tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r799408 - in /tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool: ./ interceptor/
Date Thu, 30 Jul 2009 19:10:02 GMT
Author: markt
Date: Thu Jul 30 19:10:02 2009
New Revision: 799408

URL: http://svn.apache.org/viewvc?rev=799408&view=rev
Log:
Partial fix for https://issues.apache.org/bugzilla/show_bug.cgi?id=47577
Cosmetic fixes. Main benefit is noise reduction in Eclipse error list

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

Modified: tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java?rev=799408&r1=799407&r2=799408&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java (original)
+++ tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java Thu
Jul 30 19:10:02 2009
@@ -98,7 +98,7 @@
      * 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 @@
      * @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 @@
             //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 @@
      * @param con
      */
     protected void finalize(PooledConnection con) {
-        
+        // NOOP
     }
     
     /**

Modified: tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSource.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSource.java?rev=799408&r1=799407&r2=799408&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSource.java (original)
+++ tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSource.java Thu Jul
30 19:10:02 2009
@@ -68,6 +68,7 @@
      * {@inheritDoc}
      */
     public void postRegister(Boolean registrationDone) {
+        // NOOP
     }
 
 
@@ -76,6 +77,7 @@
      * {@inheritDoc}
      */
     public void preDeregister() throws Exception {
+        // NOOP
     }
 
     /**
@@ -133,6 +135,7 @@
             MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
             mbs.unregisterMBean(oname);
         } catch (InstanceNotFoundException ignore) {
+            // NOOP
         } catch (Exception e) {
             log.error("Unable to unregister JDBC pool with JMX",e);
         }

Modified: tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSourceProxy.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSourceProxy.java?rev=799408&r1=799407&r2=799408&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSourceProxy.java (original)
+++ tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSourceProxy.java Thu
Jul 30 19:10:02 2009
@@ -424,7 +424,7 @@
         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 @@
      * {@link javax.sql.DataSource#setLogWriter(PrintWriter)}
      */
     public void setLogWriter(PrintWriter out) throws SQLException {
+        // NOOP
     }
 
     /**

Modified: tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/FairBlockingQueue.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/FairBlockingQueue.java?rev=799408&r1=799407&r2=799408&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/FairBlockingQueue.java
(original)
+++ tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/FairBlockingQueue.java
Thu Jul 30 19:10:02 2009
@@ -306,9 +306,9 @@
      * {@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;

Modified: tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/JdbcInterceptor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/JdbcInterceptor.java?rev=799408&r1=799407&r2=799408&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/JdbcInterceptor.java (original)
+++ tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/JdbcInterceptor.java Thu
Jul 30 19:10:02 2009
@@ -71,6 +71,7 @@
      * Public constructor for instantation through reflection
      */
     public JdbcInterceptor() {
+        // NOOP
     }
 
     /**
@@ -184,6 +185,7 @@
      * @param pool - the pool that is being closed.
      */
     public void poolClosed(ConnectionPool pool) {
+        // NOOP
     }
 
     /**
@@ -194,6 +196,7 @@
      * @param pool - the pool that is being closed.
      */
     public void poolStarted(ConnectionPool pool) {
+        // NOOP
     }
 
 }

Modified: tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/PoolProperties.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/PoolProperties.java?rev=799408&r1=799407&r2=799408&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/PoolProperties.java (original)
+++ tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/PoolProperties.java Thu
Jul 30 19:10:02 2009
@@ -405,6 +405,7 @@
      */
     @Override
     public void setAccessToUnderlyingConnectionAllowed(boolean accessToUnderlyingConnectionAllowed)
{
+        // NOOP
     }
 
     /** 

Modified: tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/PooledConnection.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/PooledConnection.java?rev=799408&r1=799407&r2=799408&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/PooledConnection.java
(original)
+++ tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/PooledConnection.java
Thu Jul 30 19:10:02 2009
@@ -330,7 +330,7 @@
             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

Modified: tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ProxyConnection.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ProxyConnection.java?rev=799408&r1=799407&r2=799408&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ProxyConnection.java (original)
+++ tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ProxyConnection.java Thu
Jul 30 19:10:02 2009
@@ -69,7 +69,7 @@
     }
 
 
-    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 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.

Modified: tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/interceptor/AbstractCreateStatementInterceptor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/interceptor/AbstractCreateStatementInterceptor.java?rev=799408&r1=799407&r2=799408&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/interceptor/AbstractCreateStatementInterceptor.java
(original)
+++ tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/interceptor/AbstractCreateStatementInterceptor.java
Thu Jul 30 19:10:02 2009
@@ -97,6 +97,6 @@
      */
     @Override
     public void reset(ConnectionPool parent, PooledConnection con) {
-        
+        // NOOP
     }
 }

Modified: tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/interceptor/AbstractQueryReport.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/interceptor/AbstractQueryReport.java?rev=799408&r1=799407&r2=799408&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/interceptor/AbstractQueryReport.java
(original)
+++ tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/interceptor/AbstractQueryReport.java
Thu Jul 30 19:10:02 2009
@@ -220,7 +220,7 @@
             //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;

Modified: tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/interceptor/ConnectionState.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/interceptor/ConnectionState.java?rev=799408&r1=799407&r2=799408&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/interceptor/ConnectionState.java
(original)
+++ tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/interceptor/ConnectionState.java
Thu Jul 30 19:10:02 2009
@@ -92,7 +92,7 @@
             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;

Modified: tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReport.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReport.java?rev=799408&r1=799407&r2=799408&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReport.java
(original)
+++ tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReport.java
Thu Jul 30 19:10:02 2009
@@ -317,16 +317,16 @@
         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);
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message