summaryrefslogtreecommitdiffstats
path: root/libjava/classpath/java/util/logging/LogManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/classpath/java/util/logging/LogManager.java')
-rw-r--r--libjava/classpath/java/util/logging/LogManager.java16
1 files changed, 12 insertions, 4 deletions
diff --git a/libjava/classpath/java/util/logging/LogManager.java b/libjava/classpath/java/util/logging/LogManager.java
index fbc0fe78abf..6daf3dbd9eb 100644
--- a/libjava/classpath/java/util/logging/LogManager.java
+++ b/libjava/classpath/java/util/logging/LogManager.java
@@ -1,6 +1,6 @@
/* LogManager.java -- a class for maintaining Loggers and managing
configuration properties
- Copyright (C) 2002, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005, 2006, 2007 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -446,8 +446,8 @@ public class LogManager
Iterator<WeakReference<Logger>> iter = loggers.values().iterator();
while (iter.hasNext())
- for (WeakReference<Logger> ref : loggers.values())
{
+ WeakReference<Logger> ref;
Logger logger;
ref = iter.next();
@@ -559,13 +559,21 @@ public class LogManager
if ("handlers".equals(key))
{
- StringTokenizer tokenizer = new StringTokenizer(value);
+ // In Java 5 and earlier this was specified to be
+ // whitespace-separated, but in reality it also accepted
+ // commas (tomcat relied on this), and in Java 6 the
+ // documentation was updated to fit the implementation.
+ StringTokenizer tokenizer = new StringTokenizer(value,
+ " \t\n\r\f,");
while (tokenizer.hasMoreTokens())
{
String handlerName = tokenizer.nextToken();
Handler handler = (Handler)
createInstance(handlerName, Handler.class, key);
- Logger.root.addHandler(handler);
+ // Tomcat also relies on the implementation ignoring
+ // items in 'handlers' which are not class names.
+ if (handler != null)
+ Logger.root.addHandler(handler);
}
}
OpenPOWER on IntegriCloud