You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2019/10/25 10:37:30 UTC

[tomcat] 13/15: Generics.

This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 7.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit b18ab5fb864b39b3af32090d85169e4b6887a37b
Author: psteitz <ps...@apache.org>
AuthorDate: Sun Oct 20 12:03:49 2019 -0700

    Generics.
---
 test/org/apache/tomcat/dbcp/dbcp/TestConnectionPool.java      | 4 ++--
 test/org/apache/tomcat/dbcp/dbcp/TesterCallableStatement.java | 4 ++--
 test/org/apache/tomcat/dbcp/dbcp/TesterConnection.java        | 6 +++---
 test/org/apache/tomcat/dbcp/dbcp/TesterResultSet.java         | 5 +++--
 4 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/test/org/apache/tomcat/dbcp/dbcp/TestConnectionPool.java b/test/org/apache/tomcat/dbcp/dbcp/TestConnectionPool.java
index b458263..f0ea905 100644
--- a/test/org/apache/tomcat/dbcp/dbcp/TestConnectionPool.java
+++ b/test/org/apache/tomcat/dbcp/dbcp/TestConnectionPool.java
@@ -73,7 +73,7 @@ public abstract class TestConnectionPool extends TestCase {
     }
     
     /** Connections opened during the course of a test */
-    protected Stack connections = new Stack();
+    protected Stack<Connection> connections = new Stack<Connection>();
     
     /** Acquire a connection and push it onto the connections stack */
     protected Connection newConnection() throws Exception {
@@ -520,7 +520,7 @@ public abstract class TestConnectionPool extends TestCase {
      */
     public void testHashing() throws Exception {
         Connection con = getConnection();
-        Hashtable hash = new Hashtable();
+        Hashtable<Connection, String> hash = new Hashtable<Connection, String>();
         hash.put(con, "test");
         assertEquals("test", hash.get(con));
         assertTrue(hash.containsKey(con));
diff --git a/test/org/apache/tomcat/dbcp/dbcp/TesterCallableStatement.java b/test/org/apache/tomcat/dbcp/dbcp/TesterCallableStatement.java
index d463cc1..a4b9a42 100644
--- a/test/org/apache/tomcat/dbcp/dbcp/TesterCallableStatement.java
+++ b/test/org/apache/tomcat/dbcp/dbcp/TesterCallableStatement.java
@@ -132,7 +132,7 @@ public class TesterCallableStatement extends TesterPreparedStatement implements
         return null;
     }
 
-    public Object getObject(int i, Map map) throws SQLException {
+    public Object getObject(int i, Map<String,Class<?>> map) throws SQLException {
         return null;
     }
 
@@ -311,7 +311,7 @@ public class TesterCallableStatement extends TesterPreparedStatement implements
         return null;
     }
 
-    public Object getObject(String parameterName, Map map) throws SQLException {
+    public Object getObject(String parameterName, Map<String,Class<?>> map) throws SQLException {
         return null;
     }
 
diff --git a/test/org/apache/tomcat/dbcp/dbcp/TesterConnection.java b/test/org/apache/tomcat/dbcp/dbcp/TesterConnection.java
index 8b14447..9e4e492 100644
--- a/test/org/apache/tomcat/dbcp/dbcp/TesterConnection.java
+++ b/test/org/apache/tomcat/dbcp/dbcp/TesterConnection.java
@@ -50,7 +50,7 @@ public class TesterConnection implements Connection {
     protected int _transactionIsolation = 1;
     protected DatabaseMetaData _metaData = new TesterDatabaseMetaData();
     protected String _catalog = null;
-    protected Map _typeMap = null;
+    protected Map<String,Class<?>> _typeMap = null;
     protected boolean _readOnly = false;
     protected SQLWarning warnings = null;
     protected String username = null;
@@ -117,7 +117,7 @@ public class TesterConnection implements Connection {
         return _transactionIsolation;
     }
 
-    public Map getTypeMap() throws SQLException {
+    public Map<String,Class<?>> getTypeMap() throws SQLException {
         checkOpen();
         return _typeMap;
     }
@@ -199,7 +199,7 @@ public class TesterConnection implements Connection {
         _transactionIsolation = level;
     }
 
-    public void setTypeMap(Map map) throws SQLException {
+    public void setTypeMap(Map<String,Class<?>> map) throws SQLException {
         checkOpen();
         _typeMap = map;
     }
diff --git a/test/org/apache/tomcat/dbcp/dbcp/TesterResultSet.java b/test/org/apache/tomcat/dbcp/dbcp/TesterResultSet.java
index 410ecfc..6d562f4 100644
--- a/test/org/apache/tomcat/dbcp/dbcp/TesterResultSet.java
+++ b/test/org/apache/tomcat/dbcp/dbcp/TesterResultSet.java
@@ -28,6 +28,7 @@ import java.sql.SQLException;
 import java.sql.SQLWarning;
 import java.sql.Statement;
 import java.util.Calendar;
+import java.util.Map;
 /* JDBC_4_ANT_KEY_BEGIN */
 import java.io.InputStream;
 import java.io.Reader;
@@ -632,7 +633,7 @@ public class TesterResultSet implements ResultSet {
     }
 
 
-    public Object getObject(int i, java.util.Map map) throws SQLException {
+    public Object getObject(int i, Map<String,Class<?>> map) throws SQLException {
         checkOpen();
         return new Object();
     }
@@ -657,7 +658,7 @@ public class TesterResultSet implements ResultSet {
         return null;
     }
 
-    public Object getObject(String colName, java.util.Map map) throws SQLException {
+    public Object getObject(String colName, Map<String,Class<?>> map) throws SQLException {
         checkOpen();
         return colName;
     }


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