Skip to content

Conversation

@Laurens-W
Copy link
Contributor

What's changed?

Added extra guarding against NPE

What's your motivation?

Prevent NPEs for top level functions in kotlin

Checklist

  • I've added unit tests to cover both positive and negative cases
  • I've read and applied the recipe conventions and best practices
  • I've used the IntelliJ IDEA auto-formatter on affected files

@Laurens-W Laurens-W self-assigned this Oct 29, 2025
@Laurens-W Laurens-W added the bug Something isn't working label Oct 29, 2025
@github-project-automation github-project-automation bot moved this to In Progress in OpenRewrite Oct 29, 2025
@Laurens-W Laurens-W force-pushed the covarient-equals-kotlin branch from 6fd0db8 to 6117816 Compare October 30, 2025 12:20
…qualsTest.java

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@Laurens-W Laurens-W marked this pull request as ready for review November 3, 2025 10:21
@Laurens-W Laurens-W requested a review from timtebeek November 3, 2025 12:40
@github-project-automation github-project-automation bot moved this from In Progress to Ready to Review in OpenRewrite Nov 3, 2025
@timtebeek timtebeek merged commit 475af6c into main Nov 3, 2025
2 checks passed
@timtebeek timtebeek deleted the covarient-equals-kotlin branch November 3, 2025 12:48
@github-project-automation github-project-automation bot moved this from Ready to Review to Done in OpenRewrite Nov 3, 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

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants