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

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via Stack Overflow by JohannesR
, 1 year ago
org.sonar.java.resolve.ClassJavaType cannot be cast to org.sonar.java.resolve.ParametrizedTypeJavaType
java.lang.ClassCastException: org.sonar.java.resolve.ClassJavaType cannot be cast to org.sonar.java.resolve.ParametrizedTypeJavaType
at org.sonar.java.resolve.TypeAndReferenceSolver.refineType(TypeAndReferenceSolver.java:558)
at org.sonar.java.resolve.TypeAndReferenceSolver.visitMethodReference(TypeAndReferenceSolver.java:946)
at org.sonar.java.model.expression.MethodReferenceTreeImpl.accept(MethodReferenceTreeImpl.java:62)
at org.sonar.java.resolve.TypeAndReferenceSolver.setInferedType(TypeAndReferenceSolver.java:299)
at org.sonar.java.resolve.TypeAndReferenceSolver.inferArgumentTypes(TypeAndReferenceSolver.java:775)
at org.sonar.java.resolve.TypeAndReferenceSolver.visitMethodInvocation(TypeAndReferenceSolver.java:245)
at org.sonar.java.model.expression.MethodInvocationTreeImpl.accept(MethodInvocationTreeImpl.java:96)
at org.sonar.plugins.java.api.tree.BaseTreeVisitor.scan(BaseTreeVisitor.java:43)
at org.sonar.plugins.java.api.tree.BaseTreeVisitor.visitExpressionStatement(BaseTreeVisitor.java:101)
at org.sonar.java.resolve.TypeAndReferenceSolver.visitExpressionStatement(TypeAndReferenceSolver.java:745)
at org.sonar.java.model.statement.ExpressionStatementTreeImpl.accept(ExpressionStatementTreeImpl.java:65)
at org.sonar.plugins.java.api.tree.BaseTreeVisitor.scan(BaseTreeVisitor.java:43)
at org.sonar.plugins.java.api.tree.BaseTreeVisitor.scan(BaseTreeVisitor.java:37)
at org.sonar.plugins.java.api.tree.BaseTreeVisitor.visitBlock(BaseTreeVisitor.java:85)
at org.sonar.java.model.statement.BlockTreeImpl.accept(BlockTreeImpl.java:77)
at org.sonar.plugins.java.api.tree.BaseTreeVisitor.scan(BaseTreeVisitor.java:43)
at org.sonar.java.resolve.TypeAndReferenceSolver.visitMethod(TypeAndReferenceSolver.java:131)
at org.sonar.java.model.declaration.MethodTreeImpl.accept(MethodTreeImpl.java:218)
at org.sonar.plugins.java.api.tree.BaseTreeVisitor.scan(BaseTreeVisitor.java:43)
at org.sonar.plugins.java.api.tree.BaseTreeVisitor.scan(BaseTreeVisitor.java:37)
at org.sonar.java.resolve.TypeAndReferenceSolver.visitClass(TypeAndReferenceSolver.java:140)
at org.sonar.java.model.declaration.ClassTreeImpl.accept(ClassTreeImpl.java:198)
at org.sonar.plugins.java.api.tree.BaseTreeVisitor.scan(BaseTreeVisitor.java:43)
at org.sonar.plugins.java.api.tree.BaseTreeVisitor.scan(BaseTreeVisitor.java:37)
at org.sonar.plugins.java.api.tree.BaseTreeVisitor.visitCompilationUnit(BaseTreeVisitor.java:55)
at org.sonar.java.resolve.SemanticModel.createFor(SemanticModel.java:62)
at org.sonar.java.model.VisitorsBridge.visitFile(VisitorsBridge.java:107)
at org.sonar.java.ast.JavaAstScanner.simpleScan(JavaAstScanner.java:84)
at org.sonar.java.ast.JavaAstScanner.scan(JavaAstScanner.java:67)
at org.sonar.java.JavaSquid.scanTests(JavaSquid.java:125)
at org.sonar.java.JavaSquid.scan(JavaSquid.java:114)
at org.sonar.plugins.java.JavaSquidSensor.execute(JavaSquidSensor.java:87)
at org.sonarsource.sonarlint.core.analyzer.sensor.SensorWrapper.analyse(SensorWrapper.java:52)
at org.sonarsource.sonarlint.core.analyzer.sensor.SensorsExecutor.executeSensor(SensorsExecutor.java:73)
at org.sonarsource.sonarlint.core.analyzer.sensor.SensorsExecutor.execute(SensorsExecutor.java:63)
at org.sonarsource.sonarlint.core.analyzer.sensor.PhaseExecutor.execute(PhaseExecutor.java:44)
at org.sonarsource.sonarlint.core.container.analysis.AnalysisContainer.doAfterStart(AnalysisContainer.java:143)
at org.sonarsource.sonarlint.core.container.ComponentContainer.startComponents(ComponentContainer.java:125)
at org.sonarsource.sonarlint.core.container.ComponentContainer.execute(ComponentContainer.java:110)
at org.sonarsource.sonarlint.core.container.standalone.StandaloneGlobalContainer.analyze(StandaloneGlobalContainer.java:118)
at org.sonarsource.sonarlint.core.StandaloneSonarLintEngineImpl.analyze(StandaloneSonarLintEngineImpl.java:93)
at org.sonarsource.sonarlint.core.StandaloneSonarLintEngineImpl.analyze(StandaloneSonarLintEngineImpl.java:83)
at org.sonarlint.eclipse.core.internal.jobs.StandaloneSonarLintClientFacade.runAnalysis(StandaloneSonarLintClientFacade.java:60)
at org.sonarlint.eclipse.core.internal.jobs.AnalyzeProjectJob.run(AnalyzeProjectJob.java:463)
at org.sonarlint.eclipse.core.internal.jobs.AnalyzeProjectJob$AnalysisThread.run(AnalyzeProjectJob.java:127)

Users with the same issue

You are the first who have seen this exception. Write a tip to help other users and build your expert profile.

Know the solutions? Share your knowledge to help other developers to debug faster.