db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r1497742 - /db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/PredicateList.java
Date Fri, 28 Jun 2013 12:03:42 GMT
Author: dag
Date: Fri Jun 28 12:03:42 2013
New Revision: 1497742

URL: http://svn.apache.org/r1497742
Log:
DERBY-673: Get rid of the NodeFactory

Followup fix to patch derby-673-typesafe-lists-2. The patch introduced
an issue causing ConcurrentModificationException. Roll back that change.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/PredicateList.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/PredicateList.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/PredicateList.java?rev=1497742&r1=1497741&r2=1497742&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/PredicateList.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/PredicateList.java Fri
Jun 28 12:03:42 2013
@@ -2155,9 +2155,15 @@ class PredicateList extends QueryTreeNod
         PredicateList searchClauses = new PredicateList(getContextManager());
 		RelationalOperator	equalsNode = null;
 
-        for (Predicate predicate : this)
+		int size = size();
+		for (int index = 0; index < size; index++)
 		{
-			AndNode			andNode = predicate.getAndNode();
+			AndNode			andNode;
+			Predicate		predicate;
+			predicate = elementAt(index);
+
+            andNode = predicate.getAndNode();
+
 
 			// Skip anything that's not a RelationalOperator
 			if (!predicate.isRelationalOpPredicate())
@@ -2230,12 +2236,13 @@ class PredicateList extends QueryTreeNod
 		 * NOTE: We can append to the searchClauses while walking
 		 * them, thus we cannot cache the value of size().
 		 */
-        for (Predicate searchClause : searchClauses)
+		for (int scIndex = 0; scIndex < searchClauses.size(); scIndex++)
 		{
 			ColumnReference searchCR;
 			DataValueDescriptor searchODV = null;
-            RelationalOperator ro =
-               (RelationalOperator)(searchClause.getAndNode()).getLeftOperand();
+			RelationalOperator ro = (RelationalOperator)
+                    (searchClauses.elementAt(scIndex).
+                    getAndNode()).getLeftOperand();
 
 			// Find the ColumnReference and constant value, if any, in the search clause
 			if (ro instanceof UnaryComparisonOperatorNode)



Mime
View raw message