Checkstyle "unable to get class information for @ throws tag 'xxxexception"

Source: Internet
Author: User
Tags checkstyle

In the past two days, run the checkstyle checkCode"Unable to get class information for @ throws tag 'xxxexception" always appears"

 

After reading it for a long time, I couldn't find the reason. The import in the Java class is correct and there is no problem in compiling anything.

 

Search online and find a discussion,

Http://forums.topcoder.com /? Module = thread & threadid = 508195 & START = 0

 

The cause is that the class configurationexception, which is mentioned in basic1_builder is not in the run classpath of checkstyle, so checkstyle cannot perform any checks on whether it is a checked exception or a runtime exception or other. so this is not really a warning about your code being bad, but a warning about checkstyle being unable to fully check whether the import and usage of the class configurationexception conforms to the coding styles configured.

 

It turns out that the compiled class is not in the classpath of checkstyle.

Therefore, you only need to configure the compiled class to the <checkstyle/> classpath.

 

In addition, it seems that the line length of checkstyle is also a bit problematic. If it is not more than 120 characters, an error is returned.

In eclipse, I changed the maximum line with in Java> code style> formatter to 100, and then formatted it. Basically, there is no problem.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.