java.lang.ClassCastException

com.sun.tools.javac.code.Symbol$ClassSymbol cannot be cast to com.sun.tools.javac.code.Symbol$MethodSymbol

Samebug tips0

We couldn't find tips for this exception.

Don't give up yet. Paste your full stack trace to get a solution.

Stack trace

  • java.lang.ClassCastException: com.sun.tools.javac.code.Symbol$ClassSymbol cannot be cast to com.sun.tools.javac.code.Symbol$MethodSymbol at com.google.errorprone.bugpatterns.CompileTimeConstantChecker.matchMethodInvocation(CompileTimeConstantChecker.java:170) at com.google.errorprone.scanner.ErrorProneScanner.visitMethodInvocation(ErrorProneScanner.java:826) at com.google.errorprone.scanner.ErrorProneScanner.visitMethodInvocation(ErrorProneScanner.java:146) at com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1614) at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:72) at com.google.errorprone.scanner.Scanner.scan(Scanner.java:91) at com.google.errorprone.scanner.ErrorProneScanner.scan(ErrorProneScanner.java:1050) at com.google.errorprone.scanner.ErrorProneScanner.scan(ErrorProneScanner.java:146) at com.sun.source.util.TreeScanner.visitReturn(TreeScanner.java:470) at com.google.errorprone.scanner.ErrorProneScanner.visitReturn(ErrorProneScanner.java:909) at com.google.errorprone.scanner.ErrorProneScanner.visitReturn(ErrorProneScanner.java:146) at com.sun.tools.javac.tree.JCTree$JCReturn.accept(JCTree.java:1518) at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:72) at com.google.errorprone.scanner.Scanner.scan(Scanner.java:91) at com.google.errorprone.scanner.ErrorProneScanner.scan(ErrorProneScanner.java:1050) at com.google.errorprone.scanner.ErrorProneScanner.scan(ErrorProneScanner.java:146) at com.sun.source.util.TreeScanner.scan(TreeScanner.java:106) at com.sun.source.util.TreeScanner.visitBlock(TreeScanner.java:249) at com.google.errorprone.scanner.ErrorProneScanner.visitBlock(ErrorProneScanner.java:546) at com.google.errorprone.scanner.ErrorProneScanner.visitBlock(ErrorProneScanner.java:146) at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:996) at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:72) at com.google.errorprone.scanner.Scanner.scan(Scanner.java:91) at com.google.errorprone.scanner.ErrorProneScanner.scan(ErrorProneScanner.java:1050) at com.google.errorprone.scanner.ErrorProneScanner.scan(ErrorProneScanner.java:146) at com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:91) at com.sun.source.util.TreeScanner.visitMethod(TreeScanner.java:207) at com.google.errorprone.scanner.ErrorProneScanner.visitMethod(ErrorProneScanner.java:818) at com.google.errorprone.scanner.ErrorProneScanner.visitMethod(ErrorProneScanner.java:146) at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:868) at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:72) at com.google.errorprone.scanner.Scanner.scan(Scanner.java:91) at com.google.errorprone.scanner.ErrorProneScanner.scan(ErrorProneScanner.java:1050) at com.google.errorprone.scanner.ErrorProneScanner.scan(ErrorProneScanner.java:146) at com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:91) at com.sun.source.util.TreeScanner.scan(TreeScanner.java:106) at com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:114) at com.sun.source.util.TreeScanner.visitClass(TreeScanner.java:188) 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:778) at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:72) at com.google.errorprone.scanner.Scanner.scan(Scanner.java:91) at com.google.errorprone.scanner.ErrorProneScanner.scan(ErrorProneScanner.java:1050) at com.google.errorprone.scanner.ErrorProneScanner.scan(ErrorProneScanner.java:146) at com.sun.source.util.TreeScanner.scan(TreeScanner.java:106) at com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:114) at com.sun.source.util.TreeScanner.visitCompilationUnit(TreeScanner.java:145) at com.google.errorprone.scanner.ErrorProneScanner.visitCompilationUnit(ErrorProneScanner.java:601) at com.google.errorprone.scanner.ErrorProneScanner.visitCompilationUnit(ErrorProneScanner.java:146) at com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:561) at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:53) at com.google.errorprone.scanner.Scanner.scan(Scanner.java:70) at com.google.errorprone.scanner.ErrorProneScanner.scan(ErrorProneScanner.java:1036) at com.google.errorprone.scanner.ErrorProneScannerTransformer.apply(ErrorProneScannerTransformer.java:45) at com.google.errorprone.ErrorProneAnalyzer.reportReadyForAnalysis(ErrorProneAnalyzer.java:172) at com.google.errorprone.ErrorProneAnalyzer.finished(ErrorProneAnalyzer.java:115) at com.google.errorprone.ErrorProneJavacJavaCompiler.postFlow(ErrorProneJavacJavaCompiler.java:109) at com.google.errorprone.ErrorProneJavacJavaCompiler.flow(ErrorProneJavacJavaCompiler.java:93) at com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1257) at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:865) at com.sun.tools.javac.api.JavacTaskImpl$1.call(JavacTaskImpl.java:97) at com.sun.tools.javac.api.JavacTaskImpl$1.call(JavacTaskImpl.java:93) at com.sun.tools.javac.api.JavacTaskImpl.handleExceptions(JavacTaskImpl.java:128) at com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:93) at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:87) at org.jetbrains.jps.javac.JavacMain.compile(JavacMain.java:180) at org.jetbrains.jps.incremental.java.JavaBuilder.compileJava(JavaBuilder.java:463) at org.jetbrains.jps.incremental.java.JavaBuilder.compile(JavaBuilder.java:319) at org.jetbrains.jps.incremental.java.JavaBuilder.doBuild(JavaBuilder.java:231) at org.jetbrains.jps.incremental.java.JavaBuilder.build(JavaBuilder.java:193) at org.jetbrains.jps.incremental.IncProjectBuilder.runModuleLevelBuilders(IncProjectBuilder.java:1282) at org.jetbrains.jps.incremental.IncProjectBuilder.runBuildersForChunk(IncProjectBuilder.java:951) at org.jetbrains.jps.incremental.IncProjectBuilder.buildTargetsChunk(IncProjectBuilder.java:1028) at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunkIfAffected(IncProjectBuilder.java:915) at org.jetbrains.jps.incremental.IncProjectBuilder.access$800(IncProjectBuilder.java:82) at org.jetbrains.jps.incremental.IncProjectBuilder$BuildParallelizer$2.run(IncProjectBuilder.java:885) at com.intellij.util.concurrency.BoundedTaskExecutor$2.run(BoundedTaskExecutor.java:210) at org.jetbrains.jps.service.impl.SharedThreadPoolImpl$1.run(SharedThreadPoolImpl.java:44) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

We couldn't find other users who have seen this exception.