db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r1452350 - /db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DMLModStatementNode.java
Date Mon, 04 Mar 2013 15:41:23 GMT
Author: kahatlen
Date: Mon Mar  4 15:41:22 2013
New Revision: 1452350

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

Replace use of java.util.Vector with java.util.ArrayList in
DMLModStatementNode.

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

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DMLModStatementNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DMLModStatementNode.java?rev=1452350&r1=1452349&r2=1452350&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DMLModStatementNode.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DMLModStatementNode.java
Mon Mar  4 15:41:22 2013
@@ -21,9 +21,10 @@
 
 package	org.apache.derby.impl.sql.compile;
 
+import java.util.ArrayList;
 import java.util.Hashtable;
 import java.util.Iterator;
-import java.util.Vector;
+import java.util.List;
 
 import org.apache.derby.catalog.DefaultInfo;
 import org.apache.derby.catalog.UUID;
@@ -745,7 +746,7 @@ abstract class DMLModStatementNode exten
 		expression = expression.bindExpression(
 										fakeFromList,
 										(SubqueryList) null,
-										(Vector) null);
+										(List) null);
 	}
 
 	/**
@@ -874,7 +875,7 @@ abstract class DMLModStatementNode exten
     )
 		throws StandardException
 	{
-		Vector								fkVector = new Vector(10);
+		ArrayList							fkVector = new ArrayList();
 		int 								type;
 		UUID[] 								uuids = null;
 		long[] 								conglomNumbers = null;
@@ -885,11 +886,11 @@ abstract class DMLModStatementNode exten
 		ConstraintDescriptorList			activeList = dd.getActiveConstraintDescriptors(cdl);
 		int[]								rowMap = getRowMap(readColsBitSet, td);
 		int[]                               raRules = null;
-		Vector                              refTableNames = new Vector(1);
-		Vector                              refIndexConglomNum = new Vector(1);
-		Vector                              refActions = new Vector(1);
-		Vector                              refColDescriptors = new Vector(1);
-		Vector                              fkColMap = new Vector(1);
+		ArrayList                           refTableNames = new ArrayList(1);
+		ArrayList                           refIndexConglomNum = new ArrayList(1);
+		ArrayList                           refActions = new ArrayList(1);
+		ArrayList                           refColDescriptors = new ArrayList(1);
+		ArrayList                           fkColMap = new ArrayList(1);
 		int activeSize = activeList.size();
 		for (int index = 0; index < activeSize; index++)
 		{
@@ -1005,18 +1006,12 @@ abstract class DMLModStatementNode exten
 		/*
 		** Now convert the vector into an array.
 		*/
-		int size = fkVector.size();
-		if (size > 0)
-		{
-			fkInfo = new FKInfo[size];
-			for (int i = 0; i < size; i++)
-			{
-				fkInfo[i] = (FKInfo)fkVector.get(i);
-			}
-		}
+        if (!fkVector.isEmpty()) {
+            fkInfo = (FKInfo[]) fkVector.toArray(new FKInfo[fkVector.size()]);
+        }
 
 		//convert the ref action info vectors to  to arrays
-		size = refActions.size();
+		int size = refActions.size();
 		if (size > 0)
 		{
 			fkTableNames = new String[size];
@@ -1690,7 +1685,7 @@ abstract class DMLModStatementNode exten
 	)
 					throws StandardException
 	{
-		Vector		conglomVector = new Vector();
+		ArrayList conglomVector = new ArrayList();
 
 		DMLModStatementNode.getXAffectedIndexes(td, updatedColumns, colBitSet, conglomVector );
 
@@ -1718,7 +1713,7 @@ abstract class DMLModStatementNode exten
 		TableDescriptor		baseTable,
 		ResultColumnList	updatedColumns,
 		FormatableBitSet				colBitSet,
-		Vector				conglomVector
+		List				conglomVector
 	)
 		throws StandardException
 	{
@@ -1776,7 +1771,7 @@ abstract class DMLModStatementNode exten
 
 	protected	void	markAffectedIndexes
 	(
-		Vector	affectedConglomerates
+		List	affectedConglomerates
     )
 		throws StandardException
 	{



Mime
View raw message