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-static-analysis
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.34.0
Choose a base ref
...
head repository: openrewrite/rewrite-static-analysis
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.34.1
Choose a head ref
  • 10 commits
  • 23 files changed
  • 4 contributors

Commits on Apr 28, 2026

  1. Preserve statement order in UseTryWithResources (#866)

    Refuse to merge a `close()` into try-with-resources when non-close
    statements precede it in the finally block. Try-with-resources runs the
    auto-close before the finally, so those statements would otherwise move
    from before to after the close, changing semantics.
    timtebeek authored Apr 28, 2026
    Configuration menu
    Copy the full SHA
    ab8ff8d View commit details
    Browse the repository at this point in the history
  2. Skip meta-annotated @Configuration in FinalClass and `HideUtility…

    …ClassConstructor` (#867)
    
    Enables meta-annotation matching so classes annotated with `@TestConfiguration`,
    `@SpringBootApplication`, and any user-defined stereotype layered on top of
    `@Configuration` are also skipped.
    timtebeek authored Apr 28, 2026
    Configuration menu
    Copy the full SHA
    d3e09e9 View commit details
    Browse the repository at this point in the history

Commits on Apr 29, 2026

  1. Configuration menu
    Copy the full SHA
    98d350e View commit details
    Browse the repository at this point in the history

Commits on Apr 30, 2026

  1. OpenRewrite recipe best practices (#869)

    * OpenRewrite recipe best practices
    
    Use this link to re-run the recipe: https://app.moderne.io/recipes/org.openrewrite.recipes.rewrite.OpenRewriteRecipeBestPractices?organizationId=QUxML01vZGVybmUvTW9kZXJuZSArIE9wZW5SZXdyaXRl
    
    Co-authored-by: Moderne <team@moderne.io>
    
    * Use rewrite-java-25 test runtime, revert preview-feature unnamed lambda parameters
    
    `_` unnamed variables are still a preview feature when compiled
    without `--enable-preview`, so the recipe-best-practices run that
    introduced `_ ->` broke `compileTestJava`. Revert those two lambda
    parameters back to `cu ->` and bump the test runtime parser to
    rewrite-java-25.
    
    ---------
    
    Co-authored-by: Moderne <team@moderne.io>
    timtebeek and TeamModerne authored Apr 30, 2026
    Configuration menu
    Copy the full SHA
    30a60ba View commit details
    Browse the repository at this point in the history

Commits on May 1, 2026

  1. Configuration menu
    Copy the full SHA
    9f02852 View commit details
    Browse the repository at this point in the history

Commits on May 4, 2026

  1. Preserve casts pinning generic-method return type in lambdas (#872)

    Without the cast, calls like `<T extends SourceFile> T withSourcePath(Path)`
    inside a lambda lose `T` to its bound during outer inference (e.g.
    `Optional.map(...).ifPresent(generated::add)`), causing compilation errors.
    
    Fixes #871
    timtebeek authored May 4, 2026
    Configuration menu
    Copy the full SHA
    d2bf703 View commit details
    Browse the repository at this point in the history

Commits on May 5, 2026

  1. Preserve (Object) bridge cast for unchecked generic casts (#876)

    * Preserve `(Object)` bridge cast for unchecked generic casts
    
    When a cast is wrapped by another cast and neither the outer cast type
    nor the inner expression type are assignable to one another, the inner
    cast is acting as a bridge for an unchecked generic conversion (e.g.
    `(List<String>) (Object) values`). Removing it leaves a direct cast
    that does not compile.
    
    * Always preserve a cast nested inside another cast
    
    The earlier "neither type assignable to the other" check leaves room for
    edge cases. If a developer wrote two casts they almost always had a
    reason — bridge cast, primitive widen-then-narrow, controlling overload
    resolution — so just preserve. Also skip both `J.Parentheses` and
    `J.ControlParentheses` when walking up so parenthesized variants are
    covered.
    timtebeek authored May 5, 2026
    Configuration menu
    Copy the full SHA
    209f642 View commit details
    Browse the repository at this point in the history
  2. Skip Objects::nonNull/isNull when lambda parameter does not match (

    …#875)
    
    The recipe previously transformed `() -> field != null` into
    `Objects::nonNull` even when the lambda had no parameter or the null
    check referred to a captured field rather than the lambda parameter,
    producing code that no longer compiled.
    timtebeek authored May 5, 2026
    Configuration menu
    Copy the full SHA
    095656f View commit details
    Browse the repository at this point in the history

Commits on May 6, 2026

  1. Add regression tests for ReplaceStackWithDeque against `ControlFlow…

    …` crashes (#879)
    
    Two minimized repros for the `ControlFlowIllegalStateException`s observed in
    flagship runs against `moderneinc/moderne-intellij-plugin` (Kotlin),
    `moderneinc/rewrite-sql`, and `openrewrite/rewrite-templating`:
    
    - Anonymous class body containing multiple methods whose bodies returned
      (Java) — `No current node!`.
    - Kotlin expression-body function whose `||` operands are Boolean-typed
      (`kotlin.Boolean`) — `Condition Node is not a guard!`.
    
    The underlying analyzer fix lives in `openrewrite/rewrite-analysis`. The
    Kotlin test ends up replacing `Stack` with `Deque` because the function only
    returns the boolean, not the stack — so we just assert that the recipe runs
    to completion.
    knutwannheden authored May 6, 2026
    Configuration menu
    Copy the full SHA
    d8acf8b View commit details
    Browse the repository at this point in the history
  2. Skip SimplifyConsecutiveAssignments when initializer would self-ref…

    …erence (#882)
    
    When the first statement is a variable declaration and the following
    compound assignment's right-hand side references the variable being
    declared, folding produced an initializer that read the variable before
    it was assigned, e.g. `int result = state ^ result >>> 1;`.
    timtebeek authored May 6, 2026
    Configuration menu
    Copy the full SHA
    7ba220a View commit details
    Browse the repository at this point in the history
Loading