OPENJPA-1316 Incorrect hashcode()/equals() implementation(s) in GeneratorImpl. Patch contributed by Heath Thomann.

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1027992 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Donald Woods 2010-10-27 15:01:16 +00:00
parent dcf503dd5a
commit 3b65de0765

View File

@ -73,14 +73,17 @@ public class GeneratorImpl
}
public int hashCode() {
return _seq.hashCode();
return ((_seq == null) ? 0 : _seq.hashCode());
}
public boolean equals(Object other) {
if (other == this)
return true;
if (!(other instanceof GeneratorImpl))
if ((other == null) || (other.getClass() != this.getClass()))
return false;
if (_seq == null)
return false;
return _seq.equals(((GeneratorImpl) other)._seq);
}
}