ClassCastException during a java scan for rule s1643

Hi,

While parsing my java project, I have a class for which I have a ClassCastException, for rule S1643 :
java.lang.ClassCastException: class org.sonar.java.model.expression.ParenthesizedTreeImpl cannot be cast to class org.sonar.plugins.java.api.tree.IdentifierTree (org.sonar.java.model.expression.ParenthesizedTreeImpl and org.sonar.plugins.java.api.tree.IdentifierTree are in unnamed module of loader org.sonar.classloader.ClassRealm @6e46d9f4)

Attached the complete stacktrace:
stacktrace analyse error.txt (8.0 KB)

  • Sonarscanner cli 4.6.2.2472, openjdk 11, sonarqube 8.9 enterprise, source java 8
  • The error occurs while parsing the project, but just parsing the class can reproduce it.
  • Analysis done under linux and windows

Do you have an idea of the problem ? or is it a scanner bug?

Thank You.

Hi Julien, good catch, it’s a nasty bug. I created SONARJAVA-3856. Thanks for your feedback.

2 Likes

ok, thanks for the consideration.

Julien

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.