List:Commits« Previous MessageNext Message »
From:Craig L Russell Date:June 7 2010 10:04pm
Subject:bzr push into connector-j/branches/branch_5_1 branch (Craig.Russell:941 to
943)
View as plain text  
  943 Craig L Russell	2010-06-07
      Fix warnings for getMethod and invoke via reflection

    modified:
      src/com/mysql/jdbc/LoadBalancingConnectionProxy.java
      src/com/mysql/jdbc/StringUtils.java
      src/com/mysql/jdbc/Util.java
      src/com/mysql/jdbc/integration/c3p0/MysqlConnectionTester.java
      src/testsuite/BaseTestCase.java
      src/testsuite/regression/ConnectionRegressionTest.java
      src/testsuite/regression/DataSourceRegressionTest.java
  942 Craig L Russell	2010-06-07
      Remove redundant init of connection lifecycle interceptors

    modified:
      src/com/mysql/jdbc/ConnectionImpl.java
  941 markm@stripped	2010-05-12
      Be consistent with our use of 'zeros'.

    modified:
      src/com/mysql/jdbc/LocalizedErrorMessages.properties
=== modified file 'src/com/mysql/jdbc/ConnectionImpl.java'
--- a/src/com/mysql/jdbc/ConnectionImpl.java	2010-04-29 20:46:42 +0000
+++ b/src/com/mysql/jdbc/ConnectionImpl.java	2010-06-07 21:57:03 +0000
@@ -3326,15 +3326,6 @@ public class ConnectionImpl extends Conn
 			this.connectionLifecycleInterceptors = Util.loadExtensions(this, this.props, 
 					connectionInterceptorClasses, 
 					"Connection.badLifecycleInterceptor", getExceptionInterceptor());
-			
-			Iterator iter = this.connectionLifecycleInterceptors.iterator();
-			
-			new IterateBlock(iter) {
-				void forEach(Object each) throws SQLException {
-					// TODO: Fully initialize, or continue on error?
-					((ConnectionLifecycleInterceptor)each).init(ConnectionImpl.this, props);
-				}
-			}.doForAll();
 		}
 		
 		setSessionVariables();

