pmd: fix #1049 Errors in "How to write a rule"

This commit is contained in:
Romain PELISSE 2013-01-26 20:23:36 +01:00 committed by Andreas Dangel
parent e603844a53
commit c080fdda08
3 changed files with 7 additions and 3 deletions

View File

@ -20,6 +20,10 @@ Fixed bug 1048: CommentContent Rule, String Index out of range Exception
Fixed bug 1055: Please add a colon in the ant output after line,column for Oracle JDeveloper IDE usage
Fixed bug 1060: GodClassRule >>> wrong method
????? ??, 2013 - 5.0.2:
Fixed bug 1049: Errors in “How to write a rule”
November 28, 2012 - 5.0.1:
Fixed bug 820: False+ AvoidReassigningParameters

View File

@ -73,7 +73,7 @@ public class GenericClassCounterRule extends AbstractJavaRule {
private int threshold;
private static String counterLabel;
public GenericClassCounterRule() {
definePropertyDescriptor(NAME_MATCH_DESCRIPTOR);
definePropertyDescriptor(OPERAND_DESCRIPTOR);
@ -178,7 +178,7 @@ public class GenericClassCounterRule extends AbstractJavaRule {
}
// Cleaning the context for the others rules
ctx.removeAttribute(counterLabel);
super.start(ctx);
super.end(ctx);
}
}
}

View File

@ -317,7 +317,7 @@ public class CountRule extends AbstractJavaRule {
AtomicLong total = (AtomicLong)ctx.getAttribute(COUNT);
addViolation(ctx, null, new Object[] { total });
ctx.removeAttribute(COUNT);
super.start(ctx);
super.end(ctx);
}
}
]]>