Skip to content

Conversation

@timtebeek
Copy link
Member

@timtebeek timtebeek commented Oct 24, 2025

Seen when running against rewrite-recipe-starter, that we would remove necessary null checks because of an incomplete check.

Also reworked the logic to no longer rely on doAfterVisit but instead override visitBinary directly.

@github-project-automation github-project-automation bot moved this to In Progress in OpenRewrite Oct 24, 2025
@timtebeek timtebeek self-assigned this Oct 24, 2025
@timtebeek timtebeek marked this pull request as draft October 24, 2025 11:24
@timtebeek timtebeek marked this pull request as ready for review October 24, 2025 12:40
@timtebeek timtebeek added bug Something isn't working recipe labels Oct 24, 2025
@timtebeek timtebeek moved this from In Progress to Ready to Review in OpenRewrite Oct 24, 2025
@timtebeek timtebeek merged commit 348df07 into main Oct 24, 2025
2 checks passed
@timtebeek timtebeek deleted the fix-null-check-removal branch October 24, 2025 13:06
@github-project-automation github-project-automation bot moved this from Ready to Review to Done in OpenRewrite Oct 24, 2025
mergify bot added a commit to robfrank/linklift that referenced this pull request Nov 10, 2025
… 2.20.0 to 2.21.0 [skip ci]

Bumps [org.openrewrite.recipe:rewrite-static-analysis](https://github.com/openrewrite/rewrite-static-analysis) from 2.20.0 to 2.21.0.
Release notes

*Sourced from [org.openrewrite.recipe:rewrite-static-analysis's releases](https://github.com/openrewrite/rewrite-static-analysis/releases).*

> 2.21.0
> ------
>
> What's Changed
> --------------
>
> * Retain necessary null checks in EqualsAvoidsNull by [`@​timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-static-analysis#761](https://redirect.github.com/openrewrite/rewrite-static-analysis/pull/761)
> * Fix RemoveUnusedLocalVariables producing invalid pattern matching code by [`@​timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-static-analysis#762](https://redirect.github.com/openrewrite/rewrite-static-analysis/pull/762)
> * Use constructor changed in rewrite-core by [`@​Jenson3210`](https://github.com/Jenson3210) in [openrewrite/rewrite-static-analysis#763](https://redirect.github.com/openrewrite/rewrite-static-analysis/pull/763)
> * Add recipe to reorder annotation attributes by [`@​timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-static-analysis#764](https://redirect.github.com/openrewrite/rewrite-static-analysis/pull/764)
> * Gradle 9.2.0 by [`@​timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-static-analysis#766](https://redirect.github.com/openrewrite/rewrite-static-analysis/pull/766)
> * Improve `CovariantEquals` for kotlin by [`@​Laurens-W`](https://github.com/Laurens-W) in [openrewrite/rewrite-static-analysis#765](https://redirect.github.com/openrewrite/rewrite-static-analysis/pull/765)
> * Limit `RemoveSystemOutPrintln` to `System.out` and `System.err` by [`@​timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-static-analysis#770](https://redirect.github.com/openrewrite/rewrite-static-analysis/pull/770)
> * Replace empty String concatenation with `String.valueOf()` by [`@​timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-static-analysis#634](https://redirect.github.com/openrewrite/rewrite-static-analysis/pull/634)
>
> **Full Changelog**: <openrewrite/rewrite-static-analysis@v2.20.0...v2.21.0>


Commits

* [`809c783`](openrewrite/rewrite-static-analysis@809c783) OpenRewrite recipe best practices
* [`5b24d07`](openrewrite/rewrite-static-analysis@5b24d07) Replace empty String concatenation with `String.valueOf()` ([#634](https://redirect.github.com/openrewrite/rewrite-static-analysis/issues/634))
* [`28b02de`](openrewrite/rewrite-static-analysis@28b02de) Limit `RemoveSystemOutPrintln` to `System.out` and `System.err` ([#770](https://redirect.github.com/openrewrite/rewrite-static-analysis/issues/770))
* [`475af6c`](openrewrite/rewrite-static-analysis@475af6c) Improve `CovariantEquals` for kotlin ([#765](https://redirect.github.com/openrewrite/rewrite-static-analysis/issues/765))
* [`a150aaa`](openrewrite/rewrite-static-analysis@a150aaa) Drop `@InlineMe`
* [`b8a504e`](openrewrite/rewrite-static-analysis@b8a504e) Avoid NPE on `record.getClazz()`
* [`ef0b38b`](openrewrite/rewrite-static-analysis@ef0b38b) Gradle 9.2.0 ([#766](https://redirect.github.com/openrewrite/rewrite-static-analysis/issues/766))
* [`d0e7953`](openrewrite/rewrite-static-analysis@d0e7953) Add recipe to reorder annotation attributes ([#764](https://redirect.github.com/openrewrite/rewrite-static-analysis/issues/764))
* [`2361f89`](openrewrite/rewrite-static-analysis@2361f89) Use constructor changed in rewrite-core ([#763](https://redirect.github.com/openrewrite/rewrite-static-analysis/issues/763))
* [`3ca1f7d`](openrewrite/rewrite-static-analysis@3ca1f7d) Fix RemoveUnusedLocalVariables producing invalid pattern matching code ([#762](https://redirect.github.com/openrewrite/rewrite-static-analysis/issues/762))
* Additional commits viewable in [compare view](openrewrite/rewrite-static-analysis@v2.20.0...v2.21.0)
  
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility\_score?dependency-name=org.openrewrite.recipe:rewrite-static-analysis&package-manager=maven&previous-version=2.20.0&new-version=2.21.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
Dependabot commands and options
  
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show  ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working recipe

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants