jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1521338 - /jmeter/trunk/src/protocol/jdbc/org/apache/jmeter/protocol/jdbc/AbstractJDBCTestElement.java
Date Tue, 10 Sep 2013 01:50:10 GMT
Author: sebb
Date: Tue Sep 10 01:50:09 2013
New Revision: 1521338

URL: http://svn.apache.org/r1521338
Log:
Fix Eclipse compiler warnings

Modified:
    jmeter/trunk/src/protocol/jdbc/org/apache/jmeter/protocol/jdbc/AbstractJDBCTestElement.java

Modified: jmeter/trunk/src/protocol/jdbc/org/apache/jmeter/protocol/jdbc/AbstractJDBCTestElement.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/jdbc/org/apache/jmeter/protocol/jdbc/AbstractJDBCTestElement.java?rev=1521338&r1=1521337&r2=1521338&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/jdbc/org/apache/jmeter/protocol/jdbc/AbstractJDBCTestElement.java
(original)
+++ jmeter/trunk/src/protocol/jdbc/org/apache/jmeter/protocol/jdbc/AbstractJDBCTestElement.java
Tue Sep 10 01:50:09 2013
@@ -36,6 +36,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 
+import org.apache.commons.collections.map.LRUMap;
 import org.apache.jmeter.samplers.SampleResult;
 import org.apache.jmeter.save.CSVSaveService;
 import org.apache.jmeter.testelement.AbstractTestElement;
@@ -327,15 +328,17 @@ public abstract class AbstractJDBCTestEl
     private PreparedStatement getPreparedStatement(Connection conn, boolean callable) throws
SQLException {
         Map<String, PreparedStatement> preparedStatementMap = perConnCache.get(conn);
         if (null == preparedStatementMap ) {
-            preparedStatementMap = Collections.<String, PreparedStatement>synchronizedMap(
-                    new org.apache.commons.collections.map.LRUMap(MAX_OPEN_PREPARED_STATEMENTS)
{
+            @SuppressWarnings("unchecked") // LRUMap is not generic
+            Map<String, PreparedStatement> lruMap = new LRUMap(MAX_OPEN_PREPARED_STATEMENTS)
{
+                private static final long serialVersionUID = 1L;
                 @Override
                 protected boolean removeLRU(LinkEntry entry) {
                     PreparedStatement preparedStatement = (PreparedStatement)entry.getValue();
                     close(preparedStatement);
                     return true;
-                }  
-            });
+                }
+            };
+            preparedStatementMap = Collections.<String, PreparedStatement>synchronizedMap(lruMap);
             // As a connection is held by only one thread, we cannot already have a 
             // preparedStatementMap put by another thread
             perConnCache.put(conn, preparedStatementMap);



Mime
View raw message