java.lang.ClassCastException: org.sonar.java.resolve.ClassJavaType cannot be cast to org.sonar.java.resolve.ParametrizedTypeJavaType

Stack Overflow | JohannesR | 5 months ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    SonarQube error: "Unable to create symbol table for <Class>"

    Stack Overflow | 5 months ago | JohannesR
    java.lang.ClassCastException: org.sonar.java.resolve.ClassJavaType cannot be cast to org.sonar.java.resolve.ParametrizedTypeJavaType

    Root Cause Analysis

    1. java.lang.ClassCastException

      org.sonar.java.resolve.ClassJavaType cannot be cast to org.sonar.java.resolve.ParametrizedTypeJavaType

      at org.sonar.java.resolve.TypeAndReferenceSolver.refineType()
    2. SonarQube Java :: Squid
      JavaSquid.scan
      1. org.sonar.java.resolve.TypeAndReferenceSolver.refineType(TypeAndReferenceSolver.java:558)[java-frontend-4.2.jar:na]
      2. org.sonar.java.resolve.TypeAndReferenceSolver.visitMethodReference(TypeAndReferenceSolver.java:946)[java-frontend-4.2.jar:na]
      3. org.sonar.java.model.expression.MethodReferenceTreeImpl.accept(MethodReferenceTreeImpl.java:62)[java-frontend-4.2.jar:na]
      4. org.sonar.java.resolve.TypeAndReferenceSolver.setInferedType(TypeAndReferenceSolver.java:299)[java-frontend-4.2.jar:na]
      5. org.sonar.java.resolve.TypeAndReferenceSolver.inferArgumentTypes(TypeAndReferenceSolver.java:775)[java-frontend-4.2.jar:na]
      6. org.sonar.java.resolve.TypeAndReferenceSolver.visitMethodInvocation(TypeAndReferenceSolver.java:245)[java-frontend-4.2.jar:na]
      7. org.sonar.java.model.expression.MethodInvocationTreeImpl.accept(MethodInvocationTreeImpl.java:96)[java-frontend-4.2.jar:na]
      8. org.sonar.plugins.java.api.tree.BaseTreeVisitor.scan(BaseTreeVisitor.java:43)[java-frontend-4.2.jar:na]
      9. org.sonar.plugins.java.api.tree.BaseTreeVisitor.visitExpressionStatement(BaseTreeVisitor.java:101)[java-frontend-4.2.jar:na]
      10. org.sonar.java.resolve.TypeAndReferenceSolver.visitExpressionStatement(TypeAndReferenceSolver.java:745)[java-frontend-4.2.jar:na]
      11. org.sonar.java.model.statement.ExpressionStatementTreeImpl.accept(ExpressionStatementTreeImpl.java:65)[java-frontend-4.2.jar:na]
      12. org.sonar.plugins.java.api.tree.BaseTreeVisitor.scan(BaseTreeVisitor.java:43)[java-frontend-4.2.jar:na]
      13. org.sonar.plugins.java.api.tree.BaseTreeVisitor.scan(BaseTreeVisitor.java:37)[java-frontend-4.2.jar:na]
      14. org.sonar.plugins.java.api.tree.BaseTreeVisitor.visitBlock(BaseTreeVisitor.java:85)[java-frontend-4.2.jar:na]
      15. org.sonar.java.model.statement.BlockTreeImpl.accept(BlockTreeImpl.java:77)[java-frontend-4.2.jar:na]
      16. org.sonar.plugins.java.api.tree.BaseTreeVisitor.scan(BaseTreeVisitor.java:43)[java-frontend-4.2.jar:na]
      17. org.sonar.java.resolve.TypeAndReferenceSolver.visitMethod(TypeAndReferenceSolver.java:131)[java-frontend-4.2.jar:na]
      18. org.sonar.java.model.declaration.MethodTreeImpl.accept(MethodTreeImpl.java:218)[java-frontend-4.2.jar:na]
      19. org.sonar.plugins.java.api.tree.BaseTreeVisitor.scan(BaseTreeVisitor.java:43)[java-frontend-4.2.jar:na]
      20. org.sonar.plugins.java.api.tree.BaseTreeVisitor.scan(BaseTreeVisitor.java:37)[java-frontend-4.2.jar:na]
      21. org.sonar.java.resolve.TypeAndReferenceSolver.visitClass(TypeAndReferenceSolver.java:140)[java-frontend-4.2.jar:na]
      22. org.sonar.java.model.declaration.ClassTreeImpl.accept(ClassTreeImpl.java:198)[java-frontend-4.2.jar:na]
      23. org.sonar.plugins.java.api.tree.BaseTreeVisitor.scan(BaseTreeVisitor.java:43)[java-frontend-4.2.jar:na]
      24. org.sonar.plugins.java.api.tree.BaseTreeVisitor.scan(BaseTreeVisitor.java:37)[java-frontend-4.2.jar:na]
      25. org.sonar.plugins.java.api.tree.BaseTreeVisitor.visitCompilationUnit(BaseTreeVisitor.java:55)[java-frontend-4.2.jar:na]
      26. org.sonar.java.resolve.SemanticModel.createFor(SemanticModel.java:62)[java-frontend-4.2.jar:na]
      27. org.sonar.java.model.VisitorsBridge.visitFile(VisitorsBridge.java:107)[java-frontend-4.2.jar:na]
      28. org.sonar.java.ast.JavaAstScanner.simpleScan(JavaAstScanner.java:84)[java-frontend-4.2.jar:na]
      29. org.sonar.java.ast.JavaAstScanner.scan(JavaAstScanner.java:67)[java-frontend-4.2.jar:na]
      30. org.sonar.java.JavaSquid.scanTests(JavaSquid.java:125)[java-frontend-4.2.jar:na]
      31. org.sonar.java.JavaSquid.scan(JavaSquid.java:114)[java-frontend-4.2.jar:na]
      31 frames
    3. org.sonar.plugins
      JavaSquidSensor.execute
      1. org.sonar.plugins.java.JavaSquidSensor.execute(JavaSquidSensor.java:87)[sonar-java-plugin-4.2.jar:na]
      1 frame
    4. org.sonarsource.sonarlint
      StandaloneSonarLintEngineImpl.analyze
      1. org.sonarsource.sonarlint.core.analyzer.sensor.SensorWrapper.analyse(SensorWrapper.java:52)[org.sonarsource.sonarlint.core.sonarlint-core_2.4.1.jar:na]
      2. org.sonarsource.sonarlint.core.analyzer.sensor.SensorsExecutor.executeSensor(SensorsExecutor.java:73)[org.sonarsource.sonarlint.core.sonarlint-core_2.4.1.jar:na]
      3. org.sonarsource.sonarlint.core.analyzer.sensor.SensorsExecutor.execute(SensorsExecutor.java:63)[org.sonarsource.sonarlint.core.sonarlint-core_2.4.1.jar:na]
      4. org.sonarsource.sonarlint.core.analyzer.sensor.PhaseExecutor.execute(PhaseExecutor.java:44)[org.sonarsource.sonarlint.core.sonarlint-core_2.4.1.jar:na]
      5. org.sonarsource.sonarlint.core.container.analysis.AnalysisContainer.doAfterStart(AnalysisContainer.java:143)[org.sonarsource.sonarlint.core.sonarlint-core_2.4.1.jar:na]
      6. org.sonarsource.sonarlint.core.container.ComponentContainer.startComponents(ComponentContainer.java:125)[org.sonarsource.sonarlint.core.sonarlint-core_2.4.1.jar:na]
      7. org.sonarsource.sonarlint.core.container.ComponentContainer.execute(ComponentContainer.java:110)[org.sonarsource.sonarlint.core.sonarlint-core_2.4.1.jar:na]
      8. org.sonarsource.sonarlint.core.container.standalone.StandaloneGlobalContainer.analyze(StandaloneGlobalContainer.java:118)[org.sonarsource.sonarlint.core.sonarlint-core_2.4.1.jar:na]
      9. org.sonarsource.sonarlint.core.StandaloneSonarLintEngineImpl.analyze(StandaloneSonarLintEngineImpl.java:93)[org.sonarsource.sonarlint.core.sonarlint-core_2.4.1.jar:na]
      10. org.sonarsource.sonarlint.core.StandaloneSonarLintEngineImpl.analyze(StandaloneSonarLintEngineImpl.java:83)[org.sonarsource.sonarlint.core.sonarlint-core_2.4.1.jar:na]
      10 frames
    5. org.sonarlint.eclipse
      AnalyzeProjectJob$AnalysisThread.run
      1. org.sonarlint.eclipse.core.internal.jobs.StandaloneSonarLintClientFacade.runAnalysis(StandaloneSonarLintClientFacade.java:60)[org.sonarlint.eclipse.core_2.2.1.201608261350-RELEASE.jar:na]
      2. org.sonarlint.eclipse.core.internal.jobs.AnalyzeProjectJob.run(AnalyzeProjectJob.java:463)[org.sonarlint.eclipse.core_2.2.1.201608261350-RELEASE.jar:na]
      3. org.sonarlint.eclipse.core.internal.jobs.AnalyzeProjectJob$AnalysisThread.run(AnalyzeProjectJob.java:127)[org.sonarlint.eclipse.core_2.2.1.201608261350-RELEASE.jar:na]
      3 frames