Added type check to equals()
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@2049 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
@ -73,8 +73,10 @@ public abstract class AbstractRule extends JavaParserVisitorAdapter implements R
|
||||
}
|
||||
|
||||
public boolean equals(Object o) {
|
||||
Rule r = (Rule) o;
|
||||
return r.getName().equals(getName());
|
||||
if (!(o instanceof Rule)) {
|
||||
return false;
|
||||
}
|
||||
return ((Rule)o).getName().equals(getName());
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
|
Reference in New Issue
Block a user