Fixed bug 1988829 - Violation reported without source file name (actually a fix to ConsecutiveLiteralAppends)

Allowed rootNode to be defaulted whenever 'concurrentCount' is more than 0.  This will allow a VariableDeclaration to be identified as the rootNode, even if it is never referenced later.  JUnit tests pass, I hope this doesn't have unintended consequences.

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6184 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Ryan Gustafson 2008-06-10 05:56:05 +00:00
parent 791e3f10e4
commit d9c6cb8b31
2 changed files with 2 additions and 1 deletions

View File

@ -2,6 +2,7 @@
Fixes for exclude-pattern
Updates to RuleChain to honor RuleSet exclude-pattern
Fixed bug 1988829 - Violation reported without source file name (actually a fix to ConsecutiveLiteralAppends)
May 20, 2008 - 4.2.2:

View File

@ -94,7 +94,7 @@ public class ConsecutiveLiteralAppends extends AbstractRule {
Map<VariableNameDeclaration, List<NameOccurrence>> decls = node.getScope().getVariableDeclarations();
SimpleNode rootNode = null;
// only want the constructor flagged if it's really containing strings
if (concurrentCount == 1) {
if (concurrentCount >= 1) {
rootNode = node;
}
for (Map.Entry<VariableNameDeclaration, List<NameOccurrence>> entry: decls.entrySet()) {