db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
Subject svn commit: r1485333 [3/3] - in /db/derby/code/trunk/java/engine/org/apache/derby: iapi/jdbc/ iapi/services/io/ iapi/services/loader/ iapi/sql/compile/ iapi/sql/conn/ iapi/sql/dictionary/ iapi/sql/execute/ iapi/transaction/ impl/jdbc/ impl/services/dae...
Date Wed, 22 May 2013 18:51:18 GMT
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/AggregatorInfoList.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/AggregatorInfoList.java?rev=1485333&r1=1485332&r2=1485333&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/AggregatorInfoList.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/AggregatorInfoList.java
Wed May 22 18:51:15 2013
@@ -36,7 +36,7 @@ import java.util.Vector;
  * @see java.util.Vector
  *
  */
-public class AggregatorInfoList extends Vector implements Formatable 
+public class AggregatorInfoList extends Vector<AggregatorInfo> implements Formatable

 {
 	/********************************************************
 	**

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java?rev=1485333&r1=1485332&r2=1485333&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java
Wed May 22 18:51:15 2013
@@ -1317,7 +1317,7 @@ class AlterTableConstantAction extends D
         // drop any generated columns which reference this column
         ColumnDescriptorList    generatedColumnList = td.getGeneratedColumns();
         int                                 generatedColumnCount = generatedColumnList.size();
-        ArrayList                   cascadedDroppedColumns = new ArrayList();
+        ArrayList<String>           cascadedDroppedColumns = new ArrayList<String>
();
         for ( int i = 0; i < generatedColumnCount; i++ )
         {
             ColumnDescriptor    generatedColumn = generatedColumnList.elementAt( i );
@@ -1370,7 +1370,7 @@ class AlterTableConstantAction extends D
         // now drop dependent generated columns
         for ( int i = 0; i < cascadedDrops; i++ )
         {
-            String      generatedColumnName = (String) cascadedDroppedColumns.get( i );
+            String      generatedColumnName = cascadedDroppedColumns.get( i );
             
             activation.addWarning
                 ( StandardException.newWarning( SQLState.LANG_GEN_COL_DROPPED, generatedColumnName,
td.getName() ) );
@@ -1563,7 +1563,7 @@ class AlterTableConstantAction extends D
 		ConstraintDescriptorList csdl = dd.getConstraintDescriptors(td);
 		int csdl_size = csdl.size();
 
-		ArrayList newCongloms = new ArrayList();
+		ArrayList<ConstantAction> newCongloms = new ArrayList<ConstantAction>();
 
 		// we want to remove referenced primary/unique keys in the second
 		// round.  This will ensure that self-referential constraints will
@@ -2702,7 +2702,7 @@ class AlterTableConstantAction extends D
 
 		if (! (compressTable || truncateTable))		// then it's drop column
 		{
-		    ArrayList newCongloms = new ArrayList();
+		    ArrayList<ConstantAction> newCongloms = new ArrayList<ConstantAction>();
 			for (int i = 0; i < compressIRGs.length; i++)
 			{
 				int[] baseColumnPositions = compressIRGs[i].baseColumnPositions();
@@ -2854,7 +2854,7 @@ class AlterTableConstantAction extends D
 	 *   be updated to have the conglomerate number of the newly-created
 	 *   physical conglomerate.
 	 */
-	private void createNewBackingCongloms(ArrayList newConglomActions,
+	private void createNewBackingCongloms(ArrayList<ConstantAction> newConglomActions,
                                           long [] ixCongNums)
 		throws StandardException
 	{

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/BaseActivation.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/BaseActivation.java?rev=1485333&r1=1485332&r2=1485333&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/BaseActivation.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/BaseActivation.java
Wed May 22 18:51:15 2013
@@ -112,7 +112,7 @@ public abstract class BaseActivation imp
 	private GeneratedClass gc;	// my Generated class object.
 
 	private boolean checkRowCounts;
-	private HashSet rowCountsCheckedThisExecution = new HashSet(4, 0.9f);
+	private HashSet<Integer> rowCountsCheckedThisExecution = new HashSet<Integer>(4,
0.9f);
 
 	private static final long MAX_SQRT = (long) Math.sqrt(Long.MAX_VALUE);
 
@@ -1535,7 +1535,7 @@ public abstract class BaseActivation imp
 		throws StandardException
 	{
 		rs.openCore();
-		Vector rowCache = new Vector();
+		Vector<ExecRow> rowCache = new Vector<ExecRow>();
 		ExecRow aRow;
 		int cacheSize = 0;
 		FormatableBitSet toClone = null;
@@ -1616,16 +1616,16 @@ public abstract class BaseActivation imp
 
 	// maintain hash table of parent result set vector
 	// a table can have more than one parent source.
-	protected Hashtable parentResultSets;
+	protected Hashtable<String,Vector<TemporaryRowHolder>> parentResultSets;
 	public void setParentResultSet(TemporaryRowHolder rs, String resultSetId)
 	{
-		Vector  rsVector;
+		Vector<TemporaryRowHolder>  rsVector;
 		if(parentResultSets == null)
-			parentResultSets = new Hashtable();
-		rsVector = (Vector) parentResultSets.get(resultSetId);
+			parentResultSets = new Hashtable<String,Vector<TemporaryRowHolder>>();
+		rsVector = (Vector<TemporaryRowHolder>) parentResultSets.get(resultSetId);
 		if(rsVector == null)
 		{
-			rsVector = new Vector();
+			rsVector = new Vector<TemporaryRowHolder>();
 			rsVector.addElement(rs);
 		}else
 		{
@@ -1638,12 +1638,12 @@ public abstract class BaseActivation imp
 	 * get the reference to parent table ResultSets, that will be needed by the 
 	 * referential action dependent table scans.
 	 */
-	public Vector getParentResultSet(String resultSetId)
+	public Vector<TemporaryRowHolder> getParentResultSet(String resultSetId)
 	{
-		return (Vector) parentResultSets.get(resultSetId);
+		return (Vector<TemporaryRowHolder>) parentResultSets.get(resultSetId);
 	}
 
-	public Enumeration getParentResultSetKeys()
+	public Enumeration<String> getParentResultSetKeys()
 	{
 		return parentResultSets.keys();
 	}

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/BasicSortObserver.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/BasicSortObserver.java?rev=1485333&r1=1485332&r2=1485333&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/BasicSortObserver.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/BasicSortObserver.java
Wed May 22 18:51:15 2013
@@ -42,7 +42,7 @@ public class BasicSortObserver implement
 	protected boolean	distinct;
 	private	  boolean	reuseWrappers;
 	private	  ExecRow	execRow;
-	private	  Vector	vector;
+	private	  Vector<DataValueDescriptor[]>	vector;
 
 	/**
 	 * Simple constructor
@@ -64,7 +64,7 @@ public class BasicSortObserver implement
 		this.distinct = distinct;
 		this.execRow = execRow;
 		this.reuseWrappers = reuseWrappers;
-		vector = new Vector();
+		vector = new Vector<DataValueDescriptor[]>();
 	}
 
 	/**
@@ -126,7 +126,7 @@ public class BasicSortObserver implement
 
 		if (lastElement > 0)
 		{
-			DataValueDescriptor[] retval = (DataValueDescriptor[]) vector.elementAt(lastElement -
1);
+			DataValueDescriptor[] retval = vector.elementAt(lastElement - 1);
 			vector.removeElementAt(lastElement - 1);
 			return retval;
 		}

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DDLConstantAction.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DDLConstantAction.java?rev=1485333&r1=1485332&r2=1485333&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DDLConstantAction.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DDLConstantAction.java
Wed May 22 18:51:15 2013
@@ -850,10 +850,10 @@ abstract class DDLConstantAction impleme
 		TransactionController tc = lcc.getTransactionExecute();
 
         int changedColumnCount = columnInfos == null ? 0 : columnInfos.length;
-        HashMap addUdtMap = new HashMap();
-        HashMap dropUdtMap = new HashMap();
-        HashSet addColumnNames = new HashSet();
-        HashSet dropColumnNames = new HashSet();
+        HashMap<String,AliasDescriptor> addUdtMap = new HashMap<String,AliasDescriptor>();
+        HashMap<String,AliasDescriptor> dropUdtMap = new HashMap<String,AliasDescriptor>();
+        HashSet<String> addColumnNames = new HashSet<String>();
+        HashSet<String> dropColumnNames = new HashSet<String>();
 
         // first find all of the new ansi udts which the table must depend on
         // and the old ones which are candidates for removal
@@ -1008,9 +1008,9 @@ abstract class DDLConstantAction impleme
         }
         
 		TransactionController tc = lcc.getTransactionExecute();
-        HashMap               addUdtMap = new HashMap();
-        HashMap               dropUdtMap = new HashMap();
-        HashMap               udtMap = adding ? addUdtMap : dropUdtMap;
+        HashMap<String,AliasDescriptor>               addUdtMap = new HashMap<String,AliasDescriptor>();
+        HashMap<String,AliasDescriptor>               dropUdtMap = new HashMap<String,AliasDescriptor>();
+        HashMap<String,AliasDescriptor>               udtMap = adding ? addUdtMap :
dropUdtMap;
         TypeDescriptor        rawReturnType = aggInfo != null ?
             aggInfo.getReturnType() : routineInfo.getReturnType();
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DDLSingleTableConstantAction.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DDLSingleTableConstantAction.java?rev=1485333&r1=1485332&r2=1485333&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DDLSingleTableConstantAction.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DDLSingleTableConstantAction.java
Wed May 22 18:51:15 2013
@@ -88,7 +88,7 @@ abstract class DDLSingleTableConstantAct
 		boolean clearDeps) throws StandardException
 	{
 		dropConstraint(consDesc, (TableDescriptor)null,
-			(List)null, activation, lcc, clearDeps);
+			(List<ConstantAction>)null, activation, lcc, clearDeps);
 	}
 
 	/**
@@ -105,7 +105,7 @@ abstract class DDLSingleTableConstantAct
 		throws StandardException
 	{
 		dropConstraint(consDesc, skipCreate,
-			(List)null, activation, lcc, clearDeps);
+			(List<ConstantAction>)null, activation, lcc, clearDeps);
 	}
 
 	/**
@@ -122,7 +122,7 @@ abstract class DDLSingleTableConstantAct
 	 *  ex. when dropping a table).
 	 */
 	void dropConstraint(ConstraintDescriptor consDesc,
-		TableDescriptor skipCreate, List newConglomActions,
+		TableDescriptor skipCreate, List<ConstantAction> newConglomActions,
 		Activation activation, LanguageConnectionContext lcc,
 		boolean clearDeps) throws StandardException
 	{
@@ -195,7 +195,7 @@ abstract class DDLSingleTableConstantAct
 		throws StandardException
 	{
 		dropConglomerate(congDesc, td,
-			false, (List)null, activation, lcc);
+			false, (List<ConstantAction>)null, activation, lcc);
 	}
 
 	/**
@@ -215,7 +215,7 @@ abstract class DDLSingleTableConstantAct
 	 */
 	void dropConglomerate(
 		ConglomerateDescriptor congDesc, TableDescriptor td,
-		boolean skipCreate, List newConglomActions,
+		boolean skipCreate, List<ConstantAction> newConglomActions,
 		Activation activation, LanguageConnectionContext lcc)
 		throws StandardException
 	{
@@ -280,7 +280,7 @@ abstract class DDLSingleTableConstantAct
         //get index property
         Properties prop = new Properties ();
         loadIndexProperties(lcc, cd, prop);
-        ArrayList list = new ArrayList();
+        ArrayList<ConstantAction> list = new ArrayList<ConstantAction>();
 
         // drop the existing index.
         dropConglomerate(cd, td, false, list, activation, lcc);

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DeleteCascadeResultSet.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DeleteCascadeResultSet.java?rev=1485333&r1=1485332&r2=1485333&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DeleteCascadeResultSet.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DeleteCascadeResultSet.java
Wed May 22 18:51:15 2013
@@ -131,7 +131,7 @@ class DeleteCascadeResultSet extends Del
 			}
 
 			runFkChecker(true); //check for only RESTRICT referential action rule violations
-			Hashtable mntHashTable = new Hashtable(); //Hash Table to identify  mutiple node for same
table cases. 
+			Hashtable<String,String> mntHashTable = new Hashtable<String,String>(); //Hash
Table to identify  mutiple node for same table cases. 
 			mergeRowHolders(mntHashTable);
 			fireBeforeTriggers(mntHashTable);
 			deleteDeferredRows();
@@ -210,7 +210,7 @@ class DeleteCascadeResultSet extends Del
 	}
 
 
-	void fireBeforeTriggers(Hashtable msht) throws StandardException
+	void fireBeforeTriggers(Hashtable<String,String> msht) throws StandardException
 	{
 		if(!mainNodeForTable) 
 		{
@@ -351,7 +351,7 @@ class DeleteCascadeResultSet extends Del
 
 	//if there is more than one node for the same table, copy the rows
 	// into one node , so that we don't fire trigger more than once.
-	private void mergeRowHolders(Hashtable msht) throws StandardException
+	private void mergeRowHolders(Hashtable<String,String> msht) throws StandardException
 	{
 		if(msht.containsKey(resultSetId) || rowCount ==0)
 		{

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/FKInfo.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/FKInfo.java?rev=1485333&r1=1485332&r2=1485333&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/FKInfo.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/FKInfo.java Wed May
22 18:51:15 2013
@@ -190,7 +190,7 @@ public class FKInfo implements Formatabl
 			return (FKInfo[])null;
 		}
 
-		Vector newfksVector = new Vector();
+		Vector<FKInfo> newfksVector = new Vector<FKInfo>();
 		FKInfo[] newfks = null;
 
 		/*

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericAggregateResultSet.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericAggregateResultSet.java?rev=1485333&r1=1485332&r2=1485333&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericAggregateResultSet.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericAggregateResultSet.java
Wed May 22 18:51:15 2013
@@ -122,7 +122,7 @@ abstract class GenericAggregateResultSet
 	) throws StandardException
 	{
 		GenericAggregator 	aggregators[]; 
-		Vector tmpAggregators = new Vector();
+		Vector<GenericAggregator> tmpAggregators = new Vector<GenericAggregator>();
 		ClassFactory		cf = lcc.getLanguageConnectionFactory().getClassFactory();
 
 		int count = list.size();

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericRIChecker.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericRIChecker.java?rev=1485333&r1=1485332&r2=1485333&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericRIChecker.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericRIChecker.java
Wed May 22 18:51:15 2013
@@ -54,7 +54,7 @@ public abstract class GenericRIChecker
 	protected StaticCompiledOpenConglomInfo refScoci;
 	protected TransactionController		tc;
 
-	private Hashtable 		scanControllers;
+	private Hashtable<Long,ScanController> 		scanControllers;
 	private int				numColumns;
 	private	IndexRow		indexQualifierRow;
 
@@ -69,7 +69,7 @@ public abstract class GenericRIChecker
 	{
 		this.fkInfo = fkinfo;
 		this.tc = tc;
-		scanControllers = new Hashtable();
+		scanControllers = new Hashtable<Long,ScanController>();
 		numColumns = fkInfo.colArray.length;
 		indexQualifierRow = new IndexRow(numColumns);
 
@@ -135,7 +135,7 @@ public abstract class GenericRIChecker
 		** If we haven't already opened this scan controller,
 		** we'll open it now and stick it in the hash table.
 		*/
-		if ((scan = (ScanController)scanControllers.get(hashKey)) == null)
+		if ((scan = scanControllers.get(hashKey)) == null)
 		{
 			setupQualifierRow(searchRow);
 			scan = 
@@ -222,10 +222,10 @@ public abstract class GenericRIChecker
 	void close()
 		throws StandardException
 	{
-		Enumeration e = scanControllers.elements();
+		Enumeration<ScanController> e = scanControllers.elements();
 		while (e.hasMoreElements())
 		{
-			ScanController scan = (ScanController)e.nextElement();
+			ScanController scan = e.nextElement();
 			scan.close();
 		}
 		scanControllers.clear();

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GroupedAggregateResultSet.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GroupedAggregateResultSet.java?rev=1485333&r1=1485332&r2=1485333&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GroupedAggregateResultSet.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GroupedAggregateResultSet.java
Wed May 22 18:51:15 2013
@@ -118,7 +118,7 @@ class GroupedAggregateResultSet extends 
 	//   has seen during this group instance, to eliminate duplicates.
 	//
 	private boolean resultsComplete;
-	private List finishedResults;
+	private List<ExecRow> finishedResults;
 	private ExecIndexRow[]			resultRows;
 	private HashSet [][]			distinctValues;
 
@@ -164,7 +164,7 @@ class GroupedAggregateResultSet extends 
 		super(s, aggregateItem, a, ra, resultSetNumber, optimizerEstimatedRowCount, optimizerEstimatedCost);
 		this.isInSortedOrder = isInSortedOrder;
 		rollup = isRollup;
-		finishedResults = new ArrayList();
+		finishedResults = new ArrayList<ExecRow>();
 		order = (ColumnOrdering[])
 					((FormatableArrayHolder)
 						(a.getPreparedStatement().getSavedObject(orderingItem)))
@@ -762,8 +762,7 @@ class GroupedAggregateResultSet extends 
 					if (distinctValues[level][i].contains(
 						    newValue.getString()))
 						continue;
-					distinctValues[level][i].add(
-						newValue.getString());
+                    addDistinctValue( level, i, newValue );
 				}
 			}
 
@@ -772,6 +771,16 @@ class GroupedAggregateResultSet extends 
 		}
 	}
 
+    /** Helper routine to do casting to shut up the compiler */
+    @SuppressWarnings("unchecked")
+    private void    addDistinctValue( int level, int aggregateNumber, DataValueDescriptor
newValue )
+		throws StandardException
+    {
+        HashSet<String> set = (HashSet<String>) distinctValues[ level ][ aggregateNumber
];
+
+        set.add( newValue.getString() );
+    }
+
 	private void initializeDistinctMaps(int r, boolean allocate)
 	    throws StandardException
 	{
@@ -782,12 +791,12 @@ class GroupedAggregateResultSet extends 
 			if (aInfo.isDistinct())
 			{
 				if (allocate)
-					distinctValues[r][a] = new HashSet();
+					distinctValues[r][a] = new HashSet<String>();
 				else
 					distinctValues[r][a].clear();
 				DataValueDescriptor newValue =
 					aggregates[a].getInputColumnValue(resultRows[r]);
-				distinctValues[r][a].add(newValue.getString());
+                addDistinctValue( r, a, newValue );
 			}
 		}
 	}

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InsertResultSet.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InsertResultSet.java?rev=1485333&r1=1485332&r2=1485333&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InsertResultSet.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InsertResultSet.java
Wed May 22 18:51:15 2013
@@ -119,7 +119,7 @@ class InsertResultSet extends DMLWriteRe
 	** from it's old conglom number to the new one.  It is
 	** bulk insert specific.
 	*/
-	private Hashtable				indexConversionTable;
+	private Hashtable<Long,Long>				indexConversionTable;
 
 	// indexedCols is 1-based
 	private FormatableBitSet					indexedCols;
@@ -539,7 +539,7 @@ class InsertResultSet extends DMLWriteRe
 
 		if (aiCache != null)
 		{
-			HashMap aiHashtable = new HashMap();
+			HashMap<String,Long> aiHashtable = new HashMap<String,Long>();
 			int numColumns = aiCache.length;
 			// this insert updated ai values, store them in some persistent
 			// place so that I can see these values.
@@ -1105,10 +1105,10 @@ class InsertResultSet extends DMLWriteRe
 		{
 			if (triggerInfo != null)
 			{
-				Vector v = null;
+				Vector<AutoincrementCounter> v = null;
 				if (aiCache != null)
 				{
-					v = new Vector();
+					v = new Vector<AutoincrementCounter>();
 					for (int i = 0; i < aiCache.length; i++)
 					{
 						String s, t, c;
@@ -1478,9 +1478,9 @@ class InsertResultSet extends DMLWriteRe
 						/* Self-referencing foreign key.  Both conglomerate
 						 * #s have changed.
 						 */
-						pkConglom = ((Long)indexConversionTable.get(
+						pkConglom = (indexConversionTable.get(
 									new Long(fkInfo.refConglomNumber))).longValue();
-						fkConglom = ((Long)indexConversionTable.get(
+						fkConglom = (indexConversionTable.get(
 										new Long(fkInfo.fkConglomNumbers[index]))).longValue();
 					}
 					else
@@ -1493,9 +1493,9 @@ class InsertResultSet extends DMLWriteRe
 						 * we use the compile time conglomerate #.  This
 						 * is very simple, though not very elegant.
 						 */
-						Long pkConglomLong = (Long)indexConversionTable.get(
+						Long pkConglomLong = indexConversionTable.get(
 												new Long(fkInfo.refConglomNumber));
-						Long fkConglomLong = (Long)indexConversionTable.get(
+						Long fkConglomLong = indexConversionTable.get(
 										new Long(fkInfo.fkConglomNumbers[index]));
 						if (pkConglomLong == null)
 						{
@@ -1532,7 +1532,7 @@ class InsertResultSet extends DMLWriteRe
 					SanityManager.ASSERT(fkInfo.type == FKInfo.FOREIGN_KEY, 
 						"error, expected to only check foreign keys on insert");
 				}
-				Long fkConglom = (Long)indexConversionTable.get(
+				Long fkConglom = indexConversionTable.get(
 										new Long(fkInfo.fkConglomNumbers[0]));
 				bulkValidateForeignKeysCore(
 						tc, cm, fkInfoArray[i], fkConglom.longValue(),
@@ -1865,7 +1865,7 @@ class InsertResultSet extends DMLWriteRe
 		dd.dropStatisticsDescriptors(td.getUUID(), null, tc);
 		long[] newIndexCongloms = new long[numIndexes];
 
-		indexConversionTable = new Hashtable(numIndexes);
+		indexConversionTable = new Hashtable<Long,Long>(numIndexes);
 		// Populate each index
 		for (int index = 0; index < numIndexes; index++)
 		{

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InternalTriggerExecutionContext.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InternalTriggerExecutionContext.java?rev=1485333&r1=1485332&r2=1485333&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InternalTriggerExecutionContext.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InternalTriggerExecutionContext.java
Wed May 22 18:51:15 2013
@@ -92,7 +92,7 @@ class InternalTriggerExecutionContext
 	** space because they can no longer provide meaningful
 	** results.
 	*/
-	private Vector	resultSetVector;
+	private Vector<java.sql.ResultSet>	resultSetVector;
 
 	/**
 	 * aiCounters is a vector of AutoincrementCounters used to keep state which
@@ -108,7 +108,7 @@ class InternalTriggerExecutionContext
 	 * aiHT is a hashtable of autincrement <key, value> pairs. This is used for
 	 * ai values generated by the trigger.
 	 */
-	private Hashtable aiHT;
+	private Hashtable<String,Long> aiHT;
 
 	/**
 	 * Build me a big old nasty trigger execution context.
@@ -149,7 +149,7 @@ class InternalTriggerExecutionContext
 		this.lcc = lcc;
 		this.targetTableId = targetTableId;
 		this.targetTableName = targetTableName;
-		this.resultSetVector = new Vector();
+		this.resultSetVector = new Vector<java.sql.ResultSet>();
 		this.aiCounters = aiCounters;
 
 		lcc.pushTriggerExecutionContext(this);
@@ -235,10 +235,10 @@ class InternalTriggerExecutionContext
 		** Explicitly close all result sets that we have
 		** given out to the user.  
 	 	*/
-		for (Enumeration e = resultSetVector.elements();
+		for (Enumeration<java.sql.ResultSet> e = resultSetVector.elements();
 			 e.hasMoreElements(); )
 		{
-			java.sql.ResultSet rs = (java.sql.ResultSet)e.nextElement();
+			java.sql.ResultSet rs = e.nextElement();
 			try
 			{
 				rs.close();
@@ -532,12 +532,12 @@ class InternalTriggerExecutionContext
 	 * Copy a map of autoincrement values into the trigger 
 	 * execution context hashtable of autoincrement values.
 	 */
-	public void copyHashtableToAIHT(Map from)
+	public void copyHashtableToAIHT(Map<String,Long> from)
 	{
 		if (from == null)
 			return;
 		if (aiHT == null)
-			aiHT = new Hashtable();
+			aiHT = new Hashtable<String,Long>();
 
 		aiHT.putAll(from);
 	}

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/JarUtil.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/JarUtil.java?rev=1485333&r1=1485332&r2=1485333&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/JarUtil.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/JarUtil.java Wed May
22 18:51:15 2013
@@ -345,10 +345,10 @@ public class JarUtil
         throws IOException
     {
         try {
-            return (InputStream) AccessController.doPrivileged
-            (new java.security.PrivilegedExceptionAction(){
+            return AccessController.doPrivileged
+            (new java.security.PrivilegedExceptionAction<InputStream>(){
                 
-                public Object run() throws IOException {    
+                public InputStream run() throws IOException {    
                     try {
                         return new URL(externalPath).openStream();
                     } catch (MalformedURLException mfurle)
@@ -376,10 +376,10 @@ public class JarUtil
             final long currentGenerationId)
             throws StandardException {
         try {
-            return ((Long) AccessController
-                    .doPrivileged(new java.security.PrivilegedExceptionAction() {
+            return (AccessController
+                    .doPrivileged(new java.security.PrivilegedExceptionAction<Long>()
{
 
-                        public Object run() throws StandardException {
+                        public Long run() throws StandardException {
                             long generationId;
                             
                             if (add)

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/SetConstraintsConstantAction.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/SetConstraintsConstantAction.java?rev=1485333&r1=1485332&r2=1485333&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/SetConstraintsConstantAction.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/SetConstraintsConstantAction.java
Wed May 22 18:51:15 2013
@@ -166,7 +166,7 @@ class SetConstraintsConstantAction exten
 			tmpCdl = dd.getConstraintDescriptors((TableDescriptor)null);
 		}
 	
-		Hashtable checkConstraintTables = null;
+		Hashtable<UUID,ConstraintDescriptorList> checkConstraintTables = null;
 		int cdlSize = tmpCdl.size();
 		for (int index = 0; index < cdlSize; index++)
 		{
@@ -204,10 +204,10 @@ class SetConstraintsConstantAction exten
 
 					if (checkConstraintTables == null)
 					{
-						checkConstraintTables = new Hashtable(10);
+						checkConstraintTables = new Hashtable<UUID,ConstraintDescriptorList>(10);
 					}
 
-					ConstraintDescriptorList tabCdl = (ConstraintDescriptorList)
+					ConstraintDescriptorList tabCdl =
 												checkConstraintTables.get(td.getUUID());
 					if (tabCdl == null)
 					{
@@ -291,7 +291,7 @@ class SetConstraintsConstantAction exten
 		validateAllCheckConstraints(lcc, checkConstraintTables);
 	}
 
-	private void validateAllCheckConstraints(LanguageConnectionContext lcc, Hashtable ht)
+	private void validateAllCheckConstraints(LanguageConnectionContext lcc, Hashtable<UUID,ConstraintDescriptorList>
ht)
 		throws StandardException
 	{
 		ConstraintDescriptorList	cdl;
@@ -305,10 +305,10 @@ class SetConstraintsConstantAction exten
 			return;
 		}
 
-		for (Enumeration e = ht.elements(); e.hasMoreElements(); )
+		for (Enumeration<ConstraintDescriptorList> e = ht.elements(); e.hasMoreElements();
)
 		{
 		
-			cdl = (ConstraintDescriptorList) e.nextElement();
+			cdl = e.nextElement();
 			text = null;
 			constraintNames = null;
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/TriggerEventActivator.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/TriggerEventActivator.java?rev=1485333&r1=1485332&r2=1485333&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/TriggerEventActivator.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/TriggerEventActivator.java
Wed May 22 18:51:15 2013
@@ -129,13 +129,20 @@ public class TriggerEventActivator
 		setupExecutors(triggerInfo);
 	}
 
+    /** Perform the cast needed to a list of triggers from the executorLists */
+    @SuppressWarnings("unchecked")
+    private Vector<TriggerDescriptor>   getTriggers( int idx, Vector[] executorLists
)
+    {
+        return (Vector<TriggerDescriptor>) executorLists[ idx ];
+    }
+    
 	private void setupExecutors(TriggerInfo triggerInfo) throws StandardException
 	{
 		executors = new GenericTriggerExecutor[TriggerEvent.MAX_EVENTS][];
 		Vector[] executorLists = new Vector[TriggerEvent.MAX_EVENTS];
 		for (int i = 0; i < TriggerEvent.MAX_EVENTS; i++)
 		{
-			executorLists[i] = new Vector();
+			executorLists[i] = new Vector<TriggerDescriptor>();
 		}
 
 		for (int i = 0; i < triggerInfo.triggerArray.length; i++)
@@ -146,11 +153,11 @@ public class TriggerEventActivator
 				case TriggerDescriptor.TRIGGER_EVENT_INSERT:
 					if (td.isBeforeTrigger())
 					{
-						executorLists[TriggerEvent.BEFORE_INSERT].addElement(td);
+						getTriggers( TriggerEvent.BEFORE_INSERT, executorLists ).addElement( td );
 					}
 					else
 					{
-						executorLists[TriggerEvent.AFTER_INSERT].addElement(td);
+						getTriggers( TriggerEvent.AFTER_INSERT, executorLists ).addElement( td );
 					}
 					break;
 
@@ -158,22 +165,22 @@ public class TriggerEventActivator
 				case TriggerDescriptor.TRIGGER_EVENT_DELETE:
 					if (td.isBeforeTrigger())
 					{
-						executorLists[TriggerEvent.BEFORE_DELETE].addElement(td);
+						getTriggers( TriggerEvent.BEFORE_DELETE, executorLists ).addElement( td );
 					}
 					else
 					{
-						executorLists[TriggerEvent.AFTER_DELETE].addElement(td);
+						getTriggers( TriggerEvent.AFTER_DELETE, executorLists ).addElement( td );
 					}
 					break;
 
 				case TriggerDescriptor.TRIGGER_EVENT_UPDATE:
 					if (td.isBeforeTrigger())
 					{
-						executorLists[TriggerEvent.BEFORE_UPDATE].addElement(td);
+						getTriggers( TriggerEvent.BEFORE_UPDATE, executorLists ).addElement( td );
 					}
 					else
 					{
-						executorLists[TriggerEvent.AFTER_UPDATE].addElement(td);
+						getTriggers( TriggerEvent.AFTER_UPDATE, executorLists ).addElement( td );
 					}
 					break;
 				default:



Mime
View raw message