summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2007-03-30 04:13:42 +0000
committerTom Tromey <tromey@redhat.com>2007-03-30 04:13:42 +0000
commitd8c165d51fe12c97073f59d90020848cc55a7a83 (patch)
treeba16139fbfa23b2806ed6cd791023657562cc90e
parente9c4ad67be7202ecc9813719d8897318bc0d88f6 (diff)
downloadclasspath-d8c165d51fe12c97073f59d90020848cc55a7a83.tar.gz
PR libgcj/29869:
* java/util/logging/LogManager.java (readConfiguration): Handle comma-separated 'handlers'. Don't try to add a non-existing handler.
-rw-r--r--ChangeLog7
-rw-r--r--java/util/logging/LogManager.java12
2 files changed, 17 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 047515388..6e6ffbfc0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-03-29 Tom Tromey <tromey@redhat.com>
+
+ PR libgcj/29869:
+ * java/util/logging/LogManager.java (readConfiguration): Handle
+ comma-separated 'handlers'. Don't try to add a non-existing
+ handler.
+
2007-03-29 Keith Seitz <keiths@redhat.com>
* gnu/classpath/jdwp/event/ThreadStartEvent.java (Event):
diff --git a/java/util/logging/LogManager.java b/java/util/logging/LogManager.java
index 6ce48b2d4..6daf3dbd9 100644
--- a/java/util/logging/LogManager.java
+++ b/java/util/logging/LogManager.java
@@ -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);
}
}