History log of /libcore/ojluni/src/main/java/java/nio/charset/Charset.java
Revision Date Author Comments
6975f84c2ed72e1e26d20190b6f318718c849008 01-Mar-2017 Tobias Thierer <tobiast@google.com> Make Android patch docs in ojluni more consistent with style guide

This CL consists of an automated and a manual part (originally
reviewed as separate CLs, then squashed together before submitting
in order to minimize the number of times each Android-changed line
is touch, since that makes future git archaeology on these simpler).

Automated part: Run the following command (performs regex replacements):

find ojluni -name \*\.java | xargs sed -i \
-e 's/Android[- ]changed/Android-changed/ig' \
-e 's/Android-changed :/Android-changed:/g' \
-e 's/Android-changed \(BEGIN\|END\)/\1 Android-changed/g' \
-e 's/Android-changed - /Android-changed: /g' \
-e 's/Android[- ]removed/Android-removed/ig' \
-e 's/Android-removed :/Android-removed:/g' \
-e 's/Android-removed \(BEGIN\|END\)/\1 Android-removed/g' \
-e 's/Android-removed - /Android-removed: /g' \
-e 's/Android[- ]added/Android-added/ig' \
-e 's/Android-added :/Android-added:/g' \
-e 's/Android-added \(BEGIN\|END\)/\1 Android-added/g' \
-e 's/Android-added - /Android-added: /g' \
-e 's/----- \(BEGIN\|END\) android\( -----\)\?/\1 Android-changed/g' \
-e 's/\/\* \(BEGIN\|END\) Android-changed \*\//\/\/ \1 Android-changed/g'

Manual part: Move BEGIN Android-* lines out of block comments

Some Android-{changed,removed,added} lines occurred inside block comments.
This CL targets places in ojluni that contained the String "* BEGIN Android-"

Changes made by this CL include:

- Move the "BEGIN Android-" line into a line comment (the style guide
mandates that "Android-" lines are always in line comments). In many
cases, that line comment is immediately followed by a block comment
holding commented-out upstream code.
- Add corresponding "// END Android-" line comments, where missing.
- Drop documented import changes altogether. These create noise for
little benefit:
(1.) Most import problems will be found at compile time
(2.) They generally correspond to documented changes elsewhere in
the file.
- In most cases, the phrasing of comments and the decision whether to
keep commented out upstream code was not changed by this CL.
- Some additional tweaks were made in line with the style guide.

No attempt was made to:

- Verify that commented-out upstream code actually matches the
current upstream.
- Make any fixes (eg. to comments) that would have required
git archaeology (looking up historic commits).

Bug: 35841464
Test: make droid cts update-api

Change-Id: Ibc60979cb6061cfb0e9c7096cc9dcab30ddfa733
9ffce05d1a98b2d0761c2e78db426d9c5bbb4cc4 26-Aug-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Fix documentation related to default charset.

Restore information about android default charset in the
java.nio.charset.Charset javadoc.

Test: make docs
Bug: 31079415
Bug: 27441320
(cherry picked from commit 9dab0f1f61ee1e8401c6abd715b4d0604bdd7305)

Change-Id: I30775d6bc1e4af262abb021bb3ebd98ed211c573
9dab0f1f61ee1e8401c6abd715b4d0604bdd7305 25-Aug-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Fix documentation related to default charset.

Restore information about android default charset in the
java.nio.charset.Charset javadoc.

Test: make docs
Bug: 31079415
Bug: 27441320
Change-Id: I4951ea44579c0f804f2b35b3709c775e93d72e01
861d34f160de8a5f94b2b8b453daca5246052450 17-Aug-2016 Shubham Ajmera <shubhamajmera@google.com> Port openJDK8 changes to java.nio.charset

- Mostly javadocs changes.
- CharsetEncoder #replaceWith assigns value of "newReplacement" to
"replacement"and not the reference.
- CharsetEncoder #replacement creates a copy of "replacement" and then
returns the copy.
- Made changes in the tests which were expecting old behaviour
for the above two methods.

Test: run cts -p android.core.tests.libcore.package.harmony_java_nio
run cts -p android.core.tests.libcore.package.libcore

Bug: 30964930
Change-Id: Id09238074ace5e92a5864a90aca360079847abf2
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>
5769b6580a97194bb4460ece3f9772ba90f93695 07-Jun-2016 Narayan Kamath <narayan@google.com> Charset: Fix broken level-1 caching.

The level-1 cache was incorrectly implemented. The check written here :

if (cache1 != null && charsetName.equals(cache1.getKey()))
return cache1.getValue();

Is incorrect because a different thread might change the value of cache1
between the null check, the call to getKey and the call to getValue.

The stress test in this change results in a 100% reproducible failure on a
nexus 6P without the included fix.

bug: 26548702

(cherry picked from commit 13a83b88fb12356b6edcb0bdf9171315d80583c0)

Change-Id: I081869f21e9451c03c89b7967c7f779c0205ab95
13a83b88fb12356b6edcb0bdf9171315d80583c0 07-Jun-2016 Narayan Kamath <narayan@google.com> Charset: Fix broken level-1 caching.

The level-1 cache was incorrectly implemented. The check written here :

if (cache1 != null && charsetName.equals(cache1.getKey()))
return cache1.getValue();

