commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1152274 - /commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/AbandonedTrace.java
Date Fri, 29 Jul 2011 15:42:04 GMT
Author: markt
Date: Fri Jul 29 15:42:03 2011
New Revision: 1152274

URL: http://svn.apache.org/viewvc?rev=1152274&view=rev
Log:
Generics

Modified:
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/AbandonedTrace.java

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/AbandonedTrace.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/AbandonedTrace.java?rev=1152274&r1=1152273&r2=1152274&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/AbandonedTrace.java (original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/AbandonedTrace.java Fri Jul
29 15:42:03 2011
@@ -40,7 +40,8 @@ public class AbandonedTrace {
     /** A stack trace of the code that created me (if in debug mode) */
     private volatile Exception createdBy;
     /** A list of objects created by children of this object */
-    private final List traceList = new ArrayList();
+    private final List<AbandonedTrace> traceList =
+        new ArrayList<AbandonedTrace>();
     /** Last time this connection was used */
     private volatile long lastUsed = 0;
 
@@ -168,9 +169,9 @@ public class AbandonedTrace {
      *
      * @return List of objects
      */
-    protected List getTrace() {
+    protected List<AbandonedTrace> getTrace() {
         synchronized (this.traceList) {
-            return new ArrayList(traceList);
+            return new ArrayList<AbandonedTrace>(traceList);
         }
     }
 
@@ -183,9 +184,9 @@ public class AbandonedTrace {
             createdBy.printStackTrace(config.getLogWriter());
         }
         synchronized(this.traceList) {
-            Iterator it = this.traceList.iterator();
+            Iterator<AbandonedTrace> it = this.traceList.iterator();
             while (it.hasNext()) {
-                AbandonedTrace at = (AbandonedTrace)it.next();
+                AbandonedTrace at = it.next();
                 at.printStackTrace();
             }
         }



Mime
View raw message