2004-10-18 Jeroen Frijters <jeroen@frijters.net>
* java/util/logging/LogManager.java (findAncestor): Fixed IndexOutOfBoundsException. From-SVN: r89220
This commit is contained in:
parent
0736f19f4e
commit
e5871096f0
2 changed files with 9 additions and 2 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue