db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r1448064 - in /db/derby/code/trunk/java/engine/org/apache/derby/impl/sql: catalog/ compile/
Date Wed, 20 Feb 2013 10:32:03 GMT
Author: kahatlen
Date: Wed Feb 20 10:32:03 2013
New Revision: 1448064

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

Make CollectNodesVisitor return a List instead of a Vector.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CollectNodesVisitor.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateTriggerNode.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromSubquery.java
    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/GenerationClauseNode.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/MethodCallNode.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/PredicateList.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/SetOperatorNode.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/TableElementList.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/WindowResultSetNode.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java?rev=1448064&r1=1448063&r2=1448064&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
Wed Feb 20 10:32:03 2013
@@ -167,7 +167,6 @@ import java.util.Hashtable;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Properties;
-import java.util.Vector;
 
 import java.util.List;
 import java.util.Iterator;
@@ -4944,7 +4943,7 @@ public final class	DataDictionaryImpl
 
 		CollectNodesVisitor visitor = new CollectNodesVisitor(ColumnReference.class);
 		actionStmt.accept(visitor);
-		Vector refs = visitor.getList();
+		List refs = visitor.getList();
 		/* we need to sort on position in string, beetle 4324
 		 */
 		Collections.sort(refs, OFFSET_COMPARATOR);

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CollectNodesVisitor.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CollectNodesVisitor.java?rev=1448064&r1=1448063&r2=1448064&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CollectNodesVisitor.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CollectNodesVisitor.java
Wed Feb 20 10:32:03 2013
@@ -21,17 +21,14 @@
 
 package	org.apache.derby.impl.sql.compile;
 
-import org.apache.derby.iapi.services.sanity.SanityManager;
+import java.util.ArrayList;
+import java.util.List;
 import org.apache.derby.iapi.sql.compile.Visitable; 
 import org.apache.derby.iapi.sql.compile.Visitor;
 
-import org.apache.derby.iapi.error.StandardException;
-
-import java.util.Vector;
-
 /**
  * Collect all nodes of the designated type to be returned
- * in a vector.
+ * in a list.
  * <p>
  * Can find any type of node -- the class or class name
  * of the target node is passed in as a constructor
@@ -40,9 +37,10 @@ import java.util.Vector;
  */
 public class CollectNodesVisitor implements Visitor
 {
-	private Vector	nodeList;
-	private Class 	nodeClass;
-	private Class	skipOverClass;
+    private final List nodeList;
+    private final Class nodeClass;
+    private final Class skipOverClass;
+
 	/**
 	 * Construct a visitor
 	 *
@@ -51,8 +49,7 @@ public class CollectNodesVisitor impleme
 	 */
 	public CollectNodesVisitor(Class nodeClass)
 	{
-		this.nodeClass = nodeClass;
-		nodeList = new Vector();
+        this(nodeClass, null);
 	}
 
 	/**
@@ -65,7 +62,8 @@ public class CollectNodesVisitor impleme
 	 */
 	public CollectNodesVisitor(Class nodeClass, Class skipOverClass)
 	{
-		this(nodeClass);
+        this.nodeList = new ArrayList();
+        this.nodeClass = nodeClass;
 		this.skipOverClass = skipOverClass;
 	}
 
@@ -101,7 +99,7 @@ public class CollectNodesVisitor impleme
 	}
 
 	/**
-	 * Don't visit childen under the skipOverClass
+	 * Don't visit children under the skipOverClass
 	 * node, if it isn't null.
 	 *
 	 * @return true/false
@@ -120,9 +118,11 @@ public class CollectNodesVisitor impleme
 	////////////////////////////////////////////////
 	/**
 	 * Return the list of matching nodes.
+     * The returned list may be empty, if there are no matching nodes. It
+     * is never {@code null}.
 	 *
 	 */
-	public Vector getList()
+	public List getList()
 	{
 		return nodeList;
 	}

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateTriggerNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateTriggerNode.java?rev=1448064&r1=1448063&r2=1448064&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateTriggerNode.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateTriggerNode.java
Wed Feb 20 10:32:03 2013
@@ -26,6 +26,7 @@ import java.util.Collections;
 import java.util.Comparator;
 import java.util.Enumeration;
 import java.util.Hashtable;
