tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1402014 - in /tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc: naming/ pool/interceptor/
Date Thu, 25 Oct 2012 08:17:13 GMT
Author: markt
Date: Thu Oct 25 08:17:13 2012
New Revision: 1402014

URL: http://svn.apache.org/viewvc?rev=1402014&view=rev
Log:
Fix some Eclipse warnings

Modified:
    tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/naming/GenericNamingResourcesFactory.java
    tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReport.java
    tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReportJmx.java
    tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementCache.java
    tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementDecoratorInterceptor.java
    tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementFinalizer.java

Modified: tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/naming/GenericNamingResourcesFactory.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/naming/GenericNamingResourcesFactory.java?rev=1402014&r1=1402013&r2=1402014&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/naming/GenericNamingResourcesFactory.java
(original)
+++ tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/naming/GenericNamingResourcesFactory.java
Thu Oct 25 08:17:13 2012
@@ -66,7 +66,7 @@ public class GenericNamingResourcesFacto
             if (addr.getContent()!=null) {
                 value = addr.getContent().toString();
             }
-            if (setProperty(o, param, value,false)) {
+            if (setProperty(o, param, value)) {
 
             } else {
                 log.debug("Property not configured["+param+"]. No setter found on["+o+"].");
@@ -75,7 +75,8 @@ public class GenericNamingResourcesFacto
         return o;
     }
 
-    public static boolean setProperty(Object o, String name, String value,boolean invokeSetProperty)
{
+    @SuppressWarnings("null") // setPropertyMethodVoid can't be null when used
+    private static boolean setProperty(Object o, String name, String value) {
         if (log.isDebugEnabled())
             log.debug("IntrospectionUtils: setProperty(" +
                     o.getClass() + " " + name + "=" + value + ")");

Modified: tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReport.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReport.java?rev=1402014&r1=1402013&r2=1402014&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReport.java
(original)
+++ tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReport.java
Thu Oct 25 08:17:13 2012
@@ -45,7 +45,7 @@ public class SlowQueryReport extends Abs
      * we will be keeping track of query stats on a per pool basis
      */
     protected static ConcurrentHashMap<String,ConcurrentHashMap<String,QueryStats>>
perPoolStats =
-        new ConcurrentHashMap<String,ConcurrentHashMap<String,QueryStats>>();
+        new ConcurrentHashMap<>();
     /**
      * the queries that are used for this interceptor.
      */
@@ -137,7 +137,7 @@ public class SlowQueryReport extends Abs
             //create the map to hold our stats
             //however TODO we need to improve the eviction
             //selection
-            queries = new ConcurrentHashMap<String,QueryStats>();
+            queries = new ConcurrentHashMap<>();
             if (perPoolStats.putIfAbsent(pool.getName(), queries)!=null) {
                 //there already was one
                 queries = SlowQueryReport.perPoolStats.get(pool.getName());

Modified: tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReportJmx.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReportJmx.java?rev=1402014&r1=1402013&r2=1402014&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReportJmx.java
(original)
+++ tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReportJmx.java
Thu Oct 25 08:17:13 2012
@@ -66,7 +66,7 @@ public class SlowQueryReportJmx extends 
 
 
     protected static ConcurrentHashMap<String,SlowQueryReportJmxMBean> mbeans =
-        new ConcurrentHashMap<String,SlowQueryReportJmxMBean>();
+        new ConcurrentHashMap<>();
 
 
     //==============================JMX STUFF========================

Modified: tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementCache.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementCache.java?rev=1402014&r1=1402013&r2=1402014&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementCache.java
(original)
+++ tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementCache.java
Thu Oct 25 08:17:13 2012
@@ -87,7 +87,7 @@ public class StatementCache extends Stat
 
     /*begin the cache size*/
     private static ConcurrentHashMap<ConnectionPool,AtomicInteger> cacheSizeMap =
-        new ConcurrentHashMap<ConnectionPool,AtomicInteger>();
+        new ConcurrentHashMap<>();
 
     private AtomicInteger cacheSize;
 
@@ -115,7 +115,8 @@ public class StatementCache extends Stat
             cacheSize = cacheSizeMap.get(parent);
             this.pcon = con;
             if (!pcon.getAttributes().containsKey(STATEMENT_CACHE_ATTR)) {
-                ConcurrentHashMap<String,CachedStatement> cache = new ConcurrentHashMap<String,
CachedStatement>();
+                ConcurrentHashMap<String,CachedStatement> cache =
+                        new ConcurrentHashMap<>();
                 pcon.getAttributes().put(STATEMENT_CACHE_ATTR,cache);
             }
         }

Modified: tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementDecoratorInterceptor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementDecoratorInterceptor.java?rev=1402014&r1=1402013&r2=1402014&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementDecoratorInterceptor.java
(original)
+++ tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementDecoratorInterceptor.java
Thu Oct 25 08:17:13 2012
@@ -131,7 +131,7 @@ public class StatementDecoratorIntercept
     throws InstantiationException, IllegalAccessException, InvocationTargetException {
         Object result = null;
         StatementProxy<Statement> statementProxy =
-                new StatementProxy<Statement>((Statement)statement,sql);
+                new StatementProxy<>((Statement)statement,sql);
         result = constructor.newInstance(new Object[] { statementProxy });
         statementProxy.setActualProxy(result);
         statementProxy.setConnection(proxy);

Modified: tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementFinalizer.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementFinalizer.java?rev=1402014&r1=1402013&r2=1402014&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementFinalizer.java
(original)
+++ tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementFinalizer.java
Thu Oct 25 08:17:13 2012
@@ -34,14 +34,14 @@ import org.apache.tomcat.jdbc.pool.Poole
 public class StatementFinalizer extends AbstractCreateStatementInterceptor {
     private static final Log log = LogFactory.getLog(StatementFinalizer.class);
 
-    protected ArrayList<WeakReference<Statement>> statements = new ArrayList<WeakReference<Statement>>();
+    protected ArrayList<WeakReference<Statement>> statements = new ArrayList<>();
 
     @Override
     public Object createStatement(Object proxy, Method method, Object[] args, Object statement,
long time) {
         // TODO Auto-generated method stub
         try {
             if (statement instanceof Statement)
-                statements.add(new WeakReference<Statement>((Statement)statement));
+                statements.add(new WeakReference<>((Statement)statement));
         }catch (ClassCastException x) {
             //ignore this one
         }



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


Mime
View raw message