diff --git a/pmd/etc/changelog.txt b/pmd/etc/changelog.txt index 347aefc216..fe02abe954 100644 --- a/pmd/etc/changelog.txt +++ b/pmd/etc/changelog.txt @@ -8,6 +8,7 @@ Fixed bug 1462184 False +: InsufficientStringBufferDeclaration - wrong size Fixed bug 1465574 - UnusedPrivateMethod no longer reports false positives when a private method is called from a method with a parameter of the same name. Fixed bug 1114003 - UnusedPrivateMethod no longer reports false positives when two methods have the same name and number of arguments but different types. The fix causes PMD to miss a few valid cases, but, c'est la vie. 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 major bug in CPD; it was not picking up files other than .java or .jsp. Fixed bug in C/C++ parser; a '$' is now allowed in an identifier. This is useful in VMS. Fixed a symbol table bug; PMD no longer crashes on enumeration declarations in the same scope containing the same field name diff --git a/pmd/regress/test/net/sourceforge/pmd/rules/junit/UseAssertSameInsteadOfAssertTrueTest.java b/pmd/regress/test/net/sourceforge/pmd/rules/junit/UseAssertSameInsteadOfAssertTrueTest.java index 5ea74b31db..dff36ea06f 100644 --- a/pmd/regress/test/net/sourceforge/pmd/rules/junit/UseAssertSameInsteadOfAssertTrueTest.java +++ b/pmd/regress/test/net/sourceforge/pmd/rules/junit/UseAssertSameInsteadOfAssertTrueTest.java @@ -23,6 +23,7 @@ public class UseAssertSameInsteadOfAssertTrueTest extends SimpleAggregatorTst { new TestDescriptor(TEST2, "assert true a != b", 1, rule), new TestDescriptor(TEST3, "assert false a == b", 1, rule), new TestDescriptor(TEST4, "assert false a != b", 1, rule), + new TestDescriptor(TEST5, "skip assertTrue(x == null), UseAssertNullInsteadOfAssertTrue will pick those up", 0, rule), }); } @@ -54,4 +55,11 @@ public class UseAssertSameInsteadOfAssertTrueTest extends SimpleAggregatorTst { " }" + PMD.EOL + "}"; + private static final String TEST5 = + "public class Foo {" + PMD.EOL + + " public void test1() {" + PMD.EOL + + " assertFalse(a == null);" + PMD.EOL + + " }" + PMD.EOL + + "}"; + } diff --git a/pmd/rulesets/junit.xml b/pmd/rulesets/junit.xml index b2c80e0693..b184182331 100644 --- a/pmd/rulesets/junit.xml +++ b/pmd/rulesets/junit.xml @@ -237,9 +237,12 @@ should be made by more specific methods, like assertSame, assertNotSame. diff --git a/pmd/xdocs/credits.xml b/pmd/xdocs/credits.xml index 7e4ba15e61..c30b2db2f7 100644 --- a/pmd/xdocs/credits.xml +++ b/pmd/xdocs/credits.xml @@ -48,6 +48,7 @@