JDK-8011638 : Remove deprecated methods in sun.util.logging.PlatformLogger
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.util.logging
  • Affected Version: 8
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2013-04-05
  • Updated: 2014-01-06
  • Resolved: 2013-10-16
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.

To download the current JDK release, click here.
JDK 8
8 b113Fixed
Related Reports
Relates :  
Relates :  
Description
PlatformLogger.Level enum class is defined in JDK-8010309.  The current static final constant fields representing the levels can be converted from int to Level enum constants. 

It will be source compatible if the existing code does not bind level to the type in the source. 
e.g. reference the static final constants in the following ways:
   logger.isLoggable(PlatformLogger.FINEST)
   logger.setLevel(PlatformLogger.FINEST)
   if (logger.getLevel() == PlatformLogger.FINEST)...

JFX 8 is built with JDK 7 but will be upgraded to build with JDK 8.  In addition, it references the type of PlatformLogger static final constants in a few places. For example,

        String levelString = System.getProperty("log.lens");
        int level = PlatformLogger.SEVERE;
        if (levelString != null) {
            try {
                level = Integer.parseInt(levelString);
            } catch (NumberFormatException nfe) {
                try {
                    level = PlatformLogger.class
                            .getField(levelString.toUpperCase())
                            .getInt(null);
                } catch (Exception e) { }
            }
        }
        logger.setLevel(level);

JFX can migrate to use the PlatformLogger.Level that will simply the above code:
        String levelString = System.getProperty("log.lens", "SEVERE").toUpperCase();
        logger.setLevel(PlatformLogger.Level.valueOf(levelString);

Another place in JFX:
        final int level = LOGGER.getLevel();
        if (level > PlatformLogger.WARNING &&
            level != PlatformLogger.OFF) {
            LOGGER.setLevel(PlatformLogger.WARNING);
        }

This can be changed to:
        if (LOGGER.level() > PlatformLogger.WARNING &&
            LOGGER.level() != PlatformLogger.OFF) {
            LOGGER.setLevel(PlatformLogger.WARNING);
        }

There is native code in JFX that also depends on these fields that need to migrate to use the new API.

We can fix this bug once JFX 8 removes all references to int level and switches to build with jdk8 b86 (or the promoted build where JDK-8011380 is fixed.
Comments
References to JFX jira issues: https://javafx-jira.kenai.com/browse/RT-27794 (Switch FX8 production builds to use JDK 8) https://javafx-jira.kenai.com/browse/RT-29523 (Upgrade to use PlatformLogger.Level instead of primitive int type)
05-04-2013