-
Bug
-
Resolution: Fixed
-
P3
-
8
-
b96
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8172641 | openjdk7u | Chris Hegarty | P3 | Resolved | Fixed | master |
There are 623 occurrences, and hence 623 deprecated build warnings, of PlatformLogger.isLoggable(int) in the jdk source.
PlatformLogger is an internal API, and used in may places in the jdk. isLoggable(int) has been deprecated in favor of isLoggable(Level). isLoggable(Level) is slightly more efficient, as it avoids the mapping of int to Level.
The solution is to simply replace isLoggable(int) with isLoggable(Level), providing the appropriate Level. Example:
- if(logger.isLoggable(PlatformLogger.FINE)) {
+ if(logger.isLoggable(PlatformLogger.Level.FINE)) {
http://cr.openjdk.java.net/~chegar/platLoggerWarn/webrev/
I haven't yet filed a bug for this, but I plan to push the changes through TL, rather than splitting the across multiple integration forests.
Sample warning output:
tl/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java:416: warning: [deprecation] isLoggable(int) in PlatformLogger has been deprecated
tl/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java:422: warning: [deprecation] isLoggable(int) in PlatformLogger has been deprecated
tl/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java:635: warning: [deprecation] isLoggable(int) in PlatformLogger has been deprecated
....
PlatformLogger is an internal API, and used in may places in the jdk. isLoggable(int) has been deprecated in favor of isLoggable(Level). isLoggable(Level) is slightly more efficient, as it avoids the mapping of int to Level.
The solution is to simply replace isLoggable(int) with isLoggable(Level), providing the appropriate Level. Example:
- if(logger.isLoggable(PlatformLogger.FINE)) {
+ if(logger.isLoggable(PlatformLogger.Level.FINE)) {
http://cr.openjdk.java.net/~chegar/platLoggerWarn/webrev/
I haven't yet filed a bug for this, but I plan to push the changes through TL, rather than splitting the across multiple integration forests.
Sample warning output:
tl/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java:416: warning: [deprecation] isLoggable(int) in PlatformLogger has been deprecated
tl/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java:422: warning: [deprecation] isLoggable(int) in PlatformLogger has been deprecated
tl/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java:635: warning: [deprecation] isLoggable(int) in PlatformLogger has been deprecated
....
- backported by
-
JDK-8172641 Replace deprecated PlatformLogger isLoggable(int) with isLoggable(Level)
-
- Resolved
-