--- LogFactory.java.1.0.3 2005-06-08 19:02:38.000000000 -0400
+++ LogFactory.java 2005-06-08 19:10:21.000000000 -0400
@@ -70,9 +70,12 @@
import java.lang.reflect.Method;
import java.security.AccessController;
import java.security.PrivilegedAction;
+import java.util.Collections;
import java.util.Enumeration;
-import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.Map;
import java.util.Properties;
+import java.util.WeakHashMap;
/**
@@ -225,7 +228,7 @@
* The previously constructed LogFactory
instances, keyed by
* the ClassLoader
with which it was created.
*/
- protected static Hashtable factories = new Hashtable();
+ protected static Map factories = Collections.synchronizedMap(new WeakHashMap());
// --------------------------------------------------------- Static Methods
@@ -448,9 +451,9 @@
public static void releaseAll() {
synchronized (factories) {
- Enumeration elements = factories.elements();
- while (elements.hasMoreElements()) {
- LogFactory element = (LogFactory) elements.nextElement();
+ Iterator elements = factories.values().iterator();
+ while (elements.hasNext()) {
+ LogFactory element = (LogFactory) elements.next();
element.release();
}
factories.clear();