Closed davidmontoyago closed 7 years ago
I'm experiencing the same issue. I do not include the stack trace as it's identical.
------------------------------------------------------------
Gradle 4.0.2
------------------------------------------------------------
Build time: 2017-07-26 15:04:56 UTC
Revision: 108c593aa7b43852f39045337ee84ee1d87c87fd
Groovy: 2.4.11
Ant: Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM: 1.8.0_131 (Oracle Corporation 25.131-b11)
OS: Windows 10 10.0 amd64
error-prone version: 2.0.21
lombok version: 1.16.18
Thanks for the report. Can you provide a self-contained example that reproduces the crash?
Issue is still present in 2.1.1. If you replace @Data
with
@RequiredArgsConstructor
@EqualsAndHashCode
It blows up. Specifically it seems like the issue is due to @EqualsAndHashCode
.
This makes Lombok and Error Prone a non-starter. Are there any updates on workarounds / fixing this?
A fix is in progress.
You can disable the crashing check as a work-around: -Xep:NestedInstanceOfConditions:OFF
(Another option is to use @AutoValue
to generate value classes instead of Lombok.)
-Xep:NestedInstanceOfConditions:OFF
didn't work for me. I'll have to try out the fix once it's released.
Thanks @cushon!
has the fix been released ? What's the targeted version?
BTW lombok @Slf4j annotation also break stuff
Continues to happen.
+1 happens to me as well
+1
@Data ^ Please report this at https://github.com/google/error-prone/issues/new and include the following:
error-prone version: 2.1.1
Stack Trace:
java.lang.ClassCastException: com.sun.tools.javac.tree.JCTree$JCBinary cannot be cast to com.sun.source.tree.ParenthesizedTree
at com.google.errorprone.bugpatterns.NestedInstanceOfConditions.matchIf(NestedInstanceOfConditions.java:53)
at com.google.errorprone.scanner.ErrorProneScanner.visitIf(ErrorProneScanner.java:752)
at com.google.errorprone.scanner.ErrorProneScanner.visitIf(ErrorProneScanner.java:146)
at com.sun.tools.javac.tree.JCTree$JCIf.accept(JCTree.java:1427)
at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
at com.google.errorprone.scanner.Scanner.scan(Scanner.java:82)
at com.google.errorprone.scanner.Scanner.scan(Scanner.java:42)
at com.sun.source.util.TreeScanner.scan(TreeScanner.java:105)
at com.sun.source.util.TreeScanner.visitBlock(TreeScanner.java:248)
at com.google.errorprone.scanner.ErrorProneScanner.visitBlock(ErrorProneScanner.java:530)
at com.google.errorprone.scanner.ErrorProneScanner.visitBlock(ErrorProneScanner.java:146)
at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1026)
at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
at com.google.errorprone.scanner.Scanner.scan(Scanner.java:82)
at com.google.errorprone.scanner.Scanner.scan(Scanner.java:42)
at com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:90)
at com.sun.source.util.TreeScanner.visitMethod(TreeScanner.java:206)
at com.google.errorprone.scanner.ErrorProneScanner.visitMethod(ErrorProneScanner.java:898)
at com.google.errorprone.scanner.ErrorProneScanner.visitMethod(ErrorProneScanner.java:146)
at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:898)
at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
at com.google.errorprone.scanner.Scanner.scan(Scanner.java:82)
at com.google.errorprone.scanner.Scanner.scan(Scanner.java:42)
at com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:90)
at com.sun.source.util.TreeScanner.scan(TreeScanner.java:105)
at com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:113)
at com.sun.source.util.TreeScanner.visitClass(TreeScanner.java:187)
at com.google.errorprone.scanner.ErrorProneScanner.visitClass(ErrorProneScanner.java:590)
at com.google.errorprone.scanner.ErrorProneScanner.visitClass(ErrorProneScanner.java:146)
at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:808)
at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
at com.google.errorprone.scanner.Scanner.scan(Scanner.java:82)
at com.google.errorprone.scanner.Scanner.scan(Scanner.java:42)
at com.sun.source.util.TreeScanner.scan(TreeScanner.java:105)
at com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:113)
at com.sun.source.util.TreeScanner.visitCompilationUnit(TreeScanner.java:144)
at com.google.errorprone.scanner.ErrorProneScanner.visitCompilationUnit(ErrorProneScanner.java:605)
at com.google.errorprone.scanner.ErrorProneScanner.visitCompilationUnit(ErrorProneScanner.java:146)
at com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:591)
at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:56)
at com.google.errorprone.scanner.Scanner.scan(Scanner.java:64)
at com.google.errorprone.scanner.ErrorProneScannerTransformer.apply(ErrorProneScannerTransformer.java:41)
at com.google.errorprone.ErrorProneAnalyzer.finished(ErrorProneAnalyzer.java:145)
at com.sun.tools.javac.api.MultiTaskListener.finished(MultiTaskListener.java:120)
error-prone version: 2.1.3 Continues to happen.
@wcp1231 can you file a new bug and include a self-contained example that reproduces the problem?
@wcp1231 that is a different issue: #780.
@cushon yes, when I add args -Xep:NestedInstanceOfConditions:OFF
and -Xep:ParameterName:OFF
it works.
So... It is not a bug?
It's a bug, but it's #780 and not this bug. Suppressing ParameterName
and updating the lombok version to 1.16.18 allow that example to build.
Ok, thx
Can I help?
@cushon is this issue fixed?
Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T15:39:06-04:00) Java version: 1.8.0_131, vendor: Oracle Corporation Lombok version: 1.16.16