diff --git a/pmd/etc/changelog.txt b/pmd/etc/changelog.txt index 4bb2d754ca..d5512ead80 100644 --- a/pmd/etc/changelog.txt +++ b/pmd/etc/changelog.txt @@ -12,6 +12,7 @@ Fixed bug 1114003 - UnusedPrivateMethod no longer reports false positives when t Fixed bug 1472843 - UnusedPrivateMethod no longer reports false positives when a private method is only called from a method that contains a variable with the same name as that method. Fixed bug 1461442 - UseAssertSameInsteadOfAssertTrue now ignores comparisons to null; UseAssertNullInsteadOfAssertTrue will report those. Fixed bug 1474778 - UnnecessaryCaseChange no longer flags usages of toUpperCase(Locale). +Fixed bug 1423429 - ImmutableField no longer reports false positives on variables which can be set via an anonymous inner class that is created in the constructor. Fixed major bug in CPD; it was not picking up files other than .java or .jsp. Fixed a bug in CallSuperInConstructor; it now checks inner classes/enums more carefully. Fixed a bug in VariableNamingConventions; it was not setting the warning message properly. diff --git a/pmd/regress/test/net/sourceforge/pmd/rules/design/ImmutableFieldTest.java b/pmd/regress/test/net/sourceforge/pmd/rules/design/ImmutableFieldTest.java index d84808713d..7c01d11ee2 100644 --- a/pmd/regress/test/net/sourceforge/pmd/rules/design/ImmutableFieldTest.java +++ b/pmd/regress/test/net/sourceforge/pmd/rules/design/ImmutableFieldTest.java @@ -168,7 +168,7 @@ public class ImmutableFieldTest extends SimpleAggregatorTst { private static final String TEST16 = "public class Foo {" + PMD.EOL + - " private int x;" + PMD.EOL + + " private int x = 2 ;" + PMD.EOL + " public Foo() {" + PMD.EOL + " mouseListener = new MouseAdapter() {" + PMD.EOL + " public void mouseClicked(MouseEvent e) {" + PMD.EOL + diff --git a/pmd/rulesets/design.xml b/pmd/rulesets/design.xml index a75a43338f..fe610b7676 100644 --- a/pmd/rulesets/design.xml +++ b/pmd/rulesets/design.xml @@ -654,7 +654,7 @@ public class Foo { diff --git a/pmd/rulesets/scratchpad.xml b/pmd/rulesets/scratchpad.xml index 15efeef449..242a7af45f 100644 --- a/pmd/rulesets/scratchpad.xml +++ b/pmd/rulesets/scratchpad.xml @@ -10,49 +10,6 @@ These are new rules that are still in progress - - -Avoid negation in an assertTrue or assertFalse test. -For example, rephrase: -assertTrue(!expr); -as: -assertFalse(expr); - - - - - - - - - 3 - - - - - - -