tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fha...@apache.org
Subject svn commit: r801283 - in /tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool: ./ interceptor/
Date Wed, 05 Aug 2009 16:10:05 GMT
Author: fhanik
Date: Wed Aug  5 16:10:05 2009
New Revision: 801283

URL: http://svn.apache.org/viewvc?rev=801283&view=rev
Log:
patch by sebb for 
https://issues.apache.org/bugzilla/show_bug.cgi?id=47577

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/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/MultiLockFairBlockingQueue.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/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=801283&r1=801282&r2=801283&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 Wed
Aug  5 16:10:05 2009
@@ -143,10 +143,10 @@
      */
     public Future<Connection> getConnectionAsync() throws SQLException {
         //we can only retrieve a future if the underlying queue supports it.
-        if (idle instanceof FairBlockingQueue) {
+        if (idle instanceof FairBlockingQueue<?>) {
             Future<PooledConnection> pcf = ((FairBlockingQueue<PooledConnection>)idle).pollAsync();
             return new ConnectionFuture(pcf);
-        } else if (idle instanceof MultiLockFairBlockingQueue) {
+        } else if (idle instanceof MultiLockFairBlockingQueue<?>) {
                 Future<PooledConnection> pcf = ((MultiLockFairBlockingQueue<PooledConnection>)idle).pollAsync();
                 return new ConnectionFuture(pcf);
         } else {
@@ -1069,6 +1069,7 @@
             }
         }
 
+        @Override
         public void run() {
             while (run) {
                 try {

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=801283&r1=801282&r2=801283&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 Wed
Aug  5 16:10:05 2009
@@ -188,6 +188,7 @@
         else return p.getSize();
     }
 
+    @Override
     public String toString() {
         return super.toString()+"{"+getPoolProperties()+"}";
     }

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=801283&r1=801282&r2=801283&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
Wed Aug  5 16:10:05 2009
@@ -185,11 +185,11 @@
                 waiters.addLast(c);
                 lock.unlock();
                 //return a future that will wait for the object
-                result = new ItemFuture(c);
+                result = new ItemFuture<E>(c);
             } else {
                 lock.unlock();
                 //return a future with the item
-                result = new ItemFuture(item);
+                result = new ItemFuture<E>(item);
             }
             error = false;
         } finally {

Modified: tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/MultiLockFairBlockingQueue.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/MultiLockFairBlockingQueue.java?rev=801283&r1=801282&r2=801283&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/MultiLockFairBlockingQueue.java
(original)
+++ tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/MultiLockFairBlockingQueue.java
Wed Aug  5 16:10:05 2009
@@ -196,11 +196,11 @@
                 waiters[idx].addLast(c);
                 lock.unlock();
                 //return a future that will wait for the object
-                result = new ItemFuture(c);
+                result = new ItemFuture<E>(c);
             } else {
                 lock.unlock();
                 //return a future with the item
-                result = new ItemFuture(item);
+                result = new ItemFuture<E>(item);
             }
             error = false;
         } finally {
@@ -323,9 +323,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/PoolProperties.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/PoolProperties.java?rev=801283&r1=801282&r2=801283&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 Wed
Aug  5 16:10:05 2009
@@ -651,6 +651,7 @@
         this.interceptors = null;
     }
 
+    @Override
     public String toString() {
         StringBuffer buf = new StringBuffer("ConnectionPool[");
         try {
@@ -786,9 +787,11 @@
         public String getValue() {
             return value;
         }
+        @Override
         public int hashCode() {
             return name.hashCode();
         }
+        @Override
         public boolean equals(Object o) {
             if (o==this) return true;
             if (o instanceof InterceptorProperty) {

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=801283&r1=801282&r2=801283&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
Wed Aug  5 16:10:05 2009
@@ -291,7 +291,8 @@
      *  
      * @return true if the connection was validated successfully. It returns true even if
validation was not performed, such as when 
      * {@link PoolConfiguration#setValidationInterval(long)} has been called with a positive
value. 
-     * @return false if the validation failed. The caller should close the connection if
false is returned since a session could have been left in 
+     * <p>
+     * false if the validation failed. The caller should close the connection if false is
returned since a session could have been left in 
      * an unknown state during initialization.
      */
     public boolean validate(int validateAction,String sql) {
@@ -322,7 +323,7 @@
         Statement stmt = null;
         try {
             stmt = connection.createStatement();
-            boolean exec = stmt.execute(query);
+            stmt.execute(query);
             stmt.close();
             this.lastValidated = now;
             return true;
@@ -516,6 +517,7 @@
         this.handler = handler;
     }
     
+    @Override
     public String toString() {
         return "PooledConnection["+(connection!=null?connection.toString():"null")+"]";
     }

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=801283&r1=801282&r2=801283&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 Wed
Aug  5 16:10:05 2009
@@ -59,6 +59,7 @@
         setUseEquals(useEquals);
     }
 
+    @Override
     public void reset(ConnectionPool parent, PooledConnection con) {
         this.pool = parent;
         this.connection = con;
@@ -77,6 +78,7 @@
         }
     }
 
+    @Override
     public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
         if (compare(ISCLOSED_VAL,method)) {
             return Boolean.valueOf(isClosed());
@@ -117,6 +119,7 @@
         return pool;
     }
     
+    @Override
     public String toString() {
         return "ProxyConnection["+(connection!=null?connection.toString():"null")+"]";
     }

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=801283&r1=801282&r2=801283&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
Wed Aug  5 16:10:05 2009
@@ -52,6 +52,7 @@
     protected String catalog = null;
     
     
+    @Override
     public void reset(ConnectionPool parent, PooledConnection con) {
         if (parent==null || con==null) return;
         PoolConfiguration poolProperties = parent.getPoolProperties();

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=801283&r1=801282&r2=801283&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
Wed Aug  5 16:10:05 2009
@@ -287,6 +287,7 @@
             return FIELD_TYPES;
         }
         
+        @Override
         public String toString() {
             StringBuffer buf = new StringBuffer("QueryStats[query:");
             buf.append(query);
@@ -390,10 +391,12 @@
             return totalInvocationTime;
         }
 
+        @Override
         public int hashCode() {
             return query.hashCode();
         }
         
+        @Override
         public boolean equals(Object other) {
             if (other instanceof QueryStats) {
                 QueryStats qs = (QueryStats)other;



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


Mime
View raw message