commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nia...@apache.org
Subject svn commit: r982093 - /commons/proper/io/trunk/src/java/org/apache/commons/io/FileCleaningTracker.java
Date Wed, 04 Aug 2010 00:33:52 GMT
Author: niallp
Date: Wed Aug  4 00:33:52 2010
New Revision: 982093

URL: http://svn.apache.org/viewvc?rev=982093&view=rev
Log:
IO-220 FileCleaningTracker Vector performs badly under load

Modified:
    commons/proper/io/trunk/src/java/org/apache/commons/io/FileCleaningTracker.java

Modified: commons/proper/io/trunk/src/java/org/apache/commons/io/FileCleaningTracker.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/java/org/apache/commons/io/FileCleaningTracker.java?rev=982093&r1=982092&r2=982093&view=diff
==============================================================================
--- commons/proper/io/trunk/src/java/org/apache/commons/io/FileCleaningTracker.java (original)
+++ commons/proper/io/trunk/src/java/org/apache/commons/io/FileCleaningTracker.java Wed Aug
 4 00:33:52 2010
@@ -20,7 +20,8 @@ import java.io.File;
 import java.lang.ref.PhantomReference;
 import java.lang.ref.ReferenceQueue;
 import java.util.Collection;
-import java.util.Vector;
+import java.util.Collections;
+import java.util.HashSet;
 
 /**
  * Keeps track of files awaiting deletion, and deletes them when an associated
@@ -48,7 +49,7 @@ public class FileCleaningTracker {
     /**
      * Collection of <code>Tracker</code> instances in existence.
      */
-    final Collection<Tracker> trackers = new Vector<Tracker>();  // synchronized
+    final Collection<Tracker> trackers = Collections.synchronizedSet(new HashSet<Tracker>());
// synchronized
     /**
      * Whether to terminate the thread when the tracking is complete.
      */



Mime
View raw message