openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hthom...@apache.org
Subject svn commit: r1423116 - /openjpa/branches/2.1.x/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/PredicateImpl.java
Date Mon, 17 Dec 2012 20:08:44 GMT
Author: hthomann
Date: Mon Dec 17 20:08:43 2012
New Revision: 1423116

URL: http://svn.apache.org/viewvc?rev=1423116&view=rev
Log:
OPENJPA-2304: Protect the expressin list for concurrent access - back ported to 2.1.x Pinaki's
commit in trunk.

Modified:
    openjpa/branches/2.1.x/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/PredicateImpl.java

Modified: openjpa/branches/2.1.x/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/PredicateImpl.java
URL: http://svn.apache.org/viewvc/openjpa/branches/2.1.x/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/PredicateImpl.java?rev=1423116&r1=1423115&r2=1423116&view=diff
==============================================================================
--- openjpa/branches/2.1.x/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/PredicateImpl.java
(original)
+++ openjpa/branches/2.1.x/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/PredicateImpl.java
Mon Dec 17 20:08:43 2012
@@ -19,6 +19,7 @@
 package org.apache.openjpa.persistence.criteria;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 import java.util.concurrent.CopyOnWriteArrayList;
 
@@ -48,10 +49,10 @@ abstract class PredicateImpl extends Exp
     public static final Predicate TRUE  = new Expressions.Equal(ONE,ONE);
     public static final Predicate FALSE = new Expressions.NotEqual(ONE,ONE);
     
-    protected final List<Predicate> _exps = new ArrayList<Predicate>();
+    protected final List<Predicate> _exps = Collections.synchronizedList(new ArrayList<Predicate>());
     private final BooleanOperator _op;
     private boolean _negated = false;
-
+    
     /**
      * An AND predicate with no arguments.
      */



Mime
View raw message