changeset 11475:607ea68032cd jdk9-b52

Merge
author lana
date Thu, 19 Feb 2015 16:38:11 -0800
parents 1d7c64177c51 36607eb3168f
children 65de62d768a4 be681c3449ce
files make/data/charsetmapping/dbcs make/data/charsetmapping/extsbcs make/data/charsetmapping/sbcs make/data/charsetmapping/standard-charsets src/java.desktop/macosx/classes/sun/datatransfer/resources/flavormap.properties src/java.desktop/share/classes/java/awt/datatransfer/Clipboard.java src/java.desktop/share/classes/java/awt/datatransfer/ClipboardOwner.java src/java.desktop/share/classes/java/awt/datatransfer/DataFlavor.java src/java.desktop/share/classes/java/awt/datatransfer/FlavorEvent.java src/java.desktop/share/classes/java/awt/datatransfer/FlavorListener.java src/java.desktop/share/classes/java/awt/datatransfer/FlavorMap.java src/java.desktop/share/classes/java/awt/datatransfer/FlavorTable.java src/java.desktop/share/classes/java/awt/datatransfer/MimeType.java src/java.desktop/share/classes/java/awt/datatransfer/MimeTypeParameterList.java src/java.desktop/share/classes/java/awt/datatransfer/MimeTypeParseException.java src/java.desktop/share/classes/java/awt/datatransfer/StringSelection.java src/java.desktop/share/classes/java/awt/datatransfer/SystemFlavorMap.java src/java.desktop/share/classes/java/awt/datatransfer/Transferable.java src/java.desktop/share/classes/java/awt/datatransfer/UnsupportedFlavorException.java src/java.desktop/share/classes/java/awt/datatransfer/package.html src/java.desktop/share/classes/sun/datatransfer/DataFlavorUtil.java src/java.desktop/share/classes/sun/datatransfer/DesktopDatatransferService.java src/java.desktop/unix/classes/sun/awt/X11/XAWTFormatter.java src/java.desktop/unix/classes/sun/datatransfer/resources/flavormap.properties src/java.desktop/windows/classes/sun/datatransfer/resources/flavormap.properties src/jdk.charsets/share/classes/sun/nio/cs/ext/Big5_HKSCS.java src/jdk.charsets/share/classes/sun/nio/cs/ext/Big5_Solaris.java src/jdk.charsets/share/classes/sun/nio/cs/ext/DelegatableDecoder.java src/jdk.charsets/share/classes/sun/nio/cs/ext/DoubleByte.java src/jdk.charsets/share/classes/sun/nio/cs/ext/EUC_JP.java src/jdk.charsets/share/classes/sun/nio/cs/ext/EUC_JP_LINUX.java src/jdk.charsets/share/classes/sun/nio/cs/ext/EUC_JP_Open.java src/jdk.charsets/share/classes/sun/nio/cs/ext/ExtendedCharsets.java src/jdk.charsets/share/classes/sun/nio/cs/ext/HKSCS.java src/jdk.charsets/share/classes/sun/nio/cs/ext/MS950_HKSCS_XP.java src/jdk.runtime/share/classes/com/sun/tracing/Probe.java src/jdk.runtime/share/classes/com/sun/tracing/ProbeName.java src/jdk.runtime/share/classes/com/sun/tracing/Provider.java src/jdk.runtime/share/classes/com/sun/tracing/ProviderFactory.java src/jdk.runtime/share/classes/com/sun/tracing/ProviderName.java src/jdk.runtime/share/classes/com/sun/tracing/dtrace/ArgsAttributes.java src/jdk.runtime/share/classes/com/sun/tracing/dtrace/Attributes.java src/jdk.runtime/share/classes/com/sun/tracing/dtrace/DependencyClass.java src/jdk.runtime/share/classes/com/sun/tracing/dtrace/FunctionAttributes.java src/jdk.runtime/share/classes/com/sun/tracing/dtrace/FunctionName.java src/jdk.runtime/share/classes/com/sun/tracing/dtrace/ModuleAttributes.java src/jdk.runtime/share/classes/com/sun/tracing/dtrace/ModuleName.java src/jdk.runtime/share/classes/com/sun/tracing/dtrace/NameAttributes.java src/jdk.runtime/share/classes/com/sun/tracing/dtrace/ProviderAttributes.java src/jdk.runtime/share/classes/com/sun/tracing/dtrace/StabilityLevel.java src/jdk.runtime/share/classes/com/sun/tracing/dtrace/package-info.java src/jdk.runtime/share/classes/com/sun/tracing/package-info.java src/jdk.runtime/share/classes/sun/security/tools/policytool/PolicyTool.java src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources.java src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_de.java src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_es.java src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_fr.java src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_it.java src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_ja.java src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_ko.java src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_pt_BR.java src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_sv.java src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_zh_CN.java src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_zh_HK.java src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_zh_TW.java src/jdk.runtime/share/classes/sun/tracing/MultiplexProviderFactory.java src/jdk.runtime/share/classes/sun/tracing/NullProviderFactory.java src/jdk.runtime/share/classes/sun/tracing/PrintStreamProviderFactory.java src/jdk.runtime/share/classes/sun/tracing/ProbeSkeleton.java src/jdk.runtime/share/classes/sun/tracing/ProviderSkeleton.java src/jdk.runtime/share/classes/sun/tracing/dtrace/Activation.java src/jdk.runtime/share/classes/sun/tracing/dtrace/DTraceProbe.java src/jdk.runtime/share/classes/sun/tracing/dtrace/DTraceProvider.java src/jdk.runtime/share/classes/sun/tracing/dtrace/DTraceProviderFactory.java src/jdk.runtime/share/classes/sun/tracing/dtrace/JVM.java src/jdk.runtime/share/classes/sun/tracing/package-info.java src/jdk.runtime/share/native/libjsdt/JVM.c src/jdk.runtime/share/native/libjsdt/jvm_symbols.h src/jdk.runtime/unix/native/libjsdt/jvm_symbols_md.c src/jdk.runtime/windows/native/libjsdt/jvm_symbols_md.c test/com/sun/tracing/BasicFunctionality.java test/com/sun/tracing/BasicWithSecurityMgr.java test/java/awt/color/LoadProfileWithSM.java test/java/awt/color/LoadStandardProfilesTest.java
diffstat 289 files changed, 22595 insertions(+), 21073 deletions(-) [+]
line wrap: on
line diff
--- a/make/copy/Copy-java.base.gmk	Thu Feb 19 11:24:03 2015 -0800
+++ b/make/copy/Copy-java.base.gmk	Thu Feb 19 16:38:11 2015 -0800
@@ -60,16 +60,28 @@
 endif
 
 ################################################################################
-# Copy msvcrXX.dll on windows
+# Copy the microsoft runtime libraries on windows
+ifeq ($(OPENJDK_TARGET_OS), windows)
 
-ifeq ($(OPENJDK_TARGET_OS), windows)
-  MSVCR_TARGET := $(LIB_DST_DIR)/$(notdir $(MSVCR_DLL))
   # Chmod to avoid permission issues if bundles are unpacked on unix platforms.
-  $(MSVCR_TARGET): $(MSVCR_DLL)
-	$(call install-file)
+  define copy-and-chmod
+	$(install-file)
 	$(CHMOD) a+rx $@
+  endef
 
-  TARGETS += $(MSVCR_TARGET)
+  # Use separate macro calls in case the source files are not in the same
+  # directory.
+  $(eval $(call SetupCopyFiles,COPY_MSVCR, \
+      DEST := $(LIB_DST_DIR), \
+      FILES := $(MSVCR_DLL), \
+      MACRO := copy-and-chmod))
+
+  $(eval $(call SetupCopyFiles,COPY_MSVCP, \
+      DEST := $(LIB_DST_DIR), \
+      FILES := $(MSVCP_DLL), \
+      MACRO := copy-and-chmod))
+
+  TARGETS += $(COPY_MSVCR) $(COPY_MSVCP)
 endif
 
 ################################################################################
--- a/make/data/charsetmapping/DoubleByte-X.java.template	Thu Feb 19 11:24:03 2015 -0800
+++ b/make/data/charsetmapping/DoubleByte-X.java.template	Thu Feb 19 16:38:11 2015 -0800
@@ -32,7 +32,8 @@
 import java.nio.charset.CharsetEncoder;
 import java.util.Arrays;
 import sun.nio.cs.HistoricallyNamedCharset;
-import sun.nio.cs.ext.DoubleByte;
+import sun.nio.cs.DoubleByte;
+import sun.nio.cs.*;
 
 public class $NAME_CLZ$ extends Charset
                         $IMPLEMENTS$
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/data/charsetmapping/charsets	Thu Feb 19 16:38:11 2015 -0800
@@ -0,0 +1,1818 @@
+#
+# Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+########################################################
+#
+# Standard charsets provided by StandardCharsets provider.
+#
+# Note that these "standard" charsets listed here are not
+# necessary to be the "Standard charsets" defined in the
+# specification of java.nio.charset.Charset. Instead these
+# are the charsets that this implementation believes should
+# be packaged into the charsets provider class "StandardCharsets"
+# which is initialized at startup time by java.nio.charset.Charset,
+# compared to the charsets packaged in "ExtendedCharsets" provider,
+# which is lazy initialized.
+########################################################
+
+charset US-ASCII US_ASCII
+    package sun.nio.cs
+    type    source
+    alias   iso-ir-6                    # IANA aliases
+    alias   ANSI_X3.4-1986
+    alias   ISO_646.irv:1991
+    alias   ASCII
+    alias   ISO646-US
+    alias   us
+    alias   IBM367
+    alias   cp367
+    alias   csASCII
+    alias   default
+                                        # Other aliases
+    alias   646                         # Solaris POSIX locale
+    alias   iso_646.irv:1983
+    alias   ANSI_X3.4-1968		# Linux POSIX locale (RedHat)
+    alias   ascii7
+
+charset UTF-8 UTF_8
+    package sun.nio.cs
+    type    source
+    alias   UTF8			# JDK historical
+    alias   unicode-1-1-utf-8
+
+charset CESU-8 CESU_8
+    package sun.nio.cs
+    type    source
+    alias   CESU8
+    alias   csCESU-8
+
+charset UTF-16 UTF_16
+    package sun.nio.cs
+    type    source
+    alias   UTF_16			# JDK historical
+    alias   utf16
+    alias   unicode
+    alias   UnicodeBig
+
+charset UTF-16BE UTF_16BE
+    package sun.nio.cs
+    type    source
+    alias   UTF_16BE
+    alias   ISO-10646-UCS-2
+    alias   X-UTF-16BE
+    alias   UnicodeBigUnmarked
+
+charset UTF-16LE UTF_16LE
+    package sun.nio.cs
+    type    source
+    alias   UTF_16LE
+    alias   X-UTF-16LE
+    alias   UnicodeLittleUnmarked
+
+charset x-UTF-16LE-BOM UTF_16LE_BOM
+    package sun.nio.cs
+    type    source
+    alias   UnicodeLittle
+
+charset UTF-32 UTF_32
+    package sun.nio.cs
+    type    source
+    alias   UTF_32
+    alias   UTF32
+
+charset UTF-32LE UTF_32LE
+    package sun.nio.cs
+    type    source
+    alias   UTF_32LE
+    alias   X-UTF-32LE
+
+charset UTF-32BE UTF_32BE
+    package sun.nio.cs
+    type    source
+    alias   UTF_32BE
+    alias   X-UTF-32BE
+
+charset X-UTF-32LE-BOM UTF_32LE_BOM
+    package sun.nio.cs
+    type    source
+    alias   UTF_32LE_BOM
+    alias   UTF-32LE-BOM
+
+charset X-UTF-32BE-BOM UTF_32BE_BOM
+    package sun.nio.cs
+    type    source
+    alias   UTF_32BE_BOM
+    alias   UTF-32BE-BOM
+
+charset ISO-8859-1 ISO_8859_1
+    package sun.nio.cs
+    type    source
+    alias   iso-ir-100                 # IANA aliases
+    alias   ISO_8859-1
+    alias   latin1
+    alias   l1
+    alias   IBM819
+    alias   cp819
+    alias   csISOLatin1
+    alias   819                        # Other aliases
+    alias   IBM-819
+    alias   ISO8859_1
+    alias   ISO_8859-1:1987
+    alias   ISO_8859_1
+    alias   8859_1
+    alias   ISO8859-1
+
+charset ISO-8859-2 ISO_8859_2
+    package sun.nio.cs
+    type    sbcs
+    hisname ISO8859_2
+    ascii   true
+    alias   iso8859_2			# JDK historical
+    alias   8859_2
+    alias   iso-ir-101
+    alias   ISO_8859-2
+    alias   ISO_8859-2:1987
+    alias   ISO8859-2
+    alias   latin2
+    alias   l2
+    alias   ibm912
+    alias   ibm-912
+    alias   cp912
+    alias   912
+    alias   csISOLatin2
+
+charset ISO-8859-4 ISO_8859_4
+    package sun.nio.cs
+    type    sbcs
+    hisname ISO8859_4
+    ascii   true
+    alias   iso8859_4			# JDK historical
+    alias   iso8859-4
+    alias   8859_4
+    alias   iso-ir-110
+    alias   ISO_8859-4
+    alias   ISO_8859-4:1988
+    alias   latin4
+    alias   l4
+    alias   ibm914
+    alias   ibm-914
+    alias   cp914
+    alias   914
+    alias   csISOLatin4
+
+charset ISO-8859-5 ISO_8859_5
+    package sun.nio.cs
+    type    sbcs
+    hisname ISO8859_5
+    ascii   true
+    alias   iso8859_5			# JDK historical
+    alias   8859_5
+    alias   iso-ir-144
+    alias   ISO_8859-5
+    alias   ISO_8859-5:1988
+    alias   ISO8859-5
+    alias   cyrillic
+    alias   ibm915
+    alias   ibm-915
+    alias   cp915
+    alias   915
+    alias   csISOLatinCyrillic
+
+charset ISO-8859-7 ISO_8859_7
+    package sun.nio.cs
+    type    sbcs
+    hisname ISO8859_7
+    ascii   true
+    alias   iso8859_7			# JDK historical
+    alias   8859_7
+    alias   iso-ir-126
+    alias   ISO_8859-7
+    alias   ISO_8859-7:1987
+    alias   ELOT_928
+    alias   ECMA-118
+    alias   greek
+    alias   greek8
+    alias   csISOLatinGreek
+    alias   sun_eu_greek		# Solaris 7/8 compatibility
+    alias   ibm813
+    alias   ibm-813
+    alias   813
+    alias   cp813
+    alias   iso8859-7			# Solaris 9 compatibility
+
+charset ISO-8859-9 ISO_8859_9
+    package sun.nio.cs
+    type    sbcs
+    hisname ISO8859_9
+    ascii   true
+    alias   iso8859_9			# JDK historical
+    alias   8859_9
+    alias   iso-ir-148
+    alias   ISO_8859-9
+    alias   ISO_8859-9:1989
+    alias   ISO8859-9
+    alias   latin5
+    alias   l5
+    alias   ibm920
+    alias   ibm-920
+    alias   920
+    alias   cp920
+    alias   csISOLatin5
+
+charset ISO-8859-13 ISO_8859_13
+    package sun.nio.cs
+    type    sbcs
+    hisname ISO8859_13
+    ascii   true
+    alias   iso8859_13			# JDK historical
+    alias   8859_13
+    alias   iso_8859-13
+    alias   ISO8859-13
+
+charset ISO-8859-15 ISO_8859_15
+    package sun.nio.cs
+    type    sbcs
+    hisname ISO8859_15
+    ascii   true
+    alias   ISO_8859-15                # IANA alias
+    alias   8859_15                    # Other aliases
+    alias   ISO-8859-15
+    alias   ISO8859_15
+    alias   ISO8859-15
+    alias   IBM923
+    alias   IBM-923
+    alias   cp923
+    alias   923
+    alias   LATIN0
+    alias   LATIN9
+    alias   L9
+    alias   csISOlatin0
+    alias   csISOlatin9
+    alias   ISO8859_15_FDIS
+
+charset KOI8-R KOI8_R
+    package sun.nio.cs
+    type    sbcs
+    hisname KOI8_R
+    ascii   true
+    alias   koi8_r			# JDK historical
+    alias   koi8
+    alias   cskoi8r
+
+charset KOI8-U KOI8_U
+    package sun.nio.cs
+    type    sbcs
+    hisname KOI8_U
+    ascii   true
+    alias   koi8_u
+
+charset windows-1250 MS1250
+    package sun.nio.cs
+    type    sbcs
+    hisname Cp1250
+    ascii   true
+    alias   cp1250			# JDK historical
+    alias   cp5346			# Euro IBM CCSID
+
+charset windows-1251 MS1251
+    package sun.nio.cs
+    type    sbcs
+    hisname Cp1251
+    ascii   true
+    alias   cp1251			# JDK historical
+    alias   cp5347			# Euro IBM CCSID
+    alias   ansi-1251			# Solaris compatibility
+
+charset windows-1252 MS1252
+    package sun.nio.cs
+    type    sbcs
+    hisname Cp1252
+    ascii   true
+    alias   cp1252			# JDK historical
+    alias   cp5348			# Euro IBM CCSID
+
+charset windows-1253 MS1253
+    package sun.nio.cs
+    type    sbcs
+    hisname Cp1253
+    ascii   true
+    alias   cp1253			# JDK historical
+    alias   cp5349			# Euro IBM CCSID
+
+charset windows-1254 MS1254
+    package sun.nio.cs
+    type    sbcs
+    hisname Cp1254
+    ascii   true
+    alias   cp1254			# JDK historical
+    alias   cp5350			# Euro IBM CCSID
+
+charset windows-1257 MS1257
+    package sun.nio.cs
+    type    sbcs
+    hisname Cp1257
+    ascii   true
+    alias   cp1257			# JDK historical
+    alias   cp5353			# Euro IBM CCSID
+
+
+charset IBM437 IBM437
+    package sun.nio.cs
+    type    sbcs
+    hisname Cp437
+    ascii   false
+    alias   cp437                      #JDK historical
+    alias   ibm437
+    alias   ibm-437
+    alias   437
+    alias   cspc8codepage437
+    alias   windows-437
+
+charset x-IBM737 IBM737
+    package sun.nio.cs
+    type    sbcs
+    hisname Cp737
+    ascii   false
+    alias   cp737                      #JDK historical
+    alias   ibm737
+    alias   ibm-737
+    alias   737
+
+charset IBM775 IBM775
+    package sun.nio.cs
+    type    sbcs
+    hisname Cp775
+    ascii   false
+    alias   cp775                      #JDK historical
+    alias   ibm775
+    alias   ibm-775
+    alias   775
+
+charset IBM850 IBM850
+    package sun.nio.cs
+    type    sbcs
+    hisname Cp850
+    ascii   false
+    alias   cp850                      #JDK historical
+    alias   ibm-850
+    alias   ibm850
+    alias   850
+    alias   cspc850multilingual
+
+charset IBM852 IBM852
+    package sun.nio.cs
+    type    sbcs
+    hisname Cp852
+    ascii   false
+    alias   cp852                      #JDK historical
+    alias   ibm852
+    alias   ibm-852
+    alias   852
+    alias   csPCp852
+
+charset IBM855 IBM855
+    package sun.nio.cs
+    type    sbcs
+    hisname Cp855
+    ascii   false
+    alias   cp855                      #JDK historical
+    alias   ibm-855
+    alias   ibm855
+    alias   855
+    alias   cspcp855
+
+charset IBM857 IBM857
+    package sun.nio.cs
+    type    sbcs
+    hisname Cp857
+    ascii   false
+    alias   cp857                      #JDK historical
+    alias   ibm857
+    alias   ibm-857
+    alias   857
+    alias   csIBM857
+
+charset IBM00858 IBM858
+    package sun.nio.cs
+    type    sbcs
+    hisname Cp858
+    ascii   false
+    alias   cp858                      #JDK historical
+    alias   ccsid00858
+    alias   cp00858
+    alias   858
+    alias   PC-Multilingual-850+euro
+
+charset IBM862 IBM862
+    package sun.nio.cs
+    type    sbcs
+    hisname Cp862
+    ascii   false
+    alias   cp862                      #JDK historical
+    alias   ibm862
+    alias   ibm-862
+    alias   862
+    alias   csIBM862
+    alias   cspc862latinhebrew
+
+charset IBM866 IBM866
+    package sun.nio.cs
+    type    sbcs
+    hisname Cp866
+    ascii   false
+    alias   cp866                      #JDK historical
+    alias   ibm866
+    alias   ibm-866
+    alias   866
+    alias   csIBM866
+
+charset x-IBM874 IBM874
+    package sun.nio.cs
+    type    sbcs
+    hisname Cp874
+    ascii   false
+    alias   cp874                      #JDK historical
+    alias   ibm874
+    alias   ibm-874
+    alias   874
+
+########################################################
+#
+# charsets provided by ExtendedCharsets provider.
+#
+########################################################
+charset Big5 Big5
+    package sun.nio.cs.ext
+    type    dbcs
+    hisname Big5
+    ascii   true
+    minmax  0xa1 0xf9 0x40 0xfe
+    alias   csBig5               # IANA aliases
+
+charset x-MS950-HKSCS-XP MS950_HKSCS_XP
+    package sun.nio.cs.ext
+    type    template
+    alias   MS950_HKSCS_XP       # JDK historical;
+
+charset x-MS950-HKSCS MS950_HKSCS
+    package sun.nio.cs.ext
+    type    source
+    hisname MS950_HKSCS
+    ascii   true
+    alias   MS950_HKSCS          # JDK historical;
+
+charset x-windows-950 MS950
+    package sun.nio.cs.ext
+    type    dbcs
+    hisname MS950
+    ascii   true
+    minmax  0x81 0xfe 0x40 0xfe
+    alias   ms950                # JDK historical
+    alias   windows-950
+
+charset x-windows-874 MS874
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname MS874
+    ascii   true
+    alias   ms874                # JDK historical
+    alias   ms-874
+    alias   windows-874
+
+charset x-EUC-TW EUC_TW
+    package sun.nio.cs.ext
+    type    source
+    alias   euc_tw               # JDK historical
+    alias   euctw
+    alias   cns11643
+    alias   EUC-TW
+
+charset Big5-HKSCS Big5_HKSCS
+    package sun.nio.cs.ext
+    type    template
+    hisname Big5_HKSCS
+    ascii   true
+    alias   Big5_HKSCS           # JDK historical
+    alias   big5hk
+    alias   big5-hkscs
+    alias   big5hkscs            # Linux alias
+
+charset x-Big5-HKSCS-2001 Big5_HKSCS_2001
+    package sun.nio.cs.ext
+    type    source
+    alias   Big5_HKSCS_2001
+    alias   big5hk-2001
+    alias   big5-hkscs-2001
+    alias   big5-hkscs:unicode3.0
+    alias   big5hkscs-2001
+
+charset x-Big5-Solaris Big5_Solaris
+    package sun.nio.cs.ext
+    type    template
+    hisname Big5_Solaris
+    ascii   true
+    alias   Big5_Solaris         # JDK historical
+
+
+charset GBK GBK                  # Simplified Chinese
+    package sun.nio.cs.ext
+    type    dbcs
+    hisname GBK
+    ascii   true
+    minmax  0x81 0xfe 0x40 0xfe
+    alias   windows-936
+    alias   CP936
+
+charset GB18030 GB18030
+    package sun.nio.cs.ext
+    type    source
+    alias   gb18030-2000
+
+charset GB2312 EUC_CN
+    package sun.nio.cs.ext
+    type    dbcs
+    hisname EUC_CN
+    ascii   true
+    minmax  0xa1 0xf7 0xa1 0xfe
+                                 # IANA aliases
+    alias   gb2312
+    alias   gb2312-80
+    alias   gb2312-1980
+    alias   euc-cn
+    alias   euccn
+    alias   x-EUC-CN             # 1.4 compatibility
+    alias   EUC_CN               # JDK historical
+
+charset x-mswin-936 MS936
+    package sun.nio.cs.ext
+    type    dbcs
+    hisname MS936
+    ascii   true
+    minmax  0x81 0xfe 0x40 0xfe
+    alias   ms936                # JDK historical
+    alias   ms_936 // IANA aliases
+
+# The definition of this charset may be overridden by the init method,
+# below, if the sun.nio.cs.map property is defined.
+# 
+charset Shift_JIS SJIS
+    package sun.nio.cs.ext
+    type    dbcs
+    hisname SJIS
+    ascii   true
+    minmax  0x81 0xfc 0x40 0xfc
+                                 # IANA aliases
+    alias   sjis                 # historical
+    alias   shift_jis
+    alias   shift-jis
+    alias   ms_kanji
+    alias   x-sjis
+    alias   csShiftJIS
+
+# The definition of this charset may be overridden by the init method,
+# below, if the sun.nio.cs.map property is defined.
+charset windows-31j MS932
+    package sun.nio.cs.ext
+    type    dbcs
+    hisname MS932
+    ascii   true
+    minmax  0x81 0xfc 0x40 0xfc
+    alias   MS932                # JDK historical
+    alias   windows-932
+    alias   csWindows31J
+
+charset JIS_X0201 JIS_X_0201
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname JIS_X0201
+    ascii   true
+    alias   JIS0201              # JDK historical
+                                 # IANA aliases
+    alias   JIS_X0201
+    alias   X0201
+    alias   csHalfWidthKatakana
+
+charset x-JIS0208 JIS_X_0208
+    package sun.nio.cs.ext
+    type    dbcsonly
+    hisname JIS0208
+    ascii   false
+    minmax  0x21 0x7e 0x21 0x7e
+    alias   JIS0208              # JDK historical
+                                 # IANA aliases
+    alias   JIS_C6226-1983
+    alias   iso-ir-87
+    alias   x0208
+    alias   JIS_X0208-1983
+    alias   csISO87JISX0208
+
+charset JIS_X0212-1990 JIS_X_0212
+    package sun.nio.cs.ext
+    type    dbcsonly
+    hisname JIS0212
+    ascii   false
+    minmax  0x21 0x7e 0x21 0x7e
+    alias   JIS0212              # JDK historical
+                                 # IANA aliases
+    alias   jis_x0212-1990
+    alias   x0212
+    alias   iso-ir-159
+    alias   csISO159JISX02121990
+
+charset x-SJIS_0213 SJIS_0213
+    package sun.nio.cs.ext
+    type    source
+    alias   sjis-0213
+    alias   sjis_0213
+    alias   sjis:2004
+    alias   sjis_0213:2004
+    alias   shift_jis_0213:2004
+    alias   shift_jis:2004
+
+charset x-MS932_0213 MS932_0213
+    package sun.nio.cs.ext
+    type    source
+    alias   MS932-0213
+    alias   MS932_0213
+    alias   MS932:2004
+    alias   windows-932-0213
+    alias   windows-932:2004
+
+charset EUC-JP EUC_JP
+    package sun.nio.cs.ext
+    type    template
+    hisname EUC_JP
+    ascii   true
+    alias   euc_jp               # JDK historical
+    alias   eucjis               # IANA aliases
+    alias   eucjp
+    alias   Extended_UNIX_Code_Packed_Format_for_Japanese
+    alias   csEUCPkdFmtjapanese
+    alias   x-euc-jp
+    alias   x-eucjp
+
+charset x-euc-jp-linux EUC_JP_LINUX
+    package sun.nio.cs.ext
+    type    template
+    hisname EUC_JP_LINUX
+    ascii   true
+    alias   euc_jp_linux         # JDK historical
+    alias   euc-jp-linux
+
+charset x-eucjp-open EUC_JP_Open
+    package sun.nio.cs.ext
+    type    template
+    hisname EUC_JP_Solari
+    ascii   true
+    alias   EUC_JP_Solaris       # JDK historical
+    alias   eucJP-open
+
+charset x-PCK PCK
+    package sun.nio.cs.ext
+    type    dbcs
+    hisname PCK
+    ascii   true
+    minmax  0x81 0xfc 0x40 0xfc
+                                 # IANA aliases
+    alias   pck                  # JDK historical
+
+charset ISO-2022-JP ISO2022_JP
+    package sun.nio.cs.ext
+    type    source
+                                 # IANA aliases
+    alias     iso2022jp          # JDK historical
+    alias     jis
+    alias     csISO2022JP
+    alias     jis_encoding
+    alias     csjisencoding
+
+charset ISO-2022-JP-2 ISO2022_JP_2
+    package sun.nio.cs.ext
+    type    source
+                                 # IANA aliases
+    alias     csISO2022JP2
+    alias     iso2022jp2
+
+charset x-windows-50221 MS50221
+    package sun.nio.cs.ext
+    type    source
+    alias     ms50221            # JDK historical
+    alias     cp50221
+
+charset x-windows-50220 MS50220
+    package sun.nio.cs.ext
+    type    source
+    alias     ms50220            # JDK historical
+    alias     cp50220
+
+charset x-windows-iso2022jp MSISO2022JP
+    package sun.nio.cs.ext
+    type    source
+     alias         windows-iso2022jp  # JDK historical
+
+charset x-JISAutoDetect JISAutoDetect
+    package sun.nio.cs.ext
+    type    source
+    alias   JISAutoDetect        # JDK historical
+
+
+charset EUC-KR EUC_KR            # Korean
+    package sun.nio.cs.ext
+    type    dbcs
+    hisname EUC_KR
+    ascii   true
+    minmax  0xa1 0xfd 0xa1 0xfe
+    alias   euc_kr               # JDK historical
+                                 # IANA aliases
+    alias   ksc5601
+    alias   euckr
+    alias   ks_c_5601-1987
+    alias   ksc5601-1987
+    alias   ksc5601_1987
+    alias   ksc_5601
+    alias   csEUCKR
+    alias   5601
+
+charset x-windows-949 MS949
+    package sun.nio.cs.ext
+    type    dbcs
+    hisname MS949
+    ascii   true
+    minmax  0x81 0xfe 0x41 0xfe
+    alias   ms949                # JDK historical
+    alias   windows949
+    alias   windows-949
+    alias   ms_949               # IANA aliases
+
+charset x-Johab Johab
+    package sun.nio.cs.ext
+    type    dbcs
+    hisname x-Johab
+    ascii   true
+    minmax  0x84 0xf9 0x31 0xfe
+    alias   ksc5601-1992
+    alias   ksc5601_1992
+    alias   ms1361
+    alias   johab                # JDK historical
+
+charset ISO-2022-KR ISO2022_KR
+    package sun.nio.cs.ext
+    type    source
+    alias   ISO2022KR            # JDK historical
+    alias   csISO2022KR
+
+charset ISO-2022-CN ISO2022_CN
+    package sun.nio.cs.ext
+    type    source
+    alias   ISO2022CN            # JDK historical
+    alias   csISO2022CN
+
+charset x-ISO-2022-CN-CNS ISO2022_CN_CNS
+    package sun.nio.cs.ext
+    type    source
+    alias   ISO2022CN_CNS        # JDK historical
+    alias   ISO-2022-CN-CNS
+
+charset x-ISO-2022-CN-GB ISO2022_CN_GB
+    package sun.nio.cs.ext
+    type    source
+    alias   ISO2022CN_GB         # JDK historical
+    alias   ISO-2022-CN-GB
+
+charset x-ISCII91 ISCII91
+    package sun.nio.cs.ext
+    type    source
+    alias   iscii
+    alias   ST_SEV_358-88
+    alias   iso-ir-153
+    alias   csISO153GOST1976874
+    alias   ISCII91              # JDK historical
+
+charset ISO-8859-3 ISO_8859_3
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname ISO8859_3
+    ascii   true
+    alias   iso8859_3            # JDK historical
+    alias   8859_3
+    alias   ISO_8859-3:1988
+    alias   iso-ir-109
+    alias   ISO_8859-3
+    alias   ISO8859-3
+    alias   latin3
+    alias   l3
+    alias   ibm913
+    alias   ibm-913
+    alias   cp913
+    alias   913
+    alias   csISOLatin3
+
+charset ISO-8859-6 ISO_8859_6
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname ISO8859_6
+    ascii   true
+    alias   iso8859_6            # JDK historical
+    alias   8859_6
+    alias   iso-ir-127
+    alias   ISO_8859-6
+    alias   ISO_8859-6:1987
+    alias   ISO8859-6
+    alias   ECMA-114
+    alias   ASMO-708
+    alias   arabic
+    alias   ibm1089
+    alias   ibm-1089
+    alias   cp1089
+    alias   1089
+    alias   csISOLatinArabic
+
+charset ISO-8859-8 ISO_8859_8
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname ISO8859_8
+    ascii   true
+    alias   iso8859_8            # JDK historical
+    alias   8859_8
+    alias   iso-ir-138
+    alias   ISO_8859-8
+    alias   ISO_8859-8:1988
+    alias   ISO8859-8
+    alias   cp916
+    alias   916
+    alias   ibm916
+    alias   ibm-916
+    alias   hebrew
+    alias   csISOLatinHebrew
+
+charset x-iso-8859-11 ISO_8859_11
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname x-iso-8859-11
+    ascii   true
+    alias   iso-8859-11
+    alias   iso8859_11
+
+charset TIS-620 TIS_620
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname TIS620
+    ascii   true
+    alias   tis620               # JDK historical
+    alias   tis620.2533
+
+# Microsoft Windows codepages
+
+charset windows-1255 MS1255
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp1255
+    ascii   true
+    alias   cp1255               # JDK historical
+
+charset windows-1256 MS1256
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp1256
+    ascii   true
+    alias   cp1256               # JDK historical
+
+charset windows-1258 MS1258
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp1258
+    ascii   true
+    alias   cp1258               # JDK historical
+
+charset x-IBM942 IBM942          # IBM & PC/MSDOS encodings
+    package sun.nio.cs.ext
+    type    dbcs
+    hisname Cp942
+    ascii   false
+    minmax  0x81 0xfc 0x40 0xfc
+    alias   cp942                # JDK historical
+    alias   ibm942
+    alias   ibm-942
+    alias   942
+
+charset x-IBM942C IBM942C
+    package sun.nio.cs.ext
+    type    source
+    alias   cp942C               # JDK historical
+    alias   ibm942C
+    alias   ibm-942C
+    alias   942C
+
+charset x-IBM943 IBM943
+    package sun.nio.cs.ext
+    type    dbcs
+    hisname Cp943
+    ascii   false
+    minmax  0x81 0xfc 0x40 0xfc
+    alias   cp943                # JDK historical
+    alias   ibm943
+    alias   ibm-943
+    alias   943
+
+charset x-IBM943C IBM943C
+    package sun.nio.cs.ext
+    type    source
+    alias   cp943C               # JDK historical
+    alias   ibm943C
+    alias   ibm-943C
+    alias   943C
+
+charset x-IBM948 IBM948
+    package sun.nio.cs.ext
+    type    dbcs
+    hisname Cp948
+    ascii   true
+    minmax  0x81 0xfe 0x40 0xfc
+    alias   cp948                # JDK historical
+    alias   ibm948
+    alias   ibm-948
+    alias   948
+
+charset x-IBM950 IBM950
+    package sun.nio.cs.ext
+    type    dbcs
+    hisname Cp950
+    ascii   true
+    minmax  0x81 0xfe 0x40 0xfe
+    alias   cp950                # JDK historical
+    alias   ibm950
+    alias   ibm-950
+    alias   950
+
+charset x-IBM930 IBM930
+    package sun.nio.cs.ext
+    type    ebcdic
+    hisname Cp930
+    ascii   false
+    minmax  0x40 0x7f 0x40 0xfe
+    alias   cp930                # JDK historical
+    alias   ibm930
+    alias   ibm-930
+    alias   930
+
+charset x-IBM935 IBM935
+    package sun.nio.cs.ext
+    type    ebcdic
+    hisname Cp935
+    ascii   false
+    minmax  0x40 0x7f 0x40 0xfe
+    alias   cp935                # JDK historical
+    alias   ibm935
+    alias   ibm-935
+    alias   935
+
+charset x-IBM937 IBM937
+    package sun.nio.cs.ext
+    type    ebcdic
+    hisname Cp937
+    ascii   false
+    minmax  0x40 0xe2 0x40 0xfe
+    alias   cp937                # JDK historical
+    alias   ibm937
+    alias   ibm-937
+    alias   937
+
+charset x-IBM856 IBM856
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp856
+    ascii   false
+    alias   cp856                # JDK historical
+    alias   ibm-856
+    alias   ibm856
+    alias   856
+
+charset IBM860 IBM860
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp860
+    ascii   false
+    alias   cp860                # JDK historical
+    alias   ibm860
+    alias   ibm-860
+    alias   860
+    alias   csIBM860
+
+charset IBM861 IBM861
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp861
+    ascii   false
+    alias   cp861                # JDK historical
+    alias   ibm861
+    alias   ibm-861
+    alias   861
+    alias   csIBM861
+    alias   cp-is
+
+charset IBM863 IBM863
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp863
+    ascii   false
+    alias   cp863                # JDK historical
+    alias   ibm863
+    alias   ibm-863
+    alias   863
+    alias   csIBM863
+
+charset IBM864 IBM864
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp864
+    ascii   false
+    alias   cp864                # JDK historical
+    alias   ibm864
+    alias   ibm-864
+    alias   864
+    alias   csIBM864
+
+
+charset IBM865 IBM865
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp865
+    ascii   false
+    alias   cp865                # JDK historical
+    alias   ibm865
+    alias   ibm-865
+    alias   865
+    alias   csIBM865
+
+charset IBM868 IBM868
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp868
+    ascii   false
+    alias   cp868                # JDK historical
+    alias   ibm868
+    alias   ibm-868
+    alias   868
+    alias   cp-ar
+    alias   csIBM868
+
+charset IBM869 IBM869
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp869
+    ascii   false
+    alias   cp869                # JDK historical
+    alias   ibm869
+    alias   ibm-869
+    alias   869
+    alias   cp-gr
+    alias   csIBM869
+
+charset x-IBM921 IBM921
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp921
+    ascii   false
+    alias   cp921                # JDK historical
+    alias   ibm921
+    alias   ibm-921
+    alias   921
+
+charset x-IBM1006 IBM1006
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp1006
+    ascii   false
+    alias   cp1006               # JDK historical
+    alias   ibm1006
+    alias   ibm-1006
+    alias   1006
+
+charset x-IBM1046 IBM1046
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp1046
+    ascii   false
+    alias   cp1046               # JDK historical
+    alias   ibm1046
+    alias   ibm-1046
+    alias   1046
+
+charset IBM1047 IBM1047
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp1047
+    ascii   false
+    alias   cp1047               # JDK historical
+    alias   ibm-1047
+    alias   1047
+
+charset x-IBM1098 IBM1098
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp1098
+    ascii   false
+    alias   cp1098               # JDK historical
+    alias   ibm1098
+    alias   ibm-1098
+    alias   1098
+
+charset IBM037 IBM037
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp037
+    ascii   false
+    alias   cp037                # JDK historical
+    alias   ibm037
+    alias   ebcdic-cp-us
+    alias   ebcdic-cp-ca
+    alias   ebcdic-cp-wt
+    alias   ebcdic-cp-nl
+    alias   csIBM037
+    alias   cs-ebcdic-cp-us
+    alias   cs-ebcdic-cp-ca
+    alias   cs-ebcdic-cp-wt
+    alias   cs-ebcdic-cp-nl
+    alias   ibm-037
+    alias   ibm-37
+    alias   cpibm37
+    alias   037
+
+charset x-IBM1025 IBM1025
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp1025
+    ascii   false
+    alias   cp1025               # JDK historical
+    alias   ibm1025
+    alias   ibm-1025
+    alias   1025
+
+charset IBM1026 IBM1026
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp1026
+    ascii   false
+    alias   cp1026               # JDK historical
+    alias   ibm1026
+    alias   ibm-1026
+    alias   1026
+
+charset x-IBM1112 IBM1112
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp1112
+    ascii   false
+    alias   cp1112               # JDK historical
+    alias   ibm1112
+    alias   ibm-1112
+    alias   1112
+
+charset x-IBM1122 IBM1122
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp1122
+    ascii   false
+    alias   cp1122               # JDK historical
+    alias   ibm1122
+    alias   ibm-1122
+    alias   1122
+
+charset x-IBM1123 IBM1123
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp1123
+    ascii   false
+    alias   cp1123               # JDK historical
+    alias   ibm1123
+    alias   ibm-1123
+    alias   1123
+
+charset x-IBM1124 IBM1124
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp1124
+    ascii   false
+    alias   cp1124               # JDK historical
+    alias   ibm1124
+    alias   ibm-1124
+    alias   1124
+
+charset x-IBM1364 IBM1364
+    package sun.nio.cs.ext
+    type    ebcdic
+    hisname Cp1364
+    ascii   false
+    minmax  0x40 0xde 0x40 0xfe
+    alias   cp1364
+    alias   ibm1364
+    alias   ibm-1364
+    alias   1364
+
+charset IBM273 IBM273
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp273
+    ascii   false
+    alias   cp273               # JDK historical
+    alias   ibm273
+    alias   ibm-273
+    alias   273
+
+charset IBM277 IBM277
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp277
+    ascii   false
+    alias   cp277               # JDK historical
+    alias   ibm277
+    alias   ibm-277
+    alias   277
+
+charset IBM278 IBM278
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp278
+    ascii   false
+    alias   cp278               # JDK historical
+    alias   ibm278
+    alias   ibm-278
+    alias   278
+    alias   ebcdic-sv
+    alias   ebcdic-cp-se
+    alias   csIBM278
+
+charset IBM280 IBM280
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp280
+    ascii   false
+    alias   cp280               # JDK historical
+    alias   ibm280
+    alias   ibm-280
+    alias   280
+
+charset IBM284 IBM284
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp284
+    ascii   false
+    alias   cp284               # JDK historical
+    alias   ibm284
+    alias   ibm-284
+    alias   284
+    alias   csIBM284
+    alias   cpibm284
+
+charset IBM285 IBM285
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp285
+    ascii   false
+    alias   cp285               # JDK historical
+    alias   ibm285
+    alias   ibm-285
+    alias   285
+    alias   ebcdic-cp-gb
+    alias   ebcdic-gb
+    alias   csIBM285
+    alias   cpibm285
+
+charset IBM297 IBM297
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp297
+    ascii   false
+    alias   cp297               # JDK historical
+    alias   ibm297
+    alias   ibm-297
+    alias   297
+    alias   ebcdic-cp-fr
+    alias   cpibm297
+    alias   csIBM297
+
+charset IBM420 IBM420
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp420
+    ascii   false
+    alias   cp420               # JDK historical
+    alias   ibm420
+    alias   ibm-420
+    alias   ebcdic-cp-ar1
+    alias   420
+    alias   csIBM420
+
+charset IBM424 IBM424
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp424
+    ascii   false
+    alias   cp424               # JDK historical
+    alias   ibm424
+    alias   ibm-424
+    alias   424
+    alias   ebcdic-cp-he
+    alias   csIBM424
+
+charset IBM500 IBM500
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp500
+    ascii   false
+    alias   cp500               # JDK historical
+    alias   ibm500
+    alias   ibm-500
+    alias   500
+    alias   ebcdic-cp-ch
+    alias   ebcdic-cp-bh
+    alias   csIBM500
+
+charset x-IBM833 IBM833
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp833
+    ascii   false
+     alias   cp833
+     alias   ibm833
+     alias   ibm-833
+
+
+charset x-IBM834 IBM834 # EBCDIC DBCS-only Korean
+    package sun.nio.cs.ext
+    type    source
+    alias   cp834
+    alias   ibm834
+    alias   834
+    alias   ibm-834
+
+charset IBM-Thai IBM838
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp838
+    ascii   false
+    alias   cp838               # JDK historical
+    alias   ibm838
+    alias   ibm-838
+    alias   838
+
+charset IBM870 IBM870
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp870
+    ascii   false
+    alias   cp870               # JDK historical
+    alias   ibm870
+    alias   ibm-870
+    alias   870
+    alias   ebcdic-cp-roece
+    alias   ebcdic-cp-yu
+    alias   csIBM870
+
+charset IBM871 IBM871
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp871
+    ascii   false
+    alias   cp871               # JDK historical
+    alias   ibm871
+    alias   ibm-871
+    alias   871
+    alias   ebcdic-cp-is
+    alias   csIBM871
+
+charset x-IBM875 IBM875
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp875
+    ascii   false
+    alias   cp875               # JDK historical
+    alias   ibm875
+    alias   ibm-875
+    alias   875
+
+charset IBM918 IBM918
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp918
+    ascii   false
+    alias   cp918               # JDK historical
+    alias   ibm-918
+    alias   918
+    alias   ebcdic-cp-ar2
+
+charset x-IBM922 IBM922
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp922
+    ascii   false
+    alias   cp922               # JDK historical
+    alias   ibm922
+    alias   ibm-922
+    alias   922
+
+charset x-IBM1097 IBM1097
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp1097
+    ascii   false
+    alias   cp1097              # JDK historical
+    alias   ibm1097
+    alias   ibm-1097
+    alias   1097
+
+charset x-IBM949 IBM949
+    package sun.nio.cs.ext
+    type    dbcs
+    hisname Cp949
+    ascii   false
+    minmax  0x8f 0xfe 0xa1 0xfe
+    alias   cp949               # JDK historical
+    alias   ibm949
+    alias   ibm-949
+    alias   949
+
+charset x-IBM949C IBM949C
+    package sun.nio.cs.ext
+    type    source
+    alias   cp949C              # JDK historical
+    alias   ibm949C
+    alias   ibm-949C
+    alias   949C
+
+charset x-IBM939 IBM939
+    package sun.nio.cs.ext
+    type    ebcdic
+    hisname Cp939
+    ascii   false
+    minmax  0x40 0x7f 0x40 0xfe
+    alias   cp939               # JDK historical
+    alias   ibm939
+    alias   ibm-939
+    alias   939
+
+charset x-IBM933 IBM933
+    package sun.nio.cs.ext
+    type    ebcdic
+    hisname Cp933
+    ascii   false
+    minmax  0x40 0xdd 0x40 0xfe
+    alias   cp933               # JDK historical
+    alias   ibm933
+    alias   ibm-933
+    alias   933
+
+charset x-IBM1381 IBM1381
+    package sun.nio.cs.ext
+    type    dbcs
+    hisname Cp1381
+    ascii   true
+    minmax  0x8c 0xf7 0xa1 0xfe
+    alias   cp1381              # JDK historical
+    alias   ibm1381
+    alias   ibm-1381
+    alias   1381
+
+charset x-IBM1383 IBM1383
+    package sun.nio.cs.ext
+    type    euc_sim
+    hisname Cp1383
+    ascii   true
+    minmax  0xa1 0xfe 0xa1 0xfe
+    alias   cp1383              # JDK historical
+    alias   ibm1383
+    alias   ibm-1383
+    alias   1383
+
+charset x-IBM970 IBM970
+    package sun.nio.cs.ext
+    type    euc_sim
+    hisname Cp970
+    ascii   true
+    minmax  0xa1 0xfe 0xa1 0xfe
+    alias   cp970               # JDK historical
+    alias   ibm970
+    alias   ibm-970
+    alias   ibm-eucKR
+    alias   970
+
+charset x-IBM964 IBM964
+    package sun.nio.cs.ext
+    type    source
+    alias   cp964               # JDK historical
+    alias   ibm964
+    alias   ibm-964
+    alias   964
+
+charset x-IBM33722 IBM33722
+    package sun.nio.cs.ext
+    type    source
+    alias   cp33722             # JDK historical
+    alias   ibm33722
+    alias   ibm-33722
+    alias   ibm-5050            # from IBM alias list
+    alias   ibm-33722_vascii_vpua # from IBM alias list
+    alias   33722
+
+charset IBM01140 IBM1140
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp1140
+    ascii   false
+    alias   cp1140              # JDK historical
+    alias   ccsid01140
+    alias   cp01140
+    alias   1140
+    alias   ebcdic-us-037+euro
+
+charset IBM01141 IBM1141
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp1141
+    ascii   false
+    alias   cp1141              # JDK historical
+    alias   ccsid01141
+    alias   cp01141
+    alias   1141
+    alias   ebcdic-de-273+euro
+
+charset IBM01142 IBM1142
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp1142
+    ascii   false
+    alias   cp1142              # JDK historical
+    alias   ccsid01142
+    alias   cp01142
+    alias   1142
+    alias   ebcdic-no-277+euro
+    alias   ebcdic-dk-277+euro
+
+charset IBM01143 IBM1143
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp1143
+    ascii   false
+    alias   cp1143              # JDK historical
+    alias   ccsid01143
+    alias   cp01143
+    alias   1143
+    alias   ebcdic-fi-278+euro
+    alias   ebcdic-se-278+euro
+
+charset IBM01144 IBM1144
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp1144
+    ascii   false
+    alias   cp1144              # JDK historical
+    alias   ccsid01144
+    alias   cp01144
+    alias   1144
+    alias   ebcdic-it-280+euro
+
+charset IBM01145 IBM1145
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp1145
+    ascii   false
+    alias   cp1145              # JDK historical
+    alias   ccsid01145
+    alias   cp01145
+    alias   1145
+    alias   ebcdic-es-284+euro
+
+charset IBM01146 IBM1146
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp1146
+    ascii   false
+    alias   cp1146              # JDK historical
+    alias   ccsid01146
+    alias   cp01146
+    alias   1146
+    alias   ebcdic-gb-285+euro
+
+charset IBM01147 IBM1147
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp1147
+    ascii   false
+    alias   cp1147              # JDK historical
+    alias   ccsid01147
+    alias   cp01147
+    alias   1147
+    alias   ebcdic-fr-277+euro
+
+charset IBM01148 IBM1148
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp1148
+    ascii   false
+    alias   cp1148              # JDK historical
+    alias   ccsid01148
+    alias   cp01148
+    alias   1148
+    alias   ebcdic-international-500+euro
+
+charset IBM01149 IBM1149
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp1149
+    ascii   false
+    alias   cp1149              # JDK historical
+    alias   ccsid01149
+    alias   cp01149
+    alias   1149
+    alias   ebcdic-s-871+euro
+
+charset IBM290 IBM290
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp290
+    ascii   false
+    alias   cp290
+    alias   ibm290
+    alias   ibm-290
+    alias   csIBM290
+    alias   EBCDIC-JP-kana
+    alias   290
+
+charset x-IBM300 IBM300
+    package sun.nio.cs.ext
+    type    dbcsonly
+    hisname Cp300
+    ascii   false
+    minmax  0x40 0x7f 0x40 0xfe
+    alias   cp300
+    alias   ibm300
+    alias   ibm-300
+    alias   300
+
+# Macintosh MacOS/Apple char encodingd
+
+charset x-MacRoman MacRoman
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname MacRoman
+    ascii   false
+    alias   MacRoman            # JDK historical
+
+charset x-MacCentralEurope MacCentralEurope
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname MacCentralEurope
+    ascii   false
+    alias   MacCentralEurope    # JDK historical
+
+charset x-MacCroatian MacCroatian
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname MacCroatian
+    ascii   false
+    alias   MacCroatian         # JDK historical
+
+charset x-MacGreek MacGreek
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname MacGreek
+    ascii   false
+    alias   MacGreek         # JDK historical
+
+charset x-MacCyrillic MacCyrillic
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname MacCyrillic
+    ascii   false
+    alias   MacCyrillic         # JDK historical
+
+charset x-MacUkraine MacUkraine
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname MacUkraine
+    ascii   false
+    alias   MacUkraine          # JDK historical
+
+charset x-MacTurkish MacTurkish
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname MacTurkish
+    ascii   false
+    alias   MacTurkish          # JDK historical
+
+charset x-MacArabic MacArabic
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname MacArabic
+    ascii   false
+    alias   MacArabic           # JDK historical
+
+charset x-MacHebrew MacHebrew
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname MacHebrew
+    ascii   false
+    alias   MacHebrew           # JDK historical
+
+charset x-MacIceland MacIceland
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname MacIceland
+    ascii   false
+    alias   MacIceland          # JDK historical
+
+charset x-MacRomania MacRomania
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname MacRomania
+    ascii   false
+    alias   MacRomania          # JDK historical
+
+charset x-MacThai MacThai
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname MacThai
+    ascii   false
+    alias   MacThai             # JDK historical
+
+charset x-MacSymbol MacSymbol
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname MacSymbol
+    ascii   false
+    alias   MacSymbol           # JDK historical
+
+charset x-MacDingbat MacDingbat
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname MacDingbat
+    ascii   false
+    alias   MacDingbat          # JDK historical
+
+########################################################
+#
+# internal use, not to be registered into spi
+#
+########################################################
+
+charset x-JIS0208_Solaris JIS_X_0208_Solaris
+    package sun.nio.cs.ext
+    type    dbcsonly
+    hisname JIS0208
+    ascii   false
+    minmax  0x21 0x9e 0x21 0x7e
+    internal true
+
+charset x-JIS0208_MS5022X JIS_X_0208_MS5022X
+    package sun.nio.cs.ext
+    type    dbcsonly
+    hisname JIS_X_0208_MS5022X
+    ascii   false
+    minmax  0x21 0x7e 0x21 0x7e
+    internal true
+
+charset x-JIS0208_MS932 JIS_X_0208_MS932
+    package sun.nio.cs.ext
+    type    dbcsonly
+    hisname JIS_X_0208_MS932
+    ascii   false
+    minmax  0x21 0x7e 0x21 0x7e
+    internal true               # "internal implementation
+
+charset x-JIS0212_Solaris JIS_X_0212_Solaris
+    package sun.nio.cs.ext
+    type    dbcsonly
+    hisname JIS_X_0212_Solaris
+    ascii   false
+    minmax  0x21 0x7e 0x21 0x7e
+    internal true               # "internal implementation
+
+charset x-JIS0212_MS5022X JIS_X_0212_MS5022X
+    package sun.nio.cs.ext
+    type    dbcsonly
+    hisname JIS_X_0212_MS5022X
+    ascii   false
+    minmax  0x21 0x7e 0x21 0x7e
+    internal true               # "internal implementation
--- a/make/data/charsetmapping/dbcs	Thu Feb 19 11:24:03 2015 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-#
-#clzName  csName     hisName  dbtype    pkg               ascii   b1min  b1max  b2min b2max
-#
-Big5      Big5       Big5     basic     sun.nio.cs.ext    true    0xa1   0xf9   0x40  0xfe
-Johab     x-Johab    x-Johab  basic     sun.nio.cs.ext    true    0x84   0xf9   0x31  0xfe
-EUC_CN	  GB2312     EUC_CN   basic     sun.nio.cs.ext    true    0xa1   0xf7   0xa1  0xfe
-EUC_KR	  EUC-KR     EUC_KR   basic     sun.nio.cs.ext    true    0xa1   0xfd   0xa1  0xfe
-MS932	  windows-31j MS932   basic     sun.nio.cs.ext    true    0x81   0xfc   0x40  0xfc
-MS936	  x-mswin-936 MS936   basic     sun.nio.cs.ext    true    0x81   0xfe   0x40  0xfe
-MS949	  x-windows-949 MS949 basic     sun.nio.cs.ext    true    0x81   0xfe   0x41  0xfe
-MS950	  x-windows-950 MS950 basic     sun.nio.cs.ext    true    0x81   0xfe   0x40  0xfe
-GBK	  GBK        GBK      basic     sun.nio.cs.ext    true    0x81   0xfe   0x40  0xfe
-SJIS	  Shift_JIS  SJIS     basic     sun.nio.cs.ext    true    0x81   0xfc   0x40  0xfc
-PCK	  x-PCK      PCK      basic     sun.nio.cs.ext    true    0x81   0xfc   0x40  0xfc
-IBM1364	  x-IBM1364  Cp1364   ebcdic	sun.nio.cs.ext	  false   0x40   0xde   0x40  0xfe
-IBM1381	  x-IBM1381  Cp1381   basic     sun.nio.cs.ext    true    0x8c   0xf7   0xa1  0xfe
-IBM1383	  x-IBM1383  Cp1383   euc_sim   sun.nio.cs.ext    true    0xa1   0xfe   0xa1  0xfe
-IBM300	  x-IBM300   Cp300    dbcsonly  sun.nio.cs.ext    false   0x40   0x7f   0x40  0xfe
-IBM930	  x-IBM930   Cp930    ebcdic    sun.nio.cs.ext    false   0x40   0x7f   0x40  0xfe
-IBM933	  x-IBM933   Cp933    ebcdic    sun.nio.cs.ext    false   0x40   0xdd   0x40  0xfe
-IBM935	  x-IBM935   Cp935    ebcdic    sun.nio.cs.ext    false   0x40   0x7f   0x40  0xfe
-IBM937	  x-IBM937   Cp937    ebcdic    sun.nio.cs.ext    false   0x40   0xe2   0x40  0xfe
-IBM939	  x-IBM939   Cp939    ebcdic    sun.nio.cs.ext    false   0x40   0x7f   0x40  0xfe
-IBM942	  x-IBM942   Cp942    basic     sun.nio.cs.ext    false   0x81   0xfc   0x40  0xfc
-IBM943	  x-IBM943   Cp943    basic     sun.nio.cs.ext    false   0x81   0xfc   0x40  0xfc
-IBM948	  x-IBM948   Cp948    basic     sun.nio.cs.ext    true    0x81   0xfe   0x40  0xfc
-IBM949	  x-IBM949   Cp949    basic     sun.nio.cs.ext    false   0x8f   0xfe   0xa1  0xfe
-IBM950	  x-IBM950   Cp950    basic     sun.nio.cs.ext    true    0x81   0xfe   0x40  0xfe
-IBM970	  x-IBM970   Cp970    euc_sim   sun.nio.cs.ext    true    0xa1   0xfe   0xa1  0xfe
-JIS_X_0208          x-JIS0208          JIS0208          dbcsonly  sun.nio.cs.ext  false  0x21  0x7e  0x21  0x7e
-JIS_X_0212          JIS_X0212-1990     JIS0212          dbcsonly  sun.nio.cs.ext  false  0x21  0x7e  0x21  0x7e
-JIS_X_0208_Solaris  x-JIS0208_Solaris  JIS0208_Solaris  dbcsonly  sun.nio.cs.ext  false  0x21  0x9e  0x21  0x7e
-JIS_X_0208_MS5022X  x-JIS0208_MS5022X  JIS0208_MS5022X  dbcsonly  sun.nio.cs.ext  false  0x21  0x7e  0x21  0x7e
-JIS_X_0208_MS932    x-JIS0208_MS932    JIS0208_MS932    dbcsonly  sun.nio.cs.ext  false  0x21  0x7e  0x21  0x7e
-JIS_X_0212_Solaris  x-JIS0212_Solaris  JIS0212_Solaris  dbcsonly  sun.nio.cs.ext  false  0x21  0x7e  0x21  0x7e
-JIS_X_0212_MS5022X  x-JIS0212_MS5022X  JIS0212_MS5022X  dbcsonly  sun.nio.cs.ext  false  0x21  0x7e  0x21  0x7e
--- a/make/data/charsetmapping/extsbcs	Thu Feb 19 11:24:03 2015 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +0,0 @@
-# clzName	csName		hisName		containASCII	pkg
-IBM037		IBM037		Cp037		false		sun.nio.cs.ext
-IBM1006		x-IBM1006	Cp1006		false		sun.nio.cs.ext
-IBM1025		x-IBM1025	Cp1025		false		sun.nio.cs.ext
-IBM1026		IBM1026		Cp1026		false		sun.nio.cs.ext
-IBM1046		x-IBM1046	Cp1046		false		sun.nio.cs.ext
-IBM1047		IBM1047		Cp1047		false		sun.nio.cs.ext
-IBM1097		x-IBM1097	Cp1097		false		sun.nio.cs.ext
-IBM1098		x-IBM1098	Cp1098		false		sun.nio.cs.ext
-IBM1112		x-IBM1112	Cp1112		false		sun.nio.cs.ext
-IBM1122		x-IBM1122	Cp1122		false		sun.nio.cs.ext
-IBM1123		x-IBM1123	Cp1123		false		sun.nio.cs.ext
-IBM1124		x-IBM1124	Cp1124		false		sun.nio.cs.ext
-# map tables for 1140-1149 are updated manualy with the u+20ac entry          
-IBM1140		IBM01140	Cp1140		false		sun.nio.cs.ext
-IBM1141		IBM01141	Cp1141		false		sun.nio.cs.ext
-IBM1142		IBM01142	Cp1142		false		sun.nio.cs.ext
-IBM1143		IBM01143	Cp1143		false		sun.nio.cs.ext
-IBM1144		IBM01144	Cp1144		false		sun.nio.cs.ext
-IBM1145		IBM01145	Cp1145		false		sun.nio.cs.ext
-IBM1146		IBM01146	Cp1146		false		sun.nio.cs.ext
-IBM1147		IBM01147	Cp1147		false		sun.nio.cs.ext
-IBM1148		IBM01148	Cp1148		false		sun.nio.cs.ext
-IBM1149		IBM01149	Cp1149		false		sun.nio.cs.ext
-IBM273		IBM273		Cp273		false		sun.nio.cs.ext
-IBM277		IBM277		Cp277		false		sun.nio.cs.ext
-IBM278		IBM278		Cp278		false		sun.nio.cs.ext
-IBM280		IBM280		Cp280		false		sun.nio.cs.ext
-IBM284		IBM284		Cp284		false		sun.nio.cs.ext
-IBM285		IBM285		Cp285		false		sun.nio.cs.ext
-IBM290		IBM290		Cp290		false		sun.nio.cs.ext
-IBM297		IBM297		Cp297		false		sun.nio.cs.ext
-IBM420		IBM420		Cp420		false		sun.nio.cs.ext
-IBM424		IBM424		Cp424		false		sun.nio.cs.ext
-IBM500		IBM500		Cp500		false		sun.nio.cs.ext
-IBM833		x-IBM833	Cp833		false		sun.nio.cs.ext
-IBM838		IBM-Thai	Cp838		false		sun.nio.cs.ext
-IBM856		x-IBM856	Cp856		false		sun.nio.cs.ext
-IBM860		IBM860		Cp860		false		sun.nio.cs.ext
-IBM861		IBM861		Cp861		false		sun.nio.cs.ext
-IBM863		IBM863		Cp863		false		sun.nio.cs.ext
-IBM864		IBM864		Cp864		false		sun.nio.cs.ext
-IBM865		IBM865		Cp865		false		sun.nio.cs.ext
-IBM868		IBM868		Cp868		false		sun.nio.cs.ext
-IBM869		IBM869		Cp869		false		sun.nio.cs.ext
-IBM870		IBM870		Cp870		false		sun.nio.cs.ext
-IBM871		IBM871		Cp871		false		sun.nio.cs.ext
-IBM875		x-IBM875	Cp875		false		sun.nio.cs.ext
-IBM918		IBM918		Cp918		false		sun.nio.cs.ext
-IBM921		x-IBM921	Cp921		false		sun.nio.cs.ext
-IBM922		x-IBM922	Cp922		false		sun.nio.cs.ext
-# use name as hisname as well, cs did not support hisname prevously           
-ISO_8859_11	x-iso-8859-11	x-iso-8859-11	true		sun.nio.cs.ext
-ISO_8859_3	ISO-8859-3	ISO8859_3	true		sun.nio.cs.ext
-ISO_8859_6	ISO-8859-6	ISO8859_6	true		sun.nio.cs.ext
-ISO_8859_8	ISO-8859-8	ISO8859_8	true		sun.nio.cs.ext
-JIS_X_0201	JIS_X0201	JIS_X0201	true		sun.nio.cs.ext
-MS1255		windows-1255	Cp1255		true		sun.nio.cs.ext
-MS1256		windows-1256	Cp1256		true		sun.nio.cs.ext
-MS1258		windows-1258	Cp1258		true		sun.nio.cs.ext
-MS874		x-windows-874	MS874		true		sun.nio.cs.ext
-MacArabic	x-MacArabic	MacArabic	false		sun.nio.cs.ext
-MacCentralEurope	x-MacCentralEurope	MacCentralEurope	false	sun.nio.cs.ext
-MacCroatian	x-MacCroatian	MacCroatian	false		sun.nio.cs.ext
-MacCyrillic	x-MacCyrillic	MacCyrillic	false		sun.nio.cs.ext
-MacDingbat	x-MacDingbat	MacDingbat	false		sun.nio.cs.ext
-MacGreek	x-MacGreek	MacGreek	false		sun.nio.cs.ext
-MacHebrew	x-MacHebrew	MacHebrew	false		sun.nio.cs.ext
-MacIceland	x-MacIceland	MacIceland	false		sun.nio.cs.ext
-MacRoman	x-MacRoman	MacRoman	false		sun.nio.cs.ext
-MacRomania	x-MacRomania	MacRomania	false		sun.nio.cs.ext
-MacSymbol	x-MacSymbol	MacSymbol	false		sun.nio.cs.ext
-MacThai		x-MacThai	MacThai		false		sun.nio.cs.ext
-MacTurkish	x-MacTurkish	MacTurkish	false		sun.nio.cs.ext
-MacUkraine	x-MacUkraine	MacUkraine	false		sun.nio.cs.ext
-TIS_620		TIS-620		TIS620		true		sun.nio.cs.ext
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/data/charsetmapping/list_old	Thu Feb 19 16:38:11 2015 -0800
@@ -0,0 +1,149 @@
+#
+# This is the copy of the old configuration files sbcs, dbcs and extsbcs
+# used in jdk8.
+############################### sbcs #########################################
+#
+# clzName	csName		hisName		containASCII	pkg
+#
+IBM437		IBM437		Cp437		false		sun.nio.cs
+IBM737		x-IBM737	Cp737		false		sun.nio.cs	
+IBM775		IBM775		Cp775		false		sun.nio.cs
+IBM850		IBM850		Cp850		false		sun.nio.cs
+IBM852		IBM852		Cp852		false		sun.nio.cs
+IBM855		IBM855		Cp855		false		sun.nio.cs
+IBM857		IBM857		Cp857		false		sun.nio.cs	
+IBM858		IBM00858	Cp858		false		sun.nio.cs
+IBM862		IBM862		Cp862		false		sun.nio.cs
+IBM866		IBM866		Cp866		false		sun.nio.cs
+IBM874		x-IBM874	Cp874		false		sun.nio.cs
+ISO_8859_2	ISO-8859-2	ISO8859_2	true		sun.nio.cs
+ISO_8859_4	ISO-8859-4	ISO8859_4	true		sun.nio.cs
+ISO_8859_5	ISO-8859-5	ISO8859_5	true		sun.nio.cs
+ISO_8859_7	ISO-8859-7	ISO8859_7	true		sun.nio.cs
+ISO_8859_9	ISO-8859-9	ISO8859_9	true		sun.nio.cs
+ISO_8859_13	ISO-8859-13	ISO8859_13	true		sun.nio.cs
+ISO_8859_15	ISO-8859-15	ISO8859_15	true		sun.nio.cs
+KOI8_R		KOI8-R		KOI8_R		true		sun.nio.cs
+KOI8_U		KOI8-U		KOI8_U		true		sun.nio.cs
+MS1250		windows-1250	Cp1250		true		sun.nio.cs
+MS1251		windows-1251	Cp1251		true		sun.nio.cs
+MS1252		windows-1252	Cp1252		true		sun.nio.cs
+MS1253		windows-1253	Cp1253		true		sun.nio.cs
+MS1254		windows-1254	Cp1254		true		sun.nio.cs
+MS1257		windows-1257	Cp1257		true		sun.nio.cs
+#
+############################### extsbcs #######################################
+#
+IBM037		IBM037		Cp037		false		sun.nio.cs.ext
+IBM1006		x-IBM1006	Cp1006		false		sun.nio.cs.ext
+IBM1025		x-IBM1025	Cp1025		false		sun.nio.cs.ext
+IBM1026		IBM1026		Cp1026		false		sun.nio.cs.ext
+IBM1046		x-IBM1046	Cp1046		false		sun.nio.cs.ext
+IBM1047		IBM1047		Cp1047		false		sun.nio.cs.ext
+IBM1097		x-IBM1097	Cp1097		false		sun.nio.cs.ext
+IBM1098		x-IBM1098	Cp1098		false		sun.nio.cs.ext
+IBM1112		x-IBM1112	Cp1112		false		sun.nio.cs.ext
+IBM1122		x-IBM1122	Cp1122		false		sun.nio.cs.ext
+IBM1123		x-IBM1123	Cp1123		false		sun.nio.cs.ext
+IBM1124		x-IBM1124	Cp1124		false		sun.nio.cs.ext
+# map tables for 1140-1149 are updated manualy with the u+20ac entry          
+IBM1140		IBM01140	Cp1140		false		sun.nio.cs.ext
+IBM1141		IBM01141	Cp1141		false		sun.nio.cs.ext
+IBM1142		IBM01142	Cp1142		false		sun.nio.cs.ext
+IBM1143		IBM01143	Cp1143		false		sun.nio.cs.ext
+IBM1144		IBM01144	Cp1144		false		sun.nio.cs.ext
+IBM1145		IBM01145	Cp1145		false		sun.nio.cs.ext
+IBM1146		IBM01146	Cp1146		false		sun.nio.cs.ext
+IBM1147		IBM01147	Cp1147		false		sun.nio.cs.ext
+IBM1148		IBM01148	Cp1148		false		sun.nio.cs.ext
+IBM1149		IBM01149	Cp1149		false		sun.nio.cs.ext
+IBM273		IBM273		Cp273		false		sun.nio.cs.ext
+IBM277		IBM277		Cp277		false		sun.nio.cs.ext
+IBM278		IBM278		Cp278		false		sun.nio.cs.ext
+IBM280		IBM280		Cp280		false		sun.nio.cs.ext
+IBM284		IBM284		Cp284		false		sun.nio.cs.ext
+IBM285		IBM285		Cp285		false		sun.nio.cs.ext
+IBM290		IBM290		Cp290		false		sun.nio.cs.ext
+IBM297		IBM297		Cp297		false		sun.nio.cs.ext
+IBM420		IBM420		Cp420		false		sun.nio.cs.ext
+IBM424		IBM424		Cp424		false		sun.nio.cs.ext
+IBM500		IBM500		Cp500		false		sun.nio.cs.ext
+IBM833		x-IBM833	Cp833		false		sun.nio.cs.ext
+IBM838		IBM-Thai	Cp838		false		sun.nio.cs.ext
+IBM856		x-IBM856	Cp856		false		sun.nio.cs.ext
+IBM860		IBM860		Cp860		false		sun.nio.cs.ext
+IBM861		IBM861		Cp861		false		sun.nio.cs.ext
+IBM863		IBM863		Cp863		false		sun.nio.cs.ext
+IBM864		IBM864		Cp864		false		sun.nio.cs.ext
+IBM865		IBM865		Cp865		false		sun.nio.cs.ext
+IBM868		IBM868		Cp868		false		sun.nio.cs.ext
+IBM869		IBM869		Cp869		false		sun.nio.cs.ext
+IBM870		IBM870		Cp870		false		sun.nio.cs.ext
+IBM871		IBM871		Cp871		false		sun.nio.cs.ext
+IBM875		x-IBM875	Cp875		false		sun.nio.cs.ext
+IBM918		IBM918		Cp918		false		sun.nio.cs.ext
+IBM921		x-IBM921	Cp921		false		sun.nio.cs.ext
+IBM922		x-IBM922	Cp922		false		sun.nio.cs.ext
+# use name as hisname as well, cs did not support hisname prevously           
+ISO_8859_11	x-iso-8859-11	x-iso-8859-11	true		sun.nio.cs.ext
+ISO_8859_3	ISO-8859-3	ISO8859_3	true		sun.nio.cs.ext
+ISO_8859_6	ISO-8859-6	ISO8859_6	true		sun.nio.cs.ext
+ISO_8859_8	ISO-8859-8	ISO8859_8	true		sun.nio.cs.ext
+JIS_X_0201	JIS_X0201	JIS_X0201	true		sun.nio.cs.ext
+MS1255		windows-1255	Cp1255		true		sun.nio.cs.ext
+MS1256		windows-1256	Cp1256		true		sun.nio.cs.ext
+MS1258		windows-1258	Cp1258		true		sun.nio.cs.ext
+MS874		x-windows-874	MS874		true		sun.nio.cs.ext
+MacArabic	x-MacArabic	MacArabic	false		sun.nio.cs.ext
+MacCentralEurope	x-MacCentralEurope	MacCentralEurope	false	sun.nio.cs.ext
+MacCroatian	x-MacCroatian	MacCroatian	false		sun.nio.cs.ext
+MacCyrillic	x-MacCyrillic	MacCyrillic	false		sun.nio.cs.ext
+MacDingbat	x-MacDingbat	MacDingbat	false		sun.nio.cs.ext
+MacGreek	x-MacGreek	MacGreek	false		sun.nio.cs.ext
+MacHebrew	x-MacHebrew	MacHebrew	false		sun.nio.cs.ext
+MacIceland	x-MacIceland	MacIceland	false		sun.nio.cs.ext
+MacRoman	x-MacRoman	MacRoman	false		sun.nio.cs.ext
+MacRomania	x-MacRomania	MacRomania	false		sun.nio.cs.ext
+MacSymbol	x-MacSymbol	MacSymbol	false		sun.nio.cs.ext
+MacThai		x-MacThai	MacThai		false		sun.nio.cs.ext
+MacTurkish	x-MacTurkish	MacTurkish	false		sun.nio.cs.ext
+MacUkraine	x-MacUkraine	MacUkraine	false		sun.nio.cs.ext
+TIS_620		TIS-620		TIS620		true		sun.nio.cs.ext
+#
+############################### dbcs #########################################
+#
+#clzName  csName     hisName  dbtype    pkg               ascii   b1min  b1max  b2min b2max
+#
+Big5      Big5       Big5     basic     sun.nio.cs.ext    true    0xa1   0xf9   0x40  0xfe
+Johab     x-Johab    x-Johab  basic     sun.nio.cs.ext    true    0x84   0xf9   0x31  0xfe
+EUC_CN	  GB2312     EUC_CN   basic     sun.nio.cs.ext    true    0xa1   0xf7   0xa1  0xfe
+EUC_KR	  EUC-KR     EUC_KR   basic     sun.nio.cs.ext    true    0xa1   0xfd   0xa1  0xfe
+MS932	  windows-31j MS932   basic     sun.nio.cs.ext    true    0x81   0xfc   0x40  0xfc
+MS936	  x-mswin-936 MS936   basic     sun.nio.cs.ext    true    0x81   0xfe   0x40  0xfe
+MS949	  x-windows-949 MS949 basic     sun.nio.cs.ext    true    0x81   0xfe   0x41  0xfe
+MS950	  x-windows-950 MS950 basic     sun.nio.cs.ext    true    0x81   0xfe   0x40  0xfe
+GBK	  GBK        GBK      basic     sun.nio.cs.ext    true    0x81   0xfe   0x40  0xfe
+SJIS	  Shift_JIS  SJIS     basic     sun.nio.cs.ext    true    0x81   0xfc   0x40  0xfc
+PCK	  x-PCK      PCK      basic     sun.nio.cs.ext    true    0x81   0xfc   0x40  0xfc
+IBM1364	  x-IBM1364  Cp1364   ebcdic	sun.nio.cs.ext	  false   0x40   0xde   0x40  0xfe
+IBM1381	  x-IBM1381  Cp1381   basic     sun.nio.cs.ext    true    0x8c   0xf7   0xa1  0xfe
+IBM1383	  x-IBM1383  Cp1383   euc_sim   sun.nio.cs.ext    true    0xa1   0xfe   0xa1  0xfe
+IBM300	  x-IBM300   Cp300    dbcsonly  sun.nio.cs.ext    false   0x40   0x7f   0x40  0xfe
+IBM930	  x-IBM930   Cp930    ebcdic    sun.nio.cs.ext    false   0x40   0x7f   0x40  0xfe
+IBM933	  x-IBM933   Cp933    ebcdic    sun.nio.cs.ext    false   0x40   0xdd   0x40  0xfe
+IBM935	  x-IBM935   Cp935    ebcdic    sun.nio.cs.ext    false   0x40   0x7f   0x40  0xfe
+IBM937	  x-IBM937   Cp937    ebcdic    sun.nio.cs.ext    false   0x40   0xe2   0x40  0xfe
+IBM939	  x-IBM939   Cp939    ebcdic    sun.nio.cs.ext    false   0x40   0x7f   0x40  0xfe
+IBM942	  x-IBM942   Cp942    basic     sun.nio.cs.ext    false   0x81   0xfc   0x40  0xfc
+IBM943	  x-IBM943   Cp943    basic     sun.nio.cs.ext    false   0x81   0xfc   0x40  0xfc
+IBM948	  x-IBM948   Cp948    basic     sun.nio.cs.ext    true    0x81   0xfe   0x40  0xfc
+IBM949	  x-IBM949   Cp949    basic     sun.nio.cs.ext    false   0x8f   0xfe   0xa1  0xfe
+IBM950	  x-IBM950   Cp950    basic     sun.nio.cs.ext    true    0x81   0xfe   0x40  0xfe
+IBM970	  x-IBM970   Cp970    euc_sim   sun.nio.cs.ext    true    0xa1   0xfe   0xa1  0xfe
+JIS_X_0208          x-JIS0208          JIS0208          dbcsonly  sun.nio.cs.ext  false  0x21  0x7e  0x21  0x7e
+JIS_X_0212          JIS_X0212-1990     JIS0212          dbcsonly  sun.nio.cs.ext  false  0x21  0x7e  0x21  0x7e
+JIS_X_0208_Solaris  x-JIS0208_Solaris  JIS0208_Solaris  dbcsonly  sun.nio.cs.ext  false  0x21  0x9e  0x21  0x7e
+JIS_X_0208_MS5022X  x-JIS0208_MS5022X  JIS0208_MS5022X  dbcsonly  sun.nio.cs.ext  false  0x21  0x7e  0x21  0x7e
+JIS_X_0208_MS932    x-JIS0208_MS932    JIS0208_MS932    dbcsonly  sun.nio.cs.ext  false  0x21  0x7e  0x21  0x7e
+JIS_X_0212_Solaris  x-JIS0212_Solaris  JIS0212_Solaris  dbcsonly  sun.nio.cs.ext  false  0x21  0x7e  0x21  0x7e
+JIS_X_0212_MS5022X  x-JIS0212_MS5022X  JIS0212_MS5022X  dbcsonly  sun.nio.cs.ext  false  0x21  0x7e  0x21  0x7e
--- a/make/data/charsetmapping/sbcs	Thu Feb 19 11:24:03 2015 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-# clzName	csName		hisName		containASCII	pkg
-IBM437		IBM437		Cp437		false		sun.nio.cs
-IBM737		x-IBM737	Cp737		false		sun.nio.cs	
-IBM775		IBM775		Cp775		false		sun.nio.cs
-IBM850		IBM850		Cp850		false		sun.nio.cs
-IBM852		IBM852		Cp852		false		sun.nio.cs
-IBM855		IBM855		Cp855		false		sun.nio.cs
-IBM857		IBM857		Cp857		false		sun.nio.cs	
-IBM858		IBM00858	Cp858		false		sun.nio.cs
-IBM862		IBM862		Cp862		false		sun.nio.cs
-IBM866		IBM866		Cp866		false		sun.nio.cs
-IBM874		x-IBM874	Cp874		false		sun.nio.cs
-ISO_8859_2	ISO-8859-2	ISO8859_2	true		sun.nio.cs
-ISO_8859_4	ISO-8859-4	ISO8859_4	true		sun.nio.cs
-ISO_8859_5	ISO-8859-5	ISO8859_5	true		sun.nio.cs
-ISO_8859_7	ISO-8859-7	ISO8859_7	true		sun.nio.cs
-ISO_8859_9	ISO-8859-9	ISO8859_9	true		sun.nio.cs
-ISO_8859_13	ISO-8859-13	ISO8859_13	true		sun.nio.cs
-ISO_8859_15	ISO-8859-15	ISO8859_15	true		sun.nio.cs
-KOI8_R		KOI8-R		KOI8_R		true		sun.nio.cs
-KOI8_U		KOI8-U		KOI8_U		true		sun.nio.cs
-MS1250		windows-1250	Cp1250		true		sun.nio.cs
-MS1251		windows-1251	Cp1251		true		sun.nio.cs
-MS1252		windows-1252	Cp1252		true		sun.nio.cs
-MS1253		windows-1253	Cp1253		true		sun.nio.cs
-MS1254		windows-1254	Cp1254		true		sun.nio.cs
-MS1257		windows-1257	Cp1257		true		sun.nio.cs
-
--- a/make/data/charsetmapping/standard-charsets	Thu Feb 19 11:24:03 2015 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,337 +0,0 @@
-#
-# Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-# Standard charsets provided by StandardCharsets provider.
-#
-# Note that these "standard" charsets listed here are not
-# necessary to be the "Standard charsets" defined in the
-# specification of java.nio.charset.Charset. Instead these
-# are the charsets that this implementation believes should
-# be packaged into the charsets provider class "StandardCharsets"
-# which is initialized at startup time by java.nio.charset.Charset,
-# compared to the charsets packaged in "ExtendedCharsets" provider,
-# which is lazy initialized.
-
-charset US-ASCII US_ASCII
-
-    # IANA aliases
-    alias iso-ir-6
-    alias ANSI_X3.4-1986
-    alias ISO_646.irv:1991
-    alias ASCII
-    alias ISO646-US
-    alias us
-    alias IBM367
-    alias cp367
-    alias csASCII
-    alias default
-
-    # Other aliases
-    alias 646				# Solaris POSIX locale
-    alias iso_646.irv:1983
-    alias ANSI_X3.4-1968		# Linux POSIX locale (RedHat)
-    alias ascii7
-
-charset UTF-8 UTF_8
-    alias UTF8				# JDK historical
-    alias unicode-1-1-utf-8
-
-charset CESU-8 CESU_8
-    alias CESU8
-    alias csCESU-8
-
-charset UTF-16 UTF_16
-    alias UTF_16			# JDK historical
-    alias utf16
-    alias unicode
-    alias UnicodeBig
-
-charset UTF-16BE UTF_16BE
-    alias UTF_16BE
-    alias ISO-10646-UCS-2
-    alias X-UTF-16BE
-    alias UnicodeBigUnmarked
-
-charset UTF-16LE UTF_16LE
-    alias UTF_16LE
-    alias X-UTF-16LE
-    alias UnicodeLittleUnmarked
-
-charset x-UTF-16LE-BOM UTF_16LE_BOM
-    alias UnicodeLittle
-
-charset UTF-32 UTF_32
-    alias UTF_32
-    alias UTF32
-
-charset UTF-32LE UTF_32LE
-    alias UTF_32LE
-    alias X-UTF-32LE
-
-charset UTF-32BE UTF_32BE
-    alias UTF_32BE
-    alias X-UTF-32BE
-
-charset X-UTF-32LE-BOM UTF_32LE_BOM
-    alias UTF_32LE_BOM
-    alias UTF-32LE-BOM
-
-charset X-UTF-32BE-BOM UTF_32BE_BOM
-    alias UTF_32BE_BOM
-    alias UTF-32BE-BOM
-
-charset ISO-8859-1 ISO_8859_1
-
-    # IANA aliases
-    alias iso-ir-100
-    alias ISO_8859-1
-    alias latin1
-    alias l1
-    alias IBM819
-    alias cp819
-    alias csISOLatin1
-
-    # Other aliases
-    alias 819
-    alias IBM-819
-    alias ISO8859_1
-    alias ISO_8859-1:1987
-    alias ISO_8859_1
-    alias 8859_1
-    alias ISO8859-1
-
-charset ISO-8859-2 ISO_8859_2
-    alias iso8859_2			# JDK historical
-    alias 8859_2
-    alias iso-ir-101
-    alias ISO_8859-2
-    alias ISO_8859-2:1987
-    alias ISO8859-2
-    alias latin2
-    alias l2
-    alias ibm912
-    alias ibm-912
-    alias cp912
-    alias 912
-    alias csISOLatin2
-
-charset ISO-8859-4 ISO_8859_4
-    alias iso8859_4			# JDK historical
-    alias iso8859-4
-    alias 8859_4
-    alias iso-ir-110
-    alias ISO_8859-4
-    alias ISO_8859-4:1988
-    alias latin4
-    alias l4
-    alias ibm914
-    alias ibm-914
-    alias cp914
-    alias 914
-    alias csISOLatin4
-
-charset ISO-8859-5 ISO_8859_5
-    alias iso8859_5			# JDK historical
-    alias 8859_5
-    alias iso-ir-144
-    alias ISO_8859-5
-    alias ISO_8859-5:1988
-    alias ISO8859-5
-    alias cyrillic
-    alias ibm915
-    alias ibm-915
-    alias cp915
-    alias 915
-    alias csISOLatinCyrillic
-
-charset ISO-8859-7 ISO_8859_7
-    alias iso8859_7			# JDK historical
-    alias 8859_7
-    alias iso-ir-126
-    alias ISO_8859-7
-    alias ISO_8859-7:1987
-    alias ELOT_928
-    alias ECMA-118
-    alias greek
-    alias greek8
-    alias csISOLatinGreek
-    alias sun_eu_greek			# Solaris 7/8 compatibility
-    alias ibm813
-    alias ibm-813
-    alias 813
-    alias cp813
-    alias iso8859-7			# Solaris 9 compatibility
-
-charset ISO-8859-9 ISO_8859_9
-    alias iso8859_9			# JDK historical
-    alias 8859_9
-    alias iso-ir-148
-    alias ISO_8859-9
-    alias ISO_8859-9:1989
-    alias ISO8859-9
-    alias latin5
-    alias l5
-    alias ibm920
-    alias ibm-920
-    alias 920
-    alias cp920
-    alias csISOLatin5
-
-charset ISO-8859-13 ISO_8859_13
-    alias iso8859_13			# JDK historical
-    alias 8859_13
-    alias iso_8859-13
-    alias ISO8859-13
-
-charset ISO-8859-15 ISO_8859_15
-
-    # IANA alias
-    alias ISO_8859-15
-
-    # Other aliases
-    alias 8859_15
-    alias ISO-8859-15
-    alias ISO8859_15
-    alias ISO8859-15
-    alias IBM923
-    alias IBM-923
-    alias cp923
-    alias 923
-    alias LATIN0
-    alias LATIN9
-    alias L9
-    alias csISOlatin0
-    alias csISOlatin9
-    alias ISO8859_15_FDIS
-
-charset KOI8-R KOI8_R
-    alias koi8_r			# JDK historical
-    alias koi8
-    alias cskoi8r
-
-charset KOI8-U KOI8_U
-    alias koi8_u
-
-charset windows-1250 MS1250
-    alias cp1250			# JDK historical
-    alias cp5346			# Euro IBM CCSID
-
-charset windows-1251 MS1251
-    alias cp1251			# JDK historical
-    alias cp5347			# Euro IBM CCSID
-    alias ansi-1251			# Solaris compatibility
-
-charset windows-1252 MS1252
-    alias cp1252			# JDK historical
-    alias cp5348			# Euro IBM CCSID
-
-charset windows-1253 MS1253
-    alias cp1253			# JDK historical
-    alias cp5349			# Euro IBM CCSID
-
-charset windows-1254 MS1254
-    alias cp1254			# JDK historical
-    alias cp5350			# Euro IBM CCSID
-
-charset windows-1257 MS1257
-    alias cp1257			# JDK historical
-    alias cp5353			# Euro IBM CCSID
-
-
-charset IBM437 IBM437
-    alias cp437                         #JDK historical
-    alias ibm437
-    alias ibm-437
-    alias 437
-    alias cspc8codepage437
-    alias windows-437
-
-charset x-IBM737 IBM737
-    alias cp737                         #JDK historical
-    alias ibm737
-    alias ibm-737
-    alias 737
-
-charset IBM775 IBM775
-    alias cp775                         #JDK historical
-    alias ibm775
-    alias ibm-775
-    alias 775
-
-charset IBM850 IBM850
-    alias cp850                         #JDK historical
-    alias ibm-850
-    alias ibm850
-    alias 850
-    alias cspc850multilingual
-
-charset IBM852 IBM852
-    alias cp852                         #JDK historical
-    alias ibm852
-    alias ibm-852
-    alias 852
-    alias csPCp852
-
-charset IBM855 IBM855
-    alias cp855                         #JDK historical
-    alias ibm-855
-    alias ibm855
-    alias 855
-    alias cspcp855
-
-charset IBM857 IBM857
-    alias cp857                         #JDK historical
-    alias ibm857
-    alias ibm-857
-    alias 857
-    alias csIBM857
-
-charset IBM00858 IBM858
-    alias cp858                         #JDK historical
-    alias ccsid00858
-    alias cp00858
-    alias 858
-    alias PC-Multilingual-850+euro
-
-charset IBM862 IBM862
-    alias cp862                         #JDK historical
-    alias ibm862
-    alias ibm-862
-    alias 862
-    alias csIBM862
-    alias cspc862latinhebrew
-
-charset IBM866 IBM866
-    alias cp866                         #JDK historical
-    alias ibm866
-    alias ibm-866
-    alias 866
-    alias csIBM866
-
-charset x-IBM874 IBM874
-    alias cp874                         #JDK historical
-    alias ibm874
-    alias ibm-874
-    alias 874
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/data/charsetmapping/stdcs-linux	Thu Feb 19 16:38:11 2015 -0800
@@ -0,0 +1,19 @@
+#
+#   generate these charsets into sun.nio.cs
+#
+Big5
+Big5_Solaris
+Big5_HKSCS
+EUC_CN
+EUC_KR
+EUC_JP
+EUC_JP_LINUX
+EUC_JP_Open
+GBK
+Johab
+PCK
+JIS_X_0201
+JIS_X_0208
+JIS_X_0212
+JIS_X_0208_Solaris
+JIS_X_0212_Solaris
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/data/charsetmapping/stdcs-solaris	Thu Feb 19 16:38:11 2015 -0800
@@ -0,0 +1,23 @@
+#
+#   generate these charsets into sun.nio.cs
+#
+Big5
+Big5_Solaris
+Big5_HKSCS        # always together with Big5
+EUC_CN
+EUC_KR
+EUC_JP
+EUC_JP_LINUX
+EUC_JP_Open
+GBK
+ISO_8859_11
+ISO_8859_3
+ISO_8859_6
+ISO_8859_8
+Johab
+PCK
+JIS_X_0201
+JIS_X_0208
+JIS_X_0212
+JIS_X_0208_Solaris
+JIS_X_0212_Solaris
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/data/charsetmapping/stdcs-windows	Thu Feb 19 16:38:11 2015 -0800
@@ -0,0 +1,16 @@
+#
+#   generate these charsets into sun.nio.cs
+#
+GBK
+Johab
+MS1255
+MS1256
+MS1258
+MS874
+MS932
+JIS_X_0201 # JIS_X_0201 is used by MS932 in its contains() method
+SJIS       # SJIS must go together with MS932 to support sun.nio.cs.map
+MS936
+MS949
+MS950
+MS950_HKSCS_XP
--- a/make/gensrc/Gensrc-jdk.charsets.gmk	Thu Feb 19 11:24:03 2015 -0800
+++ b/make/gensrc/Gensrc-jdk.charsets.gmk	Thu Feb 19 16:38:11 2015 -0800
@@ -30,23 +30,27 @@
 # Generate files using the charsetmapping tool
 #
 CHARSET_DATA_DIR := $(JDK_TOPDIR)/make/data/charsetmapping
+
 CHARSET_GENSRC_JAVA_DIR_CS := $(SUPPORT_OUTPUTDIR)/gensrc/jdk.charsets/sun/nio/cs/ext
 CHARSET_DONE_CS := $(CHARSET_GENSRC_JAVA_DIR_CS)/_the.charsetmapping
 CHARSET_COPYRIGHT_HEADER := $(JDK_TOPDIR)/make/src/classes/build/tools/charsetmapping
 CHARSET_TEMPLATES := \
     $(CHARSET_DATA_DIR)/SingleByte-X.java.template \
     $(CHARSET_DATA_DIR)/DoubleByte-X.java.template
+CHARSET_EXTENDED_JAVA_TEMPLATES := \
+    $(JDK_TOPDIR)/src/jdk.charsets/share/classes/sun/nio/cs/ext/ExtendedCharsets.java.template
+CHARSET_EXTENDED_JAVA_DIR := $(JDK_TOPDIR)/src/jdk.charsets/share/classes/sun/nio/cs/ext
+CHARSET_STANDARD_OS := stdcs-$(OPENJDK_TARGET_OS)
 
-$(CHARSET_DONE_CS)-extsbcs: $(CHARSET_DATA_DIR)/extsbcs  \
-    $(CHARSET_TEMPLATES) $(BUILD_TOOLS_JDK)
+$(CHARSET_DONE_CS)-extcs: $(CHARSET_DATA_DIR)/charsets \
+    $(wildcard $(CHARSET_DATA_DIR)/$(CHARSET_STANDARD_OS)) \
+    $(CHARSET_TEMPLATES) $(CHARSET_EXTENDED_JAVA_TEMPLATES) \
+    $(BUILD_TOOLS_JDK)
 	$(MKDIR) -p $(@D)
-	$(TOOL_CHARSETMAPPING) $(CHARSET_DATA_DIR) $(CHARSET_GENSRC_JAVA_DIR_CS) extsbcs
-	$(TOUCH) '$@'
-
-$(CHARSET_DONE_CS)-dbcs: $(CHARSET_DATA_DIR)/dbcs \
-    $(CHARSET_TEMPLATES) $(BUILD_TOOLS_JDK)
-	$(MKDIR) -p $(@D)
-	$(TOOL_CHARSETMAPPING) $(CHARSET_DATA_DIR) $(CHARSET_GENSRC_JAVA_DIR_CS) dbcs
+	$(TOOL_CHARSETMAPPING) $(CHARSET_DATA_DIR) $(CHARSET_GENSRC_JAVA_DIR_CS) \
+	    extcs charsets  $(CHARSET_STANDARD_OS) \
+	    $(CHARSET_EXTENDED_JAVA_TEMPLATES) \
+	    $(CHARSET_EXTENDED_JAVA_DIR) $(LOG_INFO)
 	$(TOUCH) '$@'
 
 $(CHARSET_DONE_CS)-hkscs: $(CHARSET_COPYRIGHT_HEADER)/HKSCS.java \
@@ -67,8 +71,7 @@
 	$(TOOL_CHARSETMAPPING) '$<' '$@' sjis0213
 
 GENSRC_JDK_CHARSETS += \
-    $(CHARSET_DONE_CS)-extsbcs \
-    $(CHARSET_DONE_CS)-dbcs \
+    $(CHARSET_DONE_CS)-extcs \
     $(CHARSET_DONE_CS)-hkscs \
     $(CHARSET_DONE_CS)-euctw \
     $(CHARSET_GENSRC_JAVA_DIR_CS)/sjis0213.dat \
--- a/make/gensrc/GensrcCharsetMapping.gmk	Thu Feb 19 11:24:03 2015 -0800
+++ b/make/gensrc/GensrcCharsetMapping.gmk	Thu Feb 19 16:38:11 2015 -0800
@@ -25,112 +25,29 @@
 
 ################################################################################
 #
-# Generate files using the charsetmapping tool
+# Generate StandardCharsets.java and individul sun.nio.cs charset class using
+# the charsetmapping tool
 #
 CHARSET_DATA_DIR := $(JDK_TOPDIR)/make/data/charsetmapping
+CHARSET_EXTSRC_DIR := $(JDK_TOPDIR)/src/jdk.charsets/share/classes/sun/nio/cs/ext
 CHARSET_GENSRC_JAVA_DIR_BASE := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/nio/cs
 CHARSET_DONE_BASE := $(CHARSET_GENSRC_JAVA_DIR_BASE)/_the.charsetmapping
 CHARSET_TEMPLATES := \
     $(CHARSET_DATA_DIR)/SingleByte-X.java.template \
     $(CHARSET_DATA_DIR)/DoubleByte-X.java.template
+CHARSET_STANDARD_JAVA_TEMPLATES := \
+    $(JDK_TOPDIR)/src/java.base/share/classes/sun/nio/cs/StandardCharsets.java.template
+CHARSET_STANDARD_OS := stdcs-$(OPENJDK_TARGET_OS)
 
-$(CHARSET_DONE_BASE)-sbcs: $(CHARSET_DATA_DIR)/sbcs \
-    $(CHARSET_TEMPLATES) $(BUILD_TOOLS_JDK)
+$(CHARSET_DONE_BASE)-stdcs: $(CHARSET_DATA_DIR)/charsets \
+    $(wildcard $(CHARSET_DATA_DIR)/$(CHARSET_STANDARD_OS)) \
+    $(CHARSET_TEMPLATES) $(CHARSET_STANDARD_JAVA_TEMPLATES) \
+    $(BUILD_TOOLS_JDK)
 	$(MKDIR) -p $(@D)
-	$(TOOL_CHARSETMAPPING) $(CHARSET_DATA_DIR) $(CHARSET_GENSRC_JAVA_DIR_BASE) sbcs
+	$(TOOL_CHARSETMAPPING) $(CHARSET_DATA_DIR) $(CHARSET_GENSRC_JAVA_DIR_BASE) \
+	    stdcs charsets $(CHARSET_STANDARD_OS) \
+	    $(CHARSET_STANDARD_JAVA_TEMPLATES) $(CHARSET_EXTSRC_DIR) $(LOG_INFO)
 	$(TOUCH) '$@'
 
-GENSRC_JAVA_BASE += $(CHARSET_DONE_BASE)-sbcs
+GENSRC_JAVA_BASE += $(CHARSET_DONE_BASE)-stdcs
 
-################################################################################
-#
-# Generate the sun/nio/cs/StandardCharsets.java file
-#
-CHARSET_STANDARD_GENSRC_DIR := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/_standardcharsets
-CHARSET_STANDARD_DATA := $(CHARSET_DATA_DIR)/standard-charsets
-CHARSET_STANDARD_JAVA :=  sun/nio/cs/StandardCharsets.java
-
-CHARSET_ALIASES_TABLES_AWK := ' \
-    BEGIN { n = 1; m = 1; } \
-    /^[ \t]*charset / { \
-      csn = $$2; cln = $$3; \
-      lcsn = tolower(csn); \
-      lcsns[n++] = lcsn; \
-      csns[lcsn] = csn; \
-      classMap[lcsn] = cln; \
-      if (n > 2) \
-        printf "    };\n\n"; \
-      printf "    static final String[] aliases_%s = new String[] {\n", cln; \
-    } \
-    /^[ \t]*alias / { \
-      acsns[m++] = tolower($$2); \
-      aliasMap[tolower($$2)] = lcsn; \
-      printf "        \"%s\",\n", $$2; \
-    } \
-    END { \
-      printf "    };\n\n"; \
-    } '
-
-CHARSET_ALIASES_MAP_AWK := ' \
-    /^[ \t]*charset / { \
-      csn = $$2; \
-      lcsn = tolower(csn); \
-    } \
-    /^[ \t]*alias / { \
-      an = tolower($$2); \
-      printf "%-20s \"%s\"\n", an, lcsn; \
-    } '
-
-CHARSET_CLASSES_MAP_AWK := ' \
-    /^[ \t]*charset / { \
-      csn = $$2; cln = $$3; \
-      lcsn = tolower(csn); \
-      printf "%-20s \"%s\"\n", lcsn, cln; \
-    } '
-
-# This target should be referenced using the order-only operator (|)
-$(CHARSET_STANDARD_GENSRC_DIR):
-	$(MKDIR) -p '$@'
-
-$(CHARSET_STANDARD_GENSRC_DIR)/aliases-tables.java.snippet: $(CHARSET_STANDARD_DATA) \
-    | $(CHARSET_STANDARD_GENSRC_DIR)
-	$(NAWK) < '$<' > '$@' $(CHARSET_ALIASES_TABLES_AWK)
-
-$(CHARSET_STANDARD_GENSRC_DIR)/aliases-map: $(CHARSET_STANDARD_DATA) \
-    | $(CHARSET_STANDARD_GENSRC_DIR)
-	$(NAWK) < '$<' > '$@' $(CHARSET_ALIASES_MAP_AWK)
-
-$(CHARSET_STANDARD_GENSRC_DIR)/classes-map: $(CHARSET_STANDARD_DATA) \
-    | $(CHARSET_STANDARD_GENSRC_DIR)
-	$(NAWK) < '$<' > '$@' $(CHARSET_CLASSES_MAP_AWK)
-
-$(CHARSET_STANDARD_GENSRC_DIR)/aliases-map.java.snippet: $(CHARSET_STANDARD_GENSRC_DIR)/aliases-map \
-    $(BUILD_TOOLS_JDK) | $(CHARSET_STANDARD_GENSRC_DIR)
-	$(TOOL_HASHER) -i Aliases < '$<' > '$@'
-
-$(CHARSET_STANDARD_GENSRC_DIR)/classes-map.java.snippet: $(CHARSET_STANDARD_GENSRC_DIR)/classes-map \
-    $(BUILD_TOOLS_JDK) | $(CHARSET_STANDARD_GENSRC_DIR)
-	$(TOOL_HASHER) -i Classes < '$<' > '$@'
-
-$(CHARSET_STANDARD_GENSRC_DIR)/cache-map.java.snippet: $(CHARSET_STANDARD_GENSRC_DIR)/classes-map \
-    $(BUILD_TOOLS_JDK) | $(CHARSET_STANDARD_GENSRC_DIR)
-	$(TOOL_HASHER) -i -e Cache -t Charset < '$<' > '$@'
-
-$(eval $(call SetupTextFileProcessing, BUILD_CHARSET_STANDARD, \
-    SOURCE_FILES := $(JDK_TOPDIR)/src/java.base/share/classes/$(CHARSET_STANDARD_JAVA).template, \
-    OUTPUT_FILE := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/$(CHARSET_STANDARD_JAVA), \
-    INCLUDES := \
-        _INCLUDE_ALIASES_TABLES_ => $(CHARSET_STANDARD_GENSRC_DIR)/aliases-tables.java.snippet ; \
-        _INCLUDE_ALIASES_MAP_ => $(CHARSET_STANDARD_GENSRC_DIR)/aliases-map.java.snippet ; \
-        _INCLUDE_CLASSES_MAP_ => $(CHARSET_STANDARD_GENSRC_DIR)/classes-map.java.snippet ; \
-        _INCLUDE_CACHE_MAP_ => $(CHARSET_STANDARD_GENSRC_DIR)/cache-map.java.snippet ; , \
-))
-
-# Processing of template depends on the snippets being generated first
-$(BUILD_CHARSET_STANDARD): \
-    $(CHARSET_STANDARD_GENSRC_DIR)/aliases-tables.java.snippet \
-    $(CHARSET_STANDARD_GENSRC_DIR)/aliases-map.java.snippet \
-    $(CHARSET_STANDARD_GENSRC_DIR)/classes-map.java.snippet \
-    $(CHARSET_STANDARD_GENSRC_DIR)/cache-map.java.snippet
-
-GENSRC_JAVA_BASE += $(BUILD_CHARSET_STANDARD)
--- a/make/launcher/Launcher-jdk.dev.gmk	Thu Feb 19 11:24:03 2015 -0800
+++ b/make/launcher/Launcher-jdk.dev.gmk	Thu Feb 19 16:38:11 2015 -0800
@@ -31,6 +31,12 @@
 $(eval $(call SetupLauncher,jarsigner, \
     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.tools.jarsigner.Main"$(COMMA) }'))
 
+ifndef BUILD_HEADLESS_ONLY
+  $(eval $(call SetupLauncher,policytool, \
+      -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.tools.policytool.PolicyTool"$(COMMA) }',, \
+      $(XLIBS)))
+endif
+
 $(eval $(call SetupLauncher,jdeps, \
     -DEXPAND_CLASSPATH_WILDCARDS \
     -DNEVER_ACT_AS_SERVER_CLASS_MACHINE \
--- a/make/launcher/Launcher-jdk.runtime.gmk	Thu Feb 19 11:24:03 2015 -0800
+++ b/make/launcher/Launcher-jdk.runtime.gmk	Thu Feb 19 16:38:11 2015 -0800
@@ -25,12 +25,6 @@
 
 include LauncherCommon.gmk
 
-ifndef BUILD_HEADLESS_ONLY
-  $(eval $(call SetupLauncher,policytool, \
-      -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.tools.policytool.PolicyTool"$(COMMA) }',, \
-      $(XLIBS)))
-endif
-
 $(eval $(call SetupLauncher,pack200, \
     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.java.util.jar.pack.Driver"$(COMMA) }'))
 
--- a/make/lib/Awt2dLibraries.gmk	Thu Feb 19 11:24:03 2015 -0800
+++ b/make/lib/Awt2dLibraries.gmk	Thu Feb 19 16:38:11 2015 -0800
@@ -515,6 +515,77 @@
 
 ################################################################################
 
+ifeq ($(BUILD_HEADLESS), true)
+  # Mac and Windows only use the native AWT lib, do not build libawt_headless
+  ifeq ($(findstring $(OPENJDK_TARGET_OS), windows macosx),)
+
+    LIBAWT_HEADLESS_DIRS := $(JDK_TOPDIR)/src/java.desktop/unix/native/libawt_headless/awt \
+        $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
+        $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/java2d/opengl \
+        $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/java2d/x11 \
+        $(JDK_TOPDIR)/src/java.desktop/share/native/common/java2d/opengl \
+        $(JDK_TOPDIR)/src/java.desktop/share/native/common/font \
+        #
+
+    LIBAWT_HEADLESS_EXCLUDES := medialib
+    LIBAWT_HEADLESS_CFLAGS := -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
+        $(addprefix -I, $(LIBAWT_HEADLESS_DIRS)) \
+        -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d \
+        -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d/loops \
+        -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/awt/image/cvutils \
+        -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d/pipe \
+        -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/awt/image \
+        -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt/java2d \
+        -I$(JDK_TOPDIR)/src/java.desktop/share/native/common/font \
+        -I$(JDK_TOPDIR)/src/java.desktop/share/native/common/awt/debug \
+        -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/font \
+        -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libsunwjdga/ \
+        $(LIBJAVA_HEADER_FLAGS) \
+        #
+
+    LIBAWT_HEADLESS_REORDER :=
+    ifeq ($(OPENJDK_TARGET_OS), solaris)
+      ifneq ($(OPENJDK_TARGET_CPU), x86_64)
+        LIBAWT_HEADLESS_REORDER := $(JDK_TOPDIR)/make/mapfiles/libawt_headless/reorder-$(OPENJDK_TARGET_CPU)
+      endif
+    endif
+
+    $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_HEADLESS, \
+        LIBRARY := awt_headless, \
+        OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
+        SRC := $(LIBAWT_HEADLESS_DIRS), \
+        EXCLUDES := $(LIBAWT_HEADLESS_EXCLUDES), \
+        LANG := C, \
+        OPTIMIZATION := LOW, \
+        CFLAGS := $(CFLAGS_JDKLIB) \
+            -DHEADLESS=true \
+            -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" \
+            $(CUPS_CFLAGS) \
+            $(X_CFLAGS) \
+            $(LIBAWT_HEADLESS_CFLAGS), \
+        MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libawt_headless/mapfile-vers, \
+        LDFLAGS := $(LDFLAGS_JDKLIB) \
+            $(call SET_SHARED_LIBRARY_ORIGIN), \
+        LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
+        LDFLAGS_linux := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
+        LDFLAGS_solaris := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
+        LDFLAGS_macosx := $(call SET_SHARED_LIBRARY_ORIGIN)., \
+        REORDER := $(LIBAWT_HEADLESS_REORDER), \
+        LDFLAGS_SUFFIX_linux := -ljvm -lawt -lm $(LIBDL) -ljava, \
+        LDFLAGS_SUFFIX_aix := -ljvm -lawt -ljava,\
+        LDFLAGS_SUFFIX_solaris := $(LIBDL) -ljvm -lawt -lm -ljava $(LIBCXX) -lc, \
+        OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libawt_headless, \
+        DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
+
+    $(BUILD_LIBAWT_HEADLESS): $(BUILD_LIBAWT)
+
+    TARGETS += $(BUILD_LIBAWT_HEADLESS)
+
+  endif
+endif
+
+################################################################################
+
 LIBFONTMANAGER_SRC := $(JDK_TOPDIR)/src/java.desktop/share/native/libfontmanager \
     $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libfontmanager
 LIBFONTMANAGER_CFLAGS := \
@@ -562,10 +633,6 @@
   BUILD_LIBFONTMANAGER_ExtensionSubtables.cpp_CXXFLAGS := -fno-strict-aliasing
 endif
 
-# Libfontmanager doesn't actually need X_LIBS to link, but if building
-# on a Solaris machine without X installed, using a devkit, linking
-# to libawt_xawt will fail without the -L parameters from X_LIBS. Filter
-# out the -R parameters since they aren't needed.
 $(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER, \
     LIBRARY := fontmanager, \
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
@@ -583,9 +650,8 @@
     LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
     LDFLAGS_SUFFIX := $(BUILD_LIBFONTMANAGER_FONTLIB), \
     LDFLAGS_SUFFIX_linux := -lawt $(LIBM) $(LIBCXX) -ljava -ljvm -lc, \
-    LDFLAGS_SUFFIX_solaris := $(filter-out -R%, $(X_LIBS)) \
-        -lawt -lawt_xawt -lc $(LIBM) $(LIBCXX) -ljava -ljvm, \
-    LDFLAGS_SUFFIX_aix := -lawt -lawt_xawt $(LIBM) $(LIBCXX) -ljava -ljvm,\
+    LDFLAGS_SUFFIX_solaris := -lawt -lawt_headless -lc $(LIBM) $(LIBCXX) -ljava -ljvm, \
+    LDFLAGS_SUFFIX_aix := -lawt -lawt_headless $(LIBM) $(LIBCXX) -ljava -ljvm,\
     LDFLAGS_SUFFIX_macosx := -lawt $(LIBM) $(LIBCXX) -undefined dynamic_lookup \
         -ljava -ljvm, \
     LDFLAGS_SUFFIX_windows := $(WIN_JAVA_LIB) advapi32.lib user32.lib gdi32.lib \
@@ -601,7 +667,7 @@
 $(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT)
 
 ifneq (, $(findstring $(OPENJDK_TARGET_OS), solaris aix))
-  $(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT_XAWT)
+  $(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT_HEADLESS)
 endif
 
 TARGETS += $(BUILD_LIBFONTMANAGER)
@@ -723,77 +789,6 @@
 
 ################################################################################
 
-ifeq ($(BUILD_HEADLESS), true)
-  # Mac and Windows only use the native AWT lib, do not build libawt_headless
-  ifeq ($(findstring $(OPENJDK_TARGET_OS), windows macosx),)
-
-    LIBAWT_HEADLESS_DIRS := $(JDK_TOPDIR)/src/java.desktop/unix/native/libawt_headless/awt \
-        $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
-        $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/java2d/opengl \
-        $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/java2d/x11 \
-        $(JDK_TOPDIR)/src/java.desktop/share/native/common/java2d/opengl \
-        $(JDK_TOPDIR)/src/java.desktop/share/native/common/font \
-        #
-
-    LIBAWT_HEADLESS_EXCLUDES := medialib
-    LIBAWT_HEADLESS_CFLAGS := -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
-        $(addprefix -I, $(LIBAWT_HEADLESS_DIRS)) \
-        -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d \
-        -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d/loops \
-        -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/awt/image/cvutils \
-        -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d/pipe \
-        -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/awt/image \
-        -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt/java2d \
-        -I$(JDK_TOPDIR)/src/java.desktop/share/native/common/font \
-        -I$(JDK_TOPDIR)/src/java.desktop/share/native/common/awt/debug \
-        -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/font \
-        -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libsunwjdga/ \
-        $(LIBJAVA_HEADER_FLAGS) \
-        #
-
-    LIBAWT_HEADLESS_REORDER :=
-    ifeq ($(OPENJDK_TARGET_OS), solaris)
-      ifneq ($(OPENJDK_TARGET_CPU), x86_64)
-        LIBAWT_HEADLESS_REORDER := $(JDK_TOPDIR)/make/mapfiles/libawt_headless/reorder-$(OPENJDK_TARGET_CPU)
-      endif
-    endif
-
-    $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_HEADLESS, \
-        LIBRARY := awt_headless, \
-        OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
-        SRC := $(LIBAWT_HEADLESS_DIRS), \
-        EXCLUDES := $(LIBAWT_HEADLESS_EXCLUDES), \
-        LANG := C, \
-        OPTIMIZATION := LOW, \
-        CFLAGS := $(CFLAGS_JDKLIB) \
-            -DHEADLESS=true \
-            -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" \
-            $(CUPS_CFLAGS) \
-            $(X_CFLAGS) \
-            $(LIBAWT_HEADLESS_CFLAGS), \
-        MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libawt_headless/mapfile-vers, \
-        LDFLAGS := $(LDFLAGS_JDKLIB) \
-            $(call SET_SHARED_LIBRARY_ORIGIN), \
-        LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
-        LDFLAGS_linux := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
-        LDFLAGS_solaris := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
-        LDFLAGS_macosx := $(call SET_SHARED_LIBRARY_ORIGIN)., \
-        REORDER := $(LIBAWT_HEADLESS_REORDER), \
-        LDFLAGS_SUFFIX_linux := -ljvm -lawt -lm $(LIBDL) -ljava, \
-        LDFLAGS_SUFFIX_aix := -ljvm -lawt -ljava,\
-        LDFLAGS_SUFFIX_solaris := $(LIBDL) -ljvm -lawt -lm -ljava $(LIBCXX) -lc, \
-        OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libawt_headless, \
-        DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
-
-    $(BUILD_LIBAWT_HEADLESS): $(BUILD_LIBAWT)
-
-    TARGETS += $(BUILD_LIBAWT_HEADLESS)
-
-  endif
-endif
-
-################################################################################
-
 ifndef BUILD_HEADLESS_ONLY
 
   LIBSPLASHSCREEN_DIRS := \
--- a/make/lib/CoreLibraries.gmk	Thu Feb 19 11:24:03 2015 -0800
+++ b/make/lib/CoreLibraries.gmk	Thu Feb 19 16:38:11 2015 -0800
@@ -271,6 +271,11 @@
   # Staticically link with c runtime on windows.
   LIBJLI_CFLAGS := $(filter-out -MD, $(LIBJLI_CFLAGS))
   LIBJLI_OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE)
+  # Supply the name of the C runtime lib.
+  LIBJLI_CFLAGS += -DMSVCR_DLL_NAME='"$(notdir $(MSVCR_DLL))"'
+  ifneq ($(MSVCP_DLL), )
+    LIBJLI_CFLAGS += -DMSVCP_DLL_NAME='"$(notdir $(MSVCP_DLL))"'
+  endif
 else
   LIBJLI_OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE)/jli
 endif
--- a/make/lib/Lib-jdk.runtime.gmk	Thu Feb 19 11:24:03 2015 -0800
+++ b/make/lib/Lib-jdk.runtime.gmk	Thu Feb 19 16:38:11 2015 -0800
@@ -59,37 +59,3 @@
 TARGETS += $(BUILD_LIBUNPACK)
 
 ################################################################################
-
-LIBJSDT_SRC := $(JDK_TOPDIR)/src/jdk.runtime/share/native/libjsdt \
-    $(JDK_TOPDIR)/src/jdk.runtime/$(OPENJDK_TARGET_OS_TYPE)/native/libjsdt
-
-$(eval $(call SetupNativeCompilation,BUILD_LIBJSDT, \
-    LIBRARY := jsdt, \
-    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
-    SRC := $(LIBJSDT_SRC), \
-    LANG := C, \
-    OPTIMIZATION := LOW, \
-    CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_WARNINGS_ARE_ERRORS) \
-        $(addprefix -I, $(LIBJSDT_SRC)) \
-        $(LIBJAVA_HEADER_FLAGS) \
-        -I$(SUPPORT_OUTPUTDIR)/headers/jdk.runtime, \
-    MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjsdt/mapfile-vers, \
-    LDFLAGS := $(LDFLAGS_JDKLIB) \
-        $(call SET_SHARED_LIBRARY_ORIGIN), \
-    LDFLAGS_SUFFIX_linux := $(LIBDL), \
-    LDFLAGS_SUFFIX_windows := $(LDFLAGS_JDKLIB_SUFFIX) $(LIBDL), \
-    LDFLAGS_SUFFIX_macosx := $(LIBDL), \
-    LDFLAGS_SUFFIX_solaris := -lc, \
-    VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
-    RC_FLAGS := $(RC_FLAGS) \
-        -D "JDK_FNAME=jsdt.dll" \
-        -D "JDK_INTERNAL_NAME=jsdt" \
-        -D "JDK_FTYPE=0x2L", \
-    OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjsdt, \
-    DEBUG_SYMBOLS := true))
-
-$(BUILD_LIBJSDT): $(call FindLib, java.base, java)
-
-TARGETS += $(BUILD_LIBJSDT)
-
-################################################################################
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/src/classes/build/tools/charsetmapping/Charset.java	Thu Feb 19 16:38:11 2015 -0800
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package build.tools.charsetmapping;
+
+class Charset {
+    String   pkgName;
+    String   clzName;
+    String   csName;
+    String   hisName;
+    String   type;
+    boolean  isASCII;
+    int      b1Min;
+    int      b1Max;
+    int      b2Min;
+    int      b2Max;
+    String[] aliases;
+    boolean  isGenSrc = false;
+    boolean  isInternal = false;
+}
--- a/make/src/classes/build/tools/charsetmapping/DBCS.java	Thu Feb 19 11:24:03 2015 -0800
+++ b/make/src/classes/build/tools/charsetmapping/DBCS.java	Thu Feb 19 16:38:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,71 +24,32 @@
  */
 
 package build.tools.charsetmapping;
+
 import java.io.*;
 import java.util.Arrays;
 import java.util.ArrayList;
 import java.util.Scanner;
 import java.util.Formatter;
-import java.util.regex.*;
-import java.nio.charset.*;
+import java.util.regex.Pattern;
 import static build.tools.charsetmapping.Utils.*;
 
 public class DBCS {
     // pattern used by this class to read in mapping table
     static Pattern mPattern = Pattern.compile("(?:0x)?(\\p{XDigit}++)\\s++(?:0x)?(\\p{XDigit}++)(?:\\s++#.*)?");
 
-    public static void genClass(String args[]) throws Exception {
-
-        Scanner s = new Scanner(new File(args[0], args[2]));
-        while (s.hasNextLine()) {
-            String line = s.nextLine();
-            if (line.startsWith("#") || line.length() == 0)
-                continue;
-            String[] fields = line.split("\\s+");
-            if (fields.length < 10) {
-                System.err.println("Misconfiged sbcs line <" + line + ">?");
-                continue;
-            }
-            String clzName = fields[0];
-            String csName  = fields[1];
-            String hisName = ("null".equals(fields[2]))?null:fields[2];
-            String type = fields[3].toUpperCase();
-            if ("BASIC".equals(type))
-                type = "";
-            else
-                type = "_" + type;
-            String pkgName  = fields[4];
-            boolean isASCII = Boolean.valueOf(fields[5]);
-            int    b1Min = toInteger(fields[6]);
-            int    b1Max = toInteger(fields[7]);
-            int    b2Min    = toInteger(fields[8]);
-            int    b2Max    = toInteger(fields[9]);
-            System.out.printf("%s,%s,%s,%b,%s%n", clzName, csName, hisName, isASCII, pkgName);
-            genClass0(args[0], args[1], "DoubleByte-X.java.template",
-                    clzName, csName, hisName, pkgName,
-                    isASCII, type,
-                    b1Min, b1Max, b2Min, b2Max);
-        }
-    }
-
-    static int toInteger(String s) {
-        if (s.startsWith("0x") || s.startsWith("0X"))
-            return Integer.valueOf(s.substring(2), 16);
-        else
-            return Integer.valueOf(s);
-    }
-
-    private static void genClass0(String srcDir, String dstDir, String template,
-                                  String clzName,
-                                  String csName,
-                                  String hisName,
-                                  String pkgName,
-                                  boolean isASCII,
-                                  String type,
-                                  int b1Min, int b1Max,
-                                  int b2Min, int b2Max)
+    public static void genClass(String type, Charset cs,
+                                String srcDir, String dstDir, String template)
         throws Exception
     {
+        String clzName = cs.clzName;
+        String csName  = cs.csName;
+        String hisName = cs.hisName;
+        String pkgName = cs.pkgName;
+        boolean isASCII = cs.isASCII;
+        int b1Min = cs.b1Min;
+        int b1Max = cs.b1Max;
+        int b2Min = cs.b2Min;
+        int b2Max = cs.b2Max;
 
         StringBuilder b2cSB = new StringBuilder();
         StringBuilder b2cNRSB = new StringBuilder();
--- a/make/src/classes/build/tools/charsetmapping/HKSCS.java	Thu Feb 19 11:24:03 2015 -0800
+++ b/make/src/classes/build/tools/charsetmapping/HKSCS.java	Thu Feb 19 16:38:11 2015 -0800
@@ -42,38 +42,51 @@
     private static Pattern hkscs =
         Pattern.compile("(?:0x)?+(\\p{XDigit}++)\\s++(?:0x|U\\+)?+(\\p{XDigit}++)?\\s*+(?:0x|U\\+)?(\\p{XDigit}++)?\\s*+.*");
 
-    static void genClass(String args[]) throws Exception {
+    static void genClass2008(String srcDir, String dstDir, String pkgName)
+        throws Exception
+    {
+        // hkscs2008
+        genClass0(new FileInputStream(new File(srcDir, "HKSCS2008.map")),
+                  new FileInputStream(new File(srcDir, "HKSCS2008.c2b")),
+                  new PrintStream(new File(dstDir, "HKSCSMapping.java"),
+                                  "ISO-8859-1"),
+                  pkgName,
+                  "HKSCSMapping",
+                  true,
+                  "");
+    }
 
-        // hkscs2008
-        genClass0(new FileInputStream(new File(args[0], "HKSCS2008.map")),
-                  new FileInputStream(new File(args[0], "HKSCS2008.c2b")),
-                  new PrintStream(new File(args[1], "HKSCSMapping.java"),
+    static void genClassXP(String srcDir, String dstDir, String pkgName)
+        throws Exception
+    {
+        genClass0(new FileInputStream(new File(srcDir, "HKSCS_XP.map")),
+                  null,
+                  new PrintStream(new File(dstDir, "HKSCS_XPMapping.java"),
                                   "ISO-8859-1"),
-                  "HKSCSMapping",
-                  getCopyright(new File(args[3])));
+                  pkgName,
+                  "HKSCS_XPMapping",
+                  false,
+                  "");
+    }
 
-
-        // xp2001
-        genClass0(new FileInputStream(new File(args[0], "HKSCS_XP.map")),
-                  null,
-                  new PrintStream(new File(args[1], "HKSCS_XPMapping.java"),
-                                  "ISO-8859-1"),
-                  "HKSCS_XPMapping",
-                  getCopyright(new File(args[3])));
-
+    static void genClass2001(String args[]) throws Exception {
         // hkscs2001
         genClass0(new FileInputStream(new File(args[0], "HKSCS2001.map")),
                   new FileInputStream(new File(args[0], "HKSCS2001.c2b")),
                   new PrintStream(new File(args[1], "HKSCS2001Mapping.java"),
                                   "ISO-8859-1"),
+                  "sun.nio.cs.ext",
                   "HKSCS2001Mapping",
+                  false,
                   getCopyright(new File(args[3])));
     }
 
     static void genClass0(InputStream isB2C,
                           InputStream isC2B,
                           PrintStream ps,
+                          String pkgName,
                           String clzName,
+                          boolean isPublic,
                           String copyright)
         throws Exception
     {
@@ -132,8 +145,8 @@
 
             out.format(copyright);
             out.format("%n// -- This file was mechanically generated: Do not edit! -- //%n");
-            out.format("package sun.nio.cs.ext;%n%n");
-            out.format("class %s {%n%n", clzName);
+            out.format("package %s;%n%n", pkgName);
+            out.format("%sclass %s {%n%n", isPublic ? "public " : "", clzName);
 
             /* hardcoded in sun.nio.cs.ext.HKSCS.java
             out.format("    final static int b1Min = 0x%x;%n", b1Min);
@@ -143,7 +156,8 @@
             */
 
             // bmp tables
-            out.format("%n    static final String[] b2cBmpStr = new String[] {%n");
+            out.format("%n    %sstatic final String[] b2cBmpStr = new String[] {%n",
+                       isPublic ? "public " : "");
             for (int i = 0; i < 0x100; i++) {
                 if (b2cBmp[i])
                     out.format(bmp, i, b2Min, b2Max, ",");
@@ -153,7 +167,8 @@
             out.format("        };%n");
 
             // supp tables
-            out.format("%n    static final String[] b2cSuppStr =");
+            out.format("%n    %sstatic final String[] b2cSuppStr =",
+                       isPublic ? "public " : "");
             if (hasSupp) {
                 out.format(" new String[] {%n");
                 for (int i = 0; i < 0x100; i++) {
@@ -168,7 +183,8 @@
             }
 
             // private area tables
-            out.format("%n    final static String pua =");
+            out.format("%n    %sfinal static String pua =",
+                       isPublic ? "public " : "");
             if (hasPua) {
                 out.format("%n");
                 out.format(pua, 0, pua.length, ";");
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/src/classes/build/tools/charsetmapping/Hasher.java	Thu Feb 19 16:38:11 2015 -0800
@@ -0,0 +1,265 @@
+/*
+ * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package build.tools.charsetmapping;
+
+import java.io.*;
+import java.util.*;
+
+
+/**
+ * Reads a map in the form of a sequence of key/value-expression pairs from the
+ * standard input, attempts to construct a hash map that fits within the given
+ * table-size and chain-depth constraints, and, if successful, writes source
+ * code to the standard output for a subclass of sun.util.PreHashedMap that
+ * implements the map.
+ *
+ * @see sun.util.PreHashedMap
+ *
+ * @author Mark Reinhold
+ */
+
+public class Hasher {
+
+    private PrintStream err = System.err;
+
+    boolean verbose = false;
+    List<String> keys = new ArrayList<>();      // Key strings
+    List<String> values = new ArrayList<>();    // Value expressions
+    String pkg = null;                          // Package prefix for generated class
+    String cln = null;                          // Name of generated class
+    String vtype = null;                        // Value type
+    int maxBits = 11;                           // lg table size
+    int maxDepth = 3;                           // Max chain depth
+    boolean inner = false;                      // Generating an inner class?
+    boolean empty = false;                      // Generating an empty table?
+
+    Object[] ht;                                // Hash table itself
+    int nb;                                     // Number of bits (lg table size)
+    int md;                                     // Maximum chain depth
+    int mask;                                   // Hash-code mask
+    int shift;                                  // Hash-code shift size
+
+    int hash(String w) {
+        return (w.hashCode() >> shift) & mask;
+    }
+
+    // Build a hash table of size 2^nb, shifting the hash code by s bits
+    //
+    void build(int nb, int s) {
+
+        this.nb = nb;
+        this.shift = s;
+        int n = 1 << nb;
+        this.mask = n - 1;
+        ht = new Object[n];
+        int nw = keys.size();
+
+        for (int i = 0; i < nw; i++) {
+            String w = keys.get(i);
+            String v = values.get(i);
+            int h = hash(w);
+            if (ht[h] == null)
+                ht[h] = new Object[] { w, v };
+            else
+                ht[h] = new Object[] { w, v, ht[h] };
+        }
+
+        this.md = 0;
+        for (int i = 0; i < n; i++) {
+            int d = 1;
+            for (Object[] a = (Object[])ht[i];
+                 a != null && a.length > 2;
+                 a = (Object[])a[2], d++);
+            this.md = Math.max(md, d);
+        }
+
+    }
+
+    Hasher build() {
+        // Iterate through acceptable table sizes
+        for (int nb = 2; nb < maxBits; nb++) {
+            // Iterate through possible shift sizes
+            for (int s = 0; s < (32 - nb); s++) {
+                build(nb, s);
+                if (verbose)
+                    err.println("nb=" + nb + " s=" + s + " md=" + md);
+                if (md <= maxDepth) {
+                    // Success
+                     if (verbose) {
+                        if (cln != null)
+                            err.print(cln + ": ");
+                        err.println("Table size " + (1 << nb) + " (" + nb + " bits)"
+                                    + ", shift " + shift
+                                    + ", max chain depth " + md);
+                    }
+                    return this;
+                }
+            }
+        }
+        throw new RuntimeException("Cannot find a suitable size"
+                                   + " within given constraints");
+    }
+
+    // Look for the given key in the hash table
+    //
+    String get(String k) {
+        int h = hash(k);
+        Object[] a = (Object[])ht[h];
+        for (;;) {
+            if (a[0].equals(k))
+                return (String)a[1];
+            if (a.length < 3)
+                return null;
+            a = (Object[])a[2];
+        }
+    }
+
+    // Test that all input keys can be found in the table
+    //
+    Hasher test() {
+        if (verbose)
+            err.println();
+        for (int i = 0, n = keys.size(); i < n; i++) {
+            String w = keys.get(i);
+            String v = get(w);
+            if (verbose)
+                err.println(hash(w) + "\t" + w);
+            if (!v.equals(values.get(i)))
+                throw new Error("Incorrect value: " + w + " --> "
+                                + v + ", should be " + values.get(i));
+        }
+        return this;
+    }
+
+    String ind = "";                    // Indent prefix
+
+    // Generate code for a single table entry
+    //
+    void genEntry(Object[] a, int depth, PrintStream out) {
+        Object v = empty ? null : a[1];
+        out.print("new Object[] { \"" + a[0] + "\", " + v);
+        if (a.length < 3) {
+            out.print(" }");
+            return;
+        }
+        out.println(",");
+        out.print(ind + "                     ");
+        for (int i = 0; i < depth; i++)
+            out.print("    ");
+        genEntry((Object[])a[2], depth + 1, out);
+        out.print(" }");
+    }
+
+    // Generate a PreHashedMap subclass from the computed hash table
+    //
+    Hasher generate(PrintStream out) throws IOException {
+        if (cln == null)
+            return this;
+
+        if (inner)
+            ind = "    ";
+
+        if (!inner && pkg != null) {
+            out.println();
+            out.println("package " + pkg + ";");
+            out.println();
+        }
+
+        if (inner) {
+            out.println(ind + "private static final class " + cln);
+        } else {
+            out.println();
+            out.println("public final class " + cln);
+        }
+        out.println(ind + "    extends sun.util.PreHashedMap<" + vtype +">");
+        out.println(ind + "{");
+
+        out.println();
+        out.println(ind + "    private static final int ROWS = "
+                    + ht.length + ";");
+        out.println(ind + "    private static final int SIZE = "
+                    + keys.size() + ";");
+        out.println(ind + "    private static final int SHIFT = "
+                    + shift + ";");
+        out.println(ind + "    private static final int MASK = 0x"
+                    + Integer.toHexString(mask) + ";");
+        out.println();
+
+        out.println(ind + "    " + (inner ? "private " : "public ")
+                    + cln + "() {");
+        out.println(ind + "        super(ROWS, SIZE, SHIFT, MASK);");
+        out.println(ind + "    }");
+        out.println();
+
+        out.println(ind + "    protected void init(Object[] ht) {");
+        for (int i = 0; i < ht.length; i++) {
+            if (ht[i] == null)
+                continue;
+            Object[] a = (Object[])ht[i];
+            out.print(ind + "        ht[" + i + "] = ");
+            genEntry(a, 0, out);
+            out.println(";");
+        }
+        out.println(ind + "    }");
+        out.println();
+
+        out.println(ind + "}");
+        if (inner)
+            out.println();
+
+        return this;
+    }
+
+    private Hasher(List<String> keys, List<String> values,
+                   String pkg, String cln, String vtype,
+                   int maxBits, int maxDepth,
+                   boolean inner, boolean empty,
+                   boolean verbose) {
+        this.keys = keys;
+        this.values = values;
+        this.pkg = pkg;
+        this.cln = cln;
+        this.vtype = vtype;
+        this.maxBits = maxBits;
+        this.maxDepth = maxDepth;
+        this.inner = inner;
+        this.empty = empty;
+        this.verbose = verbose;
+    }
+
+    public static void genClass(PrintStream out,
+                                List<String> keys, List<String> values,
+                                String pkg, String cln, String vtype,
+                                int maxBits, int maxDepth,
+                                boolean inner, boolean empty, boolean verbose)
+        throws IOException {
+        new Hasher(keys, values, pkg, cln, vtype,
+                   maxBits, maxDepth, inner, empty, verbose)
+            .build()
+            .test()
+            .generate(out);
+    }
+}
--- a/make/src/classes/build/tools/charsetmapping/Main.java	Thu Feb 19 11:24:03 2015 -0800
+++ b/make/src/classes/build/tools/charsetmapping/Main.java	Thu Feb 19 16:38:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,25 +26,193 @@
 package build.tools.charsetmapping;
 
 import java.io.*;
+import java.util.ArrayList;
 import java.util.Scanner;
+import java.util.LinkedHashMap;
+import java.util.Locale;
 
 public class Main {
 
-    public static void main(String args[]) throws Exception {
+    public static void main(String args[]) throws Throwable {
+        int SRC_DIR  = 0;
+        int DST_DIR  = 1;
+        int TYPE     = 2;
+        int CHARSETS = 3;
+        int OS       = 4;
+        int TEMPLATE = 5;
+        int EXT_SRC  = 6;
+
         if (args.length < 3 ) {
-            System.out.println("Usage: java -jar charsetmapping.jar src dst mType [copyrightSrc]");
+            System.out.println("Usage: java -jar charsetmapping.jar src dst spiType charsets os [template]");
             System.exit(1);
         }
-        if ("sbcs".equals(args[2]) || "extsbcs".equals(args[2])) {
-            SBCS.genClass(args);
-        } else if ("dbcs".equals(args[2])) {
-            DBCS.genClass(args);
-        } else if ("euctw".equals(args[2])) {
+        boolean isStandard = "stdcs".equals(args[TYPE]);
+        boolean isExtended = "extcs".equals(args[TYPE]);
+        if (isStandard || isExtended) {
+            LinkedHashMap<String, Charset> charsets = getCharsets(
+                new File(args[SRC_DIR], args[CHARSETS]));
+            String[] osStdcs = getOSStdCSList(new File(args[SRC_DIR], args[OS]));
+            boolean hasBig5_HKSCS = false;
+            boolean hasMS950_HKSCS_XP = false;
+            for (String name : osStdcs) {
+                Charset cs = charsets.get(name);
+                if (cs != null) {
+                    cs.pkgName = "sun.nio.cs";
+                }
+                if (name.equals("Big5_HKSCS")) {
+                    hasBig5_HKSCS = true;
+                } else if (name.equals("MS950_HKSCS_XP")) {
+                    hasMS950_HKSCS_XP = true;
+                }
+            }
+            for (Charset cs : charsets.values()) {
+                if (isStandard && cs.pkgName.equals("sun.nio.cs.ext") ||
+                    isExtended && cs.pkgName.equals("sun.nio.cs")) {
+                    continue;
+                }
+                verbose(cs);
+                switch (cs.type) {
+                case "template":
+                    SRC.genClass(cs, args[EXT_SRC], args[DST_DIR]);
+                    break;
+                case "sbcs":
+                    SBCS.genClass(cs, args[SRC_DIR], args[DST_DIR],
+                                  "SingleByte-X.java.template");
+                    break;
+                case "source":
+                    break;                   // source file, do nothing
+                default:                     // dbcs
+                    DBCS.genClass("dbcs".equals(cs.type) ?
+                                      "" :  "_" + cs.type.toUpperCase(Locale.ENGLISH),
+                                  cs, args[SRC_DIR], args[DST_DIR],
+                                  "DoubleByte-X.java.template");
+                }
+            }
+            // provider StandardCharsets.java / ExtendedCharsets.java
+            SPI.genClass(args[TYPE], charsets, args[SRC_DIR], args[DST_DIR], args[TEMPLATE]);
+
+            // HKSCSMapping2008/XP.java goes together with Big5/MS950XP_HKSCS
+            if (isStandard && hasBig5_HKSCS || isExtended && !hasBig5_HKSCS) {
+                HKSCS.genClass2008(args[SRC_DIR], args[DST_DIR],
+                                   isStandard ? "sun.nio.cs" : "sun.nio.cs.ext");
+            }
+            if (isStandard && hasMS950_HKSCS_XP || isExtended && !hasMS950_HKSCS_XP) {
+                HKSCS.genClassXP(args[SRC_DIR], args[DST_DIR],
+                                 isStandard ? "sun.nio.cs" : "sun.nio.cs.ext");
+            }
+        } else if ("euctw".equals(args[TYPE])) {
             EUC_TW.genClass(args);
-        } else if ("sjis0213".equals(args[2])) {
+        } else if ("sjis0213".equals(args[TYPE])) {
             JIS0213.genClass(args);
-        } else if ("hkscs".equals(args[2])) {
-            HKSCS.genClass(args);
+        } else if ("hkscs".equals(args[TYPE])) {
+            HKSCS.genClass2001(args);
         }
     }
+
+    private static LinkedHashMap<String, Charset> getCharsets(File cslist)
+        throws Throwable
+    {
+        LinkedHashMap<String, Charset> charsets = new LinkedHashMap<>();
+        try (Scanner s = new Scanner(cslist)) {
+            Charset cs = null;
+            ArrayList<String> names = new ArrayList<>();
+            while (s.hasNextLine()) {
+                String line = s.nextLine();
+                if (line.startsWith("#") || line.length() == 0) {
+                    continue;
+                }
+                String[] tokens = line.split("\\s+");
+                if (tokens.length < 2) {
+                    continue;
+                }
+                if ("charset".equals(tokens[0])) {
+                    if (cs != null) {
+                        cs.aliases = names.toArray(new String[names.size()]);
+                        charsets.put(cs.clzName, cs);
+                        cs = null;
+                        names.clear();
+                    }
+                    if (tokens.length < 3) {
+                        throw new RuntimeException("Error: incorrect charset line [" + line + "]");
+                    }
+                    if ((cs = charsets.get(tokens[2])) != null) {
+                        throw new RuntimeException("Error: deplicate charset line [" + line + "]");
+                    }
+                    cs = new Charset();
+                    cs.csName = tokens[1];
+                    cs.clzName = tokens[2];
+                } else {
+                    String key = tokens[1];           // leading empty str
+                    switch (key) {
+                    case "alias":
+                        if (tokens.length < 3) {
+                            throw new RuntimeException("Error: incorrect alias line [" + line + "]");
+                        } else if (names != null) {
+                            names.add(tokens[2]);     // ALIAS_NAME
+                        }
+                        break;
+                    case "package":
+                        cs.pkgName = tokens[2];
+                        break;
+                    case "type":
+                        cs.type = tokens[2];
+                        break;
+                    case "hisname":
+                        cs.hisName = tokens[2];
+                        break;
+                    case "ascii":
+                        cs.isASCII = Boolean.parseBoolean(tokens[2]);
+                        break;
+                    case "minmax":
+                        cs.b1Min = toInteger(tokens[2]);
+                        cs.b1Max = toInteger(tokens[3]);
+                        cs.b2Min = toInteger(tokens[4]);
+                        cs.b2Max = toInteger(tokens[5]);
+                        break;
+                    case "internal":
+                        cs.isInternal = Boolean.parseBoolean(tokens[2]);
+                        break;
+                    default:  // ignore
+                    }
+                }
+            }
+            if (cs != null) {
+                cs.aliases = names.toArray(new String[names.size()]);
+                charsets.put(cs.clzName, cs);
+            }
+        }
+        return charsets;
+    }
+
+    private static String[] getOSStdCSList(File stdcsos) throws Throwable
+    {
+        ArrayList<String> names = new ArrayList<>();
+        if (stdcsos.exists()) {
+            try (Scanner s = new Scanner(stdcsos)) {
+                while (s.hasNextLine()) {
+                    String line = s.nextLine();
+                    int i = line.indexOf('#');
+                    if (i != -1) {
+                        line = line.substring(0, i);
+                    }
+                    line = line.trim();
+                    if (line.length() != 0) {
+                        names.add(line);
+                    }
+                }
+            }
+        }
+        return names.toArray(new String[names.size()]);
+    }
+
+    static void verbose(Charset cs) {
+         System.out.printf("%s, %s, %s, %s, %s  %b%n",
+                           cs.clzName, cs.csName, cs.hisName, cs.pkgName, cs.type, cs.isASCII);
+    }
+
+    static int toInteger(String s) {
+        return (s.startsWith("0x") || s.startsWith("0X"))
+               ? Integer.valueOf(s.substring(2), 16)
+               : Integer.valueOf(s);
+    }
 }
--- a/make/src/classes/build/tools/charsetmapping/SBCS.java	Thu Feb 19 11:24:03 2015 -0800
+++ b/make/src/classes/build/tools/charsetmapping/SBCS.java	Thu Feb 19 16:38:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,93 +30,23 @@
 import java.util.ArrayList;
 import java.util.Scanner;
 import java.util.Formatter;
-import java.util.regex.*;
-import java.nio.charset.*;
+import java.util.regex.Pattern;
 import static build.tools.charsetmapping.Utils.*;
 
 public class SBCS {
 
-    public static void genClass(String args[]) throws Exception {
-
-        Scanner s = new Scanner(new File(args[0], args[2]));
-        while (s.hasNextLine()) {
-            String line = s.nextLine();
-            if (line.startsWith("#") || line.length() == 0)
-                continue;
-            String[] fields = line.split("\\s+");
-            if (fields.length < 5) {
-                System.err.println("Misconfiged sbcs line <" + line + ">?");
-                continue;
-            }
-            String clzName = fields[0];
-            String csName  = fields[1];
-            String hisName = fields[2];
-            boolean isASCII = Boolean.valueOf(fields[3]);
-            String pkgName  = fields[4];
-            System.out.printf("%s,%s,%s,%b,%s%n", clzName, csName, hisName, isASCII, pkgName);
-
-            genClass0(args[0], args[1], "SingleByte-X.java.template",
-                      clzName, csName, hisName, pkgName, isASCII);
-        }
-    }
-
-    private static void toString(char[] sb, int off, int end,
-                                 Formatter out, String closure,
-                                 boolean comment) {
-        while (off < end) {
-            out.format("        \"");
-            for (int j = 0; j < 8; j++) {
-                if (off == end)
-                    break;
-                char c = sb[off++];
-                switch (c) {
-                case '\b':
-                    out.format("\\b"); break;
-                case '\t':
-                    out.format("\\t"); break;
-                case '\n':
-                    out.format("\\n"); break;
-                case '\f':
-                    out.format("\\f"); break;
-                case '\r':
-                    out.format("\\r"); break;
-                case '\"':
-                    out.format("\\\""); break;
-                case '\'':
-                    out.format("\\'"); break;
-                case '\\':
-                    out.format("\\\\"); break;
-                default:
-                    out.format("\\u%04X", c & 0xffff);
-                }
-            }
-            if (comment) {
-                if (off == end)
-                    out.format("\" %s      // 0x%02x - 0x%02x%n",
-                               closure, off-8, off-1);
-                else
-                    out.format("\" +      // 0x%02x - 0x%02x%n",
-                               off-8, off-1);
-            } else {
-                if (off == end)
-                    out.format("\"%s%n", closure);
-                else
-                    out.format("\" +%n");
-            }
-        }
-    }
-
     static Pattern sbmap = Pattern.compile("0x(\\p{XDigit}++)\\s++(?:U\\+|0x)?(\\p{XDigit}++)(?:\\s++#.*)?");
 
-    private static void genClass0(String srcDir, String dstDir,
-                                  String template,
-                                  String clzName,
-                                  String csName,
-                                  String hisName,
-                                  String pkgName,
-                                  boolean isASCII)
+    public static void genClass(Charset cs,
+                                String srcDir, String dstDir, String template)
         throws Exception
     {
+        String clzName = cs.clzName;
+        String csName  = cs.csName;
+        String hisName = cs.hisName;
+        String pkgName = cs.pkgName;
+        boolean isASCII = cs.isASCII;
+
         StringBuilder b2cSB = new StringBuilder();
         StringBuilder b2cNRSB = new StringBuilder();
         StringBuilder c2bNRSB = new StringBuilder();
@@ -266,4 +196,50 @@
         }
         out.close();
     }
+
+    private static void toString(char[] sb, int off, int end,
+                                 Formatter out, String closure, boolean comment)
+    {
+        while (off < end) {
+            out.format("        \"");
+            for (int j = 0; j < 8; j++) {
+                if (off == end)
+                    break;
+                char c = sb[off++];
+                switch (c) {
+                case '\b':
+                    out.format("\\b"); break;
+                case '\t':
+                    out.format("\\t"); break;
+                case '\n':
+                    out.format("\\n"); break;
+                case '\f':
+                    out.format("\\f"); break;
+                case '\r':
+                    out.format("\\r"); break;
+                case '\"':
+                    out.format("\\\""); break;
+                case '\'':
+                    out.format("\\'"); break;
+                case '\\':
+                    out.format("\\\\"); break;
+                default:
+                    out.format("\\u%04X", c & 0xffff);
+                }
+            }
+            if (comment) {
+                if (off == end)
+                    out.format("\" %s      // 0x%02x - 0x%02x%n",
+                               closure, off-8, off-1);
+                else
+                    out.format("\" +      // 0x%02x - 0x%02x%n",
+                               off-8, off-1);
+            } else {
+                if (off == end)
+                    out.format("\"%s%n", closure);
+                else
+                    out.format("\" +%n");
+            }
+        }
+    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/src/classes/build/tools/charsetmapping/SPI.java	Thu Feb 19 16:38:11 2015 -0800
@@ -0,0 +1,141 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package build.tools.charsetmapping;
+
+import java.io.*;
+import java.util.Locale;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.Scanner;
+
+public class SPI {
+
+    public static void genClass(String type, LinkedHashMap<String, Charset> charsets,
+                                String srcDir, String dstDir, String template)
+        throws Exception
+    {
+        try (Scanner s = new Scanner(new File(template));
+             PrintStream out = new PrintStream(new FileOutputStream(
+                 new File(dstDir, new File(
+                     template.replace(".template", "")).getName()))); ) {
+            if (type.startsWith("extcs")) {           // ExtendedCharsets.java
+                while (s.hasNextLine()) {
+                    String line = s.nextLine();
+                    if (line.indexOf("_CHARSETS_DEF_LIST_") == -1) {
+                        out.println(line);
+                    } else {
+                        charsets.values()
+                                .stream()
+                                .filter(cs -> cs.pkgName.equals("sun.nio.cs.ext") &&
+                                              !cs.isInternal)
+                                .forEach( cs -> {
+                            out.printf("        charset(\"%s\", \"%s\",%n", cs.csName, cs.clzName);
+                            out.printf("                new String[] {%n");
+                            for (String alias : cs.aliases) {
+                                out.printf("                    \"%s\",%n", alias);
+                            }
+                            out.printf("                });%n%n");
+                        });
+                    }
+                }
+            } else if (type.startsWith("stdcs")) {    // StandardCharsets.java
+                 ArrayList<String> aliasKeys = new ArrayList<>();
+                 ArrayList<String> aliasValues = new ArrayList<>();
+                 ArrayList<String> clzKeys = new ArrayList<>();
+                 ArrayList<String> clzValues = new ArrayList<>();
+                 charsets.values()
+                         .stream()
+                         .filter(cs -> cs.pkgName.equals("sun.nio.cs") &&
+                                       !cs.isInternal)
+                         .forEach( cs -> {
+                     String csname = cs.csName.toLowerCase(Locale.ENGLISH);
+                     clzKeys.add(csname);
+                     clzValues.add("\"" + cs.clzName + "\"");
+                     if (cs.aliases != null) {
+                         csname = "\"" + csname + "\"";
+                         for (String alias : cs.aliases) {
+                             aliasKeys.add(alias.toLowerCase(Locale.ENGLISH));
+                             aliasValues.add(csname);
+                         }
+                     }
+                 });
+                 while (s.hasNextLine()) {
+                     String line = s.nextLine();
+                     if (line.indexOf("_INCLUDE_ALIASES_TABLES_") != -1) {
+                         charsets.values()
+                                 .stream()
+                                 .filter(cs -> cs.pkgName.equals("sun.nio.cs"))
+                                 .forEach( cs -> {
+                             if (cs.aliases == null || cs.aliases.length == 0) {
+                                 out.printf("    static final String[] aliases_%s = null;%n%n",
+                                            cs.clzName);
+                             } else {
+                                 // non-final for SJIS and MS932 to support sun.nio.cs.map
+                                 if (cs.clzName.equals("SJIS") || cs.clzName.equals("MS932")) {
+                                     out.printf("    static String[] aliases_%s = new String[] {%n",
+                                                cs.clzName);
+                                 } else {
+                                     out.printf("    static final String[] aliases_%s = new String[] {%n",
+                                                cs.clzName);
+                                 }
+                                 for (String alias : cs.aliases) {
+                                     out.printf("        \"%s\",%n", alias);
+                                 }
+                                 out.printf("    };%n%n");
+                             }
+                         });
+                         Charset cs = charsets.get("SJIS");
+                         if (cs == null || cs.pkgName.equals("sun.nio.cs.ext")) {
+                              // StandardCharsets.java has explicit reference
+                              // to aliases_SJIS/MS932. If we don't have these
+                              // two in std, just put a pair of dummy fields to
+                              // make the compiler happy.
+                              out.printf("    static String[] aliases_SJIS = null;%n%n");
+                              out.printf("    static String[] aliases_MS932 = null;%n%n");
+                         }
+                     } else if (line.indexOf("_INCLUDE_ALIASES_MAP_") != -1) {
+                         Hasher.genClass(out, aliasKeys, aliasValues,
+                                         null, "Aliases", "String",
+                                         11, 3, true, false, false);
+                     } else if (line.indexOf("_INCLUDE_CLASSES_MAP_") != -1) {
+                         Hasher.genClass(out, clzKeys, clzValues,
+                                         null, "Classes", "String",
+                                         11, 3, true, false, false);
+                     } else if (line.indexOf("_INCLUDE_CACHE_MAP_") != -1) {
+                         Hasher.genClass(out, clzKeys, clzValues,
+                                         null, "Cache", "Charset",
+                                         11, 3, true, true, false);
+                     } else {
+                         out.println(line);
+                     }
+                }
+            } else {
+                throw new RuntimeException("Unknown type:" + type);
+            }
+        }
+
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/src/classes/build/tools/charsetmapping/SRC.java	Thu Feb 19 16:38:11 2015 -0800
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package build.tools.charsetmapping;
+
+import java.io.*;
+import java.util.Scanner;
+
+public class SRC {
+
+    public static void genClass(Charset cs, String srcDir, String dstDir)
+        throws Exception
+    {
+        String clzName = cs.clzName;
+        String csName  = cs.csName;
+        String pkgName = cs.pkgName;
+
+        try (Scanner s = new Scanner(new File(srcDir, clzName + ".java.template"));
+             PrintStream out = new PrintStream(new FileOutputStream(
+                                  new File(dstDir, clzName + ".java")));) {
+            while (s.hasNextLine()) {
+                String line = s.nextLine();
+                if (line.indexOf("$") < 0) {
+                    out.println(line);
+                    continue;
+                }
+                if (line.indexOf("$PACKAGE$") != -1) {
+                    out.println(line.replace("$PACKAGE$", pkgName));
+                } else if (line.indexOf("$ALIASES$") != -1) {
+                    if ("sun.nio.cs".equals(pkgName))
+                        out.println(line.replace("$ALIASES$",
+                                                 "StandardCharsets.aliases_" + clzName));
+                    else
+                        out.println(line.replace("$ALIASES$",
+                                                 "ExtendedCharsets.aliasesFor(\"" + csName + "\")"));
+                } else {
+                    out.println(line);
+                }
+            }
+        }
+    }
+}
--- a/make/src/classes/build/tools/module/boot.modules	Thu Feb 19 11:24:03 2015 -0800
+++ b/make/src/classes/build/tools/module/boot.modules	Thu Feb 19 16:38:11 2015 -0800
@@ -1,7 +1,7 @@
 java.base
+java.compiler
+java.datatransfer
 java.desktop
-java.compiler
-java.corba
 java.instrument
 java.logging
 java.management
@@ -14,7 +14,6 @@
 java.smartcardio
 java.sql
 java.sql.rowset
-java.transaction
 java.xml
 java.xml.crypto
 jdk.charsets
@@ -22,9 +21,9 @@
 jdk.deploy.osx
 jdk.hprof.agent
 jdk.httpserver
+jdk.jfr
 jdk.naming.rmi
 jdk.sctp
 jdk.security.auth
 jdk.security.jgss
-jdk.jfr
 jdk.snmp
--- a/make/src/classes/build/tools/module/ext.modules	Thu Feb 19 11:24:03 2015 -0800
+++ b/make/src/classes/build/tools/module/ext.modules	Thu Feb 19 16:38:11 2015 -0800
@@ -1,7 +1,10 @@
 java.activation
 java.annotations.common
+java.corba
+java.transaction
 java.xml.bind
 java.xml.ws
+jdk.accessbridge
 jdk.crypto.ec
 jdk.crypto.mscapi
 jdk.crypto.pkcs11
@@ -10,4 +13,3 @@
 jdk.naming.dns
 jdk.scripting.nashorn
 jdk.zipfs
-jdk.accessbridge
--- a/src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java	Thu Feb 19 11:24:03 2015 -0800
+++ b/src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java	Thu Feb 19 16:38:11 2015 -0800
@@ -31,7 +31,6 @@
 import sun.invoke.util.VerifyAccess;
 import static java.lang.invoke.MethodHandleNatives.Constants.*;
 import static java.lang.invoke.LambdaForm.*;
-import static java.lang.invoke.LambdaForm.BasicType.*;
 import static java.lang.invoke.MethodTypeForm.*;
 import static java.lang.invoke.MethodHandleStatics.*;
 import java.lang.ref.WeakReference;
@@ -693,4 +692,10 @@
             }
         }
     }
+
+    @Override
+    void customize() {
+        assert(form.customized == null);
+        // No need to customize DMHs.
+    }
 }
--- a/src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java	Thu Feb 19 11:24:03 2015 -0800
+++ b/src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java	Thu Feb 19 16:38:11 2015 -0800
@@ -285,6 +285,7 @@
         // Forward the SAM method
         MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, samMethodName,
                                           samMethodType.toMethodDescriptorString(), null, null);
+        mv.visitAnnotation("Ljava/lang/invoke/LambdaForm$Hidden;", true);
         new ForwardingMethodGenerator(mv).generate(samMethodType);
 
         // Forward the bridges
@@ -292,6 +293,7 @@
             for (MethodType mt : additionalBridges) {
                 mv = cw.visitMethod(ACC_PUBLIC|ACC_BRIDGE, samMethodName,
                                     mt.toMethodDescriptorString(), null, null);
+                mv.visitAnnotation("Ljava/lang/invoke/LambdaForm$Hidden;", true);
                 new ForwardingMethodGenerator(mv).generate(mt);
             }
         }
--- a/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java	Thu Feb 19 11:24:03 2015 -0800
+++ b/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java	Thu Feb 19 16:38:11 2015 -0800
@@ -56,9 +56,11 @@
     private static final String OBJ     = "java/lang/Object";
     private static final String OBJARY  = "[Ljava/lang/Object;";
 
+    private static final String MH_SIG  = "L" + MH + ";";
     private static final String LF_SIG  = "L" + LF + ";";
     private static final String LFN_SIG = "L" + LFN + ";";
     private static final String LL_SIG  = "(L" + OBJ + ";)L" + OBJ + ";";
+    private static final String LLV_SIG = "(L" + OBJ + ";L" + OBJ + ";)V";
     private static final String CLL_SIG = "(L" + CLS + ";L" + OBJ + ";)L" + OBJ + ";";
 
     /** Name of its super class*/
@@ -616,6 +618,15 @@
         return g.loadMethod(g.generateCustomizedCodeBytes());
     }
 
+    /** Generates code to check that actual receiver and LambdaForm matches */
+    private boolean checkActualReceiver() {
+        // Expects MethodHandle on the stack and actual receiver MethodHandle in slot #0
+        mv.visitInsn(Opcodes.DUP);
+        mv.visitVarInsn(Opcodes.ALOAD, localsMap[0]);
+        mv.visitMethodInsn(Opcodes.INVOKESTATIC, MHI, "assertSame", LLV_SIG, false);
+        return true;
+    }
+
     /**
      * Generate an invoker method for the passed {@link LambdaForm}.
      */
@@ -635,6 +646,16 @@
             mv.visitAnnotation("Ljava/lang/invoke/DontInline;", true);
         }
 
+        if (lambdaForm.customized != null) {
+            // Since LambdaForm is customized for a particular MethodHandle, it's safe to substitute
+            // receiver MethodHandle (at slot #0) with an embedded constant and use it instead.
+            // It enables more efficient code generation in some situations, since embedded constants
+            // are compile-time constants for JIT compiler.
+            mv.visitLdcInsn(constantPlaceholder(lambdaForm.customized));
+            mv.visitTypeInsn(Opcodes.CHECKCAST, MH);
+            assert(checkActualReceiver()); // expects MethodHandle on top of the stack
+            mv.visitVarInsn(Opcodes.ASTORE, localsMap[0]);
+        }
 
         // iterate over the form's names, generating bytecode instructions for each
         // start iterating at the first name following the arguments
--- a/src/java.base/share/classes/java/lang/invoke/Invokers.java	Thu Feb 19 11:24:03 2015 -0800
+++ b/src/java.base/share/classes/java/lang/invoke/Invokers.java	Thu Feb 19 16:38:11 2015 -0800
@@ -247,6 +247,7 @@
         int nameCursor = OUTARG_LIMIT;
         final int MTYPE_ARG    = customized ? -1 : nameCursor++;  // might be last in-argument
         final int CHECK_TYPE   = nameCursor++;
+        final int CHECK_CUSTOM = (CUSTOMIZE_THRESHOLD >= 0) ? nameCursor++ : -1;
         final int LINKER_CALL  = nameCursor++;
         MethodType invokerFormType = mtype.invokerType();
         if (isLinker) {
@@ -279,6 +280,9 @@
             // mh.invokeGeneric(a*):R => checkGenericType(mh, TYPEOF(a*:R)).invokeBasic(a*)
             outArgs[0] = names[CHECK_TYPE];
         }
+        if (CHECK_CUSTOM != -1) {
+            names[CHECK_CUSTOM] = new Name(NF_checkCustomized, names[CALL_MH]);
+        }
         names[LINKER_CALL] = new Name(outCallType, outArgs);
         lform = new LambdaForm(debugName, INARG_LIMIT, names);
         if (isLinker)
@@ -386,11 +390,32 @@
         return ((CallSite)site).getTarget();
     }
 
+    /*non-public*/ static
+    @ForceInline
+    void checkCustomized(Object o) {
+        MethodHandle mh = (MethodHandle)o;
+        if (mh.form.customized == null) {
+            maybeCustomize(mh);
+        }
+    }
+
+    /*non-public*/ static
+    @DontInline
+    void maybeCustomize(MethodHandle mh) {
+        byte count = mh.customizationCount;
+        if (count >= CUSTOMIZE_THRESHOLD) {
+            mh.customize();
+        } else {
+            mh.customizationCount = (byte)(count+1);
+        }
+    }
+
     // Local constant functions:
     private static final NamedFunction
         NF_checkExactType,
         NF_checkGenericType,
-        NF_getCallSiteTarget;
+        NF_getCallSiteTarget,
+        NF_checkCustomized;
     static {
         try {
             NamedFunction nfs[] = {
@@ -399,7 +424,9 @@
                 NF_checkGenericType = new NamedFunction(Invokers.class
                         .getDeclaredMethod("checkGenericType", Object.class, Object.class)),
                 NF_getCallSiteTarget = new NamedFunction(Invokers.class
-                        .getDeclaredMethod("getCallSiteTarget", Object.class))
+                        .getDeclaredMethod("getCallSiteTarget", Object.class)),
+                NF_checkCustomized = new NamedFunction(Invokers.class
+                        .getDeclaredMethod("checkCustomized", Object.class))
             };
             for (NamedFunction nf : nfs) {
                 // Each nf must be statically invocable or we get tied up in our bootstraps.
--- a/src/java.base/share/classes/java/lang/invoke/LambdaForm.java	Thu Feb 19 11:24:03 2015 -0800
+++ b/src/java.base/share/classes/java/lang/invoke/LambdaForm.java	Thu Feb 19 16:38:11 2015 -0800
@@ -120,12 +120,14 @@
     final int arity;
     final int result;
     final boolean forceInline;
+    final MethodHandle customized;
     @Stable final Name[] names;
     final String debugName;
     MemberName vmentry;   // low-level behavior, or null if not yet prepared
     private boolean isCompiled;
 
-    volatile Object transformCache;  // managed by LambdaFormEditor
+    // Either a LambdaForm cache (managed by LambdaFormEditor) or a link to uncustomized version (for customized LF)
+    volatile Object transformCache;
 
     public static final int VOID_RESULT = -1, LAST_RESULT = -2;
 
@@ -244,16 +246,17 @@
 
     LambdaForm(String debugName,
                int arity, Name[] names, int result) {
-        this(debugName, arity, names, result, true);
+        this(debugName, arity, names, result, /*forceInline=*/true, /*customized=*/null);
     }
     LambdaForm(String debugName,
-               int arity, Name[] names, int result, boolean forceInline) {
+               int arity, Name[] names, int result, boolean forceInline, MethodHandle customized) {
         assert(namesOK(arity, names));
         this.arity = arity;
         this.result = fixResult(result, names);
         this.names = names.clone();
         this.debugName = fixDebugName(debugName);
         this.forceInline = forceInline;
+        this.customized = customized;
         int maxOutArity = normalize();
         if (maxOutArity > MethodType.MAX_MH_INVOKER_ARITY) {
             // Cannot use LF interpreter on very high arity expressions.
@@ -263,21 +266,21 @@
     }
     LambdaForm(String debugName,
                int arity, Name[] names) {
-        this(debugName, arity, names, LAST_RESULT, true);
+        this(debugName, arity, names, LAST_RESULT, /*forceInline=*/true, /*customized=*/null);
     }
     LambdaForm(String debugName,
                int arity, Name[] names, boolean forceInline) {
-        this(debugName, arity, names, LAST_RESULT, forceInline);
+        this(debugName, arity, names, LAST_RESULT, forceInline, /*customized=*/null);
     }
     LambdaForm(String debugName,
                Name[] formals, Name[] temps, Name result) {
         this(debugName,
-             formals.length, buildNames(formals, temps, result), LAST_RESULT, true);
+             formals.length, buildNames(formals, temps, result), LAST_RESULT, /*forceInline=*/true, /*customized=*/null);
     }
     LambdaForm(String debugName,
                Name[] formals, Name[] temps, Name result, boolean forceInline) {
         this(debugName,
-             formals.length, buildNames(formals, temps, result), LAST_RESULT, forceInline);
+             formals.length, buildNames(formals, temps, result), LAST_RESULT, forceInline, /*customized=*/null);
     }
 
     private static Name[] buildNames(Name[] formals, Name[] temps, Name result) {
@@ -291,10 +294,6 @@
     }
 
     private LambdaForm(String sig) {
-        this(sig, true);
-    }
-
-    private LambdaForm(String sig, boolean forceInline) {
         // Make a blank lambda form, which returns a constant zero or null.
         // It is used as a template for managing the invocation of similar forms that are non-empty.
         // Called only from getPreparedForm.
@@ -303,7 +302,8 @@
         this.result = (signatureReturn(sig) == V_TYPE ? -1 : arity);
         this.names = buildEmptyNames(arity, sig);
         this.debugName = "LF.zero";
-        this.forceInline = forceInline;
+        this.forceInline = true;
+        this.customized = null;
         assert(nameRefsAreLegal());
         assert(isEmpty());
         assert(sig.equals(basicTypeSignature())) : sig + " != " + basicTypeSignature();
@@ -375,6 +375,31 @@
         return true;
     }
 
+    /** Customize LambdaForm for a particular MethodHandle */
+    LambdaForm customize(MethodHandle mh) {
+        LambdaForm customForm = new LambdaForm(debugName, arity, names, result, forceInline, mh);
+        if (COMPILE_THRESHOLD > 0 && isCompiled) {
+            // If shared LambdaForm has been compiled, compile customized version as well.
+            customForm.compileToBytecode();
+        }
+        customForm.transformCache = this; // LambdaFormEditor should always use uncustomized form.
+        return customForm;
+    }
+
+    /** Get uncustomized flavor of the LambdaForm */
+    LambdaForm uncustomize() {
+        if (customized == null) {
+            return this;
+        }
+        assert(transformCache != null); // Customized LambdaForm should always has a link to uncustomized version.
+        LambdaForm uncustomizedForm = (LambdaForm)transformCache;
+        if (COMPILE_THRESHOLD > 0 && isCompiled) {
+            // If customized LambdaForm has been compiled, compile uncustomized version as well.
+            uncustomizedForm.compileToBytecode();
+        }
+        return uncustomizedForm;
+    }
+
     /** Renumber and/or replace params so that they are interned and canonically numbered.
      *  @return maximum argument list length among the names (since we have to pass over them anyway)
      */
@@ -417,8 +442,8 @@
             for (int i = arity; i < names.length; i++) {
                 names[i].internArguments();
             }
-            assert(nameRefsAreLegal());
         }
+        assert(nameRefsAreLegal());
         return maxOutArity;
     }
 
--- a/src/java.base/share/classes/java/lang/invoke/LambdaFormEditor.java	Thu Feb 19 11:24:03 2015 -0800
+++ b/src/java.base/share/classes/java/lang/invoke/LambdaFormEditor.java	Thu Feb 19 16:38:11 2015 -0800
@@ -51,7 +51,10 @@
     static LambdaFormEditor lambdaFormEditor(LambdaForm lambdaForm) {
         // TO DO:  Consider placing intern logic here, to cut down on duplication.
         // lambdaForm = findPreexistingEquivalent(lambdaForm)
-        return new LambdaFormEditor(lambdaForm);
+
+        // Always use uncustomized version for editing.
+        // It helps caching and customized LambdaForms reuse transformCache field to keep a link to uncustomized version.
+        return new LambdaFormEditor(lambdaForm.uncustomize());
     }
 
     /** A description of a cached transform, possibly associated with the result of the transform.
--- a/src/java.base/share/classes/java/lang/invoke/MethodHandle.java	Thu Feb 19 11:24:03 2015 -0800
+++ b/src/java.base/share/classes/java/lang/invoke/MethodHandle.java	Thu Feb 19 16:38:11 2015 -0800
@@ -434,6 +434,8 @@
     // form is not private so that invokers can easily fetch it
     /*private*/ MethodHandle asTypeCache;
     // asTypeCache is not private so that invokers can easily fetch it
+    /*non-public*/ byte customizationCount;
+    // customizationCount should be accessible from invokers
 
     /**
      * Reports the type of this method handle.
@@ -454,9 +456,9 @@
         type.getClass();  // explicit NPE
         form.getClass();  // explicit NPE
         this.type = type;
-        this.form = form;
+        this.form = form.uncustomize();
 
-        form.prepare();  // TO DO:  Try to delay this step until just before invocation.
+        this.form.prepare();  // TO DO:  Try to delay this step until just before invocation.
     }
 
     /**
@@ -1425,12 +1427,24 @@
      */
     /*non-public*/
     void updateForm(LambdaForm newForm) {
+        assert(newForm.customized == null || newForm.customized == this);
         if (form == newForm)  return;
         newForm.prepare();  // as in MethodHandle.<init>
         UNSAFE.putObject(this, FORM_OFFSET, newForm);
         UNSAFE.fullFence();
     }
 
+    /** Craft a LambdaForm customized for this particular MethodHandle */
+    /*non-public*/
+    void customize() {
+        if (form.customized == null) {
+            LambdaForm newForm = form.customize(this);
+            updateForm(newForm);
+        } else {
+            assert(form.customized == this);
+        }
+    }
+
     private static final long FORM_OFFSET;
     static {
         try {
--- a/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java	Thu Feb 19 11:24:03 2015 -0800
+++ b/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java	Thu Feb 19 16:38:11 2015 -0800
@@ -597,6 +597,7 @@
         static final NamedFunction NF_checkSpreadArgument;
         static final NamedFunction NF_guardWithCatch;
         static final NamedFunction NF_throwException;
+        static final NamedFunction NF_profileBoolean;
 
         static final MethodHandle MH_castReference;
         static final MethodHandle MH_selectAlternative;
@@ -614,10 +615,12 @@
                 NF_guardWithCatch      = new NamedFunction(MHI.getDeclaredMethod("guardWithCatch", MethodHandle.class, Class.class,
                                                                                  MethodHandle.class, Object[].class));
                 NF_throwException      = new NamedFunction(MHI.getDeclaredMethod("throwException", Throwable.class));
+                NF_profileBoolean      = new NamedFunction(MHI.getDeclaredMethod("profileBoolean", boolean.class, int[].class));
 
                 NF_checkSpreadArgument.resolve();
                 NF_guardWithCatch.resolve();
                 NF_throwException.resolve();
+                NF_profileBoolean.resolve();
 
                 MH_castReference        = IMPL_LOOKUP.findStatic(MHI, "castReference",
                                             MethodType.methodType(Object.class, Class.class, Object.class));
@@ -697,7 +700,26 @@
     @LambdaForm.Hidden
     static
     MethodHandle selectAlternative(boolean testResult, MethodHandle target, MethodHandle fallback) {
-        return testResult ? target : fallback;
+        if (testResult) {
+            return target;
+        } else {
+            return fallback;
+        }
+    }
+
+    // Intrinsified by C2. Counters are used during parsing to calculate branch frequencies.
+    @LambdaForm.Hidden
+    static
+    boolean profileBoolean(boolean result, int[] counters) {
+        // Profile is int[2] where [0] and [1] correspond to false and true occurrences respectively.
+        int idx = result ? 1 : 0;
+        try {
+            counters[idx] = Math.addExact(counters[idx], 1);
+        } catch (ArithmeticException e) {
+            // Avoid continuous overflow by halving the problematic count.
+            counters[idx] = counters[idx] / 2;
+        }
+        return result;
     }
 
     static
@@ -708,13 +730,18 @@
         assert(test.type().equals(type.changeReturnType(boolean.class)) && fallback.type().equals(type));
         MethodType basicType = type.basicType();
         LambdaForm form = makeGuardWithTestForm(basicType);
-        BoundMethodHandle.SpeciesData data = BoundMethodHandle.speciesData_LLL();
         BoundMethodHandle mh;
-
         try {
-            mh = (BoundMethodHandle)
-                    data.constructor().invokeBasic(type, form,
-                        (Object) test, (Object) profile(target), (Object) profile(fallback));
+            if (PROFILE_GWT) {
+                int[] counts = new int[2];
+                mh = (BoundMethodHandle)
+                        BoundMethodHandle.speciesData_LLLL().constructor().invokeBasic(type, form,
+                                (Object) test, (Object) profile(target), (Object) profile(fallback), counts);
+            } else {
+                mh = (BoundMethodHandle)
+                        BoundMethodHandle.speciesData_LLL().constructor().invokeBasic(type, form,
+                                (Object) test, (Object) profile(target), (Object) profile(fallback));
+            }
         } catch (Throwable ex) {
             throw uncaughtException(ex);
         }
@@ -726,7 +753,7 @@
     static
     MethodHandle profile(MethodHandle target) {
         if (DONT_INLINE_THRESHOLD >= 0) {
-            return makeBlockInlningWrapper(target);
+            return makeBlockInliningWrapper(target);
         } else {
             return target;
         }
@@ -737,8 +764,13 @@
      * Corresponding LambdaForm has @DontInline when compiled into bytecode.
      */
     static
-    MethodHandle makeBlockInlningWrapper(MethodHandle target) {
-        LambdaForm lform = PRODUCE_BLOCK_INLINING_FORM.apply(target);
+    MethodHandle makeBlockInliningWrapper(MethodHandle target) {
+        LambdaForm lform;
+        if (DONT_INLINE_THRESHOLD > 0) {
+            lform = PRODUCE_BLOCK_INLINING_FORM.apply(target);
+        } else {
+            lform = PRODUCE_REINVOKER_FORM.apply(target);
+        }
         return new CountingWrapper(target, lform,
                 PRODUCE_BLOCK_INLINING_FORM, PRODUCE_REINVOKER_FORM,
                                    DONT_INLINE_THRESHOLD);
@@ -800,7 +832,7 @@
             MethodHandle wrapper;
             if (isCounting) {
                 LambdaForm lform;
-                lform = countingFormProducer.apply(target);
+                lform = countingFormProducer.apply(newTarget);
                 wrapper = new CountingWrapper(newTarget, lform, countingFormProducer, nonCountingFormProducer, DONT_INLINE_THRESHOLD);
             } else {
                 wrapper = newTarget; // no need for a counting wrapper anymore
@@ -809,7 +841,8 @@
         }
 
         boolean countDown() {
-            if (count <= 0) {
+            int c = count;
+            if (c <= 1) {
                 // Try to limit number of updates. MethodHandle.updateForm() doesn't guarantee LF update visibility.
                 if (isCounting) {
                     isCounting = false;
@@ -818,7 +851,7 @@
                     return false;
                 }
             } else {
-                --count;
+                count = c - 1;
                 return false;
             }
         }
@@ -856,7 +889,10 @@
         final int GET_TEST     = nameCursor++;
         final int GET_TARGET   = nameCursor++;
         final int GET_FALLBACK = nameCursor++;
+        final int GET_COUNTERS = PROFILE_GWT ? nameCursor++ : -1;
         final int CALL_TEST    = nameCursor++;
+        final int PROFILE      = (GET_COUNTERS != -1) ? nameCursor++ : -1;
+        final int TEST         = nameCursor-1; // previous statement: either PROFILE or CALL_TEST
         final int SELECT_ALT   = nameCursor++;
         final int CALL_TARGET  = nameCursor++;
         assert(CALL_TARGET == SELECT_ALT+1);  // must be true to trigger IBG.emitSelectAlternative
@@ -864,12 +900,16 @@
         MethodType lambdaType = basicType.invokerType();
         Name[] names = arguments(nameCursor - ARG_LIMIT, lambdaType);
 
-        BoundMethodHandle.SpeciesData data = BoundMethodHandle.speciesData_LLL();
+        BoundMethodHandle.SpeciesData data =
+                (GET_COUNTERS != -1) ? BoundMethodHandle.speciesData_LLLL()
+                                     : BoundMethodHandle.speciesData_LLL();
         names[THIS_MH] = names[THIS_MH].withConstraint(data);
         names[GET_TEST]     = new Name(data.getterFunction(0), names[THIS_MH]);
         names[GET_TARGET]   = new Name(data.getterFunction(1), names[THIS_MH]);
         names[GET_FALLBACK] = new Name(data.getterFunction(2), names[THIS_MH]);
-
+        if (GET_COUNTERS != -1) {
+            names[GET_COUNTERS] = new Name(data.getterFunction(3), names[THIS_MH]);
+        }
         Object[] invokeArgs = Arrays.copyOfRange(names, 0, ARG_LIMIT, Object[].class);
 
         // call test
@@ -877,15 +917,18 @@
         invokeArgs[0] = names[GET_TEST];
         names[CALL_TEST] = new Name(testType, invokeArgs);
 
+        // profile branch
+        if (PROFILE != -1) {
+            names[PROFILE] = new Name(Lazy.NF_profileBoolean, names[CALL_TEST], names[GET_COUNTERS]);
+        }
         // call selectAlternative
-        names[SELECT_ALT] = new Name(Lazy.MH_selectAlternative, names[CALL_TEST],
-                                     names[GET_TARGET], names[GET_FALLBACK]);
+        names[SELECT_ALT] = new Name(Lazy.MH_selectAlternative, names[TEST], names[GET_TARGET], names[GET_FALLBACK]);
 
         // call target or fallback
         invokeArgs[0] = names[SELECT_ALT];
         names[CALL_TARGET] = new Name(basicType, invokeArgs);
 
-        lform = new LambdaForm("guard", lambdaType.parameterCount(), names);
+        lform = new LambdaForm("guard", lambdaType.parameterCount(), names, /*forceInline=*/true);
 
         return basicType.form().setCachedLambdaForm(MethodTypeForm.LF_GWT, lform);
     }
@@ -1629,4 +1672,13 @@
         assert(elemType.isPrimitive());
         return Lazy.MH_copyAsPrimitiveArray.bindTo(Wrapper.forPrimitiveType(elemType));
     }
+
+    /*non-public*/ static void assertSame(Object mh1, Object mh2) {
+        if (mh1 != mh2) {
+            String msg = String.format("mh1 != mh2: mh1 = %s (form: %s); mh2 = %s (form: %s)",
+                    mh1, ((MethodHandle)mh1).form,
+                    mh2, ((MethodHandle)mh2).form);
+            throw newInternalError(msg);
+        }
+    }
 }
--- a/src/java.base/share/classes/java/lang/invoke/MethodHandleStatics.java	Thu Feb 19 11:24:03 2015 -0800
+++ b/src/java.base/share/classes/java/lang/invoke/MethodHandleStatics.java	Thu Feb 19 16:38:11 2015 -0800
@@ -48,9 +48,11 @@
     static final int COMPILE_THRESHOLD;
     static final int DONT_INLINE_THRESHOLD;
     static final int PROFILE_LEVEL;
+    static final boolean PROFILE_GWT;
+    static final int CUSTOMIZE_THRESHOLD;
 
     static {
-        final Object[] values = new Object[7];
+        final Object[] values = new Object[9];
         AccessController.doPrivileged(new PrivilegedAction<Void>() {
                 public Void run() {
                     values[0] = Boolean.getBoolean("java.lang.invoke.MethodHandle.DEBUG_NAMES");
@@ -60,6 +62,8 @@
                     values[4] = Integer.getInteger("java.lang.invoke.MethodHandle.COMPILE_THRESHOLD", 0);
                     values[5] = Integer.getInteger("java.lang.invoke.MethodHandle.DONT_INLINE_THRESHOLD", 30);
                     values[6] = Integer.getInteger("java.lang.invoke.MethodHandle.PROFILE_LEVEL", 0);
+                    values[7] = Boolean.parseBoolean(System.getProperty("java.lang.invoke.MethodHandle.PROFILE_GWT", "true"));
+                    values[8] = Integer.getInteger("java.lang.invoke.MethodHandle.CUSTOMIZE_THRESHOLD", 127);
                     return null;
                 }
             });
@@ -70,6 +74,12 @@
         COMPILE_THRESHOLD         = (Integer) values[4];
         DONT_INLINE_THRESHOLD     = (Integer) values[5];
         PROFILE_LEVEL             = (Integer) values[6];
+        PROFILE_GWT               = (Boolean) values[7];
+        CUSTOMIZE_THRESHOLD       = (Integer) values[8];
+
+        if (CUSTOMIZE_THRESHOLD < -1 || CUSTOMIZE_THRESHOLD > 127) {
+            throw newInternalError("CUSTOMIZE_THRESHOLD should be in [-1...127] range");
+        }
     }
 
     /** Tell if any of the debugging switches are turned on.
--- a/src/java.base/share/classes/java/nio/channels/Pipe.java	Thu Feb 19 11:24:03 2015 -0800
+++ b/src/java.base/share/classes/java/nio/channels/Pipe.java	Thu Feb 19 16:38:11 2015 -0800
@@ -35,7 +35,7 @@
  * <p> A pipe consists of a pair of channels: A writable {@link
  * Pipe.SinkChannel sink} channel and a readable {@link Pipe.SourceChannel source}
  * channel.  Once some bytes are written to the sink channel they can be read
- * from source channel in exactlyAthe order in which they were written.
+ * from the source channel in exactly the order in which they were written.
  *
  * <p> Whether or not a thread writing bytes to a pipe will block until another
  * thread reads those bytes, or some previously-written bytes, from the pipe is
--- a/src/java.base/share/classes/java/security/AccessControlContext.java	Thu Feb 19 11:24:03 2015 -0800
+++ b/src/java.base/share/classes/java/security/AccessControlContext.java	Thu Feb 19 16:38:11 2015 -0800
@@ -172,9 +172,24 @@
     public AccessControlContext(AccessControlContext acc,
                                 DomainCombiner combiner) {
 
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkPermission(SecurityConstants.CREATE_ACC_PERMISSION);
+        this(acc, combiner, false);
+    }
+
+    /**
+     * package private to allow calls from ProtectionDomain without performing
+     * the security check for {@linkplain SecurityConstants.CREATE_ACC_PERMISSION}
+     * permission
+     */
+    AccessControlContext(AccessControlContext acc,
+                        DomainCombiner combiner,
+                        boolean preauthorized) {
+        if (!preauthorized) {
+            SecurityManager sm = System.getSecurityManager();
+            if (sm != null) {
+                sm.checkPermission(SecurityConstants.CREATE_ACC_PERMISSION);
+                this.isAuthorized = true;
+            }
+        } else {
             this.isAuthorized = true;
         }
 
--- a/src/java.base/share/classes/java/security/ProtectionDomain.java	Thu Feb 19 11:24:03 2015 -0800
+++ b/src/java.base/share/classes/java/security/ProtectionDomain.java	Thu Feb 19 16:38:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,6 @@
 
 import java.lang.ref.WeakReference;
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.Enumeration;
 import java.util.List;
 import java.util.Map;
@@ -60,35 +59,44 @@
  */
 
 public class ProtectionDomain {
+    private static class JavaSecurityAccessImpl implements JavaSecurityAccess {
+
+        private JavaSecurityAccessImpl() {
+        }
+
+        @Override
+        public <T> T doIntersectionPrivilege(
+                PrivilegedAction<T> action,
+                final AccessControlContext stack,
+                final AccessControlContext context) {
+            if (action == null) {
+                throw new NullPointerException();
+            }
+
+            return AccessController.doPrivileged(
+                action,
+                getCombinedACC(context, stack)
+            );
+        }
+
+        @Override
+        public <T> T doIntersectionPrivilege(
+                PrivilegedAction<T> action,
+                AccessControlContext context) {
+            return doIntersectionPrivilege(action,
+                AccessController.getContext(), context);
+        }
+
+        private static AccessControlContext getCombinedACC(AccessControlContext context, AccessControlContext stack) {
+            AccessControlContext acc = new AccessControlContext(context, stack.getCombiner(), true);
+
+            return new AccessControlContext(stack.getContext(), acc).optimize();
+        }
+    }
 
     static {
         // Set up JavaSecurityAccess in SharedSecrets
-        SharedSecrets.setJavaSecurityAccess(
-            new JavaSecurityAccess() {
-                public <T> T doIntersectionPrivilege(
-                    PrivilegedAction<T> action,
-                    final AccessControlContext stack,
-                    final AccessControlContext context)
-                {
-                    if (action == null) {
-                        throw new NullPointerException();
-                    }
-                    return AccessController.doPrivileged(
-                        action,
-                        new AccessControlContext(
-                            stack.getContext(), context).optimize()
-                    );
-                }
-
-                public <T> T doIntersectionPrivilege(
-                    PrivilegedAction<T> action,
-                    AccessControlContext context)
-                {
-                    return doIntersectionPrivilege(action,
-                        AccessController.getContext(), context);
-                }
-            }
-       );
+        SharedSecrets.setJavaSecurityAccess(new JavaSecurityAccessImpl());
     }
 
     /* CodeSource */
--- a/src/java.base/share/classes/java/util/ComparableTimSort.java	Thu Feb 19 11:24:03 2015 -0800
+++ b/src/java.base/share/classes/java/util/ComparableTimSort.java	Thu Feb 19 16:38:11 2015 -0800
@@ -144,6 +144,10 @@
          * large) stack lengths for smaller arrays.  The "magic numbers" in the
          * computation below must be changed if MIN_MERGE is decreased.  See
          * the MIN_MERGE declaration above for more information.
+         * The maximum value of 49 allows for an array up to length
+         * Integer.MAX_VALUE-4, if array is filled by the worst case stack size
+         * increasing scenario. More explanations are given in section 4 of:
+         * http://envisage-project.eu/wp-content/uploads/2015/02/sorting.pdf
          */
         int stackLen = (len <    120  ?  5 :
                         len <   1542  ? 10 :
--- a/src/java.base/share/classes/java/util/Formattable.java	Thu Feb 19 11:24:03 2015 -0800
+++ b/src/java.base/share/classes/java/util/Formattable.java	Thu Feb 19 16:38:11 2015 -0800
@@ -36,14 +36,14 @@
  * For example, the following class prints out different representations of a
  * stock's name depending on the flags and length constraints:
  *
- * {@code
+ * <pre> {@code
  *   import java.nio.CharBuffer;
  *   import java.util.Formatter;
  *   import java.util.Formattable;
  *   import java.util.Locale;
  *   import static java.util.FormattableFlags.*;
  *
- *  ...
+ *   ...
  *
  *   public class StockName implements Formattable {
  *       private String symbol, companyName, frenchCompanyName;
@@ -89,12 +89,12 @@
  *           return String.format("%s - %s", symbol, companyName);
  *       }
  *   }
- * }
+ * }</pre>
  *
  * <p> When used in conjunction with the {@link java.util.Formatter}, the above
  * class produces the following output for various format strings.
  *
- * {@code
+ * <pre> {@code
  *   Formatter fmt = new Formatter();
  *   StockName sn = new StockName("HUGE", "Huge Fruit, Inc.",
  *                                "Fruit Titanesque, Inc.");
@@ -104,7 +104,7 @@
  *   fmt.format("%-10.8s", sn);              //   -> "HUGE      "
  *   fmt.format("%.12s", sn);                //   -> "Huge Fruit,*"
  *   fmt.format(Locale.FRANCE, "%25s", sn);  //   -> "   Fruit Titanesque, Inc."
- * }
+ * }</pre>
  *
  * <p> Formattables are not necessarily safe for multithreaded access.  Thread
  * safety is optional and may be enforced by classes that extend and implement
--- a/src/java.base/share/classes/java/util/Optional.java	Thu Feb 19 11:24:03 2015 -0800
+++ b/src/java.base/share/classes/java/util/Optional.java	Thu Feb 19 16:38:11 2015 -0800
@@ -38,8 +38,8 @@
  * <p>Additional methods that depend on the presence or absence of a contained
  * value are provided, such as {@link #orElse(java.lang.Object) orElse()}
  * (return a default value if value not present) and
- * {@link #ifPresent(java.util.function.Consumer) ifPresent()} (execute a block
- * of code if the value is present).
+ * {@link #ifPresent(java.util.function.Consumer) ifPresent()} (perform an
+ * action if the value is present).
  *
  * <p>This is a <a href="../lang/doc-files/ValueBased.html">value-based</a>
  * class; use of identity-sensitive operations (including reference equality
@@ -148,16 +148,35 @@
     }
 
     /**
-     * If a value is present, invoke the specified consumer with the value,
+     * If a value is present, perform the given action with the value,
      * otherwise do nothing.
      *
-     * @param consumer block to be executed if a value is present
-     * @throws NullPointerException if value is present and {@code consumer} is
+     * @param action the action to be performed if a value is present
+     * @throws NullPointerException if a value is present and {@code action} is
      * null
      */
-    public void ifPresent(Consumer<? super T> consumer) {
+    public void ifPresent(Consumer<? super T> action) {
         if (value != null) {
-            consumer.accept(value);
+            action.accept(value);
+        }
+    }
+
+    /**
+     * If a value is present, perform the given action with the value,
+     * otherwise perform the given empty-based action.
+     *
+     * @param action the action to be performed if a value is present
+     * @param emptyAction the empty-based action to be performed if a value is
+     * not present
+     * @throws NullPointerException if a value is present and {@code action} is
+     * null, or a value is not present and {@code emptyAction} is null.
+     * @since 1.9
+     */
+    public void ifPresentOrElse(Consumer<? super T> action, Runnable emptyAction) {
+        if (value != null) {
+            action.accept(value);
+        } else {
+            emptyAction.run();
         }
     }
 
--- a/src/java.base/share/classes/java/util/OptionalDouble.java	Thu Feb 19 11:24:03 2015 -0800
+++ b/src/java.base/share/classes/java/util/OptionalDouble.java	Thu Feb 19 16:38:11 2015 -0800
@@ -37,8 +37,8 @@
  * <p>Additional methods that depend on the presence or absence of a contained
  * value are provided, such as {@link #orElse(double) orElse()}
  * (return a default value if value not present) and
- * {@link #ifPresent(java.util.function.DoubleConsumer) ifPresent()} (execute a block
- * of code if the value is present).
+ * {@link #ifPresent(java.util.function.DoubleConsumer) ifPresent()} (perform an
+ * action if the value is present).
  *
  * <p>This is a <a href="../lang/doc-files/ValueBased.html">value-based</a>
  * class; use of identity-sensitive operations (including reference equality
@@ -131,16 +131,35 @@
     }
 
     /**
-     * Have the specified consumer accept the value if a value is present,
+     * If a value is present, perform the given action with the value,
      * otherwise do nothing.
      *
-     * @param consumer block to be executed if a value is present
-     * @throws NullPointerException if value is present and {@code consumer} is
+     * @param action the action to be performed if a value is present
+     * @throws NullPointerException if a value is present and {@code action} is
      * null
      */
-    public void ifPresent(DoubleConsumer consumer) {
+    public void ifPresent(DoubleConsumer action) {
         if (isPresent) {
-            consumer.accept(value);
+            action.accept(value);
+        }
+    }
+
+    /**
+     * If a value is present, perform the given action with the value,
+     * otherwise perform the given empty-based action.
+     *
+     * @param action the action to be performed if a value is present
+     * @param emptyAction the empty-based action to be performed if a value is
+     * not present
+     * @throws NullPointerException if a value is present and {@code action} is
+     * null, or a value is not present and {@code emptyAction} is null.
+     * @since 1.9
+     */
+    public void ifPresentOrElse(DoubleConsumer action, Runnable emptyAction) {
+        if (isPresent) {
+            action.accept(value);
+        } else {
+            emptyAction.run();
         }
     }
 
--- a/src/java.base/share/classes/java/util/OptionalInt.java	Thu Feb 19 11:24:03 2015 -0800
+++ b/src/java.base/share/classes/java/util/OptionalInt.java	Thu Feb 19 16:38:11 2015 -0800
@@ -37,8 +37,8 @@
  * <p>Additional methods that depend on the presence or absence of a contained
  * value are provided, such as {@link #orElse(int) orElse()}
  * (return a default value if value not present) and
- * {@link #ifPresent(java.util.function.IntConsumer) ifPresent()} (execute a block
- * of code if the value is present).
+ * {@link #ifPresent(java.util.function.IntConsumer) ifPresent()} (perform an
+ * action if the value is present).
  *
  * <p>This is a <a href="../lang/doc-files/ValueBased.html">value-based</a>
  * class; use of identity-sensitive operations (including reference equality
@@ -131,16 +131,35 @@
     }
 
     /**
-     * Have the specified consumer accept the value if a value is present,
+     * If a value is present, perform the given action with the value,
      * otherwise do nothing.
      *
-     * @param consumer block to be executed if a value is present
-     * @throws NullPointerException if value is present and {@code consumer} is
+     * @param action the action to be performed if a value is present
+     * @throws NullPointerException if value is present and {@code action} is
      * null
      */
-    public void ifPresent(IntConsumer consumer) {
+    public void ifPresent(IntConsumer action) {
         if (isPresent) {
-            consumer.accept(value);
+            action.accept(value);
+        }
+    }
+
+    /**
+     * If a value is present, perform the given action with the value,
+     * otherwise perform the given empty-based action.
+     *
+     * @param action the action to be performed if a value is present
+     * @param emptyAction the empty-based action to be performed if a value is
+     * not present
+     * @throws NullPointerException if a value is present and {@code action} is
+     * null, or a value is not present and {@code emptyAction} is null.
+     * @since 1.9
+     */
+    public void ifPresentOrElse(IntConsumer action, Runnable emptyAction) {
+        if (isPresent) {
+            action.accept(value);
+        } else {
+            emptyAction.run();
         }
     }
 
--- a/src/java.base/share/classes/java/util/OptionalLong.java	Thu Feb 19 11:24:03 2015 -0800
+++ b/src/java.base/share/classes/java/util/OptionalLong.java	Thu Feb 19 16:38:11 2015 -0800
@@ -37,8 +37,8 @@
  * <p>Additional methods that depend on the presence or absence of a contained
  * value are provided, such as {@link #orElse(long) orElse()}
  * (return a default value if value not present) and
- * {@link #ifPresent(java.util.function.LongConsumer) ifPresent()} (execute a block
- * of code if the value is present).
+ * {@link #ifPresent(java.util.function.LongConsumer) ifPresent()} (perform an
+ * action if the value is present).
  *
  * <p>This is a <a href="../lang/doc-files/ValueBased.html">value-based</a>
  * class; use of identity-sensitive operations (including reference equality
@@ -131,16 +131,35 @@
     }
 
     /**
-     * Have the specified consumer accept the value if a value is present,
+     * If a value is present, perform the given action with the value,
      * otherwise do nothing.
      *
-     * @param consumer block to be executed if a value is present
-     * @throws NullPointerException if value is present and {@code consumer} is
+     * @param action the action to be performed if a value is present
+     * @throws NullPointerException if a value is present and {@code action} is
      * null
      */
-    public void ifPresent(LongConsumer consumer) {
+    public void ifPresent(LongConsumer action) {
         if (isPresent) {
-            consumer.accept(value);
+            action.accept(value);
+        }
+    }
+
+    /**
+     * If a value is present, perform the given action with the value,
+     * otherwise perform the given empty-based action.
+     *
+     * @param action the action to be performed if a value is present
+     * @param emptyAction the empty-based action to be performed if a value is
+     * not present
+     * @throws NullPointerException if a value is present and {@code action} is
+     * null, or a value is not present and {@code emptyAction} is null.
+     * @since 1.9
+     */
+    public void ifPresentOrElse(LongConsumer action, Runnable emptyAction) {
+        if (isPresent) {
+            action.accept(value);
+        } else {
+            emptyAction.run();
         }
     }
 
--- a/src/java.base/share/classes/java/util/TimSort.java	Thu Feb 19 11:24:03 2015 -0800
+++ b/src/java.base/share/classes/java/util/TimSort.java	Thu Feb 19 16:38:11 2015 -0800
@@ -174,6 +174,10 @@
          * large) stack lengths for smaller arrays.  The "magic numbers" in the
          * computation below must be changed if MIN_MERGE is decreased.  See
          * the MIN_MERGE declaration above for more information.
+         * The maximum value of 49 allows for an array up to length
+         * Integer.MAX_VALUE-4, if array is filled by the worst case stack size
+         * increasing scenario. More explanations are given in section 4 of:
+         * http://envisage-project.eu/wp-content/uploads/2015/02/sorting.pdf
          */
         int stackLen = (len <    120  ?  5 :
                         len <   1542  ? 10 :
--- a/src/java.base/share/classes/java/util/regex/Pattern.java	Thu Feb 19 11:24:03 2015 -0800
+++ b/src/java.base/share/classes/java/util/regex/Pattern.java	Thu Feb 19 16:38:11 2015 -0800
@@ -5819,6 +5819,10 @@
 
             MatcherIterator() {
                 this.matcher = matcher(input);
+                // If the input is an empty string then the result can only be a
+                // stream of the input.  Induce that by setting the empty
+                // element count to 1
+                this.emptyElementCount = input.length() == 0 ? 1 : 0;
             }
 
             public String next() {
--- a/src/java.base/share/classes/sun/misc/Unsafe.java	Thu Feb 19 11:24:03 2015 -0800
+++ b/src/java.base/share/classes/sun/misc/Unsafe.java	Thu Feb 19 16:38:11 2015 -0800
@@ -25,8 +25,8 @@
 
 package sun.misc;
 
-import java.security.*;
-import java.lang.reflect.*;
+import java.lang.reflect.Field;
+import java.security.ProtectionDomain;
 
 import sun.reflect.CallerSensitive;
 import sun.reflect.Reflection;
@@ -189,205 +189,39 @@
      * If the reference <code>o</code> is non-null, car marks or
      * other store barriers for that object (if the VM requires them)
      * are updated.
-     * @see #putInt(Object, int, int)
+     * @see #putInt(Object, long, int)
      */
     public native void putObject(Object o, long offset, Object x);
 
     /** @see #getInt(Object, long) */
     public native boolean getBoolean(Object o, long offset);
-    /** @see #putInt(Object, int, int) */
+    /** @see #putInt(Object, long, int) */
     public native void    putBoolean(Object o, long offset, boolean x);
     /** @see #getInt(Object, long) */
     public native byte    getByte(Object o, long offset);
-    /** @see #putInt(Object, int, int) */
+    /** @see #putInt(Object, long, int) */
     public native void    putByte(Object o, long offset, byte x);
     /** @see #getInt(Object, long) */
     public native short   getShort(Object o, long offset);
-    /** @see #putInt(Object, int, int) */
+    /** @see #putInt(Object, long, int) */
     public native void    putShort(Object o, long offset, short x);
     /** @see #getInt(Object, long) */
     public native char    getChar(Object o, long offset);
-    /** @see #putInt(Object, int, int) */
+    /** @see #putInt(Object, long, int) */
     public native void    putChar(Object o, long offset, char x);
     /** @see #getInt(Object, long) */
     public native long    getLong(Object o, long offset);
-    /** @see #putInt(Object, int, int) */
+    /** @see #putInt(Object, long, int) */
     public native void    putLong(Object o, long offset, long x);
     /** @see #getInt(Object, long) */
     public native float   getFloat(Object o, long offset);
-    /** @see #putInt(Object, int, int) */
+    /** @see #putInt(Object, long, int) */
     public native void    putFloat(Object o, long offset, float x);
     /** @see #getInt(Object, long) */
     public native double  getDouble(Object o, long offset);
-    /** @see #putInt(Object, int, int) */
+    /** @see #putInt(Object, long, int) */
     public native void    putDouble(Object o, long offset, double x);
 
-    /**
-     * This method, like all others with 32-bit offsets, was native
-     * in a previous release but is now a wrapper which simply casts
-     * the offset to a long value.  It provides backward compatibility
-     * with bytecodes compiled against 1.4.
-     * @deprecated As of 1.4.1, cast the 32-bit offset argument to a long.
-     * See {@link #staticFieldOffset}.
-     */
-    @Deprecated
-    public int getInt(Object o, int offset) {
-        return getInt(o, (long)offset);
-    }
-
-    /**
-     * @deprecated As of 1.4.1, cast the 32-bit offset argument to a long.
-     * See {@link #staticFieldOffset}.
-     */
-    @Deprecated
-    public void putInt(Object o, int offset, int x) {
-        putInt(o, (long)offset, x);
-    }
-
-    /**
-     * @deprecated As of 1.4.1, cast the 32-bit offset argument to a long.
-     * See {@link #staticFieldOffset}.
-     */
-    @Deprecated
-    public Object getObject(Object o, int offset) {
-        return getObject(o, (long)offset);
-    }
-
-    /**
-     * @deprecated As of 1.4.1, cast the 32-bit offset argument to a long.
-     * See {@link #staticFieldOffset}.
-     */
-    @Deprecated
-    public void putObject(Object o, int offset, Object x) {
-        putObject(o, (long)offset, x);
-    }
-
-    /**
-     * @deprecated As of 1.4.1, cast the 32-bit offset argument to a long.
-     * See {@link #staticFieldOffset}.
-     */
-    @Deprecated
-    public boolean getBoolean(Object o, int offset) {
-        return getBoolean(o, (long)offset);
-    }
-
-    /**
-     * @deprecated As of 1.4.1, cast the 32-bit offset argument to a long.
-     * See {@link #staticFieldOffset}.
-     */
-    @Deprecated
-    public void putBoolean(Object o, int offset, boolean x) {
-        putBoolean(o, (long)offset, x);
-    }
-
-    /**
-     * @deprecated As of 1.4.1, cast the 32-bit offset argument to a long.
-     * See {@link #staticFieldOffset}.
-     */
-    @Deprecated
-    public byte getByte(Object o, int offset) {
-        return getByte(o, (long)offset);
-    }
-
-    /**
-     * @deprecated As of 1.4.1, cast the 32-bit offset argument to a long.
-     * See {@link #staticFieldOffset}.
-     */
-    @Deprecated
-    public void putByte(Object o, int offset, byte x) {
-        putByte(o, (long)offset, x);
-    }
-
-    /**
-     * @deprecated As of 1.4.1, cast the 32-bit offset argument to a long.
-     * See {@link #staticFieldOffset}.
-     */
-    @Deprecated
-    public short getShort(Object o, int offset) {
-        return getShort(o, (long)offset);
-    }
-
-    /**
-     * @deprecated As of 1.4.1, cast the 32-bit offset argument to a long.
-     * See {@link #staticFieldOffset}.
-     */
-    @Deprecated
-    public void putShort(Object o, int offset, short x) {
-        putShort(o, (long)offset, x);
-    }
-
-    /**
-     * @deprecated As of 1.4.1, cast the 32-bit offset argument to a long.
-     * See {@link #staticFieldOffset}.
-     */
-    @Deprecated
-    public char getChar(Object o, int offset) {
-        return getChar(o, (long)offset);
-    }
-
-    /**
-     * @deprecated As of 1.4.1, cast the 32-bit offset argument to a long.
-     * See {@link #staticFieldOffset}.
-     */
-    @Deprecated
-    public void putChar(Object o, int offset, char x) {
-        putChar(o, (long)offset, x);
-    }
-
-    /**
-     * @deprecated As of 1.4.1, cast the 32-bit offset argument to a long.
-     * See {@link #staticFieldOffset}.
-     */
-    @Deprecated
-    public long getLong(Object o, int offset) {
-        return getLong(o, (long)offset);
-    }
-
-    /**
-     * @deprecated As of 1.4.1, cast the 32-bit offset argument to a long.
-     * See {@link #staticFieldOffset}.
-     */
-    @Deprecated
-    public void putLong(Object o, int offset, long x) {
-        putLong(o, (long)offset, x);
-    }
-
-    /**
-     * @deprecated As of 1.4.1, cast the 32-bit offset argument to a long.
-     * See {@link #staticFieldOffset}.
-     */
-    @Deprecated
-    public float getFloat(Object o, int offset) {
-        return getFloat(o, (long)offset);
-    }
-
-    /**
-     * @deprecated As of 1.4.1, cast the 32-bit offset argument to a long.
-     * See {@link #staticFieldOffset}.
-     */
-    @Deprecated
-    public void putFloat(Object o, int offset, float x) {
-        putFloat(o, (long)offset, x);
-    }
-
-    /**
-     * @deprecated As of 1.4.1, cast the 32-bit offset argument to a long.
-     * See {@link #staticFieldOffset}.
-     */
-    @Deprecated
-    public double getDouble(Object o, int offset) {
-        return getDouble(o, (long)offset);
-    }
-
-    /**
-     * @deprecated As of 1.4.1, cast the 32-bit offset argument to a long.
-     * See {@link #staticFieldOffset}.
-     */
-    @Deprecated
-    public void putDouble(Object o, int offset, double x) {
-        putDouble(o, (long)offset, x);
-    }
-
     // These work on values in the C heap.
 
     /**
@@ -579,58 +413,6 @@
     public static final int INVALID_FIELD_OFFSET   = -1;
 
     /**
-     * Returns the offset of a field, truncated to 32 bits.
-     * This method is implemented as follows:
-     * <blockquote><pre>
-     * public int fieldOffset(Field f) {
-     *     if (Modifier.isStatic(f.getModifiers()))
-     *         return (int) staticFieldOffset(f);
-     *     else
-     *         return (int) objectFieldOffset(f);
-     * }
-     * </pre></blockquote>
-     * @deprecated As of 1.4.1, use {@link #staticFieldOffset} for static
-     * fields and {@link #objectFieldOffset} for non-static fields.
-     */
-    @Deprecated
-    public int fieldOffset(Field f) {
-        if (Modifier.isStatic(f.getModifiers()))
-            return (int) staticFieldOffset(f);
-        else
-            return (int) objectFieldOffset(f);
-    }
-
-    /**
-     * Returns the base address for accessing some static field
-     * in the given class.  This method is implemented as follows:
-     * <blockquote><pre>
-     * public Object staticFieldBase(Class c) {
-     *     Field[] fields = c.getDeclaredFields();
-     *     for (int i = 0; i < fields.length; i++) {
-     *         if (Modifier.isStatic(fields[i].getModifiers())) {
-     *             return staticFieldBase(fields[i]);
-     *         }
-     *     }
-     *     return null;
-     * }
-     * </pre></blockquote>
-     * @deprecated As of 1.4.1, use {@link #staticFieldBase(Field)}
-     * to obtain the base pertaining to a specific {@link Field}.
-     * This method works only for JVMs which store all statics
-     * for a given class in one place.
-     */
-    @Deprecated
-    public Object staticFieldBase(Class<?> c) {
-        Field[] fields = c.getDeclaredFields();
-        for (int i = 0; i < fields.length; i++) {
-            if (Modifier.isStatic(fields[i].getModifiers())) {
-                return staticFieldBase(fields[i]);
-            }
-        }
-        return null;
-    }
-
-    /**
      * Report the location of a given field in the storage allocation of its
      * class.  Do not expect to perform any sort of arithmetic on this offset;
      * it is just a cookie which is passed to the unsafe heap memory accessors.
@@ -648,7 +430,7 @@
      * must preserve all bits of static field offsets.
      * @see #getInt(Object, long)
      */
-    public native long staticFieldOffset(Field f);
+    public native long objectFieldOffset(Field f);
 
     /**
      * Report the location of a given static field, in conjunction with {@link
@@ -667,7 +449,7 @@
      * this method reports its result as a long value.
      * @see #getInt(Object, long)
      */
-    public native long objectFieldOffset(Field f);
+    public native long staticFieldOffset(Field f);
 
     /**
      * Report the location of a given static field, in conjunction with {@link
@@ -748,7 +530,7 @@
      * Report the scale factor for addressing elements in the storage
      * allocation of a given array class.  However, arrays of "narrow" types
      * will generally not work properly with accessors like {@link
-     * #getByte(Object, int)}, so the scale factor for such classes is reported
+     * #getByte(Object, long)}, so the scale factor for such classes is reported
      * as zero.
      *
      * @see #arrayBaseOffset
@@ -1136,11 +918,11 @@
     public native void fullFence();
 
     /**
-     * Throws IllegalAccessError; for use by the VM.
+     * Throws IllegalAccessError; for use by the VM for access control
+     * error support.
      * @since 1.8
      */
     private static void throwIllegalAccessError() {
-       throw new IllegalAccessError();
+        throw new IllegalAccessError();
     }
-
 }
--- a/src/java.base/share/classes/sun/nio/cs/AbstractCharsetProvider.java	Thu Feb 19 11:24:03 2015 -0800
+++ b/src/java.base/share/classes/sun/nio/cs/AbstractCharsetProvider.java	Thu Feb 19 16:38:11 2015 -0800
@@ -111,6 +111,12 @@
         }
     }
 
+    protected boolean hasCharset(String name) {
+        synchronized (this) {
+            return classMap.containsKey(name);
+        }
+    }
+
     /* Late initialization hook, needed by some providers
      */
     protected void init() { }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/sun/nio/cs/DelegatableDecoder.java	Thu Feb 19 16:38:11 2015 -0800
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.nio.cs;
+
+import java.nio.ByteBuffer;
+import java.nio.CharBuffer;
+import java.nio.charset.CoderResult;
+
+/**
+ * A decoder that can be delegated to by another decoder
+ * when normal inheritance cannot be used.
+ * Used by autodecting decoders.
+ */
+public interface DelegatableDecoder {
+    CoderResult decodeLoop(ByteBuffer src, CharBuffer dst);
+    void implReset();
+    CoderResult implFlush(CharBuffer out);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/sun/nio/cs/DoubleByte.java	Thu Feb 19 16:38:11 2015 -0800
@@ -0,0 +1,929 @@
+/*
+ * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.nio.cs;
+
+import java.nio.ByteBuffer;
+import java.nio.CharBuffer;
+import java.nio.charset.Charset;
+import java.nio.charset.CharsetDecoder;
+import java.nio.charset.CharsetEncoder;
+import java.nio.charset.CoderResult;
+import java.util.Arrays;
+import sun.nio.cs.Surrogate;
+import sun.nio.cs.ArrayDecoder;
+import sun.nio.cs.ArrayEncoder;
+import static sun.nio.cs.CharsetMapping.*;
+
+/*
+ * Four types of "DoubleByte" charsets are implemented in this class
+ * (1)DoubleByte
+ *    The "mostly widely used" multibyte charset, a combination of
+ *    a singlebyte character set (usually the ASCII charset) and a
+ *    doublebyte character set. The codepoint values of singlebyte
+ *    and doublebyte don't overlap. Microsoft's multibyte charsets
+ *    and IBM's "DBCS_ASCII" charsets, such as IBM1381, 942, 943,
+ *    948, 949 and 950 are such charsets.
+ *
+ * (2)DoubleByte_EBCDIC
+ *    IBM EBCDIC Mix multibyte charset. Use SO and SI to shift (switch)
+ *    in and out between the singlebyte character set and doublebyte
+ *    character set.
+ *
+ * (3)DoubleByte_SIMPLE_EUC
+ *    It's a "simple" form of EUC encoding scheme, only have the
+ *    singlebyte character set G0 and one doublebyte character set
+ *    G1 are defined, G2 (with SS2) and G3 (with SS3) are not used.
+ *    So it is actually the same as the "typical" type (1) mentioned
+ *    above, except it return "malformed" for the SS2 and SS3 when
+ *    decoding.
+ *
+ * (4)DoubleByte ONLY
+ *    A "pure" doublebyte only character set. From implementation
+ *    point of view, this is the type (1) with "decodeSingle" always
+ *    returns unmappable.
+ *
+ * For simplicity, all implementations share the same decoding and
+ * encoding data structure.
+ *
+ * Decoding:
+ *
+ *    char[][] b2c;
+ *    char[] b2cSB;
+ *    int b2Min, b2Max
+ *
+ *    public char decodeSingle(int b) {
+ *        return b2cSB.[b];
+ *    }
+ *
+ *    public char decodeDouble(int b1, int b2) {
+ *        if (b2 < b2Min || b2 > b2Max)
+ *            return UNMAPPABLE_DECODING;
+ *         return b2c[b1][b2 - b2Min];
+ *    }
+ *
+ *    (1)b2Min, b2Max are the corresponding min and max value of the
+ *       low-half of the double-byte.
+ *    (2)The high 8-bit/b1 of the double-byte are used to indexed into
+ *       b2c array.
+ *
+ * Encoding:
+ *
+ *    char[] c2b;
+ *    char[] c2bIndex;
+ *
+ *    public int encodeChar(char ch) {
+ *        return c2b[c2bIndex[ch >> 8] + (ch & 0xff)];
+ *    }
+ *
+ */
+
+public class DoubleByte {
+
+    public final static char[] B2C_UNMAPPABLE;
+    static {
+        B2C_UNMAPPABLE = new char[0x100];
+        Arrays.fill(B2C_UNMAPPABLE, UNMAPPABLE_DECODING);
+    }
+
+    public static class Decoder extends CharsetDecoder
+                                implements DelegatableDecoder, ArrayDecoder
+    {
+        final char[][] b2c;
+        final char[] b2cSB;
+        final int b2Min;
+        final int b2Max;
+
+        // for SimpleEUC override
+        protected CoderResult crMalformedOrUnderFlow(int b) {
+            return CoderResult.UNDERFLOW;
+        }
+
+        protected CoderResult crMalformedOrUnmappable(int b1, int b2) {
+            if (b2c[b1] == B2C_UNMAPPABLE ||                // isNotLeadingByte(b1)
+                b2c[b2] != B2C_UNMAPPABLE ||                // isLeadingByte(b2)
+                decodeSingle(b2) != UNMAPPABLE_DECODING) {  // isSingle(b2)
+                return CoderResult.malformedForLength(1);
+            }
+            return CoderResult.unmappableForLength(2);
+        }
+
+        public Decoder(Charset cs, float avgcpb, float maxcpb,
+                       char[][] b2c, char[] b2cSB,
+                       int b2Min, int b2Max) {
+            super(cs, avgcpb, maxcpb);
+            this.b2c = b2c;
+            this.b2cSB = b2cSB;
+            this.b2Min = b2Min;
+            this.b2Max = b2Max;
+        }
+
+        public Decoder(Charset cs, char[][] b2c, char[] b2cSB, int b2Min, int b2Max) {
+            this(cs, 0.5f, 1.0f, b2c, b2cSB, b2Min, b2Max);
+        }
+
+        protected CoderResult decodeArrayLoop(ByteBuffer src, CharBuffer dst) {
+            byte[] sa = src.array();
+            int sp = src.arrayOffset() + src.position();
+            int sl = src.arrayOffset() + src.limit();
+
+            char[] da = dst.array();
+            int dp = dst.arrayOffset() + dst.position();
+            int dl = dst.arrayOffset() + dst.limit();
+
+            try {
+                while (sp < sl && dp < dl) {
+                    // inline the decodeSingle/Double() for better performance
+                    int inSize = 1;
+                    int b1 = sa[sp] & 0xff;
+                    char c = b2cSB[b1];
+                    if (c == UNMAPPABLE_DECODING) {
+                        if (sl - sp < 2)
+                            return crMalformedOrUnderFlow(b1);
+                        int b2 = sa[sp + 1] & 0xff;
+                        if (b2 < b2Min || b2 > b2Max ||
+                            (c = b2c[b1][b2 - b2Min]) == UNMAPPABLE_DECODING) {
+                            return crMalformedOrUnmappable(b1, b2);
+                        }
+                        inSize++;
+                    }
+                    da[dp++] = c;
+                    sp += inSize;
+                }
+                return (sp >= sl) ? CoderResult.UNDERFLOW
+                                  : CoderResult.OVERFLOW;
+            } finally {
+                src.position(sp - src.arrayOffset());
+                dst.position(dp - dst.arrayOffset());
+            }
+        }
+
+        protected CoderResult decodeBufferLoop(ByteBuffer src, CharBuffer dst) {
+            int mark = src.position();
+            try {
+
+                while (src.hasRemaining() && dst.hasRemaining()) {
+                    int b1 = src.get() & 0xff;
+                    char c = b2cSB[b1];
+                    int inSize = 1;
+                    if (c == UNMAPPABLE_DECODING) {
+                        if (src.remaining() < 1)
+                            return crMalformedOrUnderFlow(b1);
+                        int b2 = src.get() & 0xff;
+                        if (b2 < b2Min || b2 > b2Max ||
+                            (c = b2c[b1][b2 - b2Min]) == UNMAPPABLE_DECODING)
+                            return crMalformedOrUnmappable(b1, b2);
+                        inSize++;
+                    }
+                    dst.put(c);
+                    mark += inSize;
+                }
+                return src.hasRemaining()? CoderResult.OVERFLOW
+                                         : CoderResult.UNDERFLOW;
+            } finally {
+                src.position(mark);
+            }
+        }
+
+        // Make some protected methods public for use by JISAutoDetect
+        public CoderResult decodeLoop(ByteBuffer src, CharBuffer dst) {
+            if (src.hasArray() && dst.hasArray())
+                return decodeArrayLoop(src, dst);
+            else
+                return decodeBufferLoop(src, dst);
+        }
+
+        public int decode(byte[] src, int sp, int len, char[] dst) {
+            int dp = 0;
+            int sl = sp + len;
+            char repl = replacement().charAt(0);
+            while (sp < sl) {
+                int b1 = src[sp++] & 0xff;
+                char c = b2cSB[b1];
+                if (c == UNMAPPABLE_DECODING) {
+                    if (sp < sl) {
+                        int b2 = src[sp++] & 0xff;
+                        if (b2 < b2Min || b2 > b2Max ||
+                            (c = b2c[b1][b2 - b2Min]) == UNMAPPABLE_DECODING) {
+                            if (b2c[b1] == B2C_UNMAPPABLE ||  // isNotLeadingByte
+                                b2c[b2] != B2C_UNMAPPABLE ||  // isLeadingByte
+                                decodeSingle(b2) != UNMAPPABLE_DECODING) {
+                                sp--;
+                            }
+                        }
+                    }
+                    if (c == UNMAPPABLE_DECODING) {
+                        c = repl;
+                    }
+                }
+                dst[dp++] = c;
+            }
+            return dp;
+        }
+
+        public void implReset() {
+            super.implReset();
+        }
+
+        public CoderResult implFlush(CharBuffer out) {
+            return super.implFlush(out);
+        }
+
+        // decode loops are not using decodeSingle/Double() for performance
+        // reason.
+        public char decodeSingle(int b) {
+            return b2cSB[b];
+        }
+
+        public char decodeDouble(int b1, int b2) {
+            if (b1 < 0 || b1 > b2c.length ||
+                b2 < b2Min || b2 > b2Max)
+                return UNMAPPABLE_DECODING;
+            return  b2c[b1][b2 - b2Min];
+        }
+    }
+
+    // IBM_EBCDIC_DBCS
+    public static class Decoder_EBCDIC extends Decoder {
+        private static final int SBCS = 0;
+        private static final int DBCS = 1;
+        private static final int SO = 0x0e;
+        private static final int SI = 0x0f;
+        private int  currentState;
+
+        public Decoder_EBCDIC(Charset cs,
+                       char[][] b2c, char[] b2cSB, int b2Min, int b2Max) {
+            super(cs, b2c, b2cSB, b2Min, b2Max);
+        }
+
+        public void implReset() {
+            currentState = SBCS;
+        }
+
+        // Check validity of dbcs ebcdic byte pair values
+        //
+        // First byte : 0x41 -- 0xFE
+        // Second byte: 0x41 -- 0xFE
+        // Doublebyte blank: 0x4040
+        //
+        // The validation implementation in "old" DBCS_IBM_EBCDIC and sun.io
+        // as
+        //            if ((b1 != 0x40 || b2 != 0x40) &&
+        //                (b2 < 0x41 || b2 > 0xfe)) {...}
+        // is not correct/complete (range check for b1)
+        //
+        private static boolean isDoubleByte(int b1, int b2) {
+            return (0x41 <= b1 && b1 <= 0xfe && 0x41 <= b2 && b2 <= 0xfe)
+                   || (b1 == 0x40 && b2 == 0x40); // DBCS-HOST SPACE
+        }
+
+        protected CoderResult decodeArrayLoop(ByteBuffer src, CharBuffer dst) {
+            byte[] sa = src.array();
+            int sp = src.arrayOffset() + src.position();
+            int sl = src.arrayOffset() + src.limit();
+            char[] da = dst.array();
+            int dp = dst.arrayOffset() + dst.position();
+            int dl = dst.arrayOffset() + dst.limit();
+
+            try {
+                // don't check dp/dl together here, it's possible to
+                // decdoe a SO/SI without space in output buffer.
+                while (sp < sl) {
+                    int b1 = sa[sp] & 0xff;
+                    int inSize = 1;
+                    if (b1 == SO) {  // Shift out
+                        if (currentState != SBCS)
+                            return CoderResult.malformedForLength(1);
+                        else
+                            currentState = DBCS;
+                    } else if (b1 == SI) {
+                        if (currentState != DBCS)
+                            return CoderResult.malformedForLength(1);
+                        else
+                            currentState = SBCS;
+                    } else {
+                        char c =  UNMAPPABLE_DECODING;
+                        if (currentState == SBCS) {
+                            c = b2cSB[b1];
+                            if (c == UNMAPPABLE_DECODING)
+                                return CoderResult.unmappableForLength(1);
+                        } else {
+                            if (sl - sp < 2)
+                                return CoderResult.UNDERFLOW;
+                            int b2 = sa[sp + 1] & 0xff;
+                            if (b2 < b2Min || b2 > b2Max ||
+                                (c = b2c[b1][b2 - b2Min]) == UNMAPPABLE_DECODING) {
+                                if (!isDoubleByte(b1, b2))
+                                    return CoderResult.malformedForLength(2);
+                                return CoderResult.unmappableForLength(2);
+                            }
+                            inSize++;
+                        }
+                        if (dl - dp < 1)
+                            return CoderResult.OVERFLOW;
+
+                        da[dp++] = c;
+                    }
+                    sp += inSize;
+                }
+                return CoderResult.UNDERFLOW;
+            } finally {
+                src.position(sp - src.arrayOffset());
+                dst.position(dp - dst.arrayOffset());
+            }
+        }
+
+        protected CoderResult decodeBufferLoop(ByteBuffer src, CharBuffer dst) {
+            int mark = src.position();
+            try {
+                while (src.hasRemaining()) {
+                    int b1 = src.get() & 0xff;
+                    int inSize = 1;
+                    if (b1 == SO) {  // Shift out
+                        if (currentState != SBCS)
+                            return CoderResult.malformedForLength(1);
+                        else
+                            currentState = DBCS;
+                    } else if (b1 == SI) {
+                        if (currentState != DBCS)
+                            return CoderResult.malformedForLength(1);
+                        else
+                            currentState = SBCS;
+                    } else {
+                        char c = UNMAPPABLE_DECODING;
+                        if (currentState == SBCS) {
+                            c = b2cSB[b1];
+                            if (c == UNMAPPABLE_DECODING)
+                                return CoderResult.unmappableForLength(1);
+                        } else {
+                            if (src.remaining() < 1)
+                                return CoderResult.UNDERFLOW;
+                            int b2 = src.get()&0xff;
+                            if (b2 < b2Min || b2 > b2Max ||
+                                (c = b2c[b1][b2 - b2Min]) == UNMAPPABLE_DECODING) {
+                                if (!isDoubleByte(b1, b2))
+                                    return CoderResult.malformedForLength(2);
+                                return CoderResult.unmappableForLength(2);
+                            }
+                            inSize++;
+                        }
+
+                        if (dst.remaining() < 1)
+                            return CoderResult.OVERFLOW;
+
+                        dst.put(c);
+                    }
+                    mark += inSize;
+                }
+                return CoderResult.UNDERFLOW;
+            } finally {
+                src.position(mark);
+            }
+        }
+
+        public int decode(byte[] src, int sp, int len, char[] dst) {
+            int dp = 0;
+            int sl = sp + len;
+            currentState = SBCS;
+            char repl = replacement().charAt(0);
+            while (sp < sl) {
+                int b1 = src[sp++] & 0xff;
+                if (b1 == SO) {  // Shift out
+                    if (currentState != SBCS)
+                        dst[dp++] = repl;
+                    else
+                        currentState = DBCS;
+                } else if (b1 == SI) {
+                    if (currentState != DBCS)
+                        dst[dp++] = repl;
+                    else
+                        currentState = SBCS;
+                } else {
+                    char c =  UNMAPPABLE_DECODING;
+                    if (currentState == SBCS) {
+                        c = b2cSB[b1];
+                        if (c == UNMAPPABLE_DECODING)
+                            c = repl;
+                    } else {
+                        if (sl == sp) {
+                            c = repl;
+                        } else {
+                            int b2 = src[sp++] & 0xff;
+                            if (b2 < b2Min || b2 > b2Max ||
+                                (c = b2c[b1][b2 - b2Min]) == UNMAPPABLE_DECODING) {
+                                c = repl;
+                            }
+                        }
+                    }
+                    dst[dp++] = c;
+                }
+            }
+            return dp;
+        }
+    }
+
+    // DBCS_ONLY
+    public static class Decoder_DBCSONLY extends Decoder {
+        static final char[] b2cSB_UNMAPPABLE;
+        static {
+            b2cSB_UNMAPPABLE = new char[0x100];
+            Arrays.fill(b2cSB_UNMAPPABLE, UNMAPPABLE_DECODING);
+        }
+        public Decoder_DBCSONLY(Charset cs, char[][] b2c, char[] b2cSB, int b2Min, int b2Max) {
+            super(cs, 0.5f, 1.0f, b2c, b2cSB_UNMAPPABLE, b2Min, b2Max);
+        }
+    }
+
+    // EUC_SIMPLE
+    // The only thing we need to "override" is to check SS2/SS3 and
+    // return "malformed" if found
+    public static class Decoder_EUC_SIM extends Decoder {
+        private final int SS2 =  0x8E;
+        private final int SS3 =  0x8F;
+
+        public Decoder_EUC_SIM(Charset cs,
+                        char[][] b2c, char[] b2cSB, int b2Min, int b2Max) {
+            super(cs, b2c, b2cSB, b2Min, b2Max);
+        }
+
+        // No support provided for G2/G3 for SimpleEUC
+        protected CoderResult crMalformedOrUnderFlow(int b) {
+            if (b == SS2 || b == SS3 )
+                return CoderResult.malformedForLength(1);
+            return CoderResult.UNDERFLOW;
+        }
+
+        protected CoderResult crMalformedOrUnmappable(int b1, int b2) {
+            if (b1 == SS2 || b1 == SS3 )
+                return CoderResult.malformedForLength(1);
+            return CoderResult.unmappableForLength(2);
+        }
+
+        public int decode(byte[] src, int sp, int len, char[] dst) {
+            int dp = 0;
+            int sl = sp + len;
+            char repl = replacement().charAt(0);
+            while (sp < sl) {
+                int b1 = src[sp++] & 0xff;
+                char c = b2cSB[b1];
+                if (c == UNMAPPABLE_DECODING) {
+                    if (sp < sl) {
+                        int b2 = src[sp++] & 0xff;
+                        if (b2 < b2Min || b2 > b2Max ||
+                            (c = b2c[b1][b2 - b2Min]) == UNMAPPABLE_DECODING) {
+                            if (b1 == SS2 || b1 == SS3) {
+                                sp--;
+                            }
+                            c = repl;
+                        }
+                    } else {
+                        c = repl;
+                    }
+                }
+                dst[dp++] = c;
+            }
+            return dp;
+        }
+    }
+
+    public static class Encoder extends CharsetEncoder
+                                implements ArrayEncoder
+    {
+        protected final int MAX_SINGLEBYTE = 0xff;
+        private final char[] c2b;
+        private final char[] c2bIndex;
+        protected Surrogate.Parser sgp;
+
+        public Encoder(Charset cs, char[] c2b, char[] c2bIndex) {
+            super(cs, 2.0f, 2.0f);
+            this.c2b = c2b;
+            this.c2bIndex = c2bIndex;
+        }
+
+        public Encoder(Charset cs, float avg, float max, byte[] repl, char[] c2b, char[] c2bIndex) {
+            super(cs, avg, max, repl);
+            this.c2b = c2b;
+            this.c2bIndex = c2bIndex;
+        }
+
+        public boolean canEncode(char c) {
+            return encodeChar(c) != UNMAPPABLE_ENCODING;
+        }
+
+        protected Surrogate.Parser sgp() {
+            if (sgp == null)
+                sgp = new Surrogate.Parser();
+            return sgp;
+        }
+
+        protected CoderResult encodeArrayLoop(CharBuffer src, ByteBuffer dst) {
+            char[] sa = src.array();
+            int sp = src.arrayOffset() + src.position();
+            int sl = src.arrayOffset() + src.limit();
+
+            byte[] da = dst.array();
+            int dp = dst.arrayOffset() + dst.position();
+            int dl = dst.arrayOffset() + dst.limit();
+
+            try {
+                while (sp < sl) {
+                    char c = sa[sp];
+                    int bb = encodeChar(c);
+                    if (bb == UNMAPPABLE_ENCODING) {
+                        if (Character.isSurrogate(c)) {
+                            if (sgp().parse(c, sa, sp, sl) < 0)
+                                return sgp.error();
+                            return sgp.unmappableResult();
+                        }
+                        return CoderResult.unmappableForLength(1);
+                    }
+
+                    if (bb > MAX_SINGLEBYTE) {    // DoubleByte
+                        if (dl - dp < 2)
+                            return CoderResult.OVERFLOW;
+                        da[dp++] = (byte)(bb >> 8);
+                        da[dp++] = (byte)bb;
+                    } else {                      // SingleByte
+                        if (dl - dp < 1)
+                            return CoderResult.OVERFLOW;
+                        da[dp++] = (byte)bb;
+                    }
+
+                    sp++;
+                }
+                return CoderResult.UNDERFLOW;
+            } finally {
+                src.position(sp - src.arrayOffset());
+                dst.position(dp - dst.arrayOffset());
+            }
+        }
+
+        protected CoderResult encodeBufferLoop(CharBuffer src, ByteBuffer dst) {
+            int mark = src.position();
+            try {
+                while (src.hasRemaining()) {
+                    char c = src.get();
+                    int bb = encodeChar(c);
+                    if (bb == UNMAPPABLE_ENCODING) {
+                        if (Character.isSurrogate(c)) {
+                            if (sgp().parse(c, src) < 0)
+                                return sgp.error();
+                            return sgp.unmappableResult();
+                        }
+                        return CoderResult.unmappableForLength(1);
+                    }
+                    if (bb > MAX_SINGLEBYTE) {  // DoubleByte
+                        if (dst.remaining() < 2)
+                            return CoderResult.OVERFLOW;
+                        dst.put((byte)(bb >> 8));
+                        dst.put((byte)(bb));
+                    } else {
+                        if (dst.remaining() < 1)
+                        return CoderResult.OVERFLOW;
+                        dst.put((byte)bb);
+                    }
+                    mark++;
+                }
+                return CoderResult.UNDERFLOW;
+            } finally {
+                src.position(mark);
+            }
+        }
+
+        protected CoderResult encodeLoop(CharBuffer src, ByteBuffer dst) {
+            if (src.hasArray() && dst.hasArray())
+                return encodeArrayLoop(src, dst);
+            else
+                return encodeBufferLoop(src, dst);
+        }
+
+        protected byte[] repl = replacement();
+        protected void implReplaceWith(byte[] newReplacement) {
+            repl = newReplacement;
+        }
+
+        public int encode(char[] src, int sp, int len, byte[] dst) {
+            int dp = 0;
+            int sl = sp + len;
+            int dl = dst.length;
+            while (sp < sl) {
+                char c = src[sp++];
+                int bb = encodeChar(c);
+                if (bb == UNMAPPABLE_ENCODING) {
+                    if (Character.isHighSurrogate(c) && sp < sl &&
+                        Character.isLowSurrogate(src[sp])) {
+                        sp++;
+                    }
+                    dst[dp++] = repl[0];
+                    if (repl.length > 1)
+                        dst[dp++] = repl[1];
+                    continue;
+                } //else
+                if (bb > MAX_SINGLEBYTE) { // DoubleByte
+                    dst[dp++] = (byte)(bb >> 8);
+                    dst[dp++] = (byte)bb;
+                } else {                          // SingleByte
+                    dst[dp++] = (byte)bb;
+                }
+
+            }
+            return dp;
+        }
+
+        public int encodeChar(char ch) {
+            return c2b[c2bIndex[ch >> 8] + (ch & 0xff)];
+        }
+
+        // init the c2b and c2bIndex tables from b2c.
+        public static void initC2B(String[] b2c, String b2cSB, String b2cNR,  String c2bNR,
+                            int b2Min, int b2Max,
+                            char[] c2b, char[] c2bIndex)
+        {
+            Arrays.fill(c2b, (char)UNMAPPABLE_ENCODING);
+            int off = 0x100;
+
+            char[][] b2c_ca = new char[b2c.length][];
+            char[] b2cSB_ca = null;
+            if (b2cSB != null)
+                b2cSB_ca = b2cSB.toCharArray();
+
+            for (int i = 0; i < b2c.length; i++) {
+                if (b2c[i] == null)
+                    continue;
+                b2c_ca[i] = b2c[i].toCharArray();
+            }
+
+            if (b2cNR != null) {
+                int j = 0;
+                while (j < b2cNR.length()) {
+                    char b  = b2cNR.charAt(j++);
+                    char c  = b2cNR.charAt(j++);
+                    if (b < 0x100 && b2cSB_ca != null) {
+                        if (b2cSB_ca[b] == c)
+                            b2cSB_ca[b] = UNMAPPABLE_DECODING;
+                    } else {
+                        if (b2c_ca[b >> 8][(b & 0xff) - b2Min] == c)
+                            b2c_ca[b >> 8][(b & 0xff) - b2Min] = UNMAPPABLE_DECODING;
+                    }
+                }
+            }
+
+            if (b2cSB_ca != null) {      // SingleByte
+                for (int b = 0; b < b2cSB_ca.length; b++) {
+                    char c = b2cSB_ca[b];
+                    if (c == UNMAPPABLE_DECODING)
+                        continue;
+                    int index = c2bIndex[c >> 8];
+                    if (index == 0) {
+                        index = off;
+                        off += 0x100;
+                        c2bIndex[c >> 8] = (char)index;
+                    }
+                    c2b[index + (c & 0xff)] = (char)b;
+                }
+            }
+
+            for (int b1 = 0; b1 < b2c.length; b1++) {  // DoubleByte
+                char[] db = b2c_ca[b1];
+                if (db == null)
+                    continue;
+                for (int b2 = b2Min; b2 <= b2Max; b2++) {
+                    char c = db[b2 - b2Min];
+                    if (c == UNMAPPABLE_DECODING)
+                        continue;
+                    int index = c2bIndex[c >> 8];
+                    if (index == 0) {
+                        index = off;
+                        off += 0x100;
+                        c2bIndex[c >> 8] = (char)index;
+                    }
+                    c2b[index + (c & 0xff)] = (char)((b1 << 8) | b2);
+                }
+            }
+
+            if (c2bNR != null) {
+                // add c->b only nr entries
+                for (int i = 0; i < c2bNR.length(); i += 2) {
+                    char b = c2bNR.charAt(i);
+                    char c = c2bNR.charAt(i + 1);
+                    int index = (c >> 8);
+                    if (c2bIndex[index] == 0) {
+                        c2bIndex[index] = (char)off;
+                        off += 0x100;
+                    }
+                    index = c2bIndex[index] + (c & 0xff);
+                    c2b[index] = b;
+                }
+            }
+        }
+    }
+
+    public static class Encoder_DBCSONLY extends Encoder {
+        public Encoder_DBCSONLY(Charset cs, byte[] repl,
+                         char[] c2b, char[] c2bIndex) {
+            super(cs, 2.0f, 2.0f, repl, c2b, c2bIndex);
+        }
+
+        public int encodeChar(char ch) {
+            int bb = super.encodeChar(ch);
+            if (bb <= MAX_SINGLEBYTE)
+                return UNMAPPABLE_ENCODING;
+            return bb;
+        }
+    }
+
+
+
+    public static class Encoder_EBCDIC extends Encoder {
+        static final int SBCS = 0;
+        static final int DBCS = 1;
+        static final byte SO = 0x0e;
+        static final byte SI = 0x0f;
+
+        protected int  currentState = SBCS;
+
+        public Encoder_EBCDIC(Charset cs, char[] c2b, char[] c2bIndex) {
+            super(cs, 4.0f, 5.0f, new byte[] {(byte)0x6f}, c2b, c2bIndex);
+        }
+
+        protected void implReset() {
+            currentState = SBCS;
+        }
+
+        protected CoderResult implFlush(ByteBuffer out) {
+            if (currentState == DBCS) {
+                if (out.remaining() < 1)
+                    return CoderResult.OVERFLOW;
+                out.put(SI);
+            }
+            implReset();
+            return CoderResult.UNDERFLOW;
+        }
+
+        protected CoderResult encodeArrayLoop(CharBuffer src, ByteBuffer dst) {
+            char[] sa = src.array();
+            int sp = src.arrayOffset() + src.position();
+            int sl = src.arrayOffset() + src.limit();
+            byte[] da = dst.array();
+            int dp = dst.arrayOffset() + dst.position();
+            int dl = dst.arrayOffset() + dst.limit();
+
+            try {
+                while (sp < sl) {
+                    char c = sa[sp];
+                    int bb = encodeChar(c);
+                    if (bb == UNMAPPABLE_ENCODING) {
+                        if (Character.isSurrogate(c)) {
+                            if (sgp().parse(c, sa, sp, sl) < 0)
+                                return sgp.error();
+                            return sgp.unmappableResult();
+                        }
+                        return CoderResult.unmappableForLength(1);
+                    }
+                    if (bb > MAX_SINGLEBYTE) {  // DoubleByte
+                        if (currentState == SBCS) {
+                            if (dl - dp < 1)
+                                return CoderResult.OVERFLOW;
+                            currentState = DBCS;
+                            da[dp++] = SO;
+                        }
+                        if (dl - dp < 2)
+                            return CoderResult.OVERFLOW;
+                        da[dp++] = (byte)(bb >> 8);
+                        da[dp++] = (byte)bb;
+                    } else {                    // SingleByte
+                        if (currentState == DBCS) {
+                            if (dl - dp < 1)
+                                return CoderResult.OVERFLOW;
+                            currentState = SBCS;
+                            da[dp++] = SI;
+                        }
+                        if (dl - dp < 1)
+                            return CoderResult.OVERFLOW;
+                        da[dp++] = (byte)bb;
+
+                    }
+                    sp++;
+                }
+                return CoderResult.UNDERFLOW;
+            } finally {
+                src.position(sp - src.arrayOffset());
+                dst.position(dp - dst.arrayOffset());
+            }
+        }
+
+        protected CoderResult encodeBufferLoop(CharBuffer src, ByteBuffer dst) {
+            int mark = src.position();
+            try {
+                while (src.hasRemaining()) {
+                    char c = src.get();
+                    int bb = encodeChar(c);
+                    if (bb == UNMAPPABLE_ENCODING) {
+                        if (Character.isSurrogate(c)) {
+                            if (sgp().parse(c, src) < 0)
+                                return sgp.error();
+                            return sgp.unmappableResult();
+                        }
+                        return CoderResult.unmappableForLength(1);
+                    }
+                    if (bb > MAX_SINGLEBYTE) {  // DoubleByte
+                        if (currentState == SBCS) {
+                            if (dst.remaining() < 1)
+                                return CoderResult.OVERFLOW;
+                            currentState = DBCS;
+                            dst.put(SO);
+                        }
+                        if (dst.remaining() < 2)
+                            return CoderResult.OVERFLOW;
+                        dst.put((byte)(bb >> 8));
+                        dst.put((byte)(bb));
+                    } else {                  // Single-byte
+                        if (currentState == DBCS) {
+                            if (dst.remaining() < 1)
+                                return CoderResult.OVERFLOW;
+                            currentState = SBCS;
+                            dst.put(SI);
+                        }
+                        if (dst.remaining() < 1)
+                            return CoderResult.OVERFLOW;
+                        dst.put((byte)bb);
+                    }
+                    mark++;
+                }
+                return CoderResult.UNDERFLOW;
+            } finally {
+                src.position(mark);
+            }
+        }
+
+        public int encode(char[] src, int sp, int len, byte[] dst) {
+            int dp = 0;
+            int sl = sp + len;
+            while (sp < sl) {
+                char c = src[sp++];
+                int bb = encodeChar(c);
+
+                if (bb == UNMAPPABLE_ENCODING) {
+                    if (Character.isHighSurrogate(c) && sp < sl &&
+                        Character.isLowSurrogate(src[sp])) {
+                        sp++;
+                    }
+                    dst[dp++] = repl[0];
+                    if (repl.length > 1)
+                        dst[dp++] = repl[1];
+                    continue;
+                } //else
+                if (bb > MAX_SINGLEBYTE) {           // DoubleByte
+                    if (currentState == SBCS) {
+                        currentState = DBCS;
+                        dst[dp++] = SO;
+                    }
+                    dst[dp++] = (byte)(bb >> 8);
+                    dst[dp++] = (byte)bb;
+                } else {                             // SingleByte
+                    if (currentState == DBCS) {
+                         currentState = SBCS;
+                         dst[dp++] = SI;
+                    }
+                    dst[dp++] = (byte)bb;
+                }
+            }
+
+            if (currentState == DBCS) {
+                 currentState = SBCS;
+                 dst[dp++] = SI;
+            }
+            return dp;
+        }
+    }
+
+    // EUC_SIMPLE
+    public static class Encoder_EUC_SIM extends Encoder {
+        public Encoder_EUC_SIM(Charset cs, char[] c2b, char[] c2bIndex) {
+            super(cs, c2b, c2bIndex);
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/sun/nio/cs/HKSCS.java	Thu Feb 19 16:38:11 2015 -0800
@@ -0,0 +1,434 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.nio.cs;
+
+import java.nio.ByteBuffer;
+import java.nio.CharBuffer;
+import java.nio.charset.Charset;
+import java.nio.charset.CharsetDecoder;
+import java.nio.charset.CharsetEncoder;
+import java.nio.charset.CoderResult;
+import java.util.Arrays;
+import sun.nio.cs.DoubleByte;
+import sun.nio.cs.Surrogate;
+import static sun.nio.cs.CharsetMapping.*;
+
+public class HKSCS {
+
+    public static class Decoder extends DoubleByte.Decoder {
+        static int b2Min = 0x40;
+        static int b2Max = 0xfe;
+
+        private char[][] b2cBmp;
+        private char[][] b2cSupp;
+        private DoubleByte.Decoder big5Dec;
+
+        protected Decoder(Charset cs,
+                          DoubleByte.Decoder big5Dec,
+                          char[][] b2cBmp, char[][] b2cSupp)
+        {
+            // super(cs, 0.5f, 1.0f);
+            // need to extends DoubleByte.Decoder so the
+            // sun.io can use it. this implementation
+            super(cs, 0.5f, 1.0f, null, null, 0, 0);
+            this.big5Dec = big5Dec;
+            this.b2cBmp = b2cBmp;
+            this.b2cSupp = b2cSupp;
+        }
+
+        public char decodeSingle(int b) {
+            return big5Dec.decodeSingle(b);
+        }
+
+        public char decodeBig5(int b1, int b2) {
+            return big5Dec.decodeDouble(b1, b2);
+        }
+
+        public char decodeDouble(int b1, int b2) {
+            return b2cBmp[b1][b2 - b2Min];
+        }
+
+        public char decodeDoubleEx(int b1, int b2) {
+            /* if the b2cSupp is null, the subclass need
+               to override the methold
+            if (b2cSupp == null)
+                return UNMAPPABLE_DECODING;
+             */
+            return b2cSupp[b1][b2 - b2Min];
+        }
+
+        protected CoderResult decodeArrayLoop(ByteBuffer src, CharBuffer dst) {
+            byte[] sa = src.array();
+            int sp = src.arrayOffset() + src.position();
+            int sl = src.arrayOffset() + src.limit();
+
+            char[] da = dst.array();
+            int dp = dst.arrayOffset() + dst.position();
+            int dl = dst.arrayOffset() + dst.limit();
+
+            try {
+                while (sp < sl) {
+                    int b1 = sa[sp] & 0xff;
+                    char c = decodeSingle(b1);
+                    int inSize = 1, outSize = 1;
+                    char[] cc = null;
+                    if (c == UNMAPPABLE_DECODING) {
+                        if (sl - sp < 2)
+                            return CoderResult.UNDERFLOW;
+                        int b2 = sa[sp + 1] & 0xff;
+                        inSize++;
+                        if (b2 < b2Min || b2 > b2Max)
+                            return CoderResult.unmappableForLength(2);
+                        c = decodeDouble(b1, b2);           //bmp
+                        if (c == UNMAPPABLE_DECODING) {
+                            c = decodeDoubleEx(b1, b2);     //supp
+                            if (c == UNMAPPABLE_DECODING) {
+                                c = decodeBig5(b1, b2);     //big5
+                                if (c == UNMAPPABLE_DECODING)
+                                    return CoderResult.unmappableForLength(2);
+                            } else {
+                                // supplementary character in u+2xxxx area
+                                outSize = 2;
+                            }
+                        }
+                    }
+                    if (dl - dp < outSize)
+                        return CoderResult.OVERFLOW;
+                    if (outSize == 2) {
+                        // supplementary characters
+                        da[dp++] = Surrogate.high(0x20000 + c);
+                        da[dp++] = Surrogate.low(0x20000 + c);
+                    } else {
+                        da[dp++] = c;
+                    }
+                    sp += inSize;
+                }
+                return CoderResult.UNDERFLOW;
+            } finally {
+                src.position(sp - src.arrayOffset());
+                dst.position(dp - dst.arrayOffset());
+            }
+        }
+
+        protected CoderResult decodeBufferLoop(ByteBuffer src, CharBuffer dst) {
+            int mark = src.position();
+            try {
+                while (src.hasRemaining()) {
+                    char[] cc = null;
+                    int b1 = src.get() & 0xff;
+                    int inSize = 1, outSize = 1;
+                    char c = decodeSingle(b1);
+                    if (c == UNMAPPABLE_DECODING) {
+                        if (src.remaining() < 1)
+                            return CoderResult.UNDERFLOW;
+                        int b2 = src.get() & 0xff;
+                        inSize++;
+                        if (b2 < b2Min || b2 > b2Max)
+                            return CoderResult.unmappableForLength(2);
+                        c = decodeDouble(b1, b2);           //bmp
+                        if (c == UNMAPPABLE_DECODING) {
+                            c = decodeDoubleEx(b1, b2);     //supp
+                            if (c == UNMAPPABLE_DECODING) {
+                                c = decodeBig5(b1, b2);     //big5
+                                if (c == UNMAPPABLE_DECODING)
+                                    return CoderResult.unmappableForLength(2);
+                            } else {
+                                outSize = 2;
+                            }
+                        }
+                    }
+                    if (dst.remaining() < outSize)
+                        return CoderResult.OVERFLOW;
+                    if (outSize == 2) {
+                        dst.put(Surrogate.high(0x20000 + c));
+                        dst.put(Surrogate.low(0x20000 + c));
+                    } else {
+                        dst.put(c);
+                    }
+                    mark += inSize;
+                }
+                return CoderResult.UNDERFLOW;
+            } finally {
+                src.position(mark);
+            }
+        }
+
+        public int decode(byte[] src, int sp, int len, char[] dst) {
+            int dp = 0;
+            int sl = sp + len;
+            char repl = replacement().charAt(0);
+            while (sp < sl) {
+                int b1 = src[sp++] & 0xff;
+                char c = decodeSingle(b1);
+                if (c == UNMAPPABLE_DECODING) {
+                    if (sl == sp) {
+                        c = repl;
+                    } else {
+                        int b2 = src[sp++] & 0xff;
+                        if (b2 < b2Min || b2 > b2Max) {
+                            c = repl;
+                        } else if ((c = decodeDouble(b1, b2)) == UNMAPPABLE_DECODING) {
+                            c = decodeDoubleEx(b1, b2);     //supp
+                            if (c == UNMAPPABLE_DECODING) {
+                                c = decodeBig5(b1, b2);     //big5
+                                if (c == UNMAPPABLE_DECODING)
+                                    c = repl;
+                            } else {
+                                // supplementary character in u+2xxxx area
+                                dst[dp++] = Surrogate.high(0x20000 + c);
+                                dst[dp++] = Surrogate.low(0x20000 + c);
+                                continue;
+                            }
+                        }
+                    }
+                }
+                dst[dp++] = c;
+            }
+            return dp;
+        }
+
+        public CoderResult decodeLoop(ByteBuffer src, CharBuffer dst) {
+            if (src.hasArray() && dst.hasArray())
+                return decodeArrayLoop(src, dst);
+            else
+                return decodeBufferLoop(src, dst);
+        }
+
+        public static void initb2c(char[][]b2c, String[] b2cStr)
+        {
+            for (int i = 0; i < b2cStr.length; i++) {
+                if (b2cStr[i] == null)
+                    b2c[i] = DoubleByte.B2C_UNMAPPABLE;
+                else
+                    b2c[i] = b2cStr[i].toCharArray();
+            }
+        }
+
+    }
+
+    public static class Encoder extends DoubleByte.Encoder {
+        private DoubleByte.Encoder big5Enc;
+        private char[][] c2bBmp;
+        private char[][] c2bSupp;
+
+        protected Encoder(Charset cs,
+                          DoubleByte.Encoder big5Enc,
+                          char[][] c2bBmp,
+                          char[][] c2bSupp)
+        {
+            super(cs, null, null);
+            this.big5Enc = big5Enc;
+            this.c2bBmp = c2bBmp;
+            this.c2bSupp = c2bSupp;
+        }
+
+        public int encodeBig5(char ch) {
+            return big5Enc.encodeChar(ch);
+        }
+
+        public int encodeChar(char ch) {
+            int bb = c2bBmp[ch >> 8][ch & 0xff];
+            if (bb == UNMAPPABLE_ENCODING)
+                return encodeBig5(ch);
+            return bb;
+        }
+
+        public int encodeSupp(int cp) {
+            if ((cp & 0xf0000) != 0x20000)
+                return UNMAPPABLE_ENCODING;
+            return c2bSupp[(cp >> 8) & 0xff][cp & 0xff];
+        }
+
+        public boolean canEncode(char c) {
+            return encodeChar(c) != UNMAPPABLE_ENCODING;
+        }
+
+        protected CoderResult encodeArrayLoop(CharBuffer src, ByteBuffer dst) {
+            char[] sa = src.array();
+            int sp = src.arrayOffset() + src.position();
+            int sl = src.arrayOffset() + src.limit();
+
+            byte[] da = dst.array();
+            int dp = dst.arrayOffset() + dst.position();
+            int dl = dst.arrayOffset() + dst.limit();
+
+            try {
+                while (sp < sl) {
+                    char c = sa[sp];
+                    int inSize = 1;
+                    int bb = encodeChar(c);
+                    if (bb == UNMAPPABLE_ENCODING) {
+                        if (Character.isSurrogate(c)) {
+                            int cp;
+                            if ((cp = sgp().parse(c, sa, sp, sl)) < 0)
+                                return sgp.error();
+                            bb = encodeSupp(cp);
+                            if (bb == UNMAPPABLE_ENCODING)
+                                return CoderResult.unmappableForLength(2);
+                            inSize = 2;
+                        } else {
+                            return CoderResult.unmappableForLength(1);
+                        }
+                    }
+                    if (bb > MAX_SINGLEBYTE) {    // DoubleByte
+                        if (dl - dp < 2)
+                            return CoderResult.OVERFLOW;
+                        da[dp++] = (byte)(bb >> 8);
+                        da[dp++] = (byte)bb;
+                    } else {                      // SingleByte
+                        if (dl - dp < 1)
+                            return CoderResult.OVERFLOW;
+                        da[dp++] = (byte)bb;
+                    }
+                    sp += inSize;
+                }
+                return CoderResult.UNDERFLOW;
+            } finally {
+                src.position(sp - src.arrayOffset());
+                dst.position(dp - dst.arrayOffset());
+            }
+        }
+
+        protected CoderResult encodeBufferLoop(CharBuffer src, ByteBuffer dst) {
+            int mark = src.position();
+            try {
+                while (src.hasRemaining()) {
+                    int inSize = 1;
+                    char c = src.get();
+                    int bb = encodeChar(c);
+                    if (bb == UNMAPPABLE_ENCODING) {
+                        if (Character.isSurrogate(c)) {
+                            int cp;
+                            if ((cp = sgp().parse(c, src)) < 0)
+                                return sgp.error();
+                            bb = encodeSupp(cp);
+                            if (bb == UNMAPPABLE_ENCODING)
+                                return CoderResult.unmappableForLength(2);
+                            inSize = 2;
+                        } else {
+                            return CoderResult.unmappableForLength(1);
+                        }
+                    }
+                    if (bb > MAX_SINGLEBYTE) {  // DoubleByte
+                        if (dst.remaining() < 2)
+                            return CoderResult.OVERFLOW;
+                        dst.put((byte)(bb >> 8));
+                        dst.put((byte)(bb));
+                    } else {
+                        if (dst.remaining() < 1)
+                        return CoderResult.OVERFLOW;
+                        dst.put((byte)bb);
+                    }
+                    mark += inSize;
+                }
+                return CoderResult.UNDERFLOW;
+            } finally {
+                src.position(mark);
+            }
+        }
+
+        protected CoderResult encodeLoop(CharBuffer src, ByteBuffer dst) {
+            if (src.hasArray() && dst.hasArray())
+                return encodeArrayLoop(src, dst);
+            else
+                return encodeBufferLoop(src, dst);
+        }
+
+        private byte[] repl = replacement();
+        protected void implReplaceWith(byte[] newReplacement) {
+            repl = newReplacement;
+        }
+
+        public int encode(char[] src, int sp, int len, byte[] dst) {
+            int dp = 0;
+            int sl = sp + len;
+            while (sp < sl) {
+                char c = src[sp++];
+                int bb = encodeChar(c);
+                if (bb == UNMAPPABLE_ENCODING) {
+                    if (!Character.isHighSurrogate(c) || sp == sl ||
+                        !Character.isLowSurrogate(src[sp]) ||
+                        (bb = encodeSupp(Character.toCodePoint(c, src[sp++])))
+                        == UNMAPPABLE_ENCODING) {
+                        dst[dp++] = repl[0];
+                        if (repl.length > 1)
+                            dst[dp++] = repl[1];
+                        continue;
+                    }
+                    sp++;
+                }
+                if (bb > MAX_SINGLEBYTE) {        // DoubleByte
+                    dst[dp++] = (byte)(bb >> 8);
+                    dst[dp++] = (byte)bb;
+                } else {                          // SingleByte
+                    dst[dp++] = (byte)bb;
+                }
+            }
+            return dp;
+        }
+
+
+        static char[] C2B_UNMAPPABLE = new char[0x100];
+        static {
+            Arrays.fill(C2B_UNMAPPABLE, (char)UNMAPPABLE_ENCODING);
+        }
+
+        public static void initc2b(char[][] c2b, String[] b2cStr, String pua) {
+            // init c2b/c2bSupp from b2cStr and supp
+            int b2Min = 0x40;
+            Arrays.fill(c2b, C2B_UNMAPPABLE);
+            for (int b1 = 0; b1 < 0x100; b1++) {
+                String s = b2cStr[b1];
+                if (s == null)
+                    continue;
+                for (int i = 0; i < s.length(); i++) {
+                    char c = s.charAt(i);
+                    int hi = c >> 8;
+                    if (c2b[hi] == C2B_UNMAPPABLE) {
+                        c2b[hi] = new char[0x100];
+                        Arrays.fill(c2b[hi], (char)UNMAPPABLE_ENCODING);
+                    }
+                    c2b[hi][c & 0xff] = (char)((b1 << 8) | (i + b2Min));
+                }
+            }
+            if (pua != null) {        // add the compatibility pua entries
+                char c = '\ue000';    //first pua character
+                for (int i = 0; i < pua.length(); i++) {
+                    char bb = pua.charAt(i);
+                    if (bb != UNMAPPABLE_DECODING) {
+                        int hi = c >> 8;
+                        if (c2b[hi] == C2B_UNMAPPABLE) {
+                            c2b[hi] = new char[0x100];
+                            Arrays.fill(c2b[hi], (char)UNMAPPABLE_ENCODING);
+                        }
+                        c2b[hi][c & 0xff] = bb;
+                    }
+                    c++;
+                }
+            }
+        }
+    }
+}
--- a/src/java.base/share/classes/sun/nio/cs/StandardCharsets.java.template	Thu Feb 19 11:24:03 2015 -0800
+++ b/src/java.base/share/classes/sun/nio/cs/StandardCharsets.java.template	Thu Feb 19 16:38:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -29,20 +29,188 @@
 
 package sun.nio.cs;
 
-import java.nio.charset.*;
+import java.nio.charset.Charset;
+import java.nio.charset.spi.CharsetProvider;
+import java.util.Iterator;
+import java.util.Locale;
+import java.util.Map;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 
-
-public class StandardCharsets
-    extends FastCharsetProvider
-{
+public class StandardCharsets extends CharsetProvider {
 
     _INCLUDE_ALIASES_TABLES_
     _INCLUDE_ALIASES_MAP_
     _INCLUDE_CLASSES_MAP_
     _INCLUDE_CACHE_MAP_
 
+    // Maps canonical names to class names
+    private Map<String,String> classMap;
+    // Maps alias names to canonical names
+    private Map<String,String> aliasMap;
+    // Maps canonical names to cached instances
+    private Map<String,Charset> cache;
+
+    private String packagePrefix = "sun.nio.cs";
+
     public StandardCharsets() {
-        super("sun.nio.cs", new Aliases(), new Classes(), new Cache());
+        this.aliasMap = new Aliases();
+        this.classMap = new Classes();
+        this.cache = new Cache();
     }
 
+    private String canonicalize(String csn) {
+        String acn = aliasMap.get(csn);
+        return (acn != null) ? acn : csn;
+    }
+
+    // Private ASCII-only version, optimized for interpretation during startup
+    //
+    private static String toLower(String s) {
+        int n = s.length();
+        boolean allLower = true;
+        for (int i = 0; i < n; i++) {
+            int c = s.charAt(i);
+            if (((c - 'A') | ('Z' - c)) >= 0) {
+                allLower = false;
+                break;
+            }
+        }
+        if (allLower)
+            return s;
+        char[] ca = new char[n];
+        for (int i = 0; i < n; i++) {
+            int c = s.charAt(i);
+            if (((c - 'A') | ('Z' - c)) >= 0)
+                ca[i] = (char)(c + 0x20);
+            else
+                ca[i] = (char)c;
+        }
+        return new String(ca);
+    }
+
+    private Charset lookup(String charsetName) {
+        init();
+        String csn = canonicalize(toLower(charsetName));
+
+        // Check cache first
+        Charset cs = cache.get(csn);
+        if (cs != null)
+            return cs;
+
+        // Do we even support this charset?
+        String cln = classMap.get(csn);
+        if (cln == null)
+            return null;
+
+        if (cln.equals("US_ASCII")) {
+            cs = new US_ASCII();
+            cache.put(csn, cs);
+            return cs;
+        }
+
+        // Instantiate the charset and cache it
+        try {
+            Class<?> c = Class.forName(packagePrefix + "." + cln,
+                                    true,
+                                    this.getClass().getClassLoader());
+            cs = (Charset)c.newInstance();
+            cache.put(csn, cs);
+            return cs;
+        } catch (ClassNotFoundException |
+                 IllegalAccessException |
+                 InstantiationException x) {
+            return null;
+        }
+    }
+
+    public final Charset charsetForName(String charsetName) {
+        synchronized (this) {
+            return lookup(canonicalize(charsetName));
+        }
+    }
+
+    public final Iterator<Charset> charsets() {
+        synchronized (this) {
+            init();
+        }
+        return new Iterator<Charset>() {
+
+                Iterator<String> i = classMap.keySet().iterator();
+
+                public boolean hasNext() {
+                    return i.hasNext();
+                }
+
+                public Charset next() {
+                    String csn = i.next();
+                    return lookup(csn);
+                }
+
+                public void remove() {
+                    throw new UnsupportedOperationException();
+                }
+
+            };
+    }
+
+    private boolean initialized = false;
+
+    /*   provider the sun.nio.cs.map property fir sjis/ms932 mapping hack 
+     */
+    private void init() {
+        if (initialized)
+            return;
+        if (!sun.misc.VM.isBooted())
+            return;
+        initialized = true;
+
+        String map = getProperty("sun.nio.cs.map");
+        if (map != null) {
+            String[] maps = map.split(",");
+            for (int i = 0; i < maps.length; i++) {
+                if (maps[i].equalsIgnoreCase("Windows-31J/Shift_JIS")) {
+                    // if we dont have both sjis and ms932, do nothing
+                    if (classMap.get("shift_jis") == null ||
+                        classMap.get("windows-31j") == null) {
+                        break;
+                    }
+                    aliases_MS932 = new String[] {
+                        "MS932",        // JDK historical
+                        "windows-932",
+                        "csWindows31J",
+                        "shift-jis",
+                        "ms_kanji",
+                        "x-sjis",
+                        "csShiftJIS",
+                        // This alias takes precedence over the actual
+                        // Shift_JIS charset itself since aliases are always
+                        // resolved first, before looking up canonical names.
+                        "shift_jis"
+                    };
+                    aliases_SJIS = new String[] { "sjis" };
+
+                    for (String alias : aliases_MS932) {
+                        aliasMap.put(toLower(alias), "windows-31j");
+                    }
+                    cache.put("shift_jis", null);
+                    break;
+                }
+            }
+        }
+    }
+
+    private static String getProperty(String key) {
+        // this method may be called during initialization of
+        // system class loader and thus not using lambda
+        return AccessController.doPrivileged(
+            new PrivilegedAction<String>() {
+                @Override
+                public String run() {
+                    return System.getProperty(key);
+                }
+            });
+    }
+
+
 }
--- a/src/java.base/share/classes/sun/security/provider/DSA.java	Thu Feb 19 11:24:03 2015 -0800
+++ b/src/java.base/share/classes/sun/security/provider/DSA.java	Thu Feb 19 16:38:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,14 +33,11 @@
 import java.security.*;
 import java.security.SecureRandom;
 import java.security.interfaces.*;
-import java.security.spec.DSAParameterSpec;
-import java.security.spec.InvalidParameterSpecException;
 
 import sun.security.util.Debug;
 import sun.security.util.DerValue;
 import sun.security.util.DerInputStream;
 import sun.security.util.DerOutputStream;
-import sun.security.x509.AlgIdDSA;
 import sun.security.jca.JCAUtil;
 
 /**
@@ -85,13 +82,28 @@
     /* The message digest object used */
     private final MessageDigest md;
 
+    /* The format. true for the IEEE P1363 format. false (default) for ASN.1 */
+    private final boolean p1363Format;
+
     /**
      * Construct a blank DSA object. It must be
      * initialized before being usable for signing or verifying.
      */
     DSA(MessageDigest md) {
+        this(md, false);
+    }
+
+    /**
+     * Construct a blank DSA object that will use the specified
+     * signature format. {@code p1363Format} should be {@code true} to
+     * use the IEEE P1363 format. If {@code p1363Format} is {@code false},
+     * the DER-encoded ASN.1 format will used. The DSA object must be
+     * initialized before being usable for signing or verifying.
+     */
+    DSA(MessageDigest md, boolean p1363Format) {
         super();
         this.md = md;
+        this.p1363Format = p1363Format;
     }
 
     /**
@@ -178,12 +190,16 @@
 
 
     /**
-     * Sign all the data thus far updated. The signature is formatted
+     * Sign all the data thus far updated. The signature format is
+     * determined by {@code p1363Format}. If {@code p1363Format} is
+     * {@code false} (the default), then the signature is formatted
      * according to the Canonical Encoding Rules, returned as a DER
-     * sequence of Integer, r and s.
+     * sequence of Integers, r and s. If {@code p1363Format} is
+     * {@code false}, the signature is returned in the IEEE P1363
+     * format, which is the concatenation or r and s.
      *
-     * @return a signature block formatted according to the Canonical
-     * Encoding Rules.
+     * @return a signature block formatted according to the format
+     * indicated by {@code p1363Format}
      *
      * @exception SignatureException if the signature object was not
      * properly initialized, or if another exception occurs.
@@ -196,24 +212,48 @@
         BigInteger r = generateR(presetP, presetQ, presetG, k);
         BigInteger s = generateS(presetX, presetQ, r, k);
 
-        try {
-            DerOutputStream outseq = new DerOutputStream(100);
-            outseq.putInteger(r);
-            outseq.putInteger(s);
-            DerValue result = new DerValue(DerValue.tag_Sequence,
-                                           outseq.toByteArray());
+        if (p1363Format) {
+            // Return the concatenation of r and s
+            byte[] rBytes = r.toByteArray();
+            byte[] sBytes = s.toByteArray();
 
-            return result.toByteArray();
+            int size = presetQ.bitLength() / 8;
+            byte[] outseq = new byte[size * 2];
 
-        } catch (IOException e) {
-            throw new SignatureException("error encoding signature");
+            int rLength = rBytes.length;
+            int sLength = sBytes.length;
+            int i;
+            for (i = rLength; i > 0 && rBytes[rLength - i] == 0; i--);
+
+            int j;
+            for (j = sLength;
+                    j > 0 && sBytes[sLength - j] == 0; j--);
+
+            System.arraycopy(rBytes, rLength - i, outseq, size - i, i);
+            System.arraycopy(sBytes, sLength - j, outseq, size * 2 - j, j);
+
+            return outseq;
+        } else {
+            // Return the DER-encoded ASN.1 form
+            try {
+                DerOutputStream outseq = new DerOutputStream(100);
+                outseq.putInteger(r);
+                outseq.putInteger(s);
+                DerValue result = new DerValue(DerValue.tag_Sequence,
+                        outseq.toByteArray());
+
+                return result.toByteArray();
+
+            } catch (IOException e) {
+                throw new SignatureException("error encoding signature");
+            }
         }
     }
 
     /**
      * Verify all the data thus far updated.
      *
-     * @param signature the alledged signature, encoded using the
+     * @param signature the alleged signature, encoded using the
      * Canonical Encoding Rules, as a sequence of integers, r and s.
      *
      * @exception SignatureException if the signature object was not
@@ -230,8 +270,13 @@
     /**
      * Verify all the data thus far updated.
      *
-     * @param signature the alledged signature, encoded using the
-     * Canonical Encoding Rules, as a sequence of integers, r and s.
+     * @param signature the alleged signature, encoded using the
+     * format indicated by {@code p1363Format}. If {@code p1363Format}
+     * is {@code false} (the default), then the signature is formatted
+     * according to the Canonical Encoding Rules, as a DER sequence of
+     * Integers, r and s. If {@code p1363Format} is {@code false},
+     * the signature is in the IEEE P1363 format, which is the
+     * concatenation or r and s.
      *
      * @param offset the offset to start from in the array of bytes.
      *
@@ -248,16 +293,28 @@
 
         BigInteger r = null;
         BigInteger s = null;
-        // first decode the signature.
-        try {
-            DerInputStream in = new DerInputStream(signature, offset, length);
-            DerValue[] values = in.getSequence(2);
 
-            r = values[0].getBigInteger();
-            s = values[1].getBigInteger();
+        if (p1363Format) {
+            if ((length & 1) == 1) {
+                // length of signature byte array should be even
+                throw new SignatureException("invalid signature format");
+            }
+            int mid = length/2;
+            r = new BigInteger(Arrays.copyOfRange(signature, 0, mid));
+            s = new BigInteger(Arrays.copyOfRange(signature, mid, length));
+        } else {
+            // first decode the signature.
+            try {
+                DerInputStream in = new DerInputStream(signature, offset,
+                                                       length);
+                DerValue[] values = in.getSequence(2);
 
-        } catch (IOException e) {
-            throw new SignatureException("invalid encoding for signature");
+                r = values[0].getBigInteger();
+                s = values[1].getBigInteger();
+
+            } catch (IOException e) {
+                throw new SignatureException("invalid encoding for signature");
+            }
         }
 
         // some implementations do not correctly encode values in the ASN.1
@@ -421,6 +478,15 @@
     }
 
     /**
+     * SHA224withDSA implementation that uses the IEEE P1363 format.
+     */
+    public static final class SHA224withDSAinP1363Format extends DSA {
+        public SHA224withDSAinP1363Format() throws NoSuchAlgorithmException {
+            super(MessageDigest.getInstance("SHA-224"), true);
+        }
+    }
+
+    /**
      * Standard SHA256withDSA implementation as defined in FIPS186-3.
      */
     public static final class SHA256withDSA extends DSA {
@@ -429,6 +495,15 @@
         }
     }
 
+    /**
+     * SHA256withDSA implementation that uses the IEEE P1363 format.
+     */
+    public static final class SHA256withDSAinP1363Format extends DSA {
+        public SHA256withDSAinP1363Format() throws NoSuchAlgorithmException {
+            super(MessageDigest.getInstance("SHA-256"), true);
+        }
+    }
+
     static class LegacyDSA extends DSA {
         /* The random seed used to generate k */
         private int[] kSeed;
@@ -441,7 +516,12 @@
         private int[] kSeedLast;
 
         public LegacyDSA(MessageDigest md) throws NoSuchAlgorithmException {
-            super(md);
+            this(md, false);
+        }
+
+        private LegacyDSA(MessageDigest md, boolean p1363Format)
+                throws NoSuchAlgorithmException {
+            super(md, p1363Format);
         }
 
         @Deprecated
@@ -636,6 +716,9 @@
         }
     }
 
+    /**
+     * Standard SHA1withDSA implementation.
+     */
     public static final class SHA1withDSA extends LegacyDSA {
         public SHA1withDSA() throws NoSuchAlgorithmException {
             super(MessageDigest.getInstance("SHA-1"));
@@ -643,13 +726,22 @@
     }
 
     /**
-     * RawDSA implementation.
+     * SHA1withDSA implementation that uses the IEEE P1363 format.
+     */
+    public static final class SHA1withDSAinP1363Format extends LegacyDSA {
+        public SHA1withDSAinP1363Format() throws NoSuchAlgorithmException {
+            super(MessageDigest.getInstance("SHA-1"), true);
+        }
+    }
+
+    /**
+     * Raw DSA.
      *
-     * RawDSA requires the data to be exactly 20 bytes long. If it is
+     * Raw DSA requires the data to be exactly 20 bytes long. If it is
      * not, a SignatureException is thrown when sign()/verify() is called
      * per JCA spec.
      */
-    public static final class RawDSA extends LegacyDSA {
+    static class Raw extends LegacyDSA {
         // Internal special-purpose MessageDigest impl for RawDSA
         // Only override whatever methods used
         // NOTE: no clone support
@@ -719,8 +811,27 @@
             }
         }
 
+        private Raw(boolean p1363Format) throws NoSuchAlgorithmException {
+            super(new NullDigest20(), p1363Format);
+        }
+
+    }
+
+    /**
+     * Standard Raw DSA implementation.
+     */
+    public static final class RawDSA extends Raw {
         public RawDSA() throws NoSuchAlgorithmException {
-            super(new NullDigest20());
+            super(false);
+        }
+    }
+
+    /**
+     * Raw DSA implementation that uses the IEEE P1363 format.
+     */
+    public static final class RawDSAinP1363Format extends Raw {
+        public RawDSAinP1363Format() throws NoSuchAlgorithmException {
+            super(true);
         }
     }
 }
--- a/src/java.base/share/classes/sun/security/provider/SunEntries.java	Thu Feb 19 11:24:03 2015 -0800
+++ b/src/java.base/share/classes/sun/security/provider/SunEntries.java	Thu Feb 19 16:38:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -130,6 +130,15 @@
         map.put("Signature.SHA256withDSA",
                 "sun.security.provider.DSA$SHA256withDSA");
 
+        map.put("Signature.SHA1withDSAinP1363Format",
+                "sun.security.provider.DSA$SHA1withDSAinP1363Format");
+        map.put("Signature.NONEwithDSAinP1363Format",
+                "sun.security.provider.DSA$RawDSAinP1363Format");
+        map.put("Signature.SHA224withDSAinP1363Format",
+                "sun.security.provider.DSA$SHA224withDSAinP1363Format");
+        map.put("Signature.SHA256withDSAinP1363Format",
+                "sun.security.provider.DSA$SHA256withDSAinP1363Format");
+
         String dsaKeyClasses = "java.security.interfaces.DSAPublicKey" +
                 "|java.security.interfaces.DSAPrivateKey";
         map.put("Signature.SHA1withDSA SupportedKeyClasses", dsaKeyClasses);
--- a/src/java.base/share/classes/sun/security/util/DisabledAlgorithmConstraints.java	Thu Feb 19 11:24:03 2015 -0800
+++ b/src/java.base/share/classes/sun/security/util/DisabledAlgorithmConstraints.java	Thu Feb 19 16:38:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -171,8 +171,9 @@
             // OAEPWith<digest>And<mgf>Padding
             // <digest>with<encryption>
             // <digest>with<encryption>and<mgf>
+            // <digest>with<encryption>in<format>
             Pattern pattern =
-                    Pattern.compile("with|and", Pattern.CASE_INSENSITIVE);
+                    Pattern.compile("with|and|in", Pattern.CASE_INSENSITIVE);
             String[] tokens = pattern.split(transTocken);
 
             for (String token : tokens) {
--- a/src/java.base/share/conf/security/java.policy	Thu Feb 19 11:24:03 2015 -0800
+++ b/src/java.base/share/conf/security/java.policy	Thu Feb 19 16:38:11 2015 -0800
@@ -1,4 +1,8 @@
 // permissions required by each component
+grant codeBase "jrt:/java.corba" {
+        permission java.security.AllPermission;
+};
+
 grant codeBase "jrt:/jdk.zipfs" {
         permission java.io.FilePermission "<<ALL FILES>>", "read,write,delete";
         permission java.lang.RuntimePermission "fileSystemProvider";
--- a/src/java.base/windows/native/libjli/java_md.c	Thu Feb 19 11:24:03 2015 -0800
+++ b/src/java.base/windows/native/libjli/java_md.c	Thu Feb 19 16:38:11 2015 -0800
@@ -265,26 +265,17 @@
          * assumed to be present in the "JRE path" directory.  If it is not found
          * there (or "JRE path" fails to resolve), skip the explicit load and let
          * nature take its course, which is likely to be a failure to execute.
-         * This is clearly completely specific to the exact compiler version
-         * which isn't very nice, but its hardly the only place.
-         * No attempt to look for compiler versions in between 2003 and 2010
-         * as we aren't supporting building with those.
+         * The makefiles will provide the correct lib contained in quotes in the
+         * macro MSVCR_DLL_NAME.
          */
-#ifdef _MSC_VER
-#if _MSC_VER < 1400
-#define CRT_DLL "msvcr71.dll"
-#endif
-#if _MSC_VER >= 1600
-#define CRT_DLL "msvcr100.dll"
-#endif
-#ifdef CRT_DLL
+#ifdef MSVCR_DLL_NAME
         if (GetJREPath(crtpath, MAXPATHLEN)) {
             if (JLI_StrLen(crtpath) + JLI_StrLen("\\bin\\") +
-                    JLI_StrLen(CRT_DLL) >= MAXPATHLEN) {
+                    JLI_StrLen(MSVCR_DLL_NAME) >= MAXPATHLEN) {
                 JLI_ReportErrorMessage(JRE_ERROR11);
                 return JNI_FALSE;
             }
-            (void)JLI_StrCat(crtpath, "\\bin\\" CRT_DLL);   /* Add crt dll */
+            (void)JLI_StrCat(crtpath, "\\bin\\" MSVCR_DLL_NAME);   /* Add crt dll */
             JLI_TraceLauncher("CRT path is %s\n", crtpath);
             if (_access(crtpath, 0) == 0) {
                 if (LoadLibrary(crtpath) == 0) {
@@ -293,8 +284,24 @@
                 }
             }
         }
-#endif /* CRT_DLL */
-#endif /* _MSC_VER */
+#endif /* MSVCR_DLL_NAME */
+#ifdef MSVCP_DLL_NAME
+        if (GetJREPath(crtpath, MAXPATHLEN)) {
+            if (JLI_StrLen(crtpath) + JLI_StrLen("\\bin\\") +
+                    JLI_StrLen(MSVCP_DLL_NAME) >= MAXPATHLEN) {
+                JLI_ReportErrorMessage(JRE_ERROR11);
+                return JNI_FALSE;
+            }
+            (void)JLI_StrCat(crtpath, "\\bin\\" MSVCP_DLL_NAME);   /* Add prt dll */
+            JLI_TraceLauncher("PRT path is %s\n", crtpath);
+            if (_access(crtpath, 0) == 0) {
+                if (LoadLibrary(crtpath) == 0) {
+                    JLI_ReportErrorMessage(DLL_ERROR4, crtpath);
+                    return JNI_FALSE;
+                }
+            }
+        }
+#endif /* MSVCP_DLL_NAME */
         loaded = 1;
     }
     return JNI_TRUE;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.datatransfer/macosx/classes/sun/datatransfer/resources/flavormap.properties	Thu Feb 19 16:38:11 2015 -0800
@@ -0,0 +1,76 @@
+#
+# This properties file is used to initialize the default
+# java.awt.datatransfer.SystemFlavorMap. It contains the Mac OS X platform-specific,
+# default mappings between common Mac OS X selection atoms and platform-independent
+# MIME type strings, which will be converted into 
+# java.awt.datatransfer.DataFlavors.
+#
+# The standard format is:
+#
+# <native>=<MIME type>,<MIME type>, ...
+#
+# <native> should be a string identifier that the native platform will
+# recognize as a valid data format. <MIME type> should specify both a MIME
+# primary type and a MIME subtype separated by a '/'. The MIME type may include
+# parameters, where each parameter is a key/value pair separated by '=', and
+# where each parameter to the MIME type is separated by a ';'.
+#
+# Because SystemFlavorMap implements FlavorTable, developers are free to
+# duplicate DataFlavor values and set multiple values for a single native by
+# separating them with ",". If a mapping contains a duplicate key or value,
+# earlier mappings which included this key or value will be preferred.
+#
+# Mappings whose values specify DataFlavors with primary MIME types of
+# "text", and which support the charset parameter, should specify the exact
+# format in which the native platform expects the data. The "charset"
+# parameter specifies the char to byte encoding, the "eoln" parameter
+# specifies the end-of-line marker, and the "terminators" parameter specifies
+# the number of terminating NUL bytes. Note that "eoln" and "terminators"
+# are not standardized MIME type parameters. They are specific to this file
+# format ONLY. They will not appear in any of the DataFlavors returned by the
+# SystemFlavorMap at the Java level.
+#
+# If the "charset" parameter is omitted, or has zero length, the platform
+# default encoding is assumed. If the "eoln" parameter is omitted, or has
+# zero length, "\n" is assumed. If the "terminators" parameter is omitted,
+# or has a value less than zero, zero is assumed.
+#
+# Upon initialization, the data transfer subsystem will record the specified
+# details of the native text format, but the default SystemFlavorMap will
+# present a large set of synthesized DataFlavors which map, in both
+# directions, to the native. After receiving data from the application in one
+# of the synthetic DataFlavors, the data transfer subsystem will transform
+# the data stream into the format specified in this file before passing the
+# transformed stream to the native system.
+#
+# Mappings whose values specify DataFlavors with primary MIME types of
+# "text", but which do not support the charset parameter, will be treated as
+# opaque, 8-bit data. They will not undergo any transformation process, and
+# any "charset", "eoln", or "terminators" parameters specified in this file
+# will be ignored.
+#
+# See java.awt.datatransfer.DataFlavor.selectBestTextFlavor for a list of
+# text flavors which support the charset parameter.
+
+UTF8_STRING=text/plain;charset=UTF-8;eoln="\n";terminators=0
+
+# The COMPOUND_TEXT support for inter-client text transfer is disabled by 
+# default. The reason is that many native applications prefer this format over 
+# other native text formats, but are unable to decode the textual data in this 
+# format properly. This results in java-to-native text transfer failures.
+# To enable the COMPOUND_TEXT support for this JRE installation uncomment 
+# the line below.
+
+# COMPOUND_TEXT=text/plain;charset=x-compound-text;eoln="\n";terminators=0
+
+TEXT=text/plain;eoln="\n";terminators=0
+STRING=text/plain;charset=UTF-8;eoln="\n";terminators=0
+FILE_NAME=application/x-java-file-list;class=java.util.List
+text/uri-list=application/x-java-file-list;class=java.util.List
+PNG=image/x-java-image;class=java.awt.Image
+JFIF=image/x-java-image;class=java.awt.Image
+TIFF=image/x-java-image;class=java.awt.Image
+RICH_TEXT=text/rtf
+HTML=text/html;charset=utf-8;eoln="\r\n";terminators=1
+URL=application/x-java-url;class=java.net.URL,\
+    text/uri-list;eoln="\r\n";terminators=1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.datatransfer/share/classes/java/awt/datatransfer/Clipboard.java	Thu Feb 19 16:38:11 2015 -0800
@@ -0,0 +1,352 @@
+/*
+ * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package java.awt.datatransfer;
+
+import sun.datatransfer.DataFlavorUtil;
+
+import java.util.Objects;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.Arrays;
+
+import java.io.IOException;
+
+/**
+ * A class that implements a mechanism to transfer data using
+ * cut/copy/paste operations.
+ * <p>
+ * {@link FlavorListener}s may be registered on an instance of the
+ * Clipboard class to be notified about changes to the set of
+ * {@link DataFlavor}s available on this clipboard (see
+ * {@link #addFlavorListener}).
+ *
+ * @see java.awt.Toolkit#getSystemClipboard
+ * @see java.awt.Toolkit#getSystemSelection
+ *
+ * @author      Amy Fowler
+ * @author      Alexander Gerasimov
+ */
+public class Clipboard {
+
+    String name;
+
+    /**
+     * The owner of the clipboard.
+     */
+    protected ClipboardOwner owner;
+    /**
+     * Contents of the clipboard.
+     */
+    protected Transferable contents;
+
+    /**
+     * An aggregate of flavor listeners registered on this local clipboard.
+     *
+     * @since 1.5
+     */
+    private Set<FlavorListener> flavorListeners;
+
+    /**
+     * A set of <code>DataFlavor</code>s that is available on
+     * this local clipboard. It is used for tracking changes
+     * of <code>DataFlavor</code>s available on this clipboard.
+     *
+     * @since 1.5
+     */
+    private Set<DataFlavor> currentDataFlavors;
+
+    /**
+     * Creates a clipboard object.
+     * @param name for the clipboard
+     * @see java.awt.Toolkit#getSystemClipboard
+     */
+    public Clipboard(String name) {
+        this.name = name;
+    }
+
+    /**
+     * Returns the name of this clipboard object.
+     * @return the name of this clipboard object
+     *
+     * @see java.awt.Toolkit#getSystemClipboard
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * Sets the current contents of the clipboard to the specified
+     * transferable object and registers the specified clipboard owner
+     * as the owner of the new contents.
+     * <p>
+     * If there is an existing owner different from the argument
+     * <code>owner</code>, that owner is notified that it no longer
+     * holds ownership of the clipboard contents via an invocation
+     * of <code>ClipboardOwner.lostOwnership()</code> on that owner.
+     * An implementation of <code>setContents()</code> is free not
+     * to invoke <code>lostOwnership()</code> directly from this method.
+     * For example, <code>lostOwnership()</code> may be invoked later on
+     * a different thread. The same applies to <code>FlavorListener</code>s
+     * registered on this clipboard.
+     * <p>
+     * The method throws <code>IllegalStateException</code> if the clipboard
+     * is currently unavailable. For example, on some platforms, the system
+     * clipboard is unavailable while it is accessed by another application.
+     *
+     * @param contents the transferable object representing the
+     *                 clipboard content
+     * @param owner the object which owns the clipboard content
+     * @throws IllegalStateException if the clipboard is currently unavailable
+     * @see java.awt.Toolkit#getSystemClipboard
+     */
+    public synchronized void setContents(Transferable contents, ClipboardOwner owner) {
+        final ClipboardOwner oldOwner = this.owner;
+        final Transferable oldContents = this.contents;
+
+        this.owner = owner;
+        this.contents = contents;
+
+        if (oldOwner != null && oldOwner != owner) {
+            DataFlavorUtil.getDesktopService().invokeOnEventThread(() ->
+                    oldOwner.lostOwnership(Clipboard.this, oldContents));
+        }
+        fireFlavorsChanged();
+    }
+
+    /**
+     * Returns a transferable object representing the current contents
+     * of the clipboard.  If the clipboard currently has no contents,
+     * it returns <code>null</code>. The parameter Object requestor is
+     * not currently used.  The method throws
+     * <code>IllegalStateException</code> if the clipboard is currently
+     * unavailable.  For example, on some platforms, the system clipboard is
+     * unavailable while it is accessed by another application.
+     *
+     * @param requestor the object requesting the clip data  (not used)
+     * @return the current transferable object on the clipboard
+     * @throws IllegalStateException if the clipboard is currently unavailable
+     * @see java.awt.Toolkit#getSystemClipboard
+     */
+    public synchronized Transferable getContents(Object requestor) {
+        return contents;
+    }
+
+
+    /**
+     * Returns an array of <code>DataFlavor</code>s in which the current
+     * contents of this clipboard can be provided. If there are no
+     * <code>DataFlavor</code>s available, this method returns a zero-length
+     * array.
+     *
+     * @return an array of <code>DataFlavor</code>s in which the current
+     *         contents of this clipboard can be provided
+     *
+     * @throws IllegalStateException if this clipboard is currently unavailable
+     *
+     * @since 1.5
+     */
+    public DataFlavor[] getAvailableDataFlavors() {
+        Transferable cntnts = getContents(null);
+        if (cntnts == null) {
+            return new DataFlavor[0];
+        }
+        return cntnts.getTransferDataFlavors();
+    }
+
+    /**
+     * Returns whether or not the current contents of this clipboard can be
+     * provided in the specified <code>DataFlavor</code>.
+     *
+     * @param flavor the requested <code>DataFlavor</code> for the contents
+     *
+     * @return <code>true</code> if the current contents of this clipboard
+     *         can be provided in the specified <code>DataFlavor</code>;
+     *         <code>false</code> otherwise
+     *
+     * @throws NullPointerException if <code>flavor</code> is <code>null</code>
+     * @throws IllegalStateException if this clipboard is currently unavailable
+     *
+     * @since 1.5
+     */
+    public boolean isDataFlavorAvailable(DataFlavor flavor) {
+        if (flavor == null) {
+            throw new NullPointerException("flavor");
+        }
+
+        Transferable cntnts = getContents(null);
+        if (cntnts == null) {
+            return false;
+        }
+        return cntnts.isDataFlavorSupported(flavor);
+    }
+
+    /**
+     * Returns an object representing the current contents of this clipboard
+     * in the specified <code>DataFlavor</code>.
+     * The class of the object returned is defined by the representation
+     * class of <code>flavor</code>.
+     *
+     * @param flavor the requested <code>DataFlavor</code> for the contents
+     *
+     * @return an object representing the current contents of this clipboard
+     *         in the specified <code>DataFlavor</code>
+     *
+     * @throws NullPointerException if <code>flavor</code> is <code>null</code>
+     * @throws IllegalStateException if this clipboard is currently unavailable
+     * @throws UnsupportedFlavorException if the requested <code>DataFlavor</code>
+     *         is not available
+     * @throws IOException if the data in the requested <code>DataFlavor</code>
+     *         can not be retrieved
+     *
+     * @see DataFlavor#getRepresentationClass
+     *
+     * @since 1.5
+     */
+    public Object getData(DataFlavor flavor)
+        throws UnsupportedFlavorException, IOException {
+        if (flavor == null) {
+            throw new NullPointerException("flavor");
+        }
+
+        Transferable cntnts = getContents(null);
+        if (cntnts == null) {
+            throw new UnsupportedFlavorException(flavor);
+        }
+        return cntnts.getTransferData(flavor);
+    }
+
+
+    /**
+     * Registers the specified <code>FlavorListener</code> to receive
+     * <code>FlavorEvent</code>s from this clipboard.
+     * If <code>listener</code> is <code>null</code>, no exception
+     * is thrown and no action is performed.
+     *
+     * @param listener the listener to be added
+     *
+     * @see #removeFlavorListener
+     * @see #getFlavorListeners
+     * @see FlavorListener
+     * @see FlavorEvent
+     * @since 1.5
+     */
+    public synchronized void addFlavorListener(FlavorListener listener) {
+        if (listener == null) {
+            return;
+        }
+
+        if (flavorListeners == null) {
+            flavorListeners = new HashSet<>();
+            currentDataFlavors = getAvailableDataFlavorSet();
+        }
+
+        flavorListeners.add(listener);
+    }
+
+    /**
+     * Removes the specified <code>FlavorListener</code> so that it no longer
+     * receives <code>FlavorEvent</code>s from this <code>Clipboard</code>.
+     * This method performs no function, nor does it throw an exception, if
+     * the listener specified by the argument was not previously added to this
+     * <code>Clipboard</code>.
+     * If <code>listener</code> is <code>null</code>, no exception
+     * is thrown and no action is performed.
+     *
+     * @param listener the listener to be removed
+     *
+     * @see #addFlavorListener
+     * @see #getFlavorListeners
+     * @see FlavorListener
+     * @see FlavorEvent
+     * @since 1.5
+     */
+    public synchronized void removeFlavorListener(FlavorListener listener) {
+        if (listener == null || flavorListeners == null) {
+            return;
+        }
+        flavorListeners.remove(listener);
+    }
+
+    /**
+     * Returns an array of all the <code>FlavorListener</code>s currently
+     * registered on this <code>Clipboard</code>.
+     *
+     * @return all of this clipboard's <code>FlavorListener</code>s or an empty
+     *         array if no listeners are currently registered
+     * @see #addFlavorListener
+     * @see #removeFlavorListener
+     * @see FlavorListener
+     * @see FlavorEvent
+     * @since 1.5
+     */
+    public synchronized FlavorListener[] getFlavorListeners() {
+        return flavorListeners == null ? new FlavorListener[0] :
+            flavorListeners.toArray(new FlavorListener[flavorListeners.size()]);
+    }
+
+    /**
+     * Checks change of the <code>DataFlavor</code>s and, if necessary,
+     * notifies all listeners that have registered interest for notification
+     * on <code>FlavorEvent</code>s.
+     *
+     * @since 1.5
+     */
+    private void fireFlavorsChanged() {
+        if (flavorListeners == null) {
+            return;
+        }
+
+        Set<DataFlavor> prevDataFlavors = currentDataFlavors;
+        currentDataFlavors = getAvailableDataFlavorSet();
+        if (Objects.equals(prevDataFlavors, currentDataFlavors)) {
+            return;
+        }
+        flavorListeners.forEach(listener ->
+                DataFlavorUtil.getDesktopService().invokeOnEventThread(() ->
+                        listener.flavorsChanged(new FlavorEvent(Clipboard.this))));
+    }
+
+    /**
+     * Returns a set of <code>DataFlavor</code>s currently available
+     * on this clipboard.
+     *
+     * @return a set of <code>DataFlavor</code>s currently available
+     *         on this clipboard
+     *
+     * @since 1.5
+     */
+    private Set<DataFlavor> getAvailableDataFlavorSet() {
+        Set<DataFlavor> set = new HashSet<>();
+        Transferable contents = getContents(null);
+        if (contents != null) {
+            DataFlavor[] flavors = contents.getTransferDataFlavors();
+            if (flavors != null) {
+                set.addAll(Arrays.asList(flavors));
+            }
+        }
+        return set;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.datatransfer/share/classes/java/awt/datatransfer/ClipboardOwner.java	Thu Feb 19 16:38:11 2015 -0800
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 1996, 2002, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package java.awt.datatransfer;
+
+/**
+ * Defines the interface for classes that will provide data to
+ * a clipboard. An instance of this interface becomes the owner
+ * of the contents of a clipboard (clipboard owner) if it is
+ * passed as an argument to
+ * {@link java.awt.datatransfer.Clipboard#setContents} method of
+ * the clipboard and this method returns successfully.
+ * The instance remains the clipboard owner until another application
+ * or another object within this application asserts ownership
+ * of this clipboard.
+ *
+ * @see java.awt.datatransfer.Clipboard
+ *
+ * @author      Amy Fowler
+ */
+
+public interface ClipboardOwner {
+
+    /**
+     * Notifies this object that it is no longer the clipboard owner.
+     * This method will be called when another application or another
+     * object within this application asserts ownership of the clipboard.
+     *
+     * @param clipboard the clipboard that is no longer owned
+     * @param contents the contents which this owner had placed on the clipboard
+     */
+    public void lostOwnership(Clipboard clipboard, Transferable contents);
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.datatransfer/share/classes/java/awt/datatransfer/DataFlavor.java	Thu Feb 19 16:38:11 2015 -0800
@@ -0,0 +1,1431 @@
+/*
+ * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package java.awt.datatransfer;
+
+import sun.datatransfer.DataFlavorUtil;
+import sun.reflect.misc.ReflectUtil;
+
+import java.io.ByteArrayInputStream;
+import java.io.CharArrayReader;
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.io.OptionalDataException;
+import java.io.Reader;
+import java.io.StringReader;
+import java.io.UnsupportedEncodingException;
+import java.nio.ByteBuffer;
+import java.nio.CharBuffer;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Objects;
+
+/**
+ * A {@code DataFlavor} provides meta information about data. {@code DataFlavor}
+ * is typically used to access data on the clipboard, or during
+ * a drag and drop operation.
+ * <p>
+ * An instance of {@code DataFlavor} encapsulates a content type as
+ * defined in <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045</a>
+ * and <a href="http://www.ietf.org/rfc/rfc2046.txt">RFC 2046</a>.
+ * A content type is typically referred to as a MIME type.
+ * <p>
+ * A content type consists of a media type (referred
+ * to as the primary type), a subtype, and optional parameters. See
+ * <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045</a>
+ * for details on the syntax of a MIME type.
+ * <p>
+ * The JRE data transfer implementation interprets the parameter &quot;class&quot;
+ * of a MIME type as <B>a representation class</b>.
+ * The representation class reflects the class of the object being
+ * transferred. In other words, the representation class is the type of
+ * object returned by {@link Transferable#getTransferData}.
+ * For example, the MIME type of {@link #imageFlavor} is
+ * {@code "image/x-java-image;class=java.awt.Image"},
+ * the primary type is {@code image}, the subtype is
+ * {@code x-java-image}, and the representation class is
+ * {@code java.awt.Image}. When {@code getTransferData} is invoked
+ * with a {@code DataFlavor} of {@code imageFlavor}, an instance of
+ * {@code java.awt.Image} is returned.
+ * It's important to note that {@code DataFlavor} does no error checking
+ * against the representation class. It is up to consumers of
+ * {@code DataFlavor}, such as {@code Transferable}, to honor the representation
+ * class.
+ * <br>
+ * Note, if you do not specify a representation class when
+ * creating a {@code DataFlavor}, the default
+ * representation class is used. See appropriate documentation for
+ * {@code DataFlavor}'s constructors.
+ * <p>
+ * Also, {@code DataFlavor} instances with the &quot;text&quot; primary
+ * MIME type may have a &quot;charset&quot; parameter. Refer to
+ * <a href="http://www.ietf.org/rfc/rfc2046.txt">RFC 2046</a> and
+ * {@link #selectBestTextFlavor} for details on &quot;text&quot; MIME types
+ * and the &quot;charset&quot; parameter.
+ * <p>
+ * Equality of {@code DataFlavors} is determined by the primary type,
+ * subtype, and representation class. Refer to {@link #equals(DataFlavor)} for
+ * details. When determining equality, any optional parameters are ignored.
+ * For example, the following produces two {@code DataFlavors} that
+ * are considered identical:
+ * <pre>
+ *   DataFlavor flavor1 = new DataFlavor(Object.class, &quot;X-test/test; class=&lt;java.lang.Object&gt;; foo=bar&quot;);
+ *   DataFlavor flavor2 = new DataFlavor(Object.class, &quot;X-test/test; class=&lt;java.lang.Object&gt;; x=y&quot;);
+ *   // The following returns true.
+ *   flavor1.equals(flavor2);
+ * </pre>
+ * As mentioned, {@code flavor1} and {@code flavor2} are considered identical.
+ * As such, asking a {@code Transferable} for either {@code DataFlavor} returns
+ * the same results.
+ * <p>
+ * For more information on using data transfer with Swing see
+ * the <a href="http://docs.oracle.com/javase/tutorial/uiswing/dnd/index.html">
+ * How to Use Drag and Drop and Data Transfer</a>,
+ * section in <em>Java Tutorial</em>.
+ *
+ * @author      Blake Sullivan
+ * @author      Laurence P. G. Cable
+ * @author      Jeff Dunn
+ */
+public class DataFlavor implements Externalizable, Cloneable {
+
+    private static final long serialVersionUID = 8367026044764648243L;
+    private static final Class<InputStream> ioInputStreamClass = InputStream.class;
+
+    /**
+     * Tries to load a class from: the bootstrap loader, the system loader,
+     * the context loader (if one is present) and finally the loader specified.
+     *
+     * @param className the name of the class to be loaded
+     * @param fallback the fallback loader
+     * @return the class loaded
+     * @exception ClassNotFoundException if class is not found
+     */
+    protected final static Class<?> tryToLoadClass(String className,
+                                                   ClassLoader fallback)
+        throws ClassNotFoundException
+    {
+        ReflectUtil.checkPackageAccess(className);
+        try {
+            SecurityManager sm = System.getSecurityManager();
+            if (sm != null) {
+                sm.checkPermission(new RuntimePermission("getClassLoader"));
+            }
+            ClassLoader loader = ClassLoader.getSystemClassLoader();
+            try {
+                // bootstrap class loader and system class loader if present
+                return Class.forName(className, true, loader);
+            }
+            catch (ClassNotFoundException exception) {
+                // thread context class loader if and only if present
+                loader = Thread.currentThread().getContextClassLoader();
+                if (loader != null) {
+                    try {
+                        return Class.forName(className, true, loader);
+                    }
+                    catch (ClassNotFoundException e) {
+                        // fallback to user's class loader
+                    }
+                }
+            }
+        } catch (SecurityException exception) {
+            // ignore secured class loaders
+        }
+        return Class.forName(className, true, fallback);
+    }
+
+    /*
+     * private initializer
+     */
+    static private DataFlavor createConstant(Class<?> rc, String prn) {
+        try {
+            return new DataFlavor(rc, prn);
+        } catch (Exception e) {
+            return null;
+        }
+    }
+
+    /*
+     * private initializer
+     */
+    static private DataFlavor createConstant(String mt, String prn) {
+        try {
+            return new DataFlavor(mt, prn);
+        } catch (Exception e) {
+            return null;
+        }
+    }
+
+    /*
+     * private initializer
+     */
+    static private DataFlavor initHtmlDataFlavor(String htmlFlavorType) {
+        try {
+            return new DataFlavor ("text/html; class=java.lang.String;document=" +
+                                       htmlFlavorType + ";charset=Unicode");
+        } catch (Exception e) {
+            return null;
+        }
+    }
+
+    /**
+     * The <code>DataFlavor</code> representing a Java Unicode String class,
+     * where:
+     * <pre>
+     *     representationClass = java.lang.String
+     *     mimeType           = "application/x-java-serialized-object"
+     * </pre>
+     */
+    public static final DataFlavor stringFlavor = createConstant(java.lang.String.class, "Unicode String");
+
+    /**
+     * The <code>DataFlavor</code> representing a Java Image class,
+     * where:
+     * <pre>
+     *     representationClass = java.awt.Image
+     *     mimeType            = "image/x-java-image"
+     * </pre>
+     */
+    public static final DataFlavor imageFlavor = createConstant("image/x-java-image; class=java.awt.Image", "Image");
+
+    /**
+     * The <code>DataFlavor</code> representing plain text with Unicode
+     * encoding, where:
+     * <pre>
+     *     representationClass = InputStream
+     *     mimeType            = "text/plain; charset=unicode"
+     * </pre>
+     * This <code>DataFlavor</code> has been <b>deprecated</b> because
+     * (1) Its representation is an InputStream, an 8-bit based representation,
+     * while Unicode is a 16-bit character set; and (2) The charset "unicode"
+     * is not well-defined. "unicode" implies a particular platform's
+     * implementation of Unicode, not a cross-platform implementation.
+     *
+     * @deprecated as of 1.3. Use <code>DataFlavor.getReaderForText(Transferable)</code>
+     *             instead of <code>Transferable.getTransferData(DataFlavor.plainTextFlavor)</code>.
+     */
+    @Deprecated
+    public static final DataFlavor plainTextFlavor = createConstant("text/plain; charset=unicode; class=java.io.InputStream", "Plain Text");
+
+    /**
+     * A MIME Content-Type of application/x-java-serialized-object represents
+     * a graph of Java object(s) that have been made persistent.
+     *
+     * The representation class associated with this <code>DataFlavor</code>
+     * identifies the Java type of an object returned as a reference
+     * from an invocation <code>java.awt.datatransfer.getTransferData</code>.
+     */
+    public static final String javaSerializedObjectMimeType = "application/x-java-serialized-object";
+
+    /**
+     * To transfer a list of files to/from Java (and the underlying
+     * platform) a <code>DataFlavor</code> of this type/subtype and
+     * representation class of <code>java.util.List</code> is used.
+     * Each element of the list is required/guaranteed to be of type
+     * <code>java.io.File</code>.
+     */
+    public static final DataFlavor javaFileListFlavor = createConstant("application/x-java-file-list;class=java.util.List", null);
+
+    /**
+     * To transfer a reference to an arbitrary Java object reference that
+     * has no associated MIME Content-type, across a <code>Transferable</code>
+     * interface WITHIN THE SAME JVM, a <code>DataFlavor</code>
+     * with this type/subtype is used, with a <code>representationClass</code>
+     * equal to the type of the class/interface being passed across the
+     * <code>Transferable</code>.
+     * <p>
+     * The object reference returned from
+     * <code>Transferable.getTransferData</code> for a <code>DataFlavor</code>
+     * with this MIME Content-Type is required to be
+     * an instance of the representation Class of the <code>DataFlavor</code>.
+     */
+    public static final String javaJVMLocalObjectMimeType = "application/x-java-jvm-local-objectref";
+
+    /**
+     * In order to pass a live link to a Remote object via a Drag and Drop
+     * <code>ACTION_LINK</code> operation a Mime Content Type of
+     * application/x-java-remote-object should be used,
+     * where the representation class of the <code>DataFlavor</code>
+     * represents the type of the <code>Remote</code> interface to be
+     * transferred.
+     */
+    public static final String javaRemoteObjectMimeType = "application/x-java-remote-object";
+
+    /**
+     * Represents a piece of an HTML markup. The markup consists of the part
+     * selected on the source side. Therefore some tags in the markup may be
+     * unpaired. If the flavor is used to represent the data in
+     * a {@link Transferable} instance, no additional changes will be made.
+     * This DataFlavor instance represents the same HTML markup as DataFlavor
+     * instances which content MIME type does not contain document parameter
+     * and representation class is the String class.
+     * <pre>
+     *     representationClass = String
+     *     mimeType           = "text/html"
+     * </pre>
+     */
+    public static DataFlavor selectionHtmlFlavor = initHtmlDataFlavor("selection");
+
+    /**
+     * Represents a piece of an HTML markup. If possible, the markup received
+     * from a native system is supplemented with pair tags to be
+     * a well-formed HTML markup. If the flavor is used to represent the data in
+     * a {@link Transferable} instance, no additional changes will be made.
+     * <pre>
+     *     representationClass = String
+     *     mimeType           = "text/html"
+     * </pre>
+     */
+    public static DataFlavor fragmentHtmlFlavor = initHtmlDataFlavor("fragment");
+
+    /**
+     * Represents a piece of an HTML markup. If possible, the markup
+     * received from a native system is supplemented with additional
+     * tags to make up a well-formed HTML document. If the flavor is used to
+     * represent the data in a {@link Transferable} instance,
+     * no additional changes will be made.
+     * <pre>
+     *     representationClass = String
+     *     mimeType           = "text/html"
+     * </pre>
+     */
+    public static  DataFlavor allHtmlFlavor = initHtmlDataFlavor("all");
+
+    /**
+     * Constructs a new <code>DataFlavor</code>.  This constructor is
+     * provided only for the purpose of supporting the
+     * <code>Externalizable</code> interface.  It is not
+     * intended for public (client) use.
+     *
+     * @since 1.2
+     */
+    public DataFlavor() {
+        super();
+    }
+
+    /**
+     * Constructs a fully specified <code>DataFlavor</code>.
+     *
+     * @exception NullPointerException if either <code>primaryType</code>,
+     *            <code>subType</code> or <code>representationClass</code> is null
+     */
+    private DataFlavor(String primaryType, String subType, MimeTypeParameterList params, Class<?> representationClass, String humanPresentableName) {
+        super();
+        if (primaryType == null) {
+            throw new NullPointerException("primaryType");
+        }
+        if (subType == null) {
+            throw new NullPointerException("subType");
+        }
+        if (representationClass == null) {
+            throw new NullPointerException("representationClass");
+        }
+
+        if (params == null) params = new MimeTypeParameterList();
+
+        params.set("class", representationClass.getName());
+
+        if (humanPresentableName == null) {
+            humanPresentableName = params.get("humanPresentableName");
+
+            if (humanPresentableName == null)
+                humanPresentableName = primaryType + "/" + subType;
+        }
+
+        try {
+            mimeType = new MimeType(primaryType, subType, params);
+        } catch (MimeTypeParseException mtpe) {
+            throw new IllegalArgumentException("MimeType Parse Exception: " + mtpe.getMessage());
+        }
+
+        this.representationClass  = representationClass;
+        this.humanPresentableName = humanPresentableName;
+
+        mimeType.removeParameter("humanPresentableName");
+    }
+
+    /**
+     * Constructs a <code>DataFlavor</code> that represents a Java class.
+     * <p>
+     * The returned <code>DataFlavor</code> will have the following
+     * characteristics:
+     * <pre>
+     *    representationClass = representationClass
+     *    mimeType            = application/x-java-serialized-object
+     * </pre>
+     * @param representationClass the class used to transfer data in this flavor
+     * @param humanPresentableName the human-readable string used to identify
+     *                 this flavor; if this parameter is <code>null</code>
+     *                 then the value of the MIME Content Type is used
+     * @exception NullPointerException if <code>representationClass</code> is null
+     */
+    public DataFlavor(Class<?> representationClass, String humanPresentableName) {
+        this("application", "x-java-serialized-object", null, representationClass, humanPresentableName);
+        if (representationClass == null) {
+            throw new NullPointerException("representationClass");
+        }
+    }
+
+    /**
+     * Constructs a <code>DataFlavor</code> that represents a
+     * <code>MimeType</code>.
+     * <p>
+     * The returned <code>DataFlavor</code> will have the following
+     * characteristics:
+     * <p>
+     * If the <code>mimeType</code> is
+     * "application/x-java-serialized-object; class=&lt;representation class&gt;",
+     * the result is the same as calling
+     * <code>new DataFlavor(Class.forName(&lt;representation class&gt;)</code>.
+     * <p>
+     * Otherwise:
+     * <pre>
+     *     representationClass = InputStream
+     *     mimeType            = mimeType
+     * </pre>
+     * @param mimeType the string used to identify the MIME type for this flavor;
+     *                 if the <code>mimeType</code> does not specify a
+     *                 "class=" parameter, or if the class is not successfully
+     *                 loaded, then an <code>IllegalArgumentException</code>
+     *                 is thrown
+     * @param humanPresentableName the human-readable string used to identify
+     *                 this flavor; if this parameter is <code>null</code>
+     *                 then the value of the MIME Content Type is used
+     * @exception IllegalArgumentException if <code>mimeType</code> is
+     *                 invalid or if the class is not successfully loaded
+     * @exception NullPointerException if <code>mimeType</code> is null
+     */
+    public DataFlavor(String mimeType, String humanPresentableName) {
+        super();
+        if (mimeType == null) {
+            throw new NullPointerException("mimeType");
+        }
+        try {
+            initialize(mimeType, humanPresentableName, this.getClass().getClassLoader());
+        } catch (MimeTypeParseException mtpe) {
+            throw new IllegalArgumentException("failed to parse:" + mimeType);
+        } catch (ClassNotFoundException cnfe) {
+            throw new IllegalArgumentException("can't find specified class: " + cnfe.getMessage());
+        }
+    }
+
+    /**
+     * Constructs a <code>DataFlavor</code> that represents a
+     * <code>MimeType</code>.
+     * <p>
+     * The returned <code>DataFlavor</code> will have the following
+     * characteristics:
+     * <p>
+     * If the mimeType is
+     * "application/x-java-serialized-object; class=&lt;representation class&gt;",
+     * the result is the same as calling
+     * <code>new DataFlavor(Class.forName(&lt;representation class&gt;)</code>.
+     * <p>
+     * Otherwise:
+     * <pre>
+     *     representationClass = InputStream
+     *     mimeType            = mimeType
+     * </pre>
+     * @param mimeType the string used to identify the MIME type for this flavor
+     * @param humanPresentableName the human-readable string used to
+     *          identify this flavor
+     * @param classLoader the class loader to use
+     * @exception ClassNotFoundException if the class is not loaded
+     * @exception IllegalArgumentException if <code>mimeType</code> is
+     *                 invalid
+     * @exception NullPointerException if <code>mimeType</code> is null
+     */
+    public DataFlavor(String mimeType, String humanPresentableName, ClassLoader classLoader) throws ClassNotFoundException {
+        super();
+        if (mimeType == null) {
+            throw new NullPointerException("mimeType");
+        }
+        try {
+            initialize(mimeType, humanPresentableName, classLoader);
+        } catch (MimeTypeParseException mtpe) {
+            throw new IllegalArgumentException("failed to parse:" + mimeType);
+        }
+    }
+
+    /**
+     * Constructs a <code>DataFlavor</code> from a <code>mimeType</code> string.
+     * The string can specify a "class=&lt;fully specified Java class name&gt;"
+     * parameter to create a <code>DataFlavor</code> with the desired
+     * representation class. If the string does not contain "class=" parameter,
+     * <code>java.io.InputStream</code> is used as default.
+     *
+     * @param mimeType the string used to identify the MIME type for this flavor;
+     *                 if the class specified by "class=" parameter is not
+     *                 successfully loaded, then an
+     *                 <code>ClassNotFoundException</code> is thrown
+     * @exception ClassNotFoundException if the class is not loaded
+     * @exception IllegalArgumentException if <code>mimeType</code> is
+     *                 invalid
+     * @exception NullPointerException if <code>mimeType</code> is null
+     */
+    public DataFlavor(String mimeType) throws ClassNotFoundException {
+        super();
+        if (mimeType == null) {
+            throw new NullPointerException("mimeType");
+        }
+        try {
+            initialize(mimeType, null, this.getClass().getClassLoader());
+        } catch (MimeTypeParseException mtpe) {
+            throw new IllegalArgumentException("failed to parse:" + mimeType);
+        }
+    }
+
+   /**
+    * Common initialization code called from various constructors.
+    *
+    * @param mimeType the MIME Content Type (must have a class= param)
+    * @param humanPresentableName the human Presentable Name or
+    *                 <code>null</code>
+    * @param classLoader the fallback class loader to resolve against
+    *
+    * @throws MimeTypeParseException
+    * @throws ClassNotFoundException
+    * @throws  NullPointerException if <code>mimeType</code> is null
+    *
+    * @see #tryToLoadClass
+    */
+    private void initialize(String mimeType, String humanPresentableName, ClassLoader classLoader) throws MimeTypeParseException, ClassNotFoundException {
+        if (mimeType == null) {
+            throw new NullPointerException("mimeType");
+        }
+
+        this.mimeType = new MimeType(mimeType); // throws
+
+        String rcn = getParameter("class");
+
+        if (rcn == null) {
+            if ("application/x-java-serialized-object".equals(this.mimeType.getBaseType()))
+
+                throw new IllegalArgumentException("no representation class specified for:" + mimeType);
+            else
+                representationClass = java.io.InputStream.class; // default
+        } else { // got a class name
+            representationClass = DataFlavor.tryToLoadClass(rcn, classLoader);
+        }
+
+        this.mimeType.setParameter("class", representationClass.getName());
+
+        if (humanPresentableName == null) {
+            humanPresentableName = this.mimeType.getParameter("humanPresentableName");
+            if (humanPresentableName == null)
+                humanPresentableName = this.mimeType.getPrimaryType() + "/" + this.mimeType.getSubType();
+        }
+
+        this.humanPresentableName = humanPresentableName; // set it.
+
+        this.mimeType.removeParameter("humanPresentableName"); // just in case
+    }
+
+    /**
+     * String representation of this <code>DataFlavor</code> and its
+     * parameters. The resulting <code>String</code> contains the name of
+     * the <code>DataFlavor</code> class, this flavor's MIME type, and its
+     * representation class. If this flavor has a primary MIME type of "text",
+     * supports the charset parameter, and has an encoded representation, the
+     * flavor's charset is also included. See <code>selectBestTextFlavor</code>
+     * for a list of text flavors which support the charset parameter.
+     *
+     * @return  string representation of this <code>DataFlavor</code>
+     * @see #selectBestTextFlavor
+     */
+    public String toString() {
+        String string = getClass().getName();
+        string += "["+paramString()+"]";
+        return string;
+    }
+
+    private String paramString() {
+        String params = "";
+        params += "mimetype=";
+        if (mimeType == null) {
+            params += "null";
+        } else {
+            params += mimeType.getBaseType();
+        }
+        params += ";representationclass=";
+        if (representationClass == null) {
+           params += "null";
+        } else {
+           params += representationClass.getName();
+        }
+        if (DataFlavorUtil.isFlavorCharsetTextType(this) &&
+            (isRepresentationClassInputStream() ||
+             isRepresentationClassByteBuffer() ||
+             byte[].class.equals(representationClass)))
+        {
+            params += ";charset=" + DataFlavorUtil.getTextCharset(this);
+        }
+        return params;
+    }
+
+    /**
+     * Returns a <code>DataFlavor</code> representing plain text with Unicode
+     * encoding, where:
+     * <pre>
+     *     representationClass = java.io.InputStream
+     *     mimeType            = "text/plain;
+     *                            charset=&lt;platform default Unicode encoding&gt;"
+     * </pre>
+     * Sun's implementation for Microsoft Windows uses the encoding <code>utf-16le</code>.
+     * Sun's implementation for Solaris and Linux uses the encoding
+     * <code>iso-10646-ucs-2</code>.
+     *
+     * @return a <code>DataFlavor</code> representing plain text
+     *    with Unicode encoding
+     * @since 1.3
+     */
+    public static final DataFlavor getTextPlainUnicodeFlavor() {
+        return new DataFlavor(
+            "text/plain;charset=" + DataFlavorUtil.getDesktopService().getDefaultUnicodeEncoding()
+            +";class=java.io.InputStream", "Plain Text");
+    }
+
+    /**
+     * Selects the best text <code>DataFlavor</code> from an array of <code>
+     * DataFlavor</code>s. Only <code>DataFlavor.stringFlavor</code>, and
+     * equivalent flavors, and flavors that have a primary MIME type of "text",
+     * are considered for selection.
+     * <p>
+     * Flavors are first sorted by their MIME types in the following order:
+     * <ul>
+     * <li>"text/sgml"
+     * <li>"text/xml"
+     * <li>"text/html"
+     * <li>"text/rtf"
+     * <li>"text/enriched"
+     * <li>"text/richtext"
+     * <li>"text/uri-list"
+     * <li>"text/tab-separated-values"
+     * <li>"text/t140"
+     * <li>"text/rfc822-headers"
+     * <li>"text/parityfec"
+     * <li>"text/directory"
+     * <li>"text/css"
+     * <li>"text/calendar"
+     * <li>"application/x-java-serialized-object"
+     * <li>"text/plain"
+     * <li>"text/&lt;other&gt;"
+     * </ul>
+     * <p>For example, "text/sgml" will be selected over
+     * "text/html", and <code>DataFlavor.stringFlavor</code> will be chosen
+     * over <code>DataFlavor.plainTextFlavor</code>.
+     * <p>
+     * If two or more flavors share the best MIME type in the array, then that
+     * MIME type will be checked to see if it supports the charset parameter.
+     * <p>
+     * The following MIME types support, or are treated as though they support,
+     * the charset parameter:
+     * <ul>
+     * <li>"text/sgml"
+     * <li>"text/xml"
+     * <li>"text/html"
+     * <li>"text/enriched"
+     * <li>"text/richtext"
+     * <li>"text/uri-list"
+     * <li>"text/directory"
+     * <li>"text/css"
+     * <li>"text/calendar"
+     * <li>"application/x-java-serialized-object"
+     * <li>"text/plain"
+     * </ul>
+     * The following MIME types do not support, or are treated as though they
+     * do not support, the charset parameter:
+     * <ul>
+     * <li>"text/rtf"
+     * <li>"text/tab-separated-values"
+     * <li>"text/t140"
+     * <li>"text/rfc822-headers"
+     * <li>"text/parityfec"
+     * </ul>
+     * For "text/&lt;other&gt;" MIME types, the first time the JRE needs to
+     * determine whether the MIME type supports the charset parameter, it will
+     * check whether the parameter is explicitly listed in an arbitrarily
+     * chosen <code>DataFlavor</code> which uses that MIME type. If so, the JRE
+     * will assume from that point on that the MIME type supports the charset
+     * parameter and will not check again. If the parameter is not explicitly
+     * listed, the JRE will assume from that point on that the MIME type does
+     * not support the charset parameter and will not check again. Because
+     * this check is performed on an arbitrarily chosen
+     * <code>DataFlavor</code>, developers must ensure that all
+     * <code>DataFlavor</code>s with a "text/&lt;other&gt;" MIME type specify
+     * the charset parameter if it is supported by that MIME type. Developers
+     * should never rely on the JRE to substitute the platform's default
+     * charset for a "text/&lt;other&gt;" DataFlavor. Failure to adhere to this
+     * restriction will lead to undefined behavior.
+     * <p>
+     * If the best MIME type in the array does not support the charset
+     * parameter, the flavors which share that MIME type will then be sorted by
+     * their representation classes in the following order:
+     * <code>java.io.InputStream</code>, <code>java.nio.ByteBuffer</code>,
+     * <code>[B</code>, &lt;all others&gt;.
+     * <p>
+     * If two or more flavors share the best representation class, or if no
+     * flavor has one of the three specified representations, then one of those
+     * flavors will be chosen non-deterministically.
+     * <p>
+     * If the best MIME type in the array does support the charset parameter,
+     * the flavors which share that MIME type will then be sorted by their
+     * representation classes in the following order:
+     * <code>java.io.Reader</code>, <code>java.lang.String</code>,
+     * <code>java.nio.CharBuffer</code>, <code>[C</code>, &lt;all others&gt;.
+     * <p>
+     * If two or more flavors share the best representation class, and that
+     * representation is one of the four explicitly listed, then one of those
+     * flavors will be chosen non-deterministically. If, however, no flavor has
+     * one of the four specified representations, the flavors will then be
+     * sorted by their charsets. Unicode charsets, such as "UTF-16", "UTF-8",
+     * "UTF-16BE", "UTF-16LE", and their aliases, are considered best. After
+     * them, the platform default charset and its aliases are selected.
+     * "US-ASCII" and its aliases are worst. All other charsets are chosen in
+     * alphabetical order, but only charsets supported by this implementation
+     * of the Java platform will be considered.
+     * <p>
+     * If two or more flavors share the best charset, the flavors will then
+     * again be sorted by their representation classes in the following order:
+     * <code>java.io.InputStream</code>, <code>java.nio.ByteBuffer</code>,
+     * <code>[B</code>, &lt;all others&gt;.
+     * <p>
+     * If two or more flavors share the best representation class, or if no
+     * flavor has one of the three specified representations, then one of those
+     * flavors will be chosen non-deterministically.
+     *
+     * @param availableFlavors an array of available <code>DataFlavor</code>s
+     * @return the best (highest fidelity) flavor according to the rules
+     *         specified above, or <code>null</code>,
+     *         if <code>availableFlavors</code> is <code>null</code>,
+     *         has zero length, or contains no text flavors
+     * @since 1.3
+     */
+    public static final DataFlavor selectBestTextFlavor(
+                                       DataFlavor[] availableFlavors) {
+        if (availableFlavors == null || availableFlavors.length == 0) {
+            return null;
+        }
+
+        DataFlavor bestFlavor = Collections.max(Arrays.asList(availableFlavors),
+                                                DataFlavorUtil.getTextFlavorComparator());
+
+        if (!bestFlavor.isFlavorTextType()) {
+            return null;
+        }
+
+        return bestFlavor;
+    }
+
+    /**
+     * Gets a Reader for a text flavor, decoded, if necessary, for the expected
+     * charset (encoding). The supported representation classes are
+     * <code>java.io.Reader</code>, <code>java.lang.String</code>,
+     * <code>java.nio.CharBuffer</code>, <code>[C</code>,
+     * <code>java.io.InputStream</code>, <code>java.nio.ByteBuffer</code>,
+     * and <code>[B</code>.
+     * <p>
+     * Because text flavors which do not support the charset parameter are
+     * encoded in a non-standard format, this method should not be called for
+     * such flavors. However, in order to maintain backward-compatibility,
+     * if this method is called for such a flavor, this method will treat the
+     * flavor as though it supports the charset parameter and attempt to
+     * decode it accordingly. See <code>selectBestTextFlavor</code> for a list
+     * of text flavors which do not support the charset parameter.
+     *
+     * @param transferable the <code>Transferable</code> whose data will be
+     *        requested in this flavor
+     *
+     * @return a <code>Reader</code> to read the <code>Transferable</code>'s
+     *         data
+     *
+     * @exception IllegalArgumentException if the representation class
+     *            is not one of the seven listed above
+     * @exception IllegalArgumentException if the <code>Transferable</code>
+     *            has <code>null</code> data
+     * @exception NullPointerException if the <code>Transferable</code> is
+     *            <code>null</code>
+     * @exception UnsupportedEncodingException if this flavor's representation
+     *            is <code>java.io.InputStream</code>,
+     *            <code>java.nio.ByteBuffer</code>, or <code>[B</code> and
+     *            this flavor's encoding is not supported by this
+     *            implementation of the Java platform
+     * @exception UnsupportedFlavorException if the <code>Transferable</code>
+     *            does not support this flavor
+     * @exception IOException if the data cannot be read because of an
+     *            I/O error
+     * @see #selectBestTextFlavor
+     * @since 1.3
+     */
+    public Reader getReaderForText(Transferable transferable)
+        throws UnsupportedFlavorException, IOException
+    {
+        Object transferObject = transferable.getTransferData(this);
+        if (transferObject == null) {
+            throw new IllegalArgumentException
+                ("getTransferData() returned null");
+        }
+
+        if (transferObject instanceof Reader) {
+            return (Reader)transferObject;
+        } else if (transferObject instanceof String) {
+            return new StringReader((String)transferObject);
+        } else if (transferObject instanceof CharBuffer) {
+            CharBuffer buffer = (CharBuffer)transferObject;
+            int size = buffer.remaining();
+            char[] chars = new char[size];
+            buffer.get(chars, 0, size);
+            return new CharArrayReader(chars);
+        } else if (transferObject instanceof char[]) {
+            return new CharArrayReader((char[])transferObject);
+        }
+
+        InputStream stream = null;
+
+        if (transferObject instanceof InputStream) {
+            stream = (InputStream)transferObject;
+        } else if (transferObject instanceof ByteBuffer) {
+            ByteBuffer buffer = (ByteBuffer)transferObject;
+            int size = buffer.remaining();
+            byte[] bytes = new byte[size];
+            buffer.get(bytes, 0, size);
+            stream = new ByteArrayInputStream(bytes);
+        } else if (transferObject instanceof byte[]) {
+            stream = new ByteArrayInputStream((byte[])transferObject);
+        }
+
+        if (stream == null) {
+            throw new IllegalArgumentException("transfer data is not Reader, String, CharBuffer, char array, InputStream, ByteBuffer, or byte array");
+        }
+
+        String encoding = getParameter("charset");
+        return (encoding == null)
+            ? new InputStreamReader(stream)
+            : new InputStreamReader(stream, encoding);
+    }
+
+    /**
+     * Returns the MIME type string for this <code>DataFlavor</code>.
+     * @return the MIME type string for this flavor
+     */
+    public String getMimeType() {
+        return (mimeType != null) ? mimeType.toString() : null;
+    }
+
+    /**
+     * Returns the <code>Class</code> which objects supporting this
+     * <code>DataFlavor</code> will return when this <code>DataFlavor</code>
+     * is requested.
+     * @return the <code>Class</code> which objects supporting this
+     * <code>DataFlavor</code> will return when this <code>DataFlavor</code>
+     * is requested
+     */
+    public Class<?> getRepresentationClass() {
+        return representationClass;
+    }
+
+    /**
+     * Returns the human presentable name for the data format that this
+     * <code>DataFlavor</code> represents.  This name would be localized
+     * for different countries.
+     * @return the human presentable name for the data format that this
+     *    <code>DataFlavor</code> represents
+     */
+    public String getHumanPresentableName() {
+        return humanPresentableName;
+    }
+
+    /**
+     * Returns the primary MIME type for this <code>DataFlavor</code>.
+     * @return the primary MIME type of this <code>DataFlavor</code>
+     */
+    public String getPrimaryType() {
+        return (mimeType != null) ? mimeType.getPrimaryType() : null;
+    }
+
+    /**
+     * Returns the sub MIME type of this <code>DataFlavor</code>.
+     * @return the Sub MIME type of this <code>DataFlavor</code>
+     */
+    public String getSubType() {
+        return (mimeType != null) ? mimeType.getSubType() : null;
+    }
+
+    /**
+     * Returns the human presentable name for this <code>DataFlavor</code>
+     * if <code>paramName</code> equals "humanPresentableName".  Otherwise
+     * returns the MIME type value associated with <code>paramName</code>.
+     *
+     * @param paramName the parameter name requested
+     * @return the value of the name parameter, or <code>null</code>
+     *  if there is no associated value
+     */
+    public String getParameter(String paramName) {
+        if (paramName.equals("humanPresentableName")) {
+            return humanPresentableName;
+        } else {
+            return (mimeType != null)
+                ? mimeType.getParameter(paramName) : null;
+        }
+    }
+
+    /**
+     * Sets the human presentable name for the data format that this
+     * <code>DataFlavor</code> represents. This name would be localized
+     * for different countries.
+     * @param humanPresentableName the new human presentable name
+     */
+    public void setHumanPresentableName(String humanPresentableName) {
+        this.humanPresentableName = humanPresentableName;
+    }
+
+    /**
+     * {@inheritDoc}
+     * <p>
+     * The equals comparison for the {@code DataFlavor} class is implemented
+     * as follows: Two <code>DataFlavor</code>s are considered equal if and
+     * only if their MIME primary type and subtype and representation class are
+     * equal. Additionally, if the primary type is "text", the subtype denotes
+     * a text flavor which supports the charset parameter, and the
+     * representation class is not <code>java.io.Reader</code>,
+     * <code>java.lang.String</code>, <code>java.nio.CharBuffer</code>, or
+     * <code>[C</code>, the <code>charset</code> parameter must also be equal.
+     * If a charset is not explicitly specified for one or both
+     * <code>DataFlavor</code>s, the platform default encoding is assumed. See
+     * <code>selectBestTextFlavor</code> for a list of text flavors which
+     * support the charset parameter.
+     *
+     * @param o the <code>Object</code> to compare with <code>this</code>
+     * @return <code>true</code> if <code>that</code> is equivalent to this
+     *         <code>DataFlavor</code>; <code>false</code> otherwise
+     * @see #selectBestTextFlavor
+     */
+    public boolean equals(Object o) {
+        return ((o instanceof DataFlavor) && equals((DataFlavor)o));
+    }
+
+    /**
+     * This method has the same behavior as {@link #equals(Object)}.
+     * The only difference being that it takes a {@code DataFlavor} instance
+     * as a parameter.
+     *
+     * @param that the <code>DataFlavor</code> to compare with
+     *        <code>this</code>
+     * @return <code>true</code> if <code>that</code> is equivalent to this
+     *         <code>DataFlavor</code>; <code>false</code> otherwise
+     * @see #selectBestTextFlavor
+     */
+    public boolean equals(DataFlavor that) {
+        if (that == null) {
+            return false;
+        }
+        if (this == that) {
+            return true;
+        }
+
+        if (!Objects.equals(this.getRepresentationClass(), that.getRepresentationClass())) {
+            return false;
+        }
+
+        if (mimeType == null) {
+            if (that.mimeType != null) {
+                return false;
+            }
+        } else {
+            if (!mimeType.match(that.mimeType)) {
+                return false;
+            }
+
+            if ("text".equals(getPrimaryType())) {
+                if (DataFlavorUtil.doesSubtypeSupportCharset(this)
+                        && representationClass != null
+                        && !isStandardTextRepresentationClass()) {
+                    String thisCharset =
+                            DataFlavorUtil.canonicalName(this.getParameter("charset"));
+                    String thatCharset =
+                            DataFlavorUtil.canonicalName(that.getParameter("charset"));
+                    if (!Objects.equals(thisCharset, thatCharset)) {
+                        return false;
+                    }
+                }
+
+                if ("html".equals(getSubType())) {
+                    String thisDocument = this.getParameter("document");
+                    String thatDocument = that.getParameter("document");
+                    if (!Objects.equals(thisDocument, thatDocument)) {
+                        return false;
+                    }
+                }
+            }
+        }
+
+        return true;
+    }
+
+    /**
+     * Compares only the <code>mimeType</code> against the passed in
+     * <code>String</code> and <code>representationClass</code> is
+     * not considered in the comparison.
+     *
+     * If <code>representationClass</code> needs to be compared, then
+     * <code>equals(new DataFlavor(s))</code> may be used.
+     * @deprecated As inconsistent with <code>hashCode()</code> contract,
+     *             use <code>isMimeTypeEqual(String)</code> instead.
+     * @param s the {@code mimeType} to compare.
+     * @return true if the String (MimeType) is equal; false otherwise or if
+     *         {@code s} is {@code null}
+     */
+    @Deprecated
+    public boolean equals(String s) {
+        if (s == null || mimeType == null)
+            return false;
+        return isMimeTypeEqual(s);
+    }
+
+    /**
+     * Returns hash code for this <code>DataFlavor</code>.
+     * For two equal <code>DataFlavor</code>s, hash codes are equal.
+     * For the <code>String</code>
+     * that matches <code>DataFlavor.equals(String)</code>, it is not
+     * guaranteed that <code>DataFlavor</code>'s hash code is equal
+     * to the hash code of the <code>String</code>.
+     *
+     * @return a hash code for this <code>DataFlavor</code>
+     */
+    public int hashCode() {
+        int total = 0;
+
+        if (representationClass != null) {
+            total += representationClass.hashCode();
+        }
+
+        if (mimeType != null) {
+            String primaryType = mimeType.getPrimaryType();
+            if (primaryType != null) {
+                total += primaryType.hashCode();
+            }
+
+            // Do not add subType.hashCode() to the total. equals uses
+            // MimeType.match which reports a match if one or both of the
+            // subTypes is '*', regardless of the other subType.
+
+            if ("text".equals(primaryType)) {
+                if (DataFlavorUtil.doesSubtypeSupportCharset(this)
+                        && representationClass != null
+                        && !isStandardTextRepresentationClass()) {
+                    String charset = DataFlavorUtil.canonicalName(getParameter("charset"));
+                    if (charset != null) {
+                        total += charset.hashCode();
+                    }
+                }
+
+                if ("html".equals(getSubType())) {
+                    String document = this.getParameter("document");
+                    if (document != null) {
+                        total += document.hashCode();
+