Commit e5871096 by Jeroen Frijters Committed by Michael Koch

2004-10-18 Jeroen Frijters <jeroen@frijters.net>

	* java/util/logging/LogManager.java
	(findAncestor): Fixed IndexOutOfBoundsException.

From-SVN: r89220
parent 0736f19f
2004-10-18 Jeroen Frijters <jeroen@frijters.net>
* java/util/logging/LogManager.java
(findAncestor): Fixed IndexOutOfBoundsException.
2004-10-18 Michael Koch <konqueror@gmx.de>
* java/io/BufferedInputStream.java: Fixed @author tag.
......
......@@ -351,6 +351,7 @@ public class LogManager
private synchronized Logger findAncestor(Logger child)
{
String childName = child.getName();
int childNameLength = childName.length();
Logger best = rootLogger;
int bestNameLength = 0;
......@@ -366,9 +367,10 @@ public class LogManager
candName = (String) iter.next();
candNameLength = candName.length();
if ((candNameLength > bestNameLength)
if (candNameLength > bestNameLength
&& childNameLength > candNameLength
&& childName.startsWith(candName)
&& (childName.charAt(candNameLength) == '.'))
&& childName.charAt(candNameLength) == '.')
{
cand = (Logger) ((WeakReference) loggers.get(candName)).get();
if ((cand == null) || (cand == child))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment