You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openjpa.apache.org by al...@apache.org on 2011/08/23 04:34:48 UTC

svn commit: r1160528 - /openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/OpenJPAId.java

Author: allee8285
Date: Tue Aug 23 02:34:48 2011
New Revision: 1160528

URL: http://svn.apache.org/viewvc?rev=1160528&view=rev
Log:
OPENJPA-2043 make cached hashcode non-transient and avoid using variant hashcode from Class object.

Modified:
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/OpenJPAId.java

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/OpenJPAId.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/OpenJPAId.java?rev=1160528&r1=1160527&r2=1160528&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/OpenJPAId.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/OpenJPAId.java Tue Aug 23 02:34:48 2011
@@ -42,7 +42,7 @@ public abstract class OpenJPAId
 
     // type hash is based on the least-derived non-object class so that
     // user-given ids with non-exact types match ids with exact types
-    private transient int _typeHash = 0;
+    private int _typeHash = 0;
 
     protected OpenJPAId() {
     }
@@ -115,7 +115,7 @@ public abstract class OpenJPAId
                     base = base.getSuperclass();
                     superclass = base.getSuperclass();
                 }
-                _typeHash = base.hashCode();
+                _typeHash = base.getName().hashCode();
                 _typeCache.put(type, Integer.valueOf(_typeHash));
             } else {
                 _typeHash = typeHashInt.intValue();