=== modified file 'src/com/mysql/jdbc/LoadBalancingConnectionProxy.java'
--- a/src/com/mysql/jdbc/LoadBalancingConnectionProxy.java	2010-04-30 20:19:52 +0000
+++ b/src/com/mysql/jdbc/LoadBalancingConnectionProxy.java	2010-06-07 22:00:25 +0000
@@ -660,12 +660,12 @@ public class LoadBalancingConnectionProx
 
 	/**
 	 * Returns best-resolution representation of local time, using nanoTime() if
-	 * availble, otherwise defaulting to currentTimeMillis().
+	 * available, otherwise defaulting to currentTimeMillis().
 	 */
 	private static long getLocalTimeBestResolution() {
 		if (getLocalTimeMethod != null) {
 			try {
-				return ((Long) getLocalTimeMethod.invoke(null, null))
+				return ((Long) getLocalTimeMethod.invoke(null, (Object[])null))
 						.longValue();
 			} catch (IllegalArgumentException e) {
 				// ignore - we fall through to currentTimeMillis()

=== modified file 'src/com/mysql/jdbc/StringUtils.java'
--- a/src/com/mysql/jdbc/StringUtils.java	2010-03-02 23:09:37 +0000
+++ b/src/com/mysql/jdbc/StringUtils.java	2010-06-07 22:00:25 +0000
@@ -100,7 +100,7 @@ public class StringUtils {
 
 		if (toPlainStringMethod != null) {
 			try {
-				return (String) toPlainStringMethod.invoke(decimal, null);
+				return (String) toPlainStringMethod.invoke(decimal, (Object[])null);
 			} catch (InvocationTargetException invokeEx) {
 				// that's okay, we fall-through to decimal.toString()
 			} catch (IllegalAccessException accessEx) {

=== modified file 'src/com/mysql/jdbc/Util.java'
--- a/src/com/mysql/jdbc/Util.java	2010-01-28 23:59:15 +0000
+++ b/src/com/mysql/jdbc/Util.java	2010-06-07 22:00:25 +0000
@@ -54,7 +54,7 @@ public class Util {
 
 	static {
 		try {
-			systemNanoTimeMethod = System.class.getMethod("nanoTime", null);
+			systemNanoTimeMethod = System.class.getMethod("nanoTime", (Class[])null);
 		} catch (SecurityException e) {
 			systemNanoTimeMethod = null;
 		} catch (NoSuchMethodException e) {
@@ -447,7 +447,7 @@ public class Util {
 		try {
 			Class networkInterfaceClass = Class
 					.forName("java.net.NetworkInterface");
-			return networkInterfaceClass.getMethod("getByName", null).invoke(
+			return networkInterfaceClass.getMethod("getByName", (Class[])null).invoke(
 					networkInterfaceClass, new Object[] { hostname }) != null;
 		} catch (Throwable t) {
 			return false;
@@ -477,7 +477,7 @@ public class Util {
 	public static long getCurrentTimeNanosOrMillis() {
 		if (systemNanoTimeMethod != null) {
 			try {
-				return ((Long) systemNanoTimeMethod.invoke(null, null))
+				return ((Long) systemNanoTimeMethod.invoke(null, (Object[])null))
 						.longValue();
 			} catch (IllegalArgumentException e) {
 				// ignore - fall through to currentTimeMillis()

=== modified file 'src/com/mysql/jdbc/integration/c3p0/MysqlConnectionTester.java'
--- a/src/com/mysql/jdbc/integration/c3p0/MysqlConnectionTester.java	2010-01-28 23:59:15 +0000
+++ b/src/com/mysql/jdbc/integration/c3p0/MysqlConnectionTester.java	2010-06-07 22:00:25 +0000
@@ -54,7 +54,7 @@ public final class MysqlConnectionTester
 	public MysqlConnectionTester() {
 		try {
 			pingMethod = com.mysql.jdbc.Connection.class
-					.getMethod("ping", null);
+					.getMethod("ping", (Class[])null);
 		} catch (Exception ex) {
 			// punt, we have no way to recover, other than we now use 'SELECT 1'
 			// for

=== modified file 'src/testsuite/BaseTestCase.java'
--- a/src/testsuite/BaseTestCase.java	2010-04-30 14:44:54 +0000
+++ b/src/testsuite/BaseTestCase.java	2010-06-07 22:00:25 +0000
@@ -797,8 +797,8 @@ public abstract class BaseTestCase exten
 	 */
 	protected long currentTimeMillis() {
 		try {
-			Method mNanoTime = System.class.getDeclaredMethod("nanoTime", null);
-			return ((Long)mNanoTime.invoke(null, null)).longValue() / 1000000;
+			Method mNanoTime = System.class.getDeclaredMethod("nanoTime", (Class[])null);
+			return ((Long)mNanoTime.invoke(null, (Object[])null)).longValue() / 1000000;
 		} catch(Exception ex) {
 			return System.currentTimeMillis();
 		}

=== modified file 'src/testsuite/regression/ConnectionRegressionTest.java'
--- a/src/testsuite/regression/ConnectionRegressionTest.java	2010-04-29 23:50:34 +0000
+++ b/src/testsuite/regression/ConnectionRegressionTest.java	2010-06-07 22:00:25 +0000
@@ -1910,7 +1910,7 @@ public class ConnectionRegressionTest ex
 			accessorName.append(propertyName.substring(1));
 			
 			try {
-				clazz.getMethod(accessorName.toString(), null);
+				clazz.getMethod(accessorName.toString(), (Class[])null);
 			} catch (NoSuchMethodException nsme) {
 				missingGettersBuf.append(accessorName.toString());
 				missingGettersBuf.append("\n");

=== modified file 'src/testsuite/regression/DataSourceRegressionTest.java'
--- a/src/testsuite/regression/DataSourceRegressionTest.java	2010-01-28 23:59:15 +0000
+++ b/src/testsuite/regression/DataSourceRegressionTest.java	2010-06-07 22:00:25 +0000
@@ -403,7 +403,7 @@ public class DataSourceRegressionTest ex
 		Method enableStreamingResultsMethodStmt = Class.forName(
 				"com.mysql.jdbc.jdbc2.optional.StatementWrapper").getMethod(
 				"enableStreamingResults", new Class[0]);
-		enableStreamingResultsMethodStmt.invoke(physStatement, new Class[0]);
+		enableStreamingResultsMethodStmt.invoke(physStatement, (Object[])null);
 		this.rs = physStatement.executeQuery("SELECT 1");
 
 		try {
@@ -422,8 +422,8 @@ public class DataSourceRegressionTest ex
 		PreparedStatement physPrepStmt = physConn.prepareStatement("SELECT 1");
 		Method enableStreamingResultsMethodPstmt = Class.forName(
 				"com.mysql.jdbc.jdbc2.optional.PreparedStatementWrapper")
-				.getMethod("enableStreamingResults", new Class[0]);
-		enableStreamingResultsMethodPstmt.invoke(physPrepStmt, new Class[0]);
+				.getMethod("enableStreamingResults", (Class[])null);
+		enableStreamingResultsMethodPstmt.invoke(physPrepStmt, (Object[])null);
 
 		this.rs = physPrepStmt.executeQuery();
 


Attachment: [text/bzr-bundle] bzr/craig.russell@oracle.com-20100607220025-bhayvfy5p8e7xj7p.bundle
Thread
bzr push into connector-j/branches/branch_5_1 branch (Craig.Russell:941 to943)Craig L Russell8 Jun