fixed bug 633892
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@1204 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
@ -58,9 +58,8 @@
|
||||
<target name="pmd">
|
||||
<taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask"/>
|
||||
<!--<pmd reportFile="c:\jdk-1.4.html" rulesetfiles="rulesets/tmp.xml" format="html">-->
|
||||
<pmd reportFile="c:\jdk-1.4.html" rulesetfiles="rulesets/imports.xml,rulesets/unusedcode.xml,rulesets/basic.xml,rulesets/favorites.xml" format="html">
|
||||
<!--<fileset dir="c:\data\pmd\pmd\src\net\sourceforge\pmd\">-->
|
||||
<fileset dir="c:\j2sdk1.4.1_01\src\java\lang">
|
||||
<pmd reportFile="c:\jdk-1.4.html" rulesetfiles="rulesets/basic.xml" format="html">
|
||||
<fileset dir="c:\j2sdk1.4.1_01\src\java\">
|
||||
<include name="**/*.java"/>
|
||||
<!--<exclude name="**/ast**/"/>-->
|
||||
</fileset>
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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();
|
||||
|
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user