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

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

From-SVN: r89220
This commit is contained in:
Jeroen Frijters 2004-10-18 14:05:04 +00:00 committed by Michael Koch
parent 0736f19f4e
commit e5871096f0
2 changed files with 9 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2004-10-18 Jeroen Frijters <jeroen@frijters.net>
* java/util/logging/LogManager.java
(findAncestor): Fixed IndexOutOfBoundsException.
2004-10-18 Michael Koch <konqueror@gmx.de> 2004-10-18 Michael Koch <konqueror@gmx.de>
* java/io/BufferedInputStream.java: Fixed @author tag. * java/io/BufferedInputStream.java: Fixed @author tag.

View File

@ -351,6 +351,7 @@ public class LogManager
private synchronized Logger findAncestor(Logger child) private synchronized Logger findAncestor(Logger child)
{ {
String childName = child.getName(); String childName = child.getName();
int childNameLength = childName.length();
Logger best = rootLogger; Logger best = rootLogger;
int bestNameLength = 0; int bestNameLength = 0;
@ -366,9 +367,10 @@ public class LogManager
candName = (String) iter.next(); candName = (String) iter.next();
candNameLength = candName.length(); candNameLength = candName.length();
if ((candNameLength > bestNameLength) if (candNameLength > bestNameLength
&& childNameLength > candNameLength
&& childName.startsWith(candName) && childName.startsWith(candName)
&& (childName.charAt(candNameLength) == '.')) && childName.charAt(candNameLength) == '.')
{ {
cand = (Logger) ((WeakReference) loggers.get(candName)).get(); cand = (Logger) ((WeakReference) loggers.get(candName)).get();
if ((cand == null) || (cand == child)) if ((cand == null) || (cand == child))