-
Notifications
You must be signed in to change notification settings - Fork 119
Comparing changes
Open a pull request
base repository: openrewrite/rewrite-migrate-java
base: v3.32.1
head repository: openrewrite/rewrite-migrate-java
compare: v3.33.0
- 12 commits
- 39 files changed
- 7 contributors
Commits on Apr 12, 2026
-
Configuration menu - View commit details
-
Copy full SHA for bc4a22c - Browse repository at this point
Copy the full SHA bc4a22cView commit details
Commits on Apr 13, 2026
-
Configuration menu - View commit details
-
Copy full SHA for bac7053 - Browse repository at this point
Copy the full SHA bac7053View commit details -
Add --add-opens JVM args to surefire/failsafe for Java 25 (#1055)
* Add --add-opens JVM args to surefire/failsafe for Java 25 Java 25 enforces module boundaries more strictly, causing tests that use reflection (Mockito, Spring, Hibernate) to fail without --add-opens args. Add a new AddSurefireArgLine recipe that merges --add-opens arguments into the argLine configuration of maven-surefire-plugin and maven-failsafe-plugin, and wire it into UpgradePluginsForJava25. The recipe handles plugins with no configuration, existing configuration without argLine, and existing argLine values (merging without duplicates). Fixes moderneinc/customer-requests#1821 * Gate --add-opens flags on actual dependencies using ModuleHasDependency Split the single unconditional AddSurefireArgLine invocation into three conditional wrapper recipes gated by ModuleHasDependency preconditions: - AddSurefireArgLineForMockito: Mockito/ByteBuddy flags, gated on mockito-* - AddSurefireArgLineForSpring: Spring flags, gated on spring-* - AddSurefireArgLineForNetty: Netty flags, gated on netty-* This avoids adding unnecessary --add-opens arguments to projects that don't use those frameworks. * Remove Spring and Netty --add-opens variants, keep only Mockito * Update recipes.csv with regenerated recipe counts * Rename AddSurefireArgLine to AddSurefireFailsafeArgLine, fix copyright years and formatting - Rename recipe class to better reflect that it covers both surefire and failsafe - Update copyright year to 2026 in new files - Fix extra spaces inside parentheses in recipe implementation - Update all YAML, examples, and CSV references - Regenerate recipes.csv --------- Co-authored-by: Steve Elliott <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 38caf16 - Browse repository at this point
Copy the full SHA 38caf16View commit details
Commits on Apr 14, 2026
-
Collapse UpgradeDockerImageVersion cartesian via ChangeFrom capture (#…
…1060) `getRecipeList()` previously emitted one `ChangeFrom` per (image, oldVersion, suffix) triple because `ChangeFrom.newTag` was a literal string with no template support. ~35 hard-coded suffixes × 10 image families × (version - 8) version steps produced 3,150 children per invocation at version=17 and 5,950 at version=25. `ChangeFrom` now supports glob `*` capture and `$N` backref substitution in its new* fields. Replace the suffix enumeration with a single `oldTag = "<oldVersion>*"` + `newTag = "<version>$1"` recipe per (image, oldVersion) pair. `$1` carries whatever follows the old version digits (may be empty, `-jdk-alpine`, `-jre-noble`, or any arbitrary suffix), so the rewrite preserves the full OS/jdk/jre variant without enumerating it in advance. Per-invocation child count drops from ~3,150 -> ~90 at version=17 (35x), and from ~5,950 -> ~170 at version=25. Add two parameterized test cases exercising an exotic suffix that previously only survived the now-removed wildcard fallback (and lost its suffix).
Configuration menu - View commit details
-
Copy full SHA for f1fb66d - Browse repository at this point
Copy the full SHA f1fb66dView commit details -
Configuration menu - View commit details
-
Copy full SHA for bb638a2 - Browse repository at this point
Copy the full SHA bb638a2View commit details
Commits on Apr 16, 2026
-
Support
copyOfmigration for Guava (#1062)* Add copyOf migration * recipes.csv
Configuration menu - View commit details
-
Copy full SHA for 634e7d9 - Browse repository at this point
Copy the full SHA 634e7d9View commit details -
Rename
_identifier to__for Java ≤ 8 source files (#1063)* Rename `_` identifier to `__` for Java ≤ 8 source files In Java 9+, `_` became a reserved keyword causing compile errors. This recipe renames single-underscore identifiers to double-underscore as a prerequisite migration step for projects upgrading from Java 8. Closes moderneinc/customer-requests#2221 * Extract package-private RenameIdentifierVisitor for reuse in tests Addresses review feedback: the visitor logic is now shared between the recipe and the test setup recipe via RenameIdentifierVisitor(oldName, newName). * Move RenameIdentifierVisitor to static nested class Inline the visitor as a static nested class of RenameUnderscoreIdentifier instead of a separate top-level file. * Regenerate recipes.csv * Use @requiredargsconstructor on RenameIdentifierVisitor * Use import for @requiredargsconstructor * Use @value on RenameIdentifierVisitor * Remove redundant private final modifiers on @value fields
Configuration menu - View commit details
-
Copy full SHA for 461609f - Browse repository at this point
Copy the full SHA 461609fView commit details
Commits on Apr 17, 2026
-
Fix
ClassCastExceptionon parenthesized initializers invarrecip……es (#1064) `UseVarForConstructors` and `UseVarForGenericMethodInvocations` unwrap the initializer for local `instanceof` checks but pass the original `VariableDeclarations` (still wrapping `J.Parentheses`) to downstream casts/`transformToVar`, which re-fetch and cast the raw initializer. Rewrite the declaration to use the unwrapped initializer (preserving the original prefix) before handing it off.
Configuration menu - View commit details
-
Copy full SHA for 3b7b950 - Browse repository at this point
Copy the full SHA 3b7b950View commit details
Commits on Apr 20, 2026
-
Configuration menu - View commit details
-
Copy full SHA for a471dd1 - Browse repository at this point
Copy the full SHA a471dd1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 968a22f - Browse repository at this point
Copy the full SHA 968a22fView commit details
Commits on Apr 21, 2026
-
Extract documentation examples from tests
Use this link to re-run the recipe: https://app.moderne.io/recipes/org.openrewrite.java.recipes.ExamplesExtractor?organizationId=QUxML09wZW4gU291cmNlL09wZW5SZXdyaXRl Co-authored-by: Moderne <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 0ca5cc8 - Browse repository at this point
Copy the full SHA 0ca5cc8View commit details -
Fix
MigrateCollections*template errors on complex expression conte……xts (#1067) The `MigrateCollections{Empty,Singleton,Unmodifiable}*` family applied `JavaTemplate` in `.contextSensitive()` mode. When the `Collections.emptyList()` (etc.) call sat inside a switch expression (`case 0 -> Collections.emptyList()`), a ternary branch, a method argument, or similar non-statement contexts, the block-statement stub generator in rewrite-core either produced 0 statements (for `J.SwitchExpression` parents, which it does not handle) or 2 statements (for some substitutions with method-invocation values), causing `IllegalArgumentException: Expected a template that would generate exactly one statement to replace one statement, but generated {0,2}`. Dropping `.contextSensitive()` makes these simple static-factory templates context-free, so the stub is a trivial `class Template {{ Object o = List.of(); }}` that always parses to one statement regardless of surrounding syntax. Also guard every `MigrateCollections*` recipe with `KotlinFileChecker`/`GroovyFileChecker` preconditions — consistent with `ReplaceUnusedVariablesWithUnderscore` and `IfElseIfConstructToSwitch` — since `JavaTemplate` cannot reliably target non-Java trees, and the idiomatic replacement in Kotlin (`emptyList()`) and Groovy (`[]`) isn't `List.of()` anyway.
Configuration menu - View commit details
-
Copy full SHA for eac4344 - Browse repository at this point
Copy the full SHA eac4344View commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff v3.32.1...v3.33.0