db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r1455045 - in /db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile: FromVTI.java JoinNode.java RowResultSetNode.java SelectNode.java TableElementList.java
Date Mon, 11 Mar 2013 08:18:12 GMT
Author: kahatlen
Date: Mon Mar 11 08:18:12 2013
New Revision: 1455045

URL: http://svn.apache.org/r1455045
Log:
DERBY-6075: Use modern collections in impl/sql/compile

Use ArrayLists for the aggregate vectors.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromVTI.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/JoinNode.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/RowResultSetNode.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SelectNode.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/TableElementList.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromVTI.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromVTI.java?rev=1455045&r1=1455044&r2=1455045&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromVTI.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromVTI.java Mon Mar
11 08:18:12 2013
@@ -30,11 +30,9 @@ import java.sql.ResultSet;
 import java.sql.ResultSetMetaData;
 import java.sql.SQLException;
 import java.util.ArrayList;
-import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Vector;
 import org.apache.derby.catalog.TypeDescriptor;
 import org.apache.derby.catalog.DefaultInfo;
 import org.apache.derby.catalog.UUID;
@@ -541,7 +539,7 @@ public class FromVTI extends FromTable i
 		 * Correlated subqueries are not allowed as parameters to
 		 * a VTI, so pass an empty FromList.
 		 */
-		Vector aggregateVector = new Vector();
+		ArrayList aggregateVector = new ArrayList();
 		methodCall.bindExpression(fromListParam,
 									 subqueryList,
 									 aggregateVector);
@@ -904,7 +902,7 @@ public class FromVTI extends FromTable i
 		 * These CRs will have uninitialized column and table numbers.
 		 */
 		List colRefs = getNodesFromParameters(ColumnReference.class);
