Custom Rule Plugin - CompilationUnitTreeImpl ClassCastException

Yep, JavaSymbol was again an implementation class which has been dropped. Use Symbol.MethodSymbol instead (the same way you are using Symbol.TypeSymbol a few lines below).

That would do the trick, and that should not have any adverse impact. If you can not use anymore some method, it was anyway wrong, because these methods should have never been used at first.

Like I said earlier, you should have this ${java.plugin.version} property defined somewhere, or it would simply not work.

  • SQ 7.9.5 embed sonarjava 5.13.*, but you should update it through the SonarQube marketplace to sonarjava 6.3.2.*.
  • You should then use API of java 6.3.2 as well. APIs from version 5.13 and 6.3 are absolutely not compatible.
  • The ramifications are that if you make your plugin rely on API of 5.13, it simply won’t work with the future versions of SonarQube. Note that new LTS 8.9 just got released, and it embeds SonarJava 6.15.1.*. This last version is much closer to 6.3 in terms of API, and a world apart from 5.13.

Good luck with your changes,
Michael