You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2009/01/15 23:08:18 UTC

svn commit: r734838 - in /tomcat/trunk: java/org/apache/tomcat/util/threads/ modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/

Author: markt
Date: Thu Jan 15 14:08:17 2009
New Revision: 734838

URL: http://svn.apache.org/viewvc?rev=734838&view=rev
Log:
Fix all the static Eclipse warnings 

Modified:
    tomcat/trunk/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java
    tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java
    tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/PooledConnection.java
    tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/DefaultTestCase.java
    tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/FairnessTest.java
    tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/SimplePOJOAsyncExample.java
    tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/TestAsyncQueue.java
    tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/TwoDataSources.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java?rev=734838&r1=734837&r2=734838&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java Thu Jan 15 14:08:17 2009
@@ -98,7 +98,7 @@
                         throw new RejectedExecutionException("Queue capacity is full.");
                     }
                 } catch (InterruptedException x) {
-                    Thread.currentThread().interrupted();
+                    Thread.interrupted();
                     throw new RejectedExecutionException(x);
                 }
             } else {

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=734838&r1=734837&r2=734838&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 Jan 15 14:08:17 2009
@@ -281,7 +281,7 @@
                     con = pool.poll(1000, TimeUnit.MILLISECONDS);
                 } //while
             } catch (InterruptedException ex) {
-                Thread.currentThread().interrupted();
+                Thread.interrupted();
             }
             if (pool.size()==0 && force && pool!=busy) pool = busy;
         }
@@ -349,7 +349,7 @@
                 proxies[i].getInterceptorClass().newInstance().poolStarted(this);
             }catch (Exception x) {
                 log.error("Unable to inform interceptor of pool start.",x);
-                if (jmxPool!=null) jmxPool.notify(jmxPool.NOTIFY_INIT, getStackTrace(x));
+                if (jmxPool!=null) jmxPool.notify(org.apache.tomcat.jdbc.pool.jmx.ConnectionPool.NOTIFY_INIT, getStackTrace(x));
                 close(true);
                 SQLException ex = new SQLException();
                 ex.initCause(x);
@@ -364,7 +364,7 @@
             } //for
 
         } catch (SQLException x) {
-            if (jmxPool!=null) jmxPool.notify(jmxPool.NOTIFY_INIT, getStackTrace(x));
+            if (jmxPool!=null) jmxPool.notify(org.apache.tomcat.jdbc.pool.jmx.ConnectionPool.NOTIFY_INIT, getStackTrace(x));
             close(true);
             throw x;
         } finally {
@@ -400,7 +400,7 @@
                 log.warn("Connection has been abandoned " + con + ":" + trace);
             }
             if (jmxPool!=null) {
-                jmxPool.notify(jmxPool.NOTIFY_ABANDON, trace);
+                jmxPool.notify(org.apache.tomcat.jdbc.pool.jmx.ConnectionPool.NOTIFY_ABANDON, trace);
             }
             con.abandon();
         } finally {
@@ -465,7 +465,7 @@
                 //retrieve an existing connection
                 con = idle.poll(timetowait, TimeUnit.MILLISECONDS);
             } catch (InterruptedException ex) {
-                Thread.currentThread().interrupted();
+                Thread.interrupted();
             }
             if (maxWait==0 && con == null) { //no wait, return one if we have one
                 throw new SQLException("[" + Thread.currentThread().getName()+"] " +
@@ -878,10 +878,10 @@
             this.pool = pool;
             this.sleepTime = sleepTime;
             if (sleepTime <= 0) {
-                pool.log.warn("Database connection pool evicter thread interval is set to 0, defaulting to 30 seconds");
+                log.warn("Database connection pool evicter thread interval is set to 0, defaulting to 30 seconds");
                 this.sleepTime = 1000 * 30;
             } else if (sleepTime < 1000) {
-                pool.log.warn("Database connection pool evicter thread interval is set to lower than 1 second.");
+                log.warn("Database connection pool evicter thread interval is set to lower than 1 second.");
             }
         }
 
@@ -891,7 +891,7 @@
                     sleep(sleepTime);
                 } catch (InterruptedException e) {
                     // ignore it
-                    Thread.currentThread().interrupted();
+                    Thread.interrupted();
                     continue;
                 } //catch
 
