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 SuperBuilder annotation causes java.lang.IllegalArgumentException #2655

Closed
astubbs opened this issue Nov 3, 2021 · 3 comments
Closed
Labels

Comments

@astubbs
Copy link

astubbs commented Nov 3, 2021

java -version
openjdk version "17" 2021-09-14
OpenJDK Runtime Environment (build 17+35-Ubuntu-120.04)
OpenJDK 64-Bit Server VM (build 17+35-Ubuntu-120.04, mixed mode, sharing)
Caused by: org.apache.maven.plugin.compiler.CompilationFailureException: Compilation failure
/home/antony/IdeaProjects/truth-generator2/generator/src/main/java/io/stubbs/truth/generator/internal/model/MiddleClass.java:[1] error: An unhandled exception was thrown by the Error Prone static analysis plugin.
     Please report this at https://github.com/google/error-prone/issues/new and include the following:
  
     error-prone version: 2.9.0
     BugPattern: SameNameButDifferent
     Stack Trace:
     java.lang.IllegalArgumentException: Replacement{range=[310..323), replaceWith=AClass.@SuperBuilder} conflicts with existing replacement Replacement{range=[310..323), replaceWith=MiddleClass.@SuperBuilder}
  	at com.google.errorprone.fixes.Replacements.add(Replacements.java:109)
  	at com.google.errorprone.fixes.SuggestedFix.getReplacements(SuggestedFix.java:92)
  	at com.google.errorprone.fixes.AppliedFix$Applier.apply(AppliedFix.java:71)
  	at com.google.errorprone.JavacErrorDescriptionListener.lambda$new$1(JavacErrorDescriptionListener.java:86)
  	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
  	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
  	at java.base/java.util.Collections$2.tryAdvance(Collections.java:4853)
  	at java.base/java.util.Collections$2.forEachRemaining(Collections.java:4861)
  	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
  	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
  	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
  	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
  	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
  	at com.google.errorprone.JavacErrorDescriptionListener.onDescribed(JavacErrorDescriptionListener.java:99)
  	at com.google.errorprone.ErrorProneAnalyzer.lambda$finished$1(ErrorProneAnalyzer.java:137)
  	at com.google.errorprone.VisitorState.reportMatch(VisitorState.java:283)
  	at com.google.errorprone.bugpatterns.SameNameButDifferent.matchCompilationUnit(SameNameButDifferent.java:161)
  	at com.google.errorprone.scanner.ErrorProneScanner.processMatchers(ErrorProneScanner.java:450)
  	at com.google.errorprone.scanner.ErrorProneScanner.visitCompilationUnit(ErrorProneScanner.java:556)
  	at com.google.errorprone.scanner.ErrorProneScanner.visitCompilationUnit(ErrorProneScanner.java:151)
  	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:614)
  	at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:60)
  	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:152)
  	at jdk.compiler/com.sun.tools.javac.api.MultiTaskListener.finished(MultiTaskListener.java:132)
  	at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1394)
  	at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1341)
  	at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:933)
  	at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:317)
  	at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:176)
  	at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:64)
  	at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:50)

	at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:1220)
	at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:187)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
	... 10 common frames omitted

@astubbs
Copy link
Author

astubbs commented Nov 3, 2021

Perhaps related to #2273, but i can't say.

@ghilainm
Copy link

Same issue here. I have removed error-prone due to this issue.

@cushon
Copy link
Collaborator

cushon commented Apr 14, 2022

Please re-open this or file a new bug if you're still seeing issues with Lombok and Error Prone 2.13.0 when -XepDisableWarningsInGeneratedCode is enabled.

@cushon cushon closed this as completed Apr 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants