db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r1502965 [2/2] - in /db/derby/code/trunk/java: engine/org/apache/derby/catalog/ engine/org/apache/derby/iapi/services/context/ engine/org/apache/derby/iapi/services/property/ engine/org/apache/derby/iapi/sql/ engine/org/apache/derby/iapi/sq...
Date Sun, 14 Jul 2013 12:41:11 GMT
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionContext.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionContext.java?rev=1502965&r1=1502964&r2=1502965&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionContext.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionContext.java Sun Jul 14 12:41:09 2013
@@ -64,7 +64,6 @@ import org.apache.derby.iapi.reference.L
 import org.apache.derby.iapi.sql.execute.ConstantAction;
 import org.apache.derby.iapi.sql.execute.CursorActivation;
 import org.apache.derby.iapi.sql.execute.ExecPreparedStatement;
-import org.apache.derby.iapi.sql.execute.ExecutionContext;
 import org.apache.derby.iapi.sql.execute.ExecutionStmtValidator;
 import org.apache.derby.iapi.sql.Activation;
 import org.apache.derby.iapi.sql.LanguageFactory;
@@ -90,6 +89,8 @@ import java.util.IdentityHashMap;
 import java.util.WeakHashMap;
 import java.util.Iterator;
 import java.util.Map;
+import org.apache.derby.iapi.reference.ContextId;
+import org.apache.derby.iapi.services.context.Context;
 
 /**
  * LanguageConnectionContext keeps the pool of prepared statements,
@@ -418,7 +419,7 @@ public class GenericLanguageConnectionCo
         */
         if (cachedInitialDefaultSchemaDescr == null) {
             DataDictionary dd = getDataDictionary();
-            String authorizationId = getSessionUserId();
+
             SchemaDescriptor sd =
                 dd.getSchemaDescriptor(
                     getSessionUserId(), getTransactionCompile(), false);
@@ -615,8 +616,9 @@ public class GenericLanguageConnectionCo
                 allDeclaredGlobalTempTables.remove(
                         allDeclaredGlobalTempTables.indexOf(tempTableInfo));
 
-                if (allDeclaredGlobalTempTables.size() == 0)
+                if (allDeclaredGlobalTempTables.isEmpty()) {
                     allDeclaredGlobalTempTables = null;
+                }
             }
             else
             {
@@ -1010,7 +1012,7 @@ public class GenericLanguageConnectionCo
             // unit/transaction and not modified
         }
     
-        if (allDeclaredGlobalTempTables.size() == 0)
+        if (allDeclaredGlobalTempTables.isEmpty())
         {
             allDeclaredGlobalTempTables = null;
         }
@@ -1787,12 +1789,11 @@ public class GenericLanguageConnectionCo
     private void resetSavepoints() throws StandardException 
     {
         final ContextManager cm = getContextManager();
-        final List stmts = cm.getContextStack(org.apache.derby.
-                                              iapi.reference.
-                                              ContextId.LANG_STATEMENT);
-        final int end = stmts.size();
-        for (int i = 0; i < end; ++i) {
-            ((StatementContext)stmts.get(i)).resetSavePoint();
+        final List<Context>
+                stmts = cm.getContextStack(ContextId.LANG_STATEMENT);
+
+        for (Context c : stmts) {
+            ((StatementContext)c).resetSavePoint();
         }
     }
 
@@ -1923,7 +1924,7 @@ public class GenericLanguageConnectionCo
      * connection context. If a NUT is active then return NUT else return parent
      * transaction.
      */
-    public TransactionController getTransactionCompile()
+    public final TransactionController getTransactionCompile()
     {
         return (readOnlyNestedTransaction != null) ? readOnlyNestedTransaction : tran;
     }
@@ -2297,7 +2298,7 @@ public class GenericLanguageConnectionCo
      */
     public Long getIdentityValue()
     {
-        return identityNotNull ? new Long(identityVal) : null;
+        return identityNotNull ? Long.valueOf(identityVal) : null;
     }
 
     /**
@@ -2710,8 +2711,8 @@ public class GenericLanguageConnectionCo
      */
     public TriggerExecutionContext getTriggerExecutionContext()
     {
-        return triggerExecutionContexts.size() == 0 ? 
-                (TriggerExecutionContext)null :
+        return triggerExecutionContexts.isEmpty() ?
+                null :
                 triggerExecutionContexts.get( triggerExecutionContexts.size() - 1 );   
     }
 
@@ -2782,7 +2783,7 @@ public class GenericLanguageConnectionCo
      */
     public TableDescriptor getTriggerTable()
     {
-        return triggerTables.size() == 0 ? 
+        return triggerTables.isEmpty() ?
             (TableDescriptor)null :
             triggerTables.get(triggerTables.size() - 1);
     }
@@ -2837,7 +2838,7 @@ public class GenericLanguageConnectionCo
     }
 
     /** @see LanguageConnectionContext#setRunTimeStatisticsMode */
-    public void setRunTimeStatisticsMode(boolean onOrOff)
+    public final void setRunTimeStatisticsMode(boolean onOrOff)
     {
         runTimeStatisticsSetting = onOrOff;
     }
@@ -3115,6 +3116,7 @@ public class GenericLanguageConnectionCo
     /**
      * @see org.apache.derby.iapi.services.context.Context#isLastHandler
      */
+    @Override
     public boolean isLastHandler(int severity)
     {
         return false;
@@ -3174,8 +3176,9 @@ public class GenericLanguageConnectionCo
             //actions during commit and rollback as explained in the comments
             //below.
             ResultSet activationResultSet = a.getResultSet();
-            boolean resultsetReturnsRows =  
-                (activationResultSet != null) && activationResultSet.returnsRows(); ;
+            boolean resultsetReturnsRows =
+                    activationResultSet != null &&
+                    activationResultSet.returnsRows();
 
             if (forRollback) { 
                 if (resultsetReturnsRows)
@@ -3333,7 +3336,7 @@ public class GenericLanguageConnectionCo
         }
         if (autoincrementHT == null)
             return null;
-        return (Long)autoincrementHT.get(aiKey);
+        return autoincrementHT.get(aiKey);
     }   
 
     /**
@@ -3508,6 +3511,7 @@ public class GenericLanguageConnectionCo
         return acts.get(acts.size() - 1);
     }
 
+    @Override
     public StringBuffer appendErrorInfo() {
 
         TransactionController tc = getTransactionExecute();
@@ -3599,7 +3603,7 @@ public class GenericLanguageConnectionCo
         DataDictionary dd = getDataDictionary();
         String dbo = dd.getAuthorizationDatabaseOwner();
 
-        RoleGrantDescriptor grantDesc = null;
+        RoleGrantDescriptor grantDesc;
         String currentUser = getCurrentUserId(a);
 
         if (currentUser.equals(dbo)) {
@@ -3848,7 +3852,7 @@ public class GenericLanguageConnectionCo
     }
 
     public FormatableBitSet getReferencedColumnMap(TableDescriptor td) {
-        return (FormatableBitSet)referencedColumnMap.get(td);
+        return referencedColumnMap.get(td);
     }
 
     public void setReferencedColumnMap(TableDescriptor td,

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/depend/BasicDependencyManager.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/depend/BasicDependencyManager.java?rev=1502965&r1=1502964&r2=1502965&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/depend/BasicDependencyManager.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/depend/BasicDependencyManager.java Sun Jul 14 12:41:09 2013
@@ -170,10 +170,10 @@ public class BasicDependencyManager impl
         // If we find that the dependency we are trying to add in
         // one list is a duplicate, then it should be a duplicate in the
         // other list.
-        boolean addedToDeps = false;
         boolean addedToProvs = false;
+        boolean addedToDeps =
+                addDependencyToTable(dependents, d.getObjectID(), dy);
 
-        addedToDeps = addDependencyToTable(dependents, d.getObjectID(), dy);
         if (addedToDeps) {
             addedToProvs = addDependencyToTable(providers, p.getObjectID(), dy);
         } else if (SanityManager.DEBUG) {
@@ -567,16 +567,15 @@ public class BasicDependencyManager impl
 	 */
     public ProviderInfo[] getPersistentProviderInfos(Dependent dependent)
             throws StandardException {
-		List list = getProviders(dependent);
-        if (list.isEmpty()) {
+        List<Provider> provs = getProviders(dependent);
+
+        if (provs.isEmpty()) {
 			return EMPTY_PROVIDER_INFO;
 		}
 
-        Iterator provIter = list.iterator();
         List<ProviderInfo> pih = new ArrayList<ProviderInfo>();
-        while (provIter.hasNext()) {
-            Provider p = (Provider)provIter.next();
 
+        for (Provider p : provs) {
             if (p.isPersistent()) {
 				pih.add(new BasicProviderInfo(
                                         p.getObjectID(),
@@ -860,19 +859,19 @@ public class BasicDependencyManager impl
 		throws StandardException
 	{
         // Add the stored dependencies.
-        List storedDeps = dd.getAllDependencyDescriptorsList();
+        List<?> storedDeps = dd.getAllDependencyDescriptorsList();
         int numDependencies = storedDeps.size();
         synchronized(this) {
-            Iterator deps = dependents.values().iterator();
-            Iterator provs = providers.values().iterator();
+            Iterator<List<Dependency>> deps = dependents.values().iterator();
+            Iterator<List<Dependency>> provs = providers.values().iterator();
 
             // Count the in memory dependencies.
             while (deps.hasNext()) {
-                numDependencies += ((List) deps.next()).size();
+                numDependencies += deps.next().size();
             }
 
             while (provs.hasNext()) {
-                numDependencies += ((List) provs.next()).size();
+                numDependencies += provs.next().size();
             }
         }
         return numDependencies;
@@ -895,9 +894,11 @@ public class BasicDependencyManager impl
 	 *
 	 * @return boolean		Whether or not the dependency get added.
 	 */
-    private boolean addDependencyToTable(Map<UUID,List<Dependency>> table, UUID key, Dependency dy) {
+    private boolean addDependencyToTable(
+            Map<UUID, List<Dependency>> table, UUID key, Dependency dy) {
+
+        List<Dependency> deps = table.get(key);
 
-		List<Dependency> deps = (List<Dependency>) table.get(key);
 		if (deps == null) {
             deps = new ArrayList<Dependency>();
 			deps.add(dy);
@@ -942,15 +943,16 @@ public class BasicDependencyManager impl
 	 */
     //@GuardedBy("this")
     private void clearProviderDependency(UUID p, Dependency d) {
-		List deps = (List) providers.get(p);
+        List<?> deps = providers.get(p);
 
 		if (deps == null)
 			return;
 
 		deps.remove(d);
 
-		if (deps.size() == 0)
+        if (deps.isEmpty()) {
 			providers.remove(p);
+        }
 	}
 
 	/**
@@ -985,30 +987,28 @@ public class BasicDependencyManager impl
 			{
 				Dependent 			tempD;
 				Provider  			tempP;
-				DependableFinder	finder = null;
+                DependableFinder    finder = depDesc.getDependentFinder();
+                tempD = (Dependent) finder.getDependable(dd, depDesc.getUUID());
 
-					finder = depDesc.getDependentFinder();
-					tempD = (Dependent) finder.getDependable(dd, depDesc.getUUID() );
+                if (providerForList != null)
+                {
+                    // Use the provider being passed in.
+                    tempP = providerForList;
+
+                    // Sanity check the object identifiers match.
+                    if (SanityManager.DEBUG) {
+                        if (!tempP.getObjectID().equals(depDesc.getProviderID()))
+                        {
+                            SanityManager.THROWASSERT("mismatch providers");
+                        }
+                    }
+                }
+                else
+                {
+                    finder = depDesc.getProviderFinder();
+                    tempP = (Provider) finder.getDependable(dd, depDesc.getProviderID() );
 
-					if (providerForList != null)
-					{
-						// Use the provider being passed in.
-						tempP = providerForList;
-						
-						// Sanity check the object identifiers match.
-						if (SanityManager.DEBUG) {
-							if (!tempP.getObjectID().equals(depDesc.getProviderID()))
-							{
-								SanityManager.THROWASSERT("mismatch providers");
-							}
-						}
-					}
-					else
-					{
-						finder = depDesc.getProviderFinder();
-						tempP = (Provider) finder.getDependable(dd, depDesc.getProviderID() );
-						
-					}
+                }
 
 				retval.add( new BasicDependency( tempD, tempP ) );
 			}

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=1502965&r1=1502964&r2=1502965&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 Sun Jul 14 12:41:09 2013
@@ -22,7 +22,6 @@
 package org.apache.derby.impl.sql.execute;
 
 import org.apache.derby.iapi.services.io.StoredFormatIds;
-import org.apache.derby.iapi.services.io.FormatIdUtil;
 import org.apache.derby.iapi.services.io.Formatable;
 
 import java.io.ObjectOutput;
@@ -36,6 +35,7 @@ import java.util.Vector;
  * @see java.util.Vector
  *
  */
+@SuppressWarnings("UseOfObsoleteCollectionType")
 public class AggregatorInfoList extends Vector<AggregatorInfo> implements Formatable 
 {
 	/********************************************************
@@ -67,10 +67,8 @@ public class AggregatorInfoList extends 
 	 */
 	public boolean hasDistinct()
 	{
-		int count = size();
-		for (int i = 0; i < count; i++)
+        for (AggregatorInfo aggInfo : this)
 		{
-			AggregatorInfo aggInfo = (AggregatorInfo) elementAt(i);
 			if (aggInfo.isDistinct())
 			{
 				return true;

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=1502965&r1=1502964&r2=1502965&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 Sun Jul 14 12:41:09 2013
@@ -25,7 +25,6 @@ import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Properties;
-import java.util.Vector;
 
 import org.apache.derby.catalog.DefaultInfo;
 import org.apache.derby.catalog.Dependable;
@@ -57,7 +56,6 @@ import org.apache.derby.iapi.sql.diction
 import org.apache.derby.iapi.sql.dictionary.DataDictionary;
 import org.apache.derby.iapi.sql.dictionary.DefaultDescriptor;
 import org.apache.derby.iapi.sql.dictionary.DependencyDescriptor;
-import org.apache.derby.iapi.sql.dictionary.GenericDescriptorList;
 import org.apache.derby.iapi.sql.dictionary.IndexLister;
 import org.apache.derby.iapi.sql.dictionary.IndexRowGenerator;
 import org.apache.derby.iapi.sql.dictionary.ReferencedKeyConstraintDescriptor;
@@ -85,9 +83,7 @@ import org.apache.derby.iapi.types.DataV
 import org.apache.derby.iapi.types.RowLocation;
 import org.apache.derby.iapi.util.IdUtil;
 import org.apache.derby.iapi.util.StringUtil;
-import org.apache.derby.impl.sql.compile.CollectNodesVisitor;
 import org.apache.derby.impl.sql.compile.ColumnDefinitionNode;
-import org.apache.derby.impl.sql.compile.ColumnReference;
 import org.apache.derby.impl.sql.compile.StatementNode;
 
 /**
@@ -757,8 +753,6 @@ class AlterTableConstantAction extends D
             }
           }
         }
-
-        return;
     }
 
     /**
@@ -808,23 +802,18 @@ class AlterTableConstantAction extends D
             }
 
 			/* Get a row template for the base table */
-			ExecRow baseRow = 
+            ExecRow br =
                 lcc.getLanguageConnectionFactory().getExecutionFactory().getValueRow(
                     td.getNumberOfColumns());
 
-
 			/* Fill the row with nulls of the correct type */
-			ColumnDescriptorList cdl = td.getColumnDescriptorList();
-			int					 cdlSize = cdl.size();
-
-			for (int index = 0; index < cdlSize; index++)
+            for (ColumnDescriptor cd : td.getColumnDescriptorList())
 			{
-				ColumnDescriptor cd = (ColumnDescriptor) cdl.elementAt(index);
-				baseRow.setColumn(cd.getPosition(), cd.getType().getNull());
+                br.setColumn(cd.getPosition(), cd.getType().getNull());
 			}
 
             DataValueDescriptor[][] row_array = new DataValueDescriptor[100][];
-            row_array[0] = baseRow.getRowArray();
+            row_array[0] = br.getRowArray();
             RowLocation[] old_row_location_array = new RowLocation[100];
             RowLocation[] new_row_location_array = new RowLocation[100];
 
@@ -875,7 +864,8 @@ class AlterTableConstantAction extends D
 				    TransactionController.MODE_TABLE,
 					TransactionController.ISOLATION_SERIALIZABLE);
 
-            int num_rows_fetched = 0;
+            int num_rows_fetched;
+
             while ((num_rows_fetched = 
                         base_group_fetch_cc.fetchNextGroup(
                             row_array, 
@@ -943,8 +933,6 @@ class AlterTableConstantAction extends D
                 }
 
 		}
-
-		return;
 	}
 
     private static void setup_indexes(
@@ -1026,8 +1014,6 @@ class AlterTableConstantAction extends D
 
             index_idx++;
         }
-
-        return;
     }
 
 
@@ -1105,8 +1091,6 @@ class AlterTableConstantAction extends D
         index_row[index_row.length - 1] = new_row_loc;
 
         index_cc.insert(index_row);
-
-        return;
     }
 
     /**
@@ -1145,8 +1129,6 @@ class AlterTableConstantAction extends D
             }
           }
         }
-
-        return;
     }
 
 	/**
@@ -1422,9 +1404,7 @@ class AlterTableConstantAction extends D
 		//Now go through each trigger on this table and see if the column 
 		//being dropped is part of it's trigger columns or trigger action 
 		//columns which are used through REFERENCING clause
-		GenericDescriptorList tdl = dd.getTriggerDescriptors(td);
-        for (Iterator descIter = tdl.iterator(); descIter.hasNext() ; ) {
-            TriggerDescriptor trd = (TriggerDescriptor)descIter.next();
+        for (TriggerDescriptor trd : dd.getTriggerDescriptors(td)) {
 			//If we find that the trigger is dependent on the column being 
 			//dropped because column is part of trigger columns list, then
 			//we will give a warning or drop the trigger based on whether
@@ -1643,11 +1623,9 @@ class AlterTableConstantAction extends D
 			if (cascade)
 			{
 				ConstraintDescriptorList fkcdl = dd.getForeignKeys(cd.getUUID());
-				for (int j = 0; j < fkcdl.size(); j++)
-				{
-					ConstraintDescriptor fkcd = 
-                        (ConstraintDescriptor) fkcdl.elementAt(j);
 
+                for (ConstraintDescriptor fkcd : fkcdl)
+                {
 					dm.invalidateFor(fkcd,
 									DependencyManager.DROP_CONSTRAINT,
 									lcc);
@@ -1707,7 +1685,7 @@ class AlterTableConstantAction extends D
 		//
 		for (int i = columnDescriptor.getPosition(), j = 0; i < size; i++, j++)
 		{
-			ColumnDescriptor cd = (ColumnDescriptor) tab_cdl.elementAt(i);
+            ColumnDescriptor cd = tab_cdl.elementAt(i);
 			dd.dropColumnDescriptor(td.getUUID(), cd.getColumnName(), tc);
 			cd.setPosition(i);
 			if (cd.isAutoincrement())
@@ -1763,27 +1741,26 @@ class AlterTableConstantAction extends D
 		// able to get to the triggers dependent on the table being altered
 		//Following will get all the dependent objects that are using
 		// ALTER TABLE table as provider
-		List depsOnAlterTableList = dd.getProvidersDescriptorList(td.getObjectID().toString());
-		for (Iterator depsOnAlterTableIterator = depsOnAlterTableList.listIterator(); 
-			depsOnAlterTableIterator.hasNext();)
-		{
-			//Go through all the dependent objects on the table being altered 
-			DependencyDescriptor depOnAlterTableDesc = 
-				(DependencyDescriptor) depsOnAlterTableIterator.next();
-			DependableFinder dependent = depOnAlterTableDesc.getDependentFinder();
-			//For the given dependent, we are only interested in it if it is a
+        List<DependencyDescriptor> depsOnAlterTableList =
+                dd.getProvidersDescriptorList(td.getObjectID().toString());
+
+        for (DependencyDescriptor depOnAT : depsOnAlterTableList)
+        {
+            // Go through all the dependent objects on the table being altered
+            DependableFinder dependent = depOnAT.getDependentFinder();
+
+            // For the given dependent, we are only interested in it if it is a
 			// stored prepared statement.
 			if (dependent.getSQLObjectType().equals(Dependable.STORED_PREPARED_STATEMENT))
 			{
-				//Look for all the dependent objects that are using this 
+                // Look for all the dependent objects that are using this
 				// stored prepared statement as provider. We are only 
 				// interested in dependents that are triggers.
-				List depsTrigger = dd.getProvidersDescriptorList(depOnAlterTableDesc.getUUID().toString());
-				for (Iterator depsTriggerIterator = depsTrigger.listIterator();
-					depsTriggerIterator.hasNext();)
+                List<DependencyDescriptor> depsTrigger =
+                    dd.getProvidersDescriptorList(depOnAT.getUUID().toString());
+
+                for (DependencyDescriptor depsTriggerDesc : depsTrigger)
 				{
-					DependencyDescriptor depsTriggerDesc = 
-						(DependencyDescriptor) depsTriggerIterator.next();
 					DependableFinder providerIsTrigger = depsTriggerDesc.getDependentFinder();
 					//For the given dependent, we are only interested in it if
 					// it is a trigger
@@ -1972,10 +1949,9 @@ class AlterTableConstantAction extends D
     private void modifyColumnType(int ix)
             throws StandardException {
 		ColumnDescriptor columnDescriptor = 
-			td.getColumnDescriptor(columnInfo[ix].name),
-			newColumnDescriptor = null;
+            td.getColumnDescriptor(columnInfo[ix].name);
 
-		newColumnDescriptor = 
+        ColumnDescriptor newColumnDescriptor =
 			new ColumnDescriptor(columnInfo[ix].name,
 									columnDescriptor.getPosition(),
 									columnInfo[ix].dataType,
@@ -2003,8 +1979,7 @@ class AlterTableConstantAction extends D
     private void modifyColumnConstraint(String colName, boolean nullability)
             throws StandardException {
 		ColumnDescriptor columnDescriptor = 
-			td.getColumnDescriptor(colName),
-			newColumnDescriptor = null;
+            td.getColumnDescriptor(colName);
         
         // Get the type and change the nullability
 		DataTypeDescriptor dataType =
@@ -2040,7 +2015,7 @@ class AlterTableConstantAction extends D
             }
         }
 
-		newColumnDescriptor = 
+        ColumnDescriptor newColumnDescriptor =
 			 new ColumnDescriptor(colName,
 									columnDescriptor.getPosition(),
 									dataType,
@@ -2068,7 +2043,6 @@ class AlterTableConstantAction extends D
 	{
 		ColumnDescriptor columnDescriptor = 
 			td.getColumnDescriptor(columnInfo[ix].name);
-		DataDescriptorGenerator ddg = dd.getDataDescriptorGenerator();
 		int columnPosition = columnDescriptor.getPosition();
 
 		// Clean up after the old default, if non-null
@@ -2361,9 +2335,7 @@ class AlterTableConstantAction extends D
 		}
 
 		//truncate is not allowed when there are enabled DELETE triggers
-		GenericDescriptorList tdl = dd.getTriggerDescriptors(td);
-        for (Iterator descIter = tdl.iterator(); descIter.hasNext(); ) {
-            TriggerDescriptor trd = (TriggerDescriptor)descIter.next();
+        for (TriggerDescriptor trd : dd.getTriggerDescriptors(td)) {
 			if (trd.listensForEvent(TriggerDescriptor.TRIGGER_EVENT_DELETE) &&
 				trd.isEnabled())
 			{
@@ -2577,7 +2549,7 @@ class AlterTableConstantAction extends D
 		// We can finally drain the sorter and rebuild the index
 		// Populate the index.
 		
-		RowLocationRetRowSource cCount           = null;
+        RowLocationRetRowSource cCount;
 		boolean                 statisticsExist  = false;
 
 		if (!truncateTable)
@@ -3036,9 +3008,8 @@ class AlterTableConstantAction extends D
 		if ((! doneScan) &&
 			(currentCompressRow == bulkFetchSize || !validRow[currentCompressRow]))
 		{
-			int bulkFetched = 0;
-
-			bulkFetched = compressHeapGSC.fetchNextGroup(baseRowArray, compressRL);
+            int bulkFetched =
+                    compressHeapGSC.fetchNextGroup(baseRowArray, compressRL);
 
 			doneScan = (bulkFetched != bulkFetchSize);
 			currentCompressRow = 0;
@@ -3171,7 +3142,7 @@ class AlterTableConstantAction extends D
 
 			if (currentRow.getRowArray()[i] instanceof StreamStorable)
 			{
-				((DataValueDescriptor) currentRow.getRowArray()[i]).getObject();
+                currentRow.getRowArray()[i].getObject();
 			}
 		}
 	}
@@ -3391,7 +3362,7 @@ class AlterTableConstantAction extends D
 
 		lcc.autoincrementCreateCounter(td.getSchemaName(),
 									   td.getName(),
-									   columnName, new Long(initial),
+                                       columnName, Long.valueOf(initial),
 									   increment, 0);
 		// the sql query is.
 		// UPDATE table 
@@ -3458,7 +3429,7 @@ class AlterTableConstantAction extends D
 		throws StandardException
 	{
 		boolean foundNullable = false;
-		StringBuffer constraintText = new StringBuffer();
+        StringBuilder constraintText = new StringBuilder();
 
 		/* 
 		 * Check for nullable columns and create a constraint string which can
@@ -3487,8 +3458,8 @@ class AlterTableConstantAction extends D
 					// column name uses lower case characters, spaces, or
 					// other unusual characters.
 					constraintText.append(
-						IdUtil.normalToDelimited(columnNames[colCtr]) +
-						" IS NOT NULL ");
+                        IdUtil.normalToDelimited(columnNames[colCtr]));
+                    constraintText.append(" IS NOT NULL ");
 				}
 				foundNullable = true;
 				nullCols[colCtr] = true;

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=1502965&r1=1502964&r2=1502965&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 Sun Jul 14 12:41:09 2013
@@ -464,8 +464,6 @@ public abstract class BaseActivation imp
 
 			closed = true;
 
-			LanguageConnectionContext lcc = getLanguageConnectionContext();
-
             // Remove all the dependencies this activation has. It won't need
             // them after it's closed, so let's free up the memory in the
             // dependency manager. (DERBY-4571)
@@ -1492,8 +1490,6 @@ public abstract class BaseActivation imp
 		if (ps == null)
 			return;
 			
-		LanguageConnectionContext lcc = getLanguageConnectionContext();
-
 		CursorActivation cursorActivation = lcc.lookupCursorActivation(cursorName);
 
 		if (cursorActivation != null)
@@ -1531,6 +1527,7 @@ public abstract class BaseActivation imp
 	 *	@param	rs	input result set
 	 *	@return	materialized resultset, or original rs if it can't be materialized
 	 */
+    @SuppressWarnings("UseOfObsoleteCollectionType")
 	public NoPutResultSet materializeResultSetIfPossible(NoPutResultSet rs)
 		throws StandardException
 	{
@@ -1581,7 +1578,7 @@ public abstract class BaseActivation imp
 			{
 				rrs[i] = new RowResultSet(
 										this,
-										(ExecRow) rowCache.elementAt(i),
+                                        rowCache.elementAt(i),
 										true,
 										rsNum,
 										1,
@@ -1616,13 +1613,17 @@ public abstract class BaseActivation imp
 
 	// maintain hash table of parent result set vector
 	// a table can have more than one parent source.
+    @SuppressWarnings("UseOfObsoleteCollectionType")
 	protected Hashtable<String,Vector<TemporaryRowHolder>> parentResultSets;
-	public void setParentResultSet(TemporaryRowHolder rs, String resultSetId)
+
+    @SuppressWarnings("UseOfObsoleteCollectionType")
+    public void setParentResultSet(TemporaryRowHolder rs, String resultSetId)
 	{
 		Vector<TemporaryRowHolder>  rsVector;
 		if(parentResultSets == null)
 			parentResultSets = new Hashtable<String,Vector<TemporaryRowHolder>>();
-		rsVector = (Vector<TemporaryRowHolder>) parentResultSets.get(resultSetId);
+        rsVector = parentResultSets.get(resultSetId);
+
 		if(rsVector == null)
 		{
 			rsVector = new Vector<TemporaryRowHolder>();
@@ -1638,9 +1639,10 @@ public abstract class BaseActivation imp
 	 * get the reference to parent table ResultSets, that will be needed by the 
 	 * referential action dependent table scans.
 	 */
+    @SuppressWarnings("UseOfObsoleteCollectionType")
 	public Vector<TemporaryRowHolder> getParentResultSet(String resultSetId)
 	{
-		return (Vector<TemporaryRowHolder>) parentResultSets.get(resultSetId);
+        return parentResultSets.get(resultSetId);
 	}
 
 	public Enumeration<String> getParentResultSetKeys()

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/BaseExpressionActivation.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/BaseExpressionActivation.java?rev=1502965&r1=1502964&r2=1502965&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/BaseExpressionActivation.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/BaseExpressionActivation.java Sun Jul 14 12:41:09 2013
@@ -79,10 +79,13 @@ public abstract class BaseExpressionActi
 										throws StandardException
 	{
 		DataValueDescriptor judge;
-		if (judgeUserJDBCTypeId == -1)
-			judge = (DataValueDescriptor) new TypeId(judgeTypeFormatId, null).getNull();
-		else
-			judge = (DataValueDescriptor) new TypeId(judgeTypeFormatId, new UserDefinedTypeIdImpl()).getNull();
+
+        if (judgeUserJDBCTypeId == -1) {
+            judge = new TypeId(judgeTypeFormatId, null).getNull();
+        } else {
+            judge = new TypeId(judgeTypeFormatId,
+                               new UserDefinedTypeIdImpl()).getNull();
+        }
 			
 		DataValueDescriptor minVal = v1;
 		if (v2 != null &&

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/CardinalityCounter.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/CardinalityCounter.java?rev=1502965&r1=1502964&r2=1502965&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/CardinalityCounter.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/CardinalityCounter.java Sun Jul 14 12:41:09 2013
@@ -120,8 +120,9 @@ class CardinalityCounter implements RowL
 		int i;
 		for (i = 0; i < numKeys; i++)
 		{
-			if (((DataValueDescriptor)prevKey[i]).isNull())
+            if (prevKey[i].isNull()) {
 				break;
+            }
 
 			if ((prevKey[i]).compare(currentKey[i]) != 0)
 			{

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/ConstraintConstantAction.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/ConstraintConstantAction.java?rev=1502965&r1=1502964&r2=1502965&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/ConstraintConstantAction.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/ConstraintConstantAction.java Sun Jul 14 12:41:09 2013
@@ -151,9 +151,9 @@ public abstract class ConstraintConstant
                 fk.getIndexConglomerateDescriptor(dd).getConglomerateNumber(),
                 false,                       			// hold 
                 0, 										// read only
-                tc.MODE_TABLE,							// already locked
-                tc.ISOLATION_READ_COMMITTED,			// whatever
-                (FormatableBitSet)null, 							// retrieve all fields
+                TransactionController.MODE_TABLE,       // already locked
+                TransactionController.ISOLATION_READ_COMMITTED,
+                (FormatableBitSet)null,                 // retrieve all fields
                 (DataValueDescriptor[])null,    	    // startKeyValue
                 ScanController.GE,            			// startSearchOp
                 null,                         			// qualifier
@@ -201,9 +201,10 @@ public abstract class ConstraintConstant
 					refcd.getIndexConglomerateDescriptor(dd).getConglomerateNumber(),
                         false,                       	// hold 
                         0, 								// read only
-                        tc.MODE_RECORD,
-                        tc.ISOLATION_READ_COMMITTED,	// read committed is good enough
-                        (FormatableBitSet)null, 					// retrieve all fields
+                        TransactionController.MODE_RECORD,
+                        TransactionController.ISOLATION_READ_COMMITTED,
+                                              // read committed is good enough
+                        (FormatableBitSet)null,         // retrieve all fields
                         (DataValueDescriptor[])null,    // startKeyValue
                         ScanController.GE,            	// startSearchOp
                         null,                         	// qualifier
@@ -269,7 +270,7 @@ public abstract class ConstraintConstant
 	)
 		throws StandardException
 	{
-		StringBuffer checkStmt = new StringBuffer();
+        StringBuilder checkStmt = new StringBuilder();
 		/* should not use select sum(not(<check-predicate>) ? 1: 0) because
 		 * that would generate much more complicated code and may exceed Java
 		 * limits if we have a large number of check constraints, beetle 4347
@@ -298,7 +299,6 @@ public abstract class ConstraintConstant
 				}
 			}
 
-			DataValueDescriptor[] rowArray = row.getRowArray();
 			Number value = ((Number)((NumberDataValue)row.getRowArray()[0]).getObject());
 			/*
 			** Value may be null if there are no rows in the

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/CreateIndexConstantAction.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/CreateIndexConstantAction.java?rev=1502965&r1=1502964&r2=1502965&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/CreateIndexConstantAction.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/CreateIndexConstantAction.java Sun Jul 14 12:41:09 2013
@@ -52,7 +52,6 @@ import org.apache.derby.iapi.store.acces
 import org.apache.derby.iapi.store.access.ConglomerateController;
 import org.apache.derby.iapi.store.access.GroupFetchScanController;
 import org.apache.derby.iapi.store.access.RowLocationRetRowSource;
-import org.apache.derby.iapi.store.access.ScanController;
 import org.apache.derby.iapi.store.access.SortController;
 import org.apache.derby.iapi.store.access.SortObserver;
 import org.apache.derby.iapi.store.access.TransactionController;
@@ -241,7 +240,7 @@ class CreateIndexConstantAction extends 
 	// OBJECT SHADOWS
 	//
 	///////////////////////////////////////////////
-
+    @Override
 	public	String	toString()
 	{
 		// Do not put this under SanityManager.DEBUG - it is needed for
@@ -711,7 +710,7 @@ class CreateIndexConstantAction extends 
 					continue;
 				}
 				numSet++;
-				ColumnDescriptor cd = (ColumnDescriptor) cdl.elementAt(index);
+                ColumnDescriptor cd = cdl.elementAt(index);
 				DataTypeDescriptor dts = cd.getType();
 
 
@@ -752,7 +751,7 @@ class CreateIndexConstantAction extends 
 			 * sort.
 			 */
 			int             numColumnOrderings;
-			SortObserver    sortObserver   = null;
+            SortObserver    sortObserver;
             Properties      sortProperties = null;
 			if (unique || uniqueWithDuplicateNulls)
 			{
@@ -827,7 +826,7 @@ class CreateIndexConstantAction extends 
 			}
 
 			// create the sorter
-			sortId = tc.createSort((Properties)sortProperties, 
+            sortId = tc.createSort(sortProperties,
 					indexTemplateRow.getRowArrayClone(),
 					order,
 					sortObserver,
@@ -1072,7 +1071,7 @@ class CreateIndexConstantAction extends 
 			// beneath the surface.  Fetching the base row and row location
 			// from the table scan will automagically set up the indexRow
 			// fetchNextGroup will return how many rows are actually fetched.
-			int bulkFetched = 0;
+            int bulkFetched;
 
 			while ((bulkFetched = scan.fetchNextGroup(baseRowArray, rl)) > 0)
 			{

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=1502965&r1=1502964&r2=1502965&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 Sun Jul 14 12:41:09 2013
@@ -23,7 +23,6 @@ package org.apache.derby.impl.sql.execut
 
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.List;
 
 import org.apache.derby.catalog.AliasInfo;
@@ -34,7 +33,6 @@ import org.apache.derby.catalog.types.Ag
 import org.apache.derby.catalog.types.RoutineAliasInfo;
 import org.apache.derby.iapi.error.StandardException;
 import org.apache.derby.iapi.reference.SQLState;
-import org.apache.derby.iapi.services.sanity.SanityManager;
 import org.apache.derby.iapi.services.context.ContextManager;
 import org.apache.derby.iapi.sql.Activation;
 import org.apache.derby.iapi.sql.conn.Authorizer;
@@ -161,7 +159,7 @@ abstract class DDLConstantAction impleme
 		 TransactionController tc,
 		 Activation activation) throws StandardException {
 
-		TransactionController useTc    = null;
+        TransactionController useTc;
 		TransactionController nestedTc = null;
 
 		try {
@@ -328,7 +326,6 @@ abstract class DDLConstantAction impleme
 		LanguageConnectionContext lcc = activation.getLanguageConnectionContext();
 		DataDictionary dd = lcc.getDataDictionary();
 		DependencyManager dm = dd.getDependencyManager();
-		String dbo = dd.getAuthorizationDatabaseOwner();
         String currentUser = lcc.getCurrentUserId(activation);
 		SettableBoolean roleDepAdded = new SettableBoolean();
 
@@ -343,13 +340,13 @@ abstract class DDLConstantAction impleme
 			// CHECK constraint, any EXECUTE or USAGE privileges. If the REFERENCES is
 			// revoked from the constraint owner, the constraint will get
 			// dropped automatically.
-			List requiredPermissionsList = activation.getPreparedStatement().getRequiredPermissionsList();
+            List<StatementPermission> requiredPermissionsList =
+                activation.getPreparedStatement().getRequiredPermissionsList();
 
 			if (requiredPermissionsList != null && ! requiredPermissionsList.isEmpty())
 			{
-				for(Iterator iter = requiredPermissionsList.iterator();iter.hasNext();)
+                for (StatementPermission statPerm : requiredPermissionsList)
 				{
-					StatementPermission statPerm = (StatementPermission) iter.next();
 					//First check if we are dealing with a Table or 
 					//Column level privilege. All the other privileges
 					//are not required for a foreign key constraint.
@@ -517,10 +514,7 @@ abstract class DDLConstantAction impleme
 		LanguageConnectionContext lcc =
 			activation.getLanguageConnectionContext();
 		DataDictionary dd = lcc.getDataDictionary();
-		RoleGrantDescriptor rootGrant = null;
 		String role = lcc.getCurrentRoleId(activation);
-		String dbo = dd.getAuthorizationDatabaseOwner();
-        String currentUser = lcc.getCurrentUserId(activation);
 		PermissionsDescriptor permDesc = null;
 
 		if (SanityManager.DEBUG) {
@@ -529,17 +523,6 @@ abstract class DDLConstantAction impleme
 				"Unexpected: current role is not set");
 		}
 
-		// determine how we got to be able use this role
-		rootGrant =
-            dd.getRoleGrantDescriptor(role, currentUser, dbo);
-
-		if (rootGrant == null) {
-			rootGrant = dd.getRoleGrantDescriptor(
-				role,
-				Authorizer.PUBLIC_AUTHORIZATION_ID,
-				dbo);
-		}
-
 		// If not found in current role, get transitive
 		// closure of roles granted to current role and
 		// iterate over it to see if permission has
@@ -577,8 +560,8 @@ abstract class DDLConstantAction impleme
 	 * @param activation the current activation
 	 * @param dependent the view, constraint or trigger that is dependent on the
 	 *        current role for some privilege.
-	 * @param roleDepAdded keeps track of whether a dependeny on the
-	 *        current role has aleady been registered.
+     * @param roleDepAdded keeps track of whether a dependency on the
+     *        current role has already been registered.
 	 */
 	private static void trackRoleDependency(Activation activation,
 											Dependent dependent,
@@ -657,12 +640,14 @@ abstract class DDLConstantAction impleme
         if (! currentUser.equals(dbo))
 		{
 			PermissionsDescriptor permDesc;
-			List requiredPermissionsList = activation.getPreparedStatement().getRequiredPermissionsList();
-			if (requiredPermissionsList != null && ! requiredPermissionsList.isEmpty())
+            List<StatementPermission> requiredPermissionsList =
+                activation.getPreparedStatement().getRequiredPermissionsList();
+
+            if (requiredPermissionsList != null &&
+                ! requiredPermissionsList.isEmpty())
 			{
-				for(Iterator iter = requiredPermissionsList.iterator();iter.hasNext();)
+                for (StatementPermission statPerm : requiredPermissionsList)
 				{
-					StatementPermission statPerm = (StatementPermission) iter.next();
 					//The schema ownership permission just needs to be checked 
 					//at object creation time, to see if the object creator has 
 					//permissions to create the object in the specified schema. 
@@ -885,7 +870,9 @@ abstract class DDLConstantAction impleme
 
         // nothing to do if there are no changed columns of udt type
         // and this is not a DROP TABLE command
-        if ( (!dropWholeTable) && (addUdtMap.size() == 0) && (dropUdtMap.size() == 0) ) { return; }
+        if ( !dropWholeTable && addUdtMap.isEmpty() && dropUdtMap.isEmpty() ) {
+            return;
+        }
 
         //
         // Now prune from the add list all udt descriptors for which we already have dependencies.
@@ -939,36 +926,30 @@ abstract class DDLConstantAction impleme
          LanguageConnectionContext  lcc,
          DataDictionary             dd,
          Dependent                  dependent,
-         HashMap                    addUdtMap,
-         HashMap                    dropUdtMap
+         HashMap<String, AliasDescriptor> addUdtMap,
+         HashMap<String, AliasDescriptor> dropUdtMap
          )
         throws StandardException
     {
         // again, nothing to do if there are no columns of udt type
-        if ( (addUdtMap.size() == 0) && (dropUdtMap.size() == 0) ) { return; }
+        if ( (addUdtMap.isEmpty()) && (dropUdtMap.isEmpty()) ) {
+            return;
+        }
 
 		TransactionController tc = lcc.getTransactionExecute();
         DependencyManager     dm = dd.getDependencyManager();
         ContextManager        cm = lcc.getContextManager();
 
         // add new dependencies
-        Iterator            addIterator = addUdtMap.values().iterator();
-        while( addIterator.hasNext() )
+        for (AliasDescriptor ad : addUdtMap.values())
         {
-            AliasDescriptor ad = (AliasDescriptor) addIterator.next();
-
             dm.addDependency( dependent, ad, cm );
         }
 
         // drop dependencies that are orphaned
-        Iterator            dropIterator = dropUdtMap.values().iterator();
-        while( dropIterator.hasNext() )
-        {
-            AliasDescriptor ad = (AliasDescriptor) dropIterator.next();
-
-            DependencyDescriptor dependency = new DependencyDescriptor( dependent, ad );
-
-            dd.dropStoredDependency( dependency, tc );
+        for (AliasDescriptor ad : dropUdtMap.values()) {
+            DependencyDescriptor dep = new DependencyDescriptor(dependent, ad);
+            dd.dropStoredDependency( dep, tc );
         }
     }
 
@@ -1008,9 +989,16 @@ abstract class DDLConstantAction impleme
         }
         
 		TransactionController tc = lcc.getTransactionExecute();
-        HashMap<String,AliasDescriptor>               addUdtMap = new HashMap<String,AliasDescriptor>();
-        HashMap<String,AliasDescriptor>               dropUdtMap = new HashMap<String,AliasDescriptor>();
-        HashMap<String,AliasDescriptor>               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();
 
@@ -1057,7 +1045,7 @@ abstract class DDLConstantAction impleme
 	/**
 	 * Mutable Boolean wrapper, initially false
 	 */
-	private class SettableBoolean {
+    private static class SettableBoolean {
 		boolean value;
 
 		SettableBoolean() {

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DMLWriteResultSet.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DMLWriteResultSet.java?rev=1502965&r1=1502964&r2=1502965&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DMLWriteResultSet.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DMLWriteResultSet.java Sun Jul 14 12:41:09 2013
@@ -22,25 +22,19 @@
 package org.apache.derby.impl.sql.execute;
 
 import java.io.InputStream;
-
-import org.apache.derby.iapi.types.DataValueDescriptor;
-import org.apache.derby.iapi.sql.execute.NoPutResultSet;
-import org.apache.derby.iapi.services.io.StreamStorable;
-import org.apache.derby.iapi.sql.execute.ExecRow;
-import org.apache.derby.iapi.sql.execute.ConstantAction;
-import org.apache.derby.iapi.sql.execute.ExecutionContext;
 import org.apache.derby.iapi.error.StandardException;
+import org.apache.derby.iapi.services.io.FormatableBitSet;
+import org.apache.derby.iapi.services.io.StreamStorable;
+import org.apache.derby.iapi.services.sanity.SanityManager;
 import org.apache.derby.iapi.sql.Activation;
 import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
-
+import org.apache.derby.iapi.sql.execute.ConstantAction;
+import org.apache.derby.iapi.sql.execute.ExecRow;
+import org.apache.derby.iapi.sql.execute.NoPutResultSet;
 import org.apache.derby.iapi.store.access.DynamicCompiledOpenConglomInfo;
-import org.apache.derby.iapi.store.access.StaticCompiledOpenConglomInfo;
 import org.apache.derby.iapi.store.access.TransactionController;
-
-import org.apache.derby.catalog.UUID;
-import org.apache.derby.iapi.services.io.FormatableBitSet;
-import org.apache.derby.iapi.services.sanity.SanityManager;
 import org.apache.derby.iapi.transaction.TransactionControl;
+import org.apache.derby.iapi.types.DataValueDescriptor;
 
 /**
  * For INSERT/UPDATE/DELETE impls.  Used to tag them.
@@ -50,7 +44,6 @@ abstract class DMLWriteResultSet extends
 	protected WriteCursorConstantAction constantAction;
 	protected int[] baseRowReadMap;
 	protected int[] streamStorableHeapColIds;
-	protected ExecRow	deferredSparseRow;
 	protected DynamicCompiledOpenConglomInfo heapDCOCI;
 	protected DynamicCompiledOpenConglomInfo[] indexDCOCIs;
 	private boolean needToObjectifyStream;
@@ -113,6 +106,7 @@ abstract class DMLWriteResultSet extends
 		needToObjectifyStream = (this.constantAction.getTriggerInfo() != null);
 	}
 
+    @Override
 	public final long	modifiedRowCount() { return rowCount + RowUtil.getRowCountBase(); }
 
 

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=1502965&r1=1502964&r2=1502965&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 Sun Jul 14 12:41:09 2013
@@ -21,18 +21,12 @@
 
 package org.apache.derby.impl.sql.execute;
 
-import org.apache.derby.iapi.services.sanity.SanityManager;
 import org.apache.derby.iapi.error.StandardException;
 import org.apache.derby.iapi.sql.execute.ConstantAction;
 import org.apache.derby.iapi.sql.execute.CursorResultSet;
-import org.apache.derby.iapi.sql.execute.RowChanger;
 import org.apache.derby.iapi.sql.execute.NoPutResultSet;
 import org.apache.derby.iapi.sql.Activation;
-import org.apache.derby.iapi.sql.ResultDescription;
-import org.apache.derby.iapi.types.DataValueDescriptor;
 import org.apache.derby.iapi.sql.ResultSet;
-import org.apache.derby.iapi.store.access.ConglomerateController;
-import org.apache.derby.iapi.store.access.TransactionController;
 import org.apache.derby.iapi.sql.execute.ExecRow;
 import org.apache.derby.iapi.sql.execute.TemporaryRowHolder;
 
@@ -108,6 +102,8 @@ class DeleteCascadeResultSet extends Del
 	/**
 		@exception StandardException Standard Derby error policy
 	*/
+    @Override
+    @SuppressWarnings({"UseOfObsoleteCollectionType", "empty-statement"})
 	public void open() throws StandardException
 	{
 
@@ -118,7 +114,7 @@ class DeleteCascadeResultSet extends Del
 			{
 				setRowHoldersTypeToUniqueStream();
 				//collect until there are no more rows to found
-				while(collectAffectedRows(false));
+                while(collectAffectedRows(false)) {};
 			}else
 			{
 				collectAffectedRows(false);
@@ -156,6 +152,7 @@ class DeleteCascadeResultSet extends Del
 	 *and creates a temporary resulsets that will be passed
 	 *as source to its  dependent result sets.
 	 */
+    @Override @SuppressWarnings("UseOfObsoleteCollectionType")
 	void  setup() throws StandardException
 	{
 
@@ -168,7 +165,8 @@ class DeleteCascadeResultSet extends Del
 
 		super.setup();
 		activation.setParentResultSet(rowHolder, resultSetId);
-		Vector sVector = (Vector) activation.getParentResultSet(resultSetId);
+        Vector<TemporaryRowHolder> sVector =
+                activation.getParentResultSet(resultSetId);
 		tempRowHolderId = sVector.size() -1;
 		for(int i =0 ; i < noDependents; i++)
 		{
@@ -209,7 +207,7 @@ class DeleteCascadeResultSet extends Del
 		return rowsFound;
 	}
 
-
+    @SuppressWarnings("UseOfObsoleteCollectionType")
 	void fireBeforeTriggers(Hashtable<String,String> msht) throws StandardException
 	{
 		if(!mainNodeForTable) 
@@ -247,6 +245,7 @@ class DeleteCascadeResultSet extends Del
 			super.fireBeforeTriggers();
 	}
 
+    @Override
     void fireAfterTriggers() throws StandardException
 	{
 		//fire the After Triggers on the dependent tables, if any rows changed
@@ -267,6 +266,7 @@ class DeleteCascadeResultSet extends Del
 			super.fireAfterTriggers();
 	}
 
+    @Override
 	void deleteDeferredRows() throws StandardException
 	{
 		
@@ -290,6 +290,7 @@ class DeleteCascadeResultSet extends Del
 	}
 
 	
+    @Override
 	void runFkChecker(boolean restrictCheckOnly) throws StandardException
 	{
 
@@ -312,6 +313,7 @@ class DeleteCascadeResultSet extends Del
 	}
 
 
+    @Override
 	public void cleanUp() throws StandardException
 	{
 
@@ -351,6 +353,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.
+    @SuppressWarnings("UseOfObsoleteCollectionType")
 	private void mergeRowHolders(Hashtable<String,String> msht) throws StandardException
 	{
 		if(msht.containsKey(resultSetId) || rowCount ==0)
@@ -381,15 +384,17 @@ class DeleteCascadeResultSet extends Del
 
 
 
+    @SuppressWarnings("UseOfObsoleteCollectionType")
 	private void mergeResultSets() throws StandardException
 	{
-		Vector sVector = (Vector) activation.getParentResultSet(resultSetId);
-		int size = sVector.size();
+        Vector<TemporaryRowHolder>
+                sVector = activation.getParentResultSet(resultSetId);
+        int size = sVector.size();
 		// if there is more than one source, we need to merge them into onc
 		// temporary result set.
 		if(size > 1)
 		{
-			ExecRow		row = null;
+            ExecRow row;
 			int rowHolderId = 0 ;
 			//copy all the vallues in the result set to the current resultset row holder
 			while(rowHolderId <  size)
@@ -400,7 +405,8 @@ class DeleteCascadeResultSet extends Del
 					rowHolderId++;
 					continue;
 				}
-				TemporaryRowHolder currentRowHolder = (TemporaryRowHolder)sVector.elementAt(rowHolderId);	
+                TemporaryRowHolder
+                        currentRowHolder = sVector.elementAt(rowHolderId);
 				CursorResultSet rs = currentRowHolder.getResultSet();
 				rs.open();
 				while ((row = rs.getNextRow()) != null)
@@ -415,6 +421,7 @@ class DeleteCascadeResultSet extends Del
 	}
 
 
+    @Override
 	public void finish() throws StandardException {
 		super.finish();
 		
@@ -428,14 +435,17 @@ class DeleteCascadeResultSet extends Del
 	** find any retun true.	Multiple delete paths exist if we find more than
 	** one parent source resultset for a table involved in the delete cascade
 	**/
+    @SuppressWarnings("UseOfObsoleteCollectionType")
 	private boolean isMultipleDeletePathsExist()
 	{
-		for (Enumeration e = activation.getParentResultSetKeys() ; e.hasMoreElements() ;) 
+        for (Enumeration<String> e = activation.getParentResultSetKeys() ;
+             e.hasMoreElements() ;)
 		{
-			String rsId  = (String) e.nextElement();
-			Vector sVector = (Vector) activation.getParentResultSet(rsId);
-			int size = sVector.size();
-			if(size > 1)
+            String rsId  = e.nextElement();
+            Vector<TemporaryRowHolder>
+                    sVector = activation.getParentResultSet(rsId);
+
+            if(sVector.size() > 1)
 			{
 				return true;
 			}
@@ -450,17 +460,21 @@ class DeleteCascadeResultSet extends Del
 	**multiple iterations. To handle these case we set the temporary row holders
 	** to be  'uniqStream' type.
 	**/
+    @SuppressWarnings("UseOfObsoleteCollectionType")
 	private void setRowHoldersTypeToUniqueStream()
 	{
-		for (Enumeration e = activation.getParentResultSetKeys() ; e.hasMoreElements() ;) 
+        for (Enumeration<String> e = activation.getParentResultSetKeys() ;
+             e.hasMoreElements() ;)
 		{
-			String rsId  = (String) e.nextElement();
-			Vector sVector = (Vector) activation.getParentResultSet(rsId);
+            String rsId  = e.nextElement();
+            Vector<TemporaryRowHolder>
+                    sVector = activation.getParentResultSet(rsId);
 			int size = sVector.size();
 			int rowHolderId = 0 ;
 			while(rowHolderId <  size)
 			{
-				TemporaryRowHolder currentRowHolder = (TemporaryRowHolder)sVector.elementAt(rowHolderId);	
+                TemporaryRowHolder
+                        currentRowHolder = sVector.elementAt(rowHolderId);
 				currentRowHolder.setRowHolderTypeToUniqueStream();
 				rowHolderId++;
 			}

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DeleteResultSet.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DeleteResultSet.java?rev=1502965&r1=1502964&r2=1502965&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DeleteResultSet.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DeleteResultSet.java Sun Jul 14 12:41:09 2013
@@ -85,6 +85,7 @@ class DeleteResultSet extends DMLWriteRe
      * Returns the description of the deleted rows.
      * REVISIT: Do we want this to return NULL instead?
 	 */
+    @Override
 	public ResultDescription getResultDescription()
 	{
 	    return resultDescription;
@@ -182,6 +183,7 @@ class DeleteResultSet extends DMLWriteRe
 	
 
 	//this routine open the source and find the dependent rows 
+    @Override
 	void  setup() throws StandardException
 	{
 		super.setup();
@@ -487,14 +489,16 @@ class DeleteResultSet extends DMLWriteRe
 		
 		DataValueDescriptor		rlColumn;
  		RowLocation	baseRowLocation;
-		ExecRow		deferredRLRow = null;
+        ExecRow     defRLRow;
 
-		deferredBaseCC = tc.openCompiledConglomerate(false,
-													 tc.OPENMODE_FORUPDATE|tc.OPENMODE_SECONDARY_LOCKED,
-													 lockMode,
-													 TransactionController.ISOLATION_SERIALIZABLE,
-													 constants.heapSCOCI,
-													 heapDCOCI);
+        deferredBaseCC = tc.openCompiledConglomerate(
+                false,
+                (TransactionController.OPENMODE_FORUPDATE|
+                 TransactionController.OPENMODE_SECONDARY_LOCKED),
+                lockMode,
+                TransactionController.ISOLATION_SERIALIZABLE,
+                constants.heapSCOCI,
+                heapDCOCI);
 			
 		CursorResultSet rs = rowHolder.getResultSet();
 		try
@@ -508,9 +512,9 @@ class DeleteResultSet extends DMLWriteRe
 			FormatableBitSet readBitSet = RowUtil.shift(baseRowReadList, 1);
 
 			rs.open();
-			while ((deferredRLRow = rs.getNextRow()) != null)
+            while ((defRLRow = rs.getNextRow()) != null)
 			{
-				rlColumn = deferredRLRow.getColumn(rlColumnNumber);
+                rlColumn = defRLRow.getColumn(rlColumnNumber);
 				baseRowLocation = 
 					(RowLocation) (rlColumn).getObject();
 	
@@ -547,7 +551,6 @@ class DeleteResultSet extends DMLWriteRe
     void runFkChecker(boolean restrictCheckOnly) throws StandardException
 	{
 
-		ExecRow		deferredRLRow = null;
 		if (fkChecker != null)
 		{
 			/*
@@ -560,9 +563,11 @@ class DeleteResultSet extends DMLWriteRe
 			try
 			{
 				rs.open();
-				while ((deferredRLRow = rs.getNextRow()) != null)
+
+                ExecRow defRLRow;
+                while ((defRLRow = rs.getNextRow()) != null)
 				{
-					fkChecker.doPKCheck(deferredRLRow, restrictCheckOnly);
+                    fkChecker.doPKCheck(defRLRow, restrictCheckOnly);
 				}
 			} finally
 			{
@@ -628,6 +633,7 @@ class DeleteResultSet extends DMLWriteRe
 		super.close();
 	}
 
+    @Override
 	public void finish() throws StandardException {
 		if (source != null)
 			source.finish();

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DependentResultSet.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DependentResultSet.java?rev=1502965&r1=1502964&r2=1502965&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DependentResultSet.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DependentResultSet.java Sun Jul 14 12:41:09 2013
@@ -23,7 +23,6 @@ package org.apache.derby.impl.sql.execut
 
 import java.util.Properties;
 import java.util.Vector;
-import org.w3c.dom.Element;
 
 import org.apache.derby.iapi.error.StandardException;
 import org.apache.derby.iapi.reference.SQLState;
@@ -50,10 +49,12 @@ import org.apache.derby.iapi.types.RowLo
  * DependentResultSet should be used by only ON DELETE CASCADE/ON DELETE SET NULL ref
  * actions implementation to gather the rows from the dependent tables.  
  * Idea is to scan the foreign key index for the rows in 
- * the source table matelized temporary result set. Scanning of foreign key index gives us the 
+ * the source table materialized temporary result set.
+ * Scanning of foreign key index gives us the
  * rows that needs to be deleted on dependent tables. Using the row location 
  * we got from the index , base row is fetched.
 */
+@SuppressWarnings("UseOfObsoleteCollectionType")
 class DependentResultSet extends ScanResultSet implements CursorResultSet
 {
 
@@ -67,7 +68,6 @@ class DependentResultSet extends ScanRes
 	DynamicCompiledOpenConglomInfo indexDcoci;
 	int numFkColumns;
 	boolean isOpen; // source result set is opened or not
-	boolean deferred;
 	TemporaryRowHolderResultSet source; // Current parent table result set
 	TransactionController tc;
 	String parentResultSetId;
@@ -77,7 +77,7 @@ class DependentResultSet extends ScanRes
 	TemporaryRowHolderResultSet[] sourceResultSets;
 	int[] sourceOpened;
 	int    sArrayIndex;
-	Vector sVector;
+    Vector<TemporaryRowHolder> sVector;
 
 
     protected ScanController scanController;
@@ -162,8 +162,6 @@ class DependentResultSet extends ScanRes
         heapDcoci = activation.getTransactionController().getDynamicCompiledConglomInfo(conglomId);
 
 		if (SanityManager.DEBUG) {
-			SanityManager.ASSERT( activation!=null, "table scan must get activation context");
-
             // This ResultSet doesn't use start or stop keys, so expect them
             // to be null.
             SanityManager.ASSERT(startKeyGetter == null, "start key not null");
@@ -181,8 +179,7 @@ class DependentResultSet extends ScanRes
 		this.rowsPerRead = rowsPerRead;
 		this.oneRowScan = oneRowScan;
 		
-		runTimeStatisticsOn = (activation != null &&
-							   activation.getLanguageConnectionContext().getRunTimeStatisticsMode());
+        runTimeStatisticsOn = (activation.getLanguageConnectionContext().getRunTimeStatisticsMode());
 
 		tc = activation.getTransactionController();
 		//values required to scan the forein key index.
@@ -255,6 +252,7 @@ class DependentResultSet extends ScanRes
 	*/
 	private void setupQualifierRow(ExecRow searchRow)
 	{
+        @SuppressWarnings("MismatchedReadAndWriteOfArray")
 		Object[] indexColArray = indexQualifierRow.getRowArray();
 		Object[] baseColArray = searchRow.getRowArray();
 
@@ -468,10 +466,11 @@ class DependentResultSet extends ScanRes
 	/**
 	  Close the all the opens we did in this result set.
 	  */
+    @Override
 	public void close()
         throws StandardException
 	{
-		//save the information for the runtime stastics
+        // save the information for the runtime statistics
 		// This is where we get the scan properties for the reference index scans
 		if (runTimeStatisticsOn)
 		{
@@ -499,6 +498,7 @@ class DependentResultSet extends ScanRes
 		closeTime += getElapsedMillis(beginTime);
 	}
 
+    @Override
 	public void	finish() throws StandardException
 	{
 		if (source != null)
@@ -516,7 +516,7 @@ class DependentResultSet extends ScanRes
 		sourceResultSets = new TemporaryRowHolderResultSet[size];
 		for(int i = 0 ; i < size ; i++)
 		{
-			sourceRowHolders[i] = (TemporaryRowHolder)sVector.elementAt(i);
+            sourceRowHolders[i] = sVector.elementAt(i);
 			sourceOpened[i] = 0;
 		}
 
@@ -542,7 +542,7 @@ class DependentResultSet extends ScanRes
 		//copy the new sources
 		for(int i = sourceRowHolders.length; i < size ; i++)
 		{
-			tsourceRowHolders[i] = (TemporaryRowHolder)sVector.elementAt(i);
+            tsourceRowHolders[i] = sVector.elementAt(i);
 			tsourceOpened[i] = 0;
 		}
 
@@ -627,10 +627,9 @@ class DependentResultSet extends ScanRes
 	 */
 	private String printPosition(int searchOperator, ExecIndexRow positioner)
 	{
-		String idt = "";
 		String output = "";
 
-		String searchOp = null;
+        String searchOp;
 		switch (searchOperator)
 		{
 			case ScanController.GE:

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DropTableConstantAction.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DropTableConstantAction.java?rev=1502965&r1=1502964&r2=1502965&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DropTableConstantAction.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DropTableConstantAction.java Sun Jul 14 12:41:09 2013
@@ -35,7 +35,7 @@ import org.apache.derby.iapi.sql.diction
 import org.apache.derby.iapi.sql.dictionary.ConstraintDescriptorList;
 import org.apache.derby.iapi.sql.dictionary.DataDictionary;
 import org.apache.derby.iapi.sql.dictionary.DefaultDescriptor;
-import org.apache.derby.iapi.sql.dictionary.GenericDescriptorList;
+import org.apache.derby.iapi.sql.dictionary.TriggerDescriptorList;
 import org.apache.derby.iapi.sql.dictionary.ReferencedKeyConstraintDescriptor;
 import org.apache.derby.iapi.sql.dictionary.SchemaDescriptor;
 import org.apache.derby.iapi.sql.dictionary.TableDescriptor;
@@ -187,20 +187,15 @@ class DropTableConstantAction extends DD
 		lockTableForDDL(tc, heapId, true);
 
 		/* Drop the triggers */
-		GenericDescriptorList tdl = dd.getTriggerDescriptors(td);
-        for (Iterator descIter = tdl.iterator(); descIter.hasNext(); ) {
-            TriggerDescriptor trd = (TriggerDescriptor)descIter.next();
+        for (TriggerDescriptor trd : dd.getTriggerDescriptors(td)) {
             trd.drop(lcc);
 		}
 
 		/* Drop all defaults */
 		ColumnDescriptorList cdl = td.getColumnDescriptorList();
-		int					 cdlSize = cdl.size();
 		
-		for (int index = 0; index < cdlSize; index++)
+        for (ColumnDescriptor cd : cdl)
 		{
-			ColumnDescriptor cd = (ColumnDescriptor) cdl.elementAt(index);
-
 			// If column has a default we drop the default and
 			// any dependencies
 			if (cd.getDefaultInfo() != null)

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=1502965&r1=1502964&r2=1502965&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 Sun Jul 14 12:41:09 2013
@@ -236,7 +236,7 @@ public class FKInfo implements Formatabl
 			newfks = new FKInfo[size];
 			for (int i = 0; i < size; i++)
 			{
-				newfks[i] = (FKInfo)newfksVector.elementAt(i);
+                newfks[i] = newfksVector.elementAt(i);
 			}
 		}
 		return newfks;

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=1502965&r1=1502964&r2=1502965&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 Sun Jul 14 12:41:09 2013
@@ -34,7 +34,6 @@ import org.apache.derby.iapi.sql.Activat
 import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
 import org.apache.derby.iapi.sql.execute.ExecIndexRow;
 import org.apache.derby.iapi.sql.execute.ExecPreparedStatement;
-import org.apache.derby.iapi.sql.execute.ExecRow;
 import org.apache.derby.iapi.sql.execute.ExecRowBuilder;
 import org.apache.derby.iapi.sql.execute.ExecutionFactory;
 import org.apache.derby.iapi.sql.execute.NoPutResultSet;
@@ -116,6 +115,7 @@ abstract class GenericAggregateResultSet
 	 * 
 	 * @exception StandardException on error
 	 */	
+    @SuppressWarnings("UseOfObsoleteCollectionType")
 	protected final GenericAggregator[] getSortAggregators
 	(
 		AggregatorInfoList 			list,
@@ -125,13 +125,12 @@ abstract class GenericAggregateResultSet
 	) throws StandardException
 	{
 		GenericAggregator 	aggregators[]; 
-		Vector<GenericAggregator> tmpAggregators = new Vector<GenericAggregator>();
+        Vector<GenericAggregator>
+                tmpAggregators = new Vector<GenericAggregator>();
 		ClassFactory		cf = lcc.getLanguageConnectionFactory().getClassFactory();
 
-		int count = list.size();
-		for (int i = 0; i < count; i++)
+        for (AggregatorInfo aggInfo : list)
 		{
-			AggregatorInfo aggInfo = (AggregatorInfo) list.elementAt(i);
 			if (! (eliminateDistincts && aggInfo.isDistinct()))
 			// if (eliminateDistincts == aggInfo.isDistinct())
 			{
@@ -198,6 +197,7 @@ abstract class GenericAggregateResultSet
 		return row;
 	}
 
+    @Override
 	public void finish() throws StandardException {
 		source.finish();
 		super.finish();

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericExecutionFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericExecutionFactory.java?rev=1502965&r1=1502964&r2=1502965&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericExecutionFactory.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericExecutionFactory.java Sun Jul 14 12:41:09 2013
@@ -315,7 +315,7 @@ public class GenericExecutionFactory
 		int 						dmlType,
 		UUID						targetTableId,
 		String						targetTableName,
-		Vector						aiCounters
+        Vector<AutoincrementCounter> aiCounters
 	) throws StandardException
 	{
 		return new InternalTriggerExecutionContext(lcc, cc,

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=1502965&r1=1502964&r2=1502965&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 Sun Jul 14 12:41:09 2013
@@ -400,7 +400,7 @@ class GroupedAggregateResultSet extends 
 			 */
 			ExecIndexRow currSortedRow =
 				    resultRows[resultRows.length-1];
-                        ExecRow origRow = (ExecRow)nextRow.getClone();;
+                        ExecRow origRow = nextRow.getClone();
                         initializeVectorAggregation(nextRow);
 			int distinguisherCol = 
 				    sameGroupingValues(currSortedRow, nextRow);
@@ -504,6 +504,7 @@ class GroupedAggregateResultSet extends 
 	 *
 	 * @exception StandardException thrown on error
 	 */
+    @Override
 	public void	close() throws StandardException
 	{
 		beginTime = getCurrentTimeMillis();
@@ -759,8 +760,7 @@ class GroupedAggregateResultSet extends 
 		for (int i = 0; i < aggregates.length; i++)
 		{
 			GenericAggregator currAggregate = aggregates[i];
-			AggregatorInfo aInfo = (AggregatorInfo)
-					aggInfoList.elementAt(i);
+            AggregatorInfo aInfo = aggInfoList.elementAt(i);
 			if (aInfo.isDistinct())
 			{
 				DataValueDescriptor newValue = currAggregate.getInputColumnValue(newRow);
@@ -786,8 +786,7 @@ class GroupedAggregateResultSet extends 
 	{
 		for (int a = 0; a < aggregates.length; a++)
 		{
-			AggregatorInfo aInfo = (AggregatorInfo)
-						aggInfoList.elementAt(a);
+            AggregatorInfo aInfo = aggInfoList.elementAt(a);
 
             if (allocate) {
                 // Allocate an empty set if the aggregate is distinct.
@@ -820,7 +819,7 @@ class GroupedAggregateResultSet extends 
 	{
             if (r == null)
                 return "<NULL ROW>";
-	    StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
 	    int nCols = r.nColumns();
 	    for (int d = 0; d < nCols; d++)
 	    {

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=1502965&r1=1502964&r2=1502965&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 Sun Jul 14 12:41:09 2013
@@ -21,6 +21,7 @@
 
 package org.apache.derby.impl.sql.execute;
 
+import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.util.Enumeration;
 import java.util.Hashtable;
@@ -92,7 +93,8 @@ class InternalTriggerExecutionContext
 	** space because they can no longer provide meaningful
 	** results.
 	*/
-	private Vector<java.sql.ResultSet>	resultSetVector;
+    @SuppressWarnings("UseOfObsoleteCollectionType")
+    private Vector<ResultSet>   resultSetVector;
 
 	/**
 	 * aiCounters is a vector of AutoincrementCounters used to keep state which
@@ -102,17 +104,18 @@ class InternalTriggerExecutionContext
 	 * @see AutoincrementCounter
 	 * 
 	 */
-	private Vector aiCounters;
+    @SuppressWarnings("UseOfObsoleteCollectionType")
+    private Vector<AutoincrementCounter> aiCounters;
 	
 	/**
-	 * aiHT is a hashtable of autincrement <key, value> pairs. This is used for
-	 * ai values generated by the trigger.
+     * aiHT is a hash table of auto increment <key, value> pairs. This is used
+     * for auto increment values generated by the trigger.
 	 */
+    @SuppressWarnings("UseOfObsoleteCollectionType")
 	private Hashtable<String,Long> aiHT;
 
 	/**
-	 * Build me a big old nasty trigger execution context.
-	 * Damnit.
+     * Build a trigger execution context.
 	 * <p>
 	 * About the only thing of real interest to outside observers
 	 * is that it pushes itself as the trigger execution context
@@ -132,6 +135,7 @@ class InternalTriggerExecutionContext
 	 *
 	 * @exception StandardException on error
 	 */
+    @SuppressWarnings({"UseOfObsoleteCollectionType", "LeakingThisInConstructor"})
     InternalTriggerExecutionContext
 	(
 		LanguageConnectionContext	lcc,
@@ -140,7 +144,7 @@ class InternalTriggerExecutionContext
 		int 						dmlType,
 		UUID						targetTableId,
 		String						targetTableName,
-		Vector						aiCounters
+        Vector<AutoincrementCounter> aiCounters
 	) throws StandardException
 	{
 		this.dmlType = dmlType;
@@ -501,7 +505,7 @@ class InternalTriggerExecutionContext
 		// by this trigger.
 		if (aiHT != null)
 			{
-				Long value = (Long)aiHT.get(identity);
+                Long value = aiHT.get(identity);
 				if (value != null)
 					return value;
 			}
@@ -511,15 +515,10 @@ class InternalTriggerExecutionContext
 		// represent values inherited by trigger from insert statements.
 		if (aiCounters != null)
 		{
-			for (int i = 0; i < aiCounters.size(); i++)
+            for (AutoincrementCounter aic : aiCounters)
 			{
-				AutoincrementCounter aic = 
-					(AutoincrementCounter)aiCounters.elementAt(i);
-
-				//				System.out.println("in itec:getaivalue " + aic);
 				if (identity.equals(aic.getIdentity()))
 				{
-					//					System.out.println("in itec:getvalue--returning " +  aic.getCurrentValue());
 					return aic.getCurrentValue();
 				}
 			}
@@ -529,9 +528,10 @@ class InternalTriggerExecutionContext
 		return null;
 	}
 	/**
-	 * Copy a map of autoincrement values into the trigger 
-	 * execution context hashtable of autoincrement values.
+     * Copy a map of auto increment values into the trigger
+     * execution context hash table of auto increment values.
 	 */
+    @SuppressWarnings("UseOfObsoleteCollectionType")
 	public void copyHashtableToAIHT(Map<String,Long> from)
 	{
 		if (from == null)
@@ -558,17 +558,14 @@ class InternalTriggerExecutionContext
 
 		afterRow = null;
 
-		int size = aiCounters.size();
-		for (int i = 0; i < size; i++)
+        for (AutoincrementCounter aic : aiCounters)
 		{
-			AutoincrementCounter aic = 
-				(AutoincrementCounter)aiCounters.elementAt(i);
 			aic.reset(begin);
 		}
 	}	
 	
 	/**
-	 * Update Autoincrement Counters from the last row inserted.
+     * Update auto increment counters from the last row inserted.
 	 *
 	 */
 	public void updateAICounters() throws StandardException
@@ -576,17 +573,15 @@ class InternalTriggerExecutionContext
 		if (aiCounters == null)
 			return;
 
-		int size = aiCounters.size();
-		for (int i = 0; i < size; i++)
+        for (AutoincrementCounter aic : aiCounters)
 		{
-			AutoincrementCounter aic = 
-				(AutoincrementCounter)aiCounters.elementAt(i);
 			DataValueDescriptor dvd = afterRow.getColumn(aic.getColumnPosition());
 			aic.update(dvd.getLong());
 		}
 	}
 
 
+    @Override
 	public String toString() {
 		return triggerd.getName();
 	}

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=1502965&r1=1502964&r2=1502965&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 Sun Jul 14 12:41:09 2013
@@ -54,7 +54,6 @@ public class TriggerEventActivator
 	private int								dmlType;
 	private UUID							tableId;
 	private String							tableName;
-	private Vector							aiCounters;
 
 	/**
 	 * Basic constructor
@@ -67,6 +66,7 @@ public class TriggerEventActivator
 	 *
 	 * @exception StandardException on error
 	 */
+    @SuppressWarnings("UseOfObsoleteCollectionType")
 	public TriggerEventActivator
 	(
 		LanguageConnectionContext	lcc, 
@@ -74,7 +74,7 @@ public class TriggerEventActivator
 		TriggerInfo 				triggerInfo,
 		int							dmlType,
 		Activation					activation,
-		Vector						aiCounters
+        Vector<AutoincrementCounter> aiCounters
 	) throws StandardException
 	{
 		if (triggerInfo == null)
@@ -126,8 +126,8 @@ public class TriggerEventActivator
 								statementText,
 								dmlType,
 								tableId,	
-								tableName, aiCounters
-								);
+                                tableName,
+                                null);
 		setupExecutors(triggerInfo);
 	}
     

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/TriggerInfo.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/TriggerInfo.java?rev=1502965&r1=1502964&r2=1502965&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/TriggerInfo.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/TriggerInfo.java Sun Jul 14 12:41:09 2013
@@ -21,7 +21,7 @@
 
 package org.apache.derby.impl.sql.execute;
 
-import org.apache.derby.iapi.sql.dictionary.GenericDescriptorList;
+import org.apache.derby.iapi.sql.dictionary.TriggerDescriptorList;
 import org.apache.derby.iapi.sql.dictionary.TriggerDescriptor;
 
 import org.apache.derby.iapi.services.sanity.SanityManager;
@@ -74,7 +74,7 @@ public final class TriggerInfo implement
 	 */
 	public TriggerInfo
 	(
-		GenericDescriptorList	triggers
+        TriggerDescriptorList   triggers
 	)
 	{
 		if (SanityManager.DEBUG)
@@ -86,8 +86,7 @@ public final class TriggerInfo implement
 		/*
 		** Copy the trigger descriptors into an array of the right type
 		*/
-        triggerArray = (TriggerDescriptor[])
-                triggers.toArray(new TriggerDescriptor[triggers.size()]);
+        triggerArray = triggers.toArray(new TriggerDescriptor[triggers.size()]);
 	}
 
 	/**
@@ -177,15 +176,17 @@ public final class TriggerInfo implement
 	// Misc
 	//
 	//////////////////////////////////////////////////////////////
+    @Override
 	public String toString()
 	{
 		if (SanityManager.DEBUG)
 		{
-			StringBuffer str = new StringBuffer();
+            StringBuilder str = new StringBuilder();
 			str.append("\nTriggers:");
 			for (int i = 0; i < triggerArray.length; i++)
 			{
-				str.append("\n"+triggerArray[i]);
+                str.append('\n');
+                str.append(triggerArray[i]);
 			}
 			return str.toString();
 		}

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/ValueRow.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/ValueRow.java?rev=1502965&r1=1502964&r2=1502965&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/ValueRow.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/ValueRow.java Sun Jul 14 12:41:09 2013
@@ -119,7 +119,7 @@ class ValueRow implements ExecRow
 			if (clonedCols != null && !(clonedCols.get(colCtr + 1)))
 			{
 				/* Rows are 1-based, column[] is 0-based */
-				rowClone.setColumn(colCtr + 1, (DataValueDescriptor) column[colCtr]);
+                rowClone.setColumn(colCtr + 1, column[colCtr]);
 				continue;
 			}
 

Modified: db/derby/code/trunk/java/storeless/org/apache/derby/impl/storeless/EmptyDictionary.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/storeless/org/apache/derby/impl/storeless/EmptyDictionary.java?rev=1502965&r1=1502964&r2=1502965&view=diff
==============================================================================
--- db/derby/code/trunk/java/storeless/org/apache/derby/impl/storeless/EmptyDictionary.java (original)
+++ db/derby/code/trunk/java/storeless/org/apache/derby/impl/storeless/EmptyDictionary.java Sun Jul 14 12:41:09 2013
@@ -47,7 +47,7 @@ import org.apache.derby.iapi.sql.diction
 import org.apache.derby.iapi.sql.dictionary.DataDictionary;
 import org.apache.derby.iapi.sql.dictionary.DependencyDescriptor;
 import org.apache.derby.iapi.sql.dictionary.FileInfoDescriptor;
-import org.apache.derby.iapi.sql.dictionary.GenericDescriptorList;
+import org.apache.derby.iapi.sql.dictionary.TriggerDescriptorList;
 import org.apache.derby.iapi.sql.dictionary.PasswordHasher;
 import org.apache.derby.iapi.sql.dictionary.PermissionsDescriptor;
 import org.apache.derby.iapi.sql.dictionary.RoutinePermsDescriptor;
@@ -461,7 +461,7 @@ public class EmptyDictionary implements 
 		return null;
 	}
 
-	public List getAllSPSDescriptors() throws StandardException {
+    public List<SPSDescriptor> getAllSPSDescriptors() throws StandardException {
 		// Auto-generated method stub
 		return null;
 	}
@@ -536,7 +536,7 @@ public class EmptyDictionary implements 
 		return null;
 	}
 
-	public GenericDescriptorList getTriggerDescriptors(TableDescriptor td)
+    public TriggerDescriptorList getTriggerDescriptors(TableDescriptor td)
 			throws StandardException {
 		// Auto-generated method stub
 		return null;
@@ -555,14 +555,18 @@ public class EmptyDictionary implements 
 
 	}
 
-	public Hashtable hashAllConglomerateDescriptorsByNumber(
-			TransactionController tc) throws StandardException {
+    @SuppressWarnings("UseOfObsoleteCollectionType")
+    public Hashtable<Long, ConglomerateDescriptor>
+        hashAllConglomerateDescriptorsByNumber(TransactionController tc)
+            throws StandardException {
 		// Auto-generated method stub
 		return null;
 	}
 
-	public Hashtable hashAllTableDescriptorsByTableId(TransactionController tc)
-			throws StandardException {
+    @SuppressWarnings("UseOfObsoleteCollectionType")
+    public Hashtable<UUID, TableDescriptor>
+        hashAllTableDescriptorsByTableId(TransactionController tc)
+            throws StandardException {
 		// Auto-generated method stub
 		return null;
 	}
@@ -635,7 +639,8 @@ public class EmptyDictionary implements 
 		return null;
 	}
 
-	public List getAllDependencyDescriptorsList() throws StandardException {
+    public List<TupleDescriptor> getAllDependencyDescriptorsList()
+            throws StandardException {
 		// Auto-generated method stub
 		return null;
 	}



Mime
View raw message