fixed bug 583482, EmptyCatch/FinallyBlock reporting wrong line number

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@451 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Tom Copeland
2002-07-18 18:49:52 +00:00
parent 249238493d
commit 08d7db1456
4 changed files with 7 additions and 5 deletions

View File

@ -1,4 +1,5 @@
???? 2002 - 0.7:
Fixed bug 583482 - EmptyCatchBlock and EmptyFinallyBlock report the try statement line number.
July 18 2002 - 0.6:
Added new rules: ExcessiveClassLength, ExcessiveMethodLength

View File

@ -1,9 +1,10 @@
update run.bat to point to pmd-0.6.jar
update run.bat to point to pmd-0.7.jar
update the release date in the changelog
move rules from "new_for_v_0_6.xml" into a real ruleset file
move rules from "new_for_v_0_7.xml" into a real ruleset file
cvs rm new_for_0_6.xml
cvs add new_for_0_7.xml
update jar task to reflect pmd-0.6
update jar task to reflect pmd-0.7
update xdocs/running.xml to reflect pmd-0.7
update docs to mention GUI if it's in a presentable state
update release number in project.xml

View File

@ -21,7 +21,7 @@ public class EmptyCatchBlockRule extends AbstractRule implements Rule {
}
ASTBlock catchBlock = (ASTBlock)node.jjtGetChild(2);
if (catchBlock.jjtGetNumChildren() == 0) {
ctx.getReport().addRuleViolation(createRuleViolation(ctx, node.getBeginLine()));
ctx.getReport().addRuleViolation(createRuleViolation(ctx, catchBlock.getBeginLine()));
}
return super.visit(node, data);
}

View File

@ -26,7 +26,7 @@ public class EmptyFinallyBlockRule extends AbstractRule {
SimpleNode finallyBlock = (SimpleNode)node.jjtGetChild(finallyNodeIndex);
if (finallyBlock.jjtGetNumChildren() == 0) {
RuleContext ctx = (RuleContext)data;
ctx.getReport().addRuleViolation(createRuleViolation(ctx, node.getBeginLine()));
ctx.getReport().addRuleViolation(createRuleViolation(ctx, finallyBlock.getBeginLine()));
}
return super.visit(node, data);
}