Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to get class information for checkstyle

I have Java code that works properly. But when I checked it with checkstyle it shows some Issue like "Unable to get class information when I imported the package "import org.json.JSONException;".How do I solve this Issue?

like image 422
Prabitha Avatar asked Oct 20 '22 19:10

Prabitha


2 Answers

You can eliminate this issue by setting the 'suppressLoadErrors' property in the 'RedundantThrows' module of your checkstyle.xml file in the following way:

<module name="RedundantThrows">
    <property name="suppressLoadErrors" value="true"/>
</module>
like image 117
jdonmoyer Avatar answered Oct 29 '22 17:10

jdonmoyer


I think RedundantThrows has now been removed, but I saw the same problem with JavadocMethod. Adding suppressLoadErrors worked for me too:

<module name="JavadocMethod">
    <property name="scope" value="public"/>
    <property name="suppressLoadErrors" value="true"/>
</module>
like image 35
Neil Avatar answered Oct 29 '22 15:10

Neil