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
With Bazel 7.3.1 I am seeing build failing with the following error. I can't paste the source code here since that's confidential. But the line being reported is inside an enum declaration with dozens of enum value declarations. Specifically, line 219 is one enun declaration with some values from some method calls passed into the constructor. Please let me know if you need more details.
[2024-08-26T20:02:27.860Z] xxx/XXXX.java:219: error: An unhandled exception was thrown by the Error Prone static analysis plugin.
[2024-08-26T20:02:27.860Z] destination_type(
[2024-08-26T20:02:27.860Z] ^
[2024-08-26T20:02:27.860Z] Please report this at https://github.com/google/error-prone/issues/new and include the following:
[2024-08-26T20:02:27.860Z]
[2024-08-26T20:02:27.860Z] error-prone version: 2.23.0
[2024-08-26T20:02:27.860Z] BugPattern: UnsafeWildcard
[2024-08-26T20:02:27.860Z] Stack Trace:
[2024-08-26T20:02:27.860Z] java.lang.ClassCastException: class com.sun.tools.javac.code.Type$ErrorType cannot be cast to class com.sun.tools.javac.code.Type$MethodType (com.sun.tools.javac.code.Type$ErrorType and com.sun.tools.javac.code.Type$MethodType are in module jdk.compiler of loader 'app')
[2024-08-26T20:02:27.860Z] at com.google.errorprone.bugpatterns.nullness.UnsafeWildcard.matchNewClass(UnsafeWildcard.java:179)
[2024-08-26T20:02:27.860Z] at com.google.errorprone.scanner.ErrorProneScanner.processMatchers(ErrorProneScanner.java:449)
[2024-08-26T20:02:27.860Z] at com.google.errorprone.scanner.ErrorProneScanner.visitNewClass(ErrorProneScanner.java:773)
[2024-08-26T20:02:27.860Z] at com.google.errorprone.scanner.ErrorProneScanner.visitNewClass(ErrorProneScanner.java:150)
[2024-08-26T20:02:27.860Z] at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCNewClass.accept(JCTree.java:1874)
[2024-08-26T20:02:27.860Z] at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:86)
[2024-08-26T20:02:27.860Z] at com.google.errorprone.scanner.Scanner.scan(Scanner.java:74)
[2024-08-26T20:02:27.860Z] at com.google.errorprone.scanner.Scanner.scan(Scanner.java:48)
[2024-08-26T20:02:27.860Z] at jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:96)
[2024-08-26T20:02:27.861Z] at jdk.compiler/com.sun.source.util.TreeScanner.visitVariable(TreeScanner.java:243)
[2024-08-26T20:02:27.861Z] at com.google.errorprone.scanner.ErrorProneScanner.visitVariable(ErrorProneScanner.java:885)
[2024-08-26T20:02:27.861Z] at com.google.errorprone.scanner.ErrorProneScanner.visitVariable(ErrorProneScanner.java:150)
[2024-08-26T20:02:27.861Z] at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCVariableDecl.accept(JCTree.java:1045)
[2024-08-26T20:02:27.861Z] at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:86)
[2024-08-26T20:02:27.861Z] at com.google.errorprone.scanner.Scanner.scan(Scanner.java:74)
[2024-08-26T20:02:27.861Z] at com.google.errorprone.scanner.Scanner.scan(Scanner.java:48)
[2024-08-26T20:02:27.861Z] at jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:96)
[2024-08-26T20:02:27.861Z] at jdk.compiler/com.sun.source.util.TreeScanner.scan(TreeScanner.java:111)
[2024-08-26T20:02:27.861Z] at jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:119)
[2024-08-26T20:02:27.861Z] at jdk.compiler/com.sun.source.util.TreeScanner.visitClass(TreeScanner.java:203)
[2024-08-26T20:02:27.861Z] at com.google.errorprone.scanner.ErrorProneScanner.visitClass(ErrorProneScanner.java:548)
[2024-08-26T20:02:27.861Z] at com.google.errorprone.scanner.ErrorProneScanner.visitClass(ErrorProneScanner.java:150)
[2024-08-26T20:02:27.861Z] at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:860)
[2024-08-26T20:02:27.861Z] at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:86)
[2024-08-26T20:02:27.861Z] at com.google.errorprone.scanner.Scanner.scan(Scanner.java:74)
[2024-08-26T20:02:27.861Z] at com.google.errorprone.scanner.Scanner.scan(Scanner.java:48)
[2024-08-26T20:02:27.861Z] at jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:96)
[2024-08-26T20:02:27.861Z] at jdk.compiler/com.sun.source.util.TreeScanner.scan(TreeScanner.java:111)
[2024-08-26T20:02:27.861Z] at jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:119)
[2024-08-26T20:02:27.861Z] at jdk.compiler/com.sun.source.util.TreeScanner.visitClass(TreeScanner.java:203)
[2024-08-26T20:02:27.861Z] at com.google.errorprone.scanner.ErrorProneScanner.visitClass(ErrorProneScanner.java:548)
[2024-08-26T20:02:27.861Z] at com.google.errorprone.scanner.ErrorProneScanner.visitClass(ErrorProneScanner.java:150)
[2024-08-26T20:02:27.861Z] at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:860)
[2024-08-26T20:02:27.861Z] at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:86)
[2024-08-26T20:02:27.861Z] at com.google.errorprone.scanner.Scanner.scan(Scanner.java:74)
[2024-08-26T20:02:27.861Z] at com.google.errorprone.scanner.Scanner.scan(Scanner.java:48)
[2024-08-26T20:02:27.861Z] at jdk.compiler/com.sun.source.util.TreeScanner.scan(TreeScanner.java:111)
[2024-08-26T20:02:27.861Z] at jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:119)
[2024-08-26T20:02:27.861Z] at jdk.compiler/com.sun.source.util.TreeScanner.visitCompilationUnit(TreeScanner.java:152)
[2024-08-26T20:02:27.861Z] at com.google.errorprone.scanner.ErrorProneScanner.visitCompilationUnit(ErrorProneScanner.java:560)
[2024-08-26T20:02:27.861Z] at com.google.errorprone.scanner.ErrorProneScanner.visitCompilationUnit(ErrorProneScanner.java:150)
[2024-08-26T20:02:27.861Z] at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:614)
[2024-08-26T20:02:27.861Z] at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:60)
[2024-08-26T20:02:27.861Z] at com.google.errorprone.scanner.Scanner.scan(Scanner.java:58)
[2024-08-26T20:02:27.861Z] at com.google.errorprone.scanner.ErrorProneScannerTransformer.apply(ErrorProneScannerTransformer.java:43)
[2024-08-26T20:02:27.861Z] at com.google.errorprone.ErrorProneAnalyzer.finished(ErrorProneAnalyzer.java:156)
[2024-08-26T20:02:27.861Z] at com.google.devtools.build.buildjar.javac.plugins.errorprone.ErrorPronePlugin.postFlow(ErrorPronePlugin.java:122)
[2024-08-26T20:02:27.861Z] at com.google.devtools.build.buildjar.javac.BlazeJavaCompiler.flow(BlazeJavaCompiler.java:108)
[2024-08-26T20:02:27.861Z] at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1341)
[2024-08-26T20:02:27.861Z] at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:933)
[2024-08-26T20:02:27.861Z] at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0(JavacTaskImpl.java:104)
[2024-08-26T20:02:27.861Z] at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.invocationHelper(JavacTaskImpl.java:152)
[2024-08-26T20:02:27.861Z] at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:100)
[2024-08-26T20:02:27.861Z] at com.google.devtools.build.buildjar.javac.BlazeJavacMain.compile(BlazeJavacMain.java:146)
[2024-08-26T20:02:27.861Z] at com.google.devtools.build.buildjar.ReducedClasspathJavaLibraryBuilder.fallback(ReducedClasspathJavaLibraryBuilder.java:105)
[2024-08-26T20:02:27.861Z] at com.google.devtools.build.buildjar.ReducedClasspathJavaLibraryBuilder.compileSources(ReducedClasspathJavaLibraryBuilder.java:67)
[2024-08-26T20:02:27.861Z] at com.google.devtools.build.buildjar.SimpleJavaLibraryBuilder.compileJavaLibrary(SimpleJavaLibraryBuilder.java:110)
[2024-08-26T20:02:27.861Z] at com.google.devtools.build.buildjar.SimpleJavaLibraryBuilder.run(SimpleJavaLibraryBuilder.java:118)
[2024-08-26T20:02:27.861Z] at com.google.devtools.build.buildjar.BazelJavaBuilder.build(BazelJavaBuilder.java:111)
[2024-08-26T20:02:27.861Z] at com.google.devtools.build.buildjar.BazelJavaBuilder.parseAndBuild(BazelJavaBuilder.java:91)
[2024-08-26T20:02:27.861Z] at com.google.devtools.build.buildjar.BazelJavaBuilder.lambda$main$0(BazelJavaBuilder.java:52)
[2024-08-26T20:02:27.861Z] at com.google.devtools.build.lib.worker.WorkRequestHandler$WorkRequestCallback.apply(WorkRequestHandler.java:252)
[2024-08-26T20:02:27.861Z] at com.google.devtools.build.lib.worker.WorkRequestHandler.respondToRequest(WorkRequestHandler.java:480)
[2024-08-26T20:02:27.861Z] at com.google.devtools.build.lib.worker.WorkRequestHandler.lambda$startResponseThread$1(WorkRequestHandler.java:433)
[2024-08-26T20:02:27.861Z] at java.base/java.lang.Thread.run(Thread.java:840)
The text was updated successfully, but these errors were encountered:
If you disable this check (with -Xep:UnsafeWildcard:OFF or @SuppressWarnings("UnsafeWildcard")), does the compilation succeed, or does a different error get reported?
Thanks for the quick reply! Actually it looks like the failure is flaky. It only happened once in our CI and the same Bazel target was able to build later.
I also tried checking out the same commit locally and build it and that worked too.
With Bazel 7.3.1 I am seeing build failing with the following error. I can't paste the source code here since that's confidential. But the line being reported is inside an enum declaration with dozens of enum value declarations. Specifically, line 219 is one enun declaration with some values from some method calls passed into the constructor. Please let me know if you need more details.
The text was updated successfully, but these errors were encountered: