Skip to content

Use JavaFileChecker precondition in ExtractExplicitConstructorInvocationArguments - #1337

Merged
timtebeek merged 1 commit into
mainfrom
tim/java-file-checker-precondition
Oct 24, 2026
Merged

timtebeek merged 1 commit into
mainfrom
tim/java-file-checker-precondition

Conversation

@timtebeek

Copy link
Copy Markdown
Member

ExtractExplicitConstructorInvocationArguments limited itself to Java by overriding isAcceptable on its visitor. It now states that limit as a precondition, adding new JavaFileChecker<>() next to UsesJavaVersion<>(25), as openrewrite/rewrite-testing-frameworks#1217 did for TestMethodsShouldBeVoid. Which files the recipe visits doesn't change, and the comment explaining why other JVM languages are skipped stays next to the precondition.

Verified with ./gradlew test --tests '*.ExtractExplicitConstructorInvocationArgumentsTest', running the test JVM on Java 25 (the test class is @EnabledForJreRange(min = JAVA_25), so all of it is skipped on older JDKs): all 20 pass.

@github-project-automation github-project-automation Bot moved this to In Progress in OpenRewrite Oct 24, 2026
@timtebeek
timtebeek merged commit bdff556 into main Oct 24, 2026
2 checks passed
@timtebeek
timtebeek deleted the tim/java-file-checker-precondition branch October 24, 2026 12:26
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenRewrite Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

1 participant