Some generics fixes
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sat, 7 Mar 2009 19:50:34 +0000 (19:50 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sat, 7 Mar 2009 19:50:34 +0000 (19:50 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@751315 13f79535-47bb-0310-9956-ffa450edef68

modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/interceptor/AbstractQueryReport.java
modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReport.java
modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/interceptor/StatementFinalizer.java

index 3400611..fe8b26e 100644 (file)
@@ -43,7 +43,8 @@ public abstract class AbstractQueryReport extends AbstractCreateStatementInterce
     /**
      * the constructors that are used to create statement proxies 
      */
-    protected static final Constructor[] constructors = new Constructor[AbstractCreateStatementInterceptor.statements.length];
+    protected static final Constructor<?>[] constructors =
+        new Constructor[AbstractCreateStatementInterceptor.statements.length];
 
     
     public AbstractQueryReport() {
@@ -147,9 +148,9 @@ public abstract class AbstractQueryReport extends AbstractCreateStatementInterce
      * @return - returns a constructor used to create new instances
      * @throws NoSuchMethodException
      */
-    protected Constructor getConstructor(int idx, Class clazz) throws NoSuchMethodException {
+    protected Constructor<?> getConstructor(int idx, Class<?> clazz) throws NoSuchMethodException {
         if (constructors[idx]==null) {
-            Class proxyClass = Proxy.getProxyClass(SlowQueryReport.class.getClassLoader(), new Class[] {clazz});
+            Class<?> proxyClass = Proxy.getProxyClass(SlowQueryReport.class.getClassLoader(), new Class[] {clazz});
             constructors[idx] = proxyClass.getConstructor(new Class[] { InvocationHandler.class });
         }
         return constructors[idx];
@@ -164,7 +165,7 @@ public abstract class AbstractQueryReport extends AbstractCreateStatementInterce
             Object result = null;
             String name = method.getName();
             String sql = null;
-            Constructor constructor = null;
+            Constructor<?> constructor = null;
             if (compare(statements[0],name)) {
                 //createStatement
                 constructor = getConstructor(0,Statement.class);
index a6be343..289c5b7 100644 (file)
@@ -224,7 +224,7 @@ public class SlowQueryReport extends AbstractQueryReport  {
             "The date and time of the last invocation"
         };
         
-        static final OpenType[] FIELD_TYPES = new OpenType[] { 
+        static final OpenType<?>[] FIELD_TYPES = new OpenType[] { 
             SimpleType.STRING,
             SimpleType.INTEGER,
             SimpleType.LONG,
@@ -258,7 +258,7 @@ public class SlowQueryReport extends AbstractQueryReport  {
             return FIELD_DESCRIPTIONS;
         }
         
-        public static OpenType[] getFieldTypes() {
+        public static OpenType<?>[] getFieldTypes() {
             return FIELD_TYPES;
         }
         
index 51ae467..d947353 100644 (file)
@@ -39,7 +39,7 @@ public class StatementFinalizer extends AbstractCreateStatementInterceptor {
     public Object createStatement(Object proxy, Method method, Object[] args, Object statement, long time) {
         // TODO Auto-generated method stub
         try {
-            statements.add(new WeakReference((Statement)statement));
+            statements.add(new WeakReference<Statement>((Statement)statement));
         }catch (ClassCastException x) {
             //ignore this one
         }