diff --git a/pmd/etc/build.xml b/pmd/etc/build.xml index 6bc5c63ffc..ccc30407cd 100644 --- a/pmd/etc/build.xml +++ b/pmd/etc/build.xml @@ -58,9 +58,8 @@ - - - + + diff --git a/pmd/etc/changelog.txt b/pmd/etc/changelog.txt index e08509eeba..340643fc34 100644 --- a/pmd/etc/changelog.txt +++ b/pmd/etc/changelog.txt @@ -1,3 +1,7 @@ +???? ?? 2002 - 1.0.1: +Fixed bug 633879: EmptyFinallyBlockRule now handles multiple catch blocks followed by a finally block. +Fixed bug 633892: StringToStringRule false positive exposed problem in symbol table usage to declaration code. + November 04 2002 - 1.0: Added new rules: StringToStringRule, AvoidReassigningParametersRule, UnnecessaryConstructorRule, AvoidStringLiteralsRule Fixed bug 631010: AvoidDeeplyNestedIfStmtsRule works correctly with if..else stmts now diff --git a/pmd/etc/go.bat b/pmd/etc/go.bat index 3058c8b16d..0a5dc54c21 100755 --- a/pmd/etc/go.bat +++ b/pmd/etc/go.bat @@ -2,4 +2,4 @@ set MAIN=net.sourceforge.pmd.PMD set TEST_FILE=c:\\data\\pmd\\pmd\\test-data\\%1%.java -java %MAIN% %TEST_FILE% xml rulesets\tmp.xml +java %MAIN% %TEST_FILE% xml rulesets/tmp.xml diff --git a/pmd/src/net/sourceforge/pmd/rules/StringToStringRule.java b/pmd/src/net/sourceforge/pmd/rules/StringToStringRule.java index 00f7909125..8db250e50c 100644 --- a/pmd/src/net/sourceforge/pmd/rules/StringToStringRule.java +++ b/pmd/src/net/sourceforge/pmd/rules/StringToStringRule.java @@ -22,7 +22,7 @@ public class StringToStringRule extends AbstractRule { if (nameNode instanceof ASTPrimitiveType || !nameNode.getImage().equals("String")) { return data; } - // now we know we're at a node of type String + // now we know we're at a variable declaration of type String Map decls = node.getScope().getVariableDeclarations(true); for (Iterator i = decls.keySet().iterator(); i.hasNext();) { VariableNameDeclaration decl = (VariableNameDeclaration)i.next(); diff --git a/pmd/src/net/sourceforge/pmd/symboltable/AbstractScope.java b/pmd/src/net/sourceforge/pmd/symboltable/AbstractScope.java index 266507d177..44234b83d3 100644 --- a/pmd/src/net/sourceforge/pmd/symboltable/AbstractScope.java +++ b/pmd/src/net/sourceforge/pmd/symboltable/AbstractScope.java @@ -53,7 +53,7 @@ public abstract class AbstractScope implements Scope { public NameDeclaration addVariableNameOccurrence(NameOccurrence occurrence) { NameDeclaration decl = findVariableHere(occurrence); - if (decl != null) { + if (decl != null && !occurrence.isThisOrSuper()) { List nameOccurrences = (List)variableNames.get(decl); nameOccurrences.add(occurrence); }