-		Vector aggregateVector = null;
+		ArrayList aggregateVector = null;
 		for (Iterator it = colRefs.iterator(); it.hasNext(); )
 		{
 			ColumnReference ref = (ColumnReference) it.next();
@@ -967,7 +965,7 @@ public class FromVTI extends FromTable i
 				// we need a fake agg list
 				if (aggregateVector == null)
 				{
-					aggregateVector = new Vector();
+					aggregateVector = new ArrayList();
 				}
 				ref.bindExpression(fromListParam,
 									subqueryList,

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/JoinNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/JoinNode.java?rev=1455045&r1=1455044&r2=1455045&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/JoinNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/JoinNode.java Mon Mar
11 08:18:12 2013
@@ -57,7 +57,6 @@ import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Properties;
-import java.util.Vector;
 
 /**
  * A JoinNode represents a join result set for either of the basic DML
@@ -809,7 +808,7 @@ public class JoinNode extends TableOpera
 		subqueryList = (SubqueryList) getNodeFactory().getNode(
 											C_NodeTypes.SUBQUERY_LIST,
 											getContextManager());
-		aggregateVector = new Vector();
+		aggregateVector = new ArrayList();
 
         CompilerContext cc = getCompilerContext();
         

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/RowResultSetNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/RowResultSetNode.java?rev=1455045&r1=1455044&r2=1455045&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/RowResultSetNode.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/RowResultSetNode.java
Mon Mar 11 08:18:12 2013
@@ -21,6 +21,7 @@
 
 package	org.apache.derby.impl.sql.compile;
 
+import java.util.ArrayList;
 import java.util.List;
 import org.apache.derby.iapi.sql.compile.CostEstimate;
 import org.apache.derby.iapi.sql.compile.Optimizer;
@@ -50,7 +51,6 @@ import org.apache.derby.iapi.reference.S
 import org.apache.derby.iapi.reference.ClassName;
 import org.apache.derby.iapi.services.classfile.VMOpcode;
 
-import java.util.Vector;
 
 /**
  * A RowResultSetNode represents the result set for a VALUES clause.
@@ -231,7 +231,7 @@ public class RowResultSetNode extends Fr
 										C_NodeTypes.SUBQUERY_LIST,
 										getContextManager());
 
-		aggregateVector = new Vector();
+		aggregateVector = new ArrayList();
 
 		/* Verify that there are no DEFAULTs in the RCL.
 		 * DEFAULT is only valid for an insert, and it has
@@ -264,7 +264,7 @@ public class RowResultSetNode extends Fr
 		// Pop ourselves back out of the FROM list
 		fromListParam.removeElementAt(0);
 
-		if (aggregateVector.size() > 0)
+		if (!aggregateVector.isEmpty())
 		{
 			throw StandardException.newException(SQLState.LANG_NO_AGGREGATES_IN_WHERE_CLAUSE);
 		}

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SelectNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SelectNode.java?rev=1455045&r1=1455044&r2=1455045&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SelectNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SelectNode.java Mon
Mar 11 08:18:12 2013
@@ -43,7 +43,7 @@ import org.apache.derby.iapi.services.sa
 
 import org.apache.derby.iapi.util.JBitSet;
 
-import java.util.Vector;
+import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.List;
 
@@ -555,7 +555,7 @@ public class SelectNode extends ResultSe
 		selectSubquerys = (SubqueryList) getNodeFactory().getNode(
 											C_NodeTypes.SUBQUERY_LIST,
 											getContextManager());
-		selectAggregates = new Vector();
+		selectAggregates = new ArrayList();
 
 		/* Splice our FromList on to the beginning of fromListParam, before binding
 		 * the expressions, for correlated column resolution.
@@ -593,7 +593,7 @@ public class SelectNode extends ResultSe
 			return;
 		}
 
-		whereAggregates = new Vector();
+		whereAggregates = new ArrayList();
 		whereSubquerys = (SubqueryList) getNodeFactory().getNode(
 												C_NodeTypes.SUBQUERY_LIST,
 												getContextManager());
@@ -639,7 +639,7 @@ public class SelectNode extends ResultSe
         {
             int previousReliability = orReliability( CompilerContext.HAVING_CLAUSE_RESTRICTION
);
 
-			havingAggregates = new Vector();
+			havingAggregates = new ArrayList();
 			havingSubquerys = (SubqueryList) getNodeFactory().getNode(
 					C_NodeTypes.SUBQUERY_LIST,
 					getContextManager());
@@ -669,7 +669,7 @@ public class SelectNode extends ResultSe
 		/* If query is grouped, bind the group by list. */
 		if (groupByList != null)
 		{
-			Vector gbAggregateVector = new Vector();
+			ArrayList gbAggregateVector = new ArrayList();
 
 			groupByList.bindGroupByColumns(this,
 										   gbAggregateVector);
@@ -681,7 +681,7 @@ public class SelectNode extends ResultSe
 			*/
 			if (SanityManager.DEBUG)
 			{
-				SanityManager.ASSERT(gbAggregateVector.size() == 0,
+				SanityManager.ASSERT(gbAggregateVector.isEmpty(),
 						"Unexpected Aggregate vector generated by Group By clause");
 			}
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/TableElementList.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/TableElementList.java?rev=1455045&r1=1455044&r2=1455045&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/TableElementList.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/TableElementList.java
Mon Mar 11 08:18:12 2013
@@ -64,7 +64,6 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Properties;
 import java.util.Set;
-import java.util.Vector;
 
 /**
  * A TableElementList represents the list of columns and other table elements
@@ -611,7 +610,7 @@ public class TableElementList extends Qu
 
 		cc = getCompilerContext();
 
-		Vector aggregateVector = new Vector();
+		ArrayList aggregateVector = new ArrayList();
 
 		for (int index = 0; index < size; index++)
 		{
@@ -657,7 +656,7 @@ public class TableElementList extends Qu
 										 aggregateVector);
 
 				// no aggregates, please
-				if (aggregateVector.size() != 0)
+				if (!aggregateVector.isEmpty())
 				{
 					throw StandardException.newException(SQLState.LANG_INVALID_CHECK_CONSTRAINT, cdn.getConstraintText());
 				}
@@ -746,7 +745,7 @@ public class TableElementList extends Qu
         
 		cc = getCompilerContext();
 
-		Vector aggregateVector = new Vector();
+		ArrayList aggregateVector = new ArrayList();
 
 		for (int index = 0; index < size; index++)
 		{
@@ -832,7 +831,7 @@ public class TableElementList extends Qu
                 }
 
 				// no aggregates, please
-				if (aggregateVector.size() != 0)
+				if (!aggregateVector.isEmpty())
 				{
 					throw StandardException.newException( SQLState.LANG_AGGREGATE_IN_GENERATION_CLAUSE,
cdn.getName());
 				}



Mime
View raw message