@@ -908,7 +908,7 @@
                         if (pool.getPoolProperties().isTestWhileIdle())
                             pool.testAllIdle();
                     } catch (Exception x) {
-                        pool.log.error("", x);
+                        log.error("", x);
                     } //catch
                 } //end if
             } //while

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=734838&r1=734837&r2=734838&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 Jan 15 14:08:17 2009
@@ -92,7 +92,8 @@
                 log.debug("Unable to connect to database.", x);
             }
             if (parent.jmxPool!=null) {
-                parent.jmxPool.notify(parent.jmxPool.NOTIFY_CONNECT, parent.getStackTrace(x));
+                parent.jmxPool.notify(org.apache.tomcat.jdbc.pool.jmx.ConnectionPool.NOTIFY_CONNECT,
+                        ConnectionPool.getStackTrace(x));
             }
             if (x instanceof SQLException) {
                 throw (SQLException)x;

Modified: tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/DefaultTestCase.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/DefaultTestCase.java?rev=734838&r1=734837&r2=734838&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/DefaultTestCase.java (original)
+++ tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/DefaultTestCase.java Thu Jan 15 14:08:17 2009
@@ -70,7 +70,7 @@
             BasicDataSourceFactory factory = new BasicDataSourceFactory();
             Properties p = new Properties();
 
-            for (int i=0; i<this.ALL_PROPERTIES.length; i++) {
+            for (int i=0; i< ALL_PROPERTIES.length; i++) {
                 String name = "get" + Character.toUpperCase(ALL_PROPERTIES[i].charAt(0)) + ALL_PROPERTIES[i].substring(1);
                 String bname = "is" + name.substring(3);
                 Method get = null;
@@ -90,7 +90,7 @@
                        }
                 }
             }
-            tDatasource = (BasicDataSource)factory.createDataSource(p);
+            tDatasource = (BasicDataSource) BasicDataSourceFactory.createDataSource(p);
         }catch (Exception x) {
             x.printStackTrace();
         }

Modified: tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/FairnessTest.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/FairnessTest.java?rev=734838&r1=734837&r2=734838&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/FairnessTest.java (original)
+++ tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/FairnessTest.java Thu Jan 15 14:08:17 2009
@@ -208,9 +208,9 @@
                             st.close();
                         }
                         try { 
-                            this.sleep(FairnessTest.this.sleep); 
+                            sleep(FairnessTest.this.sleep); 
                         } catch (InterruptedException x) {
-                            this.interrupted();
+                            interrupted();
                         }
                     } finally {
                         long cstart = System.nanoTime();

Modified: tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/SimplePOJOAsyncExample.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/SimplePOJOAsyncExample.java?rev=734838&r1=734837&r2=734838&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/SimplePOJOAsyncExample.java (original)
+++ tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/SimplePOJOAsyncExample.java Thu Jan 15 14:08:17 2009
@@ -59,7 +59,7 @@
               try {
                   Thread.sleep(100); //simulate work
               }catch (InterruptedException x) {
-                  Thread.currentThread().interrupted();
+                  Thread.interrupted();
               }
           }
           con = future.get(); //should return instantly 

Modified: tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/TestAsyncQueue.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/TestAsyncQueue.java?rev=734838&r1=734837&r2=734838&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/TestAsyncQueue.java (original)
+++ tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/TestAsyncQueue.java Thu Jan 15 14:08:17 2009
@@ -52,11 +52,11 @@
         Future<Object> future = queue.pollAsync();
         try {
             future.get(2000, TimeUnit.MILLISECONDS);
-            this.assertFalse("Request should have timed out",true);
+            assertFalse("Request should have timed out",true);
         }catch (TimeoutException x) {
-            this.assertTrue("Request timed out properly",true);
+            assertTrue("Request timed out properly",true);
         }catch (Exception x) {
-            this.assertTrue("Request threw an error",false);
+            assertTrue("Request threw an error",false);
             x.printStackTrace();
         }
         assertEquals(future.get(),item);
@@ -74,7 +74,7 @@
         }
         public void run() {
             try {
-                this.sleep(delay);
+                sleep(delay);
             }catch (Exception ignore){}
             offered = true;
             TestAsyncQueue.this.queue.offer(item);

Modified: tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/TwoDataSources.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/TwoDataSources.java?rev=734838&r1=734837&r2=734838&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/TwoDataSources.java (original)
+++ tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/TwoDataSources.java Thu Jan 15 14:08:17 2009
@@ -39,26 +39,26 @@
         Thread.sleep(15000);
         try {
             c1.createStatement();
-            this.assertTrue("Connection should have been abandoned.",false);
+            assertTrue("Connection should have been abandoned.",false);
         }catch (Exception x) {
-            this.assertTrue("This is correct, c1 is abandoned",true);
+            assertTrue("This is correct, c1 is abandoned",true);
         }
 
         try {
             c2.createStatement();
-            this.assertTrue("Connection should not have been abandoned.",true);
+            assertTrue("Connection should not have been abandoned.",true);
         }catch (Exception x) {
-            this.assertTrue("Connection c2 should be working",false);
+            assertTrue("Connection c2 should be working",false);
         }
         try {
-            this.assertTrue("Connection should have been closed.",c1.isClosed());
+            assertTrue("Connection should have been closed.",c1.isClosed());
         }catch (Exception x) {
-            this.assertTrue("This is correct, c1 is closed",true);
+            assertTrue("This is correct, c1 is closed",true);
         }
         try {
-            this.assertFalse("Connection c2 should not have been closed.",c2.isClosed());
+            assertFalse("Connection c2 should not have been closed.",c2.isClosed());
         }catch (Exception x) {
-            this.assertTrue("Connection c2 should be working",false);
+            assertTrue("Connection c2 should be working",false);
         }
         
 



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