java.lang.ClassCastException: com.sun.tools.javac.code.Symbol$ClassSymbol cannot be cast to com.sun.tools.javac.code.Symbol$MethodSymbol

GitHub | fhaertig | 3 months ago
  1. 0

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

    GitHub | 3 months ago | fhaertig
    java.lang.ClassCastException: com.sun.tools.javac.code.Symbol$ClassSymbol cannot be cast to com.sun.tools.javac.code.Symbol$MethodSymbol
  2. 0

    Error from Hamcrest's allOf()

    GitHub | 2 weeks ago | mread
    java.lang.ClassCastException: com.sun.tools.javac.code.Symbol$ClassSymbol cannot be cast to com.sun.tools.javac.code.Symbol$MethodSymbol
  3. 0

    Annotating method parameters with @Inject results in ClassCastException

    GitHub | 4 years ago | gunnarmorling
    java.lang.ClassCastException: com.sun.tools.javac.code.Symbol$MethodSymbol cannot be cast to javax.lang.model.element.TypeElement
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Bug ID: JDK-6608214 Exception throw while analysing a file with error

    java.com | 8 months ago
    java.lang.ClassCastException: com.sun.tools.javac.code.Symbol$TypeSymbol cannot be cast to com.sun.tools.javac.code.Symbol$ClassSymbol
  6. 0

    Error classCast Element to ExecutableElement

    Stack Overflow | 4 months ago | warorc
    java.lang.ClassCastException: com.sun.tools.javac.code.Symbol$ClassSymbol cannot be cast to javax.lang.model.element.ExecutableElement

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. 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()
    2. com.google.errorprone
      ErrorProneScanner.visitMethodInvocation
      1. com.google.errorprone.bugpatterns.CompileTimeConstantChecker.matchMethodInvocation(CompileTimeConstantChecker.java:170)
      2. com.google.errorprone.scanner.ErrorProneScanner.visitMethodInvocation(ErrorProneScanner.java:826)
      3. com.google.errorprone.scanner.ErrorProneScanner.visitMethodInvocation(ErrorProneScanner.java:146)
      3 frames
    3. Java Tools
      TreePathScanner.scan
      1. com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1614)
      2. com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:72)
      2 frames
    4. com.google.errorprone
      ErrorProneScanner.scan
      1. com.google.errorprone.scanner.Scanner.scan(Scanner.java:91)
      2. com.google.errorprone.scanner.ErrorProneScanner.scan(ErrorProneScanner.java:1050)
      3. com.google.errorprone.scanner.ErrorProneScanner.scan(ErrorProneScanner.java:146)
      3 frames
    5. Java Tools
      TreeScanner.visitReturn
      1. com.sun.source.util.TreeScanner.visitReturn(TreeScanner.java:470)
      1 frame
    6. com.google.errorprone
      ErrorProneScanner.visitReturn
      1. com.google.errorprone.scanner.ErrorProneScanner.visitReturn(ErrorProneScanner.java:909)
      2. com.google.errorprone.scanner.ErrorProneScanner.visitReturn(ErrorProneScanner.java:146)
      2 frames
    7. Java Tools
      TreePathScanner.scan
      1. com.sun.tools.javac.tree.JCTree$JCReturn.accept(JCTree.java:1518)
      2. com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:72)
      2 frames
    8. com.google.errorprone
      ErrorProneScanner.scan
      1. com.google.errorprone.scanner.Scanner.scan(Scanner.java:91)
      2. com.google.errorprone.scanner.ErrorProneScanner.scan(ErrorProneScanner.java:1050)
      3. com.google.errorprone.scanner.ErrorProneScanner.scan(ErrorProneScanner.java:146)
      3 frames
    9. Java Tools
      TreeScanner.visitBlock
      1. com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:91)
      2. com.sun.source.util.TreeScanner.scan(TreeScanner.java:106)
      3. com.sun.source.util.TreeScanner.visitBlock(TreeScanner.java:249)
      3 frames
    10. com.google.errorprone
      ErrorProneScanner.visitBlock
      1. com.google.errorprone.scanner.ErrorProneScanner.visitBlock(ErrorProneScanner.java:546)
      2. com.google.errorprone.scanner.ErrorProneScanner.visitBlock(ErrorProneScanner.java:146)
      2 frames
    11. Java Tools
      TreePathScanner.scan
      1. com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:996)
      2. com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:72)
      2 frames
    12. com.google.errorprone
      ErrorProneScanner.scan
      1. com.google.errorprone.scanner.Scanner.scan(Scanner.java:91)
      2. com.google.errorprone.scanner.ErrorProneScanner.scan(ErrorProneScanner.java:1050)
      3. com.google.errorprone.scanner.ErrorProneScanner.scan(ErrorProneScanner.java:146)
      3 frames
    13. Java Tools
      TreeScanner.visitLambdaExpression
      1. com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:91)
      2. com.sun.source.util.TreeScanner.visitLambdaExpression(TreeScanner.java:560)
      2 frames
    14. com.google.errorprone
      ErrorProneScanner.visitLambdaExpression
      1. com.google.errorprone.scanner.ErrorProneScanner.visitLambdaExpression(ErrorProneScanner.java:769)
      2. com.google.errorprone.scanner.ErrorProneScanner.visitLambdaExpression(ErrorProneScanner.java:146)
      2 frames
    15. Java Tools
      TreePathScanner.scan
      1. com.sun.tools.javac.tree.JCTree$JCLambda.accept(JCTree.java:1775)
      2. com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:72)
      2 frames
    16. com.google.errorprone
      ErrorProneScanner.scan
      1. com.google.errorprone.scanner.Scanner.scan(Scanner.java:91)
      2. com.google.errorprone.scanner.ErrorProneScanner.scan(ErrorProneScanner.java:1050)
      3. com.google.errorprone.scanner.ErrorProneScanner.scan(ErrorProneScanner.java:146)
      3 frames
    17. Java Tools
      TreeScanner.visitMethodInvocation
      1. com.sun.source.util.TreeScanner.scan(TreeScanner.java:106)
      2. com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:114)
      3. com.sun.source.util.TreeScanner.visitMethodInvocation(TreeScanner.java:510)
      3 frames
    18. com.google.errorprone
      ErrorProneScanner.visitMethodInvocation
      1. com.google.errorprone.scanner.ErrorProneScanner.visitMethodInvocation(ErrorProneScanner.java:829)
      2. com.google.errorprone.scanner.ErrorProneScanner.visitMethodInvocation(ErrorProneScanner.java:146)
      2 frames
    19. Java Tools
      TreePathScanner.scan
      1. com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1614)
      2. com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:72)
      2 frames
    20. com.google.errorprone
      ErrorProneScanner.scan
      1. com.google.errorprone.scanner.Scanner.scan(Scanner.java:91)
      2. com.google.errorprone.scanner.ErrorProneScanner.scan(ErrorProneScanner.java:1050)
      3. com.google.errorprone.scanner.ErrorProneScanner.scan(ErrorProneScanner.java:146)
      3 frames
    21. Java Tools
      TreeScanner.visitMemberSelect
      1. com.sun.source.util.TreeScanner.visitMemberSelect(TreeScanner.java:681)
      1 frame
    22. com.google.errorprone
      ErrorProneScanner.visitMemberSelect
      1. com.google.errorprone.scanner.ErrorProneScanner.visitMemberSelect(ErrorProneScanner.java:791)
      2. com.google.errorprone.scanner.ErrorProneScanner.visitMemberSelect(ErrorProneScanner.java:146)
      2 frames
    23. Java Tools
      TreePathScanner.scan
      1. com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:2077)
      2. com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:72)
      2 frames
    24. com.google.errorprone
      ErrorProneScanner.scan
      1. com.google.errorprone.scanner.Scanner.scan(Scanner.java:91)
      2. com.google.errorprone.scanner.ErrorProneScanner.scan(ErrorProneScanner.java:1050)
      3. com.google.errorprone.scanner.ErrorProneScanner.scan(ErrorProneScanner.java:146)
      3 frames
    25. Java Tools
      TreeScanner.visitMethodInvocation
      1. com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:91)
      2. com.sun.source.util.TreeScanner.visitMethodInvocation(TreeScanner.java:509)
      2 frames
    26. com.google.errorprone
      ErrorProneScanner.visitMethodInvocation
      1. com.google.errorprone.scanner.ErrorProneScanner.visitMethodInvocation(ErrorProneScanner.java:829)
      2. com.google.errorprone.scanner.ErrorProneScanner.visitMethodInvocation(ErrorProneScanner.java:146)
      2 frames
    27. Java Tools
      TreePathScanner.scan
      1. com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1614)
      2. com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:72)
      2 frames
    28. com.google.errorprone
      ErrorProneScanner.scan
      1. com.google.errorprone.scanner.Scanner.scan(Scanner.java:91)
      2. com.google.errorprone.scanner.ErrorProneScanner.scan(ErrorProneScanner.java:1050)
      3. com.google.errorprone.scanner.ErrorProneScanner.scan(ErrorProneScanner.java:146)
      3 frames
    29. Java Tools
      TreeScanner.visitVariable
      1. com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:91)
      2. com.sun.source.util.TreeScanner.visitVariable(TreeScanner.java:224)
      2 frames
    30. com.google.errorprone
      ErrorProneScanner.visitVariable
      1. com.google.errorprone.scanner.ErrorProneScanner.visitVariable(ErrorProneScanner.java:1008)
      2. com.google.errorprone.scanner.ErrorProneScanner.visitVariable(ErrorProneScanner.java:146)
      2 frames
    31. Java Tools
      TreePathScanner.scan
      1. com.sun.tools.javac.tree.JCTree$JCVariableDecl.accept(JCTree.java:938)
      2. com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:72)
      2 frames
    32. com.google.errorprone
      ErrorProneScanner.scan
      1. com.google.errorprone.scanner.Scanner.scan(Scanner.java:91)
      2. com.google.errorprone.scanner.ErrorProneScanner.scan(ErrorProneScanner.java:1050)
      3. com.google.errorprone.scanner.ErrorProneScanner.scan(ErrorProneScanner.java:146)
      3 frames
    33. Java Tools
      TreeScanner.visitBlock
      1. com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:91)
      2. com.sun.source.util.TreeScanner.scan(TreeScanner.java:106)
      3. com.sun.source.util.TreeScanner.visitBlock(TreeScanner.java:249)
      3 frames
    34. com.google.errorprone
      ErrorProneScanner.visitBlock
      1. com.google.errorprone.scanner.ErrorProneScanner.visitBlock(ErrorProneScanner.java:546)
      2. com.google.errorprone.scanner.ErrorProneScanner.visitBlock(ErrorProneScanner.java:146)
      2 frames
    35. Java Tools
      TreePathScanner.scan
      1. com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:996)
      2. com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:72)
      2 frames
    36. com.google.errorprone
      ErrorProneScanner.scan
      1. com.google.errorprone.scanner.Scanner.scan(Scanner.java:91)
      2. com.google.errorprone.scanner.ErrorProneScanner.scan(ErrorProneScanner.java:1050)
      3. com.google.errorprone.scanner.ErrorProneScanner.scan(ErrorProneScanner.java:146)
      3 frames
    37. Java Tools
      TreeScanner.visitIf
      1. com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:91)
      2. com.sun.source.util.TreeScanner.visitIf(TreeScanner.java:420)
      2 frames
    38. com.google.errorprone
      ErrorProneScanner.visitIf
      1. com.google.errorprone.scanner.ErrorProneScanner.visitIf(ErrorProneScanner.java:714)
      2. com.google.errorprone.scanner.ErrorProneScanner.visitIf(ErrorProneScanner.java:146)
      2 frames
    39. Java Tools
      TreePathScanner.scan
      1. com.sun.tools.javac.tree.JCTree$JCIf.accept(JCTree.java:1397)
      2. com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:72)
      2 frames
    40. com.google.errorprone
      ErrorProneScanner.scan
      1. com.google.errorprone.scanner.Scanner.scan(Scanner.java:91)
      2. com.google.errorprone.scanner.ErrorProneScanner.scan(ErrorProneScanner.java:1050)
      3. com.google.errorprone.scanner.ErrorProneScanner.scan(ErrorProneScanner.java:146)
      3 frames
    41. Java Tools
      TreeScanner.visitBlock
      1. com.sun.source.util.TreeScanner.scan(TreeScanner.java:106)
      2. com.sun.source.util.TreeScanner.visitBlock(TreeScanner.java:249)
      2 frames
    42. com.google.errorprone
      ErrorProneScanner.visitBlock
      1. com.google.errorprone.scanner.ErrorProneScanner.visitBlock(ErrorProneScanner.java:546)
      2. com.google.errorprone.scanner.ErrorProneScanner.visitBlock(ErrorProneScanner.java:146)
      2 frames
    43. Java Tools
      TreePathScanner.scan
      1. com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:996)
      2. com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:72)
      2 frames
    44. com.google.errorprone
      ErrorProneScanner.scan
      1. com.google.errorprone.scanner.Scanner.scan(Scanner.java:91)
      2. com.google.errorprone.scanner.ErrorProneScanner.scan(ErrorProneScanner.java:1050)
      3. com.google.errorprone.scanner.ErrorProneScanner.scan(ErrorProneScanner.java:146)
      3 frames
    45. Java Tools
      TreeScanner.visitMethod
      1. com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:91)
      2. com.sun.source.util.TreeScanner.visitMethod(TreeScanner.java:207)
      2 frames
    46. com.google.errorprone
      ErrorProneScanner.visitMethod
      1. com.google.errorprone.scanner.ErrorProneScanner.visitMethod(ErrorProneScanner.java:818)
      2. com.google.errorprone.scanner.ErrorProneScanner.visitMethod(ErrorProneScanner.java:146)
      2 frames
    47. Java Tools
      TreePathScanner.scan
      1. com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:868)
      2. com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:72)
      2 frames
    48. com.google.errorprone
      ErrorProneScanner.scan
      1. com.google.errorprone.scanner.Scanner.scan(Scanner.java:91)
      2. com.google.errorprone.scanner.ErrorProneScanner.scan(ErrorProneScanner.java:1050)
      3. com.google.errorprone.scanner.ErrorProneScanner.scan(ErrorProneScanner.java:146)
      3 frames
    49. Java Tools
      TreeScanner.visitClass
      1. com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:91)
      2. com.sun.source.util.TreeScanner.scan(TreeScanner.java:106)
      3. com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:114)
      4. com.sun.source.util.TreeScanner.visitClass(TreeScanner.java:188)
      4 frames
    50. com.google.errorprone
      ErrorProneScanner.visitClass
      1. com.google.errorprone.scanner.ErrorProneScanner.visitClass(ErrorProneScanner.java:590)
      2. com.google.errorprone.scanner.ErrorProneScanner.visitClass(ErrorProneScanner.java:146)
      2 frames
    51. Java Tools
      TreePathScanner.scan
      1. com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:778)
      2. com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:72)
      2 frames
    52. com.google.errorprone
      ErrorProneScanner.scan
      1. com.google.errorprone.scanner.Scanner.scan(Scanner.java:91)
      2. com.google.errorprone.scanner.ErrorProneScanner.scan(ErrorProneScanner.java:1050)
      3. com.google.errorprone.scanner.ErrorProneScanner.scan(ErrorProneScanner.java:146)
      3 frames
    53. Java Tools
      TreeScanner.visitCompilationUnit
      1. com.sun.source.util.TreeScanner.scan(TreeScanner.java:106)
      2. com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:114)
      3. com.sun.source.util.TreeScanner.visitCompilationUnit(TreeScanner.java:145)
      3 frames
    54. com.google.errorprone
      ErrorProneScanner.visitCompilationUnit
      1. com.google.errorprone.scanner.ErrorProneScanner.visitCompilationUnit(ErrorProneScanner.java:601)
      2. com.google.errorprone.scanner.ErrorProneScanner.visitCompilationUnit(ErrorProneScanner.java:146)
      2 frames
    55. Java Tools
      TreePathScanner.scan
      1. com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:561)
      2. com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:53)
      2 frames
    56. com.google.errorprone
      ErrorProneScannerTransformer.apply
      1. com.google.errorprone.scanner.Scanner.scan(Scanner.java:70)
      2. com.google.errorprone.scanner.ErrorProneScanner.scan(ErrorProneScanner.java:1036)
      3. com.google.errorprone.scanner.ErrorProneScannerTransformer.apply(ErrorProneScannerTransformer.java:45)
      3 frames
    57. @BugPattern annotation
      ErrorProneJavacJavaCompiler.flow
      1. com.google.errorprone.ErrorProneAnalyzer.reportReadyForAnalysis(ErrorProneAnalyzer.java:172)
      2. com.google.errorprone.ErrorProneAnalyzer.finished(ErrorProneAnalyzer.java:115)
      3. com.google.errorprone.ErrorProneJavacJavaCompiler.postFlow(ErrorProneJavacJavaCompiler.java:109)
      4. com.google.errorprone.ErrorProneJavacJavaCompiler.flow(ErrorProneJavacJavaCompiler.java:93)
      4 frames
    58. Java Tools
      JavacTaskImpl.call
      1. com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1257)
      2. com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:865)
      3. com.sun.tools.javac.api.JavacTaskImpl$1.call(JavacTaskImpl.java:97)
      4. com.sun.tools.javac.api.JavacTaskImpl$1.call(JavacTaskImpl.java:93)
      5. com.sun.tools.javac.api.JavacTaskImpl.handleExceptions(JavacTaskImpl.java:128)
      6. com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:93)
      7. com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:87)
      7 frames
    59. org.jetbrains.jps
      JavacMain.compile
      1. org.jetbrains.jps.javac.JavacMain.compile(JavacMain.java:166)
      1 frame
    60. JetBrains jps
      SharedThreadPoolImpl$1.run
      1. org.jetbrains.jps.incremental.java.JavaBuilder.compileJava(JavaBuilder.java:423)
      2. org.jetbrains.jps.incremental.java.JavaBuilder.compile(JavaBuilder.java:290)
      3. org.jetbrains.jps.incremental.java.JavaBuilder.doBuild(JavaBuilder.java:197)
      4. org.jetbrains.jps.incremental.java.JavaBuilder.build(JavaBuilder.java:168)
      5. org.jetbrains.jps.incremental.IncProjectBuilder.runModuleLevelBuilders(IncProjectBuilder.java:1237)
      6. org.jetbrains.jps.incremental.IncProjectBuilder.runBuildersForChunk(IncProjectBuilder.java:911)
      7. org.jetbrains.jps.incremental.IncProjectBuilder.buildTargetsChunk(IncProjectBuilder.java:983)
      8. org.jetbrains.jps.incremental.IncProjectBuilder.buildChunkIfAffected(IncProjectBuilder.java:870)
      9. org.jetbrains.jps.incremental.IncProjectBuilder.buildChunks(IncProjectBuilder.java:696)
      10. org.jetbrains.jps.incremental.IncProjectBuilder.runBuild(IncProjectBuilder.java:387)
      11. org.jetbrains.jps.incremental.IncProjectBuilder.build(IncProjectBuilder.java:194)
      12. org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.java:138)
      13. org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:294)
      14. org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:125)
      15. org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler$1.run(BuildMain.java:232)
      16. org.jetbrains.jps.service.impl.SharedThreadPoolImpl$1.run(SharedThreadPoolImpl.java:44)
      16 frames
    61. Java RT
      Thread.run
      1. java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      2. java.util.concurrent.FutureTask.run(FutureTask.java:266)
      3. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      4. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      5. java.lang.Thread.run(Thread.java:745)
      5 frames