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 [1/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
Author: dag
Date: Sun Jul 14 12:41:09 2013
New Revision: 1502965

URL: http://svn.apache.org/r1502965
Log:
DERBY-673: Get rid of the NodeFactory

Patch, derby-673-more-typesafe-6. This cleans up most compiler
warnings in the classes touched, including unnecessary casts due to
changes introduced by this use, but also others.  Some warnings were
silenced using the @SuppressWarning tag (mostly use of old classes
like Vector, Hashtable), in other cases the underlying problem was
fixed by changing the code as required.

It also introduces an explicit TriggerDescriptorList class extending a
generified GenericDescriptorList<TriggerDescriptor>.

Some local variables shadowing others are renamed and in in case
the two variables were merged into one.

I left in place warnings about missing serialVersionUID in
serializable classes since I am not sure whether they can be safely
suppressed; it would need further analysis.

Added:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/TriggerDescriptorList.java   (with props)
Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/catalog/DependableFinder.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/context/ContextManager.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/property/PropertyUtil.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/Activation.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/compile/CompilerContext.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ColumnDescriptorList.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ConstraintDescriptor.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ConstraintDescriptorList.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/DDUtils.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/DataDescriptorGenerator.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/DataDictionary.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/GenericDescriptorList.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/IndexLister.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ReferencedKeyConstraintDescriptor.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/SPSDescriptor.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/TableDescriptor.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/execute/ExecPreparedStatement.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks/TableNameInfo.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/GenericActivationHolder.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/GenericPreparedStatement.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/GenericStatement.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DMLModStatementNode.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DeleteNode.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromSubquery.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UpdateNode.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/conn/GenericAuthorizer.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionContext.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/depend/BasicDependencyManager.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/AggregatorInfoList.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/BaseActivation.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/BaseExpressionActivation.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/CardinalityCounter.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/ConstraintConstantAction.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/CreateIndexConstantAction.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DDLConstantAction.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DMLWriteResultSet.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DeleteCascadeResultSet.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DeleteResultSet.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DependentResultSet.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DropTableConstantAction.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/FKInfo.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericAggregateResultSet.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericExecutionFactory.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GroupedAggregateResultSet.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InternalTriggerExecutionContext.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/TriggerEventActivator.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/TriggerInfo.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/ValueRow.java
    db/derby/code/trunk/java/storeless/org/apache/derby/impl/storeless/EmptyDictionary.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/catalog/DependableFinder.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/catalog/DependableFinder.java?rev=1502965&r1=1502964&r2=1502965&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/catalog/DependableFinder.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/catalog/DependableFinder.java Sun Jul 14 12:41:09 2013
@@ -21,8 +21,6 @@
 
 package org.apache.derby.catalog;
 
-import java.sql.SQLException;
-
 import org.apache.derby.iapi.error.StandardException;
 import org.apache.derby.iapi.sql.dictionary.DataDictionary;
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/context/ContextManager.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/context/ContextManager.java?rev=1502965&r1=1502964&r2=1502965&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/context/ContextManager.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/context/ContextManager.java Sun Jul 14 12:41:09 2013
@@ -45,6 +45,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Collections;
 import java.util.Locale;
+import org.apache.derby.iapi.reference.ContextId;
 
 /**
  *
@@ -88,7 +89,7 @@ public class ContextManager
 		void pop() {
 			stack_.remove(stack_.size()-1);
 			top_ = stack_.isEmpty() ? 
-				null : (Context) stack_.get(stack_.size()-1); 
+                null : stack_.get(stack_.size()-1);
 		}
 		void remove(Context context) {
 			if (context == top_) {
@@ -101,7 +102,8 @@ public class ContextManager
 			return top_; 
 		}
 		boolean isEmpty() { return stack_.isEmpty(); }
-		List getUnmodifiableList() { 
+
+        List<Context> getUnmodifiableList() {
 			return view_;
 		}
 	}
@@ -233,9 +235,10 @@ public class ContextManager
 	 * @see org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext#resetSavepoints()
 	 * @see org.apache.derby.iapi.sql.conn.StatementContext#resetSavePoint()
 	 */
-	public final List getContextStack(String contextId) {
+    public final List<Context> getContextStack(String contextId) {
 		final CtxStack cs = ctxTable.get(contextId);
-		return (cs==null?Collections.EMPTY_LIST:cs.getUnmodifiableList());
+        final List<Context> el = Collections.emptyList();
+        return cs==null ? el : cs.getUnmodifiableList();
 	}
     
     /**
@@ -271,12 +274,12 @@ public class ContextManager
 
 		if (reportError) 
 		{
-			ContextImpl lcc = null;
 			StringBuffer sb = null;
 			if (! shutdown)
 			{
 				// report an id for the message if possible
-				lcc = (ContextImpl) getContext(org.apache.derby.iapi.reference.ContextId.LANG_CONNECTION);
+                ContextImpl lcc =
+                        (ContextImpl)getContext(ContextId.LANG_CONNECTION);
 				if (lcc != null) {
 					sb = lcc.appendErrorInfo();
 				}

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/property/PropertyUtil.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/property/PropertyUtil.java?rev=1502965&r1=1502964&r2=1502965&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/property/PropertyUtil.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/property/PropertyUtil.java Sun Jul 14 12:41:09 2013
@@ -126,7 +126,7 @@ public class PropertyUtil {
 		String value = (String) set.get(Property.DATABASE_PROPERTIES_ONLY);
 
 		boolean dbOnly = Boolean.valueOf(
-                    (value != null ? value.trim() : value)).booleanValue();
+                    (value != null ? value.trim() : null)).booleanValue();
 
 		return dbOnly;
 	}

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/Activation.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/Activation.java?rev=1502965&r1=1502964&r2=1502965&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/Activation.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/Activation.java Sun Jul 14 12:41:09 2013
@@ -21,36 +21,27 @@
 
 package org.apache.derby.iapi.sql;
 
+import java.sql.SQLWarning;
+import java.util.Enumeration;
+import java.util.Vector;
 import org.apache.derby.iapi.error.StandardException;
-
 import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
 import org.apache.derby.iapi.sql.conn.SQLSessionContext;
 import org.apache.derby.iapi.sql.depend.Dependent;
-
-import org.apache.derby.iapi.sql.dictionary.IndexRowGenerator;
 import org.apache.derby.iapi.sql.dictionary.TableDescriptor;
-
+import org.apache.derby.iapi.sql.execute.ConstantAction;
+import org.apache.derby.iapi.sql.execute.CursorResultSet;
 import org.apache.derby.iapi.sql.execute.ExecPreparedStatement;
 import org.apache.derby.iapi.sql.execute.ExecRow;
 import org.apache.derby.iapi.sql.execute.ExecutionFactory;
 import org.apache.derby.iapi.sql.execute.NoPutResultSet;
-import org.apache.derby.iapi.sql.execute.ConstantAction;
-import org.apache.derby.iapi.sql.execute.CursorResultSet;
 import org.apache.derby.iapi.sql.execute.TemporaryRowHolder;
-
 import org.apache.derby.iapi.store.access.ConglomerateController;
 import org.apache.derby.iapi.store.access.ScanController;
 import org.apache.derby.iapi.store.access.TransactionController;
-
+import org.apache.derby.iapi.types.DataTypeDescriptor;
 import org.apache.derby.iapi.types.DataValueFactory;
-
 import org.apache.derby.iapi.types.RowLocation;
-import org.apache.derby.iapi.types.DataTypeDescriptor;
-
-import java.sql.SQLWarning;
-import java.util.Enumeration;
-import java.util.Vector;
-import java.util.Hashtable;
 
 
 /**
@@ -562,12 +553,13 @@ public interface Activation extends Depe
 	 * get the reference to parent table ResultSets, that will be needed by the 
 	 * referential action dependent table scans.
 	 */
-	public Vector getParentResultSet(String resultSetId);
+    @SuppressWarnings("UseOfObsoleteCollectionType")
+    public Vector<TemporaryRowHolder> getParentResultSet(String resultSetId);
 	
 	//clear the parent resultset hash table;
 	public void clearParentResultSets();
 
-	public Enumeration getParentResultSetKeys();
+    public Enumeration<String> getParentResultSetKeys();
 
 	/**
 	 * beetle 3865: updateable cursor using index.  A way of communication

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/compile/CompilerContext.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/compile/CompilerContext.java?rev=1502965&r1=1502964&r2=1502965&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/compile/CompilerContext.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/compile/CompilerContext.java Sun Jul 14 12:41:09 2013
@@ -573,7 +573,7 @@ public interface CompilerContext extends
 	/**
 	 * @return The list of required privileges.
 	 */
-    List<StatementPermission>getRequiredPermissionsList();
+    List<StatementPermission> getRequiredPermissionsList();
     
 	/**
 	 * Add a sequence descriptor to the list of referenced sequences.

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ColumnDescriptorList.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ColumnDescriptorList.java?rev=1502965&r1=1502964&r2=1502965&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ColumnDescriptorList.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ColumnDescriptorList.java Sun Jul 14 12:41:09 2013
@@ -24,7 +24,6 @@ package org.apache.derby.iapi.sql.dictio
 import org.apache.derby.catalog.UUID;
 
 import java.util.ArrayList;
-import java.util.Iterator;
 
 /**
  * This represents a list of column descriptors. 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ConstraintDescriptor.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ConstraintDescriptor.java?rev=1502965&r1=1502964&r2=1502965&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ConstraintDescriptor.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ConstraintDescriptor.java Sun Jul 14 12:41:09 2013
@@ -324,7 +324,6 @@ public abstract class ConstraintDescript
 	{
 		if (colDL == null)
 		{
-			DataDictionary dd = getDataDictionary();
 			colDL = new ColumnDescriptorList();
 	
 			int[]	refCols = getReferencedColumns();
@@ -369,8 +368,8 @@ public abstract class ConstraintDescript
 		int index;
 		for (index = 0; index < mySize && index < otherSize; index++)
 		{
-			myColumn = (ColumnDescriptor) myColDl.elementAt(index);	
-			otherColumn = (ColumnDescriptor) otherColumns.elementAt(index);	
+            myColumn = myColDl.elementAt(index);
+            otherColumn = otherColumns.elementAt(index);
 
 			/*
 			** Just compare the types.  Note that this will
@@ -442,7 +441,8 @@ public abstract class ConstraintDescript
 	 * @return	A String representation of this ColumnDescriptor
 	 */
 
-	public String	toString()
+    @Override
+    public String toString()
 	{
 		if (SanityManager.DEBUG)
 		{
@@ -750,7 +750,9 @@ public abstract class ConstraintDescript
     }
 	
 	/** @see TupleDescriptor#getDescriptorName */
+    @Override
 	public String getDescriptorName() { return constraintName; }
 	
+    @Override
 	public String getDescriptorType() { return "Constraint"; }
 }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ConstraintDescriptorList.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ConstraintDescriptorList.java?rev=1502965&r1=1502964&r2=1502965&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ConstraintDescriptorList.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ConstraintDescriptorList.java Sun Jul 14 12:41:09 2013
@@ -21,23 +21,9 @@
 
 package org.apache.derby.iapi.sql.dictionary;
 
-import org.apache.derby.iapi.error.StandardException;
-import org.apache.derby.iapi.services.sanity.SanityManager;
-
-import org.apache.derby.catalog.UUID;
-
-import org.apache.derby.iapi.sql.dictionary.ConstraintDescriptor;
-import org.apache.derby.iapi.sql.dictionary.ReferencedKeyConstraintDescriptor;
-import org.apache.derby.iapi.sql.dictionary.DataDictionary;
-import org.apache.derby.iapi.sql.dictionary.KeyConstraintDescriptor;
-import org.apache.derby.iapi.sql.dictionary.SchemaDescriptor;
-
-import org.apache.derby.iapi.error.StandardException;
-import org.apache.derby.iapi.services.sanity.SanityManager;
-
-import org.apache.derby.catalog.UUID;
 
 import java.util.ArrayList;
+import org.apache.derby.catalog.UUID;
 
 public class ConstraintDescriptorList extends ArrayList<ConstraintDescriptor>
 {
@@ -257,13 +243,12 @@ public class ConstraintDescriptorList ex
 	 */
 	public ConstraintDescriptorList getSubList(int type)
 	{
-		ConstraintDescriptor cd = null;
 		ConstraintDescriptorList cdl = new ConstraintDescriptorList();
 		int size = size();
 
 		for (int index = 0; index < size; index++)
 		{
-			cd = elementAt(index);
+            ConstraintDescriptor cd = elementAt(index);
 
 			if (cd.getConstraintType() == type)
 			{

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/DDUtils.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/DDUtils.java?rev=1502965&r1=1502964&r2=1502965&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/DDUtils.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/DDUtils.java Sun Jul 14 12:41:09 2013
@@ -21,14 +21,12 @@
 
 package org.apache.derby.iapi.sql.dictionary;
 
+import java.util.Enumeration;
+import java.util.Hashtable;
 import org.apache.derby.iapi.error.StandardException;
-
 import org.apache.derby.iapi.reference.SQLState;
-import org.apache.derby.iapi.sql.StatementType;
-import java.util.Hashtable;
-import org.apache.derby.iapi.services.sanity.SanityManager;
 import org.apache.derby.iapi.services.i18n.MessageService;
-import java.util.Enumeration;
+import org.apache.derby.iapi.sql.StatementType;
 
 /**
  *	Static Data dictionary utilities.
@@ -63,7 +61,7 @@ public	class	DDUtils
 		}
 
 
-		ReferencedKeyConstraintDescriptor refCd = null;
+        ReferencedKeyConstraintDescriptor refCd;
 
 		/*
 		** There were no column names specified, just find
@@ -168,10 +166,9 @@ public	class	DDUtils
 			return false;
 		}
 		
-		String name;
 		for (int index = 0; index < columnNames.length; index++)
 		{
-			name = ((ColumnDescriptor) cdl.elementAt(index)).getColumnName();
+            String name = cdl.elementAt(index).getColumnName();
 			if (!name.equals(columnNames[index]))
 			{
 				return false;
@@ -186,6 +183,7 @@ public	class	DDUtils
 	**checks whether the foreign key relation ships referential action
 	**is violating the restrictions we have in the current system.
 	**/
+    @SuppressWarnings("UseOfObsoleteCollectionType")
 	public static void validateReferentialActions
     (
 		DataDictionary	dd,
@@ -258,7 +256,7 @@ public	class	DDUtils
 	** connected to, referential action that will occur if there is a delete on
 	** the table this table connected to[CASACDE, SETNULL , RESTRICT ...etc).)
 	**/
-
+    @SuppressWarnings("UseOfObsoleteCollectionType")
 	private	static int  getCurrentDeleteConnections
 	(
 	 DataDictionary	dd,
@@ -305,7 +303,8 @@ public	class	DDUtils
 				   
 					String refTableName = refTd.getSchemaName() + "." + refTd.getName();
 					//check with  the existing references.
-					Integer rAction = ((Integer)dch.get(refTableName));
+                    Integer rAction = dch.get(refTableName);
+
 					if(rAction != null) // we already looked at this table
 					{
 						prevNotCascade = passedInPrevNotCascade;
@@ -332,7 +331,7 @@ public	class	DDUtils
 					//not specified on the current link. It is actually the 
 					//value of what happens to the table whose delete
 					// connections we are finding.
-					dch.put(refTableName, (new Integer(childRefAction)));
+                    dch.put(refTableName, Integer.valueOf(childRefAction));
 					
 					//find the next delete conectiions on this path for non
 					//self referencig delete connections.
@@ -360,7 +359,7 @@ public	class	DDUtils
 	** Our implementation just follows what is did in DB2 and throws error
 	** messaged similar to DB2 (sql0632N, sql0633N, sql0634N)
 	*/
-
+    @SuppressWarnings("UseOfObsoleteCollectionType")
 	private	static void validateDeleteConnection
 	(
 		DataDictionary	dd,
@@ -391,7 +390,7 @@ public	class	DDUtils
 		if(checkImmediateRefTable)
 		{
 		    String refTableName = refTd.getSchemaName() + "." + refTd.getName();
-			rAction = ((Integer)dch.get(refTableName));
+            rAction = dch.get(refTableName);
 			
 			// check possible invalide cases incase of self referencing foreign key
 			if(isSelfReferencingFk)
@@ -442,8 +441,9 @@ public	class	DDUtils
 				** CASCADE, otherwise we should throw error.
 				*/
 
-				if(isSelfReferencingFk && dch.contains(new Integer(StatementType.RA_CASCADE)) && 
-				   refActionType!=  StatementType.RA_CASCADE)
+                if( isSelfReferencingFk &&
+                    dch.contains(Integer.valueOf(StatementType.RA_CASCADE)) &&
+                    refActionType !=  StatementType.RA_CASCADE)
 				{
 					throw
 						generateError(SQLState.LANG_DELETE_RULE_MUSTBE_ECASCADE,
@@ -588,7 +588,7 @@ public	class	DDUtils
 				
 
 				String nextRefTableName =  nextRefTd.getSchemaName() + "." + nextRefTd.getName();
-				rAction = ((Integer)ech.get(nextRefTableName));
+                rAction = ech.get(nextRefTableName);
 				if(rAction != null)
 				{
 					/*
@@ -606,11 +606,14 @@ public	class	DDUtils
 
 				}else
 				{
-					rAction = ((Integer)dch.get(nextRefTableName));
+                    rAction = dch.get(nextRefTableName);
 					if(rAction == null)
 					{
-						if(multiPathCheck)
-							dch.put(nextRefTableName, (new Integer(refActionType)));
+                        if (multiPathCheck) {
+                            dch.put(nextRefTableName,
+                                    Integer.valueOf(refActionType));
+                        }
+
 						if(!isSelfRefLink)
 						{
 							validateDeleteConnection(dd, actualTd,  nextRefTd,
@@ -751,7 +754,8 @@ public	class	DDUtils
 	**/
 
 
-	private static void checkForAnyExistingDeleteConnectionViolations
+    @SuppressWarnings("UseOfObsoleteCollectionType")
+    private static void checkForAnyExistingDeleteConnectionViolations
 	(
 	 DataDictionary	dd,
 	 TableDescriptor td,
@@ -770,12 +774,9 @@ public	class	DDUtils
 		//find the tables that are referring to the table we 
 		//are adding the foreign key and check whether we violate their existing rules.
 		String addTableName = td.getSchemaName() + "." + td.getName();;
-		ConstraintDescriptorList refCDL = dd.getConstraintDescriptors(td);
-		int refCDLSize = refCDL.size();
-		for (int index = 0; index < refCDLSize; index++)
-		{
-			ConstraintDescriptor cd = refCDL.elementAt(index);
 
+        for (ConstraintDescriptor cd : dd.getConstraintDescriptors(td))
+        {
 			if ((cd instanceof ReferencedKeyConstraintDescriptor))
 			{
 				ConstraintDescriptorList fkcdl = dd.getActiveConstraintDescriptors

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/DataDescriptorGenerator.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/DataDescriptorGenerator.java?rev=1502965&r1=1502964&r2=1502965&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/DataDescriptorGenerator.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/DataDescriptorGenerator.java Sun Jul 14 12:41:09 2013
@@ -21,31 +21,15 @@
 
 package org.apache.derby.iapi.sql.dictionary;
 
-import org.apache.derby.iapi.services.monitor.Monitor;
-import org.apache.derby.iapi.error.StandardException;
-
-import org.apache.derby.iapi.sql.dictionary.*;
-
-import org.apache.derby.iapi.types.TypeId;
-import org.apache.derby.iapi.sql.depend.Dependent;
-import org.apache.derby.iapi.sql.depend.Provider;
-import org.apache.derby.iapi.reference.SQLState;
-import org.apache.derby.iapi.sql.execute.ConstantAction;
-import org.apache.derby.iapi.sql.execute.ExecPreparedStatement;
-import org.apache.derby.iapi.services.uuid.UUIDFactory;
-import org.apache.derby.iapi.services.io.FormatableBitSet;
-
-import org.apache.derby.catalog.AliasInfo;
-import org.apache.derby.catalog.DefaultInfo;
-import org.apache.derby.catalog.Dependable;
-import org.apache.derby.catalog.DependableFinder;
+import java.sql.Timestamp;
 import org.apache.derby.catalog.ReferencedColumns;
-import org.apache.derby.catalog.types.ReferencedColumnsDescriptorImpl;
 import org.apache.derby.catalog.UUID;
-import org.apache.derby.catalog.Statistics;
-import java.sql.Timestamp;
-import java.io.InputStream;
+import org.apache.derby.catalog.types.ReferencedColumnsDescriptorImpl;
+import org.apache.derby.iapi.error.StandardException;
+import org.apache.derby.iapi.services.io.FormatableBitSet;
+import org.apache.derby.iapi.services.monitor.Monitor;
 import org.apache.derby.iapi.services.sanity.SanityManager;
+import org.apache.derby.iapi.services.uuid.UUIDFactory;
 import org.apache.derby.iapi.types.DataTypeDescriptor;
 
 /**
@@ -332,15 +316,15 @@ public class DataDescriptorGenerator 
 						UUID schemaID
 						)
 	{
-		return (ConglomerateDescriptor)
-				new ConglomerateDescriptor(dataDictionary, conglomerateId,
-												name,
-												indexable,
-												indexRowGenerator,
-												isConstraint,
-												uuid,
-											    tableID,
-												schemaID);
+        return new ConglomerateDescriptor(dataDictionary,
+                                          conglomerateId,
+                                          name,
+                                          indexable,
+                                          indexRowGenerator,
+                                          isConstraint,
+                                          uuid,
+                                          tableID,
+                                          schemaID);
 	}
 
 	/**

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/DataDictionary.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/DataDictionary.java?rev=1502965&r1=1502964&r2=1502965&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/DataDictionary.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/DataDictionary.java Sun Jul 14 12:41:09 2013
@@ -419,7 +419,7 @@ public interface DataDictionary
 	 *
 	 * @param props   The persistent properties used to configure password hashing.
 	 */
-    public  PasswordHasher  makePasswordHasher( Dictionary props )
+    public  PasswordHasher  makePasswordHasher( Dictionary<?,?> props )
         throws StandardException;
     
 	/**
@@ -1083,8 +1083,7 @@ public interface DataDictionary
 	 *
 	 * @exception StandardException		Thrown on failure
 	 */
-	public List getAllSPSDescriptors()
-		throws StandardException;
+    public List<SPSDescriptor> getAllSPSDescriptors() throws StandardException;
 
 	/**
 	 * Get all the parameter descriptors for an SPS.
@@ -1344,7 +1343,7 @@ public interface DataDictionary
 	 *
 	 * @exception StandardException		Thrown on failure
 	 */
-	public GenericDescriptorList getTriggerDescriptors(TableDescriptor td)
+    public TriggerDescriptorList getTriggerDescriptors(TableDescriptor td)
 		throws StandardException;
 
 	/**
@@ -1399,8 +1398,10 @@ public interface DataDictionary
 	 *
 	 * @exception StandardException		Thrown on failure
 	 */
-	public Hashtable hashAllConglomerateDescriptorsByNumber(TransactionController tc)
-		throws StandardException;
+    @SuppressWarnings("UseOfObsoleteCollectionType")
+    public Hashtable<Long, ConglomerateDescriptor>
+        hashAllConglomerateDescriptorsByNumber(TransactionController tc)
+            throws StandardException;
 
 	/**
 	 * Get all of the TableDescriptors in the database and hash them by TableId
@@ -1417,7 +1418,8 @@ public interface DataDictionary
 	 *
 	 * @exception StandardException		Thrown on failure
 	 */
-	public Hashtable hashAllTableDescriptorsByTableId(TransactionController tc)
+    @SuppressWarnings("UseOfObsoleteCollectionType")
+    public Hashtable<UUID, TableDescriptor> hashAllTableDescriptorsByTableId(TransactionController tc)
 		throws StandardException;
 
 	/**
@@ -1607,7 +1609,7 @@ public interface DataDictionary
 	 *
 	 * @exception StandardException		Thrown on failure
 	 */
-	public List getAllDependencyDescriptorsList()
+    public List<TupleDescriptor> getAllDependencyDescriptorsList()
 				throws StandardException;
 
 	/** 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/GenericDescriptorList.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/GenericDescriptorList.java?rev=1502965&r1=1502964&r2=1502965&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/GenericDescriptorList.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/GenericDescriptorList.java Sun Jul 14 12:41:09 2013
@@ -25,7 +25,8 @@ import org.apache.derby.catalog.UUID;
 
 import java.util.ArrayList;
 
-public class GenericDescriptorList extends ArrayList<UniqueTupleDescriptor>
+public class GenericDescriptorList<E extends UniqueTupleDescriptor>
+       extends ArrayList<E>
 {
 	private boolean scanned;
 
@@ -61,9 +62,9 @@ public class GenericDescriptorList exten
 	 *
 	 * @return The matching UniqueTupleDescriptor.
 	 */
-	public UniqueTupleDescriptor getUniqueTupleDescriptor(UUID uuid)
+    public E getUniqueTupleDescriptor(UUID uuid)
 	{
-        for (UniqueTupleDescriptor ud : this)
+        for (E ud : this)
 		{
 			if (ud.getUUID().equals(uuid))
 			{

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/IndexLister.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/IndexLister.java?rev=1502965&r1=1502964&r2=1502965&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/IndexLister.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/IndexLister.java Sun Jul 14 12:41:09 2013
@@ -22,12 +22,8 @@
 package org.apache.derby.iapi.sql.dictionary;
 
 import org.apache.derby.iapi.error.StandardException;
-
 import org.apache.derby.iapi.services.io.ArrayUtil;
 
-import org.apache.derby.iapi.sql.dictionary.TableDescriptor;
-import org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor;
-import org.apache.derby.iapi.sql.dictionary.IndexRowGenerator;
 
 
 /**
@@ -230,8 +226,7 @@ public class IndexLister
 			if ( ! cd.isIndex())
 				continue;
 
-			indexRowGenerators[++j] = 
-				(IndexRowGenerator)cd.getIndexDescriptor();
+            indexRowGenerators[++j] = cd.getIndexDescriptor();
 			indexConglomerateNumbers[j] = cd.getConglomerateNumber();
 			if (!(cd.isConstraint()))
 			{

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ReferencedKeyConstraintDescriptor.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ReferencedKeyConstraintDescriptor.java?rev=1502965&r1=1502964&r2=1502965&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ReferencedKeyConstraintDescriptor.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ReferencedKeyConstraintDescriptor.java Sun Jul 14 12:41:09 2013
@@ -21,13 +21,10 @@
 
 package org.apache.derby.iapi.sql.dictionary;
 
+import org.apache.derby.catalog.UUID;
 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.sql.StatementType;
-import org.apache.derby.iapi.services.io.StoredFormatIds;
-import org.apache.derby.catalog.UUID;
 /**
  * A ReferencedConstraintDeescriptor is a primary key or a unique
  * key that is referenced by a foreign key.
@@ -125,7 +122,6 @@ public class ReferencedKeyConstraintDesc
 			return hasSelfReferencing;
 		}
 	
-		ConstraintDescriptor cd;
 		ForeignKeyConstraintDescriptor fkcd;
 		/* Get a full list of referencing keys, if caller
 		 * passed in null CDL.
@@ -134,11 +130,9 @@ public class ReferencedKeyConstraintDesc
 		{
 			cdl = getForeignKeyConstraints(type);
 		}
-		int cdlSize = cdl.size();
 
-		for (int index = 0; index < cdlSize; index++)
+        for (ConstraintDescriptor cd : cdl)
 		{
-			cd = (ConstraintDescriptor) cdl.elementAt(index);
 			if (! (cd instanceof ForeignKeyConstraintDescriptor))
 			{
 				continue;
@@ -172,15 +166,12 @@ public class ReferencedKeyConstraintDesc
 			checkType(type);
 		}
 	
-		ConstraintDescriptor cd;
 		ForeignKeyConstraintDescriptor fkcd;
 		// Get a full list of referencing keys,
 		ConstraintDescriptorList cdl = getForeignKeyConstraints(type);
- 		int cdlSize = cdl.size();
 
-		for (int index = 0; index < cdlSize; index++)
+        for (ConstraintDescriptor cd : cdl)
 		{
-			cd = (ConstraintDescriptor) cdl.elementAt(index);
 			if (! (cd instanceof ForeignKeyConstraintDescriptor))
 			{
 				continue;
@@ -262,6 +253,7 @@ public class ReferencedKeyConstraintDesc
 	 *
 	 * @return false
 	 */
+    @Override
 	public boolean isReferenced()
 	{
 		return referenceCount != 0;
@@ -273,6 +265,7 @@ public class ReferencedKeyConstraintDesc
 	 *
 	 * @return the number of fks
 	 */
+    @Override
 	public int getReferenceCount()
 	{
 		return referenceCount;

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/SPSDescriptor.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/SPSDescriptor.java?rev=1502965&r1=1502964&r2=1502965&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/SPSDescriptor.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/SPSDescriptor.java Sun Jul 14 12:41:09 2013
@@ -801,6 +801,7 @@ public class SPSDescriptor extends Uniqu
 	 *
 	 * @return The contents as a String
 	 */
+    @Override
 	public final String toString()
 	{
 		if (SanityManager.DEBUG)
@@ -1019,7 +1020,8 @@ public class SPSDescriptor extends Uniqu
                     preparedStatement = null;
 					updateSYSSTATEMENTS(lcc, INVALIDATE, null);
 				}
-				dm.invalidateFor(this, dm.USER_RECOMPILE_REQUEST, lcc);
+                dm.invalidateFor(
+                        this, DependencyManager.USER_RECOMPILE_REQUEST, lcc);
 				break;
 			case DependencyManager.DROP_SPS:
 				//System.out.println("SPSD " + preparedStatement);
@@ -1161,12 +1163,14 @@ public class SPSDescriptor extends Uniqu
 	}
 
 	/** @see TupleDescriptor#getDescriptorType */
+    @Override
 	public String getDescriptorType() { return "Statement"; }
 
 	/** @see TupleDescriptor#getDescriptorName */
 	// RESOLVE: some descriptors have getName.  some descriptors have
 	// getTableName, getColumnName whatever! try and unify all of this to one
 	// getDescriptorName! 
+    @Override
 	public String getDescriptorName() { return name; }
 	
 }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/TableDescriptor.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/TableDescriptor.java?rev=1502965&r1=1502964&r2=1502965&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/TableDescriptor.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/TableDescriptor.java Sun Jul 14 12:41:09 2013
@@ -21,8 +21,6 @@
 
 package org.apache.derby.iapi.sql.dictionary;
 
-import java.util.Enumeration;
-import java.util.Iterator;
 import java.util.List;
 
 import org.apache.derby.catalog.Dependable;
@@ -165,7 +163,7 @@ public class TableDescriptor extends Uni
     ColumnDescriptorList            columnDescriptorList;
 	ConglomerateDescriptorList		conglomerateDescriptorList;
 	ConstraintDescriptorList		constraintDescriptorList;
-	private	GenericDescriptorList	triggerDescriptorList;
+    private TriggerDescriptorList   triggerDescriptorList;
 	ViewDescriptor					viewDescriptor;
 
 	private FormatableBitSet referencedColumnMapGet() {
@@ -263,7 +261,7 @@ public class TableDescriptor extends Uni
 		this.conglomerateDescriptorList = new ConglomerateDescriptorList();
 		this.columnDescriptorList = new ColumnDescriptorList();
 		this.constraintDescriptorList = new ConstraintDescriptorList();
-		this.triggerDescriptorList = new GenericDescriptorList();
+        this.triggerDescriptorList = new TriggerDescriptorList();
 	}
 
 	//
@@ -461,10 +459,9 @@ public class TableDescriptor extends Uni
 		throws StandardException
 	{
 		int					maxColumnID = 1;
-		int cdlSize = getColumnDescriptorList().size();
-		for (int index = 0; index < cdlSize; index++)
+
+        for (ColumnDescriptor cd : columnDescriptorList)
 		{
-			ColumnDescriptor cd = (ColumnDescriptor) columnDescriptorList.elementAt(index);
 			maxColumnID = Math.max( maxColumnID, cd.getPosition() );
 		}
 
@@ -554,7 +551,7 @@ public class TableDescriptor extends Uni
 
 		for (int index = 0; index < columnCount; index++)
 		{
-			ColumnDescriptor cd = (ColumnDescriptor) columnDescriptorList.elementAt(index);
+            ColumnDescriptor cd = columnDescriptorList.elementAt(index);
 			//String name = column.getColumnName();
 			DataValueDescriptor dataValue = cd.getType().getNull();
 			result.setColumn(index + 1, dataValue);
@@ -581,8 +578,7 @@ public class TableDescriptor extends Uni
 
 		for (int index = 0; index < collation_ids.length; index++)
 		{
-			ColumnDescriptor cd = 
-                (ColumnDescriptor) columnDescriptorList.elementAt(index);
+            ColumnDescriptor cd = columnDescriptorList.elementAt(index);
 
             collation_ids[index] = cd.getType().getCollationType();
 
@@ -635,6 +631,7 @@ public class TableDescriptor extends Uni
 	 *
 	 * @return boolean              Whether or not this provider is persistent.
 	 */
+    @Override
 	public boolean isPersistent()
 	{
 		if (tableType == TableDescriptor.GLOBAL_TEMPORARY_TABLE_TYPE)
@@ -681,9 +678,7 @@ public class TableDescriptor extends Uni
     public int getQualifiedNumberOfIndexes(int minColCount,
                                            boolean nonUniqeTrumpsColCount) {
         int matches = 0;
-        for (Iterator congIter = conglomerateDescriptorList.iterator();
-                congIter.hasNext(); ) {
-            ConglomerateDescriptor cd = (ConglomerateDescriptor)congIter.next();
+        for (ConglomerateDescriptor cd : conglomerateDescriptorList) {
             if (cd.isIndex()) {
                 IndexRowGenerator irg = cd.getIndexDescriptor();
                 if (irg.numberOfOrderedColumns() >= minColCount ||
@@ -709,7 +704,7 @@ public class TableDescriptor extends Uni
 	(
 		int						statementType,
 		int[]					changedColumnIds,
-		GenericDescriptorList	relevantTriggers
+        TriggerDescriptorList   relevantTriggers
     )
 		throws StandardException
 	{
@@ -723,9 +718,8 @@ public class TableDescriptor extends Uni
 		}
 
 		DataDictionary				dd = getDataDictionary();
-        for (Iterator descIter = dd.getTriggerDescriptors(this).iterator() ;
-                descIter.hasNext() ; ) {
-            TriggerDescriptor tgr = (TriggerDescriptor)descIter.next();
+
+        for (TriggerDescriptor tgr : dd.getTriggerDescriptors(this)) {
             if (tgr.needsToFire(statementType, changedColumnIds)) {
                 relevantTriggers.add(tgr);
             }
@@ -854,13 +848,12 @@ public class TableDescriptor extends Uni
 			return tableName;
 		else
 		{
-			StringBuffer name = new StringBuffer();
+            StringBuilder name = new StringBuilder();
             name.append(tableName);
 			boolean first = true;
 
-			for (int i = 0; i < columnDescriptorList.size(); i++)
+            for (ColumnDescriptor cd: columnDescriptorList)
 			{
-				ColumnDescriptor cd = (ColumnDescriptor) columnDescriptorList.elementAt(i);
 				if (referencedColumnMapGet().isSet(cd.getPosition()))
 				{
 					if (first)
@@ -907,6 +900,7 @@ public class TableDescriptor extends Uni
 	 *
 	 * @return The contents as a String
 	 */
+    @Override
 	public String toString()
 	{
 		if (SanityManager.DEBUG)
@@ -1037,7 +1031,7 @@ public class TableDescriptor extends Uni
 	 *
 	 * @exception StandardException		Thrown on failure
 	 */
-	public GenericDescriptorList getTriggerDescriptorList()
+    public TriggerDescriptorList getTriggerDescriptorList()
 		throws StandardException
 	{
 		return triggerDescriptorList;
@@ -1048,7 +1042,7 @@ public class TableDescriptor extends Uni
 	 *
 	 * @param newCDL	The new trigger descriptor list for this table descriptor
 	 */
-	public void setTriggerDescriptorList(GenericDescriptorList newCDL)
+    public void setTriggerDescriptorList(TriggerDescriptorList newCDL)
 	{
 		triggerDescriptorList = newCDL;
 	}
@@ -1062,7 +1056,7 @@ public class TableDescriptor extends Uni
 		throws StandardException
 	{
 		// Easier just to get a new CDL then to clean out the current one
-		this.triggerDescriptorList = new GenericDescriptorList();
+        this.triggerDescriptorList = new TriggerDescriptorList();
 	}
 
 	
@@ -1251,18 +1245,15 @@ public class TableDescriptor extends Uni
 	}
 
 	/**
-	 * Does the table have an autoincrement column or not?
+     * Does the table have an auto-increment column or not?
 	 * 
-	 * @return TRUE if the table has atleast one autoincrement column, false
+     * @return TRUE if the table has at least one auto-increment column, false
 	 * otherwise 
 	 */
 	public boolean tableHasAutoincrement()
 	{
-		int cdlSize = getColumnDescriptorList().size();
-		for (int index = 0; index < cdlSize; index++)
+        for (ColumnDescriptor cd : columnDescriptorList)
 		{
-			ColumnDescriptor cd = 
-				(ColumnDescriptor) columnDescriptorList.elementAt(index);
 			if (cd.isAutoincrement())
 				return true;
 		}
@@ -1337,7 +1328,7 @@ public class TableDescriptor extends Uni
      */
     public void markForIndexStatsUpdate(long tableRowCountEstimate)
             throws StandardException {
-        List sdl = getStatistics();
+        List<StatisticsDescriptor> sdl = getStatistics();
         if (sdl.isEmpty() && tableRowCountEstimate >= ISTATS_CREATE_THRESHOLD) {
             // No statistics exists, create them.
             indexStatsUpToDate = false;
@@ -1347,9 +1338,7 @@ public class TableDescriptor extends Uni
         }
 
         // Check the state of the existing indexes (if any).
-        Iterator statIter = sdl.iterator();
-        while (statIter.hasNext()) {
-            StatisticsDescriptor sd = (StatisticsDescriptor)statIter.next();
+        for (StatisticsDescriptor sd : sdl) {
             long indexRowCountEstimate = sd.getStatistic().getRowEstimate();
             long diff = Math.abs(tableRowCountEstimate - indexRowCountEstimate);
             // TODO: Set a proper limit here to avoid too frequent updates.
@@ -1405,19 +1394,17 @@ public class TableDescriptor extends Uni
 	public boolean statisticsExist(ConglomerateDescriptor cd)
 		throws StandardException
 	{
-		List sdl = getStatistics();
+        List<StatisticsDescriptor> sdl = getStatistics();
 
 		if (cd == null)
 			return (sdl.size() > 0);
 
 		UUID cdUUID = cd.getUUID();
 
-		for (Iterator li = sdl.iterator(); li.hasNext(); )
-		{
-			StatisticsDescriptor statDesc = (StatisticsDescriptor) li.next();
-			if (cdUUID.equals(statDesc.getReferenceID()))
+        for (StatisticsDescriptor statDesc : sdl) {
+            if (cdUUID.equals(statDesc.getReferenceID())) {
 				return true;
-
+            }
 		}
 
 		return false;
@@ -1444,11 +1431,8 @@ public class TableDescriptor extends Uni
 	{
 		UUID referenceUUID = cd.getUUID();
 
-		List sdl = getStatistics();
-		for (Iterator li = sdl.iterator(); li.hasNext(); )
+        for (StatisticsDescriptor statDesc : getStatistics())
 		{
-			StatisticsDescriptor statDesc = (StatisticsDescriptor) li.next();
-
 			if (!referenceUUID.equals(statDesc.getReferenceID()))
 				continue;
 			
@@ -1464,9 +1448,11 @@ public class TableDescriptor extends Uni
 	}
 
 	/** @see TupleDescriptor#getDescriptorName */
+    @Override
 	public String getDescriptorName() { return tableName; }
 
 	/** @see TupleDescriptor#getDescriptorType */
+    @Override
 	public String getDescriptorType() 
 	{
 		return (tableType == TableDescriptor.SYNONYM_TYPE) ? "Synonym" : "Table/View";

Added: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/TriggerDescriptorList.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/TriggerDescriptorList.java?rev=1502965&view=auto
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/TriggerDescriptorList.java (added)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/TriggerDescriptorList.java Sun Jul 14 12:41:09 2013
@@ -0,0 +1,29 @@
+/*
+
+   Derby - Class org.apache.derby.iapi.sql.dictionary.TriggerDescriptorList
+
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to you under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+
+package org.apache.derby.iapi.sql.dictionary;
+
+public class TriggerDescriptorList extends GenericDescriptorList<TriggerDescriptor> {
+    public TriggerDescriptorList() {
+        super();
+    }
+}
+

Propchange: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/TriggerDescriptorList.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/execute/ExecPreparedStatement.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/execute/ExecPreparedStatement.java?rev=1502965&r1=1502964&r2=1502965&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/execute/ExecPreparedStatement.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/execute/ExecPreparedStatement.java Sun Jul 14 12:41:09 2013
@@ -30,6 +30,7 @@ import org.apache.derby.iapi.sql.conn.La
 import org.apache.derby.iapi.sql.PreparedStatement;
 
 import java.util.List;
+import org.apache.derby.iapi.sql.dictionary.StatementPermission;
 
 /**
  * Execution extends prepared statement to add methods it needs
@@ -173,7 +174,7 @@ public interface ExecPreparedStatement 
 	 * @return the list of permissions required to execute this statement. May be null if
 	 *         the database does not use SQL standard authorization
 	 */
-	List getRequiredPermissionsList();
+    List<StatementPermission> getRequiredPermissionsList();
 
     // Methods for stale plan checking.
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks/TableNameInfo.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks/TableNameInfo.java?rev=1502965&r1=1502964&r2=1502965&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks/TableNameInfo.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks/TableNameInfo.java Sun Jul 14 12:41:09 2013
@@ -33,14 +33,21 @@ import org.apache.derby.iapi.sql.diction
 import org.apache.derby.iapi.store.access.TransactionController;
 
 import java.util.Hashtable;
+import org.apache.derby.catalog.UUID;
 
+@SuppressWarnings("UseOfObsoleteCollectionType")
 public class TableNameInfo {
 
 	// things to look up table name etc
 	private DataDictionary dd;
-	private Hashtable ddCache;			// conglomId -> conglomerateDescriptor
-	private Hashtable tdCache;			// tableID UUID -> table descriptor
-	private Hashtable<Long,TableDescriptor> tableCache;		// conglomId -> table descriptor
+
+    // conglomId -> conglomerateDescriptor
+    private Hashtable<Long, ConglomerateDescriptor> ddCache;
+
+    // tableID UUID -> table descriptor
+    private Hashtable<UUID, TableDescriptor> tdCache;
+
+    private Hashtable<Long,TableDescriptor> tableCache;     // conglomId -> table descriptor
 	private Hashtable<Long,String> indexCache;		// conglomId -> indexname
 
 	public TableNameInfo(LanguageConnectionContext lcc, boolean andIndex)
@@ -68,15 +75,14 @@ public class TableNameInfo {
 		{
 			// first time we see this conglomerate, get it from the
 			// ddCache 
-			ConglomerateDescriptor cd =
-				(ConglomerateDescriptor)ddCache.get(conglomId);
+            ConglomerateDescriptor cd = ddCache.get(conglomId);
 
             if (cd != null)
             {
                 // conglomerateDescriptor is not null, this table is known
                 // to the data dictionary
 
-                td = (TableDescriptor) tdCache.get(cd.getTableID());
+                td = tdCache.get(cd.getTableID());
             }
 
 			if ((cd == null) || (td == null))

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/GenericActivationHolder.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/GenericActivationHolder.java?rev=1502965&r1=1502964&r2=1502965&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/GenericActivationHolder.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/GenericActivationHolder.java Sun Jul 14 12:41:09 2013
@@ -21,58 +21,39 @@
 
 package org.apache.derby.impl.sql;
 
-import	org.apache.derby.catalog.Dependable;
-import	org.apache.derby.catalog.DependableFinder;
+import java.sql.SQLWarning;
+import java.util.Enumeration;
+import java.util.Vector;
+import org.apache.derby.catalog.Dependable;
+import org.apache.derby.catalog.DependableFinder;
 import org.apache.derby.catalog.UUID;
-
+import org.apache.derby.iapi.error.StandardException;
+import org.apache.derby.iapi.reference.SQLState;
+import org.apache.derby.iapi.services.loader.GeneratedClass;
+import org.apache.derby.iapi.services.sanity.SanityManager;
+import org.apache.derby.iapi.sql.Activation;
+import org.apache.derby.iapi.sql.ParameterValueSet;
+import org.apache.derby.iapi.sql.ResultDescription;
+import org.apache.derby.iapi.sql.ResultSet;
+import org.apache.derby.iapi.sql.Row;
 import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
 import org.apache.derby.iapi.sql.conn.SQLSessionContext;
-
-import org.apache.derby.iapi.types.DataValueFactory;
-
+import org.apache.derby.iapi.sql.depend.Provider;
+import org.apache.derby.iapi.sql.dictionary.TableDescriptor;
+import org.apache.derby.iapi.sql.execute.ConstantAction;
+import org.apache.derby.iapi.sql.execute.CursorResultSet;
 import org.apache.derby.iapi.sql.execute.ExecPreparedStatement;
 import org.apache.derby.iapi.sql.execute.ExecRow;
 import org.apache.derby.iapi.sql.execute.ExecutionFactory;
 import org.apache.derby.iapi.sql.execute.NoPutResultSet;
-import org.apache.derby.iapi.sql.execute.ConstantAction;
-
-import org.apache.derby.impl.sql.execute.BaseActivation;
-
-import org.apache.derby.iapi.sql.depend.DependencyManager;
-import org.apache.derby.iapi.sql.depend.Provider;
-
-import org.apache.derby.iapi.types.DataTypeDescriptor;
-import org.apache.derby.iapi.sql.ParameterValueSet;
-import org.apache.derby.iapi.sql.ResultSet;
-import org.apache.derby.iapi.sql.ResultDescription;
-import org.apache.derby.iapi.sql.Row;
-import org.apache.derby.iapi.sql.Activation;
-import org.apache.derby.iapi.sql.execute.CursorResultSet;
 import org.apache.derby.iapi.sql.execute.TemporaryRowHolder;
-
-import org.apache.derby.iapi.sql.dictionary.IndexRowGenerator;
-import org.apache.derby.iapi.sql.dictionary.TableDescriptor;
-
-import org.apache.derby.iapi.reference.SQLState;
-
-import org.apache.derby.iapi.error.StandardException;
-
-import org.apache.derby.iapi.services.loader.GeneratedClass;
-import org.apache.derby.iapi.services.context.Context;
-
 import org.apache.derby.iapi.store.access.ConglomerateController;
 import org.apache.derby.iapi.store.access.ScanController;
-
-import org.apache.derby.iapi.types.RowLocation;
-
-import org.apache.derby.iapi.services.sanity.SanityManager;
-
 import org.apache.derby.iapi.store.access.TransactionController;
-
-import java.sql.SQLWarning;
-import java.util.Enumeration;
-import java.util.Vector;
-import java.util.Hashtable;
+import org.apache.derby.iapi.types.DataTypeDescriptor;
+import org.apache.derby.iapi.types.DataValueFactory;
+import org.apache.derby.iapi.types.RowLocation;
+import org.apache.derby.impl.sql.execute.BaseActivation;
 
 /**
  * This class holds an Activation, and passes through most of the calls
@@ -801,7 +782,8 @@ final public class GenericActivationHold
 	}
 
 
-	public Vector getParentResultSet(String resultSetId)
+    @SuppressWarnings("UseOfObsoleteCollectionType")
+    public Vector<TemporaryRowHolder> getParentResultSet(String resultSetId)
 	{
 		return ac.getParentResultSet(resultSetId);
 	}
@@ -811,7 +793,7 @@ final public class GenericActivationHold
 		ac.clearParentResultSets();
 	}
 
-	public Enumeration getParentResultSetKeys()
+    public Enumeration<String> getParentResultSetKeys()
 	{
 		return ac.getParentResultSetKeys();
 	}

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/GenericPreparedStatement.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/GenericPreparedStatement.java?rev=1502965&r1=1502964&r2=1502965&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/GenericPreparedStatement.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/GenericPreparedStatement.java Sun Jul 14 12:41:09 2013
@@ -21,64 +21,49 @@
 
 package org.apache.derby.impl.sql;
 
-import	org.apache.derby.catalog.Dependable;
-import	org.apache.derby.catalog.DependableFinder;
-
-import org.apache.derby.iapi.services.context.ContextService;
+import java.sql.SQLWarning;
+import java.sql.Timestamp;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import org.apache.derby.catalog.Dependable;
+import org.apache.derby.catalog.DependableFinder;
+import org.apache.derby.catalog.UUID;
+import org.apache.derby.iapi.error.StandardException;
+import org.apache.derby.iapi.reference.SQLState;
+import org.apache.derby.iapi.services.cache.Cacheable;
 import org.apache.derby.iapi.services.context.ContextManager;
-
+import org.apache.derby.iapi.services.context.ContextService;
+import org.apache.derby.iapi.services.io.ArrayUtil;
+import org.apache.derby.iapi.services.loader.GeneratedClass;
 import org.apache.derby.iapi.services.monitor.Monitor;
-
 import org.apache.derby.iapi.services.sanity.SanityManager;
-
-import org.apache.derby.iapi.services.io.ArrayUtil;
 import org.apache.derby.iapi.services.stream.HeaderPrintWriter;
-import org.apache.derby.iapi.services.cache.Cacheable;
-
-import org.apache.derby.catalog.UUID;
-import org.apache.derby.iapi.services.io.ArrayUtil;
 import org.apache.derby.iapi.services.uuid.UUIDFactory;
-import org.apache.derby.iapi.util.ByteArray;
-import org.apache.derby.iapi.util.ReuseFactory;
-
-import org.apache.derby.iapi.sql.dictionary.DataDictionary;
-import org.apache.derby.iapi.sql.dictionary.SchemaDescriptor;
-import org.apache.derby.iapi.sql.dictionary.SPSDescriptor;
-
+import org.apache.derby.iapi.sql.Activation;
 import org.apache.derby.iapi.sql.ParameterValueSet;
 import org.apache.derby.iapi.sql.PreparedStatement;
-import org.apache.derby.iapi.sql.Statement;
-import org.apache.derby.iapi.types.DataTypeDescriptor;
-import org.apache.derby.iapi.types.DataTypeUtilities;
 import org.apache.derby.iapi.sql.ResultDescription;
 import org.apache.derby.iapi.sql.ResultSet;
-import org.apache.derby.iapi.sql.Activation;
-
+import org.apache.derby.iapi.sql.Statement;
+import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
+import org.apache.derby.iapi.sql.conn.StatementContext;
+import org.apache.derby.iapi.sql.depend.DependencyManager;
+import org.apache.derby.iapi.sql.depend.Provider;
+import org.apache.derby.iapi.sql.dictionary.DataDictionary;
+import org.apache.derby.iapi.sql.dictionary.SPSDescriptor;
+import org.apache.derby.iapi.sql.dictionary.SchemaDescriptor;
+import org.apache.derby.iapi.sql.dictionary.StatementPermission;
 import org.apache.derby.iapi.sql.execute.ConstantAction;
 import org.apache.derby.iapi.sql.execute.ExecCursorTableReference;
 import org.apache.derby.iapi.sql.execute.ExecPreparedStatement;
-
-import org.apache.derby.iapi.sql.depend.DependencyManager;
-import org.apache.derby.iapi.sql.depend.Provider;
-
-import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
-import org.apache.derby.iapi.sql.conn.StatementContext;
-
+import org.apache.derby.iapi.types.DataTypeDescriptor;
+import org.apache.derby.iapi.types.DataTypeUtilities;
+import org.apache.derby.iapi.util.ByteArray;
+import org.apache.derby.iapi.util.ReuseFactory;
 import org.apache.derby.impl.sql.compile.CursorNode;
 import org.apache.derby.impl.sql.compile.StatementNode;
 
-import org.apache.derby.iapi.error.StandardException;
-
-import org.apache.derby.iapi.reference.SQLState;
-
-import org.apache.derby.iapi.services.loader.GeneratedClass;
-
-import java.sql.Timestamp;
-import java.sql.SQLWarning;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
 /**
  * Basic implementation of prepared statement.
  * relies on implementation of ResultDescription and Statement that
@@ -133,7 +118,7 @@ public class GenericPreparedStatement
 
 	protected ConstantAction	executionConstants;
 	protected Object[]	savedObjects;
-	protected List requiredPermissionsList;
+    protected List<StatementPermission> requiredPermissionsList;
 
 	// fields for dependency tracking
 	protected String UUIDString;
@@ -445,7 +430,7 @@ recompileOutOfDatePlan:
 				lccToUse.validateStmtExecution(executionConstants);
 			}
 
-			ResultSet resultSet = null;
+            ResultSet resultSet;
 			try {
 	
 				resultSet = activation.execute();
@@ -1244,6 +1229,7 @@ recompileOutOfDatePlan:
 		}
 	}
 
+    @Override
 	public String toString() {
 		return getObjectName();
 	}
@@ -1252,12 +1238,13 @@ recompileOutOfDatePlan:
 		return false;
 	}
 
-	public void setRequiredPermissionsList( List requiredPermissionsList)
+    public void setRequiredPermissionsList(
+            List<StatementPermission> requiredPermissionsList)
 	{
 		this.requiredPermissionsList = requiredPermissionsList;
 	}
 
-	public List getRequiredPermissionsList()
+    public List<StatementPermission> getRequiredPermissionsList()
 	{
 		return requiredPermissionsList;
 	}

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/GenericStatement.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/GenericStatement.java?rev=1502965&r1=1502964&r2=1502965&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/GenericStatement.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/GenericStatement.java Sun Jul 14 12:41:09 2013
@@ -41,7 +41,6 @@ import org.apache.derby.iapi.sql.conn.St
 import org.apache.derby.iapi.sql.dictionary.DataDictionary;
 import org.apache.derby.iapi.sql.dictionary.SchemaDescriptor;
 import org.apache.derby.iapi.sql.dictionary.TableDescriptor;
-import org.apache.derby.iapi.sql.execute.ExecutionContext;
 import org.apache.derby.impl.sql.compile.StatementNode;
 import org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext;
 import org.apache.derby.iapi.transaction.TransactionControl;
@@ -203,7 +202,7 @@ public class GenericStatement
 			beginTimestamp = new Timestamp(beginTime);
 		}
 
-		/** set the prepare Isolaton from the LanguageConnectionContext now as 
+        /** set the prepare isolation from the LanguageConnectionContext now as
 		 * we need to consider it in caching decisions
 		 */
 		prepareIsolationLevel = lcc.getPrepareIsolationLevel();
@@ -722,7 +721,7 @@ public class GenericStatement
 	/*
 	** Identity
 	*/
-
+    @Override
 	public boolean equals(Object other) {
 
 		if (other instanceof GenericStatement) {
@@ -737,6 +736,7 @@ public class GenericStatement
 		return false;
 	}
 
+    @Override
 	public int hashCode() {
 
 		return statementText.hashCode();

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java?rev=1502965&r1=1502964&r2=1502965&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java Sun Jul 14 12:41:09 2013
@@ -99,7 +99,7 @@ import org.apache.derby.iapi.sql.diction
 import org.apache.derby.iapi.sql.dictionary.DependencyDescriptor;
 import org.apache.derby.iapi.sql.dictionary.FileInfoDescriptor;
 import org.apache.derby.iapi.sql.dictionary.ForeignKeyConstraintDescriptor;
-import org.apache.derby.iapi.sql.dictionary.GenericDescriptorList;
+import org.apache.derby.iapi.sql.dictionary.TriggerDescriptorList;
 import org.apache.derby.iapi.sql.dictionary.IndexRowGenerator;
 import org.apache.derby.iapi.sql.dictionary.KeyConstraintDescriptor;
 import org.apache.derby.iapi.sql.dictionary.PasswordHasher;
@@ -163,6 +163,7 @@ import org.apache.derby.impl.sql.execute
  * Standard database implementation of the data dictionary
  * that stores the information in the system catalogs.
  */
+@SuppressWarnings("UseOfObsoleteCollectionType")
 public final class	DataDictionaryImpl
 	implements DataDictionary, CacheableFactory, ModuleControl, ModuleSupportable,java.security.PrivilegedAction<Properties>
 {
@@ -1444,7 +1445,7 @@ public final class	DataDictionaryImpl
     }
 
     // returns null if database is at rev level 10.5 or earlier
-    public  PasswordHasher  makePasswordHasher( Dictionary props )
+    public  PasswordHasher  makePasswordHasher( Dictionary<?,?> props )
         throws StandardException
     {
         // Support for configurable hash algorithm was added in Derby 10.6, so
@@ -1470,7 +1471,7 @@ public final class	DataDictionaryImpl
             byte[] salt = null;
             int iterations = 1;
             
-            if (algorithm != null && algorithm.length() > 0) {
+            if (algorithm.length() > 0) {
 
                 if (supportKeyStretching) {
                     salt = generateRandomSalt(props);
@@ -1877,8 +1878,6 @@ public final class	DataDictionaryImpl
 		int isolationLevel,
 		TransactionController tc) throws StandardException
 	{
-		SchemaDescriptor		sd = null;
-		
 		if ( tc == null )
 		{
 		    tc = getTransactionCompile();
@@ -1912,7 +1911,7 @@ public final class	DataDictionaryImpl
 
 			if (lcc != null)
 			{
-				sd = lcc.getDefaultSchema();
+                SchemaDescriptor sd = lcc.getDefaultSchema();
 
 				if ((sd != null) &&
 						((schemaId == null) ||
@@ -2085,10 +2084,8 @@ public final class	DataDictionaryImpl
 		granteeOrderable = new SQLVarchar(grantee);
 		grantorOrderable = new SQLVarchar(grantor);
 
-		ExecIndexRow keyRow = null;
-
 		/* Set up the start/stop position for the scan */
-		keyRow = exFactory.getIndexableRow(3);
+        ExecIndexRow keyRow = exFactory.getIndexableRow(3);
 		keyRow.setColumn(1, roleNameOrderable);
 		keyRow.setColumn(2, granteeOrderable);
 		keyRow.setColumn(3, grantorOrderable);
@@ -2489,7 +2486,6 @@ public final class	DataDictionaryImpl
 		ScanController			scanController = null;
 		boolean					foundRow;
 		FormatableBitSet					colToCheck = new FormatableBitSet(indexCol);
-		CatalogRowFactory		rf = ti.getCatalogRowFactory();	
 
 		if (SanityManager.DEBUG)
 		{
@@ -2595,7 +2591,6 @@ public final class	DataDictionaryImpl
 									  char lockGranularity, TransactionController tc)
 		throws StandardException
 	{
-		ExecIndexRow			keyRow1 = null;
 		ExecRow    				row;
 		DataValueDescriptor		schemaIDOrderable;
 		DataValueDescriptor		tableNameOrderable;
@@ -2609,7 +2604,7 @@ public final class	DataDictionaryImpl
 		schemaIDOrderable = getIDValueAsCHAR(schema.getUUID());
 
 		/* Set up the start/stop position for the scan */
-		keyRow1 = (ExecIndexRow) exFactory.getIndexableRow(2);
+        ExecIndexRow keyRow1 = exFactory.getIndexableRow(2);
 		keyRow1.setColumn(1, tableNameOrderable);
 		keyRow1.setColumn(2, schemaIDOrderable);
 
@@ -2638,7 +2633,8 @@ public final class	DataDictionaryImpl
     {
 		TabInfoImpl          ti = getNonCoreTI(SYSALIASES_CATALOG_NUM);
 		ExecIndexRow         keyRow = exFactory.getIndexableRow(3);
-		DataValueDescriptor  aliasNameOrderable = new SQLVarchar( "CLOBGETSUBSTRING" );;
+        DataValueDescriptor
+                aliasNameOrderable = new SQLVarchar( "CLOBGETSUBSTRING" );
 		DataValueDescriptor	 nameSpaceOrderable = new SQLChar
             ( new String( new char[] { AliasInfo.ALIAS_TYPE_FUNCTION_AS_CHAR } ) );
         
@@ -4577,9 +4573,8 @@ public final class	DataDictionaryImpl
 	{
 		startWriting(lcc);
 
-		for (java.util.Iterator li = getAllSPSDescriptors().iterator(); li.hasNext(); )
+        for (SPSDescriptor spsd : getAllSPSDescriptors())
 		{ 
-			SPSDescriptor spsd = (SPSDescriptor) li.next();
 			spsd.makeInvalid(DependencyManager.USER_RECOMPILE_REQUEST, lcc);
 		} 
 	}
@@ -4763,12 +4758,12 @@ public final class	DataDictionaryImpl
 	 *
 	 * @exception StandardException		Thrown on failure
 	 */
-	private GenericDescriptorList getAllTriggerDescriptors()
+    private TriggerDescriptorList getAllTriggerDescriptors()
 		throws StandardException
 	{
 		TabInfoImpl					ti = getNonCoreTI(SYSTRIGGERS_CATALOG_NUM);
 
-		GenericDescriptorList list = new GenericDescriptorList();
+        TriggerDescriptorList list = new TriggerDescriptorList();
 
 		getDescriptorViaHeap(
                         null,
@@ -4776,7 +4771,7 @@ public final class	DataDictionaryImpl
 						ti,
 						(TupleDescriptor) null,
                         list,
-                        UniqueTupleDescriptor.class);
+                        TriggerDescriptor.class);
 		return list;
 	}
 
@@ -5457,10 +5452,10 @@ public final class	DataDictionaryImpl
 	 *
 	 * @exception StandardException		Thrown on failure
 	 */
-	public GenericDescriptorList getTriggerDescriptors(TableDescriptor td)
+    public TriggerDescriptorList getTriggerDescriptors(TableDescriptor td)
 		throws StandardException
 	{
-		GenericDescriptorList	gdl;
+        TriggerDescriptorList   gdl;
 
 		if (td == null)
 		{
@@ -5487,7 +5482,7 @@ public final class	DataDictionaryImpl
 	}
 
 	/** 
-	 * Populate the GenericDescriptorList for the specified TableDescriptor.
+     * Populate the TriggerDescriptorList for the specified TableDescriptor.
 	 *
 	 * MT synchronization: it is assumed that the caller has synchronized
 	 * on the CDL in the given TD.
@@ -5500,7 +5495,7 @@ public final class	DataDictionaryImpl
 	 private void getTriggerDescriptorsScan(TableDescriptor td, boolean forUpdate)
 			throws StandardException
 	{
-		GenericDescriptorList  	gdl = (td).getTriggerDescriptorList();
+        TriggerDescriptorList   gdl = (td).getTriggerDescriptorList();
 		DataValueDescriptor		tableIDOrderable = null;
 		TabInfoImpl					ti = getNonCoreTI(SYSTRIGGERS_CATALOG_NUM);
 
@@ -5519,7 +5514,7 @@ public final class	DataDictionaryImpl
 					ti,
 					(TupleDescriptor) null,
 					gdl,
-                    UniqueTupleDescriptor.class,
+                    TriggerDescriptor.class,
 					forUpdate);
 		gdl.setScanned(true);
 	}
@@ -6961,6 +6956,7 @@ public final class	DataDictionaryImpl
 	 *
 	 * @exception StandardException		Thrown on failure
 	 */
+    @SuppressWarnings("UseOfObsoleteCollectionType")
 	public Hashtable<UUID,TableDescriptor> hashAllTableDescriptorsByTableId(TransactionController tc)
 		throws StandardException
 	{
@@ -14113,9 +14109,8 @@ public final class	DataDictionaryImpl
 	 */
 	private void dropJDBCMetadataSPSes(TransactionController tc) throws StandardException
 	{
-		for (java.util.Iterator it = getAllSPSDescriptors().iterator(); it.hasNext(); )
-		{
-			SPSDescriptor spsd = (SPSDescriptor) it.next();
+        for (SPSDescriptor spsd : getAllSPSDescriptors())
+        {
 			SchemaDescriptor sd = spsd.getSchemaDescriptor();
 
 			// don't drop statements in non-system schemas

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DMLModStatementNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DMLModStatementNode.java?rev=1502965&r1=1502964&r2=1502965&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DMLModStatementNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DMLModStatementNode.java Sun Jul 14 12:41:09 2013
@@ -51,7 +51,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.ForeignKeyConstraintDescriptor;
-import org.apache.derby.iapi.sql.dictionary.GenericDescriptorList;
+import org.apache.derby.iapi.sql.dictionary.TriggerDescriptorList;
 import org.apache.derby.iapi.sql.dictionary.IndexRowGenerator;
 import org.apache.derby.iapi.sql.dictionary.ReferencedKeyConstraintDescriptor;
 import org.apache.derby.iapi.sql.dictionary.SchemaDescriptor;
@@ -87,7 +87,7 @@ abstract class DMLModStatementNode exten
 	public	long[]						indexConglomerateNumbers;
 	public	String[]					indexNames;
 	protected ConstraintDescriptorList relevantCdl;
-	protected GenericDescriptorList relevantTriggers;
+    protected TriggerDescriptorList relevantTriggers;
 
 	// PRIVATE
 	private boolean			requiresDeferredProcessing;
@@ -1048,7 +1048,7 @@ abstract class DMLModStatementNode exten
 	 *
 	 * @param triggerList				The trigger descriptor list
 	 */
-    private void generateTriggerInfo(GenericDescriptorList triggerList)
+    private void generateTriggerInfo(TriggerDescriptorList triggerList)
 	{	
         if ((triggerList != null) && (!triggerList.isEmpty()))
 		{
@@ -1117,15 +1117,14 @@ abstract class DMLModStatementNode exten
 	 */
 	private void createTriggerDependencies
 	(
-		GenericDescriptorList 		tdl,
+        TriggerDescriptorList       tdl,
 		Dependent					dependent
 	)
 		throws StandardException
 	{
 		CompilerContext 			compilerContext = getCompilerContext();
 
-        for (Iterator<?> descIter = tdl.iterator(); descIter.hasNext() ; ) {
-            TriggerDescriptor td = (TriggerDescriptor)descIter.next();
+        for (TriggerDescriptor td : tdl) {
             /*
             ** The dependent now depends on this trigger.
             ** The default dependent is the statement being compiled.
@@ -1152,7 +1151,7 @@ abstract class DMLModStatementNode exten
 	 *
 	 * @exception StandardException		Thrown on failure
 	 */
-	protected GenericDescriptorList getAllRelevantTriggers
+    protected TriggerDescriptorList getAllRelevantTriggers
 	(
 		DataDictionary		dd,
 		TableDescriptor		td,
@@ -1163,7 +1162,7 @@ abstract class DMLModStatementNode exten
 	{
 		if ( relevantTriggers !=  null ) { return relevantTriggers; }
 
-		relevantTriggers =  new GenericDescriptorList();
+        relevantTriggers =  new TriggerDescriptorList();
 
 		if(!includeTriggers)
 			return relevantTriggers;

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DeleteNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DeleteNode.java?rev=1502965&r1=1502964&r2=1502965&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DeleteNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DeleteNode.java Sun Jul 14 12:41:09 2013
@@ -46,7 +46,7 @@ import org.apache.derby.iapi.sql.diction
 import org.apache.derby.iapi.sql.dictionary.ColumnDescriptorList;
 import org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor;
 import org.apache.derby.iapi.sql.dictionary.DataDictionary;
-import org.apache.derby.iapi.sql.dictionary.GenericDescriptorList;
+import org.apache.derby.iapi.sql.dictionary.TriggerDescriptorList;
 import org.apache.derby.iapi.sql.dictionary.TableDescriptor;
 import org.apache.derby.iapi.sql.dictionary.TriggerDescriptor;
 import org.apache.derby.iapi.sql.execute.ConstantAction;
@@ -680,7 +680,7 @@ class DeleteNode extends DMLModStatement
 		needsDeferredProcessing[0] = requiresDeferredProcessing();
 
         ArrayList<ConglomerateDescriptor> conglomerates = new ArrayList<ConglomerateDescriptor>();
-		relevantTriggers = new GenericDescriptorList();
+        relevantTriggers = new TriggerDescriptorList();
 
         FormatableBitSet columnMap = DeleteNode.getDeleteReadMap(baseTable,
                 conglomerates, relevantTriggers, needsDeferredProcessing);
@@ -886,7 +886,7 @@ class DeleteNode extends DMLModStatement
 	(
 		TableDescriptor				baseTable,
         List<ConglomerateDescriptor>  conglomerates,
-		GenericDescriptorList		relevantTriggers,
+        TriggerDescriptorList       relevantTriggers,
 		boolean[]					needsDeferredProcessing
 	)
 		throws StandardException
@@ -929,9 +929,8 @@ class DeleteNode extends DMLModStatement
 			needsDeferredProcessing[0] = true;
 			
 			boolean needToIncludeAllColumns = false;
-            for (Iterator<?> descIter = relevantTriggers.iterator();
-                    descIter.hasNext(); ) {
-                TriggerDescriptor trd = (TriggerDescriptor)descIter.next();
+
+            for (TriggerDescriptor trd : relevantTriggers) {
 				//Does this trigger have REFERENCING clause defined on it.
 				//If yes, then read all the columns from the trigger table.
 				if (!trd.getReferencingNew() && !trd.getReferencingOld())

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromSubquery.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromSubquery.java?rev=1502965&r1=1502964&r2=1502965&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromSubquery.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromSubquery.java Sun Jul 14 12:41:09 2013
@@ -658,7 +658,7 @@ class FromSubquery extends FromTable
             valueNode = new ColumnReference(columnName,
 											tableName,
 											getContextManager());
-           resultColumn = new ResultColumn(columnName,
+            resultColumn = new ResultColumn(columnName,
 											valueNode,
 											getContextManager());
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UpdateNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UpdateNode.java?rev=1502965&r1=1502964&r2=1502965&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UpdateNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UpdateNode.java Sun Jul 14 12:41:09 2013
@@ -48,7 +48,7 @@ import org.apache.derby.iapi.sql.diction
 import org.apache.derby.iapi.sql.dictionary.ConstraintDescriptor;
 import org.apache.derby.iapi.sql.dictionary.ConstraintDescriptorList;
 import org.apache.derby.iapi.sql.dictionary.DataDictionary;
-import org.apache.derby.iapi.sql.dictionary.GenericDescriptorList;
+import org.apache.derby.iapi.sql.dictionary.TriggerDescriptorList;
 import org.apache.derby.iapi.sql.dictionary.TableDescriptor;
 import org.apache.derby.iapi.sql.dictionary.TriggerDescriptor;
 import org.apache.derby.iapi.sql.execute.ConstantAction;
@@ -869,7 +869,7 @@ public final class UpdateNode extends DM
 
         ArrayList<ConglomerateDescriptor> conglomerates = new ArrayList<ConglomerateDescriptor>();
 		relevantCdl = new ConstraintDescriptorList();
-		relevantTriggers =  new GenericDescriptorList();
+        relevantTriggers =  new TriggerDescriptorList();
 
 		FormatableBitSet	columnMap = getUpdateReadMap
             (
@@ -970,7 +970,7 @@ public final class UpdateNode extends DM
 		ResultColumnList			updateColumnList,
         List<ConglomerateDescriptor>     conglomerates,
 		ConstraintDescriptorList	relevantConstraints,
-		GenericDescriptorList		relevantTriggers,
+        TriggerDescriptorList       relevantTriggers,
 		boolean[]					needsDeferredProcessing,
         ColumnDescriptorList    affectedGeneratedColumns
 	)
@@ -1071,9 +1071,7 @@ public final class UpdateNode extends DM
 			// after the soft-upgrade.
 			boolean in10_9_orHigherVersion = dd.checkVersion(DataDictionary.DD_VERSION_DERBY_10_9,null);
 
-            for (Iterator<?> descIter = relevantTriggers.iterator();
-                    descIter.hasNext(); ) {
-                TriggerDescriptor trd = (TriggerDescriptor) descIter.next();
+            for (TriggerDescriptor trd : relevantTriggers) {
 				if (in10_9_orHigherVersion) {
 					// See if we can avoid reading all the columns from the
 					// trigger table.

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/conn/GenericAuthorizer.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/conn/GenericAuthorizer.java?rev=1502965&r1=1502964&r2=1502965&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/conn/GenericAuthorizer.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/conn/GenericAuthorizer.java Sun Jul 14 12:41:09 2013
@@ -21,28 +21,23 @@
 
 package org.apache.derby.impl.sql.conn;
 
-import org.apache.derby.iapi.sql.Activation;
+import java.util.List;
+import org.apache.derby.catalog.types.RoutineAliasInfo;
+import org.apache.derby.iapi.error.StandardException;
 import org.apache.derby.iapi.reference.Property;
-import org.apache.derby.iapi.util.IdUtil;
-import org.apache.derby.iapi.util.StringUtil;
+import org.apache.derby.iapi.reference.SQLState;
+import org.apache.derby.iapi.services.property.PersistentSet;
+import org.apache.derby.iapi.services.property.PropertyUtil;
 import org.apache.derby.iapi.services.sanity.SanityManager;
-import org.apache.derby.iapi.error.StandardException;
+import org.apache.derby.iapi.sql.Activation;
 import org.apache.derby.iapi.sql.conn.Authorizer;
-import org.apache.derby.iapi.reference.SQLState;
 import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
-import org.apache.derby.iapi.services.property.PropertyUtil;
-import org.apache.derby.iapi.services.property.PersistentSet;
-import org.apache.derby.catalog.types.RoutineAliasInfo;
 import org.apache.derby.iapi.sql.dictionary.DataDictionary;
 import org.apache.derby.iapi.sql.dictionary.StatementPermission;
-import org.apache.derby.iapi.store.access.TransactionController;
-
-import java.util.Properties;
-import java.util.List;
-import java.util.Iterator;
+import org.apache.derby.iapi.util.IdUtil;
+import org.apache.derby.iapi.util.StringUtil;
 
-class GenericAuthorizer
-implements Authorizer
+class GenericAuthorizer implements Authorizer
 {
 	//
 	//Enumerations for user access levels.
@@ -137,7 +132,8 @@ implements Authorizer
 		}
         if( activation != null)
         {
-            List requiredPermissionsList = activation.getPreparedStatement().getRequiredPermissionsList();
+            List<StatementPermission> requiredPermissionsList =
+                activation.getPreparedStatement().getRequiredPermissionsList();
             DataDictionary dd = lcc.getDataDictionary();
 
             // Database Owner can access any object. Ignore 
@@ -177,11 +173,9 @@ implements Authorizer
                     try 
                     {
                     	// perform the permission checking
-                        for (Iterator iter = requiredPermissionsList.iterator(); 
-                            iter.hasNext();) 
+                        for (StatementPermission rp : requiredPermissionsList)
                         {
-                            ((StatementPermission) iter.next()).check
-                                (lcc, false, activation);
+                            rp.check(lcc, false, activation);
                         }
                     } 
                     finally 
@@ -244,8 +238,7 @@ implements Authorizer
 	{
 		PersistentSet tc = lcc.getTransactionExecute();
 
-		String modeS = (String)
-			PropertyUtil.getServiceProperty(
+        String modeS = PropertyUtil.getServiceProperty(
 									tc,
 									Property.DEFAULT_CONNECTION_MODE_PROPERTY);
 		if (modeS == null)
@@ -270,8 +263,7 @@ implements Authorizer
 	private boolean userOnAccessList(String listName) throws StandardException
 	{
 		PersistentSet tc = lcc.getTransactionExecute();
-		String listS = (String)
-			PropertyUtil.getServiceProperty(tc, listName);
+        String listS = PropertyUtil.getServiceProperty(tc, listName);
         return IdUtil.idOnList(lcc.getSessionUserId(),listS);
 	}
 
@@ -301,7 +293,7 @@ implements Authorizer
 	  @see Authorizer#refresh
 	  @exception StandardException Thrown if the operation is not allowed
 	  */
-	public void refresh() throws StandardException
+    public final void refresh() throws StandardException
 	{
 		getUserAccessLevel();
 		if (!readOnlyConnection)



Mime
View raw message