Use note of PMD

Source: Internet
Author: User
1) failed to check with multiple rule sets at a time
Command line:
E:/software/pmd-2.3/bin> pmd c:/test. Java HTML rulesets/unusedcode. XML, rulesets/basic. xml
Running result:
<HTML> <Table align = "center" cellspacing = "0" cellpadding = "3"> <tr>
<TH >#</Th> <TH> file </Th> <TH> line </Th> <TH> problem </Th> </tr>
</Table> </body> Sample source code:
Import java. util. arraylist;
Import java. util .*;
Public class test {
Public static void main (string [] ARGs ){
Try {
Int I = 0;
If (I> 0 ){}
System. Out. println ("Hello world! ");
} Catch (exception e ){
} Finally {
}
}
}
2) An example of successful running using the source code shown above:
Command Line: e:/software/pmd-2.3/bin> pmd c:/test. Java HTML rulesets/basic. xml
Running result:

# File Line Problem
1 C:/test. Java 11 Avoid empty 'if' statements
2 C:/test. Java 15 Avoid empty catch Blocks
3 C:/test. Java 16 Avoid empty finally Blocks

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.