Partial fix for https://issues.apache.org/bugzilla/show_bug.cgi?id=47577
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 30 Jul 2009 19:10:02 +0000 (19:10 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 30 Jul 2009 19:10:02 +0000 (19:10 +0000)
Cosmetic fixes. Main benefit is noise reduction in Eclipse error list

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@799408 13f79535-47bb-0310-9956-ffa450edef68

12 files changed:
modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java
modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSource.java
modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSourceProxy.java
modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/FairBlockingQueue.java
modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/JdbcInterceptor.java
modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/PoolProperties.java
modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/PooledConnection.java
modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ProxyConnection.java
modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/interceptor/AbstractCreateStatementInterceptor.java
modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/interceptor/AbstractQueryReport.java
modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/interceptor/ConnectionState.java
modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReport.java

index 42046ec..dd0ebbc 100644 (file)
@@ -98,7 +98,7 @@ public class ConnectionPool {
      * Since newProxyInstance performs the same operation, over and over
      * again, it is much more optimized if we simply store the constructor ourselves.
      */
-    private Constructor proxyClassConstructor;
+    private Constructor<?> proxyClassConstructor;
 
     /**
      * Executor service used to cancel Futures
@@ -295,10 +295,10 @@ public class ConnectionPool {
      * @return constructor used to instantiate the wrapper object
      * @throws NoSuchMethodException
      */
-    public Constructor getProxyConstructor() throws NoSuchMethodException {
+    public Constructor<?> getProxyConstructor() throws NoSuchMethodException {
         //cache the constructor
         if (proxyClassConstructor == null ) {
-            Class proxyClass = Proxy.getProxyClass(ConnectionPool.class.getClassLoader(), new Class[] {java.sql.Connection.class,javax.sql.PooledConnection.class});
+            Class<?> proxyClass = Proxy.getProxyClass(ConnectionPool.class.getClassLoader(), new Class[] {java.sql.Connection.class,javax.sql.PooledConnection.class});
             proxyClassConstructor = proxyClass.getConstructor(new Class[] { InvocationHandler.class });
         }
         return proxyClassConstructor;
@@ -431,7 +431,7 @@ public class ConnectionPool {
             //return the members as idle to the pool
             for (int i = 0; i < initialPool.length; i++) {
                 if (initialPool[i] != null) {
-                    try {this.returnConnection(initialPool[i]);}catch(Exception x){}
+                    try {this.returnConnection(initialPool[i]);}catch(Exception x){/*NOOP*/}
                 } //end if
             } //for
         } //catch
@@ -927,7 +927,7 @@ public class ConnectionPool {
      * @param con
      */
     protected void finalize(PooledConnection con) {
-        
+        // NOOP
     }
     
     /**
index 410a06e..490654e 100644 (file)
@@ -68,6 +68,7 @@ public class DataSource extends DataSourceProxy implements MBeanRegistration,jav
      * {@inheritDoc}
      */
     public void postRegister(Boolean registrationDone) {
+        // NOOP
     }
 
 
@@ -76,6 +77,7 @@ public class DataSource extends DataSourceProxy implements MBeanRegistration,jav
      * {@inheritDoc}
      */
     public void preDeregister() throws Exception {
+        // NOOP
     }
 
     /**
@@ -133,6 +135,7 @@ public class DataSource extends DataSourceProxy implements MBeanRegistration,jav
             MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
             mbs.unregisterMBean(oname);
         } catch (InstanceNotFoundException ignore) {
+            // NOOP
         } catch (Exception e) {
             log.error("Unable to unregister JDBC pool with JMX",e);
         }
index 80bc1a3..11924d7 100644 (file)
@@ -424,7 +424,7 @@ public class DataSourceProxy implements PoolConfiguration {
         try {
             java.util.Properties prop = DataSourceFactory
                     .getProperties(properties);
-            Iterator i = prop.keySet().iterator();
+            Iterator<?> i = prop.keySet().iterator();
             while (i.hasNext()) {
                 String key = (String) i.next();
                 String value = prop.getProperty(key);
@@ -459,6 +459,7 @@ public class DataSourceProxy implements PoolConfiguration {
      * {@link javax.sql.DataSource#setLogWriter(PrintWriter)}
      */
     public void setLogWriter(PrintWriter out) throws SQLException {
+        // NOOP
     }
 
     /**
index 6dfde42..5a0325c 100644 (file)
@@ -306,9 +306,9 @@ public class FairBlockingQueue<E> implements BlockingQueue<E> {
      * {@inheritDoc}
      */
     public boolean addAll(Collection<? extends E> c) {
-        Iterator i = c.iterator();
+        Iterator<? extends E> i = c.iterator();
         while (i.hasNext()) {
-            E e = (E)i.next();
+            E e = i.next();
             offer(e);
         }
         return true;
index e148d9f..78a214a 100644 (file)
@@ -71,6 +71,7 @@ public abstract class JdbcInterceptor implements InvocationHandler {
      * Public constructor for instantation through reflection
      */
     public JdbcInterceptor() {
+        // NOOP
     }
 
     /**
@@ -184,6 +185,7 @@ public abstract class JdbcInterceptor implements InvocationHandler {
      * @param pool - the pool that is being closed.
      */
     public void poolClosed(ConnectionPool pool) {
+        // NOOP
     }
 
     /**
@@ -194,6 +196,7 @@ public abstract class JdbcInterceptor implements InvocationHandler {
      * @param pool - the pool that is being closed.
      */
     public void poolStarted(ConnectionPool pool) {
+        // NOOP
     }
 
 }
index 73ef6ef..1d32d1f 100644 (file)
@@ -405,6 +405,7 @@ public class PoolProperties implements PoolConfiguration {
      */
     @Override
     public void setAccessToUnderlyingConnectionAllowed(boolean accessToUnderlyingConnectionAllowed) {
+        // NOOP
     }
 
     /** 
index 96c42d2..8991a60 100644 (file)
@@ -330,7 +330,7 @@ public class PooledConnection {
             if (log.isDebugEnabled())
                 log.debug("Unable to validate object:",ignore);
             if (stmt!=null)
-                try { stmt.close();} catch (Exception ignore2){}
+                try { stmt.close();} catch (Exception ignore2){/*NOOP*/}
         }
         return false;
     } //validate
index d11b3fa..f3cab3a 100644 (file)
@@ -69,7 +69,7 @@ public class ProxyConnection extends JdbcInterceptor {
     }
 
 
-    public Object unwrap(Class iface) throws SQLException {
+    public Object unwrap(Class<?> iface) throws SQLException {
         if (isWrapperFor(iface)) {
             return connection.getConnection();
         } else {
@@ -79,7 +79,7 @@ public class ProxyConnection extends JdbcInterceptor {
 
     public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
         if (compare(ISCLOSED_VAL,method)) {
-            return isClosed();
+            return Boolean.valueOf(isClosed());
         }
         if (compare(CLOSE_VAL,method)) {
             if (isClosed()) return null; //noop for already closed.
index fd4d8a4..b74d0c8 100644 (file)
@@ -97,6 +97,6 @@ public abstract class  AbstractCreateStatementInterceptor extends JdbcIntercepto
      */
     @Override
     public void reset(ConnectionPool parent, PooledConnection con) {
-        
+        // NOOP
     }
 }
index 8e00c79..fc7c0e2 100644 (file)
@@ -220,7 +220,7 @@ public abstract class AbstractQueryReport extends AbstractCreateStatementInterce
             //allow close to be called multiple times
             if (close && closed) return null; 
             //are we calling isClosed?
-            if (compare(JdbcInterceptor.ISCLOSED_VAL,name)) return closed;
+            if (compare(JdbcInterceptor.ISCLOSED_VAL,name)) return Boolean.valueOf(closed);
             //if we are calling anything else, bail out
             if (closed) throw new SQLException("Statement closed.");
             boolean process = false;
index 7256143..300b815 100644 (file)
@@ -92,7 +92,7 @@ public class ConnectionState extends JdbcInterceptor  {
             try {
                 if (transactionIsolation==null || transactionIsolation.intValue()!=poolProperties.getDefaultTransactionIsolation()) {
                     con.getConnection().setTransactionIsolation(poolProperties.getDefaultTransactionIsolation());
-                    transactionIsolation = poolProperties.getDefaultTransactionIsolation();
+                    transactionIsolation = Integer.valueOf(poolProperties.getDefaultTransactionIsolation());
                 }
             }catch (SQLException x) {
                 transactionIsolation = null;
index 90839df..28a71a4 100644 (file)
@@ -317,16 +317,16 @@ public class SlowQueryReport extends AbstractQueryReport  {
         public CompositeDataSupport getCompositeData(final CompositeType type) throws OpenDataException{
             Object[] values = new Object[] {
                     query,
-                    nrOfInvocations,
-                    maxInvocationTime,
-                    maxInvocationDate,
-                    minInvocationTime,
-                    minInvocationDate,
-                    totalInvocationTime,
-                    failures,
-                    prepareCount,
-                    prepareTime,
-                    lastInvocation
+                    Integer.valueOf(nrOfInvocations),
+                    Long.valueOf(maxInvocationTime),
+                    Long.valueOf(maxInvocationDate),
+                    Long.valueOf(minInvocationTime),
+                    Long.valueOf(minInvocationDate),
+                    Long.valueOf(totalInvocationTime),
+                    Long.valueOf(failures),
+                    Integer.valueOf(prepareCount),
+                    Long.valueOf(prepareTime),
+                    Long.valueOf(lastInvocation)
             };
             return new CompositeDataSupport(type,FIELD_NAMES,values);
         }