error-prone icon indicating copy to clipboard operation
error-prone copied to clipboard

IllegalArgumentException thrown from UnusedMethod BugPattern in 2.12.1 @ JDK 17

Open mdindoffer opened this issue 3 years ago • 0 comments

   error-prone version: 2.12.1
   BugPattern: UnusedMethod
   Stack Trace:
   java.lang.IllegalArgumentException: Cannot edit synthetic AST nodes
	at com.google.errorprone.fixes.SuggestedFix$Builder.checkNotSyntheticConstructor(SuggestedFix.java:341)
	at com.google.errorprone.fixes.SuggestedFix$Builder.postfixWith(SuggestedFix.java:248)
	at com.google.errorprone.bugpatterns.UnusedMethod.fixConstructors(UnusedMethod.java:365)
	at com.google.errorprone.bugpatterns.UnusedMethod.matchCompilationUnit(UnusedMethod.java:331)
	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: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)
$ java --version
openjdk 17.0.2 2022-01-18
OpenJDK Runtime Environment Temurin-17.0.2+8 (build 17.0.2+8)
OpenJDK 64-Bit Server VM Temurin-17.0.2+8 (build 17.0.2+8, mixed mode, sharing)

There is no clear indication which line in the source is causing the problems. The compilation failed on line nr. 1 of the file: /home/user/.../RestService.java:[1] error: An unhandled exception was thrown by the Error Prone static analysis plugin. Unfortunately I can't share the entire class's source code.

mdindoffer avatar Apr 06 '22 08:04 mdindoffer