diff --git a/pmd/etc/changelog.txt b/pmd/etc/changelog.txt index e1d586ec13..e4f74da868 100644 --- a/pmd/etc/changelog.txt +++ b/pmd/etc/changelog.txt @@ -4,7 +4,8 @@ Fixed bug 782235 - "ant -version" now prints more details when a file errors out Fixed bug 779874 - LooseCouplingRule no longer triggers on ArrayList Fixed bug 781393 - VariableNameDeclaration no longer throws ClassCastExpression since ASTLocalVariableDeclaration now subclasses AccessNode Fixed bug 797243 - CPD XML report can no longer contain ]]> (CDEnd) -Fixed bug 690196 - PMD now handles both JDK 1.3 and 1.4 code - i.e., non-keyword usage of "assert". +Fixed bug 690196 - PMD now handles both JDK 1.3 and 1.4 code - i.e., usage of "assert" as an identifier. +Fixed bug 805092 - VariableNamingConventionsRule no longer flags serialVersionUID as a violation Fixed bug - Specifying a non-existing rule format on the command line no longer results in a ClassNotFoundException. XPath rules may now include pluggable parameters. This feature is very limited. For now. Tweaked CPD time display field diff --git a/pmd/regress/test/net/sourceforge/pmd/rules/VariableNamingConventionsRuleTest.java b/pmd/regress/test/net/sourceforge/pmd/rules/VariableNamingConventionsRuleTest.java index 13a0037b77..09a412b392 100644 --- a/pmd/regress/test/net/sourceforge/pmd/rules/VariableNamingConventionsRuleTest.java +++ b/pmd/regress/test/net/sourceforge/pmd/rules/VariableNamingConventionsRuleTest.java @@ -12,6 +12,7 @@ public class VariableNamingConventionsRuleTest extends SimpleAggregatorTst { new TestDescriptor(TEST3, "variables names should start with lowercase character", 1, new VariableNamingConventionsRule()), new TestDescriptor(TEST4, "all is well", 0, new VariableNamingConventionsRule()), new TestDescriptor(TEST5, "local finals are ok", 0, new VariableNamingConventionsRule()), + new TestDescriptor(TEST6, "serialVersionUID is OK", 0, new VariableNamingConventionsRule()), }); } @@ -42,4 +43,9 @@ public class VariableNamingConventionsRuleTest extends SimpleAggregatorTst { " final int STATE_READING = 0;" + PMD.EOL + " }" + PMD.EOL + "}"; + + private static final String TEST6 = + "public class Foo {" + PMD.EOL + + " static final long serialVersionUID = 423343L;" + PMD.EOL + + "}"; } diff --git a/pmd/src/net/sourceforge/pmd/rules/VariableNamingConventionsRule.java b/pmd/src/net/sourceforge/pmd/rules/VariableNamingConventionsRule.java index 3a68597015..8364cb92e8 100644 --- a/pmd/src/net/sourceforge/pmd/rules/VariableNamingConventionsRule.java +++ b/pmd/src/net/sourceforge/pmd/rules/VariableNamingConventionsRule.java @@ -42,6 +42,9 @@ public class VariableNamingConventionsRule extends AbstractRule { ASTVariableDeclaratorId childNodeId = (ASTVariableDeclaratorId)childNodeName.jjtGetChild(0); String varName = childNodeId.getImage(); + if (varName.equals("serialVersionUID")) { + return data; + } if (isFinal) { if (!varName.equals(varName.toUpperCase())) { diff --git a/pmd/xdocs/credits.xml b/pmd/xdocs/credits.xml index 349bc0116a..616084bd84 100644 --- a/pmd/xdocs/credits.xml +++ b/pmd/xdocs/credits.xml @@ -38,6 +38,7 @@