forked from phoedos/pmd
Revert "Update documentation"
This reverts commit 3548fd14c06717460473cf417d3e1b397f0a6165.
This commit is contained in:
@ -15,6 +15,8 @@ entries:
|
||||
url: /tocpage
|
||||
output: pdf
|
||||
type: frontmatter
|
||||
|
||||
# ABOUT
|
||||
- title: About
|
||||
output: web, pdf
|
||||
folderitems:
|
||||
@ -28,198 +30,76 @@ entries:
|
||||
- title: Getting help
|
||||
url: /pmd_about_help.html
|
||||
output: web, pdf
|
||||
|
||||
# USER DOCUMENTATION
|
||||
- title: User Documentation
|
||||
output: web, pdf
|
||||
folderitems:
|
||||
- title: Getting started
|
||||
url: /pmd_userdocs_getting_started.html
|
||||
output: web, pdf
|
||||
- title: Understanding rulesets
|
||||
url: /pmd_userdocs_understanding_rulesets.html
|
||||
output: web, pdf
|
||||
- title: Making rulesets
|
||||
url: /pmd_userdocs_making_rulesets.html
|
||||
output: web, pdf
|
||||
- title: Using rule properties
|
||||
url: /pmd_userdocs_using_properties.html
|
||||
output: web, pdf
|
||||
- title: Best practices
|
||||
url: /pmd_userdocs_best_practices.html
|
||||
output: web, pdf
|
||||
- title: Suppressing warnings
|
||||
url: /pmd_userdocs_suppressing_warnings.html
|
||||
output: web, pdf
|
||||
- title: null
|
||||
output: web, pdf
|
||||
subfolders:
|
||||
- title: Apex Rules
|
||||
- title: Extending PMD
|
||||
output: web, pdf
|
||||
subfolderitems:
|
||||
- title: Index
|
||||
- title: Writing a rule
|
||||
url: /pmd_userdocs_extending_writing_pmd_rules.html
|
||||
output: web, pdf
|
||||
url: /pmd_rules_apex.html
|
||||
- title: Best Practices
|
||||
- title: Writing XPath rules
|
||||
url: /pmd_userdocs_extending_writing_xpath_rules.html
|
||||
output: web, pdf
|
||||
url: /pmd_rules_apex_bestpractices.html
|
||||
- title: Code Style
|
||||
- title: Defining rule properties
|
||||
url: /pmd_userdocs_extending_defining_properties.html
|
||||
output: web, pdf
|
||||
url: /pmd_rules_apex_codestyle.html
|
||||
- title: Design
|
||||
- title: Using and defining code metrics
|
||||
url: /pmd_userdocs_extending_metrics_howto.html
|
||||
output: web, pdf
|
||||
url: /pmd_rules_apex_design.html
|
||||
- title: Error Prone
|
||||
- title: Rule guidelines
|
||||
url: /pmd_userdocs_extending_rule_guidelines.html
|
||||
output: web, pdf
|
||||
url: /pmd_rules_apex_errorprone.html
|
||||
- title: Performance
|
||||
- title: Testing your rules
|
||||
url: /pmd_userdocs_extending_testing.html
|
||||
output: web, pdf
|
||||
url: /pmd_rules_apex_performance.html
|
||||
- title: Security
|
||||
output: web, pdf
|
||||
url: /pmd_rules_apex_security.html
|
||||
- title: Copy-paste detection
|
||||
url: /pmd_userdocs_cpd.html
|
||||
output: web, pdf
|
||||
- title: null
|
||||
output: web, pdf
|
||||
subfolders:
|
||||
- title: Ecmascript Rules
|
||||
- title: Tools / Integrations
|
||||
output: web, pdf
|
||||
subfolderitems:
|
||||
- title: Index
|
||||
- title: Maven PMD plugin
|
||||
output: web, pdf
|
||||
url: /pmd_rules_ecmascript.html
|
||||
- title: Best Practices
|
||||
url: /pmd_userdocs_tools_maven.html
|
||||
- title: Ant
|
||||
output: web, pdf
|
||||
url: /pmd_rules_ecmascript_bestpractices.html
|
||||
- title: Code Style
|
||||
url: /pmd_userdocs_tools_ant.html
|
||||
- title: CI integrations
|
||||
output: web, pdf
|
||||
url: /pmd_rules_ecmascript_codestyle.html
|
||||
- title: Error Prone
|
||||
url: /pmd_userdocs_tools_ci.html
|
||||
- title: Other Tools / Integrations
|
||||
output: web, pdf
|
||||
url: /pmd_rules_ecmascript_errorprone.html
|
||||
- title: null
|
||||
output: web, pdf
|
||||
subfolders:
|
||||
- title: Java Rules
|
||||
output: web, pdf
|
||||
subfolderitems:
|
||||
- title: Index
|
||||
output: web, pdf
|
||||
url: /pmd_rules_java.html
|
||||
- title: Best Practices
|
||||
output: web, pdf
|
||||
url: /pmd_rules_java_bestpractices.html
|
||||
- title: Code Style
|
||||
output: web, pdf
|
||||
url: /pmd_rules_java_codestyle.html
|
||||
- title: Design
|
||||
output: web, pdf
|
||||
url: /pmd_rules_java_design.html
|
||||
- title: Documentation
|
||||
output: web, pdf
|
||||
url: /pmd_rules_java_documentation.html
|
||||
- title: Error Prone
|
||||
output: web, pdf
|
||||
url: /pmd_rules_java_errorprone.html
|
||||
- title: Multithreading
|
||||
output: web, pdf
|
||||
url: /pmd_rules_java_multithreading.html
|
||||
- title: Performance
|
||||
output: web, pdf
|
||||
url: /pmd_rules_java_performance.html
|
||||
- title: null
|
||||
output: web, pdf
|
||||
subfolders:
|
||||
- title: Java Server Pages Rules
|
||||
output: web, pdf
|
||||
subfolderitems:
|
||||
- title: Index
|
||||
output: web, pdf
|
||||
url: /pmd_rules_jsp.html
|
||||
- title: Best Practices
|
||||
output: web, pdf
|
||||
url: /pmd_rules_jsp_bestpractices.html
|
||||
- title: Code Style
|
||||
output: web, pdf
|
||||
url: /pmd_rules_jsp_codestyle.html
|
||||
- title: Design
|
||||
output: web, pdf
|
||||
url: /pmd_rules_jsp_design.html
|
||||
- title: Error Prone
|
||||
output: web, pdf
|
||||
url: /pmd_rules_jsp_errorprone.html
|
||||
- title: Security
|
||||
output: web, pdf
|
||||
url: /pmd_rules_jsp_security.html
|
||||
- title: null
|
||||
output: web, pdf
|
||||
subfolders:
|
||||
- title: Maven POM Rules
|
||||
output: web, pdf
|
||||
subfolderitems:
|
||||
- title: Index
|
||||
output: web, pdf
|
||||
url: /pmd_rules_pom.html
|
||||
- title: Error Prone
|
||||
output: web, pdf
|
||||
url: /pmd_rules_pom_errorprone.html
|
||||
- title: null
|
||||
output: web, pdf
|
||||
subfolders:
|
||||
- title: PLSQL Rules
|
||||
output: web, pdf
|
||||
subfolderitems:
|
||||
- title: Index
|
||||
output: web, pdf
|
||||
url: /pmd_rules_plsql.html
|
||||
- title: Best Practices
|
||||
output: web, pdf
|
||||
url: /pmd_rules_plsql_bestpractices.html
|
||||
- title: Code Style
|
||||
output: web, pdf
|
||||
url: /pmd_rules_plsql_codestyle.html
|
||||
- title: Design
|
||||
output: web, pdf
|
||||
url: /pmd_rules_plsql_design.html
|
||||
- title: Error Prone
|
||||
output: web, pdf
|
||||
url: /pmd_rules_plsql_errorprone.html
|
||||
- title: null
|
||||
output: web, pdf
|
||||
subfolders:
|
||||
- title: Salesforce VisualForce Rules
|
||||
output: web, pdf
|
||||
subfolderitems:
|
||||
- title: Index
|
||||
output: web, pdf
|
||||
url: /pmd_rules_vf.html
|
||||
- title: Security
|
||||
output: web, pdf
|
||||
url: /pmd_rules_vf_security.html
|
||||
- title: null
|
||||
output: web, pdf
|
||||
subfolders:
|
||||
- title: VM Rules
|
||||
output: web, pdf
|
||||
subfolderitems:
|
||||
- title: Index
|
||||
output: web, pdf
|
||||
url: /pmd_rules_vm.html
|
||||
- title: Best Practices
|
||||
output: web, pdf
|
||||
url: /pmd_rules_vm_bestpractices.html
|
||||
- title: Design
|
||||
output: web, pdf
|
||||
url: /pmd_rules_vm_design.html
|
||||
- title: Error Prone
|
||||
output: web, pdf
|
||||
url: /pmd_rules_vm_errorprone.html
|
||||
- title: null
|
||||
output: web, pdf
|
||||
subfolders:
|
||||
- title: XML Rules
|
||||
output: web, pdf
|
||||
subfolderitems:
|
||||
- title: Index
|
||||
output: web, pdf
|
||||
url: /pmd_rules_xml.html
|
||||
- title: Error Prone
|
||||
output: web, pdf
|
||||
url: /pmd_rules_xml_errorprone.html
|
||||
- title: null
|
||||
output: web, pdf
|
||||
subfolders:
|
||||
- title: XSL Rules
|
||||
output: web, pdf
|
||||
subfolderitems:
|
||||
- title: Index
|
||||
output: web, pdf
|
||||
url: /pmd_rules_xsl.html
|
||||
- title: Code Style
|
||||
output: web, pdf
|
||||
url: /pmd_rules_xsl_codestyle.html
|
||||
- title: Performance
|
||||
output: web, pdf
|
||||
url: /pmd_rules_xsl_performance.html
|
||||
url: /pmd_userdocs_tools.html
|
||||
|
||||
# RULE REFERENCE
|
||||
- title: Rule Reference
|
||||
output: web, pdf
|
||||
folderitems:
|
||||
@ -412,6 +292,8 @@ entries:
|
||||
- title: Performance
|
||||
output: web, pdf
|
||||
url: /pmd_rules_xsl_performance.html
|
||||
|
||||
# LANGUAGE SPECIFIC DOCUMENTATION
|
||||
- title: Language Specific Documentation
|
||||
output: web, pdf
|
||||
folderitems:
|
||||
@ -424,6 +306,8 @@ entries:
|
||||
- title: Apex code metrics
|
||||
url: /pmd_apex_metrics_index.html
|
||||
output: web, pdf
|
||||
|
||||
# DEVELOPER DOCUMENTATION
|
||||
- title: Developer Documentation
|
||||
output: web, pdf
|
||||
folderitems:
|
||||
@ -451,15 +335,17 @@ entries:
|
||||
- title: Major contributions
|
||||
output: web, pdf
|
||||
subfolderitems:
|
||||
- title: Adding a new language
|
||||
url: /pmd_devdocs_major_adding_new_language.html
|
||||
output: web, pdf
|
||||
- title: Adding a new CPD language
|
||||
url: /pmd_devdocs_major_adding_new_cpd_language.html
|
||||
output: web, pdf
|
||||
- title: Adding metrics support to a language
|
||||
url: /pmd_devdocs_major_adding_new_metrics_framework.html
|
||||
output: web, pdf
|
||||
- title: Adding a new language
|
||||
url: /pmd_devdocs_major_adding_new_language.html
|
||||
output: web, pdf
|
||||
- title: Adding a new CPD language
|
||||
url: /pmd_devdocs_major_adding_new_cpd_language.html
|
||||
output: web, pdf
|
||||
- title: Adding metrics support to a language
|
||||
url: /pmd_devdocs_major_adding_new_metrics_framework.html
|
||||
output: web, pdf
|
||||
|
||||
# PROJECT DOCUMENTATION
|
||||
- title: Project documentation
|
||||
output: web, pdf
|
||||
folderitems:
|
||||
@ -506,3 +392,4 @@ entries:
|
||||
url: /pmd_projectdocs_committers_merging_pull_requests.html
|
||||
output: web, pdf
|
||||
|
||||
|
||||
|
@ -213,7 +213,7 @@ folder: pmd/rules
|
||||
* [DontImportSun](pmd_rules_java_errorprone.html#dontimportsun): Avoid importing anything from the 'sun.' packages. These packages are not portable and are likel...
|
||||
* [DontUseFloatTypeForLoopIndices](pmd_rules_java_errorprone.html#dontusefloattypeforloopindices): Don't use floating point for loop indices. If you must use floating point, use doubleunless you'r...
|
||||
* [EmptyCatchBlock](pmd_rules_java_errorprone.html#emptycatchblock): Empty Catch Block finds instances where an exception is caught, but nothing is done. In most cir...
|
||||
* [EmptyFinalizer](pmd_rules_java_errorprone.html#emptyfinalizer): Empty finalize methods serve no purpose and should be removed. Note that Oracle has declared Obje...
|
||||
* [EmptyFinalizer](pmd_rules_java_errorprone.html#emptyfinalizer): Empty finalize methods serve no purpose and should be removed.
|
||||
* [EmptyFinallyBlock](pmd_rules_java_errorprone.html#emptyfinallyblock): Empty finally blocks serve no purpose and should be removed.
|
||||
* [EmptyIfStmt](pmd_rules_java_errorprone.html#emptyifstmt): Empty If Statement finds instances where a condition is checked but nothing is done about it.
|
||||
* [EmptyInitializer](pmd_rules_java_errorprone.html#emptyinitializer): Empty initializers serve no purpose and should be removed.
|
||||
@ -224,8 +224,8 @@ folder: pmd/rules
|
||||
* [EmptyTryBlock](pmd_rules_java_errorprone.html#emptytryblock): Avoid empty try blocks - what's the point?
|
||||
* [EmptyWhileStmt](pmd_rules_java_errorprone.html#emptywhilestmt): Empty While Statement finds all instances where a while statement does nothing. If it is a timin...
|
||||
* [EqualsNull](pmd_rules_java_errorprone.html#equalsnull): Tests for null should not use the equals() method. The '==' operator should be used instead.
|
||||
* [FinalizeDoesNotCallSuperFinalize](pmd_rules_java_errorprone.html#finalizedoesnotcallsuperfinalize): If the finalize() is implemented, its last action should be to call super.finalize. Note that Ora...
|
||||
* [FinalizeOnlyCallsSuperFinalize](pmd_rules_java_errorprone.html#finalizeonlycallssuperfinalize): If the finalize() is implemented, it should do something besides just calling super.finalize(). N...
|
||||
* [FinalizeDoesNotCallSuperFinalize](pmd_rules_java_errorprone.html#finalizedoesnotcallsuperfinalize): If the finalize() is implemented, its last action should be to call super.finalize.
|
||||
* [FinalizeOnlyCallsSuperFinalize](pmd_rules_java_errorprone.html#finalizeonlycallssuperfinalize): If the finalize() is implemented, it should do something besides just calling super.finalize().
|
||||
* [FinalizeOverloaded](pmd_rules_java_errorprone.html#finalizeoverloaded): Methods named finalize() should not have parameters. It is confusing and most likely an attempt ...
|
||||
* [FinalizeShouldBeProtected](pmd_rules_java_errorprone.html#finalizeshouldbeprotected): When overriding the finalize(), the new method should be set as protected. If made public, other...
|
||||
* [IdempotentOperations](pmd_rules_java_errorprone.html#idempotentoperations): Avoid idempotent operations - they have no effect.
|
||||
@ -291,7 +291,7 @@ folder: pmd/rules
|
||||
|
||||
* [AddEmptyString](pmd_rules_java_performance.html#addemptystring): The conversion of literals to strings by concatenating them with empty strings is inefficient.It ...
|
||||
* [AppendCharacterWithChar](pmd_rules_java_performance.html#appendcharacterwithchar): Avoid concatenating characters as strings in StringBuffer/StringBuilder.append methods.
|
||||
* [AvoidArrayLoops](pmd_rules_java_performance.html#avoidarrayloops): Instead of manually copying data between two arrays, use the efficient Arrays.copyOf or System.ar...
|
||||
* [AvoidArrayLoops](pmd_rules_java_performance.html#avoidarrayloops): Instead of manually copying data between two arrays, use the efficient System.arraycopy method in...
|
||||
* [AvoidFileStream](pmd_rules_java_performance.html#avoidfilestream): The FileInputStream and FileOutputStream classes contains a finalizer method which will cause gar...
|
||||
* [AvoidInstantiatingObjectsInLoops](pmd_rules_java_performance.html#avoidinstantiatingobjectsinloops): New objects created within loops should be checked to see if they can created outside them and re...
|
||||
* [AvoidUsingShortType](pmd_rules_java_performance.html#avoidusingshorttype): Java uses the 'short' type to reduce memory usage, not to optimize calculation. In fact, the JVM ...
|
||||
|
@ -218,8 +218,6 @@ for (int i = 0; i < 10; i++) {
|
||||
|
||||
The method Object.finalize() is called by the garbage collector on an object when garbage collection determines
|
||||
that there are no more references to the object. It should not be invoked by application logic.
|
||||
|
||||
Note that Oracle has declared Object.finalize() as deprecated since JDK 9.
|
||||
|
||||
**This rule is defined by the following Java class:** [net.sourceforge.pmd.lang.java.rule.errorprone.AvoidCallingFinalizeRule](https://github.com/pmd/pmd/blob/master/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidCallingFinalizeRule.java)
|
||||
|
||||
@ -1506,7 +1504,7 @@ public void doSomething() {
|
||||
|
||||
**Priority:** Medium (3)
|
||||
|
||||
Empty finalize methods serve no purpose and should be removed. Note that Oracle has declared Object.finalize() as deprecated since JDK 9.
|
||||
Empty finalize methods serve no purpose and should be removed.
|
||||
|
||||
```
|
||||
//MethodDeclaration[MethodDeclarator[@Image='finalize'][not(FormalParameters/*)]]
|
||||
@ -1853,7 +1851,7 @@ if (x == null) { // preferred
|
||||
|
||||
**Priority:** Medium (3)
|
||||
|
||||
If the finalize() is implemented, its last action should be to call super.finalize. Note that Oracle has declared Object.finalize() as deprecated since JDK 9.
|
||||
If the finalize() is implemented, its last action should be to call super.finalize.
|
||||
|
||||
```
|
||||
//MethodDeclaration[MethodDeclarator[@Image='finalize'][not(FormalParameters/*)]]
|
||||
@ -1892,7 +1890,7 @@ protected void finalize() {
|
||||
|
||||
**Priority:** Medium (3)
|
||||
|
||||
If the finalize() is implemented, it should do something besides just calling super.finalize(). Note that Oracle has declared Object.finalize() as deprecated since JDK 9.
|
||||
If the finalize() is implemented, it should do something besides just calling super.finalize().
|
||||
|
||||
```
|
||||
//MethodDeclaration[MethodDeclarator[@Image="finalize"][not(FormalParameters/*)]]
|
||||
@ -1925,8 +1923,6 @@ protected void finalize() {
|
||||
|
||||
Methods named finalize() should not have parameters. It is confusing and most likely an attempt to
|
||||
overload Object.finalize(). It will not be called by the VM.
|
||||
|
||||
Note that Oracle has declared Object.finalize() as deprecated since JDK 9.
|
||||
|
||||
```
|
||||
//MethodDeclaration
|
||||
@ -1956,8 +1952,6 @@ public class Foo {
|
||||
|
||||
When overriding the finalize(), the new method should be set as protected. If made public,
|
||||
other classes may invoke it at inappropriate times.
|
||||
|
||||
Note that Oracle has declared Object.finalize() as deprecated since JDK 9.
|
||||
|
||||
```
|
||||
//MethodDeclaration[@Protected="false"]
|
||||
|
@ -63,7 +63,7 @@ sb.append('a'); // use this instead
|
||||
|
||||
**Priority:** Medium (3)
|
||||
|
||||
Instead of manually copying data between two arrays, use the efficient Arrays.copyOf or System.arraycopy method instead.
|
||||
Instead of manually copying data between two arrays, use the efficient System.arraycopy method instead.
|
||||
|
||||
```
|
||||
//Statement[(ForStatement or WhileStatement) and
|
||||
@ -255,7 +255,6 @@ bi4 = new BigInteger(0); // reference BigInteger.ZERO instead
|
||||
**Priority:** Medium High (2)
|
||||
|
||||
Avoid instantiating Boolean objects; you can reference Boolean.TRUE, Boolean.FALSE, or call Boolean.valueOf() instead.
|
||||
Note that new Boolean() is deprecated since JDK 9 for that reason.
|
||||
|
||||
**This rule is defined by the following Java class:** [net.sourceforge.pmd.lang.java.rule.performance.BooleanInstantiationRule](https://github.com/pmd/pmd/blob/master/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/performance/BooleanInstantiationRule.java)
|
||||
|
||||
@ -279,7 +278,6 @@ Boolean buz = Boolean.valueOf(false); // ...., just reference Boolean.FALSE;
|
||||
|
||||
Calling new Byte() causes memory allocation that can be avoided by the static Byte.valueOf().
|
||||
It makes use of an internal cache that recycles earlier instances making it more memory efficient.
|
||||
Note that new Byte() is deprecated since JDK 9 for that reason.
|
||||
|
||||
```
|
||||
//PrimaryPrefix/AllocationExpression
|
||||
@ -454,7 +452,6 @@ good.append("This is a long string, which is pre-sized");
|
||||
|
||||
Calling new Integer() causes memory allocation that can be avoided by the static Integer.valueOf().
|
||||
It makes use of an internal cache that recycles earlier instances making it more memory efficient.
|
||||
Note that new Integer() is deprecated since JDK 9 for that reason.
|
||||
|
||||
```
|
||||
//PrimaryPrefix
|
||||
@ -485,7 +482,6 @@ public class Foo {
|
||||
|
||||
Calling new Long() causes memory allocation that can be avoided by the static Long.valueOf().
|
||||
It makes use of an internal cache that recycles earlier instances making it more memory efficient.
|
||||
Note that new Long() is deprecated since JDK 9 for that reason.
|
||||
|
||||
```
|
||||
//PrimaryPrefix
|
||||
@ -604,7 +600,6 @@ public class C {
|
||||
|
||||
Calling new Short() causes memory allocation that can be avoided by the static Short.valueOf().
|
||||
It makes use of an internal cache that recycles earlier instances making it more memory efficient.
|
||||
Note that new Short() is deprecated since JDK 9 for that reason.
|
||||
|
||||
```
|
||||
//PrimaryPrefix
|
||||
@ -830,17 +825,9 @@ public class SimpleTest extends TestCase {
|
||||
|
||||
**Priority:** Medium (3)
|
||||
|
||||
|
||||
The java.util.Arrays class has a "asList" method that should be used when you want to create a new List from
|
||||
an array of objects. It is faster than executing a loop to copy all the elements of the array one by one.
|
||||
|
||||
Note that the result of Arrays.asList() is backed by the specified array,
|
||||
changes in the returned list will result in the array to be modified.
|
||||
For that reason, it is not possible to add new elements to the returned list of Arrays.asList() (UnsupportedOperationException).
|
||||
You must use new ArrayList<>(Arrays.asList(...)) if that is inconvenient for you (e.g. because of concurrent access).
|
||||
|
||||
|
||||
|
||||
```
|
||||
//Statement[
|
||||
(ForStatement) and (ForStatement//VariableInitializer//Literal[@IntLiteral='true' and @Image='0']) and (count(.//IfStatement)=0)
|
||||
@ -879,7 +866,7 @@ You must use new ArrayList<>(Arrays.asList(...)) if that is inconvenient for you
|
||||
public class Test {
|
||||
public void foo(Integer[] ints) {
|
||||
// could just use Arrays.asList(ints)
|
||||
List<Integer> l= new ArrayList<>(100);
|
||||
List l= new ArrayList(10);
|
||||
for (int i=0; i< 100; i++) {
|
||||
l.add(ints[i]);
|
||||
}
|
||||
|
Reference in New Issue
Block a user