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 |