openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hthom...@apache.org
Subject svn commit: r1713742 - in /openjpa/branches/2.2.x: ./ openjpa-kernel/src/main/java/org/apache/openjpa/meta/ClassMetaData.java
Date Tue, 10 Nov 2015 22:39:04 GMT
Author: hthomann
Date: Tue Nov 10 22:39:04 2015
New Revision: 1713742

URL: http://svn.apache.org/viewvc?rev=1713742&view=rev
Log:
OPENJPA-2472: Fix concurrency bug in ClassMetaData. Patch contributed by Dalia Abo Sheasha
- back ported to 2.2.x Dalia's trunk changes.

Modified:
    openjpa/branches/2.2.x/   (props changed)
    openjpa/branches/2.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ClassMetaData.java

Propchange: openjpa/branches/2.2.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Nov 10 22:39:04 2015
@@ -2,4 +2,4 @@
 /openjpa/branches/2.0.x:1484136,1484287,1504611
 /openjpa/branches/2.1.x:1415379,1415398,1469090,1469949,1484300,1484313,1485010,1505837,1513249,1517838,1529241,1530146,1533218,1533280,1539188,1569528,1575444,1591536,1614935,1636464,1648430,1655218,1662610,1673300,1673491,1686894,1709201,1709309
 /openjpa/branches/2.2.1.x:1415367,1415413,1415425,1469408,1470097,1484320,1484322,1491895,1504719,1529267,1529340,1530347,1531176,1533222,1539193,1584153,1648450,1651808,1686910
-/openjpa/trunk:1416742,1420324,1430117,1431649,1436957,1436960,1448662,1448796,1451369,1456574,1456614,1459091,1461833,1469646,1469649,1469652,1504282,1558594,1600682,1600757,1603251,1626287,1632647
+/openjpa/trunk:1416742,1420324,1430117,1431649,1436957,1436960,1448662,1448796,1451369,1456574,1456614,1459091,1461833,1469646,1469649,1469652,1504282,1558594,1564989,1600682,1600757,1603251,1626287,1632647

Modified: openjpa/branches/2.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ClassMetaData.java
URL: http://svn.apache.org/viewvc/openjpa/branches/2.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ClassMetaData.java?rev=1713742&r1=1713741&r2=1713742&view=diff
==============================================================================
--- openjpa/branches/2.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ClassMetaData.java
(original)
+++ openjpa/branches/2.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ClassMetaData.java
Tue Nov 10 22:39:04 2015
@@ -2695,19 +2695,20 @@ public class ClassMetaData
 
         // Default to false, set to true only if this type is abstract and
         // declares a PKField.
-        _hasAbstractPKField = Boolean.FALSE;
+        Boolean temp = Boolean.FALSE;
 
         if (isAbstract() == true) {
             FieldMetaData[] declaredFields = getDeclaredFields();
             if (declaredFields != null && declaredFields.length != 0) {
                 for (FieldMetaData fmd : declaredFields) {
                     if (fmd.isPrimaryKey()) {
-                        _hasAbstractPKField = Boolean.TRUE;
+                        temp = Boolean.TRUE;
                         break;
                     }
                 }
             }
         }
+        _hasAbstractPKField = temp;
 
         return _hasAbstractPKField.booleanValue();
     }
@@ -2729,7 +2730,7 @@ public class ClassMetaData
         }
 
         // Default to FALSE, until proven true.
-        _hasPKFieldsFromAbstractClass = Boolean.FALSE;
+        Boolean temp = Boolean.FALSE;
 
         FieldMetaData[] pkFields = getPrimaryKeyFields();
         for (FieldMetaData fmd : pkFields) {
@@ -2744,11 +2745,12 @@ public class ClassMetaData
                     }
                 }
                 if (cmd == fmdDMDA) {
-                    _hasPKFieldsFromAbstractClass = Boolean.TRUE;
+                    temp = Boolean.TRUE;
                     break;
                 }
             }
         }
+        _hasPKFieldsFromAbstractClass = temp;
 
         return _hasPKFieldsFromAbstractClass.booleanValue();
     }
@@ -2786,10 +2788,11 @@ public class ClassMetaData
                 }
             }
             int idsSize = ids.size();
-            _pkAndNonPersistentManagedFmdIndexes = new int[idsSize];
-            for(int i = 0; i<idsSize; i++){
-                _pkAndNonPersistentManagedFmdIndexes[i] = ids.get(i).intValue();
+            int[] temp = new int[idsSize];
+            for (int i = 0; i < idsSize; i++) {
+                temp[i] = ids.get(i).intValue();
             }
+            _pkAndNonPersistentManagedFmdIndexes = temp;
         }
         return _pkAndNonPersistentManagedFmdIndexes;
     }



Mime
View raw message