Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DefaultComesLastVisitor IOOBE since Java 21 changes #452

Open
Bananeweizen opened this issue Jan 24, 2025 · 0 comments
Open

DefaultComesLastVisitor IOOBE since Java 21 changes #452

Bananeweizen opened this issue Jan 24, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@Bananeweizen
Copy link
Contributor

What is the full stack trace of any errors you encountered?

java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:100)
java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:106)
java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:302)
java.base/java.util.Objects.checkIndex(Objects.java:385)
java.base/java.util.ArrayList.get(ArrayList.java:427)
org.openrewrite.staticanalysis.DefaultComesLastVisitor.isDefaultCase(DefaultComesLastVisitor.java:189)

You may want to check all senders of Case.getExpressions(). This is the same kind of bug like openrewrite/rewrite#4928 and there might be more. In my own projects leaving calls to newly deprecated (own) methods breaks the build, and thereby avoids this kind of bug. Since that's based on the Eclipse Compiler (ECJ) I can't say whether there is a similar option for your gradle build.

Are you interested in contributing a fix to OpenRewrite?

@Bananeweizen Bananeweizen added the bug Something isn't working label Jan 24, 2025
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
Status: No status
Development

No branches or pull requests

1 participant