bug-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug classpath/26668] New: java.util.logging bugs


From: rafaels at redhat dot com
Subject: [Bug classpath/26668] New: java.util.logging bugs
Date: 13 Mar 2006 18:51:40 -0000

I ran into a number of bugs and incompatibilities between the classpath
implementation of java.util.logging and the sun implementation while attempting
to use the tomcat-juli logging manager with classpath. I've listed the issues
below and have a patch that addresses each of them.

1. The LogManager only looks up classes in the system class loader. My patch
modifies it to also check the context class loader if nothing is found in the
system class loader. This is necessary for third party logging managers to work
at all.

2. Errors occurring during instantiation of the LogManager were masked due to
insuficiently granular exception handling. The patch modifies the
implementation to handle all the different exceptions that can occur and report
each one with a distinct error message.

3. Previously the LogManager constructor would initialize the static LogManager
variable. This is not robust because a failed LogManager instantiation will can
leave a half initialized LogManager instance in the static variable and this
will prevent any future LogManager instantiations from succeeding. The patch
moves this initialization outside the LogManager constructor where it only
happens after the LogManager instance has been successfully created.

4. The LogManager constructor also used to invoke the addLogger method. This
was a problem for the tomcat-jul LogManager subclass because the addLogger
method was overriden and tried to access instance variables that had not been
instantiated yet. The patch removes all method invocation from the LogManager
constructor and instead performs the same method invocations after the
LogManager has been successfully created.

5. The root logger is stored in the Logger class instead of being stored in
each instance of the LogManager class. This allows multiple LogManager
instantiation attempts, and also simplifies some of the cyclic dependencies
between Logger and LogManager.

6. The Level class uses == instead of .equals for string comparison, but the
code only guarantees that one of the strings being compared is intern()ed. The
patch intern()s the other end of the string by intern()ing the name that is
passed to the Level constructor.


-- 
           Summary: java.util.logging bugs
           Product: classpath
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: classpath
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rafaels at redhat dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26668





reply via email to

[Prev in Thread] Current Thread [Next in Thread]