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

Lombok & error-prone dont play together ? #751

Closed
javapapo opened this issue Sep 17, 2017 · 1 comment
Closed

Lombok & error-prone dont play together ? #751

javapapo opened this issue Sep 17, 2017 · 1 comment

Comments

@javapapo
Copy link

Hello I tried to use error-prone (through Maven) on a small Java project that among other things uses Project Lombok. I think, error-prone and Lombok are not verified to work together?

/Users/javapapo/dev/onsale/onsale-backend/src/main/java/com/project/Person.java:7: error: An unhandled exception was thrown by the Error Prone static analysis plugin.
@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)
  	at com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1425)
  	at com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1374)
  	at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:973)
  	at com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0(JavacTaskImpl.java:100)
  	at com.sun.tools.javac.api.JavacTaskImpl.handleExceptions(JavacTaskImpl.java:142)
  	at com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:96)
  	at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:90)
  	at com.google.errorprone.BaseErrorProneCompiler.run(BaseErrorProneCompiler.java:137)
  	at com.google.errorprone.BaseErrorProneCompiler.run(BaseErrorProneCompiler.java:108)
  	at com.google.errorprone.ErrorProneCompiler.run(ErrorProneCompiler.java:118)
  	at com.google.errorprone.ErrorProneCompiler.compile(ErrorProneCompiler.java:65)
  	at org.codehaus.plexus.compiler.javac.errorprone.JavacCompilerWithErrorProne$CompilerInvoker.compile(JavacCompilerWithErrorProne.java:219)
  	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  	at java.lang.reflect.Method.invoke(Method.java:498)
  	at org.codehaus.plexus.compiler.javac.errorprone.JavacCompilerWithErrorProne.performCompile(JavacCompilerWithErrorProne.java:91)
  	at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:1075)
  	at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:168)
  	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
  	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
  	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
  	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
  	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
  	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
  	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
  	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
  	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
  	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
  	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
  	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
  	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
  	at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
  	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  	at java.lang.reflect.Method.invoke(Method.java:498)
  	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
  	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
  	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
  	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
  	at org.codehaus.classworlds.Launcher.main(Launcher.java:47
@javapapo
Copy link
Author

Sorry just saw an existing issue- consider this a duplicate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant