harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r470671 - in /incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests: java/sql/ javax/sql/ javax/transaction/ javax/transaction/xa/
Date Fri, 03 Nov 2006 04:56:32 GMT
Author: ndbeyer
Date: Thu Nov  2 20:56:30 2006
New Revision: 470671

URL: http://svn.apache.org/viewvc?view=rev&rev=470671
Log:
Compiler warning cleanup for sql module tests.

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/BatchUpdateExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ConnectionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DataTruncationTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DatabaseMetaDataTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DateTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DriverManagerTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ParameterMetaDataTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ResultSetMetaDataTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ResultSetTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/SQLExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/SQLWarningTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/StatementTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TestHelper_ClassLoader.java
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TestHelper_Driver1.java
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TestHelper_Driver4.java
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TestHelper_DriverManager.java
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TimeTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TimestampTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TypesTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/ConnectionEventTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/RowSetEventTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/transaction/InvalidTransactionExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/transaction/TransactionRequiredExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/transaction/TransactionRolledbackExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/transaction/xa/XAExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/transaction/xa/XAResourceTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/transaction/xa/XidTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/BatchUpdateExceptionTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/BatchUpdateExceptionTest.java?view=diff&rev=470671&r1=470670&r2=470671
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/BatchUpdateExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/BatchUpdateExceptionTest.java Thu Nov  2 20:56:30 2006
@@ -45,8 +45,9 @@
 		for (int i = 0; i < loopCount; i++) {
 			try {
 				aBatchUpdateException = new BatchUpdateException();
-				if (theExceptions[i] != null)
-					fail();
+				if (theExceptions[i] != null) {
+                    fail();
+                }
 				assertEquals(i + " Final state mismatch: ",
 						aBatchUpdateException.getErrorCode(),
 						theFinalStates1[i]);
@@ -59,8 +60,9 @@
 						aBatchUpdateException.getMessage(), theFinalStates4[i]);
 
 			} catch (Exception e) {
-				if (theExceptions[i] == null)
-					fail(i + "Unexpected exception");
+				if (theExceptions[i] == null) {
+                    fail(i + "Unexpected exception");
+                }
 				assertEquals(i + "Exception mismatch", e.getClass(),
 						theExceptions[i].getClass());
 				assertEquals(i + "Exception mismatch", e.getMessage(),
@@ -89,8 +91,9 @@
 		for (int i = 0; i < loopCount; i++) {
 			try {
 				aBatchUpdateException = new BatchUpdateException(init1[i]);
-				if (theExceptions[i] != null)
-					fail();
+				if (theExceptions[i] != null) {
+                    fail();
+                }
 				assertEquals(i + " Final state mismatch: ",
 						aBatchUpdateException.getErrorCode(),
 						theFinalStates1[i]);
@@ -103,8 +106,9 @@
 						aBatchUpdateException.getMessage(), theFinalStates4[i]);
 
 			} catch (Exception e) {
-				if (theExceptions[i] == null)
-					fail(i + "Unexpected exception");
+				if (theExceptions[i] == null) {
+                    fail(i + "Unexpected exception");
+                }
 				assertEquals(i + "Exception mismatch", e.getClass(),
 						theExceptions[i].getClass());
 				assertEquals(i + "Exception mismatch", e.getMessage(),
@@ -142,8 +146,9 @@
 			try {
 				aBatchUpdateException = new BatchUpdateException(init1[i],
 						init2[i]);
-				if (theExceptions[i] != null)
-					fail();
+				if (theExceptions[i] != null) {
+                    fail();
+                }
 				assertEquals(i + " Final state mismatch: ",
 						aBatchUpdateException.getErrorCode(),
 						theFinalStates1[i]);
@@ -156,8 +161,9 @@
 						aBatchUpdateException.getMessage(), theFinalStates4[i]);
 
 			} catch (Exception e) {
-				if (theExceptions[i] == null)
-					fail(i + "Unexpected exception");
+				if (theExceptions[i] == null) {
+                    fail(i + "Unexpected exception");
+                }
 				assertEquals(i + "Exception mismatch", e.getClass(),
 						theExceptions[i].getClass());
 				assertEquals(i + "Exception mismatch", e.getMessage(),
@@ -197,8 +203,9 @@
 			try {
 				aBatchUpdateException = new BatchUpdateException(init1[i],
 						init2[i], init3[i]);
-				if (theExceptions[i] != null)
-					fail();
+				if (theExceptions[i] != null) {
+                    fail();
+                }
 				assertEquals(i + " Final state mismatch: ",
 						aBatchUpdateException.getErrorCode(),
 						theFinalStates1[i]);
@@ -211,8 +218,9 @@
 						aBatchUpdateException.getMessage(), theFinalStates4[i]);
 
 			} catch (Exception e) {
-				if (theExceptions[i] == null)
-					fail(i + "Unexpected exception");
+				if (theExceptions[i] == null) {
+                    fail(i + "Unexpected exception");
+                }
 				assertEquals(i + "Exception mismatch", e.getClass(),
 						theExceptions[i].getClass());
 				assertEquals(i + "Exception mismatch", e.getMessage(),
@@ -253,8 +261,9 @@
 			try {
 				aBatchUpdateException = new BatchUpdateException(init1[i],
 						init2[i], init3[i], init4[i]);
-				if (theExceptions[i] != null)
-					fail();
+				if (theExceptions[i] != null) {
+                    fail();
+                }
 				assertEquals(i + " Final state mismatch: ",
 						aBatchUpdateException.getErrorCode(),
 						theFinalStates1[i]);
@@ -267,8 +276,9 @@
 						aBatchUpdateException.getMessage(), theFinalStates4[i]);
 
 			} catch (Exception e) {
-				if (theExceptions[i] == null)
-					fail(i + "Unexpected exception");
+				if (theExceptions[i] == null) {
+                    fail(i + "Unexpected exception");
+                }
 				assertEquals(i + "Exception mismatch", e.getClass(),
 						theExceptions[i].getClass());
 				assertEquals(i + "Exception mismatch", e.getMessage(),
@@ -302,8 +312,9 @@
 			try {
 				aBatchUpdateException = new BatchUpdateException(init1[i]);
 				theReturn = aBatchUpdateException.getUpdateCounts();
-				if (theExceptions[i] != null)
-					fail(i + "Exception missed");
+				if (theExceptions[i] != null) {
+                    fail(i + "Exception missed");
+                }
 				assertEquals(i + "Return value mismatch", theReturn,
 						theReturns[i]);
 				assertEquals(i + " Final state mismatch: ",
@@ -318,8 +329,9 @@
 						aBatchUpdateException.getMessage(), theFinalStates4[i]);
 
 			} catch (Exception e) {
-				if (theExceptions[i] == null)
-					fail(i + "Unexpected exception");
+				if (theExceptions[i] == null) {
+                    fail(i + "Unexpected exception");
+                }
 				assertEquals(i + "Exception mismatch", e.getClass(),
 						theExceptions[i].getClass());
 				assertEquals(i + "Exception mismatch", e.getMessage(),

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ConnectionTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ConnectionTest.java?view=diff&rev=470671&r1=470670&r2=470671
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ConnectionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ConnectionTest.java Thu Nov  2 20:56:30 2006
@@ -30,7 +30,7 @@
 	 */
 	public void testPublicStatics() {
 
-		HashMap thePublicStatics = new HashMap();
+		HashMap<String, Integer> thePublicStatics = new HashMap<String, Integer>();
 		thePublicStatics.put("TRANSACTION_SERIALIZABLE", new Integer(8));
 		thePublicStatics.put("TRANSACTION_REPEATABLE_READ", new Integer(4));
 		thePublicStatics.put("TRANSACTION_READ_COMMITTED", new Integer(2));
@@ -49,7 +49,7 @@
 		 * "TRANSACTION_NONE: " + Connection.TRANSACTION_NONE );
 		 */
 
-		Class connectionClass;
+		Class<?> connectionClass;
 		try {
 			connectionClass = Class.forName("java.sql.Connection");
 		} catch (ClassNotFoundException e) {
@@ -62,12 +62,12 @@
 				+ Modifier.FINAL;
 
 		int countPublicStatics = 0;
-		for (int i = 0; i < theFields.length; i++) {
-			String fieldName = theFields[i].getName();
-			int theMods = theFields[i].getModifiers();
+		for (Field element : theFields) {
+			String fieldName = element.getName();
+			int theMods = element.getModifiers();
 			if (Modifier.isPublic(theMods) && Modifier.isStatic(theMods)) {
 				try {
-					Object fieldValue = theFields[i].get(null);
+					Object fieldValue = element.get(null);
 					Object expectedValue = thePublicStatics.get(fieldName);
 					if (expectedValue == null) {
 						fail("Field " + fieldName + " missing!");

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DataTruncationTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DataTruncationTest.java?view=diff&rev=470671&r1=470670&r2=470671
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DataTruncationTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DataTruncationTest.java Thu Nov  2 20:56:30 2006
@@ -60,8 +60,9 @@
 			try {
 				aDataTruncation = new DataTruncation(init1[i], init2[i],
 						init3[i], init4[i], init5[i]);
-				if (theExceptions[i] != null)
-					fail();
+				if (theExceptions[i] != null) {
+                    fail();
+                }
 				assertEquals(i + "  Final state mismatch", aDataTruncation
 						.getSQLState(), theFinalStates1[i]);
 				assertEquals(i + "  Final state mismatch", aDataTruncation
@@ -80,8 +81,9 @@
 						.getRead(), theFinalStates8[i]);
 
 			} catch (Exception e) {
-				if (theExceptions[i] == null)
-					fail(i + "Unexpected exception");
+				if (theExceptions[i] == null) {
+                    fail(i + "Unexpected exception");
+                }
 				assertEquals(i + "Exception mismatch", e.getClass(),
 						theExceptions[i].getClass());
 				assertEquals(i + "Exception mismatch", e.getMessage(),
@@ -128,8 +130,9 @@
 				aDataTruncation = new DataTruncation(init1[i], init2[i],
 						init3[i], init4[i], init5[i]);
 				theReturn = aDataTruncation.getIndex();
-				if (theExceptions[i] != null)
-					fail(i + "Exception missed");
+				if (theExceptions[i] != null) {
+                    fail(i + "Exception missed");
+                }
 				assertEquals(i + "Return value mismatch", theReturn,
 						theReturns[i]);
 				assertEquals(i + "  Final state mismatch", aDataTruncation
@@ -150,8 +153,9 @@
 						.getRead(), theFinalStates8[i]);
 
 			} catch (Exception e) {
-				if (theExceptions[i] == null)
-					fail(i + "Unexpected exception");
+				if (theExceptions[i] == null) {
+                    fail(i + "Unexpected exception");
+                }
 				assertEquals(i + "Exception mismatch", e.getClass(),
 						theExceptions[i].getClass());
 				assertEquals(i + "Exception mismatch", e.getMessage(),
@@ -198,8 +202,9 @@
 				aDataTruncation = new DataTruncation(init1[i], init2[i],
 						init3[i], init4[i], init5[i]);
 				theReturn = aDataTruncation.getParameter();
-				if (theExceptions[i] != null)
-					fail(i + "Exception missed");
+				if (theExceptions[i] != null) {
+                    fail(i + "Exception missed");
+                }
 				assertEquals(i + "Return value mismatch", theReturn,
 						theReturns[i]);
 				assertEquals(i + "  Final state mismatch", aDataTruncation
@@ -220,8 +225,9 @@
 						.getRead(), theFinalStates8[i]);
 
 			} catch (Exception e) {
-				if (theExceptions[i] == null)
-					fail(i + "Unexpected exception");
+				if (theExceptions[i] == null) {
+                    fail(i + "Unexpected exception");
+                }
 				assertEquals(i + "Exception mismatch", e.getClass(),
 						theExceptions[i].getClass());
 				assertEquals(i + "Exception mismatch", e.getMessage(),
@@ -268,8 +274,9 @@
 				aDataTruncation = new DataTruncation(init1[i], init2[i],
 						init3[i], init4[i], init5[i]);
 				theReturn = aDataTruncation.getRead();
-				if (theExceptions[i] != null)
-					fail(i + "Exception missed");
+				if (theExceptions[i] != null) {
+                    fail(i + "Exception missed");
+                }
 				assertEquals(i + "Return value mismatch", theReturn,
 						theReturns[i]);
 				assertEquals(i + "  Final state mismatch", aDataTruncation
@@ -290,8 +297,9 @@
 						.getRead(), theFinalStates8[i]);
 
 			} catch (Exception e) {
-				if (theExceptions[i] == null)
-					fail(i + "Unexpected exception");
+				if (theExceptions[i] == null) {
+                    fail(i + "Unexpected exception");
+                }
 				assertEquals(i + "Exception mismatch", e.getClass(),
 						theExceptions[i].getClass());
 				assertEquals(i + "Exception mismatch", e.getMessage(),
@@ -338,8 +346,9 @@
 				aDataTruncation = new DataTruncation(init1[i], init2[i],
 						init3[i], init4[i], init5[i]);
 				theReturn = aDataTruncation.getDataSize();
-				if (theExceptions[i] != null)
-					fail(i + "Exception missed");
+				if (theExceptions[i] != null) {
+                    fail(i + "Exception missed");
+                }
 				assertEquals(i + "Return value mismatch", theReturn,
 						theReturns[i]);
 				assertEquals(i + "  Final state mismatch", aDataTruncation
@@ -360,8 +369,9 @@
 						.getRead(), theFinalStates8[i]);
 
 			} catch (Exception e) {
-				if (theExceptions[i] == null)
-					fail(i + "Unexpected exception");
+				if (theExceptions[i] == null) {
+                    fail(i + "Unexpected exception");
+                }
 				assertEquals(i + "Exception mismatch", e.getClass(),
 						theExceptions[i].getClass());
 				assertEquals(i + "Exception mismatch", e.getMessage(),
@@ -408,8 +418,9 @@
 				aDataTruncation = new DataTruncation(init1[i], init2[i],
 						init3[i], init4[i], init5[i]);
 				theReturn = aDataTruncation.getTransferSize();
-				if (theExceptions[i] != null)
-					fail(i + "Exception missed");
+				if (theExceptions[i] != null) {
+                    fail(i + "Exception missed");
+                }
 				assertEquals(i + "Return value mismatch", theReturn,
 						theReturns[i]);
 				assertEquals(i + "  Final state mismatch", aDataTruncation
@@ -430,8 +441,9 @@
 						.getRead(), theFinalStates8[i]);
 
 			} catch (Exception e) {
-				if (theExceptions[i] == null)
-					fail(i + "Unexpected exception");
+				if (theExceptions[i] == null) {
+                    fail(i + "Unexpected exception");
+                }
 				assertEquals(i + "Exception mismatch", e.getClass(),
 						theExceptions[i].getClass());
 				assertEquals(i + "Exception mismatch", e.getMessage(),

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DatabaseMetaDataTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DatabaseMetaDataTest.java?view=diff&rev=470671&r1=470670&r2=470671
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DatabaseMetaDataTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DatabaseMetaDataTest.java Thu Nov  2 20:56:30 2006
@@ -30,7 +30,7 @@
 	 */
 	public void testPublicStatics() {
 
-		HashMap thePublicStatics = new HashMap();
+		HashMap<String, Number> thePublicStatics = new HashMap<String, Number>();
 		thePublicStatics.put("sqlStateSQL99", new Integer(2));
 		thePublicStatics.put("sqlStateXOpen", new Integer(1));
 		thePublicStatics.put("attributeNullableUnknown", new Short((short) 2));
@@ -80,7 +80,7 @@
 		thePublicStatics.put("procedureNoResult", new Integer(1));
 		thePublicStatics.put("procedureResultUnknown", new Integer(0));
 
-		Class databaseMetaDataClass;
+		Class<?> databaseMetaDataClass;
 		try {
 			databaseMetaDataClass = Class.forName("java.sql.DatabaseMetaData");
 		} catch (ClassNotFoundException e) {
@@ -93,12 +93,12 @@
 				+ Modifier.FINAL;
 
 		int countPublicStatics = 0;
-		for (int i = 0; i < theFields.length; i++) {
-			String fieldName = theFields[i].getName();
-			int theMods = theFields[i].getModifiers();
+		for (Field element : theFields) {
+			String fieldName = element.getName();
+			int theMods = element.getModifiers();
 			if (Modifier.isPublic(theMods) && Modifier.isStatic(theMods)) {
 				try {
-					Object fieldValue = theFields[i].get(null);
+					Object fieldValue = element.get(null);
 					Object expectedValue = thePublicStatics.get(fieldName);
 					if (expectedValue == null) {
 						fail("Field " + fieldName + " missing!");

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DateTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DateTest.java?view=diff&rev=470671&r1=470670&r2=470671
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DateTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DateTest.java Thu Nov  2 20:56:30 2006
@@ -105,9 +105,10 @@
 
 	/*
 	 * Test of the Date(int, int, int) constructor - now deprecated but still
-	 * funtioning
+	 * functioning
 	 */
-	public void testDateintintint() {
+	@SuppressWarnings("deprecation")
+    public void testDateintintint() {
 
 		int init1[] = { 99, 8099, 9000, 99999, 99, 99, -1, -100 };
 		int init2[] = { 11, 0, 0, 0, 999, 0, 0, -111 };
@@ -129,8 +130,8 @@
 				TIME_NEGATIVE, TIME_LOWERLIMIT, TIME_UPPERLIMIT, TIME_EPOCH,
 				TIME_NOW };
 
-		for (int i = 0; i < init1.length; i++) {
-            Date theDate = new Date(init1[i]);
+		for (long element : init1) {
+            Date theDate = new Date(element);
             assertNotNull(theDate);
         } // end for
 
@@ -140,10 +141,11 @@
 	 * Test of the (deprecated) int Date.getHours() method - which always throws
 	 * an IllegalArgumentException
 	 */
-	public void testGetHours() {
+	@SuppressWarnings("deprecation")
+    public void testGetHours() {
 		Date theDate = new Date(TIME_TESTDATE1);
 		try {
-			int theHours = theDate.getHours();
+			theDate.getHours();
             fail("Should throw IllegalArgumentException.");
 		} catch (IllegalArgumentException ie) {
             //expected
@@ -154,10 +156,11 @@
 	 * Test of the (deprecated) int Date.getMinutes() method - which always
 	 * throws an IllegalArgumentException
 	 */
-	public void testGetMinutes() {
+	@SuppressWarnings("deprecation")
+    public void testGetMinutes() {
 		Date theDate = new Date(TIME_TESTDATE1);
 		try {
-			int theMinutes = theDate.getMinutes();
+			theDate.getMinutes();
             fail("Should throw IllegalArgumentException.");
 		} catch (IllegalArgumentException ie) {
 			//expected
@@ -168,10 +171,11 @@
 	 * Test of the (deprecated) int Date.getSeconds() method - which always
 	 * throws an IllegalArgumentException
 	 */
-	public void testGetSeconds() {
+	@SuppressWarnings("deprecation")
+    public void testGetSeconds() {
 		Date theDate = new Date(TIME_TESTDATE1);
 		try {
-			int theSeconds = theDate.getSeconds();
+			theDate.getSeconds();
             fail("Should throw IllegalArgumentException.");
 		} catch (IllegalArgumentException ie) {
             //expected
@@ -182,7 +186,8 @@
 	 * Test of the (deprecated) Date.setHours( int ) method - which always
 	 * throws an IllegalArgumentException
 	 */
-	public void testSetHours() {
+	@SuppressWarnings("deprecation")
+    public void testSetHours() {
 		Date theDate = new Date(TIME_TESTDATE1);
 		try {
 			theDate.setHours(22);
@@ -196,7 +201,8 @@
 	 * Test of the (deprecated) Date.setMinutes( int ) method - which always
 	 * throws an IllegalArgumentException
 	 */
-	public void testSetMinutes() {
+	@SuppressWarnings("deprecation")
+    public void testSetMinutes() {
 		Date theDate = new Date(TIME_TESTDATE1);
 		try {
 			theDate.setMinutes(54);
@@ -211,7 +217,8 @@
 	 * Test of the (deprecated) Date.setSeconds( int ) method - which always
 	 * throws an IllegalArgumentException
 	 */
-	public void testSetSeconds() {
+	@SuppressWarnings("deprecation")
+    public void testSetSeconds() {
 		Date theDate = new Date(TIME_TESTDATE1);
 		try {
 			theDate.setSeconds(36);
@@ -284,16 +291,14 @@
 
 		Date theDate;
 
-		// Cases where the input date string is a valid format
-		for (int i = 0; i < SQL_DATEARRAY.length; i++) {
-			theDate = Date.valueOf(SQL_DATEARRAY[i]);
-            assertEquals(SQL_DATEARRAY[i], theDate.toString());
+		for (String element : SQL_DATEARRAY) {
+			theDate = Date.valueOf(element);
+            assertEquals(element, theDate.toString());
 		} // end for
 
-		// Cases where the input date string has an invalid format
-		for (int i = 0; i < SQL_INVALIDARRAY.length; i++) {
+		for (String element : SQL_INVALIDARRAY) {
 			try {
-				theDate = Date.valueOf(SQL_INVALIDARRAY[i]);
+				theDate = Date.valueOf(element);
                 fail("Should throw IllegalArgumentException.");
 			} catch (IllegalArgumentException e) {
                 //expected

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DriverManagerTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DriverManagerTest.java?view=diff&rev=470671&r1=470670&r2=470671
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DriverManagerTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DriverManagerTest.java Thu Nov  2 20:56:30 2006
@@ -66,7 +66,8 @@
 	// Static initializer to load the drivers so that they are available to all
 	// the
 	// test methods as needed.
-	public void setUp() {
+	@Override
+    public void setUp() {
 		numberLoaded = loadDrivers();
 	} // end setUp()
 
@@ -98,9 +99,8 @@
 		// TODO - need to load a driver with a different classloader!!
 		aDriver = DriverManager.getDriver(baseURL1);
 
-		TestHelper_DriverManager testHelper;
 		try {
-			Class driverClass = Class.forName(
+			Class<?> driverClass = Class.forName(
 					"org.apache.harmony.sql.tests.java.sql.TestHelper_DriverManager", true,
 					testClassLoader);
 
@@ -125,17 +125,18 @@
 	} // end method testDeregisterDriver()
 
 	static void printClassLoader(Object theObject) {
-		Class theClass = theObject.getClass();
+		Class<? extends Object> theClass = theObject.getClass();
 		ClassLoader theClassLoader = theClass.getClassLoader();
 		System.out.println("ClassLoader is: " + theClassLoader.toString()
 				+ " for object: " + theObject.toString());
 	} // end method printClassLoader( Object )
 
 	static boolean isDriverLoaded(Driver theDriver) {
-		Enumeration driverList = DriverManager.getDrivers();
+		Enumeration<?> driverList = DriverManager.getDrivers();
 		while (driverList.hasMoreElements()) {
-			if ((Driver) driverList.nextElement() == theDriver)
-				return true;
+			if ((Driver) driverList.nextElement() == theDriver) {
+                return true;
+            }
 		} // end while
 		return false;
 	} // end method isDriverLoaded( Driver )
@@ -164,11 +165,10 @@
 		theConnection = DriverManager.getConnection(validConnectionURL);
 		assertNotNull(theConnection);
 
-		// invalid connections
-		for (int i = 0; i < invalidConnectionURLs.length; i++) {
+		for (String element : invalidConnectionURLs) {
 			try {
 				theConnection = DriverManager
-						.getConnection(invalidConnectionURLs[i]);
+						.getConnection(element);
 				fail("Should throw SQLException");
 			} catch (SQLException e) {
                 //expected
@@ -264,10 +264,8 @@
                 validpassword1);
         assertNotNull(theConnection);
 
-		// invalid Connections
-		for (int i = 0; i < invalid.length; i++) {
+		for (String[] theData : invalid) {
 			theConnection = null;
-			String[] theData = invalid[i];
 			try {
 				theConnection = DriverManager.getConnection(theData[0],
 						theData[1], theData[2]);
@@ -293,15 +291,14 @@
 	static String exceptionMsg1 = "No suitable driver";
 
 	public void testGetDriver() throws SQLException {
-		// valid URLs
-		for (int i = 0; i < validURLs.length; i++) {
-            Driver validDriver = DriverManager.getDriver(validURLs[i]);
+		for (String element : validURLs) {
+            Driver validDriver = DriverManager.getDriver(element);
+            assertNotNull(validDriver);
         } // end for
 
-		// invalid URLs
-		for (int i = 0; i < invalidURLs.length; i++) {
+		for (String element : invalidURLs) {
 			try {
-				Driver invalidDriver = DriverManager.getDriver(invalidURLs[i]);
+				DriverManager.getDriver(element);
                 fail("Should throw SQLException");
 			} catch (SQLException e) {
                 assertEquals("08001", e.getSQLState());
@@ -313,10 +310,11 @@
 
 	public void testGetDrivers() {
 		// Load a driver manager
-		Enumeration driverList = DriverManager.getDrivers();
+		Enumeration<Driver> driverList = DriverManager.getDrivers();
 		int i = 0;
 		while (driverList.hasMoreElements()) {
-			Driver theDriver = (Driver) driverList.nextElement();
+			Driver theDriver = driverList.nextElement();
+            assertNotNull(theDriver);
 			i++;
 		} // end while
 
@@ -334,7 +332,8 @@
 		assertEquals(timeout1, DriverManager.getLoginTimeout());
 	} // end method testGetLoginTimeout()
 
-	public void testGetLogStream() {
+	@SuppressWarnings("deprecation")
+    public void testGetLogStream() {
 		assertNull(DriverManager.getLogStream());
 
 		DriverManager.setLogStream(testPrintStream);
@@ -355,7 +354,8 @@
 
 	static String testMessage = "DriverManagerTest: test message for print stream";
 
-	public void testPrintln() {
+	@SuppressWarnings("deprecation")
+    public void testPrintln() {
 		// System.out.println("testPrintln");
 		DriverManager.println(testMessage);
 
@@ -391,7 +391,7 @@
 
         Driver theDriver = null;
         // Load another Driver that isn't in the basic set
-        Class driverClass = Class.forName(EXTRA_DRIVER_NAME);
+        Class<?> driverClass = Class.forName(EXTRA_DRIVER_NAME);
         theDriver = (Driver) driverClass.newInstance();
         DriverManager.registerDriver(theDriver);
 
@@ -409,11 +409,10 @@
 	static int invalidTimeout1 = -10;
 
 	public void testSetLoginTimeout() {
-		// Valid timeouts
-		for (int i = 0; i < validTimeouts.length; i++) {
-			DriverManager.setLoginTimeout(validTimeouts[i]);
+		for (int element : validTimeouts) {
+			DriverManager.setLoginTimeout(element);
 
-			assertEquals(validTimeouts[i], DriverManager.getLoginTimeout());
+			assertEquals(element, DriverManager.getLoginTimeout());
 		} // end for
 		// Invalid timeouts
 		DriverManager.setLoginTimeout(invalidTimeout1);
@@ -424,7 +423,8 @@
 
 	static PrintStream testPrintStream = new PrintStream(outputStream2);
 
-	public void testSetLogStream() {
+	@SuppressWarnings("deprecation")
+    public void testSetLogStream() {
 		// System.out.println("testSetLogStream");
 		DriverManager.setLogStream(testPrintStream);
 
@@ -500,8 +500,9 @@
 	static boolean driversLoaded = false;
 
 	private static int loadDrivers() {
-		if (driversLoaded)
-			return numberLoaded;
+		if (driversLoaded) {
+            return numberLoaded;
+        }
 		/*
 		 * First define a value for the System property "jdbc.drivers" - before
 		 * the DriverManager class is loaded - this property defines a set of
@@ -516,18 +517,16 @@
 		System.setProperty(JDBC_PROPERTY, theSystemDrivers);
 		numberLoaded += 2;
 
-		/*
-		 * Next, dynamically load a set of drivers
-		 */
-		for (int i = 0; i < driverNames.length; i++) {
+		for (String element : driverNames) {
 			try {
-				Class driverClass = Class.forName(driverNames[i]);
+				Class<?> driverClass = Class.forName(element);
+                assertNotNull(driverClass);
 				// System.out.println("Loaded driver - classloader = " +
 				// driverClass.getClassLoader());
 				numberLoaded++;
 			} catch (ClassNotFoundException e) {
 				System.out.println("DriverManagerTest: failed to load Driver: "
-						+ driverNames[i]);
+						+ element);
 			} // end try
 		} // end for
 		/*
@@ -555,7 +554,8 @@
 			logAccess = allow;
 		} // end method setLogAccess( boolean )
 
-		public void checkPermission(Permission thePermission) {
+		@Override
+        public void checkPermission(Permission thePermission) {
 			if (thePermission.equals(sqlPermission)) {
 				if (!logAccess) {
 					throw new SecurityException("Cannot set the sql Log Writer");

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ParameterMetaDataTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ParameterMetaDataTest.java?view=diff&rev=470671&r1=470670&r2=470671
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ParameterMetaDataTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ParameterMetaDataTest.java Thu Nov  2 20:56:30 2006
@@ -30,7 +30,7 @@
 	 */
 	public void testPublicStatics() {
 
-		HashMap thePublicStatics = new HashMap();
+		HashMap<String, Integer> thePublicStatics = new HashMap<String, Integer>();
 		thePublicStatics.put("parameterModeOut", new Integer(4));
 		thePublicStatics.put("parameterModeInOut", new Integer(2));
 		thePublicStatics.put("parameterModeIn", new Integer(1));
@@ -53,7 +53,7 @@
 		 * ParameterMetaData.parameterNoNulls );
 		 */
 
-		Class parameterMetaDataClass;
+		Class<?> parameterMetaDataClass;
 		try {
 			parameterMetaDataClass = Class
 					.forName("java.sql.ParameterMetaData");
@@ -67,12 +67,12 @@
 				+ Modifier.FINAL;
 
 		int countPublicStatics = 0;
-		for (int i = 0; i < theFields.length; i++) {
-			String fieldName = theFields[i].getName();
-			int theMods = theFields[i].getModifiers();
+		for (Field element : theFields) {
+			String fieldName = element.getName();
+			int theMods = element.getModifiers();
 			if (Modifier.isPublic(theMods) && Modifier.isStatic(theMods)) {
 				try {
-					Object fieldValue = theFields[i].get(null);
+					Object fieldValue = element.get(null);
 					Object expectedValue = thePublicStatics.get(fieldName);
 					if (expectedValue == null) {
 						fail("Field " + fieldName + " missing!");

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ResultSetMetaDataTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ResultSetMetaDataTest.java?view=diff&rev=470671&r1=470670&r2=470671
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ResultSetMetaDataTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ResultSetMetaDataTest.java Thu Nov  2 20:56:30 2006
@@ -30,7 +30,7 @@
 	 */
 	public void testPublicStatics() {
 
-		HashMap thePublicStatics = new HashMap();
+		HashMap<String, Integer> thePublicStatics = new HashMap<String, Integer>();
 		thePublicStatics.put("columnNullableUnknown", new Integer(2));
 		thePublicStatics.put("columnNullable", new Integer(1));
 		thePublicStatics.put("columnNoNulls", new Integer(0));
@@ -43,7 +43,7 @@
 		 * ResultSetMetaData.columnNoNulls );
 		 */
 
-		Class resultSetMetaDataClass;
+		Class<?> resultSetMetaDataClass;
 		try {
 			resultSetMetaDataClass = Class
 					.forName("java.sql.ResultSetMetaData");
@@ -57,12 +57,12 @@
 				+ Modifier.FINAL;
 
 		int countPublicStatics = 0;
-		for (int i = 0; i < theFields.length; i++) {
-			String fieldName = theFields[i].getName();
-			int theMods = theFields[i].getModifiers();
+		for (Field element : theFields) {
+			String fieldName = element.getName();
+			int theMods = element.getModifiers();
 			if (Modifier.isPublic(theMods) && Modifier.isStatic(theMods)) {
 				try {
-					Object fieldValue = theFields[i].get(null);
+					Object fieldValue = element.get(null);
 					Object expectedValue = thePublicStatics.get(fieldName);
 					if (expectedValue == null) {
 						fail("Field " + fieldName + " missing!");

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ResultSetTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ResultSetTest.java?view=diff&rev=470671&r1=470670&r2=470671
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ResultSetTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ResultSetTest.java Thu Nov  2 20:56:30 2006
@@ -30,7 +30,7 @@
 	 */
 	public void testPublicStatics() {
 
-		HashMap thePublicStatics = new HashMap();
+		HashMap<String, Integer> thePublicStatics = new HashMap<String, Integer>();
 		thePublicStatics.put("CLOSE_CURSORS_AT_COMMIT",
 				new java.lang.Integer(2));
 		thePublicStatics.put("HOLD_CURSORS_OVER_COMMIT", new java.lang.Integer(
@@ -62,7 +62,7 @@
 		 * ResultSet.FETCH_FORWARD );
 		 */
 
-		Class resultSetClass;
+		Class<?> resultSetClass;
 		try {
 			resultSetClass = Class.forName("java.sql.ResultSet");
 		} catch (ClassNotFoundException e) {
@@ -75,12 +75,12 @@
 				+ Modifier.FINAL;
 
 		int countPublicStatics = 0;
-		for (int i = 0; i < theFields.length; i++) {
-			String fieldName = theFields[i].getName();
-			int theMods = theFields[i].getModifiers();
+		for (Field element : theFields) {
+			String fieldName = element.getName();
+			int theMods = element.getModifiers();
 			if (Modifier.isPublic(theMods) && Modifier.isStatic(theMods)) {
 				try {
-					Object fieldValue = theFields[i].get(null);
+					Object fieldValue = element.get(null);
 					Object expectedValue = thePublicStatics.get(fieldName);
 					if (expectedValue == null) {
 						fail("Field " + fieldName + " missing!");

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/SQLExceptionTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/SQLExceptionTest.java?view=diff&rev=470671&r1=470670&r2=470671
==============================================================================
Binary files /tmp/tmpk4jEEy and /tmp/tmpeE6k2c differ

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/SQLWarningTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/SQLWarningTest.java?view=diff&rev=470671&r1=470670&r2=470671
==============================================================================
Binary files /tmp/tmpFRtmKc and /tmp/tmpd0-t2w differ

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/StatementTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/StatementTest.java?view=diff&rev=470671&r1=470670&r2=470671
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/StatementTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/StatementTest.java Thu Nov  2 20:56:30 2006
@@ -30,7 +30,7 @@
 	 */
 	public void testPublicStatics() {
 
-		HashMap thePublicStatics = new HashMap();
+		HashMap<String, Integer> thePublicStatics = new HashMap<String, Integer>();
 		thePublicStatics.put("NO_GENERATED_KEYS", new Integer(2));
 		thePublicStatics.put("RETURN_GENERATED_KEYS", new Integer(1));
 		thePublicStatics.put("EXECUTE_FAILED", new Integer(-3));
@@ -52,7 +52,7 @@
 		 * Statement.CLOSE_CURRENT_RESULT );
 		 */
 
-		Class statementClass;
+		Class<?> statementClass;
 		try {
 			statementClass = Class.forName("java.sql.Statement");
 		} catch (ClassNotFoundException e) {
@@ -65,12 +65,12 @@
 				+ Modifier.FINAL;
 
 		int countPublicStatics = 0;
-		for (int i = 0; i < theFields.length; i++) {
-			String fieldName = theFields[i].getName();
-			int theMods = theFields[i].getModifiers();
+		for (Field element : theFields) {
+			String fieldName = element.getName();
+			int theMods = element.getModifiers();
 			if (Modifier.isPublic(theMods) && Modifier.isStatic(theMods)) {
 				try {
-					Object fieldValue = theFields[i].get(null);
+					Object fieldValue = element.get(null);
 					Object expectedValue = thePublicStatics.get(fieldName);
 					if (expectedValue == null) {
 						fail("Field " + fieldName + " missing!");

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TestHelper_ClassLoader.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TestHelper_ClassLoader.java?view=diff&rev=470671&r1=470670&r2=470671
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TestHelper_ClassLoader.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TestHelper_ClassLoader.java Thu Nov  2 20:56:30 2006
@@ -45,11 +45,13 @@
 	 * This classloader makes the assumption that any class it is asked to load
 	 * is in the current directory....
 	 */
-	public Class findClass(String className) throws ClassNotFoundException {
-		Class theClass = null;
-
-		if (!className.equals("org.apache.harmony.sql.tests.java.sql.TestHelper_DriverManager"))
-			return null;
+	@Override
+    public Class<?> findClass(String className) throws ClassNotFoundException {
+		Class<?> theClass = null;
+
+		if (!className.equals("org.apache.harmony.sql.tests.java.sql.TestHelper_DriverManager")) {
+            return null;
+        }
 
 		String classNameAsFile = className.replace('.', '/') + ".class";
 		// System.out.println("findClass - class filename = " + classNameAsFile
@@ -74,24 +76,26 @@
 		return theClass;
 	} // end method findClass( String )
 
-	public Class loadClass(String className) throws ClassNotFoundException {
+	@Override
+    public Class<?> loadClass(String className) throws ClassNotFoundException {
 		// Allowed classes:
 		String[] disallowedClasses = { "org.apache.harmony.sql.tests.java.sql.TestHelper_Driver1",
 				"org.apache.harmony.sql.tests.java.sql.TestHelper_Driver2",
 				"org.apache.harmony.sql.tests.java.sql.TestHelper_Driver4",
 				"org.apache.harmony.sql.tests.java.sql.TestHelper_Driver5" };
 
-		Class theClass;
+		Class<?> theClass;
 
 		theClass = findLoadedClass(className);
-		if (theClass != null)
-			return theClass;
+		if (theClass != null) {
+            return theClass;
+        }
 
 		theClass = this.findClass(className);
 
 		if (theClass == null) {
-			for (int i = 0; i < disallowedClasses.length; i++) {
-				if (disallowedClasses[i].equals(className)) {
+			for (String element : disallowedClasses) {
+				if (element.equals(className)) {
 					return null;
 				} // end if
 			} // end for
@@ -101,9 +105,9 @@
 		return theClass;
 	} // end method loadClass( String )
 
-	private Class loadClassFromFile(String pathName, String className,
+	private Class<?> loadClassFromFile(String pathName, String className,
 			String classNameAsFile) {
-		Class theClass = null;
+		Class<?> theClass = null;
 		FileInputStream theInput = null;
 		File theFile = null;
 		try {
@@ -116,8 +120,9 @@
 				while (dataRead < length) {
 					int count = theInput.read(theBytes, dataRead,
 							theBytes.length - dataRead);
-					if (count == -1)
-						break;
+					if (count == -1) {
+                        break;
+                    }
 					dataRead += count;
 				}
 
@@ -135,8 +140,9 @@
 			e.printStackTrace();
 		} finally {
 			try {
-				if (theInput != null)
-					theInput.close();
+				if (theInput != null) {
+                    theInput.close();
+                }
 			} catch (Exception e) {
 			}
 		}
@@ -146,9 +152,9 @@
 	/*
 	 * Loads a named class from a specified JAR file
 	 */
-	private Class loadClassFromJar(String jarfileName, String className,
+	private Class<?> loadClassFromJar(String jarfileName, String className,
 			String classNameAsFile) {
-		Class theClass = null;
+		Class<?> theClass = null;
 
 		// First, try to open the Jar file
 		JarFile theJar = null;
@@ -166,16 +172,18 @@
 			InputStream theStream = theJar.getInputStream(theEntry);
 
 			long size = theEntry.getSize();
-			if (size < 0)
-				size = 100000;
+			if (size < 0) {
+                size = 100000;
+            }
 			byte[] theBytes = new byte[(int) size + 100];
 
 			int dataRead = 0;
 			while (dataRead < size) {
 				int count = theStream.read(theBytes, dataRead, theBytes.length
 						- dataRead);
-				if (count == -1)
-					break;
+				if (count == -1) {
+                    break;
+                }
 				dataRead += count;
 			} // end while
 
@@ -206,8 +214,9 @@
 					.println("TestHelper_ClassLoader: ClassFormatException loading class from Jar ");
 		} finally {
 			try {
-				if (theJar != null)
-					theJar.close();
+				if (theJar != null) {
+                    theJar.close();
+                }
 			} catch (Exception e) {
 			} // end try
 		} // end try

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TestHelper_Driver1.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TestHelper_Driver1.java?view=diff&rev=470671&r1=470670&r2=470671
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TestHelper_Driver1.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TestHelper_Driver1.java Thu Nov  2 20:56:30 2006
@@ -67,12 +67,14 @@
 	 */
 	public boolean acceptsURL(String url) throws SQLException {
 		// Check on the supplied String...
-		if (url == null)
-			return false;
+		if (url == null) {
+            return false;
+        }
 		// Everything's fine if the quoted url starts with the base url for this
 		// driver
-		if (url.startsWith(baseURL))
-			return true;
+		if (url.startsWith(baseURL)) {
+            return true;
+        }
 		return false;
 	} // end method acceptsURL
 
@@ -94,9 +96,8 @@
 		if (this.acceptsURL(url)) {
 			// The datasource name is the remainder of the url after the ":"
 			String datasource = url.substring(baseURL.length() + 1);
-			// Loop over the valid datasources supported by this driver
-			for (int i = 0; i < dataSources.length; i++) {
-				if (datasource.equals(dataSources[i])) {
+			for (String element : dataSources) {
+				if (datasource.equals(element)) {
 					// Check for user and password, except for datasource =
 					// data1
 					// which is set up not to require a user/password
@@ -104,8 +105,9 @@
 					if (datasource.equals("data1")) {
 						// do nothing...
 					} else {
-						if (info == null)
-							throw new SQLException("Properties bundle is null");
+						if (info == null) {
+                            throw new SQLException("Properties bundle is null");
+                        }
 						String user = (String) info.get(userProperty);
 						String password = (String) info.get(passwordProperty);
 						if (user == null || password == null) {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TestHelper_Driver4.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TestHelper_Driver4.java?view=diff&rev=470671&r1=470670&r2=470671
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TestHelper_Driver4.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TestHelper_Driver4.java Thu Nov  2 20:56:30 2006
@@ -60,12 +60,14 @@
 	 */
 	public boolean acceptsURL(String url) throws SQLException {
 		// Check on the supplied String...
-		if (url == null)
-			return false;
+		if (url == null) {
+            return false;
+        }
 		// Everything's fine if the quoted url starts with the base url for this
 		// driver
-		if (url.startsWith(baseURL))
-			return true;
+		if (url.startsWith(baseURL)) {
+            return true;
+        }
 		return false;
 	} // end method acceptsURL
 
@@ -87,9 +89,8 @@
 		if (this.acceptsURL(url)) {
 			// The datasource name is the remainder of the url after the ":"
 			String datasource = url.substring(baseURL.length() + 1);
-			// Loop over the valid datasources supported by this driver
-			for (int i = 0; i < dataSources.length; i++) {
-				if (datasource.equals(dataSources[i])) {
+			for (String element : dataSources) {
+				if (datasource.equals(element)) {
 					// Check for user and password, except for datasource =
 					// data1
 					// which is set up not to require a user/password
@@ -97,8 +98,9 @@
 					if (datasource.equals("data1")) {
 						// do nothing...
 					} else {
-						if (info == null)
-							throw new SQLException("Properties bundle is null");
+						if (info == null) {
+                            throw new SQLException("Properties bundle is null");
+                        }
 						String user = (String) info.get(userProperty);
 						String password = (String) info.get(passwordProperty);
 						if (user == null || password == null) {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TestHelper_DriverManager.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TestHelper_DriverManager.java?view=diff&rev=470671&r1=470670&r2=470671
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TestHelper_DriverManager.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TestHelper_DriverManager.java Thu Nov  2 20:56:30 2006
@@ -103,7 +103,7 @@
 	} // end method testDeRegister
 
 	static void printClassLoader(Object theObject) {
-		Class theClass = theObject.getClass();
+		Class<? extends Object> theClass = theObject.getClass();
 		ClassLoader theClassLoader = theClass.getClassLoader();
 		System.out.println("ClassLoader is: " + theClassLoader.toString()
 				+ " for object: " + theObject.toString());

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TimeTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TimeTest.java?view=diff&rev=470671&r1=470670&r2=470671
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TimeTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TimeTest.java Thu Nov  2 20:56:30 2006
@@ -72,7 +72,8 @@
 	static String[][] STRING_ARRAYS = { STRING_GMT_ARRAY, STRING_LA_ARRAY,
 			STRING_JP_ARRAY };
 
-	public void testTimeintintint() {
+	@SuppressWarnings("deprecation")
+    public void testTimeintintint() {
 		Time theTime = new Time(10, 45, 20);
 
 		// The date should have been created
@@ -98,8 +99,6 @@
 			String[] theTimeStrings) {
 		// Set the timezone
 		TimeZone.setDefault(TimeZone.getTimeZone(timeZone));
-		String theTimeZoneName = TimeZone.getDefault().getDisplayName();
-		/* System.out.println("testToString: Timezone is: " + theTimeZoneName ); */
 
 		for (int i = 0; i < theTimes.length; i++) {
 			// Create the Time object
@@ -128,9 +127,9 @@
 				assertEquals(theReturns[i], theReturn);
 		} // end for
 		
-        for (int i = 0; i < invalidTime.length; i++) {
+        for (String element : invalidTime) {
             try {
-                Time theReturn = Time.valueOf(invalidTime[i]);
+                Time.valueOf(element);
                 fail("Should throw IllegalArgumentException");
             } catch (IllegalArgumentException e) {
                 //expected
@@ -150,7 +149,8 @@
         assertEquals(STRING_TEST2, theTime.toString());
 	} // end method testSetTime()
 
-	public void testSetDate() {
+	@SuppressWarnings("deprecation")
+    public void testSetDate() {
 		Time theTime = new Time(TIME_TEST1);
 
 		try {
@@ -161,7 +161,8 @@
 		} // end try
 	} // end method testSetDate()
 
-	public void testSetMonth() {
+	@SuppressWarnings("deprecation")
+    public void testSetMonth() {
 		Time theTime = new Time(TIME_TEST1);
 
 		try {
@@ -172,7 +173,8 @@
 		} // end try
 	} // end method testSetMonth()
 
-	public void testSetYear() {
+	@SuppressWarnings("deprecation")
+    public void testSetYear() {
 		Time theTime = new Time(TIME_TEST1);
 
 		try {
@@ -183,44 +185,48 @@
 		} // end try
 	} // end method testSetYear()
 
-	public void testGetDate() {
+	@SuppressWarnings("deprecation")
+    public void testGetDate() {
 		Time theTime = new Time(TIME_TEST1);
 
 		try {
-			int theDate = theTime.getDate();
+			theTime.getDate();
             fail("Should throw IllegalArgumentException.");
 		} catch (IllegalArgumentException e) {
             //expected
 		} // end try
 	} // end method test
 
-	public void testGetDay() {
+	@SuppressWarnings("deprecation")
+    public void testGetDay() {
 		Time theTime = new Time(TIME_TEST1);
 
 		try {
-			int theDay = theTime.getDay();
+			theTime.getDay();
             fail("Should throw IllegalArgumentException.");
 		} catch (IllegalArgumentException e) {
             //expected
 		} // end try
 	} // end method test
 
-	public void testGetMonth() {
+	@SuppressWarnings("deprecation")
+    public void testGetMonth() {
 		Time theTime = new Time(TIME_TEST1);
 
 		try {
-			int theDate = theTime.getMonth();
+			theTime.getMonth();
             fail("Should throw IllegalArgumentException.");
 		} catch (IllegalArgumentException e) {
 		    //expected
 		} // end try
 	} // end method test
 
-	public void testGetYear() {
+	@SuppressWarnings("deprecation")
+    public void testGetYear() {
 		Time theTime = new Time(TIME_TEST1);
 
 		try {
-			int theDate = theTime.getYear();
+			theTime.getYear();
             fail("Should throw IllegalArgumentException.");
 		} catch (IllegalArgumentException e) {
 		    //expected

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TimestampTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TimestampTest.java?view=diff&rev=470671&r1=470670&r2=470671
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TimestampTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TimestampTest.java Thu Nov  2 20:56:30 2006
@@ -119,7 +119,8 @@
 	/*
 	 * Constructor test
 	 */
-	public void testTimestampintintintintintintint() {
+	@SuppressWarnings("deprecation")
+    public void testTimestampintintintintintintint() {
 		int[][] valid = { { 99, 2, 14, 17, 52, 3, 213577212 }, // 0 valid
 				{ 0, 0, 1, 0, 0, 0, 0 }, // 1 valid
 				{ 106, 11, 31, 23, 59, 59, 999999999 }, // 2 valid
@@ -143,10 +144,10 @@
 														// negative
 		};
 
-		for (int i = 0; i < valid.length; i++) {
-            Timestamp theTimestamp = new Timestamp(valid[i][0],
-                    valid[i][1], valid[i][2], valid[i][3],
-                    valid[i][4], valid[i][5], valid[i][6]);
+		for (int[] element : valid) {
+            Timestamp theTimestamp = new Timestamp(element[0],
+                    element[1], element[2], element[3],
+                    element[4], element[5], element[6]);
             assertNotNull("Timestamp not generated: ", theTimestamp);
         } // end for
         
@@ -154,11 +155,11 @@
                 { 106, 11, 31, 23, 59, 59, 1999999999 }, 
                 { 106, 11, 31, 23, 59, 59, -999999999 },
         };
-        for (int i = 0; i < invalid.length; i++) {
+        for (int[] element : invalid) {
             try {
-                Timestamp theTimestamp = new Timestamp(invalid[i][0],
-                        invalid[i][1], invalid[i][2], invalid[i][3],
-                        invalid[i][4], invalid[i][5], invalid[i][6]);
+                new Timestamp(element[0],
+                        element[1], element[2], element[3],
+                        element[4], element[5], element[6]);
                 fail("Should throw IllegalArgumentException");
             } catch (IllegalArgumentException e) {
                 // expected
@@ -192,9 +193,9 @@
 		// First set the timezone to GMT
 		TimeZone.setDefault(TimeZone.getTimeZone("GMT"));
 
-		for (int i = 0; i < TIME_ARRAY.length; i++) {
-			Timestamp theTimestamp = new Timestamp(TIME_ARRAY[i]);
-            assertEquals(TIME_ARRAY[i], theTimestamp.getTime());
+		for (long element : TIME_ARRAY) {
+			Timestamp theTimestamp = new Timestamp(element);
+            assertEquals(element, theTimestamp.getTime());
 		} // end for
 
 	} // end method testgetTime
@@ -202,7 +203,8 @@
 	/*
 	 * Method test for getYear
 	 */
-	public void testGetYear() {
+	@SuppressWarnings("deprecation")
+    public void testGetYear() {
 		for (int i = 0; i < TIME_ARRAY.length; i++) {
 			Timestamp theTimestamp = new Timestamp(TIME_ARRAY[i]);
             assertEquals(YEAR_ARRAY[i], theTimestamp.getYear());
@@ -213,7 +215,8 @@
 	/*
 	 * Method test for getMonth
 	 */
-	public void testGetMonth() {
+	@SuppressWarnings("deprecation")
+    public void testGetMonth() {
 		for (int i = 0; i < TIME_ARRAY.length; i++) {
 			Timestamp theTimestamp = new Timestamp(TIME_ARRAY[i]);
             assertEquals(MONTH_ARRAY[i], theTimestamp.getMonth());
@@ -224,7 +227,8 @@
 	/*
 	 * Method test for getDate
 	 */
-	public void testGetDate() {
+	@SuppressWarnings("deprecation")
+    public void testGetDate() {
 		for (int i = 0; i < TIME_ARRAY.length; i++) {
 			Timestamp theTimestamp = new Timestamp(TIME_ARRAY[i]);
             assertEquals(DATE_ARRAY[i], theTimestamp.getDate());
@@ -235,7 +239,8 @@
 	/*
 	 * Method test for getHours
 	 */
-	public void testGetHours() {
+	@SuppressWarnings("deprecation")
+    public void testGetHours() {
 		for (int i = 0; i < TIME_ARRAY.length; i++) {
 			Timestamp theTimestamp = new Timestamp(TIME_ARRAY[i]);
             assertEquals(HOURS_ARRAY[i], theTimestamp.getHours());
@@ -246,7 +251,8 @@
 	/*
 	 * Method test for getMinutes
 	 */
-	public void testGetMinutes() {
+	@SuppressWarnings("deprecation")
+    public void testGetMinutes() {
 		for (int i = 0; i < TIME_ARRAY.length; i++) {
 			Timestamp theTimestamp = new Timestamp(TIME_ARRAY[i]);
             assertEquals(MINUTES_ARRAY[i], theTimestamp.getMinutes());
@@ -257,7 +263,8 @@
 	/*
 	 * Method test for getSeconds
 	 */
-	public void testGetSeconds() {
+	@SuppressWarnings("deprecation")
+    public void testGetSeconds() {
 		for (int i = 0; i < TIME_ARRAY.length; i++) {
 			Timestamp theTimestamp = new Timestamp(TIME_ARRAY[i]);
             assertEquals(SECONDS_ARRAY[i], theTimestamp.getSeconds());
@@ -280,15 +287,15 @@
 		// Test for a string in correct format but with number values out of
 		// range
 		Timestamp theTimestamp = Timestamp.valueOf(STRING_OUTRANGE);
+        assertNotNull(theTimestamp);
 		/*
 		 * System.out.println("testValueOfString: outrange timestamp: " +
 		 * theTimestamp.toString() );
 		 */
 
-		// Now test some truly invalid strings that should cause exceptions
-		for (int i = 0; i < INVALID_STRINGS.length; i++) {
+		for (String element : INVALID_STRINGS) {
 			try {
-				Timestamp theTimestamp2 = Timestamp.valueOf(INVALID_STRINGS[i]);
+				Timestamp.valueOf(element);
 				fail("Should throw IllegalArgumentException.");
 			} catch (IllegalArgumentException e) {
                 //expected
@@ -304,7 +311,6 @@
 	public void testValueOfString1() {
 
 		Timestamp theReturn;
-		Timestamp[] theReturns = {};
 		long[] theReturnTime = { 38720231, 38720231, 80279000, -38720691,
 				38720000};
 		int[] theReturnNanos = { 231000000, 231987654, 0, 309000000, 0,};
@@ -333,9 +339,9 @@
 				assertEquals(theReturnNanos[i], theReturn.getNanos());
 		} // end for
 
-        for (int i = 0; i < invalid.length; i++) {
+        for (String element : invalid) {
             try {
-                theReturn = Timestamp.valueOf(invalid[i]);
+                theReturn = Timestamp.valueOf(element);
                 fail("Should throw IllegalArgumentException.");
             } catch (IllegalArgumentException e) {
                 //expected
@@ -402,17 +408,17 @@
 	 * Method test for equals
 	 */
 	public void testEqualsTimestamp() {
-		for (int i = 0; i < TIME_ARRAY.length; i++) {
-			Timestamp theTimestamp = new Timestamp(TIME_ARRAY[i]);
-			Timestamp theTimestamp2 = new Timestamp(TIME_ARRAY[i]);
+		for (long element : TIME_ARRAY) {
+			Timestamp theTimestamp = new Timestamp(element);
+			Timestamp theTimestamp2 = new Timestamp(element);
 
 			assertTrue(theTimestamp.equals(theTimestamp2));
 		} // end for
 
 		Timestamp theTest = new Timestamp(TIME_COMPARE);
 
-		for (int i = 0; i < TIME_ARRAY.length; i++) {
-			Timestamp theTimestamp = new Timestamp(TIME_ARRAY[i]);
+		for (long element : TIME_ARRAY) {
+			Timestamp theTimestamp = new Timestamp(element);
 			assertFalse(theTimestamp.equals(theTest));
 		} // end for
         
@@ -424,18 +430,18 @@
 	 * Method test for equals
 	 */
 	public void testEqualsObject() {
-		for (int i = 0; i < TIME_ARRAY.length; i++) {
-			Timestamp theTimestamp = new Timestamp(TIME_ARRAY[i]);
+		for (long element : TIME_ARRAY) {
+			Timestamp theTimestamp = new Timestamp(element);
 
-			Object theTimestamp2 = new Timestamp(TIME_ARRAY[i]);
+			Object theTimestamp2 = new Timestamp(element);
 
 			assertTrue(theTimestamp.equals(theTimestamp2));
 		} // end for
 
 		Object theTest = new Timestamp(TIME_COMPARE);
 
-		for (int i = 0; i < TIME_ARRAY.length; i++) {
-			Timestamp theTimestamp = new Timestamp(TIME_ARRAY[i]);
+		for (long element : TIME_ARRAY) {
+			Timestamp theTimestamp = new Timestamp(element);
 
 			assertFalse(theTimestamp.equals(theTest));
 		} // end for
@@ -454,23 +460,23 @@
 	public void testBeforeTimestamp() {
 		Timestamp theTest = new Timestamp(TIME_LATE);
 
-		for (int i = 0; i < TIME_ARRAY.length; i++) {
-			Timestamp theTimestamp = new Timestamp(TIME_ARRAY[i]);
+		for (long element : TIME_ARRAY) {
+			Timestamp theTimestamp = new Timestamp(element);
 
 			assertTrue(theTimestamp.before(theTest));
 		} // end for
 
 		theTest = new Timestamp(TIME_EARLY);
 
-		for (int i = 0; i < TIME_ARRAY.length; i++) {
-			Timestamp theTimestamp = new Timestamp(TIME_ARRAY[i]);
+		for (long element : TIME_ARRAY) {
+			Timestamp theTimestamp = new Timestamp(element);
 
 			assertFalse(theTimestamp.before(theTest));
 		} // end for
 
-		for (int i = 0; i < TIME_ARRAY.length; i++) {
-			theTest = new Timestamp(TIME_ARRAY[i]);
-			Timestamp theTimestamp = new Timestamp(TIME_ARRAY[i]);
+		for (long element : TIME_ARRAY) {
+			theTest = new Timestamp(element);
+			Timestamp theTimestamp = new Timestamp(element);
 
 			assertFalse(theTimestamp.before(theTest));
 			theTest.setNanos(theTest.getNanos() + 1);
@@ -485,23 +491,23 @@
 	public void testAfterTimestamp() {
 		Timestamp theTest = new Timestamp(TIME_LATE);
 
-		for (int i = 0; i < TIME_ARRAY.length; i++) {
-			Timestamp theTimestamp = new Timestamp(TIME_ARRAY[i]);
+		for (long element : TIME_ARRAY) {
+			Timestamp theTimestamp = new Timestamp(element);
 
 			assertFalse(theTimestamp.after(theTest));
 		} // end for
 
 		theTest = new Timestamp(TIME_EARLY);
 
-		for (int i = 0; i < TIME_ARRAY.length; i++) {
-			Timestamp theTimestamp = new Timestamp(TIME_ARRAY[i]);
+		for (long element : TIME_ARRAY) {
+			Timestamp theTimestamp = new Timestamp(element);
 
 			assertTrue(theTimestamp.after(theTest));
 		} // end for
 
-		for (int i = 0; i < TIME_ARRAY.length; i++) {
-			theTest = new Timestamp(TIME_ARRAY[i]);
-			Timestamp theTimestamp = new Timestamp(TIME_ARRAY[i]);
+		for (long element : TIME_ARRAY) {
+			theTest = new Timestamp(element);
+			Timestamp theTimestamp = new Timestamp(element);
 
 			assertFalse(theTimestamp.after(theTest));
 			theTimestamp.setNanos(theTimestamp.getNanos() + 1);
@@ -513,13 +519,14 @@
 	/*
 	 * Method test for compareTo
 	 */
-	public void testCompareToTimestamp() {
+	@SuppressWarnings("deprecation")
+    public void testCompareToTimestamp() {
 		Timestamp theTest = new Timestamp(TIME_EARLY);
 		Timestamp theTest2 = new Timestamp(TIME_LATE);
 
-		for (int i = 0; i < TIME_ARRAY.length; i++) {
-			Timestamp theTimestamp = new Timestamp(TIME_ARRAY[i]);
-			Timestamp theTimestamp2 = new Timestamp(TIME_ARRAY[i]);
+		for (long element : TIME_ARRAY) {
+			Timestamp theTimestamp = new Timestamp(element);
+			Timestamp theTimestamp2 = new Timestamp(element);
 
 			assertTrue(theTimestamp.compareTo(theTest) > 0);
 			assertTrue(theTimestamp.compareTo(theTest2) < 0);
@@ -553,9 +560,9 @@
 		Date theTest = new Timestamp(TIME_EARLY);
 		Date theTest2 = new Timestamp(TIME_LATE);
 
-		for (int i = 0; i < TIME_ARRAY.length; i++) {
-			Timestamp theTimestamp = new Timestamp(TIME_ARRAY[i]);
-			Date theTimestamp2 = new Timestamp(TIME_ARRAY[i]);
+		for (long element : TIME_ARRAY) {
+			Timestamp theTimestamp = new Timestamp(element);
+			Date theTimestamp2 = new Timestamp(element);
 
 			assertTrue(theTimestamp.compareTo(theTest) > 0);
 			assertTrue(theTimestamp.compareTo(theTest2) < 0);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TypesTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TypesTest.java?view=diff&rev=470671&r1=470670&r2=470671
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TypesTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TypesTest.java Thu Nov  2 20:56:30 2006
@@ -30,7 +30,7 @@
 	 */
 	public void testPublicStatics() {
 
-		HashMap thePublicStatics = new HashMap();
+		HashMap<String, Integer> thePublicStatics = new HashMap<String, Integer>();
 		thePublicStatics.put("BOOLEAN", new Integer(16));
 		thePublicStatics.put("DATALINK", new Integer(70));
 		thePublicStatics.put("REF", new Integer(2006));
@@ -62,7 +62,7 @@
 		thePublicStatics.put("TINYINT", new Integer(-6));
 		thePublicStatics.put("BIT", new Integer(-7));
 
-		Class typesClass;
+		Class<?> typesClass;
 		try {
 			typesClass = Class.forName("java.sql.Types");
 		} catch (ClassNotFoundException e) {
@@ -75,12 +75,12 @@
 				+ Modifier.FINAL;
 
 		int countPublicStatics = 0;
-		for (int i = 0; i < theFields.length; i++) {
-			String fieldName = theFields[i].getName();
-			int theMods = theFields[i].getModifiers();
+		for (Field element : theFields) {
+			String fieldName = element.getName();
+			int theMods = element.getModifiers();
 			if (Modifier.isPublic(theMods) && Modifier.isStatic(theMods)) {
 				try {
-					Object fieldValue = theFields[i].get(null);
+					Object fieldValue = element.get(null);
 					Object expectedValue = thePublicStatics.get(fieldName);
 					if (expectedValue == null) {
 						fail("Field " + fieldName + " missing!");

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/ConnectionEventTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/ConnectionEventTest.java?view=diff&rev=470671&r1=470670&r2=470671
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/ConnectionEventTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/ConnectionEventTest.java Thu Nov  2 20:56:30 2006
@@ -53,15 +53,17 @@
 		for (int i = 0; i < loopCount; i++) {
 			try {
 				aConnectionEvent = new ConnectionEvent(init1[i], init2[i]);
-				if (theExceptions[i] != null)
-					fail(i + "Exception missed");
+				if (theExceptions[i] != null) {
+                    fail(i + "Exception missed");
+                }
 				assertEquals(i + "Final state mismatch", aConnectionEvent
 						.getSource(), theFinalStates1[i]);
 				assertEquals(i + "Final state mismatch", aConnectionEvent
 						.getSQLException(), theFinalStates2[i]);
 			} catch (Exception e) {
-				if (theExceptions[i] == null)
-					fail(i + "Unexpected exception");
+				if (theExceptions[i] == null) {
+                    fail(i + "Unexpected exception");
+                }
 				assertEquals(i + "Exception mismatch", e.getClass(),
 						theExceptions[i].getClass());
 				// assertEquals( i + "Exception mismatch", e.getMessage(),
@@ -89,16 +91,18 @@
 		for (int i = 0; i < loopCount; i++) {
 			try {
 				aConnectionEvent = new ConnectionEvent(init1[i]);
-				if (theExceptions[i] != null)
-					fail(i + "Exception missed");
+				if (theExceptions[i] != null) {
+                    fail(i + "Exception missed");
+                }
 				assertEquals(i + "Final state mismatch", aConnectionEvent
 						.getSource(), theFinalStates1[i]);
 				assertEquals(i + "Final state mismatch", aConnectionEvent
 						.getSQLException(), theFinalStates2[i]);
 
 			} catch (Exception e) {
-				if (theExceptions[i] == null)
-					fail(i + "Unexpected exception");
+				if (theExceptions[i] == null) {
+                    fail(i + "Unexpected exception");
+                }
 				assertEquals(i + "Exception mismatch", e.getClass(),
 						theExceptions[i].getClass());
 				// assertEquals( i + "Exception mismatch", e.getMessage(),
@@ -132,8 +136,9 @@
 			try {
 				aConnectionEvent = new ConnectionEvent(init1[i], init2[i]);
 				theReturn = aConnectionEvent.getSQLException();
-				if (theExceptions[i] != null)
-					fail(i + "Exception missed");
+				if (theExceptions[i] != null) {
+                    fail(i + "Exception missed");
+                }
 				assertTrue(theReturn.equals(theReturns[i]));
 				assertEquals(i + "Final state mismatch", aConnectionEvent
 						.getSource(), theFinalStates1[i]);
@@ -141,8 +146,9 @@
 						.getSQLException(), theFinalStates2[i]);
 
 			} catch (Exception e) {
-				if (theExceptions[i] == null)
-					fail(i + "Unexpected exception");
+				if (theExceptions[i] == null) {
+                    fail(i + "Unexpected exception");
+                }
 				assertEquals(i + "Exception mismatch", e.getClass(),
 						theExceptions[i].getClass());
 				assertEquals(i + "Exception mismatch", e.getMessage(),

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/RowSetEventTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/RowSetEventTest.java?view=diff&rev=470671&r1=470670&r2=470671
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/RowSetEventTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/RowSetEventTest.java Thu Nov  2 20:56:30 2006
@@ -46,14 +46,16 @@
 		for (int i = 0; i < loopCount; i++) {
 			try {
 				aRowSetEvent = new RowSetEvent(init1[i]);
-				if (theExceptions[i] != null)
-					fail(i + "Exception missed");
+				if (theExceptions[i] != null) {
+                    fail(i + "Exception missed");
+                }
 				assertEquals(i + "Final state mismatch", aRowSetEvent
 						.getSource(), theFinalStates[i]);
 
 			} catch (Exception e) {
-				if (theExceptions[i] == null)
-					fail(i + "Unexpected exception");
+				if (theExceptions[i] == null) {
+                    fail(i + "Unexpected exception");
+                }
 				assertEquals(i + "Exception mismatch", e.getClass(),
 						theExceptions[i].getClass());
 				// assertEquals( i + "Exception mismatch", e.getMessage(),

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/transaction/InvalidTransactionExceptionTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/transaction/InvalidTransactionExceptionTest.java?view=diff&rev=470671&r1=470670&r2=470671
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/transaction/InvalidTransactionExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/transaction/InvalidTransactionExceptionTest.java Thu Nov  2 20:56:30 2006
@@ -41,15 +41,17 @@
 			try {
 				aInvalidTransactionException = new InvalidTransactionException(
 						init1[i]);
-				if (theExceptions[i] != null)
-					fail();
+				if (theExceptions[i] != null) {
+                    fail();
+                }
 				assertEquals(i + "  Final state mismatch",
 						aInvalidTransactionException.getMessage(),
 						theFinalStates1[i]);
 
 			} catch (Exception e) {
-				if (theExceptions[i] == null)
-					fail(i + "Unexpected exception");
+				if (theExceptions[i] == null) {
+                    fail(i + "Unexpected exception");
+                }
 				assertEquals(i + "Exception mismatch", e.getClass(),
 						theExceptions[i].getClass());
 				assertEquals(i + "Exception mismatch", e.getMessage(),
@@ -73,15 +75,17 @@
 		for (int i = 0; i < loopCount; i++) {
 			try {
 				aInvalidTransactionException = new InvalidTransactionException();
-				if (theExceptions[i] != null)
-					fail();
+				if (theExceptions[i] != null) {
+                    fail();
+                }
 				assertEquals(i + "  Final state mismatch",
 						aInvalidTransactionException.getMessage(),
 						theFinalStates1[i]);
 
 			} catch (Exception e) {
-				if (theExceptions[i] == null)
-					fail(i + "Unexpected exception");
+				if (theExceptions[i] == null) {
+                    fail(i + "Unexpected exception");
+                }
 				assertEquals(i + "Exception mismatch", e.getClass(),
 						theExceptions[i].getClass());
 				assertEquals(i + "Exception mismatch", e.getMessage(),

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/transaction/TransactionRequiredExceptionTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/transaction/TransactionRequiredExceptionTest.java?view=diff&rev=470671&r1=470670&r2=470671
==============================================================================
Binary files /tmp/tmpvGIvXM and /tmp/tmptjnUia differ

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/transaction/TransactionRolledbackExceptionTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/transaction/TransactionRolledbackExceptionTest.java?view=diff&rev=470671&r1=470670&r2=470671
==============================================================================
Binary files /tmp/tmpZGKrVy and /tmp/tmp_C3ETr differ

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/transaction/xa/XAExceptionTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/transaction/xa/XAExceptionTest.java?view=diff&rev=470671&r1=470670&r2=470671
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/transaction/xa/XAExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/transaction/xa/XAExceptionTest.java Thu Nov  2 20:56:30 2006
@@ -32,7 +32,7 @@
 	 */
 	public void testPublicStatics() {
 
-		HashMap thePublicStatics = new HashMap();
+		HashMap<String, Integer> thePublicStatics = new HashMap<String, Integer>();
 		thePublicStatics.put("XAER_OUTSIDE", new Integer(-9));
 		thePublicStatics.put("XAER_DUPID", new Integer(-8));
 		thePublicStatics.put("XAER_RMFAIL", new Integer(-7));
@@ -73,12 +73,12 @@
 				+ Modifier.FINAL;
 
 		int countPublicStatics = 0;
-		for (int i = 0; i < theFields.length; i++) {
-			String fieldName = theFields[i].getName();
-			int theMods = theFields[i].getModifiers();
+		for (Field element : theFields) {
+			String fieldName = element.getName();
+			int theMods = element.getModifiers();
 			if (Modifier.isPublic(theMods) && Modifier.isStatic(theMods)) {
 				try {
-					Object fieldValue = theFields[i].get(null);
+					Object fieldValue = element.get(null);
 					Object expectedValue = thePublicStatics.get(fieldName);
 					if (expectedValue == null) {
 						fail("Field " + fieldName + " missing!");
@@ -113,14 +113,16 @@
 		for (int i = 0; i < loopCount; i++) {
 			try {
 				aXAException = new XAException(init1[i]);
-				if (theExceptions[i] != null)
-					fail();
+				if (theExceptions[i] != null) {
+                    fail();
+                }
 				assertEquals(i + "  Final state mismatch", aXAException
 						.getMessage(), theFinalStates1[i]);
 
 			} catch (Exception e) {
-				if (theExceptions[i] == null)
-					fail(i + "Unexpected exception");
+				if (theExceptions[i] == null) {
+                    fail(i + "Unexpected exception");
+                }
 				assertEquals(i + "Exception mismatch", e.getClass(),
 						theExceptions[i].getClass());
 				assertEquals(i + "Exception mismatch", e.getMessage(),
@@ -147,14 +149,16 @@
 		for (int i = 0; i < loopCount; i++) {
 			try {
 				aXAException = new XAException(init1[i]);
-				if (theExceptions[i] != null)
-					fail();
+				if (theExceptions[i] != null) {
+                    fail();
+                }
 				assertEquals(i + "  Final state mismatch", aXAException
 						.getMessage(), theFinalStates1[i]);
 
 			} catch (Exception e) {
-				if (theExceptions[i] == null)
-					fail(i + "Unexpected exception");
+				if (theExceptions[i] == null) {
+                    fail(i + "Unexpected exception");
+                }
 				assertEquals(i + "Exception mismatch", e.getClass(),
 						theExceptions[i].getClass());
 				assertEquals(i + "Exception mismatch", e.getMessage(),
@@ -178,14 +182,16 @@
 		for (int i = 0; i < loopCount; i++) {
 			try {
 				aXAException = new XAException();
-				if (theExceptions[i] != null)
-					fail();
+				if (theExceptions[i] != null) {
+                    fail();
+                }
 				assertEquals(i + "  Final state mismatch", aXAException
 						.getMessage(), theFinalStates1[i]);
 
 			} catch (Exception e) {
-				if (theExceptions[i] == null)
-					fail(i + "Unexpected exception");
+				if (theExceptions[i] == null) {
+                    fail(i + "Unexpected exception");
+                }
 				assertEquals(i + "Exception mismatch", e.getClass(),
 						theExceptions[i].getClass());
 				assertEquals(i + "Exception mismatch", e.getMessage(),

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/transaction/xa/XAResourceTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/transaction/xa/XAResourceTest.java?view=diff&rev=470671&r1=470670&r2=470671
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/transaction/xa/XAResourceTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/transaction/xa/XAResourceTest.java Thu Nov  2 20:56:30 2006
@@ -21,8 +21,6 @@
 import java.lang.reflect.Modifier;
 import java.util.HashMap;
 
-import javax.transaction.xa.XAResource;
-
 import junit.framework.TestCase;
 
 public class XAResourceTest extends TestCase {
@@ -32,7 +30,7 @@
 	 */
 	public void testPublicStatics() {
 
-		HashMap thePublicStatics = new HashMap();
+		HashMap<String, Integer> thePublicStatics = new HashMap<String, Integer>();
 		thePublicStatics.put("XA_OK", new Integer(0));
 		thePublicStatics.put("XA_RDONLY", new Integer(3));
 		thePublicStatics.put("TMSUSPEND", new Integer(33554432));
@@ -58,12 +56,12 @@
 				+ Modifier.FINAL;
 
 		int countPublicStatics = 0;
-		for (int i = 0; i < theFields.length; i++) {
-			String fieldName = theFields[i].getName();
-			int theMods = theFields[i].getModifiers();
+		for (Field element : theFields) {
+			String fieldName = element.getName();
+			int theMods = element.getModifiers();
 			if (Modifier.isPublic(theMods) && Modifier.isStatic(theMods)) {
 				try {
-					Object fieldValue = theFields[i].get(null);
+					Object fieldValue = element.get(null);
 					Object expectedValue = thePublicStatics.get(fieldName);
 					if (expectedValue == null) {
 						fail("Field " + fieldName + " missing!");

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/transaction/xa/XidTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/transaction/xa/XidTest.java?view=diff&rev=470671&r1=470670&r2=470671
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/transaction/xa/XidTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/transaction/xa/XidTest.java Thu Nov  2 20:56:30 2006
@@ -21,8 +21,6 @@
 import java.lang.reflect.Modifier;
 import java.util.HashMap;
 
-import javax.transaction.xa.Xid;
-
 import junit.framework.TestCase;
 
 public class XidTest extends TestCase {
@@ -32,7 +30,7 @@
 	 */
 	public void testPublicStatics() {
 
-		HashMap thePublicStatics = new HashMap();
+		HashMap<String, Integer> thePublicStatics = new HashMap<String, Integer>();
 		thePublicStatics.put("MAXBQUALSIZE", new Integer(64));
 		thePublicStatics.put("MAXGTRIDSIZE", new Integer(64));
 
@@ -49,12 +47,12 @@
 				+ Modifier.FINAL;
 
 		int countPublicStatics = 0;
-		for (int i = 0; i < theFields.length; i++) {
-			String fieldName = theFields[i].getName();
-			int theMods = theFields[i].getModifiers();
+		for (Field element : theFields) {
+			String fieldName = element.getName();
+			int theMods = element.getModifiers();
 			if (Modifier.isPublic(theMods) && Modifier.isStatic(theMods)) {
 				try {
-					Object fieldValue = theFields[i].get(null);
+					Object fieldValue = element.get(null);
 					Object expectedValue = thePublicStatics.get(fieldName);
 					if (expectedValue == null) {
 						fail("Field " + fieldName + " missing!");



Mime
View raw message