openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From allee8...@apache.org
Subject svn commit: r1160528 - /openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/OpenJPAId.java
Date Tue, 23 Aug 2011 02:34:48 GMT
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();



Mime
View raw message