History log of /libcore/ojluni/src/main/java/sun/util/resources/OpenListResourceBundle.java
Revision Date Author Comments
96c0ed3b054cff7546876b96a3e46137df71a9b0 27-Apr-2017 Tobias Thierer <tobiast@google.com> Update sun.util to upstream OpenJDK8u121-b13.

Before this CL, the package was still based on OpenJDK7u40. All of the
upstream changes integrated here were already present in OpenJDK8u60;
the only upstream changes between 8u60 and 8u121-13 related to timezone
data resource files, which are not used on Android (Android uses ICU).

Below,
[U] means that a change was integrated from upstream.
[L] means a local edit was made, e.g. to improve documentation of
existing Android changes.
[identical] means the file is identical to the upstream version,
after this CL.

The affected files were:

In sun.util.calendar:

BaseCalendar [identical]:
[U] drop unneeded import
CalendarDate [identical]:
[U]: pass cause to InternalError ctor during clone()
CalendarSystem
[L] improved formatting of Android-changed sections
[U] throw InternalError rather than RuntimeException
in case of Exception during calendarClass.newInstance()
(Shouldn't happen).
LocalGregorianCalendar:
[U] Add missing @Override annotations
[U] Drop unused imports
[U] Drop redundant generic type argument.
[LU] Adopt upstream implementation of getLocalGregorianCalendar().
Previously, the implementation was substantially different from
OpenJDK7u40, but the implementation in 8u121-b13 nearly exactly
matched what Android had.
The differences to previous Android versions are:
- Catch IllegalArgumentException, not just IOException,
when calling CalendarSystem.getCalendarProperties(), and
- throw InternalError rather than RuntimeException when
that fails.
This implementation in 8u121 was practically identical with what
Android had, allowing us to drop an Android change.
[L] Tweak an Android-changed comment.

In sun.util.locale:

BaseLocale [identical]:
[U] Adopt use of SoftReferences in Key.
See further below why this change is safe, but not obviously so.
InternalLocaleBuilder:
[L] Document the sole Android change from libcore commit
51b1b6997fd3f980076b8081f7f1165ccc2a4008 ("Initial import of
OpenJdk files") from Feb 2015 which first added this file.
The change is unexplained.
There were no upstream changes to this file between
OpenJDK7u40 and 8u121-b13.
LanguageTag [identical]:
[U]: Correct RFC number.
LocaleMatcher:
[L] document the places where the backport of JDK-8166994
(OpenJDK 9) has been applied. This change resulted
from a patch that was previously upstreamed to
OpenJDK. This documentation can be removed if/when
Android updates to OpenJDK 9, since that includes
this change.
LocaleObjectCache [identical]:
[U] fix createObject() to be called before rather than
after normalizeKey().
LocaleUtils [identical]:
[U] copyright year
LoggingProxy [identical]:
[U] copyright year
LoggingSupport [identical]
[U] copyright year
PlatformLogger:
[U] Remove (previously @Deprecated) isLoggable()/getLevel()/setLevel()
methods based on int values to identify the level.
[U] Make the int constants, representing log levels, private.
[L] Use /* .. */ rather than // to comment out a removed block;
This results in a small diff vs. upstream.
[U] Update the aforementioned block to the latest upstream version.
[L] document Android change in getCallerInfo where we have to
use throwable.getStackTrace() rather than
SharedSecrets.getJavaLangAccess().getStackTraceElement()

In sun.util.resources:

OpenListResourceBundle [identical]:
[U] narrow the scope of the synchronized block in loadLookup()
[U] add missing @Override annotations
[U] override keySet()
[U] Various API changes (public -> protected handleGetObject(),
handleGetKeys(); drop of getParent() override, addition
of createSet(), generic type arguments for createMap()).

Comments follow on why the adoption on SoftReference<String>s in
BaseLocale (and the change to LocaleObjectCache) appears correct but
not obviously so. This change was introduced by upstream commit
http://hg.openjdk.java.net/jdk9/client/jdk/rev/0fcff3336fee
Because investigation of whether this change is correct/safe and
its benefits took some time, these comments are fairly verbose:

- The only apparent benefit of these SoftReferences is that it avoids
holding on to (potentially large) String objects for "stale" Cache
entries. Cache entries are stale between the time the cached
(BaseLocale) value has been garbage collected and when the entire
entry is removed by LocaleObjectCache.cleanStaleEntries(), which
happens during Cache.get().
The Strings, e.g. from the Locale(String, String, String, String) ctor,
are typically short (this is the case for all Strings passed in in
the platform) so the four SoftReference objects appear to only be
an improvement if unusually large Strings are passed in by a misbehaved
application.

- The fact that normalizeKey() and createObject() do not need check
for whether the SoftReference<String>s have been cleared appears
correct but not obviously so:
- normalizeKey() and createObject() are only called from
LocaleObjectCache.get().
- Code in BaseLocale holds strong references to the String values
whenever it constructs Key objects to call LocaleObjectCache
with (guaranteeing that the String won't be garbage collected
during construction / interaction with the Cache).
- Specifically, BaseLocale.getInstance(String, String, String, String)
holds strong references while calling CACHE.get(), and
BaseLocale.createInstance(String, String) holds strong references
while calling CACHE.put() for a newly constructed Key object.
- normalizeKey() and createObject() could throw NPE if they were
called on a stale entry's Key, but the only way outside code
could get access to such a Key is through (unsafe) reflection.

- Likewise, the behavior of stale Cache entries is nontrivial:
- BaseLocale.Cache indirectly extends SoftReference<BaseLocale>.
The cache entry becomes stale when that SoftReference is cleared.
- BaseLocale has strong references to the same Strings as the Key,
so the earliest time the Key's SoftReference<String>s could be
cleared is when the entry becomes stale.
- While stale entries are never returned by the cache,
key.equals(obj) can still be called for them because other
(non-stale) keys in the LocaleObjectCache.map may have the
same hashCode.
- this is why, unlike normalizeKey() and createObject(),
Key.equals() *does* need to check whether the
SoftReference<String>s have been cleared.
- For keys whose SoftReference<String> has been cleared,
key.equals(obj) returns false for any obj other than themselves.
Such keys are deadweight, but will be removed from the cache during
cleanStaleEntries().

Bug: 37749191
Test: CtsLibcoreTestCases

Change-Id: Idfc63e0ee9bbc0a238ea1c124347f726b74058bc
49965c1dc9da104344f4893a05e45795a5740d20 30-Jun-2016 Ganesh Mahendran <opensource.ganesh@gmail.com> remove x attribute of java file

java file does not need x attribute. This patch removes it.

Change-Id: I2a7170d99f4bee7a7b819621c84dd197ded37fa2
Signed-off-by: Ganesh Mahendran <opensource.ganesh@gmail.com>
51b1b6997fd3f980076b8081f7f1165ccc2a4008 16-Feb-2015 Piotr Jastrzebski <haaawk@google.com> Initial import of OpenJdk files.

Create new libcore/ojluni directory with src/main/java and
src/main/native subdirectiories.

Build ojluni into core-oj jar.

Use openjdk classes from java.awt.font package.

Copy all files from jdk/src/share/classes and jdk/src/solaris/classes
directories in openjdk into libcore/ojluni/src/main/java.

Copy following native files from openjdk to
libcore/ojluni/src/main/native:
jdk/src/solaris/native/java/io/canonicalize_md.c
build/linux-amd64/include/classfile_constants.h
jdk/src/share/native/java/net/DatagramPacket.c
jdk/src/solaris/native/sun/net/spi/DefaultProxySelector.c
jdk/src/share/native/java/lang/Double.c
jdk/src/share/native/java/lang/fdlibm/include/fdlibm.h
jdk/src/solaris/native/sun/nio/ch/FileChannelImpl.c
jdk/src/solaris/native/java/io/FileDescriptor_md.c
jdk/src/solaris/native/sun/nio/ch/FileDispatcherImpl.c
jdk/src/share/native/java/io/FileInputStream.c
jdk/src/solaris/native/sun/nio/ch/FileKey.c
jdk/src/solaris/native/java/io/FileOutputStream_md.c
jdk/src/solaris/native/java/io/FileSystem_md.c
jdk/src/share/native/java/lang/Float.c
jdk/src/share/native/java/net/Inet4Address.c
jdk/src/solaris/native/java/net/Inet4AddressImpl.c
jdk/src/share/native/java/net/Inet6Address.c
jdk/src/solaris/native/java/net/Inet6AddressImpl.c
jdk/src/share/native/java/net/InetAddress.c
jdk/src/solaris/native/java/net/InetAddressImplFactory.c
jdk/src/share/native/java/io/io_util.c
jdk/src/solaris/native/sun/nio/ch/IOUtil.c
jdk/src/share/native/java/io/io_util.h
jdk/src/solaris/native/java/io/io_util_md.c
jdk/src/solaris/native/java/io/io_util_md.h
build/linux-amd64/tmp/java/java.nio/nio/CClassHeaders/java_io_FileDescriptor.h
build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/java_io_FileInputStream.h
build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/java_io_FileOutputStream.h
build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/java_io_FileSystem.h
build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/java_io_ObjectStreamClass.h
build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/java_io_UnixFileSystem.h
build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/java_lang_Double.h
build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/java_lang_Float.h
build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/java_lang_Integer.h
build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/java_lang_Long.h
build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/java_lang_Runtime.h
build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/java_lang_Shutdown.h
build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/java_lang_StrictMath.h
build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/java_lang_String.h
build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/java_lang_System.h
build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/java_lang_Thread.h
build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/java_lang_Throwable.h
build/linux-amd64/tmp/sun/java.net/net/CClassHeaders/java_net_DatagramPacket.h
build/linux-amd64/tmp/sun/java.net/net/CClassHeaders/java_net_Inet4Address.h
build/linux-amd64/tmp/sun/java.net/net/CClassHeaders/java_net_Inet4AddressImpl.h
build/linux-amd64/tmp/sun/java.net/net/CClassHeaders/java_net_Inet6Address.h
build/linux-amd64/tmp/sun/java.net/net/CClassHeaders/java_net_Inet6AddressImpl.h
build/linux-amd64/tmp/sun/java.net/net/CClassHeaders/java_net_InetAddress.h
build/linux-amd64/tmp/sun/java.net/net/CClassHeaders/java_net_InetAddressImplFactory.h
build/linux-amd64/tmp/sun/java.net/net/CClassHeaders/java_net_NetworkInterface.h
build/linux-amd64/tmp/sun/java.net/net/CClassHeaders/java_net_PlainDatagramSocketImpl.h
build/linux-amd64/tmp/sun/java.net/net/CClassHeaders/java_net_PlainSocketImpl.h
build/linux-amd64/tmp/sun/java.net/net/CClassHeaders/java_net_SocketInputStream.h
build/linux-amd64/tmp/sun/java.net/net/CClassHeaders/java_net_SocketOptions.h
build/linux-amd64/tmp/sun/java.net/net/CClassHeaders/java_net_SocketOutputStream.h
jdk/src/share/native/java/lang/java_props.h
jdk/src/solaris/native/java/lang/java_props_md.c
jdk/src/share/native/java/util/zip/Adler32.c as java_util_zip_Adler32.c
jdk/src/share/native/java/util/zip/CRC32.c as java_util_zip_CRC32.c
build/linux-amd64/tmp/sun/java.util.zip/zip/CClassHeaders/java_util_zip_CRC32.h
jdk/src/share/native/java/util/zip/Deflater.c as java_util_zip_Deflater.c
build/linux-amd64/tmp/sun/java.util.zip/zip/CClassHeaders/java_util_zip_Deflater.h
jdk/src/share/native/java/util/zip/Inflater.c as java_util_zip_Inflater.c
build/linux-amd64/tmp/sun/java.util.zip/zip/CClassHeaders/java_util_zip_Inflater.h
jdk/src/share/native/java/util/zip/ZipFile.c as java_util_zip_ZipFile.c
build/linux-amd64/tmp/sun/java.util.zip/zip/CClassHeaders/java_util_zip_ZipFile.h
jdk/src/share/native/java/lang/fdlibm/include/jfdlibm.h
jdk/src/share/native/common/jlong.h
jdk/src/solaris/native/common/jlong_md.h
jdk/src/share/native/common/jni_util.c
jdk/src/share/native/common/jni_util.h
jdk/src/solaris/native/common/jni_util_md.c
jdk/src/share/javavm/export/jvm.h
jdk/src/solaris/javavm/export/jvm_md.h
jdk/src/solaris/native/java/net/linux_close.c
jdk/src/share/native/sun/misc/NativeSignalHandler.c
jdk/src/solaris/native/sun/nio/ch/NativeThread.c
jdk/src/share/native/java/net/net_util.c
jdk/src/share/native/java/net/net_util.h
jdk/src/solaris/native/java/net/net_util_md.c
jdk/src/solaris/native/java/net/net_util_md.h
jdk/src/solaris/native/java/net/NetworkInterface.c
jdk/src/share/native/sun/nio/ch/nio.h
jdk/src/solaris/native/sun/nio/ch/nio_util.h
jdk/src/share/native/java/io/ObjectStreamClass.c
jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c
jdk/src/solaris/native/java/net/PlainSocketImpl.c
jdk/src/solaris/native/java/lang/ProcessEnvironment_md.c
jdk/src/share/native/java/lang/Runtime.c
jdk/src/share/native/java/lang/Shutdown.c
jdk/src/share/native/sun/misc/Signal.c
jdk/src/solaris/native/java/net/SocketInputStream.c
jdk/src/solaris/native/java/net/SocketOutputStream.c
jdk/src/share/native/java/lang/StrictMath.c
jdk/src/share/native/java/lang/String.c
build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/sun_misc_NativeSignalHandler.h
build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/sun_misc_Signal.h
build/linux-amd64/tmp/sun/java.net/net/CClassHeaders/sun_net_spi_DefaultProxySelector.h
build/linux-amd64/tmp/java/java.nio/nio/CClassHeaders/sun_nio_ch_FileChannelImpl.h
build/linux-amd64/tmp/java/java.nio/nio/CClassHeaders/sun_nio_ch_FileDispatcherImpl.h
build/linux-amd64/tmp/java/java.nio/nio/CClassHeaders/sun_nio_ch_FileKey.h
build/linux-amd64/tmp/java/java.nio/nio/CClassHeaders/sun_nio_ch_IOStatus.h
build/linux-amd64/tmp/java/java.nio/nio/CClassHeaders/sun_nio_ch_IOUtil.h
build/linux-amd64/tmp/java/java.nio/nio/CClassHeaders/sun_nio_ch_NativeThread.h
jdk/src/share/native/java/lang/System.c
jdk/src/share/native/java/lang/Thread.c
jdk/src/share/native/java/lang/Throwable.c
jdk/src/solaris/native/java/io/UnixFileSystem_md.c
jdk/src/solaris/native/java/lang/UNIXProcess_md.c
jdk/src/share/native/java/util/zip/zip_util.c
jdk/src/share/native/java/util/zip/zip_util.h

Change-Id: Ib237df4e1b7b5b4d9f12e74d189e6ec9eed3c31d