tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1380376 - in /tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc: bugs/Bug51582.java test/EqualsHashCodeTest.java test/JmxPasswordTest.java test/TestAsyncQueue.java
Date Mon, 03 Sep 2012 21:40:38 GMT
Author: markt
Date: Mon Sep  3 21:40:37 2012
New Revision: 1380376

URL: http://svn.apache.org/viewvc?rev=1380376&view=rev
Log:
Clean-up
- Java 7 <>
- unused code
- autoboxing

Modified:
    tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/bugs/Bug51582.java
    tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/EqualsHashCodeTest.java
    tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/JmxPasswordTest.java
    tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestAsyncQueue.java

Modified: tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/bugs/Bug51582.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/bugs/Bug51582.java?rev=1380376&r1=1380375&r2=1380376&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/bugs/Bug51582.java
(original)
+++ tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/bugs/Bug51582.java
Mon Sep  3 21:40:37 2012
@@ -69,7 +69,7 @@ public class Bug51582
       final Connection connection = pool.getConnection();
       final CallableStatement s = connection.prepareCall("{CALL SLEEP()}");
 
-      List<Thread> threadList = new ArrayList<Thread>();
+      List<Thread> threadList = new ArrayList<>();
 
       for (int l = 0; l < 3; l++)
       {

Modified: tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/EqualsHashCodeTest.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/EqualsHashCodeTest.java?rev=1380376&r1=1380375&r2=1380376&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/EqualsHashCodeTest.java
(original)
+++ tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/EqualsHashCodeTest.java
Mon Sep  3 21:40:37 2012
@@ -20,7 +20,6 @@ import java.sql.Connection;
 
 import javax.sql.PooledConnection;
 
-import org.apache.tomcat.jdbc.pool.ConnectionPool;
 import org.apache.tomcat.jdbc.test.driver.Driver;
 
 public class EqualsHashCodeTest extends DefaultTestCase{
@@ -42,7 +41,7 @@ public class EqualsHashCodeTest extends 
         this.datasource.setMaxIdle(datasource.getMaxActive());
         this.datasource.setUsername(username);
         this.datasource.getConnection().close();
-        ConnectionPool pool = datasource.createPool();
+        datasource.createPool();
     }
 
     public void testEquals() throws Exception {
@@ -67,7 +66,7 @@ public class EqualsHashCodeTest extends 
         assertEquals(con1.hashCode(), con1.hashCode());
         Connection con2 = datasource.getConnection();
         assertEquals(con2.hashCode(), con2.hashCode());
-        assertNotSame(con1.hashCode(), con2.hashCode());
+        assertTrue(con1.hashCode() != con2.hashCode());
         con2.close();
         assertEquals(con2.hashCode(), con2.hashCode());
     }

Modified: tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/JmxPasswordTest.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/JmxPasswordTest.java?rev=1380376&r1=1380375&r2=1380376&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/JmxPasswordTest.java
(original)
+++ tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/JmxPasswordTest.java
Mon Sep  3 21:40:37 2012
@@ -48,7 +48,7 @@ public class JmxPasswordTest extends Def
         this.datasource.getConnection().close();
         MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
         String domain = "tomcat.jdbc";
-        Hashtable<String,String> properties = new Hashtable<String,String>();
+        Hashtable<String,String> properties = new Hashtable<>();
         properties.put("type", "ConnectionPool");
         properties.put("class", this.getClass().getName());
         oname = new ObjectName(domain,properties);

Modified: tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestAsyncQueue.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestAsyncQueue.java?rev=1380376&r1=1380375&r2=1380376&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestAsyncQueue.java
(original)
+++ tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestAsyncQueue.java
Mon Sep  3 21:40:37 2012
@@ -30,7 +30,7 @@ public class TestAsyncQueue extends Test
     @Override
     protected void setUp() throws Exception {
         super.setUp();
-        this.queue = new FairBlockingQueue<Object>();
+        this.queue = new FairBlockingQueue<>();
     }
 
     @Override



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


Mime
View raw message