pmd: fixed #1060 GodClassRule >>> wrong method

This commit is contained in:
Andreas Dangel 2013-01-19 18:28:33 +01:00
parent e3708b5030
commit 7989ae1863
3 changed files with 18 additions and 12 deletions

View File

@ -6,6 +6,7 @@ Fixed bug 1043: node.getEndLine() always returns 0 (ECMAscript)
Fixed bug 1044: Unknown option: -excludemarker
Fixed bug 1047: False Positive in 'for' loops for LocalVariableCouldBeFinal in 5.0.1
Fixed bug 1048: CommentContent Rule, String Index out of range Exception
Fixed bug 1060: GodClassRule >>> wrong method
November 28, 2012 - 5.0.1:

View File

@ -154,9 +154,10 @@ public class GodClassRule extends AbstractJavaRule {
int pairs = 0;
if (methodCount > 1) {
for (int i = 0; i < methodCount - 1; i++) {
for (int i = 0; i < methodCount; i++) {
for (int j = i + 1; j < methodCount; j++) {
String firstMethodName = methods.get(i);
String secondMethodName = methods.get(i + 1);
String secondMethodName = methods.get(j);
Set<String> accessesOfFirstMethod = methodAttributeAccess.get(firstMethodName);
Set<String> accessesOfSecondMethod = methodAttributeAccess.get(secondMethodName);
Set<String> combinedAccesses = new HashSet<String>();
@ -169,6 +170,7 @@ public class GodClassRule extends AbstractJavaRule {
}
}
}
}
return pairs;
}

View File

@ -1,3 +1,6 @@
/**
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
package net.sourceforge.pmd.lang.java.rule.design;
import net.sourceforge.pmd.testframework.SimpleAggregatorTst;