-
Type:
Bug
-
Resolution: Cannot Reproduce
-
Priority:
P3
-
Affects Version/s: 6u14
-
Component/s: core-libs
-
generic
-
generic
LogManager.loggers is a Hashtable<String,Logger> as of 1.6u14, and the getLoggerNames() method reads as follows:
public synchronized Enumeration<String> getLoggerNames() {
return loggers.keys();
}
If one thread is walking the returned Enumeration object while another thread touches the loggers field (such as by adding a new logger), a ConcurrentModificationException would result.
One way to fix this is to create a copy within the synchronized block, such as:
return new Vector<String>(loggers.keys()).elements();
public synchronized Enumeration<String> getLoggerNames() {
return loggers.keys();
}
If one thread is walking the returned Enumeration object while another thread touches the loggers field (such as by adding a new logger), a ConcurrentModificationException would result.
One way to fix this is to create a copy within the synchronized block, such as:
return new Vector<String>(loggers.keys()).elements();