OPENJPA-1318 Incorrect hashcode()/equals() implementation(s) for ExtentImpl. Patch contributed by Heath Thomann.

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1028452 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Donald Woods 2010-10-28 19:58:31 +00:00
parent 54234f6102
commit 9230486ff7

View File

@ -104,14 +104,17 @@ public class ExtentImpl<T>
}
public int hashCode() {
return _extent.hashCode();
return ((_extent == null) ? 0 : _extent.hashCode());
}
public boolean equals(Object other) {
if (other == this)
return true;
if (!(other instanceof ExtentImpl))
if ((other == null) || (other.getClass() != this.getClass()))
return false;
if (_extent == null)
return false;
return _extent.equals(((ExtentImpl) other)._extent);
}
}