ClassCastException in PublicApiChecker


  • java-frontend-

When implementing a custom Java rule in my organisation and using PublicApiChecker i get the following error:

java.lang.ClassCastException: cannot be cast to


PublicApiChecker is not part of the java Analyzer public API to write custom rules. Therefore you can’t use it in your custom rules. I would recommend you to duplicate the logic in your rule.


Thansk for the info, i solved the problem in another fashion (somewhat mimicking the internals of PublicApiChecker but reduced to the specific need)

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