-
Notifications
You must be signed in to change notification settings - Fork 751
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
Lombok causes an IndexOutOfBoundsException - FallThrough on @Builder #2575
Labels
Comments
Got rid of error when refactored "@Singular" usage out. |
j-sandy
pushed a commit
to j-sandy/orca
that referenced
this issue
Nov 24, 2021
While building orca with upgraded spring boot version 2.3.12, google error-prone package throwing IndexOutOfBoundException as given below: orca/orca-api/src/main/java/com/netflix/spinnaker/orca/api/pipeline/TaskResult.java:32: error: An unhandled exception was thrown by the Error Prone static analysis plugin. @builder ^ Please report this at https://github.com/google/error-prone/issues/new and include the following: error-prone version: 2.4.0 BugPattern: FallThrough Stack Trace: java.lang.IndexOutOfBoundsException at java.base/java.nio.HeapCharBuffer.subSequence(HeapCharBuffer.java:633) at java.base/java.nio.HeapCharBuffer.subSequence(HeapCharBuffer.java:41) at com.google.errorprone.bugpatterns.FallThrough.matchSwitch(FallThrough.java:70) at com.google.errorprone.scanner.ErrorProneScanner.processMatchers(ErrorProneScanner.java:451) at com.google.errorprone.scanner.ErrorProneScanner.visitSwitch(ErrorProneScanner.java:825) at com.google.errorprone.scanner.ErrorProneScanner.visitSwitch(ErrorProneScanner.java:152) at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCSwitch.accept(JCTree.java:1229) at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82) The error is due to Lombok lib upgrade from 1.18.16 to 1.18.20 as transitive dependency of Spring boot. Similar to the issue mentioned below google/error-prone#2575 Fix: To remove @Singular annotation from classes using Lombok builder pattern. Reference: projectlombok/lombok#2221
j-sandy
pushed a commit
to j-sandy/orca
that referenced
this issue
Nov 24, 2021
While building orca with upgraded spring boot version 2.3.12, google error-prone package throwing IndexOutOfBoundException as given below: orca/orca-api/src/main/java/com/netflix/spinnaker/orca/api/pipeline/TaskResult.java:32: error: An unhandled exception was thrown by the Error Prone static analysis plugin. @builder ^ Please report this at https://github.com/google/error-prone/issues/new and include the following: error-prone version: 2.4.0 BugPattern: FallThrough Stack Trace: java.lang.IndexOutOfBoundsException at java.base/java.nio.HeapCharBuffer.subSequence(HeapCharBuffer.java:633) at java.base/java.nio.HeapCharBuffer.subSequence(HeapCharBuffer.java:41) at com.google.errorprone.bugpatterns.FallThrough.matchSwitch(FallThrough.java:70) at com.google.errorprone.scanner.ErrorProneScanner.processMatchers(ErrorProneScanner.java:451) at com.google.errorprone.scanner.ErrorProneScanner.visitSwitch(ErrorProneScanner.java:825) at com.google.errorprone.scanner.ErrorProneScanner.visitSwitch(ErrorProneScanner.java:152) at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCSwitch.accept(JCTree.java:1229) at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82) The error is due to Lombok lib upgrade from 1.18.16 to 1.18.20 as transitive dependency of Spring boot. Similar to the issue mentioned below google/error-prone#2575 Fix: To remove @Singular annotation from classes using Lombok builder pattern. Reference: projectlombok/lombok#2221
j-sandy
pushed a commit
to j-sandy/orca
that referenced
this issue
Nov 24, 2021
While building orca with upgraded spring boot version 2.3.12, google error-prone package throwing IndexOutOfBoundException as given below: orca/orca-api/src/main/java/com/netflix/spinnaker/orca/api/pipeline/TaskResult.java:32: error: An unhandled exception was thrown by the Error Prone static analysis plugin. @builder ^ Please report this at https://github.com/google/error-prone/issues/new and include the following: error-prone version: 2.4.0 BugPattern: FallThrough Stack Trace: java.lang.IndexOutOfBoundsException at java.base/java.nio.HeapCharBuffer.subSequence(HeapCharBuffer.java:633) at java.base/java.nio.HeapCharBuffer.subSequence(HeapCharBuffer.java:41) at com.google.errorprone.bugpatterns.FallThrough.matchSwitch(FallThrough.java:70) at com.google.errorprone.scanner.ErrorProneScanner.processMatchers(ErrorProneScanner.java:451) at com.google.errorprone.scanner.ErrorProneScanner.visitSwitch(ErrorProneScanner.java:825) at com.google.errorprone.scanner.ErrorProneScanner.visitSwitch(ErrorProneScanner.java:152) at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCSwitch.accept(JCTree.java:1229) at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82) The error is due to Lombok lib upgrade from 1.18.16 to 1.18.20 as transitive dependency of Spring boot. Similar to the issue mentioned below google/error-prone#2575 Fix: To remove @Singular annotation from classes using Lombok builder pattern. Reference: projectlombok/lombok#2221
j-sandy
added a commit
to j-sandy/orca
that referenced
this issue
Nov 24, 2021
While building orca with upgraded spring boot version 2.3.12, google error-prone package throwing IndexOutOfBoundException as given below: orca/orca-api/src/main/java/com/netflix/spinnaker/orca/api/pipeline/TaskResult.java:32: error: An unhandled exception was thrown by the Error Prone static analysis plugin. @builder ^ Please report this at https://github.com/google/error-prone/issues/new and include the following: error-prone version: 2.4.0 BugPattern: FallThrough Stack Trace: java.lang.IndexOutOfBoundsException at java.base/java.nio.HeapCharBuffer.subSequence(HeapCharBuffer.java:633) at java.base/java.nio.HeapCharBuffer.subSequence(HeapCharBuffer.java:41) at com.google.errorprone.bugpatterns.FallThrough.matchSwitch(FallThrough.java:70) at com.google.errorprone.scanner.ErrorProneScanner.processMatchers(ErrorProneScanner.java:451) at com.google.errorprone.scanner.ErrorProneScanner.visitSwitch(ErrorProneScanner.java:825) at com.google.errorprone.scanner.ErrorProneScanner.visitSwitch(ErrorProneScanner.java:152) at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCSwitch.accept(JCTree.java:1229) at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82) The error is due to Lombok lib upgrade from 1.18.16 to 1.18.20 as transitive dependency of Spring boot. Similar to the issue mentioned below google/error-prone#2575 Fix: To remove @Singular annotation from classes using Lombok builder pattern. Reference: projectlombok/lombok#2221
j-sandy
added a commit
to j-sandy/orca
that referenced
this issue
Nov 24, 2021
While building orca with upgraded spring boot version 2.3.12, google error-prone package throwing IndexOutOfBoundException as given below: orca/orca-api/src/main/java/com/netflix/spinnaker/orca/api/pipeline/TaskResult.java:32: error: An unhandled exception was thrown by the Error Prone static analysis plugin. @builder ^ Please report this at https://github.com/google/error-prone/issues/new and include the following: error-prone version: 2.4.0 BugPattern: FallThrough Stack Trace: java.lang.IndexOutOfBoundsException at java.base/java.nio.HeapCharBuffer.subSequence(HeapCharBuffer.java:633) at java.base/java.nio.HeapCharBuffer.subSequence(HeapCharBuffer.java:41) at com.google.errorprone.bugpatterns.FallThrough.matchSwitch(FallThrough.java:70) at com.google.errorprone.scanner.ErrorProneScanner.processMatchers(ErrorProneScanner.java:451) at com.google.errorprone.scanner.ErrorProneScanner.visitSwitch(ErrorProneScanner.java:825) at com.google.errorprone.scanner.ErrorProneScanner.visitSwitch(ErrorProneScanner.java:152) at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCSwitch.accept(JCTree.java:1229) at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82) The error is due to Lombok lib upgrade from 1.18.16 to 1.18.20 as transitive dependency of Spring boot. Similar to the issue mentioned below google/error-prone#2575 Fix: To remove @Singular annotation from classes using Lombok builder pattern. Reference: projectlombok/lombok#2221
j-sandy
added a commit
to j-sandy/orca
that referenced
this issue
Nov 26, 2021
While building orca with upgraded spring boot version 2.3.12, google error-prone package throwing IndexOutOfBoundException as given below: orca/orca-api/src/main/java/com/netflix/spinnaker/orca/api/pipeline/TaskResult.java:32: error: An unhandled exception was thrown by the Error Prone static analysis plugin. @builder ^ Please report this at https://github.com/google/error-prone/issues/new and include the following: error-prone version: 2.4.0 BugPattern: FallThrough Stack Trace: java.lang.IndexOutOfBoundsException at java.base/java.nio.HeapCharBuffer.subSequence(HeapCharBuffer.java:633) at java.base/java.nio.HeapCharBuffer.subSequence(HeapCharBuffer.java:41) at com.google.errorprone.bugpatterns.FallThrough.matchSwitch(FallThrough.java:70) at com.google.errorprone.scanner.ErrorProneScanner.processMatchers(ErrorProneScanner.java:451) at com.google.errorprone.scanner.ErrorProneScanner.visitSwitch(ErrorProneScanner.java:825) at com.google.errorprone.scanner.ErrorProneScanner.visitSwitch(ErrorProneScanner.java:152) at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCSwitch.accept(JCTree.java:1229) at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82) The error is due to Lombok lib upgrade from 1.18.16 to 1.18.20 as transitive dependency of Spring boot. Similar to the issue mentioned below google/error-prone#2575 Further investigation reveal that bug pattern "FallThrough" for lombok annotations (like @Singular) could be a false positive, because Lombok modifies the AST on the fly causing trouble to errorprone checks, as mentioned in below issue and PR. google/error-prone#613 google/error-prone#1573 Considering the above points, we can suppress warning of "FallThrough" bug pattern reported by errorprone for @Builder/@Singular annotations.
mergify bot
pushed a commit
to spinnaker/orca
that referenced
this issue
Nov 29, 2021
…#4194) * Remove @Singular annotation While building orca with upgraded spring boot version 2.3.12, google error-prone package throwing IndexOutOfBoundException as given below: orca/orca-api/src/main/java/com/netflix/spinnaker/orca/api/pipeline/TaskResult.java:32: error: An unhandled exception was thrown by the Error Prone static analysis plugin. @builder ^ Please report this at https://github.com/google/error-prone/issues/new and include the following: error-prone version: 2.4.0 BugPattern: FallThrough Stack Trace: java.lang.IndexOutOfBoundsException at java.base/java.nio.HeapCharBuffer.subSequence(HeapCharBuffer.java:633) at java.base/java.nio.HeapCharBuffer.subSequence(HeapCharBuffer.java:41) at com.google.errorprone.bugpatterns.FallThrough.matchSwitch(FallThrough.java:70) at com.google.errorprone.scanner.ErrorProneScanner.processMatchers(ErrorProneScanner.java:451) at com.google.errorprone.scanner.ErrorProneScanner.visitSwitch(ErrorProneScanner.java:825) at com.google.errorprone.scanner.ErrorProneScanner.visitSwitch(ErrorProneScanner.java:152) at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCSwitch.accept(JCTree.java:1229) at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82) The error is due to Lombok lib upgrade from 1.18.16 to 1.18.20 as transitive dependency of Spring boot. Similar to the issue mentioned below google/error-prone#2575 Fix: To remove @Singular annotation from classes using Lombok builder pattern. Reference: projectlombok/lombok#2221 * Revert "Remove @Singular annotation" This reverts commit e0d57a2. * Suppress warning for "FallThrough" bug pattern reported by errorprone While building orca with upgraded spring boot version 2.3.12, google error-prone package throwing IndexOutOfBoundException as given below: orca/orca-api/src/main/java/com/netflix/spinnaker/orca/api/pipeline/TaskResult.java:32: error: An unhandled exception was thrown by the Error Prone static analysis plugin. @builder ^ Please report this at https://github.com/google/error-prone/issues/new and include the following: error-prone version: 2.4.0 BugPattern: FallThrough Stack Trace: java.lang.IndexOutOfBoundsException at java.base/java.nio.HeapCharBuffer.subSequence(HeapCharBuffer.java:633) at java.base/java.nio.HeapCharBuffer.subSequence(HeapCharBuffer.java:41) at com.google.errorprone.bugpatterns.FallThrough.matchSwitch(FallThrough.java:70) at com.google.errorprone.scanner.ErrorProneScanner.processMatchers(ErrorProneScanner.java:451) at com.google.errorprone.scanner.ErrorProneScanner.visitSwitch(ErrorProneScanner.java:825) at com.google.errorprone.scanner.ErrorProneScanner.visitSwitch(ErrorProneScanner.java:152) at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCSwitch.accept(JCTree.java:1229) at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82) The error is due to Lombok lib upgrade from 1.18.16 to 1.18.20 as transitive dependency of Spring boot. Similar to the issue mentioned below google/error-prone#2575 Further investigation reveal that bug pattern "FallThrough" for lombok annotations (like @Singular) could be a false positive, because Lombok modifies the AST on the fly causing trouble to errorprone checks, as mentioned in below issue and PR. google/error-prone#613 google/error-prone#1573 Considering the above points, we can suppress warning of "FallThrough" bug pattern reported by errorprone for @Builder/@Singular annotations.
Please re-open this or file a new bug if you're still seeing issues with Lombok and Error Prone 2.13.0 when |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Not sure that class itself helps much, but here it is:
The text was updated successfully, but these errors were encountered: