JDK-7054233 : convert remaining uses of j.u.logging in jdk repo to PlatformLogger
Type:Bug
Component:core-libs
Sub-Component:java.util.logging
Affected Version:8
Priority:P4
Status:Open
Resolution:Unresolved
OS:generic
CPU:generic
Submitted:2011-06-13
Updated:2012-01-24
The Version table provides details related to the release that this issue/RFE will be addressed.
Unresolved : Release in which this issue/RFE will be addressed. Resolved: Release in which this issue/RFE has been resolved. Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.
This is a place holder bug for examining the remaining uses of
java.util.logging in the jdk repo and switching to use of the
PlatformLogger class as appropriate.
Comments
SUGGESTED FIX
See the attached 7054233-webrev-cr0-part1.tgz,
7054233-webrev-cr0-part2.tgz and 7054233-webrev-cr0-part3.tgz
files for the proposed fix.
01-07-2011
EVALUATION
The new PlatformLogger method Object getInternalLogger(String name)
was renamed to Object getUnderlyingLogger(String name).
01-07-2011
EVALUATION
Part 3 - misc updates
---------------------
- most of the files touched in this part fall into the
"simple change" category; please note that no code
reformatting was done intentional to make it easier to
review the content changes
- many logger.log(Level.<value>,...) calls were converted
into logger.<value>(....) calls, e.g.:
logger.log(Level.FINER, ...) => logger.finer(...)
The allowed me to avoid adding even more methods to the
PlatformLogger class.
- src/share/classes/sun/rmi/runtime/Log.java
The LoggerLogFactory class in this file and the non-trivial
use of the Logging API also motivated the addition of:
Object PlatformLogger.getInternalLogger(String name)
- src/solaris/classes/sun/awt/X11/XEmbeddedFrame.java
- src/solaris/classes/sun/awt/X11/generator/WrapperGenerator.java
These two files are built with the following options:
-source 6 -target 6 -XDignore.symbol.file=true
but the bootclass path is not specified. Because these files are
built with the default bootclass path, this fix (7054233) can only
be built by a JDK that already has the fix for 7054204. The easiest
way to do this is to wait for the fix for 7054204 to make it into a
promoted build before pushing this fix.
23-06-2011
EVALUATION
Part 2 - security/sasl updates
------------------------------
- most of the files touched in this part fall into the
"simple change" category; please note that no code
reformatting was done intentional to make it easier to
review the content changes
- many logger.log(Level.<value>,...) calls were converted
into logger.<value>(....) calls, e.g.:
logger.log(Level.FINE, ...) => logger.fine(...)
The allowed me to avoid adding even more methods to the
PlatformLogger class.
- src/share/classes/com/sun/security/sasl/util/AbstractSaslImpl.java
A little bit of code had to be tweaked to use an "int"
instead of a Level.
The AbstractSaslImpl class in this file also motivated
the addition of:
PlatformLogger.logp(int level, String srcClass, String srcMethod,
String msg, Object param1)
PlatformLogger.logp(int level, String srcClass, String srcMethod,
String msg, Object[] params)
23-06-2011
EVALUATION
This work will be divided into three parts:
- Part 1 - JMX and Management updates
- Part 2 - security/sasl updates
- Part 3 - misc updates
A majority of the updates made under this bug ID are simple:
- drop "import java.util.logging.<some_class>"; in a few cases the
import was the only reference to java.util.logging in the file
- add "import sun.util.logging.PlatformLogger"
- change Level.<predefined_value> to PlatformLogger.<predefined_value>
- replace Logger.getLogger() calls with PlatformLogger.getLogger()
- replace Logger vars/fields with PlatformLogger vars/fields
Part 1 - JMX and Management updates
-----------------------------------
- the JMX and Management APIs make heavy use of Logging;
there are many Loggers and many different log() calls
- most of the files touched in this part fall into the
"simple change" category; please note that no code
reformatting was done intentional to make it easier to
review the content changes
- src/closed/share/classes/com/sun/jmx/trace/Trace.java
Trace.initDestination() has some logic where it tries to
figure out what's available on the runtime Java Platform.
I'm guessing that in the past, newer JMX code could be
built and run on older Java releases. I've added detection
of sun.util.logging.PlatformLogger to the logic.
- src/closed/share/classes/com/sun/jmx/trace/TraceManager.java
Had hardcoded names of Loggers that were defined in the
JmxProperties class. I've switched to using the Logger names
provided by the JmxProperties class. BTW, the original code
used a different name for two of the Loggers:
orig TraceManager.java JmxProperties.java
----------------------- -------------------
com.sun.jmx.snmp.daemon javax.management.snmp.daemon
com.sun.jmx.snmp javax.management.snmp
Also, a little bit of code had to be tweaked to use an "int"
instead of a Level.
The TraceManager class in this file also motivated the addition of:
PlatformLogger.log(int level, String msg, Throwable t)
PlatformLogger.logp(int level, String srcClass, String srcMethod,
String msg)
- src/share/classes/com/sun/jmx/remote/util/ClassLogger.java
The static initializer for this class has a little bit of
logic to determine if runtime Java Platform has java.util.logging
support. I've changed that logic to check for PlatformLogger.
The ClassLogger class in this file also motivated the addition of:
PlatformLogger.logp(int level, String srcClass, String srcMethod,
String msg, Throwable t)
- src/share/classes/javax/management/relation/MBeanServerNotificationFilter.java
The MBeanServerNotificationFilter class in this file also motivated
the addition of:
PlatformLogger.entering(String sourceClass, String sourceMethod)
PlatformLogger.entering(String sourceClass, String sourceMethod,
Object param1)
PlatformLogger.exiting(String sourceClass, String sourceMethod)
- src/share/classes/javax/management/relation/RelationService.java
The RelationService class in this file also motivated
the addition of:
PlatformLogger.entering(String sourceClass, String sourceMethod,
Object[] params)