Is incorrect because a different thread might change the value of cache1
between the null check, the call to getKey and the call to getValue.

The stress test in this change results in a 100% reproducible failure on a
nexus 6P without the included fix.

bug: 26548702
Change-Id: Ib564c5d84282bff23f7b95d3b520d45f740b0ba3
a44ea54163e807a3e1ca809ff6fb70d4db4cd76b 08-Jan-2016 Yi Kong <yikong@google.com> Revert "Revert "Cache all Charset instances with their aliases""

Fixes the caching bug that non-standard charset name is not correctly
handled.

This reverts commit 8f5d171744cacd52d9831d9dcad79ab70ec00a70.

Bug: 26457745
Bug: 26140874
Change-Id: I73c09bc6ba0e94c8ba499b36b564f0b96976c4e2
8f5d171744cacd52d9831d9dcad79ab70ec00a70 08-Jan-2016 Narayan Kamath <narayan@google.com> Revert "Cache all Charset instances with their aliases"

This reverts commit 363101a5af755ae1d5baa32d79b3d4a97626f6ff.

bug: 26457745
bug: 26140874
Change-Id: Iff3151dfe0e987ea22f795570dbc182e93a00804
363101a5af755ae1d5baa32d79b3d4a97626f6ff 07-Jan-2016 Yi Kong <yikong@google.com> Cache all Charset instances with their aliases

Replaced type-less Object[] Charset.cache1 field type with more sane
Map.Entry. Charset.cache2 is now a HashMap that keeps all created
Charsets keyed by all of their names (canonical+aliases).

Bug: 26140874
Change-Id: I5f23a28e6c581ae0b5e973fe7cc24600e9dc9c27
3c616584fb524f6ae56ceca9beb8d7fabcb5eb1f 04-Jan-2016 Yi Kong <yikong@google.com> Look for charset providers with context class loader

This allows loading providers outside of classpath.

Bug: 26140874
Change-Id: I9b825a0176ff2fc72cefaae08885abe83ef83738
2c87ad3a45cecf9e344487cad1abfdebe79f2c7c 21-Dec-2015 Narayan Kamath <narayan@google.com> Update file headers.

Change-Id: I8149f41585768a1a4b72ab7bb4a1452376c05cc2
16ad3f07e7ec41d6709d10c71112ff1c077be4e5 28-Sep-2015 Przemyslaw Szczepaniak <pszczepaniak@google.com> Add Charset.forNameUEE.

For internal use.

Change-Id: I1b40964d64f98f07ccf6bfa6ceecb40d80af595f
cf8b6b44130216ba55589aceddb544b2390f4266 07-Aug-2015 Narayan Kamath <narayan@google.com> Revert "Revert "Cull unused Charset Encoders.""

This reverts commit 7fc85ad29feb8719ebb6b5ac281cf4fb1a2241bb.
9c67070dd3fb25e9d7ea144b297c81895a93806a 06-Aug-2015 Narayan Kamath <narayan@google.com> Revert "Revert "Drop support for the "standard" and "extended" charset providers.""

This reverts commit e5616dbf559e3d76073f4edf9901856b34414291.

Also fixes a circular dependency issue that was introduced in the
original commit.

Change-Id: Ic07582c1d6b6001fa1f08abbe02804686a5b7640
68b04a439f8959b4482b89b437abeddb367c2521 06-Aug-2015 Narayan Kamath <narayan@google.com> Revert "Drop support for the "standard" and "extended" charset providers."

This reverts commit 256e4a12d425d270e85e55933ef8fe6b3f8a34fc.
7007626f2edb12aa8dbf491bd89a0ee4d56f34bc 06-Aug-2015 Narayan Kamath <narayan@google.com> Revert "Cull unused Charset Encoders."

This reverts commit 7749f3aeb34463aab24cf891db73e3780aa363ef.
ba82d06f27d3aaf992feda91178a56aafae5c66e 06-Aug-2015 Narayan Kamath <narayan@google.com> Cull unused Charset Encoders.

Change-Id: Ia8fc394a00368c29933e03225c4ecb153d045c44
f30780203b3f1b1958aa17ccfa8bd56a7ee63f2b 06-Aug-2015 Narayan Kamath <narayan@google.com> Drop support for the "standard" and "extended" charset providers.

Gets rid of NPEs due to classes that aren't instantiable.

Change-Id: I898dcd987adc3d3ffc6b3e96119c28cc0895c821
133892a64c416abdb5d19c77ec3194aeb789b34f 19-May-2015 Piotr Jastrzebski <haaawk@google.com> Use OpenJdk implenentation of Charset{Encoder,Decoder}.

Use libcore's NativeConverter directly and also hardcode
the default charset to UTF-8.

Change-Id: Iafe84d94e1169721de943638aedd43b3f0af65e6
9a9f76d1e161f37b3d83d2db94ea63298d221bdf 28-Apr-2015 Piotr Jastrzebski <haaawk@google.com> Use OpenJdk Implementations of java.nio.charset.*

- PrehashedMap : Add a custom hash function instead of calling
hashCode().
- Add a few missing files in sun.nio.cs.
- Charset: Add an internal method that's equivalent to forName but
throws only UEEs.

Change-Id: Ica1f14d4784549c0a3642b61d325f1fb09526125
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