forked from phoedos/pmd
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:
@ -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();
|
||||
|
16
pmd/test-data/OverrideBothEqualsAndHashcode5.java
Normal file
16
pmd/test-data/OverrideBothEqualsAndHashcode5.java
Normal 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;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user