1) Checking unsuccessful using multiple rule sets
Command Line:
E: /software/pmd-2.3/bin> PMD C: /Test.java html rules / unusedcode.xml, rules / Basic.xml
operation result:
PMD title> head>
# th> | File th> | line th> | Problem th> tr>
Table> body> html>
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) Example of running successfully using the above example source code:
Command line: E: /software/pmd-2.3/bin> PMD C: /Test.java HTML RuleSets / Basic.xml
operation result:
# Filelineproblem1c: /test.java11avoid Empty 'if' statements2c: /test.java15avoid Empty catch block3c: /test.java16avoid Empty Finally Blocks
转载请注明原文地址:https://www.9cbs.com/read-54895.html
|