openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From allee8...@apache.org
Subject svn commit: r815361 - /openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerFactoryImpl.java
Date Tue, 15 Sep 2009 15:15:14 GMT
Author: allee8285
Date: Tue Sep 15 15:15:13 2009
New Revision: 815361

URL: http://svn.apache.org/viewvc?rev=815361&view=rev
Log:
OPENJPA-1301 - Committing contribution by Tim McConnell

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

Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerFactoryImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerFactoryImpl.java?rev=815361&r1=815360&r2=815361&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerFactoryImpl.java
(original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerFactoryImpl.java
Tue Sep 15 15:15:13 2009
@@ -244,13 +244,15 @@
     }
 
     public int hashCode() {
-        return _factory.hashCode();
+        return (_factory == null) ? 0 : _factory.hashCode();
     }
 
     public boolean equals(Object other) {
         if (other == this)
             return true;
-        if (!(other instanceof EntityManagerFactoryImpl))
+        if ((other == null) || (other.getClass() != this.getClass()))
+            return false;
+        if (_factory == null)
             return false;
         return _factory.equals(((EntityManagerFactoryImpl) other)._factory);
     }



Mime
View raw message