Fixed false negatives in UseArraysAsList, thanks to Fabio Insaccanebbia for the patch!

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@4716 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Tom Copeland
2006-10-20 19:38:12 +00:00
parent 2fb2fcd14d
commit ddf3533bbf
4 changed files with 7 additions and 5 deletions

View File

@ -20,6 +20,7 @@ PMD now requires JDK 1.4 to run. Note that, however, PMD will still analyze cod
SummaryHTML Report changes from Brent Fisher - now contains linePrefix to support source output from javadoc using "linksource"
Fixed CSVRenderer - had flipped line and priority columns
Fixed bug in Ant task - CSV reports were being output as text.
Fixed false negatives in UseArraysAsList.
Fixed several JDK 1.5 parsing bugs.
CloseResource rule now checks code without java.sql import.
ArrayIsStoredDirectly rule now checks Constructors

View File

@ -1,4 +1,4 @@
/**
4/**
*
* Added in support for assert as a name using lookaheads
*

View File

@ -181,9 +181,10 @@ public class Foo {
]
//StatementExpression[
PrimaryExpression/PrimaryPrefix/Name[
@Image = concat(ancestor::MethodDeclaration//LocalVariableDeclaration[
substring-before(@Image,'.add') = ancestor::MethodDeclaration//LocalVariableDeclaration[
./Type//ClassOrInterfaceType[
@Image = 'List' or @Image ='ArrayList'
@Image = 'Collection' or
@Image = 'List' or @Image='ArrayList'
]
]
/VariableDeclarator/VariableDeclaratorId[
@ -191,7 +192,7 @@ public class Foo {
@Image="ArrayList"
]
)=1
]/@Image,".add")
]/@Image
]
and
PrimaryExpression/PrimarySuffix/Arguments/ArgumentList/Expression/PrimaryExpression/PrimaryPrefix/Name

View File

@ -52,6 +52,7 @@
</subsection>
<subsection name="Contributors">
<ul>
<li><a href="http://www.livejournal.com/users/insac/">Fabio Insaccanebbia</a> - Improvement for UseArraysAsList, UnusedNullCheckInEquals, MisplacedNullCheck, UselessOperationOnImmutable, AvoidArrayLoops, UseArraysAsList, AvoidConstantsInterface, AvoidDecimalLiteralsInBigDecimalConstructor, ClassCastExceptionWithToArray, BigIntegerInstantiation_1.4, BigIntegerInstantiation_1.5</li>
<li>Ryan Gustafson - Patch to fix bug in AvoidDecimalLiteralsInBigDecimalConstructor, patch to add "ref" overrides to RuleSetFactory, patch to fix JDK 1.3 incompatibilities in PMD 2.0</li>
<li>Stefan Seidel - Reported JDK 1.5 parsing bug</li>
<li>Wouter Zelle - Fixed bug in OverrideBothEqualsAndHashcode, wrote BrokenNullCheck rule, fixed a false positive in InefficientStringBuffering, fixed a false positive in NonThreadSafeSingleton, a nice patch to clean up some of the Ant task properties and fix a TextRenderer bug, rewrote PositionLiteralsFirstInComparisons in XPath, Renderer improvement suggestions, wrote NonThreadSafeSingleton rule, wrote DefaultPackage rule, worked thru ASTMethodDeclaration.isSyntacticallyX design, reported docs bug 1292689 for UnnecessaryLocalBeforeReturn, reported leftover ExceptionTypeChecking source file, rewrote UselessOverridingMethod in Java, UselessOverridingMethod rule, ProperLogger rule, nifty code to allow variables in XPath rules, externalInfoUrl data for all rules in basic and unusedcode rulesets, some very nifty XSLT, improvements to UseCorrectExceptionLogging, designed and implemented the "externalInfoUrl" feature in the rule definitions, fixed a devious bug in RuleSetFactory, AvoidPrintStackTrace, initial implementation of SimplifyConditional</li>
@ -107,7 +108,6 @@
<li>Erik Thauvin - reported IDEA integration problem</li>
<li>John Kenny - reported bug in ConsecutiveLiteralAppends</li>
<li>Tom Judge - patch for fix to C/C++ multiline literal support for CPD, patch for including .cc files in C++ CPD checks, patch for JDK compatibility problems</li>
<li><a href="http://www.livejournal.com/users/insac/">Fabio Insaccanebbia</a> - UnusedNullCheckInEquals, MisplacedNullCheck, UselessOperationOnImmutable, AvoidArrayLoops, UseArraysAsList, AvoidConstantsInterface, AvoidDecimalLiteralsInBigDecimalConstructor, ClassCastExceptionWithToArray, BigIntegerInstantiation_1.4, BigIntegerInstantiation_1.5</li>
<li>Sean Mountcastle - reported documentation bug</li>
<li>Greg Broderick - provided patch for 'minimum priority' support</li>
<li>George Sexton - Bug report 1379701 for CompareObjectsWithEquals, suggested new rule for Additional String Concatenation Warnings in StringBuffer.</li>