United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-8024131 : Issues with cached localizedLevelName in java.util.logging.Level

Details
Type:
Bug
Submit Date:
2013-09-02
Status:
Closed
Updated Date:
2014-02-24
Project Name:
JDK
Resolved Date:
2013-09-04
Component:
core-libs
OS:
Sub-Component:
java.util.logging
CPU:
Priority:
P4
Resolution:
Fixed
Affected Versions:
Fixed Versions:
7u60 (b01)

Related Reports
Backport:
Backport:
Relates:
Relates:

Sub Tasks

Description
This is a regression introduced in 7u13:

A new localizedLevelName field was added to j.u.l.Level, which changed the serial form.
Once set, Level.getLocalizedName() will always return the cached name, regardless of the current locale.

The change in serial form should not introduce any interop issue, because localizedLevelName will be recomputed if null.

The fact that once cached, the localizedLevelName is never recomputed is the more problematic issue.

                                    

Comments
The fix for that would be to:

1. Declare localizedLevelName transient
2. Add a new transient Locale cachedLocale field to store the locale in which the localizedLevelName was computed.
    If the current locale does not match the cachedLocale field then the localized level name needs to be recomputed.
                                     
2013-09-02
URL:   http://hg.openjdk.java.net/jdk7u/jdk7u-dev/jdk/rev/ffd0a74b30d6
User:  dfuchs
Date:  2013-09-04 18:52:06 +0000

                                     
2013-09-04
URL:   http://hg.openjdk.java.net/jdk7u/jdk7u/jdk/rev/ffd0a74b30d6
User:  lana
Date:  2013-09-09 22:17:44 +0000

                                     
2013-09-09



Hardware and Software, Engineered to Work Together