forked from phoedos/pmd
Update changelog, add the new rule to 540.xml
This commit is contained in:
@ -9,6 +9,7 @@ This ruleset contains links to rules that are new in PMD v5.4.0
|
||||
</description>
|
||||
|
||||
<rule ref="rulesets/java/basic.xml/SimplifiedTernary"/>
|
||||
<rule ref="rulesets/java/clone.xml/CloneMethodReturnTypeMustMatchClassName"/>
|
||||
<rule ref="rulesets/java/comments.xml/CommentDefaultAccessModifier"/>
|
||||
<rule ref="rulesets/java/design.xml/SingleMethodSingleton"/>
|
||||
<rule ref="rulesets/java/design.xml/SingletonClassReturningNewInstance"/>
|
||||
|
@ -136,7 +136,10 @@ public class MyClass {
|
||||
class="net.sourceforge.pmd.lang.rule.XPathRule"
|
||||
externalInfoUrl="${pmd.website.baseurl}/rules/java/clone.html#CloneMethodReturnTypeMustMatchClassName">
|
||||
<description>
|
||||
If a class implements cloneable the return type of the method clone() must be the class name.
|
||||
If a class implements cloneable the return type of the method clone() must be the class name. That way, the caller
|
||||
of the clone method doesn't need to cast the returned clone to the correct type.
|
||||
|
||||
Note: This is only possible with Java 1.5 or higher.
|
||||
</description>
|
||||
<priority>3</priority>
|
||||
<properties>
|
||||
|
@ -9,19 +9,30 @@
|
||||
* [#1344](https://sourceforge.net/p/pmd/bugs/1344/): AbstractNaming should check reverse
|
||||
* [#1361](https://sourceforge.net/p/pmd/bugs/1361/): ShortVariable and ShortMethodName configuration
|
||||
|
||||
**New/Modified/Deprecated Rules:**
|
||||
|
||||
**New Rules:**
|
||||
* New Rule: rulesets/java/design.xml/SingleMethodSingletonRule: Verifies that there is only one method called
|
||||
"getInstance". If there are more methods that return the singleton, than it can easily happen, that these
|
||||
are not the same instances - and thus no singleton.
|
||||
* New Rule: rulesets/java/design.xml/SingletonClassReturningNewInstance: Verifies that the method called
|
||||
"getInstance" returns a cached instance not always a fresh, new instance.
|
||||
* Language Java, ruleset design.xml: The rule "UseSingleton" *has been renamed* to "UseUtilityClass".
|
||||
See also bugs [#1059](https://sourceforge.net/p/pmd/bugs/1059) and [#1339](https://sourceforge.net/p/pmd/bugs/1339/).
|
||||
* New Rule: rulesets/pom/basic.xml/ProjectVersionAsDependencyVersion: Checks the usage of ${project.version} in
|
||||
Maven POM files. This rule can be found in the pmd-xml module.
|
||||
* New Rule: rulesets/pom/basic.xml/InvalidDependencyTypes: Verifies that only the default types (jar, war, ...)
|
||||
for dependencies are used. This rule can be found in the pmd-xml module.
|
||||
* New Rule: rulesets/java/comments.xml/CommentDefaultAccessModifier: In order to avoid mistakes with
|
||||
forgotten access modifiers for methods, this rule ensures, that you explicitly mark the usage of the
|
||||
default access modifier by placing a comment.
|
||||
* New Rule: rulesets/java/basic.xml/SimplifiedTernary: Ternary operator with a boolean literal
|
||||
can be simplified with a boolean expression.
|
||||
* New Rule: rulesets/java/unnecessary.xml/UselessQualifiedThis: Flags unnecessary qualified usages
|
||||
of this, when `this` alone would be unique. E.g. use just `this` instead of `Foo.this`.
|
||||
* New Rule: rulesets/java/clone.xml/CloneMethodReturnTypeMustMatchClassName: If a class implements cloneable
|
||||
the return type of the method clone() must be the class name.
|
||||
|
||||
**Modified/Deprecated Rules:**
|
||||
|
||||
* Renamed Rule: Language Java, ruleset design.xml: The rule "UseSingleton" *has been renamed* to "UseUtilityClass".
|
||||
See also bugs [#1059](https://sourceforge.net/p/pmd/bugs/1059) and [#1339](https://sourceforge.net/p/pmd/bugs/1339/).
|
||||
* Modified Rule: rulesets/java/naming.xml/AbstractNaming: By default, this rule flags now classes,
|
||||
that are named "Abstract" but are not abstract. This behavior can be disabled by setting
|
||||
the new property "strict" to false.
|
||||
@ -29,15 +40,8 @@
|
||||
the minimum required length of a variable name.
|
||||
* Modified Rule: rulesets/java/naming.xml/ShortMethodName: Additional property `minimum` to configure
|
||||
the minimum required length of a method name.
|
||||
* New Rule: rulesets/java/comments.xml/CommentDefaultAccessModifier: In order to avoid mistakes with
|
||||
forgotten access modifiers for methods, this rule ensures, that you explicitly mark the usage of the
|
||||
default access modifier by placing a comment.
|
||||
* New Rule: rulesets/java/basic.xml/SimplifiedTernary: Ternary operator with a boolean literal
|
||||
can be simplified with a boolean expression.
|
||||
* Modified Rule: rulesets/java/junit.xml/UseAssertTrueInsteadOfAssertEquals: This rule also flags
|
||||
assertEquals, that use Boolean.TRUE/FALSE constants.
|
||||
* New Rule: rulesets/java/unnecessary.xml/UselessQualifiedThis: Flags unnecessary qualified usages
|
||||
of this, when `this` alone would be unique. E.g. use just `this` instead of `Foo.this`.
|
||||
|
||||
|
||||
**Pull Requests:**
|
||||
@ -50,6 +54,7 @@
|
||||
* [#58](https://github.com/pmd/pmd/pull/58): Add rule for unnecessary literal boolean in ternary operators
|
||||
* [#59](https://github.com/pmd/pmd/pull/59): Add check to Boxed booleans in UseAssertTrueInsteadOfAssertEquals rule
|
||||
* [#60](https://github.com/pmd/pmd/pull/60): Add UselessQualifiedThisRule
|
||||
* [#61](https://github.com/pmd/pmd/pull/61): Add CloneMethodReturnTypeMustMatchClassName rule
|
||||
|
||||
**Bugfixes:**
|
||||
|
||||
|
Reference in New Issue
Block a user