mirror of
https://github.com/apache/openjpa.git
synced 2025-03-06 16:39:11 +00:00
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:
parent
54234f6102
commit
9230486ff7
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user