db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
Subject svn commit: r1485822 - in /db/derby/code/trunk: ./ java/engine/org/apache/derby/catalog/ java/engine/org/apache/derby/impl/jdbc/ java/engine/org/apache/derby/impl/sql/ java/engine/org/apache/derby/jdbc/ java/shared/ java/shared/org/apache/derby/shared/...
Date Thu, 23 May 2013 18:47:47 GMT
Author: rhillegas
Date: Thu May 23 18:47:45 2013
New Revision: 1485822

URL: http://svn.apache.org/r1485822
Log:
DERBY-6213: Generify remaining classes needed to remove lint warnings in Derby build.

Modified:
    db/derby/code/trunk/build.xml
    db/derby/code/trunk/java/engine/org/apache/derby/catalog/SystemProcedures.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/build.xml
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/build.xml
    db/derby/code/trunk/java/engine/org/apache/derby/jdbc/build.xml
    db/derby/code/trunk/java/shared/build.xml
    db/derby/code/trunk/java/shared/org/apache/derby/shared/common/sanity/AssertFailure.java
    db/derby/code/trunk/java/shared/org/apache/derby/shared/common/sanity/SanityManager.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/encryptDatabaseTest2.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/xaOffline1.out
    db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/build.xml
    db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/AttributeHolder.java
    db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ConnectionEnv.java
    db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/Main.java
    db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/Session.java
    db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/URLCheck.java
    db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ij.jj
    db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ijMultipleResultSetResult.java
    db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ijResult.java
    db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ijResultImpl.java
    db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ijVectorResult.java
    db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/mtGrammar.jj
    db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/util.java
    db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/utilMain.java
    db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/xaHelper.java
    db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/planexporter/CreateXMLFile.java
    db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/sysinfo/Main.java
    db/derby/code/trunk/java/tools/org/apache/derby/tools/JDBCDisplayUtil.java
    db/derby/code/trunk/java/tools/org/apache/derby/tools/dblook.java

Modified: db/derby/code/trunk/build.xml
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/build.xml?rev=1485822&r1=1485821&r2=1485822&view=diff
==============================================================================
--- db/derby/code/trunk/build.xml (original)
+++ db/derby/code/trunk/build.xml Thu May 23 18:47:45 2013
@@ -787,6 +787,26 @@
     <!-- IBM JDK 1.3.1. See DERBY-1078                                 -->
     <replaceregexp file="${generated.src.dir}/${directory}/${chkfile}" match="tokenImage" 
                    replace="${constantsfile}.tokenImage"/>
+
+    <antcall  target="postProcessParser"/>
+
+  </target>
+
+  <target name="postProcessParser" unless="parser.done">
+
+    <!-- Suppress some warnings so the grammar will compile cleanly on Java 6. -->
+    <replaceregexp match="private void jj_add_error_token" replace="@SuppressWarnings(&quot;unchecked&quot;) private void jj_add_error_token" flags="m">
+      <fileset dir="${generated.src.dir}/${directory}">
+        <include name="${chkfile}"/>
+      </fileset>
+    </replaceregexp>
+
+    <replaceregexp match="public ParseException generateParseException" replace="@SuppressWarnings(&quot;unchecked&quot;) public ParseException generateParseException" flags="m">
+      <fileset dir="${generated.src.dir}/${directory}">
+        <include name="${chkfile}"/>
+      </fileset>
+    </replaceregexp>
+
   </target>
 
   <target name="chkparser">

Modified: db/derby/code/trunk/java/engine/org/apache/derby/catalog/SystemProcedures.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/catalog/SystemProcedures.java?rev=1485822&r1=1485821&r2=1485822&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/catalog/SystemProcedures.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/catalog/SystemProcedures.java Thu May 23 18:47:45 2013
@@ -1782,7 +1782,7 @@ public class SystemProcedures  {
         
         try {
             AccessController.doPrivileged(
-                    new PrivilegedAction() {
+                    new PrivilegedAction<Object>() {
                         public Object run() {
                             Policy.getPolicy().refresh();
                             return null;

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java?rev=1485822&r1=1485821&r2=1485822&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java Thu May 23 18:47:45 2013
@@ -87,7 +87,7 @@ import org.apache.derby.iapi.util.Interr
  * @see <a href="http://java.sun.com/products/jdbc/download.html#corespec30">JDBC 3.0 Specification</a>
  */
 public abstract class EmbedDatabaseMetaData extends ConnectionChild 
-	implements DatabaseMetaData, java.security.PrivilegedAction {
+	implements DatabaseMetaData, java.security.PrivilegedAction<Object> {
 
     private static final int ILLEGAL_UDT_TYPE = 0;
     

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/build.xml
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/build.xml?rev=1485822&r1=1485821&r2=1485822&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/build.xml (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/build.xml Thu May 23 18:47:45 2013
@@ -55,7 +55,7 @@
       </classpath>
       <include name="${derby.dir}/impl/jdbc/**"/>
 	  <exclude name="${derby.dir}/impl/jdbc/*42.java"/>
-      <!-- <compilerarg value="-Xlint:unchecked"/> -->
+      <compilerarg value="-Xlint:unchecked"/>
    </javac>
     <copy file="metadata.properties" tofile="${out.dir}/org/apache/derby/impl/jdbc/metadata.properties"/>
   </target>
@@ -79,6 +79,7 @@
             <pathelement path="${java18compile.classpath}"/>
         </classpath>
         <include name="${derby.dir}/impl/jdbc/*42.java"/>
+      <compilerarg value="-Xlint:unchecked"/>
     </javac>
 </target>
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/build.xml
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/build.xml?rev=1485822&r1=1485821&r2=1485822&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/build.xml (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/build.xml Thu May 23 18:47:45 2013
@@ -35,7 +35,7 @@
   <property name="cur.dir" value="impl/sql"/>
 
 <!-- Targets -->
-  <target name="parser" depends="chkparser" >
+  <target name="parser" >
     <ant antfile="${src.dir}/build.xml" target="genParser">
       <property name="msg" value="Generating SQL parser..."/>
       <property name="srcroot" value="engine"/>
@@ -84,36 +84,6 @@
       </fileset>
     </replaceregexp>
 
-    <antcall target="postProcessParser"/>
-
-  </target>
-
-  <target name="postProcessParser" unless="parser.compiled">
-
-    <!-- Generify some types so they will compile cleanly on Java 6. -->
-    <replaceregexp match="java.util.Vector" replace="java.util.Vector&lt;Object&gt;" flags="m">
-      <fileset dir="${generated.src.dir}/${derby.dir}/impl/sql/compile">
-        <include name="SQLParser.java"/>
-      </fileset>
-    </replaceregexp>
-    <replaceregexp match="java.util.Vector\(\)" replace="java.util.Vector&lt;Object&gt;()" flags="m">
-      <fileset dir="${generated.src.dir}/${derby.dir}/impl/sql/compile">
-        <include name="SQLParser.java"/>
-      </fileset>
-    </replaceregexp>
-    <replaceregexp match="java.util.Enumeration" replace="java.util.Enumeration&lt;Object&gt;" flags="m">
-      <fileset dir="${generated.src.dir}/${derby.dir}/impl/sql/compile">
-        <include name="SQLParser.java"/>
-      </fileset>
-    </replaceregexp>
-
-  </target>
-
-  <target name="chkparser">
-    <uptodate property="parser.compiled"
-              targetfile="${generated.src.dir}/${derby.dir}/impl/sql/compile/SQLParser.java" >
-      <srcfiles dir="compile"  includes="sqlgrammar.jj" />
-    </uptodate>
   </target>
 
   <target name="compile" depends="parser">

Modified: db/derby/code/trunk/java/engine/org/apache/derby/jdbc/build.xml
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/jdbc/build.xml?rev=1485822&r1=1485821&r2=1485822&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/jdbc/build.xml (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/jdbc/build.xml Thu May 23 18:47:45 2013
@@ -54,6 +54,7 @@
         </classpath>
         <include name="${derby.dir}/jdbc/*.java"/>
         <exclude name="${derby.dir}/jdbc/*42.java"/>
+        <compilerarg value="-Xlint:unchecked"/>
     </javac>
   </target>
 
@@ -75,6 +76,7 @@
             <pathelement path="${java18compile.classpath}"/>
         </classpath>
         <include name="${derby.dir}/jdbc/*42.java"/>
+        <compilerarg value="-Xlint:unchecked"/>
     </javac>
   </target> 
 

Modified: db/derby/code/trunk/java/shared/build.xml
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/shared/build.xml?rev=1485822&r1=1485821&r2=1485822&view=diff
==============================================================================
--- db/derby/code/trunk/java/shared/build.xml (original)
+++ db/derby/code/trunk/java/shared/build.xml Thu May 23 18:47:45 2013
@@ -68,6 +68,7 @@
       <classpath>
           <pathelement path="${java16compile.classpath}"/>
       </classpath>
+      <compilerarg value="-Xlint:unchecked"/>
     </javac>
 
   	<javac
@@ -89,6 +90,7 @@
       </classpath>
       <include name="org/apache/derby/shared/**"/>
   	  <exclude name="org/apache/derby/shared/common/sanity/ThreadDump.java"/>
+      <compilerarg value="-Xlint:unchecked"/>
     </javac>
   	
   	<javac
@@ -108,6 +110,7 @@
   	        <pathelement path="${java16compile.classpath}"/>
   	      </classpath>
   	    <include name="org/apache/derby/shared/common/sanity/ThreadDump.java"/>
+      <compilerarg value="-Xlint:unchecked"/>
   	    </javac>
 </target>
   

Modified: db/derby/code/trunk/java/shared/org/apache/derby/shared/common/sanity/AssertFailure.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/shared/org/apache/derby/shared/common/sanity/AssertFailure.java?rev=1485822&r1=1485821&r2=1485822&view=diff
==============================================================================
--- db/derby/code/trunk/java/shared/org/apache/derby/shared/common/sanity/AssertFailure.java (original)
+++ db/derby/code/trunk/java/shared/org/apache/derby/shared/common/sanity/AssertFailure.java Thu May 23 18:47:45 2013
@@ -166,7 +166,7 @@ public class AssertFailure extends Runti
         // Load the class and method we need with reflection.
         final Method m;
         try {
-            Class c = Class.forName(
+            Class<?> c = Class.forName(
                     "org.apache.derby.shared.common.sanity.ThreadDump");
             m = c.getMethod("getStackDumpString", new Class[] {});
         } catch (Exception e) {
@@ -179,7 +179,7 @@ public class AssertFailure extends Runti
         //Try to get a thread dump and deal with various situations.
         try {
             String dump = (String) AccessController.doPrivileged
-            (new PrivilegedExceptionAction(){
+            (new PrivilegedExceptionAction<Object>(){
                 public Object run() throws
                         IllegalArgumentException,
                         IllegalAccessException,

Modified: db/derby/code/trunk/java/shared/org/apache/derby/shared/common/sanity/SanityManager.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/shared/org/apache/derby/shared/common/sanity/SanityManager.java?rev=1485822&r1=1485821&r2=1485822&view=diff
==============================================================================
--- db/derby/code/trunk/java/shared/org/apache/derby/shared/common/sanity/SanityManager.java (original)
+++ db/derby/code/trunk/java/shared/org/apache/derby/shared/common/sanity/SanityManager.java Thu May 23 18:47:45 2013
@@ -72,7 +72,7 @@ public class SanityManager {
 	 * DebugFlags holds the values of all debug flags in
 	 * the configuration file.
 	 */
-	static private Hashtable DebugFlags = new Hashtable();
+	static private Hashtable<String,Boolean> DebugFlags = new Hashtable<String,Boolean>();
 	/**
 	 * AllDebugOn and AllDebugOff override individual flags
 	 */
@@ -226,7 +226,7 @@ public class SanityManager {
 			if (AllDebugOn) return true;
 			else if (AllDebugOff) return false;
 			else {
-					Boolean flagValue = (Boolean) DebugFlags.get(flag);
+					Boolean flagValue = DebugFlags.get(flag);
 					if (! DEBUGDEBUG.equals(flag)) {
 						if (DEBUG_ON(DEBUGDEBUG)) {
 							DEBUG_PRINT(DEBUGDEBUG, "DEBUG_ON: Debug flag "+flag+" = "+flagValue);

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/encryptDatabaseTest2.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/encryptDatabaseTest2.out?rev=1485822&r1=1485821&r2=1485822&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/encryptDatabaseTest2.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/encryptDatabaseTest2.out Thu May 23 18:47:45 2013
@@ -69,8 +69,7 @@ ij> xa_getconnection;
 ij> insert into foo values (4);
 1 row inserted/updated/deleted
 ij> xa_recover xa_startrscan;
-Recovered 1 in-doubt transactions
-Transaction 1 : (1,FILTERED,FILTERED)
+[, Recovered 1 in-doubt transactions, , Transaction 1 : (1,776f6d6261745f656e,776f6d6261745f656e)]
 ij> xa_commit xa_2phase 1;
 ij> select * from foo;
 A          
@@ -124,8 +123,7 @@ ij> xa_getconnection;
 ij> insert into foo values (6);
 1 row inserted/updated/deleted
 ij> xa_recover xa_startrscan;
-Recovered 1 in-doubt transactions
-Transaction 1 : (3,FILTERED,FILTERED)
+[, Recovered 1 in-doubt transactions, , Transaction 1 : (3,776f6d6261745f656e,776f6d6261745f656e)]
 ij> xa_commit xa_2phase 3;
 ij> select * from foo;
 A          

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/xaOffline1.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/xaOffline1.out?rev=1485822&r1=1485821&r2=1485822&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/xaOffline1.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/xaOffline1.out Thu May 23 18:47:45 2013
@@ -167,8 +167,7 @@ APP     |UserTransaction|ROW     |1   |X
 ij(XA)> xa_end xa_success 2;
 ij(XA)> xa_commit xa_1phase 2;
 ij(XA)> xa_recover xa_startrscan;
-Recovered 1 in-doubt transactions
-Transaction 1 : (1,FILTERED,FILTERED)
+[, Recovered 1 in-doubt transactions, , Transaction 1 : (1,776f6d626174,776f6d626174)]
 ij(XA)> --- xa_datasource 'wombat' shutdown;
 ---------------------------------------------
 -- shutdown the database.
@@ -200,8 +199,7 @@ USERNAME|TRANTYPE       |TYPE    |CNT |M
 NULL    |UserTransaction|TABLE   |1   |IX  |FOO         |Tablelock |GRANT|PREPARED
 NULL    |UserTransaction|ROW     |1   |X   |FOO         |(1,8)     |GRANT|PREPARED
 ij(XA)> xa_recover xa_startrscan;
-Recovered 1 in-doubt transactions
-Transaction 1 : (1,FILTERED,FILTERED)
+[, Recovered 1 in-doubt transactions, , Transaction 1 : (1,776f6d626174,776f6d626174)]
 ij(XA)> xa_end xa_success 4;
 ij(XA)> xa_commit xa_1phase 4;
 ij(XA)> ---------------------------------------------
@@ -218,7 +216,7 @@ ij(XA)> select * from lock_table order b
 USERNAME|TRANTYPE       |TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
 ----------------------------------------------------------------------------------
 ij(XA)> xa_recover xa_startrscan;
-Recovered 0 in-doubt transactions
+[, Recovered 0 in-doubt transactions, ]
 ij(XA)> xa_end xa_success 4;
 ij(XA)> xa_commit xa_1phase 4;
 ij(XA)> ---------------------------------------------

Modified: db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/build.xml
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/build.xml?rev=1485822&r1=1485821&r2=1485822&view=diff
==============================================================================
--- db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/build.xml (original)
+++ db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/build.xml Thu May 23 18:47:45 2013
@@ -109,7 +109,7 @@
         <pathelement path="${java16compile.classpath}"/>
       </classpath>
       <include name="${derby.dir}/impl/tools/**"/>
-      <!-- <compilerarg value="-Xlint:unchecked"/> -->
+      <compilerarg value="-Xlint:unchecked"/>
     </javac>
    </target>
 

Modified: db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/AttributeHolder.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/AttributeHolder.java?rev=1485822&r1=1485821&r2=1485822&view=diff
==============================================================================
--- db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/AttributeHolder.java (original)
+++ db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/AttributeHolder.java Thu May 23 18:47:45 2013
@@ -40,7 +40,7 @@ public class AttributeHolder {
     String name;
     String value;
     String token;
-    Vector errors = new Vector();
+    Vector<String> errors = new Vector<String>();
 
     public String getName(){
       return name;
@@ -72,14 +72,14 @@ public class AttributeHolder {
     }
     void displayErrors(){
       //If no error are found then nothing is displayed.
-      Enumeration e = errors.elements();
+      Enumeration<String> e = errors.elements();
       //In the first line, show the exact token that was parsed from
       //the URL.
       if (e.hasMoreElements())
         display(LocalizedResource.getMessage("TL_urlLabel1", "[", getToken(), "]"));
       //Show all errors.  More than one error can be found for an attribute.
       while (e.hasMoreElements()){
-        String aString = (String)e.nextElement();
+        String aString = e.nextElement();
         displayIndented(aString);
       }
     }

Modified: db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ConnectionEnv.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ConnectionEnv.java?rev=1485822&r1=1485821&r2=1485822&view=diff
==============================================================================
--- db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ConnectionEnv.java (original)
+++ db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ConnectionEnv.java Thu May 23 18:47:45 2013
@@ -42,7 +42,7 @@ import org.apache.derby.iapi.tools.i18n.
 
  */
 class ConnectionEnv {
-	Hashtable sessions = new Hashtable();
+	Hashtable<String,Session> sessions = new Hashtable<String,Session>();
 	private Session currSession;
 	private String tag;
 	private boolean only;
@@ -66,8 +66,8 @@ class ConnectionEnv {
 		// only load up ij.connection.* properties if there is
 		// only one ConnectionEnv in the system.
 		if (only) {
-            Properties p = (Properties) AccessController.doPrivileged(new PrivilegedAction() {
-            	public Object run() {
+            Properties p = AccessController.doPrivileged(new PrivilegedAction<Properties>() {
+            	public Properties run() {
                 	return System.getProperties();
             	}
             });
@@ -122,13 +122,13 @@ class ConnectionEnv {
     int newNum = 0;
     boolean newConnectionNameOk = false;
     String newConnectionName = "";
-    Enumeration e;
+    Enumeration<String> e;
     while (!newConnectionNameOk){
       newConnectionName = Session.DEFAULT_NAME + newNum;
       newConnectionNameOk = true;
       e = sessions.keys();
       while (e.hasMoreElements() && newConnectionNameOk){
-        if (((String)e.nextElement()).equals(newConnectionName))
+        if ((e.nextElement()).equals(newConnectionName))
            newConnectionNameOk = false;
       }
       newNum = newNum + 1;
@@ -140,16 +140,16 @@ class ConnectionEnv {
 		return currSession;
 	}
 
-	Hashtable getSessions() {
+	Hashtable<String,Session> getSessions() {
 		return sessions;
 	}
 
 	Session getSession(String name) {
-		return (Session) sessions.get(name);
+		return sessions.get(name);
 	}
 
 	Session setCurrentSession(String name) {
-		currSession = (Session) sessions.get(name);
+		currSession = sessions.get(name);
 		return currSession;
 	}
 
@@ -165,7 +165,7 @@ class ConnectionEnv {
 	}
 
 	void removeSession(String name) throws SQLException {
-		Session s = (Session) sessions.remove(name);
+		Session s = sessions.remove(name);
 		s.close();
 		if (currSession == s)
 			currSession = null;
@@ -175,8 +175,8 @@ class ConnectionEnv {
 		if (sessions == null || sessions.size() == 0)
 			return;
 		else
-			for (Enumeration e = sessions.keys(); e.hasMoreElements(); ) {
-				String n = (String)e.nextElement();
+			for (Enumeration<String> e = sessions.keys(); e.hasMoreElements(); ) {
+				String n = e.nextElement();
 				removeSession(n);
 			}
 	}

Modified: db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/Main.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/Main.java?rev=1485822&r1=1485821&r2=1485822&view=diff
==============================================================================
--- db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/Main.java (original)
+++ db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/Main.java Thu May 23 18:47:45 2013
@@ -117,8 +117,8 @@ public class Main {
     	        } else {
                     try {
                     	final String inFile1 = file;
-                    	in1 = (FileInputStream) AccessController.doPrivileged(new PrivilegedExceptionAction() {
-            				public Object run() throws FileNotFoundException {
+                    	in1 = AccessController.doPrivileged(new PrivilegedExceptionAction<FileInputStream>() {
+            				public FileInputStream run() throws FileNotFoundException {
         						return new FileInputStream(inFile1);
             				}
             			});
@@ -140,8 +140,8 @@ public class Main {
 		final String outFile = util.getSystemProperty("ij.outfile");
 		if (outFile != null && outFile.length()>0) {
 			LocalizedOutput oldOut = out;
-			FileOutputStream fos = (FileOutputStream) AccessController.doPrivileged(new PrivilegedAction() {
-				public Object run() {
+			FileOutputStream fos = AccessController.doPrivileged(new PrivilegedAction<FileOutputStream>() {
+				public FileOutputStream run() {
 					FileOutputStream out = null;
 					try {
 						out = new FileOutputStream(outFile);

Modified: db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/Session.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/Session.java?rev=1485822&r1=1485821&r2=1485822&view=diff
==============================================================================
--- db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/Session.java (original)
+++ db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/Session.java Thu May 23 18:47:45 2013
@@ -46,10 +46,10 @@ class Session {
 	boolean singleSession = true;
 	Connection conn = null;
 	String tag, name;
-	Hashtable prepStmts = new Hashtable();
-	Hashtable cursorStmts = new Hashtable();
-	Hashtable cursors = new Hashtable();
-	Hashtable asyncStmts = new Hashtable();
+	Hashtable<String,PreparedStatement> prepStmts = new Hashtable<String,PreparedStatement>();
+	Hashtable<String,Statement> cursorStmts = new Hashtable<String,Statement>();
+	Hashtable<String,ResultSet> cursors = new Hashtable<String,ResultSet>();
+	Hashtable<String,AsyncStatement> asyncStmts = new Hashtable<String,AsyncStatement>();
 	boolean isJCC= false;      // Is this the IBM UNIVERSAL DRIVER.
 	boolean isDNC = false;     // Is this the Derby Network Client JDBC Driver
 	boolean isEmbeddedDerby = false; // Is this the Derby Embedded JDBC Driver
@@ -97,36 +97,36 @@ class Session {
 		return name;
 	}
 
-	Object addPreparedStatement(String name, PreparedStatement ps) {
+	PreparedStatement addPreparedStatement(String name, PreparedStatement ps) {
 		return prepStmts.put(name,ps);
 	}
 
-	Object addCursorStatement(String name, Statement s) {
+	Statement addCursorStatement(String name, Statement s) {
 		return cursorStmts.put(name, s);
 	}
 
-	Object addCursor(String name, ResultSet rs) {
+	ResultSet addCursor(String name, ResultSet rs) {
 		return cursors.put(name, rs);
 	}
 
-	Object addAsyncStatement(String name, AsyncStatement s) {
+	AsyncStatement addAsyncStatement(String name, AsyncStatement s) {
 		return asyncStmts.put(name, s);
 	}
 
 	PreparedStatement getPreparedStatement(String name) {
-		return (PreparedStatement) prepStmts.get(name);
+		return prepStmts.get(name);
 	}
 
 	Statement getCursorStatement(String name) {
-		return (Statement)cursorStmts.get(name);
+		return cursorStmts.get(name);
 	}
 
 	ResultSet getCursor(String name) {
-		return (ResultSet)cursors.get(name);
+		return cursors.get(name);
 	}
 
 	AsyncStatement getAsyncStatement(String name) {
-		return (AsyncStatement)asyncStmts.get(name);
+		return asyncStmts.get(name);
 	}
 
 	boolean removePreparedStatement(String name) {

Modified: db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/URLCheck.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/URLCheck.java?rev=1485822&r1=1485821&r2=1485822&view=diff
==============================================================================
--- db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/URLCheck.java (original)
+++ db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/URLCheck.java Thu May 23 18:47:45 2013
@@ -42,11 +42,11 @@ import java.sql.SQLException;
 
 public class URLCheck {
 
-  private   Vector attributes;
-  private   static Vector booleanAttributes;
+  private   Vector<AttributeHolder> attributes;
+  private   static Vector<String> booleanAttributes;
   //Need so that AppUI class does not get garbage collected
   private   LocalizedResource langUtil = LocalizedResource.getInstance();
-  private   Vector validProps;
+  private   Vector<String> validProps;
 
   public URLCheck(String anURL) {
 
@@ -70,9 +70,9 @@ public class URLCheck {
     }
   }
   public void check(){
-    Enumeration e = attributes.elements();
+    Enumeration<AttributeHolder> e = attributes.elements();
     while (e.hasMoreElements()) {
-      AttributeHolder anAttribute = (AttributeHolder)e.nextElement();
+      AttributeHolder anAttribute = e.nextElement();
       //The check for duplicate must be done at the URLCheck level
       //and not by each specific attribute.  Only URLCheck knowns about
       //all of the attributes and names.
@@ -82,9 +82,9 @@ public class URLCheck {
     }
   }
   public void checkForDuplicate(AttributeHolder anAttribute){
-    Enumeration e = attributes.elements();
+    Enumeration<AttributeHolder> e = attributes.elements();
     while (e.hasMoreElements()) {
-      AttributeHolder aHolder = (AttributeHolder)e.nextElement();
+      AttributeHolder aHolder = e.nextElement();
       //If a duplicate is found, make sure that the message is only shown
       //once for each attribute.
       if (anAttribute != aHolder && anAttribute.getName().equals(aHolder.getName())) {
@@ -113,7 +113,7 @@ public class URLCheck {
 		
 		//Parse the url into attributes and put them in a Properties object.
 		StringTokenizer st = new StringTokenizer(url.substring(protocol.length()), ";:\"");
-		attributes = new Vector();
+		attributes = new Vector<AttributeHolder>();
 		while (st.hasMoreTokens()) {
       AttributeHolder anAttribute = new AttributeHolder();
       String anAtt = "";
@@ -139,9 +139,9 @@ public class URLCheck {
 		return props;
 	}
 
-  public static Vector getBooleanAttributes(){
+  public static Vector<String> getBooleanAttributes(){
     if (booleanAttributes == null) {
-      booleanAttributes = new Vector();
+      booleanAttributes = new Vector<String>();
 		  booleanAttributes.addElement(Attribute.DATA_ENCRYPTION);
 		  booleanAttributes.addElement(Attribute.CREATE_ATTR);
 		  booleanAttributes.addElement(Attribute.SHUTDOWN_ATTR);
@@ -150,14 +150,14 @@ public class URLCheck {
     return booleanAttributes;
   }
 
-    private static Vector validDerbyProps;
-    private Vector getValidDerbyProps()
+    private static Vector<String> validDerbyProps;
+    private Vector<String> getValidDerbyProps()
     {
         if( validDerbyProps == null)
         {
             try
             {
-                Vector props = new Vector();
+                Vector<String> props = new Vector<String>();
                 Class att = Attribute.class;
                 //Use reflection to get the list of valid keys from the Attribute class.
                 //The Attribute class is an interface and therefore all the field
@@ -166,7 +166,7 @@ public class URLCheck {
                 for (int i = 0; i < fields.length; i++)
                 {
                     Field aField = (Field)fields[i];
-                    props.addElement(aField.get(att));
+                    props.addElement( (String) aField.get(att));
                 }
                 validDerbyProps = props;
             }

Modified: db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ij.jj
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ij.jj?rev=1485822&r1=1485821&r2=1485822&view=diff
==============================================================================
--- db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ij.jj (original)
+++ db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ij.jj Thu May 23 18:47:45 2013
@@ -116,7 +116,7 @@ class ij {
 	utilMain utilInstance = null;
 	Hashtable ignoreErrors = null;
 	String protocol = null;		// the (single) unnamed protocol
-	Hashtable namedProtocols;
+	Hashtable<String,String> namedProtocols;
 
 
 
@@ -141,8 +141,8 @@ class ij {
 
 		// load all protocols specified via properties
 		//
-        Properties p = (Properties) AccessController.doPrivileged(new PrivilegedAction() {
-          	public Object run() {
+        Properties p = AccessController.doPrivileged(new PrivilegedAction<Properties>() {
+          	public Properties run() {
               	return System.getProperties();
             }
         });
@@ -161,11 +161,11 @@ class ij {
 		}
 
 
-		namedProtocols = new Hashtable();
+		namedProtocols = new Hashtable<String,String>();
 		String prefix = PROTOCOL_PROPERTY + ".";
-		for (Enumeration e = p.propertyNames(); e.hasMoreElements(); )
+		for (Enumeration<?> e = p.propertyNames(); e.hasMoreElements(); )
 		{
-			String key = (String)e.nextElement();
+			String key = (String) e.nextElement();
 			if (key.startsWith(prefix)) {
 				String name = key.substring(prefix.length());
 				installProtocol(name.toUpperCase(Locale.ENGLISH), p.getProperty(key));
@@ -513,7 +513,7 @@ class ij {
 	    */
 	public ijResult showConnectionsMethod(boolean ignore0Rows) throws SQLException {
   		Hashtable ss = currentConnEnv.getSessions();
-	  	Vector v = new Vector();
+	  	Vector<Object> v = new Vector<Object>();
 	  	SQLWarning w = null;
         if (ss == null || ss.size() == 0) {
         	if (!ignore0Rows)
@@ -740,7 +740,7 @@ class ij {
                 DatabaseMetaData dbmd = theConnection.getMetaData();
                 ResultSet tablers = dbmd.getTables(null,schema,null,null); 
               
-                List resultSets = new ArrayList();
+                List<ResultSet> resultSets = new ArrayList<ResultSet>();
                 boolean firstIteration = true;
                 ResultSet current_rs = null;
                 while (tablers.next()){
@@ -1785,7 +1785,7 @@ throws SQLException
 
 		// add named protocol if it was specified
 		if (p != null) {
-			String protocol = (String)namedProtocols.get(p);
+			String protocol = namedProtocols.get(p);
 			if (protocol == null) { throw ijException.noSuchProtocol(p); }
 			sVal = protocol + sVal; 
 		}
@@ -1888,13 +1888,13 @@ throws SQLException
 :
 {
 	String			name = null;
-	Vector			idList;
+	Vector<String>			idList;
 	int				idx = 0;
 	int				lastID = 0;
 	StringBuffer	buffer;
 	String			className;
 	String			methodName;
-	Class			classC;
+	Class<?>		classC;
 	Method			method;
 	int				argCount;
 	String[]		args;
@@ -2937,7 +2937,7 @@ Bang() :
 		Process p = Runtime.getRuntime().exec(stringValue(cmd.image));
 		LocalizedInput in = new LocalizedInput(p.getInputStream());
 		int c;
-		Vector v = new Vector();
+		Vector<Object> v = new Vector<Object>();
 		StringBuffer output = new StringBuffer();
 		// echo output
 		while ((c = in.read()) != -1) {
@@ -2967,7 +2967,7 @@ Bang() :
 }
 
 void
-StringList(Vector v) :
+StringList(Vector<Token> v) :
 {
 }
 {
@@ -2975,7 +2975,7 @@ StringList(Vector v) :
 }
 
 void
-StringItem(Vector v) :
+StringItem(Vector<Token> v) :
 {
 	Token s;
 }
@@ -2997,7 +2997,7 @@ HelpStatement() :
 {
 	<HELP>
 	{
-		Vector v = new Vector();
+		Vector<Object> v = new Vector<Object>();
 
                 StringTokenizer st = new StringTokenizer(LocalizedResource.getMessage("IJ_HelpText"), "\n");
 		while (st.hasMoreTokens()) {
@@ -3098,10 +3098,10 @@ intLiteral() throws SQLException :
 	}
 }
 
-Vector
+Vector<String>
 staticMethodName() throws SQLException :
 {
-	Vector	list = new Vector();
+	Vector<String>	list = new Vector<String>();
 }
 {
 	methodLeg( list ) ( <PERIOD> methodLeg( list ) )+
@@ -3111,7 +3111,7 @@ staticMethodName() throws SQLException :
 }
 
 void
-methodLeg( Vector list ) throws SQLException :
+methodLeg( Vector<String> list ) throws SQLException :
 {
 	Token	id;
 }
@@ -3125,7 +3125,7 @@ methodLeg( Vector list ) throws SQLExcep
 String[]
 staticMethodArgs() throws SQLException :
 {
-	Vector		list = new Vector();
+	Vector<String>		list = new Vector<String>();
 	String[]	args;
 }
 {
@@ -3141,7 +3141,7 @@ staticMethodArgs() throws SQLException :
 }
 
 void
-oneStaticArg( Vector list ) throws SQLException :
+oneStaticArg( Vector<String> list ) throws SQLException :
 {
 	Token	tok;
 }

Modified: db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ijMultipleResultSetResult.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ijMultipleResultSetResult.java?rev=1485822&r1=1485821&r2=1485822&view=diff
==============================================================================
--- db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ijMultipleResultSetResult.java (original)
+++ db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ijMultipleResultSetResult.java Thu May 23 18:47:45 2013
@@ -39,7 +39,7 @@ import org.apache.derby.iapi.tools.ToolU
  */
 public class ijMultipleResultSetResult extends ijResultImpl {
 
-    private ArrayList resultSets = null;
+    private ArrayList<ResultSet> resultSets = null;
 
     private int[] displayColumns = null;
     private int[] columnWidths = null;
@@ -54,9 +54,9 @@ public class ijMultipleResultSetResult e
      * @param widths  The widths of the columns specified in 'display', or
      *                null to display using default column sizes.
      */
-    public ijMultipleResultSetResult(List resultSets, int[] display,
+    public ijMultipleResultSetResult(List<ResultSet> resultSets, int[] display,
                                      int[] widths) throws SQLException {
-        this.resultSets = new ArrayList();
+        this.resultSets = new ArrayList<ResultSet>();
         this.resultSets.addAll(resultSets);
 
         displayColumns = ToolUtils.copy( display );
@@ -72,15 +72,16 @@ public class ijMultipleResultSetResult e
         return true;
     }
 
-    public List getMultipleResultSets() {
-        return (List) resultSets.clone();
+    @SuppressWarnings("unchecked")
+    public List<ResultSet> getMultipleResultSets() {
+        return (List<ResultSet>) resultSets.clone();
     }
 
     public void closeStatement() throws SQLException {
         if (resultSets != null) {
             ResultSet rs = null;
             for (int i = 0; i<resultSets.size(); i++){
-                rs = (ResultSet)resultSets.get(i);
+                rs = resultSets.get(i);
                 if(rs.getStatement() != null) rs.getStatement().close();
                 else rs.close(); 
             }
@@ -97,7 +98,7 @@ public class ijMultipleResultSetResult e
         SQLWarning warning = null;
         ResultSet rs = null;
         for (int i=0; i<resultSets.size(); i++){
-            rs = (ResultSet)resultSets.get(i);
+            rs = resultSets.get(i);
             if (rs.getWarnings() != null) {
                 if (warning == null) warning = rs.getWarnings();
                 else                 warning.setNextWarning(rs.getWarnings());
@@ -111,7 +112,7 @@ public class ijMultipleResultSetResult e
      */
     public void clearSQLWarnings() throws SQLException {
         for (int i=0; i<resultSets.size(); i++){
-            ((ResultSet)resultSets.get(i)).clearWarnings();
+            (resultSets.get(i)).clearWarnings();
         }
     }
 }

Modified: db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ijResult.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ijResult.java?rev=1485822&r1=1485821&r2=1485822&view=diff
==============================================================================
--- db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ijResult.java (original)
+++ db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ijResult.java Thu May 23 18:47:45 2013
@@ -52,7 +52,7 @@ interface ijResult {
 	Statement getStatement();
 	int getUpdateCount() throws SQLException;
 	ResultSet getResultSet() throws SQLException;
-	List getMultipleResultSets();
+	List<ResultSet> getMultipleResultSets();
 	ResultSet getNextRowOfResultSet();
 	Vector getVector();
 	SQLException getException();

Modified: db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ijResultImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ijResultImpl.java?rev=1485822&r1=1485821&r2=1485822&view=diff
==============================================================================
--- db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ijResultImpl.java (original)
+++ db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ijResultImpl.java Thu May 23 18:47:45 2013
@@ -50,7 +50,7 @@ abstract class ijResultImpl implements i
 	public Statement getStatement() { return null; }
 	public int getUpdateCount() throws SQLException { return -1; }
 	public ResultSet getResultSet() throws SQLException { return null; }
-	public List getMultipleResultSets() { return null; }
+	public List<ResultSet> getMultipleResultSets() { return null; }
 	public ResultSet getNextRowOfResultSet() { return null; }
 	public Vector getVector() { return null; }
 	public SQLException getException() { return null; }

Modified: db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ijVectorResult.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ijVectorResult.java?rev=1485822&r1=1485821&r2=1485822&view=diff
==============================================================================
--- db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ijVectorResult.java (original)
+++ db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ijVectorResult.java Thu May 23 18:47:45 2013
@@ -30,10 +30,10 @@ import java.sql.SQLWarning;
  */
 class ijVectorResult extends ijResultImpl {
 
-	Vector vec;
+	Vector<Object> vec;
 	SQLWarning warns;
 
-	ijVectorResult(Vector v, SQLWarning w) {
+	ijVectorResult(Vector<Object> v, SQLWarning w) {
 		vec = v;
 		warns = w;
 	}
@@ -42,7 +42,7 @@ class ijVectorResult extends ijResultImp
 	 * Initialize a new vector containing only one object.
 	 */
 	ijVectorResult(Object value, SQLWarning w) {
-		this(new Vector(1), w);
+		this(new Vector<Object>(1), w);
 		vec.add(value);
 	}
 

Modified: db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/mtGrammar.jj
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/mtGrammar.jj?rev=1485822&r1=1485821&r2=1485822&view=diff
==============================================================================
--- db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/mtGrammar.jj (original)
+++ db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/mtGrammar.jj Thu May 23 18:47:45 2013
@@ -145,7 +145,7 @@ runTime() :
 Vector
 cases() :
 {
-	Vector testCases = new Vector(5);	// start with 5
+	Vector<mtTestCase> testCases = new Vector<mtTestCase>(5);	// start with 5
 }
 {
 	(testCase(testCases))+
@@ -157,7 +157,7 @@ cases() :
 
 
 void
-testCase(Vector testCases) :
+testCase(Vector<mtTestCase> testCases) :
 {
 	Token	t;
 	mtTestCase testCase = new mtTestCase();
@@ -171,10 +171,10 @@ testCase(Vector testCases) :
 }
 
 
-Vector
+Vector<mtTestCase>
 init() :
 {
-	Vector testCases = new Vector(5);	// start with 5
+	Vector<mtTestCase> testCases = new Vector<mtTestCase>(5);	// start with 5
 }
 {
 	(initCase(testCases))+ 
@@ -186,7 +186,7 @@ init() :
 
 
 void
-initCase(Vector testCases) :
+initCase(Vector<mtTestCase> testCases) :
 {
 	Token	t;
 	mtTestCase testCase = new mtTestCase();
@@ -202,7 +202,7 @@ initCase(Vector testCases) :
 Vector
 last() :
 {
-	Vector testCases = new Vector(1);	// start with 1
+	Vector<mtTestCase> testCases = new Vector<mtTestCase>(1);	// start with 1
 }
 {
 	(lastCase(testCases))+ 
@@ -214,7 +214,7 @@ last() :
 
 
 void
-lastCase(Vector testCases) :
+lastCase(Vector<mtTestCase> testCases) :
 {
 	Token	t;
 	mtTestCase testCase = new mtTestCase();
@@ -233,7 +233,7 @@ caseInfo(mtTestCase testCase) :
 	String	file;
 	String	prop = null;
 	int	weight = 50;
-	Hashtable errorList = null;
+	Hashtable<String,Integer> errorList = null;
 	String	description = null;
 }
 {
@@ -255,7 +255,7 @@ caseInfo(mtTestCase testCase) :
 	[ errorList=ignoreErrors() ] 
 	{
 		if (errorList == null)
-			errorList = new Hashtable();
+			errorList = new Hashtable<String,Integer>();
 
 		testCase.setIgnoreErrors(errorList);
 	}
@@ -324,12 +324,12 @@ description() :
 	}	
 }
 
-Hashtable
+Hashtable<String,Integer>
 ignoreErrors() :
 {
 	// note: we need a non-null errorlist even
 	// if there is nothing in it
-	Hashtable errorList = new Hashtable();
+	Hashtable<String,Integer> errorList = new Hashtable<String,Integer>();
 }
 {
 	<IGNOREERRORS> getError(errorList) (<COMMA> getError(errorList))*
@@ -339,7 +339,7 @@ ignoreErrors() :
 }
 
 void
-getError(Hashtable errorList) :
+getError(Hashtable<String,Integer> errorList) :
 {
 	String	s;
 }

Modified: db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/util.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/util.java?rev=1485822&r1=1485821&r2=1485822&view=diff
==============================================================================
--- db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/util.java (original)
+++ db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/util.java Thu May 23 18:47:45 2013
@@ -53,7 +53,7 @@ import java.util.Locale;
 
 	@see org.apache.derby.tools.JDBCDisplayUtil
  */
-public final class util implements java.security.PrivilegedAction {
+public final class util implements java.security.PrivilegedAction<String> {
 	
 	private static boolean IS_AT_LEAST_JDBC2;
 	
@@ -185,8 +185,8 @@ public final class util implements java.
 		final String resource = qualifyResourceName(resourceName,true);
 		if (resource == null) 
 			return null;
-		InputStream is = (InputStream) AccessController.doPrivileged(new PrivilegedAction() {
-            public Object run() { 
+		InputStream is = AccessController.doPrivileged(new PrivilegedAction<InputStream>() {
+            public InputStream run() { 
                       InputStream locis = 
                           c.getResourceAsStream(resource);
                                   return locis;
@@ -367,7 +367,7 @@ public final class util implements java.
 		Object ds = null; // really javax.sql.DataSource
 		try {
 			
-		    Class dc = Class.forName(dsName);
+		    Class<?> dc = Class.forName(dsName);
 		    ds = dc.newInstance();
 		    
 		    // set datasource properties
@@ -695,7 +695,7 @@ AppUI.out.println("SIZE="+l);
 			{
 				util u = new util();
 				u.key = propertyName;
-				return (String) java.security.AccessController.doPrivileged(u);
+				return java.security.AccessController.doPrivileged(u);
 			}
 			else
 			{
@@ -708,7 +708,7 @@ AppUI.out.println("SIZE="+l);
 
 	private String key;
 
-	public final Object run() {
+	public final String run() {
 		return System.getProperty(key);
 	}
 	/** 

Modified: db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/utilMain.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/utilMain.java?rev=1485822&r1=1485821&r2=1485822&view=diff
==============================================================================
--- db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/utilMain.java (original)
+++ db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/utilMain.java Thu May 23 18:47:45 2013
@@ -51,7 +51,7 @@ import java.sql.PreparedStatement;
 	single and dual connection ij runs.
 
  */
-public class utilMain implements java.security.PrivilegedAction {
+public class utilMain implements java.security.PrivilegedAction<Object> {
 
 	private StatementFinder[] commandGrabber;
 	UCode_CharStream charStream;
@@ -86,7 +86,7 @@ public class utilMain implements java.se
 	 * command can be redirected, so we stack up command
 	 * grabbers as needed.
 	 */
-	Stack oldGrabbers = new Stack();
+	Stack<StatementFinder> oldGrabbers = new Stack<StatementFinder>();
 
 	LocalizedResource langUtil = LocalizedResource.getInstance();
 	/**
@@ -315,7 +315,7 @@ public class utilMain implements java.se
 				while (command == null && ! oldGrabbers.empty()) {
 					// close the old input file if not System.in
 					if (fileInput) commandGrabber[currCE].close();
-					commandGrabber[currCE] = (StatementFinder)oldGrabbers.pop();
+					commandGrabber[currCE] = oldGrabbers.pop();
 					if (oldGrabbers.empty())
 						fileInput = initialFileInput;
 					command = commandGrabber[currCE].nextStatement();
@@ -488,7 +488,7 @@ public class utilMain implements java.se
 				}
 				result.closeStatement();
             } else if (result.isMultipleResultSetResult()) {
-              List resultSets = result.getMultipleResultSets();
+              List<ResultSet> resultSets = result.getMultipleResultSets();
               try {
                 JDBCDisplayUtil.DisplayMultipleResults(out,resultSets,
                                      connEnv[currCE].getConnection(),

Modified: db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/xaHelper.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/xaHelper.java?rev=1485822&r1=1485821&r2=1485822&view=diff
==============================================================================
--- db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/xaHelper.java (original)
+++ db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/xaHelper.java Thu May 23 18:47:45 2013
@@ -293,7 +293,7 @@ class xaHelper implements xaAbstractHelp
             throw handleException(t);
 		}
 
-		Vector v = new Vector();
+		Vector<String> v = new Vector<String>();
 		v.addElement("");
 		v.addElement(LocalizedResource.getMessage("IJ_Reco0InDoubT", LocalizedResource.getNumber(val.length)));
 		v.addElement("");

Modified: db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/planexporter/CreateXMLFile.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/planexporter/CreateXMLFile.java?rev=1485822&r1=1485821&r2=1485822&view=diff
==============================================================================
--- db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/planexporter/CreateXMLFile.java (original)
+++ db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/planexporter/CreateXMLFile.java Thu May 23 18:47:45 2013
@@ -70,9 +70,9 @@ public class CreateXMLFile {
 
         FileOutputStream fos;
         try {
-            fos = (FileOutputStream) AccessController.doPrivileged(
-                    new PrivilegedExceptionAction() {
-                        public Object run() throws IOException {
+            fos = AccessController.doPrivileged(
+                    new PrivilegedExceptionAction<FileOutputStream>() {
+                        public FileOutputStream run() throws IOException {
                             return new FileOutputStream(file_name);
                         }
                     });

Modified: db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/sysinfo/Main.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/sysinfo/Main.java?rev=1485822&r1=1485821&r2=1485822&view=diff
==============================================================================
--- db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/sysinfo/Main.java (original)
+++ db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/sysinfo/Main.java Thu May 23 18:47:45 2013
@@ -222,9 +222,9 @@ public static void getMainInfo (java.io.
 	  String classpath = null;
 
       try {
-          classpath = (String) AccessController.doPrivileged( new PrivilegedAction()
+          classpath = AccessController.doPrivileged( new PrivilegedAction<String>()
               {
-                  public Object run()
+                  public String run()
                   {
                       return System.getProperty("java.class.path");
                   }
@@ -347,9 +347,9 @@ public static void getMainInfo (java.io.
     final   String unavailable = nullUnavailable ? null : Main.getTextMessage ("SIF01.H");
 
     try {
-        String  property = (String) AccessController.doPrivileged( new PrivilegedAction()
+        String  property = AccessController.doPrivileged( new PrivilegedAction<String>()
             {
-                public  Object  run()
+                public  String  run()
                 {
                     return System.getProperty (whichProperty, unavailable);
                 }
@@ -376,9 +376,9 @@ public static void getMainInfo (java.io.
     private static String getCanonicalPath(final File f) throws IOException {
 
         try {
-            return (String) AccessController
-                    .doPrivileged(new PrivilegedExceptionAction() {
-                        public Object run() throws IOException {
+            return AccessController
+                    .doPrivileged(new PrivilegedExceptionAction<String>() {
+                        public String run() throws IOException {
                             return f.getCanonicalPath();
                         }
                     });
@@ -447,9 +447,9 @@ public static void getMainInfo (java.io.
       final String finalLocaleResource = localeResource;
      
       try {     
-        	InputStream is = (InputStream) AccessController.doPrivileged
-            (new PrivilegedAction() {
-                  public Object run() {
+        	InputStream is = AccessController.doPrivileged
+            (new PrivilegedAction<InputStream>() {
+                  public InputStream run() {
   		            InputStream locis =
   		            	finalp.getClass().getResourceAsStream (finalLocaleResource);
   					return locis;
@@ -825,7 +825,7 @@ public static void getMainInfo (java.io.
         {
 			if (classpath != null) {
 				String cp [] = parseClasspath(classpath);
-				Vector v = new Vector();
+				Vector<ZipInfoProperties> v = new Vector<ZipInfoProperties>();
 				for (int i = 0; i < cp.length; i++)
 				{
 					ZipInfoProperties zip = null;
@@ -874,15 +874,15 @@ public static void getMainInfo (java.io.
      */
     private static ZipInfoProperties [] loadZipFromResource()
     {
-		java.util.ArrayList al = new java.util.ArrayList();
+		java.util.ArrayList<ZipInfoProperties> al = new java.util.ArrayList<ZipInfoProperties>();
 
         for (int i = 0; i < infoNames.length; i++)
         {
             final String resource = "/".concat(infoNames[i]);
 
-            InputStream is = (InputStream) AccessController.doPrivileged
-            (new PrivilegedAction() {
-                public Object run() {
+            InputStream is = AccessController.doPrivileged
+            (new PrivilegedAction<InputStream>() {
+                public InputStream run() {
 			        InputStream locis =
                         new Main().getClass().getResourceAsStream(resource);
                             return locis;
@@ -896,9 +896,9 @@ public static void getMainInfo (java.io.
 			ZipInfoProperties ze = new ZipInfoProperties(ProductVersionHolder.getProductVersionHolderFromMyEnv(is));
  
                         // get the real location of the info file
-                        URL locUrl = (URL) AccessController.doPrivileged
-                        (new PrivilegedAction() {
-                            public Object run() {
+                        URL locUrl = AccessController.doPrivileged
+                        (new PrivilegedAction<URL>() {
+                            public URL run() {
                                 URL realUrl = new Main().getClass().getResource(resource);
                                 return realUrl;
                             }
@@ -954,9 +954,9 @@ public static void getMainInfo (java.io.
      */
     private static ZipInfoProperties checkForInfo(final String cpEntry)
     {
-        return (ZipInfoProperties) AccessController.doPrivileged( new PrivilegedAction()
+        return AccessController.doPrivileged( new PrivilegedAction<ZipInfoProperties>()
             {
-                public Object run()
+                public ZipInfoProperties run()
                 {
                     File f = new File(cpEntry);
                     if ( ! f.exists())
@@ -1111,9 +1111,9 @@ public static void getMainInfo (java.io.
      */
     private static String getFileWhichLoadedClass(final Class cls)
     {
-         return (String)AccessController.doPrivileged( new PrivilegedAction()
+         return AccessController.doPrivileged( new PrivilegedAction<String>()
         {
-            public Object run()
+            public String run()
             {
                 CodeSource cs = null;
                 try {
@@ -1163,7 +1163,7 @@ public static void getMainInfo (java.io.
     private static ZipInfoProperties[] mergeZips(ZipInfoProperties[] zip1,
                                                  ZipInfoProperties[] zip2)
     {
-        Vector v = new Vector();
+        Vector<ZipInfoProperties> v = new Vector<ZipInfoProperties>();
         boolean foundDup = false;
   
         // remove duplicates from first array
@@ -1189,7 +1189,7 @@ public static void getMainInfo (java.io.
           {
             for (int k = 0; k < v.size(); k++)
             {
-                ZipInfoProperties z = (ZipInfoProperties)v.get(k);
+                ZipInfoProperties z = v.get(k);
                 if (zip2[j].getLocation().equals(z.getLocation()))
                   foundDup = true;
             }

Modified: db/derby/code/trunk/java/tools/org/apache/derby/tools/JDBCDisplayUtil.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/tools/org/apache/derby/tools/JDBCDisplayUtil.java?rev=1485822&r1=1485821&r2=1485822&view=diff
==============================================================================
--- db/derby/code/trunk/java/tools/org/apache/derby/tools/JDBCDisplayUtil.java (original)
+++ db/derby/code/trunk/java/tools/org/apache/derby/tools/JDBCDisplayUtil.java Thu May 23 18:47:45 2013
@@ -306,7 +306,7 @@ public class JDBCDisplayUtil {
 
        @exception SQLException on JDBC access failure
     */
-    static public void DisplayMultipleResults(PrintWriter out, List resultSets,
+    static public void DisplayMultipleResults(PrintWriter out, List<ResultSet> resultSets,
                                               Connection conn,
                                               int[] displayColumns,
                                               int[] displayColumnWidths)
@@ -339,14 +339,14 @@ public class JDBCDisplayUtil {
         (PrintWriter out, ResultSet rs, Connection conn, int indentLevel,
          int[] displayColumns, int[] displayColumnWidths)
         throws SQLException {
-        List resultSets = new ArrayList();
+        List<ResultSet> resultSets = new ArrayList<ResultSet>();
         resultSets.add(rs);
         indent_DisplayResults( out, resultSets, conn, 0, displayColumns, 
                                displayColumnWidths);
     }
 
     static private void indent_DisplayResults
-        (PrintWriter out, List resultSets, Connection conn, int indentLevel,
+        (PrintWriter out, List<ResultSet> resultSets, Connection conn, int indentLevel,
          int[] displayColumns, int[] displayColumnWidths)
         throws SQLException {
 
@@ -354,16 +354,16 @@ public class JDBCDisplayUtil {
 
         //get metadata from the first ResultSet
         if (resultSets != null && resultSets.size() > 0)
-            rsmd = ((ResultSet)resultSets.get(0)).getMetaData();
+            rsmd = (resultSets.get(0)).getMetaData();
 
         checkNotNull(rsmd, "ResultSetMetaData");
-        Vector nestedResults;
+        Vector<ResultSet> nestedResults;
         int numberOfRowsSelected = 0;
 
         // autocommit must be off or the nested cursors
         // are closed when the outer statement completes.
         if (!conn.getAutoCommit())
-            nestedResults = new Vector();
+            nestedResults = new Vector<ResultSet>();
         else
             nestedResults = null;
 
@@ -381,7 +381,7 @@ public class JDBCDisplayUtil {
         ResultSet rs = null;
         boolean doNext = true;
         for (int i = 0; i< resultSets.size(); i++) {
-            rs = (ResultSet)resultSets.get(i);
+            rs = resultSets.get(i);
             doNext = true;
             while (doNext){
                 try {
@@ -430,7 +430,7 @@ public class JDBCDisplayUtil {
 
 		@exception SQLException thrown on access error
 	 */
-	static private void DisplayNestedResults(PrintWriter out, Vector nr, Connection conn, int indentLevel )
+	static private void DisplayNestedResults(PrintWriter out, Vector<ResultSet> nr, Connection conn, int indentLevel )
 		throws SQLException {
 
 		if (nr == null) return;
@@ -477,12 +477,12 @@ public class JDBCDisplayUtil {
 											  int[] displayColumns, int[] displayColumnWidths )
 		throws SQLException {
 
-		Vector nestedResults;
+		Vector<ResultSet> nestedResults;
 
 		// autocommit must be off or the nested cursors
 		// are closed when the outer statement completes.
 		if (!conn.getAutoCommit())
-			nestedResults = new Vector();
+			nestedResults = new Vector<ResultSet>();
 		else
 			nestedResults = null;
 
@@ -529,7 +529,7 @@ public class JDBCDisplayUtil {
 												 int indentLevel, int[] displayColumns, int[] displayColumnWidths )
 		throws SQLException {
 
-		Vector nestedResults;
+		Vector<ResultSet> nestedResults;
 
 		if (rs == null) {
 			indentedPrintLine( out, indentLevel, LocalizedResource.getMessage("UT_NoCurreRow_19"));
@@ -539,7 +539,7 @@ public class JDBCDisplayUtil {
 		// autocommit must be off or the nested cursors
 		// are closed when the outer statement completes.
 		if (!conn.getAutoCommit())
-			nestedResults = new Vector();
+			nestedResults = new Vector<ResultSet>();
 		else
 			nestedResults = null;
 
@@ -660,7 +660,7 @@ public class JDBCDisplayUtil {
 
 		@exception SQLException thrown on JDBC access failure
 	 */
-	static private void DisplayRow(PrintWriter out, ResultSet rs, ResultSetMetaData rsmd, int rowLen, Vector nestedResults, Connection conn, int indentLevel,
+	static private void DisplayRow(PrintWriter out, ResultSet rs, ResultSetMetaData rsmd, int rowLen, Vector<ResultSet> nestedResults, Connection conn, int indentLevel,
 								   int[] displayColumns, int[] displayColumnWidths )
 		throws SQLException
 	{
@@ -691,7 +691,7 @@ public class JDBCDisplayUtil {
 				else if (o instanceof ResultSet && nestedResults != null)
 				{
 					s = LocalizedResource.getMessage("UT_Resul0_20", LocalizedResource.getNumber(nestedResults.size()));
-					nestedResults.addElement(o);
+					nestedResults.addElement( (ResultSet) o);
 				}
 				else
 				{
@@ -927,13 +927,13 @@ public class JDBCDisplayUtil {
 		throws SQLException {
 		ResultSetMetaData rsmd = rs.getMetaData();
 		checkNotNull(rsmd, "ResultSetMetaData");
-		Vector nestedResults;
+		Vector<ResultSet> nestedResults;
     int numberOfRowsSelected = 0;
 
 		// autocommit must be off or the nested cursors
 		// are closed when the outer statement completes.
 		if (!conn.getAutoCommit())
-			nestedResults = new Vector();
+			nestedResults = new Vector<ResultSet>();
 		else
 			nestedResults = null;
 
@@ -981,7 +981,7 @@ public class JDBCDisplayUtil {
 		nestedResults = null;
 	}
 
-	static private void DisplayNestedResults(PrintStream out, Vector nr, Connection conn, int indentLevel )
+	static private void DisplayNestedResults(PrintStream out, Vector<ResultSet> nr, Connection conn, int indentLevel )
 		throws SQLException {
 
 		if (nr == null) return;
@@ -1003,7 +1003,7 @@ public class JDBCDisplayUtil {
 			System.out.println(b);
 			System.out.println(s+i+" +");
 			System.out.println(b);
-			indent_DisplayResults(out, (ResultSet) nr.elementAt(i), conn, 
+			indent_DisplayResults(out, nr.elementAt(i), conn, 
 								  indentLevel, null, null);
 		}
 	}
@@ -1019,12 +1019,12 @@ public class JDBCDisplayUtil {
 											  int[] displayColumns, int[] displayColumnWidths )
 		throws SQLException {
 
-		Vector nestedResults;
+		Vector<ResultSet> nestedResults;
 
 		// autocommit must be off or the nested cursors
 		// are closed when the outer statement completes.
 		if (!conn.getAutoCommit())
-			nestedResults = new Vector();
+			nestedResults = new Vector<ResultSet>();
 		else
 			nestedResults = null;
 
@@ -1061,7 +1061,7 @@ public class JDBCDisplayUtil {
 												 int indentLevel, int[] displayColumns, int[] displayColumnWidths )
 		throws SQLException {
 
-		Vector nestedResults;
+		Vector<ResultSet> nestedResults;
 
 		if (rs == null) {
 			indentedPrintLine( out, indentLevel, LocalizedResource.getMessage("UT_NoCurreRow_19"));
@@ -1071,7 +1071,7 @@ public class JDBCDisplayUtil {
 		// autocommit must be off or the nested cursors
 		// are closed when the outer statement completes.
 		if (!conn.getAutoCommit())
-			nestedResults = new Vector();
+			nestedResults = new Vector<ResultSet>();
 		else
 			nestedResults = null;
 
@@ -1170,7 +1170,7 @@ public class JDBCDisplayUtil {
 		return rowLen;
 	} // DisplayBanner
 
-	static private void DisplayRow(PrintStream out, ResultSet rs, ResultSetMetaData rsmd, int rowLen, Vector nestedResults, Connection conn, int indentLevel,
+	static private void DisplayRow(PrintStream out, ResultSet rs, ResultSetMetaData rsmd, int rowLen, Vector<ResultSet> nestedResults, Connection conn, int indentLevel,
 								   int[] displayColumns, int[] displayColumnWidths)
 		throws SQLException
 	{
@@ -1201,7 +1201,7 @@ public class JDBCDisplayUtil {
 				else if (o instanceof ResultSet && nestedResults != null)
 				{
 					s = "ResultSet #"+nestedResults.size();
-					nestedResults.addElement(o);
+					nestedResults.addElement( (ResultSet) o);
 				}
 				else
 				{
@@ -1269,10 +1269,10 @@ public class JDBCDisplayUtil {
      */
     private static boolean getSystemBoolean(final String name) {
 
-        return ((Boolean) AccessController
-                .doPrivileged(new java.security.PrivilegedAction() {
+        return (AccessController
+                .doPrivileged(new java.security.PrivilegedAction<Boolean>() {
 
-                    public Object run() {
+                    public Boolean run() {
                         return Boolean.getBoolean(name) ?
                             Boolean.TRUE : Boolean.FALSE;
 

Modified: db/derby/code/trunk/java/tools/org/apache/derby/tools/dblook.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/tools/org/apache/derby/tools/dblook.java?rev=1485822&r1=1485821&r2=1485822&view=diff
==============================================================================
--- db/derby/code/trunk/java/tools/org/apache/derby/tools/dblook.java (original)
+++ db/derby/code/trunk/java/tools/org/apache/derby/tools/dblook.java Thu May 23 18:47:45 2013
@@ -64,15 +64,15 @@ public final class dblook {
 
 	// Mappings from id to name for schemas and tables (for ease
 	// of reference).
-	private static HashMap schemaMap;
-	private static HashMap tableIdToNameMap;
+	private static HashMap<String,String> schemaMap;
+	private static HashMap<String,String> tableIdToNameMap;
 
 	// Command-line Parameters.
 	private static String sourceDBUrl;
 	private static String ddlFileName;
 	private static String stmtDelimiter;
 	private static boolean appendLogs;
-	private static ArrayList tableList;
+	private static ArrayList<String> tableList;
 	private static String schemaParam;
 	private static String targetSchema;
 	private static boolean skipViews;
@@ -135,8 +135,8 @@ public final class dblook {
 			return;
 		}
 
-		schemaMap = new HashMap();
-		tableIdToNameMap = new HashMap();
+		schemaMap = new HashMap<String,String>();
+		tableIdToNameMap = new HashMap<String,String>();
 
 		// Now run the utility.
 		go();
@@ -432,7 +432,7 @@ public final class dblook {
 
 		int argIndex = start;
 		int count = 0;
-		tableList = new ArrayList();
+		tableList = new ArrayList<String>();
 		while (argIndex < args.length) {
 
 			if (((args[argIndex].length() > 0) && (args[argIndex].charAt(0) == '-')) ||
@@ -895,7 +895,7 @@ public final class dblook {
 		int strLen = str.length();
 		for (int i = 0; i < tableList.size(); i++) {
 
-			String tableName = (String)tableList.get(i);
+			String tableName = tableList.get(i);
 			tableName = expandDoubleQuotes(stripQuotes(tableName));
 			int nameLen = tableName.length();
 			String strCopy;
@@ -1055,7 +1055,7 @@ public final class dblook {
 
 	public static String lookupSchemaId(String schemaId) {
 
-		return (String)(schemaMap.get(schemaId));
+		return schemaMap.get(schemaId);
 
 	}
 
@@ -1069,7 +1069,7 @@ public final class dblook {
 
 	public static String lookupTableId(String tableId) {
 
-		return (String)(tableIdToNameMap.get(tableId));
+		return tableIdToNameMap.get(tableId);
 
 	}
 



Mime
View raw message