Skip to content

Conversation

@zakaria-shahen
Copy link
Contributor

What version of OpenRewrite are you using?

I build it locally, last commit id is c24a7a6

What is the smallest, simplest way to reproduce the problem?

public record Foo(String id) {
	public Foo {
		if (id == null || id.isBlank()) {
			throw new IllegalArgumentException("ID cannot be null or blank");
		}
	}
}

What did you expect to see?

no change

What did you see instead?

Caused by: java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
	at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:100)
	at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:106)
	at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:302)
	at java.base/java.util.Objects.checkIndex(Objects.java:385)
	at java.base/java.util.ArrayList.get(ArrayList.java:427)
	at org.openrewrite.java.migrate.lombok.LombokUtils.isGetter(LombokUtils.java:42)

Copy link
Member

@timtebeek timtebeek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick fix!

@github-project-automation github-project-automation bot moved this from In Progress to Ready to Review in OpenRewrite Dec 11, 2025
@timtebeek timtebeek merged commit d7b0867 into openrewrite:main Dec 11, 2025
2 checks passed
@github-project-automation github-project-automation bot moved this from Ready to Review to Done in OpenRewrite Dec 11, 2025
@timtebeek timtebeek added bug Something isn't working lombok labels Dec 11, 2025
mergify bot added a commit to robfrank/linklift that referenced this pull request Dec 22, 2025
…23.0 to 3.24.0 [skip ci]

Bumps [org.openrewrite.recipe:rewrite-migrate-java](https://github.com/openrewrite/rewrite-migrate-java) from 3.23.0 to 3.24.0.
Release notes

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

> 3.24.0
> ------
>
> What's Changed
> --------------
>
> * Migrate to `jakarta.mail-api:2.1.x` as part of Jakarta EE 10 upgrade by [`@​ChenyuWang98`](https://github.com/ChenyuWang98) in [openrewrite/rewrite-migrate-java#954](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/954)
> * Lombok: add `onMethod_` argument If getter/setter method is annotated by [`@​zakaria-shahen`](https://github.com/zakaria-shahen) in [openrewrite/rewrite-migrate-java#955](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/955)
> * UseLombokGetter recipe: fix `IndexOutOfBoundsException` that occurs when visiting `record` compact constructor method by [`@​zakaria-shahen`](https://github.com/zakaria-shahen) in [openrewrite/rewrite-migrate-java#956](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/956)
> * Reorder `maybeRemoveImport` before `maybeAddImport` by [`@​timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-migrate-java#957](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/957)
> * Avoid opinionated empty EnumSet where included with Java 6+ upgrades by [`@​timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-migrate-java#959](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/959)
>
> New Contributors
> ----------------
>
> * [`@​zakaria-shahen`](https://github.com/zakaria-shahen) made their first contribution in [openrewrite/rewrite-migrate-java#955](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/955)
>
> **Full Changelog**: <openrewrite/rewrite-migrate-java@v3.23.0...v3.24.0>


Commits

* [`7592e24`](openrewrite/rewrite-migrate-java@7592e24) Do not include `UseEnumSetOf` with chained Java upgrades
* [`195efc5`](openrewrite/rewrite-migrate-java@195efc5) Avoid opinionated empty EnumSet by default ([#959](https://redirect.github.com/openrewrite/rewrite-migrate-java/issues/959))
* [`6bcd03a`](openrewrite/rewrite-migrate-java@6bcd03a) Reorder `maybeRemoveImport` before `maybeAddImport` ([#957](https://redirect.github.com/openrewrite/rewrite-migrate-java/issues/957))
* [`4a873ab`](openrewrite/rewrite-migrate-java@4a873ab) [Auto] SDKMAN! Java candidates as of 2025-12-15T1020
* [`d7b0867`](openrewrite/rewrite-migrate-java@d7b0867) UseLombokGetter recipe: fix `IndexOutOfBoundsException` that occurs when visi...
* [`c24a7a6`](openrewrite/rewrite-migrate-java@c24a7a6) Lombok: add `onMethod_` argument If getter/setter method is annotated ([#955](https://redirect.github.com/openrewrite/rewrite-migrate-java/issues/955))
* [`937bf9b`](openrewrite/rewrite-migrate-java@937bf9b) Migrate to `jakarta.mail-api:2.1.x` as part of Jakarta EE 10 upgrade ([#954](https://redirect.github.com/openrewrite/rewrite-migrate-java/issues/954))
* [`073965a`](openrewrite/rewrite-migrate-java@073965a) [Auto] SDKMAN! Java candidates as of 2025-12-08T1018
* See full diff in [compare view](openrewrite/rewrite-migrate-java@v3.23.0...v3.24.0)
  
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility\_score?dependency-name=org.openrewrite.recipe:rewrite-migrate-java&package-manager=maven&previous-version=3.23.0&new-version=3.24.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 lombok

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants