fixing bug 580093

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@295 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Tom Copeland
2002-07-11 18:47:15 +00:00
parent 9ffe4b9b07
commit 394d322142
2 changed files with 17 additions and 1 deletions

View File

@ -39,7 +39,7 @@ public class OverrideBothEqualsAndHashcodeRule extends AbstractRule implements R
if (criteria.isMet()) {
RuleContext ctx = (RuleContext)data;
ctx.getReport().addRuleViolation(createRuleViolation(ctx, 1));
ctx.getReport().addRuleViolation(createRuleViolation(ctx, node.getBeginLine()));
}
criteria = new ViolationCriteria();

View File

@ -0,0 +1,16 @@
public class OverrideBothEqualsAndHashcode5 {
public class Foo {
public boolean equals(Object o) {
return true;
}
}
public boolean equals(Object o) {
return true;
}
public int hashCode() {
return 0;
}
}