tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1416450 - in /tomcat/tc7.0.x/trunk: ./ modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/ webapps/docs/
Date Mon, 03 Dec 2012 11:15:14 GMT
Author: markt
Date: Mon Dec  3 11:15:12 2012
New Revision: 1416450

URL: http://svn.apache.org/viewvc?rev=1416450&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=53565
Fix a handful of Eclipse warnings in the JDBC pool source code

Modified:
    tomcat/tc7.0.x/trunk/   (props changed)
    tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/FairBlockingQueue.java
    tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/MultiLockFairBlockingQueue.java
    tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReport.java
    tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementDecoratorInterceptor.java
    tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml

Propchange: tomcat/tc7.0.x/trunk/
------------------------------------------------------------------------------
  Merged /tomcat/trunk:r1406526

Modified: tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/FairBlockingQueue.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/FairBlockingQueue.java?rev=1416450&r1=1416449&r2=1416450&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/FairBlockingQueue.java
(original)
+++ tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/FairBlockingQueue.java
Mon Dec  3 11:15:12 2012
@@ -503,6 +503,7 @@ public class FairBlockingQueue<E> implem
         int index;
         E element = null;
 
+        @SuppressWarnings("unchecked") // Can't create arrays of generic types
         public FairIterator() {
             final ReentrantLock lock = FairBlockingQueue.this.lock;
             lock.lock();

Modified: tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/MultiLockFairBlockingQueue.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/MultiLockFairBlockingQueue.java?rev=1416450&r1=1416449&r2=1416450&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/MultiLockFairBlockingQueue.java
(original)
+++ tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/MultiLockFairBlockingQueue.java
Mon Dec  3 11:15:12 2012
@@ -80,6 +80,7 @@ public class MultiLockFairBlockingQueue<
     /**
      * Creates a new fair blocking queue.
      */
+    @SuppressWarnings("unchecked") // Can create arrays of generic types
     public MultiLockFairBlockingQueue() {
         items = new LinkedList[LOCK_COUNT];
         waiters = new LinkedList[LOCK_COUNT];
@@ -520,6 +521,7 @@ public class MultiLockFairBlockingQueue<
         int index;
         E element = null;
 
+        @SuppressWarnings("unchecked") // Can't create arrays of generic types
         public FairIterator() {
             ArrayList<E> list = new ArrayList<E>(MultiLockFairBlockingQueue.this.size());
             for (int idx=0; idx<LOCK_COUNT; idx++) {

Modified: tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReport.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReport.java?rev=1416450&r1=1416449&r2=1416450&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReport.java
(original)
+++ tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReport.java
Mon Dec  3 11:15:12 2012
@@ -16,8 +16,11 @@
  */
 package org.apache.tomcat.jdbc.pool.interceptor;
 
+import java.text.SimpleDateFormat;
 import java.util.Iterator;
+import java.util.Locale;
 import java.util.Map;
+import java.util.TimeZone;
 import java.util.concurrent.ConcurrentHashMap;
 
 import javax.management.openmbean.CompositeDataSupport;
@@ -116,13 +119,13 @@ public class SlowQueryReport extends Abs
     @Override
     public void prepareStatement(String sql, long time) {
         QueryStats qs = getQueryStats(sql);
-        qs.prepare(time, System.currentTimeMillis());
+        qs.prepare(time);
     }
 
     @Override
     public void prepareCall(String sql, long time) {
         QueryStats qs = getQueryStats(sql);
-        qs.prepare(time, System.currentTimeMillis());
+        qs.prepare(time);
     }
 
     /**
@@ -287,6 +290,9 @@ public class SlowQueryReport extends Abs
 
         @Override
         public String toString() {
+            SimpleDateFormat sdf =
+                    new SimpleDateFormat("d MMM yyyy HH:mm:ss z", Locale.US);
+            sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
             StringBuilder buf = new StringBuilder("QueryStats[query:");
             buf.append(query);
             buf.append(", nrOfInvocations:");
@@ -294,11 +300,11 @@ public class SlowQueryReport extends Abs
             buf.append(", maxInvocationTime:");
             buf.append(maxInvocationTime);
             buf.append(", maxInvocationDate:");
-            buf.append(new java.util.Date(maxInvocationDate).toGMTString());
+            buf.append(sdf.format(new java.util.Date(maxInvocationDate)));
             buf.append(", minInvocationTime:");
             buf.append(minInvocationTime);
             buf.append(", minInvocationDate:");
-            buf.append(new java.util.Date(minInvocationDate).toGMTString());
+            buf.append(sdf.format(new java.util.Date(minInvocationDate)));
             buf.append(", totalInvocationTime:");
             buf.append(totalInvocationTime);
             buf.append(", averageInvocationTime:");
@@ -334,7 +340,7 @@ public class SlowQueryReport extends Abs
             this.query = query;
         }
 
-        public void prepare(long invocationTime, long now) {
+        public void prepare(long invocationTime) {
             prepareCount++;
             prepareTime+=invocationTime;
 

Modified: tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementDecoratorInterceptor.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementDecoratorInterceptor.java?rev=1416450&r1=1416449&r2=1416450&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementDecoratorInterceptor.java
(original)
+++ tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementDecoratorInterceptor.java
Mon Dec  3 11:15:12 2012
@@ -126,6 +126,20 @@ public class StatementDecoratorIntercept
         return statement;
     }
 
+    /**
+     * Creates a proxy for a Statement.
+     *
+     * @param proxy         The proxy object on which the method that triggered
+     *                          the creation of the statement was called.
+     * @param method        The method that was called on the proxy
+     * @param args          The arguments passed as part of the method call to
+     *                          the proxy
+     * @param statement     The statement object that is to be proxied
+     * @param constructor   The constructor for the desired proxy
+     * @param sql           The sql of of the statement
+     *
+     * @return  A new proxy for the Statement
+     */
     protected Object createDecorator(Object proxy, Method method, Object[] args,
                                      Object statement, Constructor<?> constructor,
String sql)
     throws InstantiationException, IllegalAccessException, InvocationTargetException {

Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1416450&r1=1416449&r2=1416450&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Mon Dec  3 11:15:12 2012
@@ -88,6 +88,14 @@
       </fix>
     </changelog>
   </subsection>
+  <subsection name="jdbc-pool">
+    <changelog>
+      <scode>
+        Fix a handful of Eclipse warnings in the JDBC pool source code including
+        the warnings reported in <bug>53565</bug>. (markt)
+      </scode>
+    </changelog>
+  </subsection>
   <subsection name="Other">
     <changelog>
       <update>



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


Mime
View raw message