Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: openrewrite/rewrite-migrate-java
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.31.3
Choose a base ref
...
head repository: openrewrite/rewrite-migrate-java
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3.32.0
Choose a head ref
  • 16 commits
  • 57 files changed
  • 5 contributors

Commits on Mar 31, 2026

  1. Cap Java version at 24 for Kotlin <2.3 in UpgradeToJava25 (#1035)

    * Cap Java version at 24 for Kotlin <2.3 in UpgradeToJava25 (#2126)
    
    Kotlin versions before 2.3 only support up to Java 24. When running
    UpgradeToJava25 on projects with kotlin-stdlib <2.3, the Java version
    is now set to 24 instead of 25.
    
    * Use ModuleHasDependency invertMarking instead of custom ScanningRecipe
    
    Replace HasNoOldKotlinDependency with ModuleHasDependency's invertMarking
    option for detecting projects without Kotlin <2.3.
    
    * Inline Kotlin version check recipes into UpgradeToJava25
    
    Remove the intermediate UpgradeBuildToJava25 wrapper and reference
    UpgradeBuildToJava24ForOldKotlin and UpgradeBuildToJava25Default
    directly from UpgradeToJava25.
    
    * Rename UpgradeBuildToJava25Default to UpgradeBuildToJava25
    
    * Rename UpgradeBuildToJava24ForOldKotlin to UpgradeBuildToJava24
    timtebeek authored Mar 31, 2026
    Configuration menu
    Copy the full SHA
    926ea39 View commit details
    Browse the repository at this point in the history
  2. Inline JavaTemplate fields at their usage sites (#1036)

    Remove stored JavaTemplate fields in favor of inline builder chains,
    matching the recommended pattern used throughout the rest of the codebase.
    timtebeek authored Mar 31, 2026
    Configuration menu
    Copy the full SHA
    dd77a80 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    41cc6b9 View commit details
    Browse the repository at this point in the history

Commits on Apr 2, 2026

  1. Fix ClassCastException in UseVarForGenericMethodInvocations (#1039)

    Add instanceof check before casting to J.ParameterizedType in
    makeNestedGenericsExplicit(). The code assumed all NewClass clazz
    nodes are ParameterizedType, but they can also be J.Identifier
    (e.g., `new String(...)`) or J.FieldAccess (e.g., `new java.lang.String(...)`).
    knutwannheden authored Apr 2, 2026
    Configuration menu
    Copy the full SHA
    ff0c329 View commit details
    Browse the repository at this point in the history
  2. Upgrade Mockito to 5.17.x in Java 25 migration recipe (#1041)

    Mockito's inline mock maker relies on Byte Buddy, but versions before
    5.17.0 bundle a Byte Buddy that only supports classfile version 66
    (Java 22). Java 25 emits classfile version 69, causing Byte Buddy to
    abort instrumentation and Mockito to fail with "cannot mock this class".
    
    Mockito 5.17.0+ bundles Byte Buddy 1.17.6+ which supports Java 25.
    timtebeek authored Apr 2, 2026
    Configuration menu
    Copy the full SHA
    ed7df0d View commit details
    Browse the repository at this point in the history
  3. Migrate Mojarra and Glassfish JSF dependencies to Jakarta Faces (#1040)

    * Migrate Mojarra (com.sun.faces) and Glassfish JSF dependencies to Jakarta Faces
    
    The JSF 2.x to Jakarta Faces migration recipes only handled javax.faces:javax.faces-api,
    missing the widely-used Mojarra (com.sun.faces:jsf-api, com.sun.faces:jsf-impl) and
    Glassfish (org.glassfish:javax.faces) artifacts. This caused ClassCastException at runtime
    when upgrading to Spring 6 because the JSF runtime stayed on javax.el while Spring 6
    uses jakarta.el.
    
    Adds ChangeDependency rules for com.sun.faces and org.glassfish:javax.faces in the
    Faces 3.x migration, and UpgradeDependencyVersion for org.glassfish:jakarta.faces in
    the Faces 4.x migration.
    
    Fixes moderneinc/customer-requests#2160
    
    * Use assertThat(...).actual() style assertions in UpdateJakartaFacesApiTest
    timtebeek authored Apr 2, 2026
    Configuration menu
    Copy the full SHA
    2c285d5 View commit details
    Browse the repository at this point in the history
  4. Upgrade jakarta.annotation-api to 3.0.x in Jakarta EE 11 recipe (#1042)

    * Upgrade jakarta.annotation-api to 3.0.x in Jakarta EE 11 recipe
    
    The UpdateJakartaPlatform11 recipe was missing the version upgrade for
    jakarta.annotation:jakarta.annotation-api to 3.0.x, which is the
    version specified by the Jakarta EE 11 platform BOM. Jakarta EE 10
    already upgrades to 2.1.x via MigrationToJakarta10Apis.
    
    Also adds tests for JavaxAnnotationMigrationToJakartaAnnotation covering
    both the explicit dependency migration and the no-explicit-dependency
    scenarios.
    
    * Use .actual() on assertion chain in annotation migration test
    
    * Use .actual() on remaining assertion chain in annotation migration test
    timtebeek authored Apr 2, 2026
    Configuration menu
    Copy the full SHA
    276316d View commit details
    Browse the repository at this point in the history
  5. Move type-use annotations to array brackets during JSpecify migration (

    …#1038)
    
    * Move type-use annotations to array brackets during JSpecify migration (#934)
    
    * Run MoveAnnotationToArrayType before ChangeType to preserve semantics
    
    Move the recipe before ChangeType in each migration pipeline so it
    matches on the old annotation type (e.g. javax.annotation.*). This
    avoids incorrectly moving pre-existing JSpecify annotations where
    @nullable String[] intentionally means "array of nullable Strings."
    
    * Add test: pre-existing JSpecify array-of-nullable-elements is not affected
    
    Verifies that a project with both javax annotations (to migrate) and
    pre-existing JSpecify @nullable String[] (meaning array of nullable
    elements) only migrates the javax annotations without touching the
    already-correct JSpecify annotations.
    
    * Fix copyright year, use import, and early returns in MoveAnnotationToArrayType
    
    * Narrow annotation type patterns to *ull* to match only nullability annotations
    
    * Replace AtomicReference with find-then-remove using equality check
    
    * Use ListUtils.map result equality check instead of stream
    
    * Remove AtomicReference and redundant test
    
    * Capture match from ListUtils.map lambda, drop separate for loop
    
    * Update generated recipes.csv
    
    * Add test for nested class array type annotation movement
    
    * Skip MoveAnnotationToArrayType for TYPE_USE annotations
    
    Jakarta, JetBrains, and Micronaut annotations target TYPE_USE, so
    `@Nullable X[]` (element nullable) already has distinct semantics from
    `X @nullable[]` (array nullable). Moving them would change meaning.
    timtebeek authored Apr 2, 2026
    Configuration menu
    Copy the full SHA
    9e138a7 View commit details
    Browse the repository at this point in the history

Commits on Apr 6, 2026

  1. Configuration menu
    Copy the full SHA
    407e3dd View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    41373e1 View commit details
    Browse the repository at this point in the history
  3. Add explicit casts for visitor visit() return type (#1049)

    * Add explicit casts for visitor `visit()` return type
    
    The `visit()` method on OpenRewrite visitors now returns `J` rather
    than the specific subtype. Add explicit casts at affected call sites:
    - `RefineSwitchCases` — cast to `J.Switch`
    - `IfElseIfConstructToSwitch` — cast to `J.Switch`
    - `LombokValueToRecord` — cast to `J.ClassDeclaration`
    - `RemoveEmbeddableId` — cast to `J.ClassDeclaration`
    
    Also fix `MoveAnnotationToArrayType` missing `@Nullable` import by
    adding `org.jspecify.annotations.Nullable` and adjusting type-use
    annotation placement.
    
    * Revert @nullable annotation changes in MoveAnnotationToArrayType
    
    * Add missing @nullable import in MoveAnnotationToArrayType
    
    * Avoid constructor calls in RemovedModifierAndConstantBootstrapsConstructors test
    
    The core ChangeMethodTargetToStatic recipe now matches constructor calls
    with the wildcard pattern, incorrectly converting `new Modifier()` to
    `Modifier.Modifier()`. Pass instances as parameters instead to avoid
    triggering the constructor matching.
    timtebeek authored Apr 6, 2026
    Configuration menu
    Copy the full SHA
    9e118a4 View commit details
    Browse the repository at this point in the history

Commits on Apr 7, 2026

  1. Configuration menu
    Copy the full SHA
    2a56971 View commit details
    Browse the repository at this point in the history
  2. Replace Collections.emptyXXX with Immutable Static Factory Methods (#…

    …1045)
    
    * Replace Collections.emptyXXX with Immutable Static Factory Methods
    
    Closes #1044
    
    * Add Java 9+ precondition and use JavaTemplate for Collections.emptyXXX recipes
    
    * Add all util recipes to JavaUtilAPIs and reference it from best practices
    
    * Fix ReplaceMathRandomWithThreadLocalRandom recipe class name
    
    ---------
    
    Co-authored-by: Tim te Beek <[email protected]>
    mkarg and timtebeek authored Apr 7, 2026
    Configuration menu
    Copy the full SHA
    96d6dd9 View commit details
    Browse the repository at this point in the history

Commits on Apr 8, 2026

  1. Configuration menu
    Copy the full SHA
    55f801a View commit details
    Browse the repository at this point in the history
  2. Fix AddMissingMethodImplementation generating stubs for inherited m…

    …ethods (#1051)
    
    * Use `getVisibleMethods()` in `AddMissingMethodImplementation` to detect inherited methods
    
    Closes #648
    
    * Skip only concrete inherited methods, not abstract interface declarations
    timtebeek authored Apr 8, 2026
    Configuration menu
    Copy the full SHA
    fecaa2e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    2388f91 View commit details
    Browse the repository at this point in the history
Loading