+import java.util.List;
 import java.util.Vector;
 
 import org.apache.derby.catalog.UUID;
@@ -42,8 +43,6 @@ import org.apache.derby.iapi.sql.diction
 import org.apache.derby.iapi.sql.dictionary.TableDescriptor;
 import org.apache.derby.iapi.sql.dictionary.TriggerDescriptor;
 import org.apache.derby.iapi.sql.execute.ConstantAction;
-import org.apache.derby.iapi.types.DataTypeDescriptor;
-import org.apache.derby.iapi.types.TypeId;
 
 /**
  * A CreateTriggerNode is the root of a QueryTree 
@@ -603,7 +602,7 @@ public class CreateTriggerNode extends D
 			*/
 			CollectNodesVisitor visitor = new CollectNodesVisitor(FromBaseTable.class);
 			actionNode.accept(visitor);
-			Vector tabs = visitor.getList();
+			List tabs = visitor.getList();
 			Collections.sort(tabs, OFFSET_COMPARATOR);
 			for (int i = 0; i < tabs.size(); i++)
 			{
@@ -725,7 +724,7 @@ public class CreateTriggerNode extends D
 
         actionNode.accept( visitor );
 
-        Vector                   columnRefs = visitor.getList();
+        List columnRefs = visitor.getList();
         int                             colRefCount = columnRefs.size();
 
         for ( int crf_idx = 0; crf_idx < colRefCount; crf_idx++ )

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromSubquery.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromSubquery.java?rev=1448064&r1=1448063&r2=1448064&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromSubquery.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromSubquery.java Wed
Feb 20 10:32:03 2013
@@ -21,8 +21,8 @@
 
 package	org.apache.derby.impl.sql.compile;
 
-import java.util.Enumeration;
-import java.util.Vector;
+import java.util.Iterator;
+import java.util.List;
 
 import org.apache.derby.iapi.error.StandardException;
 import org.apache.derby.iapi.sql.compile.C_NodeTypes;
@@ -267,10 +267,10 @@ public class FromSubquery extends FromTa
         // references are illegal. See DERBY-5554 and DERBY-5779.
 		CollectNodesVisitor nestedVTIs = new CollectNodesVisitor( FromVTI.class );
 		subquery.accept( nestedVTIs );
-		Vector vtiRefs = nestedVTIs.getList();
-		for (Enumeration e = vtiRefs.elements(); e.hasMoreElements(); )
+		List vtiRefs = nestedVTIs.getList();
+		for (Iterator it = vtiRefs.iterator(); it.hasNext(); )
 		{
-			FromVTI ref = (FromVTI) e.nextElement();
+			FromVTI ref = (FromVTI) it.next();
             ref.addOuterFromList( fromListParam );
 		}
         

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=1448064&r1=1448063&r2=1448064&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 Wed Feb
20 10:32:03 2013
@@ -32,6 +32,8 @@ 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;
@@ -901,11 +903,11 @@ public class FromVTI extends FromTable i
 		 * from other VTIs that appear after this one in the FROM list.
 		 * These CRs will have uninitialized column and table numbers.
 		 */
-		Vector colRefs = getNodesFromParameters(ColumnReference.class);
+		List colRefs = getNodesFromParameters(ColumnReference.class);
 		Vector aggregateVector = null;
-		for (Enumeration e = colRefs.elements(); e.hasMoreElements(); )
+		for (Iterator it = colRefs.iterator(); it.hasNext(); )
 		{
-			ColumnReference ref = (ColumnReference)e.nextElement();
+			ColumnReference ref = (ColumnReference) it.next();
 
             //
             // Table Function parameters may not reference columns from other tables in the
@@ -1006,11 +1008,11 @@ public class FromVTI extends FromTable i
 	 *
 	 * @param nodeClass	The Class of interest.
 	 *
-	 * @return A vector containing all of the nodes of interest.
+	 * @return A list containing all of the nodes of interest.
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
-	Vector getNodesFromParameters(Class nodeClass)
+	List getNodesFromParameters(Class nodeClass)
 		throws StandardException
 	{
 		CollectNodesVisitor getCRs = new CollectNodesVisitor(nodeClass);
@@ -1610,10 +1612,10 @@ public class FromVTI extends FromTable i
      */
     private void remapBaseTableColumns() throws StandardException
     {
-		Vector colRefs = getNodesFromParameters(ColumnReference.class);
-		for (Enumeration e = colRefs.elements(); e.hasMoreElements(); )
+		List colRefs = getNodesFromParameters(ColumnReference.class);
+		for (Iterator it = colRefs.iterator(); it.hasNext(); )
 		{
-			ColumnReference ref = (ColumnReference)e.nextElement();
+			ColumnReference ref = (ColumnReference) it.next();
             FromTable   fromTable = (FromTable) argSources.get( new Integer( ref.getTableNumber()
) );
 
             if ( fromTable != null )
@@ -1678,8 +1680,8 @@ public class FromVTI extends FromTable i
 		// o  No ? or ColumnReferences in parameters
 
 		boolean reuseablePs = version2 &&
-			(getNodesFromParameters(ParameterNode.class).size() == 0) &&
-			(getNodesFromParameters(ColumnReference.class).size() == 0);
+			(getNodesFromParameters(ParameterNode.class).isEmpty()) &&
+			(getNodesFromParameters(ColumnReference.class).isEmpty());
 
 
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/GenerationClauseNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/GenerationClauseNode.java?rev=1448064&r1=1448063&r2=1448064&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/GenerationClauseNode.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/GenerationClauseNode.java
Wed Feb 20 10:32:03 2013
@@ -21,32 +21,17 @@
 
 package	org.apache.derby.impl.sql.compile;
 
-import org.apache.derby.iapi.sql.dictionary.DataDictionary;
-import org.apache.derby.iapi.sql.dictionary.TableDescriptor;
-
-import org.apache.derby.iapi.sql.compile.CompilerContext;
+import java.util.List;
 
 import org.apache.derby.iapi.sql.depend.ProviderList;
 
 import org.apache.derby.iapi.reference.SQLState;
 
-import org.apache.derby.iapi.types.TypeId;
-import org.apache.derby.iapi.types.DataTypeDescriptor;
-
 import org.apache.derby.iapi.services.compiler.MethodBuilder;
-import org.apache.derby.iapi.services.compiler.LocalField;
 import org.apache.derby.iapi.services.sanity.SanityManager;
 
- import org.apache.derby.iapi.store.access.Qualifier;
-
-import org.apache.derby.impl.sql.compile.ExpressionClassBuilder;
-
-import java.lang.reflect.Modifier;
-
 import org.apache.derby.iapi.error.StandardException;
 
-import java.sql.Types;
-
 import java.util.Vector;
 
 /**
@@ -145,22 +130,18 @@ public class GenerationClauseNode extend
     }
     
 	/**
-	 * Return a vector of columns referenced in the generation expression.
+	 * Return a list of columns referenced in the generation expression.
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
-    public Vector findReferencedColumns()
+    public List findReferencedColumns()
         throws StandardException
     {
         CollectNodesVisitor visitor = new CollectNodesVisitor( ColumnReference.class );
 
         _generationExpression.accept( visitor );
 
-        Vector result = visitor.getList();
-
-        if ( result == null ) { result = new Vector(); }
-
-        return result;
+        return visitor.getList();
     }
 
 	/*

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/MethodCallNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/MethodCallNode.java?rev=1448064&r1=1448063&r2=1448064&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/MethodCallNode.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/MethodCallNode.java
Wed Feb 20 10:32:03 2013
@@ -56,11 +56,10 @@ import org.apache.derby.iapi.util.JBitSe
 import org.apache.derby.catalog.types.RoutineAliasInfo;
 
 import java.lang.reflect.Member;
-import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
 
 import java.sql.ResultSet;
-import java.util.Enumeration;
+import java.util.Iterator;
 import java.util.List;
 import java.util.StringTokenizer;
 import java.util.Vector;
@@ -239,10 +238,9 @@ abstract class MethodCallNode extends Ja
 	{
 		CollectNodesVisitor getCRs = new CollectNodesVisitor(ColumnReference.class);
 		accept(getCRs);
-		Vector colRefs = getCRs.getList();
-		for (Enumeration e = colRefs.elements(); e.hasMoreElements(); )
+		for (Iterator it = getCRs.getList().iterator(); it.hasNext(); )
 		{
-			ColumnReference ref = (ColumnReference)e.nextElement();
+			ColumnReference ref = (ColumnReference) it.next();
 			if (ref.getCorrelated())
 			{
 				correlationMap.set(ref.getTableNumber());

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=1448064&r1=1448063&r2=1448064&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 Wed
Feb 20 10:32:03 2013
@@ -21,7 +21,6 @@
 
 package	org.apache.derby.impl.sql.compile;
 
-import org.apache.derby.iapi.services.loader.GeneratedMethod;
 
 import org.apache.derby.iapi.services.compiler.MethodBuilder;
 import org.apache.derby.iapi.services.compiler.LocalField;
@@ -41,25 +40,15 @@ import org.apache.derby.iapi.sql.compile
 import org.apache.derby.iapi.sql.compile.AccessPath;
 import org.apache.derby.iapi.sql.compile.C_NodeTypes;
 
-import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
-
-import org.apache.derby.iapi.sql.execute.ExecIndexRow;
 import org.apache.derby.iapi.sql.execute.ExecutionFactory;
 
-import org.apache.derby.iapi.sql.Activation;
-import org.apache.derby.iapi.sql.Row;
 
 import org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor;
 import org.apache.derby.iapi.sql.dictionary.TableDescriptor;
-import org.apache.derby.iapi.sql.dictionary.StatisticsDescriptor;
-import org.apache.derby.iapi.types.DataValueDescriptor;
 import org.apache.derby.iapi.types.DataValueDescriptor;
 
-import org.apache.derby.iapi.store.access.Qualifier;
 import org.apache.derby.iapi.store.access.ScanController;
 
-import org.apache.derby.impl.sql.compile.ExpressionClassBuilder;
-import org.apache.derby.impl.sql.compile.ActivationClassBuilder;
 
 import org.apache.derby.iapi.services.sanity.SanityManager;
 
@@ -67,11 +56,10 @@ import org.apache.derby.iapi.util.JBitSe
 
 import java.lang.reflect.Modifier;
 
-import java.sql.Types;
 
 import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.Properties;
+import java.util.Iterator;
+import java.util.List;
 import java.util.Vector;
 
 /**
@@ -1480,7 +1468,7 @@ public class PredicateList extends Query
                 new CollectNodesVisitor(ColumnReference.class);
 
 			predicate.getAndNode().accept(getCRs);
-			Vector colRefs = getCRs.getList();
+			List colRefs = getCRs.getList();
 
 			/* state doesn't become true until we find the 1st
 			 * ColumnReference.  (We probably will always find
@@ -1489,9 +1477,9 @@ public class PredicateList extends Query
 			boolean state = colRefs.size() > 0;
 			if (state)
 			{
-				for (Enumeration e = colRefs.elements(); e.hasMoreElements(); )
+				for (Iterator it = colRefs.iterator(); it.hasNext(); )
 				{
-					ColumnReference ref = (ColumnReference)e.nextElement();
+					ColumnReference ref = (ColumnReference) it.next();
 					if (!ref.pointsToColumnReference())
 					{
 						state = false;
@@ -1644,10 +1632,10 @@ public class PredicateList extends Query
 			predicate.getAndNode().accept(collectCRs);
 		}
 
-		Vector colRefs = collectCRs.getList();
-		for (Enumeration e = colRefs.elements(); e.hasMoreElements(); )
+		List colRefs = collectCRs.getList();
+		for (Iterator it = colRefs.iterator(); it.hasNext(); )
 		{
-			ColumnReference ref = (ColumnReference)e.nextElement();
+			ColumnReference ref = (ColumnReference) it.next();
 			ResultColumn source = ref.getSource();
 
             // DERBY-4391: Don't try to call markAllRCsInChainReferenced() if

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=1448064&r1=1448063&r2=1448064&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 Wed
Feb 20 10:32:03 2013
@@ -22,7 +22,6 @@
 
 package	org.apache.derby.impl.sql.compile;
 
-import java.util.Arrays;
 import org.apache.derby.iapi.sql.compile.CostEstimate;
 import org.apache.derby.iapi.sql.compile.Optimizer;
 import org.apache.derby.iapi.sql.compile.Visitor;
@@ -39,7 +38,6 @@ import org.apache.derby.iapi.reference.L
 import org.apache.derby.iapi.reference.SQLState;
 import org.apache.derby.iapi.error.StandardException;
 
-import org.apache.derby.iapi.store.access.TransactionController;
 
 import org.apache.derby.iapi.services.sanity.SanityManager;
 
@@ -47,6 +45,7 @@ import org.apache.derby.iapi.util.JBitSe
 
 import java.util.Vector;
 import java.util.HashSet;
+import java.util.List;
 
 /**
  * A SelectNode represents the result set for any of the basic DML
@@ -95,7 +94,7 @@ public class SelectNode extends ResultSe
 	/**
 	 * List of window function calls (e.g. ROW_NUMBER, AVG(i), DENSE_RANK).
 	 */
-	Vector windowFuncCalls;
+	List windowFuncCalls;
 
 	/** User specified a group by without aggregates and we turned 
 	 * it into a select distinct 
@@ -195,7 +194,7 @@ public class SelectNode extends ResultSe
 
 			for (int i=0; i < windowFuncCalls.size(); i++) {
 				WindowFunctionNode wfn =
-					(WindowFunctionNode)windowFuncCalls.elementAt(i);
+					(WindowFunctionNode) windowFuncCalls.get(i);
 
 				// Some window function, e.g. ROW_NUMBER() contains an inline
 				// window specification, so we add it to our list of window
@@ -1315,11 +1314,11 @@ public class SelectNode extends ResultSe
 			CollectNodesVisitor cnvw =
 				new CollectNodesVisitor(WindowFunctionNode.class);
             orderByLists[0].accept(cnvw);
-			Vector wfcInOrderBy = cnvw.getList();
+			List wfcInOrderBy = cnvw.getList();
 
 			for (int i=0; i < wfcInOrderBy.size(); i++) {
 				WindowFunctionNode wfn =
-					(WindowFunctionNode)wfcInOrderBy.elementAt(i);
+					(WindowFunctionNode) wfcInOrderBy.get(i);
 				windowFuncCalls.add(wfn);
 
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SetOperatorNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SetOperatorNode.java?rev=1448064&r1=1448063&r2=1448064&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SetOperatorNode.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SetOperatorNode.java
Wed Feb 20 10:32:03 2013
@@ -25,23 +25,21 @@ import org.apache.derby.iapi.services.sa
 
 import org.apache.derby.iapi.error.StandardException;
 
-import org.apache.derby.iapi.sql.compile.AccessPath;
 import org.apache.derby.iapi.sql.compile.C_NodeTypes;
 import org.apache.derby.iapi.sql.compile.CostEstimate;
 import org.apache.derby.iapi.sql.compile.Optimizable;
 import org.apache.derby.iapi.sql.compile.OptimizablePredicate;
 import org.apache.derby.iapi.sql.compile.OptimizablePredicateList;
 
-import org.apache.derby.iapi.sql.dictionary.DataDictionary;
 import org.apache.derby.iapi.sql.dictionary.TableDescriptor;
 
 import org.apache.derby.iapi.reference.SQLState;
 import org.apache.derby.iapi.types.DataTypeDescriptor;
-import org.apache.derby.iapi.types.StringDataValue;
 
 import org.apache.derby.iapi.util.JBitSet;
 
 import java.util.HashMap;
+import java.util.List;
 
 /**
  * A SetOperatorNode represents a UNION, INTERSECT, or EXCEPT in a DML statement. Binding
and optimization
@@ -223,7 +221,7 @@ abstract class SetOperatorNode extends T
 		// Find all UnionNodes in the subtree.
 		CollectNodesVisitor cnv = new CollectNodesVisitor(UnionNode.class);
 		this.accept(cnv);
-		java.util.Vector unions = cnv.getList();
+		List unions = cnv.getList();
 
 		// Now see if any of them have unpushed predicates.
 		boolean genPRN = false;

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=1448064&r1=1448063&r2=1448064&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
Wed Feb 20 10:32:03 2013
@@ -33,7 +33,6 @@ import org.apache.derby.iapi.sql.compile
 import org.apache.derby.iapi.sql.compile.C_NodeTypes;
 
 import org.apache.derby.iapi.types.DataTypeDescriptor;
-import org.apache.derby.iapi.types.StringDataValue;
 import org.apache.derby.iapi.types.TypeId;
 
 import org.apache.derby.catalog.types.DefaultInfoImpl;
@@ -63,6 +62,7 @@ import org.apache.derby.catalog.UUID;
 import java.util.ArrayList;
 import java.util.Hashtable;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Properties;
 import java.util.Vector;
 
@@ -931,11 +931,11 @@ public class TableElementList extends Qu
         {
             ColumnDefinitionNode    cdn = (ColumnDefinitionNode) generatedColumns.get( i
);
             GenerationClauseNode    generationClauseNode = cdn.getGenerationClauseNode();
-            Vector                  referencedColumns = generationClauseNode.findReferencedColumns();
+            List                    referencedColumns = generationClauseNode.findReferencedColumns();
             int                     refCount = referencedColumns.size();
             for ( int j = 0; j < refCount; j++ )
             {
-                String  name = ((ColumnReference) referencedColumns.elementAt( j ) ).getColumnName();
+                String name = ((ColumnReference) referencedColumns.get(j)).getColumnName();
 
                 if ( name != null )
                 {

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/WindowResultSetNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/WindowResultSetNode.java?rev=1448064&r1=1448063&r2=1448064&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/WindowResultSetNode.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/WindowResultSetNode.java
Wed Feb 20 10:32:03 2013
@@ -20,37 +20,16 @@
 
 package org.apache.derby.impl.sql.compile;
 
-import java.util.Iterator;
-import java.util.Vector;
 import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.Collections;
-
-import org.apache.derby.catalog.IndexDescriptor;
+import java.util.List;
 import org.apache.derby.iapi.error.StandardException;
 import org.apache.derby.iapi.reference.ClassName;
-import org.apache.derby.iapi.reference.SQLState;
 import org.apache.derby.iapi.services.classfile.VMOpcode;
 import org.apache.derby.iapi.services.compiler.MethodBuilder;
-import org.apache.derby.iapi.services.io.FormatableArrayHolder;
 import org.apache.derby.iapi.services.io.FormatableBitSet;
 import org.apache.derby.iapi.services.sanity.SanityManager;
 import org.apache.derby.iapi.sql.LanguageFactory;
-import org.apache.derby.iapi.sql.ResultColumnDescriptor;
-import org.apache.derby.iapi.sql.compile.AccessPath;
 import org.apache.derby.iapi.sql.compile.C_NodeTypes;
-import org.apache.derby.iapi.sql.compile.CostEstimate;
-import org.apache.derby.iapi.sql.compile.Optimizable;
-import org.apache.derby.iapi.sql.compile.OptimizablePredicate;
-import org.apache.derby.iapi.sql.compile.OptimizablePredicateList;
-import org.apache.derby.iapi.sql.compile.Optimizer;
-import org.apache.derby.iapi.sql.compile.RequiredRowOrdering;
-import org.apache.derby.iapi.sql.compile.RowOrdering;
-import org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor;
-import org.apache.derby.iapi.sql.dictionary.DataDictionary;
-import org.apache.derby.iapi.store.access.ColumnOrdering;
-import org.apache.derby.impl.sql.execute.AggregatorInfo;
-import org.apache.derby.impl.sql.execute.AggregatorInfoList;
 
 
 /**
@@ -64,7 +43,7 @@ public class WindowResultSetNode extends
      * over the windowing node and parent is set to that node.
      */
     FromTable   parent;
-    Vector windowFuncCalls;
+    List windowFuncCalls;
     WindowDefinitionNode wdn;
 
     /**
@@ -85,7 +64,7 @@ public class WindowResultSetNode extends
     {
         super.init(bottomPR, null);
         this.wdn = (WindowDefinitionNode)windowDef;
-        this.windowFuncCalls = (Vector)windowFuncCalls;
+        this.windowFuncCalls = (List) windowFuncCalls;
         setLevel(((Integer)nestingLevel).intValue());
 
         ResultColumnList newBottomRCL;
@@ -175,13 +154,13 @@ public class WindowResultSetNode extends
 
         parent.getResultColumns().accept(getCRVisitor);
 
-        Vector colRefs = getCRVisitor.getList();
+        List colRefs = getCRVisitor.getList();
 
         // Find all unique columns referenced and add those to windowing result
         // set.
-        Vector uniqueCols = new Vector();
+        ArrayList uniqueCols = new ArrayList();
         for (int i= 0; i< colRefs.size(); i++) {
-            ColumnReference cr = (ColumnReference)colRefs.elementAt(i);
+            ColumnReference cr = (ColumnReference) colRefs.get(i);
             if (!colRefAlreadySeen(uniqueCols, cr)) {
                 uniqueCols.add(cr);
             }
@@ -195,18 +174,18 @@ public class WindowResultSetNode extends
             new CollectNodesVisitor(VirtualColumnNode.class);
 
         parent.getResultColumns().accept(getVCVisitor);
-        Vector vcs = getVCVisitor.getList();
+        List vcs = getVCVisitor.getList();
 
         // Add any virtual columns to windowing result.
         for (int i= 0; i< vcs.size(); i++) {
-            uniqueCols.add(vcs.elementAt(i));
+            uniqueCols.add(vcs.get(i));
         }
 
         ResultColumnList bottomRCL  = childResult.getResultColumns();
         ResultColumnList windowingRCL = resultColumns;
 
         for (int i= 0; i< uniqueCols.size(); i++) {
-            ValueNode crOrVcn = (ValueNode)uniqueCols.elementAt(i);
+            ValueNode crOrVcn = (ValueNode) uniqueCols.get(i);
 
             ResultColumn newRC = (ResultColumn) getNodeFactory().getNode(
                     C_NodeTypes.RESULT_COLUMN,
@@ -253,12 +232,12 @@ public class WindowResultSetNode extends
      * @return true if an equivalent column reference to cand is already
      * present in uniqueColRefs
      */
-    private boolean colRefAlreadySeen(Vector uniqueColRefs,
+    private boolean colRefAlreadySeen(List uniqueColRefs,
                                       ColumnReference cand)
             throws StandardException {
 
         for (int i= 0; i< uniqueColRefs.size(); i++) {
-            ColumnReference cr = (ColumnReference)uniqueColRefs.elementAt(i);
+            ColumnReference cr = (ColumnReference) uniqueColRefs.get(i);
 
             if (cr.isEquivalent(cand)) {
                 return true;
@@ -294,7 +273,7 @@ public class WindowResultSetNode extends
 
         for (int i=0; i < windowFuncCalls.size(); i++) {
             WindowFunctionNode winFunc =
-                (WindowFunctionNode)windowFuncCalls.elementAt(i);
+                (WindowFunctionNode) windowFuncCalls.get(i);
 
             if (SanityManager.DEBUG) {
                 SanityManager.ASSERT(

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj?rev=1448064&r1=1448063&r2=1448064&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj Wed Feb
20 10:32:03 2013
@@ -10203,10 +10203,10 @@ groupingColumnReference(GroupByList grou
         // rather than ordinary function calls.
         CollectNodesVisitor  functionSniffer = new CollectNodesVisitor( StaticMethodCallNode.class
);
         columnExpression.accept( functionSniffer );
-        Vector    functionNodes = functionSniffer.getList();
+        List functionNodes = functionSniffer.getList();
         for ( int i = 0; i < functionNodes.size(); i++ )
         {
-            ((StaticMethodCallNode) functionNodes.elementAt( i )).setAppearsInGroupBy();
+            ((StaticMethodCallNode) functionNodes.get(i)).setAppearsInGroupBy();
         }
 
 		if (columnExpression.isParameterNode()) 



Mime
View raw message