Author: dwoods
Date: Thu Oct 28 16:12:12 2010
New Revision: 1028365

URL: http://svn.apache.org/viewvc?rev=1028365&view=rev
Log:
OPENJPA-1317 Incorrect hashcode()/equals() implementation(s) for FetchPlanImpl. 
 Patch contributed by Heath Thomann.

Modified:
    
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/FetchPlanImpl.java

Modified: 
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/FetchPlanImpl.java
URL: 
http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/FetchPlanImpl.java?rev=1028365&r1=1028364&r2=1028365&view=diff
==============================================================================
--- 
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/FetchPlanImpl.java
 (original)
+++ 
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/FetchPlanImpl.java
 Thu Oct 28 16:12:12 2010
@@ -381,14 +381,17 @@ public class FetchPlanImpl
     }
     
     public int hashCode() {
-        return _fetch.hashCode();
+        return ((_fetch == null) ? 0  : _fetch.hashCode());
     }
 
     public boolean equals(Object other) {
         if (other == this)
             return true;
-        if (!(other instanceof FetchPlanImpl))
+        if ((other == null) || (other.getClass() != this.getClass()))
             return false;
+        if (_fetch == null)
+               return false;
+        
         return _fetch.equals(((FetchPlanImpl) other)._fetch);
     }
 


Reply via email to