You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running Error Prone 2.21.0 on a project using Lombok, generated synthetic nodes with overlapping source offsets are causing a crash in Error Prone's NotJavadoc check.
And then run ./gradlew :test-java-lib-lombok:compileJava. When building on either JDK 11 or JDK 17 I get this crash:
NullAway/test-java-lib-lombok/src/main/java/com/uber/lombok/LombokDTO.java:23: error: An unhandled exception was thrown by the Error Prone static analysis plugin.
package com.uber.lombok;
^
Please report this at https://github.com/google/error-prone/issues/new and include the following:
error-prone version: 2.21.0
BugPattern: NotJavadoc
Stack Trace:
java.lang.IllegalArgumentException: Overlapping ranges not permitted but found [1233..1241] overlapping [1233..1241]
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:445)
at com.google.common.collect.ImmutableRangeSet$Builder.build(ImmutableRangeSet.java:807)
at com.google.errorprone.bugpatterns.BugChecker.suppressedRegions(BugChecker.java:321)
at com.google.errorprone.bugpatterns.javadoc.NotJavadoc.matchCompilationUnit(NotJavadoc.java:62)
at com.google.errorprone.scanner.ErrorProneScanner.processMatchers(ErrorProneScanner.java:449)
at com.google.errorprone.scanner.ErrorProneScanner.visitCompilationUnit(ErrorProneScanner.java:555)
at com.google.errorprone.scanner.ErrorProneScanner.visitCompilationUnit(ErrorProneScanner.java:150)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:591)
at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:56)
at com.google.errorprone.scanner.Scanner.scan(Scanner.java:58)
at com.google.errorprone.scanner.ErrorProneScannerTransformer.apply(ErrorProneScannerTransformer.java:43)
at com.google.errorprone.ErrorProneAnalyzer.finished(ErrorProneAnalyzer.java:156)
at jdk.compiler/com.sun.tools.javac.api.MultiTaskListener.finished(MultiTaskListener.java:132)
[...]
The same crash reproduces with the latest Lombok release, 1.18.28.
Expected behavior
No crash.
Version info (please complete the following information):
Lombok version 1.18.28
JDK 11 or 17 javac, Error Prone 2.21.0
Additional context
Reported on the Error Prone issue tracker at google/error-prone#4040. I believe Lombok tries to generate valid source offsets now, so hopefully this can be fixed on the Lombok side.
The text was updated successfully, but these errors were encountered:
Every generated method/field gets the position of the annotation that triggers the generation. If there are multiple methods they all end up with the same source range. I don't know that there is a better solution for this, if you have one in your mind please let me know.
I think the best solution is to tell error prone to ignore generate stuff.
Thanks for looking into this. The specific Error Prone crash this was causing got fixed in that checker. I feel like this kind of thing may creep up again in the future, but I don't know how complicated it would be to generate non-overlapping source ranges in these cases, and I don't have a specific suggestion there.
Describe the bug
When running Error Prone 2.21.0 on a project using Lombok, generated synthetic nodes with overlapping source offsets are causing a crash in Error Prone's NotJavadoc check.
To Reproduce
To repro, check out this branch:
https://github.com/msridhar/NullAway/tree/not-javadoc-lombok-crash-repro
And then run
./gradlew :test-java-lib-lombok:compileJava
. When building on either JDK 11 or JDK 17 I get this crash:The same crash reproduces with the latest Lombok release, 1.18.28.
Expected behavior
No crash.
Version info (please complete the following information):
Additional context
Reported on the Error Prone issue tracker at google/error-prone#4040. I believe Lombok tries to generate valid source offsets now, so hopefully this can be fixed on the Lombok side.
The text was updated successfully, but these errors were encountered: