Hello @HAYOUNGCHOI ,
The JUtils
class is not available in the classloader for custom rules. When writing custom rules, you can only use what is coming from org.sonar.plugins.java.api
. All the rest will make your code crash at runtime. When copy-pasting from existing rules, make sure that there are no such dependencies. I would advise you to re-read this part of the tutorial: What you can use, and what you can’t.
Looking at the code of isPrimitiveWrapper()
, I’m pretty sure you don’t need anything particular from this. I would advise you to simply duplicate the method and the map it uses directly into your rule.
Cheers,
Michael