Merge
authorctornqvi
Mon, 23 Feb 2015 05:01:11 -0800
changeset 29198 c1e6bf2dad41
parent 29197 bce1216dc498 (current diff)
parent 29090 bf691f42c812 (diff)
child 29211 b6362911d8ba
child 29316 5287df8a8972
Merge
hotspot/src/share/vm/oops/oop.inline2.hpp
jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/Aspect.java
jdk/make/data/charsetmapping/dbcs
jdk/make/data/charsetmapping/extsbcs
jdk/make/data/charsetmapping/sbcs
jdk/make/data/charsetmapping/standard-charsets
jdk/src/java.desktop/macosx/classes/sun/datatransfer/resources/flavormap.properties
jdk/src/java.desktop/share/classes/java/awt/datatransfer/Clipboard.java
jdk/src/java.desktop/share/classes/java/awt/datatransfer/ClipboardOwner.java
jdk/src/java.desktop/share/classes/java/awt/datatransfer/DataFlavor.java
jdk/src/java.desktop/share/classes/java/awt/datatransfer/FlavorEvent.java
jdk/src/java.desktop/share/classes/java/awt/datatransfer/FlavorListener.java
jdk/src/java.desktop/share/classes/java/awt/datatransfer/FlavorMap.java
jdk/src/java.desktop/share/classes/java/awt/datatransfer/FlavorTable.java
jdk/src/java.desktop/share/classes/java/awt/datatransfer/MimeType.java
jdk/src/java.desktop/share/classes/java/awt/datatransfer/MimeTypeParameterList.java
jdk/src/java.desktop/share/classes/java/awt/datatransfer/MimeTypeParseException.java
jdk/src/java.desktop/share/classes/java/awt/datatransfer/StringSelection.java
jdk/src/java.desktop/share/classes/java/awt/datatransfer/SystemFlavorMap.java
jdk/src/java.desktop/share/classes/java/awt/datatransfer/Transferable.java
jdk/src/java.desktop/share/classes/java/awt/datatransfer/UnsupportedFlavorException.java
jdk/src/java.desktop/share/classes/java/awt/datatransfer/package.html
jdk/src/java.desktop/share/classes/sun/datatransfer/DataFlavorUtil.java
jdk/src/java.desktop/share/classes/sun/datatransfer/DesktopDatatransferService.java
jdk/src/java.desktop/unix/classes/sun/awt/X11/XAWTFormatter.java
jdk/src/java.desktop/unix/classes/sun/datatransfer/resources/flavormap.properties
jdk/src/java.desktop/windows/classes/sun/datatransfer/resources/flavormap.properties
jdk/src/java.management/share/classes/java/lang/management/PlatformComponent.java
jdk/src/java.management/share/classes/sun/management/ExtendedPlatformComponent.java
jdk/src/java.security.acl/share/classes/java/security/acl/Acl.java
jdk/src/java.security.acl/share/classes/java/security/acl/AclEntry.java
jdk/src/java.security.acl/share/classes/java/security/acl/AclNotFoundException.java
jdk/src/java.security.acl/share/classes/java/security/acl/Group.java
jdk/src/java.security.acl/share/classes/java/security/acl/LastOwnerException.java
jdk/src/java.security.acl/share/classes/java/security/acl/NotOwnerException.java
jdk/src/java.security.acl/share/classes/java/security/acl/Owner.java
jdk/src/java.security.acl/share/classes/java/security/acl/Permission.java
jdk/src/java.security.acl/share/classes/java/security/acl/package-info.java
jdk/src/java.security.acl/share/classes/sun/security/acl/AclEntryImpl.java
jdk/src/java.security.acl/share/classes/sun/security/acl/AclImpl.java
jdk/src/java.security.acl/share/classes/sun/security/acl/AllPermissionsImpl.java
jdk/src/java.security.acl/share/classes/sun/security/acl/GroupImpl.java
jdk/src/java.security.acl/share/classes/sun/security/acl/OwnerImpl.java
jdk/src/java.security.acl/share/classes/sun/security/acl/PermissionImpl.java
jdk/src/java.security.acl/share/classes/sun/security/acl/PrincipalImpl.java
jdk/src/java.security.acl/share/classes/sun/security/acl/WorldGroupImpl.java
jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/Big5_HKSCS.java
jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/Big5_Solaris.java
jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/DelegatableDecoder.java
jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/DoubleByte.java
jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/EUC_JP.java
jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/EUC_JP_LINUX.java
jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/EUC_JP_Open.java
jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/ExtendedCharsets.java
jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/HKSCS.java
jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/MS950_HKSCS_XP.java
jdk/src/jdk.runtime/share/classes/com/sun/tracing/Probe.java
jdk/src/jdk.runtime/share/classes/com/sun/tracing/ProbeName.java
jdk/src/jdk.runtime/share/classes/com/sun/tracing/Provider.java
jdk/src/jdk.runtime/share/classes/com/sun/tracing/ProviderFactory.java
jdk/src/jdk.runtime/share/classes/com/sun/tracing/ProviderName.java
jdk/src/jdk.runtime/share/classes/com/sun/tracing/dtrace/ArgsAttributes.java
jdk/src/jdk.runtime/share/classes/com/sun/tracing/dtrace/Attributes.java
jdk/src/jdk.runtime/share/classes/com/sun/tracing/dtrace/DependencyClass.java
jdk/src/jdk.runtime/share/classes/com/sun/tracing/dtrace/FunctionAttributes.java
jdk/src/jdk.runtime/share/classes/com/sun/tracing/dtrace/FunctionName.java
jdk/src/jdk.runtime/share/classes/com/sun/tracing/dtrace/ModuleAttributes.java
jdk/src/jdk.runtime/share/classes/com/sun/tracing/dtrace/ModuleName.java
jdk/src/jdk.runtime/share/classes/com/sun/tracing/dtrace/NameAttributes.java
jdk/src/jdk.runtime/share/classes/com/sun/tracing/dtrace/ProviderAttributes.java
jdk/src/jdk.runtime/share/classes/com/sun/tracing/dtrace/StabilityLevel.java
jdk/src/jdk.runtime/share/classes/com/sun/tracing/dtrace/package-info.java
jdk/src/jdk.runtime/share/classes/com/sun/tracing/package-info.java
jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/PolicyTool.java
jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources.java
jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_de.java
jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_es.java
jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_fr.java
jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_it.java
jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_ja.java
jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_ko.java
jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_pt_BR.java
jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_sv.java
jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_zh_CN.java
jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_zh_HK.java
jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_zh_TW.java
jdk/src/jdk.runtime/share/classes/sun/tracing/MultiplexProviderFactory.java
jdk/src/jdk.runtime/share/classes/sun/tracing/NullProviderFactory.java
jdk/src/jdk.runtime/share/classes/sun/tracing/PrintStreamProviderFactory.java
jdk/src/jdk.runtime/share/classes/sun/tracing/ProbeSkeleton.java
jdk/src/jdk.runtime/share/classes/sun/tracing/ProviderSkeleton.java
jdk/src/jdk.runtime/share/classes/sun/tracing/dtrace/Activation.java
jdk/src/jdk.runtime/share/classes/sun/tracing/dtrace/DTraceProbe.java
jdk/src/jdk.runtime/share/classes/sun/tracing/dtrace/DTraceProvider.java
jdk/src/jdk.runtime/share/classes/sun/tracing/dtrace/DTraceProviderFactory.java
jdk/src/jdk.runtime/share/classes/sun/tracing/dtrace/JVM.java
jdk/src/jdk.runtime/share/classes/sun/tracing/package-info.java
jdk/src/jdk.runtime/share/native/libjsdt/JVM.c
jdk/src/jdk.runtime/share/native/libjsdt/jvm_symbols.h
jdk/src/jdk.runtime/unix/native/libjsdt/jvm_symbols_md.c
jdk/src/jdk.runtime/windows/native/libjsdt/jvm_symbols_md.c
jdk/test/com/sun/tracing/BasicFunctionality.java
jdk/test/com/sun/tracing/BasicWithSecurityMgr.java
jdk/test/java/awt/color/LoadProfileWithSM.java
jdk/test/java/awt/color/LoadStandardProfilesTest.java
langtools/test/tools/javac/resolve/tests/PrimitiveBinopOverload.java
--- a/.hgtags	Wed Feb 18 22:19:47 2015 -0500
+++ b/.hgtags	Mon Feb 23 05:01:11 2015 -0800
@@ -291,3 +291,6 @@
 722378bc599e38d9a1dd484de30f10dfd7b21438 jdk9-b46
 8327024a99559982b848e9c2191da9c0bf8838fd jdk9-b47
 b2f9702efbe95527ea3a991474fda23987ff1c5c jdk9-b48
+5b8db585a33c3cc48e70e688ceee57dd9271dc5d jdk9-b49
+1550b2f6b63d1411fa84dc7bbc6f04809aedb43f jdk9-b50
+6efe265424e3f1ea596408a1f71baf2de316c772 jdk9-b51
--- a/.hgtags-top-repo	Wed Feb 18 22:19:47 2015 -0500
+++ b/.hgtags-top-repo	Mon Feb 23 05:01:11 2015 -0800
@@ -291,3 +291,6 @@
 12f1e276447bcc81516e85367d53e4f08897049d jdk9-b46
 b6cca3e6175a69f39e5799b7349ddb0176630291 jdk9-b47
 0064e246d83f6f9fc245c19b6d05041ecaf4b6d4 jdk9-b48
+d91ed1951b948210590ce1394bea5515357246ba jdk9-b49
+d1f37d39ff2421f956a6ddf316cf763807bc3363 jdk9-b50
+6207b4b8731ca75c51b031c47daa813ab92ef558 jdk9-b51
--- a/Makefile	Wed Feb 18 22:19:47 2015 -0500
+++ b/Makefile	Mon Feb 23 05:01:11 2015 -0800
@@ -48,6 +48,17 @@
 endif
 root_dir:=$(patsubst %/,%,$(dir $(makefile_path)))
 
+ifeq ($(MAIN_TARGETS), )
+  COMMAND_LINE_VARIABLES:=$(subst =command,,$(filter %=command,$(foreach var,$(.VARIABLES),$(var)=$(firstword $(origin $(var))))))
+  MAKE_CONTROL_VARIABLES:=LOG CONF SPEC JOBS TEST IGNORE_OLD_CONFIG
+  UNKNOWN_COMMAND_LINE_VARIABLES:=$(strip $(filter-out $(MAKE_CONTROL_VARIABLES), $(COMMAND_LINE_VARIABLES)))
+  ifneq ($(UNKNOWN_COMMAND_LINE_VARIABLES), )
+    $(info Note: Command line contains non-control variables: $(UNKNOWN_COMMAND_LINE_VARIABLES).)
+    $(info Make sure it is not mistyped, and that you intend to override this variable.)
+    $(info 'make help' will list known control variables)
+  endif
+endif
+
 ifneq ($(findstring qp,$(MAKEFLAGS)),)
   # When called with -qp, assume an external part (e.g. bash completion) is trying
   # to understand our targets.
@@ -148,62 +159,64 @@
 # Here are "global" targets, i.e. targets that can be executed without specifying a single configuration.
 # If you add more global targets, please update the variable global_targets in MakeHelpers.
 
+# Helper macro to allow $(info) to properly print strings beginning with spaces.
+_:=
+
 help:
 	$(info )
 	$(info OpenJDK Makefile help)
 	$(info =====================)
 	$(info )
 	$(info Common make targets)
-	$(info .  make [default]         # Compile all modules in langtools, hotspot, jaxp, jaxws,)
-	$(info .                         # corba and jdk and create a runnable "exploded" image)
-	$(info .  make all               # Compile everything, all repos, docs and images)
-	$(info .  make images            # Create complete jdk and jre images)
-	$(info .  make <phase>           # Compile the specified phase and everything it depends on)
-	$(info .                         # (gensrc, java, copy, libs, launchers, gendata, rmic))
-	$(info .  make *-only            # Applies to most targets and disables compling the)
-	$(info .                         # dependencies for the target. This is faster but may)
-	$(info .                         # result in incorrect build results!)
-	$(info .  make docs              # Create all docs)
-	$(info .  make docs-javadoc      # Create just javadocs, depends on less than full docs)
-	$(info .  make profiles          # Create complete jre compact profile images)
-	$(info .  make bootcycle-images  # Build images twice, second time with newly built JDK)
-	$(info .  make install           # Install the generated images locally)
-	$(info .  make reconfigure       # Rerun configure with the same arguments as last time)
-	$(info .  make help              # Give some help on using make)
-	$(info .  make test              # Run tests, default is all tests (see TEST below))
+	$(info $(_) make [default]         # Compile all modules in langtools, hotspot, jdk, jaxws,)
+	$(info $(_)                        # jaxp and corba, and create a runnable "exploded" image)
+	$(info $(_) make all               # Compile everything, all repos, docs and images)
+	$(info $(_) make images            # Create complete j2sdk and j2re images)
+	$(info $(_) make <phase>           # Build the specified phase and everything it depends on)
+	$(info $(_)                        # (gensrc, java, copy, libs, launchers, gendata, rmic))
+	$(info $(_) make *-only            # Applies to most targets and disables compling the)
+	$(info $(_)                        # dependencies for the target. This is faster but may)
+	$(info $(_)                        # result in incorrect build results!)
+	$(info $(_) make docs              # Create all docs)
+	$(info $(_) make docs-javadoc      # Create just javadocs, depends on less than full docs)
+	$(info $(_) make profiles          # Create complete j2re compact profile images)
+	$(info $(_) make bootcycle-images  # Build images twice, second time with newly built JDK)
+	$(info $(_) make install           # Install the generated images locally)
+	$(info $(_) make reconfigure       # Rerun configure with the same arguments as last time)
+	$(info $(_) make help              # Give some help on using make)
+	$(info $(_) make test              # Run tests, default is all tests (see TEST below))
 	$(info )
 	$(info Targets for cleaning)
-	$(info .  make clean             # Remove all files generated by make, but not those)
-	$(info .                         # generated by configure)
-	$(info .  make dist-clean        # Remove all files, including configuration)
-	$(info .  make clean-<outputdir> # Remove the subdir in the output dir with the name)
-	$(info .  make clean-<phase>     # Remove all build results related to a certain build)
-	$(info .                         # phase (gensrc, java, libs, launchers))
-	$(info .  make clean-<module>    # Remove all build results related to a certain module)
-	$(info .  make clean-<module>-<phase> # Remove all build results related to a certain)
-	$(info .                         # module and phase)
+	$(info $(_) make clean             # Remove all files generated by make, but not those)
+	$(info $(_)                        # generated by configure)
+	$(info $(_) make dist-clean        # Remove all files, including configuration)
+	$(info $(_) make clean-<outputdir> # Remove the subdir in the output dir with the name)
+	$(info $(_) make clean-<phase>     # Remove all build results related to a certain build)
+	$(info $(_)                        # phase (gensrc, java, libs, launchers))
+	$(info $(_) make clean-<module>    # Remove all build results related to a certain module)
+	$(info $(_) make clean-<module>-<phase> # Remove all build results related to a certain)
+	$(info $(_)                        # module and phase)
 	$(info )
 	$(info Targets for specific modules)
-	$(info .  make <module>          # Build <module> and everything it depends on. )
-	$(info .  make <module>-<phase>  # Compile the specified phase for the specified module)
-	$(info .                         # and everything it depends on)
-	$(info .                         # (gensrc, java, copy, libs, launchers, gendata, rmic))
-	$(info )
-	$(info Useful make variables)
-	$(info .  make CONF=             # Build all configurations (note, assignment is empty))
-	$(info .  make CONF=<substring>  # Build the configuration(s) with a name matching)
-	$(info .                         # <substring>)
+	$(info $(_) make <module>          # Build <module> and everything it depends on.)
+	$(info $(_) make <module>-<phase>  # Compile the specified phase for the specified module)
+	$(info $(_)                        # and everything it depends on)
+	$(info $(_)                        # (gensrc, java, copy, libs, launchers, gendata, rmic))
 	$(info )
-	$(info .  make LOG=<loglevel>    # Change the log level from warn to <loglevel>)
-	$(info .                         # Available log levels are:)
-	$(info .                         # 'warn' (default), 'info', 'debug' and 'trace')
-	$(info .                         # To see executed command lines, use LOG=debug)
-	$(info )
-	$(info .  make JOBS=<n>          # Run <n> parallel make jobs)
-	$(info .                         # Note that -jN does not work as expected!)
-	$(info )
-	$(info .  make test TEST=<test>  # Only run the given test or tests, e.g.)
-	$(info .                         # make test TEST="jdk_lang jdk_net")
+	$(info Make control variables)
+	$(info $(_) CONF=                  # Build all configurations (note, assignment is empty))
+	$(info $(_) CONF=<substring>       # Build the configuration(s) with a name matching)
+	$(info $(_)                        # <substring>)
+	$(info $(_) SPEC=<spec file>       # Build the configuration given by the spec file)
+	$(info $(_) LOG=<loglevel>         # Change the log level from warn to <loglevel>)
+	$(info $(_)                        # Available log levels are:)
+	$(info $(_)                        # 'warn' (default), 'info', 'debug' and 'trace')
+	$(info $(_)                        # To see executed command lines, use LOG=debug)
+	$(info $(_) JOBS=<n>               # Run <n> parallel make jobs)
+	$(info $(_)                        # Note that -jN does not work as expected!)
+	$(info $(_) IGNORE_OLD_CONFIG=true # Skip tests if spec file is up to date)
+	$(info $(_) make test TEST=<test>  # Only run the given test or tests, e.g.)
+	$(info $(_)                        # make test TEST="jdk_lang jdk_net")
 	$(info )
 
 .PHONY: help
--- a/README-builds.html	Wed Feb 18 22:19:47 2015 -0500
+++ b/README-builds.html	Mon Feb 23 05:01:11 2015 -0800
@@ -1463,14 +1463,13 @@
 
                 <h4>Building with ccache</h4>
 
-                <p>A simple way to radically speed up compilation of native code
-                    (typically hotspot and native libraries in JDK) is to install
-                    ccache. This will cache and reuse prior compilation results, if the
-                    source code is unchanged. However, ccache versions prior to 3.1.4
-                    does not work correctly with the precompiled headers used in
-                    OpenJDK. So if your platform supports ccache at 3.1.4 or later, we
-                    highly recommend installing it. This is currently only supported on
-                    linux.</p> 
+                <p>The OpenJDK build supports building with ccache 
+                    when using gcc or clang. Using ccache can
+                    radically speed up compilation of native code if
+                    you often rebuild the same sources. Your milage
+                    may vary however so we recommend evaluating it for
+                    yourself. To enable it, make sure it's on the path
+                    and configure with <code>--enable-ccache</code>.</p> 
 
                 <h4>Building on local disk</h4>
 
--- a/common/autoconf/basics.m4	Wed Feb 18 22:19:47 2015 -0500
+++ b/common/autoconf/basics.m4	Mon Feb 23 05:01:11 2015 -0800
@@ -242,6 +242,9 @@
 [
   # Save the original command line. This is passed to us by the wrapper configure script.
   AC_SUBST(CONFIGURE_COMMAND_LINE)
+  # Save the path variable before it gets changed
+  ORIGINAL_PATH="$PATH"
+  AC_SUBST(ORIGINAL_PATH)
   DATE_WHEN_CONFIGURED=`LANG=C date`
   AC_SUBST(DATE_WHEN_CONFIGURED)
   AC_MSG_NOTICE([Configuration created at $DATE_WHEN_CONFIGURED.])
@@ -896,10 +899,6 @@
   fi
   AC_SUBST(IS_GNU_TIME)
 
-  if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
-    BASIC_REQUIRE_PROGS(COMM, comm)
-  fi
-
   if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
     BASIC_REQUIRE_PROGS(DSYMUTIL, dsymutil)
     BASIC_REQUIRE_PROGS(XATTR, xattr)
--- a/common/autoconf/build-performance.m4	Wed Feb 18 22:19:47 2015 -0500
+++ b/common/autoconf/build-performance.m4	Mon Feb 23 05:01:11 2015 -0800
@@ -164,19 +164,26 @@
       [enable using ccache to speed up recompilations @<:@disabled@:>@])])
 
   CCACHE=
+  CCACHE_STATUS=
   AC_MSG_CHECKING([is ccache enabled])
-  ENABLE_CCACHE=$enable_ccache
   if test "x$enable_ccache" = xyes; then
-    AC_MSG_RESULT([yes])
-    OLD_PATH="$PATH"
-    if test "x$TOOLCHAIN_PATH" != x; then
-      PATH=$TOOLCHAIN_PATH:$PATH
+    if test "x$TOOLCHAIN_TYPE" = "xgcc" -o "x$TOOLCHAIN_TYPE" = "xclang"; then
+      AC_MSG_RESULT([yes])
+      OLD_PATH="$PATH"
+      if test "x$TOOLCHAIN_PATH" != x; then
+        PATH=$TOOLCHAIN_PATH:$PATH
+      fi
+      BASIC_REQUIRE_PROGS(CCACHE, ccache)
+      PATH="$OLD_PATH"
+      CCACHE_VERSION=[`$CCACHE --version | head -n1 | $SED 's/[A-Za-z ]*//'`]
+      CCACHE_STATUS="Active ($CCACHE_VERSION)"
+    else
+      AC_MSG_RESULT([no])
+      AC_MSG_WARN([ccache is not supported with toolchain type $TOOLCHAIN_TYPE])
     fi
-    BASIC_REQUIRE_PROGS(CCACHE, ccache)
-    CCACHE_STATUS="enabled"
-    PATH="$OLD_PATH"
   elif test "x$enable_ccache" = xno; then
     AC_MSG_RESULT([no, explicitly disabled])
+    CCACHE_STATUS="Disabled"
   elif test "x$enable_ccache" = x; then
     AC_MSG_RESULT([no])
   else
@@ -206,35 +213,31 @@
 AC_DEFUN([BPERF_SETUP_CCACHE_USAGE],
 [
   if test "x$CCACHE" != x; then
-    # Only use ccache if it is 3.1.4 or later, which supports
-    # precompiled headers.
-    AC_MSG_CHECKING([if ccache supports precompiled headers])
-    HAS_GOOD_CCACHE=`($CCACHE --version | head -n 1 | grep -E 3.1.@<:@456789@:>@) 2> /dev/null`
-    if test "x$HAS_GOOD_CCACHE" = x; then
-      AC_MSG_RESULT([no, disabling ccache])
-      CCACHE=
-      CCACHE_STATUS="disabled"
-    else
-      AC_MSG_RESULT([yes])
+    if test "x$USE_PRECOMPILED_HEADER" = "x1"; then
+      HAS_BAD_CCACHE=[`$ECHO $CCACHE_VERSION | \
+          $GREP -e '^1.*' -e '^2.*' -e '^3\.0.*' -e '^3\.1\.[0123]'`]
+      if test "x$HAS_BAD_CCACHE" != "x"; then
+        AC_MSG_ERROR([Precompiled headers requires ccache 3.1.4 or later, found $CCACHE_VERSION])
+      fi
       AC_MSG_CHECKING([if C-compiler supports ccache precompiled headers])
+      CCACHE_PRECOMP_FLAG="-fpch-preprocess"
       PUSHED_FLAGS="$CXXFLAGS"
-      CXXFLAGS="-fpch-preprocess $CXXFLAGS"
+      CXXFLAGS="$CCACHE_PRECOMP_FLAG $CXXFLAGS"
       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])], [CC_KNOWS_CCACHE_TRICK=yes], [CC_KNOWS_CCACHE_TRICK=no])
       CXXFLAGS="$PUSHED_FLAGS"
       if test "x$CC_KNOWS_CCACHE_TRICK" = xyes; then
         AC_MSG_RESULT([yes])
+        CFLAGS_CCACHE="$CCACHE_PRECOMP_FLAG"
+        AC_SUBST(CFLAGS_CCACHE)
+        CCACHE_SLOPPINESS=pch_defines,time_macros
       else
-        AC_MSG_RESULT([no, disabling ccaching of precompiled headers])
-        CCACHE=
-        CCACHE_STATUS="disabled"
+        AC_MSG_RESULT([no])
+        AC_MSG_ERROR([Cannot use ccache with precompiled headers without compiler support for $CCACHE_PRECOMP_FLAG])
       fi
     fi
-  fi
 
-  if test "x$CCACHE" != x; then
-    CCACHE_SLOPPINESS=time_macros
-    CCACHE="CCACHE_COMPRESS=1 $SET_CCACHE_DIR CCACHE_SLOPPINESS=$CCACHE_SLOPPINESS $CCACHE"
-    CCACHE_FLAGS=-fpch-preprocess
+    CCACHE="CCACHE_COMPRESS=1 $SET_CCACHE_DIR \
+        CCACHE_SLOPPINESS=$CCACHE_SLOPPINESS CCACHE_BASEDIR=$TOPDIR $CCACHE"
 
     if test "x$SET_CCACHE_DIR" != x; then
       mkdir -p $CCACHE_DIR > /dev/null 2>&1
--- a/common/autoconf/configure	Wed Feb 18 22:19:47 2015 -0500
+++ b/common/autoconf/configure	Mon Feb 23 05:01:11 2015 -0800
@@ -40,8 +40,9 @@
   echo "Error: This script must be run using bash." 1>&2
   exit 1
 fi
-# Force autoconf to use bash
+# Force autoconf to use bash. This also means we must disable autoconf re-exec.
 export CONFIG_SHELL=$BASH
+export _as_can_reexec=no
 
 conf_script_dir="$TOPDIR/common/autoconf"
 
--- a/common/autoconf/flags.m4	Wed Feb 18 22:19:47 2015 -0500
+++ b/common/autoconf/flags.m4	Mon Feb 23 05:01:11 2015 -0800
@@ -558,15 +558,23 @@
     CFLAGS_JDK="$CFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC"
     CXXFLAGS_JDK="$CXXFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC"
   elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
-    COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Zi -MD -Zc:wchar_t- -W3 -wd4800 \
-    -D_STATIC_CPPLIB -D_DISABLE_DEPRECATE_STATIC_CPPLIB -DWIN32_LEAN_AND_MEAN \
-    -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \
-    -DWIN32 -DIAL"
+    COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK \
+        -Zi -MD -Zc:wchar_t- -W3 -wd4800 \
+        -DWIN32_LEAN_AND_MEAN \
+        -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \
+        -DWIN32 -DIAL"
     if test "x$OPENJDK_TARGET_CPU" = xx86_64; then
       COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_AMD64_ -Damd64"
     else
       COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_X86_ -Dx86"
     fi
+    # If building with Visual Studio 2010, we can still use _STATIC_CPPLIB to
+    # avoid bundling msvcpNNN.dll. Doesn't work with newer versions of visual
+    # studio.
+    if test "x$TOOLCHAIN_VERSION" = "x2010"; then
+      COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK \
+          -D_STATIC_CPPLIB -D_DISABLE_DEPRECATE_STATIC_CPPLIB"
+    fi
   fi
 
   ###############################################################################
--- a/common/autoconf/generated-configure.sh	Wed Feb 18 22:19:47 2015 -0500
+++ b/common/autoconf/generated-configure.sh	Mon Feb 23 05:01:11 2015 -0800
@@ -629,6 +629,7 @@
 
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
+CFLAGS_CCACHE
 CCACHE
 USE_PRECOMPILED_HEADER
 SJAVAC_SERVER_DIR
@@ -645,6 +646,7 @@
 ENABLE_INTREE_EC
 SALIB_NAME
 HOTSPOT_MAKE_ARGS
+MSVCP_DLL
 MSVCR_DLL
 LIBCXX
 LLVM_LIBS
@@ -991,6 +993,7 @@
 BASH
 BASENAME
 DATE_WHEN_CONFIGURED
+ORIGINAL_PATH
 CONFIGURE_COMMAND_LINE
 target_alias
 host_alias
@@ -1077,6 +1080,7 @@
 with_override_jdk
 with_import_hotspot
 with_toolchain_type
+with_toolchain_version
 with_jtreg
 with_extra_cflags
 with_extra_cxxflags
@@ -1101,6 +1105,7 @@
 with_zlib
 with_stdc__lib
 with_msvcr_dll
+with_msvcp_dll
 with_dxsdk
 with_dxsdk_lib
 with_dxsdk_include
@@ -1932,6 +1937,10 @@
                           source
   --with-toolchain-type   the toolchain type (or family) to use, use '--help'
                           to show possible values [platform dependent]
+  --with-toolchain-version
+                          the version of the toolchain to look for, use
+                          '--help' to show possible values [platform
+                          dependent]
   --with-jtreg            Regression Test Harness [probed]
   --with-extra-cflags     extra flags to be used when compiling jdk c-files
   --with-extra-cxxflags   extra flags to be used when compiling jdk c++-files
@@ -1967,8 +1976,10 @@
                           force linking of the C++ runtime on Linux to either
                           static or dynamic, default is static with dynamic as
                           fallback
-  --with-msvcr-dll        copy this msvcr100.dll into the built JDK (Windows
-                          only) [probed]
+  --with-msvcr-dll        path to microsoft C runtime dll (msvcr*.dll)
+                          (Windows only) [probed]
+  --with-msvcp-dll        path to microsoft C++ runtime dll (msvcp*.dll)
+                          (Windows only) [probed]
   --with-dxsdk            Deprecated. Option is kept for backwards
                           compatibility and is ignored
   --with-dxsdk-lib        Deprecated. Option is kept for backwards
@@ -4307,12 +4318,59 @@
 # questions.
 #
 
-
-
-
-
-
-
+################################################################################
+
+VALID_VS_VERSIONS="2010 2012 2013"
+
+VS_DESCRIPTION_2010="Microsoft Visual Studio 2010"
+VS_VERSION_INTERNAL_2010=100
+VS_MSVCR_2010=msvcr100.dll
+# We don't use msvcp on Visual Studio 2010
+#VS_MSVCP_2010=msvcp100.dll
+VS_ENVVAR_2010="VS100COMNTOOLS"
+VS_VS_INSTALLDIR_2010="Microsoft Visual Studio 10.0"
+VS_SDK_INSTALLDIR_2010="Microsoft SDKs/Windows/v7.1"
+VS_VS_PLATFORM_NAME_2010="v100"
+VS_SDK_PLATFORM_NAME_2010="Windows7.1SDK"
+
+VS_DESCRIPTION_2012="Microsoft Visual Studio 2012"
+VS_VERSION_INTERNAL_2012=110
+VS_MSVCR_2012=msvcr110.dll
+VS_MSVCP_2012=msvcp110.dll
+VS_ENVVAR_2012="VS110COMNTOOLS"
+VS_VS_INSTALLDIR_2012="Microsoft Visual Studio 11.0"
+VS_SDK_INSTALLDIR_2012=
+VS_VS_PLATFORM_NAME_2012="v110"
+VS_SDK_PLATFORM_NAME_2012=
+
+VS_DESCRIPTION_2013="Microsoft Visual Studio 2013"
+VS_VERSION_INTERNAL_2013=120
+VS_MSVCR_2013=msvcr120.dll
+VS_MSVCP_2013=msvcp120.dll
+VS_ENVVAR_2013="VS120COMNTOOLS"
+VS_VS_INSTALLDIR_2013="Microsoft Visual Studio 12.0"
+VS_SDK_INSTALLDIR_2013=
+VS_VS_PLATFORM_NAME_2013="v120"
+VS_SDK_PLATFORM_NAME_2013=
+
+################################################################################
+
+
+
+################################################################################
+
+
+
+################################################################################
+# Finds the bat or cmd file in Visual Studio or the SDK that sets up a proper
+# build environment and assigns it to VS_ENV_CMD
+
+
+################################################################################
+
+
+
+################################################################################
 # Check if the VS env variables were setup prior to running configure.
 # If not, then find vcvarsall.bat and run it automatically, and integrate
 # the set env variables into the spec file.
@@ -4327,13 +4385,15 @@
 
 
 
+
+
 # This line needs to be here, verbatim, after all includes and the dummy hook
 # definitions. It is replaced with custom functionality when building
 # custom sources.
 #CUSTOM_AUTOCONF_INCLUDE
 
 # Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1421247827
+DATE_WHEN_GENERATED=1424202275
 
 ###############################################################################
 #
@@ -4366,6 +4426,9 @@
 
   # Save the original command line. This is passed to us by the wrapper configure script.
 
+  # Save the path variable before it gets changed
+  ORIGINAL_PATH="$PATH"
+
   DATE_WHEN_CONFIGURED=`LANG=C date`
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: Configuration created at $DATE_WHEN_CONFIGURED." >&5
@@ -18825,202 +18888,6 @@
   fi
 
 
-  if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
-
-
-
-  # Publish this variable in the help.
-
-
-  if test "x$COMM" = x; then
-    # The variable is not set by user, try to locate tool using the code snippet
-    for ac_prog in comm
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_COMM+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $COMM in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_COMM="$COMM" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_COMM="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-  ;;
-esac
-fi
-COMM=$ac_cv_path_COMM
-if test -n "$COMM"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $COMM" >&5
-$as_echo "$COMM" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$COMM" && break
-done
-
-  else
-    # The variable is set, but is it from the command line or the environment?
-
-    # Try to remove the string !COMM! from our list.
-    try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!COMM!/}
-    if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then
-      # If it failed, the variable was not from the command line. Ignore it,
-      # but warn the user (except for BASH, which is always set by the calling BASH).
-      if test "xCOMM" != xBASH; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of COMM from the environment. Use command line variables instead." >&5
-$as_echo "$as_me: WARNING: Ignoring value of COMM from the environment. Use command line variables instead." >&2;}
-      fi
-      # Try to locate tool using the code snippet
-      for ac_prog in comm
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_COMM+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $COMM in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_COMM="$COMM" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_COMM="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-  ;;
-esac
-fi
-COMM=$ac_cv_path_COMM
-if test -n "$COMM"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $COMM" >&5
-$as_echo "$COMM" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$COMM" && break
-done
-
-    else
-      # If it succeeded, then it was overridden by the user. We will use it
-      # for the tool.
-
-      # First remove it from the list of overridden variables, so we can test
-      # for unknown variables in the end.
-      CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var"
-
-      # Check if the provided tool contains a complete path.
-      tool_specified="$COMM"
-      tool_basename="${tool_specified##*/}"
-      if test "x$tool_basename" = "x$tool_specified"; then
-        # A command without a complete path is provided, search $PATH.
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool COMM=$tool_basename" >&5
-$as_echo "$as_me: Will search for user supplied tool COMM=$tool_basename" >&6;}
-        # Extract the first word of "$tool_basename", so it can be a program name with args.
-set dummy $tool_basename; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_COMM+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $COMM in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_COMM="$COMM" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_COMM="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-  ;;
-esac
-fi
-COMM=$ac_cv_path_COMM
-if test -n "$COMM"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $COMM" >&5
-$as_echo "$COMM" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-        if test "x$COMM" = x; then
-          as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5
-        fi
-      else
-        # Otherwise we believe it is a complete path. Use it as it is.
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool COMM=$tool_specified" >&5
-$as_echo "$as_me: Will use user supplied tool COMM=$tool_specified" >&6;}
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for COMM" >&5
-$as_echo_n "checking for COMM... " >&6; }
-        if test ! -x "$tool_specified"; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
-$as_echo "not found" >&6; }
-          as_fn_error $? "User supplied tool COMM=$tool_specified does not exist or is not executable" "$LINENO" 5
-        fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5
-$as_echo "$tool_specified" >&6; }
-      fi
-    fi
-  fi
-
-
-
-  if test "x$COMM" = x; then
-    as_fn_error $? "Could not find required tool for COMM" "$LINENO" 5
-  fi
-
-
-  fi
-
   if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
 
 
@@ -26695,86 +26562,177 @@
 
   # First-hand choice is to locate and run the vsvars bat file.
 
-  if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
-    VCVARSFILE="vc/bin/vcvars32.bat"
-  else
-    VCVARSFILE="vc/bin/amd64/vcvars64.bat"
+
+# Check whether --with-toolchain-version was given.
+if test "${with_toolchain_version+set}" = set; then :
+  withval=$with_toolchain_version;
+fi
+
+
+  if test "x$with_toolchain_version" = xlist; then
+    # List all toolchains
+    { $as_echo "$as_me:${as_lineno-$LINENO}: The following toolchain versions are valid on this platform:" >&5
+$as_echo "$as_me: The following toolchain versions are valid on this platform:" >&6;}
+    for version in $VALID_VS_VERSIONS; do
+      eval VS_DESCRIPTION=\${VS_DESCRIPTION_$version}
+      $PRINTF "  %-10s  %s\n" $version "$VS_DESCRIPTION"
+    done
+
+    exit 0
+  elif test "x$with_toolchain_version" != x; then
+    # User override; check that it is valid
+    if test "x${VALID_VS_VERSIONS/$with_toolchain_version/}" = "x${VALID_VS_VERSIONS}"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Visual Studio version $with_toolchain_version is not valid." >&5
+$as_echo "$as_me: Visual Studio version $with_toolchain_version is not valid." >&6;}
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Valid Visual Studio versions: $VALID_VS_VERSIONS." >&5
+$as_echo "$as_me: Valid Visual Studio versions: $VALID_VS_VERSIONS." >&6;}
+      as_fn_error $? "Cannot continue." "$LINENO" 5
+    fi
+    VS_VERSIONS_PROBE_LIST="$with_toolchain_version"
+  else
+    # No flag given, use default
+    VS_VERSIONS_PROBE_LIST="$VALID_VS_VERSIONS"
+  fi
+
+  for VS_VERSION in $VS_VERSIONS_PROBE_LIST; do
+
+  VS_VERSION="$VS_VERSION"
+  eval VS_COMNTOOLS_VAR="\${VS_ENVVAR_${VS_VERSION}}"
+  eval VS_COMNTOOLS="\$${VS_COMNTOOLS_VAR}"
+  eval VS_INSTALL_DIR="\${VS_VS_INSTALLDIR_${VS_VERSION}}"
+  eval SDK_INSTALL_DIR="\${VS_SDK_INSTALLDIR_${VS_VERSION}}"
+
+  # When using --with-tools-dir, assume it points to the correct and default
+  # version of Visual Studio or that --with-toolchain-version was also set.
+  if test "x$with_tools_dir" != x; then
+
+  if test "x$VS_ENV_CMD" = x; then
+    VS_VERSION="${VS_VERSION}"
+    VS_BASE="$with_tools_dir/../.."
+    METHOD="--with-tools-dir"
+
+    if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
+      VCVARSFILE="vc/bin/vcvars32.bat"
+    else
+      VCVARSFILE="vc/bin/amd64/vcvars64.bat"
+    fi
+
+
+  windows_path="$VS_BASE"
+  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+    unix_path=`$CYGPATH -u "$windows_path"`
+    VS_BASE="$unix_path"
+  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
+    VS_BASE="$unix_path"
+  fi
+
+    if test -d "$VS_BASE"; then
+      if test -f "$VS_BASE/$VCVARSFILE"; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5
+$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;}
+        VS_ENV_CMD="$VS_BASE/$VCVARSFILE"
+        # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
+        # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013
+        eval PLATFORM_TOOLSET="\${VS_VS_PLATFORM_NAME_${VS_VERSION}}"
+      else
+        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5
+$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;}
+        { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5
+$as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;}
+      fi
+    fi
+  fi
+
+
+  if test "x$VS_ENV_CMD" = x; then
+    VS_VERSION="${VS_VERSION}"
+    VS_BASE="$with_tools_dir/../../.."
+    METHOD="--with-tools-dir"
+
+    if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
+      VCVARSFILE="vc/bin/vcvars32.bat"
+    else
+      VCVARSFILE="vc/bin/amd64/vcvars64.bat"
+    fi
+
+
+  windows_path="$VS_BASE"
+  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+    unix_path=`$CYGPATH -u "$windows_path"`
+    VS_BASE="$unix_path"
+  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
+    VS_BASE="$unix_path"
+  fi
+
+    if test -d "$VS_BASE"; then
+      if test -f "$VS_BASE/$VCVARSFILE"; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5
+$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;}
+        VS_ENV_CMD="$VS_BASE/$VCVARSFILE"
+        # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
+        # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013
+        eval PLATFORM_TOOLSET="\${VS_VS_PLATFORM_NAME_${VS_VERSION}}"
+      else
+        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5
+$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;}
+        { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5
+$as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;}
+      fi
+    fi
+  fi
+
+    if test "x$VS_ENV_CMD" = x; then
+      # Having specified an argument which is incorrect will produce an instant failure;
+      # we should not go on looking
+      { $as_echo "$as_me:${as_lineno-$LINENO}: The path given by --with-tools-dir does not contain a valid" >&5
+$as_echo "$as_me: The path given by --with-tools-dir does not contain a valid" >&6;}
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Visual Studio installation. Please point to the VC/bin or VC/bin/amd64" >&5
+$as_echo "$as_me: Visual Studio installation. Please point to the VC/bin or VC/bin/amd64" >&6;}
+      { $as_echo "$as_me:${as_lineno-$LINENO}: directory within the Visual Studio installation" >&5
+$as_echo "$as_me: directory within the Visual Studio installation" >&6;}
+      as_fn_error $? "Cannot locate a valid Visual Studio installation" "$LINENO" 5
+    fi
   fi
 
   VS_ENV_CMD=""
   VS_ENV_ARGS=""
-  if test "x$with_toolsdir" != x; then
+
+  if test "x$VS_COMNTOOLS" != x; then
 
   if test "x$VS_ENV_CMD" = x; then
-    VS100BASE="$with_toolsdir/../.."
-    METHOD="--with-tools-dir"
-
-  windows_path="$VS100BASE"
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
-    unix_path=`$CYGPATH -u "$windows_path"`
-    VS100BASE="$unix_path"
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
-    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
-    VS100BASE="$unix_path"
-  fi
-
-    if test -d "$VS100BASE"; then
-      if test -f "$VS100BASE/$VCVARSFILE"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
-$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
-        VS_ENV_CMD="$VS100BASE/$VCVARSFILE"
+    VS_VERSION="${VS_VERSION}"
+    VS_BASE="$VS_COMNTOOLS/../.."
+    METHOD="$VS_COMNTOOLS_VAR variable"
+
+    if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
+      VCVARSFILE="vc/bin/vcvars32.bat"
+    else
+      VCVARSFILE="vc/bin/amd64/vcvars64.bat"
+    fi
+
+
+  windows_path="$VS_BASE"
+  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+    unix_path=`$CYGPATH -u "$windows_path"`
+    VS_BASE="$unix_path"
+  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
+    VS_BASE="$unix_path"
+  fi
+
+    if test -d "$VS_BASE"; then
+      if test -f "$VS_BASE/$VCVARSFILE"; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5
+$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;}
+        VS_ENV_CMD="$VS_BASE/$VCVARSFILE"
         # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
         # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013
-        # TODO: improve detection for other versions of VS
-        PLATFORM_TOOLSET="v100"
-      else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
-$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5
-$as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;}
-      fi
-    fi
-  fi
-
-  fi
-
-  if test "x$with_toolsdir" != x && test "x$VS_ENV_CMD" = x; then
-    # Having specified an argument which is incorrect will produce an instant failure;
-    # we should not go on looking
-    { $as_echo "$as_me:${as_lineno-$LINENO}: The path given by --with-tools-dir does not contain a valid Visual Studio installation" >&5
-$as_echo "$as_me: The path given by --with-tools-dir does not contain a valid Visual Studio installation" >&6;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Please point to the VC/bin directory within the Visual Studio installation" >&5
-$as_echo "$as_me: Please point to the VC/bin directory within the Visual Studio installation" >&6;}
-    as_fn_error $? "Cannot locate a valid Visual Studio installation" "$LINENO" 5
-  fi
-
-  if test "x$VS100COMNTOOLS" != x; then
-
-  if test "x$VS_ENV_CMD" = x; then
-    VS100BASE="$VS100COMNTOOLS/../.."
-    METHOD="VS100COMNTOOLS variable"
-
-  windows_path="$VS100BASE"
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
-    unix_path=`$CYGPATH -u "$windows_path"`
-    VS100BASE="$unix_path"
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
-    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
-    VS100BASE="$unix_path"
-  fi
-
-    if test -d "$VS100BASE"; then
-      if test -f "$VS100BASE/$VCVARSFILE"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
-$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
-        VS_ENV_CMD="$VS100BASE/$VCVARSFILE"
-        # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
-        # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013
-        # TODO: improve detection for other versions of VS
-        PLATFORM_TOOLSET="v100"
-      else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
-$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
+        eval PLATFORM_TOOLSET="\${VS_VS_PLATFORM_NAME_${VS_VERSION}}"
+      else
+        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5
+$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;}
         { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5
 $as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;}
       fi
@@ -26785,30 +26743,80 @@
   if test "x$PROGRAMFILES" != x; then
 
   if test "x$VS_ENV_CMD" = x; then
-    VS100BASE="$PROGRAMFILES/Microsoft Visual Studio 10.0"
+    VS_VERSION="${VS_VERSION}"
+    VS_BASE="$PROGRAMFILES/$VS_INSTALL_DIR"
     METHOD="well-known name"
 
-  windows_path="$VS100BASE"
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
-    unix_path=`$CYGPATH -u "$windows_path"`
-    VS100BASE="$unix_path"
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
-    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
-    VS100BASE="$unix_path"
-  fi
-
-    if test -d "$VS100BASE"; then
-      if test -f "$VS100BASE/$VCVARSFILE"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
-$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
-        VS_ENV_CMD="$VS100BASE/$VCVARSFILE"
+    if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
+      VCVARSFILE="vc/bin/vcvars32.bat"
+    else
+      VCVARSFILE="vc/bin/amd64/vcvars64.bat"
+    fi
+
+
+  windows_path="$VS_BASE"
+  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+    unix_path=`$CYGPATH -u "$windows_path"`
+    VS_BASE="$unix_path"
+  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
+    VS_BASE="$unix_path"
+  fi
+
+    if test -d "$VS_BASE"; then
+      if test -f "$VS_BASE/$VCVARSFILE"; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5
+$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;}
+        VS_ENV_CMD="$VS_BASE/$VCVARSFILE"
         # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
         # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013
-        # TODO: improve detection for other versions of VS
-        PLATFORM_TOOLSET="v100"
-      else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
-$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
+        eval PLATFORM_TOOLSET="\${VS_VS_PLATFORM_NAME_${VS_VERSION}}"
+      else
+        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5
+$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;}
+        { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5
+$as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;}
+      fi
+    fi
+  fi
+
+  fi
+  # Work around the insanely named ProgramFiles(x86) env variable
+  PROGRAMFILES_X86="`env | $SED -n 's/^ProgramFiles(x86)=//p'`"
+  if test "x$PROGRAMFILES_X86" != x; then
+
+  if test "x$VS_ENV_CMD" = x; then
+    VS_VERSION="${VS_VERSION}"
+    VS_BASE="$PROGRAMFILES_X86/$VS_INSTALL_DIR"
+    METHOD="well-known name"
+
+    if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
+      VCVARSFILE="vc/bin/vcvars32.bat"
+    else
+      VCVARSFILE="vc/bin/amd64/vcvars64.bat"
+    fi
+
+
+  windows_path="$VS_BASE"
+  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+    unix_path=`$CYGPATH -u "$windows_path"`
+    VS_BASE="$unix_path"
+  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
+    VS_BASE="$unix_path"
+  fi
+
+    if test -d "$VS_BASE"; then
+      if test -f "$VS_BASE/$VCVARSFILE"; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5
+$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;}
+        VS_ENV_CMD="$VS_BASE/$VCVARSFILE"
+        # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
+        # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013
+        eval PLATFORM_TOOLSET="\${VS_VS_PLATFORM_NAME_${VS_VERSION}}"
+      else
+        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5
+$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;}
         { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5
 $as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;}
       fi
@@ -26818,30 +26826,37 @@
   fi
 
   if test "x$VS_ENV_CMD" = x; then
-    VS100BASE="C:/Program Files/Microsoft Visual Studio 10.0"
+    VS_VERSION="${VS_VERSION}"
+    VS_BASE="C:/Program Files/$VS_INSTALL_DIR"
     METHOD="well-known name"
 
-  windows_path="$VS100BASE"
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
-    unix_path=`$CYGPATH -u "$windows_path"`
-    VS100BASE="$unix_path"
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
-    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
-    VS100BASE="$unix_path"
-  fi
-
-    if test -d "$VS100BASE"; then
-      if test -f "$VS100BASE/$VCVARSFILE"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
-$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
-        VS_ENV_CMD="$VS100BASE/$VCVARSFILE"
+    if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
+      VCVARSFILE="vc/bin/vcvars32.bat"
+    else
+      VCVARSFILE="vc/bin/amd64/vcvars64.bat"
+    fi
+
+
+  windows_path="$VS_BASE"
+  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+    unix_path=`$CYGPATH -u "$windows_path"`
+    VS_BASE="$unix_path"
+  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
+    VS_BASE="$unix_path"
+  fi
+
+    if test -d "$VS_BASE"; then
+      if test -f "$VS_BASE/$VCVARSFILE"; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5
+$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;}
+        VS_ENV_CMD="$VS_BASE/$VCVARSFILE"
         # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
         # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013
-        # TODO: improve detection for other versions of VS
-        PLATFORM_TOOLSET="v100"
-      else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
-$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
+        eval PLATFORM_TOOLSET="\${VS_VS_PLATFORM_NAME_${VS_VERSION}}"
+      else
+        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5
+$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;}
         { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5
 $as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;}
       fi
@@ -26850,30 +26865,37 @@
 
 
   if test "x$VS_ENV_CMD" = x; then
-    VS100BASE="C:/Program Files (x86)/Microsoft Visual Studio 10.0"
+    VS_VERSION="${VS_VERSION}"
+    VS_BASE="C:/Program Files (x86)/$VS_INSTALL_DIR"
     METHOD="well-known name"
 
-  windows_path="$VS100BASE"
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
-    unix_path=`$CYGPATH -u "$windows_path"`
-    VS100BASE="$unix_path"
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
-    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
-    VS100BASE="$unix_path"
-  fi
-
-    if test -d "$VS100BASE"; then
-      if test -f "$VS100BASE/$VCVARSFILE"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
-$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
-        VS_ENV_CMD="$VS100BASE/$VCVARSFILE"
+    if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
+      VCVARSFILE="vc/bin/vcvars32.bat"
+    else
+      VCVARSFILE="vc/bin/amd64/vcvars64.bat"
+    fi
+
+
+  windows_path="$VS_BASE"
+  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+    unix_path=`$CYGPATH -u "$windows_path"`
+    VS_BASE="$unix_path"
+  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
+    VS_BASE="$unix_path"
+  fi
+
+    if test -d "$VS_BASE"; then
+      if test -f "$VS_BASE/$VCVARSFILE"; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5
+$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;}
+        VS_ENV_CMD="$VS_BASE/$VCVARSFILE"
         # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
         # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013
-        # TODO: improve detection for other versions of VS
-        PLATFORM_TOOLSET="v100"
-      else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
-$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
+        eval PLATFORM_TOOLSET="\${VS_VS_PLATFORM_NAME_${VS_VERSION}}"
+      else
+        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5
+$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;}
         { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5
 $as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;}
       fi
@@ -26881,10 +26903,12 @@
   fi
 
 
-  if test "x$ProgramW6432" != x; then
+  if test "x$SDK_INSTALL_DIR" != x; then
+    if test "x$ProgramW6432" != x; then
 
   if test "x$VS_ENV_CMD" = x; then
-    WIN_SDK_BASE="$ProgramW6432/Microsoft SDKs/Windows/v7.1/Bin"
+    VS_VERSION="${VS_VERSION}"
+    WIN_SDK_BASE="$ProgramW6432/$SDK_INSTALL_DIR"
     METHOD="well-known name"
 
   windows_path="$WIN_SDK_BASE"
@@ -26899,15 +26923,15 @@
     if test -d "$WIN_SDK_BASE"; then
       # There have been cases of partial or broken SDK installations. A missing
       # lib dir is not going to work.
-      if test ! -d "$WIN_SDK_BASE/../lib"; then
+      if test ! -d "$WIN_SDK_BASE/lib"; then
         { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
 $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;}
         { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: Installation is broken, lib dir is missing. Ignoring" >&5
 $as_echo "$as_me: Warning: Installation is broken, lib dir is missing. Ignoring" >&6;}
-      elif test -f "$WIN_SDK_BASE/SetEnv.Cmd"; then
+      elif test -f "$WIN_SDK_BASE/Bin/SetEnv.Cmd"; then
         { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
 $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;}
-        VS_ENV_CMD="$WIN_SDK_BASE/SetEnv.Cmd"
+        VS_ENV_CMD="$WIN_SDK_BASE/Bin/SetEnv.Cmd"
         if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
           VS_ENV_ARGS="/x86"
         else
@@ -26916,7 +26940,7 @@
         # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
         # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be 'Windows7.1SDK' for Windows7.1SDK
         # TODO: improve detection for other versions of SDK
-        PLATFORM_TOOLSET="Windows7.1SDK"
+        eval PLATFORM_TOOLSET="\${VS_SDK_PLATFORM_NAME_${VS_VERSION}}"
       else
         { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
 $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;}
@@ -26926,11 +26950,12 @@
     fi
   fi
 
-  fi
-  if test "x$PROGRAMW6432" != x; then
+    fi
+    if test "x$PROGRAMW6432" != x; then
 
   if test "x$VS_ENV_CMD" = x; then
-    WIN_SDK_BASE="$PROGRAMW6432/Microsoft SDKs/Windows/v7.1/Bin"
+    VS_VERSION="${VS_VERSION}"
+    WIN_SDK_BASE="$PROGRAMW6432/$SDK_INSTALL_DIR"
     METHOD="well-known name"
 
   windows_path="$WIN_SDK_BASE"
@@ -26945,15 +26970,15 @@
     if test -d "$WIN_SDK_BASE"; then
       # There have been cases of partial or broken SDK installations. A missing
       # lib dir is not going to work.
-      if test ! -d "$WIN_SDK_BASE/../lib"; then
+      if test ! -d "$WIN_SDK_BASE/lib"; then
         { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
 $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;}
         { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: Installation is broken, lib dir is missing. Ignoring" >&5
 $as_echo "$as_me: Warning: Installation is broken, lib dir is missing. Ignoring" >&6;}
-      elif test -f "$WIN_SDK_BASE/SetEnv.Cmd"; then
+      elif test -f "$WIN_SDK_BASE/Bin/SetEnv.Cmd"; then
         { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
 $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;}
-        VS_ENV_CMD="$WIN_SDK_BASE/SetEnv.Cmd"
+        VS_ENV_CMD="$WIN_SDK_BASE/Bin/SetEnv.Cmd"
         if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
           VS_ENV_ARGS="/x86"
         else
@@ -26962,7 +26987,7 @@
         # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
         # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be 'Windows7.1SDK' for Windows7.1SDK
         # TODO: improve detection for other versions of SDK
-        PLATFORM_TOOLSET="Windows7.1SDK"
+        eval PLATFORM_TOOLSET="\${VS_SDK_PLATFORM_NAME_${VS_VERSION}}"
       else
         { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
 $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;}
@@ -26972,11 +26997,12 @@
     fi
   fi
 
-  fi
-  if test "x$PROGRAMFILES" != x; then
+    fi
+    if test "x$PROGRAMFILES" != x; then
 
   if test "x$VS_ENV_CMD" = x; then
-    WIN_SDK_BASE="$PROGRAMFILES/Microsoft SDKs/Windows/v7.1/Bin"
+    VS_VERSION="${VS_VERSION}"
+    WIN_SDK_BASE="$PROGRAMFILES/$SDK_INSTALL_DIR"
     METHOD="well-known name"
 
   windows_path="$WIN_SDK_BASE"
@@ -26991,15 +27017,15 @@
     if test -d "$WIN_SDK_BASE"; then
       # There have been cases of partial or broken SDK installations. A missing
       # lib dir is not going to work.
-      if test ! -d "$WIN_SDK_BASE/../lib"; then
+      if test ! -d "$WIN_SDK_BASE/lib"; then
         { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
 $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;}
         { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: Installation is broken, lib dir is missing. Ignoring" >&5
 $as_echo "$as_me: Warning: Installation is broken, lib dir is missing. Ignoring" >&6;}
-      elif test -f "$WIN_SDK_BASE/SetEnv.Cmd"; then
+      elif test -f "$WIN_SDK_BASE/Bin/SetEnv.Cmd"; then
         { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
 $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;}
-        VS_ENV_CMD="$WIN_SDK_BASE/SetEnv.Cmd"
+        VS_ENV_CMD="$WIN_SDK_BASE/Bin/SetEnv.Cmd"
         if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
           VS_ENV_ARGS="/x86"
         else
@@ -27008,7 +27034,7 @@
         # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
         # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be 'Windows7.1SDK' for Windows7.1SDK
         # TODO: improve detection for other versions of SDK
-        PLATFORM_TOOLSET="Windows7.1SDK"
+        eval PLATFORM_TOOLSET="\${VS_SDK_PLATFORM_NAME_${VS_VERSION}}"
       else
         { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
 $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;}
@@ -27018,10 +27044,11 @@
     fi
   fi
 
-  fi
+    fi
 
   if test "x$VS_ENV_CMD" = x; then
-    WIN_SDK_BASE="C:/Program Files/Microsoft SDKs/Windows/v7.1/Bin"
+    VS_VERSION="${VS_VERSION}"
+    WIN_SDK_BASE="C:/Program Files/$SDK_INSTALL_DIR"
     METHOD="well-known name"
 
   windows_path="$WIN_SDK_BASE"
@@ -27036,15 +27063,15 @@
     if test -d "$WIN_SDK_BASE"; then
       # There have been cases of partial or broken SDK installations. A missing
       # lib dir is not going to work.
-      if test ! -d "$WIN_SDK_BASE/../lib"; then
+      if test ! -d "$WIN_SDK_BASE/lib"; then
         { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
 $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;}
         { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: Installation is broken, lib dir is missing. Ignoring" >&5
 $as_echo "$as_me: Warning: Installation is broken, lib dir is missing. Ignoring" >&6;}
-      elif test -f "$WIN_SDK_BASE/SetEnv.Cmd"; then
+      elif test -f "$WIN_SDK_BASE/Bin/SetEnv.Cmd"; then
         { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
 $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;}
-        VS_ENV_CMD="$WIN_SDK_BASE/SetEnv.Cmd"
+        VS_ENV_CMD="$WIN_SDK_BASE/Bin/SetEnv.Cmd"
         if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
           VS_ENV_ARGS="/x86"
         else
@@ -27053,7 +27080,7 @@
         # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
         # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be 'Windows7.1SDK' for Windows7.1SDK
         # TODO: improve detection for other versions of SDK
-        PLATFORM_TOOLSET="Windows7.1SDK"
+        eval PLATFORM_TOOLSET="\${VS_SDK_PLATFORM_NAME_${VS_VERSION}}"
       else
         { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
 $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;}
@@ -27065,7 +27092,8 @@
 
 
   if test "x$VS_ENV_CMD" = x; then
-    WIN_SDK_BASE="C:/Program Files (x86)/Microsoft SDKs/Windows/v7.1/Bin"
+    VS_VERSION="${VS_VERSION}"
+    WIN_SDK_BASE="C:/Program Files (x86)/$SDK_INSTALL_DIR"
     METHOD="well-known name"
 
   windows_path="$WIN_SDK_BASE"
@@ -27080,15 +27108,15 @@
     if test -d "$WIN_SDK_BASE"; then
       # There have been cases of partial or broken SDK installations. A missing
       # lib dir is not going to work.
-      if test ! -d "$WIN_SDK_BASE/../lib"; then
+      if test ! -d "$WIN_SDK_BASE/lib"; then
         { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
 $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;}
         { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: Installation is broken, lib dir is missing. Ignoring" >&5
 $as_echo "$as_me: Warning: Installation is broken, lib dir is missing. Ignoring" >&6;}
-      elif test -f "$WIN_SDK_BASE/SetEnv.Cmd"; then
+      elif test -f "$WIN_SDK_BASE/Bin/SetEnv.Cmd"; then
         { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
 $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;}
-        VS_ENV_CMD="$WIN_SDK_BASE/SetEnv.Cmd"
+        VS_ENV_CMD="$WIN_SDK_BASE/Bin/SetEnv.Cmd"
         if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
           VS_ENV_ARGS="/x86"
         else
@@ -27097,7 +27125,7 @@
         # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
         # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be 'Windows7.1SDK' for Windows7.1SDK
         # TODO: improve detection for other versions of SDK
-        PLATFORM_TOOLSET="Windows7.1SDK"
+        eval PLATFORM_TOOLSET="\${VS_SDK_PLATFORM_NAME_${VS_VERSION}}"
       else
         { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
 $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;}
@@ -27107,6 +27135,21 @@
     fi
   fi
 
+  fi
+
+    if test "x$VS_ENV_CMD" != x; then
+      TOOLCHAIN_VERSION=$VS_VERSION
+      eval VS_DESCRIPTION="\${VS_DESCRIPTION_${VS_VERSION}}"
+      eval VS_VERSION_INTERNAL="\${VS_VERSION_INTERNAL_${VS_VERSION}}"
+      eval MSVCR_NAME="\${VS_MSVCR_${VS_VERSION}}"
+      eval MSVCP_NAME="\${VS_MSVCP_${VS_VERSION}}"
+      # The rest of the variables are already evaled while probing
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Found $VS_DESCRIPTION" >&5
+$as_echo "$as_me: Found $VS_DESCRIPTION" >&6;}
+      break
+    fi
+  done
+
 
   if test "x$VS_ENV_CMD" != x; then
     # We have found a Visual Studio environment on disk, let's extract variables from the vsvars bat file.
@@ -27438,8 +27481,8 @@
     # The trailing space for everyone except PATH is no typo, but is needed due
     # to trailing \ in the Windows paths. These will be stripped later.
     $ECHO "$WINPATH_BASH -c 'echo VS_PATH="'\"$PATH\" > set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
-    $ECHO "$WINPATH_BASH -c 'echo VS_INCLUDE="'\"$INCLUDE \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
-    $ECHO "$WINPATH_BASH -c 'echo VS_LIB="'\"$LIB \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
+    $ECHO "$WINPATH_BASH -c 'echo VS_INCLUDE="'\"$INCLUDE\;$include \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
+    $ECHO "$WINPATH_BASH -c 'echo VS_LIB="'\"$LIB\;$lib \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
     $ECHO "$WINPATH_BASH -c 'echo VCINSTALLDIR="'\"$VCINSTALLDIR \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
     $ECHO "$WINPATH_BASH -c 'echo WindowsSdkDir="'\"$WindowsSdkDir \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
     $ECHO "$WINPATH_BASH -c 'echo WINDOWSSDKDIR="'\"$WINDOWSSDKDIR \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
@@ -27486,9 +27529,9 @@
     else
       { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
 $as_echo "ok" >&6; }
-      # Remove any trailing "\" and " " from the variables.
-      VS_INCLUDE=`$ECHO "$VS_INCLUDE" | $SED 's/\\\\* *$//'`
-      VS_LIB=`$ECHO "$VS_LIB" | $SED 's/\\\\* *$//'`
+      # Remove any trailing "\" ";" and " " from the variables.
+      VS_INCLUDE=`$ECHO "$VS_INCLUDE" | $SED -e 's/\\\\*;* *$//'`
+      VS_LIB=`$ECHO "$VS_LIB" | $SED 's/\\\\*;* *$//'`
       VCINSTALLDIR=`$ECHO "$VCINSTALLDIR" | $SED 's/\\\\* *$//'`
       WindowsSDKDir=`$ECHO "$WindowsSDKDir" | $SED 's/\\\\* *$//'`
       WINDOWSSDKDIR=`$ECHO "$WINDOWSSDKDIR" | $SED 's/\\\\* *$//'`
@@ -27499,6 +27542,268 @@
 
 
 
+
+      # Convert VS_INCLUDE into SYSROOT_CFLAGS
+      OLDIFS="$IFS"
+      IFS=";"
+      for i in $VS_INCLUDE; do
+        ipath=$i
+	IFS="$OLDIFS"
+
+  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+
+  # Input might be given as Windows format, start by converting to
+  # unix format.
+  path="$ipath"
+  new_path=`$CYGPATH -u "$path"`
+
+  # Cygwin tries to hide some aspects of the Windows file system, such that binaries are
+  # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered
+  # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then
+  # "foo.exe" is OK but "foo" is an error.
+  #
+  # This test is therefore slightly more accurate than "test -f" to check for file precense.
+  # It is also a way to make sure we got the proper file name for the real test later on.
+  test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null`
+  if test "x$test_shortpath" = x; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: The path of ipath, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of ipath, which resolves as \"$path\", is invalid." >&6;}
+    as_fn_error $? "Cannot locate the the path of ipath" "$LINENO" 5
+  fi
+
+  # Call helper function which possibly converts this using DOS-style short mode.
+  # If so, the updated path is stored in $new_path.
+
+  input_path="$new_path"
+  # Check if we need to convert this using DOS-style short mode. If the path
+  # contains just simple characters, use it. Otherwise (spaces, weird characters),
+  # take no chances and rewrite it.
+  # Note: m4 eats our [], so we need to use [ and ] instead.
+  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]`
+  if test "x$has_forbidden_chars" != x; then
+    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
+    shortmode_path=`$CYGPATH -s -m -a "$input_path"`
+    path_after_shortmode=`$CYGPATH -u "$shortmode_path"`
+    if test "x$path_after_shortmode" != "x$input_to_shortpath"; then
+      # Going to short mode and back again did indeed matter. Since short mode is
+      # case insensitive, let's make it lowercase to improve readability.
+      shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+      # Now convert it back to Unix-stile (cygpath)
+      input_path=`$CYGPATH -u "$shortmode_path"`
+      new_path="$input_path"
+    fi
+  fi
+
+  test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/`
+  if test "x$test_cygdrive_prefix" = x; then
+    # As a simple fix, exclude /usr/bin since it's not a real path.
+    if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then
+      # The path is in a Cygwin special directory (e.g. /home). We need this converted to
+      # a path prefixed by /cygdrive for fixpath to work.
+      new_path="$CYGWIN_ROOT_PATH$input_path"
+    fi
+  fi
+
+
+  if test "x$path" != "x$new_path"; then
+    ipath="$new_path"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting ipath to \"$new_path\"" >&5
+$as_echo "$as_me: Rewriting ipath to \"$new_path\"" >&6;}
+  fi
+
+  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+
+  path="$ipath"
+  has_colon=`$ECHO $path | $GREP ^.:`
+  new_path="$path"
+  if test "x$has_colon" = x; then
+    # Not in mixed or Windows style, start by that.
+    new_path=`cmd //c echo $path`
+  fi
+
+
+  input_path="$new_path"
+  # Check if we need to convert this using DOS-style short mode. If the path
+  # contains just simple characters, use it. Otherwise (spaces, weird characters),
+  # take no chances and rewrite it.
+  # Note: m4 eats our [], so we need to use [ and ] instead.
+  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]`
+  if test "x$has_forbidden_chars" != x; then
+    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
+    new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+  fi
+
+
+  windows_path="$new_path"
+  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+    unix_path=`$CYGPATH -u "$windows_path"`
+    new_path="$unix_path"
+  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
+    new_path="$unix_path"
+  fi
+
+  if test "x$path" != "x$new_path"; then
+    ipath="$new_path"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting ipath to \"$new_path\"" >&5
+$as_echo "$as_me: Rewriting ipath to \"$new_path\"" >&6;}
+  fi
+
+  # Save the first 10 bytes of this path to the storage, so fixpath can work.
+  all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
+
+  else
+    # We're on a unix platform. Hooray! :)
+    path="$ipath"
+    has_space=`$ECHO "$path" | $GREP " "`
+    if test "x$has_space" != x; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of ipath, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of ipath, which resolves as \"$path\", is invalid." >&6;}
+      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+    fi
+
+    # Use eval to expand a potential ~
+    eval path="$path"
+    if test ! -f "$path" && test ! -d "$path"; then
+      as_fn_error $? "The path of ipath, which resolves as \"$path\", is not found." "$LINENO" 5
+    fi
+
+    ipath="`cd "$path"; $THEPWDCMD -L`"
+  fi
+
+	IFS=";"
+      	SYSROOT_CFLAGS="$SYSROOT_CFLAGS -I$ipath"
+      done
+      # Convert VS_LIB into SYSROOT_LDFLAGS
+      for i in $VS_LIB; do
+        libpath=$i
+	IFS="$OLDIFS"
+
+  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+
+  # Input might be given as Windows format, start by converting to
+  # unix format.
+  path="$libpath"
+  new_path=`$CYGPATH -u "$path"`
+
+  # Cygwin tries to hide some aspects of the Windows file system, such that binaries are
+  # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered
+  # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then
+  # "foo.exe" is OK but "foo" is an error.
+  #
+  # This test is therefore slightly more accurate than "test -f" to check for file precense.
+  # It is also a way to make sure we got the proper file name for the real test later on.
+  test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null`
+  if test "x$test_shortpath" = x; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: The path of libpath, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of libpath, which resolves as \"$path\", is invalid." >&6;}
+    as_fn_error $? "Cannot locate the the path of libpath" "$LINENO" 5
+  fi
+
+  # Call helper function which possibly converts this using DOS-style short mode.
+  # If so, the updated path is stored in $new_path.
+
+  input_path="$new_path"
+  # Check if we need to convert this using DOS-style short mode. If the path
+  # contains just simple characters, use it. Otherwise (spaces, weird characters),
+  # take no chances and rewrite it.
+  # Note: m4 eats our [], so we need to use [ and ] instead.
+  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]`
+  if test "x$has_forbidden_chars" != x; then
+    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
+    shortmode_path=`$CYGPATH -s -m -a "$input_path"`
+    path_after_shortmode=`$CYGPATH -u "$shortmode_path"`
+    if test "x$path_after_shortmode" != "x$input_to_shortpath"; then
+      # Going to short mode and back again did indeed matter. Since short mode is
+      # case insensitive, let's make it lowercase to improve readability.
+      shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+      # Now convert it back to Unix-stile (cygpath)
+      input_path=`$CYGPATH -u "$shortmode_path"`
+      new_path="$input_path"
+    fi
+  fi
+
+  test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/`
+  if test "x$test_cygdrive_prefix" = x; then
+    # As a simple fix, exclude /usr/bin since it's not a real path.
+    if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then
+      # The path is in a Cygwin special directory (e.g. /home). We need this converted to
+      # a path prefixed by /cygdrive for fixpath to work.
+      new_path="$CYGWIN_ROOT_PATH$input_path"
+    fi
+  fi
+
+
+  if test "x$path" != "x$new_path"; then
+    libpath="$new_path"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting libpath to \"$new_path\"" >&5
+$as_echo "$as_me: Rewriting libpath to \"$new_path\"" >&6;}
+  fi
+
+  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+
+  path="$libpath"
+  has_colon=`$ECHO $path | $GREP ^.:`
+  new_path="$path"
+  if test "x$has_colon" = x; then
+    # Not in mixed or Windows style, start by that.
+    new_path=`cmd //c echo $path`
+  fi
+
+
+  input_path="$new_path"
+  # Check if we need to convert this using DOS-style short mode. If the path
+  # contains just simple characters, use it. Otherwise (spaces, weird characters),
+  # take no chances and rewrite it.
+  # Note: m4 eats our [], so we need to use [ and ] instead.
+  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]`
+  if test "x$has_forbidden_chars" != x; then
+    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
+    new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+  fi
+
+
+  windows_path="$new_path"
+  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+    unix_path=`$CYGPATH -u "$windows_path"`
+    new_path="$unix_path"
+  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
+    new_path="$unix_path"
+  fi
+
+  if test "x$path" != "x$new_path"; then
+    libpath="$new_path"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting libpath to \"$new_path\"" >&5
+$as_echo "$as_me: Rewriting libpath to \"$new_path\"" >&6;}
+  fi
+
+  # Save the first 10 bytes of this path to the storage, so fixpath can work.
+  all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
+
+  else
+    # We're on a unix platform. Hooray! :)
+    path="$libpath"
+    has_space=`$ECHO "$path" | $GREP " "`
+    if test "x$has_space" != x; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of libpath, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of libpath, which resolves as \"$path\", is invalid." >&6;}
+      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+    fi
+
+    # Use eval to expand a potential ~
+    eval path="$path"
+    if test ! -f "$path" && test ! -d "$path"; then
+      as_fn_error $? "The path of libpath, which resolves as \"$path\", is not found." "$LINENO" 5
+    fi
+
+    libpath="`cd "$path"; $THEPWDCMD -L`"
+  fi
+
+	IFS=";"
+      	SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS -libpath:$libpath"
+      done
+      IFS="$OLDIFS"
     fi
   else
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
@@ -40767,8 +41072,8 @@
     CC_VERSION_OUTPUT=`$CC 2>&1 | $HEAD -n 1 | $TR -d '\r'`
     COMPILER_CPU_TEST=`$ECHO $CC_VERSION_OUTPUT | $SED -n "s/^.* \(.*\)$/\1/p"`
     if test "x$OPENJDK_TARGET_CPU" = "xx86"; then
-      if test "x$COMPILER_CPU_TEST" != "x80x86"; then
-        as_fn_error $? "Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for \"$COMPILER_CPU_TEST\"; expected \"80x86\"." "$LINENO" 5
+      if test "x$COMPILER_CPU_TEST" != "x80x86" -a "x$COMPILER_CPU_TEST" != "xx86"; then
+        as_fn_error $? "Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for \"$COMPILER_CPU_TEST\"; expected \"80x86\" or \"x86\"." "$LINENO" 5
       fi
     elif test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then
       if test "x$COMPILER_CPU_TEST" != "xx64"; then
@@ -42416,15 +42721,23 @@
     CFLAGS_JDK="$CFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC"
     CXXFLAGS_JDK="$CXXFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC"
   elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
-    COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Zi -MD -Zc:wchar_t- -W3 -wd4800 \
-    -D_STATIC_CPPLIB -D_DISABLE_DEPRECATE_STATIC_CPPLIB -DWIN32_LEAN_AND_MEAN \
-    -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \
-    -DWIN32 -DIAL"
+    COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK \
+        -Zi -MD -Zc:wchar_t- -W3 -wd4800 \
+        -DWIN32_LEAN_AND_MEAN \
+        -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \
+        -DWIN32 -DIAL"
     if test "x$OPENJDK_TARGET_CPU" = xx86_64; then
       COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_AMD64_ -Damd64"
     else
       COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_X86_ -Dx86"
     fi
+    # If building with Visual Studio 2010, we can still use _STATIC_CPPLIB to
+    # avoid bundling msvcpNNN.dll. Doesn't work with newer versions of visual
+    # studio.
+    if test "x$TOOLCHAIN_VERSION" = "x2010"; then
+      COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK \
+          -D_STATIC_CPPLIB -D_DISABLE_DEPRECATE_STATIC_CPPLIB"
+    fi
   fi
 
   ###############################################################################
@@ -49575,16 +49888,17 @@
   if test "x$with_msvcr_dll" != x; then
     # If given explicitely by user, do not probe. If not present, fail directly.
 
-  POSSIBLE_MSVCR_DLL="$with_msvcr_dll"
+  DLL_NAME="$DLL_NAME"
+  POSSIBLE_MSVC_DLL="$with_msvcr_dll"
   METHOD="--with-msvcr-dll"
-  if test -e "$POSSIBLE_MSVCR_DLL"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&5
-$as_echo "$as_me: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&6;}
+  if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5
+$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;}
 
     # Need to check if the found msvcr is correct architecture
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking found msvcr100.dll architecture" >&5
-$as_echo_n "checking found msvcr100.dll architecture... " >&6; }
-    MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"`
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5
+$as_echo_n "checking found $DLL_NAME architecture... " >&6; }
+    MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"`
     if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
       # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit"
       # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems.
@@ -49600,28 +49914,32 @@
         CORRECT_MSVCR_ARCH=x86-64
       fi
     fi
-    if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then
+    if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
 $as_echo "ok" >&6; }
-      MSVCR_DLL="$POSSIBLE_MSVCR_DLL"
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5
-$as_echo_n "checking for msvcr100.dll... " >&6; }
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5
-$as_echo "$MSVCR_DLL" >&6; }
+      MSVC_DLL="$POSSIBLE_MSVC_DLL"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5
+$as_echo_n "checking for $DLL_NAME... " >&6; }
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5
+$as_echo "$MSVC_DLL" >&6; }
     else
       { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5
 $as_echo "incorrect, ignoring" >&6; }
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&5
-$as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&6;}
-    fi
-  fi
-
-    if test "x$MSVCR_DLL" = x; then
-      as_fn_error $? "Could not find a proper msvcr100.dll as specified by --with-msvcr-dll" "$LINENO" 5
-    fi
-  fi
-
-  if test "x$MSVCR_DLL" = x; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5
+$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;}
+    fi
+  fi
+
+    if test "x$MSVC_DLL" = x; then
+      as_fn_error $? "Could not find a proper $MSVCR_NAME as specified by --with-msvcr-dll" "$LINENO" 5
+    fi
+  else
+
+  VAR_NAME="MSVCR_DLL"
+  DLL_NAME="${MSVCR_NAME}"
+  MSVC_DLL=
+
+  if test "x$MSVC_DLL" = x; then
     # Probe: Using well-known location from Visual Studio 10.0
     if test "x$VCINSTALLDIR" != x; then
       CYGWIN_VC_INSTALL_DIR="$VCINSTALLDIR"
@@ -49636,21 +49954,23 @@
   fi
 
       if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
-        POSSIBLE_MSVCR_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x64/Microsoft.VC100.CRT/msvcr100.dll"
-      else
-        POSSIBLE_MSVCR_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x86/Microsoft.VC100.CRT/msvcr100.dll"
-      fi
-
-  POSSIBLE_MSVCR_DLL="$POSSIBLE_MSVCR_DLL"
+        POSSIBLE_MSVC_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x64/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME"
+      else
+        POSSIBLE_MSVC_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x86/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME"
+      fi
+      $ECHO "POSSIBLE_MSVC_DLL $POSSIBLEMSVC_DLL"
+
+  DLL_NAME="$DLL_NAME"
+  POSSIBLE_MSVC_DLL="$POSSIBLE_MSVC_DLL"
   METHOD="well-known location in VCINSTALLDIR"
-  if test -e "$POSSIBLE_MSVCR_DLL"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&5
-$as_echo "$as_me: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&6;}
+  if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5
+$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;}
 
     # Need to check if the found msvcr is correct architecture
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking found msvcr100.dll architecture" >&5
-$as_echo_n "checking found msvcr100.dll architecture... " >&6; }
-    MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"`
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5
+$as_echo_n "checking found $DLL_NAME architecture... " >&6; }
+    MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"`
     if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
       # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit"
       # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems.
@@ -49666,39 +49986,40 @@
         CORRECT_MSVCR_ARCH=x86-64
       fi
     fi
-    if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then
+    if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
 $as_echo "ok" >&6; }
-      MSVCR_DLL="$POSSIBLE_MSVCR_DLL"
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5
-$as_echo_n "checking for msvcr100.dll... " >&6; }
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5
-$as_echo "$MSVCR_DLL" >&6; }
+      MSVC_DLL="$POSSIBLE_MSVC_DLL"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5
+$as_echo_n "checking for $DLL_NAME... " >&6; }
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5
+$as_echo "$MSVC_DLL" >&6; }
     else
       { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5
 $as_echo "incorrect, ignoring" >&6; }
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&5
-$as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&6;}
-    fi
-  fi
-
-    fi
-  fi
-
-  if test "x$MSVCR_DLL" = x; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5
+$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;}
+    fi
+  fi
+
+    fi
+  fi
+
+  if test "x$MSVC_DLL" = x; then
     # Probe: Check in the Boot JDK directory.
-    POSSIBLE_MSVCR_DLL="$BOOT_JDK/bin/msvcr100.dll"
-
-  POSSIBLE_MSVCR_DLL="$POSSIBLE_MSVCR_DLL"
+    POSSIBLE_MSVC_DLL="$BOOT_JDK/bin/$DLL_NAME"
+
+  DLL_NAME="$DLL_NAME"
+  POSSIBLE_MSVC_DLL="$POSSIBLE_MSVC_DLL"
   METHOD="well-known location in Boot JDK"
-  if test -e "$POSSIBLE_MSVCR_DLL"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&5
-$as_echo "$as_me: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&6;}
+  if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5
+$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;}
 
     # Need to check if the found msvcr is correct architecture
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking found msvcr100.dll architecture" >&5
-$as_echo_n "checking found msvcr100.dll architecture... " >&6; }
-    MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"`
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5
+$as_echo_n "checking found $DLL_NAME architecture... " >&6; }
+    MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"`
     if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
       # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit"
       # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems.
@@ -49714,25 +50035,25 @@
         CORRECT_MSVCR_ARCH=x86-64
       fi
     fi
-    if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then
+    if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
 $as_echo "ok" >&6; }
-      MSVCR_DLL="$POSSIBLE_MSVCR_DLL"
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5
-$as_echo_n "checking for msvcr100.dll... " >&6; }
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5
-$as_echo "$MSVCR_DLL" >&6; }
+      MSVC_DLL="$POSSIBLE_MSVC_DLL"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5
+$as_echo_n "checking for $DLL_NAME... " >&6; }
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5
+$as_echo "$MSVC_DLL" >&6; }
     else
       { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5
 $as_echo "incorrect, ignoring" >&6; }
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&5
-$as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&6;}
-    fi
-  fi
-
-  fi
-
-  if test "x$MSVCR_DLL" = x; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5
+$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;}
+    fi
+  fi
+
+  fi
+
+  if test "x$MSVC_DLL" = x; then
     # Probe: Look in the Windows system32 directory
     CYGWIN_SYSTEMROOT="$SYSTEMROOT"
 
@@ -49745,18 +50066,19 @@
     CYGWIN_SYSTEMROOT="$unix_path"
   fi
 
-    POSSIBLE_MSVCR_DLL="$CYGWIN_SYSTEMROOT/system32/msvcr100.dll"
-
-  POSSIBLE_MSVCR_DLL="$POSSIBLE_MSVCR_DLL"
+    POSSIBLE_MSVC_DLL="$CYGWIN_SYSTEMROOT/system32/$DLL_NAME"
+
+  DLL_NAME="$DLL_NAME"
+  POSSIBLE_MSVC_DLL="$POSSIBLE_MSVC_DLL"
   METHOD="well-known location in SYSTEMROOT"
-  if test -e "$POSSIBLE_MSVCR_DLL"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&5
-$as_echo "$as_me: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&6;}
+  if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5
+$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;}
 
     # Need to check if the found msvcr is correct architecture
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking found msvcr100.dll architecture" >&5
-$as_echo_n "checking found msvcr100.dll architecture... " >&6; }
-    MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"`
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5
+$as_echo_n "checking found $DLL_NAME architecture... " >&6; }
+    MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"`
     if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
       # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit"
       # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems.
@@ -49772,25 +50094,25 @@
         CORRECT_MSVCR_ARCH=x86-64
       fi
     fi
-    if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then
+    if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
 $as_echo "ok" >&6; }
-      MSVCR_DLL="$POSSIBLE_MSVCR_DLL"
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5
-$as_echo_n "checking for msvcr100.dll... " >&6; }
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5
-$as_echo "$MSVCR_DLL" >&6; }
+      MSVC_DLL="$POSSIBLE_MSVC_DLL"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5
+$as_echo_n "checking for $DLL_NAME... " >&6; }
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5
+$as_echo "$MSVC_DLL" >&6; }
     else
       { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5
 $as_echo "incorrect, ignoring" >&6; }
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&5
-$as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&6;}
-    fi
-  fi
-
-  fi
-
-  if test "x$MSVCR_DLL" = x; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5
+$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;}
+    fi
+  fi
+
+  fi
+
+  if test "x$MSVC_DLL" = x; then
     # Probe: If Visual Studio Express is installed, there is usually one with the debugger
     if test "x$VS100COMNTOOLS" != x; then
       CYGWIN_VS_TOOLS_DIR="$VS100COMNTOOLS/.."
@@ -49805,21 +50127,24 @@
   fi
 
       if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
-        POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name msvcr100.dll | $GREP -i /x64/ | $HEAD --lines 1`
-      else
-        POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name msvcr100.dll | $GREP -i /x86/ | $HEAD --lines 1`
-      fi
-
-  POSSIBLE_MSVCR_DLL="$POSSIBLE_MSVCR_DLL"
+        POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name $DLL_NAME \
+	    | $GREP -i /x64/ | $HEAD --lines 1`
+      else
+        POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name $DLL_NAME \
+	    | $GREP -i /x86/ | $HEAD --lines 1`
+      fi
+
+  DLL_NAME="$DLL_NAME"
+  POSSIBLE_MSVC_DLL="$POSSIBLE_MSVC_DLL"
   METHOD="search of VS100COMNTOOLS"
-  if test -e "$POSSIBLE_MSVCR_DLL"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&5
-$as_echo "$as_me: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&6;}
+  if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5
+$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;}
 
     # Need to check if the found msvcr is correct architecture
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking found msvcr100.dll architecture" >&5
-$as_echo_n "checking found msvcr100.dll architecture... " >&6; }
-    MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"`
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5
+$as_echo_n "checking found $DLL_NAME architecture... " >&6; }
+    MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"`
     if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
       # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit"
       # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems.
@@ -49835,50 +50160,54 @@
         CORRECT_MSVCR_ARCH=x86-64
       fi
     fi
-    if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then
+    if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
 $as_echo "ok" >&6; }
-      MSVCR_DLL="$POSSIBLE_MSVCR_DLL"
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5
-$as_echo_n "checking for msvcr100.dll... " >&6; }
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5
-$as_echo "$MSVCR_DLL" >&6; }
+      MSVC_DLL="$POSSIBLE_MSVC_DLL"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5
+$as_echo_n "checking for $DLL_NAME... " >&6; }
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5
+$as_echo "$MSVC_DLL" >&6; }
     else
       { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5
 $as_echo "incorrect, ignoring" >&6; }
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&5
-$as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&6;}
-    fi
-  fi
-
-    fi
-  fi
-
-  if test "x$MSVCR_DLL" = x; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5
+$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;}
+    fi
+  fi
+
+    fi
+  fi
+
+  if test "x$MSVC_DLL" = x; then
     # Probe: Search wildly in the VCINSTALLDIR. We've probably lost by now.
-    # (This was the original behaviour; kept since it might turn up something)
+    # (This was the original behaviour; kept since it might turn something up)
     if test "x$CYGWIN_VC_INSTALL_DIR" != x; then
       if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
-        POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name msvcr100.dll | $GREP x64 | $HEAD --lines 1`
-      else
-        POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name msvcr100.dll | $GREP x86 | $GREP -v ia64 | $GREP -v x64 | $HEAD --lines 1`
-        if test "x$POSSIBLE_MSVCR_DLL" = x; then
+        POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name $DLL_NAME \
+	    | $GREP x64 | $HEAD --lines 1`
+      else
+        POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name $DLL_NAME \
+	    | $GREP x86 | $GREP -v ia64 | $GREP -v x64 | $HEAD --lines 1`
+        if test "x$POSSIBLE_MSVC_DLL" = x; then
           # We're grasping at straws now...
-          POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name msvcr100.dll | $HEAD --lines 1`
-        fi
-      fi
-
-
-  POSSIBLE_MSVCR_DLL="$POSSIBLE_MSVCR_DLL"
+          POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name $DLL_NAME \
+	      | $HEAD --lines 1`
+        fi
+      fi
+
+
+  DLL_NAME="$DLL_NAME"
+  POSSIBLE_MSVC_DLL="$POSSIBLE_MSVC_DLL"
   METHOD="search of VCINSTALLDIR"
-  if test -e "$POSSIBLE_MSVCR_DLL"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&5
-$as_echo "$as_me: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&6;}
+  if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5
+$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;}
 
     # Need to check if the found msvcr is correct architecture
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking found msvcr100.dll architecture" >&5
-$as_echo_n "checking found msvcr100.dll architecture... " >&6; }
-    MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"`
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5
+$as_echo_n "checking found $DLL_NAME architecture... " >&6; }
+    MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"`
     if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
       # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit"
       # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems.
@@ -49894,33 +50223,34 @@
         CORRECT_MSVCR_ARCH=x86-64
       fi
     fi
-    if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then
+    if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
 $as_echo "ok" >&6; }
-      MSVCR_DLL="$POSSIBLE_MSVCR_DLL"
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5
-$as_echo_n "checking for msvcr100.dll... " >&6; }
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5
-$as_echo "$MSVCR_DLL" >&6; }
+      MSVC_DLL="$POSSIBLE_MSVC_DLL"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5
+$as_echo_n "checking for $DLL_NAME... " >&6; }
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5
+$as_echo "$MSVC_DLL" >&6; }
     else
       { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5
 $as_echo "incorrect, ignoring" >&6; }
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&5
-$as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&6;}
-    fi
-  fi
-
-    fi
-  fi
-
-  if test "x$MSVCR_DLL" = x; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5
-$as_echo_n "checking for msvcr100.dll... " >&6; }
+      { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5
+$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;}
+    fi
+  fi
+
+    fi
+  fi
+
+  if test "x$MSVC_DLL" = x; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5
+$as_echo_n "checking for $DLL_NAME... " >&6; }
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
-    as_fn_error $? "Could not find msvcr100.dll. Please specify using --with-msvcr-dll." "$LINENO" 5
-  fi
-
+    as_fn_error $? "Could not find $DLL_NAME. Please specify using --with-msvcr-dll." "$LINENO" 5
+  fi
+
+  MSVCR_DLL=$MSVC_DLL
 
   if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
@@ -50043,6 +50373,512 @@
     MSVCR_DLL="`cd "$path"; $THEPWDCMD -L`"
   fi
 
+  MSVCR_DLL=$MSVCR_DLL
+
+
+  fi
+
+
+# Check whether --with-msvcp-dll was given.
+if test "${with_msvcp_dll+set}" = set; then :
+  withval=$with_msvcp_dll;
+fi
+
+
+  if test "x$MSVCP_NAME" != "x"; then
+    if test "x$with_msvcp_dll" != x; then
+      # If given explicitely by user, do not probe. If not present, fail directly.
+
+  DLL_NAME="$DLL_NAME"
+  POSSIBLE_MSVC_DLL="$with_msvcp_dll"
+  METHOD="--with-msvcp-dll"
+  if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5
+$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;}
+
+    # Need to check if the found msvcr is correct architecture
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5
+$as_echo_n "checking found $DLL_NAME architecture... " >&6; }
+    MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"`
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+      # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit"
+      # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems.
+      if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
+        CORRECT_MSVCR_ARCH="PE32 executable"
+      else
+        CORRECT_MSVCR_ARCH="PE32+ executable"
+      fi
+    else
+      if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
+        CORRECT_MSVCR_ARCH=386
+      else
+        CORRECT_MSVCR_ARCH=x86-64
+      fi
+    fi
+    if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+$as_echo "ok" >&6; }
+      MSVC_DLL="$POSSIBLE_MSVC_DLL"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5
+$as_echo_n "checking for $DLL_NAME... " >&6; }
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5
+$as_echo "$MSVC_DLL" >&6; }
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5
+$as_echo "incorrect, ignoring" >&6; }
+      { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5
+$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;}
+    fi
+  fi
+
+      if test "x$MSVC_DLL" = x; then
+        as_fn_error $? "Could not find a proper $MSVCP_NAME as specified by --with-msvcp-dll" "$LINENO" 5
+      fi
+    else
+
+  VAR_NAME="MSVCP_DLL"
+  DLL_NAME="${MSVCP_NAME}"
+  MSVC_DLL=
+
+  if test "x$MSVC_DLL" = x; then
+    # Probe: Using well-known location from Visual Studio 10.0
+    if test "x$VCINSTALLDIR" != x; then
+      CYGWIN_VC_INSTALL_DIR="$VCINSTALLDIR"
+
+  windows_path="$CYGWIN_VC_INSTALL_DIR"
+  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+    unix_path=`$CYGPATH -u "$windows_path"`
+    CYGWIN_VC_INSTALL_DIR="$unix_path"
+  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
+    CYGWIN_VC_INSTALL_DIR="$unix_path"
+  fi
+
+      if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
+        POSSIBLE_MSVC_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x64/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME"
+      else
+        POSSIBLE_MSVC_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x86/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME"
+      fi
+      $ECHO "POSSIBLE_MSVC_DLL $POSSIBLEMSVC_DLL"
+
+  DLL_NAME="$DLL_NAME"
+  POSSIBLE_MSVC_DLL="$POSSIBLE_MSVC_DLL"
+  METHOD="well-known location in VCINSTALLDIR"
+  if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5
+$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;}
+
+    # Need to check if the found msvcr is correct architecture
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5
+$as_echo_n "checking found $DLL_NAME architecture... " >&6; }
+    MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"`
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+      # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit"
+      # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems.
+      if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
+        CORRECT_MSVCR_ARCH="PE32 executable"
+      else
+        CORRECT_MSVCR_ARCH="PE32+ executable"
+      fi
+    else
+      if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
+        CORRECT_MSVCR_ARCH=386
+      else
+        CORRECT_MSVCR_ARCH=x86-64
+      fi
+    fi
+    if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+$as_echo "ok" >&6; }
+      MSVC_DLL="$POSSIBLE_MSVC_DLL"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5
+$as_echo_n "checking for $DLL_NAME... " >&6; }
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5
+$as_echo "$MSVC_DLL" >&6; }
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5
+$as_echo "incorrect, ignoring" >&6; }
+      { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5
+$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;}
+    fi
+  fi
+
+    fi
+  fi
+
+  if test "x$MSVC_DLL" = x; then
+    # Probe: Check in the Boot JDK directory.
+    POSSIBLE_MSVC_DLL="$BOOT_JDK/bin/$DLL_NAME"
+
+  DLL_NAME="$DLL_NAME"
+  POSSIBLE_MSVC_DLL="$POSSIBLE_MSVC_DLL"
+  METHOD="well-known location in Boot JDK"
+  if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5
+$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;}
+
+    # Need to check if the found msvcr is correct architecture
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5
+$as_echo_n "checking found $DLL_NAME architecture... " >&6; }
+    MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"`
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+      # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit"
+      # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems.
+      if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
+        CORRECT_MSVCR_ARCH="PE32 executable"
+      else
+        CORRECT_MSVCR_ARCH="PE32+ executable"
+      fi
+    else
+      if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
+        CORRECT_MSVCR_ARCH=386
+      else
+        CORRECT_MSVCR_ARCH=x86-64
+      fi
+    fi
+    if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+$as_echo "ok" >&6; }
+      MSVC_DLL="$POSSIBLE_MSVC_DLL"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5
+$as_echo_n "checking for $DLL_NAME... " >&6; }
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5
+$as_echo "$MSVC_DLL" >&6; }
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5
+$as_echo "incorrect, ignoring" >&6; }
+      { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5
+$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;}
+    fi
+  fi
+
+  fi
+
+  if test "x$MSVC_DLL" = x; then
+    # Probe: Look in the Windows system32 directory
+    CYGWIN_SYSTEMROOT="$SYSTEMROOT"
+
+  windows_path="$CYGWIN_SYSTEMROOT"
+  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+    unix_path=`$CYGPATH -u "$windows_path"`
+    CYGWIN_SYSTEMROOT="$unix_path"
+  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
+    CYGWIN_SYSTEMROOT="$unix_path"
+  fi
+
+    POSSIBLE_MSVC_DLL="$CYGWIN_SYSTEMROOT/system32/$DLL_NAME"
+
+  DLL_NAME="$DLL_NAME"
+  POSSIBLE_MSVC_DLL="$POSSIBLE_MSVC_DLL"
+  METHOD="well-known location in SYSTEMROOT"
+  if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5
+$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;}
+
+    # Need to check if the found msvcr is correct architecture
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5
+$as_echo_n "checking found $DLL_NAME architecture... " >&6; }
+    MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"`
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+      # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit"
+      # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems.
+      if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
+        CORRECT_MSVCR_ARCH="PE32 executable"
+      else
+        CORRECT_MSVCR_ARCH="PE32+ executable"
+      fi
+    else
+      if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
+        CORRECT_MSVCR_ARCH=386
+      else
+        CORRECT_MSVCR_ARCH=x86-64
+      fi
+    fi
+    if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+$as_echo "ok" >&6; }
+      MSVC_DLL="$POSSIBLE_MSVC_DLL"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5
+$as_echo_n "checking for $DLL_NAME... " >&6; }
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5
+$as_echo "$MSVC_DLL" >&6; }
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5
+$as_echo "incorrect, ignoring" >&6; }
+      { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5
+$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;}
+    fi
+  fi
+
+  fi
+
+  if test "x$MSVC_DLL" = x; then
+    # Probe: If Visual Studio Express is installed, there is usually one with the debugger
+    if test "x$VS100COMNTOOLS" != x; then
+      CYGWIN_VS_TOOLS_DIR="$VS100COMNTOOLS/.."
+
+  windows_path="$CYGWIN_VS_TOOLS_DIR"
+  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+    unix_path=`$CYGPATH -u "$windows_path"`
+    CYGWIN_VS_TOOLS_DIR="$unix_path"
+  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
+    CYGWIN_VS_TOOLS_DIR="$unix_path"
+  fi
+
+      if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
+        POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name $DLL_NAME \
+	    | $GREP -i /x64/ | $HEAD --lines 1`
+      else
+        POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name $DLL_NAME \
+	    | $GREP -i /x86/ | $HEAD --lines 1`
+      fi
+
+  DLL_NAME="$DLL_NAME"
+  POSSIBLE_MSVC_DLL="$POSSIBLE_MSVC_DLL"
+  METHOD="search of VS100COMNTOOLS"
+  if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5
+$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;}
+
+    # Need to check if the found msvcr is correct architecture
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5
+$as_echo_n "checking found $DLL_NAME architecture... " >&6; }
+    MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"`
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+      # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit"
+      # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems.
+      if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
+        CORRECT_MSVCR_ARCH="PE32 executable"
+      else
+        CORRECT_MSVCR_ARCH="PE32+ executable"
+      fi
+    else
+      if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
+        CORRECT_MSVCR_ARCH=386
+      else
+        CORRECT_MSVCR_ARCH=x86-64
+      fi
+    fi
+    if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+$as_echo "ok" >&6; }
+      MSVC_DLL="$POSSIBLE_MSVC_DLL"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5
+$as_echo_n "checking for $DLL_NAME... " >&6; }
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5
+$as_echo "$MSVC_DLL" >&6; }
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5
+$as_echo "incorrect, ignoring" >&6; }
+      { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5
+$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;}
+    fi
+  fi
+
+    fi
+  fi
+
+  if test "x$MSVC_DLL" = x; then
+    # Probe: Search wildly in the VCINSTALLDIR. We've probably lost by now.
+    # (This was the original behaviour; kept since it might turn something up)
+    if test "x$CYGWIN_VC_INSTALL_DIR" != x; then
+      if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
+        POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name $DLL_NAME \
+	    | $GREP x64 | $HEAD --lines 1`
+      else
+        POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name $DLL_NAME \
+	    | $GREP x86 | $GREP -v ia64 | $GREP -v x64 | $HEAD --lines 1`
+        if test "x$POSSIBLE_MSVC_DLL" = x; then
+          # We're grasping at straws now...
+          POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name $DLL_NAME \
+	      | $HEAD --lines 1`
+        fi
+      fi
+
+
+  DLL_NAME="$DLL_NAME"
+  POSSIBLE_MSVC_DLL="$POSSIBLE_MSVC_DLL"
+  METHOD="search of VCINSTALLDIR"
+  if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5
+$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;}
+
+    # Need to check if the found msvcr is correct architecture
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5
+$as_echo_n "checking found $DLL_NAME architecture... " >&6; }
+    MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"`
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+      # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit"
+      # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems.
+      if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
+        CORRECT_MSVCR_ARCH="PE32 executable"
+      else
+        CORRECT_MSVCR_ARCH="PE32+ executable"
+      fi
+    else
+      if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
+        CORRECT_MSVCR_ARCH=386
+      else
+        CORRECT_MSVCR_ARCH=x86-64
+      fi
+    fi
+    if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+$as_echo "ok" >&6; }
+      MSVC_DLL="$POSSIBLE_MSVC_DLL"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5
+$as_echo_n "checking for $DLL_NAME... " >&6; }
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5
+$as_echo "$MSVC_DLL" >&6; }
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5
+$as_echo "incorrect, ignoring" >&6; }
+      { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5
+$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;}
+    fi
+  fi
+
+    fi
+  fi
+
+  if test "x$MSVC_DLL" = x; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5
+$as_echo_n "checking for $DLL_NAME... " >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    as_fn_error $? "Could not find $DLL_NAME. Please specify using --with-msvcr-dll." "$LINENO" 5
+  fi
+
+  MSVCP_DLL=$MSVC_DLL
+
+  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+
+  # Input might be given as Windows format, start by converting to
+  # unix format.
+  path="$MSVCP_DLL"
+  new_path=`$CYGPATH -u "$path"`
+
+  # Cygwin tries to hide some aspects of the Windows file system, such that binaries are
+  # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered
+  # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then
+  # "foo.exe" is OK but "foo" is an error.
+  #
+  # This test is therefore slightly more accurate than "test -f" to check for file precense.
+  # It is also a way to make sure we got the proper file name for the real test later on.
+  test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null`
+  if test "x$test_shortpath" = x; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MSVCP_DLL, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of MSVCP_DLL, which resolves as \"$path\", is invalid." >&6;}
+    as_fn_error $? "Cannot locate the the path of MSVCP_DLL" "$LINENO" 5
+  fi
+
+  # Call helper function which possibly converts this using DOS-style short mode.
+  # If so, the updated path is stored in $new_path.
+
+  input_path="$new_path"
+  # Check if we need to convert this using DOS-style short mode. If the path
+  # contains just simple characters, use it. Otherwise (spaces, weird characters),
+  # take no chances and rewrite it.
+  # Note: m4 eats our [], so we need to use [ and ] instead.
+  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]`
+  if test "x$has_forbidden_chars" != x; then
+    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
+    shortmode_path=`$CYGPATH -s -m -a "$input_path"`
+    path_after_shortmode=`$CYGPATH -u "$shortmode_path"`
+    if test "x$path_after_shortmode" != "x$input_to_shortpath"; then
+      # Going to short mode and back again did indeed matter. Since short mode is
+      # case insensitive, let's make it lowercase to improve readability.
+      shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+      # Now convert it back to Unix-stile (cygpath)
+      input_path=`$CYGPATH -u "$shortmode_path"`
+      new_path="$input_path"
+    fi
+  fi
+
+  test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/`
+  if test "x$test_cygdrive_prefix" = x; then
+    # As a simple fix, exclude /usr/bin since it's not a real path.
+    if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then
+      # The path is in a Cygwin special directory (e.g. /home). We need this converted to
+      # a path prefixed by /cygdrive for fixpath to work.
+      new_path="$CYGWIN_ROOT_PATH$input_path"
+    fi
+  fi
+
+
+  if test "x$path" != "x$new_path"; then
+    MSVCP_DLL="$new_path"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MSVCP_DLL to \"$new_path\"" >&5
+$as_echo "$as_me: Rewriting MSVCP_DLL to \"$new_path\"" >&6;}
+  fi
+
+  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+
+  path="$MSVCP_DLL"
+  has_colon=`$ECHO $path | $GREP ^.:`
+  new_path="$path"
+  if test "x$has_colon" = x; then
+    # Not in mixed or Windows style, start by that.
+    new_path=`cmd //c echo $path`
+  fi
+
+
+  input_path="$new_path"
+  # Check if we need to convert this using DOS-style short mode. If the path
+  # contains just simple characters, use it. Otherwise (spaces, weird characters),
+  # take no chances and rewrite it.
+  # Note: m4 eats our [], so we need to use [ and ] instead.
+  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]`
+  if test "x$has_forbidden_chars" != x; then
+    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
+    new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+  fi
+
+
+  windows_path="$new_path"
+  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+    unix_path=`$CYGPATH -u "$windows_path"`
+    new_path="$unix_path"
+  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
+    new_path="$unix_path"
+  fi
+
+  if test "x$path" != "x$new_path"; then
+    MSVCP_DLL="$new_path"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MSVCP_DLL to \"$new_path\"" >&5
+$as_echo "$as_me: Rewriting MSVCP_DLL to \"$new_path\"" >&6;}
+  fi
+
+  # Save the first 10 bytes of this path to the storage, so fixpath can work.
+  all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
+
+  else
+    # We're on a unix platform. Hooray! :)
+    path="$MSVCP_DLL"
+    has_space=`$ECHO "$path" | $GREP " "`
+    if test "x$has_space" != x; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MSVCP_DLL, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of MSVCP_DLL, which resolves as \"$path\", is invalid." >&6;}
+      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+    fi
+
+    # Use eval to expand a potential ~
+    eval path="$path"
+    if test ! -f "$path" && test ! -d "$path"; then
+      as_fn_error $? "The path of MSVCP_DLL, which resolves as \"$path\", is not found." "$LINENO" 5
+    fi
+
+    MSVCP_DLL="`cd "$path"; $THEPWDCMD -L`"
+  fi
+
+  MSVCP_DLL=$MSVCP_DLL
+
+
+    fi
+  fi
 
 
 
@@ -50074,7 +50910,6 @@
   fi
 
 
-
 ###############################################################################
 #
 # We need to do some final tweaking, when everything else is done.
@@ -50616,16 +51451,17 @@
 
 
   CCACHE=
+  CCACHE_STATUS=
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking is ccache enabled" >&5
 $as_echo_n "checking is ccache enabled... " >&6; }
-  ENABLE_CCACHE=$enable_ccache
   if test "x$enable_ccache" = xyes; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+    if test "x$TOOLCHAIN_TYPE" = "xgcc" -o "x$TOOLCHAIN_TYPE" = "xclang"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
-    OLD_PATH="$PATH"
-    if test "x$TOOLCHAIN_PATH" != x; then
-      PATH=$TOOLCHAIN_PATH:$PATH
-    fi
+      OLD_PATH="$PATH"
+      if test "x$TOOLCHAIN_PATH" != x; then
+        PATH=$TOOLCHAIN_PATH:$PATH
+      fi
 
 
 
@@ -50819,11 +51655,19 @@
   fi
 
 
-    CCACHE_STATUS="enabled"
-    PATH="$OLD_PATH"
+      PATH="$OLD_PATH"
+      CCACHE_VERSION=`$CCACHE --version | head -n1 | $SED 's/[A-Za-z ]*//'`
+      CCACHE_STATUS="Active ($CCACHE_VERSION)"
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ccache is not supported with toolchain type $TOOLCHAIN_TYPE" >&5
+$as_echo "$as_me: WARNING: ccache is not supported with toolchain type $TOOLCHAIN_TYPE" >&2;}
+    fi
   elif test "x$enable_ccache" = xno; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, explicitly disabled" >&5
 $as_echo "no, explicitly disabled" >&6; }
+    CCACHE_STATUS="Disabled"
   elif test "x$enable_ccache" = x; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
@@ -50854,23 +51698,17 @@
   if test "x$CCACHE" != x; then
 
   if test "x$CCACHE" != x; then
-    # Only use ccache if it is 3.1.4 or later, which supports
-    # precompiled headers.
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ccache supports precompiled headers" >&5
-$as_echo_n "checking if ccache supports precompiled headers... " >&6; }
-    HAS_GOOD_CCACHE=`($CCACHE --version | head -n 1 | grep -E 3.1.[456789]) 2> /dev/null`
-    if test "x$HAS_GOOD_CCACHE" = x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, disabling ccache" >&5
-$as_echo "no, disabling ccache" >&6; }
-      CCACHE=
-      CCACHE_STATUS="disabled"
-    else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+    if test "x$USE_PRECOMPILED_HEADER" = "x1"; then
+      HAS_BAD_CCACHE=`$ECHO $CCACHE_VERSION | \
+          $GREP -e '^1.*' -e '^2.*' -e '^3\.0.*' -e '^3\.1\.[0123]'`
+      if test "x$HAS_BAD_CCACHE" != "x"; then
+        as_fn_error $? "Precompiled headers requires ccache 3.1.4 or later, found $CCACHE_VERSION" "$LINENO" 5
+      fi
       { $as_echo "$as_me:${as_lineno-$LINENO}: checking if C-compiler supports ccache precompiled headers" >&5
 $as_echo_n "checking if C-compiler supports ccache precompiled headers... " >&6; }
+      CCACHE_PRECOMP_FLAG="-fpch-preprocess"
       PUSHED_FLAGS="$CXXFLAGS"
-      CXXFLAGS="-fpch-preprocess $CXXFLAGS"
+      CXXFLAGS="$CCACHE_PRECOMP_FLAG $CXXFLAGS"
       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -50892,19 +51730,18 @@
       if test "x$CC_KNOWS_CCACHE_TRICK" = xyes; then
         { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
-      else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, disabling ccaching of precompiled headers" >&5
-$as_echo "no, disabling ccaching of precompiled headers" >&6; }
-        CCACHE=
-        CCACHE_STATUS="disabled"
-      fi
-    fi
-  fi
-
-  if test "x$CCACHE" != x; then
-    CCACHE_SLOPPINESS=time_macros
-    CCACHE="CCACHE_COMPRESS=1 $SET_CCACHE_DIR CCACHE_SLOPPINESS=$CCACHE_SLOPPINESS $CCACHE"
-    CCACHE_FLAGS=-fpch-preprocess
+        CFLAGS_CCACHE="$CCACHE_PRECOMP_FLAG"
+
+        CCACHE_SLOPPINESS=pch_defines,time_macros
+      else
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+        as_fn_error $? "Cannot use ccache with precompiled headers without compiler support for $CCACHE_PRECOMP_FLAG" "$LINENO" 5
+      fi
+    fi
+
+    CCACHE="CCACHE_COMPRESS=1 $SET_CCACHE_DIR \
+        CCACHE_SLOPPINESS=$CCACHE_SLOPPINESS CCACHE_BASEDIR=$TOPDIR $CCACHE"
 
     if test "x$SET_CCACHE_DIR" != x; then
       mkdir -p $CCACHE_DIR > /dev/null 2>&1
@@ -52201,7 +53038,10 @@
     printf "* Environment:    $WINDOWS_ENV_VENDOR version $WINDOWS_ENV_VERSION (root at $WINDOWS_ENV_ROOT_PATH)\n"
   fi
   printf "* Boot JDK:       $BOOT_JDK_VERSION (at $BOOT_JDK)\n"
-  printf "* Toolchain:      $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION)\n"
+  if test "x$TOOLCHAIN_VERSION" != "x"; then
+    print_version=" $TOOLCHAIN_VERSION"
+  fi
+  printf "* Toolchain:      $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION$print_version)\n"
   printf "* C Compiler:     Version $CC_VERSION_NUMBER (at $CC)\n"
   printf "* C++ Compiler:   Version $CXX_VERSION_NUMBER (at $CXX)\n"
 
--- a/common/autoconf/help.m4	Wed Feb 18 22:19:47 2015 -0500
+++ b/common/autoconf/help.m4	Mon Feb 23 05:01:11 2015 -0800
@@ -209,7 +209,10 @@
     printf "* Environment:    $WINDOWS_ENV_VENDOR version $WINDOWS_ENV_VERSION (root at $WINDOWS_ENV_ROOT_PATH)\n"
   fi
   printf "* Boot JDK:       $BOOT_JDK_VERSION (at $BOOT_JDK)\n"
-  printf "* Toolchain:      $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION)\n"
+  if test "x$TOOLCHAIN_VERSION" != "x"; then
+    print_version=" $TOOLCHAIN_VERSION"
+  fi
+  printf "* Toolchain:      $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION$print_version)\n" 
   printf "* C Compiler:     Version $CC_VERSION_NUMBER (at $CC)\n"
   printf "* C++ Compiler:   Version $CXX_VERSION_NUMBER (at $CXX)\n"
 
--- a/common/autoconf/hotspot-spec.gmk.in	Wed Feb 18 22:19:47 2015 -0500
+++ b/common/autoconf/hotspot-spec.gmk.in	Mon Feb 23 05:01:11 2015 -0800
@@ -109,8 +109,8 @@
 MT:=@HOTSPOT_MT@
 RC:=@HOTSPOT_RC@
 
-EXTRA_CFLAGS=@LEGACY_EXTRA_CFLAGS@
-EXTRA_CXXFLAGS=@LEGACY_EXTRA_CXXFLAGS@
+EXTRA_CFLAGS=@LEGACY_EXTRA_CFLAGS@ $(CFLAGS_CCACHE)
+EXTRA_CXXFLAGS=@LEGACY_EXTRA_CXXFLAGS@ $(CFLAGS_CCACHE)
 EXTRA_LDFLAGS=@LEGACY_EXTRA_LDFLAGS@
 
 USE_PRECOMPILED_HEADER=@USE_PRECOMPILED_HEADER@
@@ -132,6 +132,13 @@
   ZIP_DEBUGINFO_FILES:=0
 endif
 
+ifeq ($(OPENJDK_TARGET_OS), windows)
+  # On Windows, the Visual Studio toolchain needs the LIB and INCLUDE
+  # environment variables (in Windows path style).
+  export INCLUDE:=@VS_INCLUDE@
+  export LIB:=@VS_LIB@
+endif
+
 # Sneak this in via the spec.gmk file, since we don't want to mess around too much with the Hotspot make files.
 # This is needed to get the LOG setting to work properly.
 include $(SRC_ROOT)/make/common/MakeBase.gmk
--- a/common/autoconf/libraries.m4	Wed Feb 18 22:19:47 2015 -0500
+++ b/common/autoconf/libraries.m4	Mon Feb 23 05:01:11 2015 -0800
@@ -1124,10 +1124,9 @@
 AC_DEFUN_ONCE([LIB_SETUP_ON_WINDOWS],
 [
   if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
-    TOOLCHAIN_SETUP_MSVCR_DLL
+    TOOLCHAIN_SETUP_VS_RUNTIME_DLLS
     BASIC_DEPRECATED_ARG_WITH([dxsdk])
     BASIC_DEPRECATED_ARG_WITH([dxsdk-lib])
     BASIC_DEPRECATED_ARG_WITH([dxsdk-include])
   fi
-  AC_SUBST(MSVCR_DLL)
 ])
--- a/common/autoconf/spec.gmk.in	Wed Feb 18 22:19:47 2015 -0500
+++ b/common/autoconf/spec.gmk.in	Mon Feb 23 05:01:11 2015 -0800
@@ -129,14 +129,12 @@
 # colon or semicolon
 PATH_SEP:=@PATH_SEP@
 
+# Save the original path before replacing it with the Visual Studio tools
+ORIGINAL_PATH:=@ORIGINAL_PATH@
 ifeq ($(OPENJDK_TARGET_OS), windows)
-  # On Windows, the Visual Studio toolchain needs the LIB and INCLUDE
-  # environment variables (in Windows path style), and the PATH needs to
-  # be adjusted to include Visual Studio tools (but this needs to be in
-  # cygwin/msys style).
+  # On Windows, the Visual Studio toolchain needs the PATH to be adjusted
+  # to include Visual Studio tools (this needs to be in cygwin/msys style).
   export PATH:=@VS_PATH@
-  export INCLUDE:=@VS_INCLUDE@
-  export LIB:=@VS_LIB@
 endif
 
 SYSROOT_CFLAGS := @SYSROOT_CFLAGS@
@@ -328,6 +326,8 @@
 
 CFLAGS_WARNINGS_ARE_ERRORS:=@CFLAGS_WARNINGS_ARE_ERRORS@
 
+CFLAGS_CCACHE:=@CFLAGS_CCACHE@
+
 # Tools that potentially need to be cross compilation aware.
 CC:=@FIXPATH@ @CCACHE@ @CC@
 
@@ -583,6 +583,7 @@
 USE_EXTERNAL_LIBZ:=@USE_EXTERNAL_LIBZ@
 LIBZIP_CAN_USE_MMAP:=@LIBZIP_CAN_USE_MMAP@
 MSVCR_DLL:=@MSVCR_DLL@
+MSVCP_DLL:=@MSVCP_DLL@
 
 
 # ADD_SRCS takes a single argument with source roots
--- a/common/autoconf/toolchain.m4	Wed Feb 18 22:19:47 2015 -0500
+++ b/common/autoconf/toolchain.m4	Mon Feb 23 05:01:11 2015 -0800
@@ -691,8 +691,8 @@
     CC_VERSION_OUTPUT=`$CC 2>&1 | $HEAD -n 1 | $TR -d '\r'`
     COMPILER_CPU_TEST=`$ECHO $CC_VERSION_OUTPUT | $SED -n "s/^.* \(.*\)$/\1/p"`
     if test "x$OPENJDK_TARGET_CPU" = "xx86"; then
-      if test "x$COMPILER_CPU_TEST" != "x80x86"; then
-        AC_MSG_ERROR([Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for "$COMPILER_CPU_TEST"; expected "80x86".])
+      if test "x$COMPILER_CPU_TEST" != "x80x86" -a "x$COMPILER_CPU_TEST" != "xx86"; then
+        AC_MSG_ERROR([Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for "$COMPILER_CPU_TEST"; expected "80x86" or "x86".])
       fi
     elif test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then
       if test "x$COMPILER_CPU_TEST" != "xx64"; then
--- a/common/autoconf/toolchain_windows.m4	Wed Feb 18 22:19:47 2015 -0500
+++ b/common/autoconf/toolchain_windows.m4	Mon Feb 23 05:01:11 2015 -0800
@@ -23,43 +23,90 @@
 # questions.
 #
 
+################################################################################
+
+VALID_VS_VERSIONS="2010 2012 2013"
+
+VS_DESCRIPTION_2010="Microsoft Visual Studio 2010"
+VS_VERSION_INTERNAL_2010=100
+VS_MSVCR_2010=msvcr100.dll
+# We don't use msvcp on Visual Studio 2010
+#VS_MSVCP_2010=msvcp100.dll
+VS_ENVVAR_2010="VS100COMNTOOLS"
+VS_VS_INSTALLDIR_2010="Microsoft Visual Studio 10.0"
+VS_SDK_INSTALLDIR_2010="Microsoft SDKs/Windows/v7.1"
+VS_VS_PLATFORM_NAME_2010="v100"
+VS_SDK_PLATFORM_NAME_2010="Windows7.1SDK"
+
+VS_DESCRIPTION_2012="Microsoft Visual Studio 2012"
+VS_VERSION_INTERNAL_2012=110
+VS_MSVCR_2012=msvcr110.dll
+VS_MSVCP_2012=msvcp110.dll
+VS_ENVVAR_2012="VS110COMNTOOLS"
+VS_VS_INSTALLDIR_2012="Microsoft Visual Studio 11.0"
+VS_SDK_INSTALLDIR_2012=
+VS_VS_PLATFORM_NAME_2012="v110"
+VS_SDK_PLATFORM_NAME_2012=
+
+VS_DESCRIPTION_2013="Microsoft Visual Studio 2013"
+VS_VERSION_INTERNAL_2013=120
+VS_MSVCR_2013=msvcr120.dll
+VS_MSVCP_2013=msvcp120.dll
+VS_ENVVAR_2013="VS120COMNTOOLS"
+VS_VS_INSTALLDIR_2013="Microsoft Visual Studio 12.0"
+VS_SDK_INSTALLDIR_2013=
+VS_VS_PLATFORM_NAME_2013="v120"
+VS_SDK_PLATFORM_NAME_2013=
+
+################################################################################
+
 AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT],
 [
   if test "x$VS_ENV_CMD" = x; then
-    VS100BASE="$1"
-    METHOD="$2"
-    BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(VS100BASE)
-    if test -d "$VS100BASE"; then
-      if test -f "$VS100BASE/$VCVARSFILE"; then
-        AC_MSG_NOTICE([Found Visual Studio installation at $VS100BASE using $METHOD])
-        VS_ENV_CMD="$VS100BASE/$VCVARSFILE"
+    VS_VERSION="$1"
+    VS_BASE="$2"
+    METHOD="$3"
+
+    if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
+      VCVARSFILE="vc/bin/vcvars32.bat"
+    else
+      VCVARSFILE="vc/bin/amd64/vcvars64.bat"
+    fi
+  
+    BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(VS_BASE)
+    if test -d "$VS_BASE"; then
+      if test -f "$VS_BASE/$VCVARSFILE"; then
+        AC_MSG_NOTICE([Found Visual Studio installation at $VS_BASE using $METHOD])
+        VS_ENV_CMD="$VS_BASE/$VCVARSFILE"
         # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
         # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013
-        # TODO: improve detection for other versions of VS
-        PLATFORM_TOOLSET="v100"
+        eval PLATFORM_TOOLSET="\${VS_VS_PLATFORM_NAME_${VS_VERSION}}"
       else
-        AC_MSG_NOTICE([Found Visual Studio installation at $VS100BASE using $METHOD])
+        AC_MSG_NOTICE([Found Visual Studio installation at $VS_BASE using $METHOD])
         AC_MSG_NOTICE([Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring])
       fi
     fi
   fi
 ])
 
+################################################################################
+
 AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT],
 [
   if test "x$VS_ENV_CMD" = x; then
-    WIN_SDK_BASE="$1"
-    METHOD="$2"
+    VS_VERSION="$1"
+    WIN_SDK_BASE="$2"
+    METHOD="$3"
     BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(WIN_SDK_BASE)
     if test -d "$WIN_SDK_BASE"; then
       # There have been cases of partial or broken SDK installations. A missing
       # lib dir is not going to work.
-      if test ! -d "$WIN_SDK_BASE/../lib"; then
+      if test ! -d "$WIN_SDK_BASE/lib"; then
         AC_MSG_NOTICE([Found Windows SDK installation at $WIN_SDK_BASE using $METHOD])
         AC_MSG_NOTICE([Warning: Installation is broken, lib dir is missing. Ignoring])
-      elif test -f "$WIN_SDK_BASE/SetEnv.Cmd"; then
+      elif test -f "$WIN_SDK_BASE/Bin/SetEnv.Cmd"; then
         AC_MSG_NOTICE([Found Windows SDK installation at $WIN_SDK_BASE using $METHOD])
-        VS_ENV_CMD="$WIN_SDK_BASE/SetEnv.Cmd"
+        VS_ENV_CMD="$WIN_SDK_BASE/Bin/SetEnv.Cmd"
         if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
           VS_ENV_ARGS="/x86"
         else
@@ -68,7 +115,7 @@
         # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
         # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be 'Windows7.1SDK' for Windows7.1SDK
         # TODO: improve detection for other versions of SDK
-        PLATFORM_TOOLSET="Windows7.1SDK"
+        eval PLATFORM_TOOLSET="\${VS_SDK_PLATFORM_NAME_${VS_VERSION}}"
       else
         AC_MSG_NOTICE([Found Windows SDK installation at $WIN_SDK_BASE using $METHOD])
         AC_MSG_NOTICE([Warning: Installation is broken, SetEnv.Cmd is missing. Ignoring])
@@ -77,50 +124,121 @@
   fi
 ])
 
+################################################################################
+# Finds the bat or cmd file in Visual Studio or the SDK that sets up a proper
+# build environment and assigns it to VS_ENV_CMD
 AC_DEFUN([TOOLCHAIN_FIND_VISUAL_STUDIO_BAT_FILE],
 [
-  if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
-    VCVARSFILE="vc/bin/vcvars32.bat"
-  else
-    VCVARSFILE="vc/bin/amd64/vcvars64.bat"
+  VS_VERSION="$1"
+  eval VS_COMNTOOLS_VAR="\${VS_ENVVAR_${VS_VERSION}}"
+  eval VS_COMNTOOLS="\$${VS_COMNTOOLS_VAR}"
+  eval VS_INSTALL_DIR="\${VS_VS_INSTALLDIR_${VS_VERSION}}"
+  eval SDK_INSTALL_DIR="\${VS_SDK_INSTALLDIR_${VS_VERSION}}"
+
+  # When using --with-tools-dir, assume it points to the correct and default
+  # version of Visual Studio or that --with-toolchain-version was also set.
+  if test "x$with_tools_dir" != x; then
+    TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([${VS_VERSION}],
+        [$with_tools_dir/../..], [--with-tools-dir])
+    TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([${VS_VERSION}],
+        [$with_tools_dir/../../..], [--with-tools-dir])
+    if test "x$VS_ENV_CMD" = x; then
+      # Having specified an argument which is incorrect will produce an instant failure;
+      # we should not go on looking
+      AC_MSG_NOTICE([The path given by --with-tools-dir does not contain a valid])
+      AC_MSG_NOTICE([Visual Studio installation. Please point to the VC/bin or VC/bin/amd64])
+      AC_MSG_NOTICE([directory within the Visual Studio installation])
+      AC_MSG_ERROR([Cannot locate a valid Visual Studio installation])
+    fi
   fi
 
   VS_ENV_CMD=""
   VS_ENV_ARGS=""
-  if test "x$with_toolsdir" != x; then
-    TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([$with_toolsdir/../..], [--with-tools-dir])
-  fi
 
-  if test "x$with_toolsdir" != x && test "x$VS_ENV_CMD" = x; then
-    # Having specified an argument which is incorrect will produce an instant failure;
-    # we should not go on looking
-    AC_MSG_NOTICE([The path given by --with-tools-dir does not contain a valid Visual Studio installation])
-    AC_MSG_NOTICE([Please point to the VC/bin directory within the Visual Studio installation])
-    AC_MSG_ERROR([Cannot locate a valid Visual Studio installation])
-  fi
-
-  if test "x$VS100COMNTOOLS" != x; then
-    TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([$VS100COMNTOOLS/../..], [VS100COMNTOOLS variable])
+  if test "x$VS_COMNTOOLS" != x; then
+    TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([${VS_VERSION}],
+        [$VS_COMNTOOLS/../..], [$VS_COMNTOOLS_VAR variable])
   fi
   if test "x$PROGRAMFILES" != x; then
-    TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([$PROGRAMFILES/Microsoft Visual Studio 10.0], [well-known name])
+    TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([${VS_VERSION}],
+        [$PROGRAMFILES/$VS_INSTALL_DIR], [well-known name])
   fi
-  TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([C:/Program Files/Microsoft Visual Studio 10.0], [well-known name])
-  TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([C:/Program Files (x86)/Microsoft Visual Studio 10.0], [well-known name])
-
-  if test "x$ProgramW6432" != x; then
-    TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([$ProgramW6432/Microsoft SDKs/Windows/v7.1/Bin], [well-known name])
+  # Work around the insanely named ProgramFiles(x86) env variable
+  PROGRAMFILES_X86="`env | $SED -n 's/^ProgramFiles(x86)=//p'`"
+  if test "x$PROGRAMFILES_X86" != x; then
+    TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([${VS_VERSION}],
+        [$PROGRAMFILES_X86/$VS_INSTALL_DIR], [well-known name])
   fi
-  if test "x$PROGRAMW6432" != x; then
-    TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([$PROGRAMW6432/Microsoft SDKs/Windows/v7.1/Bin], [well-known name])
+  TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([${VS_VERSION}],
+      [C:/Program Files/$VS_INSTALL_DIR], [well-known name])
+  TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([${VS_VERSION}],
+      [C:/Program Files (x86)/$VS_INSTALL_DIR], [well-known name])
+
+  if test "x$SDK_INSTALL_DIR" != x; then
+    if test "x$ProgramW6432" != x; then
+      TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([${VS_VERSION}],
+          [$ProgramW6432/$SDK_INSTALL_DIR], [well-known name])
+    fi
+    if test "x$PROGRAMW6432" != x; then
+      TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([${VS_VERSION}],
+          [$PROGRAMW6432/$SDK_INSTALL_DIR], [well-known name])
+    fi
+    if test "x$PROGRAMFILES" != x; then
+      TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([${VS_VERSION}],
+          [$PROGRAMFILES/$SDK_INSTALL_DIR], [well-known name])
+    fi
+    TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([${VS_VERSION}],
+        [C:/Program Files/$SDK_INSTALL_DIR], [well-known name])
+    TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([${VS_VERSION}],
+        [C:/Program Files (x86)/$SDK_INSTALL_DIR], [well-known name])
   fi
-  if test "x$PROGRAMFILES" != x; then
-    TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([$PROGRAMFILES/Microsoft SDKs/Windows/v7.1/Bin], [well-known name])
-  fi
-  TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([C:/Program Files/Microsoft SDKs/Windows/v7.1/Bin], [well-known name])
-  TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([C:/Program Files (x86)/Microsoft SDKs/Windows/v7.1/Bin], [well-known name])
 ])
 
+################################################################################
+
+AC_DEFUN([TOOLCHAIN_FIND_VISUAL_STUDIO],
+[
+  AC_ARG_WITH(toolchain-version, [AS_HELP_STRING([--with-toolchain-version],
+      [the version of the toolchain to look for, use '--help' to show possible values @<:@platform dependent@:>@])])
+
+  if test "x$with_toolchain_version" = xlist; then
+    # List all toolchains
+    AC_MSG_NOTICE([The following toolchain versions are valid on this platform:])
+    for version in $VALID_VS_VERSIONS; do
+      eval VS_DESCRIPTION=\${VS_DESCRIPTION_$version}
+      $PRINTF "  %-10s  %s\n" $version "$VS_DESCRIPTION"
+    done
+
+    exit 0
+  elif test "x$with_toolchain_version" != x; then
+    # User override; check that it is valid
+    if test "x${VALID_VS_VERSIONS/$with_toolchain_version/}" = "x${VALID_VS_VERSIONS}"; then
+      AC_MSG_NOTICE([Visual Studio version $with_toolchain_version is not valid.])
+      AC_MSG_NOTICE([Valid Visual Studio versions: $VALID_VS_VERSIONS.])
+      AC_MSG_ERROR([Cannot continue.])
+    fi
+    VS_VERSIONS_PROBE_LIST="$with_toolchain_version"
+  else
+    # No flag given, use default
+    VS_VERSIONS_PROBE_LIST="$VALID_VS_VERSIONS"
+  fi
+
+  for VS_VERSION in $VS_VERSIONS_PROBE_LIST; do
+    TOOLCHAIN_FIND_VISUAL_STUDIO_BAT_FILE([$VS_VERSION])
+    if test "x$VS_ENV_CMD" != x; then
+      TOOLCHAIN_VERSION=$VS_VERSION
+      eval VS_DESCRIPTION="\${VS_DESCRIPTION_${VS_VERSION}}"
+      eval VS_VERSION_INTERNAL="\${VS_VERSION_INTERNAL_${VS_VERSION}}"
+      eval MSVCR_NAME="\${VS_MSVCR_${VS_VERSION}}"
+      eval MSVCP_NAME="\${VS_MSVCP_${VS_VERSION}}"
+      # The rest of the variables are already evaled while probing
+      AC_MSG_NOTICE([Found $VS_DESCRIPTION])
+      break
+    fi
+  done
+])
+
+################################################################################
 # Check if the VS env variables were setup prior to running configure.
 # If not, then find vcvarsall.bat and run it automatically, and integrate
 # the set env variables into the spec file.
@@ -142,7 +260,8 @@
   fi
 
   # First-hand choice is to locate and run the vsvars bat file.
-  TOOLCHAIN_FIND_VISUAL_STUDIO_BAT_FILE
+  TOOLCHAIN_FIND_VISUAL_STUDIO
+
   if test "x$VS_ENV_CMD" != x; then
     # We have found a Visual Studio environment on disk, let's extract variables from the vsvars bat file.
     BASIC_FIXUP_EXECUTABLE(VS_ENV_CMD)
@@ -213,9 +332,9 @@
       AC_MSG_ERROR([Your VC command prompt seems broken, INCLUDE and/or LIB is missing.])
     else
       AC_MSG_RESULT([ok])
-      # Remove any trailing "\" and " " from the variables.
-      VS_INCLUDE=`$ECHO "$VS_INCLUDE" | $SED 's/\\\\* *$//'`
-      VS_LIB=`$ECHO "$VS_LIB" | $SED 's/\\\\* *$//'`
+      # Remove any trailing "\" ";" and " " from the variables.
+      VS_INCLUDE=`$ECHO "$VS_INCLUDE" | $SED -e 's/\\\\*;* *$//'`
+      VS_LIB=`$ECHO "$VS_LIB" | $SED 's/\\\\*;* *$//'`
       VCINSTALLDIR=`$ECHO "$VCINSTALLDIR" | $SED 's/\\\\* *$//'`
       WindowsSDKDir=`$ECHO "$WindowsSDKDir" | $SED 's/\\\\* *$//'`
       WINDOWSSDKDIR=`$ECHO "$WINDOWSSDKDIR" | $SED 's/\\\\* *$//'`
@@ -226,6 +345,26 @@
       AC_SUBST(VS_PATH)
       AC_SUBST(VS_INCLUDE)
       AC_SUBST(VS_LIB)
+
+      # Convert VS_INCLUDE into SYSROOT_CFLAGS
+      OLDIFS="$IFS"
+      IFS=";"
+      for i in $VS_INCLUDE; do
+        ipath=$i
+	IFS="$OLDIFS"
+        BASIC_FIXUP_PATH([ipath])
+	IFS=";"
+      	SYSROOT_CFLAGS="$SYSROOT_CFLAGS -I$ipath"
+      done
+      # Convert VS_LIB into SYSROOT_LDFLAGS
+      for i in $VS_LIB; do
+        libpath=$i
+	IFS="$OLDIFS"
+        BASIC_FIXUP_PATH([libpath])
+	IFS=";"
+      	SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS -libpath:$libpath"
+      done
+      IFS="$OLDIFS"
     fi
   else
     AC_MSG_RESULT([not found])
@@ -242,16 +381,17 @@
   fi
 ])
 
-AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL],
+AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL],
 [
-  POSSIBLE_MSVCR_DLL="$1"
-  METHOD="$2"
-  if test -e "$POSSIBLE_MSVCR_DLL"; then
-    AC_MSG_NOTICE([Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD])
-
+  DLL_NAME="$1"
+  POSSIBLE_MSVC_DLL="$2"
+  METHOD="$3"
+  if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then
+    AC_MSG_NOTICE([Found $1 at $POSSIBLE_MSVC_DLL using $METHOD])
+    
     # Need to check if the found msvcr is correct architecture
-    AC_MSG_CHECKING([found msvcr100.dll architecture])
-    MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"`
+    AC_MSG_CHECKING([found $1 architecture])
+    MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"`
     if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
       # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit"
       # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems.
@@ -267,96 +407,135 @@
         CORRECT_MSVCR_ARCH=x86-64
       fi
     fi
-    if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then
+    if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then
       AC_MSG_RESULT([ok])
-      MSVCR_DLL="$POSSIBLE_MSVCR_DLL"
-      AC_MSG_CHECKING([for msvcr100.dll])
-      AC_MSG_RESULT([$MSVCR_DLL])
+      MSVC_DLL="$POSSIBLE_MSVC_DLL"
+      AC_MSG_CHECKING([for $1])
+      AC_MSG_RESULT([$MSVC_DLL])
     else
       AC_MSG_RESULT([incorrect, ignoring])
-      AC_MSG_NOTICE([The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE])
+      AC_MSG_NOTICE([The file type of the located $1 is $MSVC_DLL_FILETYPE])
     fi
   fi
 ])
 
-AC_DEFUN([TOOLCHAIN_SETUP_MSVCR_DLL],
+AC_DEFUN([TOOLCHAIN_SETUP_MSVC_DLL],
 [
-  AC_ARG_WITH(msvcr-dll, [AS_HELP_STRING([--with-msvcr-dll],
-      [copy this msvcr100.dll into the built JDK (Windows only) @<:@probed@:>@])])
+  VAR_NAME="$1"
+  DLL_NAME="$2"
+  MSVC_DLL=
 
-  if test "x$with_msvcr_dll" != x; then
-    # If given explicitely by user, do not probe. If not present, fail directly.
-    TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL([$with_msvcr_dll], [--with-msvcr-dll])
-    if test "x$MSVCR_DLL" = x; then
-      AC_MSG_ERROR([Could not find a proper msvcr100.dll as specified by --with-msvcr-dll])
-    fi
-  fi
-
-  if test "x$MSVCR_DLL" = x; then
+  if test "x$MSVC_DLL" = x; then
     # Probe: Using well-known location from Visual Studio 10.0
     if test "x$VCINSTALLDIR" != x; then
       CYGWIN_VC_INSTALL_DIR="$VCINSTALLDIR"
       BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(CYGWIN_VC_INSTALL_DIR)
       if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
-        POSSIBLE_MSVCR_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x64/Microsoft.VC100.CRT/msvcr100.dll"
+        POSSIBLE_MSVC_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x64/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME"
       else
-        POSSIBLE_MSVCR_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x86/Microsoft.VC100.CRT/msvcr100.dll"
+        POSSIBLE_MSVC_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x86/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME"
       fi
-      TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL([$POSSIBLE_MSVCR_DLL], [well-known location in VCINSTALLDIR])
+      $ECHO "POSSIBLE_MSVC_DLL $POSSIBLEMSVC_DLL"
+      TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL([$DLL_NAME], [$POSSIBLE_MSVC_DLL],
+          [well-known location in VCINSTALLDIR])
     fi
   fi
 
-  if test "x$MSVCR_DLL" = x; then
+  if test "x$MSVC_DLL" = x; then
     # Probe: Check in the Boot JDK directory.
-    POSSIBLE_MSVCR_DLL="$BOOT_JDK/bin/msvcr100.dll"
-    TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL([$POSSIBLE_MSVCR_DLL], [well-known location in Boot JDK])
+    POSSIBLE_MSVC_DLL="$BOOT_JDK/bin/$DLL_NAME"
+    TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL([$DLL_NAME], [$POSSIBLE_MSVC_DLL],
+        [well-known location in Boot JDK])
+  fi
+  
+  if test "x$MSVC_DLL" = x; then
+    # Probe: Look in the Windows system32 directory 
+    CYGWIN_SYSTEMROOT="$SYSTEMROOT"
+    BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(CYGWIN_SYSTEMROOT)
+    POSSIBLE_MSVC_DLL="$CYGWIN_SYSTEMROOT/system32/$DLL_NAME"
+    TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL([$DLL_NAME], [$POSSIBLE_MSVC_DLL],
+        [well-known location in SYSTEMROOT])
   fi
 
-  if test "x$MSVCR_DLL" = x; then
-    # Probe: Look in the Windows system32 directory
-    CYGWIN_SYSTEMROOT="$SYSTEMROOT"
-    BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(CYGWIN_SYSTEMROOT)
-    POSSIBLE_MSVCR_DLL="$CYGWIN_SYSTEMROOT/system32/msvcr100.dll"
-    TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL([$POSSIBLE_MSVCR_DLL], [well-known location in SYSTEMROOT])
-  fi
-
-  if test "x$MSVCR_DLL" = x; then
+  if test "x$MSVC_DLL" = x; then
     # Probe: If Visual Studio Express is installed, there is usually one with the debugger
     if test "x$VS100COMNTOOLS" != x; then
       CYGWIN_VS_TOOLS_DIR="$VS100COMNTOOLS/.."
       BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(CYGWIN_VS_TOOLS_DIR)
       if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
-        POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name msvcr100.dll | $GREP -i /x64/ | $HEAD --lines 1`
+        POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name $DLL_NAME \
+	    | $GREP -i /x64/ | $HEAD --lines 1`
       else
-        POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name msvcr100.dll | $GREP -i /x86/ | $HEAD --lines 1`
+        POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name $DLL_NAME \
+	    | $GREP -i /x86/ | $HEAD --lines 1`
       fi
-      TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL([$POSSIBLE_MSVCR_DLL], [search of VS100COMNTOOLS])
+      TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL([$DLL_NAME], [$POSSIBLE_MSVC_DLL],
+          [search of VS100COMNTOOLS])
     fi
   fi
-
-  if test "x$MSVCR_DLL" = x; then
+      
+  if test "x$MSVC_DLL" = x; then
     # Probe: Search wildly in the VCINSTALLDIR. We've probably lost by now.
-    # (This was the original behaviour; kept since it might turn up something)
+    # (This was the original behaviour; kept since it might turn something up)
     if test "x$CYGWIN_VC_INSTALL_DIR" != x; then
       if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
-        POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name msvcr100.dll | $GREP x64 | $HEAD --lines 1`
+        POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name $DLL_NAME \
+	    | $GREP x64 | $HEAD --lines 1`
       else
-        POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name msvcr100.dll | $GREP x86 | $GREP -v ia64 | $GREP -v x64 | $HEAD --lines 1`
-        if test "x$POSSIBLE_MSVCR_DLL" = x; then
+        POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name $DLL_NAME \
+	    | $GREP x86 | $GREP -v ia64 | $GREP -v x64 | $HEAD --lines 1`
+        if test "x$POSSIBLE_MSVC_DLL" = x; then
           # We're grasping at straws now...
-          POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name msvcr100.dll | $HEAD --lines 1`
+          POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name $DLL_NAME \
+	      | $HEAD --lines 1`
         fi
       fi
-
-      TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL([$POSSIBLE_MSVCR_DLL], [search of VCINSTALLDIR])
+      
+      TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL([$DLL_NAME], [$POSSIBLE_MSVC_DLL],
+          [search of VCINSTALLDIR])
     fi
   fi
+  
+  if test "x$MSVC_DLL" = x; then
+    AC_MSG_CHECKING([for $DLL_NAME])
+    AC_MSG_RESULT([no])
+    AC_MSG_ERROR([Could not find $DLL_NAME. Please specify using --with-msvcr-dll.])
+  fi
 
-  if test "x$MSVCR_DLL" = x; then
-    AC_MSG_CHECKING([for msvcr100.dll])
-    AC_MSG_RESULT([no])
-    AC_MSG_ERROR([Could not find msvcr100.dll. Please specify using --with-msvcr-dll.])
+  $1=$MSVC_DLL
+  BASIC_FIXUP_PATH($1)
+  AC_SUBST($1, [$]$1)
+])
+
+AC_DEFUN([TOOLCHAIN_SETUP_VS_RUNTIME_DLLS],
+[
+  AC_ARG_WITH(msvcr-dll, [AS_HELP_STRING([--with-msvcr-dll],
+      [path to microsoft C runtime dll (msvcr*.dll) (Windows only) @<:@probed@:>@])])
+
+  if test "x$with_msvcr_dll" != x; then
+    # If given explicitely by user, do not probe. If not present, fail directly.
+    TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL([$DLL_NAME], [$with_msvcr_dll],
+        [--with-msvcr-dll])
+    if test "x$MSVC_DLL" = x; then
+      AC_MSG_ERROR([Could not find a proper $MSVCR_NAME as specified by --with-msvcr-dll])
+    fi
+  else
+    TOOLCHAIN_SETUP_MSVC_DLL([MSVCR_DLL], [${MSVCR_NAME}])
   fi
 
-  BASIC_FIXUP_PATH(MSVCR_DLL)
+  AC_ARG_WITH(msvcp-dll, [AS_HELP_STRING([--with-msvcp-dll],
+      [path to microsoft C++ runtime dll (msvcp*.dll) (Windows only) @<:@probed@:>@])])
+
+  if test "x$MSVCP_NAME" != "x"; then
+    if test "x$with_msvcp_dll" != x; then
+      # If given explicitely by user, do not probe. If not present, fail directly.
+      TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL([$DLL_NAME], [$with_msvcp_dll],
+          [--with-msvcp-dll])
+      if test "x$MSVC_DLL" = x; then
+        AC_MSG_ERROR([Could not find a proper $MSVCP_NAME as specified by --with-msvcp-dll])
+      fi
+    else
+      TOOLCHAIN_SETUP_MSVC_DLL([MSVCP_DLL], [${MSVCP_NAME}])
+    fi
+  fi
 ])
--- a/common/bin/unshuffle_list.txt	Wed Feb 18 22:19:47 2015 -0500
+++ b/common/bin/unshuffle_list.txt	Mon Feb 23 05:01:11 2015 -0800
@@ -123,6 +123,7 @@
 jdk/src/java.base/share/classes/java/math : jdk/src/share/classes/java/math
 jdk/src/java.base/share/classes/java/net : jdk/src/share/classes/java/net
 jdk/src/java.base/share/classes/java/nio : jdk/src/share/classes/java/nio
+jdk/src/java.base/share/classes/java/security/acl : jdk/src/share/classes/java/security/acl
 jdk/src/java.base/share/classes/java/security/cert : jdk/src/share/classes/java/security/cert
 jdk/src/java.base/share/classes/java/security/interfaces : jdk/src/share/classes/java/security/interfaces
 jdk/src/java.base/share/classes/java/security : jdk/src/share/classes/java/security
@@ -179,6 +180,7 @@
 jdk/src/java.base/share/classes/sun/nio/cs : jdk/src/share/classes/sun/nio/cs
 jdk/src/java.base/share/classes/sun/nio/fs : jdk/src/share/classes/sun/nio/fs
 jdk/src/java.base/share/classes/sun/reflect : jdk/src/share/classes/sun/reflect
+jdk/src/java.base/share/classes/sun/security/acl : jdk/src/share/classes/sun/security/acl
 jdk/src/java.base/share/classes/sun/security/action : jdk/src/share/classes/sun/security/action
 jdk/src/java.base/share/classes/sun/security/internal : jdk/src/share/classes/sun/security/internal
 jdk/src/java.base/share/classes/sun/security/jca : jdk/src/share/classes/sun/security/jca
@@ -1211,8 +1213,6 @@
 jdk/src/java.rmi/unix/bin/java-rmi.cgi.sh : jdk/src/solaris/bin/java-rmi.cgi.sh
 jdk/src/java.scripting/share/classes/javax/script : jdk/src/share/classes/javax/script
 jdk/src/java.scripting/share/classes/com/sun/tools/script/shell : jdk/src/share/classes/com/sun/tools/script/shell
-jdk/src/java.security.acl/share/classes/java/security/acl : jdk/src/share/classes/java/security/acl
-jdk/src/java.security.acl/share/classes/sun/security/acl : jdk/src/share/classes/sun/security/acl
 jdk/src/java.security.jgss/macosx/native/libosxkrb5/nativeccache.c : jdk/src/share/native/sun/security/krb5/nativeccache.c
 jdk/src/java.security.jgss/macosx/native/libosxkrb5/SCDynamicStoreConfig.m : jdk/src/macosx/native/sun/security/krb5/SCDynamicStoreConfig.m
 jdk/src/java.security.jgss/share/classes/javax/security/auth/kerberos : jdk/src/share/classes/javax/security/auth/kerberos
@@ -1303,6 +1303,7 @@
 jdk/src/jdk.dev/share/classes/com/sun/jarsigner : jdk/src/share/classes/com/sun/jarsigner
 jdk/src/jdk.dev/share/classes/com/sun/tools/hat : jdk/src/share/classes/com/sun/tools/hat
 jdk/src/jdk.dev/share/classes/sun/security/tools/jarsigner : jdk/src/share/classes/sun/security/tools/jarsigner
+jdk/src/jdk.dev/share/classes/sun/security/tools/policytool : jdk/src/share/classes/sun/security/tools/policytool
 jdk/src/jdk.dev/share/classes/sun/tools/jar : jdk/src/share/classes/sun/tools/jar
 jdk/src/jdk.dev/share/classes/sun/tools/native2ascii : jdk/src/share/classes/sun/tools/native2ascii
 jdk/src/jdk.hprof.agent/share/classes/com/sun/demo/jvmti/hprof : jdk/src/share/classes/com/sun/demo/jvmti/hprof
@@ -1443,7 +1444,6 @@
 jdk/src/jdk.rmic/share/classes/sun/tools/tree : jdk/src/share/classes/sun/tools/tree
 jdk/src/jdk.rmic/share/classes/sun/tools/util : jdk/src/share/classes/sun/tools/util
 jdk/src/jdk.runtime/share/classes/com/sun/tracing : jdk/src/share/classes/com/sun/tracing
-jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool : jdk/src/share/classes/sun/security/tools/policytool
 jdk/src/jdk.runtime/share/classes/sun/tracing : jdk/src/share/classes/sun/tracing
 jdk/src/jdk.runtime/share/native/common-unpack/bands.cpp : jdk/src/share/native/com/sun/java/util/jar/pack/bands.cpp
 jdk/src/jdk.runtime/share/native/common-unpack/bands.h : jdk/src/share/native/com/sun/java/util/jar/pack/bands.h
--- a/corba/.hgtags	Wed Feb 18 22:19:47 2015 -0500
+++ b/corba/.hgtags	Mon Feb 23 05:01:11 2015 -0800
@@ -291,3 +291,6 @@
 326f2068b4a4c05e2fa27d6acf93eba7b54b090d jdk9-b46
 ee8447ca632e1d39180b4767c749db101bff7314 jdk9-b47
 a13c49c5f2899b702652a460ed7aa73123e671e6 jdk9-b48
+9285d14eb7b6b0815679bae98dd936dbc136218d jdk9-b49
+224f593393e5b01b3c8f1e591b7f4b1790a3737a jdk9-b50
+2309c02386d1fa4ced5051873ffb9e04874f7a44 jdk9-b51
--- a/corba/src/java.corba/share/classes/com/sun/corba/se/spi/orb/ORB.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/corba/src/java.corba/share/classes/com/sun/corba/se/spi/orb/ORB.java	Mon Feb 23 05:01:11 2015 -0800
@@ -176,42 +176,9 @@
         staticWrapper = ORBUtilSystemException.get(
             CORBALogDomains.RPC_PRESENTATION ) ;
 
-        boolean useDynamicStub =
-            ((Boolean)AccessController.doPrivileged(
-                new PrivilegedAction() {
-                    public java.lang.Object run() {
-                        return Boolean.valueOf( Boolean.getBoolean (
-                            ORBConstants.USE_DYNAMIC_STUB_PROPERTY ) ) ;
-                    }
-                }
-            )).booleanValue() ;
-
-        PresentationManager.StubFactoryFactory dynamicStubFactoryFactory =
-            (PresentationManager.StubFactoryFactory)AccessController.doPrivileged(
-                new PrivilegedAction() {
-                    public java.lang.Object run() {
-                        PresentationManager.StubFactoryFactory sff =
-                            PresentationDefaults.getProxyStubFactoryFactory() ;
+        boolean useDynamicStub = false;
 
-                        String className = System.getProperty(
-                            ORBConstants.DYNAMIC_STUB_FACTORY_FACTORY_CLASS,
-                            "com.sun.corba.se.impl.presentation.rmi.bcel.StubFactoryFactoryBCELImpl" ) ;
-
-                        try {
-                            // First try the configured class name, if any
-                            Class<?> cls =
-                                sun.corba.SharedSecrets.getJavaCorbaAccess().loadClass(className);
-                            sff = (PresentationManager.StubFactoryFactory)cls.newInstance();
-                        } catch (Exception exc) {
-                            // Use the default. Log the error as a warning.
-                            staticWrapper.errorInSettingDynamicStubFactoryFactory(
-                                exc, className ) ;
-                        }
-
-                        return sff ;
-                    }
-                }
-            ) ;
+        PresentationManager.StubFactoryFactory dynamicStubFactoryFactory = null;
 
         PresentationManager pm = new PresentationManagerImpl( useDynamicStub ) ;
         pm.setStubFactoryFactory( false,
--- a/corba/src/java.corba/share/classes/sun/corba/SharedSecrets.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/corba/src/java.corba/share/classes/sun/corba/SharedSecrets.java	Mon Feb 23 05:01:11 2015 -0800
@@ -28,7 +28,9 @@
 import com.sun.corba.se.impl.io.ValueUtility;
 import sun.misc.Unsafe;
 
+import java.lang.reflect.Field;
 import java.security.AccessController;
+import java.security.PrivilegedAction;
 
 /** A repository of "shared secrets", which are a mechanism for
     calling implementation-private methods in another package without
@@ -41,9 +43,23 @@
 
 // SharedSecrets cloned in corba repo to avoid build issues
 public class SharedSecrets {
-    private static final Unsafe unsafe = Unsafe.getUnsafe();
+    private static final Unsafe unsafe = getUnsafe();
     private static JavaCorbaAccess javaCorbaAccess;
 
+     private static Unsafe getUnsafe() {
+          PrivilegedAction<Unsafe> pa = () -> {
+               Class<?> unsafeClass = sun.misc.Unsafe.class ;
+               try {
+                    Field f = unsafeClass.getDeclaredField("theUnsafe");
+                    f.setAccessible(true);
+                    return (Unsafe) f.get(null);
+               } catch (Exception e) {
+                    throw new Error(e);
+               }
+          };
+          return AccessController.doPrivileged(pa);
+     }
+
     public static JavaCorbaAccess getJavaCorbaAccess() {
         if (javaCorbaAccess == null) {
             // Ensure ValueUtility is initialized; we know that that class
--- a/hotspot/.hgtags	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/.hgtags	Mon Feb 23 05:01:11 2015 -0800
@@ -451,3 +451,6 @@
 a184ee1d717297bd35b7c3e35393e137921a3ed2 jdk9-b46
 3b241fb72b8925b75941d612db762a6d5da66d02 jdk9-b47
 cc775a4a24c7f5d9e624b4205e9fbd48a17331f6 jdk9-b48
+360cd1fc42f10941a9fd17cc32d5b85a22d12a0b jdk9-b49
+e0947f58c9c1426aa0d98b98ebb78357b27a7b99 jdk9-b50
+403b9cbadb04d3d1201823591cf931dc93b38e3a jdk9-b51
--- a/hotspot/src/cpu/ppc/vm/icBuffer_ppc.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/cpu/ppc/vm/icBuffer_ppc.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2012, 2013 SAP AG. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -32,7 +32,6 @@
 #include "memory/resourceArea.hpp"
 #include "nativeInst_ppc.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
 
 #define __ masm.
 
--- a/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -29,6 +29,7 @@
 #include "interp_masm_ppc_64.hpp"
 #include "interpreter/interpreterRuntime.hpp"
 #include "prims/jvmtiThreadState.hpp"
+#include "runtime/sharedRuntime.hpp"
 
 #ifdef PRODUCT
 #define BLOCK_COMMENT(str) // nothing
--- a/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp	Mon Feb 23 05:01: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.
  * Copyright 2012, 2014 SAP AG. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -25,6 +25,7 @@
 
 #include "precompiled.hpp"
 #include "asm/macroAssembler.inline.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "interpreter/interpreter.hpp"
 #include "memory/allocation.inline.hpp"
 #include "prims/methodHandles.hpp"
--- a/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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,6 +33,7 @@
 #include "runtime/basicLock.hpp"
 #include "runtime/biasedLocking.hpp"
 #include "runtime/os.hpp"
+#include "runtime/sharedRuntime.hpp"
 #include "runtime/stubRoutines.hpp"
 
 void C1_MacroAssembler::inline_cache_check(Register receiver, Register iCache) {
--- a/hotspot/src/cpu/sparc/vm/icBuffer_sparc.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/cpu/sparc/vm/icBuffer_sparc.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, 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
@@ -30,7 +30,6 @@
 #include "memory/resourceArea.hpp"
 #include "nativeInst_sparc.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
 
 int InlineCacheBuffer::ic_stub_code_size() {
 #ifdef _LP64
--- a/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2014, 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
@@ -24,6 +24,7 @@
 
 #include "precompiled.hpp"
 #include "asm/macroAssembler.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "interpreter/interpreter.hpp"
 #include "interpreter/interp_masm.hpp"
 #include "memory/allocation.inline.hpp"
--- a/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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,6 +33,7 @@
 #include "runtime/basicLock.hpp"
 #include "runtime/biasedLocking.hpp"
 #include "runtime/os.hpp"
+#include "runtime/sharedRuntime.hpp"
 #include "runtime/stubRoutines.hpp"
 
 int C1_MacroAssembler::lock_object(Register hdr, Register obj, Register disp_hdr, Register scratch, Label& slow_case) {
--- a/hotspot/src/cpu/x86/vm/icBuffer_x86.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/cpu/x86/vm/icBuffer_x86.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, 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
@@ -31,7 +31,6 @@
 #include "memory/resourceArea.hpp"
 #include "nativeInst_x86.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
 
 int InlineCacheBuffer::ic_stub_code_size() {
   return NativeMovConstReg::instruction_size +
--- a/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp	Mon Feb 23 05:01: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
@@ -24,6 +24,7 @@
 
 #include "precompiled.hpp"
 #include "asm/macroAssembler.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "interpreter/interpreter.hpp"
 #include "interpreter/interpreterRuntime.hpp"
 #include "memory/allocation.inline.hpp"
--- a/hotspot/src/cpu/zero/vm/icBuffer_zero.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/cpu/zero/vm/icBuffer_zero.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -32,7 +32,6 @@
 #include "memory/resourceArea.hpp"
 #include "nativeInst_zero.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
 
 int InlineCacheBuffer::ic_stub_code_size() {
   // NB set this once the functions below are implemented
--- a/hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/LogParser.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/LogParser.java	Mon Feb 23 05:01: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
@@ -24,12 +24,12 @@
 
 /**
  * A SAX based parser of LogCompilation output from HotSpot.  It takes a complete
- * @author never
  */
 
 package com.sun.hotspot.tools.compiler;
 
 import java.io.FileReader;
+import java.io.PrintStream;
 import java.io.Reader;
 import java.util.ArrayDeque;
 import java.util.ArrayList;
@@ -134,6 +134,44 @@
         }
     };
 
+    class Jvms {
+        Jvms(Method method, int bci) {
+            this.method = method;
+            this.bci = bci;
+        }
+        final public Method method;
+        final public int bci;
+        final public String toString() {
+            return "@" + bci + " " + method;
+        }
+    }
+
+    class LockElimination extends BasicLogEvent {
+
+        ArrayList<Jvms> jvms = new ArrayList<Jvms>(1);
+        final String kind;
+        final String classId;
+        final String tagName;
+        LockElimination(String tagName, double start, String id, String kind, String classId) {
+            super(start, id);
+            this.kind = kind;
+            this.classId = classId;
+            this.tagName = tagName;
+        }
+
+        @Override
+        public void print(PrintStream stream) {
+            stream.printf("%s %s %s %s  %.3f ", getId(), tagName, kind, classId, getStart());
+            stream.print(jvms.toString());
+            stream.print("\n");
+        }
+
+        void addJVMS(Method method, int bci) {
+            jvms.add(new Jvms(method, bci));
+        }
+
+    }
+
     private ArrayList<LogEvent> events = new ArrayList<LogEvent>();
 
     private HashMap<String, String> types = new HashMap<String, String>();
@@ -147,6 +185,7 @@
     private CallSite site;
     private CallSite methodHandleSite;
     private Stack<Phase> phaseStack = new Stack<Phase>();
+    private LockElimination currentLockElimination;
     private UncommonTrapEvent currentTrap;
     private Stack<CallSite> lateInlineScope;
     private boolean lateInlining;
@@ -192,7 +231,12 @@
         }
 
         LogParser log = new LogParser();
-        p.parse(new InputSource(reader), log);
+        try {
+            p.parse(new InputSource(reader), log);
+        } catch (Throwable th) {
+            th.printStackTrace();
+            // Carry on with what we've got...
+        }
 
         // Associate compilations with their NMethods
         for (NMethod nm : log.nmethods.values()) {
@@ -418,8 +462,23 @@
                 // uncommon trap inserted during parsing.
                 // ignore for now
             }
+        } else if (qname.startsWith("eliminate_lock")) {
+            String id = atts.getValue("compile_id");
+            if (id != null) {
+                id = makeId(atts);
+                String kind = atts.getValue("kind");
+                String classId = atts.getValue("class_id");
+                currentLockElimination = new LockElimination(qname, Double.parseDouble(search(atts, "stamp")), id, kind, classId);
+                events.add(currentLockElimination);
+            }
         } else if (qname.equals("late_inline")) {
-            long inlineId = Long.parseLong(search(atts, "inline_id"));
+            long inlineId = 0;
+            try {
+                Long.parseLong(search(atts, "inline_id"));
+            } catch (InternalError ex) {
+                // Log files from older hotspots may lack inline_id,
+                // and zero is an acceptable substitute that allows processing to continue.
+            }
             lateInlineScope = new Stack<CallSite>();
             site = new CallSite(-999, method(search(atts, "method")));
             site.setInlineId(inlineId);
@@ -428,13 +487,14 @@
             // <jvms bci='4' method='java/io/DataInputStream readChar ()C' bytes='40' count='5815' iicount='20815'/>
             if (currentTrap != null) {
                 currentTrap.addJVMS(atts.getValue("method"), Integer.parseInt(atts.getValue("bci")));
+            } else if (currentLockElimination != null) {
+                  currentLockElimination.addJVMS(method(atts.getValue("method")), Integer.parseInt(atts.getValue("bci")));
             } else if (lateInlineScope != null) {
                 bci = Integer.parseInt(search(atts, "bci"));
                 site = new CallSite(bci, method(search(atts, "method")));
                 lateInlineScope.push(site);
             } else {
                 // Ignore <eliminate_allocation type='667'>,
-                //        <eliminate_lock lock='1'>,
                 //        <replace_string_concat arguments='2' string_alloc='0' multiple='0'>
             }
         } else if (qname.equals("inline_id")) {
@@ -512,6 +572,8 @@
             }
         } else if (qname.equals("uncommon_trap")) {
             currentTrap = null;
+        } else if (qname.startsWith("eliminate_lock")) {
+            currentLockElimination = null;
         } else if (qname.equals("late_inline")) {
             // Populate late inlining info.
             if (scopes.size() != 0) {
@@ -522,8 +584,8 @@
             CallSite caller = lateInlineScope.pop();
             Method m = compile.getMethod();
             if (m != caller.getMethod()) {
-                System.out.println(m);
-                System.out.println(caller.getMethod() + " bci: " + bci);
+                System.err.println(m);
+                System.err.println(caller.getMethod() + " bci: " + bci);
                 throw new InternalError("call site and late_inline info don't match");
             }
 
--- a/hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/UncommonTrapEvent.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/UncommonTrapEvent.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 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
@@ -50,7 +50,7 @@
     }
 
     public void print(PrintStream stream) {
-        stream.printf("%s uncommon trap %s %s\n", getId(), getReason(), getAction());
+        stream.printf("%s uncommon trap %.3f %s %s\n", getId(), getStart(), getReason(), getAction());
         stream.print(getJvms());
     }
 
--- a/hotspot/src/share/vm/adlc/main.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/adlc/main.cpp	Mon Feb 23 05:01: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
@@ -220,7 +220,6 @@
   AD.addInclude(AD._CPP_file, "oops/markOop.hpp");
   AD.addInclude(AD._CPP_file, "oops/method.hpp");
   AD.addInclude(AD._CPP_file, "oops/oop.inline.hpp");
-  AD.addInclude(AD._CPP_file, "oops/oop.inline2.hpp");
   AD.addInclude(AD._CPP_file, "opto/cfgnode.hpp");
   AD.addInclude(AD._CPP_file, "opto/locknode.hpp");
   AD.addInclude(AD._CPP_file, "opto/opcodes.hpp");
--- a/hotspot/src/share/vm/c1/c1_Compilation.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/c1/c1_Compilation.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -29,12 +29,12 @@
 #include "c1/c1_LIRAssembler.hpp"
 #include "c1/c1_LinearScan.hpp"
 #include "c1/c1_MacroAssembler.hpp"
+#include "c1/c1_RangeCheckElimination.hpp"
 #include "c1/c1_ValueMap.hpp"
 #include "c1/c1_ValueStack.hpp"
 #include "code/debugInfoRec.hpp"
 #include "compiler/compileLog.hpp"
-#include "c1/c1_RangeCheckElimination.hpp"
-
+#include "runtime/sharedRuntime.hpp"
 
 typedef enum {
   _t_compile,
--- a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -34,6 +34,7 @@
 #include "ci/ciMemberName.hpp"
 #include "compiler/compileBroker.hpp"
 #include "interpreter/bytecode.hpp"
+#include "oops/oop.inline.hpp"
 #include "runtime/sharedRuntime.hpp"
 #include "runtime/compilationPolicy.hpp"
 #include "runtime/vm_version.hpp"
--- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -32,6 +32,7 @@
 #include "ci/ciArrayKlass.hpp"
 #include "ci/ciInstance.hpp"
 #include "ci/ciObjArray.hpp"
+#include "memory/cardTableModRefBS.hpp"
 #include "runtime/arguments.hpp"
 #include "runtime/sharedRuntime.hpp"
 #include "runtime/stubRoutines.hpp"
--- a/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -29,6 +29,7 @@
 #include "ci/ciMethodBlocks.hpp"
 #include "ci/ciStreams.hpp"
 #include "interpreter/bytecode.hpp"
+#include "oops/oop.inline.hpp"
 #include "utilities/bitMap.inline.hpp"
 
 
--- a/hotspot/src/share/vm/ci/ciArray.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/ci/ciArray.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -28,7 +28,8 @@
 #include "ci/ciConstant.hpp"
 #include "ci/ciKlass.hpp"
 #include "ci/ciUtilities.hpp"
-#include "oops/objArrayOop.hpp"
+#include "oops/objArrayOop.inline.hpp"
+#include "oops/oop.inline.hpp"
 #include "oops/typeArrayOop.hpp"
 
 // ciArray
--- a/hotspot/src/share/vm/ci/ciBaseObject.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/ci/ciBaseObject.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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,7 +26,6 @@
 #include "ci/ciBaseObject.hpp"
 #include "ci/ciUtilities.hpp"
 #include "gc_interface/collectedHeap.inline.hpp"
-#include "oops/oop.inline2.hpp"
 
 // ------------------------------------------------------------------
 // ciBaseObject::set_ident
--- a/hotspot/src/share/vm/ci/ciCallSite.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/ci/ciCallSite.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2011, 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
@@ -23,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "ci/ciCallSite.hpp"
 #include "ci/ciUtilities.hpp"
 
--- a/hotspot/src/share/vm/ci/ciEnv.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/ci/ciEnv.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -46,8 +46,8 @@
 #include "memory/universe.inline.hpp"
 #include "oops/methodData.hpp"
 #include "oops/objArrayKlass.hpp"
+#include "oops/objArrayOop.inline.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
 #include "prims/jvmtiExport.hpp"
 #include "runtime/init.hpp"
 #include "runtime/reflection.hpp"
--- a/hotspot/src/share/vm/ci/ciField.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/ci/ciField.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -31,7 +31,6 @@
 #include "interpreter/linkResolver.hpp"
 #include "memory/universe.inline.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
 #include "runtime/fieldDescriptor.hpp"
 
 // ciField
--- a/hotspot/src/share/vm/ci/ciInstance.hpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/ci/ciInstance.hpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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,6 +27,7 @@
 
 #include "ci/ciObject.hpp"
 #include "oops/instanceOop.hpp"
+#include "oops/oop.hpp"
 
 // ciInstance
 //
--- a/hotspot/src/share/vm/ci/ciMetadata.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/ci/ciMetadata.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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,7 +26,6 @@
 #include "ci/ciObject.hpp"
 #include "ci/ciUtilities.hpp"
 #include "gc_interface/collectedHeap.inline.hpp"
-#include "oops/oop.inline2.hpp"
 
 // ------------------------------------------------------------------
 // ciMetadata::print
--- a/hotspot/src/share/vm/ci/ciMethodData.hpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/ci/ciMethodData.hpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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,7 +30,7 @@
 #include "ci/ciObject.hpp"
 #include "ci/ciUtilities.hpp"
 #include "oops/methodData.hpp"
-#include "oops/oop.inline.hpp"
+#include "oops/oop.hpp"
 #include "runtime/deoptimization.hpp"
 
 class ciBitData;
--- a/hotspot/src/share/vm/ci/ciObjArray.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/ci/ciObjArray.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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,7 +26,7 @@
 #include "ci/ciNullObject.hpp"
 #include "ci/ciObjArray.hpp"
 #include "ci/ciUtilities.hpp"
-#include "oops/objArrayOop.hpp"
+#include "oops/objArrayOop.inline.hpp"
 
 // ciObjArray
 //
--- a/hotspot/src/share/vm/ci/ciObject.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/ci/ciObject.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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,7 +26,7 @@
 #include "ci/ciObject.hpp"
 #include "ci/ciUtilities.hpp"
 #include "gc_interface/collectedHeap.inline.hpp"
-#include "oops/oop.inline2.hpp"
+#include "oops/oop.inline.hpp"
 
 // ciObject
 //
--- a/hotspot/src/share/vm/ci/ciObjectFactory.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/ci/ciObjectFactory.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -40,11 +40,11 @@
 #include "ci/ciTypeArray.hpp"
 #include "ci/ciTypeArrayKlass.hpp"
 #include "ci/ciUtilities.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "gc_interface/collectedHeap.inline.hpp"
 #include "memory/allocation.inline.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
 #include "runtime/fieldType.hpp"
 #include "utilities/macros.hpp"
 #if INCLUDE_ALL_GCS
--- a/hotspot/src/share/vm/ci/ciReplay.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/ci/ciReplay.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2013, 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
@@ -31,6 +31,7 @@
 #include "memory/allocation.inline.hpp"
 #include "memory/oopFactory.hpp"
 #include "memory/resourceArea.hpp"
+#include "oops/oop.inline.hpp"
 #include "utilities/copy.hpp"
 #include "utilities/macros.hpp"
 
--- a/hotspot/src/share/vm/ci/ciTypeFlow.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/ci/ciTypeFlow.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, 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.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,6 +35,7 @@
 #include "interpreter/bytecode.hpp"
 #include "interpreter/bytecodes.hpp"
 #include "memory/allocation.inline.hpp"
+#include "oops/oop.inline.hpp"
 #include "opto/compile.hpp"
 #include "opto/node.hpp"
 #include "runtime/deoptimization.hpp"
--- a/hotspot/src/share/vm/classfile/classFileParser.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/classfile/classFileParser.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -25,10 +25,9 @@
 #include "precompiled.hpp"
 #include "classfile/classFileParser.hpp"
 #include "classfile/classLoader.hpp"
-#include "classfile/classLoaderData.hpp"
 #include "classfile/classLoaderData.inline.hpp"
 #include "classfile/defaultMethods.hpp"
-#include "classfile/javaClasses.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "classfile/symbolTable.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "classfile/verificationType.hpp"
--- a/hotspot/src/share/vm/classfile/classFileParser.hpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/classfile/classFileParser.hpp	Mon Feb 23 05:01: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,9 +27,7 @@
 
 #include "classfile/classFileStream.hpp"
 #include "memory/resourceArea.hpp"
-#include "oops/oop.inline.hpp"
 #include "oops/typeArrayOop.hpp"
-#include "runtime/handles.inline.hpp"
 #include "utilities/accessFlags.hpp"
 #include "classfile/symbolTable.hpp"
 
--- a/hotspot/src/share/vm/classfile/classLoaderData.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/classfile/classLoaderData.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -57,6 +57,8 @@
 #include "memory/metadataFactory.hpp"
 #include "memory/metaspaceShared.hpp"
 #include "memory/oopFactory.hpp"
+#include "oops/objArrayOop.inline.hpp"
+#include "oops/oop.inline.hpp"
 #include "runtime/atomic.inline.hpp"
 #include "runtime/jniHandles.hpp"
 #include "runtime/mutex.hpp"
--- a/hotspot/src/share/vm/classfile/classLoaderStats.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/classfile/classLoaderStats.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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,6 +24,7 @@
 
 #include "precompiled.hpp"
 #include "classfile/classLoaderStats.hpp"
+#include "oops/oop.inline.hpp"
 #include "utilities/globalDefinitions.hpp"
 
 
--- a/hotspot/src/share/vm/classfile/dictionary.hpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/classfile/dictionary.hpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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,7 @@
 
 #include "classfile/systemDictionary.hpp"
 #include "oops/instanceKlass.hpp"
-#include "oops/oop.inline.hpp"
+#include "oops/oop.hpp"
 #include "utilities/hashtable.hpp"
 
 class DictionaryEntry;
--- a/hotspot/src/share/vm/classfile/javaClasses.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/classfile/javaClasses.cpp	Mon Feb 23 05:01: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
@@ -24,7 +24,7 @@
 
 #include "precompiled.hpp"
 #include "classfile/altHashing.hpp"
-#include "classfile/javaClasses.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "classfile/stringTable.hpp"
 #include "classfile/vmSymbols.hpp"
 #include "code/debugInfo.hpp"
@@ -39,6 +39,8 @@
 #include "oops/instanceMirrorKlass.hpp"
 #include "oops/klass.hpp"
 #include "oops/method.hpp"
+#include "oops/objArrayOop.inline.hpp"
+#include "oops/oop.inline.hpp"
 #include "oops/symbol.hpp"
 #include "oops/typeArrayOop.hpp"
 #include "prims/jvmtiRedefineClassesTrace.hpp"
@@ -149,6 +151,10 @@
 
 bool java_lang_String::initialized  = false;
 
+bool java_lang_String::is_instance(oop obj) {
+  return is_instance_inlined(obj);
+}
+
 void java_lang_String::compute_offsets() {
   assert(!initialized, "offsets should be initialized only once");
 
@@ -2730,6 +2736,11 @@
   }
 }
 
+bool java_lang_invoke_LambdaForm::is_instance(oop obj) {
+  return obj != NULL && is_subclass(obj->klass());
+}
+
+
 oop java_lang_invoke_MethodHandle::type(oop mh) {
   return mh->obj_field(_type_offset);
 }
@@ -3076,6 +3087,10 @@
   return false;
 }
 
+bool java_lang_ClassLoader::is_instance(oop obj) {
+  return obj != NULL && is_subclass(obj->klass());
+}
+
 
 // For class loader classes, parallelCapable defined
 // based on non-null field
--- a/hotspot/src/share/vm/classfile/javaClasses.hpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/classfile/javaClasses.hpp	Mon Feb 23 05:01: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
@@ -204,9 +204,8 @@
   static Symbol* as_symbol_or_null(oop java_string);
 
   // Testers
-  static bool is_instance(oop obj) {
-    return obj != NULL && obj->klass() == SystemDictionary::String_klass();
-  }
+  static bool is_instance(oop obj);
+  static bool is_instance_inlined(oop obj);
 
   // Debugging
   static void print(oop java_string, outputStream* st);
@@ -273,9 +272,8 @@
   static Symbol* as_signature(oop java_class, bool intern_if_not_found, TRAPS);
   static void print_signature(oop java_class, outputStream *st);
   // Testing
-  static bool is_instance(oop obj) {
-    return obj != NULL && obj->klass() == SystemDictionary::Class_klass();
-  }
+  static bool is_instance(oop obj);
+
   static bool is_primitive(oop java_class);
   static BasicType primitive_type(oop java_class);
   static oop primitive_mirror(BasicType t);
@@ -989,9 +987,7 @@
   static bool is_subclass(Klass* klass) {
     return klass->is_subclass_of(SystemDictionary::MethodHandle_klass());
   }
-  static bool is_instance(oop obj) {
-    return obj != NULL && is_subclass(obj->klass());
-  }
+  static bool is_instance(oop obj);
 
   // Accessors for code generation:
   static int type_offset_in_bytes()             { return _type_offset; }
@@ -1016,9 +1012,7 @@
   static bool is_subclass(Klass* klass) {
     return klass->is_subclass_of(SystemDictionary::DirectMethodHandle_klass());
   }
-  static bool is_instance(oop obj) {
-    return obj != NULL && is_subclass(obj->klass());
-  }
+  static bool is_instance(oop obj);
 
   // Accessors for code generation:
   static int member_offset_in_bytes()           { return _member_offset; }
@@ -1045,9 +1039,7 @@
     return SystemDictionary::LambdaForm_klass() != NULL &&
       klass->is_subclass_of(SystemDictionary::LambdaForm_klass());
   }
-  static bool is_instance(oop obj) {
-    return obj != NULL && is_subclass(obj->klass());
-  }
+  static bool is_instance(oop obj);
 
   // Accessors for code generation:
   static int vmentry_offset_in_bytes()          { return _vmentry_offset; }
@@ -1111,9 +1103,7 @@
   static bool is_subclass(Klass* klass) {
     return klass->is_subclass_of(SystemDictionary::MemberName_klass());
   }
-  static bool is_instance(oop obj) {
-    return obj != NULL && is_subclass(obj->klass());
-  }
+  static bool is_instance(oop obj);
 
   static bool is_method(oop obj);
 
@@ -1166,9 +1156,7 @@
   static Symbol*        as_signature(oop mt, bool intern_if_not_found, TRAPS);
   static void           print_signature(oop mt, outputStream* st);
 
-  static bool is_instance(oop obj) {
-    return obj != NULL && obj->klass() == SystemDictionary::MethodType_klass();
-  }
+  static bool is_instance(oop obj);
 
   static bool equals(oop mt1, oop mt2);
 
@@ -1190,19 +1178,17 @@
 
 public:
   // Accessors
-  static oop              target(         oop site)             { return site->obj_field(             _target_offset);         }
-  static void         set_target(         oop site, oop target) {        site->obj_field_put(         _target_offset, target); }
+  static oop              target(         oop site);
+  static void         set_target(         oop site, oop target);
 
-  static volatile oop     target_volatile(oop site)             { return oop((oopDesc *)(site->obj_field_volatile(_target_offset))); }
-  static void         set_target_volatile(oop site, oop target) {        site->obj_field_put_volatile(_target_offset, target); }
+  static volatile oop     target_volatile(oop site);
+  static void         set_target_volatile(oop site, oop target);
 
   // Testers
   static bool is_subclass(Klass* klass) {
     return klass->is_subclass_of(SystemDictionary::CallSite_klass());
   }
-  static bool is_instance(oop obj) {
-    return obj != NULL && is_subclass(obj->klass());
-  }
+  static bool is_instance(oop obj);
 
   // Accessors for code generation:
   static int target_offset_in_bytes()           { return _target_offset; }
@@ -1268,9 +1254,7 @@
   static bool is_subclass(Klass* klass) {
     return klass->is_subclass_of(SystemDictionary::ClassLoader_klass());
   }
-  static bool is_instance(oop obj) {
-    return obj != NULL && is_subclass(obj->klass());
-  }
+  static bool is_instance(oop obj);
 
   // Debugging
   friend class JavaClasses;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/classfile/javaClasses.inline.hpp	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,76 @@
+/*
+ * 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.
+ *
+ * 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.
+ *
+ */
+
+#ifndef SHARE_VM_CLASSFILE_JAVACLASSES_INLINE_HPP
+#define SHARE_VM_CLASSFILE_JAVACLASSES_INLINE_HPP
+
+#include "classfile/javaClasses.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/oopsHierarchy.hpp"
+
+inline volatile oop java_lang_invoke_CallSite::target_volatile(oop site) {
+  return oop((oopDesc *)(site->obj_field_volatile(_target_offset)));
+}
+
+inline void java_lang_invoke_CallSite::set_target_volatile(oop site, oop target) {
+  site->obj_field_put_volatile(_target_offset, target);
+}
+
+inline oop  java_lang_invoke_CallSite::target(oop site) {
+  return site->obj_field(_target_offset);
+}
+
+inline void java_lang_invoke_CallSite::set_target(oop site, oop target) {
+  site->obj_field_put(_target_offset, target);
+}
+
+inline bool java_lang_String::is_instance_inlined(oop obj) {
+  return obj != NULL && obj->klass() == SystemDictionary::String_klass();
+}
+
+inline bool java_lang_invoke_CallSite::is_instance(oop obj) {
+  return obj != NULL && is_subclass(obj->klass());
+}
+
+inline bool java_lang_invoke_MemberName::is_instance(oop obj) {
+  return obj != NULL && is_subclass(obj->klass());
+}
+
+inline bool java_lang_invoke_MethodType::is_instance(oop obj) {
+  return obj != NULL && obj->klass() == SystemDictionary::MethodType_klass();
+}
+
+inline bool java_lang_invoke_MethodHandle::is_instance(oop obj) {
+  return obj != NULL && is_subclass(obj->klass());
+}
+
+inline bool java_lang_Class::is_instance(oop obj) {
+  return obj != NULL && obj->klass() == SystemDictionary::Class_klass();
+}
+
+inline bool java_lang_invoke_DirectMethodHandle::is_instance(oop obj) {
+  return obj != NULL && is_subclass(obj->klass());
+}
+
+#endif // SHARE_VM_CLASSFILE_JAVACLASSES_INLINE_HPP
--- a/hotspot/src/share/vm/classfile/stringTable.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/classfile/stringTable.cpp	Mon Feb 23 05:01: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
@@ -33,7 +33,6 @@
 #include "memory/filemap.hpp"
 #include "memory/gcLocker.inline.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
 #include "runtime/atomic.inline.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "utilities/hashtable.inline.hpp"
--- a/hotspot/src/share/vm/classfile/symbolTable.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/classfile/symbolTable.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -33,7 +33,6 @@
 #include "memory/filemap.hpp"
 #include "memory/gcLocker.inline.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
 #include "runtime/atomic.inline.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "utilities/hashtable.inline.hpp"
--- a/hotspot/src/share/vm/classfile/systemDictionary.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/classfile/systemDictionary.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -25,7 +25,7 @@
 #include "precompiled.hpp"
 #include "classfile/classLoaderData.inline.hpp"
 #include "classfile/dictionary.hpp"
-#include "classfile/javaClasses.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "classfile/loaderConstraints.hpp"
 #include "classfile/placeholders.hpp"
 #include "classfile/resolutionErrors.hpp"
@@ -44,8 +44,8 @@
 #include "oops/klass.inline.hpp"
 #include "oops/methodData.hpp"
 #include "oops/objArrayKlass.hpp"
+#include "oops/objArrayOop.inline.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
 #include "oops/typeArrayKlass.hpp"
 #include "prims/jvmtiEnvBase.hpp"
 #include "prims/methodHandles.hpp"
--- a/hotspot/src/share/vm/classfile/verificationType.hpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/classfile/verificationType.hpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -28,7 +28,7 @@
 #include "classfile/systemDictionary.hpp"
 #include "memory/allocation.hpp"
 #include "oops/instanceKlass.hpp"
-#include "oops/oop.inline.hpp"
+#include "oops/oop.hpp"
 #include "oops/symbol.hpp"
 #include "runtime/handles.hpp"
 #include "runtime/signature.hpp"
--- a/hotspot/src/share/vm/code/codeCache.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/code/codeCache.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -39,6 +39,7 @@
 #include "oops/method.hpp"
 #include "oops/objArrayOop.hpp"
 #include "oops/oop.inline.hpp"
+#include "oops/verifyOopClosure.hpp"
 #include "runtime/handles.inline.hpp"
 #include "runtime/arguments.hpp"
 #include "runtime/icache.hpp"
--- a/hotspot/src/share/vm/code/dependencies.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/code/dependencies.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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,6 +27,7 @@
 #include "ci/ciEnv.hpp"
 #include "ci/ciKlass.hpp"
 #include "ci/ciMethod.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "code/dependencies.hpp"
 #include "compiler/compileLog.hpp"
 #include "oops/oop.inline.hpp"
--- a/hotspot/src/share/vm/code/icBuffer.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/code/icBuffer.cpp	Mon Feb 23 05:01: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
@@ -35,7 +35,6 @@
 #include "memory/universe.inline.hpp"
 #include "oops/method.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "runtime/stubRoutines.hpp"
 
--- a/hotspot/src/share/vm/code/nmethod.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/code/nmethod.cpp	Mon Feb 23 05:01: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
@@ -35,6 +35,7 @@
 #include "compiler/disassembler.hpp"
 #include "interpreter/bytecode.hpp"
 #include "oops/methodData.hpp"
+#include "oops/oop.inline.hpp"
 #include "prims/jvmtiRedefineClassesTrace.hpp"
 #include "prims/jvmtiImpl.hpp"
 #include "runtime/atomic.inline.hpp"
--- a/hotspot/src/share/vm/compiler/disassembler.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/compiler/disassembler.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2014, 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
@@ -28,6 +28,7 @@
 #include "compiler/disassembler.hpp"
 #include "gc_interface/collectedHeap.hpp"
 #include "memory/cardTableModRefBS.hpp"
+#include "oops/oop.inline.hpp"
 #include "runtime/fprofiler.hpp"
 #include "runtime/handles.inline.hpp"
 #include "runtime/os.hpp"
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.hpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.hpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -129,8 +129,8 @@
 // GenCollectedHeap heap.
 class VM_GenCollectFullConcurrent: public VM_GC_Operation {
  public:
-  VM_GenCollectFullConcurrent(unsigned int gc_count_before,
-                              unsigned int full_gc_count_before,
+  VM_GenCollectFullConcurrent(uint gc_count_before,
+                              uint full_gc_count_before,
                               GCCause::Cause gc_cause)
     : VM_GC_Operation(gc_count_before, gc_cause, full_gc_count_before, true /* full */)
   {
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -333,7 +333,7 @@
   HeapRegion* lists[] = {_head,   _survivor_head};
   const char* names[] = {"YOUNG", "SURVIVOR"};
 
-  for (unsigned int list = 0; list < ARRAY_SIZE(lists); ++list) {
+  for (uint list = 0; list < ARRAY_SIZE(lists); ++list) {
     gclog_or_tty->print_cr("%s LIST CONTENTS", names[list]);
     HeapRegion *curr = lists[list];
     if (curr == NULL)
@@ -765,8 +765,8 @@
   assert_heap_not_locked_and_not_at_safepoint();
   assert(!is_humongous(word_size), "we do not allow humongous TLABs");
 
-  unsigned int dummy_gc_count_before;
-  int dummy_gclocker_retry_count = 0;
+  uint dummy_gc_count_before;
+  uint dummy_gclocker_retry_count = 0;
   return attempt_allocation(word_size, &dummy_gc_count_before, &dummy_gclocker_retry_count);
 }
 
@@ -776,8 +776,8 @@
   assert_heap_not_locked_and_not_at_safepoint();
 
   // Loop until the allocation is satisfied, or unsatisfied after GC.
-  for (int try_count = 1, gclocker_retry_count = 0; /* we'll return */; try_count += 1) {
-    unsigned int gc_count_before;
+  for (uint try_count = 1, gclocker_retry_count = 0; /* we'll return */; try_count += 1) {
+    uint gc_count_before;
 
     HeapWord* result = NULL;
     if (!is_humongous(word_size)) {
@@ -829,8 +829,8 @@
 
 HeapWord* G1CollectedHeap::attempt_allocation_slow(size_t word_size,
                                                    AllocationContext_t context,
-                                                   unsigned int *gc_count_before_ret,
-                                                   int* gclocker_retry_count_ret) {
+                                                   uint* gc_count_before_ret,
+                                                   uint* gclocker_retry_count_ret) {
   // Make sure you read the note in attempt_allocation_humongous().
 
   assert_heap_not_locked_and_not_at_safepoint();
@@ -847,7 +847,7 @@
   HeapWord* result = NULL;
   for (int try_count = 1; /* we'll return */; try_count += 1) {
     bool should_try_gc;
-    unsigned int gc_count_before;
+    uint gc_count_before;
 
     {
       MutexLockerEx x(Heap_lock);
@@ -891,7 +891,7 @@
     if (should_try_gc) {
       bool succeeded;
       result = do_collection_pause(word_size, gc_count_before, &succeeded,
-          GCCause::_g1_inc_collection_pause);
+                                   GCCause::_g1_inc_collection_pause);
       if (result != NULL) {
         assert(succeeded, "only way to get back a non-NULL result");
         return result;
@@ -945,8 +945,8 @@
 }
 
 HeapWord* G1CollectedHeap::attempt_allocation_humongous(size_t word_size,
-                                                        unsigned int * gc_count_before_ret,
-                                                        int* gclocker_retry_count_ret) {
+                                                        uint* gc_count_before_ret,
+                                                        uint* gclocker_retry_count_ret) {
   // The structure of this method has a lot of similarities to
   // attempt_allocation_slow(). The reason these two were not merged
   // into a single one is that such a method would require several "if
@@ -979,7 +979,7 @@
   HeapWord* result = NULL;
   for (int try_count = 1; /* we'll return */; try_count += 1) {
     bool should_try_gc;
-    unsigned int gc_count_before;
+    uint gc_count_before;
 
     {
       MutexLockerEx x(Heap_lock);
@@ -1017,7 +1017,7 @@
 
       bool succeeded;
       result = do_collection_pause(word_size, gc_count_before, &succeeded,
-          GCCause::_g1_humongous_allocation);
+                                   GCCause::_g1_humongous_allocation);
       if (result != NULL) {
         assert(succeeded, "only way to get back a non-NULL result");
         return result;
@@ -1815,7 +1815,7 @@
   assert(n_rem_sets > 0, "Invariant.");
 
   _worker_cset_start_region = NEW_C_HEAP_ARRAY(HeapRegion*, n_queues, mtGC);
-  _worker_cset_start_region_time_stamp = NEW_C_HEAP_ARRAY(unsigned int, n_queues, mtGC);
+  _worker_cset_start_region_time_stamp = NEW_C_HEAP_ARRAY(uint, n_queues, mtGC);
   _evacuation_failed_info_array = NEW_C_HEAP_ARRAY(EvacuationFailedInfo, n_queues, mtGC);
 
   for (int i = 0; i < n_queues; i++) {
@@ -2396,9 +2396,9 @@
 void G1CollectedHeap::collect(GCCause::Cause cause) {
   assert_heap_not_locked();
 
-  unsigned int gc_count_before;
-  unsigned int old_marking_count_before;
-  unsigned int full_gc_count_before;
+  uint gc_count_before;
+  uint old_marking_count_before;
+  uint full_gc_count_before;
   bool retry_gc;
 
   do {
@@ -3418,7 +3418,7 @@
 }
 
 HeapWord* G1CollectedHeap::do_collection_pause(size_t word_size,
-                                               unsigned int gc_count_before,
+                                               uint gc_count_before,
                                                bool* succeeded,
                                                GCCause::Cause gc_cause) {
   assert_heap_not_locked_and_not_at_safepoint();
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -325,11 +325,11 @@
 
   // Keeps track of how many "old marking cycles" (i.e., Full GCs or
   // concurrent cycles) we have started.
-  volatile unsigned int _old_marking_cycles_started;
+  volatile uint _old_marking_cycles_started;
 
   // Keeps track of how many "old marking cycles" (i.e., Full GCs or
   // concurrent cycles) we have completed.
-  volatile unsigned int _old_marking_cycles_completed;
+  volatile uint _old_marking_cycles_completed;
 
   bool _concurrent_cycle_started;
   bool _heap_summary_sent;
@@ -497,22 +497,22 @@
   // the mutator alloc region without taking the Heap_lock. This
   // should only be used for non-humongous allocations.
   inline HeapWord* attempt_allocation(size_t word_size,
-                                      unsigned int* gc_count_before_ret,
-                                      int* gclocker_retry_count_ret);
+                                      uint* gc_count_before_ret,
+                                      uint* gclocker_retry_count_ret);
 
   // Second-level mutator allocation attempt: take the Heap_lock and
   // retry the allocation attempt, potentially scheduling a GC
   // pause. This should only be used for non-humongous allocations.
   HeapWord* attempt_allocation_slow(size_t word_size,
                                     AllocationContext_t context,
-                                    unsigned int* gc_count_before_ret,
-                                    int* gclocker_retry_count_ret);
+                                    uint* gc_count_before_ret,
+                                    uint* gclocker_retry_count_ret);
 
   // Takes the Heap_lock and attempts a humongous allocation. It can
   // potentially schedule a GC pause.
   HeapWord* attempt_allocation_humongous(size_t word_size,
-                                         unsigned int* gc_count_before_ret,
-                                         int* gclocker_retry_count_ret);
+                                         uint* gc_count_before_ret,
+                                         uint* gclocker_retry_count_ret);
 
   // Allocation attempt that should be called during safepoints (e.g.,
   // at the end of a successful GC). expect_null_mutator_alloc_region
@@ -686,7 +686,7 @@
   // +ExplicitGCInvokesConcurrent).
   void increment_old_marking_cycles_completed(bool concurrent);
 
-  unsigned int old_marking_cycles_completed() {
+  uint old_marking_cycles_completed() {
     return _old_marking_cycles_completed;
   }
 
@@ -745,7 +745,7 @@
   // methods that call do_collection_pause() release the Heap_lock
   // before the call, so it's easy to read gc_count_before just before.
   HeapWord* do_collection_pause(size_t         word_size,
-                                unsigned int   gc_count_before,
+                                uint           gc_count_before,
                                 bool*          succeeded,
                                 GCCause::Cause gc_cause);
 
@@ -981,7 +981,7 @@
   // The heap region entry for a given worker is valid iff
   // the associated time stamp value matches the current value
   // of G1CollectedHeap::_gc_time_stamp.
-  unsigned int* _worker_cset_start_region_time_stamp;
+  uint* _worker_cset_start_region_time_stamp;
 
   enum G1H_process_roots_tasks {
     G1H_PS_filter_satb_buffers,
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.inline.hpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.inline.hpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -131,8 +131,8 @@
 }
 
 inline HeapWord* G1CollectedHeap::attempt_allocation(size_t word_size,
-                                                     unsigned int* gc_count_before_ret,
-                                                     int* gclocker_retry_count_ret) {
+                                                     uint* gc_count_before_ret,
+                                                     uint* gclocker_retry_count_ret) {
   assert_heap_not_locked_and_not_at_safepoint();
   assert(!is_humongous(word_size), "attempt_allocation() should not "
          "be called for humongous allocation requests");
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1EvacFailure.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,239 @@
+/*
+ * Copyright (c) 2012, 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.
+ *
+ * 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.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "gc_implementation/g1/concurrentMark.inline.hpp"
+#include "gc_implementation/g1/dirtyCardQueue.hpp"
+#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
+#include "gc_implementation/g1/g1EvacFailure.hpp"
+#include "gc_implementation/g1/g1_globals.hpp"
+#include "gc_implementation/g1/g1OopClosures.inline.hpp"
+#include "gc_implementation/g1/heapRegion.hpp"
+#include "gc_implementation/g1/heapRegionRemSet.hpp"
+
+class UpdateRSetDeferred : public OopsInHeapRegionClosure {
+private:
+  G1CollectedHeap* _g1;
+  DirtyCardQueue *_dcq;
+  G1SATBCardTableModRefBS* _ct_bs;
+
+public:
+  UpdateRSetDeferred(G1CollectedHeap* g1, DirtyCardQueue* dcq) :
+    _g1(g1), _ct_bs(_g1->g1_barrier_set()), _dcq(dcq) {}
+
+  virtual void do_oop(narrowOop* p) { do_oop_work(p); }
+  virtual void do_oop(      oop* p) { do_oop_work(p); }
+  template <class T> void do_oop_work(T* p) {
+    assert(_from->is_in_reserved(p), "paranoia");
+    if (!_from->is_in_reserved(oopDesc::load_decode_heap_oop(p)) &&
+        !_from->is_survivor()) {
+      size_t card_index = _ct_bs->index_for(p);
+      if (_ct_bs->mark_card_deferred(card_index)) {
+        _dcq->enqueue((jbyte*)_ct_bs->byte_for_index(card_index));
+      }
+    }
+  }
+};
+
+class RemoveSelfForwardPtrObjClosure: public ObjectClosure {
+private:
+  G1CollectedHeap* _g1;
+  ConcurrentMark* _cm;
+  HeapRegion* _hr;
+  size_t _marked_bytes;
+  OopsInHeapRegionClosure *_update_rset_cl;
+  bool _during_initial_mark;
+  bool _during_conc_mark;
+  uint _worker_id;
+  HeapWord* _end_of_last_gap;
+  HeapWord* _last_gap_threshold;
+  HeapWord* _last_obj_threshold;
+
+public:
+  RemoveSelfForwardPtrObjClosure(G1CollectedHeap* g1, ConcurrentMark* cm,
+                                 HeapRegion* hr,
+                                 OopsInHeapRegionClosure* update_rset_cl,
+                                 bool during_initial_mark,
+                                 bool during_conc_mark,
+                                 uint worker_id) :
+    _g1(g1), _cm(cm), _hr(hr), _marked_bytes(0),
+    _update_rset_cl(update_rset_cl),
+    _during_initial_mark(during_initial_mark),
+    _during_conc_mark(during_conc_mark),
+    _worker_id(worker_id),
+    _end_of_last_gap(hr->bottom()),
+    _last_gap_threshold(hr->bottom()),
+    _last_obj_threshold(hr->bottom()) { }
+
+  size_t marked_bytes() { return _marked_bytes; }
+
+  // <original comment>
+  // The original idea here was to coalesce evacuated and dead objects.
+  // However that caused complications with the block offset table (BOT).
+  // In particular if there were two TLABs, one of them partially refined.
+  // |----- TLAB_1--------|----TLAB_2-~~~(partially refined part)~~~|
+  // The BOT entries of the unrefined part of TLAB_2 point to the start
+  // of TLAB_2. If the last object of the TLAB_1 and the first object
+  // of TLAB_2 are coalesced, then the cards of the unrefined part
+  // would point into middle of the filler object.
+  // The current approach is to not coalesce and leave the BOT contents intact.
+  // </original comment>
+  //
+  // We now reset the BOT when we start the object iteration over the
+  // region and refine its entries for every object we come across. So
+  // the above comment is not really relevant and we should be able
+  // to coalesce dead objects if we want to.
+  void do_object(oop obj) {
+    HeapWord* obj_addr = (HeapWord*) obj;
+    assert(_hr->is_in(obj_addr), "sanity");
+    size_t obj_size = obj->size();
+    HeapWord* obj_end = obj_addr + obj_size;
+
+    if (_end_of_last_gap != obj_addr) {
+      // there was a gap before obj_addr
+      _last_gap_threshold = _hr->cross_threshold(_end_of_last_gap, obj_addr);
+    }
+
+    if (obj->is_forwarded() && obj->forwardee() == obj) {
+      // The object failed to move.
+
+      // We consider all objects that we find self-forwarded to be
+      // live. What we'll do is that we'll update the prev marking
+      // info so that they are all under PTAMS and explicitly marked.
+      if (!_cm->isPrevMarked(obj)) {
+        _cm->markPrev(obj);
+      }
+      if (_during_initial_mark) {
+        // For the next marking info we'll only mark the
+        // self-forwarded objects explicitly if we are during
+        // initial-mark (since, normally, we only mark objects pointed
+        // to by roots if we succeed in copying them). By marking all
+        // self-forwarded objects we ensure that we mark any that are
+        // still pointed to be roots. During concurrent marking, and
+        // after initial-mark, we don't need to mark any objects
+        // explicitly and all objects in the CSet are considered
+        // (implicitly) live. So, we won't mark them explicitly and
+        // we'll leave them over NTAMS.
+        _cm->grayRoot(obj, obj_size, _worker_id, _hr);
+      }
+      _marked_bytes += (obj_size * HeapWordSize);
+      obj->set_mark(markOopDesc::prototype());
+
+      // While we were processing RSet buffers during the collection,
+      // we actually didn't scan any cards on the collection set,
+      // since we didn't want to update remembered sets with entries
+      // that point into the collection set, given that live objects
+      // from the collection set are about to move and such entries
+      // will be stale very soon.
+      // This change also dealt with a reliability issue which
+      // involved scanning a card in the collection set and coming
+      // across an array that was being chunked and looking malformed.
+      // The problem is that, if evacuation fails, we might have
+      // remembered set entries missing given that we skipped cards on
+      // the collection set. So, we'll recreate such entries now.
+      obj->oop_iterate(_update_rset_cl);
+    } else {
+
+      // The object has been either evacuated or is dead. Fill it with a
+      // dummy object.
+      MemRegion mr(obj_addr, obj_size);
+      CollectedHeap::fill_with_object(mr);
+
+      // must nuke all dead objects which we skipped when iterating over the region
+      _cm->clearRangePrevBitmap(MemRegion(_end_of_last_gap, obj_end));
+    }
+    _end_of_last_gap = obj_end;
+    _last_obj_threshold = _hr->cross_threshold(obj_addr, obj_end);
+  }
+};
+
+class RemoveSelfForwardPtrHRClosure: public HeapRegionClosure {
+  G1CollectedHeap* _g1h;
+  ConcurrentMark* _cm;
+  uint _worker_id;
+  HeapRegionClaimer* _hrclaimer;
+
+  DirtyCardQueue _dcq;
+  UpdateRSetDeferred _update_rset_cl;
+
+public:
+  RemoveSelfForwardPtrHRClosure(G1CollectedHeap* g1h,
+                                uint worker_id,
+                                HeapRegionClaimer* hrclaimer) :
+      _g1h(g1h), _dcq(&g1h->dirty_card_queue_set()), _update_rset_cl(g1h, &_dcq),
+      _worker_id(worker_id), _cm(_g1h->concurrent_mark()), _hrclaimer(hrclaimer) {
+  }
+
+  bool doHeapRegion(HeapRegion *hr) {
+    bool during_initial_mark = _g1h->g1_policy()->during_initial_mark_pause();
+    bool during_conc_mark = _g1h->mark_in_progress();
+
+    assert(!hr->is_humongous(), "sanity");
+    assert(hr->in_collection_set(), "bad CS");
+
+    if (_hrclaimer->claim_region(hr->hrm_index())) {
+      if (hr->evacuation_failed()) {
+        RemoveSelfForwardPtrObjClosure rspc(_g1h, _cm, hr, &_update_rset_cl,
+                                            during_initial_mark,
+                                            during_conc_mark,
+                                            _worker_id);
+
+        hr->note_self_forwarding_removal_start(during_initial_mark,
+                                               during_conc_mark);
+        _g1h->check_bitmaps("Self-Forwarding Ptr Removal", hr);
+
+        // In the common case (i.e. when there is no evacuation
+        // failure) we make sure that the following is done when
+        // the region is freed so that it is "ready-to-go" when it's
+        // re-allocated. However, when evacuation failure happens, a
+        // region will remain in the heap and might ultimately be added
+        // to a CSet in the future. So we have to be careful here and
+        // make sure the region's RSet is ready for parallel iteration
+        // whenever this might be required in the future.
+        hr->rem_set()->reset_for_par_iteration();
+        hr->reset_bot();
+        _update_rset_cl.set_region(hr);
+        hr->object_iterate(&rspc);
+
+        hr->rem_set()->clean_strong_code_roots(hr);
+
+        hr->note_self_forwarding_removal_end(during_initial_mark,
+                                             during_conc_mark,
+                                             rspc.marked_bytes());
+      }
+    }
+    return false;
+  }
+};
+
+G1ParRemoveSelfForwardPtrsTask::G1ParRemoveSelfForwardPtrsTask(G1CollectedHeap* g1h) :
+    AbstractGangTask("G1 Remove Self-forwarding Pointers"), _g1h(g1h),
+    _hrclaimer(g1h->workers()->active_workers()) {}
+
+void G1ParRemoveSelfForwardPtrsTask::work(uint worker_id) {
+  RemoveSelfForwardPtrHRClosure rsfp_cl(_g1h, worker_id, &_hrclaimer);
+
+  HeapRegion* hr = _g1h->start_cset_region_for_worker(worker_id);
+  _g1h->collection_set_iterate_from(hr, &rsfp_cl);
+}
--- a/hotspot/src/share/vm/gc_implementation/g1/g1EvacFailure.hpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1EvacFailure.hpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -25,229 +25,24 @@
 #ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1EVACFAILURE_HPP
 #define SHARE_VM_GC_IMPLEMENTATION_G1_G1EVACFAILURE_HPP
 
-#include "gc_implementation/g1/concurrentMark.inline.hpp"
-#include "gc_implementation/g1/dirtyCardQueue.hpp"
-#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
-#include "gc_implementation/g1/g1_globals.hpp"
-#include "gc_implementation/g1/g1OopClosures.inline.hpp"
-#include "gc_implementation/g1/heapRegion.hpp"
-#include "gc_implementation/g1/heapRegionRemSet.hpp"
+#include "gc_implementation/g1/g1OopClosures.hpp"
+#include "gc_implementation/g1/heapRegionManager.hpp"
+#include "utilities/globalDefinitions.hpp"
 #include "utilities/workgroup.hpp"
 
-// Closures and tasks associated with any self-forwarding pointers
-// installed as a result of an evacuation failure.
-
-class UpdateRSetDeferred : public OopsInHeapRegionClosure {
-private:
-  G1CollectedHeap* _g1;
-  DirtyCardQueue *_dcq;
-  G1SATBCardTableModRefBS* _ct_bs;
-
-public:
-  UpdateRSetDeferred(G1CollectedHeap* g1, DirtyCardQueue* dcq) :
-    _g1(g1), _ct_bs(_g1->g1_barrier_set()), _dcq(dcq) {}
-
-  virtual void do_oop(narrowOop* p) { do_oop_work(p); }
-  virtual void do_oop(      oop* p) { do_oop_work(p); }
-  template <class T> void do_oop_work(T* p) {
-    assert(_from->is_in_reserved(p), "paranoia");
-    if (!_from->is_in_reserved(oopDesc::load_decode_heap_oop(p)) &&
-        !_from->is_survivor()) {
-      size_t card_index = _ct_bs->index_for(p);
-      if (_ct_bs->mark_card_deferred(card_index)) {
-        _dcq->enqueue((jbyte*)_ct_bs->byte_for_index(card_index));
-      }
-    }
-  }
-};
-
-class RemoveSelfForwardPtrObjClosure: public ObjectClosure {
-private:
-  G1CollectedHeap* _g1;
-  ConcurrentMark* _cm;
-  HeapRegion* _hr;
-  size_t _marked_bytes;
-  OopsInHeapRegionClosure *_update_rset_cl;
-  bool _during_initial_mark;
-  bool _during_conc_mark;
-  uint _worker_id;
-  HeapWord* _end_of_last_gap;
-  HeapWord* _last_gap_threshold;
-  HeapWord* _last_obj_threshold;
-
-public:
-  RemoveSelfForwardPtrObjClosure(G1CollectedHeap* g1, ConcurrentMark* cm,
-                                 HeapRegion* hr,
-                                 OopsInHeapRegionClosure* update_rset_cl,
-                                 bool during_initial_mark,
-                                 bool during_conc_mark,
-                                 uint worker_id) :
-    _g1(g1), _cm(cm), _hr(hr), _marked_bytes(0),
-    _update_rset_cl(update_rset_cl),
-    _during_initial_mark(during_initial_mark),
-    _during_conc_mark(during_conc_mark),
-    _worker_id(worker_id),
-    _end_of_last_gap(hr->bottom()),
-    _last_gap_threshold(hr->bottom()),
-    _last_obj_threshold(hr->bottom()) { }
-
-  size_t marked_bytes() { return _marked_bytes; }
-
-  // <original comment>
-  // The original idea here was to coalesce evacuated and dead objects.
-  // However that caused complications with the block offset table (BOT).
-  // In particular if there were two TLABs, one of them partially refined.
-  // |----- TLAB_1--------|----TLAB_2-~~~(partially refined part)~~~|
-  // The BOT entries of the unrefined part of TLAB_2 point to the start
-  // of TLAB_2. If the last object of the TLAB_1 and the first object
-  // of TLAB_2 are coalesced, then the cards of the unrefined part
-  // would point into middle of the filler object.
-  // The current approach is to not coalesce and leave the BOT contents intact.
-  // </original comment>
-  //
-  // We now reset the BOT when we start the object iteration over the
-  // region and refine its entries for every object we come across. So
-  // the above comment is not really relevant and we should be able
-  // to coalesce dead objects if we want to.
-  void do_object(oop obj) {
-    HeapWord* obj_addr = (HeapWord*) obj;
-    assert(_hr->is_in(obj_addr), "sanity");
-    size_t obj_size = obj->size();
-    HeapWord* obj_end = obj_addr + obj_size;
-
-    if (_end_of_last_gap != obj_addr) {
-      // there was a gap before obj_addr
-      _last_gap_threshold = _hr->cross_threshold(_end_of_last_gap, obj_addr);
-    }
-
-    if (obj->is_forwarded() && obj->forwardee() == obj) {
-      // The object failed to move.
+class G1CollectedHeap;
 
-      // We consider all objects that we find self-forwarded to be
-      // live. What we'll do is that we'll update the prev marking
-      // info so that they are all under PTAMS and explicitly marked.
-      if (!_cm->isPrevMarked(obj)) {
-        _cm->markPrev(obj);
-      }
-      if (_during_initial_mark) {
-        // For the next marking info we'll only mark the
-        // self-forwarded objects explicitly if we are during
-        // initial-mark (since, normally, we only mark objects pointed
-        // to by roots if we succeed in copying them). By marking all
-        // self-forwarded objects we ensure that we mark any that are
-        // still pointed to be roots. During concurrent marking, and
-        // after initial-mark, we don't need to mark any objects
-        // explicitly and all objects in the CSet are considered
-        // (implicitly) live. So, we won't mark them explicitly and
-        // we'll leave them over NTAMS.
-        _cm->grayRoot(obj, obj_size, _worker_id, _hr);
-      }
-      _marked_bytes += (obj_size * HeapWordSize);
-      obj->set_mark(markOopDesc::prototype());
-
-      // While we were processing RSet buffers during the collection,
-      // we actually didn't scan any cards on the collection set,
-      // since we didn't want to update remembered sets with entries
-      // that point into the collection set, given that live objects
-      // from the collection set are about to move and such entries
-      // will be stale very soon.
-      // This change also dealt with a reliability issue which
-      // involved scanning a card in the collection set and coming
-      // across an array that was being chunked and looking malformed.
-      // The problem is that, if evacuation fails, we might have
-      // remembered set entries missing given that we skipped cards on
-      // the collection set. So, we'll recreate such entries now.
-      obj->oop_iterate(_update_rset_cl);
-    } else {
-
-      // The object has been either evacuated or is dead. Fill it with a
-      // dummy object.
-      MemRegion mr(obj_addr, obj_size);
-      CollectedHeap::fill_with_object(mr);
-
-      // must nuke all dead objects which we skipped when iterating over the region
-      _cm->clearRangePrevBitmap(MemRegion(_end_of_last_gap, obj_end));
-    }
-    _end_of_last_gap = obj_end;
-    _last_obj_threshold = _hr->cross_threshold(obj_addr, obj_end);
-  }
-};
-
-class RemoveSelfForwardPtrHRClosure: public HeapRegionClosure {
-  G1CollectedHeap* _g1h;
-  ConcurrentMark* _cm;
-  uint _worker_id;
-  HeapRegionClaimer* _hrclaimer;
-
-  DirtyCardQueue _dcq;
-  UpdateRSetDeferred _update_rset_cl;
-
-public:
-  RemoveSelfForwardPtrHRClosure(G1CollectedHeap* g1h,
-                                uint worker_id,
-                                HeapRegionClaimer* hrclaimer) :
-      _g1h(g1h), _dcq(&g1h->dirty_card_queue_set()), _update_rset_cl(g1h, &_dcq),
-      _worker_id(worker_id), _cm(_g1h->concurrent_mark()), _hrclaimer(hrclaimer) {
-  }
-
-  bool doHeapRegion(HeapRegion *hr) {
-    bool during_initial_mark = _g1h->g1_policy()->during_initial_mark_pause();
-    bool during_conc_mark = _g1h->mark_in_progress();
-
-    assert(!hr->is_humongous(), "sanity");
-    assert(hr->in_collection_set(), "bad CS");
-
-    if (_hrclaimer->claim_region(hr->hrm_index())) {
-      if (hr->evacuation_failed()) {
-        RemoveSelfForwardPtrObjClosure rspc(_g1h, _cm, hr, &_update_rset_cl,
-                                            during_initial_mark,
-                                            during_conc_mark,
-                                            _worker_id);
-
-        hr->note_self_forwarding_removal_start(during_initial_mark,
-                                               during_conc_mark);
-        _g1h->check_bitmaps("Self-Forwarding Ptr Removal", hr);
-
-        // In the common case (i.e. when there is no evacuation
-        // failure) we make sure that the following is done when
-        // the region is freed so that it is "ready-to-go" when it's
-        // re-allocated. However, when evacuation failure happens, a
-        // region will remain in the heap and might ultimately be added
-        // to a CSet in the future. So we have to be careful here and
-        // make sure the region's RSet is ready for parallel iteration
-        // whenever this might be required in the future.
-        hr->rem_set()->reset_for_par_iteration();
-        hr->reset_bot();
-        _update_rset_cl.set_region(hr);
-        hr->object_iterate(&rspc);
-
-        hr->rem_set()->clean_strong_code_roots(hr);
-
-        hr->note_self_forwarding_removal_end(during_initial_mark,
-                                             during_conc_mark,
-                                             rspc.marked_bytes());
-      }
-    }
-    return false;
-  }
-};
-
+// Task to fixup self-forwarding pointers
+// installed as a result of an evacuation failure.
 class G1ParRemoveSelfForwardPtrsTask: public AbstractGangTask {
 protected:
   G1CollectedHeap* _g1h;
   HeapRegionClaimer _hrclaimer;
 
 public:
-  G1ParRemoveSelfForwardPtrsTask(G1CollectedHeap* g1h) :
-      AbstractGangTask("G1 Remove Self-forwarding Pointers"), _g1h(g1h),
-      _hrclaimer(g1h->workers()->active_workers()) {}
+  G1ParRemoveSelfForwardPtrsTask(G1CollectedHeap* g1h);
 
-  void work(uint worker_id) {
-    RemoveSelfForwardPtrHRClosure rsfp_cl(_g1h, worker_id, &_hrclaimer);
-
-    HeapRegion* hr = _g1h->start_cset_region_for_worker(worker_id);
-    _g1h->collection_set_iterate_from(hr, &rsfp_cl);
-  }
+  void work(uint worker_id);
 };
 
 #endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1EVACFAILURE_HPP
--- a/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -27,6 +27,7 @@
 #include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
 #include "gc_implementation/g1/heapRegion.hpp"
 #include "gc_implementation/g1/satbQueue.hpp"
+#include "oops/oop.inline.hpp"
 #include "runtime/atomic.inline.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "runtime/orderAccess.inline.hpp"
--- a/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp	Mon Feb 23 05:01:11 2015 -0800
@@ -28,7 +28,7 @@
 #include "gc_implementation/g1/g1RegionToSpaceMapper.hpp"
 #include "memory/cardTableModRefBS.hpp"
 #include "memory/memRegion.hpp"
-#include "oops/oop.inline.hpp"
+#include "oops/oop.hpp"
 #include "utilities/macros.hpp"
 
 class DirtyCardQueueSet;
--- a/hotspot/src/share/vm/gc_implementation/g1/g1StringDedup.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1StringDedup.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -23,7 +23,7 @@
  */
 
 #include "precompiled.hpp"
-#include "classfile/javaClasses.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
 #include "gc_implementation/g1/g1GCPhaseTimes.hpp"
 #include "gc_implementation/g1/g1StringDedup.hpp"
@@ -51,7 +51,7 @@
 }
 
 bool G1StringDedup::is_candidate_from_mark(oop obj) {
-  if (java_lang_String::is_instance(obj)) {
+  if (java_lang_String::is_instance_inlined(obj)) {
     bool from_young = G1CollectedHeap::heap()->heap_region_containing_raw(obj)->is_young();
     if (from_young && obj->age() < StringDeduplicationAgeThreshold) {
       // Candidate found. String is being evacuated from young to old but has not
@@ -73,7 +73,7 @@
 }
 
 bool G1StringDedup::is_candidate_from_evacuation(bool from_young, bool to_young, oop obj) {
-  if (from_young && java_lang_String::is_instance(obj)) {
+  if (from_young && java_lang_String::is_instance_inlined(obj)) {
     if (to_young && obj->age() == StringDeduplicationAgeThreshold) {
       // Candidate found. String is being evacuated from young to young and just
       // reached the deduplication age threshold.
--- a/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupQueue.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupQueue.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -23,9 +23,11 @@
  */
 
 #include "precompiled.hpp"
-#include "classfile/javaClasses.hpp"
+#include "classfile/javaClasses.inline.hpp"
+#include "gc_implementation/g1/g1StringDedup.hpp"
 #include "gc_implementation/g1/g1StringDedupQueue.hpp"
 #include "memory/gcLocker.hpp"
+#include "oops/oop.inline.hpp"
 #include "runtime/atomic.inline.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "utilities/stack.inline.hpp"
--- a/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupTable.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupTable.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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,13 +24,14 @@
 
 #include "precompiled.hpp"
 #include "classfile/altHashing.hpp"
-#include "classfile/javaClasses.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
 #include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
 #include "gc_implementation/g1/g1StringDedupTable.hpp"
 #include "memory/gcLocker.hpp"
 #include "memory/padded.inline.hpp"
 #include "oops/typeArrayOop.hpp"
+#include "oops/oop.inline.hpp"
 #include "runtime/mutexLocker.hpp"
 
 //
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.inline.hpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.inline.hpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -29,6 +29,7 @@
 #include "gc_implementation/g1/g1CollectedHeap.hpp"
 #include "gc_implementation/g1/heapRegion.hpp"
 #include "memory/space.hpp"
+#include "oops/oop.inline.hpp"
 #include "runtime/atomic.inline.hpp"
 
 // This version requires locking.
--- a/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -34,12 +34,11 @@
 #include "gc_implementation/g1/vm_operations_g1.hpp"
 #include "runtime/interfaceSupport.hpp"
 
-VM_G1CollectForAllocation::VM_G1CollectForAllocation(
-                                                  unsigned int gc_count_before,
-                                                  size_t word_size)
+VM_G1CollectForAllocation::VM_G1CollectForAllocation(uint gc_count_before,
+                                                     size_t word_size)
   : VM_G1OperationWithAllocRequest(gc_count_before, word_size,
                                    GCCause::_allocation_failure) {
-  guarantee(word_size > 0, "an allocation should always be requested");
+  guarantee(word_size != 0, "An allocation should always be requested with this operation.");
 }
 
 void VM_G1CollectForAllocation::doit() {
@@ -57,12 +56,11 @@
   g1h->do_full_collection(false /* clear_all_soft_refs */);
 }
 
-VM_G1IncCollectionPause::VM_G1IncCollectionPause(
-                                      unsigned int   gc_count_before,
-                                      size_t         word_size,
-                                      bool           should_initiate_conc_mark,
-                                      double         target_pause_time_ms,
-                                      GCCause::Cause gc_cause)
+VM_G1IncCollectionPause::VM_G1IncCollectionPause(uint           gc_count_before,
+                                                 size_t         word_size,
+                                                 bool           should_initiate_conc_mark,
+                                                 double         target_pause_time_ms,
+                                                 GCCause::Cause gc_cause)
   : VM_G1OperationWithAllocRequest(gc_count_before, word_size, gc_cause),
     _should_initiate_conc_mark(should_initiate_conc_mark),
     _target_pause_time_ms(target_pause_time_ms),
@@ -75,7 +73,7 @@
 }
 
 bool VM_G1IncCollectionPause::doit_prologue() {
-  bool res = VM_GC_Operation::doit_prologue();
+  bool res = VM_G1OperationWithAllocRequest::doit_prologue();
   if (!res) {
     if (_should_initiate_conc_mark) {
       // The prologue can fail for a couple of reasons. The first is that another GC
@@ -165,7 +163,7 @@
 }
 
 void VM_G1IncCollectionPause::doit_epilogue() {
-  VM_GC_Operation::doit_epilogue();
+  VM_G1OperationWithAllocRequest::doit_epilogue();
 
   // If the pause was initiated by a System.gc() and
   // +ExplicitGCInvokesConcurrent, we have to wait here for the cycle
--- a/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.hpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.hpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -36,20 +36,17 @@
 //     - VM_G1CollectForAllocation
 //     - VM_G1IncCollectionPause
 
-class VM_G1OperationWithAllocRequest: public VM_GC_Operation {
+class VM_G1OperationWithAllocRequest : public VM_CollectForAllocation {
 protected:
-  size_t    _word_size;
-  HeapWord* _result;
   bool      _pause_succeeded;
   AllocationContext_t _allocation_context;
 
 public:
-  VM_G1OperationWithAllocRequest(unsigned int gc_count_before,
-                                 size_t       word_size,
+  VM_G1OperationWithAllocRequest(uint           gc_count_before,
+                                 size_t         word_size,
                                  GCCause::Cause gc_cause)
-    : VM_GC_Operation(gc_count_before, gc_cause),
-      _word_size(word_size), _result(NULL), _pause_succeeded(false) { }
-  HeapWord* result() { return _result; }
+    : VM_CollectForAllocation(word_size, gc_count_before, gc_cause),
+      _pause_succeeded(false) {}
   bool pause_succeeded() { return _pause_succeeded; }
   void set_allocation_context(AllocationContext_t context) { _allocation_context = context; }
   AllocationContext_t  allocation_context() { return _allocation_context; }
@@ -57,8 +54,8 @@
 
 class VM_G1CollectFull: public VM_GC_Operation {
 public:
-  VM_G1CollectFull(unsigned int gc_count_before,
-                   unsigned int full_gc_count_before,
+  VM_G1CollectFull(uint gc_count_before,
+                   uint full_gc_count_before,
                    GCCause::Cause cause)
     : VM_GC_Operation(gc_count_before, cause, full_gc_count_before, true) { }
   virtual VMOp_Type type() const { return VMOp_G1CollectFull; }
@@ -70,7 +67,7 @@
 
 class VM_G1CollectForAllocation: public VM_G1OperationWithAllocRequest {
 public:
-  VM_G1CollectForAllocation(unsigned int gc_count_before,
+  VM_G1CollectForAllocation(uint         gc_count_before,
                             size_t       word_size);
   virtual VMOp_Type type() const { return VMOp_G1CollectForAllocation; }
   virtual void doit();
@@ -84,9 +81,9 @@
   bool         _should_initiate_conc_mark;
   bool         _should_retry_gc;
   double       _target_pause_time_ms;
-  unsigned int _old_marking_cycles_completed_before;
+  uint         _old_marking_cycles_completed_before;
 public:
-  VM_G1IncCollectionPause(unsigned int   gc_count_before,
+  VM_G1IncCollectionPause(uint           gc_count_before,
                           size_t         word_size,
                           bool           should_initiate_conc_mark,
                           double         target_pause_time_ms,
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/objectStartArray.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/objectStartArray.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -126,7 +126,9 @@
 
 bool ObjectStartArray::object_starts_in_range(HeapWord* start_addr,
                                               HeapWord* end_addr) const {
-  assert(start_addr <= end_addr, "range is wrong");
+  assert(start_addr <= end_addr,
+         err_msg("Range is wrong. start_addr (" PTR_FORMAT ") is after end_addr (" PTR_FORMAT ")",
+                 p2i(start_addr), p2i(end_addr)));
   if (start_addr > end_addr) {
     return false;
   }
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/objectStartArray.hpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/objectStartArray.hpp	Mon Feb 23 05:01:11 2015 -0800
@@ -119,8 +119,13 @@
 
   MemRegion covered_region() { return _covered_region; }
 
+#define assert_covered_region_contains(addr)                                                                 \
+        assert(_covered_region.contains(addr),                                                               \
+               err_msg(#addr " (" PTR_FORMAT ") is not in covered region [" PTR_FORMAT ", " PTR_FORMAT "]",  \
+                       p2i(addr), p2i(_covered_region.start()), p2i(_covered_region.end())))
+
   void allocate_block(HeapWord* p) {
-    assert(_covered_region.contains(p), "Must be in covered region");
+    assert_covered_region_contains(p);
     jbyte* block = block_for_addr(p);
     HeapWord* block_base = addr_for_block(block);
     size_t offset = pointer_delta(p, block_base, sizeof(HeapWord*));
@@ -135,7 +140,7 @@
   // object in that block. Scroll backwards by one, and the first
   // object hit should be at the beginning of the block
   HeapWord* object_start(HeapWord* addr) const {
-    assert(_covered_region.contains(addr), "Must be in covered region");
+    assert_covered_region_contains(addr);
     jbyte* block = block_for_addr(addr);
     HeapWord* scroll_forward = offset_addr_for_block(block--);
     while (scroll_forward > addr) {
@@ -153,13 +158,14 @@
   }
 
   bool is_block_allocated(HeapWord* addr) {
-    assert(_covered_region.contains(addr), "Must be in covered region");
+    assert_covered_region_contains(addr);
     jbyte* block = block_for_addr(addr);
     if (*block == clean_block)
       return false;
 
     return true;
   }
+#undef assert_covered_region_contains
 
   // Return true if an object starts in the range of heap addresses.
   // If an object starts at an address corresponding to
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -260,7 +260,7 @@
 
   uint loop_count = 0;
   uint gc_count = 0;
-  int gclocker_stalled_count = 0;
+  uint gclocker_stalled_count = 0;
 
   while (result == NULL) {
     // We don't want to have multiple collections for a single filled generation.
@@ -520,8 +520,8 @@
   assert(!Heap_lock->owned_by_self(),
     "this thread should not own the Heap_lock");
 
-  unsigned int gc_count      = 0;
-  unsigned int full_gc_count = 0;
+  uint gc_count      = 0;
+  uint full_gc_count = 0;
   {
     MutexLocker ml(Heap_lock);
     // This value is guarded by the Heap_lock
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -32,12 +32,10 @@
 #include "utilities/dtrace.hpp"
 
 // The following methods are used by the parallel scavenge collector
-VM_ParallelGCFailedAllocation::VM_ParallelGCFailedAllocation(size_t size,
-                                                      unsigned int gc_count) :
-  VM_GC_Operation(gc_count, GCCause::_allocation_failure),
-  _size(size),
-  _result(NULL)
-{
+VM_ParallelGCFailedAllocation::VM_ParallelGCFailedAllocation(size_t word_size,
+                                                             uint gc_count) :
+    VM_CollectForAllocation(word_size, gc_count, GCCause::_allocation_failure) {
+  assert(word_size != 0, "An allocation should always be requested with this operation.");
 }
 
 void VM_ParallelGCFailedAllocation::doit() {
@@ -47,7 +45,7 @@
   assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "must be a ParallelScavengeHeap");
 
   GCCauseSetter gccs(heap, _gc_cause);
-  _result = heap->failed_mem_allocate(_size);
+  _result = heap->failed_mem_allocate(_word_size);
 
   if (_result == NULL && GC_locker::is_active_and_needs_gc()) {
     set_gc_locked();
@@ -55,8 +53,8 @@
 }
 
 // Only used for System.gc() calls
-VM_ParallelGCSystemGC::VM_ParallelGCSystemGC(unsigned int gc_count,
-                                             unsigned int full_gc_count,
+VM_ParallelGCSystemGC::VM_ParallelGCSystemGC(uint gc_count,
+                                             uint full_gc_count,
                                              GCCause::Cause gc_cause) :
   VM_GC_Operation(gc_count, gc_cause, full_gc_count, true /* full */)
 {
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.hpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.hpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -29,26 +29,19 @@
 #include "gc_implementation/shared/vmGCOperations.hpp"
 #include "gc_interface/gcCause.hpp"
 
-class VM_ParallelGCFailedAllocation: public VM_GC_Operation {
- private:
-  size_t    _size;
-  HeapWord* _result;
-
+class VM_ParallelGCFailedAllocation : public VM_CollectForAllocation {
  public:
-  VM_ParallelGCFailedAllocation(size_t size, unsigned int gc_count);
+  VM_ParallelGCFailedAllocation(size_t word_size, uint gc_count);
 
   virtual VMOp_Type type() const {
     return VMOp_ParallelGCFailedAllocation;
   }
   virtual void doit();
-
-  HeapWord* result() const       { return _result; }
 };
 
 class VM_ParallelGCSystemGC: public VM_GC_Operation {
  public:
-  VM_ParallelGCSystemGC(unsigned int gc_count, unsigned int full_gc_count,
-                        GCCause::Cause gc_cause);
+  VM_ParallelGCSystemGC(uint gc_count, uint full_gc_count, GCCause::Cause gc_cause);
   virtual VMOp_Type type() const { return VMOp_ParallelGCSystemGC; }
   virtual void doit();
 };
--- a/hotspot/src/share/vm/gc_implementation/shared/gcTrace.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/gc_implementation/shared/gcTrace.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -31,6 +31,7 @@
 #include "gc_implementation/shared/objectCountEventSender.hpp"
 #include "memory/heapInspection.hpp"
 #include "memory/referenceProcessorStats.hpp"
+#include "memory/resourceArea.hpp"
 #include "runtime/os.hpp"
 #include "utilities/globalDefinitions.hpp"
 #include "utilities/macros.hpp"
--- a/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -41,6 +41,11 @@
 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
 #endif // INCLUDE_ALL_GCS
 
+VM_GC_Operation::~VM_GC_Operation() {
+  CollectedHeap* ch = Universe::heap();
+  ch->collector_policy()->set_all_soft_refs_clear(false);
+}
+
 // The same dtrace probe can't be inserted in two different files, so we
 // have to call it here, so it's only in one file.  Can't create new probes
 // for the other file anymore.   The dtrace probes have to remain stable.
@@ -179,10 +184,10 @@
 
   GenCollectedHeap* gch = GenCollectedHeap::heap();
   GCCauseSetter gccs(gch, _gc_cause);
-  _res = gch->satisfy_failed_allocation(_size, _tlab);
-  assert(gch->is_in_reserved_or_null(_res), "result not in heap");
+  _result = gch->satisfy_failed_allocation(_word_size, _tlab);
+  assert(gch->is_in_reserved_or_null(_result), "result not in heap");
 
-  if (_res == NULL && GC_locker::is_active_and_needs_gc()) {
+  if (_result == NULL && GC_locker::is_active_and_needs_gc()) {
     set_gc_locked();
   }
 }
--- a/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.hpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.hpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -25,6 +25,7 @@
 #ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_VMGCOPERATIONS_HPP
 #define SHARE_VM_GC_IMPLEMENTATION_SHARED_VMGCOPERATIONS_HPP
 
+#include "gc_interface/collectedHeap.hpp"
 #include "memory/heapInspection.hpp"
 #include "runtime/handles.hpp"
 #include "runtime/jniHandles.hpp"
@@ -38,11 +39,12 @@
 //  VM_Operation
 //      VM_GC_Operation
 //          VM_GC_HeapInspection
-//          VM_GenCollectForAllocation
 //          VM_GenCollectFull
 //          VM_GenCollectFullConcurrent
-//          VM_ParallelGCFailedAllocation
 //          VM_ParallelGCSystemGC
+//          VM_CollectForAllocation
+//              VM_GenCollectForAllocation
+//              VM_ParallelGCFailedAllocation
 //  VM_GC_Operation
 //   - implements methods common to all classes in the hierarchy:
 //     prevents multiple gc requests and manages lock on heap;
@@ -51,6 +53,7 @@
 //   - prints class histogram on SIGBREAK if PrintClassHistogram
 //     is specified; and also the attach "inspectheap" operation
 //
+//  VM_CollectForAllocation
 //  VM_GenCollectForAllocation
 //  VM_ParallelGCFailedAllocation
 //   - this operation is invoked when allocation is failed;
@@ -66,13 +69,13 @@
 
 class VM_GC_Operation: public VM_Operation {
  protected:
-  BasicLock     _pending_list_basic_lock; // for refs pending list notification (PLL)
-  unsigned int  _gc_count_before;         // gc count before acquiring PLL
-  unsigned int  _full_gc_count_before;    // full gc count before acquiring PLL
-  bool          _full;                    // whether a "full" collection
-  bool          _prologue_succeeded;      // whether doit_prologue succeeded
+  BasicLock      _pending_list_basic_lock; // for refs pending list notification (PLL)
+  uint           _gc_count_before;         // gc count before acquiring PLL
+  uint           _full_gc_count_before;    // full gc count before acquiring PLL
+  bool           _full;                    // whether a "full" collection
+  bool           _prologue_succeeded;      // whether doit_prologue succeeded
   GCCause::Cause _gc_cause;                // the putative cause for this gc op
-  bool          _gc_locked;               // will be set if gc was locked
+  bool           _gc_locked;               // will be set if gc was locked
 
   virtual bool skip_operation() const;
 
@@ -81,9 +84,9 @@
   void release_and_notify_pending_list_lock();
 
  public:
-  VM_GC_Operation(unsigned int gc_count_before,
+  VM_GC_Operation(uint gc_count_before,
                   GCCause::Cause _cause,
-                  unsigned int full_gc_count_before = 0,
+                  uint full_gc_count_before = 0,
                   bool full = false) {
     _full = full;
     _prologue_succeeded = false;
@@ -104,10 +107,7 @@
     // mutators have run.  Soft refs will be cleared again in this
     // collection.
   }
-  ~VM_GC_Operation() {
-    CollectedHeap* ch = Universe::heap();
-    ch->collector_policy()->set_all_soft_refs_clear(false);
-  }
+  ~VM_GC_Operation();
 
   // Acquire the reference synchronization lock
   virtual bool doit_prologue();
@@ -160,38 +160,46 @@
   bool collect();
 };
 
+class VM_CollectForAllocation : public VM_GC_Operation {
+ protected:
+  size_t    _word_size; // Size of object to be allocated (in number of words)
+  HeapWord* _result;    // Allocation result (NULL if allocation failed)
 
-class VM_GenCollectForAllocation: public VM_GC_Operation {
+ public:
+  VM_CollectForAllocation(size_t word_size, uint gc_count_before, GCCause::Cause cause)
+    : VM_GC_Operation(gc_count_before, cause), _result(NULL), _word_size(word_size) {}
+
+  HeapWord* result() const {
+    return _result;
+  }
+};
+
+class VM_GenCollectForAllocation : public VM_CollectForAllocation {
  private:
-  HeapWord*   _res;
-  size_t      _size;                       // size of object to be allocated.
   bool        _tlab;                       // alloc is of a tlab.
  public:
-  VM_GenCollectForAllocation(size_t size,
+  VM_GenCollectForAllocation(size_t word_size,
                              bool tlab,
-                             unsigned int gc_count_before)
-    : VM_GC_Operation(gc_count_before, GCCause::_allocation_failure),
-      _size(size),
+                             uint gc_count_before)
+    : VM_CollectForAllocation(word_size, gc_count_before, GCCause::_allocation_failure),
       _tlab(tlab) {
-    _res = NULL;
+    assert(word_size != 0, "An allocation should always be requested with this operation.");
   }
   ~VM_GenCollectForAllocation()  {}
   virtual VMOp_Type type() const { return VMOp_GenCollectForAllocation; }
   virtual void doit();
-  HeapWord* result() const       { return _res; }
 };
 
-
 // VM operation to invoke a collection of the heap as a
 // GenCollectedHeap heap.
 class VM_GenCollectFull: public VM_GC_Operation {
  private:
   int _max_level;
  public:
-  VM_GenCollectFull(unsigned int gc_count_before,
-                    unsigned int full_gc_count_before,
+  VM_GenCollectFull(uint gc_count_before,
+                    uint full_gc_count_before,
                     GCCause::Cause gc_cause,
-                      int max_level)
+                    int max_level)
     : VM_GC_Operation(gc_count_before, gc_cause, full_gc_count_before, true /* full */),
       _max_level(max_level) { }
   ~VM_GenCollectFull() {}
@@ -208,9 +216,9 @@
  public:
   VM_CollectForMetadataAllocation(ClassLoaderData* loader_data,
                                   size_t size, Metaspace::MetadataType mdtype,
-                                      unsigned int gc_count_before,
-                                      unsigned int full_gc_count_before,
-                                      GCCause::Cause gc_cause)
+                                  uint gc_count_before,
+                                  uint full_gc_count_before,
+                                  GCCause::Cause gc_cause)
     : VM_GC_Operation(gc_count_before, gc_cause, full_gc_count_before, true),
       _loader_data(loader_data), _size(size), _mdtype(mdtype), _result(NULL) {
   }
--- a/hotspot/src/share/vm/gc_interface/collectedHeap.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/gc_interface/collectedHeap.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -32,6 +32,7 @@
 #include "gc_interface/allocTracer.hpp"
 #include "gc_interface/collectedHeap.hpp"
 #include "gc_interface/collectedHeap.inline.hpp"
+#include "memory/barrierSet.inline.hpp"
 #include "memory/metaspace.hpp"
 #include "oops/oop.inline.hpp"
 #include "oops/instanceMirrorKlass.hpp"
@@ -124,6 +125,14 @@
   }
 }
 
+void CollectedHeap::print_on_error(outputStream* st) const {
+  st->print_cr("Heap:");
+  print_extended_on(st);
+  st->cr();
+
+  _barrier_set->print_on(st);
+}
+
 void CollectedHeap::register_nmethod(nmethod* nm) {
   assert_locked_or_safepoint(CodeCache_lock);
 }
--- a/hotspot/src/share/vm/gc_interface/collectedHeap.hpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/gc_interface/collectedHeap.hpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -28,7 +28,6 @@
 #include "gc_interface/gcCause.hpp"
 #include "gc_implementation/shared/gcWhen.hpp"
 #include "memory/allocation.hpp"
-#include "memory/barrierSet.hpp"
 #include "runtime/handles.hpp"
 #include "runtime/perfData.hpp"
 #include "runtime/safepoint.hpp"
@@ -576,13 +575,7 @@
     print_on(st);
   }
 
-  virtual void print_on_error(outputStream* st) const {
-    st->print_cr("Heap:");
-    print_extended_on(st);
-    st->cr();
-
-    _barrier_set->print_on(st);
-  }
+  virtual void print_on_error(outputStream* st) const;
 
   // Print all GC threads (other than the VM thread)
   // used by this heap.
--- a/hotspot/src/share/vm/interpreter/bytecodeTracer.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/interpreter/bytecodeTracer.cpp	Mon Feb 23 05:01: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
@@ -23,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "interpreter/bytecodeHistogram.hpp"
 #include "interpreter/bytecodeTracer.hpp"
 #include "interpreter/bytecodes.hpp"
--- a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp	Mon Feb 23 05:01: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
@@ -23,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "classfile/vmSymbols.hpp"
 #include "compiler/compileBroker.hpp"
@@ -38,6 +39,7 @@
 #include "oops/instanceKlass.hpp"
 #include "oops/methodData.hpp"
 #include "oops/objArrayKlass.hpp"
+#include "oops/objArrayOop.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "oops/symbol.hpp"
 #include "prims/jvmtiExport.hpp"
--- a/hotspot/src/share/vm/interpreter/linkResolver.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/interpreter/linkResolver.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -35,6 +35,7 @@
 #include "memory/universe.inline.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/objArrayOop.hpp"
+#include "oops/oop.inline.hpp"
 #include "prims/methodHandles.hpp"
 #include "prims/nativeLookup.hpp"
 #include "runtime/compilationPolicy.hpp"
--- a/hotspot/src/share/vm/memory/barrierSet.hpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/memory/barrierSet.hpp	Mon Feb 23 05:01:11 2015 -0800
@@ -160,7 +160,7 @@
   // (For efficiency reasons, this operation is specialized for certain
   // barrier types.  Semantically, it should be thought of as a call to the
   // virtual "_work" function below, which must implement the barrier.)
-  inline void write_region(MemRegion mr);
+  void write_region(MemRegion mr);
 protected:
   virtual void write_region_work(MemRegion mr) = 0;
 public:
--- a/hotspot/src/share/vm/memory/barrierSet.inline.hpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/memory/barrierSet.inline.hpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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,7 +26,7 @@
 #define SHARE_VM_MEMORY_BARRIERSET_INLINE_HPP
 
 #include "memory/barrierSet.hpp"
-#include "memory/cardTableModRefBS.hpp"
+#include "memory/cardTableModRefBS.inline.hpp"
 
 // Inline functions of BarrierSet, which de-virtualize certain
 // performance-critical calls when the barrier is the most common
@@ -76,7 +76,7 @@
 }
 
 
-void BarrierSet::write_region(MemRegion mr) {
+inline void BarrierSet::write_region(MemRegion mr) {
   if (kind() == CardTableModRef) {
     ((CardTableModRefBS*)this)->inline_write_region(mr);
   } else {
--- a/hotspot/src/share/vm/memory/cardTableModRefBS.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/memory/cardTableModRefBS.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -24,7 +24,7 @@
 
 #include "precompiled.hpp"
 #include "memory/allocation.inline.hpp"
-#include "memory/cardTableModRefBS.hpp"
+#include "memory/cardTableModRefBS.inline.hpp"
 #include "memory/cardTableRS.hpp"
 #include "memory/sharedHeap.hpp"
 #include "memory/space.hpp"
--- a/hotspot/src/share/vm/memory/cardTableModRefBS.hpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/memory/cardTableModRefBS.hpp	Mon Feb 23 05:01:11 2015 -0800
@@ -27,7 +27,6 @@
 
 #include "memory/modRefBarrierSet.hpp"
 #include "oops/oop.hpp"
-#include "oops/oop.inline2.hpp"
 
 // This kind of "BarrierSet" allows a "CollectedHeap" to detect and
 // enumerate ref fields that have been modified (since the last
@@ -45,6 +44,7 @@
 class OopsInGenClosure;
 class DirtyCardToOopClosure;
 class ClearNoncleanCardWrapper;
+class CardTableRS;
 
 class CardTableModRefBS: public ModRefBarrierSet {
   // Some classes get to look at some private stuff.
@@ -333,15 +333,7 @@
 
   template <class T> inline void inline_write_ref_field_pre(T* field, oop newVal) {}
 
-  template <class T> inline void inline_write_ref_field(T* field, oop newVal, bool release) {
-    jbyte* byte = byte_for((void*)field);
-    if (release) {
-      // Perform a releasing store if requested.
-      OrderAccess::release_store((volatile jbyte*) byte, dirty_card);
-    } else {
-      *byte = dirty_card;
-    }
-  }
+  template <class T> inline void inline_write_ref_field(T* field, oop newVal, bool release);
 
   // These are used by G1, when it uses the card table as a temporary data
   // structure for card claiming.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/memory/cardTableModRefBS.inline.hpp	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,42 @@
+/*
+ * 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.
+ *
+ * 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.
+ *
+ */
+
+#ifndef SHARE_VM_MEMORY_CARDTABLEMODREFBS_INLINE_HPP
+#define SHARE_VM_MEMORY_CARDTABLEMODREFBS_INLINE_HPP
+
+#include "memory/cardTableModRefBS.hpp"
+#include "oops/oopsHierarchy.hpp"
+#include "runtime/orderAccess.inline.hpp"
+
+template <class T> inline void CardTableModRefBS::inline_write_ref_field(T* field, oop newVal, bool release) {
+  jbyte* byte = byte_for((void*)field);
+  if (release) {
+    // Perform a releasing store if requested.
+    OrderAccess::release_store((volatile jbyte*) byte, dirty_card);
+  } else {
+    *byte = dirty_card;
+  }
+}
+
+#endif // SHARE_VM_MEMORY_CARDTABLEMODREFBS_INLINE_HPP
--- a/hotspot/src/share/vm/memory/collectorPolicy.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/memory/collectorPolicy.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -597,7 +597,7 @@
   HeapWord* result = NULL;
 
   // Loop until the allocation is satisfied, or unsatisfied after GC.
-  for (int try_count = 1, gclocker_stalled_count = 0; /* return or throw */; try_count += 1) {
+  for (uint try_count = 1, gclocker_stalled_count = 0; /* return or throw */; try_count += 1) {
     HandleMark hm; // Discard any handles allocated in each iteration.
 
     // First allocation attempt is lock-free.
@@ -611,7 +611,7 @@
         return result;
       }
     }
-    unsigned int gc_count_before;  // Read inside the Heap_lock locked region.
+    uint gc_count_before;  // Read inside the Heap_lock locked region.
     {
       MutexLocker ml(Heap_lock);
       if (PrintGC && Verbose) {
--- a/hotspot/src/share/vm/memory/genCollectedHeap.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/memory/genCollectedHeap.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -41,7 +41,6 @@
 #include "memory/sharedHeap.hpp"
 #include "memory/space.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
 #include "runtime/biasedLocking.hpp"
 #include "runtime/fprofiler.hpp"
 #include "runtime/handles.hpp"
--- a/hotspot/src/share/vm/memory/genOopClosures.hpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/memory/genOopClosures.hpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -189,16 +189,4 @@
   inline void do_oop_nv(narrowOop* p);
 };
 
-class VerifyOopClosure: public OopClosure {
- protected:
-  template <class T> inline void do_oop_work(T* p) {
-    oop obj = oopDesc::load_decode_heap_oop(p);
-    guarantee(obj->is_oop_or_null(), err_msg("invalid oop: " INTPTR_FORMAT, p2i((oopDesc*) obj)));
-  }
- public:
-  virtual void do_oop(oop* p);
-  virtual void do_oop(narrowOop* p);
-  static VerifyOopClosure verify_oop;
-};
-
 #endif // SHARE_VM_MEMORY_GENOOPCLOSURES_HPP
--- a/hotspot/src/share/vm/memory/heapInspection.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/memory/heapInspection.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -29,6 +29,7 @@
 #include "memory/genCollectedHeap.hpp"
 #include "memory/heapInspection.hpp"
 #include "memory/resourceArea.hpp"
+#include "oops/oop.inline.hpp"
 #include "runtime/os.hpp"
 #include "utilities/globalDefinitions.hpp"
 #include "utilities/macros.hpp"
--- a/hotspot/src/share/vm/memory/heapInspection.hpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/memory/heapInspection.hpp	Mon Feb 23 05:01:11 2015 -0800
@@ -25,8 +25,9 @@
 #ifndef SHARE_VM_MEMORY_HEAPINSPECTION_HPP
 #define SHARE_VM_MEMORY_HEAPINSPECTION_HPP
 
-#include "memory/allocation.inline.hpp"
-#include "oops/oop.inline.hpp"
+#include "memory/allocation.hpp"
+#include "oops/objArrayOop.hpp"
+#include "oops/oop.hpp"
 #include "oops/annotations.hpp"
 #include "utilities/macros.hpp"
 
--- a/hotspot/src/share/vm/memory/space.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/memory/space.cpp	Mon Feb 23 05:01: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
@@ -36,7 +36,6 @@
 #include "memory/space.inline.hpp"
 #include "memory/universe.inline.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
 #include "runtime/java.hpp"
 #include "runtime/atomic.inline.hpp"
 #include "runtime/prefetch.inline.hpp"
--- a/hotspot/src/share/vm/memory/space.inline.hpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/memory/space.inline.hpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2012, 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.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,7 @@
 #include "gc_implementation/shared/markSweep.inline.hpp"
 #include "gc_implementation/shared/spaceDecorator.hpp"
 #include "gc_interface/collectedHeap.hpp"
+#include "memory/generation.hpp"
 #include "memory/space.hpp"
 #include "memory/universe.hpp"
 #include "runtime/prefetch.inline.hpp"
--- a/hotspot/src/share/vm/memory/universe.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/memory/universe.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -50,6 +50,7 @@
 #include "oops/instanceKlass.hpp"
 #include "oops/instanceMirrorKlass.hpp"
 #include "oops/instanceRefKlass.hpp"
+#include "oops/objArrayOop.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "oops/typeArrayKlass.hpp"
 #include "prims/jvmtiRedefineClassesTrace.hpp"
--- a/hotspot/src/share/vm/oops/compiledICHolder.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/oops/compiledICHolder.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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,7 +26,6 @@
 #include "oops/compiledICHolder.hpp"
 #include "oops/klass.hpp"
 #include "oops/method.hpp"
-#include "oops/oop.inline2.hpp"
 #include "runtime/atomic.inline.hpp"
 
 volatile int CompiledICHolder::_live_count;
--- a/hotspot/src/share/vm/oops/constantPool.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/oops/constantPool.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -24,7 +24,7 @@
 
 #include "precompiled.hpp"
 #include "classfile/classLoaderData.hpp"
-#include "classfile/javaClasses.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "classfile/metadataOnStackMark.hpp"
 #include "classfile/stringTable.hpp"
 #include "classfile/systemDictionary.hpp"
@@ -36,11 +36,14 @@
 #include "oops/constantPool.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/objArrayKlass.hpp"
+#include "oops/objArrayOop.inline.hpp"
+#include "oops/oop.inline.hpp"
 #include "runtime/fieldType.hpp"
 #include "runtime/init.hpp"
 #include "runtime/javaCalls.hpp"
 #include "runtime/signature.hpp"
 #include "runtime/vframe.hpp"
+#include "utilities/copy.hpp"
 
 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
 
--- a/hotspot/src/share/vm/oops/cpCache.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/oops/cpCache.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -28,7 +28,7 @@
 #include "interpreter/rewriter.hpp"
 #include "memory/universe.inline.hpp"
 #include "oops/cpCache.hpp"
-#include "oops/objArrayOop.hpp"
+#include "oops/objArrayOop.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "prims/jvmtiRedefineClassesTrace.hpp"
 #include "prims/methodHandles.hpp"
--- a/hotspot/src/share/vm/oops/klass.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/oops/klass.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -35,7 +35,7 @@
 #include "memory/resourceArea.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/klass.inline.hpp"
-#include "oops/oop.inline2.hpp"
+#include "oops/oop.inline.hpp"
 #include "runtime/atomic.inline.hpp"
 #include "runtime/orderAccess.inline.hpp"
 #include "trace/traceMacros.hpp"
--- a/hotspot/src/share/vm/oops/markOop.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/oops/markOop.cpp	Mon Feb 23 05:01: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
@@ -25,17 +25,40 @@
 #include "precompiled.hpp"
 #include "oops/markOop.hpp"
 #include "runtime/thread.inline.hpp"
+#include "runtime/objectMonitor.inline.hpp"
 
 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
 
 void markOopDesc::print_on(outputStream* st) const {
-  if (is_locked()) {
-    st->print("locked(" INTPTR_FORMAT ")->", value());
-    markOop(*(markOop*)value())->print_on(st);
+  if (is_marked()) {
+    st->print(" marked(" INTPTR_FORMAT ")", value());
+  } else if (is_locked()) {
+    st->print(" locked(" INTPTR_FORMAT ")->", value());
+    if (is_neutral()) {
+      st->print("is_neutral");
+      if (has_no_hash()) st->print(" no_hash");
+      else st->print(" hash=" INTPTR_FORMAT, hash());
+      st->print(" age=%d", age());
+    } else if (has_bias_pattern()) {
+      st->print("is_biased");
+      JavaThread* jt = biased_locker();
+      st->print(" biased_locker=" INTPTR_FORMAT, p2i(jt));
+    } else if (has_monitor()) {
+      ObjectMonitor* mon = monitor();
+      if (mon == NULL)
+        st->print("monitor=NULL");
+      else {
+        BasicLock * bl = (BasicLock *) mon->owner();
+        st->print("monitor={count="INTPTR_FORMAT",waiters="INTPTR_FORMAT",recursions="INTPTR_FORMAT",owner="INTPTR_FORMAT"}",
+                mon->count(), mon->waiters(), mon->recursions(), p2i(bl));
+      }
+    } else {
+      st->print("??");
+    }
   } else {
     assert(is_unlocked() || has_bias_pattern(), "just checking");
     st->print("mark(");
-    if (has_bias_pattern())  st->print("biased,");
+    if (has_bias_pattern()) st->print("biased,");
     st->print("hash %#lx,", hash());
     st->print("age %d)", age());
   }
--- a/hotspot/src/share/vm/oops/methodData.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/oops/methodData.cpp	Mon Feb 23 05:01: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.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,6 +36,7 @@
 #include "runtime/deoptimization.hpp"
 #include "runtime/handles.inline.hpp"
 #include "runtime/orderAccess.inline.hpp"
+#include "utilities/copy.hpp"
 
 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
 
--- a/hotspot/src/share/vm/oops/objArrayKlass.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/oops/objArrayKlass.cpp	Mon Feb 23 05:01: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
@@ -35,11 +35,9 @@
 #include "memory/universe.inline.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/klass.inline.hpp"
-#include "oops/objArrayKlass.hpp"
 #include "oops/objArrayKlass.inline.hpp"
-#include "oops/objArrayOop.hpp"
+#include "oops/objArrayOop.inline.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
 #include "oops/symbol.hpp"
 #include "runtime/handles.inline.hpp"
 #include "runtime/mutexLocker.hpp"
--- a/hotspot/src/share/vm/oops/objArrayOop.hpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/oops/objArrayOop.hpp	Mon Feb 23 05:01: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
@@ -78,15 +78,7 @@
   HeapWord* base() const      { return (HeapWord*) arrayOopDesc::base(T_OBJECT); }
 
   // Accessing
-  oop obj_at(int index) const {
-    // With UseCompressedOops decode the narrow oop in the objArray to an
-    // uncompressed oop.  Otherwise this is simply a "*" operator.
-    if (UseCompressedOops) {
-      return load_decode_heap_oop(obj_at_addr<narrowOop>(index));
-    } else {
-      return load_decode_heap_oop(obj_at_addr<oop>(index));
-    }
-  }
+  oop obj_at(int index) const;
 
   void obj_at_put(int index, oop value) {
     if (UseCompressedOops) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/oops/objArrayOop.inline.hpp	Mon Feb 23 05:01: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.
+ *
+ * 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.
+ *
+ */
+
+#ifndef SHARE_VM_OOPS_OBJARRAYOOP_INLINE_HPP
+#define SHARE_VM_OOPS_OBJARRAYOOP_INLINE_HPP
+
+#include "oops/objArrayOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/globals.hpp"
+
+inline oop objArrayOopDesc::obj_at(int index) const {
+  // With UseCompressedOops decode the narrow oop in the objArray to an
+  // uncompressed oop.  Otherwise this is simply a "*" operator.
+  if (UseCompressedOops) {
+    return load_decode_heap_oop(obj_at_addr<narrowOop>(index));
+  } else {
+    return load_decode_heap_oop(obj_at_addr<oop>(index));
+  }
+}
+
+#endif // SHARE_VM_OOPS_OBJARRAYOOP_INLINE_HPP
--- a/hotspot/src/share/vm/oops/oop.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/oops/oop.cpp	Mon Feb 23 05:01: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
@@ -24,8 +24,9 @@
 
 #include "precompiled.hpp"
 #include "classfile/altHashing.hpp"
-#include "classfile/javaClasses.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "oops/oop.inline.hpp"
+#include "oops/verifyOopClosure.hpp"
 #include "runtime/handles.inline.hpp"
 #include "runtime/thread.inline.hpp"
 #include "utilities/copy.hpp"
@@ -120,5 +121,24 @@
 
 VerifyOopClosure VerifyOopClosure::verify_oop;
 
+template <class T> void VerifyOopClosure::do_oop_work(T* p) {
+  oop obj = oopDesc::load_decode_heap_oop(p);
+  guarantee(obj->is_oop_or_null(), err_msg("invalid oop: " INTPTR_FORMAT, p2i((oopDesc*) obj)));
+}
+
 void VerifyOopClosure::do_oop(oop* p)       { VerifyOopClosure::do_oop_work(p); }
 void VerifyOopClosure::do_oop(narrowOop* p) { VerifyOopClosure::do_oop_work(p); }
+
+// type test operations that doesn't require inclusion of oop.inline.hpp.
+bool oopDesc::is_instance_noinline()          const { return is_instance();            }
+bool oopDesc::is_instanceMirror_noinline()    const { return is_instanceMirror();      }
+bool oopDesc::is_instanceClassLoader_noline() const { return is_instanceClassLoader(); }
+bool oopDesc::is_instanceRef_noline()         const { return is_instanceRef();         }
+bool oopDesc::is_array_noinline()             const { return is_array();               }
+bool oopDesc::is_objArray_noinline()          const { return is_objArray();            }
+bool oopDesc::is_typeArray_noinline()         const { return is_typeArray();           }
+
+bool oopDesc::has_klass_gap() {
+  // Only has a klass gap when compressed class pointers are used.
+  return UseCompressedClassPointers;
+}
--- a/hotspot/src/share/vm/oops/oop.hpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/oops/oop.hpp	Mon Feb 23 05:01: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
@@ -108,7 +108,7 @@
   // to be able to figure out the size of an object knowing its klass.
   int size_given_klass(Klass* klass);
 
-  // type test operations (inlined in oop.inline.h)
+  // type test operations (inlined in oop.inline.hpp)
   bool is_instance()            const;
   bool is_instanceMirror()      const;
   bool is_instanceClassLoader() const;
@@ -117,6 +117,15 @@
   bool is_objArray()            const;
   bool is_typeArray()           const;
 
+  // type test operations that don't require inclusion of oop.inline.hpp.
+  bool is_instance_noinline()          const;
+  bool is_instanceMirror_noinline()    const;
+  bool is_instanceClassLoader_noline() const;
+  bool is_instanceRef_noline()         const;
+  bool is_array_noinline()             const;
+  bool is_objArray_noinline()          const;
+  bool is_typeArray_noinline()         const;
+
  private:
   // field addresses in oop
   void*     field_base(int offset)        const;
@@ -370,10 +379,15 @@
   markOop  displaced_mark() const;
   void     set_displaced_mark(markOop m);
 
+  static bool has_klass_gap();
+
   // for code generation
-  static int mark_offset_in_bytes()    { return offset_of(oopDesc, _mark); }
-  static int klass_offset_in_bytes()   { return offset_of(oopDesc, _metadata._klass); }
-  static int klass_gap_offset_in_bytes();
+  static int mark_offset_in_bytes()      { return offset_of(oopDesc, _mark); }
+  static int klass_offset_in_bytes()     { return offset_of(oopDesc, _metadata._klass); }
+  static int klass_gap_offset_in_bytes() {
+    assert(has_klass_gap(), "only applicable to compressed klass pointers");
+    return klass_offset_in_bytes() + sizeof(narrowKlass);
+  }
 };
 
 #endif // SHARE_VM_OOPS_OOP_HPP
--- a/hotspot/src/share/vm/oops/oop.inline.hpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/oops/oop.inline.hpp	Mon Feb 23 05:01: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
@@ -71,11 +71,6 @@
   }
 }
 
-inline int oopDesc::klass_gap_offset_in_bytes() {
-  assert(UseCompressedClassPointers, "only applicable to compressed klass pointers");
-  return oopDesc::klass_offset_in_bytes() + sizeof(narrowKlass);
-}
-
 inline Klass** oopDesc::klass_addr() {
   // Only used internally and with CMS and will not work with
   // UseCompressedOops
@@ -602,8 +597,11 @@
   klass()->oop_follow_contents(this);
 }
 
+inline bool oopDesc::is_scavengable() const {
+  return Universe::heap()->is_scavengable(this);
+}
+
 // Used by scavengers
-
 inline bool oopDesc::is_forwarded() const {
   // The extra heap check is needed since the obj might be locked, in which case the
   // mark would point to a stack location and have the sentinel bit cleared
--- a/hotspot/src/share/vm/oops/oop.inline2.hpp	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2000, 2012, 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.
- *
- * 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.
- *
- */
-
-#ifndef SHARE_VM_OOPS_OOP_INLINE2_HPP
-#define SHARE_VM_OOPS_OOP_INLINE2_HPP
-
-#include "gc_interface/collectedHeap.hpp"
-#include "memory/generation.hpp"
-#include "memory/universe.hpp"
-#include "oops/oop.hpp"
-
-// Implementation of all inlined member functions defined in oop.hpp
-// We need a separate file to avoid circular references
-
-inline bool oopDesc::is_scavengable() const {
-  return Universe::heap()->is_scavengable(this);
-}
-#endif // SHARE_VM_OOPS_OOP_INLINE2_HPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/oops/verifyOopClosure.hpp	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,39 @@
+/*
+ * 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.
+ *
+ * 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.
+ *
+ */
+
+#ifndef SHARE_VM_OOPS_VERIFYOOPCLOSURE_HPP
+#define SHARE_VM_OOPS_VERIFYOOPCLOSURE_HPP
+
+#include "memory/iterator.hpp"
+
+class VerifyOopClosure: public OopClosure {
+ protected:
+  template <class T> void do_oop_work(T* p);
+ public:
+  virtual void do_oop(oop* p);
+  virtual void do_oop(narrowOop* p);
+  static VerifyOopClosure verify_oop;
+};
+
+#endif // SHARE_VM_OOPS_VERIFYOOPCLOSURE_HPP
--- a/hotspot/src/share/vm/opto/callGenerator.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/opto/callGenerator.cpp	Mon Feb 23 05:01: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.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,7 @@
 #include "opto/rootnode.hpp"
 #include "opto/runtime.hpp"
 #include "opto/subnode.hpp"
-
+#include "runtime/sharedRuntime.hpp"
 
 // Utility function.
 const TypeFunc* CallGenerator::tf() const {
--- a/hotspot/src/share/vm/opto/callnode.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/opto/callnode.cpp	Mon Feb 23 05:01: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
@@ -23,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "compiler/compileLog.hpp"
 #include "ci/bcEscapeAnalyzer.hpp"
 #include "compiler/oopMap.hpp"
 #include "opto/callGenerator.hpp"
@@ -1673,6 +1674,9 @@
       // The lock could be marked eliminated by lock coarsening
       // code during first IGVN before EA. Replace coarsened flag
       // to eliminate all associated locks/unlocks.
+#ifdef ASSERT
+      this->log_lock_optimization(phase->C,"eliminate_lock_set_non_esc1");
+#endif
       this->set_non_esc_obj();
       return result;
     }
@@ -1734,6 +1738,9 @@
           AbstractLockNode* lock = lock_ops.at(i);
 
           // Mark it eliminated by coarsening and update any counters
+#ifdef ASSERT
+          lock->log_lock_optimization(phase->C, "eliminate_lock_set_coarsened");
+#endif
           lock->set_coarsened();
         }
       } else if (ctrl->is_Region() &&
@@ -1752,16 +1759,33 @@
 
 //=============================================================================
 bool LockNode::is_nested_lock_region() {
+  return is_nested_lock_region(NULL);
+}
+
+// p is used for access to compilation log; no logging if NULL
+bool LockNode::is_nested_lock_region(Compile * c) {
   BoxLockNode* box = box_node()->as_BoxLock();
   int stk_slot = box->stack_slot();
-  if (stk_slot <= 0)
+  if (stk_slot <= 0) {
+#ifdef ASSERT
+    this->log_lock_optimization(c, "eliminate_lock_INLR_1");
+#endif
     return false; // External lock or it is not Box (Phi node).
+  }
 
   // Ignore complex cases: merged locks or multiple locks.
   Node* obj = obj_node();
   LockNode* unique_lock = NULL;
-  if (!box->is_simple_lock_region(&unique_lock, obj) ||
-      (unique_lock != this)) {
+  if (!box->is_simple_lock_region(&unique_lock, obj)) {
+#ifdef ASSERT
+    this->log_lock_optimization(c, "eliminate_lock_INLR_2a");
+#endif
+    return false;
+  }
+  if (unique_lock != this) {
+#ifdef ASSERT
+    this->log_lock_optimization(c, "eliminate_lock_INLR_2b");
+#endif
     return false;
   }
 
@@ -1781,6 +1805,9 @@
       }
     }
   }
+#ifdef ASSERT
+  this->log_lock_optimization(c, "eliminate_lock_INLR_3");
+#endif
   return false;
 }
 
@@ -1812,12 +1839,43 @@
       // The lock could be marked eliminated by lock coarsening
       // code during first IGVN before EA. Replace coarsened flag
       // to eliminate all associated locks/unlocks.
+#ifdef ASSERT
+      this->log_lock_optimization(phase->C, "eliminate_lock_set_non_esc2");
+#endif
       this->set_non_esc_obj();
     }
   }
   return result;
 }
 
+const char * AbstractLockNode::kind_as_string() const {
+  return is_coarsened()   ? "coarsened" :
+         is_nested()      ? "nested" :
+         is_non_esc_obj() ? "non_escaping" :
+         "?";
+}
+
+void AbstractLockNode::log_lock_optimization(Compile *C, const char * tag)  const {
+  if (C == NULL) {
+    return;
+  }
+  CompileLog* log = C->log();
+  if (log != NULL) {
+    log->begin_head("%s lock='%d' compile_id='%d' class_id='%s' kind='%s'",
+          tag, is_Lock(), C->compile_id(),
+          is_Unlock() ? "unlock" : is_Lock() ? "lock" : "?",
+          kind_as_string());
+    log->stamp();
+    log->end_head();
+    JVMState* p = is_Unlock() ? (as_Unlock()->dbg_jvms()) : jvms();
+    while (p != NULL) {
+      log->elem("jvms bci='%d' method='%d'", p->bci(), log->identify(p->method()));
+      p = p->caller();
+    }
+    log->tail(tag);
+  }
+}
+
 ArrayCopyNode::ArrayCopyNode(Compile* C, bool alloc_tightly_coupled)
   : CallNode(arraycopy_type(), NULL, TypeRawPtr::BOTTOM),
     _alloc_tightly_coupled(alloc_tightly_coupled),
--- a/hotspot/src/share/vm/opto/callnode.hpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/opto/callnode.hpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, 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
@@ -985,6 +985,9 @@
   bool is_coarsened()   const { return (_kind == Coarsened); }
   bool is_nested()      const { return (_kind == Nested); }
 
+  const char * kind_as_string() const;
+  void log_lock_optimization(Compile* c, const char * tag) const;
+
   void set_non_esc_obj() { _kind = NonEscObj; set_eliminated_lock_counter(); }
   void set_coarsened()   { _kind = Coarsened; set_eliminated_lock_counter(); }
   void set_nested()      { _kind = Nested; set_eliminated_lock_counter(); }
@@ -1045,15 +1048,24 @@
   }
 
   bool is_nested_lock_region(); // Is this Lock nested?
+  bool is_nested_lock_region(Compile * c); // Why isn't this Lock nested?
 };
 
 //------------------------------Unlock---------------------------------------
 // High-level unlock operation
 class UnlockNode : public AbstractLockNode {
+private:
+#ifdef ASSERT
+  JVMState* const _dbg_jvms;      // Pointer to list of JVM State objects
+#endif
 public:
   virtual int Opcode() const;
   virtual uint size_of() const; // Size is bigger
-  UnlockNode(Compile* C, const TypeFunc *tf) : AbstractLockNode( tf ) {
+  UnlockNode(Compile* C, const TypeFunc *tf) : AbstractLockNode( tf )
+#ifdef ASSERT
+    , _dbg_jvms(NULL)
+#endif
+  {
     init_class_id(Class_Unlock);
     init_flags(Flag_is_macro);
     C->add_macro_node(this);
@@ -1061,6 +1073,14 @@
   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
   // unlock is never a safepoint
   virtual bool        guaranteed_safepoint()  { return false; }
+#ifdef ASSERT
+  void set_dbg_jvms(JVMState* s) {
+    *(JVMState**)&_dbg_jvms = s;  // override const attribute in the accessor
+  }
+  JVMState* dbg_jvms() const { return _dbg_jvms; }
+#else
+  JVMState* dbg_jvms() const { return NULL; }
+#endif
 };
 
 class GraphKit;
--- a/hotspot/src/share/vm/opto/compile.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/opto/compile.cpp	Mon Feb 23 05:01: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
@@ -64,6 +64,7 @@
 #include "opto/type.hpp"
 #include "opto/vectornode.hpp"
 #include "runtime/arguments.hpp"
+#include "runtime/sharedRuntime.hpp"
 #include "runtime/signature.hpp"
 #include "runtime/stubRoutines.hpp"
 #include "runtime/timer.hpp"
--- a/hotspot/src/share/vm/opto/convertnode.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/opto/convertnode.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -28,6 +28,7 @@
 #include "opto/matcher.hpp"
 #include "opto/phaseX.hpp"
 #include "opto/subnode.hpp"
+#include "runtime/sharedRuntime.hpp"
 
 //=============================================================================
 //------------------------------Identity---------------------------------------
--- a/hotspot/src/share/vm/opto/escape.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/opto/escape.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -1802,6 +1802,9 @@
             // The lock could be marked eliminated by lock coarsening
             // code during first IGVN before EA. Replace coarsened flag
             // to eliminate all associated locks/unlocks.
+#ifdef ASSERT
+            alock->log_lock_optimization(C, "eliminate_lock_set_non_esc3");
+#endif
             alock->set_non_esc_obj();
           }
         }
--- a/hotspot/src/share/vm/opto/graphKit.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/opto/graphKit.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -3244,6 +3244,9 @@
 
   const TypeFunc *tf = OptoRuntime::complete_monitor_exit_Type();
   UnlockNode *unlock = new UnlockNode(C, tf);
+#ifdef ASSERT
+  unlock->set_dbg_jvms(sync_jvms());
+#endif
   uint raw_idx = Compile::AliasIdxRaw;
   unlock->init_req( TypeFunc::Control, control() );
   unlock->init_req( TypeFunc::Memory , memory(raw_idx) );
@@ -3754,6 +3757,17 @@
   sync_kit(ideal);
 }
 
+Node* GraphKit::byte_map_base_node() {
+  // Get base of card map
+  CardTableModRefBS* ct = (CardTableModRefBS*)(Universe::heap()->barrier_set());
+  assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust users of this code");
+  if (ct->byte_map_base != NULL) {
+    return makecon(TypeRawPtr::make((address)ct->byte_map_base));
+  } else {
+    return null();
+  }
+}
+
 // vanilla/CMS post barrier
 // Insert a write-barrier store.  This is to let generational GC work; we have
 // to flag all oop-stores before the next GC point.
--- a/hotspot/src/share/vm/opto/graphKit.hpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/opto/graphKit.hpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -104,16 +104,7 @@
   // (See also macro MakeConX in type.hpp, which uses intcon or longcon.)
 
   // Helper for byte_map_base
-  Node* byte_map_base_node() {
-    // Get base of card map
-    CardTableModRefBS* ct = (CardTableModRefBS*)(Universe::heap()->barrier_set());
-    assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust users of this code");
-    if (ct->byte_map_base != NULL) {
-      return makecon(TypeRawPtr::make((address)ct->byte_map_base));
-    } else {
-      return null();
-    }
-  }
+  Node* byte_map_base_node();
 
   jint  find_int_con(Node* n, jint value_if_unknown) {
     return _gvn.find_int_con(n, value_if_unknown);
--- a/hotspot/src/share/vm/opto/lcm.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/opto/lcm.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -31,6 +31,7 @@
 #include "opto/cfgnode.hpp"
 #include "opto/machnode.hpp"
 #include "opto/runtime.hpp"
+#include "runtime/sharedRuntime.hpp"
 
 // Optimization - Graph Style
 
--- a/hotspot/src/share/vm/opto/loopnode.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/opto/loopnode.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -436,6 +436,19 @@
       return false; // cyclic loop or this loop trips only once
   }
 
+  if (phi_incr != NULL) {
+    // check if there is a possiblity of IV overflowing after the first increment
+    if (stride_con > 0) {
+      if (init_t->_hi > max_jint - stride_con) {
+        return false;
+      }
+    } else {
+      if (init_t->_lo < min_jint - stride_con) {
+        return false;
+      }
+    }
+  }
+
   // =================================================
   // ---- SUCCESS!   Found A Trip-Counted Loop!  -----
   //
--- a/hotspot/src/share/vm/opto/macro.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/opto/macro.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -1890,7 +1890,7 @@
     // Box is used only in one lock region. Mark this box as eliminated.
     _igvn.hash_delete(oldbox);
     oldbox->as_BoxLock()->set_eliminated(); // This changes box's hash value
-    _igvn.hash_insert(oldbox);
+     _igvn.hash_insert(oldbox);
 
     for (uint i = 0; i < oldbox->outcnt(); i++) {
       Node* u = oldbox->raw_out(i);
@@ -1899,6 +1899,9 @@
         // Check lock's box since box could be referenced by Lock's debug info.
         if (alock->box_node() == oldbox) {
           // Mark eliminated all related locks and unlocks.
+#ifdef ASSERT
+          alock->log_lock_optimization(C, "eliminate_lock_set_non_esc4");
+#endif
           alock->set_non_esc_obj();
         }
       }
@@ -1925,6 +1928,9 @@
       AbstractLockNode* alock = u->as_AbstractLock();
       if (alock->box_node() == oldbox && alock->obj_node()->eqv_uncast(obj)) {
         // Replace Box and mark eliminated all related locks and unlocks.
+#ifdef ASSERT
+        alock->log_lock_optimization(C, "eliminate_lock_set_non_esc5");
+#endif
         alock->set_non_esc_obj();
         _igvn.rehash_node_delayed(alock);
         alock->set_box_node(newbox);
@@ -1971,26 +1977,38 @@
        return;
     } else if (!alock->is_non_esc_obj()) { // Not eliminated or coarsened
       // Only Lock node has JVMState needed here.
-      if (alock->jvms() != NULL && alock->as_Lock()->is_nested_lock_region()) {
-        // Mark eliminated related nested locks and unlocks.
-        Node* obj = alock->obj_node();
-        BoxLockNode* box_node = alock->box_node()->as_BoxLock();
-        assert(!box_node->is_eliminated(), "should not be marked yet");
-        // Note: BoxLock node is marked eliminated only here
-        // and it is used to indicate that all associated lock
-        // and unlock nodes are marked for elimination.
-        box_node->set_eliminated(); // Box's hash is always NO_HASH here
-        for (uint i = 0; i < box_node->outcnt(); i++) {
-          Node* u = box_node->raw_out(i);
-          if (u->is_AbstractLock()) {
-            alock = u->as_AbstractLock();
-            if (alock->box_node() == box_node) {
-              // Verify that this Box is referenced only by related locks.
-              assert(alock->obj_node()->eqv_uncast(obj), "");
-              // Mark all related locks and unlocks.
-              alock->set_nested();
+      // Not that preceding claim is documented anywhere else.
+      if (alock->jvms() != NULL) {
+        if (alock->as_Lock()->is_nested_lock_region()) {
+          // Mark eliminated related nested locks and unlocks.
+          Node* obj = alock->obj_node();
+          BoxLockNode* box_node = alock->box_node()->as_BoxLock();
+          assert(!box_node->is_eliminated(), "should not be marked yet");
+          // Note: BoxLock node is marked eliminated only here
+          // and it is used to indicate that all associated lock
+          // and unlock nodes are marked for elimination.
+          box_node->set_eliminated(); // Box's hash is always NO_HASH here
+          for (uint i = 0; i < box_node->outcnt(); i++) {
+            Node* u = box_node->raw_out(i);
+            if (u->is_AbstractLock()) {
+              alock = u->as_AbstractLock();
+              if (alock->box_node() == box_node) {
+                // Verify that this Box is referenced only by related locks.
+                assert(alock->obj_node()->eqv_uncast(obj), "");
+                // Mark all related locks and unlocks.
+#ifdef ASSERT
+                alock->log_lock_optimization(C, "eliminate_lock_set_nested");
+#endif
+                alock->set_nested();
+              }
             }
           }
+        } else {
+#ifdef ASSERT
+          alock->log_lock_optimization(C, "eliminate_lock_NOT_nested_lock_region");
+          if (C->log() != NULL)
+            alock->as_Lock()->is_nested_lock_region(C); // rerun for debugging output
+#endif
         }
       }
       return;
@@ -2035,19 +2053,10 @@
     assert(oldbox->is_eliminated(), "should be done already");
   }
 #endif
-  CompileLog* log = C->log();
-  if (log != NULL) {
-    log->head("eliminate_lock lock='%d'",
-              alock->is_Lock());
-    JVMState* p = alock->jvms();
-    while (p != NULL) {
-      log->elem("jvms bci='%d' method='%d'", p->bci(), log->identify(p->method()));
-      p = p->caller();
-    }
-    log->tail("eliminate_lock");
-  }
 
-  #ifndef PRODUCT
+  alock->log_lock_optimization(C, "eliminate_lock");
+
+#ifndef PRODUCT
   if (PrintEliminateLocks) {
     if (alock->is_Lock()) {
       tty->print_cr("++++ Eliminated: %d Lock", alock->_idx);
@@ -2055,7 +2064,7 @@
       tty->print_cr("++++ Eliminated: %d Unlock", alock->_idx);
     }
   }
-  #endif
+#endif
 
   Node* mem  = alock->in(TypeFunc::Memory);
   Node* ctrl = alock->in(TypeFunc::Control);
--- a/hotspot/src/share/vm/opto/matcher.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/opto/matcher.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -38,6 +38,7 @@
 #include "opto/type.hpp"
 #include "opto/vectornode.hpp"
 #include "runtime/os.hpp"
+#include "runtime/sharedRuntime.hpp"
 
 OptoReg::Name OptoReg::c_frame_pointer;
 
--- a/hotspot/src/share/vm/opto/memnode.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/opto/memnode.cpp	Mon Feb 23 05:01: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
@@ -40,6 +40,7 @@
 #include "opto/narrowptrnode.hpp"
 #include "opto/phaseX.hpp"
 #include "opto/regmask.hpp"
+#include "utilities/copy.hpp"
 
 // Portions of code courtesy of Clifford Click
 
--- a/hotspot/src/share/vm/opto/parse2.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/opto/parse2.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -29,6 +29,7 @@
 #include "compiler/compileLog.hpp"
 #include "interpreter/linkResolver.hpp"
 #include "memory/universe.inline.hpp"
+#include "oops/oop.inline.hpp"
 #include "opto/addnode.hpp"
 #include "opto/castnode.hpp"
 #include "opto/convertnode.hpp"
--- a/hotspot/src/share/vm/opto/stringopts.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/opto/stringopts.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2014, 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
@@ -34,6 +34,7 @@
 #include "opto/runtime.hpp"
 #include "opto/stringopts.hpp"
 #include "opto/subnode.hpp"
+#include "runtime/sharedRuntime.hpp"
 
 #define __ kit.
 
--- a/hotspot/src/share/vm/precompiled/precompiled.hpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/precompiled/precompiled.hpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2014, 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
@@ -160,8 +160,6 @@
 # include "oops/objArrayKlass.hpp"
 # include "oops/objArrayOop.hpp"
 # include "oops/oop.hpp"
-# include "oops/oop.inline.hpp"
-# include "oops/oop.inline2.hpp"
 # include "oops/oopsHierarchy.hpp"
 # include "oops/symbol.hpp"
 # include "oops/typeArrayKlass.hpp"
--- a/hotspot/src/share/vm/prims/forte.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/prims/forte.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -29,7 +29,6 @@
 #include "memory/space.hpp"
 #include "memory/universe.inline.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
 #include "prims/forte.hpp"
 #include "runtime/javaCalls.hpp"
 #include "runtime/thread.inline.hpp"
--- a/hotspot/src/share/vm/prims/jni.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/prims/jni.cpp	Mon Feb 23 05:01: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.
  * Copyright (c) 2012 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -42,7 +42,7 @@
 #include "oops/markOop.hpp"
 #include "oops/method.hpp"
 #include "oops/objArrayKlass.hpp"
-#include "oops/objArrayOop.hpp"
+#include "oops/objArrayOop.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "oops/symbol.hpp"
 #include "oops/typeArrayKlass.hpp"
--- a/hotspot/src/share/vm/prims/jniCheck.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/prims/jniCheck.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -23,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "classfile/vmSymbols.hpp"
 #include "memory/guardedMemory.hpp"
--- a/hotspot/src/share/vm/prims/jvm.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/prims/jvm.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -25,18 +25,21 @@
 #include "precompiled.hpp"
 #include "classfile/classLoader.hpp"
 #include "classfile/javaAssertions.hpp"
-#include "classfile/javaClasses.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "classfile/stringTable.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "classfile/vmSymbols.hpp"
 #include "gc_interface/collectedHeap.inline.hpp"
 #include "interpreter/bytecode.hpp"
+#include "memory/barrierSet.inline.hpp"
 #include "memory/oopFactory.hpp"
 #include "memory/universe.inline.hpp"
 #include "oops/fieldStreams.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/objArrayKlass.hpp"
+#include "oops/objArrayOop.inline.hpp"
 #include "oops/method.hpp"
+#include "oops/oop.inline.hpp"
 #include "prims/jvm.h"
 #include "prims/jvm_misc.hpp"
 #include "prims/jvmtiExport.hpp"
--- a/hotspot/src/share/vm/prims/jvmtiEnter.xsl	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/prims/jvmtiEnter.xsl	Mon Feb 23 05:01:11 2015 -0800
@@ -1,6 +1,6 @@
 <?xml version="1.0"?> 
 <!--
- Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2002, 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
@@ -39,6 +39,7 @@
 # include "precompiled.hpp"
 # include "utilities/macros.hpp"
 #if INCLUDE_JVMTI
+# include "oops/oop.inline.hpp"
 # include "prims/jvmtiEnter.hpp"
 # include "prims/jvmtiRawMonitor.hpp"
 # include "prims/jvmtiUtil.hpp"
--- a/hotspot/src/share/vm/prims/jvmtiEnv.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/prims/jvmtiEnv.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -32,6 +32,8 @@
 #include "memory/resourceArea.hpp"
 #include "memory/universe.inline.hpp"
 #include "oops/instanceKlass.hpp"
+#include "oops/objArrayOop.inline.hpp"
+#include "oops/oop.inline.hpp"
 #include "prims/jniCheck.hpp"
 #include "prims/jvm_misc.hpp"
 #include "prims/jvmtiAgentThread.hpp"
--- a/hotspot/src/share/vm/prims/jvmtiEnvBase.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/prims/jvmtiEnvBase.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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,6 +27,7 @@
 #include "jvmtifiles/jvmtiEnv.hpp"
 #include "oops/objArrayKlass.hpp"
 #include "oops/objArrayOop.hpp"
+#include "oops/oop.inline.hpp"
 #include "prims/jvmtiEnvBase.hpp"
 #include "prims/jvmtiEventController.inline.hpp"
 #include "prims/jvmtiExtensions.hpp"
--- a/hotspot/src/share/vm/prims/jvmtiExport.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/prims/jvmtiExport.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -32,6 +32,7 @@
 #include "memory/resourceArea.hpp"
 #include "oops/objArrayKlass.hpp"
 #include "oops/objArrayOop.hpp"
+#include "oops/oop.inline.hpp"
 #include "prims/jvmtiCodeBlobEvents.hpp"
 #include "prims/jvmtiEventController.hpp"
 #include "prims/jvmtiEventController.inline.hpp"
--- a/hotspot/src/share/vm/prims/jvmtiGetLoadedClasses.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/prims/jvmtiGetLoadedClasses.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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,9 +24,11 @@
 
 #include "precompiled.hpp"
 #include "classfile/systemDictionary.hpp"
+#include "gc_interface/collectedHeap.hpp"
 #include "memory/universe.inline.hpp"
 #include "prims/jvmtiGetLoadedClasses.hpp"
 #include "runtime/thread.hpp"
+#include "utilities/stack.inline.hpp"
 
 
 // The closure for GetLoadedClasses
--- a/hotspot/src/share/vm/prims/jvmtiImpl.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/prims/jvmtiImpl.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -29,6 +29,7 @@
 #include "jvmtifiles/jvmtiEnv.hpp"
 #include "memory/resourceArea.hpp"
 #include "oops/instanceKlass.hpp"
+#include "oops/oop.inline.hpp"
 #include "prims/jvmtiAgentThread.hpp"
 #include "prims/jvmtiEventController.inline.hpp"
 #include "prims/jvmtiImpl.hpp"
--- a/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -36,6 +36,7 @@
 #include "memory/universe.inline.hpp"
 #include "oops/fieldStreams.hpp"
 #include "oops/klassVtable.hpp"
+#include "oops/oop.inline.hpp"
 #include "prims/jvmtiImpl.hpp"
 #include "prims/jvmtiRedefineClasses.hpp"
 #include "prims/methodComparator.hpp"
--- a/hotspot/src/share/vm/prims/jvmtiTagMap.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/prims/jvmtiTagMap.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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,7 +30,8 @@
 #include "jvmtifiles/jvmtiEnv.hpp"
 #include "oops/instanceMirrorKlass.hpp"
 #include "oops/objArrayKlass.hpp"
-#include "oops/oop.inline2.hpp"
+#include "oops/objArrayOop.inline.hpp"
+#include "oops/oop.inline.hpp"
 #include "prims/jvmtiEventController.hpp"
 #include "prims/jvmtiEventController.inline.hpp"
 #include "prims/jvmtiExport.hpp"
--- a/hotspot/src/share/vm/prims/methodHandles.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/prims/methodHandles.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -23,13 +23,17 @@
  */
 
 #include "precompiled.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "classfile/stringTable.hpp"
 #include "code/codeCache.hpp"
 #include "compiler/compileBroker.hpp"
 #include "interpreter/interpreter.hpp"
 #include "interpreter/oopMapCache.hpp"
+#include "interpreter/linkResolver.hpp"
 #include "memory/allocation.inline.hpp"
 #include "memory/oopFactory.hpp"
+#include "oops/objArrayOop.inline.hpp"
+#include "oops/oop.inline.hpp"
 #include "prims/methodHandles.hpp"
 #include "runtime/compilationPolicy.hpp"
 #include "runtime/javaCalls.hpp"
@@ -405,7 +409,7 @@
     return java_lang_invoke_MethodType::as_signature(type_str, intern_if_not_found, THREAD);
   } else if (java_lang_Class::is_instance(type_str)) {
     return java_lang_Class::as_signature(type_str, false, THREAD);
-  } else if (java_lang_String::is_instance(type_str)) {
+  } else if (java_lang_String::is_instance_inlined(type_str)) {
     if (intern_if_not_found) {
       return java_lang_String::as_symbol(type_str, THREAD);
     } else {
--- a/hotspot/src/share/vm/prims/unsafe.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/prims/unsafe.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -25,6 +25,8 @@
 #include "precompiled.hpp"
 #include "classfile/vmSymbols.hpp"
 #include "memory/allocation.inline.hpp"
+#include "oops/objArrayOop.inline.hpp"
+#include "oops/oop.inline.hpp"
 #include "prims/jni.h"
 #include "prims/jvm.h"
 #include "runtime/atomic.inline.hpp"
--- a/hotspot/src/share/vm/prims/wbtestmethods/parserTests.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/prims/wbtestmethods/parserTests.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -23,16 +23,14 @@
  */
 
 #include "precompiled.hpp"
-
+#include "classfile/javaClasses.inline.hpp"
 #include "classfile/symbolTable.hpp"
-
+#include "memory/oopFactory.hpp"
+#include "oops/objArrayOop.inline.hpp"
 #include "prims/jni.h"
 #include "prims/whitebox.hpp"
 #include "prims/wbtestmethods/parserTests.hpp"
 #include "runtime/interfaceSupport.hpp"
-
-#include "memory/oopFactory.hpp"
-
 #include "services/diagnosticArgument.hpp"
 #include "services/diagnosticFramework.hpp"
 
--- a/hotspot/src/share/vm/runtime/basicLock.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/runtime/basicLock.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, 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
@@ -28,6 +28,9 @@
 
 void BasicLock::print_on(outputStream* st) const {
   st->print("monitor");
+  markOop moop = displaced_header();
+  if (moop != NULL)
+    moop->print_on(st);
 }
 
 void BasicLock::move_to(oop obj, BasicLock* dest) {
--- a/hotspot/src/share/vm/runtime/biasedLocking.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/runtime/biasedLocking.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -25,6 +25,7 @@
 #include "precompiled.hpp"
 #include "oops/klass.inline.hpp"
 #include "oops/markOop.hpp"
+#include "oops/oop.inline.hpp"
 #include "runtime/atomic.inline.hpp"
 #include "runtime/basicLock.hpp"
 #include "runtime/biasedLocking.hpp"
--- a/hotspot/src/share/vm/runtime/deoptimization.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/runtime/deoptimization.cpp	Mon Feb 23 05:01: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
@@ -37,6 +37,7 @@
 #include "memory/resourceArea.hpp"
 #include "oops/method.hpp"
 #include "oops/oop.inline.hpp"
+#include "oops/verifyOopClosure.hpp"
 #include "prims/jvmtiThreadState.hpp"
 #include "runtime/biasedLocking.hpp"
 #include "runtime/compilationPolicy.hpp"
--- a/hotspot/src/share/vm/runtime/fieldDescriptor.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/runtime/fieldDescriptor.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, 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
@@ -29,6 +29,7 @@
 #include "memory/universe.inline.hpp"
 #include "oops/annotations.hpp"
 #include "oops/instanceKlass.hpp"
+#include "oops/oop.inline.hpp"
 #include "oops/fieldStreams.hpp"
 #include "runtime/fieldDescriptor.hpp"
 #include "runtime/handles.inline.hpp"
--- a/hotspot/src/share/vm/runtime/fprofiler.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/runtime/fprofiler.cpp	Mon Feb 23 05:01: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
@@ -31,7 +31,6 @@
 #include "memory/allocation.inline.hpp"
 #include "memory/universe.inline.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
 #include "oops/symbol.hpp"
 #include "runtime/deoptimization.hpp"
 #include "runtime/fprofiler.hpp"
--- a/hotspot/src/share/vm/runtime/frame.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/runtime/frame.cpp	Mon Feb 23 05:01: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
@@ -36,7 +36,7 @@
 #include "oops/methodData.hpp"
 #include "oops/method.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
+#include "oops/verifyOopClosure.hpp"
 #include "prims/methodHandles.hpp"
 #include "runtime/frame.inline.hpp"
 #include "runtime/handles.inline.hpp"
--- a/hotspot/src/share/vm/runtime/globals.hpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/runtime/globals.hpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1520,7 +1520,7 @@
           "How much the GC can expand the eden by while the GC locker "     \
           "is active (as a percentage)")                                    \
                                                                             \
-  diagnostic(intx, GCLockerRetryAllocationCount, 2,                         \
+  diagnostic(uintx, GCLockerRetryAllocationCount, 2,                        \
           "Number of times to retry allocations when "                      \
           "blocked by the GC locker")                                       \
                                                                             \
--- a/hotspot/src/share/vm/runtime/handles.hpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/runtime/handles.hpp	Mon Feb 23 05:01: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
@@ -123,10 +123,10 @@
   };
 
 
-DEF_HANDLE(instance         , is_instance         )
-DEF_HANDLE(array            , is_array            )
-DEF_HANDLE(objArray         , is_objArray         )
-DEF_HANDLE(typeArray        , is_typeArray        )
+DEF_HANDLE(instance         , is_instance_noinline         )
+DEF_HANDLE(array            , is_array_noinline            )
+DEF_HANDLE(objArray         , is_objArray_noinline         )
+DEF_HANDLE(typeArray        , is_typeArray_noinline        )
 
 //------------------------------------------------------------------------------------------------------------------------
 
--- a/hotspot/src/share/vm/runtime/reflection.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/runtime/reflection.cpp	Mon Feb 23 05:01: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
@@ -34,7 +34,8 @@
 #include "memory/universe.inline.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/objArrayKlass.hpp"
-#include "oops/objArrayOop.hpp"
+#include "oops/objArrayOop.inline.hpp"
+#include "oops/oop.inline.hpp"
 #include "prims/jvm.h"
 #include "prims/jvmtiExport.hpp"
 #include "runtime/arguments.hpp"
--- a/hotspot/src/share/vm/runtime/serviceThread.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/runtime/serviceThread.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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,9 +30,10 @@
 #include "runtime/os.hpp"
 #include "prims/jvmtiImpl.hpp"
 #include "services/allocationContextService.hpp"
-#include "services/gcNotifier.hpp"
 #include "services/diagnosticArgument.hpp"
 #include "services/diagnosticFramework.hpp"
+#include "services/gcNotifier.hpp"
+#include "services/lowMemoryDetector.hpp"
 
 ServiceThread* ServiceThread::_instance = NULL;
 
--- a/hotspot/src/share/vm/runtime/thread.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/runtime/thread.cpp	Mon Feb 23 05:01: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
@@ -42,6 +42,7 @@
 #include "oops/objArrayOop.hpp"
 #include "oops/oop.inline.hpp"
 #include "oops/symbol.hpp"
+#include "oops/verifyOopClosure.hpp"
 #include "prims/jvm_misc.hpp"
 #include "prims/jvmtiExport.hpp"
 #include "prims/jvmtiThreadState.hpp"
--- a/hotspot/src/share/vm/runtime/vframe.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/runtime/vframe.cpp	Mon Feb 23 05:01: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
@@ -189,6 +189,7 @@
       if (monitor->eliminated() && is_compiled_frame()) { // Eliminated in compiled code
         if (monitor->owner_is_scalar_replaced()) {
           Klass* k = java_lang_Class::as_Klass(monitor->owner_klass());
+          // format below for lockbits matches this one.
           st->print("\t- eliminated <owner is scalar replaced> (a %s)", k->external_name());
         } else {
           oop obj = monitor->owner();
@@ -206,9 +207,10 @@
         // see if we have completed the lock or we are blocked trying to
         // acquire it - we can only be blocked if the monitor is inflated
 
+        markOop mark = NULL;
         const char *lock_state = "locked"; // assume we have the monitor locked
         if (!found_first_monitor && frame_count == 0) {
-          markOop mark = monitor->owner()->mark();
+          mark = monitor->owner()->mark();
           if (mark->has_monitor() &&
               ( // we have marked ourself as pending on this monitor
                 mark->monitor() == thread()->current_pending_monitor() ||
@@ -216,11 +218,19 @@
                 !mark->monitor()->is_entered(thread())
               )) {
             lock_state = "waiting to lock";
+          } else {
+            mark = NULL; // Disable printing below
           }
         }
+        print_locked_object_class_name(st, monitor->owner(), lock_state);
+        if (Verbose && mark != NULL) {
+          // match with format above, replacing "-" with " ".
+          st->print("\t  lockbits=");
+          mark->print_on(st);
+          st->cr();
+        }
 
         found_first_monitor = true;
-        print_locked_object_class_name(st, monitor->owner(), lock_state);
       }
     }
   }
@@ -577,10 +587,15 @@
       tty->print("( null )");
     } else {
       monitor->owner()->print_value();
-      tty->print("(" INTPTR_FORMAT ")", (address)monitor->owner());
+      tty->print("(owner=" INTPTR_FORMAT ")", (address)monitor->owner());
     }
-    if (monitor->eliminated() && is_compiled_frame())
-      tty->print(" ( lock is eliminated )");
+    if (monitor->eliminated()) {
+      if(is_compiled_frame()) {
+        tty->print(" ( lock is eliminated in compiled frame )");
+      } else {
+        tty->print(" ( lock is eliminated, frame not compiled )");
+      }
+    }
     tty->cr();
     tty->print("\t  ");
     monitor->lock()->print_on(tty);
--- a/hotspot/src/share/vm/runtime/vframe_hp.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/runtime/vframe_hp.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, 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
@@ -23,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "code/codeCache.hpp"
 #include "code/debugInfoRec.hpp"
 #include "code/nmethod.hpp"
--- a/hotspot/src/share/vm/runtime/vmThread.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/runtime/vmThread.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -28,6 +28,7 @@
 #include "memory/resourceArea.hpp"
 #include "oops/method.hpp"
 #include "oops/oop.inline.hpp"
+#include "oops/verifyOopClosure.hpp"
 #include "runtime/interfaceSupport.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "runtime/os.hpp"
--- a/hotspot/src/share/vm/services/attachListener.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/services/attachListener.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -27,6 +27,7 @@
 #include "classfile/systemDictionary.hpp"
 #include "gc_implementation/shared/vmGCOperations.hpp"
 #include "memory/resourceArea.hpp"
+#include "oops/oop.inline.hpp"
 #include "prims/jvmtiExport.hpp"
 #include "runtime/arguments.hpp"
 #include "runtime/globals.hpp"
--- a/hotspot/src/share/vm/services/diagnosticCommand.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/services/diagnosticCommand.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -26,6 +26,7 @@
 #include "classfile/classLoaderStats.hpp"
 #include "classfile/compactHashtable.hpp"
 #include "gc_implementation/shared/vmGCOperations.hpp"
+#include "oops/oop.inline.hpp"
 #include "runtime/javaCalls.hpp"
 #include "runtime/os.hpp"
 #include "services/diagnosticArgument.hpp"
--- a/hotspot/src/share/vm/services/diagnosticFramework.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/services/diagnosticFramework.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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,6 +24,7 @@
 
 #include "precompiled.hpp"
 #include "memory/oopFactory.hpp"
+#include "oops/oop.inline.hpp"
 #include "runtime/javaCalls.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "services/diagnosticArgument.hpp"
--- a/hotspot/src/share/vm/services/heapDumper.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/services/heapDumper.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -31,6 +31,8 @@
 #include "memory/genCollectedHeap.hpp"
 #include "memory/universe.hpp"
 #include "oops/objArrayKlass.hpp"
+#include "oops/objArrayOop.inline.hpp"
+#include "oops/oop.inline.hpp"
 #include "runtime/javaCalls.hpp"
 #include "runtime/jniHandles.hpp"
 #include "runtime/os.hpp"
--- a/hotspot/src/share/vm/services/management.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/hotspot/src/share/vm/services/management.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -30,6 +30,7 @@
 #include "memory/resourceArea.hpp"
 #include "oops/klass.hpp"
 #include "oops/objArrayKlass.hpp"
+#include "oops/objArrayOop.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/arguments.hpp"
 #include "runtime/globals.hpp"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/loopopts/CountedLoopProblem.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,54 @@
+/*
+ * 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.
+ *
+ * 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.
+ *
+ */
+
+/**
+ * @test
+ * @bug 8072753
+ * @summary Inner loop induction variable increment occurs before compare which causes integer overflow
+ * @run main/othervm CountedLoopProblem
+ *
+ */
+
+import java.util.*;
+
+public class CountedLoopProblem {
+    public static void main(String[] args) throws Exception {
+        Random r = new Random(42);
+        int x = 0;
+        StringBuilder sb = new StringBuilder();
+        for(int i = 0; i < 1000000; ++i) {
+            int v = Math.abs(r.nextInt());
+            sb.append('+').append(v).append('\n');
+            x += v;
+            // To trigger the problem we must OSR in the following loop
+            // To make the problem 100% reproducible run with -XX:-TieredCompilation -XX:OSROnlyBCI=62
+            while(x < 0) x += 1000000000;
+            sb.append('=').append(x).append('\n');
+        }
+        if (sb.toString().hashCode() != 0xaba94591) {
+            throw new Exception("Unexpected result");
+        }
+    }
+}
+
--- a/jaxp/.hgtags	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxp/.hgtags	Mon Feb 23 05:01:11 2015 -0800
@@ -291,3 +291,6 @@
 74eaf7ad986576c792df4dbff05eed63e5727695 jdk9-b46
 e391de88e69b59d7c618387e3cf91032f6991ce9 jdk9-b47
 833051855168a973780fafeb6fc59e7370bcf400 jdk9-b48
+786058752e0ac3e48d7aef79e0885d29d6a2a7eb jdk9-b49
+74ead7bddde19263fd463bc1bd87de84f27d1b5e jdk9-b50
+7cb3674cbd8c06222851444285bb66b2952a2a5c jdk9-b51
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/datatype/ptests/DurationTest.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,585 @@
+/*
+ * Copyright (c) 1999, 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.
+ *
+ * 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 javax.xml.datatype.ptests;
+
+import static javax.xml.datatype.DatatypeConstants.DAYS;
+import static javax.xml.datatype.DatatypeConstants.HOURS;
+import static javax.xml.datatype.DatatypeConstants.MINUTES;
+import static javax.xml.datatype.DatatypeConstants.MONTHS;
+import static javax.xml.datatype.DatatypeConstants.SECONDS;
+import static javax.xml.datatype.DatatypeConstants.YEARS;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertTrue;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.Calendar;
+import java.util.function.Function;
+
+import javax.xml.datatype.DatatypeConfigurationException;
+import javax.xml.datatype.DatatypeConstants;
+import javax.xml.datatype.DatatypeFactory;
+import javax.xml.datatype.Duration;
+import javax.xml.namespace.QName;
+
+import jaxp.library.JAXPBaseTest;
+
+import org.testng.Assert;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
+/*
+ * @summary Class containing the test cases for Duration.
+ */
+public class DurationTest extends JAXPBaseTest {
+
+    private DatatypeFactory datatypeFactory;
+
+    /*
+     * Setup.
+     */
+    @BeforeClass
+    public void setup() throws DatatypeConfigurationException {
+        datatypeFactory = DatatypeFactory.newInstance();
+    }
+
+    @DataProvider(name = "legal-number-duration")
+    public Object[][] getLegalNumberDuration() {
+        return new Object[][] {
+                // is positive, year, month, day, hour, minute, second
+                { true, 1, 1, 1, 1, 1, 1 },
+                { false, 1, 1, 1, 1, 1, 1 },
+                { true, 1, 0, 0, 0, 0, 0 },
+                { false, 1, 0, 0, 0, 0, 0 }
+        };
+    }
+
+    /*
+     * Test for constructor Duration(boolean isPositive,int years,int months,
+     * int days,int hours,int minutes,int seconds).
+     */
+    @Test(dataProvider = "legal-number-duration")
+    public void checkNumberDurationPos(boolean isPositive, int years, int months, int days, int hours, int minutes, int seconds) {
+        datatypeFactory.newDuration(isPositive, years, months, days, hours, minutes, seconds);
+    }
+
+    @DataProvider(name = "illegal-number-duration")
+    public Object[][] getIllegalNumberDuration() {
+        return new Object[][] {
+                // is positive, year, month, day, hour, minute, second
+                { true, 1, 1, -1, 1, 1, 1 },
+                { false, 1, 1, -1, 1, 1, 1 },
+                { true, undef, undef, undef, undef, undef, undef },
+                { false, undef, undef, undef, undef, undef, undef }
+        };
+    }
+
+    /*
+     * Test for constructor Duration(boolean isPositive,int years,int months,
+     * int days,int hours,int minutes,int seconds), if any of the fields is
+     * negative should throw IllegalArgumentException.
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class, dataProvider = "illegal-number-duration")
+    public void checkDurationNumberNeg(boolean isPositive, int years, int months, int days, int hours, int minutes, int seconds) {
+        datatypeFactory.newDuration(isPositive, years, months, days, hours, minutes, seconds);
+    }
+
+    @DataProvider(name = "legal-bigint-duration")
+    public Object[][] getLegalBigIntegerDuration() {
+        return new Object[][] {
+                // is positive, year, month, day, hour, minute, second
+                { true, zero, zero, zero, zero, zero, new BigDecimal(zero) },
+                { false, zero, zero, zero, zero, zero, new BigDecimal(zero) },
+                { true, one, one, one, one, one, new BigDecimal(one) },
+                { false, one, one, one, one, one, new BigDecimal(one) },
+                { true, null, null, null, null, null, new BigDecimal(one) },
+                { false, null, null, null, null, null, new BigDecimal(one) } };
+    }
+
+    /*
+     * Test for constructor Duration(boolean isPositive,BigInteger
+     * years,BigInteger months, BigInteger days,BigInteger hours,BigInteger
+     * minutes,BigDecimal seconds).
+     */
+    @Test(dataProvider = "legal-bigint-duration")
+    public void checkBigIntegerDurationPos(boolean isPositive, BigInteger years, BigInteger months, BigInteger days, BigInteger hours, BigInteger minutes,
+            BigDecimal seconds) {
+        datatypeFactory.newDuration(isPositive, years, months, days, hours, minutes, seconds);
+    }
+
+    @DataProvider(name = "illegal-bigint-duration")
+    public Object[][] getIllegalBigIntegerDuration() {
+        return new Object[][] {
+                // is positive, year, month, day, hour, minute, second
+                { true, null, null, null, null, null, null },
+                { false, null, null, null, null, null, null }
+        };
+    }
+
+    /*
+     * Test for constructor Duration(boolean isPositive,BigInteger
+     * years,BigInteger months, BigInteger days,BigInteger hours,BigInteger
+     * minutes,BigDecimal seconds), if all the fields are null should throw
+     * IllegalArgumentException.
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class, dataProvider = "illegal-bigint-duration")
+    public void checkBigIntegerDurationNeg(boolean isPositive, BigInteger years, BigInteger months, BigInteger days, BigInteger hours, BigInteger minutes,
+            BigDecimal seconds) {
+        datatypeFactory.newDuration(isPositive, years, months, days, hours, minutes, seconds);
+    }
+
+    @DataProvider(name = "legal-millisec-duration")
+    public Object[][] getLegalMilliSecondDuration() {
+        return new Object[][] { { 1000000 }, { 0 }, { Long.MAX_VALUE }, { Long.MIN_VALUE }
+
+        };
+    }
+
+    /*
+     * Test for constructor Duration(long durationInMilliSeconds)
+     */
+    @Test(dataProvider = "legal-millisec-duration")
+    public void checkMilliSecondDuration(long millisec) {
+        datatypeFactory.newDuration(millisec);
+    }
+
+    @DataProvider(name = "legal-lexical-duration")
+    public Object[][] getLegalLexicalDuration() {
+        return new Object[][] { { "P1Y1M1DT1H1M1S" }, { "-P1Y1M1DT1H1M1S" } };
+    }
+
+    /*
+     * Test for constructor Duration(java.lang.String lexicalRepresentation)
+     */
+    @Test(dataProvider = "legal-lexical-duration")
+    public void checkLexicalDurationPos(String lexRepresentation) {
+        datatypeFactory.newDuration(lexRepresentation);
+    }
+
+    @DataProvider(name = "illegal-lexical-duration")
+    public Object[][] getIllegalLexicalDuration() {
+        return new Object[][] {
+                { null },
+                { "P1Y1M1DT1H1M1S " },
+                { " P1Y1M1DT1H1M1S" },
+                { "X1Y1M1DT1H1M1S" },
+                { "" },
+                { "P1Y2MT" } // The designator 'T' shall be absent if all of the time items are absent in "PnYnMnDTnHnMnS"
+        };
+    }
+
+    /*
+     * Test for constructor Duration(java.lang.String lexicalRepresentation),
+     * null should throw NullPointerException, invalid lex should throw
+     * IllegalArgumentException
+     */
+    @Test(expectedExceptions = { NullPointerException.class, IllegalArgumentException.class }, dataProvider = "illegal-lexical-duration")
+    public void checkLexicalDurationNeg(String lexRepresentation) {
+        datatypeFactory.newDuration(lexRepresentation);
+    }
+
+    @DataProvider(name = "equal-duration")
+    public Object[][] getEqualDurations() {
+        return new Object[][] { { "P1Y1M1DT1H1M1S", "P1Y1M1DT1H1M1S" } };
+    }
+
+    /*
+     * Test for compare() both durations valid and equal.
+     */
+    @Test(dataProvider = "equal-duration")
+    public void checkDurationEqual(String lexRepresentation1, String lexRepresentation2) {
+        Duration duration1 = datatypeFactory.newDuration(lexRepresentation1);
+        Duration duration2 = datatypeFactory.newDuration(lexRepresentation2);
+        assertTrue(duration1.equals(duration2));
+    }
+
+    @DataProvider(name = "greater-duration")
+    public Object[][] getGreaterDuration() {
+        return new Object[][] {
+                { "P1Y1M1DT1H1M2S", "P1Y1M1DT1H1M1S" },
+                { "P1Y1M1DT1H1M1S", "-P1Y1M1DT1H1M2S" },
+                { "P1Y1M1DT1H1M2S", "-P1Y1M1DT1H1M1S" },
+                { "-P1Y1M1DT1H1M1S", "-P1Y1M1DT1H1M2S" }, };
+    }
+
+    /*
+     * Test for compare() both durations valid and lhs > rhs.
+     */
+    @Test(dataProvider = "greater-duration")
+    public void checkDurationCompare(String lexRepresentation1, String lexRepresentation2) {
+        Duration duration1 = datatypeFactory.newDuration(lexRepresentation1);
+        Duration duration2 = datatypeFactory.newDuration(lexRepresentation2);
+        assertTrue(duration1.compare(duration2) == DatatypeConstants.GREATER);
+    }
+
+    @DataProvider(name = "not-equal-duration")
+    public Object[][] getNotEqualDurations() {
+        return new Object[][] {
+                { "P1Y1M1DT1H1M1S", "-P1Y1M1DT1H1M1S" },
+                { "P2Y1M1DT1H1M1S", "P1Y1M1DT1H1M1S" } };
+    }
+
+    /*
+     * Test for equals() both durations valid and lhs not equals rhs.
+     */
+    @Test(dataProvider = "not-equal-duration")
+    public void checkDurationNotEqual(String lexRepresentation1, String lexRepresentation2) {
+        Duration duration1 = datatypeFactory.newDuration(lexRepresentation1);
+        Duration duration2 = datatypeFactory.newDuration(lexRepresentation2);
+        Assert.assertNotEquals(duration1, duration2);
+    }
+
+    @DataProvider(name = "duration-sign")
+    public Object[][] getDurationAndSign() {
+        return new Object[][] {
+                { "P0Y0M0DT0H0M0S", 0 },
+                { "P1Y0M0DT0H0M0S", 1 },
+                { "-P1Y0M0DT0H0M0S", -1 } };
+    }
+
+    /*
+     * Test for Duration.getSign().
+     */
+    @Test(dataProvider = "duration-sign")
+    public void checkDurationSign(String lexRepresentation, int sign) {
+        Duration duration = datatypeFactory.newDuration(lexRepresentation);
+        assertEquals(duration.getSign(), sign);
+    }
+
+    /*
+     * Test for Duration.negate().
+     */
+    @Test
+    public void checkDurationNegate() {
+        Duration durationPos = datatypeFactory.newDuration("P1Y0M0DT0H0M0S");
+        Duration durationNeg = datatypeFactory.newDuration("-P1Y0M0DT0H0M0S");
+
+        assertEquals(durationPos.negate(), durationNeg);
+        assertEquals(durationNeg.negate(), durationPos);
+        assertEquals(durationPos.negate().negate(), durationPos);
+
+    }
+
+    /*
+     * Test for Duration.isShorterThan(Duration) and
+     * Duration.isLongerThan(Duration).
+     */
+    @Test
+    public void checkDurationShorterLonger() {
+        Duration shorter = datatypeFactory.newDuration("P1Y1M1DT1H1M1S");
+        Duration longer = datatypeFactory.newDuration("P2Y1M1DT1H1M1S");
+
+        assertTrue(shorter.isShorterThan(longer));
+        assertFalse(longer.isShorterThan(shorter));
+        assertFalse(shorter.isShorterThan(shorter));
+
+        assertTrue(longer.isLongerThan(shorter));
+        assertFalse(shorter.isLongerThan(longer));
+        assertFalse(shorter.isLongerThan(shorter));
+    }
+
+    /*
+     * Test for Duration.isSet().
+     */
+    @Test
+    public void checkDurationIsSet() {
+        Duration duration1 = datatypeFactory.newDuration(true, 1, 1, 1, 1, 1, 1);
+        Duration duration2 = datatypeFactory.newDuration(true, 0, 0, 0, 0, 0, 0);
+
+        assertTrue(duration1.isSet(YEARS));
+        assertTrue(duration1.isSet(MONTHS));
+        assertTrue(duration1.isSet(DAYS));
+        assertTrue(duration1.isSet(HOURS));
+        assertTrue(duration1.isSet(MINUTES));
+        assertTrue(duration1.isSet(SECONDS));
+
+        assertTrue(duration2.isSet(YEARS));
+        assertTrue(duration2.isSet(MONTHS));
+        assertTrue(duration2.isSet(DAYS));
+        assertTrue(duration2.isSet(HOURS));
+        assertTrue(duration2.isSet(MINUTES));
+        assertTrue(duration2.isSet(SECONDS));
+
+        Duration duration66 = datatypeFactory.newDuration(true, null, null, zero, null, null, null);
+        assertFalse(duration66.isSet(YEARS));
+        assertFalse(duration66.isSet(MONTHS));
+        assertFalse(duration66.isSet(HOURS));
+        assertFalse(duration66.isSet(MINUTES));
+        assertFalse(duration66.isSet(SECONDS));
+
+        Duration duration3 = datatypeFactory.newDuration("P1D");
+        assertFalse(duration3.isSet(YEARS));
+        assertFalse(duration3.isSet(MONTHS));
+        assertFalse(duration3.isSet(HOURS));
+        assertFalse(duration3.isSet(MINUTES));
+        assertFalse(duration3.isSet(SECONDS));
+    }
+
+    /*
+     * Test Duration.isSet(Field) throws NPE if the field parameter is null.
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void checkDurationIsSetNeg() {
+        Duration duration = datatypeFactory.newDuration(true, 0, 0, 0, 0, 0, 0);
+        duration.isSet(null);
+    }
+
+    /*
+     * Test for -getField(DatatypeConstants.Field) DatatypeConstants.Field is
+     * null - throws NPE.
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void checkDurationGetFieldNeg() {
+        Duration duration67 = datatypeFactory.newDuration("P1Y1M1DT1H1M1S");
+        duration67.getField(null);
+    }
+
+    @DataProvider(name = "duration-fields")
+    public Object[][] getDurationAndFields() {
+        return new Object[][] {
+                { "P1Y1M1DT1H1M1S", one, one, one, one, one, new BigDecimal(one) },
+                { "PT1M", null, null, null, null, one, null },
+                { "P1M", null, one, null, null, null, null } };
+    }
+
+    /*
+     * Test for Duration.getField(DatatypeConstants.Field).
+     */
+    @Test(dataProvider = "duration-fields")
+    public void checkDurationGetField(String lexRepresentation, BigInteger years, BigInteger months, BigInteger days, BigInteger hours, BigInteger minutes,
+            BigDecimal seconds) {
+        Duration duration = datatypeFactory.newDuration(lexRepresentation);
+
+        assertEquals(duration.getField(YEARS), years);
+        assertEquals(duration.getField(MONTHS), months);
+        assertEquals(duration.getField(DAYS), days);
+        assertEquals(duration.getField(HOURS), hours);
+        assertEquals(duration.getField(MINUTES), minutes);
+        assertEquals(duration.getField(SECONDS), seconds);
+    }
+
+    @DataProvider(name = "number-string")
+    public Object[][] getNumberAndString() {
+        return new Object[][] {
+                // is positive, year, month, day, hour, minute, second, lexical
+                { true, 1, 1, 1, 1, 1, 1, "P1Y1M1DT1H1M1S" },
+                { false, 1, 1, 1, 1, 1, 1, "-P1Y1M1DT1H1M1S" },
+                { true, 0, 0, 0, 0, 0, 0, "P0Y0M0DT0H0M0S" },
+                { false, 0, 0, 0, 0, 0, 0, "P0Y0M0DT0H0M0S" }
+        };
+    }
+
+    /*
+     * Test for - toString().
+     */
+    @Test(dataProvider = "number-string")
+    public void checkDurationToString(boolean isPositive, int years, int months, int days, int hours, int minutes, int seconds, String lexical) {
+        Duration duration = datatypeFactory.newDuration(isPositive,  years,  months,  days,  hours,  minutes,  seconds);
+        assertEquals(duration.toString(), lexical);
+
+        assertEquals(datatypeFactory.newDuration(duration.toString()), duration);
+    }
+
+    @DataProvider(name = "duration-field")
+    public Object[][] getDurationAndField() {
+        Function<Duration, Integer> getyears = duration -> duration.getYears();
+        Function<Duration, Integer> getmonths = duration -> duration.getMonths();
+        Function<Duration, Integer> getdays = duration -> duration.getDays();
+        Function<Duration, Integer> gethours = duration -> duration.getHours();
+        Function<Duration, Integer> getminutes = duration -> duration.getMinutes();
+        Function<Duration, Integer> getseconds = duration -> duration.getSeconds();
+        return new Object[][] {
+                { "P1Y1M1DT1H1M1S", getyears, 1 },
+                { "P1M1DT1H1M1S", getyears, 0 },
+                { "P1Y1M1DT1H1M1S", getmonths, 1 },
+                { "P1Y1DT1H1M1S", getmonths, 0 },
+                { "P1Y1M1DT1H1M1S", getdays, 1 },
+                { "P1Y1MT1H1M1S", getdays, 0 },
+                { "P1Y1M1DT1H1M1S", gethours, 1 },
+                { "P1Y1M1DT1M1S", gethours, 0 },
+                { "P1Y1M1DT1H1M1S", getminutes, 1 },
+                { "P1Y1M1DT1H1S", getminutes, 0 },
+                { "P1Y1M1DT1H1M1S", getseconds, 1 },
+                { "P1Y1M1DT1H1M", getseconds, 0 },
+                { "P1Y1M1DT1H1M100000000S", getseconds, 100000000 }, };
+    }
+
+    /*
+     * Test for Duration.getYears(), getMonths(), etc.
+     */
+    @Test(dataProvider = "duration-field")
+    public void checkDurationGetOneField(String lexRepresentation, Function<Duration, Integer> getter, int value) {
+        Duration duration = datatypeFactory.newDuration(lexRepresentation);
+        assertEquals(getter.apply(duration).intValue(), value);
+    }
+
+    /*
+     * Test for - getField(SECONDS)
+     */
+    @Test
+    public void checkDurationGetSecondsField() {
+        Duration duration85 = datatypeFactory.newDuration("P1Y1M1DT1H1M100000000S");
+        assertEquals((duration85.getField(SECONDS)).intValue(), 100000000);
+    }
+
+    /*
+     * getTimeInMillis(java.util.Calendar startInstant) returns milliseconds
+     * between startInstant and startInstant plus this Duration.
+     */
+    @Test
+    public void checkDurationGetTimeInMillis() {
+        Duration duration86 = datatypeFactory.newDuration("PT1M1S");
+        Calendar calendar86 = Calendar.getInstance();
+        assertEquals(duration86.getTimeInMillis(calendar86), 61000);
+    }
+
+    /*
+     * getTimeInMillis(java.util.Calendar startInstant) returns milliseconds
+     * between startInstant and startInstant plus this Duration throws NPE if
+     * startInstant parameter is null.
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void checkDurationGetTimeInMillisNeg() {
+        Duration duration87 = datatypeFactory.newDuration("PT1M1S");
+        Calendar calendar87 = null;
+        duration87.getTimeInMillis(calendar87);
+    }
+
+    @DataProvider(name = "duration-for-hash")
+    public Object[][] getDurationsForHash() {
+        return new Object[][] {
+                { "P1Y1M1DT1H1M1S", "P1Y1M1DT1H1M1S" },
+                { "P1D", "PT24H" },
+                { "PT1H", "PT60M" },
+                { "PT1M", "PT60S" },
+                { "P1Y", "P12M" } };
+    }
+
+    /*
+     * Test for Duration.hashcode(). hashcode() should return same value for
+     * some equal durations.
+     */
+    @Test(dataProvider = "duration-for-hash")
+    public void checkDurationHashCode(String lexRepresentation1, String lexRepresentation2) {
+        Duration duration1 = datatypeFactory.newDuration(lexRepresentation1);
+        Duration duration2 = datatypeFactory.newDuration(lexRepresentation2);
+        int hash1 = duration1.hashCode();
+        int hash2 = duration2.hashCode();
+        assertTrue(hash1 == hash2, " generated hash1 : " + hash1 + " generated hash2 : " + hash2);
+    }
+
+    @DataProvider(name = "duration-for-add")
+    public Object[][] getDurationsForAdd() {
+        return new Object[][] {
+                // initVal, addVal, resultVal
+                { "P1Y1M1DT1H1M1S", "P1Y1M1DT1H1M1S", "P2Y2M2DT2H2M2S" },
+                { "P1Y1M1DT1H1M1S", "-P1Y1M1DT1H1M1S", "P0Y0M0DT0H0M0S" },
+                { "-P1Y1M1DT1H1M1S", "-P1Y1M1DT1H1M1S", "-P2Y2M2DT2H2M2S" }, };
+    }
+
+    /*
+     * Test for add(Duration rhs).
+     */
+    @Test(dataProvider = "duration-for-add")
+    public void checkDurationAdd(String initVal, String addVal, String result) {
+        Duration durationInit = datatypeFactory.newDuration(initVal);
+        Duration durationAdd = datatypeFactory.newDuration(addVal);
+        Duration durationResult = datatypeFactory.newDuration(result);
+
+        assertEquals(durationInit.add(durationAdd), durationResult);
+    }
+
+    @DataProvider(name = "duration-for-addneg")
+    public Object[][] getDurationsForAddNeg() {
+        return new Object[][] {
+                // initVal, addVal
+                { "P1Y1M1DT1H1M1S", null },
+                { "P1Y", "-P1D" },
+                { "-P1Y", "P1D" }, };
+    }
+
+    /*
+     * Test for add(Duration rhs) 'rhs' is null , should throw NPE. "1 year" +
+     * "-1 day" or "-1 year" + "1 day" should throw IllegalStateException
+     */
+    @Test(expectedExceptions = { NullPointerException.class, IllegalStateException.class }, dataProvider = "duration-for-addneg")
+    public void checkDurationAddNeg(String initVal, String addVal) {
+        Duration durationInit = datatypeFactory.newDuration(initVal);
+        Duration durationAdd = addVal == null ? null : datatypeFactory.newDuration(addVal);
+
+        durationInit.add(durationAdd);
+    }
+
+    /*
+     * Test Duration#compare(Duration duration) with large durations.
+     *
+     * Bug # 4972785 UnsupportedOperationException is expected
+     *
+     */
+    @Test(expectedExceptions = UnsupportedOperationException.class)
+    public void checkDurationCompareLarge() {
+        String duration1Lex = "P100000000000000000000D";
+        String duration2Lex = "PT2400000000000000000000H";
+
+        Duration duration1 = datatypeFactory.newDuration(duration1Lex);
+        Duration duration2 = datatypeFactory.newDuration(duration2Lex);
+        duration1.compare(duration2);
+
+    }
+
+    /*
+     * Test Duration#getXMLSchemaType().
+     *
+     * Bug # 5049544 Duration.getXMLSchemaType shall return the correct result
+     *
+     */
+    @Test
+    public void checkDurationGetXMLSchemaType() {
+        // DURATION
+        Duration duration = datatypeFactory.newDuration("P1Y1M1DT1H1M1S");
+        QName duration_xmlSchemaType = duration.getXMLSchemaType();
+        assertEquals(duration_xmlSchemaType, DatatypeConstants.DURATION, "Expected DatatypeConstants.DURATION, returned " + duration_xmlSchemaType.toString());
+
+        // DURATION_DAYTIME
+        Duration duration_dayTime = datatypeFactory.newDuration("P1DT1H1M1S");
+        QName duration_dayTime_xmlSchemaType = duration_dayTime.getXMLSchemaType();
+        assertEquals(duration_dayTime_xmlSchemaType, DatatypeConstants.DURATION_DAYTIME, "Expected DatatypeConstants.DURATION_DAYTIME, returned "
+                + duration_dayTime_xmlSchemaType.toString());
+
+        // DURATION_YEARMONTH
+        Duration duration_yearMonth = datatypeFactory.newDuration("P1Y1M");
+        QName duration_yearMonth_xmlSchemaType = duration_yearMonth.getXMLSchemaType();
+        assertEquals(duration_yearMonth_xmlSchemaType, DatatypeConstants.DURATION_YEARMONTH, "Expected DatatypeConstants.DURATION_YEARMONTH, returned "
+                + duration_yearMonth_xmlSchemaType.toString());
+
+    }
+
+
+    private final int undef = DatatypeConstants.FIELD_UNDEFINED;
+    private final BigInteger zero = BigInteger.ZERO;
+    private final BigInteger one = BigInteger.ONE;
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/datatype/ptests/FactoryNewInstanceTest.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 1999, 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.
+ *
+ * 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 javax.xml.datatype.ptests;
+
+import static org.testng.Assert.assertNotNull;
+
+import javax.xml.datatype.DatatypeConfigurationException;
+import javax.xml.datatype.DatatypeFactory;
+import javax.xml.datatype.Duration;
+
+import jaxp.library.JAXPDataProvider;
+import jaxp.library.JAXPBaseTest;
+
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
+/*
+ * @summary Tests for DatatypeFactory.newInstance(factoryClassName , classLoader)
+ */
+public class FactoryNewInstanceTest extends JAXPBaseTest {
+
+    private static final String DATATYPE_FACTORY_CLASSNAME = "com.sun.org.apache.xerces.internal.jaxp.datatype.DatatypeFactoryImpl";
+
+    @DataProvider(name = "parameters")
+    public Object[][] getValidateParameters() {
+        return new Object[][] { { DATATYPE_FACTORY_CLASSNAME, null }, { DATATYPE_FACTORY_CLASSNAME, this.getClass().getClassLoader() } };
+    }
+
+    /*
+     * test for DatatypeFactory.newInstance(java.lang.String factoryClassName,
+     * java.lang.ClassLoader classLoader) factoryClassName points to correct
+     * implementation of javax.xml.datatype.DatatypeFactory , should return
+     * newInstance of DatatypeFactory
+     */
+    @Test(dataProvider = "parameters")
+    public void testNewInstance(String factoryClassName, ClassLoader classLoader) throws DatatypeConfigurationException {
+        DatatypeFactory dtf = DatatypeFactory.newInstance(DATATYPE_FACTORY_CLASSNAME, null);
+        Duration duration = dtf.newDuration(true, 1, 1, 1, 1, 1, 1);
+        assertNotNull(duration);
+    }
+
+
+    /*
+     * test for DatatypeFactory.newInstance(java.lang.String factoryClassName,
+     * java.lang.ClassLoader classLoader) factoryClassName is null , should
+     * throw DatatypeConfigurationException
+     */
+    @Test(expectedExceptions = DatatypeConfigurationException.class, dataProvider = "new-instance-neg", dataProviderClass = JAXPDataProvider.class)
+    public void testNewInstanceNeg(String factoryClassName, ClassLoader classLoader) throws DatatypeConfigurationException {
+        DatatypeFactory.newInstance(factoryClassName, classLoader);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/datatype/ptests/XMLGregorianCalendarTest.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,356 @@
+/*
+ * Copyright (c) 1999, 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.
+ *
+ * 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 javax.xml.datatype.ptests;
+
+import static java.util.Calendar.HOUR;
+import static java.util.Calendar.MINUTE;
+import static java.util.Calendar.YEAR;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertTrue;
+
+import java.util.GregorianCalendar;
+import java.util.Locale;
+import java.util.TimeZone;
+
+import javax.xml.datatype.DatatypeConfigurationException;
+import javax.xml.datatype.DatatypeConstants;
+import javax.xml.datatype.DatatypeFactory;
+import javax.xml.datatype.Duration;
+import javax.xml.datatype.XMLGregorianCalendar;
+
+import jaxp.library.JAXPBaseTest;
+
+import org.testng.Assert;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 5049592 5041845 5048932 5064587 5040542 5049531 5049528
+ * @summary Class containing the test cases for XMLGregorianCalendar
+ */
+public class XMLGregorianCalendarTest extends JAXPBaseTest {
+
+    private DatatypeFactory datatypeFactory;
+
+    @BeforeClass
+    public void setup() throws DatatypeConfigurationException {
+        datatypeFactory = DatatypeFactory.newInstance();
+    }
+
+    @DataProvider(name = "valid-milliseconds")
+    public Object[][] getValidMilliSeconds() {
+        return new Object[][] { { 0 }, { 1 }, { 2 }, { 16 }, { 1000 }   };
+    }
+
+    /*
+     * Test DatatypeFactory.newXMLGregorianCalendar(..) with milliseconds > 1.
+     *
+     * Bug # 5049592
+     *
+     */
+    @Test(dataProvider = "valid-milliseconds")
+    public void checkNewCalendar(int ms) {
+        // valid milliseconds
+        XMLGregorianCalendar calendar = datatypeFactory.newXMLGregorianCalendar(2004, // year
+                6, // month
+                2, // day
+                19, // hour
+                20, // minute
+                59, // second
+                ms, // milliseconds
+                840 // timezone
+                );
+        // expected success
+
+        assertEquals(calendar.getMillisecond(), ms);
+    }
+
+    /*
+     * Test DatatypeFactory.newXMLGregorianCalendarTime(..).
+     *
+     * Bug # 5049592
+     */
+    @Test(dataProvider = "valid-milliseconds")
+    public void checkNewTime(int ms) {
+        // valid milliseconds
+        XMLGregorianCalendar calendar2 = datatypeFactory.newXMLGregorianCalendarTime(19, // hour
+                20, // minute
+                59, // second
+                ms, // milliseconds
+                840 // timezone
+                );
+        // expected success
+
+        assertEquals(calendar2.getMillisecond(), ms);
+    }
+
+    @DataProvider(name = "invalid-milliseconds")
+    public Object[][] getInvalidMilliSeconds() {
+        return new Object[][] { { -1 }, { 1001 } };
+    }
+
+    /*
+     * Test DatatypeFactory.newXMLGregorianCalendar(..).
+     *
+     * Bug # 5049592 IllegalArgumentException is thrown if milliseconds < 0 or >
+     * 1001.
+     *
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class, dataProvider = "invalid-milliseconds")
+    public void checkNewCalendarNeg(int milliseconds) {
+        // invalid milliseconds
+        datatypeFactory.newXMLGregorianCalendar(2004, // year
+                6, // month
+                2, // day
+                19, // hour
+                20, // minute
+                59, // second
+                milliseconds, // milliseconds
+                840 // timezone
+                );
+    }
+
+    /*
+     * Test DatatypeFactory.newXMLGregorianCalendarTime(..).
+     *
+     * Bug # 5049592 IllegalArgumentException is thrown if milliseconds < 0 or >
+     * 1001.
+     *
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class, dataProvider = "invalid-milliseconds")
+    public void checkNewTimeNeg(int milliseconds) {
+        // invalid milliseconds
+        datatypeFactory.newXMLGregorianCalendarTime(19, // hour
+                20, // minute
+                59, // second
+                milliseconds, // milliseconds
+                840 // timezone
+                );
+    }
+
+    @DataProvider(name = "data-for-add")
+    public Object[][] getDataForAdd() {
+        return new Object[][] {
+                //calendar1, calendar2, duration
+                { "1999-12-31T00:00:00Z", "2000-01-01T00:00:00Z", "P1D" },
+                { "2000-12-31T00:00:00Z", "2001-01-01T00:00:00Z", "P1D" },
+                { "1998-12-31T00:00:00Z", "1999-01-01T00:00:00Z", "P1D" },
+                { "2001-12-31T00:00:00Z", "2002-01-01T00:00:00Z", "P1D" },
+                { "2003-04-11T00:00:00Z", "2003-04-12T00:00:00Z", "P1D" },
+                { "2003-04-11T00:00:00Z", "2003-04-14T00:00:00Z", "P3D" },
+                { "2003-04-30T00:00:00Z", "2003-05-01T00:00:00Z", "P1D" },
+                { "2003-02-28T00:00:00Z", "2003-03-01T00:00:00Z", "P1D" },
+                { "2000-02-29T00:00:00Z", "2000-03-01T00:00:00Z", "P1D" },
+                { "2000-02-28T00:00:00Z", "2000-02-29T00:00:00Z", "P1D" },
+                { "1998-01-11T00:00:00Z", "1998-04-11T00:00:00Z", "P90D" },
+                { "1999-05-11T00:00:00Z", "2002-05-11T00:00:00Z", "P1096D" }};
+    }
+
+    /*
+     * Test XMLGregorianCalendar.add(Duration).
+     *
+     */
+    @Test(dataProvider = "data-for-add")
+    public void checkAddDays(String cal1, String cal2, String dur) {
+
+        XMLGregorianCalendar calendar1 = datatypeFactory.newXMLGregorianCalendar(cal1);
+        XMLGregorianCalendar calendar2 = datatypeFactory.newXMLGregorianCalendar(cal2);
+
+        Duration duration = datatypeFactory.newDuration(dur);
+
+        XMLGregorianCalendar calendar1Clone = (XMLGregorianCalendar)calendar1.clone();
+
+        calendar1Clone.add(duration);
+        assertEquals(calendar1Clone, calendar2);
+
+        calendar2.add(duration.negate());
+        assertEquals(calendar2, calendar1);
+
+    }
+
+    @DataProvider(name = "gMonth")
+    public Object[][] getGMonth() {
+        return new Object[][] {
+                { "2000-02" },
+                { "2000-03" },
+                { "2018-02" }};
+    }
+    /*
+     * Test XMLGregorianCalendar#isValid(). for gMonth
+     *
+     * Bug # 5041845
+     *
+     */
+    @Test(dataProvider = "gMonth")
+    public void checkIsValid(String month) {
+
+        XMLGregorianCalendar gMonth = datatypeFactory.newXMLGregorianCalendar(month);
+        gMonth.setYear(null);
+        Assert.assertTrue(gMonth.isValid(), gMonth.toString() + " should isValid");
+
+    }
+
+    @DataProvider(name = "lexical01")
+    public Object[][] getLexicalRepresentForNormalize01() {
+        return new Object[][] { { "2000-01-16T12:00:00Z" }, { "2000-01-16T12:00:00" } };
+    }
+
+    /*
+     * Test XMLGregorianCalendar#normalize(...).
+     *
+     * Bug # 5048932 XMLGregorianCalendar.normalize works
+     *
+     */
+    @Test(dataProvider = "lexical01")
+    public void checkNormalize01(String lexical) {
+        XMLGregorianCalendar lhs = datatypeFactory.newXMLGregorianCalendar(lexical);
+        lhs.normalize();
+    }
+
+    @DataProvider(name = "lexical02")
+    public Object[][] getLexicalRepresentForNormalize02() {
+        return new Object[][] { { "2000-01-16T00:00:00.01Z" }, { "2000-01-16T00:00:00.01" }, { "13:20:00" } };
+    }
+
+    /*
+     * Test XMLGregorianCalendar#normalize(...).
+     *
+     * Bug # 5064587 XMLGregorianCalendar.normalize shall not change timezone
+     *
+     */
+    @Test(dataProvider = "lexical02")
+    public void checkNormalize02(String lexical) {
+        XMLGregorianCalendar orig = datatypeFactory.newXMLGregorianCalendar(lexical);
+        XMLGregorianCalendar normalized = datatypeFactory.newXMLGregorianCalendar(lexical).normalize();
+
+        assertEquals(normalized.getTimezone(), orig.getTimezone());
+        assertEquals(normalized.getMillisecond(), orig.getMillisecond());
+    }
+
+    /*
+     * Test XMLGregorianCalendar#toGregorianCalendar( TimeZone timezone, Locale
+     * aLocale, XMLGregorianCalendar defaults)
+     *
+     * Bug # 5040542 the defaults XMLGregorianCalendar parameter shall take
+     * effect
+     *
+     */
+    @Test
+    public void checkToGregorianCalendar01() {
+
+        XMLGregorianCalendar time_16_17_18 = datatypeFactory.newXMLGregorianCalendar("16:17:18");
+        XMLGregorianCalendar date_2001_02_03 = datatypeFactory.newXMLGregorianCalendar("2001-02-03");
+        GregorianCalendar calendar = date_2001_02_03.toGregorianCalendar(null, null, time_16_17_18);
+
+        int year = calendar.get(YEAR);
+        int minute = calendar.get(MINUTE);
+
+        assertTrue((year == 2001 && minute == 17), " expecting year == 2001, minute == 17" + ", result is year == " + year + ", minute == " + minute);
+
+
+        calendar = time_16_17_18.toGregorianCalendar(null, null, date_2001_02_03);
+
+        year = calendar.get(YEAR);
+        minute = calendar.get(MINUTE);
+
+        assertTrue((year == 2001 && minute == 17), " expecting year == 2001, minute == 17" + ", result is year == " + year + ", minute == " + minute);
+
+
+        date_2001_02_03.setMinute(3);
+        date_2001_02_03.setYear(null);
+
+        XMLGregorianCalendar date_time = datatypeFactory.newXMLGregorianCalendar("2003-04-11T02:13:01Z");
+
+        calendar = date_2001_02_03.toGregorianCalendar(null, null, date_time);
+
+        year = calendar.get(YEAR);
+        minute = calendar.get(MINUTE);
+        int hour = calendar.get(HOUR);
+
+        assertTrue((year == 2003 && hour == 2 && minute == 3), " expecting year == 2003, hour == 2, minute == 3" + ", result is year == " + year + ", hour == " + hour + ", minute == " + minute);
+
+
+    }
+
+    /*
+     * Test XMLGregorianCalendar#toGregorianCalendar( TimeZone timezone, Locale
+     * aLocale, XMLGregorianCalendar defaults) with the 'defaults' parameter
+     * being null.
+     *
+     * Bug # 5049531 XMLGregorianCalendar.toGregorianCalendar(..) can accept
+     * 'defaults' is null
+     *
+     */
+    @Test
+    public void checkToGregorianCalendar02() {
+
+        XMLGregorianCalendar calendar = datatypeFactory.newXMLGregorianCalendar("2004-05-19T12:00:00+06:00");
+        calendar.toGregorianCalendar(TimeZone.getDefault(), Locale.getDefault(), null);
+    }
+
+    @DataProvider(name = "calendar")
+    public Object[][] getXMLGregorianCalendarData() {
+        return new Object[][] {
+                // year, month, day, hour, minute, second
+                { 1970, 1, 1, 0, 0, 0 }, // DATETIME
+                { 1970, 1, 1, undef, undef, undef }, // DATE
+                { undef, undef, undef, 1, 0, 0 }, // TIME
+                { 1970, 1, undef, undef, undef, undef }, // GYEARMONTH
+                { undef, 1, 1, undef, undef, undef }, // GMONTHDAY
+                { 1970, undef, undef, undef, undef, undef }, // GYEAR
+                { undef, 1, undef, undef, undef, undef }, // GMONTH
+                { undef, undef, 1, undef, undef, undef } // GDAY
+        };
+    }
+
+    /*
+     * Test XMLGregorianCalendar#toString()
+     *
+     * Bug # 5049528
+     *
+     */
+    @Test(dataProvider = "calendar")
+    public void checkToStringPos(final int year, final int month, final int day, final int hour, final int minute, final int second) {
+        XMLGregorianCalendar calendar = datatypeFactory.newXMLGregorianCalendar(year, month, day, hour, minute, second, undef, undef);
+        calendar.toString();
+    }
+
+    /*
+     * Negative Test XMLGregorianCalendar#toString()
+     *
+     * Bug # 5049528 XMLGregorianCalendar.toString throws IllegalStateException
+     * if all parameters are undef
+     *
+     */
+    @Test(expectedExceptions = IllegalStateException.class)
+    public void checkToStringNeg() {
+        XMLGregorianCalendar calendar = datatypeFactory.newXMLGregorianCalendar(undef, undef, undef, undef, undef, undef, undef, undef);
+        // expected to fail
+        calendar.toString();
+    }
+
+    private final int undef = DatatypeConstants.FIELD_UNDEFINED;
+
+}
--- a/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/DocumentBuilderFactoryTest.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/DocumentBuilderFactoryTest.java	Mon Feb 23 05:01:11 2015 -0800
@@ -26,27 +26,38 @@
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertNotNull;
 import static org.testng.Assert.assertNull;
+
 import java.io.BufferedReader;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FilePermission;
 import java.io.FileReader;
+
 import static javax.xml.XMLConstants.W3C_XML_SCHEMA_NS_URI;
+
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.FactoryConfigurationError;
+import javax.xml.parsers.ParserConfigurationException;
 import javax.xml.parsers.SAXParser;
 import javax.xml.parsers.SAXParserFactory;
+
 import static javax.xml.parsers.ptests.ParserTestConst.GOLDEN_DIR;
 import static javax.xml.parsers.ptests.ParserTestConst.XML_DIR;
+
 import javax.xml.transform.Transformer;
 import javax.xml.transform.TransformerFactory;
 import javax.xml.transform.dom.DOMSource;
 import javax.xml.transform.sax.SAXResult;
+
+import jaxp.library.JAXPDataProvider;
 import jaxp.library.JAXPFileBaseTest;
 import static jaxp.library.JAXPTestUtilities.USER_DIR;
 import static jaxp.library.JAXPTestUtilities.compareWithGold;
 import static org.testng.Assert.assertFalse;
 import static org.testng.Assert.assertTrue;
+
+import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
@@ -60,6 +71,52 @@
  */
 public class DocumentBuilderFactoryTest extends JAXPFileBaseTest {
     /**
+     * DocumentBuilderFactory implementation class name.
+     */
+    private static final String DOCUMENT_BUILDER_FACTORY_CLASSNAME = "com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl";
+
+    /**
+     * Provide valid DocumentBuilderFactory instantiation parameters.
+     *
+     * @return a data provider contains DocumentBuilderFactory instantiation parameters.
+     */
+    @DataProvider(name = "parameters")
+    public Object[][] getValidateParameters() {
+        return new Object[][] { { DOCUMENT_BUILDER_FACTORY_CLASSNAME, null }, { DOCUMENT_BUILDER_FACTORY_CLASSNAME, this.getClass().getClassLoader() } };
+    }
+
+    /**
+     * Test for DocumentBuilderFactory.newInstance(java.lang.String
+     * factoryClassName, java.lang.ClassLoader classLoader) factoryClassName
+     * points to correct implementation of
+     * javax.xml.parsers.DocumentBuilderFactory , should return newInstance of
+     * DocumentBuilderFactory
+     *
+     * @param factoryClassName
+     * @param classLoader
+     * @throws ParserConfigurationException
+     */
+    @Test(dataProvider = "parameters")
+    public void testNewInstance(String factoryClassName, ClassLoader classLoader) throws ParserConfigurationException {
+        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(factoryClassName, classLoader);
+        DocumentBuilder builder = dbf.newDocumentBuilder();
+        assertNotNull(builder);
+    }
+
+    /**
+     * test for DocumentBuilderFactory.newInstance(java.lang.String
+     * factoryClassName, java.lang.ClassLoader classLoader) factoryClassName is
+     * null , should throw FactoryConfigurationError
+     *
+     * @param factoryClassName
+     * @param classLoader
+     */
+    @Test(expectedExceptions = FactoryConfigurationError.class, dataProvider = "new-instance-neg", dataProviderClass = JAXPDataProvider.class)
+    public void testNewInstanceNeg(String factoryClassName, ClassLoader classLoader) {
+        DocumentBuilderFactory.newInstance(factoryClassName, classLoader);
+    }
+
+    /**
      * Test the default functionality of schema support method.
      * @throws Exception If any errors occur.
      */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/SAXFactoryNewInstanceTest.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 1999, 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.
+ *
+ * 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 javax.xml.parsers.ptests;
+
+import static org.testng.Assert.assertNotNull;
+
+import javax.xml.parsers.FactoryConfigurationError;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import jaxp.library.JAXPDataProvider;
+import jaxp.library.JAXPBaseTest;
+
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+import org.xml.sax.SAXException;
+
+/*
+ * @summary Tests for SAXParserFactory.newInstance(factoryClassName , classLoader)
+ */
+public class SAXFactoryNewInstanceTest extends JAXPBaseTest {
+
+    private static final String SAXPARSER_FACTORY_CLASSNAME = "com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl";
+
+    @DataProvider(name = "parameters")
+    public Object[][] getValidateParameters() {
+        return new Object[][] { { SAXPARSER_FACTORY_CLASSNAME, null }, { SAXPARSER_FACTORY_CLASSNAME, this.getClass().getClassLoader() } };
+    }
+
+    /*
+     * test for SAXParserFactory.newInstance(java.lang.String factoryClassName,
+     * java.lang.ClassLoader classLoader) factoryClassName points to correct
+     * implementation of javax.xml.parsers.SAXParserFactory , should return
+     * newInstance of SAXParserFactory
+     */
+    @Test(dataProvider = "parameters")
+    public void testNewInstance(String factoryClassName, ClassLoader classLoader) throws ParserConfigurationException, SAXException {
+        SAXParserFactory spf = SAXParserFactory.newInstance(factoryClassName, classLoader);
+        SAXParser sp = spf.newSAXParser();
+        assertNotNull(sp);
+    }
+
+    /*
+     * test for SAXParserFactory.newInstance(java.lang.String factoryClassName,
+     * java.lang.ClassLoader classLoader) factoryClassName is null , should
+     * throw FactoryConfigurationError
+     */
+    @Test(expectedExceptions = FactoryConfigurationError.class, dataProvider = "new-instance-neg", dataProviderClass = JAXPDataProvider.class)
+    public void testNewInstanceNeg(String factoryClassName, ClassLoader classLoader) {
+        SAXParserFactory.newInstance(factoryClassName, classLoader);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/stream/ptests/XMLEventFactoryNewInstanceTest.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 1999, 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.
+ *
+ * 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 javax.xml.stream.ptests;
+
+import static org.testng.Assert.assertNotNull;
+
+import javax.xml.stream.XMLEventFactory;
+
+import jaxp.library.JAXPDataProvider;
+import jaxp.library.JAXPBaseTest;
+
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
+/*
+ * @summary Tests for XMLEventFactory.newFactory(factoryId , classLoader)
+ */
+public class XMLEventFactoryNewInstanceTest extends JAXPBaseTest {
+
+    private static final String XMLEVENT_FACTORY_CLASSNAME = "com.sun.xml.internal.stream.events.XMLEventFactoryImpl";
+    private static final String XMLEVENT_FACRORY_ID = "javax.xml.stream.XMLEventFactory";
+
+    @DataProvider(name = "parameters")
+    public Object[][] getValidateParameters() {
+        return new Object[][] { { XMLEVENT_FACRORY_ID, null }, { XMLEVENT_FACRORY_ID, this.getClass().getClassLoader() } };
+    }
+
+    /*
+     * test for XMLEventFactory.newFactory(java.lang.String factoryClassName,
+     * java.lang.ClassLoader classLoader) factoryClassName points to correct
+     * implementation of javax.xml.stream.XMLEventFactory , should return
+     * newInstance of XMLEventFactory
+     */
+    @Test(dataProvider = "parameters")
+    public void testNewFactory(String factoryId, ClassLoader classLoader) {
+        setSystemProperty(XMLEVENT_FACRORY_ID, XMLEVENT_FACTORY_CLASSNAME);
+        try {
+            XMLEventFactory xef = XMLEventFactory.newFactory(factoryId, classLoader);
+            assertNotNull(xef);
+        } finally {
+            setSystemProperty(XMLEVENT_FACRORY_ID, null);
+        }
+    }
+
+    /*
+     * test for XMLEventFactory.newFactory(java.lang.String factoryClassName,
+     * java.lang.ClassLoader classLoader) factoryClassName is null , should
+     * throw NullPointerException
+     */
+    @Test(expectedExceptions = NullPointerException.class, dataProvider = "new-instance-neg", dataProviderClass = JAXPDataProvider.class)
+    public void testNewFactoryNeg(String factoryId, ClassLoader classLoader) {
+        XMLEventFactory.newFactory(null, null);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/stream/ptests/XMLInputFactoryNewInstanceTest.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 1999, 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.
+ *
+ * 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 javax.xml.stream.ptests;
+
+import static org.testng.Assert.assertNotNull;
+
+import javax.xml.stream.XMLInputFactory;
+
+import jaxp.library.JAXPDataProvider;
+import jaxp.library.JAXPBaseTest;
+
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
+/*
+ * @summary Tests for XMLInputFactory.newFactory(factoryId , classLoader)
+ */
+public class XMLInputFactoryNewInstanceTest extends JAXPBaseTest {
+
+    private static final String XMLINPUT_FACTORY_CLASSNAME = "com.sun.xml.internal.stream.XMLInputFactoryImpl";
+    private static final String XMLINPUT_FACRORY_ID = "javax.xml.stream.XMLInputFactory";
+
+    @DataProvider(name = "parameters")
+    public Object[][] getValidateParameters() {
+        return new Object[][] { { XMLINPUT_FACRORY_ID, null }, { XMLINPUT_FACRORY_ID, this.getClass().getClassLoader() } };
+    }
+
+    /*
+     * test for XMLInputFactory.newFactory(java.lang.String factoryId,
+     * java.lang.ClassLoader classLoader) factoryClassName points to correct
+     * implementation of javax.xml.stream.XMLInputFactory , should return
+     * newInstance of XMLInputFactory
+     */
+    @Test(dataProvider = "parameters")
+    public void testNewFactory(String factoryId, ClassLoader classLoader) {
+        setSystemProperty(XMLINPUT_FACRORY_ID, XMLINPUT_FACTORY_CLASSNAME);
+        try {
+            XMLInputFactory xif = XMLInputFactory.newFactory(factoryId, classLoader);
+            assertNotNull(xif);
+        } finally {
+            setSystemProperty(XMLINPUT_FACRORY_ID, null);
+        }
+    }
+
+    /*
+     * test for XMLInputFactory.newFactory(java.lang.String factoryClassName,
+     * java.lang.ClassLoader classLoader) factoryClassName is null , should
+     * throw NullPointerException
+     */
+    @Test(expectedExceptions = NullPointerException.class, dataProvider = "new-instance-neg", dataProviderClass = JAXPDataProvider.class)
+    public void testNewFactoryNeg(String factoryId, ClassLoader classLoader) {
+        XMLInputFactory.newFactory(factoryId, classLoader);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/Bug6384418Test.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 1999, 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.
+ *
+ * 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 javax.xml.transform.ptests;
+
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+import jaxp.library.JAXPFileBaseTest;
+import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
+
+import org.testng.annotations.Test;
+import org.w3c.dom.Document;
+
+/*
+ * @bug 6384418
+ * @summary verify the transforming won't throw any exception
+ */
+public class Bug6384418Test extends JAXPFileBaseTest {
+
+    @Test
+    public void test() throws Exception {
+        TransformerFactory tfactory = TransformerFactory.newInstance();
+        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+        dbf.setNamespaceAware(true);
+        DocumentBuilder db = dbf.newDocumentBuilder();
+        Document document = db.parse(new File(XML_DIR + "dataentry.xsl"));
+        DOMSource domSource = new DOMSource(document);
+
+        Transformer transformer = tfactory.newTransformer(domSource);
+        StreamSource streamSource = new StreamSource(new File(XML_DIR + "test.xml"));
+        StreamResult streamResult = new StreamResult(new ByteArrayOutputStream());
+        transformer.transform(streamSource, streamResult);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/TransformTest.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,383 @@
+/*
+ * Copyright (c) 1999, 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.
+ *
+ * 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 javax.xml.transform.ptests;
+
+import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
+
+import java.io.BufferedWriter;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.function.Supplier;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.stream.XMLEventWriter;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.sax.SAXResult;
+import javax.xml.transform.sax.SAXSource;
+import javax.xml.transform.stax.StAXResult;
+import javax.xml.transform.stax.StAXSource;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+import jaxp.library.JAXPFileBaseTest;
+
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+import org.w3c.dom.Document;
+import org.xml.sax.Attributes;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+
+/*
+ * @summary Tests for variable combination of Transformer.transform(Source, Result)
+ */
+@Test(singleThreaded = true)
+public class TransformTest extends JAXPFileBaseTest {
+
+    /*
+     * Initialize the share objects.
+     */
+    @BeforeClass
+    public void setup() throws Exception {
+        ifac = XMLInputFactory.newInstance();
+        ofac = XMLOutputFactory.newInstance();
+        tfac = TransformerFactory.newInstance();
+
+        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+        dbf.setNamespaceAware(true);
+        db = dbf.newDocumentBuilder();
+
+        xml = Files.readAllBytes(Paths.get(XML_DIR + "cities.xml"));
+        template = Files.readAllBytes(Paths.get(XML_DIR + "cities.xsl"));
+
+        xmlDoc = db.parse(xmlInputStream());
+    }
+
+    @DataProvider(name = "input-provider")
+    public Object[][] prepareTestCombination() throws Exception {
+
+        Supplier<Source> staxStreamSource = () -> new StAXSource(getXMLStreamReader());
+        Supplier<Source> staxEventSource = this::getStAXEventSource;
+        Supplier<Source> domSource = () -> new DOMSource(xmlDoc);
+        Supplier<Source> saxSource = () -> new SAXSource(new InputSource(xmlInputStream()));
+        Supplier<Source> streamSource = () -> new StreamSource(xmlInputStream());
+
+        Supplier<Result> staxStreamResult = () -> new StAXResult(getXMLStreamWriter());
+        Supplier<Result> staxEventResult = () -> new StAXResult(getXMLEventWriter());
+        Supplier<Result> saxResult = this::getHandlerSAXResult;
+        Supplier<Result> streamResult = () -> new StreamResult(transOutputStream());
+
+        Transformer domTemplateTransformer = createTransformer(getDomTemplate());
+        Transformer saxTemplateTransformer = createTransformer(getSAXTemplate());
+        Transformer streamTemplateTransformer = createTransformer(getStreamTemplate());
+        Transformer noTemplateTransformer = createTransformer(null);
+        Transformer staxStreamTemplateTransformer = createTransformer(getStAXStreamTemplate());
+        Transformer staxEventTemplateTransformer = createTransformer(getStAXEventTemplate());
+
+        return new Object[][] {
+                // StAX Stream
+                { staxStreamSource, staxStreamResult, domTemplateTransformer },
+                { staxStreamSource, staxStreamResult, saxTemplateTransformer },
+                { staxStreamSource, staxStreamResult, streamTemplateTransformer },
+                { staxStreamSource, staxStreamResult, noTemplateTransformer },
+                { staxStreamSource, staxStreamResult, staxStreamTemplateTransformer },
+                { staxStreamSource, saxResult, domTemplateTransformer },
+                { staxStreamSource, streamResult, domTemplateTransformer },
+                { domSource, staxStreamResult, domTemplateTransformer },
+                { saxSource, staxStreamResult, domTemplateTransformer },
+                { streamSource, staxStreamResult, domTemplateTransformer },
+                { staxStreamSource, streamResult, saxTemplateTransformer },
+                { domSource, staxStreamResult, saxTemplateTransformer },
+                { saxSource, staxStreamResult, saxTemplateTransformer },
+                { streamSource, staxStreamResult, saxTemplateTransformer },
+                { staxStreamSource, streamResult, streamTemplateTransformer },
+                { domSource, staxStreamResult, streamTemplateTransformer },
+                { saxSource, staxStreamResult, streamTemplateTransformer },
+                { streamSource, staxStreamResult, streamTemplateTransformer },
+                // StAX Event
+                { staxEventSource, staxEventResult, domTemplateTransformer },
+                { staxEventSource, staxEventResult, saxTemplateTransformer },
+                { staxEventSource, staxEventResult, streamTemplateTransformer },
+                { staxEventSource, staxEventResult, noTemplateTransformer },
+                { staxEventSource, staxEventResult, staxEventTemplateTransformer },
+                { staxEventSource, saxResult, domTemplateTransformer },
+                { staxEventSource, streamResult, domTemplateTransformer },
+                { domSource, staxEventResult, domTemplateTransformer },
+                { saxSource, staxEventResult, domTemplateTransformer },
+                { streamSource, staxEventResult, domTemplateTransformer },
+                { staxEventSource, streamResult, saxTemplateTransformer },
+                { domSource, staxEventResult, saxTemplateTransformer },
+                { saxSource, staxEventResult, saxTemplateTransformer },
+                { streamSource, staxEventResult, saxTemplateTransformer },
+                { staxEventSource, streamResult, streamTemplateTransformer },
+                { domSource, staxEventResult, streamTemplateTransformer },
+                { saxSource, staxEventResult, streamTemplateTransformer },
+                { streamSource, staxEventResult, streamTemplateTransformer } };
+    }
+
+    /*
+     * run Transformer.transform(Source, Result)
+     */
+    @Test(dataProvider = "input-provider")
+    public void testTransform(Supplier<Source> src, Supplier<Result> res, Transformer transformer) throws Throwable {
+        try {
+            transformer.transform(src.get(), res.get());
+        } catch (WrapperException e) {
+            throw e.getCause();
+        }
+    }
+
+    private InputStream xmlInputStream() {
+        return new ByteArrayInputStream(xml);
+    }
+
+    private InputStream templateInputStream() {
+        return new ByteArrayInputStream(template);
+    }
+
+    private OutputStream transOutputStream() {
+        return new ByteArrayOutputStream(xml.length);
+    }
+
+    private XMLStreamReader getXMLStreamReader() {
+        try {
+            return ifac.createXMLStreamReader(xmlInputStream());
+        } catch (XMLStreamException e) {
+            throw new WrapperException(e);
+        }
+    }
+
+    private XMLStreamWriter getXMLStreamWriter() {
+        try {
+            return ofac.createXMLStreamWriter(transOutputStream());
+        } catch (XMLStreamException e) {
+            throw new WrapperException(e);
+        }
+    }
+
+    private StAXSource getStAXEventSource() {
+        try {
+            return new StAXSource(ifac.createXMLEventReader(xmlInputStream()));
+        } catch (XMLStreamException e) {
+            throw new WrapperException(e);
+        }
+    }
+
+    private XMLEventWriter getXMLEventWriter() {
+        try {
+            return ofac.createXMLEventWriter(transOutputStream());
+        } catch (XMLStreamException e) {
+            throw new WrapperException(e);
+        }
+    }
+
+    private SAXResult getHandlerSAXResult() {
+        SAXResult res = new SAXResult();
+        MyContentHandler myContentHandler = new MyContentHandler(transOutputStream());
+        res.setHandler(myContentHandler);
+        return res;
+    }
+
+    private Source getDomTemplate() throws SAXException, IOException {
+        return new DOMSource(db.parse(templateInputStream()));
+    }
+
+    private Source getSAXTemplate() {
+        return new SAXSource(new InputSource(templateInputStream()));
+    }
+
+    private Source getStreamTemplate() {
+        return new StreamSource(templateInputStream());
+    }
+
+    private Source getStAXStreamTemplate() throws XMLStreamException {
+        return new StAXSource(ifac.createXMLStreamReader(templateInputStream()));
+    }
+
+    private Source getStAXEventTemplate() throws XMLStreamException {
+        return new StAXSource(ifac.createXMLEventReader(templateInputStream()));
+    }
+
+    private Transformer createTransformer(Source templateSource) throws TransformerConfigurationException {
+        Transformer transformer = (templateSource == null) ? tfac.newTransformer() : tfac.newTransformer(templateSource);
+        transformer.setOutputProperty("indent", "yes");
+        return transformer;
+
+    }
+
+    private static class MyContentHandler implements ContentHandler {
+        private BufferedWriter bWriter;
+
+        public MyContentHandler(OutputStream os) {
+            bWriter = new BufferedWriter(new OutputStreamWriter(os));
+        }
+
+        public void setDocumentLocator(Locator locator) {
+        }
+
+        public void startDocument() throws SAXException {
+            String str = "startDocument";
+            try {
+                bWriter.write(str, 0, str.length());
+                bWriter.newLine();
+            } catch (IOException e) {
+                System.out.println("bWriter error");
+            }
+        }
+
+        public void endDocument() throws SAXException {
+            String str = "endDocument";
+            try {
+                bWriter.write(str, 0, str.length());
+                bWriter.newLine();
+                bWriter.flush();
+                bWriter.close();
+            } catch (IOException e) {
+                System.out.println("bWriter error");
+            }
+        }
+
+        public void startPrefixMapping(String prefix, String uri) throws SAXException {
+            String str = "startPrefixMapping: " + prefix + ", " + uri;
+            try {
+                bWriter.write(str, 0, str.length());
+                bWriter.newLine();
+            } catch (IOException e) {
+                System.out.println("bWriter error");
+            }
+        }
+
+        public void endPrefixMapping(String prefix) throws SAXException {
+            String str = "endPrefixMapping: " + prefix;
+            try {
+                bWriter.write(str, 0, str.length());
+                bWriter.newLine();
+            } catch (IOException e) {
+                System.out.println("bWriter error");
+            }
+        }
+
+        public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
+            StringBuilder str = new StringBuilder("startElement: ").append(namespaceURI).append(", ").append(namespaceURI).append(", ").append(qName).append(" : ");
+            int n = atts.getLength();
+            for (int i = 0; i < n; i++) {
+                str.append(", ").append(atts.getQName(i)).append(" : ").append(atts.getValue(i));
+            }
+
+            try {
+                bWriter.write(str.toString(), 0, str.length());
+                bWriter.newLine();
+            } catch (IOException e) {
+                System.out.println("bWriter error");
+            }
+        }
+
+        public void endElement(String namespaceURI, String localName, String qName) throws SAXException {
+            String str = "endElement: " + namespaceURI + ", " + namespaceURI + ", " + qName;
+            try {
+                bWriter.write(str, 0, str.length());
+                bWriter.newLine();
+            } catch (IOException e) {
+                System.out.println("bWriter error");
+            }
+
+        }
+
+        public void characters(char ch[], int start, int length) throws SAXException {
+            String str = new String(ch, start, length);
+            try {
+                bWriter.write(str, 0, str.length());
+                bWriter.newLine();
+            } catch (IOException e) {
+                System.out.println("bWriter error");
+            }
+        }
+
+        public void ignorableWhitespace(char ch[], int start, int length) throws SAXException {
+            String str = "ignorableWhitespace";
+            try {
+                bWriter.write(str, 0, str.length());
+                bWriter.newLine();
+            } catch (IOException e) {
+                System.out.println("bWriter error");
+            }
+        }
+
+        public void processingInstruction(String target, String data) throws SAXException {
+            String str = "processingInstruction: " + target + ", " + target;
+            try {
+                bWriter.write(str, 0, str.length());
+                bWriter.newLine();
+            } catch (IOException e) {
+                System.out.println("bWriter error");
+            }
+        }
+
+        public void skippedEntity(String name) throws SAXException {
+            String str = "skippedEntity: " + name;
+            try {
+                bWriter.write(str, 0, str.length());
+                bWriter.newLine();
+            } catch (IOException e) {
+                System.out.println("bWriter error");
+            }
+        }
+    }
+
+    private static class WrapperException extends RuntimeException {
+        public WrapperException(Throwable cause) {
+            super(cause);
+        }
+    }
+
+    private XMLInputFactory ifac;
+    private XMLOutputFactory ofac;
+    private TransformerFactory tfac;
+    private DocumentBuilder db;
+    private byte[] xml;
+    private byte[] template;
+    private Document xmlDoc;
+
+}
--- a/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/TransformerFactoryTest.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/TransformerFactoryTest.java	Mon Feb 23 05:01:11 2015 -0800
@@ -23,26 +23,79 @@
 package javax.xml.transform.ptests;
 
 import java.io.*;
-import java.io.FileOutputStream;
+
 import javax.xml.parsers.*;
 import javax.xml.transform.*;
 import javax.xml.transform.dom.*;
+
 import static javax.xml.transform.ptests.TransformerTestConst.GOLDEN_DIR;
 import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
+
 import javax.xml.transform.stream.*;
+
+import jaxp.library.JAXPDataProvider;
 import jaxp.library.JAXPFileBaseTest;
 import static jaxp.library.JAXPTestUtilities.USER_DIR;
 import static jaxp.library.JAXPTestUtilities.compareWithGold;
+import static org.testng.Assert.assertNotNull;
 import static org.testng.Assert.assertTrue;
+
+import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
 import org.w3c.dom.*;
 
 /**
  * Class containing the test cases for TransformerFactory API's
- * getAssociatedStyleSheet method.
+ * getAssociatedStyleSheet method and TransformerFactory.newInstance(factoryClassName , classLoader).
  */
 public class TransformerFactoryTest extends JAXPFileBaseTest {
     /**
+     * TransformerFactory implementation class name.
+     */
+    private static final String TRANSFORMER_FACTORY_CLASSNAME = "com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl";
+
+    /**
+     * Provide valid TransformerFactory instantiation parameters.
+     *
+     * @return a data provider contains TransformerFactory instantiation parameters.
+     */
+    @DataProvider(name = "parameters")
+    public Object[][] getValidateParameters() {
+        return new Object[][] { { TRANSFORMER_FACTORY_CLASSNAME, null }, { TRANSFORMER_FACTORY_CLASSNAME, this.getClass().getClassLoader() } };
+    }
+
+    /**
+     * Test for TransformerFactory.newInstance(java.lang.String
+     * factoryClassName, java.lang.ClassLoader classLoader) factoryClassName
+     * points to correct implementation of
+     * javax.xml.transform.TransformerFactory , should return newInstance of
+     * TransformerFactory
+     *
+     * @param factoryClassName
+     * @param classLoader
+     * @throws TransformerConfigurationException
+     */
+    @Test(dataProvider = "parameters")
+    public void testNewInstance(String factoryClassName, ClassLoader classLoader) throws TransformerConfigurationException {
+        TransformerFactory tf = TransformerFactory.newInstance(factoryClassName, classLoader);
+        Transformer transformer = tf.newTransformer();
+        assertNotNull(transformer);
+    }
+
+    /**
+     * Test for TransformerFactory.newInstance(java.lang.String
+     * factoryClassName, java.lang.ClassLoader classLoader) factoryClassName is
+     * null , should throw TransformerFactoryConfigurationError
+     *
+     * @param factoryClassName
+     * @param classLoader
+     */
+    @Test(expectedExceptions = TransformerFactoryConfigurationError.class, dataProvider = "new-instance-neg", dataProviderClass = JAXPDataProvider.class)
+    public void testNewInstanceNeg(String factoryClassName, ClassLoader classLoader) {
+        TransformerFactory.newInstance(factoryClassName, classLoader);
+    }
+
+    /**
      * This test case checks for the getAssociatedStylesheet method
      * of TransformerFactory.
      * The style sheet returned is then copied to an tfactory01.out
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/xmlfiles/dataentry.xsl	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+	<xsl:template match="dataentry">
+		<table cellspacing="0" cellpadding="0" width="85%" align="center" 
+class="color1" border="0">
+				<xsl:apply-templates/>
+		</table>
+
+	</xsl:template>
+	<xsl:template match="list">
+		<xsl:value-of select="self::node()[@multi='false']"/>
+                    
+               <!--
+		<xsl:if test="self::node()[@multi='false']">
+		<xsl:if test="self::node()">
+			FALSE<br/>
+		</xsl:if>
+                -->
+	</xsl:template>
+</xsl:stylesheet>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/xmlfiles/test.xml	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,8 @@
+<appcapp>
+<dataentry>
+<list multi="false">
+  <name>TypeOfLifeApp</name>
+</list>
+</dataentry>
+</appcapp>
+
--- a/jaxp/test/javax/xml/jaxp/functional/javax/xml/validation/ptests/SchemaFactoryTest.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/validation/ptests/SchemaFactoryTest.java	Mon Feb 23 05:01:11 2015 -0800
@@ -46,6 +46,8 @@
 import javax.xml.validation.Schema;
 import javax.xml.validation.SchemaFactory;
 
+import jaxp.library.JAXPDataProvider;
+
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
@@ -81,6 +83,59 @@
         xml = Files.readAllBytes(Paths.get(XML_DIR + "test.xml"));
     }
 
+
+    @DataProvider(name = "parameters")
+    public Object[][] getValidateParameters() {
+        return new Object[][] { { W3C_XML_SCHEMA_NS_URI, SCHEMA_FACTORY_CLASSNAME, null },
+                { W3C_XML_SCHEMA_NS_URI, SCHEMA_FACTORY_CLASSNAME, this.getClass().getClassLoader() } };
+    }
+
+    /*
+     * test for SchemaFactory.newInstance(java.lang.String schemaLanguage,
+     * java.lang.String factoryClassName, java.lang.ClassLoader classLoader)
+     * factoryClassName points to correct implementation of
+     * javax.xml.validation.SchemaFactory , should return newInstance of
+     * SchemaFactory
+     */
+    @Test(dataProvider = "parameters")
+    public void testNewInstance(String schemaLanguage, String factoryClassName, ClassLoader classLoader) throws SAXException {
+        SchemaFactory sf = SchemaFactory.newInstance(W3C_XML_SCHEMA_NS_URI, SCHEMA_FACTORY_CLASSNAME, null);
+        Schema schema = sf.newSchema();
+        assertNotNull(schema);
+    }
+
+    /*
+     * test for SchemaFactory.newInstance(java.lang.String schemaLanguage,
+     * java.lang.String factoryClassName, java.lang.ClassLoader classLoader)
+     * factoryClassName is null , should throw IllegalArgumentException
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class, dataProvider = "new-instance-neg", dataProviderClass = JAXPDataProvider.class)
+    public void testNewInstanceWithNullFactoryClassName(String factoryClassName, ClassLoader classLoader) {
+
+        SchemaFactory.newInstance(W3C_XML_SCHEMA_NS_URI, factoryClassName, classLoader);
+    }
+
+    /*
+     * test for SchemaFactory.newInstance(java.lang.String schemaLanguage,
+     * java.lang.String factoryClassName, java.lang.ClassLoader classLoader)
+     * schemaLanguage is null , should throw NPE
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void testNewInstanceWithNullSchemaLanguage() {
+        SchemaFactory.newInstance(null, SCHEMA_FACTORY_CLASSNAME, this.getClass().getClassLoader());
+    }
+
+    /*
+     * test for SchemaFactory.newInstance(java.lang.String schemaLanguage,
+     * java.lang.String factoryClassName, java.lang.ClassLoader classLoader)
+     * schemaLanguage is empty , should throw IllegalArgumentException
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void testNewInstanceWithEmptySchemaLanguage() {
+        SchemaFactory.newInstance("", SCHEMA_FACTORY_CLASSNAME, this.getClass().getClassLoader());
+    }
+
+
     @Test(expectedExceptions = SAXParseException.class)
     public void testNewSchemaDefault() throws SAXException, IOException {
         validate(sf.newSchema());
@@ -288,6 +343,8 @@
 
     private static final String UNRECOGNIZED_NAME = "http://xml.org/sax/features/namespace-prefixes";
 
+    private static final String SCHEMA_FACTORY_CLASSNAME = "com.sun.org.apache.xerces.internal.jaxp.validation.XMLSchemaFactory";
+
     private SchemaFactory sf;
     private byte[] xsd1;
     private byte[] xsd2;
--- a/jaxp/test/javax/xml/jaxp/functional/javax/xml/xpath/ptests/XPathFactoryTest.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/xpath/ptests/XPathFactoryTest.java	Mon Feb 23 05:01:11 2015 -0800
@@ -24,10 +24,16 @@
 package javax.xml.xpath.ptests;
 
 import static javax.xml.xpath.XPathConstants.DOM_OBJECT_MODEL;
+
+import javax.xml.xpath.XPath;
 import javax.xml.xpath.XPathFactory;
 import javax.xml.xpath.XPathFactoryConfigurationException;
+
+import jaxp.library.JAXPDataProvider;
 import jaxp.library.JAXPBaseTest;
-import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.Assert.assertNotNull;
+
+import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
 
 /**
@@ -45,6 +51,78 @@
     private static final String INVALID_URL = "http://java.sun.com/jaxp/xpath/dom1";
 
     /**
+     * XPathFactory implementation class name.
+     */
+    private static final String XPATH_FACTORY_CLASSNAME = "com.sun.org.apache.xpath.internal.jaxp.XPathFactoryImpl";
+
+
+    /**
+     * Provide valid XPathFactory instantiation parameters.
+     *
+     * @return a data provider contains XPathFactory instantiation parameters.
+     */
+    @DataProvider(name = "parameters")
+    public Object[][] getValidateParameters() {
+        return new Object[][] { { VALID_URL, XPATH_FACTORY_CLASSNAME, null }, { VALID_URL, XPATH_FACTORY_CLASSNAME, this.getClass().getClassLoader() } };
+    }
+
+    /**
+     * Test for XPathFactory.newInstance(java.lang.String uri, java.lang.String
+     * factoryClassName, java.lang.ClassLoader classLoader) factoryClassName
+     * points to correct implementation of javax.xml.xpath.XPathFactory , should
+     * return newInstance of XPathFactory
+     *
+     * @param uri
+     * @param factoryClassName
+     * @param classLoader
+     * @throws XPathFactoryConfigurationException
+     */
+    @Test(dataProvider = "parameters")
+    public void testNewInstance(String uri, String factoryClassName, ClassLoader classLoader) throws XPathFactoryConfigurationException {
+        XPathFactory xpf = XPathFactory.newInstance(uri, factoryClassName, classLoader);
+        XPath xpath = xpf.newXPath();
+        assertNotNull(xpath);
+    }
+
+    /**
+     * Test for XPathFactory.newInstance(java.lang.String uri, java.lang.String
+     * factoryClassName, java.lang.ClassLoader classLoader)
+     *
+     * @param factoryClassName
+     * @param classLoader
+     * @throws XPathFactoryConfigurationException
+     *             is expected when factoryClassName is null
+     */
+    @Test(expectedExceptions = XPathFactoryConfigurationException.class, dataProvider = "new-instance-neg", dataProviderClass = JAXPDataProvider.class)
+    public void testNewInstanceWithNullFactoryClassName(String factoryClassName, ClassLoader classLoader) throws XPathFactoryConfigurationException {
+        XPathFactory.newInstance(VALID_URL, factoryClassName, classLoader);
+    }
+
+    /**
+     * Test for XPathFactory.newInstance(java.lang.String uri, java.lang.String
+     * factoryClassName, java.lang.ClassLoader classLoader) uri is null , should
+     * throw NPE
+     *
+     * @throws XPathFactoryConfigurationException
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void testNewInstanceWithNullUri() throws XPathFactoryConfigurationException {
+        XPathFactory.newInstance(null, XPATH_FACTORY_CLASSNAME, this.getClass().getClassLoader());
+    }
+
+    /**
+     * Test for XPathFactory.newInstance(java.lang.String uri, java.lang.String
+     * factoryClassName, java.lang.ClassLoader classLoader)
+     *
+     * @throws IllegalArgumentException
+     *             is expected when uri is empty
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void testNewInstanceWithEmptyUri() throws XPathFactoryConfigurationException {
+        XPathFactory.newInstance("", XPATH_FACTORY_CLASSNAME, this.getClass().getClassLoader());
+    }
+
+    /**
      * Test for constructor - XPathFactory.newInstance().
      */
     @Test
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/libs/jaxp/library/JAXPDataProvider.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,38 @@
+/*
+ * 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.
+ *
+ * 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 jaxp.library;
+
+import org.testng.annotations.DataProvider;
+
+/**
+ * Provide invalid parameters for negative testing Factory.newInstance.
+ */
+public class JAXPDataProvider {
+
+    @DataProvider(name = "new-instance-neg")
+    public static Object[][] getNewInstanceNeg() {
+        return new Object[][] { { null, null }, { null, JAXPDataProvider.class.getClassLoader() } };
+    }
+
+}
--- a/jaxws/.hgtags	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/.hgtags	Mon Feb 23 05:01:11 2015 -0800
@@ -294,3 +294,6 @@
 64ca52b0bda8028636e4ccafbe1107befcdda47d jdk9-b46
 6c17d648d03e4bf4729c3645f8db55d34115e0b7 jdk9-b47
 33e7e699804892c0496adf60ad67cc12855aeb61 jdk9-b48
+435a49db1de0589acc86b2cc5fd61d546f94b56c jdk9-b49
+45a30e7ee623031a1532685512dd2c2d8e8fa0ad jdk9-b50
+bb9cf97a5ac6aa1aa2a1034676d64413071f58ea jdk9-b51
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/JAXBContext.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/JAXBContext.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -45,14 +45,14 @@
  * specialized forms of the method available:
  *
  * <ul>
- *   <li>{@link #newInstance(String,ClassLoader) JAXBContext.newInstance( "com.acme.foo:com.acme.bar" )} <br/>
+ *   <li>{@link #newInstance(String,ClassLoader) JAXBContext.newInstance( "com.acme.foo:com.acme.bar" )} <br>
  *   The JAXBContext instance is initialized from a list of colon
  *   separated Java package names. Each java package contains
  *   JAXB mapped classes, schema-derived classes and/or user annotated
  *   classes. Additionally, the java package may contain JAXB package annotations
  *   that must be processed. (see JLS, Section 7.4.1 "Named Packages").
  *   </li>
- *   <li>{@link #newInstance(Class...) JAXBContext.newInstance( com.acme.foo.Foo.class )} <br/>
+ *   <li>{@link #newInstance(Class...) JAXBContext.newInstance( com.acme.foo.Foo.class )} <br>
  *    The JAXBContext instance is initialized with class(es)
  *    passed as parameter(s) and classes that are statically reachable from
  *    these class(es). See {@link #newInstance(Class...)} for details.
@@ -64,8 +64,8 @@
  * class containing the following method signatures:</i>
  *
  * <pre>
- * public static JAXBContext createContext( String contextPath, ClassLoader classLoader, Map&lt;String,Object> properties ) throws JAXBException
- * public static JAXBContext createContext( Class[] classes, Map&lt;String,Object> properties ) throws JAXBException
+ * public static JAXBContext createContext( String contextPath, ClassLoader classLoader, Map&lt;String,Object&gt; properties ) throws JAXBException
+ * public static JAXBContext createContext( Class[] classes, Map&lt;String,Object&gt; properties ) throws JAXBException
  * </pre>
  *
  * <p><i>
@@ -256,7 +256,7 @@
  * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
  * @see Marshaller
  * @see Unmarshaller
- * @see S 7.4.1 "Named Packages" in Java Language Specification</a>
+ * @see <a href="http://docs.oracle.com/javase/specs/jls/se7/html/jls-7.html#jls-7.4.1">S 7.4.1 "Named Packages" in Java Language Specification</a>
  * @since 1.6, JAXB 1.0
  */
 public abstract class JAXBContext {
@@ -352,7 +352,7 @@
      * <p>
      * To maintain compatibility with JAXB 1.0 schema to java
      * interface/implementation binding, enabled by schema customization
-     * <tt>&lt;jaxb:globalBindings valueClass="false"></tt>,
+     * <tt>&lt;jaxb:globalBindings valueClass="false"&gt;</tt>,
      * the JAXB provider will ensure that each package on the context path
      * has a <tt>jaxb.properties</tt> file which contains a value for the
      * <tt>javax.xml.bind.context.factory</tt> property and that all values
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/JAXBException.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/JAXBException.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -48,7 +48,7 @@
      * Exception reference
      *
      */
-    private Throwable linkedException;
+    private volatile Throwable linkedException;
 
     static final long serialVersionUID = -5621384651494307979L;
 
@@ -133,7 +133,7 @@
      *                  indicates that the linked exception does not exist or
      *                  is unknown).
      */
-    public synchronized void setLinkedException( Throwable exception ) {
+    public void setLinkedException( Throwable exception ) {
         this.linkedException = exception;
     }
 
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/JAXBIntrospector.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/JAXBIntrospector.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -51,7 +51,7 @@
      * <ol>
      *   <li>It is an instance of <code>javax.xml.bind.JAXBElement</code>.</li>
      *   <li>The class of <code>object</code> is annotated with
-     *       <code>&#64XmlRootElement</code>.
+     *       <code>&#64;XmlRootElement</code>.
      *   </li>
      * </ol>
      *
@@ -74,7 +74,7 @@
      *
      * <p>Convenience method to abstract whether working with either
      *    a javax.xml.bind.JAXBElement instance or an instance of
-     *    <tt>&#64XmlRootElement</tt> annotated Java class.</p>
+     *    <tt>&#64;XmlRootElement</tt> annotated Java class.</p>
      *
      * @param jaxbElement  object that #isElement(Object) returns true.
      *
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/Marshaller.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/Marshaller.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -175,7 +175,7 @@
  * encoding used during these marshal operations.  Client applications are
  * expected to supply a valid character encoding name as defined in the
  * <a href="http://www.w3.org/TR/2000/REC-xml-20001006#charencoding">W3C XML 1.0
- * Recommendation</a> and supported by your Java Platform</a>.
+ * Recommendation</a> and supported by your Java Platform.
  * </blockquote>
  *
  * <p>
@@ -664,7 +664,7 @@
      *
      * <p>
      * Every marshaller internally maintains a
-     * {@link java.util.Map}&lt;{@link Class},{@link XmlAdapter}>,
+     * {@link java.util.Map}&lt;{@link Class},{@link XmlAdapter}&gt;,
      * which it uses for marshalling classes whose fields/methods are annotated
      * with {@link javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter}.
      *
@@ -750,17 +750,17 @@
     public Schema getSchema();
 
     /**
-     * <p/>
+     * <p>
      * Register an instance of an implementation of this class with a {@link Marshaller} to externally listen
      * for marshal events.
-     * <p/>
-     * <p/>
+     * </p>
+     * <p>
      * This class enables pre and post processing of each marshalled object.
      * The event callbacks are called when marshalling from an instance that maps to an xml element or
      * complex type definition. The event callbacks are not called when marshalling from an instance of a
      * Java datatype that represents a simple type definition.
-     * <p/>
-     * <p/>
+     * </p>
+     * <p>
      * External listener is one of two different mechanisms for defining marshal event callbacks.
      * See <a href="Marshaller.html#marshalEventCallback">Marshal Event Callbacks</a> for an overview.
      *
@@ -770,10 +770,10 @@
      */
     public static abstract class Listener {
         /**
-         * <p/>
+         * <p>
          * Callback method invoked before marshalling from <tt>source</tt> to XML.
-         * <p/>
-         * <p/>
+         * </p>
+         * <p>
          * This method is invoked just before marshalling process starts to marshal <tt>source</tt>.
          * Note that if the class of <tt>source</tt> defines its own <tt>beforeMarshal</tt> method,
          * the class specific callback method is invoked just before this method is invoked.
@@ -784,10 +784,10 @@
         }
 
         /**
-         * <p/>
+         * <p>
          * Callback method invoked after marshalling <tt>source</tt> to XML.
-         * <p/>
-         * <p/>
+         * </p>
+         * <p>
          * This method is invoked after <tt>source</tt> and all its descendants have been marshalled.
          * Note that if the class of <tt>source</tt> defines its own <tt>afterMarshal</tt> method,
          * the class specific callback method is invoked just before this method is invoked.
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/SchemaOutputResolver.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/SchemaOutputResolver.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -70,11 +70,11 @@
      *
      *      If the {@link Result} object has a system ID, it must be an
      *      absolute system ID. Those system IDs are relativized by the caller and used
-     *      for &lt;xs:import> statements.
+     *      for &lt;xs:import&gt; statements.
      *
      *      If the {@link Result} object does not have a system ID, a schema
      *      for the namespace URI is generated but it won't be explicitly
-     *      &lt;xs:import>ed from other schemas.
+     *      &lt;xs:import&gt;ed from other schemas.
      *
      *      If {@code null} is returned, the schema generation for this
      *      namespace URI will be skipped.
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/TypeConstraintException.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/TypeConstraintException.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -57,8 +57,9 @@
      * Exception reference
      *
      */
-    private Throwable linkedException;
+    private volatile Throwable linkedException;
 
+    static final long serialVersionUID = -3059799699420143848L;
 
     /**
      * Construct a TypeConstraintException with the specified detail message.  The
@@ -141,7 +142,7 @@
      *                  indicates that the linked exception does not exist or
      *                  is unknown).
      */
-    public synchronized void setLinkedException( Throwable exception ) {
+    public void setLinkedException( Throwable exception ) {
         this.linkedException = exception;
     }
 
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/Unmarshaller.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/Unmarshaller.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -238,13 +238,12 @@
  * to a JAXB mapped class by {@link JAXBContext}, that the root
  * element's <tt>xsi:type</tt> attribute takes
  * precedence over the unmarshal methods <tt>declaredType</tt> parameter.
- * These methods always return a <tt>JAXBElement&lt;declaredType></tt>
+ * These methods always return a <tt>JAXBElement&lt;declaredType&gt;</tt>
  * instance. The table below shows how the properties of the returned JAXBElement
  * instance are set.
  *
  * <a name="unmarshalDeclaredTypeReturn"></a>
- * <p>
- *   <table border="2" rules="all" cellpadding="4">
+ *   <table summary="" border="2" rules="all" cellpadding="4">
  *   <thead>
  *     <tr>
  *       <th align="center" colspan="2">
@@ -284,19 +283,19 @@
  * <blockquote>
  *    <pre>
  *       Schema fragment for example
- *       &lt;xs:schema>
- *          &lt;xs:complexType name="FooType">...&lt;\xs:complexType>
- *          &lt;!-- global element declaration "PurchaseOrder" -->
- *          &lt;xs:element name="PurchaseOrder">
- *              &lt;xs:complexType>
- *                 &lt;xs:sequence>
- *                    &lt;!-- local element declaration "foo" -->
- *                    &lt;xs:element name="foo" type="FooType"/>
+ *       &lt;xs:schema&gt;
+ *          &lt;xs:complexType name="FooType"&gt;...&lt;\xs:complexType&gt;
+ *          &lt;!-- global element declaration "PurchaseOrder" --&gt;
+ *          &lt;xs:element name="PurchaseOrder"&gt;
+ *              &lt;xs:complexType&gt;
+ *                 &lt;xs:sequence&gt;
+ *                    &lt;!-- local element declaration "foo" --&gt;
+ *                    &lt;xs:element name="foo" type="FooType"/&gt;
  *                    ...
- *                 &lt;/xs:sequence>
- *              &lt;/xs:complexType>
- *          &lt;/xs:element>
- *       &lt;/xs:schema>
+ *                 &lt;/xs:sequence&gt;
+ *              &lt;/xs:complexType&gt;
+ *          &lt;/xs:element&gt;
+ *       &lt;/xs:schema&gt;
  *
  *       JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
  *       Unmarshaller u = jc.createUnmarshaller();
@@ -309,7 +308,7 @@
  *                                  // local element declaration in schema.
  *
  *       // FooType is the JAXB mapping of the type of local element declaration foo.
- *       JAXBElement&lt;FooType> foo = u.unmarshal( fooSubtree, FooType.class);
+ *       JAXBElement&lt;FooType&gt; foo = u.unmarshal( fooSubtree, FooType.class);
  *    </pre>
  * </blockquote>
  *
@@ -390,7 +389,7 @@
  * The external listener callback mechanism enables the registration of a {@link Listener}
  * instance with an {@link Unmarshaller#setListener(Listener)}. The external listener receives all callback events,
  * allowing for more centralized processing than per class defined callback methods.  The external listener
- * receives events when unmarshalling proces is marshalling to a JAXB element or to JAXB mapped class.
+ * receives events when unmarshalling process is marshalling to a JAXB element or to JAXB mapped class.
  * <p>
  * The 'class defined' and external listener event callback methods are independent of each other,
  * both can be called for one event.  The invocation ordering when both listener callback methods exist is
@@ -1010,7 +1009,7 @@
      *
      * <p>
      * Every unmarshaller internally maintains a
-     * {@link java.util.Map}&lt;{@link Class},{@link XmlAdapter}>,
+     * {@link java.util.Map}&lt;{@link Class},{@link XmlAdapter}&gt;,
      * which it uses for unmarshalling classes whose fields/methods are annotated
      * with {@link javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter}.
      *
@@ -1050,7 +1049,6 @@
     /**
      * <p>Associate a context that resolves cid's, content-id URIs, to
      * binary data passed as attachments.</p>
-     * <p/>
      * <p>Unmarshal time validation, enabled via {@link #setSchema(Schema)},
      * must be supported even when unmarshaller is performing XOP processing.
      * </p>
@@ -1063,21 +1061,21 @@
     AttachmentUnmarshaller getAttachmentUnmarshaller();
 
     /**
-     * <p/>
+     * <p>
      * Register an instance of an implementation of this class with {@link Unmarshaller} to externally listen
      * for unmarshal events.
-     * <p/>
-     * <p/>
+     * </p>
+     * <p>
      * This class enables pre and post processing of an instance of a JAXB mapped class
      * as XML data is unmarshalled into it. The event callbacks are called when unmarshalling
      * XML content into a JAXBElement instance or a JAXB mapped class that represents a complex type definition.
      * The event callbacks are not called when unmarshalling to an instance of a
      * Java datatype that represents a simple type definition.
-     * <p/>
-     * <p/>
+     * </p>
+     * <p>
      * External listener is one of two different mechanisms for defining unmarshal event callbacks.
      * See <a href="Unmarshaller.html#unmarshalEventCallback">Unmarshal Event Callbacks</a> for an overview.
-     * <p/>
+     * </p>
      * (@link #setListener(Listener)}
      * (@link #getListener()}
      *
@@ -1085,10 +1083,10 @@
      */
     public static abstract class Listener {
         /**
-         * <p/>
+         * <p>
          * Callback method invoked before unmarshalling into <tt>target</tt>.
-         * <p/>
-         * <p/>
+         * </p>
+         * <p>
          * This method is invoked immediately after <tt>target</tt> was created and
          * before the unmarshalling of this object begins. Note that
          * if the class of <tt>target</tt> defines its own <tt>beforeUnmarshal</tt> method,
@@ -1102,10 +1100,10 @@
         }
 
         /**
-         * <p/>
+         * <p>
          * Callback method invoked after unmarshalling XML data into <tt>target</tt>.
-         * <p/>
-         * <p/>
+         * </p>
+         * <p>
          * This method is invoked after all the properties (except IDREF) are unmarshalled into <tt>target</tt>,
          * but before <tt>target</tt> is set into its <tt>parent</tt> object.
          * Note that if the class of <tt>target</tt> defines its own <tt>afterUnmarshal</tt> method,
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlAnyAttribute.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlAnyAttribute.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -62,7 +62,7 @@
  * each attribute that is not statically associated with another
  * JavaBean property, via {@link XmlAttribute}, is entered into the
  * wildcard attribute map represented by
- * {@link Map}&lt;{@link QName},{@link Object}>. The attribute QName is the
+ * {@link Map}&lt;{@link QName},{@link Object}&gt;. The attribute QName is the
  * map's key. The key's value is the String value of the attribute.
  *
  * @author Kohsuke Kawaguchi, Sun Microsystems, Inc.
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlAnyElement.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlAnyElement.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -50,7 +50,6 @@
  * annotation for the other JavaBean properties on the class, is added to this
  * "catch-all" property.
  *
- * <p>
  * <h2>Usages:</h2>
  * <pre>
  * &#64;XmlAnyElement
@@ -61,7 +60,7 @@
  * public {@link Object}[] others;
  *
  * &#64;XmlAnyElement
- * private List&lt;{@link Element}> nodes;
+ * private List&lt;{@link Element}&gt; nodes;
  *
  * &#64;XmlAnyElement
  * private {@link Element} node;
@@ -88,7 +87,7 @@
  * <pre>
  * // List of java.lang.String or DOM nodes.
  * &#64;XmlAnyElement &#64;XmlMixed
- * List&lt;Object> others;
+ * List&lt;Object&gt; others;
  * </pre>
  *
  *
@@ -96,13 +95,13 @@
  *
  * The following schema would produce the following Java class:
  * <pre>
- * &lt;xs:complexType name="foo">
- *   &lt;xs:sequence>
- *     &lt;xs:element name="a" type="xs:int" />
- *     &lt;xs:element name="b" type="xs:int" />
- *     &lt;xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
- *   &lt;/xs:sequence>
- * &lt;/xs:complexType>
+ * &lt;xs:complexType name="foo"&gt;
+ *   &lt;xs:sequence&gt;
+ *     &lt;xs:element name="a" type="xs:int" /&gt;
+ *     &lt;xs:element name="b" type="xs:int" /&gt;
+ *     &lt;xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" /&gt;
+ *   &lt;/xs:sequence&gt;
+ * &lt;/xs:complexType&gt;
  * </pre>
  *
  * <pre>
@@ -110,35 +109,35 @@
  *   int a;
  *   int b;
  *   &#64;{@link XmlAnyElement}
- *   List&lt;Element> any;
+ *   List&lt;Element&gt; any;
  * }
  * </pre>
  *
  * It can unmarshal instances like
  *
  * <pre>
- * &lt;foo xmlns:e="extra">
- *   &lt;a>1</a>
- *   &lt;e:other />  // this will be bound to DOM, because unmarshalling is orderless
- *   &lt;b>3</b>
- *   &lt;e:other />
- *   &lt;c>5</c>     // this will be bound to DOM, because the annotation doesn't remember namespaces.
- * &lt;/foo>
+ * &lt;foo xmlns:e="extra"&gt;
+ *   &lt;a&gt;1&lt;/a&gt;
+ *   &lt;e:other /&gt;  // this will be bound to DOM, because unmarshalling is orderless
+ *   &lt;b&gt;3&lt;/b&gt;
+ *   &lt;e:other /&gt;
+ *   &lt;c&gt;5&lt;/c&gt;     // this will be bound to DOM, because the annotation doesn't remember namespaces.
+ * &lt;/foo&gt;
  * </pre>
  *
  *
  *
  * The following schema would produce the following Java class:
  * <pre>
- * &lt;xs:complexType name="bar">
- *   &lt;xs:complexContent>
- *   &lt;xs:extension base="foo">
- *     &lt;xs:sequence>
- *       &lt;xs:element name="c" type="xs:int" />
- *       &lt;xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
- *     &lt;/xs:sequence>
- *   &lt;/xs:extension>
- * &lt;/xs:complexType>
+ * &lt;xs:complexType name="bar"&gt;
+ *   &lt;xs:complexContent&gt;
+ *   &lt;xs:extension base="foo"&gt;
+ *     &lt;xs:sequence&gt;
+ *       &lt;xs:element name="c" type="xs:int" /&gt;
+ *       &lt;xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" /&gt;
+ *     &lt;/xs:sequence&gt;
+ *   &lt;/xs:extension&gt;
+ * &lt;/xs:complexType&gt;
  * </pre>
  *
  * <pre>
@@ -152,14 +151,14 @@
  * It can unmarshal instances like
  *
  * <pre>
- * &lt;bar xmlns:e="extra">
- *   &lt;a>1</a>
- *   &lt;e:other />  // this will be bound to DOM, because unmarshalling is orderless
- *   &lt;b>3</b>
- *   &lt;e:other />
- *   &lt;c>5</c>     // this now goes to Bar.c
- *   &lt;e:other />  // this will go to Foo.any
- * &lt;/bar>
+ * &lt;bar xmlns:e="extra"&gt;
+ *   &lt;a&gt;1&lt;/a&gt;
+ *   &lt;e:other /&gt;  // this will be bound to DOM, because unmarshalling is orderless
+ *   &lt;b&gt;3&lt;/b&gt;
+ *   &lt;e:other /&gt;
+ *   &lt;c&gt;5&lt;/c&gt;     // this now goes to Bar.c
+ *   &lt;e:other /&gt;  // this will go to Foo.any
+ * &lt;/bar&gt;
  * </pre>
  *
  *
@@ -173,13 +172,13 @@
  * <p>
  * The following schema would produce the following Java class:
  * <pre>
- * &lt;xs:complexType name="foo">
- *   &lt;xs:choice maxOccurs="unbounded" minOccurs="0">
- *     &lt;xs:element name="a" type="xs:int" />
- *     &lt;xs:element name="b" type="xs:int" />
- *     &lt;xs:any namespace="##other" processContents="lax" />
- *   &lt;/xs:choice>
- * &lt;/xs:complexType>
+ * &lt;xs:complexType name="foo"&gt;
+ *   &lt;xs:choice maxOccurs="unbounded" minOccurs="0"&gt;
+ *     &lt;xs:element name="a" type="xs:int" /&gt;
+ *     &lt;xs:element name="b" type="xs:int" /&gt;
+ *     &lt;xs:any namespace="##other" processContents="lax" /&gt;
+ *   &lt;/xs:choice&gt;
+ * &lt;/xs:complexType&gt;
  * </pre>
  *
  * <pre>
@@ -189,27 +188,27 @@
  *     &#64;{@link XmlElementRef}(name="a", type="JAXBElement.class")
  *     &#64;{@link XmlElementRef}(name="b", type="JAXBElement.class")
  *   })
- *   {@link List}&lt;{@link Object}> others;
+ *   {@link List}&lt;{@link Object}&gt; others;
  * }
  *
  * &#64;XmlRegistry
  * class ObjectFactory {
  *   ...
  *   &#64;XmlElementDecl(name = "a", namespace = "", scope = Foo.class)
- *   {@link JAXBElement}&lt;Integer> createFooA( Integer i ) { ... }
+ *   {@link JAXBElement}&lt;Integer&gt; createFooA( Integer i ) { ... }
  *
  *   &#64;XmlElementDecl(name = "b", namespace = "", scope = Foo.class)
- *   {@link JAXBElement}&lt;Integer> createFooB( Integer i ) { ... }
+ *   {@link JAXBElement}&lt;Integer&gt; createFooB( Integer i ) { ... }
  * </pre>
  *
  * It can unmarshal instances like
  *
  * <pre>
- * &lt;foo xmlns:e="extra">
- *   &lt;a>1</a>     // this will unmarshal to a {@link JAXBElement} instance whose value is 1.
- *   &lt;e:other />  // this will unmarshal to a DOM {@link Element}.
- *   &lt;b>3</b>     // this will unmarshal to a {@link JAXBElement} instance whose value is 1.
- * &lt;/foo>
+ * &lt;foo xmlns:e="extra"&gt;
+ *   &lt;a&gt;1&lt;/a&gt;     // this will unmarshal to a {@link JAXBElement} instance whose value is 1.
+ *   &lt;e:other /&gt;  // this will unmarshal to a DOM {@link Element}.
+ *   &lt;b&gt;3&lt;/b&gt;     // this will unmarshal to a {@link JAXBElement} instance whose value is 1.
+ * &lt;/foo&gt;
  * </pre>
  *
  *
@@ -227,10 +226,10 @@
  * </pre>
  * then the following document will unmarshal like this:
  * <pre>
- * &lt;foo>
- *   &lt;unknown />
- *   &lt;foo />
- * &lt;/foo>
+ * &lt;foo&gt;
+ *   &lt;unknown /&gt;
+ *   &lt;foo /&gt;
+ * &lt;/foo&gt;
  *
  * Foo foo = unmarshal();
  * // 1 for 'unknown', another for 'foo'
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlAttachmentRef.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlAttachmentRef.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -52,14 +52,14 @@
  * </pre>
  * The above code maps to the following XML:
  * <pre>
- * &lt;xs:element name="foo" xmlns:ref="http://ws-i.org/profiles/basic/1.1/xsd">
- *   &lt;xs:complexType>
- *     &lt;xs:sequence>
- *       &lt;xs:element name="body" type="ref:swaRef" minOccurs="0" />
- *     &lt;/xs:sequence>
- *     &lt;xs:attribute name="data" type="ref:swaRef" use="optional" />
- *   &lt;/xs:complexType>
- * &lt;/xs:element>
+ * &lt;xs:element name="foo" xmlns:ref="http://ws-i.org/profiles/basic/1.1/xsd"&gt;
+ *   &lt;xs:complexType&gt;
+ *     &lt;xs:sequence&gt;
+ *       &lt;xs:element name="body" type="ref:swaRef" minOccurs="0" /&gt;
+ *     &lt;/xs:sequence&gt;
+ *     &lt;xs:attribute name="data" type="ref:swaRef" use="optional" /&gt;
+ *   &lt;/xs:complexType&gt;
+ * &lt;/xs:element&gt;
  * </pre>
  *
  * <p>
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlAttribute.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlAttribute.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -56,8 +56,8 @@
  *        simple type.
  * <pre>
  *     // Examples
- *     &#64;XmlAttribute List&lt;Integer> items; //legal
- *     &#64;XmlAttribute List&lt;Bar> foo; // illegal if Bar does not map to a schema simple type
+ *     &#64;XmlAttribute List&lt;Integer&gt; items; //legal
+ *     &#64;XmlAttribute List&lt;Bar&gt; foo; // illegal if Bar does not map to a schema simple type
  * </pre>
  *   </li>
  *   <li> If the type of the field or the property is a non
@@ -80,7 +80,6 @@
  *            {@link XmlInlineBinaryData},
  *            {@link javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter}.</li>
  * </ul>
- * </p>
  *
  * <p> <b>Example 1: </b>Map a JavaBean property to an XML attribute.</p>
  * <pre>
@@ -91,12 +90,12 @@
  *         public void setPrice(java.math.BigDecimal ) {...};
  *     }
  *
- *     &lt;!-- Example: XML Schema fragment -->
- *     &lt;xs:complexType name="USPrice">
- *       &lt;xs:sequence>
- *       &lt;/xs:sequence>
- *       &lt;xs:attribute name="price" type="xs:decimal"/>
- *     &lt;/xs:complexType>
+ *     &lt;!-- Example: XML Schema fragment --&gt;
+ *     &lt;xs:complexType name="USPrice"&gt;
+ *       &lt;xs:sequence&gt;
+ *       &lt;/xs:sequence&gt;
+ *       &lt;xs:attribute name="price" type="xs:decimal"/&gt;
+ *     &lt;/xs:complexType&gt;
  * </pre>
  *
  * <p> <b>Example 2: </b>Map a JavaBean property to an XML attribute with anonymous type.</p>
@@ -107,17 +106,17 @@
  *     // Example: Code fragment
  *     class Foo {
  *         ...
- *         &#64;XmlAttribute List&lt;Integer> items;
+ *         &#64;XmlAttribute List&lt;Integer&gt; items;
  *     }
  *
- *     &lt;!-- Example: XML Schema fragment -->
- *     &lt;xs:complexType name="foo">
+ *     &lt;!-- Example: XML Schema fragment --&gt;
+ *     &lt;xs:complexType name="foo"&gt;
  *       ...
- *       &lt;xs:attribute name="items">
- *         &lt;xs:simpleType>
- *           &lt;xs:list itemType="xs:int"/>
- *         &lt;/xs:simpleType>
- *     &lt;/xs:complexType>
+ *       &lt;xs:attribute name="items"&gt;
+ *         &lt;xs:simpleType&gt;
+ *           &lt;xs:list itemType="xs:int"/&gt;
+ *         &lt;/xs:simpleType&gt;
+ *     &lt;/xs:complexType&gt;
  *
  * </pre>
  * @author Sekhar Vajjhala, Sun Microsystems, Inc.
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElement.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElement.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -83,12 +83,12 @@
  *         public java.math.BigDecimal price;
  *     }
  *
- *     &lt;!-- Example: Local XML Schema element -->
- *     &lt;xs:complexType name="USPrice"/>
- *       &lt;xs:sequence>
- *         &lt;xs:element name="itemprice" type="xs:decimal" minOccurs="0"/>
- *       &lt;/sequence>
- *     &lt;/xs:complexType>
+ *     &lt;!-- Example: Local XML Schema element --&gt;
+ *     &lt;xs:complexType name="USPrice"/&gt;
+ *       &lt;xs:sequence&gt;
+ *         &lt;xs:element name="itemprice" type="xs:decimal" minOccurs="0"/&gt;
+ *       &lt;/sequence&gt;
+ *     &lt;/xs:complexType&gt;
  *   </pre>
  * <p>
  *
@@ -101,12 +101,12 @@
  *         public java.math.BigDecimal price;
  *     }
  *
- *     &lt;!-- Example: Local XML Schema element -->
- *     &lt;xs:complexType name="USPrice">
- *       &lt;xs:sequence>
- *         &lt;xs:element name="price" type="xs:decimal" nillable="true" minOccurs="0"/>
- *       &lt;/sequence>
- *     &lt;/xs:complexType>
+ *     &lt;!-- Example: Local XML Schema element --&gt;
+ *     &lt;xs:complexType name="USPrice"&gt;
+ *       &lt;xs:sequence&gt;
+ *         &lt;xs:element name="price" type="xs:decimal" nillable="true" minOccurs="0"/&gt;
+ *       &lt;/sequence&gt;
+ *     &lt;/xs:complexType&gt;
  *   </pre>
  * <p>
  * <b> Example 3: </b> Map a field to a nillable, required element.
@@ -118,14 +118,13 @@
  *         public java.math.BigDecimal price;
  *     }
  *
- *     &lt;!-- Example: Local XML Schema element -->
- *     &lt;xs:complexType name="USPrice">
- *       &lt;xs:sequence>
- *         &lt;xs:element name="price" type="xs:decimal" nillable="true" minOccurs="1"/>
- *       &lt;/sequence>
- *     &lt;/xs:complexType>
+ *     &lt;!-- Example: Local XML Schema element --&gt;
+ *     &lt;xs:complexType name="USPrice"&gt;
+ *       &lt;xs:sequence&gt;
+ *         &lt;xs:element name="price" type="xs:decimal" nillable="true" minOccurs="1"/&gt;
+ *       &lt;/sequence&gt;
+ *     &lt;/xs:complexType&gt;
  *   </pre>
- * <p>
  *
  * <p> <b>Example 4: </b>Map a JavaBean property to an XML element
  * with anonymous type.</p>
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElementDecl.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElementDecl.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -62,23 +62,23 @@
  *     &#64;XmlRegistry
  *     class ObjectFactory {
  *         &#64;XmlElementDecl(name="foo")
- *         JAXBElement&lt;String> createFoo(String s) { ... }
+ *         JAXBElement&lt;String&gt; createFoo(String s) { ... }
  *     }
  * </pre>
  * <pre>
- *     &lt;!-- XML input -->
- *       &lt;foo>string</foo>
+ *     &lt;!-- XML input --&gt;
+ *       &lt;foo&gt;string&lt;/foo&gt;
  *
  *     // Example: code fragment corresponding to XML input
- *     JAXBElement<String> o =
- *     (JAXBElement<String>)unmarshaller.unmarshal(aboveDocument);
+ *     JAXBElement&lt;String&gt; o =
+ *     (JAXBElement&lt;String&gt;)unmarshaller.unmarshal(aboveDocument);
  *     // print JAXBElement instance to show values
  *     System.out.println(o.getName());   // prints  "{}foo"
  *     System.out.println(o.getValue());  // prints  "string"
  *     System.out.println(o.getValue().getClass()); // prints "java.lang.String"
  *
- *     &lt;!-- Example: XML schema definition -->
- *     &lt;xs:element name="foo" type="xs:string"/>
+ *     &lt;!-- Example: XML schema definition --&gt;
+ *     &lt;xs:element name="foo" type="xs:string"/&gt;
  * </pre>
  *
  * <p><b>Example 2: </b> Element declaration with non local scope
@@ -91,16 +91,16 @@
  * this javadoc.
  *
  * <pre>
- *     &lt;!-- Example: XML schema definition -->
- *     &lt;xs:schema>
- *       &lt;xs:complexType name="pea">
- *         &lt;xs:choice maxOccurs="unbounded">
- *           &lt;xs:element name="foo" type="xs:string"/>
- *           &lt;xs:element name="bar" type="xs:string"/>
- *         &lt;/xs:choice>
- *       &lt;/xs:complexType>
- *       &lt;xs:element name="foo" type="xs:int"/>
- *     &lt;/xs:schema>
+ *     &lt;!-- Example: XML schema definition --&gt;
+ *     &lt;xs:schema&gt;
+ *       &lt;xs:complexType name="pea"&gt;
+ *         &lt;xs:choice maxOccurs="unbounded"&gt;
+ *           &lt;xs:element name="foo" type="xs:string"/&gt;
+ *           &lt;xs:element name="bar" type="xs:string"/&gt;
+ *         &lt;/xs:choice&gt;
+ *       &lt;/xs:complexType&gt;
+ *       &lt;xs:element name="foo" type="xs:int"/&gt;
+ *     &lt;/xs:schema&gt;
  * </pre>
  * <pre>
  *     // Example: expected default binding
@@ -109,19 +109,19 @@
  *             &#64;XmlElementRef(name="foo",type=JAXBElement.class)
  *             &#64;XmlElementRef(name="bar",type=JAXBElement.class)
  *         })
- *         List&lt;JAXBElement&lt;String>> fooOrBar;
+ *         List&lt;JAXBElement&lt;String&gt;&gt; fooOrBar;
  *     }
  *
  *     &#64;XmlRegistry
  *     class ObjectFactory {
  *         &#64;XmlElementDecl(scope=Pea.class,name="foo")
- *         JAXBElement<String> createPeaFoo(String s);
+ *         JAXBElement&lt;String&gt; createPeaFoo(String s);
  *
  *         &#64;XmlElementDecl(scope=Pea.class,name="bar")
- *         JAXBElement<String> createPeaBar(String s);
+ *         JAXBElement&lt;String&gt; createPeaBar(String s);
  *
  *         &#64;XmlElementDecl(name="foo")
- *         JAXBElement<Integer> createFoo(Integer i);
+ *         JAXBElement&lt;Integer&gt; createFoo(Integer i);
  *     }
  *
  * </pre>
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElementRef.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElementRef.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -57,8 +57,8 @@
  * (section 5.5.5, "Element Property" of JAXB 2.0 specification). An
  * element property method signature is of the form:
  * <pre>
- *     public void setTerm(JAXBElement<? extends Operator>);
- *     public JAXBElement<? extends Operator> getTerm();
+ *     public void setTerm(JAXBElement&lt;? extends Operator&gt;);
+ *     public JAXBElement&lt;? extends Operator&gt; getTerm();
  * </pre>
  * <p>
  * An element factory method annotated with  {@link XmlElementDecl} is
@@ -106,7 +106,7 @@
  *         // element name will be derived from the &#64;XmlRootElement
  *         // annotation on the type (for e.g. "jar" for JarTask).
  *         &#64;XmlElementRef
- *         List&lt;Task> tasks;
+ *         List&lt;Task&gt; tasks;
  *     }
  *
  *     abstract class Task {
@@ -122,16 +122,16 @@
  *         ...
  *     }
  *
- *     &lt;!-- XML Schema fragment -->
- *     &lt;xs:element name="target" type="Target">
- *     &lt;xs:complexType name="Target">
- *       &lt;xs:sequence>
- *         &lt;xs:choice maxOccurs="unbounded">
- *           &lt;xs:element ref="jar">
- *           &lt;xs:element ref="javac">
- *         &lt;/xs:choice>
- *       &lt;/xs:sequence>
- *     &lt;/xs:complexType>
+ *     &lt;!-- XML Schema fragment --&gt;
+ *     &lt;xs:element name="target" type="Target"&gt;
+ *     &lt;xs:complexType name="Target"&gt;
+ *       &lt;xs:sequence&gt;
+ *         &lt;xs:choice maxOccurs="unbounded"&gt;
+ *           &lt;xs:element ref="jar"&gt;
+ *           &lt;xs:element ref="javac"&gt;
+ *         &lt;/xs:choice&gt;
+ *       &lt;/xs:sequence&gt;
+ *     &lt;/xs:complexType&gt;
  *
  * </pre>
  * <p>
@@ -144,14 +144,14 @@
  * </pre>
  * will produce the following XML output:
  * <pre>
- *     &lt;target>
- *       &lt;jar>
+ *     &lt;target&gt;
+ *       &lt;jar&gt;
  *         ....
- *       &lt;/jar>
- *       &lt;javac>
+ *       &lt;/jar&gt;
+ *       &lt;javac&gt;
  *         ....
- *       &lt;/javac>
- *     &lt;/target>
+ *       &lt;/javac&gt;
+ *     &lt;/target&gt;
  * </pre>
  * <p>
  * It is not an error to have a class that extends <tt>Task</tt>
@@ -182,17 +182,17 @@
  *         //  substituted in the XML document.
  *         //
  *         &#64;XmlElementRef(type=JAXBElement.class,name="operator")
- *         JAXBElement&lt;? extends Operator> term;
+ *         JAXBElement&lt;? extends Operator&gt; term;
  *     }
  *
  *     &#64;XmlRegistry
  *     class ObjectFactory {
  *         &#64;XmlElementDecl(name="operator")
- *         JAXBElement&lt;Operator> createOperator(Operator o) {...}
+ *         JAXBElement&lt;Operator&gt; createOperator(Operator o) {...}
  *         &#64;XmlElementDecl(name="add",substitutionHeadName="operator")
- *         JAXBElement&lt;Operator> createAdd(Operator o) {...}
+ *         JAXBElement&lt;Operator&gt; createAdd(Operator o) {...}
  *         &#64;XmlElementDecl(name="sub",substitutionHeadName="operator")
- *         JAXBElement&lt;Operator> createSub(Operator o) {...}
+ *         JAXBElement&lt;Operator&gt; createSub(Operator o) {...}
  *     }
  *
  *     class Operator {
@@ -208,9 +208,9 @@
  * </pre>
  * will produce the following XML output:
  * <pre>
- *     &lt;math>
- *       &lt;add>...&lt;/add>
- *     &lt;/math>
+ *     &lt;math&gt;
+ *       &lt;add&gt;...&lt;/add&gt;
+ *     &lt;/math&gt;
  * </pre>
  *
  *
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElementWrapper.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElementWrapper.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -44,15 +44,15 @@
  *      int[] names;
  *
  *    // XML Serialization Form 1 (Unwrapped collection)
- *    &lt;names> ... &lt;/names>
- *    &lt;names> ... &lt;/names>
+ *    &lt;names&gt; ... &lt;/names&gt;
+ *    &lt;names&gt; ... &lt;/names&gt;
  *
  *    // XML Serialization Form 2 ( Wrapped collection )
- *    &lt;wrapperElement>
- *       &lt;names> value-of-item &lt;/names>
- *       &lt;names> value-of-item &lt;/names>
+ *    &lt;wrapperElement&gt;
+ *       &lt;names&gt; value-of-item &lt;/names&gt;
+ *       &lt;names&gt; value-of-item &lt;/names&gt;
  *       ....
- *    &lt;/wrapperElement>
+ *    &lt;/wrapperElement&gt;
  * </pre>
  *
  * <p> The two serialized XML forms allow a null collection to be
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElements.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElements.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -83,21 +83,21 @@
  *    }
  *
  *    &lt;!-- XML Representation for a List of {1,2.5}
- *            XML output is not wrapped using another element -->
+ *            XML output is not wrapped using another element --&gt;
  *    ...
- *    &lt;A> 1 &lt;/A>
- *    &lt;B> 2.5 &lt;/B>
+ *    &lt;A&gt; 1 &lt;/A&gt;
+ *    &lt;B&gt; 2.5 &lt;/B&gt;
  *    ...
  *
- *    &lt;!-- XML Schema fragment -->
- *    &lt;xs:complexType name="Foo">
- *      &lt;xs:sequence>
- *        &lt;xs:choice minOccurs="0" maxOccurs="unbounded">
- *          &lt;xs:element name="A" type="xs:int"/>
- *          &lt;xs:element name="B" type="xs:float"/>
- *        &lt;xs:choice>
- *      &lt;/xs:sequence>
- *    &lt;/xs:complexType>
+ *    &lt;!-- XML Schema fragment --&gt;
+ *    &lt;xs:complexType name="Foo"&gt;
+ *      &lt;xs:sequence&gt;
+ *        &lt;xs:choice minOccurs="0" maxOccurs="unbounded"&gt;
+ *          &lt;xs:element name="A" type="xs:int"/&gt;
+ *          &lt;xs:element name="B" type="xs:float"/&gt;
+ *        &lt;xs:choice&gt;
+ *      &lt;/xs:sequence&gt;
+ *    &lt;/xs:complexType&gt;
  *
  * </pre>
  *
@@ -115,19 +115,19 @@
  *        public List items;
  *    }
  *
- *    &lt;!-- XML Schema fragment -->
- *    &lt;xs:complexType name="Foo">
- *      &lt;xs:sequence>
- *        &lt;xs:element name="bar">
- *          &lt;xs:complexType>
- *            &lt;xs:choice minOccurs="0" maxOccurs="unbounded">
- *              &lt;xs:element name="A" type="xs:int"/>
- *              &lt;xs:element name="B" type="xs:float"/>
- *            &lt;/xs:choice>
- *          &lt;/xs:complexType>
- *        &lt;/xs:element>
- *      &lt;/xs:sequence>
- *    &lt;/xs:complexType>
+ *    &lt;!-- XML Schema fragment --&gt;
+ *    &lt;xs:complexType name="Foo"&gt;
+ *      &lt;xs:sequence&gt;
+ *        &lt;xs:element name="bar"&gt;
+ *          &lt;xs:complexType&gt;
+ *            &lt;xs:choice minOccurs="0" maxOccurs="unbounded"&gt;
+ *              &lt;xs:element name="A" type="xs:int"/&gt;
+ *              &lt;xs:element name="B" type="xs:float"/&gt;
+ *            &lt;/xs:choice&gt;
+ *          &lt;/xs:complexType&gt;
+ *        &lt;/xs:element&gt;
+ *      &lt;/xs:sequence&gt;
+ *    &lt;/xs:complexType&gt;
  * </pre>
  *
  * <p><b>Example 3:</b> Change element name based on type using an adapter.
@@ -146,19 +146,19 @@
  *    &#64;XmlType(name="PX") class PX extends P {...}
  *    &#64;XmlType(name="PY") class PY extends P {...}
  *
- *    &lt;!-- XML Schema fragment -->
- *    &lt;xs:complexType name="Foo">
- *      &lt;xs:sequence>
- *        &lt;xs:element name="bar">
- *          &lt;xs:complexType>
- *            &lt;xs:choice minOccurs="0" maxOccurs="unbounded">
- *              &lt;xs:element name="A" type="PX"/>
- *              &lt;xs:element name="B" type="PY"/>
- *            &lt;/xs:choice>
- *          &lt;/xs:complexType>
- *        &lt;/xs:element>
- *      &lt;/xs:sequence>
- *    &lt;/xs:complexType>
+ *    &lt;!-- XML Schema fragment --&gt;
+ *    &lt;xs:complexType name="Foo"&gt;
+ *      &lt;xs:sequence&gt;
+ *        &lt;xs:element name="bar"&gt;
+ *          &lt;xs:complexType&gt;
+ *            &lt;xs:choice minOccurs="0" maxOccurs="unbounded"&gt;
+ *              &lt;xs:element name="A" type="PX"/&gt;
+ *              &lt;xs:element name="B" type="PY"/&gt;
+ *            &lt;/xs:choice&gt;
+ *          &lt;/xs:complexType&gt;
+ *        &lt;/xs:element&gt;
+ *      &lt;/xs:sequence&gt;
+ *    &lt;/xs:complexType&gt;
  * </pre>
  *
  * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Sekhar Vajjhala, Sun Microsystems, Inc.</li></ul>
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlEnumValue.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlEnumValue.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -56,23 +56,23 @@
  * <p> In the absence of this annotation, {@link Enum#name()} is used
  * as the XML representation.
  *
- * <p> <b>Example 1: </b>Map enum constant name -> enumeration facet</p>
+ * <p> <b>Example 1: </b>Map enum constant name -&gt; enumeration facet</p>
  * <pre>
  *     //Example: Code fragment
  *     &#64;XmlEnum(String.class)
  *     public enum Card { CLUBS, DIAMONDS, HEARTS, SPADES }
  *
- *     &lt;!-- Example: XML Schema fragment -->
- *     &lt;xs:simpleType name="Card">
- *       &lt;xs:restriction base="xs:string"/>
- *         &lt;xs:enumeration value="CLUBS"/>
- *         &lt;xs:enumeration value="DIAMONDS"/>
- *         &lt;xs:enumeration value="HEARTS"/>
- *         &lt;xs:enumeration value="SPADES"/>
- *     &lt;/xs:simpleType>
+ *     &lt;!-- Example: XML Schema fragment --&gt;
+ *     &lt;xs:simpleType name="Card"&gt;
+ *       &lt;xs:restriction base="xs:string"/&gt;
+ *         &lt;xs:enumeration value="CLUBS"/&gt;
+ *         &lt;xs:enumeration value="DIAMONDS"/&gt;
+ *         &lt;xs:enumeration value="HEARTS"/&gt;
+ *         &lt;xs:enumeration value="SPADES"/&gt;
+ *     &lt;/xs:simpleType&gt;
  * </pre>
  *
- * <p><b>Example 2: </b>Map enum constant name(value) -> enumeration facet </p>
+ * <p><b>Example 2: </b>Map enum constant name(value) -&gt; enumeration facet </p>
  * <pre>
  *     //Example: code fragment
  *     &#64;XmlType
@@ -83,18 +83,18 @@
  *         &#64;XmlEnumValue("10") DIME(10),
  *         &#64;XmlEnumValue("25") QUARTER(25) }
  *
- *     &lt;!-- Example: XML Schema fragment -->
- *     &lt;xs:simpleType name="Coin">
- *       &lt;xs:restriction base="xs:int">
- *         &lt;xs:enumeration value="1"/>
- *         &lt;xs:enumeration value="5"/>
- *         &lt;xs:enumeration value="10"/>
- *         &lt;xs:enumeration value="25"/>
- *       &lt;/xs:restriction>
- *     &lt;/xs:simpleType>
+ *     &lt;!-- Example: XML Schema fragment --&gt;
+ *     &lt;xs:simpleType name="Coin"&gt;
+ *       &lt;xs:restriction base="xs:int"&gt;
+ *         &lt;xs:enumeration value="1"/&gt;
+ *         &lt;xs:enumeration value="5"/&gt;
+ *         &lt;xs:enumeration value="10"/&gt;
+ *         &lt;xs:enumeration value="25"/&gt;
+ *       &lt;/xs:restriction&gt;
+ *     &lt;/xs:simpleType&gt;
  * </pre>
  *
- * <p><b>Example 3: </b>Map enum constant name -> enumeration facet </p>
+ * <p><b>Example 3: </b>Map enum constant name -&gt; enumeration facet </p>
  *
  * <pre>
  *     //Code fragment
@@ -105,13 +105,13 @@
  *         &#64;XmlEnumValue("2") TWO;
  *     }
  *
- *     &lt;!-- Example: XML Schema fragment -->
- *     &lt;xs:simpleType name="Code">
- *       &lt;xs:restriction base="xs:int">
- *         &lt;xs:enumeration value="1"/>
- *         &lt;xs:enumeration value="2"/>
- *       &lt;/xs:restriction>
- *     &lt;/xs:simpleType>
+ *     &lt;!-- Example: XML Schema fragment --&gt;
+ *     &lt;xs:simpleType name="Code"&gt;
+ *       &lt;xs:restriction base="xs:int"&gt;
+ *         &lt;xs:enumeration value="1"/&gt;
+ *         &lt;xs:enumeration value="2"/&gt;
+ *       &lt;/xs:restriction&gt;
+ *     &lt;/xs:simpleType&gt;
  * </pre>
  *
  * @since 1.6, JAXB 2.0
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlID.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlID.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -74,15 +74,15 @@
  *        .... other properties not shown
  *    }
  *
- *    &lt;!-- Example: XML Schema fragment -->
- *    &lt;xs:complexType name="Customer">
- *      &lt;xs:complexContent>
- *        &lt;xs:sequence>
+ *    &lt;!-- Example: XML Schema fragment --&gt;
+ *    &lt;xs:complexType name="Customer"&gt;
+ *      &lt;xs:complexContent&gt;
+ *        &lt;xs:sequence&gt;
  *          ....
- *        &lt;/xs:sequence>
- *        &lt;xs:attribute name="customerID" type="xs:ID"/>
- *      &lt;/xs:complexContent>
- *    &lt;/xs:complexType>
+ *        &lt;/xs:sequence&gt;
+ *        &lt;xs:attribute name="customerID" type="xs:ID"/&gt;
+ *      &lt;/xs:complexContent&gt;
+ *    &lt;/xs:complexType&gt;
  * </pre>
  *
  * @author Sekhar Vajjhala, Sun Microsystems, Inc.
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlIDREF.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlIDREF.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -83,15 +83,15 @@
  *       ....
  *    }
  *
- *   &lt;!-- Example: XML Schema fragment -->
- *   &lt;xs:complexType name="Shipping">
- *     &lt;xs:complexContent>
- *       &lt;xs:sequence>
- *         &lt;xs:element name="customer" type="xs:IDREF"/>
+ *   &lt;!-- Example: XML Schema fragment --&gt;
+ *   &lt;xs:complexType name="Shipping"&gt;
+ *     &lt;xs:complexContent&gt;
+ *       &lt;xs:sequence&gt;
+ *         &lt;xs:element name="customer" type="xs:IDREF"/&gt;
  *         ....
- *       &lt;/xs:sequence>
- *     &lt;/xs:complexContent>
- *   &lt;/xs:complexType>
+ *       &lt;/xs:sequence&gt;
+ *     &lt;/xs:complexContent&gt;
+ *   &lt;/xs:complexType&gt;
  *
  * </pre>
  *
@@ -143,61 +143,61 @@
  *       public Invoice getInvoice();
  *   }
  *
- *   &lt;!-- XML Schema mapping for above code frament -->
+ *   &lt;!-- XML Schema mapping for above code frament --&gt;
  *
- *   &lt;xs:complexType name="Invoice">
- *     &lt;xs:complexContent>
- *       &lt;xs:sequence>
- *         &lt;xs:element name="customer" type="xs:IDREF"/>
+ *   &lt;xs:complexType name="Invoice"&gt;
+ *     &lt;xs:complexContent&gt;
+ *       &lt;xs:sequence&gt;
+ *         &lt;xs:element name="customer" type="xs:IDREF"/&gt;
  *         ....
- *       &lt;/xs:sequence>
- *     &lt;/xs:complexContent>
- *   &lt;/xs:complexType>
+ *       &lt;/xs:sequence&gt;
+ *     &lt;/xs:complexContent&gt;
+ *   &lt;/xs:complexType&gt;
  *
- *   &lt;xs:complexType name="Shipping">
- *     &lt;xs:complexContent>
- *       &lt;xs:sequence>
- *         &lt;xs:element name="customer" type="xs:IDREF"/>
+ *   &lt;xs:complexType name="Shipping"&gt;
+ *     &lt;xs:complexContent&gt;
+ *       &lt;xs:sequence&gt;
+ *         &lt;xs:element name="customer" type="xs:IDREF"/&gt;
  *         ....
- *       &lt;/xs:sequence>
- *     &lt;/xs:complexContent>
- *   &lt;/xs:complexType>
+ *       &lt;/xs:sequence&gt;
+ *     &lt;/xs:complexContent&gt;
+ *   &lt;/xs:complexType&gt;
  *
- *   &lt;xs:complexType name="Customer">
- *     &lt;xs:complexContent>
- *       &lt;xs:sequence>
+ *   &lt;xs:complexType name="Customer"&gt;
+ *     &lt;xs:complexContent&gt;
+ *       &lt;xs:sequence&gt;
  *         ....
- *       &lt;/xs:sequence>
- *       &lt;xs:attribute name="CustomerID" type="xs:ID"/>
- *     &lt;/xs:complexContent>
- *   &lt;/xs:complexType>
+ *       &lt;/xs:sequence&gt;
+ *       &lt;xs:attribute name="CustomerID" type="xs:ID"/&gt;
+ *     &lt;/xs:complexContent&gt;
+ *   &lt;/xs:complexType&gt;
  *
- *   &lt;xs:complexType name="CustomerData">
- *     &lt;xs:complexContent>
- *       &lt;xs:sequence>
- *         &lt;xs:element name="customer" type="xs:Customer"/>
- *         &lt;xs:element name="shipping" type="xs:Shipping"/>
- *         &lt;xs:element name="invoice"  type="xs:Invoice"/>
- *       &lt;/xs:sequence>
- *     &lt;/xs:complexContent>
- *   &lt;/xs:complexType>
+ *   &lt;xs:complexType name="CustomerData"&gt;
+ *     &lt;xs:complexContent&gt;
+ *       &lt;xs:sequence&gt;
+ *         &lt;xs:element name="customer" type="xs:Customer"/&gt;
+ *         &lt;xs:element name="shipping" type="xs:Shipping"/&gt;
+ *         &lt;xs:element name="invoice"  type="xs:Invoice"/&gt;
+ *       &lt;/xs:sequence&gt;
+ *     &lt;/xs:complexContent&gt;
+ *   &lt;/xs:complexType&gt;
  *
- *   &lt;xs:element name"customerData" type="xs:CustomerData"/>
+ *   &lt;xs:element name"customerData" type="xs:CustomerData"/&gt;
  *
- *   &lt;!-- Instance document conforming to the above XML Schema -->
- *    &lt;customerData>
- *       &lt;customer customerID="Alice">
+ *   &lt;!-- Instance document conforming to the above XML Schema --&gt;
+ *    &lt;customerData&gt;
+ *       &lt;customer customerID="Alice"&gt;
  *           ....
- *       &lt;/customer>
+ *       &lt;/customer&gt;
  *
- *       &lt;shipping customer="Alice">
+ *       &lt;shipping customer="Alice"&gt;
  *           ....
- *       &lt;/shipping>
+ *       &lt;/shipping&gt;
  *
- *       &lt;invoice customer="Alice">
+ *       &lt;invoice customer="Alice"&gt;
  *           ....
- *       &lt;/invoice>
- *   &lt;/customerData>
+ *       &lt;/invoice&gt;
+ *   &lt;/customerData&gt;
  *
  * </pre>
  *
@@ -210,14 +210,14 @@
  *             public List customers;
  *     }
  *
- *     &lt;!-- XML schema fragment -->
- *     &lt;xs:complexType name="Shipping">
- *       &lt;xs:sequence>
- *         &lt;xs:choice minOccurs="0" maxOccurs="unbounded">
- *           &lt;xs:element name="Alice" type="xs:IDREF"/>
- *         &lt;/xs:choice>
- *       &lt;/xs:sequence>
- *     &lt;/xs:complexType>
+ *     &lt;!-- XML schema fragment --&gt;
+ *     &lt;xs:complexType name="Shipping"&gt;
+ *       &lt;xs:sequence&gt;
+ *         &lt;xs:choice minOccurs="0" maxOccurs="unbounded"&gt;
+ *           &lt;xs:element name="Alice" type="xs:IDREF"/&gt;
+ *         &lt;/xs:choice&gt;
+ *       &lt;/xs:sequence&gt;
+ *     &lt;/xs:complexType&gt;
  * </pre>
  *
  * <p><b>Example 4: </b> Mapping a List to a list of elements of type IDREF.
@@ -231,15 +231,15 @@
  *         public List customers;
  *     }
  *
- *     &lt;!-- XML Schema fragment -->
- *     &lt;xs:complexType name="Shipping">
- *       &lt;xs:sequence>
- *         &lt;xs:choice minOccurs="0" maxOccurs="unbounded">
- *           &lt;xs:element name="Alice" type="xs:IDREF"/>
- *           &lt;xs:element name="John" type="xs:IDREF"/>
- *         &lt;/xs:choice>
- *       &lt;/xs:sequence>
- *     &lt;/xs:complexType>
+ *     &lt;!-- XML Schema fragment --&gt;
+ *     &lt;xs:complexType name="Shipping"&gt;
+ *       &lt;xs:sequence&gt;
+ *         &lt;xs:choice minOccurs="0" maxOccurs="unbounded"&gt;
+ *           &lt;xs:element name="Alice" type="xs:IDREF"/&gt;
+ *           &lt;xs:element name="John" type="xs:IDREF"/&gt;
+ *         &lt;/xs:choice&gt;
+ *       &lt;/xs:sequence&gt;
+ *     &lt;/xs:complexType&gt;
  * </pre>
  * @author Sekhar Vajjhala, Sun Microsystems, Inc.
  * @see XmlID
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlList.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlList.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -53,17 +53,17 @@
  * &#64;XmlRootElement
  * class Foo {
  *     &#64;XmlElement
- *     List&lt;String> data;
+ *     List&lt;String&gt; data;
  * }
  * </pre>
  *
  * would produce XML like this:
  *
  * <pre>
- * &lt;foo>
- *   &lt;data>abc</data>
- *   &lt;data>def</data>
- * &lt;/foo>
+ * &lt;foo&gt;
+ *   &lt;data&gt;abc&lt;/data&gt;
+ *   &lt;data&gt;def&lt;/data&gt;
+ * &lt;/foo&gt;
  * </pre>
  *
  * &#64;XmlList annotation, on the other hand, allows multiple values to be
@@ -74,16 +74,16 @@
  * class Foo {
  *     &#64;XmlElement
  *     &#64;XmlList
- *     List&lt;String> data;
+ *     List&lt;String&gt; data;
  * }
  * </pre>
  *
  * the above code will produce XML like this:
  *
  * <pre>
- * &lt;foo>
- *   &lt;data>abc def</data>
- * &lt;/foo>
+ * &lt;foo&gt;
+ *   &lt;data&gt;abc def&lt;/data&gt;
+ * &lt;/foo&gt;
  * </pre>
  *
  * <p>This annotation can be used with the following annotations:
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlMixed.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlMixed.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -57,16 +57,16 @@
  *
  * Below is an example of binding and creation of mixed content.
  * <pre>
- *  &lt;!-- schema fragment having  mixed content -->
- *  &lt;xs:complexType name="letterBody" mixed="true">
- *    &lt;xs:sequence>
- *      &lt;xs:element name="name" type="xs:string"/>
- *      &lt;xs:element name="quantity" type="xs:positiveInteger"/>
- *      &lt;xs:element name="productName" type="xs:string"/>
- *      &lt;!-- etc. -->
- *    &lt;/xs:sequence>
- *  &lt;/xs:complexType>
- *  &lt;xs:element name="letterBody" type="letterBody"/>
+ *  &lt;!-- schema fragment having  mixed content --&gt;
+ *  &lt;xs:complexType name="letterBody" mixed="true"&gt;
+ *    &lt;xs:sequence&gt;
+ *      &lt;xs:element name="name" type="xs:string"/&gt;
+ *      &lt;xs:element name="quantity" type="xs:positiveInteger"/&gt;
+ *      &lt;xs:element name="productName" type="xs:string"/&gt;
+ *      &lt;!-- etc. --&gt;
+ *    &lt;/xs:sequence&gt;
+ *  &lt;/xs:complexType&gt;
+ *  &lt;xs:element name="letterBody" type="letterBody"/&gt;
  *
  * // Schema-derived Java code:
  * // (Only annotations relevant to mixed content are shown below,
@@ -74,12 +74,12 @@
  * import java.math.BigInteger;
  * public class ObjectFactory {
  *      // element instance factories
- *      JAXBElement&lt;LetterBody> createLetterBody(LetterBody value);
- *      JAXBElement&lt;String>     createLetterBodyName(String value);
- *      JAXBElement&lt;BigInteger> createLetterBodyQuantity(BigInteger value);
- *      JAXBElement&lt;String>     createLetterBodyProductName(String value);
+ *      JAXBElement&lt;LetterBody&gt; createLetterBody(LetterBody value);
+ *      JAXBElement&lt;String&gt;     createLetterBodyName(String value);
+ *      JAXBElement&lt;BigInteger&gt; createLetterBodyQuantity(BigInteger value);
+ *      JAXBElement&lt;String&gt;     createLetterBodyProductName(String value);
  *      // type instance factory
- *      LetterBody> createLetterBody();
+ *      LetterBody createLetterBody();
  * }
  * </pre>
  * <pre>
@@ -97,16 +97,16 @@
  * </pre>
  * The following is an XML instance document with mixed content
  * <pre>
- * &lt;letterBody>
- * Dear Mr.&lt;name>Robert Smith&lt;/name>
- * Your order of &lt;quantity>1&lt;/quantity> &lt;productName>Baby
- * Monitor&lt;/productName> shipped from our warehouse. ....
- * &lt;/letterBody>
+ * &lt;letterBody&gt;
+ * Dear Mr.&lt;name&gt;Robert Smith&lt;/name&gt;
+ * Your order of &lt;quantity&gt;1&lt;/quantity&gt; &lt;productName&gt;Baby
+ * Monitor&lt;/productName&gt; shipped from our warehouse. ....
+ * &lt;/letterBody&gt;
  * </pre>
  * that can be constructed using following JAXB API calls.
  * <pre>
  * LetterBody lb = ObjectFactory.createLetterBody();
- * JAXBElement&lt;LetterBody> lbe = ObjectFactory.createLetterBody(lb);
+ * JAXBElement&lt;LetterBody&gt; lbe = ObjectFactory.createLetterBody(lb);
  * List gcl = lb.getContent();  //add mixed content to general content property.
  * gcl.add("Dear Mr.");  // add text information item as a String.
  *
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlNsForm.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlNsForm.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -36,8 +36,7 @@
  * The namespace qualification values are used in the annotations
  * defined in this packge. The enumeration values are mapped as follows:
  *
- * <p>
- * <table border="1" cellpadding="4" cellspacing="3">
+ * <table summary="" border="1" cellpadding="4" cellspacing="3">
  *   <tbody>
  *     <tr>
  *       <td><b>Enum Value</b></td>
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlRootElement.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlRootElement.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -54,7 +54,7 @@
  * <p> This annotation can be used with the following annotations:
  * {@link XmlType}, {@link XmlEnum}, {@link XmlAccessorType},
  * {@link XmlAccessorOrder}.
- * <p>
+ * </p>
 
  * <p>
  * <b>Example 1: </b> Associate an element with XML Schema type
@@ -74,11 +74,11 @@
  * </pre>
  *
  * <pre>
- *     &lt;!-- Example: XML output -->
- *     &lt;point>
- *       &lt;x> 3 </x>
- *       &lt;y> 5 </y>
- *     &lt;/point>
+ *     &lt;!-- Example: XML output --&gt;
+ *     &lt;point&gt;
+ *       &lt;x&gt; 3 &lt;/x&gt;
+ *       &lt;y&gt; 5 &lt;/y&gt;
+ *     &lt;/point&gt;
  * </pre>
  *
  * The annotation causes an global element declaration to be produced
@@ -86,14 +86,14 @@
  * the XML schema type to which the class is mapped.
  *
  * <pre>
- *     &lt;!-- Example: XML schema definition -->
- *     &lt;xs:element name="point" type="point"/>
- *     &lt;xs:complexType name="point">
- *       &lt;xs:sequence>
- *         &lt;xs:element name="x" type="xs:int"/>
- *         &lt;xs:element name="y" type="xs:int"/>
- *       &lt;/xs:sequence>
- *     &lt;/xs:complexType>
+ *     &lt;!-- Example: XML schema definition --&gt;
+ *     &lt;xs:element name="point" type="point"/&gt;
+ *     &lt;xs:complexType name="point"&gt;
+ *       &lt;xs:sequence&gt;
+ *         &lt;xs:element name="x" type="xs:int"/&gt;
+ *         &lt;xs:element name="y" type="xs:int"/&gt;
+ *       &lt;/xs:sequence&gt;
+ *     &lt;/xs:complexType&gt;
  * </pre>
  *
  * <p>
@@ -114,25 +114,25 @@
  *     //Example: Code fragment corresponding to XML output *
  *     marshal( new Point3D(3,5,0), System.out );
  *
- *     &lt;!-- Example: XML output -->
- *     &lt;!-- The element name is point3D not point -->
- *     &lt;point3D>
- *       &lt;x>3&lt;/x>
- *       &lt;y>5&lt;/y>
- *       &lt;z>0&lt;/z>
- *     &lt;/point3D>
+ *     &lt;!-- Example: XML output --&gt;
+ *     &lt;!-- The element name is point3D not point --&gt;
+ *     &lt;point3D&gt;
+ *       &lt;x&gt;3&lt;/x&gt;
+ *       &lt;y&gt;5&lt;/y&gt;
+ *       &lt;z&gt;0&lt;/z&gt;
+ *     &lt;/point3D&gt;
  *
- *     &lt;!-- Example: XML schema definition -->
- *     &lt;xs:element name="point3D" type="point3D"/>
- *     &lt;xs:complexType name="point3D">
- *       &lt;xs:complexContent>
- *         &lt;xs:extension base="point">
- *           &lt;xs:sequence>
- *             &lt;xs:element name="z" type="xs:int"/>
- *           &lt;/xs:sequence>
- *         &lt;/xs:extension>
- *       &lt;/xs:complexContent>
- *     &lt;/xs:complexType>
+ *     &lt;!-- Example: XML schema definition --&gt;
+ *     &lt;xs:element name="point3D" type="point3D"/&gt;
+ *     &lt;xs:complexType name="point3D"&gt;
+ *       &lt;xs:complexContent&gt;
+ *         &lt;xs:extension base="point"&gt;
+ *           &lt;xs:sequence&gt;
+ *             &lt;xs:element name="z" type="xs:int"/&gt;
+ *           &lt;/xs:sequence&gt;
+ *         &lt;/xs:extension&gt;
+ *       &lt;/xs:complexContent&gt;
+ *     &lt;/xs:complexType&gt;
  * </pre>
  *
  * <b>Example 3: </b> Associate a global element with XML Schema type
@@ -145,13 +145,13 @@
  *         public java.math.BigDecimal price;
  *     }
  *
- *     &lt;!-- Example: XML schema definition -->
- *     &lt;xs:element name="PriceElement" type="USPrice"/>
- *     &lt;xs:complexType name="USPrice">
- *       &lt;xs:sequence>
- *         &lt;xs:element name="price" type="xs:decimal"/>
- *       &lt;/sequence>
- *     &lt;/xs:complexType>
+ *     &lt;!-- Example: XML schema definition --&gt;
+ *     &lt;xs:element name="PriceElement" type="USPrice"/&gt;
+ *     &lt;xs:complexType name="USPrice"&gt;
+ *       &lt;xs:sequence&gt;
+ *         &lt;xs:element name="price" type="xs:decimal"/&gt;
+ *       &lt;/sequence&gt;
+ *     &lt;/xs:complexType&gt;
  * </pre>
  *
  * @author Sekhar Vajjhala, Sun Microsystems, Inc.
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlSchema.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlSchema.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -55,7 +55,6 @@
  *        will allow the package level annotations to be defined in
  *        package-info.java.
  * </ul>
- * <p>
  *
  * <p><b>Example 1:</b> Customize name of XML namespace to which
  * package is mapped.</p>
@@ -65,14 +64,14 @@
  *      namespace = "http://www.example.com/MYPO1"
  *    )
  *
- *    &lt;!-- XML Schema fragment -->
+ *    &lt;!-- XML Schema fragment --&gt;
  *    &lt;schema
  *      xmlns=...
  *      xmlns:po=....
  *      targetNamespace="http://www.example.com/MYPO1"
- *    >
+ *    &gt;
  *    &lt;!-- prefixes generated by default are implementation
- *            depedenent -->
+ *            depedenent --&gt;
  * </pre>
  *
  * <p><b>Example 2:</b> Customize namespace prefix, namespace URI
@@ -90,11 +89,11 @@
  *      )
  *    )
  *
- *    &lt;!-- XML Schema fragment -->
+ *    &lt;!-- XML Schema fragment --&gt;
  *    &lt;schema
  *        xmlns:xs="http://www.w3.org/2001/XMLSchema"
  *        xmlns:po="http://www.example.com/PO1"
- *        targetNamespace="http://www.example.com/PO1">
+ *        targetNamespace="http://www.example.com/PO1"&gt;
  *
  * </pre>
  *
@@ -105,11 +104,11 @@
  *      ...
  *    )
  *
- *    &lt;!-- XML Schema fragment -->
+ *    &lt;!-- XML Schema fragment --&gt;
  *    &lt;schema
  *        xmlns="http://www.w3.org/2001/XMLSchema"
  *        xmlns:po="http://www.example.com/PO1"
- *        elementFormDefault="unqualified">
+ *        elementFormDefault="unqualified"&gt;
  *
  * </pre>
 
@@ -180,11 +179,11 @@
      * More precisely, the value must be either <tt>""</tt>, <tt>"##generate"</tt>, or
      * <a href="http://www.w3.org/TR/xmlschema-2/#anyURI">
      * a valid lexical representation of <tt>xs:anyURI</tt></a> that begins
-     * with <tt>&lt;scheme>:</tt>.
+     * with <tt>&lt;scheme&gt;:</tt>.
      *
      * <p>
      * A schema generator is expected to generate a corresponding
-     * <tt>&lt;xs:import namespace="..." schemaLocation="..."/></tt> (or
+     * <tt>&lt;xs:import namespace="..." schemaLocation="..."/&gt;</tt> (or
      * no <tt>schemaLocation</tt> attribute at all if the empty string is specified.)
      * However, the schema generator is allowed to use a different value in
      * the <tt>schemaLocation</tt> attribute (including not generating
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlSchemaType.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlSchemaType.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -66,12 +66,12 @@
  *         public XMLGregorianCalendar date;
  *     }
  *
- *     &lt;!-- Example: Local XML Schema element -->
- *     &lt;xs:complexType name="USPrice"/>
- *       &lt;xs:sequence>
- *         &lt;xs:element name="date" type="xs:date"/>
- *       &lt;/sequence>
- *     &lt;/xs:complexType>
+ *     &lt;!-- Example: Local XML Schema element --&gt;
+ *     &lt;xs:complexType name="USPrice"/&gt;
+ *       &lt;xs:sequence&gt;
+ *         &lt;xs:element name="date" type="xs:date"/&gt;
+ *       &lt;/sequence&gt;
+ *     &lt;/xs:complexType&gt;
  * </pre>
  *
  * <p> <b> Example 2: </b> Customize mapping of XMLGregorianCalendar at package
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlTransient.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlTransient.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -79,12 +79,12 @@
  *   }
  *
  *
- *   &lt;!-- Example: XML Schema fragment -->
- *   &lt;xs:complexType name="USAddress">
- *     &lt;xs:sequence>
- *       &lt;xs:element name="name" type="xs:string"/>
- *     &lt;/xs:sequence>
- *   &lt;/xs:complexType>
+ *   &lt;!-- Example: XML Schema fragment --&gt;
+ *   &lt;xs:complexType name="USAddress"&gt;
+ *     &lt;xs:sequence&gt;
+ *       &lt;xs:element name="name" type="xs:string"/&gt;
+ *     &lt;/xs:sequence&gt;
+ *   &lt;/xs:complexType&gt;
  * </pre>
  *
  * @author Sekhar Vajjhala, Sun Microsystems, Inc.
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlType.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlType.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -64,7 +64,7 @@
  * mapping of JavaBean properties and fields contained within the
  * class. The schema type to which the class is mapped can either be
  * named or anonymous. A class can be mapped to an anonymous schema
- * type by annotating the class with <tt>&#64XmlType(name="")</tt>.
+ * type by annotating the class with <tt>&#64;XmlType(name="")</tt>.
  * <p>
  * Either a global element, local element or a local attribute can be
  * associated with an anonymous type as follows:
@@ -112,14 +112,14 @@
  * The following table shows the mapping of the class to a XML Schema
  * complex type or simple type. The notational symbols used in the table are:
  * <ul>
- *   <li> ->    : represents a mapping </li>
+ *   <li> -&gt;    : represents a mapping </li>
  *   <li> [x]+  : one or more occurances of x </li>
  *   <li> [ <tt>@XmlValue</tt> property ]: JavaBean property annotated with
  *         <tt>@XmlValue</tt></li>
  *   <li> X     : don't care
  * </ul>
  * <blockquote>
- *   <table border="1" cellpadding="4" cellspacing="3">
+ *   <table summary="" border="1" cellpadding="4" cellspacing="3">
  *     <tbody>
  *       <tr>
  *         <td><b>Target</b></td>
@@ -132,7 +132,7 @@
  *       <tr valign="top">
  *         <td>Class</td>
  *         <td>{}</td>
- *         <td>[property]+ -> elements</td>
+ *         <td>[property]+ -&gt; elements</td>
  *         <td>complexcontent<br>xs:all</td>
  *         <td> </td>
  *       </tr>
@@ -140,7 +140,7 @@
  *       <tr valign="top">
  *         <td>Class</td>
  *         <td>non empty</td>
- *         <td>[property]+ -> elements</td>
+ *         <td>[property]+ -&gt; elements</td>
  *         <td>complexcontent<br>xs:sequence</td>
  *         <td> </td>
  *       </tr>
@@ -148,7 +148,7 @@
  *       <tr valign="top">
  *         <td>Class</td>
  *         <td>X</td>
- *         <td>no property -> element</td>
+ *         <td>no property -&gt; element</td>
  *         <td>complexcontent<br>empty sequence</td>
  *         <td> </td>
  *       </tr>
@@ -156,8 +156,7 @@
  *       <tr valign="top">
  *         <td>Class</td>
  *         <td>X</td>
- *         <td>1 [ <tt>@XmlValue</tt> property] && <br> [property]+
- *             ->attributes</td>
+ *         <td>1 [<tt>@XmlValue</tt> property] {@literal &&} <br> [property]+ -&gt; attributes</td>
  *         <td>simplecontent</td>
  *         <td> </td>
  *       </tr>
@@ -165,11 +164,9 @@
  *       <tr valign="top">
  *         <td>Class</td>
  *         <td>X</td>
- *         <td>1 [ <tt>@XmlValue</tt> property ]&& <br> no properties
- *         -> attribute</td>
+ *         <td>1 [<tt>@XmlValue</tt> property] {@literal &&} <br> no properties -&gt; attribute</td>
  *         <td> </td>
  *         <td>simpletype</td>
- *         <td> </td>
  *       </tr>
  *     </tbody>
  *   </table>
@@ -212,16 +209,16 @@
  *     void setZip(java.math.BigDecimal) {..};
  *   }
  *
- *   &lt;!-- XML Schema mapping for USAddress -->
- *   &lt;xs:complexType name="USAddress">
- *     &lt;xs:sequence>
- *       &lt;xs:element name="street" type="xs:string"/>
- *       &lt;xs:element name="city" type="xs:string"/>
- *       &lt;xs:element name="state" type="xs:string"/>
- *       &lt;xs:element name="zip" type="xs:decimal"/>
- *       &lt;xs:element name="name" type="xs:string"/>
- *     &lt;/xs:all>
- *   &lt;/xs:complexType>
+ *   &lt;!-- XML Schema mapping for USAddress --&gt;
+ *   &lt;xs:complexType name="USAddress"&gt;
+ *     &lt;xs:sequence&gt;
+ *       &lt;xs:element name="street" type="xs:string"/&gt;
+ *       &lt;xs:element name="city" type="xs:string"/&gt;
+ *       &lt;xs:element name="state" type="xs:string"/&gt;
+ *       &lt;xs:element name="zip" type="xs:decimal"/&gt;
+ *       &lt;xs:element name="name" type="xs:string"/&gt;
+ *     &lt;/xs:all&gt;
+ *   &lt;/xs:complexType&gt;
  * </pre>
  * <p> <b> Example 2: </b> Map a class to a complex type with
  *     xs:all </p>
@@ -229,16 +226,16 @@
  * &#64;XmlType(propOrder={})
  * public class USAddress { ...}
  *
- * &lt;!-- XML Schema mapping for USAddress -->
- * &lt;xs:complexType name="USAddress">
- *   &lt;xs:all>
- *     &lt;xs:element name="name" type="xs:string"/>
- *     &lt;xs:element name="street" type="xs:string"/>
- *     &lt;xs:element name="city" type="xs:string"/>
- *     &lt;xs:element name="state" type="xs:string"/>
- *     &lt;xs:element name="zip" type="xs:decimal"/>
- *   &lt;/xs:sequence>
- * &lt;/xs:complexType>
+ * &lt;!-- XML Schema mapping for USAddress --&gt;
+ * &lt;xs:complexType name="USAddress"&gt;
+ *   &lt;xs:all&gt;
+ *     &lt;xs:element name="name" type="xs:string"/&gt;
+ *     &lt;xs:element name="street" type="xs:string"/&gt;
+ *     &lt;xs:element name="city" type="xs:string"/&gt;
+ *     &lt;xs:element name="state" type="xs:string"/&gt;
+ *     &lt;xs:element name="zip" type="xs:decimal"/&gt;
+ *   &lt;/xs:sequence&gt;
+ * &lt;/xs:complexType&gt;
  *</pre>
  * <p> <b> Example 3: </b> Map a class to a global element with an
  * anonymous type.
@@ -248,22 +245,22 @@
  *   &#64;XmlType(name="")
  *   public class USAddress { ...}
  *
- *   &lt;!-- XML Schema mapping for USAddress -->
- *   &lt;xs:element name="USAddress">
- *     &lt;xs:complexType>
- *       &lt;xs:sequence>
- *         &lt;xs:element name="name" type="xs:string"/>
- *         &lt;xs:element name="street" type="xs:string"/>
- *         &lt;xs:element name="city" type="xs:string"/>
- *         &lt;xs:element name="state" type="xs:string"/>
- *         &lt;xs:element name="zip" type="xs:decimal"/>
- *       &lt;/xs:sequence>
- *     &lt;/xs:complexType>
- *   &lt;/xs:element>
+ *   &lt;!-- XML Schema mapping for USAddress --&gt;
+ *   &lt;xs:element name="USAddress"&gt;
+ *     &lt;xs:complexType&gt;
+ *       &lt;xs:sequence&gt;
+ *         &lt;xs:element name="name" type="xs:string"/&gt;
+ *         &lt;xs:element name="street" type="xs:string"/&gt;
+ *         &lt;xs:element name="city" type="xs:string"/&gt;
+ *         &lt;xs:element name="state" type="xs:string"/&gt;
+ *         &lt;xs:element name="zip" type="xs:decimal"/&gt;
+ *       &lt;/xs:sequence&gt;
+ *     &lt;/xs:complexType&gt;
+ *   &lt;/xs:element&gt;
  * </pre>
  *
  * <p> <b> Example 4: </b> Map a property to a local element with
- * anonmyous type.
+ * anonymous type.
  * <pre>
  *   //Example: Code fragment
  *   public class Invoice {
@@ -275,20 +272,20 @@
  *   public class USAddress { ... }
  *   }
  *
- *   &lt;!-- XML Schema mapping for USAddress -->
- *   &lt;xs:complexType name="Invoice">
- *     &lt;xs:sequence>
- *       &lt;xs:element name="addr">
- *         &lt;xs:complexType>
- *           &lt;xs:element name="name", type="xs:string"/>
- *           &lt;xs:element name="city", type="xs:string"/>
- *           &lt;xs:element name="city" type="xs:string"/>
- *           &lt;xs:element name="state" type="xs:string"/>
- *           &lt;xs:element name="zip" type="xs:decimal"/>
- *         &lt;/xs:complexType>
+ *   &lt;!-- XML Schema mapping for USAddress --&gt;
+ *   &lt;xs:complexType name="Invoice"&gt;
+ *     &lt;xs:sequence&gt;
+ *       &lt;xs:element name="addr"&gt;
+ *         &lt;xs:complexType&gt;
+ *           &lt;xs:element name="name", type="xs:string"/&gt;
+ *           &lt;xs:element name="city", type="xs:string"/&gt;
+ *           &lt;xs:element name="city" type="xs:string"/&gt;
+ *           &lt;xs:element name="state" type="xs:string"/&gt;
+ *           &lt;xs:element name="zip" type="xs:decimal"/&gt;
+ *         &lt;/xs:complexType&gt;
  *       ...
- *     &lt;/xs:sequence>
- *   &lt;/xs:complexType>
+ *     &lt;/xs:sequence&gt;
+ *   &lt;/xs:complexType&gt;
  * </pre>
  *
  * <p> <b> Example 5: </b> Map a property to an attribute with
@@ -310,17 +307,17 @@
  *         public java.math.BigDecimal price;
  *     }
  *
- *     &lt;!-- Example: XML Schema fragment -->
- *     &lt;xs:complexType name="Item">
- *       &lt;xs:sequence>
- *         &lt;xs:element name="name" type="xs:string"/>
- *         &lt;xs:attribute name="price">
- *           &lt;xs:simpleType>
- *             &lt;xs:restriction base="xs:decimal"/>
- *           &lt;/xs:simpleType>
- *         &lt;/xs:attribute>
- *       &lt;/xs:sequence>
- *     &lt;/xs:complexType>
+ *     &lt;!-- Example: XML Schema fragment --&gt;
+ *     &lt;xs:complexType name="Item"&gt;
+ *       &lt;xs:sequence&gt;
+ *         &lt;xs:element name="name" type="xs:string"/&gt;
+ *         &lt;xs:attribute name="price"&gt;
+ *           &lt;xs:simpleType&gt;
+ *             &lt;xs:restriction base="xs:decimal"/&gt;
+ *           &lt;/xs:simpleType&gt;
+ *         &lt;/xs:attribute&gt;
+ *       &lt;/xs:sequence&gt;
+ *     &lt;/xs:complexType&gt;
  * </pre>
  *
  *  <p> <b> Example 6: </b> Define a factoryClass and factoryMethod
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlValue.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlValue.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -67,7 +67,6 @@
  *       type, then the type must map to a XML Schema simple type. </li>
  *
  * </ul>
- * </p>
  * <p>
  * If the annotated JavaBean property is the sole class member being
  * mapped to XML Schema construct, then the class is mapped to a
@@ -89,10 +88,10 @@
  *         public java.math.BigDecimal price;
  *     }
  *
- *     &lt;!-- Example 1: XML Schema fragment -->
- *     &lt;xs:simpleType name="USPrice">
- *       &lt;xs:restriction base="xs:decimal"/>
- *     &lt;/xs:simpleType>
+ *     &lt;!-- Example 1: XML Schema fragment --&gt;
+ *     &lt;xs:simpleType name="USPrice"&gt;
+ *       &lt;xs:restriction base="xs:decimal"/&gt;
+ *     &lt;/xs:simpleType&gt;
  *
  *   </pre>
  *
@@ -110,17 +109,16 @@
  *       public String currency;
  *   }
  *
- *   &lt;!-- Example 2: XML Schema fragment -->
- *   &lt;xs:complexType name="InternationalPrice">
- *     &lt;xs:simpleContent>
- *       &lt;xs:extension base="xs:decimal">
- *         &lt;xs:attribute name="currency" type="xs:string"/>
- *       &lt;/xs:extension>
- *     &lt;/xs:simpleContent>
- *   &lt;/xs:complexType>
+ *   &lt;!-- Example 2: XML Schema fragment --&gt;
+ *   &lt;xs:complexType name="InternationalPrice"&gt;
+ *     &lt;xs:simpleContent&gt;
+ *       &lt;xs:extension base="xs:decimal"&gt;
+ *         &lt;xs:attribute name="currency" type="xs:string"/&gt;
+ *       &lt;/xs:extension&gt;
+ *     &lt;/xs:simpleContent&gt;
+ *   &lt;/xs:complexType&gt;
  *
  *   </pre>
- * </p>
  *
  * @author Sekhar Vajjhala, Sun Microsystems, Inc.
  * @see XmlType
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/adapters/XmlAdapter.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/adapters/XmlAdapter.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -76,11 +76,11 @@
  * <p> <b> Step 1: </b> Determine the desired XML representation for HashMap.
  *
  * <pre>
- *     &lt;hashmap>
- *         &lt;entry key="id123">this is a value&lt;/entry>
- *         &lt;entry key="id312">this is another value&lt;/entry>
+ *     &lt;hashmap&gt;
+ *         &lt;entry key="id123"&gt;this is a value&lt;/entry&gt;
+ *         &lt;entry key="id312"&gt;this is another value&lt;/entry&gt;
  *         ...
- *       &lt;/hashmap>
+ *       &lt;/hashmap&gt;
  * </pre>
  *
  * <p> <b> Step 2: </b> Determine the schema definition that the
@@ -88,20 +88,20 @@
  *
  * <pre>
  *
- *     &lt;xs:complexType name="myHashMapType">
- *       &lt;xs:sequence>
+ *     &lt;xs:complexType name="myHashMapType"&gt;
+ *       &lt;xs:sequence&gt;
  *         &lt;xs:element name="entry" type="myHashMapEntryType"
- *                        minOccurs = "0" maxOccurs="unbounded"/>
- *       &lt;/xs:sequence>
- *     &lt;/xs:complexType>
+ *                        minOccurs = "0" maxOccurs="unbounded"/&gt;
+ *       &lt;/xs:sequence&gt;
+ *     &lt;/xs:complexType&gt;
  *
- *     &lt;xs:complexType name="myHashMapEntryType">
- *       &lt;xs:simpleContent>
- *         &lt;xs:extension base="xs:string">
- *           &lt;xs:attribute name="key" type="xs:int"/>
- *         &lt;/xs:extension>
- *       &lt;/xs:simpleContent>
- *     &lt;/xs:complexType>
+ *     &lt;xs:complexType name="myHashMapEntryType"&gt;
+ *       &lt;xs:simpleContent&gt;
+ *         &lt;xs:extension base="xs:string"&gt;
+ *           &lt;xs:attribute name="key" type="xs:int"/&gt;
+ *         &lt;/xs:extension&gt;
+ *       &lt;/xs:simpleContent&gt;
+ *     &lt;/xs:complexType&gt;
  *
  * </pre>
  *
@@ -110,7 +110,7 @@
  *
  * <pre>
  *     public class MyHashMapType {
- *         List&lt;MyHashMapEntryType> entry;
+ *         List&lt;MyHashMapEntryType&gt; entry;
  *     }
  *
  *     public class MyHashMapEntryType {
@@ -127,7 +127,7 @@
  *
  * <pre>
  *     public final class MyHashMapAdapter extends
- *                        XmlAdapter&lt;MyHashMapType,HashMap> { ... }
+ *                        XmlAdapter&lt;MyHashMapType,HashMap&gt; { ... }
  *
  * </pre>
  *
@@ -144,11 +144,11 @@
  * The above code fragment will map to the following schema:
  *
  * <pre>
- *     &lt;xs:complexType name="Foo">
- *       &lt;xs:sequence>
- *         &lt;xs:element name="hashmap" type="myHashMapType"
- *       &lt;/xs:sequence>
- *     &lt;/xs:complexType>
+ *     &lt;xs:complexType name="Foo"&gt;
+ *       &lt;xs:sequence&gt;
+ *         &lt;xs:element name="hashmap" type="myHashMapType"&gt;
+ *       &lt;/xs:sequence&gt;
+ *     &lt;/xs:complexType&gt;
  * </pre>
  *
  * @param <BoundType>
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/attachment/AttachmentUnmarshaller.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/attachment/AttachmentUnmarshaller.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -70,7 +70,7 @@
     *
     * <p>The returned <code>DataHandler</code> instance must be configured
     * to meet the following required mapping constaint.
-    * <table border="2" rules="all" cellpadding="4">
+    * <table summary="" border="2" rules="all" cellpadding="4">
     *   <thead>
     *     <tr>
     *       <th align="center" colspan="2">
@@ -100,7 +100,7 @@
     *     </tr>
     *   </tbody>
     *  </table>
-    * Note that it is allowable to support additional mappings.</p>
+    * Note that it is allowable to support additional mappings.
     *
     * @param cid It is expected to be a valid lexical form of the XML Schema
     * <code>xs:anyURI</code> datatype. If <code>{@link #isXOPPackage()}
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/version.properties	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/version.properties	Mon Feb 23 05:01:11 2015 -0800
@@ -23,7 +23,7 @@
 # questions.
 #
 
-build-id=2.2.11-b141124.1933
-build-version=JAX-WS RI 2.2.11-b141124.1933
+build-id=2.2.11-b150127.1410
+build-version=JAX-WS RI 2.2.11-b150127.1410
 major-version=2.2.11
-svn-revision=312b19a2e0e312b55e1ea6f531bd595955cd581f
+svn-revision=28121d09ed8ac02b76788709ccb4cdb66e03bbfa
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle.properties	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle.properties	Mon Feb 23 05:01:11 2015 -0800
@@ -30,10 +30,10 @@
     Non-existent directory: {0}
 
 VERSION = \
-        schemagen 2.2.12-b141016.1821
+        schemagen 2.2.12-b150126.1924
 
 FULLVERSION = \
-        schemagen full version "2.2.12-b141016.1821"
+        schemagen full version "2.2.12-b150126.1924"
 
 USAGE = \
 Usage: schemagen [-options ...] <java files> \n\
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_de.properties	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_de.properties	Mon Feb 23 05:01:11 2015 -0800
@@ -27,8 +27,8 @@
 
 BASEDIR_DOESNT_EXIST = Nicht vorhandenes Verzeichnis: {0}
 
-VERSION = schemagen 2.2.12-b141016.1821
+VERSION = schemagen 2.2.12-b150126.1924
 
-FULLVERSION = schemagen vollst\u00E4ndige Version "2.2.12-b141016.1821"
+FULLVERSION = schemagen vollst\u00E4ndige Version "2.2.12-b150126.1924"
 
 USAGE = Verwendung: schemagen [-options ...] <java files> \nOptionen: \n\\ \\ \\ \\ -d <path>             : Gibt an, wo die von Prozessor und javac generierten Klassendateien gespeichert werden sollen\n\\ \\ \\ \\ -cp <path>            : Gibt an, wo die vom Benutzer angegebenen Dateien gespeichert sind\n\\ \\ \\ \\ -classpath <path>     : Gibt an, wo die vom Benutzer angegebenen Dateien gespeichert sind\n\\ \\ \\ \\ -encoding <encoding>  : Gibt die Codierung f\u00FCr die Annotationsverarbeitung/den javac-Aufruf an \n\\ \\ \\ \\ -episode <file>       : Generiert Episodendatei f\u00FCr separate Kompilierung\n\\ \\ \\ \\ -version              : Zeigt Versionsinformation an\n\\ \\ \\ \\ -fullversion          : Zeigt vollst\u00E4ndige Versionsinformationen an\n\\ \\ \\ \\ -help                 : Zeigt diese Verwendungsmeldung an
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_es.properties	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_es.properties	Mon Feb 23 05:01:11 2015 -0800
@@ -27,8 +27,8 @@
 
 BASEDIR_DOESNT_EXIST = Directorio no existente: {0}
 
-VERSION = schemagen 2.2.12-b141016.1821
+VERSION = schemagen 2.2.12-b150126.1924
 
-FULLVERSION = versi\u00F3n completa de schemagen "2.2.12-b141016.1821"
+FULLVERSION = versi\u00F3n completa de schemagen "2.2.12-b150126.1924"
 
 USAGE = Sintaxis: schemagen [-options ...] <archivos java> \nOpciones: \n\\ \\ \\ \\ -d <ruta de acceso>             : especifique d\u00F3nde se colocan los archivos de clase generados por javac y el procesador\n\\ \\ \\ \\ -cp <ruta de acceso>            : especifique d\u00F3nde se encuentran los archivos especificados por el usuario\n\\ \\ \\ \\ -encoding <codificaci\u00F3n>  : especifique la codificaci\u00F3n que se va a utilizar para el procesamiento de anotaciones/llamada de javac\n\\ \\ \\ \\ -episode <archivo>       : genera un archivo de episodio para una compilaci\u00F3n diferente\n\\ \\ \\ \\ -version              : muestra la informaci\u00F3n de la versi\u00F3n\n\\ \\ \\ \\ -fullversion          : muestra la informaci\u00F3n completa de la versi\u00F3n\n\\ \\ \\ \\ -help                 : muestra este mensaje de sintaxis
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_fr.properties	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_fr.properties	Mon Feb 23 05:01:11 2015 -0800
@@ -27,8 +27,8 @@
 
 BASEDIR_DOESNT_EXIST = R\u00E9pertoire {0} inexistant
 
-VERSION = schemagen 2.2.12-b141016.1821
+VERSION = schemagen 2.2.12-b150126.1924
 
-FULLVERSION = version compl\u00E8te de schemagen "2.2.12-b141016.1821"
+FULLVERSION = version compl\u00E8te de schemagen "2.2.12-b150126.1924"
 
 USAGE = Syntaxe : schemagen [-options ...] <java files> \nOptions : \n\ \ \ \ -d <path> : indiquez o\u00F9 placer les fichiers de classe g\u00E9n\u00E9r\u00E9s par le processeur et le compilateur javac\n\ \ \ \ -cp <path> : indiquez o\u00F9 trouver les fichiers sp\u00E9cifi\u00E9s par l'utilisateur\n\ \ \ \ -classpath <path> : indiquez o\u00F9 trouver les fichiers sp\u00E9cifi\u00E9s par l'utilisateur\n\ \ \ \ -encoding <encoding> : indiquez l'encodage \u00E0 utiliser pour l'appel de javac/traitement de l'annotation \n\ \ \ \ -episode <file> : g\u00E9n\u00E9rez un fichier d'\u00E9pisode pour la compilation s\u00E9par\u00E9e\n\ \ \ \ -version : affichez les informations de version\n\ \ \ \ -fullversion : affichez les informations compl\u00E8tes de version\n\ \ \ \ -help : affichez ce message de syntaxe
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_it.properties	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_it.properties	Mon Feb 23 05:01:11 2015 -0800
@@ -27,8 +27,8 @@
 
 BASEDIR_DOESNT_EXIST = Directory non esistente: {0}
 
-VERSION = schemagen 2.2.12-b141016.1821
+VERSION = schemagen 2.2.12-b150126.1924
 
-FULLVERSION = versione completa schemagen "2.2.12-b141016.1821"
+FULLVERSION = versione completa schemagen "2.2.12-b150126.1924"
 
 USAGE = Uso: schemagen [-options ...] <java files> \nOpzioni: \n\ \ \ \ -d <path>             : specifica dove posizionare il processore e i file della classe generata javac\n\ \ \ \ -cp <path>            : specifica dove trovare i file specificati dall'utente\n\ \ \ \ -classpath <path>     : specifica dove trovare i file specificati dall'utente\n\ \ \ \ -encoding <encoding>  : specifica la codifica da usare per l'elaborazione dell'annotazione/richiamo javac \n\ \ \ \ -episode <file>       : genera il file di episodio per la compilazione separata\n\ \ \ \ -version              : visualizza le informazioni sulla versione\n\ \ \ \ -fullversion          : visualizza le informazioni sulla versione completa\n\ \ \ \ -help                 : visualizza questo messaggio sull'uso
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ja.properties	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ja.properties	Mon Feb 23 05:01:11 2015 -0800
@@ -27,8 +27,8 @@
 
 BASEDIR_DOESNT_EXIST = \u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304C\u5B58\u5728\u3057\u307E\u305B\u3093: {0}
 
-VERSION = schemagen 2.2.12-b141016.1821
+VERSION = schemagen 2.2.12-b150126.1924
 
-FULLVERSION = schemagen\u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3"2.2.12-b141016.1821"
+FULLVERSION = schemagen\u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3"2.2.12-b150126.1924"
 
 USAGE = \u4F7F\u7528\u65B9\u6CD5: schemagen [-options ...] <java files> \n\u30AA\u30D7\u30B7\u30E7\u30F3: \n\ \ \ \ -d <path>             : \u30D7\u30ED\u30BB\u30C3\u30B5\u304A\u3088\u3073javac\u304C\u751F\u6210\u3057\u305F\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u7F6E\u304F\u4F4D\u7F6E\u3092\u6307\u5B9A\u3057\u307E\u3059\n\ \ \ \ -cp <path>            : \u30E6\u30FC\u30B6\u30FC\u304C\u6307\u5B9A\u3057\u305F\u30D5\u30A1\u30A4\u30EB\u3092\u691C\u7D22\u3059\u308B\u4F4D\u7F6E\u3092\u6307\u5B9A\u3057\u307E\u3059\n\ \ \ \ -classpath <path>     : \u30E6\u30FC\u30B6\u30FC\u304C\u6307\u5B9A\u3057\u305F\u30D5\u30A1\u30A4\u30EB\u3092\u691C\u7D22\u3059\u308B\u4F4D\u7F6E\u3092\u6307\u5B9A\u3057\u307E\u3059\n\ \ \ \ -encoding <encoding>  : \u6CE8\u91C8\u51E6\u7406/javac\u547C\u51FA\u3057\u306B\u4F7F\u7528\u3059\u308B\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u3092\u6307\u5B9A\u3057\u307E\u3059\n\ \ \ \ -episode <file>       : \u30B3\u30F3\u30D1\u30A4\u30EB\u3054\u3068\u306B\u30A8\u30D4\u30BD\u30FC\u30C9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u751F\u6210\u3057\u307E\u3059\n\ \ \ \ -version              : \u30D0\u30FC\u30B8\u30E7\u30F3\u60C5\u5831\u3092\u8868\u793A\u3057\u307E\u3059\n\ \ \ \ -fullversion          : \u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3\u60C5\u5831\u3092\u8868\u793A\u3057\u307E\u3059\n\ \ \ \ -help                 : \u3053\u306E\u4F7F\u7528\u4F8B\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8868\u793A\u3057\u307E\u3059
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ko.properties	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ko.properties	Mon Feb 23 05:01:11 2015 -0800
@@ -27,8 +27,8 @@
 
 BASEDIR_DOESNT_EXIST = \uC874\uC7AC\uD558\uC9C0 \uC54A\uB294 \uB514\uB809\uD1A0\uB9AC: {0}
 
-VERSION = schemagen 2.2.12-b141016.1821
+VERSION = schemagen 2.2.12-b150126.1924
 
-FULLVERSION = schemagen \uC815\uC2DD \uBC84\uC804 "2.2.12-b141016.1821"
+FULLVERSION = schemagen \uC815\uC2DD \uBC84\uC804 "2.2.12-b150126.1924"
 
 USAGE = \uC0AC\uC6A9\uBC95: schemagen [-options ...] <java files> \n\uC635\uC158: \n\ \ \ \ -d <path>             : \uD504\uB85C\uC138\uC11C \uBC0F javac\uC5D0\uC11C \uC0DD\uC131\uD55C \uD074\uB798\uC2A4 \uD30C\uC77C\uC744 \uBC30\uCE58\uD560 \uC704\uCE58\uB97C \uC9C0\uC815\uD569\uB2C8\uB2E4.\n\ \ \ \ -cp <path>            : \uC0AC\uC6A9\uC790\uAC00 \uC9C0\uC815\uD55C \uD30C\uC77C\uC744 \uCC3E\uC744 \uC704\uCE58\uB97C \uC9C0\uC815\uD569\uB2C8\uB2E4.\n\ \ \ \ -classpath <path>     : \uC0AC\uC6A9\uC790\uAC00 \uC9C0\uC815\uD55C \uD30C\uC77C\uC744 \uCC3E\uC744 \uC704\uCE58\uB97C \uC9C0\uC815\uD569\uB2C8\uB2E4.\n\ \ \ \ -encoding <encoding>  : \uC8FC\uC11D \uCC98\uB9AC/javac \uD638\uCD9C\uC5D0 \uC0AC\uC6A9\uD560 \uC778\uCF54\uB529\uC744 \uC9C0\uC815\uD569\uB2C8\uB2E4. \n\ \ \ \ -episode <file>       : \uBCC4\uB3C4 \uCEF4\uD30C\uC77C\uC744 \uC704\uD574 episode \uD30C\uC77C\uC744 \uC0DD\uC131\uD569\uB2C8\uB2E4.\n\ \ \ \ -version              : \uBC84\uC804 \uC815\uBCF4\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n\ \ \ \ -fullversion          : \uC815\uC2DD \uBC84\uC804 \uC815\uBCF4\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n\ \ \ \ -help                 : \uC774 \uC0AC\uC6A9\uBC95 \uBA54\uC2DC\uC9C0\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_pt_BR.properties	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_pt_BR.properties	Mon Feb 23 05:01:11 2015 -0800
@@ -27,8 +27,8 @@
 
 BASEDIR_DOESNT_EXIST = Diret\u00F3rio n\u00E3o existente: {0}
 
-VERSION = gera\u00E7\u00E3o do esquema 2.2.12-b141016.1821
+VERSION = gera\u00E7\u00E3o do esquema 2.2.12-b150126.1924
 
-FULLVERSION = vers\u00E3o completa da gera\u00E7\u00E3o do esquema "2.2.12-b141016.1821"
+FULLVERSION = vers\u00E3o completa da gera\u00E7\u00E3o do esquema "2.2.12-b150126.1924"
 
 USAGE = Uso: gera\u00E7\u00E3o do esquema [-options ...] <java files> \nOp\u00E7\u00F5es: \n\\ \\ \\ \\ -d <path>             : especificar onde colocar o processador e os arquivos da classe gerados por javac\n\\ \\ \\ \\ -cp <path>            : especificar onde localizar arquivos especificados pelo usu\u00E1rio\n\\ \\ \\ \\ -classpath <path>     : especificar onde localizar os arquivos especificados pelo usu\u00E1rio\n\\ \\ \\ \\ -encoding <encoding>  : especificar codifica\u00E7\u00E3o a ser usada para processamento de anota\u00E7\u00E3o/chamada javac \n\\ \\ \\ \\ -episode <file>       : gerar arquivo do epis\u00F3dio para compila\u00E7\u00E3o separada\n\\ \\ \\ \\ -version              : exibir informa\u00E7\u00F5es da vers\u00E3o\n\\ \\ \\ \\ -fullversion          : exibir informa\u00E7\u00F5es da vers\u00E3o completa\n\\ \\ \\ \\ -help                 : exibir esta mensagem de uso
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_CN.properties	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_CN.properties	Mon Feb 23 05:01:11 2015 -0800
@@ -27,8 +27,8 @@
 
 BASEDIR_DOESNT_EXIST = \u4E0D\u5B58\u5728\u7684\u76EE\u5F55: {0}
 
-VERSION = schemagen 2.2.12-b141016.1821
+VERSION = schemagen 2.2.12-b150126.1924
 
-FULLVERSION = schemagen \u5B8C\u6574\u7248\u672C "2.2.12-b141016.1821"
+FULLVERSION = schemagen \u5B8C\u6574\u7248\u672C "2.2.12-b150126.1924"
 
 USAGE = \u7528\u6CD5: schemagen [-options ...] <java files> \n\u9009\u9879: \n\ \ \ \ -d <path>             : \u6307\u5B9A\u653E\u7F6E\u5904\u7406\u7A0B\u5E8F\u548C javac \u751F\u6210\u7684\u7C7B\u6587\u4EF6\u7684\u4F4D\u7F6E\n\ \ \ \ -cp <path>            : \u6307\u5B9A\u67E5\u627E\u7528\u6237\u6307\u5B9A\u6587\u4EF6\u7684\u4F4D\u7F6E\n\ \ \ \ -classpath <path>     : \u6307\u5B9A\u67E5\u627E\u7528\u6237\u6307\u5B9A\u6587\u4EF6\u7684\u4F4D\u7F6E\n\ \ \ \ -encoding <encoding>  : \u6307\u5B9A\u7528\u4E8E\u6CE8\u91CA\u5904\u7406/javac \u8C03\u7528\u7684\u7F16\u7801\n\ \ \ \ -episode <file>       : \u751F\u6210\u7247\u6BB5\u6587\u4EF6\u4EE5\u4F9B\u5355\u72EC\u7F16\u8BD1\n\ \ \ \ -version              : \u663E\u793A\u7248\u672C\u4FE1\u606F\n\ \ \ \ -fullversion          : \u663E\u793A\u5B8C\u6574\u7684\u7248\u672C\u4FE1\u606F\n\ \ \ \ -help                 : \u663E\u793A\u6B64\u7528\u6CD5\u6D88\u606F
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_TW.properties	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_TW.properties	Mon Feb 23 05:01:11 2015 -0800
@@ -27,8 +27,8 @@
 
 BASEDIR_DOESNT_EXIST = \u4E0D\u5B58\u5728\u7684\u76EE\u9304: {0}
 
-VERSION = schemagen 2.2.12-b141016.1821
+VERSION = schemagen 2.2.12-b150126.1924
 
-FULLVERSION = schemagen \u5B8C\u6574\u7248\u672C "2.2.12-b141016.1821"
+FULLVERSION = schemagen \u5B8C\u6574\u7248\u672C "2.2.12-b150126.1924"
 
 USAGE = \u7528\u6CD5: schemagen [-options ...] <java files> \n\u9078\u9805: \n\\ \\ \\ \\ -d <path>             : \u6307\u5B9A\u8655\u7406\u5668\u4EE5\u53CA javac \u7522\u751F\u7684\u985E\u5225\u6A94\u6848\u653E\u7F6E\u4F4D\u7F6E\n\\ \\ \\ \\ -cp <path>            : \u6307\u5B9A\u8981\u5C0B\u627E\u4F7F\u7528\u8005\u6307\u5B9A\u6A94\u6848\u7684\u4F4D\u7F6E\n\\ \\ \\ \\ -classpath <path>     : \u6307\u5B9A\u8981\u5C0B\u627E\u4F7F\u7528\u8005\u6307\u5B9A\u6A94\u6848\u7684\u4F4D\u7F6E\n\\ \\ \\ \\ -encoding <encoding>  : \u6307\u5B9A\u8981\u7528\u65BC\u8A3B\u89E3\u8655\u7406/javac \u547C\u53EB\u7684\u7DE8\u78BC \n\\ \\ \\ \\ -episode <file>       : \u7522\u751F\u7368\u7ACB\u7DE8\u8B6F\u7684\u4E8B\u4EF6 (episode) \u6A94\u6848\n\\ \\ \\ \\ -version              : \u986F\u793A\u7248\u672C\u8CC7\u8A0A\n\\ \\ \\ \\ -fullversion          : \u986F\u793A\u5B8C\u6574\u7248\u672C\u8CC7\u8A0A\n\\ \\ \\ \\ -help                 : \u986F\u793A\u6B64\u7528\u6CD5\u8A0A\u606F
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle.properties	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle.properties	Mon Feb 23 05:01:11 2015 -0800
@@ -171,20 +171,20 @@
 Driver.FailedToGenerateCode = \
         Failed to produce code.
 
-# DO NOT localize the 2.2.12-b141016.1821 string - it is a token for an mvn <properties filter>
+# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn <properties filter>
 Driver.FilePrologComment = \
-        This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.12-b141016.1821 \n\
+        This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.12-b150126.1924 \n\
         See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \n\
         Any modifications to this file will be lost upon recompilation of the source schema. \n\
         Generated on: {0} \n
 
 Driver.Version = \
-        xjc 2.2.12-b141016.1821
+        xjc 2.2.12-b150126.1924
 
 Driver.FullVersion = \
-        xjc full version "2.2.12-b141016.1821"
+        xjc full version "2.2.12-b150126.1924"
 
-Driver.BuildID = 2.2.12-b141016.1821
+Driver.BuildID = 2.2.12-b150126.1924
 
 # for JDK integration - include version in source zip
 jaxb.jdk.version=@@JAXB_JDK_VERSION@@
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_de.properties	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_de.properties	Mon Feb 23 05:01:11 2015 -0800
@@ -96,14 +96,14 @@
 
 Driver.FailedToGenerateCode = Code konnte nicht erzeugt werden.
 
-# DO NOT localize the 2.2.12-b141016.1821 string - it is a token for an mvn <properties filter>
-Driver.FilePrologComment = Diese Datei wurde mit der JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.12-b141016.1821 generiert \nSiehe <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \n\u00c4nderungen an dieser Datei gehen bei einer Neukompilierung des Quellschemas verloren. \nGeneriert: {0} \n
+# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn <properties filter>
+Driver.FilePrologComment = Diese Datei wurde mit der JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.12-b150126.1924 generiert \nSiehe <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \n\u00c4nderungen an dieser Datei gehen bei einer Neukompilierung des Quellschemas verloren. \nGeneriert: {0} \n
 
-Driver.Version = xjc 2.2.12-b141016.1821
+Driver.Version = xjc 2.2.12-b150126.1924
 
-Driver.FullVersion = xjc vollst\u00E4ndige Version "2.2.12-b141016.1821"
+Driver.FullVersion = xjc vollst\u00E4ndige Version "2.2.12-b150126.1924"
 
-Driver.BuildID = 2.2.12-b141016.1821
+Driver.BuildID = 2.2.12-b150126.1924
 
 # for JDK integration - include version in source zip
 jaxb.jdk.version=@@JAXB_JDK_VERSION@@
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_es.properties	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_es.properties	Mon Feb 23 05:01:11 2015 -0800
@@ -96,14 +96,14 @@
 
 Driver.FailedToGenerateCode = Fallo al producir c\u00f3digo.
 
-# DO NOT localize the 2.2.12-b141016.1821 string - it is a token for an mvn <properties filter>
-Driver.FilePrologComment = Este archivo ha sido generado por la arquitectura JavaTM para la implantaci\u00f3n de la referencia de enlace (JAXB) XML v2.2.12-b141016.1821 \nVisite <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \nTodas las modificaciones realizadas en este archivo se perder\u00e1n si se vuelve a compilar el esquema de origen. \nGenerado el: {0} \n
+# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn <properties filter>
+Driver.FilePrologComment = Este archivo ha sido generado por la arquitectura JavaTM para la implantaci\u00f3n de la referencia de enlace (JAXB) XML v2.2.12-b150126.1924 \nVisite <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \nTodas las modificaciones realizadas en este archivo se perder\u00e1n si se vuelve a compilar el esquema de origen. \nGenerado el: {0} \n
 
-Driver.Version = xjc 2.2.12-b141016.1821
+Driver.Version = xjc 2.2.12-b150126.1924
 
-Driver.FullVersion = versi\u00F3n completa de xjc "2.2.12-b141016.1821"
+Driver.FullVersion = versi\u00F3n completa de xjc "2.2.12-b150126.1924"
 
-Driver.BuildID = 2.2.12-b141016.1821
+Driver.BuildID = 2.2.12-b150126.1924
 
 # for JDK integration - include version in source zip
 jaxb.jdk.version=@@JAXB_JDK_VERSION@@
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_fr.properties	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_fr.properties	Mon Feb 23 05:01:11 2015 -0800
@@ -96,14 +96,14 @@
 
 Driver.FailedToGenerateCode = Echec de la production du code.
 
-# DO NOT localize the 2.2.12-b141016.1821 string - it is a token for an mvn <properties filter>
-Driver.FilePrologComment = Ce fichier a \u00e9t\u00e9 g\u00e9n\u00e9r\u00e9 par l''impl\u00e9mentation de r\u00e9f\u00e9rence JavaTM Architecture for XML Binding (JAXB), v2.2.12-b141016.1821 \nVoir <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \nToute modification apport\u00e9e \u00e0 ce fichier sera perdue lors de la recompilation du sch\u00e9ma source. \nG\u00e9n\u00e9r\u00e9 le : {0} \n
+# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn <properties filter>
+Driver.FilePrologComment = Ce fichier a \u00e9t\u00e9 g\u00e9n\u00e9r\u00e9 par l''impl\u00e9mentation de r\u00e9f\u00e9rence JavaTM Architecture for XML Binding (JAXB), v2.2.12-b150126.1924 \nVoir <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \nToute modification apport\u00e9e \u00e0 ce fichier sera perdue lors de la recompilation du sch\u00e9ma source. \nG\u00e9n\u00e9r\u00e9 le : {0} \n
 
-Driver.Version = xjc 2.2.12-b141016.1821
+Driver.Version = xjc 2.2.12-b150126.1924
 
-Driver.FullVersion = version compl\u00E8te xjc "2.2.12-b141016.1821"
+Driver.FullVersion = version compl\u00E8te xjc "2.2.12-b150126.1924"
 
-Driver.BuildID = 2.2.12-b141016.1821
+Driver.BuildID = 2.2.12-b150126.1924
 
 # for JDK integration - include version in source zip
 jaxb.jdk.version=@@JAXB_JDK_VERSION@@
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_it.properties	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_it.properties	Mon Feb 23 05:01:11 2015 -0800
@@ -96,14 +96,14 @@
 
 Driver.FailedToGenerateCode = Produzione del codice non riuscita.
 
-# DO NOT localize the 2.2.12-b141016.1821 string - it is a token for an mvn <properties filter>
-Driver.FilePrologComment = Questo file \u00e8 stato generato dall''architettura JavaTM per XML Binding (JAXB) Reference Implementation, v2.2.12-b141016.1821 \nVedere <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \nQualsiasi modifica a questo file andr\u00e0 persa durante la ricompilazione dello schema di origine. \nGenerato il: {0} \n
+# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn <properties filter>
+Driver.FilePrologComment = Questo file \u00e8 stato generato dall''architettura JavaTM per XML Binding (JAXB) Reference Implementation, v2.2.12-b150126.1924 \nVedere <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \nQualsiasi modifica a questo file andr\u00e0 persa durante la ricompilazione dello schema di origine. \nGenerato il: {0} \n
 
-Driver.Version = xjc 2.2.12-b141016.1821
+Driver.Version = xjc 2.2.12-b150126.1924
 
-Driver.FullVersion = versione completa xjc "2.2.12-b141016.1821"
+Driver.FullVersion = versione completa xjc "2.2.12-b150126.1924"
 
-Driver.BuildID = 2.2.12-b141016.1821
+Driver.BuildID = 2.2.12-b150126.1924
 
 # for JDK integration - include version in source zip
 jaxb.jdk.version=@@JAXB_JDK_VERSION@@
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ja.properties	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ja.properties	Mon Feb 23 05:01:11 2015 -0800
@@ -96,14 +96,14 @@
 
 Driver.FailedToGenerateCode = \u30b3\u30fc\u30c9\u306e\u751f\u6210\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002
 
-# DO NOT localize the 2.2.12-b141016.1821 string - it is a token for an mvn <properties filter>
-Driver.FilePrologComment = \u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306f\u3001JavaTM Architecture for XML Binding(JAXB) Reference Implementation\u3001v2.2.12-b141016.1821\u306b\u3088\u3063\u3066\u751f\u6210\u3055\u308c\u307e\u3057\u305f \n<a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044 \n\u30bd\u30fc\u30b9\u30fb\u30b9\u30ad\u30fc\u30de\u306e\u518d\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u306b\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u5909\u66f4\u306f\u5931\u308f\u308c\u307e\u3059\u3002 \n\u751f\u6210\u65e5: {0} \n
+# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn <properties filter>
+Driver.FilePrologComment = \u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306f\u3001JavaTM Architecture for XML Binding(JAXB) Reference Implementation\u3001v2.2.12-b150126.1924\u306b\u3088\u3063\u3066\u751f\u6210\u3055\u308c\u307e\u3057\u305f \n<a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044 \n\u30bd\u30fc\u30b9\u30fb\u30b9\u30ad\u30fc\u30de\u306e\u518d\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u306b\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u5909\u66f4\u306f\u5931\u308f\u308c\u307e\u3059\u3002 \n\u751f\u6210\u65e5: {0} \n
 
-Driver.Version = xjc 2.2.12-b141016.1821
+Driver.Version = xjc 2.2.12-b150126.1924
 
-Driver.FullVersion = xjc\u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3"2.2.12-b141016.1821"
+Driver.FullVersion = xjc\u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3"2.2.12-b150126.1924"
 
-Driver.BuildID = 2.2.12-b141016.1821
+Driver.BuildID = 2.2.12-b150126.1924
 
 # for JDK integration - include version in source zip
 jaxb.jdk.version=@@JAXB_JDK_VERSION@@
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ko.properties	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ko.properties	Mon Feb 23 05:01:11 2015 -0800
@@ -96,14 +96,14 @@
 
 Driver.FailedToGenerateCode = \ucf54\ub4dc \uc0dd\uc131\uc744 \uc2e4\ud328\ud588\uc2b5\ub2c8\ub2e4.
 
-# DO NOT localize the 2.2.12-b141016.1821 string - it is a token for an mvn <properties filter>
-Driver.FilePrologComment = \uc774 \ud30c\uc77c\uc740 JAXB(JavaTM Architecture for XML Binding) \ucc38\uc870 \uad6c\ud604 2.2.12-b141016.1821 \ubc84\uc804\uc744 \ud1b5\ud574 \uc0dd\uc131\ub418\uc5c8\uc2b5\ub2c8\ub2e4. \n<a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>\ub97c \ucc38\uc870\ud558\uc2ed\uc2dc\uc624. \n\uc774 \ud30c\uc77c\uc744 \uc218\uc815\ud558\uba74 \uc18c\uc2a4 \uc2a4\ud0a4\ub9c8\ub97c \uc7ac\ucef4\ud30c\uc77c\ud560 \ub54c \uc218\uc815 \uc0ac\ud56d\uc774 \uc190\uc2e4\ub429\ub2c8\ub2e4. \n\uc0dd\uc131 \ub0a0\uc9dc: {0} \n
+# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn <properties filter>
+Driver.FilePrologComment = \uc774 \ud30c\uc77c\uc740 JAXB(JavaTM Architecture for XML Binding) \ucc38\uc870 \uad6c\ud604 2.2.12-b150126.1924 \ubc84\uc804\uc744 \ud1b5\ud574 \uc0dd\uc131\ub418\uc5c8\uc2b5\ub2c8\ub2e4. \n<a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>\ub97c \ucc38\uc870\ud558\uc2ed\uc2dc\uc624. \n\uc774 \ud30c\uc77c\uc744 \uc218\uc815\ud558\uba74 \uc18c\uc2a4 \uc2a4\ud0a4\ub9c8\ub97c \uc7ac\ucef4\ud30c\uc77c\ud560 \ub54c \uc218\uc815 \uc0ac\ud56d\uc774 \uc190\uc2e4\ub429\ub2c8\ub2e4. \n\uc0dd\uc131 \ub0a0\uc9dc: {0} \n
 
-Driver.Version = XJC 2.2.12-b141016.1821
+Driver.Version = XJC 2.2.12-b150126.1924
 
-Driver.FullVersion = XJC \uC815\uC2DD \uBC84\uC804 "2.2.12-b141016.1821"
+Driver.FullVersion = XJC \uC815\uC2DD \uBC84\uC804 "2.2.12-b150126.1924"
 
-Driver.BuildID = 2.2.12-b141016.1821
+Driver.BuildID = 2.2.12-b150126.1924
 
 # for JDK integration - include version in source zip
 jaxb.jdk.version=@@JAXB_JDK_VERSION@@
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_pt_BR.properties	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_pt_BR.properties	Mon Feb 23 05:01:11 2015 -0800
@@ -96,14 +96,14 @@
 
 Driver.FailedToGenerateCode = Falha ao produzir o c\u00f3digo.
 
-# DO NOT localize the 2.2.12-b141016.1821 string - it is a token for an mvn <properties filter>
-Driver.FilePrologComment = Este arquivo foi gerado pela Arquitetura JavaTM para Implementa\u00e7\u00e3o de Refer\u00eancia (JAXB) de Bind XML, v2.2.12-b141016.1821 \nConsulte <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \nTodas as modifica\u00e7\u00f5es neste arquivo ser\u00e3o perdidas ap\u00f3s a recompila\u00e7\u00e3o do esquema de origem. \nGerado em: {0} \n
+# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn <properties filter>
+Driver.FilePrologComment = Este arquivo foi gerado pela Arquitetura JavaTM para Implementa\u00e7\u00e3o de Refer\u00eancia (JAXB) de Bind XML, v2.2.12-b150126.1924 \nConsulte <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \nTodas as modifica\u00e7\u00f5es neste arquivo ser\u00e3o perdidas ap\u00f3s a recompila\u00e7\u00e3o do esquema de origem. \nGerado em: {0} \n
 
-Driver.Version = xjc 2.2.12-b141016.1821
+Driver.Version = xjc 2.2.12-b150126.1924
 
-Driver.FullVersion = vers\u00E3o completa de xjc "2.2.12-b141016.1821"
+Driver.FullVersion = vers\u00E3o completa de xjc "2.2.12-b150126.1924"
 
-Driver.BuildID = 2.2.12-b141016.1821
+Driver.BuildID = 2.2.12-b150126.1924
 
 # for JDK integration - include version in source zip
 jaxb.jdk.version=@@JAXB_JDK_VERSION@@
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_CN.properties	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_CN.properties	Mon Feb 23 05:01:11 2015 -0800
@@ -96,14 +96,14 @@
 
 Driver.FailedToGenerateCode = \u65e0\u6cd5\u751f\u6210\u4ee3\u7801\u3002
 
-# DO NOT localize the 2.2.12-b141016.1821 string - it is a token for an mvn <properties filter>
-Driver.FilePrologComment = \u6b64\u6587\u4ef6\u662f\u7531 JavaTM Architecture for XML Binding (JAXB) \u5f15\u7528\u5b9e\u73b0 v2.2.12-b141016.1821 \u751f\u6210\u7684\n\u8bf7\u8bbf\u95ee <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \n\u5728\u91cd\u65b0\u7f16\u8bd1\u6e90\u6a21\u5f0f\u65f6, \u5bf9\u6b64\u6587\u4ef6\u7684\u6240\u6709\u4fee\u6539\u90fd\u5c06\u4e22\u5931\u3002\n\u751f\u6210\u65f6\u95f4: {0} \n
+# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn <properties filter>
+Driver.FilePrologComment = \u6b64\u6587\u4ef6\u662f\u7531 JavaTM Architecture for XML Binding (JAXB) \u5f15\u7528\u5b9e\u73b0 v2.2.12-b150126.1924 \u751f\u6210\u7684\n\u8bf7\u8bbf\u95ee <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \n\u5728\u91cd\u65b0\u7f16\u8bd1\u6e90\u6a21\u5f0f\u65f6, \u5bf9\u6b64\u6587\u4ef6\u7684\u6240\u6709\u4fee\u6539\u90fd\u5c06\u4e22\u5931\u3002\n\u751f\u6210\u65f6\u95f4: {0} \n
 
-Driver.Version = xjc 2.2.12-b141016.1821
+Driver.Version = xjc 2.2.12-b150126.1924
 
-Driver.FullVersion = xjc \u5B8C\u6574\u7248\u672C "2.2.12-b141016.1821"
+Driver.FullVersion = xjc \u5B8C\u6574\u7248\u672C "2.2.12-b150126.1924"
 
-Driver.BuildID = 2.2.12-b141016.1821
+Driver.BuildID = 2.2.12-b150126.1924
 
 # for JDK integration - include version in source zip
 jaxb.jdk.version=@@JAXB_JDK_VERSION@@
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_TW.properties	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_TW.properties	Mon Feb 23 05:01:11 2015 -0800
@@ -96,14 +96,14 @@
 
 Driver.FailedToGenerateCode = \u7121\u6cd5\u7522\u751f\u7a0b\u5f0f\u78bc.
 
-# DO NOT localize the 2.2.12-b141016.1821 string - it is a token for an mvn <properties filter>
-Driver.FilePrologComment = \u6b64\u6a94\u6848\u662f\u7531 JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.12-b141016.1821 \u6240\u7522\u751f \n\u8acb\u53c3\u95b1 <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \n\u4e00\u65e6\u91cd\u65b0\u7de8\u8b6f\u4f86\u6e90\u7db1\u8981, \u5c0d\u6b64\u6a94\u6848\u6240\u505a\u7684\u4efb\u4f55\u4fee\u6539\u90fd\u5c07\u6703\u907a\u5931. \n\u7522\u751f\u6642\u9593: {0} \n
+# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn <properties filter>
+Driver.FilePrologComment = \u6b64\u6a94\u6848\u662f\u7531 JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.12-b150126.1924 \u6240\u7522\u751f \n\u8acb\u53c3\u95b1 <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \n\u4e00\u65e6\u91cd\u65b0\u7de8\u8b6f\u4f86\u6e90\u7db1\u8981, \u5c0d\u6b64\u6a94\u6848\u6240\u505a\u7684\u4efb\u4f55\u4fee\u6539\u90fd\u5c07\u6703\u907a\u5931. \n\u7522\u751f\u6642\u9593: {0} \n
 
-Driver.Version = xjc 2.2.12-b141016.1821
+Driver.Version = xjc 2.2.12-b150126.1924
 
-Driver.FullVersion = xjc \u5B8C\u6574\u7248\u672C "2.2.12-b141016.1821"
+Driver.FullVersion = xjc \u5B8C\u6574\u7248\u672C "2.2.12-b150126.1924"
 
-Driver.BuildID = 2.2.12-b141016.1821
+Driver.BuildID = 2.2.12-b150126.1924
 
 # for JDK integration - include version in source zip
 jaxb.jdk.version=@@JAXB_JDK_VERSION@@
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/Options.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/Options.java	Mon Feb 23 05:01:11 2015 -0800
@@ -32,18 +32,18 @@
 import java.io.InputStreamReader;
 import java.io.PrintWriter;
 import java.io.StringWriter;
-import java.lang.reflect.Array;
-import java.lang.reflect.InvocationTargetException;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.net.URLClassLoader;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Date;
 import java.util.Enumeration;
 import java.util.HashSet;
 import java.util.List;
+import java.util.ServiceLoader;
 import java.util.Set;
 
 import com.sun.codemodel.internal.CodeWriter;
@@ -354,9 +354,7 @@
      */
     public List<Plugin> getAllPlugins() {
         if(allPlugins==null) {
-            allPlugins = new ArrayList<Plugin>();
-            ClassLoader ucl = getUserClassLoader(SecureLoader.getClassClassLoader(getClass()));
-            allPlugins.addAll(Arrays.asList(findServices(Plugin.class,ucl)));
+            allPlugins = findServices(Plugin.class);
         }
 
         return allPlugins;
@@ -924,118 +922,44 @@
     /**
      * If a plugin failed to load, report.
      */
-    private static String pluginLoadFailure;
+    private String pluginLoadFailure;
 
     /**
      * Looks for all "META-INF/services/[className]" files and
      * create one instance for each class name found inside this file.
      */
-    private static <T> T[] findServices( Class<T> clazz, ClassLoader classLoader ) {
-        // if true, print debug output
-        final boolean debug = com.sun.tools.internal.xjc.util.Util.getSystemProperty(Options.class,"findServices")!=null;
-
-        // if we are running on Mustang or Dolphin, use ServiceLoader
-        // so that we can take advantage of JSR-277 module system.
-        try {
-            Class<?> serviceLoader = Class.forName("java.util.ServiceLoader");
-            if(debug)
-                System.out.println("Using java.util.ServiceLoader");
-            Iterable<T> itr = (Iterable<T>)serviceLoader.getMethod("load",Class.class,ClassLoader.class).invoke(null,clazz,classLoader);
-            List<T> r = new ArrayList<T>();
-            for (T t : itr)
-                r.add(t);
-            return r.toArray((T[])Array.newInstance(clazz,r.size()));
-        } catch (ClassNotFoundException e) {
-            // fall through
-        } catch (IllegalAccessException e) {
-            Error x = new IllegalAccessError();
-            x.initCause(e);
-            throw x;
-        } catch (InvocationTargetException e) {
-            Throwable x = e.getTargetException();
-            if (x instanceof RuntimeException)
-                throw (RuntimeException) x;
-            if (x instanceof Error)
-                throw (Error) x;
-            throw new Error(x);
-        } catch (NoSuchMethodException e) {
-            Error x = new NoSuchMethodError();
-            x.initCause(e);
-            throw x;
-        }
-
-        String serviceId = "META-INF/services/" + clazz.getName();
-
-        // used to avoid creating the same instance twice
-        Set<String> classNames = new HashSet<String>();
-
-        if(debug) {
-            System.out.println("Looking for "+serviceId+" for add-ons");
-        }
-
-        // try to find services in CLASSPATH
+    private <T> List<T> findServices( Class<T> clazz) {
+        final List<T> result = new ArrayList<T>();
+        final boolean debug = getDebugPropertyValue();
         try {
-            Enumeration<URL> e = classLoader.getResources(serviceId);
-            if(e==null) return (T[])Array.newInstance(clazz,0);
-
-            ArrayList<T> a = new ArrayList<T>();
-            while(e.hasMoreElements()) {
-                URL url = e.nextElement();
-                BufferedReader reader=null;
-
-                if(debug) {
-                    System.out.println("Checking "+url+" for an add-on");
-                }
-
-                try {
-                    reader = new BufferedReader(new InputStreamReader(url.openStream()));
-                    String impl;
-                    while((impl = reader.readLine())!=null ) {
-                        // try to instanciate the object
-                        impl = impl.trim();
-                        if(classNames.add(impl)) {
-                            Class implClass = classLoader.loadClass(impl);
-                            if(!clazz.isAssignableFrom(implClass)) {
-                                pluginLoadFailure = impl+" is not a subclass of "+clazz+". Skipping";
-                                if(debug)
-                                    System.out.println(pluginLoadFailure);
-                                continue;
-                            }
-                            if(debug) {
-                                System.out.println("Attempting to instanciate "+impl);
-                            }
-                            a.add(clazz.cast(implClass.newInstance()));
-                        }
-                    }
-                    reader.close();
-                } catch( Exception ex ) {
-                    // let it go.
-                    StringWriter w = new StringWriter();
-                    ex.printStackTrace(new PrintWriter(w));
-                    pluginLoadFailure = w.toString();
-                    if(debug) {
-                        System.out.println(pluginLoadFailure);
-                    }
-                    if( reader!=null ) {
-                        try {
-                            reader.close();
-                        } catch( IOException ex2 ) {
-                            // ignore
-                        }
-                    }
-                }
-            }
-
-            return a.toArray((T[])Array.newInstance(clazz,a.size()));
+            // TCCL allows user plugins to be loaded even if xjc is in jdk
+            // We have to use our SecureLoader to obtain it because we are trying to avoid SecurityException
+            final ClassLoader tccl = SecureLoader.getContextClassLoader();
+            final ServiceLoader<T> sl = ServiceLoader.load(clazz, tccl);
+            for (T t : sl)
+                result.add(t);
         } catch( Throwable e ) {
             // ignore any error
             StringWriter w = new StringWriter();
             e.printStackTrace(new PrintWriter(w));
             pluginLoadFailure = w.toString();
-            if(debug) {
+            if(debug)
                 System.out.println(pluginLoadFailure);
-            }
-            return (T[])Array.newInstance(clazz,0);
+        }
+        return result;
+    }
+
+    private static boolean getDebugPropertyValue() {
+        final String debugPropertyName = Options.class.getName() + ".findServices";
+        if (System.getSecurityManager() != null) {
+            return AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
+                @Override
+                public Boolean run() {
+                    return Boolean.getBoolean(debugPropertyName);
+                }
+            });
+        } else {
+            return Boolean.getBoolean(debugPropertyName);
         }
     }
 
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementCollectionAdapter.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementCollectionAdapter.java	Mon Feb 23 05:01:11 2015 -0800
@@ -40,7 +40,7 @@
 import com.sun.codemodel.internal.JType;
 import com.sun.codemodel.internal.JVar;
 import com.sun.tools.internal.xjc.model.CElementInfo;
-import static com.sun.tools.internal.xjc.model.Aspect.EXPOSED;
+import static com.sun.tools.internal.xjc.outline.Aspect.EXPOSED;
 import com.sun.tools.internal.xjc.outline.FieldAccessor;
 import com.sun.tools.internal.xjc.outline.FieldOutline;
 
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementSingleAdapter.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementSingleAdapter.java	Mon Feb 23 05:01:11 2015 -0800
@@ -33,7 +33,7 @@
 import com.sun.codemodel.internal.JConditional;
 import com.sun.codemodel.internal.JExpr;
 import com.sun.codemodel.internal.JExpression;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
 import com.sun.tools.internal.xjc.outline.FieldOutline;
 import com.sun.tools.internal.xjc.outline.FieldAccessor;
 import com.sun.tools.internal.xjc.model.CElementInfo;
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/TypeAndAnnotationImpl.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/TypeAndAnnotationImpl.java	Mon Feb 23 05:01:11 2015 -0800
@@ -36,7 +36,7 @@
 import com.sun.tools.internal.xjc.model.CAdapter;
 import com.sun.tools.internal.xjc.model.TypeUse;
 import com.sun.tools.internal.xjc.model.nav.NType;
-import static com.sun.tools.internal.xjc.model.Aspect.EXPOSED;
+import static com.sun.tools.internal.xjc.outline.Aspect.EXPOSED;
 import com.sun.tools.internal.xjc.outline.Outline;
 import com.sun.xml.internal.bind.v2.runtime.SwaRefAdapterMarker;
 
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/BeanGenerator.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/BeanGenerator.java	Mon Feb 23 05:01:11 2015 -0800
@@ -25,7 +25,7 @@
 
 package com.sun.tools.internal.xjc.generator.bean;
 
-import static com.sun.tools.internal.xjc.model.Aspect.EXPOSED;
+import static com.sun.tools.internal.xjc.outline.Aspect.EXPOSED;
 
 import java.io.Serializable;
 import java.net.URL;
@@ -90,7 +90,7 @@
 import com.sun.tools.internal.xjc.model.CTypeRef;
 import com.sun.tools.internal.xjc.model.Model;
 import com.sun.tools.internal.xjc.model.CClassRef;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
 import com.sun.tools.internal.xjc.outline.ClassOutline;
 import com.sun.tools.internal.xjc.outline.EnumConstantOutline;
 import com.sun.tools.internal.xjc.outline.EnumOutline;
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/ElementOutlineImpl.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/ElementOutlineImpl.java	Mon Feb 23 05:01:11 2015 -0800
@@ -39,7 +39,7 @@
 import com.sun.codemodel.internal.JMod;
 import com.sun.codemodel.internal.JType;
 import com.sun.tools.internal.xjc.model.CElementInfo;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
 import com.sun.tools.internal.xjc.outline.ElementOutline;
 
 /**
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/ImplStructureStrategy.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/ImplStructureStrategy.java	Mon Feb 23 05:01:11 2015 -0800
@@ -42,7 +42,7 @@
 import com.sun.codemodel.internal.JVar;
 import com.sun.tools.internal.xjc.generator.annotation.spec.XmlAccessorTypeWriter;
 import com.sun.tools.internal.xjc.model.CClassInfo;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
 import com.sun.tools.internal.xjc.outline.Outline;
 
 /**
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/ObjectFactoryGeneratorImpl.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/ObjectFactoryGeneratorImpl.java	Mon Feb 23 05:01:11 2015 -0800
@@ -51,7 +51,7 @@
 import com.sun.tools.internal.xjc.model.CPropertyInfo;
 import com.sun.tools.internal.xjc.model.Constructor;
 import com.sun.tools.internal.xjc.model.Model;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
 import com.sun.tools.internal.xjc.outline.FieldAccessor;
 import com.sun.tools.internal.xjc.outline.FieldOutline;
 import com.sun.xml.internal.bind.v2.TODO;
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/PackageOutlineImpl.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/PackageOutlineImpl.java	Mon Feb 23 05:01:11 2015 -0800
@@ -49,7 +49,7 @@
 import com.sun.tools.internal.xjc.model.CValuePropertyInfo;
 import com.sun.tools.internal.xjc.model.Model;
 import com.sun.tools.internal.xjc.outline.PackageOutline;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
 
 /**
  * {@link PackageOutline} enhanced with schema2java specific
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/PrivateObjectFactoryGenerator.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/PrivateObjectFactoryGenerator.java	Mon Feb 23 05:01:11 2015 -0800
@@ -32,7 +32,7 @@
 import com.sun.codemodel.internal.fmt.JPropertyFile;
 import com.sun.tools.internal.xjc.model.CElementInfo;
 import com.sun.tools.internal.xjc.model.Model;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
 import com.sun.tools.internal.xjc.runtime.JAXBContextFactory;
 
 /**
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/PublicObjectFactoryGenerator.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/PublicObjectFactoryGenerator.java	Mon Feb 23 05:01:11 2015 -0800
@@ -28,7 +28,7 @@
 import com.sun.codemodel.internal.JPackage;
 import com.sun.tools.internal.xjc.model.CElementInfo;
 import com.sun.tools.internal.xjc.model.Model;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
 
 /**
  * Generates public ObjectFactory.
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/AbstractField.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/AbstractField.java	Mon Feb 23 05:01:11 2015 -0800
@@ -63,8 +63,8 @@
 import com.sun.tools.internal.xjc.model.CTypeRef;
 import com.sun.tools.internal.xjc.model.CValuePropertyInfo;
 import com.sun.tools.internal.xjc.model.nav.NClass;
-import com.sun.tools.internal.xjc.model.Aspect;
-import static com.sun.tools.internal.xjc.model.Aspect.IMPLEMENTATION;
+import com.sun.tools.internal.xjc.outline.Aspect;
+import static com.sun.tools.internal.xjc.outline.Aspect.IMPLEMENTATION;
 import com.sun.tools.internal.xjc.outline.ClassOutline;
 import com.sun.tools.internal.xjc.outline.FieldAccessor;
 import com.sun.tools.internal.xjc.outline.FieldOutline;
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/ContentListField.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/ContentListField.java	Mon Feb 23 05:01:11 2015 -0800
@@ -38,7 +38,7 @@
 import com.sun.tools.internal.xjc.generator.bean.ClassOutlineImpl;
 import com.sun.tools.internal.xjc.generator.bean.MethodWriter;
 import com.sun.tools.internal.xjc.model.CPropertyInfo;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
 import com.sun.xml.internal.bind.api.impl.NameConverter;
 import java.io.Serializable;
 
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/NoExtendedContentField.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/NoExtendedContentField.java	Mon Feb 23 05:01:11 2015 -0800
@@ -40,7 +40,7 @@
 import com.sun.tools.internal.xjc.model.CElement;
 import com.sun.tools.internal.xjc.model.CPropertyInfo;
 import com.sun.tools.internal.xjc.model.CReferencePropertyInfo;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
 import com.sun.xml.internal.bind.api.impl.NameConverter;
 import java.io.Serializable;
 import java.util.Set;
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/UnboxedField.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/UnboxedField.java	Mon Feb 23 05:01:11 2015 -0800
@@ -35,7 +35,7 @@
 import com.sun.tools.internal.xjc.generator.bean.ClassOutlineImpl;
 import com.sun.tools.internal.xjc.generator.bean.MethodWriter;
 import com.sun.tools.internal.xjc.model.CPropertyInfo;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
 import com.sun.tools.internal.xjc.outline.FieldAccessor;
 import com.sun.xml.internal.bind.api.impl.NameConverter;
 
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/Aspect.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 1997, 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 com.sun.tools.internal.xjc.model;
-
-import com.sun.tools.internal.xjc.generator.bean.ImplStructureStrategy;
-
-/**
- * Sometimes a single JAXB-generated bean spans across multiple Java classes/interfaces.
- * We call them "aspects of a bean".
- *
- * <p>
- * This is an enumeration of all possible aspects.
- *
- * @author Kohsuke Kawaguchi
- */
-public enum Aspect {
-    /**
-     * The exposed part of the bean.
-     * <p>
-     * This corresponds to the content interface when we are geneting one.
-     * This would be the same as the {@link #IMPLEMENTATION} when we are
-     * just generating beans.
-     *
-     * <p>
-     * This could be an interface, or it could be a class.
-     *
-     * We don't have any other {@link ImplStructureStrategy} at this point,
-     * but generally you can't assume anything about where this could be
-     * or whether that's equal to {@link #IMPLEMENTATION}.
-     */
-    EXPOSED,
-    /**
-     * The part of the bean that holds all the implementations.
-     *
-     * <p>
-     * This is always a class, never an interface.
-     */
-    IMPLEMENTATION
-}
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CAdapter.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CAdapter.java	Mon Feb 23 05:01:11 2015 -0800
@@ -34,6 +34,7 @@
 import com.sun.tools.internal.xjc.model.nav.NClass;
 import com.sun.tools.internal.xjc.model.nav.NType;
 import com.sun.tools.internal.xjc.model.nav.NavigatorImpl;
+import com.sun.tools.internal.xjc.outline.Aspect;
 import com.sun.tools.internal.xjc.outline.Outline;
 import com.sun.xml.internal.bind.v2.model.core.Adapter;
 
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CArrayInfo.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CArrayInfo.java	Mon Feb 23 05:01:11 2015 -0800
@@ -28,6 +28,7 @@
 import javax.xml.namespace.QName;
 
 import com.sun.codemodel.internal.JType;
+import com.sun.tools.internal.xjc.outline.Aspect;
 import com.sun.xml.internal.bind.v2.model.util.ArrayInfoUtil;
 import com.sun.tools.internal.xjc.model.nav.NClass;
 import com.sun.tools.internal.xjc.model.nav.NType;
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CBuiltinLeafInfo.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CBuiltinLeafInfo.java	Mon Feb 23 05:01:11 2015 -0800
@@ -49,6 +49,7 @@
 import com.sun.codemodel.internal.JExpression;
 import com.sun.codemodel.internal.JType;
 import com.sun.tools.internal.xjc.model.nav.NClass;
+import com.sun.tools.internal.xjc.outline.Aspect;
 import com.sun.xml.internal.bind.v2.model.annotation.Locatable;
 import com.sun.xml.internal.bind.v2.model.core.BuiltinLeafInfo;
 import com.sun.xml.internal.bind.v2.model.core.Element;
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CClassInfo.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CClassInfo.java	Mon Feb 23 05:01:11 2015 -0800
@@ -45,6 +45,7 @@
 import com.sun.tools.internal.xjc.Language;
 import com.sun.tools.internal.xjc.model.nav.NClass;
 import com.sun.tools.internal.xjc.model.nav.NType;
+import com.sun.tools.internal.xjc.outline.Aspect;
 import com.sun.tools.internal.xjc.outline.Outline;
 import com.sun.tools.internal.xjc.reader.Ring;
 import com.sun.tools.internal.xjc.reader.xmlschema.BGMBuilder;
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CClassRef.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CClassRef.java	Mon Feb 23 05:01:11 2015 -0800
@@ -30,6 +30,7 @@
 import com.sun.codemodel.internal.JClass;
 import com.sun.tools.internal.xjc.model.nav.NClass;
 import com.sun.tools.internal.xjc.model.nav.NType;
+import com.sun.tools.internal.xjc.outline.Aspect;
 import com.sun.tools.internal.xjc.outline.Outline;
 import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIClass;
 import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIEnum;
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CElementInfo.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CElementInfo.java	Mon Feb 23 05:01:11 2015 -0800
@@ -43,6 +43,7 @@
 import com.sun.tools.internal.xjc.model.nav.NClass;
 import com.sun.tools.internal.xjc.model.nav.NType;
 import com.sun.tools.internal.xjc.model.nav.NavigatorImpl;
+import com.sun.tools.internal.xjc.outline.Aspect;
 import com.sun.tools.internal.xjc.outline.Outline;
 import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIInlineBinaryData;
 import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIFactoryMethod;
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CEnumLeafInfo.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CEnumLeafInfo.java	Mon Feb 23 05:01:11 2015 -0800
@@ -34,6 +34,7 @@
 import com.sun.codemodel.internal.JExpression;
 import com.sun.tools.internal.xjc.model.nav.NClass;
 import com.sun.tools.internal.xjc.model.nav.NType;
+import com.sun.tools.internal.xjc.outline.Aspect;
 import com.sun.tools.internal.xjc.outline.Outline;
 import com.sun.xml.internal.bind.v2.model.annotation.Locatable;
 import com.sun.xml.internal.bind.v2.model.core.EnumLeafInfo;
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CReferencePropertyInfo.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CReferencePropertyInfo.java	Mon Feb 23 05:01:11 2015 -0800
@@ -26,7 +26,7 @@
 package com.sun.tools.internal.xjc.model;
 
 import java.util.Collection;
-import java.util.HashSet;
+import java.util.LinkedHashSet;
 import java.util.Set;
 import java.util.Map;
 
@@ -60,7 +60,7 @@
     /**
      * List of referenced elements.
      */
-    private final Set<CElement> elements = new HashSet<CElement>();
+    private final Set<CElement> elements = new LinkedHashSet<CElement>();
 
     private final boolean isMixed;
     private WildcardMode wildcard;
@@ -87,7 +87,7 @@
         // so the Java types of the substitution members need to be taken into account
         // when computing the signature
 
-        final class RefList extends HashSet<CTypeInfo> {
+        final class RefList extends LinkedHashSet<CTypeInfo> {
             RefList() {
                 super(elements.size());
                 addAll(elements);
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CTypeInfo.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CTypeInfo.java	Mon Feb 23 05:01:11 2015 -0800
@@ -29,6 +29,7 @@
 import com.sun.codemodel.internal.JType;
 import com.sun.tools.internal.xjc.model.nav.NClass;
 import com.sun.tools.internal.xjc.model.nav.NType;
+import com.sun.tools.internal.xjc.outline.Aspect;
 import com.sun.tools.internal.xjc.outline.Outline;
 import com.sun.xml.internal.bind.v2.model.core.TypeInfo;
 
@@ -44,7 +45,7 @@
      * Returns the {@link JClass} that represents the class being bound,
      * under the given {@link Outline}.
      *
-     * @see NType#toType(Outline, Aspect)
+     * @see NType#toType(Outline, com.sun.tools.internal.xjc.outline.Aspect)
      */
     JType toType(Outline o, Aspect aspect);
 }
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CWildcardTypeInfo.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CWildcardTypeInfo.java	Mon Feb 23 05:01:11 2015 -0800
@@ -29,6 +29,7 @@
 import com.sun.tools.internal.xjc.model.nav.NClass;
 import com.sun.tools.internal.xjc.model.nav.NType;
 import com.sun.tools.internal.xjc.model.nav.NavigatorImpl;
+import com.sun.tools.internal.xjc.outline.Aspect;
 import com.sun.tools.internal.xjc.outline.Outline;
 import com.sun.xml.internal.bind.v2.model.core.WildcardTypeInfo;
 
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/EagerNClass.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/EagerNClass.java	Mon Feb 23 05:01:11 2015 -0800
@@ -30,7 +30,7 @@
 import java.util.Set;
 
 import com.sun.codemodel.internal.JClass;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
 import com.sun.tools.internal.xjc.outline.Outline;
 
 /**
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/EagerNType.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/EagerNType.java	Mon Feb 23 05:01:11 2015 -0800
@@ -28,7 +28,7 @@
 import java.lang.reflect.Type;
 
 import com.sun.codemodel.internal.JType;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
 import com.sun.tools.internal.xjc.outline.Outline;
 
 /**
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NClass.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NClass.java	Mon Feb 23 05:01:11 2015 -0800
@@ -26,7 +26,7 @@
 package com.sun.tools.internal.xjc.model.nav;
 
 import com.sun.codemodel.internal.JClass;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
 import com.sun.tools.internal.xjc.outline.Outline;
 
 /**
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NClassByJClass.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NClassByJClass.java	Mon Feb 23 05:01:11 2015 -0800
@@ -26,7 +26,7 @@
 package com.sun.tools.internal.xjc.model.nav;
 
 import com.sun.codemodel.internal.JClass;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
 import com.sun.tools.internal.xjc.outline.Outline;
 
 /**
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NParameterizedType.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NParameterizedType.java	Mon Feb 23 05:01:11 2015 -0800
@@ -26,7 +26,7 @@
 package com.sun.tools.internal.xjc.model.nav;
 
 import com.sun.codemodel.internal.JClass;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
 import com.sun.tools.internal.xjc.outline.Outline;
 
 /**
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NType.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NType.java	Mon Feb 23 05:01:11 2015 -0800
@@ -26,7 +26,7 @@
 package com.sun.tools.internal.xjc.model.nav;
 
 import com.sun.codemodel.internal.JType;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
 import com.sun.tools.internal.xjc.outline.Outline;
 
 /**
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/Aspect.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,64 @@
+/*
+ * 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
+ * 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 com.sun.tools.internal.xjc.outline;
+
+import com.sun.tools.internal.xjc.generator.bean.ImplStructureStrategy;
+
+/**
+ * Sometimes a single JAXB-generated bean spans across multiple Java classes/interfaces.
+ * We call them "aspects of a bean".
+ *
+ * <p>
+ * This is an enumeration of all possible aspects.
+ *
+ * @author Kohsuke Kawaguchi
+ *
+ * TODO: move this to the model package. We cannot do this before JAXB3 because of old plugins
+ */
+public enum Aspect {
+    /**
+     * The exposed part of the bean.
+     * <p>
+     * This corresponds to the content interface when we are geneting one.
+     * This would be the same as the {@link #IMPLEMENTATION} when we are
+     * just generating beans.
+     *
+     * <p>
+     * This could be an interface, or it could be a class.
+     *
+     * We don't have any other {@link ImplStructureStrategy} at this point,
+     * but generally you can't assume anything about where this could be
+     * or whether that's equal to {@link #IMPLEMENTATION}.
+     */
+    EXPOSED,
+    /**
+     * The part of the bean that holds all the implementations.
+     *
+     * <p>
+     * This is always a class, never an interface.
+     */
+    IMPLEMENTATION
+}
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/Outline.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/Outline.java	Mon Feb 23 05:01:11 2015 -0800
@@ -33,7 +33,6 @@
 import com.sun.codemodel.internal.JPackage;
 import com.sun.codemodel.internal.JType;
 import com.sun.tools.internal.xjc.ErrorReceiver;
-import com.sun.tools.internal.xjc.model.Aspect;
 import com.sun.tools.internal.xjc.model.CClassInfo;
 import com.sun.tools.internal.xjc.model.CClassInfoParent;
 import com.sun.tools.internal.xjc.model.CElementInfo;
--- a/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/version.properties	Wed Feb 18 22:19:47 2015 -0500
+++ b/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/version.properties	Mon Feb 23 05:01:11 2015 -0800
@@ -23,7 +23,7 @@
 # questions.
 #
 
-build-id=2.2.11-b141124.1933
-build-version=JAX-WS RI 2.2.11-b141124.1933
+build-id=2.2.11-b150127.1410
+build-version=JAX-WS RI 2.2.11-b150127.1410
 major-version=2.2.11
-svn-revision=312b19a2e0e312b55e1ea6f531bd595955cd581f
+svn-revision=28121d09ed8ac02b76788709ccb4cdb66e03bbfa
--- a/jdk/.hgtags	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/.hgtags	Mon Feb 23 05:01:11 2015 -0800
@@ -291,3 +291,6 @@
 efedac7f44ed41cea2b1038138047271f55aacba jdk9-b46
 b641c14730ac05d9ec8b4f66e6fca3dc21adb403 jdk9-b47
 ebb2eb7f1aec78eb6d8cc4c96f018afa11093cde jdk9-b48
+541a8cef4e0d54c3e4b52a98c6af3c31e2096669 jdk9-b49
+f6b8edd397ee463be208fee27517c99101293267 jdk9-b50
+a0dad230aeb3b0d5cfd5b0715029e48d50573f8c jdk9-b51
--- a/jdk/make/Tools.gmk	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/make/Tools.gmk	Mon Feb 23 05:01:11 2015 -0800
@@ -147,6 +147,15 @@
     EXCLUDES := jdk/internal/jimage/concurrent, \
     BIN := $(BUILDTOOLS_OUTPUTDIR)/interim_jimage_classes))
 
+# Because of the explicit INCLUDES in the compilation setup above, the service provider
+# file will not be copied unless META-INF/services would also be added to the INCLUDES.
+# Adding META-INF/services would include all files in that directory when only the one
+# is needed, which is why this explicit copy is defined instead.
+$(eval $(call SetupCopyFiles,COPY_JIMAGE_SERVICE_PROVIDER, \
+    SRC := $(JDK_TOPDIR)/src/java.base/share/classes, \
+    DEST := $(BUILDTOOLS_OUTPUTDIR)/interim_jimage_classes, \
+    FILES := META-INF/services/java.nio.file.spi.FileSystemProvider))
+
 ##########################################################################################
 
 # Tools needed on solaris because OBJCOPY is broken.
@@ -173,7 +182,7 @@
       PROGRAM := fix_empty_sec_hdr_flags))
 endif
 
-$(BUILD_TOOLS_JDK): $(BUILD_INTERIM_JIMAGE)
+$(BUILD_TOOLS_JDK): $(BUILD_INTERIM_JIMAGE) $(COPY_JIMAGE_SERVICE_PROVIDER)
 
 java-tools: $(BUILD_TOOLS_JDK)
 
--- a/jdk/make/copy/Copy-java.base.gmk	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/make/copy/Copy-java.base.gmk	Mon Feb 23 05:01: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/jdk/make/data/charsetmapping/DoubleByte-X.java.template	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/make/data/charsetmapping/DoubleByte-X.java.template	Mon Feb 23 05:01: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/jdk/make/data/charsetmapping/charsets	Mon Feb 23 05:01: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/jdk/make/data/charsetmapping/dbcs	Wed Feb 18 22:19:47 2015 -0500
+++ /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/jdk/make/data/charsetmapping/extsbcs	Wed Feb 18 22:19:47 2015 -0500
+++ /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/jdk/make/data/charsetmapping/list_old	Mon Feb 23 05:01: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/jdk/make/data/charsetmapping/sbcs	Wed Feb 18 22:19:47 2015 -0500
+++ /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/jdk/make/data/charsetmapping/standard-charsets	Wed Feb 18 22:19:47 2015 -0500
+++ /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/jdk/make/data/charsetmapping/stdcs-linux	Mon Feb 23 05:01: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/jdk/make/data/charsetmapping/stdcs-solaris	Mon Feb 23 05:01: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/jdk/make/data/charsetmapping/stdcs-windows	Mon Feb 23 05:01: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/jdk/make/data/tzdata/VERSION	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/make/data/tzdata/VERSION	Mon Feb 23 05:01:11 2015 -0800
@@ -21,4 +21,4 @@
 # or visit www.oracle.com if you need additional information or have any
 # questions.
 #
-tzdata2014j
+tzdata2015a
--- a/jdk/make/data/tzdata/antarctica	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/make/data/tzdata/antarctica	Mon Feb 23 05:01:11 2015 -0800
@@ -70,8 +70,8 @@
 Rule	ChileAQ	2010	only	-	Apr	Sun>=1	3:00u	0	-
 Rule	ChileAQ	2011	only	-	May	Sun>=2	3:00u	0	-
 Rule	ChileAQ	2011	only	-	Aug	Sun>=16	4:00u	1:00	S
-Rule	ChileAQ	2012	max	-	Apr	Sun>=23	3:00u	0	-
-Rule	ChileAQ	2012	max	-	Sep	Sun>=2	4:00u	1:00	S
+Rule	ChileAQ	2012	2015	-	Apr	Sun>=23	3:00u	0	-
+Rule	ChileAQ	2012	2014	-	Sep	Sun>=2	4:00u	1:00	S
 
 # Argentina - year-round bases
 # Belgrano II, Confin Coast, -770227-0343737, since 1972-02-05
@@ -377,9 +377,10 @@
 #
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Antarctica/Palmer	0	-	zzz	1965
-			-4:00	ArgAQ	AR%sT	1969 Oct 5
+			-4:00	ArgAQ	AR%sT	1969 Oct  5
 			-3:00	ArgAQ	AR%sT	1982 May
-			-4:00	ChileAQ	CL%sT
+			-4:00	ChileAQ	CL%sT	2015 Apr 26 3:00u
+			-3:00	-	CLT
 #
 #
 # McMurdo Station, Ross Island, since 1955-12
--- a/jdk/make/data/tzdata/asia	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/make/data/tzdata/asia	Mon Feb 23 05:01:11 2015 -0800
@@ -168,10 +168,7 @@
 			4:00	Azer	AZ%sT
 
 # Bahrain
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Bahrain	3:22:20 -	LMT	1920     # Manamah
-			4:00	-	GST	1972 Jun
-			3:00	-	AST
+# See Asia/Qatar.
 
 # Bangladesh
 # From Alexander Krivenyshev (2009-05-13):
@@ -1754,9 +1751,7 @@
 ###############################################################################
 
 # Kuwait
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Kuwait	3:11:56 -	LMT	1950
-			3:00	-	AST
+# See Asia/Riyadh.
 
 # Laos
 # See Asia/Bangkok.
@@ -1977,12 +1972,7 @@
 			5:45	-	NPT	# Nepal Time
 
 # Oman
-
-# Milne says 3:54:24 was the meridian of the Muscat Tidal Observatory.
-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Muscat	3:54:24 -	LMT	1920
-			4:00	-	GST
+# See Asia/Dubai.
 
 # Pakistan
 
@@ -2476,6 +2466,7 @@
 Zone	Asia/Qatar	3:26:08 -	LMT	1920     # Al Dawhah / Doha
 			4:00	-	GST	1972 Jun
 			3:00	-	AST
+Link Asia/Qatar Asia/Bahrain
 
 # Saudi Arabia
 #
@@ -2502,6 +2493,8 @@
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Riyadh	3:06:52 -	LMT	1947 Mar 14
 			3:00	-	AST
+Link Asia/Riyadh Asia/Aden	# Yemen
+Link Asia/Riyadh Asia/Kuwait
 
 # Singapore
 # taken from Mok Ly Yng (2003-10-30)
@@ -2790,6 +2783,7 @@
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Dubai	3:41:12 -	LMT	1920
 			4:00	-	GST
+Link Asia/Dubai Asia/Muscat	# Oman
 
 # Uzbekistan
 # Byalokoz 1919 says Uzbekistan was 4:27:53.
@@ -2874,10 +2868,4 @@
 			7:00	-	ICT
 
 # Yemen
-
-# Milne says 2:59:54 was the meridian of the saluting battery at Aden,
-# and that Yemen was at 1:55:56, the meridian of the Hagia Sophia.
-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Aden	2:59:54	-	LMT	1950
-			3:00	-	AST
+# See Asia/Riyadh.
--- a/jdk/make/data/tzdata/backward	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/make/data/tzdata/backward	Mon Feb 23 05:01:11 2015 -0800
@@ -28,7 +28,7 @@
 # and their old names.  Many names changed in late 1993.
 
 # Link	TARGET			LINK-NAME
-Link	Africa/Asmara		Africa/Asmera
+Link	Africa/Nairobi		Africa/Asmera
 Link	Africa/Abidjan		Africa/Timbuktu
 Link	America/Argentina/Catamarca	America/Argentina/ComodRivadavia
 Link	America/Adak		America/Atka
--- a/jdk/make/data/tzdata/europe	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/make/data/tzdata/europe	Mon Feb 23 05:01:11 2015 -0800
@@ -1430,35 +1430,32 @@
 # might be a reference to the Julian calendar as opposed to Gregorian, or it
 # might mean something else (???).
 #
-# From Paul Eggert (2006-03-22):
-# The Iceland Almanak, Shanks & Pottenger, and Whitman disagree on many points.
-# We go with the Almanak, except for one claim from Shanks & Pottenger, namely
-# that Reykavik was 21W57 from 1837 to 1908, local mean time before that.
+# From Paul Eggert (2014-11-22):
+# The information below is taken from the 1988 Almanak; see
+# http://www.almanak.hi.is/klukkan.html
 #
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Iceland	1917	1918	-	Feb	19	23:00	1:00	S
+Rule	Iceland	1917	1919	-	Feb	19	23:00	1:00	S
 Rule	Iceland	1917	only	-	Oct	21	 1:00	0	-
-Rule	Iceland	1918	only	-	Nov	16	 1:00	0	-
+Rule	Iceland	1918	1919	-	Nov	16	 1:00	0	-
+Rule	Iceland	1921	only	-	Mar	19	23:00	1:00	S
+Rule	Iceland	1921	only	-	Jun	23	 1:00	0	-
 Rule	Iceland	1939	only	-	Apr	29	23:00	1:00	S
-Rule	Iceland	1939	only	-	Nov	29	 2:00	0	-
+Rule	Iceland	1939	only	-	Oct	29	 2:00	0	-
 Rule	Iceland	1940	only	-	Feb	25	 2:00	1:00	S
-Rule	Iceland	1940	only	-	Nov	 3	 2:00	0	-
-Rule	Iceland	1941	only	-	Mar	 2	 1:00s	1:00	S
-Rule	Iceland	1941	only	-	Nov	 2	 1:00s	0	-
-Rule	Iceland	1942	only	-	Mar	 8	 1:00s	1:00	S
-Rule	Iceland	1942	only	-	Oct	25	 1:00s	0	-
+Rule	Iceland	1940	1941	-	Nov	Sun>=2	 1:00s	0	-
+Rule	Iceland	1941	1942	-	Mar	Sun>=2	 1:00s	1:00	S
 # 1943-1946 - first Sunday in March until first Sunday in winter
 Rule	Iceland	1943	1946	-	Mar	Sun>=1	 1:00s	1:00	S
-Rule	Iceland	1943	1948	-	Oct	Sun>=22	 1:00s	0	-
+Rule	Iceland	1942	1948	-	Oct	Sun>=22	 1:00s	0	-
 # 1947-1967 - first Sunday in April until first Sunday in winter
 Rule	Iceland	1947	1967	-	Apr	Sun>=1	 1:00s	1:00	S
-# 1949 Oct transition delayed by 1 week
+# 1949 and 1967 Oct transitions delayed by 1 week
 Rule	Iceland	1949	only	-	Oct	30	 1:00s	0	-
 Rule	Iceland	1950	1966	-	Oct	Sun>=22	 1:00s	0	-
 Rule	Iceland	1967	only	-	Oct	29	 1:00s	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Atlantic/Reykjavik	-1:27:24 -	LMT	1837
-			-1:27:48 -	RMT	1908 # Reykjavik Mean Time?
+Zone Atlantic/Reykjavik	-1:28	-	LMT	1908
 			-1:00	Iceland	IS%sT	1968 Apr  7  1:00s
 			 0:00	-	GMT
 
--- a/jdk/make/data/tzdata/leapseconds	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/make/data/tzdata/leapseconds	Mon Feb 23 05:01:11 2015 -0800
@@ -77,3 +77,7 @@
 Leap	2005	Dec	31	23:59:60	+	S
 Leap	2008	Dec	31	23:59:60	+	S
 Leap	2012	Jun	30	23:59:60	+	S
+Leap	2015	Jun	30	23:59:60	+	S
+
+#	Updated through IERS Bulletin C49
+#	File expires on:  28 December 2015
--- a/jdk/make/data/tzdata/northamerica	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/make/data/tzdata/northamerica	Mon Feb 23 05:01:11 2015 -0800
@@ -147,7 +147,7 @@
 Rule	US	1918	1919	-	Oct	lastSun	2:00	0	S
 Rule	US	1942	only	-	Feb	9	2:00	1:00	W # War
 Rule	US	1945	only	-	Aug	14	23:00u	1:00	P # Peace
-Rule	US	1945	only	-	Sep	30	2:00	0	S
+Rule	US	1945	only	-	Sep	lastSun	2:00	0	S
 Rule	US	1967	2006	-	Oct	lastSun	2:00	0	S
 Rule	US	1967	1973	-	Apr	lastSun	2:00	1:00	D
 Rule	US	1974	only	-	Jan	6	2:00	1:00	D
@@ -2147,11 +2147,11 @@
 
 # Mexico
 
-# From Paul Eggert (2001-03-05):
+# From Paul Eggert (2014-12-07):
 # The Investigation and Analysis Service of the
 # Mexican Library of Congress (MLoC) has published a
 # history of Mexican local time (in Spanish)
-# http://www.cddhcu.gob.mx/bibliot/publica/inveyana/polisoc/horver/
+# http://www.diputados.gob.mx/bibliot/publica/inveyana/polisoc/horver/index.htm
 #
 # Here are the discrepancies between Shanks & Pottenger (S&P) and the MLoC.
 # (In all cases we go with the MLoC.)
@@ -2320,6 +2320,24 @@
 # efecto desde las dos horas del segundo domingo de marzo y concluirá a
 # las dos horas del primer domingo de noviembre.
 
+# From Steffen Thorsen (2014-12-08), translated by Gwillim Law:
+# The Mexican state of Quintana Roo will likely change to EST in 2015.
+#
+# http://www.unioncancun.mx/articulo/2014/12/04/medio-ambiente/congreso-aprueba-una-hora-mas-de-sol-en-qroo
+# "With this change, the time conflict that has existed between the municipios
+# of Quintana Roo and the municipio of Felipe Carrillo Puerto may come to an
+# end. The latter declared itself in rebellion 15 years ago when a time change
+# was initiated in Mexico, and since then it has refused to change its time
+# zone along with the rest of the country."
+#
+# From Steffen Thorsen (2015-01-14), translated by Gwillim Law:
+# http://sipse.com/novedades/confirman-aplicacion-de-nueva-zona-horaria-para-quintana-roo-132331.html
+# "...the new time zone will come into effect at two o'clock on the first Sunday
+# of February, when we will have to advance the clock one hour from its current
+# time..."
+#
+# Also, the new zone will not use DST.
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Mexico	1939	only	-	Feb	5	0:00	1:00	D
 Rule	Mexico	1939	only	-	Jun	25	0:00	0	S
@@ -2340,7 +2358,8 @@
 Zone America/Cancun	-5:47:04 -	LMT	1922 Jan  1  0:12:56
 			-6:00	-	CST	1981 Dec 23
 			-5:00	Mexico	E%sT	1998 Aug  2  2:00
-			-6:00	Mexico	C%sT
+			-6:00	Mexico	C%sT	2015 Feb  1  2:00
+			-5:00	-	EST
 # Campeche, Yucatán; represented by Mérida
 Zone America/Merida	-5:58:28 -	LMT	1922 Jan  1  0:01:32
 			-6:00	-	CST	1981 Dec 23
--- a/jdk/make/data/tzdata/southamerica	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/make/data/tzdata/southamerica	Mon Feb 23 05:01:11 2015 -0800
@@ -1229,6 +1229,11 @@
 # DST Start: first Saturday of September 2014 (Sun 07 Sep 2014 04:00 UTC)
 # http://www.diariooficial.interior.gob.cl//media/2014/02/19/do-20140219.pdf
 
+# From Juan Correa (2015-01-28):
+# ... today the Ministry of Energy announced that Chile will drop DST, will keep
+# "summer time" (UTC -3 / UTC -5) all year round....
+# http://www.minenergia.cl/ministerio/noticias/generales/ministerio-de-energia-anuncia.html
+
 # NOTE: ChileAQ rules for Antarctic bases are stored separately in the
 # 'antarctica' file.
 
@@ -1270,8 +1275,8 @@
 Rule	Chile	2010	only	-	Apr	Sun>=1	3:00u	0	-
 Rule	Chile	2011	only	-	May	Sun>=2	3:00u	0	-
 Rule	Chile	2011	only	-	Aug	Sun>=16	4:00u	1:00	S
-Rule	Chile	2012	max	-	Apr	Sun>=23	3:00u	0	-
-Rule	Chile	2012	max	-	Sep	Sun>=2	4:00u	1:00	S
+Rule	Chile	2012	2015	-	Apr	Sun>=23	3:00u	0	-
+Rule	Chile	2012	2014	-	Sep	Sun>=2	4:00u	1:00	S
 # IATA SSIM anomalies: (1992-02) says 1992-03-14;
 # (1996-09) says 1998-03-08.  Ignore these.
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
@@ -1282,11 +1287,13 @@
 			-4:00	-	CLT	1919 Jul  1 # Chile Time
 			-4:42:46 -	SMT	1927 Sep  1 # Santiago Mean Time
 			-5:00	Chile	CL%sT	1947 May 22 # Chile Time
-			-4:00	Chile	CL%sT
+			-4:00	Chile	CL%sT	2015 Apr 26  3:00u
+			-3:00	-	CLT
 Zone Pacific/Easter	-7:17:44 -	LMT	1890
 			-7:17:28 -	EMT	1932 Sep    # Easter Mean Time
-			-7:00	Chile	EAS%sT	1982 Mar 13 21:00 # Easter Time
-			-6:00	Chile	EAS%sT
+			-7:00	Chile	EAS%sT	1982 Mar 13 3:00u # Easter Time
+			-6:00	Chile	EAS%sT	2015 Apr 26 3:00u
+			-5:00	-	EAST
 #
 # Salas y Gómez Island is uninhabited.
 # Other Chilean locations, including Juan Fernández Is, Desventuradas Is,
--- a/jdk/make/data/tzdata/zone.tab	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/make/data/tzdata/zone.tab	Mon Feb 23 05:01:11 2015 -0800
@@ -297,7 +297,7 @@
 MV	+0410+07330	Indian/Maldives
 MW	-1547+03500	Africa/Blantyre
 MX	+1924-09909	America/Mexico_City	Central Time - most locations
-MX	+2105-08646	America/Cancun	Central Time - Quintana Roo
+MX	+2105-08646	America/Cancun	Eastern Standard Time - Quintana Roo
 MX	+2058-08937	America/Merida	Central Time - Campeche, Yucatan
 MX	+2540-10019	America/Monterrey	Mexican Central Time - Coahuila, Durango, Nuevo Leon, Tamaulipas away from US border
 MX	+2550-09730	America/Matamoros	US Central Time - Coahuila, Durango, Nuevo Leon, Tamaulipas near US border
--- a/jdk/make/gensrc/Gensrc-jdk.charsets.gmk	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/make/gensrc/Gensrc-jdk.charsets.gmk	Mon Feb 23 05:01: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/jdk/make/gensrc/GensrcCharsetMapping.gmk	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/make/gensrc/GensrcCharsetMapping.gmk	Mon Feb 23 05:01: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
-
-################################################################################
-#
-# 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; \
-    } '
+GENSRC_JAVA_BASE += $(CHARSET_DONE_BASE)-stdcs
 
-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/jdk/make/launcher/Launcher-jdk.dev.gmk	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/make/launcher/Launcher-jdk.dev.gmk	Mon Feb 23 05:01: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/jdk/make/launcher/Launcher-jdk.runtime.gmk	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/make/launcher/Launcher-jdk.runtime.gmk	Mon Feb 23 05:01: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) }'))
 
@@ -66,19 +60,6 @@
 ifeq ($(OPENJDK_TARGET_OS), solaris)
   UNPACKEXE_LANG := C++
 endif
-UNPACKEXE_DEBUG_SYMBOLS := true
-# On windows, unpack200 is linked completely differently to all other
-# executables, using the compiler with the compiler arguments.
-# It's also linked incrementally, producing a .ilk file that needs to
-# be kept away.
-ifeq ($(OPENJDK_TARGET_OS), windows)
-  BUILD_UNPACKEXE_LDEXE := $(CC)
-  EXE_OUT_OPTION_save := $(EXE_OUT_OPTION)
-  EXE_OUT_OPTION := -Fe
-  # With the current way unpack200 is built, debug symbols aren't supported
-  # anyway.
-  UNPACKEXE_DEBUG_SYMBOLS := false
-endif
 
 # The linker on older SuSE distros (e.g. on SLES 10) complains with:
 # "Invalid version tag `SUNWprivate_1.1'. Only anonymous version tag is allowed in executable."
@@ -93,49 +74,36 @@
     SRC := $(UNPACKEXE_SRC), \
     LANG := $(UNPACKEXE_LANG), \
     OPTIMIZATION := LOW, \
-    CFLAGS := $(UNPACKEXE_CFLAGS) $(CXXFLAGS_JDKEXE) \
-        -DFULL, \
+    CFLAGS := $(UNPACKEXE_CFLAGS) $(CXXFLAGS_JDKEXE) -DFULL, \
     CFLAGS_release := -DPRODUCT, \
     CFLAGS_linux := -fPIC, \
     CFLAGS_solaris := -KPIC, \
     CFLAGS_macosx := -fPIC, \
     MAPFILE := $(UNPACK_MAPFILE),\
-    LDFLAGS := $(UNPACKEXE_ZIPOBJS), \
-    LDFLAGS_windows := $(CXXFLAGS_JDKEXE), \
-    LDFLAGS_unix := $(LDFLAGS_JDKEXE) $(LDFLAGS_CXX_JDK) \
+    LDFLAGS := $(UNPACKEXE_ZIPOBJS) \
+        $(LDFLAGS_JDKEXE) $(LDFLAGS_CXX_JDK) \
         $(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)unpack$(SHARED_LIBRARY_SUFFIX)) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
     LDFLAGS_linux := -lc, \
     LDFLAGS_solaris := $(UNPACKEXE_LDFLAGS_solaris) -lc, \
     LDFLAGS_SUFFIX := $(LIBCXX), \
     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/unpackexe$(OUTPUT_SUBDIR), \
-    OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/unpackexe$(OUTPUT_SUBDIR), \
+    OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_cmds/$(MODULE), \
     PROGRAM := unpack200, \
     VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
     RC_FLAGS := $(RC_FLAGS) \
         -D "JDK_FNAME=unpack200.exe" \
         -D "JDK_INTERNAL_NAME=unpack200" \
         -D "JDK_FTYPE=0x1L", \
-    DEBUG_SYMBOLS := $(UNPACKEXE_DEBUG_SYMBOLS), \
+    DEBUG_SYMBOLS := true, \
     MANIFEST := $(JDK_TOPDIR)/src/jdk.runtime/windows/native/unpack200/unpack200_proto.exe.manifest))
 
-ifeq ($(OPENJDK_TARGET_OS), windows)
-  EXE_OUT_OPTION := $(EXE_OUT_OPTION_save)
-endif
-
 ifneq ($(USE_EXTERNAL_LIBZ), true)
 
   $(BUILD_UNPACKEXE): $(UNPACKEXE_ZIPOBJS)
 
 endif
 
-# Build into object dir and copy executable afterwards to avoid .ilk file in
-# image. The real fix would be clean up linking of unpack200 using
-# -link -incremental:no
-# like all other launchers.
-$(SUPPORT_OUTPUTDIR)/modules_cmds/$(MODULE)/unpack200$(EXE_SUFFIX): $(BUILD_UNPACKEXE)
-	$(call install-file)
-
-TARGETS += $(SUPPORT_OUTPUTDIR)/modules_cmds/$(MODULE)/unpack200$(EXE_SUFFIX)
+TARGETS += $(BUILD_UNPACKEXE)
 
 ################################################################################
--- a/jdk/make/lib/Awt2dLibraries.gmk	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/make/lib/Awt2dLibraries.gmk	Mon Feb 23 05:01: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/jdk/make/lib/CoreLibraries.gmk	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/make/lib/CoreLibraries.gmk	Mon Feb 23 05:01: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/jdk/make/lib/Lib-jdk.runtime.gmk	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/make/lib/Lib-jdk.runtime.gmk	Mon Feb 23 05:01: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/jdk/make/src/classes/build/tools/charsetmapping/Charset.java	Mon Feb 23 05:01: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/jdk/make/src/classes/build/tools/charsetmapping/DBCS.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/make/src/classes/build/tools/charsetmapping/DBCS.java	Mon Feb 23 05:01: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/jdk/make/src/classes/build/tools/charsetmapping/HKSCS.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/make/src/classes/build/tools/charsetmapping/HKSCS.java	Mon Feb 23 05:01: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(args[0], "HKSCS2008.map")),
-                  new FileInputStream(new File(args[0], "HKSCS2008.c2b")),
-                  new PrintStream(new File(args[1], "HKSCSMapping.java"),
+        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",
-                  getCopyright(new File(args[3])));
+                  true,
+                  "");
+    }
 
-
-        // xp2001
-        genClass0(new FileInputStream(new File(args[0], "HKSCS_XP.map")),
+    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(args[1], "HKSCS_XPMapping.java"),
+                  new PrintStream(new File(dstDir, "HKSCS_XPMapping.java"),
                                   "ISO-8859-1"),
+                  pkgName,
                   "HKSCS_XPMapping",
-                  getCopyright(new File(args[3])));
+                  false,
+                  "");
+    }
 
+    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/jdk/make/src/classes/build/tools/charsetmapping/Hasher.java	Mon Feb 23 05:01: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/jdk/make/src/classes/build/tools/charsetmapping/Main.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/make/src/classes/build/tools/charsetmapping/Main.java	Mon Feb 23 05:01: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/jdk/make/src/classes/build/tools/charsetmapping/SBCS.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/make/src/classes/build/tools/charsetmapping/SBCS.java	Mon Feb 23 05:01: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/jdk/make/src/classes/build/tools/charsetmapping/SPI.java	Mon Feb 23 05:01: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/jdk/make/src/classes/build/tools/charsetmapping/SRC.java	Mon Feb 23 05:01: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/jdk/make/src/classes/build/tools/module/boot.modules	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/make/src/classes/build/tools/module/boot.modules	Mon Feb 23 05:01:11 2015 -0800
@@ -1,9 +1,7 @@
 java.base
+java.compiler
+java.datatransfer
 java.desktop
-java.activation
-java.annotations.common
-java.compiler
-java.corba
 java.instrument
 java.logging
 java.management
@@ -11,25 +9,21 @@
 java.prefs
 java.rmi
 java.scripting
-java.security.acl
 java.security.jgss
 java.security.sasl
 java.smartcardio
 java.sql
 java.sql.rowset
-java.transaction
 java.xml
-java.xml.bind
 java.xml.crypto
-java.xml.ws
 jdk.charsets
 jdk.deploy
 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/jdk/make/src/classes/build/tools/module/ext.modules	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/make/src/classes/build/tools/module/ext.modules	Mon Feb 23 05:01:11 2015 -0800
@@ -1,3 +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
@@ -6,4 +13,3 @@
 jdk.naming.dns
 jdk.scripting.nashorn
 jdk.zipfs
-jdk.accessbridge
--- a/jdk/src/java.base/macosx/native/libjli/java_md_macosx.c	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/macosx/native/libjli/java_md_macosx.c	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -1059,6 +1059,7 @@
 void PostJVMInit(JNIEnv *env, jstring mainClass, JavaVM *vm) {
     jvmInstance = vm;
     SetMainClassForAWT(env, mainClass);
+    CHECK_EXCEPTION_RETURN();
     ShowSplashScreen();
 }
 
--- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/GHASH.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/GHASH.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,9 +29,7 @@
 
 package com.sun.crypto.provider;
 
-import java.util.Arrays;
-import java.security.*;
-import static com.sun.crypto.provider.AESConstants.AES_BLOCK_SIZE;
+import java.security.ProviderException;
 
 /**
  * This class represents the GHASH function defined in NIST 800-38D
@@ -44,62 +43,90 @@
  */
 final class GHASH {
 
-    private static final byte P128 = (byte) 0xe1; //reduction polynomial
-
-    private static boolean getBit(byte[] b, int pos) {
-        int p = pos / 8;
-        pos %= 8;
-        int i = (b[p] >>> (7 - pos)) & 1;
-        return i != 0;
+    private static long getLong(byte[] buffer, int offset) {
+        long result = 0;
+        int end = offset + 8;
+        for (int i = offset; i < end; ++i) {
+            result = (result << 8) + (buffer[i] & 0xFF);
+        }
+        return result;
     }
 
-    private static void shift(byte[] b) {
-        byte temp, temp2;
-        temp2 = 0;
-        for (int i = 0; i < b.length; i++) {
-            temp = (byte) ((b[i] & 0x01) << 7);
-            b[i] = (byte) ((b[i] & 0xff) >>> 1);
-            b[i] = (byte) (b[i] | temp2);
-            temp2 = temp;
+    private static void putLong(byte[] buffer, int offset, long value) {
+        int end = offset + 8;
+        for (int i = end - 1; i >= offset; --i) {
+            buffer[i] = (byte) value;
+            value >>= 8;
         }
     }
 
-    // Given block X and Y, returns the muliplication of X * Y
-    private static byte[] blockMult(byte[] x, byte[] y) {
-        if (x.length != AES_BLOCK_SIZE || y.length != AES_BLOCK_SIZE) {
-            throw new RuntimeException("illegal input sizes");
-        }
-        byte[] z = new byte[AES_BLOCK_SIZE];
-        byte[] v = y.clone();
-        // calculate Z1-Z127 and V1-V127
-        for (int i = 0; i < 127; i++) {
+    private static final int AES_BLOCK_SIZE = 16;
+
+    // Multiplies state0, state1 by V0, V1.
+    private void blockMult(long V0, long V1) {
+        long Z0 = 0;
+        long Z1 = 0;
+        long X;
+
+        // Separate loops for processing state0 and state1.
+        X = state0;
+        for (int i = 0; i < 64; i++) {
             // Zi+1 = Zi if bit i of x is 0
-            if (getBit(x, i)) {
-                for (int n = 0; n < z.length; n++) {
-                    z[n] ^= v[n];
-                }
-            }
-            boolean lastBitOfV = getBit(v, 127);
-            shift(v);
-            if (lastBitOfV) v[0] ^= P128;
+            long mask = X >> 63;
+            Z0 ^= V0 & mask;
+            Z1 ^= V1 & mask;
+
+            // Save mask for conditional reduction below.
+            mask = (V1 << 63) >> 63;
+
+            // V = rightshift(V)
+            long carry = V0 & 1;
+            V0 = V0 >>> 1;
+            V1 = (V1 >>> 1) | (carry << 63);
+
+            // Conditional reduction modulo P128.
+            V0 ^= 0xe100000000000000L & mask;
+            X <<= 1;
         }
+
+        X = state1;
+        for (int i = 64; i < 127; i++) {
+            // Zi+1 = Zi if bit i of x is 0
+            long mask = X >> 63;
+            Z0 ^= V0 & mask;
+            Z1 ^= V1 & mask;
+
+            // Save mask for conditional reduction below.
+            mask = (V1 << 63) >> 63;
+
+            // V = rightshift(V)
+            long carry = V0 & 1;
+            V0 = V0 >>> 1;
+            V1 = (V1 >>> 1) | (carry << 63);
+
+            // Conditional reduction.
+            V0 ^= 0xe100000000000000L & mask;
+            X <<= 1;
+        }
+
         // calculate Z128
-        if (getBit(x, 127)) {
-            for (int n = 0; n < z.length; n++) {
-                z[n] ^= v[n];
-            }
-        }
-        return z;
+        long mask = X >> 63;
+        Z0 ^= V0 & mask;
+        Z1 ^= V1 & mask;
+
+        // Save result.
+        state0 = Z0;
+        state1 = Z1;
     }
 
     // hash subkey H; should not change after the object has been constructed
-    private final byte[] subkeyH;
+    private final long subkeyH0, subkeyH1;
 
     // buffer for storing hash
-    private byte[] state;
+    private long state0, state1;
 
     // variables for save/restore calls
-    private byte[] stateSave = null;
+    private long stateSave0, stateSave1;
 
     /**
      * Initializes the cipher in the specified mode with the given key
@@ -114,8 +141,8 @@
         if ((subkeyH == null) || subkeyH.length != AES_BLOCK_SIZE) {
             throw new ProviderException("Internal error");
         }
-        this.subkeyH = subkeyH;
-        this.state = new byte[AES_BLOCK_SIZE];
+        this.subkeyH0 = getLong(subkeyH, 0);
+        this.subkeyH1 = getLong(subkeyH, 8);
     }
 
     /**
@@ -124,31 +151,33 @@
      * this object for different data w/ the same H.
      */
     void reset() {
-        Arrays.fill(state, (byte) 0);
+        state0 = 0;
+        state1 = 0;
     }
 
     /**
      * Save the current snapshot of this GHASH object.
      */
     void save() {
-        stateSave = state.clone();
+        stateSave0 = state0;
+        stateSave1 = state1;
     }
 
     /**
      * Restores this object using the saved snapshot.
      */
     void restore() {
-        state = stateSave;
+        state0 = stateSave0;
+        state1 = stateSave1;
     }
 
     private void processBlock(byte[] data, int ofs) {
         if (data.length - ofs < AES_BLOCK_SIZE) {
             throw new RuntimeException("need complete block");
         }
-        for (int n = 0; n < state.length; n++) {
-            state[n] ^= data[ofs + n];
-        }
-        state = blockMult(state, subkeyH);
+        state0 ^= getLong(data, ofs);
+        state1 ^= getLong(data, ofs + 8);
+        blockMult(subkeyH0, subkeyH1);
     }
 
     void update(byte[] in) {
@@ -169,10 +198,10 @@
     }
 
     byte[] digest() {
-        try {
-            return state.clone();
-        } finally {
-            reset();
-        }
+        byte[] result = new byte[AES_BLOCK_SIZE];
+        putLong(result, 0, state0);
+        putLong(result, 8, state1);
+        reset();
+        return result;
     }
 }
--- a/jdk/src/java.base/share/classes/java/io/PushbackInputStream.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/java/io/PushbackInputStream.java	Mon Feb 23 05:01:11 2015 -0800
@@ -28,9 +28,10 @@
 /**
  * A <code>PushbackInputStream</code> adds
  * functionality to another input stream, namely
- * the  ability to "push back" or "unread"
- * one byte. This is useful in situations where
- * it is  convenient for a fragment of code
+ * the  ability to "push back" or "unread" bytes,
+ * by storing pushed-back bytes in an internal buffer.
+ * This is useful in situations where
+ * it is convenient for a fragment of code
  * to read an indefinite number of data bytes
  * that  are delimited by a particular byte
  * value; after reading the terminating byte,
@@ -77,11 +78,9 @@
     /**
      * Creates a <code>PushbackInputStream</code>
      * with a pushback buffer of the specified <code>size</code>,
-     * and saves its  argument, the input stream
+     * and saves its argument, the input stream
      * <code>in</code>, for later use. Initially,
-     * there is no pushed-back byte  (the field
-     * <code>pushBack</code> is initialized to
-     * <code>-1</code>).
+     * the pushback buffer is empty.
      *
      * @param  in    the input stream from which bytes will be read.
      * @param  size  the size of the pushback buffer.
@@ -99,11 +98,9 @@
 
     /**
      * Creates a <code>PushbackInputStream</code>
-     * and saves its  argument, the input stream
+     * with a 1-byte pushback buffer, and saves its argument, the input stream
      * <code>in</code>, for later use. Initially,
-     * there is no pushed-back byte  (the field
-     * <code>pushBack</code> is initialized to
-     * <code>-1</code>).
+     * the pushback buffer is empty.
      *
      * @param   in   the input stream from which bytes will be read.
      */
--- a/jdk/src/java.base/share/classes/java/lang/Number.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/java/lang/Number.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 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
@@ -37,7 +37,7 @@
  *
  * For platform classes, the conversion is often analogous to a
  * narrowing primitive conversion or a widening primitive conversion
- * as defining in <cite>The Java&trade; Language Specification</cite>
+ * as defined in <cite>The Java&trade; Language Specification</cite>
  * for converting between primitive types.  Therefore, conversions may
  * lose information about the overall magnitude of a numeric value, may
  * lose precision, and may even return a result of a different sign
@@ -54,8 +54,7 @@
  */
 public abstract class Number implements java.io.Serializable {
     /**
-     * Returns the value of the specified number as an {@code int},
-     * which may involve rounding or truncation.
+     * Returns the value of the specified number as an {@code int}.
      *
      * @return  the numeric value represented by this object after conversion
      *          to type {@code int}.
@@ -63,8 +62,7 @@
     public abstract int intValue();
 
     /**
-     * Returns the value of the specified number as a {@code long},
-     * which may involve rounding or truncation.
+     * Returns the value of the specified number as a {@code long}.
      *
      * @return  the numeric value represented by this object after conversion
      *          to type {@code long}.
@@ -72,8 +70,7 @@
     public abstract long longValue();
 
     /**
-     * Returns the value of the specified number as a {@code float},
-     * which may involve rounding.
+     * Returns the value of the specified number as a {@code float}.
      *
      * @return  the numeric value represented by this object after conversion
      *          to type {@code float}.
@@ -81,8 +78,7 @@
     public abstract float floatValue();
 
     /**
-     * Returns the value of the specified number as a {@code double},
-     * which may involve rounding.
+     * Returns the value of the specified number as a {@code double}.
      *
      * @return  the numeric value represented by this object after conversion
      *          to type {@code double}.
@@ -90,8 +86,7 @@
     public abstract double doubleValue();
 
     /**
-     * Returns the value of the specified number as a {@code byte},
-     * which may involve rounding or truncation.
+     * Returns the value of the specified number as a {@code byte}.
      *
      * <p>This implementation returns the result of {@link #intValue} cast
      * to a {@code byte}.
@@ -105,8 +100,7 @@
     }
 
     /**
-     * Returns the value of the specified number as a {@code short},
-     * which may involve rounding or truncation.
+     * Returns the value of the specified number as a {@code short}.
      *
      * <p>This implementation returns the result of {@link #intValue} cast
      * to a {@code short}.
--- a/jdk/src/java.base/share/classes/java/lang/ProcessBuilder.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/java/lang/ProcessBuilder.java	Mon Feb 23 05:01:11 2015 -0800
@@ -964,6 +964,9 @@
      * of the exception is system-dependent, but it will always be a
      * subclass of {@link IOException}.
      *
+     * <p>If the operating system does not support the creation of
+     * processes, an {@link UnsupportedOperationException} will be thrown.
+     *
      * <p>Subsequent modifications to this process builder will not
      * affect the returned {@link Process}.
      *
@@ -998,6 +1001,9 @@
      *
      *         </ul>
      *
+     * @throws  UnsupportedOperationException
+     *          If the operating system does not support the creation of processes.
+     *
      * @throws IOException if an I/O error occurs
      *
      * @see Runtime#exec(String[], String[], java.io.File)
--- a/jdk/src/java.base/share/classes/java/lang/Runtime.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/java/lang/Runtime.java	Mon Feb 23 05:01:11 2015 -0800
@@ -576,6 +576,9 @@
      * of the exception is system-dependent, but it will always be a
      * subclass of {@link IOException}.
      *
+     * <p>If the operating system does not support the creation of
+     * processes, an {@link UnsupportedOperationException} will be thrown.
+     *
      *
      * @param   cmdarray  array containing the command to call and
      *                    its arguments.
@@ -597,6 +600,9 @@
      *          {@link SecurityManager#checkExec checkExec}
      *          method doesn't allow creation of the subprocess
      *
+     * @throws  UnsupportedOperationException
+     *          If the operating system does not support the creation of processes.
+     *
      * @throws  IOException
      *          If an I/O error occurs
      *
--- a/jdk/src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java	Mon Feb 23 05:01: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/jdk/src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java	Mon Feb 23 05:01: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/jdk/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java	Mon Feb 23 05:01: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/jdk/src/java.base/share/classes/java/lang/invoke/Invokers.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/Invokers.java	Mon Feb 23 05:01: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/jdk/src/java.base/share/classes/java/lang/invoke/LambdaForm.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/LambdaForm.java	Mon Feb 23 05:01: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/jdk/src/java.base/share/classes/java/lang/invoke/LambdaFormEditor.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/LambdaFormEditor.java	Mon Feb 23 05:01: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/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandle.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandle.java	Mon Feb 23 05:01: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/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java	Mon Feb 23 05:01: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/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleStatics.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleStatics.java	Mon Feb 23 05:01: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/jdk/src/java.base/share/classes/java/lang/reflect/Executable.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/java/lang/reflect/Executable.java	Mon Feb 23 05:01:11 2015 -0800
@@ -662,7 +662,7 @@
      *
      * If this {@code Executable} object represents a static method or
      * represents a constructor of a top level, static member, local, or
-     * anoymous class, then the return value is null.
+     * anonymous class, then the return value is null.
      *
      * @return an object representing the receiver type of the method or
      * constructor represented by this {@code Executable} or {@code null} if
--- a/jdk/src/java.base/share/classes/java/math/BigDecimal.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/java/math/BigDecimal.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, 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
@@ -4814,41 +4814,61 @@
         if (dividendHi >= divisor) {
             return null;
         }
+
         final int shift = Long.numberOfLeadingZeros(divisor);
         divisor <<= shift;
 
         final long v1 = divisor >>> 32;
         final long v0 = divisor & LONG_MASK;
 
-        long q1, q0;
-        long r_tmp;
-
         long tmp = dividendLo << shift;
         long u1 = tmp >>> 32;
         long u0 = tmp & LONG_MASK;
 
         tmp = (dividendHi << shift) | (dividendLo >>> 64 - shift);
         long u2 = tmp & LONG_MASK;
-        tmp = divWord(tmp,v1);
-        q1 = tmp & LONG_MASK;
-        r_tmp = tmp >>> 32;
+        long q1, r_tmp;
+        if (v1 == 1) {
+            q1 = tmp;
+            r_tmp = 0;
+        } else if (tmp >= 0) {
+            q1 = tmp / v1;
+            r_tmp = tmp - q1 * v1;
+        } else {
+            long[] rq = divRemNegativeLong(tmp, v1);
+            q1 = rq[1];
+            r_tmp = rq[0];
+        }
+
         while(q1 >= DIV_NUM_BASE || unsignedLongCompare(q1*v0, make64(r_tmp, u1))) {
             q1--;
             r_tmp += v1;
             if (r_tmp >= DIV_NUM_BASE)
                 break;
         }
+
         tmp = mulsub(u2,u1,v1,v0,q1);
         u1 = tmp & LONG_MASK;
-        tmp = divWord(tmp,v1);
-        q0 = tmp & LONG_MASK;
-        r_tmp = tmp >>> 32;
+        long q0;
+        if (v1 == 1) {
+            q0 = tmp;
+            r_tmp = 0;
+        } else if (tmp >= 0) {
+            q0 = tmp / v1;
+            r_tmp = tmp - q0 * v1;
+        } else {
+            long[] rq = divRemNegativeLong(tmp, v1);
+            q0 = rq[1];
+            r_tmp = rq[0];
+        }
+
         while(q0 >= DIV_NUM_BASE || unsignedLongCompare(q0*v0,make64(r_tmp,u0))) {
             q0--;
             r_tmp += v1;
             if (r_tmp >= DIV_NUM_BASE)
                 break;
         }
+
         if((int)q1 < 0) {
             // result (which is positive and unsigned here)
             // can't fit into long due to sign bit is used for value
@@ -4871,10 +4891,13 @@
                 }
             }
         }
+
         long q = make64(q1,q0);
         q*=sign;
+
         if (roundingMode == ROUND_DOWN && scale == preferredScale)
             return valueOf(q, scale);
+
         long r = mulsub(u1, u0, v1, v0, q0) >>> shift;
         if (r != 0) {
             boolean increment = needIncrement(divisor >>> shift, roundingMode, sign, q, r);
@@ -4917,28 +4940,35 @@
         }
     }
 
-    private static long divWord(long n, long dLong) {
-        long r;
-        long q;
-        if (dLong == 1) {
-            q = (int)n;
-            return (q & LONG_MASK);
-        }
+    /**
+     * Calculate the quotient and remainder of dividing a negative long by
+     * another long.
+     *
+     * @param n the numerator; must be negative
+     * @param d the denominator; must not be unity
+     * @return a two-element {@long} array with the remainder and quotient in
+     *         the initial and final elements, respectively
+     */
+    private static long[] divRemNegativeLong(long n, long d) {
+        assert n < 0 : "Non-negative numerator " + n;
+        assert d != 1 : "Unity denominator";
+
         // Approximate the quotient and remainder
-        q = (n >>> 1) / (dLong >>> 1);
-        r = n - q*dLong;
+        long q = (n >>> 1) / (d >>> 1);
+        long r = n - q * d;
 
         // Correct the approximation
         while (r < 0) {
-            r += dLong;
+            r += d;
             q--;
         }
-        while (r >= dLong) {
-            r -= dLong;
+        while (r >= d) {
+            r -= d;
             q++;
         }
-        // n - q*dlong == r && 0 <= r <dLong, hence we're done.
-        return (r << 32) | (q & LONG_MASK);
+
+        // n - q*d == r && 0 <= r < d, hence we're done.
+        return new long[] {r, q};
     }
 
     private static long make64(long hi, long lo) {
--- a/jdk/src/java.base/share/classes/java/net/DatagramSocket.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/java/net/DatagramSocket.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 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
@@ -1308,6 +1308,7 @@
     /**
      * Sets the value of a socket option.
      *
+     * @param <T> The type of the socket option value
      * @param name The socket option
      * @param value The value of the socket option. A value of {@code null}
      *              may be valid for some options.
@@ -1342,6 +1343,7 @@
     /**
      * Returns the value of a socket option.
      *
+     * @param <T> The type of the socket option value
      * @param name The socket option
      *
      * @return The value of the socket option.
--- a/jdk/src/java.base/share/classes/java/net/DatagramSocketImpl.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/java/net/DatagramSocketImpl.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, 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
@@ -267,6 +267,7 @@
     /**
      * Called to set a socket option.
      *
+     * @param <T> The type of the socket option value
      * @param name The socket option
      *
      * @param value The value of the socket option. A value of {@code null}
@@ -276,7 +277,7 @@
      *         support the option
      *
      * @throws NullPointerException if name is {@code null}
-     *
+     * @throws IOException if an I/O problem occurs while attempting to set the option
      * @since 1.9
      */
     protected <T> void setOption(SocketOption<T> name, T value) throws IOException {
@@ -308,12 +309,15 @@
     /**
      * Called to get a socket option.
      *
+     * @return the socket option
+     * @param <T> The type of the socket option value
      * @param name The socket option
      *
      * @throws UnsupportedOperationException if the DatagramSocketImpl does not
      *         support the option
      *
      * @throws NullPointerException if name is {@code null}
+     * @throws IOException if an I/O problem occurs while attempting to set the option
      *
      * @since 1.9
      */
--- a/jdk/src/java.base/share/classes/java/net/ServerSocket.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/java/net/ServerSocket.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 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
@@ -924,6 +924,7 @@
     /**
      * Sets the value of a socket option.
      *
+     * @param <T> The type of the socket option value
      * @param name The socket option
      * @param value The value of the socket option. A value of {@code null}
      *              may be valid for some options.
@@ -957,6 +958,7 @@
     /**
      * Returns the value of a socket option.
      *
+     * @param <T> The type of the socket option value
      * @param name The socket option
      *
      * @return The value of the socket option.
--- a/jdk/src/java.base/share/classes/java/net/Socket.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/java/net/Socket.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 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
@@ -1727,6 +1727,7 @@
     /**
      * Sets the value of a socket option.
      *
+     * @param <T> The type of the socket option value
      * @param name The socket option
      * @param value The value of the socket option. A value of {@code null}
      *              may be valid for some options.
@@ -1758,6 +1759,7 @@
     /**
      * Returns the value of a socket option.
      *
+     * @param <T> The type of the socket option value
      * @param name The socket option
      *
      * @return The value of the socket option.
--- a/jdk/src/java.base/share/classes/java/net/SocketImpl.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/java/net/SocketImpl.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 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
@@ -362,6 +362,7 @@
     /**
      * Called to set a socket option.
      *
+     * @param <T> The type of the socket option value
      * @param name The socket option
      *
      * @param value The value of the socket option. A value of {@code null}
@@ -397,6 +398,7 @@
     /**
      * Called to get a socket option.
      *
+     * @param <T> The type of the socket option value
      * @param name The socket option
      *
      * @return the value of the named option
--- a/jdk/src/java.base/share/classes/java/nio/channels/FileLock.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/java/nio/channels/FileLock.java	Mon Feb 23 05:01:11 2015 -0800
@@ -26,6 +26,7 @@
 package java.nio.channels;
 
 import java.io.IOException;
+import java.util.Objects;
 
 /**
  * A token representing a lock on a region of a file.
@@ -147,6 +148,7 @@
     protected FileLock(FileChannel channel,
                        long position, long size, boolean shared)
     {
+        Objects.requireNonNull(channel, "Null channel");
         if (position < 0)
             throw new IllegalArgumentException("Negative position");
         if (size < 0)
@@ -185,6 +187,7 @@
     protected FileLock(AsynchronousFileChannel channel,
                        long position, long size, boolean shared)
     {
+        Objects.requireNonNull(channel, "Null channel");
         if (position < 0)
             throw new IllegalArgumentException("Negative position");
         if (size < 0)
--- a/jdk/src/java.base/share/classes/java/nio/channels/Pipe.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/java/nio/channels/Pipe.java	Mon Feb 23 05:01: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/jdk/src/java.base/share/classes/java/security/AccessControlContext.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/java/security/AccessControlContext.java	Mon Feb 23 05:01: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/jdk/src/java.base/share/classes/java/security/KeyStore.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/java/security/KeyStore.java	Mon Feb 23 05:01: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
@@ -1618,11 +1618,13 @@
      * integrity check.
      *
      * <p>
-     * This method traverses the list of registered security {@link Providers},
-     * starting with the most preferred Provider.
-     * For each {@link KeyStoreSpi} implementation supported by a Provider,
-     * it invokes the {@link engineProbe} method to determine if it supports
-     * the specified keystore.
+     * This method traverses the list of registered security
+     * {@linkplain Provider providers}, starting with the most
+     * preferred Provider.
+     * For each {@link KeyStoreSpi} implementation supported by a
+     * Provider, it invokes the {@link
+     * KeyStoreSpi#engineProbe(InputStream) engineProbe} method to
+     * determine if it supports the specified keystore.
      * A new KeyStore object is returned that encapsulates the KeyStoreSpi
      * implementation from the first Provider that supports the specified file.
      *
@@ -1672,11 +1674,12 @@
      * unlock the keystore data or perform an integrity check.
      *
      * <p>
-     * This method traverses the list of registered security {@link Providers},
-     * starting with the most preferred Provider.
-     * For each {@link KeyStoreSpi} implementation supported by a Provider,
-     * it invokes the {@link engineProbe} method to determine if it supports
-     * the specified keystore.
+     * This method traverses the list of registered security {@linkplain
+     * Provider providers}, starting with the most preferred Provider.
+     * For each {@link KeyStoreSpi} implementation supported by a
+     * Provider, it invokes the {@link
+     * KeyStoreSpi#engineProbe(InputStream) engineProbe} method to
+     * determine if it supports the specified keystore.
      * A new KeyStore object is returned that encapsulates the KeyStoreSpi
      * implementation from the first Provider that supports the specified file.
      *
--- a/jdk/src/java.base/share/classes/java/security/ProtectionDomain.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/java/security/ProtectionDomain.java	Mon Feb 23 05:01: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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.base/share/classes/java/security/acl/Acl.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,241 @@
+/*
+ * Copyright (c) 1996, 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 java.security.acl;
+
+import java.util.Enumeration;
+import java.security.Principal;
+
+/**
+ * Interface representing an Access Control List (ACL).  An Access
+ * Control List is a data structure used to guard access to
+ * resources.<p>
+ *
+ * An ACL can be thought of as a data structure with multiple ACL
+ * entries.  Each ACL entry, of interface type AclEntry, contains a
+ * set of permissions associated with a particular principal. (A
+ * principal represents an entity such as an individual user or a
+ * group). Additionally, each ACL entry is specified as being either
+ * positive or negative. If positive, the permissions are to be
+ * granted to the associated principal. If negative, the permissions
+ * are to be denied.<p>
+ *
+ * The ACL Entries in each ACL observe the following rules:
+ *
+ * <ul> <li>Each principal can have at most one positive ACL entry and
+ * one negative entry; that is, multiple positive or negative ACL
+ * entries are not allowed for any principal.  Each entry specifies
+ * the set of permissions that are to be granted (if positive) or
+ * denied (if negative).
+ *
+ * <li>If there is no entry for a particular principal, then the
+ * principal is considered to have a null (empty) permission set.
+ *
+ * <li>If there is a positive entry that grants a principal a
+ * particular permission, and a negative entry that denies the
+ * principal the same permission, the result is as though the
+ * permission was never granted or denied.
+ *
+ * <li>Individual permissions always override permissions of the
+ * group(s) to which the individual belongs. That is, individual
+ * negative permissions (specific denial of permissions) override the
+ * groups' positive permissions. And individual positive permissions
+ * override the groups' negative permissions.
+ *
+ * </ul>
+ *
+ * The {@code  java.security.acl } package provides the
+ * interfaces to the ACL and related data structures (ACL entries,
+ * groups, permissions, etc.), and the {@code  sun.security.acl }
+ * classes provide a default implementation of the interfaces. For
+ * example, {@code  java.security.acl.Acl } provides the
+ * interface to an ACL and the {@code  sun.security.acl.AclImpl }
+ * class provides the default implementation of the interface.<p>
+ *
+ * The {@code  java.security.acl.Acl } interface extends the
+ * {@code  java.security.acl.Owner } interface. The Owner
+ * interface is used to maintain a list of owners for each ACL.  Only
+ * owners are allowed to modify an ACL. For example, only an owner can
+ * call the ACL's {@code addEntry} method to add a new ACL entry
+ * to the ACL.
+ *
+ * @see java.security.acl.AclEntry
+ * @see java.security.acl.Owner
+ * @see java.security.acl.Acl#getPermissions
+ *
+ * @author Satish Dharmaraj
+ */
+
+public interface Acl extends Owner {
+
+    /**
+     * Sets the name of this ACL.
+     *
+     * @param caller the principal invoking this method. It must be an
+     * owner of this ACL.
+     *
+     * @param name the name to be given to this ACL.
+     *
+     * @exception NotOwnerException if the caller principal
+     * is not an owner of this ACL.
+     *
+     * @see #getName
+     */
+    public void setName(Principal caller, String name)
+      throws NotOwnerException;
+
+    /**
+     * Returns the name of this ACL.
+     *
+     * @return the name of this ACL.
+     *
+     * @see #setName
+     */
+    public String getName();
+
+    /**
+     * Adds an ACL entry to this ACL. An entry associates a principal
+     * (e.g., an individual or a group) with a set of
+     * permissions. Each principal can have at most one positive ACL
+     * entry (specifying permissions to be granted to the principal)
+     * and one negative ACL entry (specifying permissions to be
+     * denied). If there is already an ACL entry of the same type
+     * (negative or positive) already in the ACL, false is returned.
+     *
+     * @param caller the principal invoking this method. It must be an
+     * owner of this ACL.
+     *
+     * @param entry the ACL entry to be added to this ACL.
+     *
+     * @return true on success, false if an entry of the same type
+     * (positive or negative) for the same principal is already
+     * present in this ACL.
+     *
+     * @exception NotOwnerException if the caller principal
+     *  is not an owner of this ACL.
+     */
+    public boolean addEntry(Principal caller, AclEntry entry)
+      throws NotOwnerException;
+
+    /**
+     * Removes an ACL entry from this ACL.
+     *
+     * @param caller the principal invoking this method. It must be an
+     * owner of this ACL.
+     *
+     * @param entry the ACL entry to be removed from this ACL.
+     *
+     * @return true on success, false if the entry is not part of this ACL.
+     *
+     * @exception NotOwnerException if the caller principal is not
+     * an owner of this Acl.
+     */
+    public boolean removeEntry(Principal caller, AclEntry entry)
+          throws NotOwnerException;
+
+    /**
+     * Returns an enumeration for the set of allowed permissions for the
+     * specified principal (representing an entity such as an individual or
+     * a group). This set of allowed permissions is calculated as
+     * follows:
+     *
+     * <ul>
+     *
+     * <li>If there is no entry in this Access Control List for the
+     * specified principal, an empty permission set is returned.
+     *
+     * <li>Otherwise, the principal's group permission sets are determined.
+     * (A principal can belong to one or more groups, where a group is a
+     * group of principals, represented by the Group interface.)
+     * The group positive permission set is the union of all
+     * the positive permissions of each group that the principal belongs to.
+     * The group negative permission set is the union of all
+     * the negative permissions of each group that the principal belongs to.
+     * If there is a specific permission that occurs in both
+     * the positive permission set and the negative permission set,
+     * it is removed from both.<p>
+     *
+     * The individual positive and negative permission sets are also
+     * determined. The positive permission set contains the permissions
+     * specified in the positive ACL entry (if any) for the principal.
+     * Similarly, the negative permission set contains the permissions
+     * specified in the negative ACL entry (if any) for the principal.
+     * The individual positive (or negative) permission set is considered
+     * to be null if there is not a positive (negative) ACL entry for the
+     * principal in this ACL.<p>
+     *
+     * The set of permissions granted to the principal is then calculated
+     * using the simple rule that individual permissions always override
+     * the group permissions. That is, the principal's individual negative
+     * permission set (specific denial of permissions) overrides the group
+     * positive permission set, and the principal's individual positive
+     * permission set overrides the group negative permission set.
+     *
+     * </ul>
+     *
+     * @param user the principal whose permission set is to be returned.
+     *
+     * @return the permission set specifying the permissions the principal
+     * is allowed.
+     */
+    public Enumeration<Permission> getPermissions(Principal user);
+
+    /**
+     * Returns an enumeration of the entries in this ACL. Each element in
+     * the enumeration is of type AclEntry.
+     *
+     * @return an enumeration of the entries in this ACL.
+     */
+    public Enumeration<AclEntry> entries();
+
+    /**
+     * Checks whether or not the specified principal has the specified
+     * permission. If it does, true is returned, otherwise false is returned.
+     *
+     * More specifically, this method checks whether the passed permission
+     * is a member of the allowed permission set of the specified principal.
+     * The allowed permission set is determined by the same algorithm as is
+     * used by the {@code getPermissions} method.
+     *
+     * @param principal the principal, assumed to be a valid authenticated
+     * Principal.
+     *
+     * @param permission the permission to be checked for.
+     *
+     * @return true if the principal has the specified permission, false
+     * otherwise.
+     *
+     * @see #getPermissions
+     */
+    public boolean checkPermission(Principal principal, Permission permission);
+
+    /**
+     * Returns a string representation of the
+     * ACL contents.
+     *
+     * @return a string representation of the ACL contents.
+     */
+    public String toString();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.base/share/classes/java/security/acl/AclEntry.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,154 @@
+/*
+ * Copyright (c) 1996, 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 java.security.acl;
+
+import java.util.Enumeration;
+import java.security.Principal;
+
+/**
+ * This is the interface used for representing one entry in an Access
+ * Control List (ACL).<p>
+ *
+ * An ACL can be thought of as a data structure with multiple ACL entry
+ * objects. Each ACL entry object contains a set of permissions associated
+ * with a particular principal. (A principal represents an entity such as
+ * an individual user or a group). Additionally, each ACL entry is specified
+ * as being either positive or negative. If positive, the permissions are
+ * to be granted to the associated principal. If negative, the permissions
+ * are to be denied. Each principal can have at most one positive ACL entry
+ * and one negative entry; that is, multiple positive or negative ACL
+ * entries are not allowed for any principal.
+ *
+ * Note: ACL entries are by default positive. An entry becomes a
+ * negative entry only if the
+ * {@link #setNegativePermissions() setNegativePermissions}
+ * method is called on it.
+ *
+ * @see java.security.acl.Acl
+ *
+ * @author      Satish Dharmaraj
+ */
+public interface AclEntry extends Cloneable {
+
+    /**
+     * Specifies the principal for which permissions are granted or denied
+     * by this ACL entry. If a principal was already set for this ACL entry,
+     * false is returned, otherwise true is returned.
+     *
+     * @param user the principal to be set for this entry.
+     *
+     * @return true if the principal is set, false if there was
+     * already a principal set for this entry.
+     *
+     * @see #getPrincipal
+     */
+    public boolean setPrincipal(Principal user);
+
+    /**
+     * Returns the principal for which permissions are granted or denied by
+     * this ACL entry. Returns null if there is no principal set for this
+     * entry yet.
+     *
+     * @return the principal associated with this entry.
+     *
+     * @see #setPrincipal
+     */
+    public Principal getPrincipal();
+
+    /**
+     * Sets this ACL entry to be a negative one. That is, the associated
+     * principal (e.g., a user or a group) will be denied the permission set
+     * specified in the entry.
+     *
+     * Note: ACL entries are by default positive. An entry becomes a
+     * negative entry only if this {@code setNegativePermissions}
+     * method is called on it.
+     */
+    public void setNegativePermissions();
+
+    /**
+     * Returns true if this is a negative ACL entry (one denying the
+     * associated principal the set of permissions in the entry), false
+     * otherwise.
+     *
+     * @return true if this is a negative ACL entry, false if it's not.
+     */
+    public boolean isNegative();
+
+    /**
+     * Adds the specified permission to this ACL entry. Note: An entry can
+     * have multiple permissions.
+     *
+     * @param permission the permission to be associated with
+     * the principal in this entry.
+     *
+     * @return true if the permission was added, false if the
+     * permission was already part of this entry's permission set.
+     */
+    public boolean addPermission(Permission permission);
+
+    /**
+     * Removes the specified permission from this ACL entry.
+     *
+     * @param permission the permission to be removed from this entry.
+     *
+     * @return true if the permission is removed, false if the
+     * permission was not part of this entry's permission set.
+     */
+    public boolean removePermission(Permission permission);
+
+    /**
+     * Checks if the specified permission is part of the
+     * permission set in this entry.
+     *
+     * @param permission the permission to be checked for.
+     *
+     * @return true if the permission is part of the
+     * permission set in this entry, false otherwise.
+     */
+    public boolean checkPermission(Permission permission);
+
+    /**
+     * Returns an enumeration of the permissions in this ACL entry.
+     *
+     * @return an enumeration of the permissions in this ACL entry.
+     */
+    public Enumeration<Permission> permissions();
+
+    /**
+     * Returns a string representation of the contents of this ACL entry.
+     *
+     * @return a string representation of the contents.
+     */
+    public String toString();
+
+    /**
+     * Clones this ACL entry.
+     *
+     * @return a clone of this ACL entry.
+     */
+    public Object clone();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.base/share/classes/java/security/acl/AclNotFoundException.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 1996, 2003, 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.security.acl;
+
+/**
+ * This is an exception that is thrown whenever a reference is made to a
+ * non-existent ACL (Access Control List).
+ *
+ * @author      Satish Dharmaraj
+ */
+public class AclNotFoundException extends Exception {
+
+    private static final long serialVersionUID = 5684295034092681791L;
+
+    /**
+     * Constructs an AclNotFoundException.
+     */
+    public AclNotFoundException() {
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.base/share/classes/java/security/acl/Group.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 1996, 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 java.security.acl;
+
+import java.util.Enumeration;
+import java.security.Principal;
+
+/**
+ * This interface is used to represent a group of principals. (A principal
+ * represents an entity such as an individual user or a company). <p>
+ *
+ * Note that Group extends Principal. Thus, either a Principal or a Group can
+ * be passed as an argument to methods containing a Principal parameter. For
+ * example, you can add either a Principal or a Group to a Group object by
+ * calling the object's {@code addMember} method, passing it the
+ * Principal or Group.
+ *
+ * @author      Satish Dharmaraj
+ */
+public interface Group extends Principal {
+
+    /**
+     * Adds the specified member to the group.
+     *
+     * @param user the principal to add to this group.
+     *
+     * @return true if the member was successfully added,
+     * false if the principal was already a member.
+     */
+    public boolean addMember(Principal user);
+
+    /**
+     * Removes the specified member from the group.
+     *
+     * @param user the principal to remove from this group.
+     *
+     * @return true if the principal was removed, or
+     * false if the principal was not a member.
+     */
+    public boolean removeMember(Principal user);
+
+    /**
+     * Returns true if the passed principal is a member of the group.
+     * This method does a recursive search, so if a principal belongs to a
+     * group which is a member of this group, true is returned.
+     *
+     * @param member the principal whose membership is to be checked.
+     *
+     * @return true if the principal is a member of this group,
+     * false otherwise.
+     */
+    public boolean isMember(Principal member);
+
+
+    /**
+     * Returns an enumeration of the members in the group.
+     * The returned objects can be instances of either Principal
+     * or Group (which is a subclass of Principal).
+     *
+     * @return an enumeration of the group members.
+     */
+    public Enumeration<? extends Principal> members();
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.base/share/classes/java/security/acl/LastOwnerException.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 1996, 2003, 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.security.acl;
+
+/**
+ * This is an exception that is thrown whenever an attempt is made to delete
+ * the last owner of an Access Control List.
+ *
+ * @see java.security.acl.Owner#deleteOwner
+ *
+ * @author Satish Dharmaraj
+ */
+public class LastOwnerException extends Exception {
+
+    private static final long serialVersionUID = -5141997548211140359L;
+
+    /**
+     * Constructs a LastOwnerException.
+     */
+    public LastOwnerException() {
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.base/share/classes/java/security/acl/NotOwnerException.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 1996, 2003, 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.security.acl;
+
+/**
+ * This is an exception that is thrown whenever the modification of an object
+ * (such as an Access Control List) is only allowed to be done by an owner of
+ * the object, but the Principal attempting the modification is not an owner.
+ *
+ * @author      Satish Dharmaraj
+ */
+public class NotOwnerException extends Exception {
+
+    private static final long serialVersionUID = -5555597911163362399L;
+
+    /**
+     * Constructs a NotOwnerException.
+     */
+    public NotOwnerException() {
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.base/share/classes/java/security/acl/Owner.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 1996, 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 java.security.acl;
+
+import java.security.Principal;
+
+/**
+ * Interface for managing owners of Access Control Lists (ACLs) or ACL
+ * configurations. (Note that the Acl interface in the
+ * {@code  java.security.acl} package extends this Owner
+ * interface.) The initial owner Principal should be specified as an
+ * argument to the constructor of the class implementing this interface.
+ *
+ * @see java.security.acl.Acl
+ *
+ */
+public interface Owner {
+
+    /**
+     * Adds an owner. Only owners can modify ACL contents. The caller
+     * principal must be an owner of the ACL in order to invoke this method.
+     * That is, only an owner can add another owner. The initial owner is
+     * configured at ACL construction time.
+     *
+     * @param caller the principal invoking this method. It must be an owner
+     * of the ACL.
+     *
+     * @param owner the owner that should be added to the list of owners.
+     *
+     * @return true if successful, false if owner is already an owner.
+     * @exception NotOwnerException if the caller principal is not an owner
+     * of the ACL.
+     */
+    public boolean addOwner(Principal caller, Principal owner)
+      throws NotOwnerException;
+
+    /**
+     * Deletes an owner. If this is the last owner in the ACL, an exception is
+     * raised.<p>
+     *
+     * The caller principal must be an owner of the ACL in order to invoke
+     * this method.
+     *
+     * @param caller the principal invoking this method. It must be an owner
+     * of the ACL.
+     *
+     * @param owner the owner to be removed from the list of owners.
+     *
+     * @return true if the owner is removed, false if the owner is not part
+     * of the list of owners.
+     *
+     * @exception NotOwnerException if the caller principal is not an owner
+     * of the ACL.
+     *
+     * @exception LastOwnerException if there is only one owner left, so that
+     * deleteOwner would leave the ACL owner-less.
+     */
+    public boolean deleteOwner(Principal caller, Principal owner)
+      throws NotOwnerException, LastOwnerException;
+
+    /**
+     * Returns true if the given principal is an owner of the ACL.
+     *
+     * @param owner the principal to be checked to determine whether or not
+     * it is an owner.
+     *
+     * @return true if the passed principal is in the list of owners, false
+     * if not.
+     */
+    public boolean isOwner(Principal owner);
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.base/share/classes/java/security/acl/Permission.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 1996, 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.security.acl;
+
+
+/**
+ * This interface represents a permission, such as that used to grant
+ * a particular type of access to a resource.
+ *
+ * @author Satish Dharmaraj
+ */
+public interface Permission {
+
+    /**
+     * Returns true if the object passed matches the permission represented
+     * in this interface.
+     *
+     * @param another the Permission object to compare with.
+     *
+     * @return true if the Permission objects are equal, false otherwise
+     */
+    public boolean equals(Object another);
+
+    /**
+     * Prints a string representation of this permission.
+     *
+     * @return the string representation of the permission.
+     */
+    public String toString();
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.base/share/classes/java/security/acl/package-info.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 1998, 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.
+ */
+
+/**
+ * The classes and interfaces in this package have been
+ * superseded by classes in the java.security package.
+ * See that package and, for example, java.security.Permission for details.
+ *
+ * @since 1.1
+ */
+package java.security.acl;
--- a/jdk/src/java.base/share/classes/java/time/Clock.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/java/time/Clock.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -61,12 +61,15 @@
  */
 package java.time;
 
+import java.io.IOException;
+import java.io.ObjectInputStream;
 import static java.time.LocalTime.NANOS_PER_MINUTE;
 import static java.time.LocalTime.NANOS_PER_SECOND;
 
 import java.io.Serializable;
 import java.util.Objects;
 import java.util.TimeZone;
+import sun.misc.VM;
 
 /**
  * A clock providing access to the current instant, date and time using a time-zone.
@@ -446,10 +449,22 @@
      */
     static final class SystemClock extends Clock implements Serializable {
         private static final long serialVersionUID = 6740630888130243051L;
+        private static final long OFFSET_SEED =
+                System.currentTimeMillis()/1000 - 1024; // initial offest
         private final ZoneId zone;
+        // We don't actually need a volatile here.
+        // We don't care if offset is set or read concurrently by multiple
+        // threads - we just need a value which is 'recent enough' - in other
+        // words something that has been updated at least once in the last
+        // 2^32 secs (~136 years). And even if we by chance see an invalid
+        // offset, the worst that can happen is that we will get a -1 value
+        // from getNanoTimeAdjustment, forcing us to update the offset
+        // once again.
+        private transient long offset;
 
         SystemClock(ZoneId zone) {
             this.zone = zone;
+            this.offset = OFFSET_SEED;
         }
         @Override
         public ZoneId getZone() {
@@ -464,11 +479,50 @@
         }
         @Override
         public long millis() {
+            // System.currentTimeMillis() and VM.getNanoTimeAdjustment(offset)
+            // use the same time source - System.currentTimeMillis() simply
+            // limits the resolution to milliseconds.
+            // So we take the faster path and call System.currentTimeMillis()
+            // directly - in order to avoid the performance penalty of
+            // VM.getNanoTimeAdjustment(offset) which is less efficient.
             return System.currentTimeMillis();
         }
         @Override
         public Instant instant() {
-            return Instant.ofEpochMilli(millis());
+            // Take a local copy of offset. offset can be updated concurrently
+            // by other threads (even if we haven't made it volatile) so we will
+            // work with a local copy.
+            long localOffset = offset;
+            long adjustment = VM.getNanoTimeAdjustment(localOffset);
+
+            if (adjustment == -1) {
+                // -1 is a sentinel value returned by VM.getNanoTimeAdjustment
+                // when the offset it is given is too far off the current UTC
+                // time. In principle, this should not happen unless the
+                // JVM has run for more than ~136 years (not likely) or
+                // someone is fiddling with the system time, or the offset is
+                // by chance at 1ns in the future (very unlikely).
+                // We can easily recover from all these conditions by bringing
+                // back the offset in range and retry.
+
+                // bring back the offset in range. We use -1024 to make
+                // it more unlikely to hit the 1ns in the future condition.
+                localOffset = System.currentTimeMillis()/1000 - 1024;
+
+                // retry
+                adjustment = VM.getNanoTimeAdjustment(localOffset);
+
+                if (adjustment == -1) {
+                    // Should not happen: we just recomputed a new offset.
+                    // It should have fixed the issue.
+                    throw new InternalError("Offset " + localOffset + " is not in range");
+                } else {
+                    // OK - recovery succeeded. Update the offset for the
+                    // next call...
+                    offset = localOffset;
+                }
+            }
+            return Instant.ofEpochSecond(localOffset, adjustment);
         }
         @Override
         public boolean equals(Object obj) {
@@ -485,6 +539,12 @@
         public String toString() {
             return "SystemClock[" + zone + "]";
         }
+        private void readObject(ObjectInputStream is)
+                throws IOException, ClassNotFoundException {
+            // ensure that offset is initialized
+            is.defaultReadObject();
+            offset = OFFSET_SEED;
+        }
     }
 
     //-----------------------------------------------------------------------
--- a/jdk/src/java.base/share/classes/java/time/chrono/Chronology.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/java/time/chrono/Chronology.java	Mon Feb 23 05:01:11 2015 -0800
@@ -538,7 +538,14 @@
      * <ul>
      * <li>a leap-year must imply a year-length longer than a non leap-year.
      * <li>a chronology that does not support the concept of a year must return false.
+     * <li>the correct result must be returned for all years within the
+     *     valid range of years for the chronology.
      * </ul>
+     * <p>
+     * Outside the range of valid years an implementation is free to return
+     * either a best guess or false.
+     * An implementation must not throw an exception, even if the year is
+     * outside the range of valid years.
      *
      * @param prolepticYear  the proleptic-year to check, not validated for range
      * @return true if the year is a leap year
--- a/jdk/src/java.base/share/classes/java/time/chrono/HijrahChronology.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/java/time/chrono/HijrahChronology.java	Mon Feb 23 05:01:11 2015 -0800
@@ -475,10 +475,10 @@
     @Override
     public boolean isLeapYear(long prolepticYear) {
         checkCalendarInit();
+        if (prolepticYear < getMinimumYear() || prolepticYear > getMaximumYear()) {
+            return false;
+        }
         int epochMonth = yearToEpochMonth((int) prolepticYear);
-        if (epochMonth < 0 || epochMonth > maxEpochDay) {
-            throw new DateTimeException("Hijrah date out of range");
-        }
         int len = getYearLength((int) prolepticYear);
         return (len > 354);
     }
--- a/jdk/src/java.base/share/classes/java/time/chrono/JapaneseEra.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/java/time/chrono/JapaneseEra.java	Mon Feb 23 05:01:11 2015 -0800
@@ -195,10 +195,11 @@
      * @throws DateTimeException if the value is invalid
      */
     public static JapaneseEra of(int japaneseEra) {
-        if (japaneseEra < MEIJI.eraValue || japaneseEra + ERA_OFFSET > KNOWN_ERAS.length) {
+        int i = ordinal(japaneseEra);
+        if (i < 0 || i >= KNOWN_ERAS.length) {
             throw new DateTimeException("Invalid era: " + japaneseEra);
         }
-        return KNOWN_ERAS[ordinal(japaneseEra)];
+        return KNOWN_ERAS[i];
     }
 
     /**
--- a/jdk/src/java.base/share/classes/java/time/format/DateTimeFormatter.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/java/time/format/DateTimeFormatter.java	Mon Feb 23 05:01:11 2015 -0800
@@ -117,8 +117,9 @@
  * {@code parse(CharSequence text, DateTimeFormatter formatter)}.
  * <p>For example:
  * <blockquote><pre>
+ *  LocalDate date = LocalDate.now();
  *  String text = date.format(formatter);
- *  LocalDate date = LocalDate.parse(text, formatter);
+ *  LocalDate parsedDate = LocalDate.parse(text, formatter);
  * </pre></blockquote>
  * <p>
  * In addition to the format, formatters can be created with desired Locale,
@@ -265,9 +266,10 @@
  * <p>
  * For example:
  * <blockquote><pre>
+ *  LocalDate date = LocalDate.now();
  *  DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy MM dd");
  *  String text = date.format(formatter);
- *  LocalDate date = LocalDate.parse(text, formatter);
+ *  LocalDate parsedDate = LocalDate.parse(text, formatter);
  * </pre></blockquote>
  * <p>
  * All letters 'A' to 'Z' and 'a' to 'z' are reserved as pattern letters. The
--- a/jdk/src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java	Mon Feb 23 05:01:11 2015 -0800
@@ -849,6 +849,7 @@
      * @param fractionalDigits  the number of fractional second digits to format with,
      *  from 0 to 9, or -1 to use as many digits as necessary
      * @return this, for chaining, not null
+     * @throws IllegalArgumentException if the number of fractional digits is invalid
      */
     public DateTimeFormatterBuilder appendInstant(int fractionalDigits) {
         if (fractionalDigits < -1 || fractionalDigits > 9) {
@@ -909,6 +910,7 @@
      * @param pattern  the pattern to use, not null
      * @param noOffsetText  the text to use when the offset is zero, not null
      * @return this, for chaining, not null
+     * @throws IllegalArgumentException if the pattern is invalid
      */
     public DateTimeFormatterBuilder appendOffset(String pattern, String noOffsetText) {
         appendInternal(new OffsetIdPrinterParser(pattern, noOffsetText));
--- a/jdk/src/java.base/share/classes/java/time/package-info.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/java/time/package-info.java	Mon Feb 23 05:01:11 2015 -0800
@@ -65,7 +65,7 @@
  * The main API for dates, times, instants, and durations.
  * </p>
  * <p>
- * The classes defined here represent the principal date-time concepts,
+ * The classes defined here represent the principle date-time concepts,
  * including instants, durations, dates, times, time-zones and periods.
  * They are based on the ISO calendar system, which is the <i>de facto</i> world
  * calendar following the proleptic Gregorian rules.
@@ -247,8 +247,8 @@
  * </ul>
  * <p>
  * Multiple calendar systems is an awkward addition to the design challenges.
- * The first principal is that most users want the standard ISO calendar system.
- * As such, the main classes are ISO-only. The second principal is that most of those that want a
+ * The first principle is that most users want the standard ISO calendar system.
+ * As such, the main classes are ISO-only. The second principle is that most of those that want a
  * non-ISO calendar system want it for user interaction, thus it is a UI localization issue.
  * As such, date and time objects should be held as ISO objects in the data model and persistent
  * storage, only being converted to and from a local calendar for display.
--- a/jdk/src/java.base/share/classes/java/util/ComparableTimSort.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/java/util/ComparableTimSort.java	Mon Feb 23 05:01:11 2015 -0800
@@ -144,10 +144,14 @@
          * 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 :
-                        len < 119151  ? 24 : 40);
+                        len < 119151  ? 24 : 49);
         runBase = new int[stackLen];
         runLen = new int[stackLen];
     }
--- a/jdk/src/java.base/share/classes/java/util/Formattable.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/java/util/Formattable.java	Mon Feb 23 05:01: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/jdk/src/java.base/share/classes/java/util/Formatter.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/java/util/Formatter.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -57,6 +57,7 @@
 import java.time.temporal.ChronoField;
 import java.time.temporal.TemporalAccessor;
 import java.time.temporal.TemporalQueries;
+import java.time.temporal.UnsupportedTemporalTypeException;
 
 import sun.misc.DoubleConsts;
 import sun.misc.FormattedFloatingDecimal;
@@ -4056,7 +4057,12 @@
                     break;
                 }
                 case DateTime.NANOSECOND:  { // 'N' (000000000 - 999999999)
-                    int i = t.get(ChronoField.MILLI_OF_SECOND) * 1000000;
+                    int i;
+                    try {
+                        i = t.get(ChronoField.NANO_OF_SECOND);
+                    } catch (UnsupportedTemporalTypeException u) {
+                        i = t.get(ChronoField.MILLI_OF_SECOND) * 1000000;
+                    }
                     Flags flags = Flags.ZERO_PAD;
                     sb.append(localizedMagnitude(null, i, flags, 9, l));
                     break;
--- a/jdk/src/java.base/share/classes/java/util/Optional.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/java/util/Optional.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -28,6 +28,7 @@
 import java.util.function.Function;
 import java.util.function.Predicate;
 import java.util.function.Supplier;
+import java.util.stream.Stream;
 
 /**
  * A container object which may or may not contain a non-null value.
@@ -37,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
@@ -147,16 +148,36 @@
     }
 
     /**
-     * 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) {
-        if (value != null)
-            consumer.accept(value);
+    public void ifPresent(Consumer<? super T> action) {
+        if (value != null) {
+            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();
+        }
     }
 
     /**
@@ -172,10 +193,11 @@
      */
     public Optional<T> filter(Predicate<? super T> predicate) {
         Objects.requireNonNull(predicate);
-        if (!isPresent())
+        if (!isPresent()) {
             return this;
-        else
+        } else {
             return predicate.test(value) ? this : empty();
+        }
     }
 
     /**
@@ -209,9 +231,9 @@
      */
     public<U> Optional<U> map(Function<? super T, ? extends U> mapper) {
         Objects.requireNonNull(mapper);
-        if (!isPresent())
+        if (!isPresent()) {
             return empty();
-        else {
+        } else {
             return Optional.ofNullable(mapper.apply(value));
         }
     }
@@ -235,14 +257,37 @@
      */
     public<U> Optional<U> flatMap(Function<? super T, Optional<U>> mapper) {
         Objects.requireNonNull(mapper);
-        if (!isPresent())
+        if (!isPresent()) {
             return empty();
-        else {
+        } else {
             return Objects.requireNonNull(mapper.apply(value));
         }
     }
 
     /**
+     * If a value is present return a sequential {@link Stream} containing only
+     * that value, otherwise return an empty {@code Stream}.
+     *
+     * @apiNote This method can be used to transform a {@code Stream} of
+     * optional elements to a {@code Stream} of present value elements:
+     *
+     * <pre>{@code
+     *     Stream<Optional<T>> os = ..
+     *     Stream<T> s = os.flatMap(Optional::stream)
+     * }</pre>
+     *
+     * @return the optional value as a {@code Stream}
+     * @since 1.9
+     */
+    public Stream<T> stream() {
+        if (!isPresent()) {
+            return Stream.empty();
+        } else {
+            return Stream.of(value);
+        }
+    }
+
+    /**
      * Return the value if present, otherwise return {@code other}.
      *
      * @param other the value to be returned if there is no value present, may
--- a/jdk/src/java.base/share/classes/java/util/OptionalDouble.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/java/util/OptionalDouble.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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,6 +27,7 @@
 import java.util.function.DoubleConsumer;
 import java.util.function.DoubleSupplier;
 import java.util.function.Supplier;
+import java.util.stream.DoubleStream;
 
 /**
  * A container object which may or may not contain a {@code double} value.
@@ -36,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
@@ -130,16 +131,59 @@
     }
 
     /**
-     * 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) {
-        if (isPresent)
-            consumer.accept(value);
+    public void ifPresent(DoubleConsumer action) {
+        if (isPresent) {
+            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();
+        }
+    }
+
+    /**
+     * If a value is present return a sequential {@link DoubleStream} containing
+     * only that value, otherwise return an empty {@code DoubleStream}.
+     *
+     * @apiNote This method can be used to transform a {@code Stream} of
+     * optional doubles to a {@code DoubleStream} of present doubles:
+     *
+     * <pre>{@code
+     *     Stream<OptionalDouble> os = ..
+     *     DoubleStream s = os.flatMapToDouble(OptionalDouble::stream)
+     * }</pre>
+     *
+     * @return the optional value as a {@code DoubleStream}
+     * @since 1.9
+     */
+    public DoubleStream stream() {
+        if (isPresent) {
+            return DoubleStream.of(value);
+        } else {
+            return DoubleStream.empty();
+        }
     }
 
     /**
@@ -182,7 +226,7 @@
      * @throws NullPointerException if no value is present and
      * {@code exceptionSupplier} is null
      */
-    public<X extends Throwable> double orElseThrow(Supplier<X> exceptionSupplier) throws X {
+    public<X extends Throwable> double orElseThrow(Supplier<? extends X> exceptionSupplier) throws X {
         if (isPresent) {
             return value;
         } else {
--- a/jdk/src/java.base/share/classes/java/util/OptionalInt.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/java/util/OptionalInt.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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,6 +27,7 @@
 import java.util.function.IntConsumer;
 import java.util.function.IntSupplier;
 import java.util.function.Supplier;
+import java.util.stream.IntStream;
 
 /**
  * A container object which may or may not contain a {@code int} value.
@@ -36,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
@@ -130,16 +131,59 @@
     }
 
     /**
-     * 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) {
-        if (isPresent)
-            consumer.accept(value);
+    public void ifPresent(IntConsumer action) {
+        if (isPresent) {
+            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();
+        }
+    }
+
+    /**
+     * If a value is present return a sequential {@link IntStream} containing
+     * only that value, otherwise return an empty {@code IntStream}.
+     *
+     * @apiNote This method can be used to transform a {@code Stream} of
+     * optional integers to an {@code IntStream} of present integers:
+     *
+     * <pre>{@code
+     *     Stream<OptionalInt> os = ..
+     *     IntStream s = os.flatMapToInt(OptionalInt::stream)
+     * }</pre>
+     *
+     * @return the optional value as an {@code IntStream}
+     * @since 1.9
+     */
+    public IntStream stream() {
+        if (isPresent) {
+            return IntStream.of(value);
+        } else {
+            return IntStream.empty();
+        }
     }
 
     /**
@@ -182,7 +226,7 @@
      * @throws NullPointerException if no value is present and
      * {@code exceptionSupplier} is null
      */
-    public<X extends Throwable> int orElseThrow(Supplier<X> exceptionSupplier) throws X {
+    public<X extends Throwable> int orElseThrow(Supplier<? extends X> exceptionSupplier) throws X {
         if (isPresent) {
             return value;
         } else {
--- a/jdk/src/java.base/share/classes/java/util/OptionalLong.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/java/util/OptionalLong.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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,6 +27,7 @@
 import java.util.function.LongConsumer;
 import java.util.function.LongSupplier;
 import java.util.function.Supplier;
+import java.util.stream.LongStream;
 
 /**
  * A container object which may or may not contain a {@code long} value.
@@ -36,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
@@ -130,16 +131,59 @@
     }
 
     /**
-     * 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) {
-        if (isPresent)
-            consumer.accept(value);
+    public void ifPresent(LongConsumer action) {
+        if (isPresent) {
+            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();
+        }
+    }
+
+    /**
+     * If a value is present return a sequential {@link LongStream} containing
+     * only that value, otherwise return an empty {@code LongStream}.
+     *
+     * @apiNote This method can be used to transform a {@code Stream} of
+     * optional longs to a {@code LongStream} of present longs:
+     *
+     * <pre>{@code
+     *     Stream<OptionalLong> os = ..
+     *     LongStream s = os.flatMapToLong(OptionalLong::stream)
+     * }</pre>
+     *
+     * @return the optional value as a {@code LongStream}
+     * @since 1.9
+     */
+    public LongStream stream() {
+        if (isPresent) {
+            return LongStream.of(value);
+        } else {
+            return LongStream.empty();
+        }
     }
 
     /**
@@ -182,7 +226,7 @@
      * @throws NullPointerException if no value is present and
      * {@code exceptionSupplier} is null
      */
-    public<X extends Throwable> long orElseThrow(Supplier<X> exceptionSupplier) throws X {
+    public<X extends Throwable> long orElseThrow(Supplier<? extends X> exceptionSupplier) throws X {
         if (isPresent) {
             return value;
         } else {
--- a/jdk/src/java.base/share/classes/java/util/TimSort.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/java/util/TimSort.java	Mon Feb 23 05:01:11 2015 -0800
@@ -174,10 +174,14 @@
          * 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 :
-                        len < 119151  ? 24 : 40);
+                        len < 119151  ? 24 : 49);
         runBase = new int[stackLen];
         runLen = new int[stackLen];
     }
--- a/jdk/src/java.base/share/classes/java/util/concurrent/TimeUnit.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/TimeUnit.java	Mon Feb 23 05:01:11 2015 -0800
@@ -131,6 +131,7 @@
 
     /**
      * Time unit representing sixty seconds
+     * @since 1.6
      */
     MINUTES {
         public long toNanos(long d)   { return x(d, C4/C0, MAX/(C4/C0)); }
@@ -146,6 +147,7 @@
 
     /**
      * Time unit representing sixty minutes
+     * @since 1.6
      */
     HOURS {
         public long toNanos(long d)   { return x(d, C5/C0, MAX/(C5/C0)); }
@@ -161,6 +163,7 @@
 
     /**
      * Time unit representing twenty four hours
+     * @since 1.6
      */
     DAYS {
         public long toNanos(long d)   { return x(d, C6/C0, MAX/(C6/C0)); }
--- a/jdk/src/java.base/share/classes/java/util/regex/Pattern.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/java/util/regex/Pattern.java	Mon Feb 23 05:01: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/jdk/src/java.base/share/classes/java/util/stream/BaseStream.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/java/util/stream/BaseStream.java	Mon Feb 23 05:01:11 2015 -0800
@@ -79,6 +79,14 @@
      * <p>This is a <a href="package-summary.html#StreamOps">terminal
      * operation</a>.
      *
+     * <p>
+     * The returned spliterator should report the set of characteristics derived
+     * from the stream pipeline (namely the characteristics derived from the
+     * stream source spliterator and the intermediate operations).
+     * Implementations may report a sub-set of those characteristics.  For
+     * example, it may be too expensive to compute the entire set for some or
+     * all possible stream pipelines.
+     *
      * @return the element spliterator for this stream
      */
     Spliterator<T> spliterator();
--- a/jdk/src/java.base/share/classes/java/util/stream/Stream.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/java/util/stream/Stream.java	Mon Feb 23 05:01:11 2015 -0800
@@ -988,6 +988,21 @@
     }
 
     /**
+     * Returns a sequential {@code Stream} containing a single element, if
+     * non-null, otherwise returns an empty {@code Stream}.
+     *
+     * @param t the single element
+     * @param <T> the type of stream elements
+     * @return a stream with a single element if the specified element
+     *         is non-null, otherwise an empty stream
+     * @since 1.9
+     */
+    public static<T> Stream<T> ofNullable(T t) {
+        return t == null ? Stream.empty()
+                         : StreamSupport.stream(new Streams.StreamBuilderImpl<>(t), false);
+    }
+
+    /**
      * Returns a sequential ordered stream whose elements are the specified values.
      *
      * @param <T> the type of stream elements
--- a/jdk/src/java.base/share/classes/sun/misc/Unsafe.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/sun/misc/Unsafe.java	Mon Feb 23 05:01: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/jdk/src/java.base/share/classes/sun/misc/VM.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/sun/misc/VM.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, 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
@@ -402,6 +402,36 @@
      */
     public static native long getegid();
 
+    /**
+     * Get a nanosecond time stamp adjustment in the form of a single long.
+     *
+     * This value can be used to create an instant using
+     * {@link java.time.Instant#ofEpochSecond(long, long)
+     *  java.time.Instant.ofEpochSecond(offsetInSeconds,
+     *  getNanoTimeAdjustment(offsetInSeconds))}.
+     * <p>
+     * The value returned has the best resolution available to the JVM on
+     * the current system.
+     * This is usually down to microseconds - or tenth of microseconds -
+     * depending on the OS/Hardware and the JVM implementation.
+     *
+     * @param offsetInSeconds The offset in seconds from which the nanosecond
+     *        time stamp should be computed.
+     *
+     * @apiNote The offset should be recent enough - so that
+     *         {@code offsetInSeconds} is within {@code +/- 2^32} seconds of the
+     *         current UTC time. If the offset is too far off, {@code -1} will be
+     *         returned. As such, {@code -1} must not be considered as a valid
+     *         nano time adjustment, but as an exception value indicating
+     *         that an offset closer to the current time should be used.
+     *
+     * @return A nanosecond time stamp adjustment in the form of a single long.
+     *     If the offset is too far off the current time, this method returns -1.
+     *     In that case, the caller should call this method again, passing a
+     *     more accurate offset.
+     */
+    public static native long getNanoTimeAdjustment(long offsetInSeconds);
+
     static {
         initialize();
     }
--- a/jdk/src/java.base/share/classes/sun/nio/cs/AbstractCharsetProvider.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/sun/nio/cs/AbstractCharsetProvider.java	Mon Feb 23 05:01: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/jdk/src/java.base/share/classes/sun/nio/cs/DelegatableDecoder.java	Mon Feb 23 05:01: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/jdk/src/java.base/share/classes/sun/nio/cs/DoubleByte.java	Mon Feb 23 05:01: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/jdk/src/java.base/share/classes/sun/nio/cs/HKSCS.java	Mon Feb 23 05:01: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/jdk/src/java.base/share/classes/sun/nio/cs/SingleByte.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/sun/nio/cs/SingleByte.java	Mon Feb 23 05:01:11 2015 -0800
@@ -160,22 +160,18 @@
             byte[] da = dst.array();
             int dp = dst.arrayOffset() + dst.position();
             int dl = dst.arrayOffset() + dst.limit();
+            int len  = Math.min(dl - dp, sl - sp);
 
-            CoderResult cr = CoderResult.UNDERFLOW;
-            if ((dl - dp) < (sl - sp)) {
-                sl = sp + (dl - dp);
-                cr = CoderResult.OVERFLOW;
-            }
-
-            while (sp < sl) {
+            while (len-- > 0) {
                 char c = sa[sp];
                 int b = encode(c);
                 if (b == UNMAPPABLE_ENCODING) {
                     if (Character.isSurrogate(c)) {
                         if (sgp == null)
                             sgp = new Surrogate.Parser();
-                        if (sgp.parse(c, sa, sp, sl) < 0)
+                        if (sgp.parse(c, sa, sp, sl) < 0) {
                             return withResult(sgp.error(), src, sp, dst, dp);
+                        }
                         return withResult(sgp.unmappableResult(), src, sp, dst, dp);
                     }
                     return withResult(CoderResult.unmappableForLength(1),
@@ -184,7 +180,8 @@
                 da[dp++] = (byte)b;
                 sp++;
             }
-            return withResult(cr, src, sp, dst, dp);
+            return withResult(sp < sl ? CoderResult.OVERFLOW : CoderResult.UNDERFLOW,
+                              src, sp, dst, dp);
         }
 
         private CoderResult encodeBufferLoop(CharBuffer src, ByteBuffer dst) {
--- a/jdk/src/java.base/share/classes/sun/nio/cs/StandardCharsets.java.template	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/sun/nio/cs/StandardCharsets.java.template	Mon Feb 23 05:01: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/jdk/src/java.base/share/classes/sun/nio/cs/StreamEncoder.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/sun/nio/cs/StreamEncoder.java	Mon Feb 23 05:01:11 2015 -0800
@@ -243,8 +243,11 @@
             if (cr.isUnderflow()) {
                 if (lcb.hasRemaining()) {
                     leftoverChar = lcb.get();
-                    if (cb != null && cb.hasRemaining())
-                        flushLeftoverChar(cb, endOfInput);
+                    if (cb != null && cb.hasRemaining()) {
+                        lcb.clear();
+                        lcb.put(leftoverChar).put(cb.get()).flip();
+                        continue;
+                    }
                     return;
                 }
                 break;
@@ -265,24 +268,24 @@
         CharBuffer cb = CharBuffer.wrap(cbuf, off, len);
 
         if (haveLeftoverChar)
-        flushLeftoverChar(cb, false);
+            flushLeftoverChar(cb, false);
 
         while (cb.hasRemaining()) {
-        CoderResult cr = encoder.encode(cb, bb, false);
-        if (cr.isUnderflow()) {
-           assert (cb.remaining() <= 1) : cb.remaining();
-           if (cb.remaining() == 1) {
-                haveLeftoverChar = true;
-                leftoverChar = cb.get();
+            CoderResult cr = encoder.encode(cb, bb, false);
+            if (cr.isUnderflow()) {
+                assert (cb.remaining() <= 1) : cb.remaining();
+                if (cb.remaining() == 1) {
+                    haveLeftoverChar = true;
+                    leftoverChar = cb.get();
+                }
+                break;
             }
-            break;
-        }
-        if (cr.isOverflow()) {
-            assert bb.position() > 0;
-            writeBytes();
-            continue;
-        }
-        cr.throwException();
+            if (cr.isOverflow()) {
+                assert bb.position() > 0;
+                writeBytes();
+                continue;
+            }
+            cr.throwException();
         }
     }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.base/share/classes/sun/security/acl/AclEntryImpl.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,181 @@
+/*
+ * Copyright (c) 1996, 2011, 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.security.acl;
+
+import java.util.*;
+import java.security.Principal;
+import java.security.acl.*;
+
+/**
+ * This is a class that describes one entry that associates users
+ * or groups with permissions in the ACL.
+ * The entry may be used as a way of granting or denying permissions.
+ * @author      Satish Dharmaraj
+ */
+public class AclEntryImpl implements AclEntry {
+    private Principal user = null;
+    private Vector<Permission> permissionSet = new Vector<>(10, 10);
+    private boolean negative = false;
+
+    /**
+     * Construct an ACL entry that associates a user with permissions
+     * in the ACL.
+     * @param user The user that is associated with this entry.
+     */
+    public AclEntryImpl(Principal user) {
+        this.user = user;
+    }
+
+    /**
+     * Construct a null ACL entry
+     */
+    public AclEntryImpl() {
+    }
+
+    /**
+     * Sets the principal in the entity. If a group or a
+     * principal had already been set, a false value is
+     * returned, otherwise a true value is returned.
+     * @param user The user that is associated with this entry.
+     * @return true if the principal is set, false if there is
+     * one already.
+     */
+    public boolean setPrincipal(Principal user) {
+        if (this.user != null)
+          return false;
+        this.user = user;
+        return true;
+    }
+
+    /**
+     * This method sets the ACL to have negative permissions.
+     * That is the user or group is denied the permission set
+     * specified in the entry.
+     */
+    public void setNegativePermissions() {
+        negative = true;
+    }
+
+    /**
+     * Returns true if this is a negative ACL.
+     */
+    public boolean isNegative() {
+        return negative;
+    }
+
+    /**
+     * A principal or a group can be associated with multiple
+     * permissions. This method adds a permission to the ACL entry.
+     * @param permission The permission to be associated with
+     * the principal or the group in the entry.
+     * @return true if the permission was added, false if the
+     * permission was already part of the permission set.
+     */
+    public boolean addPermission(Permission permission) {
+
+        if (permissionSet.contains(permission))
+          return false;
+
+        permissionSet.addElement(permission);
+
+        return true;
+    }
+
+    /**
+     * The method disassociates the permission from the Principal
+     * or the Group in this ACL entry.
+     * @param permission The permission to be disassociated with
+     * the principal or the group in the entry.
+     * @return true if the permission is removed, false if the
+     * permission is not part of the permission set.
+     */
+    public boolean removePermission(Permission permission) {
+        return permissionSet.removeElement(permission);
+    }
+
+    /**
+     * Checks if the passed permission is part of the allowed
+     * permission set in this entry.
+     * @param permission The permission that has to be part of
+     * the permission set in the entry.
+     * @return true if the permission passed is part of the
+     * permission set in the entry, false otherwise.
+     */
+    public boolean checkPermission(Permission permission) {
+        return permissionSet.contains(permission);
+    }
+
+    /**
+     * return an enumeration of the permissions in this ACL entry.
+     */
+    public Enumeration<Permission> permissions() {
+        return permissionSet.elements();
+    }
+
+    /**
+     * Return a string representation of  the contents of the ACL entry.
+     */
+    public String toString() {
+        StringBuffer s = new StringBuffer();
+        if (negative)
+          s.append("-");
+        else
+          s.append("+");
+        if (user instanceof Group)
+            s.append("Group.");
+        else
+            s.append("User.");
+        s.append(user + "=");
+        Enumeration<Permission> e = permissions();
+        while(e.hasMoreElements()) {
+            Permission p = e.nextElement();
+            s.append(p);
+            if (e.hasMoreElements())
+                s.append(",");
+        }
+        return new String(s);
+    }
+
+    /**
+     * Clones an AclEntry.
+     */
+    @SuppressWarnings("unchecked") // Safe casts assuming clone() works correctly
+    public synchronized Object clone() {
+        AclEntryImpl cloned;
+        cloned = new AclEntryImpl(user);
+        cloned.permissionSet = (Vector<Permission>) permissionSet.clone();
+        cloned.negative = negative;
+        return cloned;
+    }
+
+    /**
+     * Return the Principal associated in this ACL entry.
+     * The method returns null if the entry uses a group
+     * instead of a principal.
+     */
+    public Principal getPrincipal() {
+        return user;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.base/share/classes/sun/security/acl/AclImpl.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,408 @@
+/*
+ * Copyright (c) 1996, 2011, 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.security.acl;
+
+import java.io.*;
+import java.util.*;
+import java.security.Principal;
+import java.security.acl.*;
+
+/**
+ * An Access Control List (ACL) is encapsulated by this class.
+ * @author      Satish Dharmaraj
+ */
+public class AclImpl extends OwnerImpl implements Acl {
+    //
+    // Maintain four tables. one each for positive and negative
+    // ACLs. One each depending on whether the entity is a group
+    // or principal.
+    //
+    private Hashtable<Principal, AclEntry> allowedUsersTable =
+                                        new Hashtable<>(23);
+    private Hashtable<Principal, AclEntry> allowedGroupsTable =
+                                        new Hashtable<>(23);
+    private Hashtable<Principal, AclEntry> deniedUsersTable =
+                                        new Hashtable<>(23);
+    private Hashtable<Principal, AclEntry> deniedGroupsTable =
+                                        new Hashtable<>(23);
+    private String aclName = null;
+    private Vector<Permission> zeroSet = new Vector<>(1,1);
+
+
+    /**
+     * Constructor for creating an empty ACL.
+     */
+    public AclImpl(Principal owner, String name) {
+        super(owner);
+        try {
+            setName(owner, name);
+        } catch (Exception e) {}
+    }
+
+    /**
+     * Sets the name of the ACL.
+     * @param caller the principal who is invoking this method.
+     * @param name the name of the ACL.
+     * @exception NotOwnerException if the caller principal is
+     * not on the owners list of the Acl.
+     */
+    public void setName(Principal caller, String name)
+      throws NotOwnerException
+    {
+        if (!isOwner(caller))
+            throw new NotOwnerException();
+
+        aclName = name;
+    }
+
+    /**
+     * Returns the name of the ACL.
+     * @return the name of the ACL.
+     */
+    public String getName() {
+        return aclName;
+    }
+
+    /**
+     * Adds an ACL entry to this ACL. An entry associates a
+     * group or a principal with a set of permissions. Each
+     * user or group can have one positive ACL entry and one
+     * negative ACL entry. If there is one of the type (negative
+     * or positive) already in the table, a false value is returned.
+     * The caller principal must be a part of the owners list of
+     * the ACL in order to invoke this method.
+     * @param caller the principal who is invoking this method.
+     * @param entry the ACL entry that must be added to the ACL.
+     * @return true on success, false if the entry is already present.
+     * @exception NotOwnerException if the caller principal
+     * is not on the owners list of the Acl.
+     */
+    public synchronized boolean addEntry(Principal caller, AclEntry entry)
+      throws NotOwnerException
+    {
+        if (!isOwner(caller))
+            throw new NotOwnerException();
+
+        Hashtable<Principal, AclEntry> aclTable = findTable(entry);
+        Principal key = entry.getPrincipal();
+
+        if (aclTable.get(key) != null)
+            return false;
+
+        aclTable.put(key, entry);
+        return true;
+    }
+
+    /**
+     * Removes an ACL entry from this ACL.
+     * The caller principal must be a part of the owners list of the ACL
+     * in order to invoke this method.
+     * @param caller the principal who is invoking this method.
+     * @param entry the ACL entry that must be removed from the ACL.
+     * @return true on success, false if the entry is not part of the ACL.
+     * @exception NotOwnerException if the caller principal is not
+     * the owners list of the Acl.
+     */
+    public synchronized boolean removeEntry(Principal caller, AclEntry entry)
+      throws NotOwnerException
+    {
+        if (!isOwner(caller))
+            throw new NotOwnerException();
+
+        Hashtable<Principal, AclEntry> aclTable = findTable(entry);
+        Principal key = entry.getPrincipal();
+
+        AclEntry o = aclTable.remove(key);
+        return (o != null);
+    }
+
+    /**
+     * This method returns the set of allowed permissions for the
+     * specified principal. This set of allowed permissions is calculated
+     * as follows:
+     *
+     * If there is no entry for a group or a principal an empty permission
+     * set is assumed.
+     *
+     * The group positive permission set is the union of all
+     * the positive permissions of each group that the individual belongs to.
+     * The group negative permission set is the union of all
+     * the negative permissions of each group that the individual belongs to.
+     * If there is a specific permission that occurs in both
+     * the postive permission set and the negative permission set,
+     * it is removed from both. The group positive and negatoive permission
+     * sets are calculated.
+     *
+     * The individial positive permission set and the individual negative
+     * permission set is then calculated. Again abscence of an entry means
+     * the empty set.
+     *
+     * The set of permissions granted to the principal is then calculated using
+     * the simple rule: Individual permissions always override the Group permissions.
+     * Specifically, individual negative permission set (specific
+     * denial of permissions) overrides the group positive permission set.
+     * And the individual positive permission set override the group negative
+     * permission set.
+     *
+     * @param user the principal for which the ACL entry is returned.
+     * @return The resulting permission set that the principal is allowed.
+     */
+    public synchronized Enumeration<Permission> getPermissions(Principal user) {
+
+        Enumeration<Permission> individualPositive;
+        Enumeration<Permission> individualNegative;
+        Enumeration<Permission> groupPositive;
+        Enumeration<Permission> groupNegative;
+
+        //
+        // canonicalize the sets. That is remove common permissions from
+        // positive and negative sets.
+        //
+        groupPositive =
+            subtract(getGroupPositive(user), getGroupNegative(user));
+        groupNegative  =
+            subtract(getGroupNegative(user), getGroupPositive(user));
+        individualPositive =
+            subtract(getIndividualPositive(user), getIndividualNegative(user));
+        individualNegative =
+            subtract(getIndividualNegative(user), getIndividualPositive(user));
+
+        //
+        // net positive permissions is individual positive permissions
+        // plus (group positive - individual negative).
+        //
+        Enumeration<Permission> temp1 =
+            subtract(groupPositive, individualNegative);
+        Enumeration<Permission> netPositive =
+            union(individualPositive, temp1);
+
+        // recalculate the enumeration since we lost it in performing the
+        // subtraction
+        //
+        individualPositive =
+            subtract(getIndividualPositive(user), getIndividualNegative(user));
+        individualNegative =
+            subtract(getIndividualNegative(user), getIndividualPositive(user));
+
+        //
+        // net negative permissions is individual negative permissions
+        // plus (group negative - individual positive).
+        //
+        temp1 = subtract(groupNegative, individualPositive);
+        Enumeration<Permission> netNegative = union(individualNegative, temp1);
+
+        return subtract(netPositive, netNegative);
+    }
+
+    /**
+     * This method checks whether or not the specified principal
+     * has the required permission. If permission is denied
+     * permission false is returned, a true value is returned otherwise.
+     * This method does not authenticate the principal. It presumes that
+     * the principal is a valid authenticated principal.
+     * @param principal the name of the authenticated principal
+     * @param permission the permission that the principal must have.
+     * @return true of the principal has the permission desired, false
+     * otherwise.
+     */
+    public boolean checkPermission(Principal principal, Permission permission)
+    {
+        Enumeration<Permission> permSet = getPermissions(principal);
+        while (permSet.hasMoreElements()) {
+            Permission p = permSet.nextElement();
+            if (p.equals(permission))
+              return true;
+        }
+        return false;
+    }
+
+    /**
+     * returns an enumeration of the entries in this ACL.
+     */
+    public synchronized Enumeration<AclEntry> entries() {
+        return new AclEnumerator(this,
+                                 allowedUsersTable, allowedGroupsTable,
+                                 deniedUsersTable, deniedGroupsTable);
+    }
+
+    /**
+     * return a stringified version of the
+     * ACL.
+     */
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        Enumeration<AclEntry> entries = entries();
+        while (entries.hasMoreElements()) {
+            AclEntry entry = entries.nextElement();
+            sb.append(entry.toString().trim());
+            sb.append("\n");
+        }
+
+        return sb.toString();
+    }
+
+    //
+    // Find the table that this entry belongs to. There are 4
+    // tables that are maintained. One each for postive and
+    // negative ACLs and one each for groups and users.
+    // This method figures out which
+    // table is the one that this AclEntry belongs to.
+    //
+    private Hashtable<Principal, AclEntry> findTable(AclEntry entry) {
+        Hashtable<Principal, AclEntry> aclTable = null;
+
+        Principal p = entry.getPrincipal();
+        if (p instanceof Group) {
+            if (entry.isNegative())
+                aclTable = deniedGroupsTable;
+            else
+                aclTable = allowedGroupsTable;
+        } else {
+            if (entry.isNegative())
+                aclTable = deniedUsersTable;
+            else
+                aclTable = allowedUsersTable;
+        }
+        return aclTable;
+    }
+
+    //
+    // returns the set e1 U e2.
+    //
+    private static Enumeration<Permission> union(Enumeration<Permission> e1,
+                Enumeration<Permission> e2) {
+        Vector<Permission> v = new Vector<>(20, 20);
+
+        while (e1.hasMoreElements())
+            v.addElement(e1.nextElement());
+
+        while (e2.hasMoreElements()) {
+            Permission o = e2.nextElement();
+            if (!v.contains(o))
+                v.addElement(o);
+        }
+
+        return v.elements();
+    }
+
+    //
+    // returns the set e1 - e2.
+    //
+    private Enumeration<Permission> subtract(Enumeration<Permission> e1,
+                Enumeration<Permission> e2) {
+        Vector<Permission> v = new Vector<>(20, 20);
+
+        while (e1.hasMoreElements())
+            v.addElement(e1.nextElement());
+
+        while (e2.hasMoreElements()) {
+            Permission o = e2.nextElement();
+            if (v.contains(o))
+                v.removeElement(o);
+        }
+
+        return v.elements();
+    }
+
+    private Enumeration<Permission> getGroupPositive(Principal user) {
+        Enumeration<Permission> groupPositive = zeroSet.elements();
+        Enumeration<Principal> e = allowedGroupsTable.keys();
+        while (e.hasMoreElements()) {
+            Group g = (Group)e.nextElement();
+            if (g.isMember(user)) {
+                AclEntry ae = allowedGroupsTable.get(g);
+                groupPositive = union(ae.permissions(), groupPositive);
+            }
+        }
+        return groupPositive;
+    }
+
+    private Enumeration<Permission> getGroupNegative(Principal user) {
+        Enumeration<Permission> groupNegative = zeroSet.elements();
+        Enumeration<Principal> e = deniedGroupsTable.keys();
+        while (e.hasMoreElements()) {
+            Group g = (Group)e.nextElement();
+            if (g.isMember(user)) {
+                AclEntry ae = deniedGroupsTable.get(g);
+                groupNegative = union(ae.permissions(), groupNegative);
+            }
+        }
+        return groupNegative;
+    }
+
+    private Enumeration<Permission> getIndividualPositive(Principal user) {
+        Enumeration<Permission> individualPositive = zeroSet.elements();
+        AclEntry ae = allowedUsersTable.get(user);
+        if (ae != null)
+            individualPositive = ae.permissions();
+        return individualPositive;
+    }
+
+    private Enumeration<Permission> getIndividualNegative(Principal user) {
+        Enumeration<Permission> individualNegative = zeroSet.elements();
+        AclEntry ae  = deniedUsersTable.get(user);
+        if (ae != null)
+            individualNegative = ae.permissions();
+        return individualNegative;
+    }
+}
+
+final class AclEnumerator implements Enumeration<AclEntry> {
+    Acl acl;
+    Enumeration<AclEntry> u1, u2, g1, g2;
+
+    AclEnumerator(Acl acl, Hashtable<?,AclEntry> u1, Hashtable<?,AclEntry> g1,
+                  Hashtable<?,AclEntry> u2, Hashtable<?,AclEntry> g2) {
+        this.acl = acl;
+        this.u1 = u1.elements();
+        this.u2 = u2.elements();
+        this.g1 = g1.elements();
+        this.g2 = g2.elements();
+    }
+
+    public boolean hasMoreElements() {
+        return (u1.hasMoreElements() ||
+                u2.hasMoreElements() ||
+                g1.hasMoreElements() ||
+                g2.hasMoreElements());
+    }
+
+    public AclEntry nextElement()
+    {
+        AclEntry o;
+        synchronized (acl) {
+            if (u1.hasMoreElements())
+                return u1.nextElement();
+            if (u2.hasMoreElements())
+                return u2.nextElement();
+            if (g1.hasMoreElements())
+                return g1.nextElement();
+            if (g2.hasMoreElements())
+                return g2.nextElement();
+        }
+        throw new NoSuchElementException("Acl Enumerator");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.base/share/classes/sun/security/acl/AllPermissionsImpl.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 1996, 1997, 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.security.acl;
+
+import java.security.Principal;
+import java.security.acl.*;
+
+/**
+ * This class implements the principal interface for the set of all permissions.
+ * @author Satish Dharmaraj
+ */
+public class AllPermissionsImpl extends PermissionImpl {
+
+    public AllPermissionsImpl(String s) {
+        super(s);
+    }
+
+    /**
+     * This function returns true if the permission passed matches the permission represented in
+     * this interface.
+     * @param another The Permission object to compare with.
+     * @returns true always
+     */
+    public boolean equals(Permission another) {
+        return true;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.base/share/classes/sun/security/acl/GroupImpl.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,186 @@
+/*
+ * Copyright (c) 1996, 2011, 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.security.acl;
+
+import java.util.*;
+import java.security.*;
+import java.security.acl.*;
+
+/**
+ * This class implements a group of principals.
+ * @author      Satish Dharmaraj
+ */
+public class GroupImpl implements Group {
+    private Vector<Principal> groupMembers = new Vector<>(50, 100);
+    private String group;
+
+    /**
+     * Constructs a Group object with no members.
+     * @param groupName the name of the group
+     */
+    public GroupImpl(String groupName) {
+        this.group = groupName;
+    }
+
+    /**
+     * adds the specified member to the group.
+     * @param user The principal to add to the group.
+     * @return true if the member was added - false if the
+     * member could not be added.
+     */
+    public boolean addMember(Principal user) {
+        if (groupMembers.contains(user))
+          return false;
+
+        // do not allow groups to be added to itself.
+        if (group.equals(user.toString()))
+            throw new IllegalArgumentException();
+
+        groupMembers.addElement(user);
+        return true;
+    }
+
+    /**
+     * removes the specified member from the group.
+     * @param user The principal to remove from the group.
+     * @param true if the principal was removed false if
+     * the principal was not a member
+     */
+    public boolean removeMember(Principal user) {
+        return groupMembers.removeElement(user);
+    }
+
+    /**
+     * returns the enumeration of the members in the group.
+     */
+    public Enumeration<? extends Principal> members() {
+        return groupMembers.elements();
+    }
+
+    /**
+     * This function returns true if the group passed matches
+     * the group represented in this interface.
+     * @param another The group to compare this group to.
+     */
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj instanceof Group == false) {
+            return false;
+        }
+        Group another = (Group)obj;
+        return group.equals(another.toString());
+    }
+
+    // equals(Group) for compatibility
+    public boolean equals(Group another) {
+        return equals((Object)another);
+    }
+
+    /**
+     * Prints a stringified version of the group.
+     */
+    public String toString() {
+        return group;
+    }
+
+    /**
+     * return a hashcode for the principal.
+     */
+    public int hashCode() {
+        return group.hashCode();
+    }
+
+    /**
+     * returns true if the passed principal is a member of the group.
+     * @param member The principal whose membership must be checked for.
+     * @return true if the principal is a member of this group,
+     * false otherwise
+     */
+    public boolean isMember(Principal member) {
+
+        //
+        // if the member is part of the group (common case), return true.
+        // if not, recursively search depth first in the group looking for the
+        // principal.
+        //
+        if (groupMembers.contains(member)) {
+            return true;
+        } else {
+            Vector<Group> alreadySeen = new Vector<>(10);
+            return isMemberRecurse(member, alreadySeen);
+        }
+    }
+
+    /**
+     * return the name of the principal.
+     */
+    public String getName() {
+        return group;
+    }
+
+    //
+    // This function is the recursive search of groups for this
+    // implementation of the Group. The search proceeds building up
+    // a vector of already seen groups. Only new groups are considered,
+    // thereby avoiding loops.
+    //
+    boolean isMemberRecurse(Principal member, Vector<Group> alreadySeen) {
+        Enumeration<? extends Principal> e = members();
+        while (e.hasMoreElements()) {
+            boolean mem = false;
+            Principal p = (Principal) e.nextElement();
+
+            // if the member is in this collection, return true
+            if (p.equals(member)) {
+                return true;
+            } else if (p instanceof GroupImpl) {
+                //
+                // if not recurse if the group has not been checked already.
+                // Can call method in this package only if the object is an
+                // instance of this class. Otherwise call the method defined
+                // in the interface. (This can lead to a loop if a mixture of
+                // implementations form a loop, but we live with this improbable
+                // case rather than clutter the interface by forcing the
+                // implementation of this method.)
+                //
+                GroupImpl g = (GroupImpl) p;
+                alreadySeen.addElement(this);
+                if (!alreadySeen.contains(g))
+                  mem =  g.isMemberRecurse(member, alreadySeen);
+            } else if (p instanceof Group) {
+                Group g = (Group) p;
+                if (!alreadySeen.contains(g))
+                  mem = g.isMember(member);
+            }
+
+            if (mem)
+              return mem;
+        }
+        return false;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.base/share/classes/sun/security/acl/OwnerImpl.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 1996, 2006, 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.security.acl;
+
+import java.util.*;
+import java.security.*;
+import java.security.acl.*;
+
+/**
+ * Class implementing the Owner interface. The
+ * initial owner principal is configured as
+ * part of the constructor.
+ * @author      Satish Dharmaraj
+ */
+public class OwnerImpl implements Owner {
+    private Group ownerGroup;
+
+    public OwnerImpl(Principal owner) {
+        ownerGroup = new GroupImpl("AclOwners");
+        ownerGroup.addMember(owner);
+    }
+
+    /**
+     * Adds an owner. Owners can modify ACL contents and can disassociate
+     * ACLs from the objects they protect in the AclConfig interface.
+     * The caller principal must be a part of the owners list of the ACL in
+     * order to invoke this method. The initial owner is configured
+     * at ACL construction time.
+     * @param caller the principal who is invoking this method.
+     * @param owner The owner that should be added to the owners list.
+     * @return true if success, false if already an owner.
+     * @exception NotOwnerException if the caller principal is not on
+     * the owners list of the Acl.
+     */
+    public synchronized boolean addOwner(Principal caller, Principal owner)
+      throws NotOwnerException
+    {
+        if (!isOwner(caller))
+            throw new NotOwnerException();
+
+        ownerGroup.addMember(owner);
+        return false;
+    }
+
+    /**
+     * Delete owner. If this is the last owner in the ACL, an exception is
+     * raised.
+     * The caller principal must be a part of the owners list of the ACL in
+     * order to invoke this method.
+     * @param caller the principal who is invoking this method.
+     * @param owner The owner to be removed from the owners list.
+     * @return true if the owner is removed, false if the owner is not part
+     * of the owners list.
+     * @exception NotOwnerException if the caller principal is not on
+     * the owners list of the Acl.
+     * @exception LastOwnerException if there is only one owner left in the group, then
+     * deleteOwner would leave the ACL owner-less. This exception is raised in such a case.
+     */
+    public synchronized boolean deleteOwner(Principal caller, Principal owner)
+      throws NotOwnerException, LastOwnerException
+    {
+        if (!isOwner(caller))
+            throw new NotOwnerException();
+
+        Enumeration<? extends Principal> e = ownerGroup.members();
+        //
+        // check if there is atleast 2 members left.
+        //
+        Object o = e.nextElement();
+        if (e.hasMoreElements())
+            return ownerGroup.removeMember(owner);
+        else
+            throw new LastOwnerException();
+
+    }
+
+    /**
+     * returns if the given principal belongs to the owner list.
+     * @param owner The owner to check if part of the owners list
+     * @return true if the passed principal is in the owner list, false if not.
+     */
+    public synchronized boolean isOwner(Principal owner) {
+        return ownerGroup.isMember(owner);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.base/share/classes/sun/security/acl/PermissionImpl.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 1996, 1999, 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.security.acl;
+
+import java.security.Principal;
+import java.security.acl.*;
+
+/**
+ * The PermissionImpl class implements the permission
+ * interface for permissions that are strings.
+ * @author Satish Dharmaraj
+ */
+public class PermissionImpl implements Permission {
+
+    private String permission;
+
+    /**
+     * Construct a permission object using a string.
+     * @param permission the stringified version of the permission.
+     */
+    public PermissionImpl(String permission) {
+        this.permission = permission;
+    }
+
+    /**
+     * This function returns true if the object passed matches the permission
+     * represented in this interface.
+     * @param another The Permission object to compare with.
+     * @return true if the Permission objects are equal, false otherwise
+     */
+    public boolean equals(Object another) {
+        if (another instanceof Permission) {
+            Permission p = (Permission) another;
+            return permission.equals(p.toString());
+        } else {
+            return false;
+        }
+    }
+
+    /**
+     * Prints a stringified version of the permission.
+     * @return the string representation of the Permission.
+     */
+    public String toString() {
+        return permission;
+    }
+
+    /**
+     * Returns a hashcode for this PermissionImpl.
+     *
+     * @return a hashcode for this PermissionImpl.
+     */
+    public int hashCode() {
+        return toString().hashCode();
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.base/share/classes/sun/security/acl/PrincipalImpl.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 1996, 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.security.acl;
+
+import java.security.*;
+
+/**
+ * This class implements the principal interface.
+ *
+ * @author      Satish Dharmaraj
+ */
+public class PrincipalImpl implements Principal {
+
+    private String user;
+
+    /**
+     * Construct a principal from a string user name.
+     * @param user The string form of the principal name.
+     */
+    public PrincipalImpl(String user) {
+        this.user = user;
+    }
+
+    /**
+     * This function returns true if the object passed matches
+     * the principal represented in this implementation
+     * @param another the Principal to compare with.
+     * @return true if the Principal passed is the same as that
+     * encapsulated in this object, false otherwise
+     */
+    public boolean equals(Object another) {
+        if (another instanceof PrincipalImpl) {
+            PrincipalImpl p = (PrincipalImpl) another;
+            return user.equals(p.toString());
+        } else
+          return false;
+    }
+
+    /**
+     * Prints a stringified version of the principal.
+     */
+    public String toString() {
+        return user;
+    }
+
+    /**
+     * return a hashcode for the principal.
+     */
+    public int hashCode() {
+        return user.hashCode();
+    }
+
+    /**
+     * return the name of the principal.
+     */
+    public String getName() {
+        return user;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.base/share/classes/sun/security/acl/WorldGroupImpl.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 1996, 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.security.acl;
+
+import java.security.*;
+
+/**
+ * This class implements a group of principals.
+ * @author Satish Dharmaraj
+ */
+public class WorldGroupImpl extends GroupImpl {
+
+    public WorldGroupImpl(String s) {
+        super(s);
+    }
+
+    /**
+     * returns true for all passed principals
+     * @param member The principal whose membership must be checked in this Group.
+     * @return true always since this is the "world" group.
+     */
+    public boolean isMember(Principal member) {
+        return true;
+    }
+}
--- a/jdk/src/java.base/share/classes/sun/security/provider/DSA.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/sun/security/provider/DSA.java	Mon Feb 23 05:01: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();
+
+            int size = presetQ.bitLength() / 8;
+            byte[] outseq = new byte[size * 2];
+
+            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--);
 
-            return result.toByteArray();
+            System.arraycopy(rBytes, rLength - i, outseq, size - i, i);
+            System.arraycopy(sBytes, sLength - j, outseq, size * 2 - j, j);
 
-        } catch (IOException e) {
-            throw new SignatureException("error encoding signature");
+            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/jdk/src/java.base/share/classes/sun/security/provider/SunEntries.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/sun/security/provider/SunEntries.java	Mon Feb 23 05:01: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/jdk/src/java.base/share/classes/sun/security/util/DisabledAlgorithmConstraints.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/sun/security/util/DisabledAlgorithmConstraints.java	Mon Feb 23 05:01: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/jdk/src/java.base/share/classes/sun/security/util/HostnameChecker.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/sun/security/util/HostnameChecker.java	Mon Feb 23 05:01:11 2015 -0800
@@ -26,6 +26,8 @@
 package sun.security.util;
 
 import java.io.IOException;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
 import java.util.*;
 
 import java.security.Principal;
@@ -148,6 +150,17 @@
                 String ipAddress = (String)next.get(1);
                 if (expectedIP.equalsIgnoreCase(ipAddress)) {
                     return;
+                } else {
+                    // compare InetAddress objects in order to ensure
+                    // equality between a long IPv6 address and its
+                    // abbreviated form.
+                    try {
+                        if (InetAddress.getByName(expectedIP).equals(
+                                InetAddress.getByName(ipAddress))) {
+                            return;
+                        }
+                    } catch (UnknownHostException e) {
+                    } catch (SecurityException e) {}
                 }
             }
         }
--- a/jdk/src/java.base/share/classes/sun/util/resources/TimeZoneNames.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/classes/sun/util/resources/TimeZoneNames.java	Mon Feb 23 05:01: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
@@ -408,7 +408,7 @@
             {"America/Buenos_Aires", AGT},
             {"America/Cambridge_Bay", MST},
             {"America/Campo_Grande", AMT},
-            {"America/Cancun", CST},
+            {"America/Cancun", EST},
             {"America/Caracas", new String[] {"Venezuela Time", "VET",
                                               "Venezuela Summer Time", "VEST",
                                               "Venezuela Time", "VET"}},
--- a/jdk/src/java.base/share/conf/security/java.policy	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/conf/security/java.policy	Mon Feb 23 05:01: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";
@@ -55,6 +59,29 @@
         permission java.io.FilePermission "<<ALL FILES>>", "read";
 };
 
+grant codeBase "jrt:/java.xml.ws" {
+        permission java.lang.RuntimePermission "accessClassInPackage.com.sun.xml.internal.*";
+        permission java.lang.RuntimePermission "accessClassInPackage.com.sun.istack.internal";
+        permission java.lang.RuntimePermission "accessClassInPackage.com.sun.istack.internal.*";
+        permission java.lang.RuntimePermission "accessClassInPackage.com.sun.org.apache.xerces.internal.*";
+        permission java.lang.RuntimePermission "accessDeclaredMembers";
+        permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
+        permission java.util.PropertyPermission "*", "read";
+};
+
+grant codeBase "jrt:/java.xml.bind" {
+        permission java.lang.RuntimePermission "accessClassInPackage.com.sun.xml.internal.*";
+        permission java.lang.RuntimePermission "accessClassInPackage.com.sun.istack.internal";
+        permission java.lang.RuntimePermission "accessClassInPackage.com.sun.istack.internal.*";
+        permission java.lang.RuntimePermission "accessDeclaredMembers";
+        permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
+        permission java.util.PropertyPermission "*", "read";
+};
+
+grant codeBase "jrt:/java.activation" {
+        permission java.security.AllPermission;
+};
+
 // default permissions granted to all domains
 
 grant {
--- a/jdk/src/java.base/share/native/include/jvm.h	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/native/include/jvm.h	Mon Feb 23 05:01: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
@@ -104,6 +104,9 @@
 JNIEXPORT jlong JNICALL
 JVM_NanoTime(JNIEnv *env, jclass ignored);
 
+JNIEXPORT jlong JNICALL
+JVM_GetNanoTimeAdjustment(JNIEnv *env, jclass ignored, jlong offset_secs);
+
 JNIEXPORT void JNICALL
 JVM_ArrayCopy(JNIEnv *env, jclass ignored, jobject src, jint src_pos,
               jobject dst, jint dst_pos, jint length);
--- a/jdk/src/java.base/share/native/libjava/VM.c	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/native/libjava/VM.c	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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,6 +33,11 @@
 
 #include "sun_misc_VM.h"
 
+/* Only register the performance-critical methods */
+static JNINativeMethod methods[] = {
+    {"getNanoTimeAdjustment", "(J)J", (void *)&JVM_GetNanoTimeAdjustment}
+};
+
 JNIEXPORT jobject JNICALL
 Java_sun_misc_VM_latestUserDefinedLoader(JNIEnv *env, jclass cls) {
     return JVM_LatestUserDefinedLoader(env);
@@ -49,6 +54,14 @@
         return;
     }
 
+    // Registers implementations of native methods described in methods[]
+    // above.
+    // In particular, registers JVM_GetNanoTimeAdjustment as the implementation
+    // of the native sun.misc.VM.getNanoTimeAdjustment - avoiding the cost of
+    // introducing a Java_sun_misc_VM_getNanoTimeAdjustment  wrapper
+    (*env)->RegisterNatives(env, cls,
+                            methods, sizeof(methods)/sizeof(methods[0]));
+
     func_p = (GetJvmVersionInfo_fp) JDK_FindJvmEntry("JVM_GetVersionInfo");
      if (func_p != NULL) {
         jvm_version_info info;
--- a/jdk/src/java.base/share/native/libjli/java.c	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/native/libjli/java.c	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 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
@@ -350,12 +350,6 @@
         } \
     } while (JNI_FALSE)
 
-#define CHECK_EXCEPTION_RETURN() \
-    do { \
-        if ((*env)->ExceptionOccurred(env)) { \
-            return; \
-        } \
-    } while (JNI_FALSE)
 
 int JNICALL
 JavaMain(void * _args)
@@ -466,6 +460,7 @@
      * of the application class.
      */
     PostJVMInit(env, appClass, vm);
+    CHECK_EXCEPTION_LEAVE(1);
     /*
      * The LoadMainClass not only loads the main class, it will also ensure
      * that the main method's signature is correct, therefore further checking
--- a/jdk/src/java.base/share/native/libjli/java.h	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/share/native/libjli/java.h	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -254,4 +254,11 @@
 #define NULL_CHECK(NC_check_pointer) \
     NULL_CHECK_RETURN_VALUE(NC_check_pointer, )
 
+#define CHECK_EXCEPTION_RETURN() \
+    do { \
+        if ((*env)->ExceptionOccurred(env)) { \
+            return; \
+        } \
+    } while (JNI_FALSE)
+
 #endif /* _JAVA_H_ */
--- a/jdk/src/java.base/windows/classes/sun/nio/fs/WindowsPath.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/windows/classes/sun/nio/fs/WindowsPath.java	Mon Feb 23 05:01:11 2015 -0800
@@ -391,6 +391,10 @@
         if (!this.root.equalsIgnoreCase(other.root))
             throw new IllegalArgumentException("'other' has different root");
 
+        // this path is the empty path
+        if (this.isEmpty())
+            return other;
+
         int bn = this.getNameCount();
         int cn = other.getNameCount();
 
--- a/jdk/src/java.base/windows/native/libjava/ProcessImpl_md.c	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/windows/native/libjava/ProcessImpl_md.c	Mon Feb 23 05:01:11 2015 -0800
@@ -30,6 +30,7 @@
 #include "jvm.h"
 #include "jni_util.h"
 #include "io_util.h"
+#include "io_util_md.h"
 #include <windows.h>
 #include <io.h>
 
@@ -467,26 +468,6 @@
     return (jboolean) CloseHandle((HANDLE) handle);
 }
 
-/**
- * Returns a copy of the Unicode characters of a string. Fow now this
- * function doesn't handle long path names and other issues.
- */
-static WCHAR* getPath(JNIEnv *env, jstring ps) {
-    WCHAR *pathbuf = NULL;
-    const jchar *chars = (*(env))->GetStringChars(env, ps, NULL);
-    if (chars != NULL) {
-        size_t pathlen = wcslen(chars);
-        pathbuf = (WCHAR*)malloc((pathlen + 6) * sizeof(WCHAR));
-        if (pathbuf == NULL) {
-            JNU_ThrowOutOfMemoryError(env, NULL);
-        } else {
-            wcscpy(pathbuf, chars);
-        }
-        (*env)->ReleaseStringChars(env, ps, chars);
-    }
-    return pathbuf;
-}
-
 JNIEXPORT jlong JNICALL
 Java_java_lang_ProcessImpl_openForAtomicAppend(JNIEnv *env, jclass ignored, jstring path)
 {
@@ -495,7 +476,7 @@
     const DWORD disposition = OPEN_ALWAYS;
     const DWORD flagsAndAttributes = FILE_ATTRIBUTE_NORMAL;
     HANDLE h;
-    WCHAR *pathbuf = getPath(env, path);
+    WCHAR *pathbuf = pathToNTPath(env, path, JNI_FALSE);
     if (pathbuf == NULL) {
         /* Exception already pending */
         return -1;
--- a/jdk/src/java.base/windows/native/libjava/io_util_md.h	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/windows/native/libjava/io_util_md.h	Mon Feb 23 05:01:11 2015 -0800
@@ -33,7 +33,8 @@
 
 /*
  * Prototypes for functions in io_util_md.c called from io_util.c,
- * FileDescriptor.c, FileInputStream.c, FileOutputStream.c
+ * FileDescriptor.c, FileInputStream.c, FileOutputStream.c,
+ * ProcessImpl_md.c
  */
 WCHAR* pathToNTPath(JNIEnv *env, jstring path, jboolean throwFNFE);
 WCHAR* fileToNTPath(JNIEnv *env, jobject file, jfieldID id);
--- a/jdk/src/java.base/windows/native/libjli/java_md.c	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.base/windows/native/libjli/java_md.c	Mon Feb 23 05:01: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/jdk/src/java.datatransfer/macosx/classes/sun/datatransfer/resources/flavormap.properties	Mon Feb 23 05:01: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/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/Clipboard.java	Mon Feb 23 05:01: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/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/ClipboardOwner.java	Mon Feb 23 05:01: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/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/DataFlavor.java	Mon Feb 23 05:01: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();
+                    }
+                }
+            }
+        }
+
+        return total;
+    }
+
+    /**
+     * Identical to {@link #equals(DataFlavor)}.
+     *
+     * @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
+     * @since 1.3
+     */
+    public boolean match(DataFlavor that) {
+        return equals(that);
+    }
+
+    /**
+     * Returns whether the string representation of the MIME type passed in
+     * is equivalent to the MIME type of this <code>DataFlavor</code>.
+     * Parameters are not included in the comparison.
+     *
+     * @param mimeType the string representation of the MIME type
+     * @return true if the string representation of the MIME type passed in is
+     *         equivalent to the MIME type of this <code>DataFlavor</code>;
+     *         false otherwise
+     * @throws NullPointerException if mimeType is <code>null</code>
+     */
+    public boolean isMimeTypeEqual(String mimeType) {
+        // JCK Test DataFlavor0117: if 'mimeType' is null, throw NPE
+        if (mimeType == null) {
+            throw new NullPointerException("mimeType");
+        }
+        if (this.mimeType == null) {
+            return false;
+        }
+        try {
+            return this.mimeType.match(new MimeType(mimeType));
+        } catch (MimeTypeParseException mtpe) {
+            return false;
+        }
+    }
+
+    /**
+     * Compares the <code>mimeType</code> of two <code>DataFlavor</code>
+     * objects. No parameters are considered.
+     *
+     * @param dataFlavor the <code>DataFlavor</code> to be compared
+     * @return true if the <code>MimeType</code>s are equal,
+     *  otherwise false
+     */
+
+    public final boolean isMimeTypeEqual(DataFlavor dataFlavor) {
+        return isMimeTypeEqual(dataFlavor.mimeType);
+    }
+
+    /**
+     * Compares the <code>mimeType</code> of two <code>DataFlavor</code>
+     * objects.  No parameters are considered.
+     *
+     * @return true if the <code>MimeType</code>s are equal,
+     *  otherwise false
+     */
+
+    private boolean isMimeTypeEqual(MimeType mtype) {
+        if (this.mimeType == null) {
+            return (mtype == null);
+        }
+        return mimeType.match(mtype);
+    }
+
+    /**
+     * Checks if the representation class is one of the standard text
+     * representation classes.
+     *
+     * @return true if the representation class is one of the standard text
+     *              representation classes, otherwise false
+     */
+    private boolean isStandardTextRepresentationClass() {
+        return isRepresentationClassReader()
+                || String.class.equals(representationClass)
+                || isRepresentationClassCharBuffer()
+                || char[].class.equals(representationClass);
+    }
+
+   /**
+    * Does the <code>DataFlavor</code> represent a serialized object?
+    * @return whether or not a serialized object is represented
+    */
+    public boolean isMimeTypeSerializedObject() {
+        return isMimeTypeEqual(javaSerializedObjectMimeType);
+    }
+
+    /**
+     * Returns the default representation class.
+     * @return the default representation class
+     */
+    public final Class<?> getDefaultRepresentationClass() {
+        return ioInputStreamClass;
+    }
+
+    /**
+     * Returns the name of the default representation class.
+     * @return the name of the default representation class
+     */
+    public final String getDefaultRepresentationClassAsString() {
+        return getDefaultRepresentationClass().getName();
+    }
+
+   /**
+    * Does the <code>DataFlavor</code> represent a
+    * <code>java.io.InputStream</code>?
+    * @return whether or not this {@code DataFlavor} represent a
+    * {@code java.io.InputStream}
+    */
+    public boolean isRepresentationClassInputStream() {
+        return ioInputStreamClass.isAssignableFrom(representationClass);
+    }
+
+    /**
+     * Returns whether the representation class for this
+     * <code>DataFlavor</code> is <code>java.io.Reader</code> or a subclass
+     * thereof.
+     * @return whether or not the representation class for this
+     * {@code DataFlavor} is {@code java.io.Reader} or a subclass
+     * thereof
+     *
+     * @since 1.4
+     */
+    public boolean isRepresentationClassReader() {
+        return java.io.Reader.class.isAssignableFrom(representationClass);
+    }
+
+    /**
+     * Returns whether the representation class for this
+     * <code>DataFlavor</code> is <code>java.nio.CharBuffer</code> or a
+     * subclass thereof.
+     * @return whether or not the representation class for this
+     * {@code DataFlavor} is {@code java.nio.CharBuffer} or a subclass
+     * thereof
+     *
+     * @since 1.4
+     */
+    public boolean isRepresentationClassCharBuffer() {
+        return java.nio.CharBuffer.class.isAssignableFrom(representationClass);
+    }
+
+    /**
+     * Returns whether the representation class for this
+     * <code>DataFlavor</code> is <code>java.nio.ByteBuffer</code> or a
+     * subclass thereof.
+     * @return whether or not the representation class for this
+     * {@code DataFlavor} is {@code java.nio.ByteBuffer} or a subclass
+     * thereof
+     *
+     * @since 1.4
+     */
+    public boolean isRepresentationClassByteBuffer() {
+        return java.nio.ByteBuffer.class.isAssignableFrom(representationClass);
+    }
+
+   /**
+    * Returns true if the representation class can be serialized.
+    * @return true if the representation class can be serialized
+    */
+
+    public boolean isRepresentationClassSerializable() {
+        return java.io.Serializable.class.isAssignableFrom(representationClass);
+    }
+
+   /**
+    * Returns true if the representation class is <code>Remote</code>.
+    * @return true if the representation class is <code>Remote</code>
+    */
+    public boolean isRepresentationClassRemote() {
+        return DataFlavorUtil.RMI.isRemote(representationClass);
+    }
+
+   /**
+    * Returns true if the <code>DataFlavor</code> specified represents
+    * a serialized object.
+    * @return true if the <code>DataFlavor</code> specified represents
+    *   a Serialized Object
+    */
+
+    public boolean isFlavorSerializedObjectType() {
+        return isRepresentationClassSerializable() && isMimeTypeEqual(javaSerializedObjectMimeType);
+    }
+
+    /**
+     * Returns true if the <code>DataFlavor</code> specified represents
+     * a remote object.
+     * @return true if the <code>DataFlavor</code> specified represents
+     *  a Remote Object
+     */
+
+    public boolean isFlavorRemoteObjectType() {
+        return isRepresentationClassRemote()
+            && isRepresentationClassSerializable()
+            && isMimeTypeEqual(javaRemoteObjectMimeType);
+    }
+
+
+   /**
+    * Returns true if the <code>DataFlavor</code> specified represents
+    * a list of file objects.
+    * @return true if the <code>DataFlavor</code> specified represents
+    *   a List of File objects
+    */
+
+   public boolean isFlavorJavaFileListType() {
+        if (mimeType == null || representationClass == null)
+            return false;
+        return java.util.List.class.isAssignableFrom(representationClass) &&
+               mimeType.match(javaFileListFlavor.mimeType);
+
+   }
+
+    /**
+     * Returns whether this <code>DataFlavor</code> is a valid text flavor for
+     * this implementation of the Java platform. Only flavors equivalent to
+     * <code>DataFlavor.stringFlavor</code> and <code>DataFlavor</code>s with
+     * a primary MIME type of "text" can be valid text flavors.
+     * <p>
+     * If this flavor supports the charset parameter, it must be equivalent to
+     * <code>DataFlavor.stringFlavor</code>, or its representation must be
+     * <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>, or
+     * <code>[B</code>. If the representation is
+     * <code>java.io.InputStream</code>, <code>java.nio.ByteBuffer</code>, or
+     * <code>[B</code>, then this flavor's <code>charset</code> parameter must
+     * be supported by this implementation of the Java platform. If a charset
+     * is not specified, then the platform default charset, which is always
+     * supported, is assumed.
+     * <p>
+     * If this flavor does not support the charset parameter, its
+     * representation must be <code>java.io.InputStream</code>,
+     * <code>java.nio.ByteBuffer</code>, or <code>[B</code>.
+     * <p>
+     * See <code>selectBestTextFlavor</code> for a list of text flavors which
+     * support the charset parameter.
+     *
+     * @return <code>true</code> if this <code>DataFlavor</code> is a valid
+     *         text flavor as described above; <code>false</code> otherwise
+     * @see #selectBestTextFlavor
+     * @since 1.4
+     */
+    public boolean isFlavorTextType() {
+        return (DataFlavorUtil.isFlavorCharsetTextType(this) ||
+                DataFlavorUtil.isFlavorNoncharsetTextType(this));
+    }
+
+   /**
+    * Serializes this <code>DataFlavor</code>.
+    */
+
+   public synchronized void writeExternal(ObjectOutput os) throws IOException {
+       if (mimeType != null) {
+           mimeType.setParameter("humanPresentableName", humanPresentableName);
+           os.writeObject(mimeType);
+           mimeType.removeParameter("humanPresentableName");
+       } else {
+           os.writeObject(null);
+       }
+
+       os.writeObject(representationClass);
+   }
+
+   /**
+    * Restores this <code>DataFlavor</code> from a Serialized state.
+    */
+
+   public synchronized void readExternal(ObjectInput is) throws IOException , ClassNotFoundException {
+       String rcn = null;
+        mimeType = (MimeType)is.readObject();
+
+        if (mimeType != null) {
+            humanPresentableName =
+                mimeType.getParameter("humanPresentableName");
+            mimeType.removeParameter("humanPresentableName");
+            rcn = mimeType.getParameter("class");
+            if (rcn == null) {
+                throw new IOException("no class parameter specified in: " +
+                                      mimeType);
+            }
+        }
+
+        try {
+            representationClass = (Class)is.readObject();
+        } catch (OptionalDataException ode) {
+            if (!ode.eof || ode.length != 0) {
+                throw ode;
+            }
+            // Ensure backward compatibility.
+            // Old versions didn't write the representation class to the stream.
+            if (rcn != null) {
+                representationClass =
+                    DataFlavor.tryToLoadClass(rcn, getClass().getClassLoader());
+            }
+        }
+   }
+
+   /**
+    * Returns a clone of this <code>DataFlavor</code>.
+    * @return a clone of this <code>DataFlavor</code>
+    */
+
+    public Object clone() throws CloneNotSupportedException {
+        Object newObj = super.clone();
+        if (mimeType != null) {
+            ((DataFlavor)newObj).mimeType = (MimeType)mimeType.clone();
+        }
+        return newObj;
+    } // clone()
+
+   /**
+    * Called on <code>DataFlavor</code> for every MIME Type parameter
+    * to allow <code>DataFlavor</code> subclasses to handle special
+    * parameters like the text/plain <code>charset</code>
+    * parameters, whose values are case insensitive.  (MIME type parameter
+    * values are supposed to be case sensitive.
+    * <p>
+    * This method is called for each parameter name/value pair and should
+    * return the normalized representation of the <code>parameterValue</code>.
+    *
+    * This method is never invoked by this implementation from 1.1 onwards.
+    *
+    * @param parameterName the parameter name
+    * @param parameterValue the parameter value
+    * @return the parameter value
+    * @deprecated
+    */
+    @Deprecated
+    protected String normalizeMimeTypeParameter(String parameterName, String parameterValue) {
+        return parameterValue;
+    }
+
+   /**
+    * Called for each MIME type string to give <code>DataFlavor</code> subtypes
+    * the opportunity to change how the normalization of MIME types is
+    * accomplished.  One possible use would be to add default
+    * parameter/value pairs in cases where none are present in the MIME
+    * type string passed in.
+    *
+    * This method is never invoked by this implementation from 1.1 onwards.
+    *
+    * @param mimeType the mime type
+    * @return the mime type
+    * @deprecated
+    */
+    @Deprecated
+    protected String normalizeMimeType(String mimeType) {
+        return mimeType;
+    }
+
+    /*
+     * fields
+     */
+
+    /* placeholder for caching any platform-specific data for flavor */
+
+    transient int       atom;
+
+    /* Mime Type of DataFlavor */
+
+    MimeType            mimeType;
+
+    private String      humanPresentableName;
+
+    /** Java class of objects this DataFlavor represents **/
+
+    private Class<?>       representationClass;
+
+} // class DataFlavor
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/FlavorEvent.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2003, 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 java.util.EventObject;
+
+
+/**
+ * <code>FlavorEvent</code> is used to notify interested parties
+ * that available {@link DataFlavor}s have changed in the
+ * {@link Clipboard} (the event source).
+ *
+ * @see FlavorListener
+ *
+ * @author Alexander Gerasimov
+ * @since 1.5
+ */
+public class FlavorEvent extends EventObject {
+    private static final long serialVersionUID = -5842664112252414548L;
+
+    /**
+     * Constructs a <code>FlavorEvent</code> object.
+     *
+     * @param source  the <code>Clipboard</code> that is the source of the event
+     *
+     * @throws IllegalArgumentException if the {@code source} is {@code null}
+     */
+    public FlavorEvent(Clipboard source) {
+        super(source);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/FlavorListener.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2003, 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 java.util.EventListener;
+
+
+/**
+ * Defines an object which listens for {@link FlavorEvent}s.
+ *
+ * @author Alexander Gerasimov
+ * @since 1.5
+ */
+public interface FlavorListener extends EventListener {
+    /**
+     * Invoked when the target {@link Clipboard} of the listener
+     * has changed its available {@link DataFlavor}s.
+     * <p>
+     * Some notifications may be redundant &#8212; they are not
+     * caused by a change of the set of DataFlavors available
+     * on the clipboard.
+     * For example, if the clipboard subsystem supposes that
+     * the system clipboard's contents has been changed but it
+     * can't ascertain whether its DataFlavors have been changed
+     * because of some exceptional condition when accessing the
+     * clipboard, the notification is sent to ensure from omitting
+     * a significant notification. Ordinarily, those redundant
+     * notifications should be occasional.
+     *
+     * @param e  a <code>FlavorEvent</code> object
+     */
+    void flavorsChanged(FlavorEvent e);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/FlavorMap.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 1997, 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 java.awt.datatransfer;
+
+import java.util.Map;
+
+
+/**
+ * A two-way Map between "natives" (Strings), which correspond to platform-
+ * specific data formats, and "flavors" (DataFlavors), which correspond to
+ * platform-independent MIME types. FlavorMaps need not be symmetric, but
+ * typically are.
+ *
+ *
+ * @since 1.2
+ */
+public interface FlavorMap {
+
+    /**
+     * Returns a <code>Map</code> of the specified <code>DataFlavor</code>s to
+     * their corresponding <code>String</code> native. The returned
+     * <code>Map</code> is a modifiable copy of this <code>FlavorMap</code>'s
+     * internal data. Client code is free to modify the <code>Map</code>
+     * without affecting this object.
+     *
+     * @param flavors an array of <code>DataFlavor</code>s which will be the
+     *        key set of the returned <code>Map</code>. If <code>null</code> is
+     *        specified, a mapping of all <code>DataFlavor</code>s currently
+     *        known to this <code>FlavorMap</code> to their corresponding
+     *        <code>String</code> natives will be returned.
+     * @return a <code>java.util.Map</code> of <code>DataFlavor</code>s to
+     *         <code>String</code> natives
+     */
+    Map<DataFlavor,String> getNativesForFlavors(DataFlavor[] flavors);
+
+    /**
+     * Returns a <code>Map</code> of the specified <code>String</code> natives
+     * to their corresponding <code>DataFlavor</code>. The returned
+     * <code>Map</code> is a modifiable copy of this <code>FlavorMap</code>'s
+     * internal data. Client code is free to modify the <code>Map</code>
+     * without affecting this object.
+     *
+     * @param natives an array of <code>String</code>s which will be the
+     *        key set of the returned <code>Map</code>. If <code>null</code> is
+     *        specified, a mapping of all <code>String</code> natives currently
+     *        known to this <code>FlavorMap</code> to their corresponding
+     *        <code>DataFlavor</code>s will be returned.
+     * @return a <code>java.util.Map</code> of <code>String</code> natives to
+     *         <code>DataFlavor</code>s
+     */
+    Map<String,DataFlavor> getFlavorsForNatives(String[] natives);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/FlavorTable.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2000, 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 java.awt.datatransfer;
+
+import java.util.List;
+
+
+/**
+ * A FlavorMap which relaxes the traditional 1-to-1 restriction of a Map. A
+ * flavor is permitted to map to any number of natives, and likewise a native
+ * is permitted to map to any number of flavors. FlavorTables need not be
+ * symmetric, but typically are.
+ *
+ * @author David Mendenhall
+ *
+ * @since 1.4
+ */
+public interface FlavorTable extends FlavorMap {
+
+    /**
+     * Returns a <code>List</code> of <code>String</code> natives to which the
+     * specified <code>DataFlavor</code> corresponds. The <code>List</code>
+     * will be sorted from best native to worst. That is, the first native will
+     * best reflect data in the specified flavor to the underlying native
+     * platform. The returned <code>List</code> is a modifiable copy of this
+     * <code>FlavorTable</code>'s internal data. Client code is free to modify
+     * the <code>List</code> without affecting this object.
+     *
+     * @param flav the <code>DataFlavor</code> whose corresponding natives
+     *        should be returned. If <code>null</code> is specified, all
+     *        natives currently known to this <code>FlavorTable</code> are
+     *        returned in a non-deterministic order.
+     * @return a <code>java.util.List</code> of <code>java.lang.String</code>
+     *         objects which are platform-specific representations of platform-
+     *         specific data formats
+     */
+    List<String> getNativesForFlavor(DataFlavor flav);
+
+    /**
+     * Returns a <code>List</code> of <code>DataFlavor</code>s to which the
+     * specified <code>String</code> corresponds. The <code>List</code> will be
+     * sorted from best <code>DataFlavor</code> to worst. That is, the first
+     * <code>DataFlavor</code> will best reflect data in the specified
+     * native to a Java application. The returned <code>List</code> is a
+     * modifiable copy of this <code>FlavorTable</code>'s internal data.
+     * Client code is free to modify the <code>List</code> without affecting
+     * this object.
+     *
+     * @param nat the native whose corresponding <code>DataFlavor</code>s
+     *        should be returned. If <code>null</code> is specified, all
+     *        <code>DataFlavor</code>s currently known to this
+     *        <code>FlavorTable</code> are returned in a non-deterministic
+     *        order.
+     * @return a <code>java.util.List</code> of <code>DataFlavor</code>
+     *         objects into which platform-specific data in the specified,
+     *         platform-specific native can be translated
+     */
+    List<DataFlavor> getFlavorsForNative(String nat);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/MimeType.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,394 @@
+/*
+ * Copyright (c) 1997, 2012, 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 java.io.Externalizable;
+import java.io.ObjectOutput;
+import java.io.ObjectInput;
+import java.io.IOException;
+import java.util.Enumeration;
+import java.util.Locale;
+
+
+/**
+ * A Multipurpose Internet Mail Extension (MIME) type, as defined
+ * in RFC 2045 and 2046.
+ *
+ * THIS IS *NOT* - REPEAT *NOT* - A PUBLIC CLASS! DataFlavor IS
+ * THE PUBLIC INTERFACE, AND THIS IS PROVIDED AS A ***PRIVATE***
+ * (THAT IS AS IN *NOT* PUBLIC) HELPER CLASS!
+ */
+class MimeType implements Externalizable, Cloneable {
+
+    /*
+     * serialization support
+     */
+
+    static final long serialVersionUID = -6568722458793895906L;
+
+    /**
+     * Constructor for externalization; this constructor should not be
+     * called directly by an application, since the result will be an
+     * uninitialized, immutable <code>MimeType</code> object.
+     */
+    public MimeType() {
+    }
+
+    /**
+     * Builds a <code>MimeType</code> from a <code>String</code>.
+     *
+     * @param rawdata text used to initialize the <code>MimeType</code>
+     * @throws NullPointerException if <code>rawdata</code> is null
+     */
+    public MimeType(String rawdata) throws MimeTypeParseException {
+        parse(rawdata);
+    }
+
+    /**
+     * Builds a <code>MimeType</code> with the given primary and sub
+     * type but has an empty parameter list.
+     *
+     * @param primary the primary type of this <code>MimeType</code>
+     * @param sub the subtype of this <code>MimeType</code>
+     * @throws NullPointerException if either <code>primary</code> or
+     *         <code>sub</code> is null
+     */
+    public MimeType(String primary, String sub) throws MimeTypeParseException {
+        this(primary, sub, new MimeTypeParameterList());
+    }
+
+    /**
+     * Builds a <code>MimeType</code> with a pre-defined
+     * and valid (or empty) parameter list.
+     *
+     * @param primary the primary type of this <code>MimeType</code>
+     * @param sub the subtype of this <code>MimeType</code>
+     * @param mtpl the requested parameter list
+     * @throws NullPointerException if either <code>primary</code>,
+     *         <code>sub</code> or <code>mtpl</code> is null
+     */
+    public MimeType(String primary, String sub, MimeTypeParameterList mtpl) throws
+MimeTypeParseException {
+        //    check to see if primary is valid
+        if(isValidToken(primary)) {
+            primaryType = primary.toLowerCase(Locale.ENGLISH);
+        } else {
+            throw new MimeTypeParseException("Primary type is invalid.");
+        }
+
+        //    check to see if sub is valid
+        if(isValidToken(sub)) {
+            subType = sub.toLowerCase(Locale.ENGLISH);
+        } else {
+            throw new MimeTypeParseException("Sub type is invalid.");
+        }
+
+        parameters = (MimeTypeParameterList)mtpl.clone();
+    }
+
+    public int hashCode() {
+
+        // We sum up the hash codes for all of the strings. This
+        // way, the order of the strings is irrelevant
+        int code = 0;
+        code += primaryType.hashCode();
+        code += subType.hashCode();
+        code += parameters.hashCode();
+        return code;
+    } // hashCode()
+
+    /**
+     * <code>MimeType</code>s are equal if their primary types,
+     * subtypes, and  parameters are all equal. No default values
+     * are taken into account.
+     * @param thatObject the object to be evaluated as a
+     *    <code>MimeType</code>
+     * @return <code>true</code> if <code>thatObject</code> is
+     *    a <code>MimeType</code>; otherwise returns <code>false</code>
+     */
+    public boolean equals(Object thatObject) {
+        if (!(thatObject instanceof MimeType)) {
+            return false;
+        }
+        MimeType that = (MimeType)thatObject;
+        boolean isIt =
+            ((this.primaryType.equals(that.primaryType)) &&
+             (this.subType.equals(that.subType)) &&
+             (this.parameters.equals(that.parameters)));
+        return isIt;
+    } // equals()
+
+    /**
+     * A routine for parsing the MIME type out of a String.
+     *
+     * @throws NullPointerException if <code>rawdata</code> is null
+     */
+    private void parse(String rawdata) throws MimeTypeParseException {
+        int slashIndex = rawdata.indexOf('/');
+        int semIndex = rawdata.indexOf(';');
+        if((slashIndex < 0) && (semIndex < 0)) {
+            //    neither character is present, so treat it
+            //    as an error
+            throw new MimeTypeParseException("Unable to find a sub type.");
+        } else if((slashIndex < 0) && (semIndex >= 0)) {
+            //    we have a ';' (and therefore a parameter list),
+            //    but no '/' indicating a sub type is present
+            throw new MimeTypeParseException("Unable to find a sub type.");
+        } else if((slashIndex >= 0) && (semIndex < 0)) {
+            //    we have a primary and sub type but no parameter list
+            primaryType = rawdata.substring(0,slashIndex).
+                trim().toLowerCase(Locale.ENGLISH);
+            subType = rawdata.substring(slashIndex + 1).
+                trim().toLowerCase(Locale.ENGLISH);
+            parameters = new MimeTypeParameterList();
+        } else if (slashIndex < semIndex) {
+            //    we have all three items in the proper sequence
+            primaryType = rawdata.substring(0, slashIndex).
+                trim().toLowerCase(Locale.ENGLISH);
+            subType = rawdata.substring(slashIndex + 1,
+                semIndex).trim().toLowerCase(Locale.ENGLISH);
+            parameters = new
+MimeTypeParameterList(rawdata.substring(semIndex));
+        } else {
+            //    we have a ';' lexically before a '/' which means we have a primary type
+            //    & a parameter list but no sub type
+            throw new MimeTypeParseException("Unable to find a sub type.");
+        }
+
+        //    now validate the primary and sub types
+
+        //    check to see if primary is valid
+        if(!isValidToken(primaryType)) {
+            throw new MimeTypeParseException("Primary type is invalid.");
+        }
+
+        //    check to see if sub is valid
+        if(!isValidToken(subType)) {
+            throw new MimeTypeParseException("Sub type is invalid.");
+        }
+    }
+
+    /**
+     * Retrieve the primary type of this object.
+     */
+    public String getPrimaryType() {
+        return primaryType;
+    }
+
+    /**
+     * Retrieve the sub type of this object.
+     */
+    public String getSubType() {
+        return subType;
+    }
+
+    /**
+     * Retrieve a copy of this object's parameter list.
+     */
+    public MimeTypeParameterList getParameters() {
+        return (MimeTypeParameterList)parameters.clone();
+    }
+
+    /**
+     * Retrieve the value associated with the given name, or null if there
+     * is no current association.
+     */
+    public String getParameter(String name) {
+        return parameters.get(name);
+    }
+
+    /**
+     * Set the value to be associated with the given name, replacing
+     * any previous association.
+     *
+     * @throw IllegalArgumentException if parameter or value is illegal
+     */
+    public void setParameter(String name, String value) {
+        parameters.set(name, value);
+    }
+
+    /**
+     * Remove any value associated with the given name.
+     *
+     * @throw IllegalArgumentException if parameter may not be deleted
+     */
+    public void removeParameter(String name) {
+        parameters.remove(name);
+    }
+
+    /**
+     * Return the String representation of this object.
+     */
+    public String toString() {
+        return getBaseType() + parameters.toString();
+    }
+
+    /**
+     * Return a String representation of this object
+     * without the parameter list.
+     */
+    public String getBaseType() {
+        return primaryType + "/" + subType;
+    }
+
+    /**
+     * Returns <code>true</code> if the primary type and the
+     * subtype of this object are the same as the specified
+     * <code>type</code>; otherwise returns <code>false</code>.
+     *
+     * @param type the type to compare to <code>this</code>'s type
+     * @return <code>true</code> if the primary type and the
+     *    subtype of this object are the same as the
+     *    specified <code>type</code>; otherwise returns
+     *    <code>false</code>
+     */
+    public boolean match(MimeType type) {
+        if (type == null)
+            return false;
+        return primaryType.equals(type.getPrimaryType())
+                    && (subType.equals("*")
+                            || type.getSubType().equals("*")
+                            || (subType.equals(type.getSubType())));
+    }
+
+    /**
+     * Returns <code>true</code> if the primary type and the
+     * subtype of this object are the same as the content type
+     * described in <code>rawdata</code>; otherwise returns
+     * <code>false</code>.
+     *
+     * @param rawdata the raw data to be examined
+     * @return <code>true</code> if the primary type and the
+     *    subtype of this object are the same as the content type
+     *    described in <code>rawdata</code>; otherwise returns
+     *    <code>false</code>; if <code>rawdata</code> is
+     *    <code>null</code>, returns <code>false</code>
+     */
+    public boolean match(String rawdata) throws MimeTypeParseException {
+        if (rawdata == null)
+            return false;
+        return match(new MimeType(rawdata));
+    }
+
+    /**
+     * The object implements the writeExternal method to save its contents
+     * by calling the methods of DataOutput for its primitive values or
+     * calling the writeObject method of ObjectOutput for objects, strings
+     * and arrays.
+     * @exception IOException Includes any I/O exceptions that may occur
+     */
+    public void writeExternal(ObjectOutput out) throws IOException {
+        String s = toString(); // contains ASCII chars only
+        // one-to-one correspondence between ASCII char and byte in UTF string
+        if (s.length() <= 65535) { // 65535 is max length of UTF string
+            out.writeUTF(s);
+        } else {
+            out.writeByte(0);
+            out.writeByte(0);
+            out.writeInt(s.length());
+            out.write(s.getBytes());
+        }
+    }
+
+    /**
+     * The object implements the readExternal method to restore its
+     * contents by calling the methods of DataInput for primitive
+     * types and readObject for objects, strings and arrays.  The
+     * readExternal method must read the values in the same sequence
+     * and with the same types as were written by writeExternal.
+     * @exception ClassNotFoundException If the class for an object being
+     *              restored cannot be found.
+     */
+    public void readExternal(ObjectInput in) throws IOException,
+ClassNotFoundException {
+        String s = in.readUTF();
+        if (s == null || s.length() == 0) { // long mime type
+            byte[] ba = new byte[in.readInt()];
+            in.readFully(ba);
+            s = new String(ba);
+        }
+        try {
+            parse(s);
+        } catch(MimeTypeParseException e) {
+            throw new IOException(e.toString());
+        }
+    }
+
+    /**
+     * Returns a clone of this object.
+     * @return a clone of this object
+     */
+
+    public Object clone() {
+        MimeType newObj = null;
+        try {
+            newObj = (MimeType)super.clone();
+        } catch (CloneNotSupportedException cannotHappen) {
+        }
+        newObj.parameters = (MimeTypeParameterList)parameters.clone();
+        return newObj;
+    }
+
+    private String    primaryType;
+    private String    subType;
+    private MimeTypeParameterList parameters;
+
+    //    below here be scary parsing related things
+
+    /**
+     * Determines whether or not a given character belongs to a legal token.
+     */
+    private static boolean isTokenChar(char c) {
+        return ((c > 040) && (c < 0177)) && (TSPECIALS.indexOf(c) < 0);
+    }
+
+    /**
+     * Determines whether or not a given string is a legal token.
+     *
+     * @throws NullPointerException if <code>s</code> is null
+     */
+    private boolean isValidToken(String s) {
+        int len = s.length();
+        if(len > 0) {
+            for (int i = 0; i < len; ++i) {
+                char c = s.charAt(i);
+                if (!isTokenChar(c)) {
+                    return false;
+                }
+            }
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    /**
+     * A string that holds all the special chars.
+     */
+
+    private static final String TSPECIALS = "()<>@,;:\\\"/[]?=";
+
+} // class MimeType
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/MimeTypeParameterList.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,404 @@
+/*
+ * Copyright (c) 1997, 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 java.awt.datatransfer;
+
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+
+/**
+ * An object that encapsulates the parameter list of a MimeType
+ * as defined in RFC 2045 and 2046.
+ *
+ * @author jeff.dunn@eng.sun.com
+ */
+class MimeTypeParameterList implements Cloneable {
+
+    /**
+     * Default constructor.
+     */
+    public MimeTypeParameterList() {
+        parameters = new Hashtable<>();
+    }
+
+    public MimeTypeParameterList(String rawdata)
+        throws MimeTypeParseException
+    {
+        parameters = new Hashtable<>();
+
+        //    now parse rawdata
+        parse(rawdata);
+    }
+
+    public int hashCode() {
+        int code = Integer.MAX_VALUE/45; // "random" value for empty lists
+        String paramName = null;
+        Enumeration<String> enum_ = this.getNames();
+
+        while (enum_.hasMoreElements()) {
+            paramName = enum_.nextElement();
+            code += paramName.hashCode();
+            code += this.get(paramName).hashCode();
+        }
+
+        return code;
+    } // hashCode()
+
+    /**
+     * Two parameter lists are considered equal if they have exactly
+     * the same set of parameter names and associated values. The
+     * order of the parameters is not considered.
+     */
+    public boolean equals(Object thatObject) {
+        //System.out.println("MimeTypeParameterList.equals("+this+","+thatObject+")");
+        if (!(thatObject instanceof MimeTypeParameterList)) {
+            return false;
+        }
+        MimeTypeParameterList that = (MimeTypeParameterList)thatObject;
+        if (this.size() != that.size()) {
+            return false;
+        }
+        String name = null;
+        String thisValue = null;
+        String thatValue = null;
+        Set<Map.Entry<String, String>> entries = parameters.entrySet();
+        Iterator<Map.Entry<String, String>> iterator = entries.iterator();
+        Map.Entry<String, String> entry = null;
+        while (iterator.hasNext()) {
+            entry = iterator.next();
+            name = entry.getKey();
+            thisValue = entry.getValue();
+            thatValue = that.parameters.get(name);
+            if ((thisValue == null) || (thatValue == null)) {
+                // both null -> equal, only one null -> not equal
+                if (thisValue != thatValue) {
+                    return false;
+                }
+            } else if (!thisValue.equals(thatValue)) {
+                return false;
+            }
+        } // while iterator
+
+        return true;
+    } // equals()
+
+    /**
+     * A routine for parsing the parameter list out of a String.
+     */
+    protected void parse(String rawdata) throws MimeTypeParseException {
+        int length = rawdata.length();
+        if(length > 0) {
+            int currentIndex = skipWhiteSpace(rawdata, 0);
+            int lastIndex = 0;
+
+            if(currentIndex < length) {
+                char currentChar = rawdata.charAt(currentIndex);
+                while ((currentIndex < length) && (currentChar == ';')) {
+                    String name;
+                    String value;
+                    boolean foundit;
+
+                    //    eat the ';'
+                    ++currentIndex;
+
+                    //    now parse the parameter name
+
+                    //    skip whitespace
+                    currentIndex = skipWhiteSpace(rawdata, currentIndex);
+
+                    if(currentIndex < length) {
+                        //    find the end of the token char run
+                        lastIndex = currentIndex;
+                        currentChar = rawdata.charAt(currentIndex);
+                        while((currentIndex < length) && isTokenChar(currentChar)) {
+                            ++currentIndex;
+                            currentChar = rawdata.charAt(currentIndex);
+                        }
+                        name = rawdata.substring(lastIndex, currentIndex).toLowerCase();
+
+                        //    now parse the '=' that separates the name from the value
+
+                        //    skip whitespace
+                        currentIndex = skipWhiteSpace(rawdata, currentIndex);
+
+                        if((currentIndex < length) && (rawdata.charAt(currentIndex) == '='))  {
+                            //    eat it and parse the parameter value
+                            ++currentIndex;
+
+                            //    skip whitespace
+                            currentIndex = skipWhiteSpace(rawdata, currentIndex);
+
+                            if(currentIndex < length) {
+                                //    now find out whether or not we have a quoted value
+                                currentChar = rawdata.charAt(currentIndex);
+                                if(currentChar == '"') {
+                                    //    yup it's quoted so eat it and capture the quoted string
+                                    ++currentIndex;
+                                    lastIndex = currentIndex;
+
+                                    if(currentIndex < length) {
+                                        //    find the next unescaped quote
+                                        foundit = false;
+                                        while((currentIndex < length) && !foundit) {
+                                            currentChar = rawdata.charAt(currentIndex);
+                                            if(currentChar == '\\') {
+                                                //    found an escape sequence so pass this and the next character
+                                                currentIndex += 2;
+                                            } else if(currentChar == '"') {
+                                                //    found it!
+                                                foundit = true;
+                                            } else {
+                                                ++currentIndex;
+                                            }
+                                        }
+                                        if(currentChar == '"') {
+                                            value = unquote(rawdata.substring(lastIndex, currentIndex));
+                                            //    eat the quote
+                                            ++currentIndex;
+                                        } else {
+                                            throw new MimeTypeParseException("Encountered unterminated quoted parameter value.");
+                                        }
+                                    } else {
+                                        throw new MimeTypeParseException("Encountered unterminated quoted parameter value.");
+                                    }
+                                } else if(isTokenChar(currentChar)) {
+                                    //    nope it's an ordinary token so it ends with a non-token char
+                                    lastIndex = currentIndex;
+                                    foundit = false;
+                                    while((currentIndex < length) && !foundit) {
+                                        currentChar = rawdata.charAt(currentIndex);
+
+                                        if(isTokenChar(currentChar)) {
+                                            ++currentIndex;
+                                        } else {
+                                            foundit = true;
+                                        }
+                                    }
+                                    value = rawdata.substring(lastIndex, currentIndex);
+                                } else {
+                                    //    it ain't a value
+                                    throw new MimeTypeParseException("Unexpected character encountered at index " + currentIndex);
+                                }
+
+                                //    now put the data into the hashtable
+                                parameters.put(name, value);
+                            } else {
+                                throw new MimeTypeParseException("Couldn't find a value for parameter named " + name);
+                            }
+                        } else {
+                            throw new MimeTypeParseException("Couldn't find the '=' that separates a parameter name from its value.");
+                        }
+                    } else {
+                        throw new MimeTypeParseException("Couldn't find parameter name");
+                    }
+
+                    //    setup the next iteration
+                    currentIndex = skipWhiteSpace(rawdata, currentIndex);
+                    if(currentIndex < length) {
+                        currentChar = rawdata.charAt(currentIndex);
+                    }
+                }
+                if(currentIndex < length) {
+                    throw new MimeTypeParseException("More characters encountered in input than expected.");
+                }
+            }
+        }
+    }
+
+    /**
+     * return the number of name-value pairs in this list.
+     */
+    public int size() {
+        return parameters.size();
+    }
+
+    /**
+     * Determine whether or not this list is empty.
+     */
+    public boolean isEmpty() {
+        return parameters.isEmpty();
+    }
+
+    /**
+     * Retrieve the value associated with the given name, or null if there
+     * is no current association.
+     */
+    public String get(String name) {
+        return parameters.get(name.trim().toLowerCase());
+    }
+
+    /**
+     * Set the value to be associated with the given name, replacing
+     * any previous association.
+     */
+    public void set(String name, String value) {
+        parameters.put(name.trim().toLowerCase(), value);
+    }
+
+    /**
+     * Remove any value associated with the given name.
+     */
+    public void remove(String name) {
+        parameters.remove(name.trim().toLowerCase());
+    }
+
+    /**
+     * Retrieve an enumeration of all the names in this list.
+     */
+    public Enumeration<String> getNames() {
+        return parameters.keys();
+    }
+
+    public String toString() {
+        // Heuristic: 8 characters per field
+        StringBuilder buffer = new StringBuilder(parameters.size() * 16);
+
+        Enumeration<String> keys = parameters.keys();
+        while(keys.hasMoreElements())
+        {
+            buffer.append("; ");
+
+            String key = keys.nextElement();
+            buffer.append(key);
+            buffer.append('=');
+               buffer.append(quote(parameters.get(key)));
+        }
+
+        return buffer.toString();
+    }
+
+    /**
+     * @return a clone of this object
+     */
+    @SuppressWarnings("unchecked") // Cast from clone
+     public Object clone() {
+         MimeTypeParameterList newObj = null;
+         try {
+             newObj = (MimeTypeParameterList)super.clone();
+         } catch (CloneNotSupportedException cannotHappen) {
+         }
+         newObj.parameters = (Hashtable<String, String>)parameters.clone();
+         return newObj;
+     }
+
+    private Hashtable<String, String> parameters;
+
+    //    below here be scary parsing related things
+
+    /**
+     * Determine whether or not a given character belongs to a legal token.
+     */
+    private static boolean isTokenChar(char c) {
+        return ((c > 040) && (c < 0177)) && (TSPECIALS.indexOf(c) < 0);
+    }
+
+    /**
+     * return the index of the first non white space character in
+     * rawdata at or after index i.
+     */
+    private static int skipWhiteSpace(String rawdata, int i) {
+        int length = rawdata.length();
+        if (i < length) {
+            char c =  rawdata.charAt(i);
+            while ((i < length) && Character.isWhitespace(c)) {
+                ++i;
+                c = rawdata.charAt(i);
+            }
+        }
+
+        return i;
+    }
+
+    /**
+     * A routine that knows how and when to quote and escape the given value.
+     */
+    private static String quote(String value) {
+        boolean needsQuotes = false;
+
+        //    check to see if we actually have to quote this thing
+        int length = value.length();
+        for(int i = 0; (i < length) && !needsQuotes; ++i) {
+            needsQuotes = !isTokenChar(value.charAt(i));
+        }
+
+        if(needsQuotes) {
+            StringBuilder buffer = new StringBuilder((int)(length * 1.5));
+
+            //    add the initial quote
+            buffer.append('"');
+
+            //    add the properly escaped text
+            for(int i = 0; i < length; ++i) {
+                char c = value.charAt(i);
+                if((c == '\\') || (c == '"')) {
+                    buffer.append('\\');
+                }
+                buffer.append(c);
+            }
+
+            //    add the closing quote
+            buffer.append('"');
+
+            return buffer.toString();
+        }
+        else
+        {
+            return value;
+        }
+    }
+
+    /**
+     * A routine that knows how to strip the quotes and escape sequences from the given value.
+     */
+    private static String unquote(String value) {
+        int valueLength = value.length();
+        StringBuilder buffer = new StringBuilder(valueLength);
+
+        boolean escaped = false;
+        for(int i = 0; i < valueLength; ++i) {
+            char currentChar = value.charAt(i);
+            if(!escaped && (currentChar != '\\')) {
+                buffer.append(currentChar);
+            } else if(escaped) {
+                buffer.append(currentChar);
+                escaped = false;
+            } else {
+                escaped = true;
+            }
+        }
+
+        return buffer.toString();
+    }
+
+    /**
+     * A string that holds all the special chars.
+     */
+    private static final String TSPECIALS = "()<>@,;:\\\"/[]?=";
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/MimeTypeParseException.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 1997, 2006, 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;
+
+
+/**
+ *    A class to encapsulate MimeType parsing related exceptions
+ *
+ * @serial exclude
+ * @since 1.3
+ */
+public class MimeTypeParseException extends Exception {
+
+    // use serialVersionUID from JDK 1.2.2 for interoperability
+    private static final long serialVersionUID = -5604407764691570741L;
+
+    /**
+     * Constructs a MimeTypeParseException with no specified detail message.
+     */
+    public MimeTypeParseException() {
+        super();
+    }
+
+    /**
+     * Constructs a MimeTypeParseException with the specified detail message.
+     *
+     * @param   s   the detail message.
+     */
+    public MimeTypeParseException(String s) {
+        super(s);
+    }
+} // class MimeTypeParseException
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/StringSelection.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,143 @@
+/*
+ * 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 java.io.*;
+
+
+/**
+ * A <code>Transferable</code> which implements the capability required
+ * to transfer a <code>String</code>.
+ *
+ * This <code>Transferable</code> properly supports
+ * <code>DataFlavor.stringFlavor</code>
+ * and all equivalent flavors. Support for
+ * <code>DataFlavor.plainTextFlavor</code>
+ * and all equivalent flavors is <b>deprecated</b>. No other
+ * <code>DataFlavor</code>s are supported.
+ *
+ * @see java.awt.datatransfer.DataFlavor#stringFlavor
+ * @see java.awt.datatransfer.DataFlavor#plainTextFlavor
+ */
+public class StringSelection implements Transferable, ClipboardOwner {
+
+    private static final int STRING = 0;
+    private static final int PLAIN_TEXT = 1;
+
+    @SuppressWarnings("deprecation")
+    private static final DataFlavor[] flavors = {
+        DataFlavor.stringFlavor,
+        DataFlavor.plainTextFlavor // deprecated
+    };
+
+    private String data;
+
+    /**
+     * Creates a <code>Transferable</code> capable of transferring
+     * the specified <code>String</code>.
+     * @param data the string to be transferred
+     */
+    public StringSelection(String data) {
+        this.data = data;
+    }
+
+    /**
+     * Returns an array of flavors in which this <code>Transferable</code>
+     * can provide the data. <code>DataFlavor.stringFlavor</code>
+     * is properly supported.
+     * Support for <code>DataFlavor.plainTextFlavor</code> is
+     * <b>deprecated</b>.
+     *
+     * @return an array of length two, whose elements are <code>DataFlavor.
+     *         stringFlavor</code> and <code>DataFlavor.plainTextFlavor</code>
+     */
+    public DataFlavor[] getTransferDataFlavors() {
+        // returning flavors itself would allow client code to modify
+        // our internal behavior
+        return flavors.clone();
+    }
+
+    /**
+     * Returns whether the requested flavor is supported by this
+     * <code>Transferable</code>.
+     *
+     * @param flavor the requested flavor for the data
+     * @return true if <code>flavor</code> is equal to
+     *   <code>DataFlavor.stringFlavor</code> or
+     *   <code>DataFlavor.plainTextFlavor</code>; false if <code>flavor</code>
+     *   is not one of the above flavors
+     * @throws NullPointerException if flavor is <code>null</code>
+     */
+    public boolean isDataFlavorSupported(DataFlavor flavor) {
+        // JCK Test StringSelection0003: if 'flavor' is null, throw NPE
+        for (int i = 0; i < flavors.length; i++) {
+            if (flavor.equals(flavors[i])) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /**
+     * Returns the <code>Transferable</code>'s data in the requested
+     * <code>DataFlavor</code> if possible. If the desired flavor is
+     * <code>DataFlavor.stringFlavor</code>, or an equivalent flavor,
+     * the <code>String</code> representing the selection is
+     * returned. If the desired flavor is
+     * <code>DataFlavor.plainTextFlavor</code>,
+     * or an equivalent flavor, a <code>Reader</code> is returned.
+     * <b>Note:</b> The behavior of this method for
+     * <code>DataFlavor.plainTextFlavor</code>
+     * and equivalent <code>DataFlavor</code>s is inconsistent with the
+     * definition of <code>DataFlavor.plainTextFlavor</code>.
+     *
+     * @param flavor the requested flavor for the data
+     * @return the data in the requested flavor, as outlined above
+     * @throws UnsupportedFlavorException if the requested data flavor is
+     *         not equivalent to either <code>DataFlavor.stringFlavor</code>
+     *         or <code>DataFlavor.plainTextFlavor</code>
+     * @throws IOException if an IOException occurs while retrieving the data.
+     *         By default, StringSelection never throws this exception, but a
+     *         subclass may.
+     * @throws NullPointerException if flavor is <code>null</code>
+     * @see java.io.Reader
+     */
+    public Object getTransferData(DataFlavor flavor)
+        throws UnsupportedFlavorException, IOException
+    {
+        // JCK Test StringSelection0007: if 'flavor' is null, throw NPE
+        if (flavor.equals(flavors[STRING])) {
+            return (Object)data;
+        } else if (flavor.equals(flavors[PLAIN_TEXT])) {
+            return new StringReader(data == null ? "" : data);
+        } else {
+            throw new UnsupportedFlavorException(flavor);
+        }
+    }
+
+    public void lostOwnership(Clipboard clipboard, Transferable contents) {
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/SystemFlavorMap.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,1094 @@
+/*
+ * 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
+ * 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.datatransfer.DesktopDatatransferService;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.lang.ref.SoftReference;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+
+/**
+ * The SystemFlavorMap is a configurable map between "natives" (Strings), which
+ * correspond to platform-specific data formats, and "flavors" (DataFlavors),
+ * which correspond to platform-independent MIME types. This mapping is used
+ * by the data transfer subsystem to transfer data between Java and native
+ * applications, and between Java applications in separate VMs.
+ *
+ * @since 1.2
+ */
+public final class SystemFlavorMap implements FlavorMap, FlavorTable {
+
+    /**
+     * Constant prefix used to tag Java types converted to native platform
+     * type.
+     */
+    private static String JavaMIME = "JAVA_DATAFLAVOR:";
+
+    private static final Object FLAVOR_MAP_KEY = new Object();
+
+    /**
+     * The list of valid, decoded text flavor representation classes, in order
+     * from best to worst.
+     */
+    private static final String[] UNICODE_TEXT_CLASSES = {
+        "java.io.Reader", "java.lang.String", "java.nio.CharBuffer", "\"[C\""
+    };
+
+    /**
+     * The list of valid, encoded text flavor representation classes, in order
+     * from best to worst.
+     */
+    private static final String[] ENCODED_TEXT_CLASSES = {
+        "java.io.InputStream", "java.nio.ByteBuffer", "\"[B\""
+    };
+
+    /**
+     * A String representing text/plain MIME type.
+     */
+    private static final String TEXT_PLAIN_BASE_TYPE = "text/plain";
+
+    /**
+     * A String representing text/html MIME type.
+     */
+    private static final String HTML_TEXT_BASE_TYPE = "text/html";
+
+    /**
+     * Maps native Strings to Lists of DataFlavors (or base type Strings for
+     * text DataFlavors).
+     * Do not use the field directly, use getNativeToFlavor() instead.
+     */
+    private final Map<String, LinkedHashSet<DataFlavor>> nativeToFlavor = new HashMap<>();
+
+    /**
+     * Accessor to nativeToFlavor map.  Since we use lazy initialization we must
+     * use this accessor instead of direct access to the field which may not be
+     * initialized yet.  This method will initialize the field if needed.
+     *
+     * @return nativeToFlavor
+     */
+    private Map<String, LinkedHashSet<DataFlavor>> getNativeToFlavor() {
+        if (!isMapInitialized) {
+            initSystemFlavorMap();
+        }
+        return nativeToFlavor;
+    }
+
+    /**
+     * Maps DataFlavors (or base type Strings for text DataFlavors) to Lists of
+     * native Strings.
+     * Do not use the field directly, use getFlavorToNative() instead.
+     */
+    private final Map<DataFlavor, LinkedHashSet<String>> flavorToNative = new HashMap<>();
+
+    /**
+     * Accessor to flavorToNative map.  Since we use lazy initialization we must
+     * use this accessor instead of direct access to the field which may not be
+     * initialized yet.  This method will initialize the field if needed.
+     *
+     * @return flavorToNative
+     */
+    private synchronized Map<DataFlavor, LinkedHashSet<String>> getFlavorToNative() {
+        if (!isMapInitialized) {
+            initSystemFlavorMap();
+        }
+        return flavorToNative;
+    }
+
+    /**
+     * Maps a text DataFlavor primary mime-type to the native. Used only to store
+     * standard mappings registered in the flavormap.properties
+     * Do not use this field directly, use getTextTypeToNative() instead.
+     */
+    private Map<String, LinkedHashSet<String>> textTypeToNative = new HashMap<>();
+
+    /**
+     * Shows if the object has been initialized.
+     */
+    private boolean isMapInitialized = false;
+
+    /**
+     * An accessor to textTypeToNative map.  Since we use lazy initialization we
+     * must use this accessor instead of direct access to the field which may not
+     * be initialized yet. This method will initialize the field if needed.
+     *
+     * @return textTypeToNative
+     */
+    private synchronized Map<String, LinkedHashSet<String>> getTextTypeToNative() {
+        if (!isMapInitialized) {
+            initSystemFlavorMap();
+            // From this point the map should not be modified
+            textTypeToNative = Collections.unmodifiableMap(textTypeToNative);
+        }
+        return textTypeToNative;
+    }
+
+    /**
+     * Caches the result of getNativesForFlavor(). Maps DataFlavors to
+     * SoftReferences which reference LinkedHashSet of String natives.
+     */
+    private final SoftCache<DataFlavor, String> nativesForFlavorCache = new SoftCache<>();
+
+    /**
+     * Caches the result getFlavorsForNative(). Maps String natives to
+     * SoftReferences which reference LinkedHashSet of DataFlavors.
+     */
+    private final SoftCache<String, DataFlavor> flavorsForNativeCache = new SoftCache<>();
+
+    /**
+     * Dynamic mapping generation used for text mappings should not be applied
+     * to the DataFlavors and String natives for which the mappings have been
+     * explicitly specified with setFlavorsForNative() or
+     * setNativesForFlavor(). This keeps all such keys.
+     */
+    private Set<Object> disabledMappingGenerationKeys = new HashSet<>();
+
+    /**
+     * Returns the default FlavorMap for this thread's ClassLoader.
+     *
+     * @return the default FlavorMap for this thread's ClassLoader
+     */
+    public static FlavorMap getDefaultFlavorMap() {
+        return DataFlavorUtil.getDesktopService().getFlavorMap(SystemFlavorMap::new);
+    }
+
+    private SystemFlavorMap() {
+    }
+
+    /**
+     * Initializes a SystemFlavorMap by reading flavormap.properties
+     * For thread-safety must be called under lock on this.
+     */
+    private void initSystemFlavorMap() {
+        if (isMapInitialized) {
+            return;
+        }
+        isMapInitialized = true;
+
+        InputStream is = SystemFlavorMap.class.getResourceAsStream("/sun/datatransfer/resources/flavormap.properties");
+        if (is == null) {
+            throw new InternalError("Default flavor mapping not found");
+        }
+
+        try (InputStreamReader isr = new InputStreamReader(is);
+             BufferedReader reader = new BufferedReader(isr)) {
+            String line;
+            while ((line = reader.readLine()) != null) {
+                line = line.trim();
+                if (line.startsWith("#") || line.isEmpty()) continue;
+                while (line.endsWith("\\")) {
+                    line = line.substring(0, line.length() - 1) + reader.readLine().trim();
+                }
+                int delimiterPosition = line.indexOf('=');
+                String key = line.substring(0, delimiterPosition).replace("\\ ", " ");
+                String[] values = line.substring(delimiterPosition + 1, line.length()).split(",");
+                for (String value : values) {
+                    try {
+                        value = loadConvert(value);
+                        MimeType mime = new MimeType(value);
+                        if ("text".equals(mime.getPrimaryType())) {
+                            String charset = mime.getParameter("charset");
+                            if (DataFlavorUtil.doesSubtypeSupportCharset(mime.getSubType(), charset))
+                            {
+                                // We need to store the charset and eoln
+                                // parameters, if any, so that the
+                                // DataTransferer will have this information
+                                // for conversion into the native format.
+                                DesktopDatatransferService desktopService =
+                                        DataFlavorUtil.getDesktopService();
+                                if (desktopService.isDesktopPresent()) {
+                                    desktopService.registerTextFlavorProperties(
+                                            key, charset,
+                                            mime.getParameter("eoln"),
+                                            mime.getParameter("terminators"));
+                                }
+                            }
+
+                            // But don't store any of these parameters in the
+                            // DataFlavor itself for any text natives (even
+                            // non-charset ones). The SystemFlavorMap will
+                            // synthesize the appropriate mappings later.
+                            mime.removeParameter("charset");
+                            mime.removeParameter("class");
+                            mime.removeParameter("eoln");
+                            mime.removeParameter("terminators");
+                            value = mime.toString();
+                        }
+                    } catch (MimeTypeParseException e) {
+                        e.printStackTrace();
+                        continue;
+                    }
+
+                    DataFlavor flavor;
+                    try {
+                        flavor = new DataFlavor(value);
+                    } catch (Exception e) {
+                        try {
+                            flavor = new DataFlavor(value, null);
+                        } catch (Exception ee) {
+                            ee.printStackTrace();
+                            continue;
+                        }
+                    }
+
+                    final LinkedHashSet<DataFlavor> dfs = new LinkedHashSet<>();
+                    dfs.add(flavor);
+
+                    if ("text".equals(flavor.getPrimaryType())) {
+                        dfs.addAll(convertMimeTypeToDataFlavors(value));
+                        store(flavor.mimeType.getBaseType(), key, getTextTypeToNative());
+                    }
+
+                    for (DataFlavor df : dfs) {
+                        store(df, key, getFlavorToNative());
+                        store(key, df, getNativeToFlavor());
+                    }
+                }
+            }
+        } catch (IOException e) {
+            throw new InternalError("Error reading default flavor mapping", e);
+        }
+    }
+
+    // Copied from java.util.Properties
+    private static String loadConvert(String theString) {
+        char aChar;
+        int len = theString.length();
+        StringBuilder outBuffer = new StringBuilder(len);
+
+        for (int x = 0; x < len; ) {
+            aChar = theString.charAt(x++);
+            if (aChar == '\\') {
+                aChar = theString.charAt(x++);
+                if (aChar == 'u') {
+                    // Read the xxxx
+                    int value = 0;
+                    for (int i = 0; i < 4; i++) {
+                        aChar = theString.charAt(x++);
+                        switch (aChar) {
+                            case '0': case '1': case '2': case '3': case '4':
+                            case '5': case '6': case '7': case '8': case '9': {
+                                value = (value << 4) + aChar - '0';
+                                break;
+                            }
+                            case 'a': case 'b': case 'c':
+                            case 'd': case 'e': case 'f': {
+                                value = (value << 4) + 10 + aChar - 'a';
+                                break;
+                            }
+                            case 'A': case 'B': case 'C':
+                            case 'D': case 'E': case 'F': {
+                                value = (value << 4) + 10 + aChar - 'A';
+                                break;
+                            }
+                            default: {
+                                throw new IllegalArgumentException(
+                                        "Malformed \\uxxxx encoding.");
+                            }
+                        }
+                    }
+                    outBuffer.append((char)value);
+                } else {
+                    if (aChar == 't') {
+                        aChar = '\t';
+                    } else if (aChar == 'r') {
+                        aChar = '\r';
+                    } else if (aChar == 'n') {
+                        aChar = '\n';
+                    } else if (aChar == 'f') {
+                        aChar = '\f';
+                    }
+                    outBuffer.append(aChar);
+                }
+            } else {
+                outBuffer.append(aChar);
+            }
+        }
+        return outBuffer.toString();
+    }
+
+    /**
+     * Stores the listed object under the specified hash key in map. Unlike a
+     * standard map, the listed object will not replace any object already at
+     * the appropriate Map location, but rather will be appended to a List
+     * stored in that location.
+     */
+    private <H, L> void store(H hashed, L listed, Map<H, LinkedHashSet<L>> map) {
+        LinkedHashSet<L> list = map.get(hashed);
+        if (list == null) {
+            list = new LinkedHashSet<>(1);
+            map.put(hashed, list);
+        }
+        if (!list.contains(listed)) {
+            list.add(listed);
+        }
+    }
+
+    /**
+     * Semantically equivalent to 'nativeToFlavor.get(nat)'. This method
+     * handles the case where 'nat' is not found in 'nativeToFlavor'. In that
+     * case, a new DataFlavor is synthesized, stored, and returned, if and
+     * only if the specified native is encoded as a Java MIME type.
+     */
+    private LinkedHashSet<DataFlavor> nativeToFlavorLookup(String nat) {
+        LinkedHashSet<DataFlavor> flavors = getNativeToFlavor().get(nat);
+
+        if (nat != null && !disabledMappingGenerationKeys.contains(nat)) {
+            DesktopDatatransferService desktopService = DataFlavorUtil.getDesktopService();
+            if (desktopService.isDesktopPresent()) {
+                LinkedHashSet<DataFlavor> platformFlavors =
+                        desktopService.getPlatformMappingsForNative(nat);
+                if (!platformFlavors.isEmpty()) {
+                    if (flavors != null) {
+                        // Prepending the platform-specific mappings ensures
+                        // that the flavors added with
+                        // addFlavorForUnencodedNative() are at the end of
+                        // list.
+                        platformFlavors.addAll(flavors);
+                    }
+                    flavors = platformFlavors;
+                }
+            }
+        }
+
+        if (flavors == null && isJavaMIMEType(nat)) {
+            String decoded = decodeJavaMIMEType(nat);
+            DataFlavor flavor = null;
+
+            try {
+                flavor = new DataFlavor(decoded);
+            } catch (Exception e) {
+                System.err.println("Exception \"" + e.getClass().getName() +
+                                   ": " + e.getMessage()  +
+                                   "\"while constructing DataFlavor for: " +
+                                   decoded);
+            }
+
+            if (flavor != null) {
+                flavors = new LinkedHashSet<>(1);
+                getNativeToFlavor().put(nat, flavors);
+                flavors.add(flavor);
+                flavorsForNativeCache.remove(nat);
+
+                LinkedHashSet<String> natives = getFlavorToNative().get(flavor);
+                if (natives == null) {
+                    natives = new LinkedHashSet<>(1);
+                    getFlavorToNative().put(flavor, natives);
+                }
+                natives.add(nat);
+                nativesForFlavorCache.remove(flavor);
+            }
+        }
+
+        return (flavors != null) ? flavors : new LinkedHashSet<>(0);
+    }
+
+    /**
+     * Semantically equivalent to 'flavorToNative.get(flav)'. This method
+     * handles the case where 'flav' is not found in 'flavorToNative' depending
+     * on the value of passes 'synthesize' parameter. If 'synthesize' is
+     * SYNTHESIZE_IF_NOT_FOUND a native is synthesized, stored, and returned by
+     * encoding the DataFlavor's MIME type. Otherwise an empty List is returned
+     * and 'flavorToNative' remains unaffected.
+     */
+    private LinkedHashSet<String> flavorToNativeLookup(final DataFlavor flav,
+                                                       final boolean synthesize) {
+
+        LinkedHashSet<String> natives = getFlavorToNative().get(flav);
+
+        if (flav != null && !disabledMappingGenerationKeys.contains(flav)) {
+            DesktopDatatransferService desktopService = DataFlavorUtil.getDesktopService();
+            if (desktopService.isDesktopPresent()) {
+                LinkedHashSet<String> platformNatives =
+                        desktopService.getPlatformMappingsForFlavor(flav);
+                if (!platformNatives.isEmpty()) {
+                    if (natives != null) {
+                        // Prepend the platform-specific mappings to ensure
+                        // that the natives added with
+                        // addUnencodedNativeForFlavor() are at the end of
+                        // list.
+                        platformNatives.addAll(natives);
+                    }
+                    natives = platformNatives;
+                }
+            }
+        }
+
+        if (natives == null) {
+            if (synthesize) {
+                String encoded = encodeDataFlavor(flav);
+                natives = new LinkedHashSet<>(1);
+                getFlavorToNative().put(flav, natives);
+                natives.add(encoded);
+
+                LinkedHashSet<DataFlavor> flavors = getNativeToFlavor().get(encoded);
+                if (flavors == null) {
+                    flavors = new LinkedHashSet<>(1);
+                    getNativeToFlavor().put(encoded, flavors);
+                }
+                flavors.add(flav);
+
+                nativesForFlavorCache.remove(flav);
+                flavorsForNativeCache.remove(encoded);
+            } else {
+                natives = new LinkedHashSet<>(0);
+            }
+        }
+
+        return new LinkedHashSet<>(natives);
+    }
+
+    /**
+     * Returns a <code>List</code> of <code>String</code> natives to which the
+     * specified <code>DataFlavor</code> can be translated by the data transfer
+     * subsystem. The <code>List</code> will be sorted from best native to
+     * worst. That is, the first native will best reflect data in the specified
+     * flavor to the underlying native platform.
+     * <p>
+     * If the specified <code>DataFlavor</code> is previously unknown to the
+     * data transfer subsystem and the data transfer subsystem is unable to
+     * translate this <code>DataFlavor</code> to any existing native, then
+     * invoking this method will establish a
+     * mapping in both directions between the specified <code>DataFlavor</code>
+     * and an encoded version of its MIME type as its native.
+     *
+     * @param flav the <code>DataFlavor</code> whose corresponding natives
+     *        should be returned. If <code>null</code> is specified, all
+     *        natives currently known to the data transfer subsystem are
+     *        returned in a non-deterministic order.
+     * @return a <code>java.util.List</code> of <code>java.lang.String</code>
+     *         objects which are platform-specific representations of platform-
+     *         specific data formats
+     *
+     * @see #encodeDataFlavor
+     * @since 1.4
+     */
+    @Override
+    public synchronized List<String> getNativesForFlavor(DataFlavor flav) {
+        LinkedHashSet<String> retval = nativesForFlavorCache.check(flav);
+        if (retval != null) {
+            return new ArrayList<>(retval);
+        }
+
+        if (flav == null) {
+            retval = new LinkedHashSet<>(getNativeToFlavor().keySet());
+        } else if (disabledMappingGenerationKeys.contains(flav)) {
+            // In this case we shouldn't synthesize a native for this flavor,
+            // since its mappings were explicitly specified.
+            retval = flavorToNativeLookup(flav, false);
+        } else if (DataFlavorUtil.isFlavorCharsetTextType(flav)) {
+            retval = new LinkedHashSet<>(0);
+
+            // For text/* flavors, flavor-to-native mappings specified in
+            // flavormap.properties are stored per flavor's base type.
+            if ("text".equals(flav.getPrimaryType())) {
+                LinkedHashSet<String> textTypeNatives =
+                        getTextTypeToNative().get(flav.mimeType.getBaseType());
+                if (textTypeNatives != null) {
+                    retval.addAll(textTypeNatives);
+                }
+            }
+
+            // Also include text/plain natives, but don't duplicate Strings
+            LinkedHashSet<String> textTypeNatives =
+                    getTextTypeToNative().get(TEXT_PLAIN_BASE_TYPE);
+            if (textTypeNatives != null) {
+                retval.addAll(textTypeNatives);
+            }
+
+            if (retval.isEmpty()) {
+                retval = flavorToNativeLookup(flav, true);
+            } else {
+                // In this branch it is guaranteed that natives explicitly
+                // listed for flav's MIME type were added with
+                // addUnencodedNativeForFlavor(), so they have lower priority.
+                retval.addAll(flavorToNativeLookup(flav, false));
+            }
+        } else if (DataFlavorUtil.isFlavorNoncharsetTextType(flav)) {
+            retval = getTextTypeToNative().get(flav.mimeType.getBaseType());
+
+            if (retval == null || retval.isEmpty()) {
+                retval = flavorToNativeLookup(flav, true);
+            } else {
+                // In this branch it is guaranteed that natives explicitly
+                // listed for flav's MIME type were added with
+                // addUnencodedNativeForFlavor(), so they have lower priority.
+                retval.addAll(flavorToNativeLookup(flav, false));
+            }
+        } else {
+            retval = flavorToNativeLookup(flav, true);
+        }
+
+        nativesForFlavorCache.put(flav, retval);
+        // Create a copy, because client code can modify the returned list.
+        return new ArrayList<>(retval);
+    }
+
+    /**
+     * Returns a <code>List</code> of <code>DataFlavor</code>s to which the
+     * specified <code>String</code> native can be translated by the data
+     * transfer subsystem. The <code>List</code> will be sorted from best
+     * <code>DataFlavor</code> to worst. That is, the first
+     * <code>DataFlavor</code> will best reflect data in the specified
+     * native to a Java application.
+     * <p>
+     * If the specified native is previously unknown to the data transfer
+     * subsystem, and that native has been properly encoded, then invoking this
+     * method will establish a mapping in both directions between the specified
+     * native and a <code>DataFlavor</code> whose MIME type is a decoded
+     * version of the native.
+     * <p>
+     * If the specified native is not a properly encoded native and the
+     * mappings for this native have not been altered with
+     * <code>setFlavorsForNative</code>, then the contents of the
+     * <code>List</code> is platform dependent, but <code>null</code>
+     * cannot be returned.
+     *
+     * @param nat the native whose corresponding <code>DataFlavor</code>s
+     *        should be returned. If <code>null</code> is specified, all
+     *        <code>DataFlavor</code>s currently known to the data transfer
+     *        subsystem are returned in a non-deterministic order.
+     * @return a <code>java.util.List</code> of <code>DataFlavor</code>
+     *         objects into which platform-specific data in the specified,
+     *         platform-specific native can be translated
+     *
+     * @see #encodeJavaMIMEType
+     * @since 1.4
+     */
+    @Override
+    public synchronized List<DataFlavor> getFlavorsForNative(String nat) {
+        LinkedHashSet<DataFlavor> returnValue = flavorsForNativeCache.check(nat);
+        if (returnValue != null) {
+            return new ArrayList<>(returnValue);
+        } else {
+            returnValue = new LinkedHashSet<>();
+        }
+
+        if (nat == null) {
+            for (String n : getNativesForFlavor(null)) {
+                returnValue.addAll(getFlavorsForNative(n));
+            }
+        } else {
+            final LinkedHashSet<DataFlavor> flavors = nativeToFlavorLookup(nat);
+            if (disabledMappingGenerationKeys.contains(nat)) {
+                return new ArrayList<>(flavors);
+            }
+
+            final LinkedHashSet<DataFlavor> flavorsWithSynthesized =
+                    nativeToFlavorLookup(nat);
+
+            for (DataFlavor df : flavorsWithSynthesized) {
+                returnValue.add(df);
+                if ("text".equals(df.getPrimaryType())) {
+                    String baseType = df.mimeType.getBaseType();
+                    returnValue.addAll(convertMimeTypeToDataFlavors(baseType));
+                }
+            }
+        }
+        flavorsForNativeCache.put(nat, returnValue);
+        return new ArrayList<>(returnValue);
+    }
+
+    @SuppressWarnings("deprecation")
+    private static Set<DataFlavor> convertMimeTypeToDataFlavors(
+        final String baseType) {
+
+        final Set<DataFlavor> returnValue = new LinkedHashSet<>();
+
+        String subType = null;
+
+        try {
+            final MimeType mimeType = new MimeType(baseType);
+            subType = mimeType.getSubType();
+        } catch (MimeTypeParseException mtpe) {
+            // Cannot happen, since we checked all mappings
+            // on load from flavormap.properties.
+        }
+
+        if (DataFlavorUtil.doesSubtypeSupportCharset(subType, null)) {
+            if (TEXT_PLAIN_BASE_TYPE.equals(baseType))
+            {
+                returnValue.add(DataFlavor.stringFlavor);
+            }
+
+            for (String unicodeClassName : UNICODE_TEXT_CLASSES) {
+                final String mimeType = baseType + ";charset=Unicode;class=" +
+                                            unicodeClassName;
+
+                final LinkedHashSet<String> mimeTypes =
+                    handleHtmlMimeTypes(baseType, mimeType);
+                for (String mt : mimeTypes) {
+                    DataFlavor toAdd = null;
+                    try {
+                        toAdd = new DataFlavor(mt);
+                    } catch (ClassNotFoundException cannotHappen) {
+                    }
+                    returnValue.add(toAdd);
+                }
+            }
+
+            for (String charset : DataFlavorUtil.standardEncodings()) {
+
+                for (String encodedTextClass : ENCODED_TEXT_CLASSES) {
+                    final String mimeType =
+                            baseType + ";charset=" + charset +
+                            ";class=" + encodedTextClass;
+
+                    final LinkedHashSet<String> mimeTypes =
+                        handleHtmlMimeTypes(baseType, mimeType);
+
+                    for (String mt : mimeTypes) {
+
+                        DataFlavor df = null;
+
+                        try {
+                            df = new DataFlavor(mt);
+                            // Check for equality to plainTextFlavor so
+                            // that we can ensure that the exact charset of
+                            // plainTextFlavor, not the canonical charset
+                            // or another equivalent charset with a
+                            // different name, is used.
+                            if (df.equals(DataFlavor.plainTextFlavor)) {
+                                df = DataFlavor.plainTextFlavor;
+                            }
+                        } catch (ClassNotFoundException cannotHappen) {
+                        }
+
+                        returnValue.add(df);
+                    }
+                }
+            }
+
+            if (TEXT_PLAIN_BASE_TYPE.equals(baseType))
+            {
+                returnValue.add(DataFlavor.plainTextFlavor);
+            }
+        } else {
+            // Non-charset text natives should be treated as
+            // opaque, 8-bit data in any of its various
+            // representations.
+            for (String encodedTextClassName : ENCODED_TEXT_CLASSES) {
+                DataFlavor toAdd = null;
+                try {
+                    toAdd = new DataFlavor(baseType +
+                         ";class=" + encodedTextClassName);
+                } catch (ClassNotFoundException cannotHappen) {
+                }
+                returnValue.add(toAdd);
+            }
+        }
+        return returnValue;
+    }
+
+    private static final String [] htmlDocumentTypes =
+            new String [] {"all", "selection", "fragment"};
+
+    private static LinkedHashSet<String> handleHtmlMimeTypes(String baseType,
+                                                             String mimeType) {
+
+        LinkedHashSet<String> returnValues = new LinkedHashSet<>();
+
+        if (HTML_TEXT_BASE_TYPE.equals(baseType)) {
+            for (String documentType : htmlDocumentTypes) {
+                returnValues.add(mimeType + ";document=" + documentType);
+            }
+        } else {
+            returnValues.add(mimeType);
+        }
+
+        return returnValues;
+    }
+
+    /**
+     * Returns a <code>Map</code> of the specified <code>DataFlavor</code>s to
+     * their most preferred <code>String</code> native. Each native value will
+     * be the same as the first native in the List returned by
+     * <code>getNativesForFlavor</code> for the specified flavor.
+     * <p>
+     * If a specified <code>DataFlavor</code> is previously unknown to the
+     * data transfer subsystem, then invoking this method will establish a
+     * mapping in both directions between the specified <code>DataFlavor</code>
+     * and an encoded version of its MIME type as its native.
+     *
+     * @param flavors an array of <code>DataFlavor</code>s which will be the
+     *        key set of the returned <code>Map</code>. If <code>null</code> is
+     *        specified, a mapping of all <code>DataFlavor</code>s known to the
+     *        data transfer subsystem to their most preferred
+     *        <code>String</code> natives will be returned.
+     * @return a <code>java.util.Map</code> of <code>DataFlavor</code>s to
+     *         <code>String</code> natives
+     *
+     * @see #getNativesForFlavor
+     * @see #encodeDataFlavor
+     */
+    @Override
+    public synchronized Map<DataFlavor,String> getNativesForFlavors(DataFlavor[] flavors)
+    {
+        // Use getNativesForFlavor to generate extra natives for text flavors
+        // and stringFlavor
+
+        if (flavors == null) {
+            List<DataFlavor> flavor_list = getFlavorsForNative(null);
+            flavors = new DataFlavor[flavor_list.size()];
+            flavor_list.toArray(flavors);
+        }
+
+        Map<DataFlavor, String> retval = new HashMap<>(flavors.length, 1.0f);
+        for (DataFlavor flavor : flavors) {
+            List<String> natives = getNativesForFlavor(flavor);
+            String nat = (natives.isEmpty()) ? null : natives.get(0);
+            retval.put(flavor, nat);
+        }
+
+        return retval;
+    }
+
+    /**
+     * Returns a <code>Map</code> of the specified <code>String</code> natives
+     * to their most preferred <code>DataFlavor</code>. Each
+     * <code>DataFlavor</code> value will be the same as the first
+     * <code>DataFlavor</code> in the List returned by
+     * <code>getFlavorsForNative</code> for the specified native.
+     * <p>
+     * If a specified native is previously unknown to the data transfer
+     * subsystem, and that native has been properly encoded, then invoking this
+     * method will establish a mapping in both directions between the specified
+     * native and a <code>DataFlavor</code> whose MIME type is a decoded
+     * version of the native.
+     *
+     * @param natives an array of <code>String</code>s which will be the
+     *        key set of the returned <code>Map</code>. If <code>null</code> is
+     *        specified, a mapping of all supported <code>String</code> natives
+     *        to their most preferred <code>DataFlavor</code>s will be
+     *        returned.
+     * @return a <code>java.util.Map</code> of <code>String</code> natives to
+     *         <code>DataFlavor</code>s
+     *
+     * @see #getFlavorsForNative
+     * @see #encodeJavaMIMEType
+     */
+    @Override
+    public synchronized Map<String,DataFlavor> getFlavorsForNatives(String[] natives)
+    {
+        // Use getFlavorsForNative to generate extra flavors for text natives
+        if (natives == null) {
+            List<String> nativesList = getNativesForFlavor(null);
+            natives = new String[nativesList.size()];
+            nativesList.toArray(natives);
+        }
+
+        Map<String, DataFlavor> retval = new HashMap<>(natives.length, 1.0f);
+        for (String aNative : natives) {
+            List<DataFlavor> flavors = getFlavorsForNative(aNative);
+            DataFlavor flav = (flavors.isEmpty())? null : flavors.get(0);
+            retval.put(aNative, flav);
+        }
+        return retval;
+    }
+
+    /**
+     * Adds a mapping from the specified <code>DataFlavor</code> (and all
+     * <code>DataFlavor</code>s equal to the specified <code>DataFlavor</code>)
+     * to the specified <code>String</code> native.
+     * Unlike <code>getNativesForFlavor</code>, the mapping will only be
+     * established in one direction, and the native will not be encoded. To
+     * establish a two-way mapping, call
+     * <code>addFlavorForUnencodedNative</code> as well. The new mapping will
+     * be of lower priority than any existing mapping.
+     * This method has no effect if a mapping from the specified or equal
+     * <code>DataFlavor</code> to the specified <code>String</code> native
+     * already exists.
+     *
+     * @param flav the <code>DataFlavor</code> key for the mapping
+     * @param nat the <code>String</code> native value for the mapping
+     * @throws NullPointerException if flav or nat is <code>null</code>
+     *
+     * @see #addFlavorForUnencodedNative
+     * @since 1.4
+     */
+    public synchronized void addUnencodedNativeForFlavor(DataFlavor flav,
+                                                         String nat) {
+        Objects.requireNonNull(nat, "Null native not permitted");
+        Objects.requireNonNull(flav, "Null flavor not permitted");
+
+        LinkedHashSet<String> natives = getFlavorToNative().get(flav);
+        if (natives == null) {
+            natives = new LinkedHashSet<>(1);
+            getFlavorToNative().put(flav, natives);
+        }
+        natives.add(nat);
+        nativesForFlavorCache.remove(flav);
+    }
+
+    /**
+     * Discards the current mappings for the specified <code>DataFlavor</code>
+     * and all <code>DataFlavor</code>s equal to the specified
+     * <code>DataFlavor</code>, and creates new mappings to the
+     * specified <code>String</code> natives.
+     * Unlike <code>getNativesForFlavor</code>, the mappings will only be
+     * established in one direction, and the natives will not be encoded. To
+     * establish two-way mappings, call <code>setFlavorsForNative</code>
+     * as well. The first native in the array will represent the highest
+     * priority mapping. Subsequent natives will represent mappings of
+     * decreasing priority.
+     * <p>
+     * If the array contains several elements that reference equal
+     * <code>String</code> natives, this method will establish new mappings
+     * for the first of those elements and ignore the rest of them.
+     * <p>
+     * It is recommended that client code not reset mappings established by the
+     * data transfer subsystem. This method should only be used for
+     * application-level mappings.
+     *
+     * @param flav the <code>DataFlavor</code> key for the mappings
+     * @param natives the <code>String</code> native values for the mappings
+     * @throws NullPointerException if flav or natives is <code>null</code>
+     *         or if natives contains <code>null</code> elements
+     *
+     * @see #setFlavorsForNative
+     * @since 1.4
+     */
+    public synchronized void setNativesForFlavor(DataFlavor flav,
+                                                 String[] natives) {
+        Objects.requireNonNull(natives, "Null natives not permitted");
+        Objects.requireNonNull(flav, "Null flavors not permitted");
+
+        getFlavorToNative().remove(flav);
+        for (String aNative : natives) {
+            addUnencodedNativeForFlavor(flav, aNative);
+        }
+        disabledMappingGenerationKeys.add(flav);
+        nativesForFlavorCache.remove(flav);
+    }
+
+    /**
+     * Adds a mapping from a single <code>String</code> native to a single
+     * <code>DataFlavor</code>. Unlike <code>getFlavorsForNative</code>, the
+     * mapping will only be established in one direction, and the native will
+     * not be encoded. To establish a two-way mapping, call
+     * <code>addUnencodedNativeForFlavor</code> as well. The new mapping will
+     * be of lower priority than any existing mapping.
+     * This method has no effect if a mapping from the specified
+     * <code>String</code> native to the specified or equal
+     * <code>DataFlavor</code> already exists.
+     *
+     * @param nat the <code>String</code> native key for the mapping
+     * @param flav the <code>DataFlavor</code> value for the mapping
+     * @throws NullPointerException if nat or flav is <code>null</code>
+     *
+     * @see #addUnencodedNativeForFlavor
+     * @since 1.4
+     */
+    public synchronized void addFlavorForUnencodedNative(String nat,
+                                                         DataFlavor flav) {
+        Objects.requireNonNull(nat, "Null native not permitted");
+        Objects.requireNonNull(flav, "Null flavor not permitted");
+
+        LinkedHashSet<DataFlavor> flavors = getNativeToFlavor().get(nat);
+        if (flavors == null) {
+            flavors = new LinkedHashSet<>(1);
+            getNativeToFlavor().put(nat, flavors);
+        }
+        flavors.add(flav);
+        flavorsForNativeCache.remove(nat);
+    }
+
+    /**
+     * Discards the current mappings for the specified <code>String</code>
+     * native, and creates new mappings to the specified
+     * <code>DataFlavor</code>s. Unlike <code>getFlavorsForNative</code>, the
+     * mappings will only be established in one direction, and the natives need
+     * not be encoded. To establish two-way mappings, call
+     * <code>setNativesForFlavor</code> as well. The first
+     * <code>DataFlavor</code> in the array will represent the highest priority
+     * mapping. Subsequent <code>DataFlavor</code>s will represent mappings of
+     * decreasing priority.
+     * <p>
+     * If the array contains several elements that reference equal
+     * <code>DataFlavor</code>s, this method will establish new mappings
+     * for the first of those elements and ignore the rest of them.
+     * <p>
+     * It is recommended that client code not reset mappings established by the
+     * data transfer subsystem. This method should only be used for
+     * application-level mappings.
+     *
+     * @param nat the <code>String</code> native key for the mappings
+     * @param flavors the <code>DataFlavor</code> values for the mappings
+     * @throws NullPointerException if nat or flavors is <code>null</code>
+     *         or if flavors contains <code>null</code> elements
+     *
+     * @see #setNativesForFlavor
+     * @since 1.4
+     */
+    public synchronized void setFlavorsForNative(String nat,
+                                                 DataFlavor[] flavors) {
+        Objects.requireNonNull(nat, "Null native not permitted");
+        Objects.requireNonNull(flavors, "Null flavors not permitted");
+
+        getNativeToFlavor().remove(nat);
+        for (DataFlavor flavor : flavors) {
+            addFlavorForUnencodedNative(nat, flavor);
+        }
+        disabledMappingGenerationKeys.add(nat);
+        flavorsForNativeCache.remove(nat);
+    }
+
+    /**
+     * Encodes a MIME type for use as a <code>String</code> native. The format
+     * of an encoded representation of a MIME type is implementation-dependent.
+     * The only restrictions are:
+     * <ul>
+     * <li>The encoded representation is <code>null</code> if and only if the
+     * MIME type <code>String</code> is <code>null</code>.</li>
+     * <li>The encoded representations for two non-<code>null</code> MIME type
+     * <code>String</code>s are equal if and only if these <code>String</code>s
+     * are equal according to <code>String.equals(Object)</code>.</li>
+     * </ul>
+     * <p>
+     * The reference implementation of this method returns the specified MIME
+     * type <code>String</code> prefixed with <code>JAVA_DATAFLAVOR:</code>.
+     *
+     * @param mimeType the MIME type to encode
+     * @return the encoded <code>String</code>, or <code>null</code> if
+     *         mimeType is <code>null</code>
+     */
+    public static String encodeJavaMIMEType(String mimeType) {
+        return (mimeType != null)
+            ? JavaMIME + mimeType
+            : null;
+    }
+
+    /**
+     * Encodes a <code>DataFlavor</code> for use as a <code>String</code>
+     * native. The format of an encoded <code>DataFlavor</code> is
+     * implementation-dependent. The only restrictions are:
+     * <ul>
+     * <li>The encoded representation is <code>null</code> if and only if the
+     * specified <code>DataFlavor</code> is <code>null</code> or its MIME type
+     * <code>String</code> is <code>null</code>.</li>
+     * <li>The encoded representations for two non-<code>null</code>
+     * <code>DataFlavor</code>s with non-<code>null</code> MIME type
+     * <code>String</code>s are equal if and only if the MIME type
+     * <code>String</code>s of these <code>DataFlavor</code>s are equal
+     * according to <code>String.equals(Object)</code>.</li>
+     * </ul>
+     * <p>
+     * The reference implementation of this method returns the MIME type
+     * <code>String</code> of the specified <code>DataFlavor</code> prefixed
+     * with <code>JAVA_DATAFLAVOR:</code>.
+     *
+     * @param flav the <code>DataFlavor</code> to encode
+     * @return the encoded <code>String</code>, or <code>null</code> if
+     *         flav is <code>null</code> or has a <code>null</code> MIME type
+     */
+    public static String encodeDataFlavor(DataFlavor flav) {
+        return (flav != null)
+            ? SystemFlavorMap.encodeJavaMIMEType(flav.getMimeType())
+            : null;
+    }
+
+    /**
+     * Returns whether the specified <code>String</code> is an encoded Java
+     * MIME type.
+     *
+     * @param str the <code>String</code> to test
+     * @return <code>true</code> if the <code>String</code> is encoded;
+     *         <code>false</code> otherwise
+     */
+    public static boolean isJavaMIMEType(String str) {
+        return (str != null && str.startsWith(JavaMIME, 0));
+    }
+
+    /**
+     * Decodes a <code>String</code> native for use as a Java MIME type.
+     *
+     * @param nat the <code>String</code> to decode
+     * @return the decoded Java MIME type, or <code>null</code> if nat is not
+     *         an encoded <code>String</code> native
+     */
+    public static String decodeJavaMIMEType(String nat) {
+        return (isJavaMIMEType(nat))
+            ? nat.substring(JavaMIME.length(), nat.length()).trim()
+            : null;
+    }
+
+    /**
+     * Decodes a <code>String</code> native for use as a
+     * <code>DataFlavor</code>.
+     *
+     * @param nat the <code>String</code> to decode
+     * @return the decoded <code>DataFlavor</code>, or <code>null</code> if
+     *         nat is not an encoded <code>String</code> native
+     * @throws ClassNotFoundException if the class of the data flavor
+     * is not loaded
+     */
+    public static DataFlavor decodeDataFlavor(String nat)
+        throws ClassNotFoundException
+    {
+        String retval_str = SystemFlavorMap.decodeJavaMIMEType(nat);
+        return (retval_str != null)
+            ? new DataFlavor(retval_str)
+            : null;
+    }
+
+    private static final class SoftCache<K, V> {
+        Map<K, SoftReference<LinkedHashSet<V>>> cache;
+
+        public void put(K key, LinkedHashSet<V> value) {
+            if (cache == null) {
+                cache = new HashMap<>(1);
+            }
+            cache.put(key, new SoftReference<>(value));
+        }
+
+        public void remove(K key) {
+            if (cache == null) return;
+            cache.remove(null);
+            cache.remove(key);
+        }
+
+        public LinkedHashSet<V> check(K key) {
+            if (cache == null) return null;
+            SoftReference<LinkedHashSet<V>> ref = cache.get(key);
+            if (ref != null) {
+                return ref.get();
+            }
+            return null;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/Transferable.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,74 @@
+/*
+ * 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 java.io.IOException;
+
+/**
+ * Defines the interface for classes that can be used to provide data
+ * for a transfer operation.
+ * <p>
+ * For information on using data transfer with Swing, see
+ * <a href="http://docs.oracle.com/javase/tutorial/uiswing/dnd/index.html">
+ * How to Use Drag and Drop and Data Transfer</a>,
+ * a section in <em>The Java Tutorial</em>, for more information.
+ *
+ * @author      Amy Fowler
+ */
+
+public interface Transferable {
+
+    /**
+     * Returns an array of DataFlavor objects indicating the flavors the data
+     * can be provided in.  The array should be ordered according to preference
+     * for providing the data (from most richly descriptive to least descriptive).
+     * @return an array of data flavors in which this data can be transferred
+     */
+    public DataFlavor[] getTransferDataFlavors();
+
+    /**
+     * Returns whether or not the specified data flavor is supported for
+     * this object.
+     * @param flavor the requested flavor for the data
+     * @return boolean indicating whether or not the data flavor is supported
+     */
+    public boolean isDataFlavorSupported(DataFlavor flavor);
+
+    /**
+     * Returns an object which represents the data to be transferred.  The class
+     * of the object returned is defined by the representation class of the flavor.
+     *
+     * @param flavor the requested flavor for the data
+     * @return an object which represents the data to be transferred
+     * @see DataFlavor#getRepresentationClass
+     * @exception IOException                if the data is no longer available
+     *              in the requested flavor.
+     * @exception UnsupportedFlavorException if the requested data flavor is
+     *              not supported.
+     */
+    public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException;
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/UnsupportedFlavorException.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 1996, 2000, 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;
+
+/**
+ * Signals that the requested data is not supported in this flavor.
+ * @see Transferable#getTransferData
+ *
+ * @author      Amy Fowler
+ */
+public class UnsupportedFlavorException extends Exception {
+
+    /*
+     * JDK 1.1 serialVersionUID
+     */
+    private static final long serialVersionUID = 5383814944251665601L;
+
+    /**
+     * Constructs an UnsupportedFlavorException.
+     *
+     * @param flavor the flavor object which caused the exception. May
+     *        be <code>null</code>.
+     */
+    public UnsupportedFlavorException(DataFlavor flavor) {
+        super((flavor != null) ? flavor.getHumanPresentableName() : null);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/package.html	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,64 @@
+<!--
+ Copyright (c) 1998, 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.
+-->
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head><title></title></head>
+<body bgcolor="white">
+
+Provides interfaces and classes for transferring data
+between and within applications.  It defines the notion of a
+"transferable" object, which is an object capable of being
+transferred between or within applications. An object identifies
+itself as being transferable by implementing the Transferable
+interface.
+<p>
+It also provides a clipboard mechanism, which is an object that
+temporarily holds a transferable object that can be transferred
+between or within an application. The clipboard is typically used
+for copy and paste operations. Although it is possible to create
+a clipboard to use within an application, most applications will
+use the system clipboard to ensure the data can be transferred
+across applications running on the platform.
+
+<!--
+<h2>Package Specification</h2>
+
+##### FILL IN ANY SPECS NEEDED BY JAVA COMPATIBILITY KIT #####
+<ul>
+  <li><a href="">##### REFER TO ANY FRAMEMAKER SPECIFICATION HERE #####</a>
+</ul>
+
+<h2>Related Documentation</h2>
+
+For overviews, tutorials, examples, guides, and tool documentation, please see:
+<ul>
+  <li><a href="">##### REFER TO NON-SPEC DOCUMENTATION HERE #####</a>
+</ul>
+-->
+
+@since 1.1
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.datatransfer/share/classes/sun/datatransfer/DataFlavorUtil.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,841 @@
+/*
+ * Copyright (c) 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 sun.datatransfer;
+
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.FlavorMap;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Reader;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.nio.ByteBuffer;
+import java.nio.CharBuffer;
+import java.nio.charset.Charset;
+import java.nio.charset.IllegalCharsetNameException;
+import java.nio.charset.StandardCharsets;
+import java.nio.charset.UnsupportedCharsetException;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.ServiceLoader;
+import java.util.Set;
+import java.util.SortedSet;
+import java.util.TreeSet;
+import java.util.function.Supplier;
+
+
+/**
+ * Utility class with different datatransfer helper functions
+ *
+ * @see 1.9
+ */
+public class DataFlavorUtil {
+
+    private DataFlavorUtil() {
+        // Avoid instantiation
+    }
+
+    private static Comparator<String> getCharsetComparator() {
+       return CharsetComparator.INSTANCE;
+    }
+
+    public static Comparator<DataFlavor> getDataFlavorComparator() {
+       return DataFlavorComparator.INSTANCE;
+    }
+
+    public static Comparator<Long> getIndexOrderComparator(Map<Long, Integer> indexMap) {
+        return new IndexOrderComparator(indexMap);
+    }
+
+    public static Comparator<DataFlavor> getTextFlavorComparator() {
+        return TextFlavorComparator.INSTANCE;
+    }
+
+    /**
+     * Tracks whether a particular text/* MIME type supports the charset
+     * parameter. The Map is initialized with all of the standard MIME types
+     * listed in the DataFlavor.selectBestTextFlavor method comment. Additional
+     * entries may be added during the life of the JRE for text/<other> types.
+     */
+    private static final Map<String, Boolean> textMIMESubtypeCharsetSupport;
+
+    static {
+        Map<String, Boolean> tempMap = new HashMap<>(17);
+        tempMap.put("sgml", Boolean.TRUE);
+        tempMap.put("xml", Boolean.TRUE);
+        tempMap.put("html", Boolean.TRUE);
+        tempMap.put("enriched", Boolean.TRUE);
+        tempMap.put("richtext", Boolean.TRUE);
+        tempMap.put("uri-list", Boolean.TRUE);
+        tempMap.put("directory", Boolean.TRUE);
+        tempMap.put("css", Boolean.TRUE);
+        tempMap.put("calendar", Boolean.TRUE);
+        tempMap.put("plain", Boolean.TRUE);
+        tempMap.put("rtf", Boolean.FALSE);
+        tempMap.put("tab-separated-values", Boolean.FALSE);
+        tempMap.put("t140", Boolean.FALSE);
+        tempMap.put("rfc822-headers", Boolean.FALSE);
+        tempMap.put("parityfec", Boolean.FALSE);
+        textMIMESubtypeCharsetSupport = Collections.synchronizedMap(tempMap);
+    }
+
+    /**
+     * Lazy initialization of Standard Encodings.
+     */
+    private static class StandardEncodingsHolder {
+        private static final SortedSet<String> standardEncodings = load();
+
+        private static SortedSet<String> load() {
+            final SortedSet<String> tempSet = new TreeSet<>(getCharsetComparator().reversed());
+            tempSet.add("US-ASCII");
+            tempSet.add("ISO-8859-1");
+            tempSet.add("UTF-8");
+            tempSet.add("UTF-16BE");
+            tempSet.add("UTF-16LE");
+            tempSet.add("UTF-16");
+            tempSet.add(Charset.defaultCharset().name());
+            return Collections.unmodifiableSortedSet(tempSet);
+        }
+    }
+
+    /**
+     * Returns a {@code SortedSet} of Strings which are a total order of the standard
+     * character sets supported by the JRE. The ordering follows the same principles as
+     * {@link java.awt.datatransfer.DataFlavor#selectBestTextFlavor(java.awt.datatransfer.DataFlavor[])}.
+     * So as to avoid loading all available character converters, optional, non-standard,
+     * character sets are not included.
+     */
+    public static Set<String> standardEncodings() {
+        return StandardEncodingsHolder.standardEncodings;
+    }
+
+    /**
+     * Converts an arbitrary text encoding to its canonical name.
+     */
+    public static String canonicalName(String encoding) {
+        if (encoding == null) {
+            return null;
+        }
+        try {
+            return Charset.forName(encoding).name();
+        } catch (IllegalCharsetNameException icne) {
+            return encoding;
+        } catch (UnsupportedCharsetException uce) {
+            return encoding;
+        }
+    }
+
+    /**
+     * Tests only whether the flavor's MIME type supports the charset
+     * parameter. Must only be called for flavors with a primary type of
+     * "text".
+     */
+    public static boolean doesSubtypeSupportCharset(DataFlavor flavor) {
+        String subType = flavor.getSubType();
+        if (subType == null) {
+            return false;
+        }
+
+        Boolean support = textMIMESubtypeCharsetSupport.get(subType);
+
+        if (support != null) {
+            return support;
+        }
+
+        boolean ret_val = (flavor.getParameter("charset") != null);
+        textMIMESubtypeCharsetSupport.put(subType, ret_val);
+        return ret_val;
+    }
+    public static boolean doesSubtypeSupportCharset(String subType,
+                                                    String charset)
+    {
+        Boolean support = textMIMESubtypeCharsetSupport.get(subType);
+
+        if (support != null) {
+            return support;
+        }
+
+        boolean ret_val = (charset != null);
+        textMIMESubtypeCharsetSupport.put(subType, ret_val);
+        return ret_val;
+    }
+
+
+    /**
+     * Returns whether this flavor is a text type which supports the
+     * 'charset' parameter.
+     */
+    public static boolean isFlavorCharsetTextType(DataFlavor flavor) {
+        // Although stringFlavor doesn't actually support the charset
+        // parameter (because its primary MIME type is not "text"), it should
+        // be treated as though it does. stringFlavor is semantically
+        // equivalent to "text/plain" data.
+        if (DataFlavor.stringFlavor.equals(flavor)) {
+            return true;
+        }
+
+        if (!"text".equals(flavor.getPrimaryType()) ||
+                !doesSubtypeSupportCharset(flavor))
+        {
+            return false;
+        }
+
+        Class<?> rep_class = flavor.getRepresentationClass();
+
+        if (flavor.isRepresentationClassReader() ||
+                String.class.equals(rep_class) ||
+                flavor.isRepresentationClassCharBuffer() ||
+                char[].class.equals(rep_class))
+        {
+            return true;
+        }
+
+        if (!(flavor.isRepresentationClassInputStream() ||
+                flavor.isRepresentationClassByteBuffer() ||
+                byte[].class.equals(rep_class))) {
+            return false;
+        }
+
+        String charset = flavor.getParameter("charset");
+
+        // null equals default encoding which is always supported
+        return (charset == null) || isEncodingSupported(charset);
+    }
+
+    /**
+     * Returns whether this flavor is a text type which does not support the
+     * 'charset' parameter.
+     */
+    public static boolean isFlavorNoncharsetTextType(DataFlavor flavor) {
+        if (!"text".equals(flavor.getPrimaryType()) || doesSubtypeSupportCharset(flavor)) {
+            return false;
+        }
+
+        return (flavor.isRepresentationClassInputStream() ||
+                flavor.isRepresentationClassByteBuffer() ||
+                byte[].class.equals(flavor.getRepresentationClass()));
+    }
+
+    /**
+     * If the specified flavor is a text flavor which supports the "charset"
+     * parameter, then this method returns that parameter, or the default
+     * charset if no such parameter was specified at construction. For non-
+     * text DataFlavors, and for non-charset text flavors, this method returns
+     * null.
+     */
+    public static String getTextCharset(DataFlavor flavor) {
+        if (!isFlavorCharsetTextType(flavor)) {
+            return null;
+        }
+
+        String encoding = flavor.getParameter("charset");
+
+        return (encoding != null) ? encoding : Charset.defaultCharset().name();
+    }
+
+    /**
+     * Determines whether this JRE can both encode and decode text in the
+     * specified encoding.
+     */
+    private static boolean isEncodingSupported(String encoding) {
+        if (encoding == null) {
+            return false;
+        }
+        try {
+            return Charset.isSupported(encoding);
+        } catch (IllegalCharsetNameException icne) {
+            return false;
+        }
+    }
+
+    /**
+     * Helper method to compare two objects by their Integer indices in the
+     * given map. If the map doesn't contain an entry for either of the
+     * objects, the fallback index will be used for the object instead.
+     *
+     * @param indexMap the map which maps objects into Integer indexes.
+     * @param obj1 the first object to be compared.
+     * @param obj2 the second object to be compared.
+     * @param fallbackIndex the Integer to be used as a fallback index.
+     * @return a negative integer, zero, or a positive integer as the
+     *             first object is mapped to a less, equal to, or greater
+     *             index than the second.
+     */
+    static <T> int compareIndices(Map<T, Integer> indexMap,
+                                  T obj1, T obj2,
+                                  Integer fallbackIndex) {
+        Integer index1 = indexMap.getOrDefault(obj1, fallbackIndex);
+        Integer index2 = indexMap.getOrDefault(obj2, fallbackIndex);
+        return index1.compareTo(index2);
+    }
+
+    /**
+     * An IndexedComparator which compares two String charsets. The comparison
+     * follows the rules outlined in DataFlavor.selectBestTextFlavor. In order
+     * to ensure that non-Unicode, non-ASCII, non-default charsets are sorted
+     * in alphabetical order, charsets are not automatically converted to their
+     * canonical forms.
+     */
+    private static class CharsetComparator implements Comparator<String> {
+        static final CharsetComparator INSTANCE = new CharsetComparator();
+
+        private static final Map<String, Integer> charsets;
+
+        private static final Integer DEFAULT_CHARSET_INDEX = 2;
+        private static final Integer OTHER_CHARSET_INDEX = 1;
+        private static final Integer WORST_CHARSET_INDEX = 0;
+        private static final Integer UNSUPPORTED_CHARSET_INDEX = Integer.MIN_VALUE;
+
+        private static final String UNSUPPORTED_CHARSET = "UNSUPPORTED";
+
+        static {
+            Map<String, Integer> charsetsMap = new HashMap<>(8, 1.0f);
+
+            // we prefer Unicode charsets
+            charsetsMap.put(canonicalName("UTF-16LE"), 4);
+            charsetsMap.put(canonicalName("UTF-16BE"), 5);
+            charsetsMap.put(canonicalName("UTF-8"), 6);
+            charsetsMap.put(canonicalName("UTF-16"), 7);
+
+            // US-ASCII is the worst charset supported
+            charsetsMap.put(canonicalName("US-ASCII"), WORST_CHARSET_INDEX);
+
+            charsetsMap.putIfAbsent(Charset.defaultCharset().name(), DEFAULT_CHARSET_INDEX);
+
+            charsetsMap.put(UNSUPPORTED_CHARSET, UNSUPPORTED_CHARSET_INDEX);
+
+            charsets = Collections.unmodifiableMap(charsetsMap);
+        }
+
+        /**
+         * Compares charsets. Returns a negative integer, zero, or a positive
+         * integer as the first charset is worse than, equal to, or better than
+         * the second.
+         * <p>
+         * Charsets are ordered according to the following rules:
+         * <ul>
+         * <li>All unsupported charsets are equal.
+         * <li>Any unsupported charset is worse than any supported charset.
+         * <li>Unicode charsets, such as "UTF-16", "UTF-8", "UTF-16BE" and
+         *     "UTF-16LE", are considered best.
+         * <li>After them, platform default charset is selected.
+         * <li>"US-ASCII" is the worst of supported charsets.
+         * <li>For all other supported charsets, the lexicographically less
+         *     one is considered the better.
+         * </ul>
+         *
+         * @param charset1 the first charset to be compared
+         * @param charset2 the second charset to be compared.
+         * @return a negative integer, zero, or a positive integer as the
+         *             first argument is worse, equal to, or better than the
+         *             second.
+         */
+        public int compare(String charset1, String charset2) {
+            charset1 = getEncoding(charset1);
+            charset2 = getEncoding(charset2);
+
+            int comp = compareIndices(charsets, charset1, charset2, OTHER_CHARSET_INDEX);
+
+            if (comp == 0) {
+                return charset2.compareTo(charset1);
+            }
+
+            return comp;
+        }
+
+        /**
+         * Returns encoding for the specified charset according to the
+         * following rules:
+         * <ul>
+         * <li>If the charset is <code>null</code>, then <code>null</code> will
+         *     be returned.
+         * <li>Iff the charset specifies an encoding unsupported by this JRE,
+         *     <code>UNSUPPORTED_CHARSET</code> will be returned.
+         * <li>If the charset specifies an alias name, the corresponding
+         *     canonical name will be returned iff the charset is a known
+         *     Unicode, ASCII, or default charset.
+         * </ul>
+         *
+         * @param charset the charset.
+         * @return an encoding for this charset.
+         */
+        static String getEncoding(String charset) {
+            if (charset == null) {
+                return null;
+            } else if (!isEncodingSupported(charset)) {
+                return UNSUPPORTED_CHARSET;
+            } else {
+                // Only convert to canonical form if the charset is one
+                // of the charsets explicitly listed in the known charsets
+                // map. This will happen only for Unicode, ASCII, or default
+                // charsets.
+                String canonicalName = canonicalName(charset);
+                return (charsets.containsKey(canonicalName))
+                        ? canonicalName
+                        : charset;
+            }
+        }
+    }
+
+    /**
+     * An IndexedComparator which compares two DataFlavors. For text flavors,
+     * the comparison follows the rules outlined in
+     * DataFlavor.selectBestTextFlavor. For non-text flavors, unknown
+     * application MIME types are preferred, followed by known
+     * application/x-java-* MIME types. Unknown application types are preferred
+     * because if the user provides his own data flavor, it will likely be the
+     * most descriptive one. For flavors which are otherwise equal, the
+     * flavors' string representation are compared in the alphabetical order.
+     */
+    private static class DataFlavorComparator implements Comparator<DataFlavor> {
+
+        static final DataFlavorComparator INSTANCE = new DataFlavorComparator();
+
+        private static final Map<String, Integer> exactTypes;
+        private static final Map<String, Integer> primaryTypes;
+        private static final Map<Class<?>, Integer> nonTextRepresentations;
+        private static final Map<String, Integer> textTypes;
+        private static final Map<Class<?>, Integer> decodedTextRepresentations;
+        private static final Map<Class<?>, Integer> encodedTextRepresentations;
+
+        private static final Integer UNKNOWN_OBJECT_LOSES = Integer.MIN_VALUE;
+        private static final Integer UNKNOWN_OBJECT_WINS = Integer.MAX_VALUE;
+
+        static {
+            {
+                Map<String, Integer> exactTypesMap = new HashMap<>(4, 1.0f);
+
+                // application/x-java-* MIME types
+                exactTypesMap.put("application/x-java-file-list", 0);
+                exactTypesMap.put("application/x-java-serialized-object", 1);
+                exactTypesMap.put("application/x-java-jvm-local-objectref", 2);
+                exactTypesMap.put("application/x-java-remote-object", 3);
+
+                exactTypes = Collections.unmodifiableMap(exactTypesMap);
+            }
+
+            {
+                Map<String, Integer> primaryTypesMap = new HashMap<>(1, 1.0f);
+
+                primaryTypesMap.put("application", 0);
+
+                primaryTypes = Collections.unmodifiableMap(primaryTypesMap);
+            }
+
+            {
+                Map<Class<?>, Integer> nonTextRepresentationsMap = new HashMap<>(3, 1.0f);
+
+                nonTextRepresentationsMap.put(java.io.InputStream.class, 0);
+                nonTextRepresentationsMap.put(java.io.Serializable.class, 1);
+
+                nonTextRepresentationsMap.put(RMI.remoteClass(), 2);
+
+                nonTextRepresentations = Collections.unmodifiableMap(nonTextRepresentationsMap);
+            }
+
+            {
+                Map<String, Integer> textTypesMap = new HashMap<>(16, 1.0f);
+
+                // plain text
+                textTypesMap.put("text/plain", 0);
+
+                // stringFlavor
+                textTypesMap.put("application/x-java-serialized-object", 1);
+
+                // misc
+                textTypesMap.put("text/calendar", 2);
+                textTypesMap.put("text/css", 3);
+                textTypesMap.put("text/directory", 4);
+                textTypesMap.put("text/parityfec", 5);
+                textTypesMap.put("text/rfc822-headers", 6);
+                textTypesMap.put("text/t140", 7);
+                textTypesMap.put("text/tab-separated-values", 8);
+                textTypesMap.put("text/uri-list", 9);
+
+                // enriched
+                textTypesMap.put("text/richtext", 10);
+                textTypesMap.put("text/enriched", 11);
+                textTypesMap.put("text/rtf", 12);
+
+                // markup
+                textTypesMap.put("text/html", 13);
+                textTypesMap.put("text/xml", 14);
+                textTypesMap.put("text/sgml", 15);
+
+                textTypes = Collections.unmodifiableMap(textTypesMap);
+            }
+
+            {
+                Map<Class<?>, Integer> decodedTextRepresentationsMap = new HashMap<>(4, 1.0f);
+
+                decodedTextRepresentationsMap.put(char[].class, 0);
+                decodedTextRepresentationsMap.put(CharBuffer.class, 1);
+                decodedTextRepresentationsMap.put(String.class, 2);
+                decodedTextRepresentationsMap.put(Reader.class, 3);
+
+                decodedTextRepresentations =
+                        Collections.unmodifiableMap(decodedTextRepresentationsMap);
+            }
+
+            {
+                Map<Class<?>, Integer> encodedTextRepresentationsMap = new HashMap<>(3, 1.0f);
+
+                encodedTextRepresentationsMap.put(byte[].class, 0);
+                encodedTextRepresentationsMap.put(ByteBuffer.class, 1);
+                encodedTextRepresentationsMap.put(InputStream.class, 2);
+
+                encodedTextRepresentations =
+                        Collections.unmodifiableMap(encodedTextRepresentationsMap);
+            }
+        }
+
+
+        public int compare(DataFlavor flavor1, DataFlavor flavor2) {
+            if (flavor1.equals(flavor2)) {
+                return 0;
+            }
+
+            int comp;
+
+            String primaryType1 = flavor1.getPrimaryType();
+            String subType1 = flavor1.getSubType();
+            String mimeType1 = primaryType1 + "/" + subType1;
+            Class<?> class1 = flavor1.getRepresentationClass();
+
+            String primaryType2 = flavor2.getPrimaryType();
+            String subType2 = flavor2.getSubType();
+            String mimeType2 = primaryType2 + "/" + subType2;
+            Class<?> class2 = flavor2.getRepresentationClass();
+
+            if (flavor1.isFlavorTextType() && flavor2.isFlavorTextType()) {
+                // First, compare MIME types
+                comp = compareIndices(textTypes, mimeType1, mimeType2, UNKNOWN_OBJECT_LOSES);
+                if (comp != 0) {
+                    return comp;
+                }
+
+                // Only need to test one flavor because they both have the
+                // same MIME type. Also don't need to worry about accidentally
+                // passing stringFlavor because either
+                //   1. Both flavors are stringFlavor, in which case the
+                //      equality test at the top of the function succeeded.
+                //   2. Only one flavor is stringFlavor, in which case the MIME
+                //      type comparison returned a non-zero value.
+                if (doesSubtypeSupportCharset(flavor1)) {
+                    // Next, prefer the decoded text representations of Reader,
+                    // String, CharBuffer, and [C, in that order.
+                    comp = compareIndices(decodedTextRepresentations, class1,
+                            class2, UNKNOWN_OBJECT_LOSES);
+                    if (comp != 0) {
+                        return comp;
+                    }
+
+                    // Next, compare charsets
+                    comp = CharsetComparator.INSTANCE.compare(getTextCharset(flavor1),
+                            getTextCharset(flavor2));
+                    if (comp != 0) {
+                        return comp;
+                    }
+                }
+
+                // Finally, prefer the encoded text representations of
+                // InputStream, ByteBuffer, and [B, in that order.
+                comp = compareIndices(encodedTextRepresentations, class1,
+                        class2, UNKNOWN_OBJECT_LOSES);
+                if (comp != 0) {
+                    return comp;
+                }
+            } else {
+                // First, prefer application types.
+                comp = compareIndices(primaryTypes, primaryType1, primaryType2,
+                        UNKNOWN_OBJECT_LOSES);
+                if (comp != 0) {
+                    return comp;
+                }
+
+                // Next prefer text types
+                if (flavor1.isFlavorTextType()) {
+                    return 1;
+                }
+
+                if (flavor2.isFlavorTextType()) {
+                    return -1;
+                }
+
+                // Next, look for application/x-java-* types. Prefer unknown
+                // MIME types because if the user provides his own data flavor,
+                // it will likely be the most descriptive one.
+                comp = compareIndices(exactTypes, mimeType1, mimeType2,
+                        UNKNOWN_OBJECT_WINS);
+                if (comp != 0) {
+                    return comp;
+                }
+
+                // Finally, prefer the representation classes of Remote,
+                // Serializable, and InputStream, in that order.
+                comp = compareIndices(nonTextRepresentations, class1, class2,
+                        UNKNOWN_OBJECT_LOSES);
+                if (comp != 0) {
+                    return comp;
+                }
+            }
+
+            // The flavours are not equal but still not distinguishable.
+            // Compare String representations in alphabetical order
+            return flavor1.getMimeType().compareTo(flavor2.getMimeType());
+        }
+    }
+
+    /*
+     * Given the Map that maps objects to Integer indices and a boolean value,
+     * this Comparator imposes a direct or reverse order on set of objects.
+     * <p>
+     * If the specified boolean value is SELECT_BEST, the Comparator imposes the
+     * direct index-based order: an object A is greater than an object B if and
+     * only if the index of A is greater than the index of B. An object that
+     * doesn't have an associated index is less or equal than any other object.
+     * <p>
+     * If the specified boolean value is SELECT_WORST, the Comparator imposes the
+     * reverse index-based order: an object A is greater than an object B if and
+     * only if A is less than B with the direct index-based order.
+     */
+    private static class IndexOrderComparator implements Comparator<Long> {
+        private final Map<Long, Integer> indexMap;
+        private static final Integer FALLBACK_INDEX = Integer.MIN_VALUE;
+
+        public IndexOrderComparator(Map<Long, Integer> indexMap) {
+            this.indexMap = indexMap;
+        }
+
+        public int compare(Long obj1, Long obj2) {
+            return compareIndices(indexMap, obj1, obj2, FALLBACK_INDEX);
+        }
+    }
+
+    private static class TextFlavorComparator extends DataFlavorComparator {
+
+        static final TextFlavorComparator INSTANCE = new TextFlavorComparator();
+        /**
+         * Compares two <code>DataFlavor</code> objects. Returns a negative
+         * integer, zero, or a positive integer as the first
+         * <code>DataFlavor</code> is worse than, equal to, or better than the
+         * second.
+         * <p>
+         * <code>DataFlavor</code>s are ordered according to the rules outlined
+         * for <code>selectBestTextFlavor</code>.
+         *
+         * @param flavor1 the first <code>DataFlavor</code> to be compared
+         * @param flavor2 the second <code>DataFlavor</code> to be compared
+         * @return a negative integer, zero, or a positive integer as the first
+         *         argument is worse, equal to, or better than the second
+         * @throws ClassCastException if either of the arguments is not an
+         *         instance of <code>DataFlavor</code>
+         * @throws NullPointerException if either of the arguments is
+         *         <code>null</code>
+         *
+         * @see java.awt.datatransfer.DataFlavor#selectBestTextFlavor
+         */
+        public int compare(DataFlavor flavor1, DataFlavor flavor2) {
+            if (flavor1.isFlavorTextType()) {
+                if (flavor2.isFlavorTextType()) {
+                    return super.compare(flavor1, flavor2);
+                } else {
+                    return 1;
+                }
+            } else if (flavor2.isFlavorTextType()) {
+                return -1;
+            } else {
+                return 0;
+            }
+        }
+    }
+
+    /**
+     * A fallback implementation of {@link sun.datatransfer.DesktopDatatransferService}
+     * used if there is no desktop.
+     */
+    private static final class DefaultDesktopDatatransferService implements DesktopDatatransferService {
+        static final DesktopDatatransferService INSTANCE = getDesktopService();
+
+        private static DesktopDatatransferService getDesktopService() {
+            ServiceLoader<DesktopDatatransferService> loader =
+                    ServiceLoader.load(DesktopDatatransferService.class, null);
+            Iterator<DesktopDatatransferService> iterator = loader.iterator();
+            if (iterator.hasNext()) {
+                return iterator.next();
+            } else {
+                return new DefaultDesktopDatatransferService();
+            }
+        }
+
+        /**
+         * System singleton FlavorTable.
+         * Only used if there is no desktop
+         * to provide an appropriate FlavorMap.
+         */
+        private volatile FlavorMap flavorMap;
+
+        @Override
+        public void invokeOnEventThread(Runnable r) {
+            r.run();
+        }
+
+        @Override
+        public String getDefaultUnicodeEncoding() {
+            return StandardCharsets.UTF_8.name();
+        }
+
+        @Override
+        public FlavorMap getFlavorMap(Supplier<FlavorMap> supplier) {
+            FlavorMap map = flavorMap;
+            if (map == null) {
+                synchronized (this) {
+                    map = flavorMap;
+                    if (map == null) {
+                        flavorMap = map = supplier.get();
+                    }
+                }
+            }
+            return map;
+        }
+
+        @Override
+        public boolean isDesktopPresent() {
+            return false;
+        }
+
+        @Override
+        public LinkedHashSet<DataFlavor> getPlatformMappingsForNative(String nat) {
+            return new LinkedHashSet<>();
+        }
+
+        @Override
+        public LinkedHashSet<String> getPlatformMappingsForFlavor(DataFlavor df) {
+            return new LinkedHashSet<>();
+        }
+
+        @Override
+        public void registerTextFlavorProperties(String nat, String charset,
+                                                 String eoln, String terminators) {
+            // Not needed if desktop module is absent
+        }
+    }
+
+    public static DesktopDatatransferService getDesktopService() {
+        return DefaultDesktopDatatransferService.INSTANCE;
+    }
+
+    /**
+     * A class that provides access to java.rmi.Remote and java.rmi.MarshalledObject
+     * without creating a static dependency.
+     */
+    public static class RMI {
+        private static final Class<?> remoteClass = getClass("java.rmi.Remote");
+        private static final Class<?> marshallObjectClass = getClass("java.rmi.MarshalledObject");
+        private static final Constructor<?> marshallCtor = getConstructor(marshallObjectClass, Object.class);
+        private static final Method marshallGet = getMethod(marshallObjectClass, "get");
+
+        private static Class<?> getClass(String name) {
+            try {
+                return Class.forName(name, true, null);
+            } catch (ClassNotFoundException e) {
+                return null;
+            }
+        }
+
+        private static Constructor<?> getConstructor(Class<?> c, Class<?>... types) {
+            try {
+                return (c == null) ? null : c.getDeclaredConstructor(types);
+            } catch (NoSuchMethodException x) {
+                throw new AssertionError(x);
+            }
+        }
+
+        private static Method getMethod(Class<?> c, String name, Class<?>... types) {
+            try {
+                return (c == null) ? null : c.getMethod(name, types);
+            } catch (NoSuchMethodException e) {
+                throw new AssertionError(e);
+            }
+        }
+
+        /**
+         * Returns java.rmi.Remote.class if RMI is present; otherwise {@code null}.
+         */
+        static Class<?> remoteClass() {
+            return remoteClass;
+        }
+
+        /**
+         * Returns {@code true} if the given class is java.rmi.Remote.
+         */
+        public static boolean isRemote(Class<?> c) {
+            return (remoteClass != null) && remoteClass.isAssignableFrom(c);
+        }
+
+        /**
+         * Returns a new MarshalledObject containing the serialized representation
+         * of the given object.
+         */
+        public static Object newMarshalledObject(Object obj) throws IOException {
+            try {
+                return marshallCtor == null ? null : marshallCtor.newInstance(obj);
+            } catch (InstantiationException | IllegalAccessException x) {
+                throw new AssertionError(x);
+            } catch (InvocationTargetException x) {
+                Throwable cause = x.getCause();
+                if (cause instanceof IOException)
+                    throw (IOException) cause;
+                throw new AssertionError(x);
+            }
+        }
+
+        /**
+         * Returns a new copy of the contained marshalled object.
+         */
+        public static Object getMarshalledObject(Object obj)
+                throws IOException, ClassNotFoundException {
+            try {
+                return marshallGet == null ? null : marshallGet.invoke(obj);
+            } catch (IllegalAccessException x) {
+                throw new AssertionError(x);
+            } catch (InvocationTargetException x) {
+                Throwable cause = x.getCause();
+                if (cause instanceof IOException)
+                    throw (IOException) cause;
+                if (cause instanceof ClassNotFoundException)
+                    throw (ClassNotFoundException) cause;
+                throw new AssertionError(x);
+            }
+        }
+
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.datatransfer/share/classes/sun/datatransfer/DesktopDatatransferService.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 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 sun.datatransfer;
+
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.FlavorMap;
+import java.util.LinkedHashSet;
+import java.util.function.Supplier;
+
+/**
+ * Contains services which desktop provides to the datatransfer system
+ * to enrich it's functionality
+ *
+ * @author Petr Pchelko
+ * @since 1.9
+ */
+public interface DesktopDatatransferService {
+
+    /**
+     * If desktop is present - invokes a {@code Runnable} on
+     * the event dispatch thread. Otherwise invokes a {@code run()}
+     * method directly.
+     *
+     * @param r a {@code Runnable} to invoke
+     */
+    void invokeOnEventThread(Runnable r);
+
+    /**
+     * Get a platform-dependent default unicode encoding to use in
+     * datatransfer system.
+     *
+     * @return default unicode encoding
+     */
+    String getDefaultUnicodeEncoding();
+
+    /**
+     * Takes an appropriate {@code FlavorMap} from the desktop.
+     * If no appropriate table is found - uses a provided supplier to
+     * instantiate a table. If the desktop is absent - creates and returns
+     * a system singleton.
+     *
+     * @param supplier a constructor that should be used to create a new instance of
+     *                 the {@code FlavorMap}
+     * @return a {@code FlavorMap}
+     */
+    FlavorMap getFlavorMap(Supplier<FlavorMap> supplier);
+
+    /**
+     * Checks if desktop is present
+     *
+     * @return {@code true} is the desktop is present
+     */
+    boolean isDesktopPresent();
+
+    /**
+     * Returns platform-specific mappings for the specified native format.
+     * If there are no platform-specific mappings for this native, the method
+     * returns an empty {@code Set}
+     *
+     * @param nat a native format to return flavors for
+     * @return set of platform-specific mappings for a native format
+     */
+    LinkedHashSet<DataFlavor> getPlatformMappingsForNative(String nat);
+
+    /**
+     * Returns platform-specific mappings for the specified flavor.
+     * If there are no platform-specific mappings for this flavor, the method
+     * returns an empty {@code Set}
+     *
+     * @param df {@code DataFlavor} to return mappings for
+     * @return set of platform-specific mappings for a {@code DataFlavor}
+     */
+    LinkedHashSet<String> getPlatformMappingsForFlavor(DataFlavor df);
+
+    /**
+     * This method is called for text flavor mappings established while parsing
+     * the default flavor mappings file. It stores the "eoln" and "terminators"
+     * parameters which are not officially part of the MIME type. They are
+     * MIME parameters specific to the flavormap.properties file format.
+     */
+    void registerTextFlavorProperties(String nat, String charset,
+                                      String eoln, String terminators);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.datatransfer/unix/classes/sun/datatransfer/resources/flavormap.properties	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,71 @@
+#
+# This properties file is used to initialize the default
+# java.awt.datatransfer.SystemFlavorMap. It contains the X11 platform-specific,
+# default mappings between common X11 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=iso8859-1;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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.datatransfer/windows/classes/sun/datatransfer/resources/flavormap.properties	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,69 @@
+#
+# This properties file is used to initialize the default
+# java.awt.datatransfer.SystemFlavorMap. It contains the Win32 platform-
+# specific, default mappings between common Win32 Clipboard 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.
+
+UNICODE\ TEXT=text/plain;charset=utf-16le;eoln="\r\n";terminators=2
+TEXT=text/plain;eoln="\r\n";terminators=1
+HTML\ Format=text/html;charset=utf-8;eoln="\r\n";terminators=1
+Rich\ Text\ Format=text/rtf
+HDROP=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
+DIB=image/x-java-image;class=java.awt.Image
+ENHMETAFILE=image/x-java-image;class=java.awt.Image
+METAFILEPICT=image/x-java-image;class=java.awt.Image
+LOCALE=application/x-java-text-encoding;class="[B"
+UniformResourceLocator=application/x-java-url;class=java.net.URL,\
+                       text/uri-list;eoln="\r\n";terminators=1,\
+                       text/plain;eoln="\r\n";terminators=1
+FileGroupDescriptorW=application/x-java-file-list;class=java.util.List
+FileGroupDescriptor=application/x-java-file-list;class=java.util.List
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaBorder.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaBorder.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -68,8 +68,9 @@
         painter.state.set(size);
     }
 
+    @Override
     public Insets getBorderInsets(final Component c) {
-        return sizeVariant.margins;
+        return (Insets) sizeVariant.margins.clone();
     }
 
     protected AquaBorder deriveBorderForSize(final Size size) {
@@ -130,8 +131,10 @@
         return (focusable != null && focusable instanceof JComponent && ((JComponent)focusable).hasFocus());
     }
 
+    @Override
     public boolean isBorderOpaque() { return false; }
 
+    @Override
     public void paintBorder(final Component c, final Graphics g, final int x, final int y, final int w, final int h) {
         painter.paint(g, c, x, y, w, h);
     }
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxUI.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxUI.java	Mon Feb 23 05:01:11 2015 -0800
@@ -275,7 +275,7 @@
 
         actionMap.put("aquaSelectNext", highlightNextAction);
         actionMap.put("aquaSelectPrevious", highlightPreviousAction);
-        actionMap.put("aquaEnterPressed", triggerSelectionAction);
+        actionMap.put("enterPressed", triggerSelectionAction);
         actionMap.put("aquaSpacePressed", toggleSelectionAction);
 
         actionMap.put("aquaSelectHome", highlightFirstAction);
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaFileChooserUI.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaFileChooserUI.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -1098,8 +1098,15 @@
             super(f);
         }
 
-        public Component getTableCellRendererComponent(final JTable list, final Object value, final boolean isSelected, final boolean cellHasFocus, final int index, final int col) {
-            super.getTableCellRendererComponent(list, value, isSelected, false, index, col); // No focus border, thanks
+        public Component getTableCellRendererComponent(final JTable list,
+                                                       final Object value,
+                                                       final boolean isSelected,
+                                                       final boolean cellHasFocus,
+                                                       final int index,
+                                                       final int col) {
+            super.getTableCellRendererComponent(list, value, isSelected, false,
+                                                index,
+                                                col); // No focus border, thanks
             final File file = (File)value;
             final JFileChooser fc = getFileChooser();
             setText(fc.getName(file));
@@ -1115,8 +1122,14 @@
             super(f);
         }
 
-        public Component getTableCellRendererComponent(final JTable list, final Object value, final boolean isSelected, final boolean cellHasFocus, final int index, final int col) {
-            super.getTableCellRendererComponent(list, value, isSelected, false, index, col);
+        public Component getTableCellRendererComponent(final JTable list,
+                                                       final Object value,
+                                                       final boolean isSelected,
+                                                       final boolean cellHasFocus,
+                                                       final int index,
+                                                       final int col) {
+            super.getTableCellRendererComponent(list, value, isSelected, false,
+                                                index, col);
             final File file = (File)fFileList.getValueAt(index, 0);
             setEnabled(isSelectableInList(file));
             final DateFormat formatter = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.SHORT);
@@ -1132,14 +1145,17 @@
         }
     }
 
+    @Override
     public Dimension getPreferredSize(final JComponent c) {
-        return PREF_SIZE;
+        return new Dimension(PREF_WIDTH, PREF_HEIGHT);
     }
 
+    @Override
     public Dimension getMinimumSize(final JComponent c) {
-        return MIN_SIZE;
+        return new Dimension(MIN_WIDTH, MIN_HEIGHT);
     }
 
+    @Override
     public Dimension getMaximumSize(final JComponent c) {
         return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
     }
@@ -1819,12 +1835,8 @@
 
     private static final int PREF_WIDTH = 550;
     private static final int PREF_HEIGHT = 400;
-    private static final Dimension PREF_SIZE = new Dimension(PREF_WIDTH, PREF_HEIGHT);
-
     private static final int MIN_WIDTH = 400;
     private static final int MIN_HEIGHT = 250;
-    private static final Dimension MIN_SIZE = new Dimension(MIN_WIDTH, MIN_HEIGHT);
-
     private static final int LIST_MIN_WIDTH = 400;
     private static final int LIST_MIN_HEIGHT = 100;
     private static final Dimension LIST_MIN_SIZE = new Dimension(LIST_MIN_WIDTH, LIST_MIN_HEIGHT);
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaKeyBindings.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaKeyBindings.java	Mon Feb 23 05:01:11 2015 -0800
@@ -214,7 +214,7 @@
             "PAGE_DOWN", "aquaSelectPageDown",
             "HOME", "aquaSelectHome",
             "END", "aquaSelectEnd",
-            "ENTER", "aquaEnterPressed",
+            "ENTER", "enterPressed",
             "UP", "aquaSelectPrevious",
             "KP_UP", "aquaSelectPrevious",
             "DOWN", "aquaSelectNext",
--- a/jdk/src/java.desktop/macosx/classes/sun/datatransfer/resources/flavormap.properties	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +0,0 @@
-#
-# 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
--- a/jdk/src/java.desktop/macosx/classes/sun/font/CFont.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.desktop/macosx/classes/sun/font/CFont.java	Mon Feb 23 05:01:11 2015 -0800
@@ -77,14 +77,72 @@
     }
 
     private static native long createNativeFont(final String nativeFontName,
-                                                final int style,
-                                                final boolean isFakeItalic);
+                                                final int style);
     private static native void disposeNativeFont(final long nativeFontPtr);
 
     private boolean isFakeItalic;
     private String nativeFontName;
     private long nativeFontPtr;
 
+    private native float getWidthNative(final long nativeFontPtr);
+    private native float getWeightNative(final long nativeFontPtr);
+
+    private int fontWidth = -1;
+    private int fontWeight = -1;
+
+    @Override
+    public int getWidth() {
+        if (fontWidth == -1) {
+            // Apple use a range of -1 -> +1, where 0.0 is normal
+            // OpenType uses a % range from 50% -> 200% where 100% is normal
+            // and maps these onto the integer values 1->9.
+            // Since that is what Font2D.getWidth() expects, remap to that.
+            float fw = getWidthNative(getNativeFontPtr());
+            if (fw == 0.0) { // short cut the common case
+                fontWidth = Font2D.FWIDTH_NORMAL;
+                return fontWidth;
+            }
+            fw += 1.0; fw *= 100.0;
+            if (fw <= 50.0) {
+                fontWidth = 1;
+            } else if (fw <= 62.5) {
+                fontWidth = 2;
+            } else if (fw <= 75.0) {
+                fontWidth = 3;
+            } else if (fw <= 87.5) {
+                fontWidth = 4;
+            } else if (fw <= 100.0) {
+                fontWidth = 5;
+            } else if (fw <= 112.5) {
+                fontWidth = 6;
+            } else if (fw <= 125.0) {
+                fontWidth = 7;
+            } else if (fw <= 150.0) {
+                fontWidth = 8;
+            } else {
+                fontWidth = 9;
+            }
+        }
+        return fontWidth;
+   }
+
+    @Override
+    public int getWeight() {
+        if (fontWeight == -1) {
+            // Apple use a range of -1 -> +1, where 0 is medium/regular
+            // Map this on to the OpenType range of 100->900 where
+            // 500 is medium/regular.
+            // We'll actually map to 0->1000 but that's close enough.
+            float fw = getWeightNative(getNativeFontPtr());
+            if (fw == 0) {
+               return Font2D.FWEIGHT_NORMAL;
+            }
+            fw += 1.0; fw *= 500;
+            fontWeight = (int)fw;
+          }
+          return fontWeight;
+    }
+
     // this constructor is called from CFontWrapper.m
     public CFont(String name) {
         this(name, name);
@@ -94,10 +152,11 @@
         handle = new Font2DHandle(this);
         fullName = name;
         familyName = inFamilyName;
-        nativeFontName = inFamilyName;
+        nativeFontName = fullName;
         setStyle();
     }
 
+    /* Called from CFontManager too */
     public CFont(CFont other, String logicalFamilyName) {
         handle = new Font2DHandle(this);
         fullName = logicalFamilyName;
@@ -109,6 +168,7 @@
 
     public CFont createItalicVariant() {
         CFont font = new CFont(this, familyName);
+        font.nativeFontName = fullName;
         font.fullName =
             fullName + (style == Font.BOLD ? "" : "-") + "Italic-Derived";
         font.style |= Font.ITALIC;
@@ -118,7 +178,7 @@
 
     protected synchronized long getNativeFontPtr() {
         if (nativeFontPtr == 0L) {
-            nativeFontPtr = createNativeFont(nativeFontName, style, isFakeItalic);
+            nativeFontPtr = createNativeFont(nativeFontName, style);
 }
         return nativeFontPtr;
     }
--- a/jdk/src/java.desktop/macosx/classes/sun/font/CFontManager.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.desktop/macosx/classes/sun/font/CFontManager.java	Mon Feb 23 05:01:11 2015 -0800
@@ -252,13 +252,42 @@
         final CFont font = new CFont(fontName, fontFamilyName);
 
         registerGenericFont(font);
+    }
 
-        if ((font.getStyle() & Font.ITALIC) == 0) {
-            registerGenericFont(font.createItalicVariant(), true);
+    void registerItalicDerived() {
+        FontFamily[] famArr = FontFamily.getAllFontFamilies();
+        for (int i=0; i<famArr.length; i++) {
+            FontFamily family = famArr[i];
+
+            Font2D f2dPlain = family.getFont(Font.PLAIN);
+            if (f2dPlain != null && !(f2dPlain instanceof CFont)) continue;
+            Font2D f2dBold = family.getFont(Font.BOLD);
+            if (f2dBold != null && !(f2dBold instanceof CFont)) continue;
+            Font2D f2dItalic = family.getFont(Font.ITALIC);
+            if (f2dItalic != null && !(f2dItalic instanceof CFont)) continue;
+            Font2D f2dBoldItalic = family.getFont(Font.BOLD|Font.ITALIC);
+            if (f2dBoldItalic != null && !(f2dBoldItalic instanceof CFont)) continue;
+
+            CFont plain = (CFont)f2dPlain;
+            CFont bold = (CFont)f2dBold;
+            CFont italic = (CFont)f2dItalic;
+            CFont boldItalic = (CFont)f2dBoldItalic;
+
+            if (bold == null) bold = plain;
+            if (plain == null && bold == null) continue;
+            if (italic != null && boldItalic != null) continue;
+            if (plain != null && italic == null) {
+               registerGenericFont(plain.createItalicVariant(), true);
+            }
+            if (bold != null && boldItalic == null) {
+               registerGenericFont(bold.createItalicVariant(), true);
+            }
         }
     }
 
     Object waitForFontsToBeLoaded  = new Object();
+    private boolean loadedAllFonts = false;
+
     public void loadFonts()
     {
         synchronized(waitForFontsToBeLoaded)
@@ -267,7 +296,11 @@
             java.security.AccessController.doPrivileged(
                 new java.security.PrivilegedAction<Object>() {
                     public Object run() {
-                        loadNativeFonts();
+                        if (!loadedAllFonts) {
+                           loadNativeFonts();
+                           registerItalicDerived();
+                           loadedAllFonts = true;
+                        }
                         return null;
                     }
                 }
--- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m	Mon Feb 23 05:01:11 2015 -0800
@@ -890,9 +890,9 @@
     // text, or 'text in progress'.  We also need to send the event if we get an insert text out of the blue!
     // (i.e., when the user uses the Character palette or Inkwell), or when the string to insert is a complex
     // Unicode value.
-    NSUInteger utf8Length = [aString lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
+    NSUInteger utf16Length = [aString lengthOfBytesUsingEncoding:NSUTF16StringEncoding];
 
-    if ([self hasMarkedText] || !fProcessingKeystroke || (utf8Length > 1)) {
+    if ([self hasMarkedText] || !fProcessingKeystroke || (utf16Length > 2)) {
         JNIEnv *env = [ThreadUtilities getJNIEnv];
 
         static JNF_MEMBER_CACHE(jm_selectPreviousGlyph, jc_CInputMethod, "selectPreviousGlyph", "()V");
--- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/font/AWTFont.m	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/font/AWTFont.m	Mon Feb 23 05:01:11 2015 -0800
@@ -35,15 +35,11 @@
 #import "AWTStrike.h"
 #import "CoreTextSupport.h"
 
-
-#define DEBUG
-
 @implementation AWTFont
 
-- (id) initWithFont:(NSFont *)font isFakeItalic:(BOOL)isFakeItalic {
+- (id) initWithFont:(NSFont *)font {
     self = [super init];
     if (self) {
-        fIsFakeItalic = isFakeItalic;
         fFont = [font retain];
         fNativeCGFont = CTFontCopyGraphicsFont((CTFontRef)font, NULL);
     }
@@ -72,7 +68,6 @@
 
 + (AWTFont *) awtFontForName:(NSString *)name
                        style:(int)style
-                isFakeItalic:(BOOL)isFakeItalic
 {
     // create font with family & size
     NSFont *nsFont = [NSFont fontWithName:name size:1.0];
@@ -95,7 +90,7 @@
         nsFont = [[NSFontManager sharedFontManager] convertFont:nsFont toHaveTrait:NSBoldFontMask];
     }
 
-    return [[[AWTFont alloc] initWithFont:nsFont isFakeItalic:isFakeItalic] autorelease];
+    return [[[AWTFont alloc] initWithFont:nsFont] autorelease];
 }
 
 + (NSFont *) nsFontForJavaFont:(jobject)javaFont env:(JNIEnv *)env {
@@ -354,7 +349,7 @@
 JNIEXPORT jlong JNICALL
 Java_sun_font_CFont_createNativeFont
     (JNIEnv *env, jclass clazz,
-     jstring nativeFontName, jint style, jboolean isFakeItalic)
+     jstring nativeFontName, jint style)
 {
     AWTFont *awtFont = nil;
 
@@ -362,8 +357,7 @@
 
     awtFont =
         [AWTFont awtFontForName:JNFJavaToNSString(env, nativeFontName)
-         style:style
-         isFakeItalic:isFakeItalic]; // autoreleased
+         style:style]; // autoreleased
 
     if (awtFont) {
         CFRetain(awtFont); // GC
@@ -376,6 +370,52 @@
 
 /*
  * Class:     sun_font_CFont
+ * Method:    getWidthNative
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL
+Java_sun_font_CFont_getWidthNative
+    (JNIEnv *env, jobject cfont, jlong awtFontPtr)
+{
+    float widthVal;
+JNF_COCOA_ENTER(env);
+
+    AWTFont *awtFont = (AWTFont *)jlong_to_ptr(awtFontPtr);
+    NSFont* nsFont = awtFont->fFont;
+    NSFontDescriptor *fontDescriptor = nsFont.fontDescriptor;
+    NSDictionary *fontTraits = [fontDescriptor objectForKey : NSFontTraitsAttribute];
+    NSNumber *width = [fontTraits objectForKey : NSFontWidthTrait];
+    widthVal = (float)[width floatValue];
+
+JNF_COCOA_EXIT(env);
+   return (jfloat)widthVal;
+}
+
+/*
+ * Class:     sun_font_CFont
+ * Method:    getWeightNative
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL
+Java_sun_font_CFont_getWeightNative
+    (JNIEnv *env, jobject cfont, jlong awtFontPtr)
+{
+    float weightVal;
+JNF_COCOA_ENTER(env);
+
+    AWTFont *awtFont = (AWTFont *)jlong_to_ptr(awtFontPtr);
+    NSFont* nsFont = awtFont->fFont;
+    NSFontDescriptor *fontDescriptor = nsFont.fontDescriptor;
+    NSDictionary *fontTraits = [fontDescriptor objectForKey : NSFontTraitsAttribute];
+    NSNumber *weight = [fontTraits objectForKey : NSFontWeightTrait];
+    weightVal = (float)[weight floatValue];
+
+JNF_COCOA_EXIT(env);
+   return (jfloat)weightVal;
+}
+
+/*
+ * Class:     sun_font_CFont
  * Method:    disposeNativeFont
  * Signature: (J)V
  */
--- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java	Mon Feb 23 05:01: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.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -43,8 +43,6 @@
 
 import java.awt.image.Raster;
 import java.awt.image.WritableRaster;
-import java.awt.image.SampleModel;
-import java.awt.image.DataBuffer;
 import java.awt.image.DataBufferByte;
 import java.awt.image.ColorModel;
 import java.awt.image.IndexColorModel;
@@ -1048,7 +1046,13 @@
 
         // Call the writer, who will call back for every scanline
 
-        processImageStarted(currentImage);
+        clearAbortRequest();
+        cbLock.lock();
+        try {
+            processImageStarted(currentImage);
+        } finally {
+            cbLock.unlock();
+        }
 
         boolean aborted = false;
 
@@ -1225,6 +1229,23 @@
         }
     }
 
+    @Override
+    protected synchronized void clearAbortRequest() {
+        setThreadLock();
+        try {
+            cbLock.check();
+            if (abortRequested()) {
+                super.clearAbortRequest();
+                // reset C structures
+                resetWriter(structPointer);
+                // reset the native destination
+                setDest(structPointer);
+            }
+        } finally {
+            clearThreadLock();
+        }
+    }
+
     private void resetInternalState() {
         // reset C structures
         resetWriter(structPointer);
@@ -1652,7 +1673,7 @@
         int vsamp0 = specs[0].VsamplingFactor;
         for (int i = 1; i < specs.length; i++) {
             if ((specs[i].HsamplingFactor != hsamp0) ||
-                (specs[i].HsamplingFactor != hsamp0))
+                (specs[i].VsamplingFactor != vsamp0))
                 return true;
         }
         return false;
--- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKFileChooserUI.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKFileChooserUI.java	Mon Feb 23 05:01:11 2015 -0800
@@ -100,7 +100,8 @@
     private static Dimension prefListSize = new Dimension(75, 150);
 
     private static Dimension PREF_SIZE = new Dimension(435, 360);
-    private static Dimension MIN_SIZE = new Dimension(200, 300);
+    private static final int MIN_WIDTH = 200;
+    private static final int MIN_HEIGHT = 300;
 
     private static Dimension ZERO_ACC_SIZE = new Dimension(1, 1);
 
@@ -1052,6 +1053,7 @@
         }
     }
 
+    @Override
     public Dimension getPreferredSize(JComponent c) {
         Dimension prefSize = new Dimension(PREF_SIZE);
         JComponent accessory = getFileChooser().getAccessory();
@@ -1067,10 +1069,12 @@
         }
     }
 
-    public Dimension getMinimumSize(JComponent x)  {
-        return new Dimension(MIN_SIZE);
+    @Override
+    public Dimension getMinimumSize(JComponent x) {
+        return new Dimension(MIN_WIDTH, MIN_HEIGHT);
     }
 
+    @Override
     public Dimension getMaximumSize(JComponent x) {
         return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
     }
--- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifFileChooserUI.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifFileChooserUI.java	Mon Feb 23 05:01: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
@@ -65,8 +65,8 @@
 
     private static Dimension WITH_ACCELERATOR_PREF_SIZE = new Dimension(650, 450);
     private static Dimension PREF_SIZE = new Dimension(350, 450);
-    private static Dimension MIN_SIZE = new Dimension(200, 300);
-
+    private static final int MIN_WIDTH = 200;
+    private static final int MIN_HEIGHT = 300;
     private static Dimension PREF_ACC_SIZE = new Dimension(10, 10);
     private static Dimension ZERO_ACC_SIZE = new Dimension(1, 1);
 
@@ -628,6 +628,7 @@
         return scrollpane;
     }
 
+    @Override
     public Dimension getPreferredSize(JComponent c) {
         Dimension prefSize =
             (getFileChooser().getAccessory() != null) ? WITH_ACCELERATOR_PREF_SIZE : PREF_SIZE;
@@ -640,10 +641,12 @@
         }
     }
 
-    public Dimension getMinimumSize(JComponent x)  {
-        return MIN_SIZE;
+    @Override
+    public Dimension getMinimumSize(JComponent x) {
+        return new Dimension(MIN_WIDTH, MIN_HEIGHT);
     }
 
+    @Override
     public Dimension getMaximumSize(JComponent x) {
         return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
     }
--- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java	Mon Feb 23 05:01:11 2015 -0800
@@ -93,7 +93,6 @@
 
     private static int MIN_WIDTH = 425;
     private static int MIN_HEIGHT = 245;
-    private static Dimension MIN_SIZE = new Dimension(MIN_WIDTH, MIN_HEIGHT);
 
     private static int LIST_PREF_WIDTH = 444;
     private static int LIST_PREF_HEIGHT = 138;
@@ -642,6 +641,7 @@
      * @return   a <code>Dimension</code> specifying the preferred
      *           width and height of the file chooser
      */
+    @Override
     public Dimension getPreferredSize(JComponent c) {
         int prefWidth = PREF_SIZE.width;
         Dimension d = c.getLayout().preferredLayoutSize(c);
@@ -660,8 +660,9 @@
      * @return   a <code>Dimension</code> specifying the minimum
      *           width and height of the file chooser
      */
+    @Override
     public Dimension getMinimumSize(JComponent c) {
-        return MIN_SIZE;
+        return new Dimension(MIN_WIDTH, MIN_HEIGHT);
     }
 
     /**
@@ -671,6 +672,7 @@
      * @return   a <code>Dimension</code> specifying the maximum
      *           width and height of the file chooser
      */
+    @Override
     public Dimension getMaximumSize(JComponent c) {
         return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
     }
--- a/jdk/src/java.desktop/share/classes/java/awt/Component.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.desktop/share/classes/java/awt/Component.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 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
@@ -1690,15 +1690,6 @@
         /* do nothing */
     }
 
-    /*
-     * Delete references from LightweightDispatcher of a heavyweight parent
-     */
-    void clearLightweightDispatcherOnRemove(Component removedComponent) {
-        if (parent != null) {
-            parent.clearLightweightDispatcherOnRemove(removedComponent);
-        }
-    }
-
     /**
      * @deprecated As of JDK version 1.1,
      * replaced by <code>setVisible(boolean)</code>.
@@ -6242,7 +6233,7 @@
     /**
      * Indicates whether a class or its superclasses override coalesceEvents.
      * Must be called with lock on coalesceMap and privileged.
-     * @see checkCoalsecing
+     * @see checkCoalescing
      */
     private static boolean isCoalesceEventsOverriden(Class<?> clazz) {
         assert Thread.holdsLock(coalesceMap);
@@ -7083,8 +7074,6 @@
         }
 
         synchronized (getTreeLock()) {
-            clearLightweightDispatcherOnRemove(this);
-
             if (isFocusOwner() && KeyboardFocusManager.isAutoFocusTransferEnabledFor(this)) {
                 transferFocus(true);
             }
--- a/jdk/src/java.desktop/share/classes/java/awt/Container.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.desktop/share/classes/java/awt/Container.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 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
@@ -41,6 +41,7 @@
 import java.io.PrintStream;
 import java.io.PrintWriter;
 
+import java.lang.ref.WeakReference;
 import java.security.AccessController;
 
 import java.util.EventListener;
@@ -3321,16 +3322,6 @@
         }
     }
 
-    @Override
-    void clearLightweightDispatcherOnRemove(Component removedComponent) {
-        if (dispatcher != null) {
-            dispatcher.removeReferences(removedComponent);
-        } else {
-            //It is a Lightweight Container, should clear parent`s Dispatcher
-            super.clearLightweightDispatcherOnRemove(removedComponent);
-        }
-    }
-
     final Container getTraversalRoot() {
         if (isFocusCycleRoot()) {
             return findTraversalRoot();
@@ -4431,7 +4422,9 @@
 
     LightweightDispatcher(Container nativeContainer) {
         this.nativeContainer = nativeContainer;
-        mouseEventTarget = null;
+        mouseEventTarget = new WeakReference<>(null);
+        targetLastEntered = new WeakReference<>(null);
+        targetLastEnteredDT = new WeakReference<>(null);
         eventMask = 0;
     }
 
@@ -4442,9 +4435,9 @@
     void dispose() {
         //System.out.println("Disposing lw dispatcher");
         stopListeningForOtherDrags();
-        mouseEventTarget = null;
-        targetLastEntered = null;
-        targetLastEnteredDT = null;
+        mouseEventTarget.clear();
+        targetLastEntered.clear();
+        targetLastEnteredDT.clear();
     }
 
     /**
@@ -4531,65 +4524,62 @@
 
         trackMouseEnterExit(mouseOver, e);
 
-    // 4508327 : MOUSE_CLICKED should only go to the recipient of
-    // the accompanying MOUSE_PRESSED, so don't reset mouseEventTarget on a
-    // MOUSE_CLICKED.
-    if (!isMouseGrab(e) && id != MouseEvent.MOUSE_CLICKED) {
-            mouseEventTarget = (mouseOver != nativeContainer) ? mouseOver: null;
-            isCleaned = false;
+        Component met = mouseEventTarget.get();
+        // 4508327 : MOUSE_CLICKED should only go to the recipient of
+        // the accompanying MOUSE_PRESSED, so don't reset mouseEventTarget on a
+        // MOUSE_CLICKED.
+        if (!isMouseGrab(e) && id != MouseEvent.MOUSE_CLICKED) {
+            met = (mouseOver != nativeContainer) ? mouseOver : null;
+            mouseEventTarget = new WeakReference<>(met);
         }
 
-        if (mouseEventTarget != null) {
+        if (met != null) {
             switch (id) {
-            case MouseEvent.MOUSE_ENTERED:
-            case MouseEvent.MOUSE_EXITED:
-                break;
-            case MouseEvent.MOUSE_PRESSED:
-                retargetMouseEvent(mouseEventTarget, id, e);
-                break;
-        case MouseEvent.MOUSE_RELEASED:
-            retargetMouseEvent(mouseEventTarget, id, e);
-        break;
-        case MouseEvent.MOUSE_CLICKED:
-        // 4508327: MOUSE_CLICKED should never be dispatched to a Component
-        // other than that which received the MOUSE_PRESSED event.  If the
-        // mouse is now over a different Component, don't dispatch the event.
-        // The previous fix for a similar problem was associated with bug
-        // 4155217.
-        if (mouseOver == mouseEventTarget) {
-            retargetMouseEvent(mouseOver, id, e);
-        }
-        break;
-            case MouseEvent.MOUSE_MOVED:
-                retargetMouseEvent(mouseEventTarget, id, e);
-                break;
-        case MouseEvent.MOUSE_DRAGGED:
-            if (isMouseGrab(e)) {
-                retargetMouseEvent(mouseEventTarget, id, e);
-            }
-                break;
-        case MouseEvent.MOUSE_WHEEL:
-            // This may send it somewhere that doesn't have MouseWheelEvents
-            // enabled.  In this case, Component.dispatchEventImpl() will
-            // retarget the event to a parent that DOES have the events enabled.
-            if (eventLog.isLoggable(PlatformLogger.Level.FINEST) && (mouseOver != null)) {
-                eventLog.finest("retargeting mouse wheel to " +
+                case MouseEvent.MOUSE_ENTERED:
+                case MouseEvent.MOUSE_EXITED:
+                    break;
+                case MouseEvent.MOUSE_PRESSED:
+                    retargetMouseEvent(met, id, e);
+                    break;
+                case MouseEvent.MOUSE_RELEASED:
+                    retargetMouseEvent(met, id, e);
+                    break;
+                case MouseEvent.MOUSE_CLICKED:
+                    // 4508327: MOUSE_CLICKED should never be dispatched to a Component
+                    // other than that which received the MOUSE_PRESSED event.  If the
+                    // mouse is now over a different Component, don't dispatch the event.
+                    // The previous fix for a similar problem was associated with bug
+                    // 4155217.
+                    if (mouseOver == met) {
+                        retargetMouseEvent(mouseOver, id, e);
+                    }
+                    break;
+                case MouseEvent.MOUSE_MOVED:
+                    retargetMouseEvent(met, id, e);
+                    break;
+                case MouseEvent.MOUSE_DRAGGED:
+                    if (isMouseGrab(e)) {
+                        retargetMouseEvent(met, id, e);
+                    }
+                    break;
+                case MouseEvent.MOUSE_WHEEL:
+                    // This may send it somewhere that doesn't have MouseWheelEvents
+                    // enabled.  In this case, Component.dispatchEventImpl() will
+                    // retarget the event to a parent that DOES have the events enabled.
+                    if (eventLog.isLoggable(PlatformLogger.Level.FINEST) && (mouseOver != null)) {
+                        eventLog.finest("retargeting mouse wheel to " +
                                 mouseOver.getName() + ", " +
                                 mouseOver.getClass());
-            }
-            retargetMouseEvent(mouseOver, id, e);
-        break;
+                    }
+                    retargetMouseEvent(mouseOver, id, e);
+                    break;
             }
-        //Consuming of wheel events is implemented in "retargetMouseEvent".
-        if (id != MouseEvent.MOUSE_WHEEL) {
-            e.consume();
+            //Consuming of wheel events is implemented in "retargetMouseEvent".
+            if (id != MouseEvent.MOUSE_WHEEL) {
+                e.consume();
+            }
         }
-    } else if (isCleaned && id != MouseEvent.MOUSE_WHEEL) {
-        //After mouseEventTarget was removed and cleaned should consume all events
-        //until new mouseEventTarget is found
-        e.consume();
-    }
-    return e.isConsumed();
+        return e.isConsumed();
     }
 
     private boolean processDropTargetEvent(SunDropTargetEvent e) {
@@ -4646,15 +4636,16 @@
             // drag has an associated drop target. MOUSE_ENTERED comes when the
             // mouse is in the native container already. To propagate this event
             // properly we should null out targetLastEntered.
-            targetLastEnteredDT = null;
+            targetLastEnteredDT.clear();
         } else if (id == MouseEvent.MOUSE_ENTERED) {
             isMouseDTInNativeContainer = true;
         } else if (id == MouseEvent.MOUSE_EXITED) {
             isMouseDTInNativeContainer = false;
         }
-        targetLastEnteredDT = retargetMouseEnterExit(targetOver, e,
-                                                     targetLastEnteredDT,
+        Component tle = retargetMouseEnterExit(targetOver, e,
+                                                     targetLastEnteredDT.get(),
                                                      isMouseDTInNativeContainer);
+        targetLastEnteredDT = new WeakReference<>(tle);
     }
 
     /*
@@ -4680,9 +4671,10 @@
             isMouseInNativeContainer = false;
             stopListeningForOtherDrags();
         }
-        targetLastEntered = retargetMouseEnterExit(targetOver, e,
-                                                   targetLastEntered,
+        Component tle = retargetMouseEnterExit(targetOver, e,
+                                                   targetLastEntered.get(),
                                                    isMouseInNativeContainer);
+        targetLastEntered = new WeakReference<>(tle);
     }
 
     private Component retargetMouseEnterExit(Component targetOver, MouseEvent e,
@@ -4944,22 +4936,17 @@
      * is null, there are currently no events being forwarded to
      * a subcomponent.
      */
-    private transient Component mouseEventTarget;
+    private transient WeakReference<Component> mouseEventTarget;
 
     /**
      * The last component entered by the {@code MouseEvent}.
      */
-    private transient Component targetLastEntered;
+    private transient  WeakReference<Component> targetLastEntered;
 
     /**
      * The last component entered by the {@code SunDropTargetEvent}.
      */
-    private transient Component targetLastEnteredDT;
-
-    /**
-     * Indicates whether {@code mouseEventTarget} was removed and nulled
-     */
-    private transient boolean isCleaned;
+    private transient  WeakReference<Component> targetLastEnteredDT;
 
     /**
      * Is the mouse over the native container.
@@ -5000,17 +4987,4 @@
         AWTEvent.MOUSE_EVENT_MASK |
         AWTEvent.MOUSE_MOTION_EVENT_MASK |
         AWTEvent.MOUSE_WHEEL_EVENT_MASK;
-
-    void removeReferences(Component removedComponent) {
-        if (mouseEventTarget == removedComponent) {
-            isCleaned = true;
-            mouseEventTarget = null;
-        }
-        if (targetLastEntered == removedComponent) {
-            targetLastEntered = null;
-        }
-        if (targetLastEnteredDT == removedComponent) {
-            targetLastEnteredDT = null;
-        }
-    }
 }
--- a/jdk/src/java.desktop/share/classes/java/awt/EventQueue.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.desktop/share/classes/java/awt/EventQueue.java	Mon Feb 23 05:01:11 2015 -0800
@@ -182,7 +182,14 @@
 
     private FwDispatcher fwDispatcher;
 
-    private static final PlatformLogger eventLog = PlatformLogger.getLogger("java.awt.event.EventQueue");
+    private static volatile PlatformLogger eventLog;
+
+    private static final PlatformLogger getEventLog() {
+        if(eventLog == null) {
+            eventLog = PlatformLogger.getLogger("java.awt.event.EventQueue");
+        }
+        return eventLog;
+    }
 
     static {
         AWTAccessor.setEventQueueAccessor(
@@ -762,8 +769,8 @@
                 dispatchThread.stopDispatching();
             }
         } else {
-            if (eventLog.isLoggable(PlatformLogger.Level.FINE)) {
-                eventLog.fine("Unable to dispatch event: " + event);
+            if (getEventLog().isLoggable(PlatformLogger.Level.FINE)) {
+                getEventLog().fine("Unable to dispatch event: " + event);
             }
         }
     }
@@ -860,8 +867,8 @@
      * @since           1.2
      */
     public void push(EventQueue newEventQueue) {
-        if (eventLog.isLoggable(PlatformLogger.Level.FINE)) {
-            eventLog.fine("EventQueue.push(" + newEventQueue + ")");
+        if (getEventLog().isLoggable(PlatformLogger.Level.FINE)) {
+            getEventLog().fine("EventQueue.push(" + newEventQueue + ")");
         }
 
         pushPopLock.lock();
@@ -886,8 +893,8 @@
                     // Use getNextEventPrivate() as it doesn't call flushPendingEvents()
                     newEventQueue.postEventPrivate(topQueue.getNextEventPrivate());
                 } catch (InterruptedException ie) {
-                    if (eventLog.isLoggable(PlatformLogger.Level.FINE)) {
-                        eventLog.fine("Interrupted push", ie);
+                    if (getEventLog().isLoggable(PlatformLogger.Level.FINE)) {
+                        getEventLog().fine("Interrupted push", ie);
                     }
                 }
             }
@@ -925,8 +932,8 @@
      * @since           1.2
      */
     protected void pop() throws EmptyStackException {
-        if (eventLog.isLoggable(PlatformLogger.Level.FINE)) {
-            eventLog.fine("EventQueue.pop(" + this + ")");
+        if (getEventLog().isLoggable(PlatformLogger.Level.FINE)) {
+            getEventLog().fine("EventQueue.pop(" + this + ")");
         }
 
         pushPopLock.lock();
@@ -948,8 +955,8 @@
                 try {
                     prevQueue.postEventPrivate(topQueue.getNextEventPrivate());
                 } catch (InterruptedException ie) {
-                    if (eventLog.isLoggable(PlatformLogger.Level.FINE)) {
-                        eventLog.fine("Interrupted pop", ie);
+                    if (getEventLog().isLoggable(PlatformLogger.Level.FINE)) {
+                        getEventLog().fine("Interrupted pop", ie);
                     }
                 }
             }
--- a/jdk/src/java.desktop/share/classes/java/awt/MenuBar.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.desktop/share/classes/java/awt/MenuBar.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 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
@@ -181,7 +181,7 @@
      * removed from the menu bar, and replaced with the specified menu.
      * @param m    the menu to be set as the help menu
      */
-    public void setHelpMenu(Menu m) {
+    public void setHelpMenu(final Menu m) {
         synchronized (getTreeLock()) {
             if (helpMenu == m) {
                 return;
@@ -189,11 +189,11 @@
             if (helpMenu != null) {
                 remove(helpMenu);
             }
-            if (m.parent != this) {
-                add(m);
-            }
             helpMenu = m;
             if (m != null) {
+                if (m.parent != this) {
+                    add(m);
+                }
                 m.isHelpMenu = true;
                 m.parent = this;
                 MenuBarPeer peer = (MenuBarPeer)this.peer;
@@ -242,7 +242,7 @@
      * @param        index   the position of the menu to be removed.
      * @see          java.awt.MenuBar#add(java.awt.Menu)
      */
-    public void remove(int index) {
+    public void remove(final int index) {
         synchronized (getTreeLock()) {
             Menu m = getMenu(index);
             menus.removeElementAt(index);
@@ -252,6 +252,10 @@
                 m.parent = null;
                 peer.delMenu(index);
             }
+            if (helpMenu == m) {
+                helpMenu = null;
+                m.isHelpMenu = false;
+            }
         }
     }
 
--- a/jdk/src/java.desktop/share/classes/java/awt/datatransfer/Clipboard.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,352 +0,0 @@
-/*
- * 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;
-    }
-}
--- a/jdk/src/java.desktop/share/classes/java/awt/datatransfer/ClipboardOwner.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
- * 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);
-
-}
--- a/jdk/src/java.desktop/share/classes/java/awt/datatransfer/DataFlavor.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1433 +0,0 @@
-/*
- * 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 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;
-
-import static sun.security.util.SecurityConstants.GET_CLASSLOADER_PERMISSION;
-
-/**
- * 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(GET_CLASSLOADER_PERMISSION);
-            }
-            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();
-                    }
-                }
-            }
-        }
-
-        return total;
-    }
-
-    /**
-     * Identical to {@link #equals(DataFlavor)}.
-     *
-     * @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
-     * @since 1.3
-     */
-    public boolean match(DataFlavor that) {
-        return equals(that);
-    }
-
-    /**
-     * Returns whether the string representation of the MIME type passed in
-     * is equivalent to the MIME type of this <code>DataFlavor</code>.
-     * Parameters are not included in the comparison.
-     *
-     * @param mimeType the string representation of the MIME type
-     * @return true if the string representation of the MIME type passed in is
-     *         equivalent to the MIME type of this <code>DataFlavor</code>;
-     *         false otherwise
-     * @throws NullPointerException if mimeType is <code>null</code>
-     */
-    public boolean isMimeTypeEqual(String mimeType) {
-        // JCK Test DataFlavor0117: if 'mimeType' is null, throw NPE
-        if (mimeType == null) {
-            throw new NullPointerException("mimeType");
-        }
-        if (this.mimeType == null) {
-            return false;
-        }
-        try {
-            return this.mimeType.match(new MimeType(mimeType));
-        } catch (MimeTypeParseException mtpe) {
-            return false;
-        }
-    }
-
-    /**
-     * Compares the <code>mimeType</code> of two <code>DataFlavor</code>
-     * objects. No parameters are considered.
-     *
-     * @param dataFlavor the <code>DataFlavor</code> to be compared
-     * @return true if the <code>MimeType</code>s are equal,
-     *  otherwise false
-     */
-
-    public final boolean isMimeTypeEqual(DataFlavor dataFlavor) {
-        return isMimeTypeEqual(dataFlavor.mimeType);
-    }
-
-    /**
-     * Compares the <code>mimeType</code> of two <code>DataFlavor</code>
-     * objects.  No parameters are considered.
-     *
-     * @return true if the <code>MimeType</code>s are equal,
-     *  otherwise false
-     */
-
-    private boolean isMimeTypeEqual(MimeType mtype) {
-        if (this.mimeType == null) {
-            return (mtype == null);
-        }
-        return mimeType.match(mtype);
-    }
-
-    /**
-     * Checks if the representation class is one of the standard text
-     * representation classes.
-     *
-     * @return true if the representation class is one of the standard text
-     *              representation classes, otherwise false
-     */
-    private boolean isStandardTextRepresentationClass() {
-        return isRepresentationClassReader()
-                || String.class.equals(representationClass)
-                || isRepresentationClassCharBuffer()
-                || char[].class.equals(representationClass);
-    }
-
-   /**
-    * Does the <code>DataFlavor</code> represent a serialized object?
-    * @return whether or not a serialized object is represented
-    */
-    public boolean isMimeTypeSerializedObject() {
-        return isMimeTypeEqual(javaSerializedObjectMimeType);
-    }
-
-    /**
-     * Returns the default representation class.
-     * @return the default representation class
-     */
-    public final Class<?> getDefaultRepresentationClass() {
-        return ioInputStreamClass;
-    }
-
-    /**
-     * Returns the name of the default representation class.
-     * @return the name of the default representation class
-     */
-    public final String getDefaultRepresentationClassAsString() {
-        return getDefaultRepresentationClass().getName();
-    }
-
-   /**
-    * Does the <code>DataFlavor</code> represent a
-    * <code>java.io.InputStream</code>?
-    * @return whether or not this {@code DataFlavor} represent a
-    * {@code java.io.InputStream}
-    */
-    public boolean isRepresentationClassInputStream() {
-        return ioInputStreamClass.isAssignableFrom(representationClass);
-    }
-
-    /**
-     * Returns whether the representation class for this
-     * <code>DataFlavor</code> is <code>java.io.Reader</code> or a subclass
-     * thereof.
-     * @return whether or not the representation class for this
-     * {@code DataFlavor} is {@code java.io.Reader} or a subclass
-     * thereof
-     *
-     * @since 1.4
-     */
-    public boolean isRepresentationClassReader() {
-        return java.io.Reader.class.isAssignableFrom(representationClass);
-    }
-
-    /**
-     * Returns whether the representation class for this
-     * <code>DataFlavor</code> is <code>java.nio.CharBuffer</code> or a
-     * subclass thereof.
-     * @return whether or not the representation class for this
-     * {@code DataFlavor} is {@code java.nio.CharBuffer} or a subclass
-     * thereof
-     *
-     * @since 1.4
-     */
-    public boolean isRepresentationClassCharBuffer() {
-        return java.nio.CharBuffer.class.isAssignableFrom(representationClass);
-    }
-
-    /**
-     * Returns whether the representation class for this
-     * <code>DataFlavor</code> is <code>java.nio.ByteBuffer</code> or a
-     * subclass thereof.
-     * @return whether or not the representation class for this
-     * {@code DataFlavor} is {@code java.nio.ByteBuffer} or a subclass
-     * thereof
-     *
-     * @since 1.4
-     */
-    public boolean isRepresentationClassByteBuffer() {
-        return java.nio.ByteBuffer.class.isAssignableFrom(representationClass);
-    }
-
-   /**
-    * Returns true if the representation class can be serialized.
-    * @return true if the representation class can be serialized
-    */
-
-    public boolean isRepresentationClassSerializable() {
-        return java.io.Serializable.class.isAssignableFrom(representationClass);
-    }
-
-   /**
-    * Returns true if the representation class is <code>Remote</code>.
-    * @return true if the representation class is <code>Remote</code>
-    */
-    public boolean isRepresentationClassRemote() {
-        return DataFlavorUtil.RMI.isRemote(representationClass);
-    }
-
-   /**
-    * Returns true if the <code>DataFlavor</code> specified represents
-    * a serialized object.
-    * @return true if the <code>DataFlavor</code> specified represents
-    *   a Serialized Object
-    */
-
-    public boolean isFlavorSerializedObjectType() {
-        return isRepresentationClassSerializable() && isMimeTypeEqual(javaSerializedObjectMimeType);
-    }
-
-    /**
-     * Returns true if the <code>DataFlavor</code> specified represents
-     * a remote object.
-     * @return true if the <code>DataFlavor</code> specified represents
-     *  a Remote Object
-     */
-
-    public boolean isFlavorRemoteObjectType() {
-        return isRepresentationClassRemote()
-            && isRepresentationClassSerializable()
-            && isMimeTypeEqual(javaRemoteObjectMimeType);
-    }
-
-
-   /**
-    * Returns true if the <code>DataFlavor</code> specified represents
-    * a list of file objects.
-    * @return true if the <code>DataFlavor</code> specified represents
-    *   a List of File objects
-    */
-
-   public boolean isFlavorJavaFileListType() {
-        if (mimeType == null || representationClass == null)
-            return false;
-        return java.util.List.class.isAssignableFrom(representationClass) &&
-               mimeType.match(javaFileListFlavor.mimeType);
-
-   }
-
-    /**
-     * Returns whether this <code>DataFlavor</code> is a valid text flavor for
-     * this implementation of the Java platform. Only flavors equivalent to
-     * <code>DataFlavor.stringFlavor</code> and <code>DataFlavor</code>s with
-     * a primary MIME type of "text" can be valid text flavors.
-     * <p>
-     * If this flavor supports the charset parameter, it must be equivalent to
-     * <code>DataFlavor.stringFlavor</code>, or its representation must be
-     * <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>, or
-     * <code>[B</code>. If the representation is
-     * <code>java.io.InputStream</code>, <code>java.nio.ByteBuffer</code>, or
-     * <code>[B</code>, then this flavor's <code>charset</code> parameter must
-     * be supported by this implementation of the Java platform. If a charset
-     * is not specified, then the platform default charset, which is always
-     * supported, is assumed.
-     * <p>
-     * If this flavor does not support the charset parameter, its
-     * representation must be <code>java.io.InputStream</code>,
-     * <code>java.nio.ByteBuffer</code>, or <code>[B</code>.
-     * <p>
-     * See <code>selectBestTextFlavor</code> for a list of text flavors which
-     * support the charset parameter.
-     *
-     * @return <code>true</code> if this <code>DataFlavor</code> is a valid
-     *         text flavor as described above; <code>false</code> otherwise
-     * @see #selectBestTextFlavor
-     * @since 1.4
-     */
-    public boolean isFlavorTextType() {
-        return (DataFlavorUtil.isFlavorCharsetTextType(this) ||
-                DataFlavorUtil.isFlavorNoncharsetTextType(this));
-    }
-
-   /**
-    * Serializes this <code>DataFlavor</code>.
-    */
-
-   public synchronized void writeExternal(ObjectOutput os) throws IOException {
-       if (mimeType != null) {
-           mimeType.setParameter("humanPresentableName", humanPresentableName);
-           os.writeObject(mimeType);
-           mimeType.removeParameter("humanPresentableName");
-       } else {
-           os.writeObject(null);
-       }
-
-       os.writeObject(representationClass);
-   }
-
-   /**
-    * Restores this <code>DataFlavor</code> from a Serialized state.
-    */
-
-   public synchronized void readExternal(ObjectInput is) throws IOException , ClassNotFoundException {
-       String rcn = null;
-        mimeType = (MimeType)is.readObject();
-
-        if (mimeType != null) {
-            humanPresentableName =
-                mimeType.getParameter("humanPresentableName");
-            mimeType.removeParameter("humanPresentableName");
-            rcn = mimeType.getParameter("class");
-            if (rcn == null) {
-                throw new IOException("no class parameter specified in: " +
-                                      mimeType);
-            }
-        }
-
-        try {
-            representationClass = (Class)is.readObject();
-        } catch (OptionalDataException ode) {
-            if (!ode.eof || ode.length != 0) {
-                throw ode;
-            }
-            // Ensure backward compatibility.
-            // Old versions didn't write the representation class to the stream.
-            if (rcn != null) {
-                representationClass =
-                    DataFlavor.tryToLoadClass(rcn, getClass().getClassLoader());
-            }
-        }
-   }
-
-   /**
-    * Returns a clone of this <code>DataFlavor</code>.
-    * @return a clone of this <code>DataFlavor</code>
-    */
-
-    public Object clone() throws CloneNotSupportedException {
-        Object newObj = super.clone();
-        if (mimeType != null) {
-            ((DataFlavor)newObj).mimeType = (MimeType)mimeType.clone();
-        }
-        return newObj;
-    } // clone()
-
-   /**
-    * Called on <code>DataFlavor</code> for every MIME Type parameter
-    * to allow <code>DataFlavor</code> subclasses to handle special
-    * parameters like the text/plain <code>charset</code>
-    * parameters, whose values are case insensitive.  (MIME type parameter
-    * values are supposed to be case sensitive.
-    * <p>
-    * This method is called for each parameter name/value pair and should
-    * return the normalized representation of the <code>parameterValue</code>.
-    *
-    * This method is never invoked by this implementation from 1.1 onwards.
-    *
-    * @param parameterName the parameter name
-    * @param parameterValue the parameter value
-    * @return the parameter value
-    * @deprecated
-    */
-    @Deprecated
-    protected String normalizeMimeTypeParameter(String parameterName, String parameterValue) {
-        return parameterValue;
-    }
-
-   /**
-    * Called for each MIME type string to give <code>DataFlavor</code> subtypes
-    * the opportunity to change how the normalization of MIME types is
-    * accomplished.  One possible use would be to add default
-    * parameter/value pairs in cases where none are present in the MIME
-    * type string passed in.
-    *
-    * This method is never invoked by this implementation from 1.1 onwards.
-    *
-    * @param mimeType the mime type
-    * @return the mime type
-    * @deprecated
-    */
-    @Deprecated
-    protected String normalizeMimeType(String mimeType) {
-        return mimeType;
-    }
-
-    /*
-     * fields
-     */
-
-    /* placeholder for caching any platform-specific data for flavor */
-
-    transient int       atom;
-
-    /* Mime Type of DataFlavor */
-
-    MimeType            mimeType;
-
-    private String      humanPresentableName;
-
-    /** Java class of objects this DataFlavor represents **/
-
-    private Class<?>       representationClass;
-
-} // class DataFlavor
--- a/jdk/src/java.desktop/share/classes/java/awt/datatransfer/FlavorEvent.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2003, 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 java.util.EventObject;
-
-
-/**
- * <code>FlavorEvent</code> is used to notify interested parties
- * that available {@link DataFlavor}s have changed in the
- * {@link Clipboard} (the event source).
- *
- * @see FlavorListener
- *
- * @author Alexander Gerasimov
- * @since 1.5
- */
-public class FlavorEvent extends EventObject {
-    private static final long serialVersionUID = -5842664112252414548L;
-
-    /**
-     * Constructs a <code>FlavorEvent</code> object.
-     *
-     * @param source  the <code>Clipboard</code> that is the source of the event
-     *
-     * @throws IllegalArgumentException if the {@code source} is {@code null}
-     */
-    public FlavorEvent(Clipboard source) {
-        super(source);
-    }
-}
--- a/jdk/src/java.desktop/share/classes/java/awt/datatransfer/FlavorListener.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2003, 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 java.util.EventListener;
-
-
-/**
- * Defines an object which listens for {@link FlavorEvent}s.
- *
- * @author Alexander Gerasimov
- * @since 1.5
- */
-public interface FlavorListener extends EventListener {
-    /**
-     * Invoked when the target {@link Clipboard} of the listener
-     * has changed its available {@link DataFlavor}s.
-     * <p>
-     * Some notifications may be redundant &#8212; they are not
-     * caused by a change of the set of DataFlavors available
-     * on the clipboard.
-     * For example, if the clipboard subsystem supposes that
-     * the system clipboard's contents has been changed but it
-     * can't ascertain whether its DataFlavors have been changed
-     * because of some exceptional condition when accessing the
-     * clipboard, the notification is sent to ensure from omitting
-     * a significant notification. Ordinarily, those redundant
-     * notifications should be occasional.
-     *
-     * @param e  a <code>FlavorEvent</code> object
-     */
-    void flavorsChanged(FlavorEvent e);
-}
--- a/jdk/src/java.desktop/share/classes/java/awt/datatransfer/FlavorMap.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 1997, 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 java.awt.datatransfer;
-
-import java.util.Map;
-
-
-/**
- * A two-way Map between "natives" (Strings), which correspond to platform-
- * specific data formats, and "flavors" (DataFlavors), which correspond to
- * platform-independent MIME types. FlavorMaps need not be symmetric, but
- * typically are.
- *
- *
- * @since 1.2
- */
-public interface FlavorMap {
-
-    /**
-     * Returns a <code>Map</code> of the specified <code>DataFlavor</code>s to
-     * their corresponding <code>String</code> native. The returned
-     * <code>Map</code> is a modifiable copy of this <code>FlavorMap</code>'s
-     * internal data. Client code is free to modify the <code>Map</code>
-     * without affecting this object.
-     *
-     * @param flavors an array of <code>DataFlavor</code>s which will be the
-     *        key set of the returned <code>Map</code>. If <code>null</code> is
-     *        specified, a mapping of all <code>DataFlavor</code>s currently
-     *        known to this <code>FlavorMap</code> to their corresponding
-     *        <code>String</code> natives will be returned.
-     * @return a <code>java.util.Map</code> of <code>DataFlavor</code>s to
-     *         <code>String</code> natives
-     */
-    Map<DataFlavor,String> getNativesForFlavors(DataFlavor[] flavors);
-
-    /**
-     * Returns a <code>Map</code> of the specified <code>String</code> natives
-     * to their corresponding <code>DataFlavor</code>. The returned
-     * <code>Map</code> is a modifiable copy of this <code>FlavorMap</code>'s
-     * internal data. Client code is free to modify the <code>Map</code>
-     * without affecting this object.
-     *
-     * @param natives an array of <code>String</code>s which will be the
-     *        key set of the returned <code>Map</code>. If <code>null</code> is
-     *        specified, a mapping of all <code>String</code> natives currently
-     *        known to this <code>FlavorMap</code> to their corresponding
-     *        <code>DataFlavor</code>s will be returned.
-     * @return a <code>java.util.Map</code> of <code>String</code> natives to
-     *         <code>DataFlavor</code>s
-     */
-    Map<String,DataFlavor> getFlavorsForNatives(String[] natives);
-}
--- a/jdk/src/java.desktop/share/classes/java/awt/datatransfer/FlavorTable.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 2000, 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 java.awt.datatransfer;
-
-import java.util.List;
-
-
-/**
- * A FlavorMap which relaxes the traditional 1-to-1 restriction of a Map. A
- * flavor is permitted to map to any number of natives, and likewise a native
- * is permitted to map to any number of flavors. FlavorTables need not be
- * symmetric, but typically are.
- *
- * @author David Mendenhall
- *
- * @since 1.4
- */
-public interface FlavorTable extends FlavorMap {
-
-    /**
-     * Returns a <code>List</code> of <code>String</code> natives to which the
-     * specified <code>DataFlavor</code> corresponds. The <code>List</code>
-     * will be sorted from best native to worst. That is, the first native will
-     * best reflect data in the specified flavor to the underlying native
-     * platform. The returned <code>List</code> is a modifiable copy of this
-     * <code>FlavorTable</code>'s internal data. Client code is free to modify
-     * the <code>List</code> without affecting this object.
-     *
-     * @param flav the <code>DataFlavor</code> whose corresponding natives
-     *        should be returned. If <code>null</code> is specified, all
-     *        natives currently known to this <code>FlavorTable</code> are
-     *        returned in a non-deterministic order.
-     * @return a <code>java.util.List</code> of <code>java.lang.String</code>
-     *         objects which are platform-specific representations of platform-
-     *         specific data formats
-     */
-    List<String> getNativesForFlavor(DataFlavor flav);
-
-    /**
-     * Returns a <code>List</code> of <code>DataFlavor</code>s to which the
-     * specified <code>String</code> corresponds. The <code>List</code> will be
-     * sorted from best <code>DataFlavor</code> to worst. That is, the first
-     * <code>DataFlavor</code> will best reflect data in the specified
-     * native to a Java application. The returned <code>List</code> is a
-     * modifiable copy of this <code>FlavorTable</code>'s internal data.
-     * Client code is free to modify the <code>List</code> without affecting
-     * this object.
-     *
-     * @param nat the native whose corresponding <code>DataFlavor</code>s
-     *        should be returned. If <code>null</code> is specified, all
-     *        <code>DataFlavor</code>s currently known to this
-     *        <code>FlavorTable</code> are returned in a non-deterministic
-     *        order.
-     * @return a <code>java.util.List</code> of <code>DataFlavor</code>
-     *         objects into which platform-specific data in the specified,
-     *         platform-specific native can be translated
-     */
-    List<DataFlavor> getFlavorsForNative(String nat);
-}
--- a/jdk/src/java.desktop/share/classes/java/awt/datatransfer/MimeType.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,394 +0,0 @@
-/*
- * Copyright (c) 1997, 2012, 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 java.io.Externalizable;
-import java.io.ObjectOutput;
-import java.io.ObjectInput;
-import java.io.IOException;
-import java.util.Enumeration;
-import java.util.Locale;
-
-
-/**
- * A Multipurpose Internet Mail Extension (MIME) type, as defined
- * in RFC 2045 and 2046.
- *
- * THIS IS *NOT* - REPEAT *NOT* - A PUBLIC CLASS! DataFlavor IS
- * THE PUBLIC INTERFACE, AND THIS IS PROVIDED AS A ***PRIVATE***
- * (THAT IS AS IN *NOT* PUBLIC) HELPER CLASS!
- */
-class MimeType implements Externalizable, Cloneable {
-
-    /*
-     * serialization support
-     */
-
-    static final long serialVersionUID = -6568722458793895906L;
-
-    /**
-     * Constructor for externalization; this constructor should not be
-     * called directly by an application, since the result will be an
-     * uninitialized, immutable <code>MimeType</code> object.
-     */
-    public MimeType() {
-    }
-
-    /**
-     * Builds a <code>MimeType</code> from a <code>String</code>.
-     *
-     * @param rawdata text used to initialize the <code>MimeType</code>
-     * @throws NullPointerException if <code>rawdata</code> is null
-     */
-    public MimeType(String rawdata) throws MimeTypeParseException {
-        parse(rawdata);
-    }
-
-    /**
-     * Builds a <code>MimeType</code> with the given primary and sub
-     * type but has an empty parameter list.
-     *
-     * @param primary the primary type of this <code>MimeType</code>
-     * @param sub the subtype of this <code>MimeType</code>
-     * @throws NullPointerException if either <code>primary</code> or
-     *         <code>sub</code> is null
-     */
-    public MimeType(String primary, String sub) throws MimeTypeParseException {
-        this(primary, sub, new MimeTypeParameterList());
-    }
-
-    /**
-     * Builds a <code>MimeType</code> with a pre-defined
-     * and valid (or empty) parameter list.
-     *
-     * @param primary the primary type of this <code>MimeType</code>
-     * @param sub the subtype of this <code>MimeType</code>
-     * @param mtpl the requested parameter list
-     * @throws NullPointerException if either <code>primary</code>,
-     *         <code>sub</code> or <code>mtpl</code> is null
-     */
-    public MimeType(String primary, String sub, MimeTypeParameterList mtpl) throws
-MimeTypeParseException {
-        //    check to see if primary is valid
-        if(isValidToken(primary)) {
-            primaryType = primary.toLowerCase(Locale.ENGLISH);
-        } else {
-            throw new MimeTypeParseException("Primary type is invalid.");
-        }
-
-        //    check to see if sub is valid
-        if(isValidToken(sub)) {
-            subType = sub.toLowerCase(Locale.ENGLISH);
-        } else {
-            throw new MimeTypeParseException("Sub type is invalid.");
-        }
-
-        parameters = (MimeTypeParameterList)mtpl.clone();
-    }
-
-    public int hashCode() {
-
-        // We sum up the hash codes for all of the strings. This
-        // way, the order of the strings is irrelevant
-        int code = 0;
-        code += primaryType.hashCode();
-        code += subType.hashCode();
-        code += parameters.hashCode();
-        return code;
-    } // hashCode()
-
-    /**
-     * <code>MimeType</code>s are equal if their primary types,
-     * subtypes, and  parameters are all equal. No default values
-     * are taken into account.
-     * @param thatObject the object to be evaluated as a
-     *    <code>MimeType</code>
-     * @return <code>true</code> if <code>thatObject</code> is
-     *    a <code>MimeType</code>; otherwise returns <code>false</code>
-     */
-    public boolean equals(Object thatObject) {
-        if (!(thatObject instanceof MimeType)) {
-            return false;
-        }
-        MimeType that = (MimeType)thatObject;
-        boolean isIt =
-            ((this.primaryType.equals(that.primaryType)) &&
-             (this.subType.equals(that.subType)) &&
-             (this.parameters.equals(that.parameters)));
-        return isIt;
-    } // equals()
-
-    /**
-     * A routine for parsing the MIME type out of a String.
-     *
-     * @throws NullPointerException if <code>rawdata</code> is null
-     */
-    private void parse(String rawdata) throws MimeTypeParseException {
-        int slashIndex = rawdata.indexOf('/');
-        int semIndex = rawdata.indexOf(';');
-        if((slashIndex < 0) && (semIndex < 0)) {
-            //    neither character is present, so treat it
-            //    as an error
-            throw new MimeTypeParseException("Unable to find a sub type.");
-        } else if((slashIndex < 0) && (semIndex >= 0)) {
-            //    we have a ';' (and therefore a parameter list),
-            //    but no '/' indicating a sub type is present
-            throw new MimeTypeParseException("Unable to find a sub type.");
-        } else if((slashIndex >= 0) && (semIndex < 0)) {
-            //    we have a primary and sub type but no parameter list
-            primaryType = rawdata.substring(0,slashIndex).
-                trim().toLowerCase(Locale.ENGLISH);
-            subType = rawdata.substring(slashIndex + 1).
-                trim().toLowerCase(Locale.ENGLISH);
-            parameters = new MimeTypeParameterList();
-        } else if (slashIndex < semIndex) {
-            //    we have all three items in the proper sequence
-            primaryType = rawdata.substring(0, slashIndex).
-                trim().toLowerCase(Locale.ENGLISH);
-            subType = rawdata.substring(slashIndex + 1,
-                semIndex).trim().toLowerCase(Locale.ENGLISH);
-            parameters = new
-MimeTypeParameterList(rawdata.substring(semIndex));
-        } else {
-            //    we have a ';' lexically before a '/' which means we have a primary type
-            //    & a parameter list but no sub type
-            throw new MimeTypeParseException("Unable to find a sub type.");
-        }
-
-        //    now validate the primary and sub types
-
-        //    check to see if primary is valid
-        if(!isValidToken(primaryType)) {
-            throw new MimeTypeParseException("Primary type is invalid.");
-        }
-
-        //    check to see if sub is valid
-        if(!isValidToken(subType)) {
-            throw new MimeTypeParseException("Sub type is invalid.");
-        }
-    }
-
-    /**
-     * Retrieve the primary type of this object.
-     */
-    public String getPrimaryType() {
-        return primaryType;
-    }
-
-    /**
-     * Retrieve the sub type of this object.
-     */
-    public String getSubType() {
-        return subType;
-    }
-
-    /**
-     * Retrieve a copy of this object's parameter list.
-     */
-    public MimeTypeParameterList getParameters() {
-        return (MimeTypeParameterList)parameters.clone();
-    }
-
-    /**
-     * Retrieve the value associated with the given name, or null if there
-     * is no current association.
-     */
-    public String getParameter(String name) {
-        return parameters.get(name);
-    }
-
-    /**
-     * Set the value to be associated with the given name, replacing
-     * any previous association.
-     *
-     * @throw IllegalArgumentException if parameter or value is illegal
-     */
-    public void setParameter(String name, String value) {
-        parameters.set(name, value);
-    }
-
-    /**
-     * Remove any value associated with the given name.
-     *
-     * @throw IllegalArgumentException if parameter may not be deleted
-     */
-    public void removeParameter(String name) {
-        parameters.remove(name);
-    }
-
-    /**
-     * Return the String representation of this object.
-     */
-    public String toString() {
-        return getBaseType() + parameters.toString();
-    }
-
-    /**
-     * Return a String representation of this object
-     * without the parameter list.
-     */
-    public String getBaseType() {
-        return primaryType + "/" + subType;
-    }
-
-    /**
-     * Returns <code>true</code> if the primary type and the
-     * subtype of this object are the same as the specified
-     * <code>type</code>; otherwise returns <code>false</code>.
-     *
-     * @param type the type to compare to <code>this</code>'s type
-     * @return <code>true</code> if the primary type and the
-     *    subtype of this object are the same as the
-     *    specified <code>type</code>; otherwise returns
-     *    <code>false</code>
-     */
-    public boolean match(MimeType type) {
-        if (type == null)
-            return false;
-        return primaryType.equals(type.getPrimaryType())
-                    && (subType.equals("*")
-                            || type.getSubType().equals("*")
-                            || (subType.equals(type.getSubType())));
-    }
-
-    /**
-     * Returns <code>true</code> if the primary type and the
-     * subtype of this object are the same as the content type
-     * described in <code>rawdata</code>; otherwise returns
-     * <code>false</code>.
-     *
-     * @param rawdata the raw data to be examined
-     * @return <code>true</code> if the primary type and the
-     *    subtype of this object are the same as the content type
-     *    described in <code>rawdata</code>; otherwise returns
-     *    <code>false</code>; if <code>rawdata</code> is
-     *    <code>null</code>, returns <code>false</code>
-     */
-    public boolean match(String rawdata) throws MimeTypeParseException {
-        if (rawdata == null)
-            return false;
-        return match(new MimeType(rawdata));
-    }
-
-    /**
-     * The object implements the writeExternal method to save its contents
-     * by calling the methods of DataOutput for its primitive values or
-     * calling the writeObject method of ObjectOutput for objects, strings
-     * and arrays.
-     * @exception IOException Includes any I/O exceptions that may occur
-     */
-    public void writeExternal(ObjectOutput out) throws IOException {
-        String s = toString(); // contains ASCII chars only
-        // one-to-one correspondence between ASCII char and byte in UTF string
-        if (s.length() <= 65535) { // 65535 is max length of UTF string
-            out.writeUTF(s);
-        } else {
-            out.writeByte(0);
-            out.writeByte(0);
-            out.writeInt(s.length());
-            out.write(s.getBytes());
-        }
-    }
-
-    /**
-     * The object implements the readExternal method to restore its
-     * contents by calling the methods of DataInput for primitive
-     * types and readObject for objects, strings and arrays.  The
-     * readExternal method must read the values in the same sequence
-     * and with the same types as were written by writeExternal.
-     * @exception ClassNotFoundException If the class for an object being
-     *              restored cannot be found.
-     */
-    public void readExternal(ObjectInput in) throws IOException,
-ClassNotFoundException {
-        String s = in.readUTF();
-        if (s == null || s.length() == 0) { // long mime type
-            byte[] ba = new byte[in.readInt()];
-            in.readFully(ba);
-            s = new String(ba);
-        }
-        try {
-            parse(s);
-        } catch(MimeTypeParseException e) {
-            throw new IOException(e.toString());
-        }
-    }
-
-    /**
-     * Returns a clone of this object.
-     * @return a clone of this object
-     */
-
-    public Object clone() {
-        MimeType newObj = null;
-        try {
-            newObj = (MimeType)super.clone();
-        } catch (CloneNotSupportedException cannotHappen) {
-        }
-        newObj.parameters = (MimeTypeParameterList)parameters.clone();
-        return newObj;
-    }
-
-    private String    primaryType;
-    private String    subType;
-    private MimeTypeParameterList parameters;
-
-    //    below here be scary parsing related things
-
-    /**
-     * Determines whether or not a given character belongs to a legal token.
-     */
-    private static boolean isTokenChar(char c) {
-        return ((c > 040) && (c < 0177)) && (TSPECIALS.indexOf(c) < 0);
-    }
-
-    /**
-     * Determines whether or not a given string is a legal token.
-     *
-     * @throws NullPointerException if <code>s</code> is null
-     */
-    private boolean isValidToken(String s) {
-        int len = s.length();
-        if(len > 0) {
-            for (int i = 0; i < len; ++i) {
-                char c = s.charAt(i);
-                if (!isTokenChar(c)) {
-                    return false;
-                }
-            }
-            return true;
-        } else {
-            return false;
-        }
-    }
-
-    /**
-     * A string that holds all the special chars.
-     */
-
-    private static final String TSPECIALS = "()<>@,;:\\\"/[]?=";
-
-} // class MimeType
--- a/jdk/src/java.desktop/share/classes/java/awt/datatransfer/MimeTypeParameterList.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,404 +0,0 @@
-/*
- * Copyright (c) 1997, 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 java.awt.datatransfer;
-
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-
-/**
- * An object that encapsulates the parameter list of a MimeType
- * as defined in RFC 2045 and 2046.
- *
- * @author jeff.dunn@eng.sun.com
- */
-class MimeTypeParameterList implements Cloneable {
-
-    /**
-     * Default constructor.
-     */
-    public MimeTypeParameterList() {
-        parameters = new Hashtable<>();
-    }
-
-    public MimeTypeParameterList(String rawdata)
-        throws MimeTypeParseException
-    {
-        parameters = new Hashtable<>();
-
-        //    now parse rawdata
-        parse(rawdata);
-    }
-
-    public int hashCode() {
-        int code = Integer.MAX_VALUE/45; // "random" value for empty lists
-        String paramName = null;
-        Enumeration<String> enum_ = this.getNames();
-
-        while (enum_.hasMoreElements()) {
-            paramName = enum_.nextElement();
-            code += paramName.hashCode();
-            code += this.get(paramName).hashCode();
-        }
-
-        return code;
-    } // hashCode()
-
-    /**
-     * Two parameter lists are considered equal if they have exactly
-     * the same set of parameter names and associated values. The
-     * order of the parameters is not considered.
-     */
-    public boolean equals(Object thatObject) {
-        //System.out.println("MimeTypeParameterList.equals("+this+","+thatObject+")");
-        if (!(thatObject instanceof MimeTypeParameterList)) {
-            return false;
-        }
-        MimeTypeParameterList that = (MimeTypeParameterList)thatObject;
-        if (this.size() != that.size()) {
-            return false;
-        }
-        String name = null;
-        String thisValue = null;
-        String thatValue = null;
-        Set<Map.Entry<String, String>> entries = parameters.entrySet();
-        Iterator<Map.Entry<String, String>> iterator = entries.iterator();
-        Map.Entry<String, String> entry = null;
-        while (iterator.hasNext()) {
-            entry = iterator.next();
-            name = entry.getKey();
-            thisValue = entry.getValue();
-            thatValue = that.parameters.get(name);
-            if ((thisValue == null) || (thatValue == null)) {
-                // both null -> equal, only one null -> not equal
-                if (thisValue != thatValue) {
-                    return false;
-                }
-            } else if (!thisValue.equals(thatValue)) {
-                return false;
-            }
-        } // while iterator
-
-        return true;
-    } // equals()
-
-    /**
-     * A routine for parsing the parameter list out of a String.
-     */
-    protected void parse(String rawdata) throws MimeTypeParseException {
-        int length = rawdata.length();
-        if(length > 0) {
-            int currentIndex = skipWhiteSpace(rawdata, 0);
-            int lastIndex = 0;
-
-            if(currentIndex < length) {
-                char currentChar = rawdata.charAt(currentIndex);
-                while ((currentIndex < length) && (currentChar == ';')) {
-                    String name;
-                    String value;
-                    boolean foundit;
-
-                    //    eat the ';'
-                    ++currentIndex;
-
-                    //    now parse the parameter name
-
-                    //    skip whitespace
-                    currentIndex = skipWhiteSpace(rawdata, currentIndex);
-
-                    if(currentIndex < length) {
-                        //    find the end of the token char run
-                        lastIndex = currentIndex;
-                        currentChar = rawdata.charAt(currentIndex);
-                        while((currentIndex < length) && isTokenChar(currentChar)) {
-                            ++currentIndex;
-                            currentChar = rawdata.charAt(currentIndex);
-                        }
-                        name = rawdata.substring(lastIndex, currentIndex).toLowerCase();
-
-                        //    now parse the '=' that separates the name from the value
-
-                        //    skip whitespace
-                        currentIndex = skipWhiteSpace(rawdata, currentIndex);
-
-                        if((currentIndex < length) && (rawdata.charAt(currentIndex) == '='))  {
-                            //    eat it and parse the parameter value
-                            ++currentIndex;
-
-                            //    skip whitespace
-                            currentIndex = skipWhiteSpace(rawdata, currentIndex);
-
-                            if(currentIndex < length) {
-                                //    now find out whether or not we have a quoted value
-                                currentChar = rawdata.charAt(currentIndex);
-                                if(currentChar == '"') {
-                                    //    yup it's quoted so eat it and capture the quoted string
-                                    ++currentIndex;
-                                    lastIndex = currentIndex;
-
-                                    if(currentIndex < length) {
-                                        //    find the next unescaped quote
-                                        foundit = false;
-                                        while((currentIndex < length) && !foundit) {
-                                            currentChar = rawdata.charAt(currentIndex);
-                                            if(currentChar == '\\') {
-                                                //    found an escape sequence so pass this and the next character
-                                                currentIndex += 2;
-                                            } else if(currentChar == '"') {
-                                                //    found it!
-                                                foundit = true;
-                                            } else {
-                                                ++currentIndex;
-                                            }
-                                        }
-                                        if(currentChar == '"') {
-                                            value = unquote(rawdata.substring(lastIndex, currentIndex));
-                                            //    eat the quote
-                                            ++currentIndex;
-                                        } else {
-                                            throw new MimeTypeParseException("Encountered unterminated quoted parameter value.");
-                                        }
-                                    } else {
-                                        throw new MimeTypeParseException("Encountered unterminated quoted parameter value.");
-                                    }
-                                } else if(isTokenChar(currentChar)) {
-                                    //    nope it's an ordinary token so it ends with a non-token char
-                                    lastIndex = currentIndex;
-                                    foundit = false;
-                                    while((currentIndex < length) && !foundit) {
-                                        currentChar = rawdata.charAt(currentIndex);
-
-                                        if(isTokenChar(currentChar)) {
-                                            ++currentIndex;
-                                        } else {
-                                            foundit = true;
-                                        }
-                                    }
-                                    value = rawdata.substring(lastIndex, currentIndex);
-                                } else {
-                                    //    it ain't a value
-                                    throw new MimeTypeParseException("Unexpected character encountered at index " + currentIndex);
-                                }
-
-                                //    now put the data into the hashtable
-                                parameters.put(name, value);
-                            } else {
-                                throw new MimeTypeParseException("Couldn't find a value for parameter named " + name);
-                            }
-                        } else {
-                            throw new MimeTypeParseException("Couldn't find the '=' that separates a parameter name from its value.");
-                        }
-                    } else {
-                        throw new MimeTypeParseException("Couldn't find parameter name");
-                    }
-
-                    //    setup the next iteration
-                    currentIndex = skipWhiteSpace(rawdata, currentIndex);
-                    if(currentIndex < length) {
-                        currentChar = rawdata.charAt(currentIndex);
-                    }
-                }
-                if(currentIndex < length) {
-                    throw new MimeTypeParseException("More characters encountered in input than expected.");
-                }
-            }
-        }
-    }
-
-    /**
-     * return the number of name-value pairs in this list.
-     */
-    public int size() {
-        return parameters.size();
-    }
-
-    /**
-     * Determine whether or not this list is empty.
-     */
-    public boolean isEmpty() {
-        return parameters.isEmpty();
-    }
-
-    /**
-     * Retrieve the value associated with the given name, or null if there
-     * is no current association.
-     */
-    public String get(String name) {
-        return parameters.get(name.trim().toLowerCase());
-    }
-
-    /**
-     * Set the value to be associated with the given name, replacing
-     * any previous association.
-     */
-    public void set(String name, String value) {
-        parameters.put(name.trim().toLowerCase(), value);
-    }
-
-    /**
-     * Remove any value associated with the given name.
-     */
-    public void remove(String name) {
-        parameters.remove(name.trim().toLowerCase());
-    }
-
-    /**
-     * Retrieve an enumeration of all the names in this list.
-     */
-    public Enumeration<String> getNames() {
-        return parameters.keys();
-    }
-
-    public String toString() {
-        // Heuristic: 8 characters per field
-        StringBuilder buffer = new StringBuilder(parameters.size() * 16);
-
-        Enumeration<String> keys = parameters.keys();
-        while(keys.hasMoreElements())
-        {
-            buffer.append("; ");
-
-            String key = keys.nextElement();
-            buffer.append(key);
-            buffer.append('=');
-               buffer.append(quote(parameters.get(key)));
-        }
-
-        return buffer.toString();
-    }
-
-    /**
-     * @return a clone of this object
-     */
-    @SuppressWarnings("unchecked") // Cast from clone
-     public Object clone() {
-         MimeTypeParameterList newObj = null;
-         try {
-             newObj = (MimeTypeParameterList)super.clone();
-         } catch (CloneNotSupportedException cannotHappen) {
-         }
-         newObj.parameters = (Hashtable<String, String>)parameters.clone();
-         return newObj;
-     }
-
-    private Hashtable<String, String> parameters;
-
-    //    below here be scary parsing related things
-
-    /**
-     * Determine whether or not a given character belongs to a legal token.
-     */
-    private static boolean isTokenChar(char c) {
-        return ((c > 040) && (c < 0177)) && (TSPECIALS.indexOf(c) < 0);
-    }
-
-    /**
-     * return the index of the first non white space character in
-     * rawdata at or after index i.
-     */
-    private static int skipWhiteSpace(String rawdata, int i) {
-        int length = rawdata.length();
-        if (i < length) {
-            char c =  rawdata.charAt(i);
-            while ((i < length) && Character.isWhitespace(c)) {
-                ++i;
-                c = rawdata.charAt(i);
-            }
-        }
-
-        return i;
-    }
-
-    /**
-     * A routine that knows how and when to quote and escape the given value.
-     */
-    private static String quote(String value) {
-        boolean needsQuotes = false;
-
-        //    check to see if we actually have to quote this thing
-        int length = value.length();
-        for(int i = 0; (i < length) && !needsQuotes; ++i) {
-            needsQuotes = !isTokenChar(value.charAt(i));
-        }
-
-        if(needsQuotes) {
-            StringBuilder buffer = new StringBuilder((int)(length * 1.5));
-
-            //    add the initial quote
-            buffer.append('"');
-
-            //    add the properly escaped text
-            for(int i = 0; i < length; ++i) {
-                char c = value.charAt(i);
-                if((c == '\\') || (c == '"')) {
-                    buffer.append('\\');
-                }
-                buffer.append(c);
-            }
-
-            //    add the closing quote
-            buffer.append('"');
-
-            return buffer.toString();
-        }
-        else
-        {
-            return value;
-        }
-    }
-
-    /**
-     * A routine that knows how to strip the quotes and escape sequences from the given value.
-     */
-    private static String unquote(String value) {
-        int valueLength = value.length();
-        StringBuilder buffer = new StringBuilder(valueLength);
-
-        boolean escaped = false;
-        for(int i = 0; i < valueLength; ++i) {
-            char currentChar = value.charAt(i);
-            if(!escaped && (currentChar != '\\')) {
-                buffer.append(currentChar);
-            } else if(escaped) {
-                buffer.append(currentChar);
-                escaped = false;
-            } else {
-                escaped = true;
-            }
-        }
-
-        return buffer.toString();
-    }
-
-    /**
-     * A string that holds all the special chars.
-     */
-    private static final String TSPECIALS = "()<>@,;:\\\"/[]?=";
-
-}
--- a/jdk/src/java.desktop/share/classes/java/awt/datatransfer/MimeTypeParseException.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 1997, 2006, 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;
-
-
-/**
- *    A class to encapsulate MimeType parsing related exceptions
- *
- * @serial exclude
- * @since 1.3
- */
-public class MimeTypeParseException extends Exception {
-
-    // use serialVersionUID from JDK 1.2.2 for interoperability
-    private static final long serialVersionUID = -5604407764691570741L;
-
-    /**
-     * Constructs a MimeTypeParseException with no specified detail message.
-     */
-    public MimeTypeParseException() {
-        super();
-    }
-
-    /**
-     * Constructs a MimeTypeParseException with the specified detail message.
-     *
-     * @param   s   the detail message.
-     */
-    public MimeTypeParseException(String s) {
-        super(s);
-    }
-} // class MimeTypeParseException
--- a/jdk/src/java.desktop/share/classes/java/awt/datatransfer/StringSelection.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,143 +0,0 @@
-/*
- * 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 java.io.*;
-
-
-/**
- * A <code>Transferable</code> which implements the capability required
- * to transfer a <code>String</code>.
- *
- * This <code>Transferable</code> properly supports
- * <code>DataFlavor.stringFlavor</code>
- * and all equivalent flavors. Support for
- * <code>DataFlavor.plainTextFlavor</code>
- * and all equivalent flavors is <b>deprecated</b>. No other
- * <code>DataFlavor</code>s are supported.
- *
- * @see java.awt.datatransfer.DataFlavor#stringFlavor
- * @see java.awt.datatransfer.DataFlavor#plainTextFlavor
- */
-public class StringSelection implements Transferable, ClipboardOwner {
-
-    private static final int STRING = 0;
-    private static final int PLAIN_TEXT = 1;
-
-    @SuppressWarnings("deprecation")
-    private static final DataFlavor[] flavors = {
-        DataFlavor.stringFlavor,
-        DataFlavor.plainTextFlavor // deprecated
-    };
-
-    private String data;
-
-    /**
-     * Creates a <code>Transferable</code> capable of transferring
-     * the specified <code>String</code>.
-     * @param data the string to be transferred
-     */
-    public StringSelection(String data) {
-        this.data = data;
-    }
-
-    /**
-     * Returns an array of flavors in which this <code>Transferable</code>
-     * can provide the data. <code>DataFlavor.stringFlavor</code>
-     * is properly supported.
-     * Support for <code>DataFlavor.plainTextFlavor</code> is
-     * <b>deprecated</b>.
-     *
-     * @return an array of length two, whose elements are <code>DataFlavor.
-     *         stringFlavor</code> and <code>DataFlavor.plainTextFlavor</code>
-     */
-    public DataFlavor[] getTransferDataFlavors() {
-        // returning flavors itself would allow client code to modify
-        // our internal behavior
-        return flavors.clone();
-    }
-
-    /**
-     * Returns whether the requested flavor is supported by this
-     * <code>Transferable</code>.
-     *
-     * @param flavor the requested flavor for the data
-     * @return true if <code>flavor</code> is equal to
-     *   <code>DataFlavor.stringFlavor</code> or
-     *   <code>DataFlavor.plainTextFlavor</code>; false if <code>flavor</code>
-     *   is not one of the above flavors
-     * @throws NullPointerException if flavor is <code>null</code>
-     */
-    public boolean isDataFlavorSupported(DataFlavor flavor) {
-        // JCK Test StringSelection0003: if 'flavor' is null, throw NPE
-        for (int i = 0; i < flavors.length; i++) {
-            if (flavor.equals(flavors[i])) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    /**
-     * Returns the <code>Transferable</code>'s data in the requested
-     * <code>DataFlavor</code> if possible. If the desired flavor is
-     * <code>DataFlavor.stringFlavor</code>, or an equivalent flavor,
-     * the <code>String</code> representing the selection is
-     * returned. If the desired flavor is
-     * <code>DataFlavor.plainTextFlavor</code>,
-     * or an equivalent flavor, a <code>Reader</code> is returned.
-     * <b>Note:</b> The behavior of this method for
-     * <code>DataFlavor.plainTextFlavor</code>
-     * and equivalent <code>DataFlavor</code>s is inconsistent with the
-     * definition of <code>DataFlavor.plainTextFlavor</code>.
-     *
-     * @param flavor the requested flavor for the data
-     * @return the data in the requested flavor, as outlined above
-     * @throws UnsupportedFlavorException if the requested data flavor is
-     *         not equivalent to either <code>DataFlavor.stringFlavor</code>
-     *         or <code>DataFlavor.plainTextFlavor</code>
-     * @throws IOException if an IOException occurs while retrieving the data.
-     *         By default, StringSelection never throws this exception, but a
-     *         subclass may.
-     * @throws NullPointerException if flavor is <code>null</code>
-     * @see java.io.Reader
-     */
-    public Object getTransferData(DataFlavor flavor)
-        throws UnsupportedFlavorException, IOException
-    {
-        // JCK Test StringSelection0007: if 'flavor' is null, throw NPE
-        if (flavor.equals(flavors[STRING])) {
-            return (Object)data;
-        } else if (flavor.equals(flavors[PLAIN_TEXT])) {
-            return new StringReader(data == null ? "" : data);
-        } else {
-            throw new UnsupportedFlavorException(flavor);
-        }
-    }
-
-    public void lostOwnership(Clipboard clipboard, Transferable contents) {
-    }
-}
--- a/jdk/src/java.desktop/share/classes/java/awt/datatransfer/SystemFlavorMap.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1094 +0,0 @@
-/*
- * Copyright (c) 1997, 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 sun.datatransfer.DesktopDatatransferService;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.lang.ref.SoftReference;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Set;
-
-/**
- * The SystemFlavorMap is a configurable map between "natives" (Strings), which
- * correspond to platform-specific data formats, and "flavors" (DataFlavors),
- * which correspond to platform-independent MIME types. This mapping is used
- * by the data transfer subsystem to transfer data between Java and native
- * applications, and between Java applications in separate VMs.
- *
- * @since 1.2
- */
-public final class SystemFlavorMap implements FlavorMap, FlavorTable {
-
-    /**
-     * Constant prefix used to tag Java types converted to native platform
-     * type.
-     */
-    private static String JavaMIME = "JAVA_DATAFLAVOR:";
-
-    private static final Object FLAVOR_MAP_KEY = new Object();
-
-    /**
-     * The list of valid, decoded text flavor representation classes, in order
-     * from best to worst.
-     */
-    private static final String[] UNICODE_TEXT_CLASSES = {
-        "java.io.Reader", "java.lang.String", "java.nio.CharBuffer", "\"[C\""
-    };
-
-    /**
-     * The list of valid, encoded text flavor representation classes, in order
-     * from best to worst.
-     */
-    private static final String[] ENCODED_TEXT_CLASSES = {
-        "java.io.InputStream", "java.nio.ByteBuffer", "\"[B\""
-    };
-
-    /**
-     * A String representing text/plain MIME type.
-     */
-    private static final String TEXT_PLAIN_BASE_TYPE = "text/plain";
-
-    /**
-     * A String representing text/html MIME type.
-     */
-    private static final String HTML_TEXT_BASE_TYPE = "text/html";
-
-    /**
-     * Maps native Strings to Lists of DataFlavors (or base type Strings for
-     * text DataFlavors).
-     * Do not use the field directly, use getNativeToFlavor() instead.
-     */
-    private final Map<String, LinkedHashSet<DataFlavor>> nativeToFlavor = new HashMap<>();
-
-    /**
-     * Accessor to nativeToFlavor map.  Since we use lazy initialization we must
-     * use this accessor instead of direct access to the field which may not be
-     * initialized yet.  This method will initialize the field if needed.
-     *
-     * @return nativeToFlavor
-     */
-    private Map<String, LinkedHashSet<DataFlavor>> getNativeToFlavor() {
-        if (!isMapInitialized) {
-            initSystemFlavorMap();
-        }
-        return nativeToFlavor;
-    }
-
-    /**
-     * Maps DataFlavors (or base type Strings for text DataFlavors) to Lists of
-     * native Strings.
-     * Do not use the field directly, use getFlavorToNative() instead.
-     */
-    private final Map<DataFlavor, LinkedHashSet<String>> flavorToNative = new HashMap<>();
-
-    /**
-     * Accessor to flavorToNative map.  Since we use lazy initialization we must
-     * use this accessor instead of direct access to the field which may not be
-     * initialized yet.  This method will initialize the field if needed.
-     *
-     * @return flavorToNative
-     */
-    private synchronized Map<DataFlavor, LinkedHashSet<String>> getFlavorToNative() {
-        if (!isMapInitialized) {
-            initSystemFlavorMap();
-        }
-        return flavorToNative;
-    }
-
-    /**
-     * Maps a text DataFlavor primary mime-type to the native. Used only to store
-     * standard mappings registered in the flavormap.properties
-     * Do not use this field directly, use getTextTypeToNative() instead.
-     */
-    private Map<String, LinkedHashSet<String>> textTypeToNative = new HashMap<>();
-
-    /**
-     * Shows if the object has been initialized.
-     */
-    private boolean isMapInitialized = false;
-
-    /**
-     * An accessor to textTypeToNative map.  Since we use lazy initialization we
-     * must use this accessor instead of direct access to the field which may not
-     * be initialized yet. This method will initialize the field if needed.
-     *
-     * @return textTypeToNative
-     */
-    private synchronized Map<String, LinkedHashSet<String>> getTextTypeToNative() {
-        if (!isMapInitialized) {
-            initSystemFlavorMap();
-            // From this point the map should not be modified
-            textTypeToNative = Collections.unmodifiableMap(textTypeToNative);
-        }
-        return textTypeToNative;
-    }
-
-    /**
-     * Caches the result of getNativesForFlavor(). Maps DataFlavors to
-     * SoftReferences which reference LinkedHashSet of String natives.
-     */
-    private final SoftCache<DataFlavor, String> nativesForFlavorCache = new SoftCache<>();
-
-    /**
-     * Caches the result getFlavorsForNative(). Maps String natives to
-     * SoftReferences which reference LinkedHashSet of DataFlavors.
-     */
-    private final SoftCache<String, DataFlavor> flavorsForNativeCache = new SoftCache<>();
-
-    /**
-     * Dynamic mapping generation used for text mappings should not be applied
-     * to the DataFlavors and String natives for which the mappings have been
-     * explicitly specified with setFlavorsForNative() or
-     * setNativesForFlavor(). This keeps all such keys.
-     */
-    private Set<Object> disabledMappingGenerationKeys = new HashSet<>();
-
-    /**
-     * Returns the default FlavorMap for this thread's ClassLoader.
-     *
-     * @return the default FlavorMap for this thread's ClassLoader
-     */
-    public static FlavorMap getDefaultFlavorMap() {
-        return DataFlavorUtil.getDesktopService().getFlavorMap(SystemFlavorMap::new);
-    }
-
-    private SystemFlavorMap() {
-    }
-
-    /**
-     * Initializes a SystemFlavorMap by reading flavormap.properties
-     * For thread-safety must be called under lock on this.
-     */
-    private void initSystemFlavorMap() {
-        if (isMapInitialized) {
-            return;
-        }
-        isMapInitialized = true;
-
-        InputStream is = SystemFlavorMap.class.getResourceAsStream("/sun/datatransfer/resources/flavormap.properties");
-        if (is == null) {
-            throw new InternalError("Default flavor mapping not found");
-        }
-
-        try (InputStreamReader isr = new InputStreamReader(is);
-             BufferedReader reader = new BufferedReader(isr)) {
-            String line;
-            while ((line = reader.readLine()) != null) {
-                line = line.trim();
-                if (line.startsWith("#") || line.isEmpty()) continue;
-                while (line.endsWith("\\")) {
-                    line = line.substring(0, line.length() - 1) + reader.readLine().trim();
-                }
-                int delimiterPosition = line.indexOf('=');
-                String key = line.substring(0, delimiterPosition).replaceAll("\\ ", " ");
-                String[] values = line.substring(delimiterPosition + 1, line.length()).split(",");
-                for (String value : values) {
-                    try {
-                        value = loadConvert(value);
-                        MimeType mime = new MimeType(value);
-                        if ("text".equals(mime.getPrimaryType())) {
-                            String charset = mime.getParameter("charset");
-                            if (DataFlavorUtil.doesSubtypeSupportCharset(mime.getSubType(), charset))
-                            {
-                                // We need to store the charset and eoln
-                                // parameters, if any, so that the
-                                // DataTransferer will have this information
-                                // for conversion into the native format.
-                                DesktopDatatransferService desktopService =
-                                        DataFlavorUtil.getDesktopService();
-                                if (desktopService.isDesktopPresent()) {
-                                    desktopService.registerTextFlavorProperties(
-                                            key, charset,
-                                            mime.getParameter("eoln"),
-                                            mime.getParameter("terminators"));
-                                }
-                            }
-
-                            // But don't store any of these parameters in the
-                            // DataFlavor itself for any text natives (even
-                            // non-charset ones). The SystemFlavorMap will
-                            // synthesize the appropriate mappings later.
-                            mime.removeParameter("charset");
-                            mime.removeParameter("class");
-                            mime.removeParameter("eoln");
-                            mime.removeParameter("terminators");
-                            value = mime.toString();
-                        }
-                    } catch (MimeTypeParseException e) {
-                        e.printStackTrace();
-                        continue;
-                    }
-
-                    DataFlavor flavor;
-                    try {
-                        flavor = new DataFlavor(value);
-                    } catch (Exception e) {
-                        try {
-                            flavor = new DataFlavor(value, null);
-                        } catch (Exception ee) {
-                            ee.printStackTrace();
-                            continue;
-                        }
-                    }
-
-                    final LinkedHashSet<DataFlavor> dfs = new LinkedHashSet<>();
-                    dfs.add(flavor);
-
-                    if ("text".equals(flavor.getPrimaryType())) {
-                        dfs.addAll(convertMimeTypeToDataFlavors(value));
-                        store(flavor.mimeType.getBaseType(), key, getTextTypeToNative());
-                    }
-
-                    for (DataFlavor df : dfs) {
-                        store(df, key, getFlavorToNative());
-                        store(key, df, getNativeToFlavor());
-                    }
-                }
-            }
-        } catch (IOException e) {
-            throw new InternalError("Error reading default flavor mapping", e);
-        }
-    }
-
-    // Copied from java.util.Properties
-    private static String loadConvert(String theString) {
-        char aChar;
-        int len = theString.length();
-        StringBuilder outBuffer = new StringBuilder(len);
-
-        for (int x = 0; x < len; ) {
-            aChar = theString.charAt(x++);
-            if (aChar == '\\') {
-                aChar = theString.charAt(x++);
-                if (aChar == 'u') {
-                    // Read the xxxx
-                    int value = 0;
-                    for (int i = 0; i < 4; i++) {
-                        aChar = theString.charAt(x++);
-                        switch (aChar) {
-                            case '0': case '1': case '2': case '3': case '4':
-                            case '5': case '6': case '7': case '8': case '9': {
-                                value = (value << 4) + aChar - '0';
-                                break;
-                            }
-                            case 'a': case 'b': case 'c':
-                            case 'd': case 'e': case 'f': {
-                                value = (value << 4) + 10 + aChar - 'a';
-                                break;
-                            }
-                            case 'A': case 'B': case 'C':
-                            case 'D': case 'E': case 'F': {
-                                value = (value << 4) + 10 + aChar - 'A';
-                                break;
-                            }
-                            default: {
-                                throw new IllegalArgumentException(
-                                        "Malformed \\uxxxx encoding.");
-                            }
-                        }
-                    }
-                    outBuffer.append((char)value);
-                } else {
-                    if (aChar == 't') {
-                        aChar = '\t';
-                    } else if (aChar == 'r') {
-                        aChar = '\r';
-                    } else if (aChar == 'n') {
-                        aChar = '\n';
-                    } else if (aChar == 'f') {
-                        aChar = '\f';
-                    }
-                    outBuffer.append(aChar);
-                }
-            } else {
-                outBuffer.append(aChar);
-            }
-        }
-        return outBuffer.toString();
-    }
-
-    /**
-     * Stores the listed object under the specified hash key in map. Unlike a
-     * standard map, the listed object will not replace any object already at
-     * the appropriate Map location, but rather will be appended to a List
-     * stored in that location.
-     */
-    private <H, L> void store(H hashed, L listed, Map<H, LinkedHashSet<L>> map) {
-        LinkedHashSet<L> list = map.get(hashed);
-        if (list == null) {
-            list = new LinkedHashSet<>(1);
-            map.put(hashed, list);
-        }
-        if (!list.contains(listed)) {
-            list.add(listed);
-        }
-    }
-
-    /**
-     * Semantically equivalent to 'nativeToFlavor.get(nat)'. This method
-     * handles the case where 'nat' is not found in 'nativeToFlavor'. In that
-     * case, a new DataFlavor is synthesized, stored, and returned, if and
-     * only if the specified native is encoded as a Java MIME type.
-     */
-    private LinkedHashSet<DataFlavor> nativeToFlavorLookup(String nat) {
-        LinkedHashSet<DataFlavor> flavors = getNativeToFlavor().get(nat);
-
-        if (nat != null && !disabledMappingGenerationKeys.contains(nat)) {
-            DesktopDatatransferService desktopService = DataFlavorUtil.getDesktopService();
-            if (desktopService.isDesktopPresent()) {
-                LinkedHashSet<DataFlavor> platformFlavors =
-                        desktopService.getPlatformMappingsForNative(nat);
-                if (!platformFlavors.isEmpty()) {
-                    if (flavors != null) {
-                        // Prepending the platform-specific mappings ensures
-                        // that the flavors added with
-                        // addFlavorForUnencodedNative() are at the end of
-                        // list.
-                        platformFlavors.addAll(flavors);
-                    }
-                    flavors = platformFlavors;
-                }
-            }
-        }
-
-        if (flavors == null && isJavaMIMEType(nat)) {
-            String decoded = decodeJavaMIMEType(nat);
-            DataFlavor flavor = null;
-
-            try {
-                flavor = new DataFlavor(decoded);
-            } catch (Exception e) {
-                System.err.println("Exception \"" + e.getClass().getName() +
-                                   ": " + e.getMessage()  +
-                                   "\"while constructing DataFlavor for: " +
-                                   decoded);
-            }
-
-            if (flavor != null) {
-                flavors = new LinkedHashSet<>(1);
-                getNativeToFlavor().put(nat, flavors);
-                flavors.add(flavor);
-                flavorsForNativeCache.remove(nat);
-
-                LinkedHashSet<String> natives = getFlavorToNative().get(flavor);
-                if (natives == null) {
-                    natives = new LinkedHashSet<>(1);
-                    getFlavorToNative().put(flavor, natives);
-                }
-                natives.add(nat);
-                nativesForFlavorCache.remove(flavor);
-            }
-        }
-
-        return (flavors != null) ? flavors : new LinkedHashSet<>(0);
-    }
-
-    /**
-     * Semantically equivalent to 'flavorToNative.get(flav)'. This method
-     * handles the case where 'flav' is not found in 'flavorToNative' depending
-     * on the value of passes 'synthesize' parameter. If 'synthesize' is
-     * SYNTHESIZE_IF_NOT_FOUND a native is synthesized, stored, and returned by
-     * encoding the DataFlavor's MIME type. Otherwise an empty List is returned
-     * and 'flavorToNative' remains unaffected.
-     */
-    private LinkedHashSet<String> flavorToNativeLookup(final DataFlavor flav,
-                                                       final boolean synthesize) {
-
-        LinkedHashSet<String> natives = getFlavorToNative().get(flav);
-
-        if (flav != null && !disabledMappingGenerationKeys.contains(flav)) {
-            DesktopDatatransferService desktopService = DataFlavorUtil.getDesktopService();
-            if (desktopService.isDesktopPresent()) {
-                LinkedHashSet<String> platformNatives =
-                        desktopService.getPlatformMappingsForFlavor(flav);
-                if (!platformNatives.isEmpty()) {
-                    if (natives != null) {
-                        // Prepend the platform-specific mappings to ensure
-                        // that the natives added with
-                        // addUnencodedNativeForFlavor() are at the end of
-                        // list.
-                        platformNatives.addAll(natives);
-                    }
-                    natives = platformNatives;
-                }
-            }
-        }
-
-        if (natives == null) {
-            if (synthesize) {
-                String encoded = encodeDataFlavor(flav);
-                natives = new LinkedHashSet<>(1);
-                getFlavorToNative().put(flav, natives);
-                natives.add(encoded);
-
-                LinkedHashSet<DataFlavor> flavors = getNativeToFlavor().get(encoded);
-                if (flavors == null) {
-                    flavors = new LinkedHashSet<>(1);
-                    getNativeToFlavor().put(encoded, flavors);
-                }
-                flavors.add(flav);
-
-                nativesForFlavorCache.remove(flav);
-                flavorsForNativeCache.remove(encoded);
-            } else {
-                natives = new LinkedHashSet<>(0);
-            }
-        }
-
-        return new LinkedHashSet<>(natives);
-    }
-
-    /**
-     * Returns a <code>List</code> of <code>String</code> natives to which the
-     * specified <code>DataFlavor</code> can be translated by the data transfer
-     * subsystem. The <code>List</code> will be sorted from best native to
-     * worst. That is, the first native will best reflect data in the specified
-     * flavor to the underlying native platform.
-     * <p>
-     * If the specified <code>DataFlavor</code> is previously unknown to the
-     * data transfer subsystem and the data transfer subsystem is unable to
-     * translate this <code>DataFlavor</code> to any existing native, then
-     * invoking this method will establish a
-     * mapping in both directions between the specified <code>DataFlavor</code>
-     * and an encoded version of its MIME type as its native.
-     *
-     * @param flav the <code>DataFlavor</code> whose corresponding natives
-     *        should be returned. If <code>null</code> is specified, all
-     *        natives currently known to the data transfer subsystem are
-     *        returned in a non-deterministic order.
-     * @return a <code>java.util.List</code> of <code>java.lang.String</code>
-     *         objects which are platform-specific representations of platform-
-     *         specific data formats
-     *
-     * @see #encodeDataFlavor
-     * @since 1.4
-     */
-    @Override
-    public synchronized List<String> getNativesForFlavor(DataFlavor flav) {
-        LinkedHashSet<String> retval = nativesForFlavorCache.check(flav);
-        if (retval != null) {
-            return new ArrayList<>(retval);
-        }
-
-        if (flav == null) {
-            retval = new LinkedHashSet<>(getNativeToFlavor().keySet());
-        } else if (disabledMappingGenerationKeys.contains(flav)) {
-            // In this case we shouldn't synthesize a native for this flavor,
-            // since its mappings were explicitly specified.
-            retval = flavorToNativeLookup(flav, false);
-        } else if (DataFlavorUtil.isFlavorCharsetTextType(flav)) {
-            retval = new LinkedHashSet<>(0);
-
-            // For text/* flavors, flavor-to-native mappings specified in
-            // flavormap.properties are stored per flavor's base type.
-            if ("text".equals(flav.getPrimaryType())) {
-                LinkedHashSet<String> textTypeNatives =
-                        getTextTypeToNative().get(flav.mimeType.getBaseType());
-                if (textTypeNatives != null) {
-                    retval.addAll(textTypeNatives);
-                }
-            }
-
-            // Also include text/plain natives, but don't duplicate Strings
-            LinkedHashSet<String> textTypeNatives =
-                    getTextTypeToNative().get(TEXT_PLAIN_BASE_TYPE);
-            if (textTypeNatives != null) {
-                retval.addAll(textTypeNatives);
-            }
-
-            if (retval.isEmpty()) {
-                retval = flavorToNativeLookup(flav, true);
-            } else {
-                // In this branch it is guaranteed that natives explicitly
-                // listed for flav's MIME type were added with
-                // addUnencodedNativeForFlavor(), so they have lower priority.
-                retval.addAll(flavorToNativeLookup(flav, false));
-            }
-        } else if (DataFlavorUtil.isFlavorNoncharsetTextType(flav)) {
-            retval = getTextTypeToNative().get(flav.mimeType.getBaseType());
-
-            if (retval == null || retval.isEmpty()) {
-                retval = flavorToNativeLookup(flav, true);
-            } else {
-                // In this branch it is guaranteed that natives explicitly
-                // listed for flav's MIME type were added with
-                // addUnencodedNativeForFlavor(), so they have lower priority.
-                retval.addAll(flavorToNativeLookup(flav, false));
-            }
-        } else {
-            retval = flavorToNativeLookup(flav, true);
-        }
-
-        nativesForFlavorCache.put(flav, retval);
-        // Create a copy, because client code can modify the returned list.
-        return new ArrayList<>(retval);
-    }
-
-    /**
-     * Returns a <code>List</code> of <code>DataFlavor</code>s to which the
-     * specified <code>String</code> native can be translated by the data
-     * transfer subsystem. The <code>List</code> will be sorted from best
-     * <code>DataFlavor</code> to worst. That is, the first
-     * <code>DataFlavor</code> will best reflect data in the specified
-     * native to a Java application.
-     * <p>
-     * If the specified native is previously unknown to the data transfer
-     * subsystem, and that native has been properly encoded, then invoking this
-     * method will establish a mapping in both directions between the specified
-     * native and a <code>DataFlavor</code> whose MIME type is a decoded
-     * version of the native.
-     * <p>
-     * If the specified native is not a properly encoded native and the
-     * mappings for this native have not been altered with
-     * <code>setFlavorsForNative</code>, then the contents of the
-     * <code>List</code> is platform dependent, but <code>null</code>
-     * cannot be returned.
-     *
-     * @param nat the native whose corresponding <code>DataFlavor</code>s
-     *        should be returned. If <code>null</code> is specified, all
-     *        <code>DataFlavor</code>s currently known to the data transfer
-     *        subsystem are returned in a non-deterministic order.
-     * @return a <code>java.util.List</code> of <code>DataFlavor</code>
-     *         objects into which platform-specific data in the specified,
-     *         platform-specific native can be translated
-     *
-     * @see #encodeJavaMIMEType
-     * @since 1.4
-     */
-    @Override
-    public synchronized List<DataFlavor> getFlavorsForNative(String nat) {
-        LinkedHashSet<DataFlavor> returnValue = flavorsForNativeCache.check(nat);
-        if (returnValue != null) {
-            return new ArrayList<>(returnValue);
-        } else {
-            returnValue = new LinkedHashSet<>();
-        }
-
-        if (nat == null) {
-            for (String n : getNativesForFlavor(null)) {
-                returnValue.addAll(getFlavorsForNative(n));
-            }
-        } else {
-            final LinkedHashSet<DataFlavor> flavors = nativeToFlavorLookup(nat);
-            if (disabledMappingGenerationKeys.contains(nat)) {
-                return new ArrayList<>(flavors);
-            }
-
-            final LinkedHashSet<DataFlavor> flavorsWithSynthesized =
-                    nativeToFlavorLookup(nat);
-
-            for (DataFlavor df : flavorsWithSynthesized) {
-                returnValue.add(df);
-                if ("text".equals(df.getPrimaryType())) {
-                    String baseType = df.mimeType.getBaseType();
-                    returnValue.addAll(convertMimeTypeToDataFlavors(baseType));
-                }
-            }
-        }
-        flavorsForNativeCache.put(nat, returnValue);
-        return new ArrayList<>(returnValue);
-    }
-
-    @SuppressWarnings("deprecation")
-    private static Set<DataFlavor> convertMimeTypeToDataFlavors(
-        final String baseType) {
-
-        final Set<DataFlavor> returnValue = new LinkedHashSet<>();
-
-        String subType = null;
-
-        try {
-            final MimeType mimeType = new MimeType(baseType);
-            subType = mimeType.getSubType();
-        } catch (MimeTypeParseException mtpe) {
-            // Cannot happen, since we checked all mappings
-            // on load from flavormap.properties.
-        }
-
-        if (DataFlavorUtil.doesSubtypeSupportCharset(subType, null)) {
-            if (TEXT_PLAIN_BASE_TYPE.equals(baseType))
-            {
-                returnValue.add(DataFlavor.stringFlavor);
-            }
-
-            for (String unicodeClassName : UNICODE_TEXT_CLASSES) {
-                final String mimeType = baseType + ";charset=Unicode;class=" +
-                                            unicodeClassName;
-
-                final LinkedHashSet<String> mimeTypes =
-                    handleHtmlMimeTypes(baseType, mimeType);
-                for (String mt : mimeTypes) {
-                    DataFlavor toAdd = null;
-                    try {
-                        toAdd = new DataFlavor(mt);
-                    } catch (ClassNotFoundException cannotHappen) {
-                    }
-                    returnValue.add(toAdd);
-                }
-            }
-
-            for (String charset : DataFlavorUtil.standardEncodings()) {
-
-                for (String encodedTextClass : ENCODED_TEXT_CLASSES) {
-                    final String mimeType =
-                            baseType + ";charset=" + charset +
-                            ";class=" + encodedTextClass;
-
-                    final LinkedHashSet<String> mimeTypes =
-                        handleHtmlMimeTypes(baseType, mimeType);
-
-                    for (String mt : mimeTypes) {
-
-                        DataFlavor df = null;
-
-                        try {
-                            df = new DataFlavor(mt);
-                            // Check for equality to plainTextFlavor so
-                            // that we can ensure that the exact charset of
-                            // plainTextFlavor, not the canonical charset
-                            // or another equivalent charset with a
-                            // different name, is used.
-                            if (df.equals(DataFlavor.plainTextFlavor)) {
-                                df = DataFlavor.plainTextFlavor;
-                            }
-                        } catch (ClassNotFoundException cannotHappen) {
-                        }
-
-                        returnValue.add(df);
-                    }
-                }
-            }
-
-            if (TEXT_PLAIN_BASE_TYPE.equals(baseType))
-            {
-                returnValue.add(DataFlavor.plainTextFlavor);
-            }
-        } else {
-            // Non-charset text natives should be treated as
-            // opaque, 8-bit data in any of its various
-            // representations.
-            for (String encodedTextClassName : ENCODED_TEXT_CLASSES) {
-                DataFlavor toAdd = null;
-                try {
-                    toAdd = new DataFlavor(baseType +
-                         ";class=" + encodedTextClassName);
-                } catch (ClassNotFoundException cannotHappen) {
-                }
-                returnValue.add(toAdd);
-            }
-        }
-        return returnValue;
-    }
-
-    private static final String [] htmlDocumentTypes =
-            new String [] {"all", "selection", "fragment"};
-
-    private static LinkedHashSet<String> handleHtmlMimeTypes(String baseType,
-                                                             String mimeType) {
-
-        LinkedHashSet<String> returnValues = new LinkedHashSet<>();
-
-        if (HTML_TEXT_BASE_TYPE.equals(baseType)) {
-            for (String documentType : htmlDocumentTypes) {
-                returnValues.add(mimeType + ";document=" + documentType);
-            }
-        } else {
-            returnValues.add(mimeType);
-        }
-
-        return returnValues;
-    }
-
-    /**
-     * Returns a <code>Map</code> of the specified <code>DataFlavor</code>s to
-     * their most preferred <code>String</code> native. Each native value will
-     * be the same as the first native in the List returned by
-     * <code>getNativesForFlavor</code> for the specified flavor.
-     * <p>
-     * If a specified <code>DataFlavor</code> is previously unknown to the
-     * data transfer subsystem, then invoking this method will establish a
-     * mapping in both directions between the specified <code>DataFlavor</code>
-     * and an encoded version of its MIME type as its native.
-     *
-     * @param flavors an array of <code>DataFlavor</code>s which will be the
-     *        key set of the returned <code>Map</code>. If <code>null</code> is
-     *        specified, a mapping of all <code>DataFlavor</code>s known to the
-     *        data transfer subsystem to their most preferred
-     *        <code>String</code> natives will be returned.
-     * @return a <code>java.util.Map</code> of <code>DataFlavor</code>s to
-     *         <code>String</code> natives
-     *
-     * @see #getNativesForFlavor
-     * @see #encodeDataFlavor
-     */
-    @Override
-    public synchronized Map<DataFlavor,String> getNativesForFlavors(DataFlavor[] flavors)
-    {
-        // Use getNativesForFlavor to generate extra natives for text flavors
-        // and stringFlavor
-
-        if (flavors == null) {
-            List<DataFlavor> flavor_list = getFlavorsForNative(null);
-            flavors = new DataFlavor[flavor_list.size()];
-            flavor_list.toArray(flavors);
-        }
-
-        Map<DataFlavor, String> retval = new HashMap<>(flavors.length, 1.0f);
-        for (DataFlavor flavor : flavors) {
-            List<String> natives = getNativesForFlavor(flavor);
-            String nat = (natives.isEmpty()) ? null : natives.get(0);
-            retval.put(flavor, nat);
-        }
-
-        return retval;
-    }
-
-    /**
-     * Returns a <code>Map</code> of the specified <code>String</code> natives
-     * to their most preferred <code>DataFlavor</code>. Each
-     * <code>DataFlavor</code> value will be the same as the first
-     * <code>DataFlavor</code> in the List returned by
-     * <code>getFlavorsForNative</code> for the specified native.
-     * <p>
-     * If a specified native is previously unknown to the data transfer
-     * subsystem, and that native has been properly encoded, then invoking this
-     * method will establish a mapping in both directions between the specified
-     * native and a <code>DataFlavor</code> whose MIME type is a decoded
-     * version of the native.
-     *
-     * @param natives an array of <code>String</code>s which will be the
-     *        key set of the returned <code>Map</code>. If <code>null</code> is
-     *        specified, a mapping of all supported <code>String</code> natives
-     *        to their most preferred <code>DataFlavor</code>s will be
-     *        returned.
-     * @return a <code>java.util.Map</code> of <code>String</code> natives to
-     *         <code>DataFlavor</code>s
-     *
-     * @see #getFlavorsForNative
-     * @see #encodeJavaMIMEType
-     */
-    @Override
-    public synchronized Map<String,DataFlavor> getFlavorsForNatives(String[] natives)
-    {
-        // Use getFlavorsForNative to generate extra flavors for text natives
-        if (natives == null) {
-            List<String> nativesList = getNativesForFlavor(null);
-            natives = new String[nativesList.size()];
-            nativesList.toArray(natives);
-        }
-
-        Map<String, DataFlavor> retval = new HashMap<>(natives.length, 1.0f);
-        for (String aNative : natives) {
-            List<DataFlavor> flavors = getFlavorsForNative(aNative);
-            DataFlavor flav = (flavors.isEmpty())? null : flavors.get(0);
-            retval.put(aNative, flav);
-        }
-        return retval;
-    }
-
-    /**
-     * Adds a mapping from the specified <code>DataFlavor</code> (and all
-     * <code>DataFlavor</code>s equal to the specified <code>DataFlavor</code>)
-     * to the specified <code>String</code> native.
-     * Unlike <code>getNativesForFlavor</code>, the mapping will only be
-     * established in one direction, and the native will not be encoded. To
-     * establish a two-way mapping, call
-     * <code>addFlavorForUnencodedNative</code> as well. The new mapping will
-     * be of lower priority than any existing mapping.
-     * This method has no effect if a mapping from the specified or equal
-     * <code>DataFlavor</code> to the specified <code>String</code> native
-     * already exists.
-     *
-     * @param flav the <code>DataFlavor</code> key for the mapping
-     * @param nat the <code>String</code> native value for the mapping
-     * @throws NullPointerException if flav or nat is <code>null</code>
-     *
-     * @see #addFlavorForUnencodedNative
-     * @since 1.4
-     */
-    public synchronized void addUnencodedNativeForFlavor(DataFlavor flav,
-                                                         String nat) {
-        Objects.requireNonNull(nat, "Null native not permitted");
-        Objects.requireNonNull(flav, "Null flavor not permitted");
-
-        LinkedHashSet<String> natives = getFlavorToNative().get(flav);
-        if (natives == null) {
-            natives = new LinkedHashSet<>(1);
-            getFlavorToNative().put(flav, natives);
-        }
-        natives.add(nat);
-        nativesForFlavorCache.remove(flav);
-    }
-
-    /**
-     * Discards the current mappings for the specified <code>DataFlavor</code>
-     * and all <code>DataFlavor</code>s equal to the specified
-     * <code>DataFlavor</code>, and creates new mappings to the
-     * specified <code>String</code> natives.
-     * Unlike <code>getNativesForFlavor</code>, the mappings will only be
-     * established in one direction, and the natives will not be encoded. To
-     * establish two-way mappings, call <code>setFlavorsForNative</code>
-     * as well. The first native in the array will represent the highest
-     * priority mapping. Subsequent natives will represent mappings of
-     * decreasing priority.
-     * <p>
-     * If the array contains several elements that reference equal
-     * <code>String</code> natives, this method will establish new mappings
-     * for the first of those elements and ignore the rest of them.
-     * <p>
-     * It is recommended that client code not reset mappings established by the
-     * data transfer subsystem. This method should only be used for
-     * application-level mappings.
-     *
-     * @param flav the <code>DataFlavor</code> key for the mappings
-     * @param natives the <code>String</code> native values for the mappings
-     * @throws NullPointerException if flav or natives is <code>null</code>
-     *         or if natives contains <code>null</code> elements
-     *
-     * @see #setFlavorsForNative
-     * @since 1.4
-     */
-    public synchronized void setNativesForFlavor(DataFlavor flav,
-                                                 String[] natives) {
-        Objects.requireNonNull(natives, "Null natives not permitted");
-        Objects.requireNonNull(flav, "Null flavors not permitted");
-
-        getFlavorToNative().remove(flav);
-        for (String aNative : natives) {
-            addUnencodedNativeForFlavor(flav, aNative);
-        }
-        disabledMappingGenerationKeys.add(flav);
-        nativesForFlavorCache.remove(flav);
-    }
-
-    /**
-     * Adds a mapping from a single <code>String</code> native to a single
-     * <code>DataFlavor</code>. Unlike <code>getFlavorsForNative</code>, the
-     * mapping will only be established in one direction, and the native will
-     * not be encoded. To establish a two-way mapping, call
-     * <code>addUnencodedNativeForFlavor</code> as well. The new mapping will
-     * be of lower priority than any existing mapping.
-     * This method has no effect if a mapping from the specified
-     * <code>String</code> native to the specified or equal
-     * <code>DataFlavor</code> already exists.
-     *
-     * @param nat the <code>String</code> native key for the mapping
-     * @param flav the <code>DataFlavor</code> value for the mapping
-     * @throws NullPointerException if nat or flav is <code>null</code>
-     *
-     * @see #addUnencodedNativeForFlavor
-     * @since 1.4
-     */
-    public synchronized void addFlavorForUnencodedNative(String nat,
-                                                         DataFlavor flav) {
-        Objects.requireNonNull(nat, "Null native not permitted");
-        Objects.requireNonNull(flav, "Null flavor not permitted");
-
-        LinkedHashSet<DataFlavor> flavors = getNativeToFlavor().get(nat);
-        if (flavors == null) {
-            flavors = new LinkedHashSet<>(1);
-            getNativeToFlavor().put(nat, flavors);
-        }
-        flavors.add(flav);
-        flavorsForNativeCache.remove(nat);
-    }
-
-    /**
-     * Discards the current mappings for the specified <code>String</code>
-     * native, and creates new mappings to the specified
-     * <code>DataFlavor</code>s. Unlike <code>getFlavorsForNative</code>, the
-     * mappings will only be established in one direction, and the natives need
-     * not be encoded. To establish two-way mappings, call
-     * <code>setNativesForFlavor</code> as well. The first
-     * <code>DataFlavor</code> in the array will represent the highest priority
-     * mapping. Subsequent <code>DataFlavor</code>s will represent mappings of
-     * decreasing priority.
-     * <p>
-     * If the array contains several elements that reference equal
-     * <code>DataFlavor</code>s, this method will establish new mappings
-     * for the first of those elements and ignore the rest of them.
-     * <p>
-     * It is recommended that client code not reset mappings established by the
-     * data transfer subsystem. This method should only be used for
-     * application-level mappings.
-     *
-     * @param nat the <code>String</code> native key for the mappings
-     * @param flavors the <code>DataFlavor</code> values for the mappings
-     * @throws NullPointerException if nat or flavors is <code>null</code>
-     *         or if flavors contains <code>null</code> elements
-     *
-     * @see #setNativesForFlavor
-     * @since 1.4
-     */
-    public synchronized void setFlavorsForNative(String nat,
-                                                 DataFlavor[] flavors) {
-        Objects.requireNonNull(nat, "Null native not permitted");
-        Objects.requireNonNull(flavors, "Null flavors not permitted");
-
-        getNativeToFlavor().remove(nat);
-        for (DataFlavor flavor : flavors) {
-            addFlavorForUnencodedNative(nat, flavor);
-        }
-        disabledMappingGenerationKeys.add(nat);
-        flavorsForNativeCache.remove(nat);
-    }
-
-    /**
-     * Encodes a MIME type for use as a <code>String</code> native. The format
-     * of an encoded representation of a MIME type is implementation-dependent.
-     * The only restrictions are:
-     * <ul>
-     * <li>The encoded representation is <code>null</code> if and only if the
-     * MIME type <code>String</code> is <code>null</code>.</li>
-     * <li>The encoded representations for two non-<code>null</code> MIME type
-     * <code>String</code>s are equal if and only if these <code>String</code>s
-     * are equal according to <code>String.equals(Object)</code>.</li>
-     * </ul>
-     * <p>
-     * The reference implementation of this method returns the specified MIME
-     * type <code>String</code> prefixed with <code>JAVA_DATAFLAVOR:</code>.
-     *
-     * @param mimeType the MIME type to encode
-     * @return the encoded <code>String</code>, or <code>null</code> if
-     *         mimeType is <code>null</code>
-     */
-    public static String encodeJavaMIMEType(String mimeType) {
-        return (mimeType != null)
-            ? JavaMIME + mimeType
-            : null;
-    }
-
-    /**
-     * Encodes a <code>DataFlavor</code> for use as a <code>String</code>
-     * native. The format of an encoded <code>DataFlavor</code> is
-     * implementation-dependent. The only restrictions are:
-     * <ul>
-     * <li>The encoded representation is <code>null</code> if and only if the
-     * specified <code>DataFlavor</code> is <code>null</code> or its MIME type
-     * <code>String</code> is <code>null</code>.</li>
-     * <li>The encoded representations for two non-<code>null</code>
-     * <code>DataFlavor</code>s with non-<code>null</code> MIME type
-     * <code>String</code>s are equal if and only if the MIME type
-     * <code>String</code>s of these <code>DataFlavor</code>s are equal
-     * according to <code>String.equals(Object)</code>.</li>
-     * </ul>
-     * <p>
-     * The reference implementation of this method returns the MIME type
-     * <code>String</code> of the specified <code>DataFlavor</code> prefixed
-     * with <code>JAVA_DATAFLAVOR:</code>.
-     *
-     * @param flav the <code>DataFlavor</code> to encode
-     * @return the encoded <code>String</code>, or <code>null</code> if
-     *         flav is <code>null</code> or has a <code>null</code> MIME type
-     */
-    public static String encodeDataFlavor(DataFlavor flav) {
-        return (flav != null)
-            ? SystemFlavorMap.encodeJavaMIMEType(flav.getMimeType())
-            : null;
-    }
-
-    /**
-     * Returns whether the specified <code>String</code> is an encoded Java
-     * MIME type.
-     *
-     * @param str the <code>String</code> to test
-     * @return <code>true</code> if the <code>String</code> is encoded;
-     *         <code>false</code> otherwise
-     */
-    public static boolean isJavaMIMEType(String str) {
-        return (str != null && str.startsWith(JavaMIME, 0));
-    }
-
-    /**
-     * Decodes a <code>String</code> native for use as a Java MIME type.
-     *
-     * @param nat the <code>String</code> to decode
-     * @return the decoded Java MIME type, or <code>null</code> if nat is not
-     *         an encoded <code>String</code> native
-     */
-    public static String decodeJavaMIMEType(String nat) {
-        return (isJavaMIMEType(nat))
-            ? nat.substring(JavaMIME.length(), nat.length()).trim()
-            : null;
-    }
-
-    /**
-     * Decodes a <code>String</code> native for use as a
-     * <code>DataFlavor</code>.
-     *
-     * @param nat the <code>String</code> to decode
-     * @return the decoded <code>DataFlavor</code>, or <code>null</code> if
-     *         nat is not an encoded <code>String</code> native
-     * @throws ClassNotFoundException if the class of the data flavor
-     * is not loaded
-     */
-    public static DataFlavor decodeDataFlavor(String nat)
-        throws ClassNotFoundException
-    {
-        String retval_str = SystemFlavorMap.decodeJavaMIMEType(nat);
-        return (retval_str != null)
-            ? new DataFlavor(retval_str)
-            : null;
-    }
-
-    private static final class SoftCache<K, V> {
-        Map<K, SoftReference<LinkedHashSet<V>>> cache;
-
-        public void put(K key, LinkedHashSet<V> value) {
-            if (cache == null) {
-                cache = new HashMap<>(1);
-            }
-            cache.put(key, new SoftReference<>(value));
-        }
-
-        public void remove(K key) {
-            if (cache == null) return;
-            cache.remove(null);
-            cache.remove(key);
-        }
-
-        public LinkedHashSet<V> check(K key) {
-            if (cache == null) return null;
-            SoftReference<LinkedHashSet<V>> ref = cache.get(key);
-            if (ref != null) {
-                return ref.get();
-            }
-            return null;
-        }
-    }
-}
--- a/jdk/src/java.desktop/share/classes/java/awt/datatransfer/Transferable.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-/*
- * 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 java.io.IOException;
-
-/**
- * Defines the interface for classes that can be used to provide data
- * for a transfer operation.
- * <p>
- * For information on using data transfer with Swing, see
- * <a href="http://docs.oracle.com/javase/tutorial/uiswing/dnd/index.html">
- * How to Use Drag and Drop and Data Transfer</a>,
- * a section in <em>The Java Tutorial</em>, for more information.
- *
- * @author      Amy Fowler
- */
-
-public interface Transferable {
-
-    /**
-     * Returns an array of DataFlavor objects indicating the flavors the data
-     * can be provided in.  The array should be ordered according to preference
-     * for providing the data (from most richly descriptive to least descriptive).
-     * @return an array of data flavors in which this data can be transferred
-     */
-    public DataFlavor[] getTransferDataFlavors();
-
-    /**
-     * Returns whether or not the specified data flavor is supported for
-     * this object.
-     * @param flavor the requested flavor for the data
-     * @return boolean indicating whether or not the data flavor is supported
-     */
-    public boolean isDataFlavorSupported(DataFlavor flavor);
-
-    /**
-     * Returns an object which represents the data to be transferred.  The class
-     * of the object returned is defined by the representation class of the flavor.
-     *
-     * @param flavor the requested flavor for the data
-     * @return an object which represents the data to be transferred
-     * @see DataFlavor#getRepresentationClass
-     * @exception IOException                if the data is no longer available
-     *              in the requested flavor.
-     * @exception UnsupportedFlavorException if the requested data flavor is
-     *              not supported.
-     */
-    public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException;
-
-}
--- a/jdk/src/java.desktop/share/classes/java/awt/datatransfer/UnsupportedFlavorException.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 1996, 2000, 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;
-
-/**
- * Signals that the requested data is not supported in this flavor.
- * @see Transferable#getTransferData
- *
- * @author      Amy Fowler
- */
-public class UnsupportedFlavorException extends Exception {
-
-    /*
-     * JDK 1.1 serialVersionUID
-     */
-    private static final long serialVersionUID = 5383814944251665601L;
-
-    /**
-     * Constructs an UnsupportedFlavorException.
-     *
-     * @param flavor the flavor object which caused the exception. May
-     *        be <code>null</code>.
-     */
-    public UnsupportedFlavorException(DataFlavor flavor) {
-        super((flavor != null) ? flavor.getHumanPresentableName() : null);
-    }
-}
--- a/jdk/src/java.desktop/share/classes/java/awt/datatransfer/package.html	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-<!--
- Copyright (c) 1998, 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.
--->
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head><title></title></head>
-<body bgcolor="white">
-
-Provides interfaces and classes for transferring data
-between and within applications.  It defines the notion of a
-"transferable" object, which is an object capable of being
-transferred between or within applications. An object identifies
-itself as being transferable by implementing the Transferable
-interface.
-<p>
-It also provides a clipboard mechanism, which is an object that
-temporarily holds a transferable object that can be transferred
-between or within an application. The clipboard is typically used
-for copy and paste operations. Although it is possible to create
-a clipboard to use within an application, most applications will
-use the system clipboard to ensure the data can be transferred
-across applications running on the platform.
-
-<!--
-<h2>Package Specification</h2>
-
-##### FILL IN ANY SPECS NEEDED BY JAVA COMPATIBILITY KIT #####
-<ul>
-  <li><a href="">##### REFER TO ANY FRAMEMAKER SPECIFICATION HERE #####</a>
-</ul>
-
-<h2>Related Documentation</h2>
-
-For overviews, tutorials, examples, guides, and tool documentation, please see:
-<ul>
-  <li><a href="">##### REFER TO NON-SPEC DOCUMENTATION HERE #####</a>
-</ul>
--->
-
-@since 1.1
-</body>
-</html>
--- a/jdk/src/java.desktop/share/classes/java/awt/image/BufferedImage.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.desktop/share/classes/java/awt/image/BufferedImage.java	Mon Feb 23 05:01: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
@@ -25,26 +25,23 @@
 
 package java.awt.image;
 
+import java.awt.Graphics2D;
+import java.awt.GraphicsEnvironment;
+import java.awt.Point;
+import java.awt.Rectangle;
 import java.awt.Transparency;
 import java.awt.color.ColorSpace;
-import java.awt.Graphics2D;
-import java.awt.GraphicsConfiguration;
-import java.awt.GraphicsEnvironment;
-import java.awt.ImageCapabilities;
-import java.awt.geom.Rectangle2D;
-import java.awt.geom.Point2D;
-import java.awt.Point;
-import java.awt.Rectangle;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.util.Hashtable;
+import java.util.Set;
 import java.util.Vector;
 
+import sun.awt.image.ByteComponentRaster;
 import sun.awt.image.BytePackedRaster;
-import sun.awt.image.ShortComponentRaster;
-import sun.awt.image.ByteComponentRaster;
 import sun.awt.image.IntegerComponentRaster;
 import sun.awt.image.OffScreenImageSource;
+import sun.awt.image.ShortComponentRaster;
 
 /**
  *
@@ -68,18 +65,14 @@
  * @see Raster
  * @see WritableRaster
  */
-
 public class BufferedImage extends java.awt.Image
                            implements WritableRenderedImage, Transparency
 {
-    int        imageType = TYPE_CUSTOM;
-    ColorModel colorModel;
-    WritableRaster raster;
-    OffScreenImageSource osis;
-    Hashtable<?, ?> properties;
-
-    boolean    isAlphaPremultiplied;// If true, alpha has been premultiplied in
-    // color channels
+    private int imageType = TYPE_CUSTOM;
+    private ColorModel colorModel;
+    private final WritableRaster raster;
+    private OffScreenImageSource osis;
+    private Hashtable<String, Object> properties;
 
     /**
      * Image Type Constants
@@ -328,8 +321,8 @@
                                                   0x000000ff,   // Blue
                                                   0x0           // Alpha
                                                   );
-                  raster = colorModel.createCompatibleWritableRaster(width,
-                                                                      height);
+                raster = colorModel.createCompatibleWritableRaster(width,
+                                                                   height);
             }
         break;
 
@@ -355,9 +348,8 @@
                                      true,       // Alpha Premultiplied
                                      DataBuffer.TYPE_INT
                                      );
-
-                  raster = colorModel.createCompatibleWritableRaster(width,
-                                                                      height);
+                raster = colorModel.createCompatibleWritableRaster(width,
+                                                                   height);
             }
         break;
 
@@ -368,8 +360,8 @@
                                                   0x0000ff00,   // Green
                                                   0x00ff0000    // Blue
                                                   );
-                  raster = colorModel.createCompatibleWritableRaster(width,
-                                                                      height);
+                raster = colorModel.createCompatibleWritableRaster(width,
+                                                                   height);
             }
         break;
 
@@ -642,7 +634,14 @@
 
         colorModel = cm;
         this.raster  = raster;
-        this.properties = properties;
+        if (properties != null && !properties.isEmpty()) {
+            this.properties = new Hashtable<>();
+            for (final Object key : properties.keySet()) {
+                if (key instanceof String) {
+                    this.properties.put((String) key, properties.get(key));
+                }
+            }
+        }
         int numBands = raster.getNumBands();
         boolean isAlphaPre = cm.isAlphaPremultiplied();
         final boolean isStandard = isStandard(cm, raster);
@@ -1272,7 +1271,11 @@
      *          or <code>null</code> if no property names are recognized.
      */
     public String[] getPropertyNames() {
-         return null;
+        if (properties == null || properties.isEmpty()) {
+            return null;
+        }
+        final Set<String> keys = properties.keySet();
+        return keys.toArray(new String[keys.size()]);
     }
 
     /**
--- a/jdk/src/java.desktop/share/classes/javax/swing/AbstractButton.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.desktop/share/classes/javax/swing/AbstractButton.java	Mon Feb 23 05:01: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
@@ -2215,10 +2215,7 @@
      */
     public boolean imageUpdate(Image img, int infoflags,
                                int x, int y, int w, int h) {
-        Icon iconDisplayed = getIcon();
-        if (iconDisplayed == null) {
-            return false;
-        }
+        Icon iconDisplayed = null;
 
         if (!model.isEnabled()) {
             if (model.isSelected()) {
@@ -2238,7 +2235,12 @@
             iconDisplayed = getSelectedIcon();
         }
 
-        if (!SwingUtilities.doesIconReferenceImage(iconDisplayed, img)) {
+        if (iconDisplayed == null) {
+            iconDisplayed = getIcon();
+        }
+
+        if (iconDisplayed == null
+            || !SwingUtilities.doesIconReferenceImage(iconDisplayed, img)) {
             // We don't know about this image, disable the notification so
             // we don't keep repainting.
             return false;
--- a/jdk/src/java.desktop/share/classes/javax/swing/JComponent.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.desktop/share/classes/javax/swing/JComponent.java	Mon Feb 23 05:01: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,22 +27,15 @@
 
 import java.util.HashSet;
 import java.util.Hashtable;
-import java.util.Dictionary;
 import java.util.Enumeration;
 import java.util.Locale;
 import java.util.Vector;
 import java.util.EventListener;
 import java.util.Set;
-import java.util.Map;
-import java.util.HashMap;
 
 import java.awt.*;
 import java.awt.event.*;
-import java.awt.image.VolatileImage;
-import java.awt.Graphics2D;
 import java.awt.peer.LightweightPeer;
-import java.awt.dnd.DropTarget;
-import java.awt.font.FontRenderContext;
 import java.beans.PropertyChangeListener;
 import java.beans.VetoableChangeListener;
 import java.beans.VetoableChangeSupport;
@@ -1868,7 +1861,7 @@
 
     /**
      * Overrides <code>Container.getAlignmentY</code> to return
-     * the horizontal alignment.
+     * the vertical alignment.
      *
      * @return the value of the <code>alignmentY</code> property
      * @see #setAlignmentY
@@ -1882,9 +1875,9 @@
     }
 
     /**
-     * Sets the horizontal alignment.
+     * Sets the vertical alignment.
      *
-     * @param alignmentY  the new horizontal alignment
+     * @param alignmentY  the new vertical alignment
      * @see #getAlignmentY
      * @beaninfo
      *   description: The preferred vertical alignment of the component.
@@ -1897,7 +1890,7 @@
 
     /**
      * Overrides <code>Container.getAlignmentX</code> to return
-     * the vertical alignment.
+     * the horizontal alignment.
      *
      * @return the value of the <code>alignmentX</code> property
      * @see #setAlignmentX
@@ -1911,9 +1904,9 @@
     }
 
     /**
-     * Sets the vertical alignment.
+     * Sets the horizontal alignment.
      *
-     * @param alignmentX  the new vertical alignment
+     * @param alignmentX  the new horizontal alignment
      * @see #getAlignmentX
      * @beaninfo
      *   description: The preferred horizontal alignment of the component.
--- a/jdk/src/java.desktop/share/classes/javax/swing/JFormattedTextField.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.desktop/share/classes/javax/swing/JFormattedTextField.java	Mon Feb 23 05:01: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.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,6 @@
 import java.io.*;
 import java.text.*;
 import java.util.*;
-import javax.swing.UIManager;
 import javax.swing.event.*;
 import javax.swing.plaf.UIResource;
 import javax.swing.text.*;
@@ -151,7 +150,7 @@
  * will be created to handle formatting of numbers:
  * <pre>
  *   JFormattedTextField tf = new JFormattedTextField();
- *   tf.setValue(new Number(100));
+ *   tf.setValue(100);
  * </pre>
  * <p>
  * <strong>Warning:</strong> As the <code>AbstractFormatter</code> will
--- a/jdk/src/java.desktop/share/classes/javax/swing/JSlider.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.desktop/share/classes/javax/swing/JSlider.java	Mon Feb 23 05:01: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
@@ -1287,10 +1287,10 @@
         return paintTrack;
     }
 
-
     /**
-     * Determines whether the track is painted on the slider.
-     * By default, this property is {@code true}.
+     * Determines whether the track is painted on the slider. By default, this
+     * property is {@code true}. It is up to the look and feel to honor this
+     * property, some may choose to ignore it.
      *
      * @param  b  whether or not to paint the slider track
      * @see #getPaintTrack
--- a/jdk/src/java.desktop/share/classes/javax/swing/JTextArea.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.desktop/share/classes/javax/swing/JTextArea.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, 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
@@ -493,7 +493,6 @@
      * @exception IllegalArgumentException  if part of the range is an
      *  invalid position in the model
      * @see #insert
-     * @see #replaceRange
      */
     public void replaceRange(String str, int start, int end) {
         if (end < start) {
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicDesktopPaneUI.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicDesktopPaneUI.java	Mon Feb 23 05:01: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
@@ -36,10 +36,9 @@
 import java.awt.Graphics;
 import java.awt.KeyboardFocusManager;
 import java.awt.*;
-import java.util.Vector;
+
 import sun.swing.DefaultLookup;
 import sun.swing.UIAction;
-import sun.awt.AppContext;
 
 /**
  * Basic L&amp;F for a desktop.
@@ -49,9 +48,6 @@
 public class BasicDesktopPaneUI extends DesktopPaneUI {
     // Old actions forward to an instance of this.
     private static final Actions SHARED_ACTION = new Actions();
-    private static Dimension minSize = new Dimension(0,0);
-    private static Dimension maxSize = new Dimension(Integer.MAX_VALUE,
-            Integer.MAX_VALUE);
     private Handler handler;
     private PropertyChangeListener pcl;
 
@@ -304,13 +300,19 @@
 
     public void paint(Graphics g, JComponent c) {}
 
-    public Dimension getPreferredSize(JComponent c) {return null;}
+    @Override
+    public Dimension getPreferredSize(JComponent c) {
+        return null;
+    }
 
+    @Override
     public Dimension getMinimumSize(JComponent c) {
-        return minSize;
-        }
-    public Dimension getMaximumSize(JComponent c){
-        return maxSize;
+        return new Dimension(0, 0);
+    }
+
+    @Override
+    public Dimension getMaximumSize(JComponent c) {
+        return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
     }
 
     /**
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -92,8 +92,6 @@
 
     private static int MIN_WIDTH = 500;
     private static int MIN_HEIGHT = 326;
-    private static Dimension MIN_SIZE = new Dimension(MIN_WIDTH, MIN_HEIGHT);
-
     private static int LIST_PREF_WIDTH = 405;
     private static int LIST_PREF_HEIGHT = 135;
     private static Dimension LIST_PREF_SIZE = new Dimension(LIST_PREF_WIDTH, LIST_PREF_HEIGHT);
@@ -615,6 +613,7 @@
      * @return   a <code>Dimension</code> specifying the preferred
      *           width and height of the file chooser
      */
+    @Override
     public Dimension getPreferredSize(JComponent c) {
         int prefWidth = PREF_SIZE.width;
         Dimension d = c.getLayout().preferredLayoutSize(c);
@@ -633,8 +632,9 @@
      * @return   a <code>Dimension</code> specifying the minimum
      *           width and height of the file chooser
      */
+    @Override
     public Dimension getMinimumSize(JComponent c) {
-        return MIN_SIZE;
+        return new Dimension(MIN_WIDTH, MIN_HEIGHT);
     }
 
     /**
@@ -644,6 +644,7 @@
      * @return   a <code>Dimension</code> specifying the maximum
      *           width and height of the file chooser
      */
+    @Override
     public Dimension getMaximumSize(JComponent c) {
         return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
     }
@@ -654,7 +655,8 @@
         } else {
             JFileChooser fc = getFileChooser();
             if ((fc.isDirectorySelectionEnabled() && !fc.isFileSelectionEnabled()) ||
-                (fc.isDirectorySelectionEnabled() && fc.isFileSelectionEnabled() && fc.getFileSystemView().isFileSystemRoot(file))) {
+                (fc.isDirectorySelectionEnabled() && fc.isFileSelectionEnabled()
+                 && fc.getFileSystemView().isFileSystemRoot(file))) {
                 return file.getPath();
             } else {
                 return file.getName();
--- a/jdk/src/java.desktop/share/classes/javax/swing/text/GapContent.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.desktop/share/classes/javax/swing/text/GapContent.java	Mon Feb 23 05:01:11 2015 -0800
@@ -710,8 +710,9 @@
      * @param length the length &gt;= 0
      * @return the set of instances
      */
-    protected Vector<UndoPosRef> getPositionsInRange(Vector<UndoPosRef> v,
-                                                     int offset, int length) {
+    @SuppressWarnings({"rawtypes", "unchecked"}) // UndoPosRef type cannot be exposed
+    protected Vector getPositionsInRange(Vector v,
+                                         int offset, int length) {
         int endOffset = offset + length;
         int startIndex;
         int endIndex;
@@ -758,7 +759,8 @@
      *
      * @param positions the UndoPosRef instances to reset
      */
-    protected void updateUndoPositions(Vector<UndoPosRef> positions, int offset,
+    @SuppressWarnings("rawtypes") // UndoPosRef type cannot be exposed
+    protected void updateUndoPositions(Vector positions, int offset,
                                        int length) {
         // Find the indexs of the end points.
         int endOffset = offset + length;
@@ -775,7 +777,7 @@
 
         // Reset the location of the refenences.
         for(int counter = positions.size() - 1; counter >= 0; counter--) {
-            UndoPosRef ref = positions.elementAt(counter);
+            UndoPosRef ref = (UndoPosRef) positions.elementAt(counter);
             ref.resetLocation(endOffset, g1);
         }
         // We have to resort the marks in the range startIndex to endIndex.
@@ -902,7 +904,8 @@
         protected String string;
         /** An array of instances of UndoPosRef for the Positions in the
          * range that was removed, valid after undo. */
-        protected Vector<UndoPosRef> posRefs;
+        @SuppressWarnings("rawtypes") // UndoPosRef type cannot be exposed
+        protected Vector posRefs;
     } // GapContent.InsertUndo
 
 
@@ -911,6 +914,7 @@
      */
     @SuppressWarnings("serial") // JDK-implementation class
     class RemoveUndo extends AbstractUndoableEdit {
+        @SuppressWarnings("unchecked")
         protected RemoveUndo(int offset, String string) {
             super();
             this.offset = offset;
@@ -934,6 +938,7 @@
             }
         }
 
+        @SuppressWarnings("unchecked")
         public void redo() throws CannotRedoException {
             super.redo();
             try {
--- a/jdk/src/java.desktop/share/classes/javax/swing/text/StringContent.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.desktop/share/classes/javax/swing/text/StringContent.java	Mon Feb 23 05:01:11 2015 -0800
@@ -271,11 +271,12 @@
      * @param length the length &gt;= 0
      * @return the set of instances
      */
-    protected Vector<UndoPosRef> getPositionsInRange(Vector<UndoPosRef> v, int offset,
-                                                      int length) {
+    @SuppressWarnings({"rawtypes", "unchecked"}) // UndoPosRef type cannot be exposed
+    protected Vector getPositionsInRange(Vector v, int offset,
+                                         int length) {
         int n = marks.size();
         int end = offset + length;
-        Vector<UndoPosRef> placeIn = (v == null) ? new Vector<>() : v;
+        Vector placeIn = (v == null) ? new Vector() : v;
         for (int i = 0; i < n; i++) {
             PosRec mark = marks.elementAt(i);
             if (mark.unused) {
@@ -298,9 +299,10 @@
      *
      * @param positions the positions of the instances
      */
-    protected void updateUndoPositions(Vector<UndoPosRef> positions) {
+    @SuppressWarnings("rawtypes") // UndoPosRef type cannot be exposed
+    protected void updateUndoPositions(Vector positions) {
         for(int counter = positions.size() - 1; counter >= 0; counter--) {
-            UndoPosRef ref = positions.elementAt(counter);
+            UndoPosRef ref = (UndoPosRef) positions.elementAt(counter);
             // Check if the Position is still valid.
             if(ref.rec.unused) {
                 positions.removeElementAt(counter);
@@ -437,7 +439,8 @@
         protected String string;
         // An array of instances of UndoPosRef for the Positions in the
         // range that was removed, valid after undo.
-        protected Vector<UndoPosRef> posRefs;
+        @SuppressWarnings("rawtypes") // UndoPosRef type cannot be exposed
+        protected Vector posRefs;
     }
 
 
@@ -445,6 +448,7 @@
      * UndoableEdit created for removes.
      */
     class RemoveUndo extends AbstractUndoableEdit {
+        @SuppressWarnings("unchecked")
         protected RemoveUndo(int offset, String string) {
             super();
             this.offset = offset;
@@ -471,6 +475,7 @@
             }
         }
 
+        @SuppressWarnings("unchecked")
         public void redo() throws CannotRedoException {
             super.redo();
             try {
--- a/jdk/src/java.desktop/share/classes/sun/applet/AppletProps.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.desktop/share/classes/sun/applet/AppletProps.java	Mon Feb 23 05:01:11 2015 -0800
@@ -28,8 +28,6 @@
 import java.awt.*;
 import java.io.*;
 import java.util.Properties;
-import sun.net.www.http.HttpClient;
-import sun.net.ftp.FtpClient;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.security.PrivilegedExceptionAction;
--- a/jdk/src/java.desktop/share/classes/sun/awt/HKSCS.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.desktop/share/classes/sun/awt/HKSCS.java	Mon Feb 23 05:01:11 2015 -0800
@@ -34,11 +34,21 @@
    ExtendedCharsets class, because if we want to have a public HKSCS,
    it probably should be HKSCS_2001 not HKSCS.
 */
-public class HKSCS extends sun.nio.cs.ext.MS950_HKSCS_XP {
+public class HKSCS extends Charset {
+    private static Charset cs = Charset.forName("x-MS950-HKSCS-XP");
+
     public HKSCS () {
-        super();
+        super("HKSCS", null);
     }
     public boolean contains(Charset cs) {
         return (cs instanceof HKSCS);
     }
+
+    public CharsetDecoder newDecoder() {
+        return cs.newDecoder();
+    }
+
+    public CharsetEncoder newEncoder() {
+        return cs.newEncoder();
+    }
 }
--- a/jdk/src/java.desktop/share/classes/sun/datatransfer/DataFlavorUtil.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,841 +0,0 @@
-/*
- * Copyright (c) 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 sun.datatransfer;
-
-import java.awt.datatransfer.DataFlavor;
-import java.awt.datatransfer.FlavorMap;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.nio.ByteBuffer;
-import java.nio.CharBuffer;
-import java.nio.charset.Charset;
-import java.nio.charset.IllegalCharsetNameException;
-import java.nio.charset.StandardCharsets;
-import java.nio.charset.UnsupportedCharsetException;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.Map;
-import java.util.ServiceLoader;
-import java.util.Set;
-import java.util.SortedSet;
-import java.util.TreeSet;
-import java.util.function.Supplier;
-
-
-/**
- * Utility class with different datatransfer helper functions
- *
- * @see 1.9
- */
-public class DataFlavorUtil {
-
-    private DataFlavorUtil() {
-        // Avoid instantiation
-    }
-
-    private static Comparator<String> getCharsetComparator() {
-       return CharsetComparator.INSTANCE;
-    }
-
-    public static Comparator<DataFlavor> getDataFlavorComparator() {
-       return DataFlavorComparator.INSTANCE;
-    }
-
-    public static Comparator<Long> getIndexOrderComparator(Map<Long, Integer> indexMap) {
-        return new IndexOrderComparator(indexMap);
-    }
-
-    public static Comparator<DataFlavor> getTextFlavorComparator() {
-        return TextFlavorComparator.INSTANCE;
-    }
-
-    /**
-     * Tracks whether a particular text/* MIME type supports the charset
-     * parameter. The Map is initialized with all of the standard MIME types
-     * listed in the DataFlavor.selectBestTextFlavor method comment. Additional
-     * entries may be added during the life of the JRE for text/<other> types.
-     */
-    private static final Map<String, Boolean> textMIMESubtypeCharsetSupport;
-
-    static {
-        Map<String, Boolean> tempMap = new HashMap<>(17);
-        tempMap.put("sgml", Boolean.TRUE);
-        tempMap.put("xml", Boolean.TRUE);
-        tempMap.put("html", Boolean.TRUE);
-        tempMap.put("enriched", Boolean.TRUE);
-        tempMap.put("richtext", Boolean.TRUE);
-        tempMap.put("uri-list", Boolean.TRUE);
-        tempMap.put("directory", Boolean.TRUE);
-        tempMap.put("css", Boolean.TRUE);
-        tempMap.put("calendar", Boolean.TRUE);
-        tempMap.put("plain", Boolean.TRUE);
-        tempMap.put("rtf", Boolean.FALSE);
-        tempMap.put("tab-separated-values", Boolean.FALSE);
-        tempMap.put("t140", Boolean.FALSE);
-        tempMap.put("rfc822-headers", Boolean.FALSE);
-        tempMap.put("parityfec", Boolean.FALSE);
-        textMIMESubtypeCharsetSupport = Collections.synchronizedMap(tempMap);
-    }
-
-    /**
-     * Lazy initialization of Standard Encodings.
-     */
-    private static class StandardEncodingsHolder {
-        private static final SortedSet<String> standardEncodings = load();
-
-        private static SortedSet<String> load() {
-            final SortedSet<String> tempSet = new TreeSet<>(getCharsetComparator().reversed());
-            tempSet.add("US-ASCII");
-            tempSet.add("ISO-8859-1");
-            tempSet.add("UTF-8");
-            tempSet.add("UTF-16BE");
-            tempSet.add("UTF-16LE");
-            tempSet.add("UTF-16");
-            tempSet.add(Charset.defaultCharset().name());
-            return Collections.unmodifiableSortedSet(tempSet);
-        }
-    }
-
-    /**
-     * Returns a {@code SortedSet} of Strings which are a total order of the standard
-     * character sets supported by the JRE. The ordering follows the same principles as
-     * {@link java.awt.datatransfer.DataFlavor#selectBestTextFlavor(java.awt.datatransfer.DataFlavor[])}.
-     * So as to avoid loading all available character converters, optional, non-standard,
-     * character sets are not included.
-     */
-    public static Set<String> standardEncodings() {
-        return StandardEncodingsHolder.standardEncodings;
-    }
-
-    /**
-     * Converts an arbitrary text encoding to its canonical name.
-     */
-    public static String canonicalName(String encoding) {
-        if (encoding == null) {
-            return null;
-        }
-        try {
-            return Charset.forName(encoding).name();
-        } catch (IllegalCharsetNameException icne) {
-            return encoding;
-        } catch (UnsupportedCharsetException uce) {
-            return encoding;
-        }
-    }
-
-    /**
-     * Tests only whether the flavor's MIME type supports the charset
-     * parameter. Must only be called for flavors with a primary type of
-     * "text".
-     */
-    public static boolean doesSubtypeSupportCharset(DataFlavor flavor) {
-        String subType = flavor.getSubType();
-        if (subType == null) {
-            return false;
-        }
-
-        Boolean support = textMIMESubtypeCharsetSupport.get(subType);
-
-        if (support != null) {
-            return support;
-        }
-
-        boolean ret_val = (flavor.getParameter("charset") != null);
-        textMIMESubtypeCharsetSupport.put(subType, ret_val);
-        return ret_val;
-    }
-    public static boolean doesSubtypeSupportCharset(String subType,
-                                                    String charset)
-    {
-        Boolean support = textMIMESubtypeCharsetSupport.get(subType);
-
-        if (support != null) {
-            return support;
-        }
-
-        boolean ret_val = (charset != null);
-        textMIMESubtypeCharsetSupport.put(subType, ret_val);
-        return ret_val;
-    }
-
-
-    /**
-     * Returns whether this flavor is a text type which supports the
-     * 'charset' parameter.
-     */
-    public static boolean isFlavorCharsetTextType(DataFlavor flavor) {
-        // Although stringFlavor doesn't actually support the charset
-        // parameter (because its primary MIME type is not "text"), it should
-        // be treated as though it does. stringFlavor is semantically
-        // equivalent to "text/plain" data.
-        if (DataFlavor.stringFlavor.equals(flavor)) {
-            return true;
-        }
-
-        if (!"text".equals(flavor.getPrimaryType()) ||
-                !doesSubtypeSupportCharset(flavor))
-        {
-            return false;
-        }
-
-        Class<?> rep_class = flavor.getRepresentationClass();
-
-        if (flavor.isRepresentationClassReader() ||
-                String.class.equals(rep_class) ||
-                flavor.isRepresentationClassCharBuffer() ||
-                char[].class.equals(rep_class))
-        {
-            return true;
-        }
-
-        if (!(flavor.isRepresentationClassInputStream() ||
-                flavor.isRepresentationClassByteBuffer() ||
-                byte[].class.equals(rep_class))) {
-            return false;
-        }
-
-        String charset = flavor.getParameter("charset");
-
-        // null equals default encoding which is always supported
-        return (charset == null) || isEncodingSupported(charset);
-    }
-
-    /**
-     * Returns whether this flavor is a text type which does not support the
-     * 'charset' parameter.
-     */
-    public static boolean isFlavorNoncharsetTextType(DataFlavor flavor) {
-        if (!"text".equals(flavor.getPrimaryType()) || doesSubtypeSupportCharset(flavor)) {
-            return false;
-        }
-
-        return (flavor.isRepresentationClassInputStream() ||
-                flavor.isRepresentationClassByteBuffer() ||
-                byte[].class.equals(flavor.getRepresentationClass()));
-    }
-
-    /**
-     * If the specified flavor is a text flavor which supports the "charset"
-     * parameter, then this method returns that parameter, or the default
-     * charset if no such parameter was specified at construction. For non-
-     * text DataFlavors, and for non-charset text flavors, this method returns
-     * null.
-     */
-    public static String getTextCharset(DataFlavor flavor) {
-        if (!isFlavorCharsetTextType(flavor)) {
-            return null;
-        }
-
-        String encoding = flavor.getParameter("charset");
-
-        return (encoding != null) ? encoding : Charset.defaultCharset().name();
-    }
-
-    /**
-     * Determines whether this JRE can both encode and decode text in the
-     * specified encoding.
-     */
-    private static boolean isEncodingSupported(String encoding) {
-        if (encoding == null) {
-            return false;
-        }
-        try {
-            return Charset.isSupported(encoding);
-        } catch (IllegalCharsetNameException icne) {
-            return false;
-        }
-    }
-
-    /**
-     * Helper method to compare two objects by their Integer indices in the
-     * given map. If the map doesn't contain an entry for either of the
-     * objects, the fallback index will be used for the object instead.
-     *
-     * @param indexMap the map which maps objects into Integer indexes.
-     * @param obj1 the first object to be compared.
-     * @param obj2 the second object to be compared.
-     * @param fallbackIndex the Integer to be used as a fallback index.
-     * @return a negative integer, zero, or a positive integer as the
-     *             first object is mapped to a less, equal to, or greater
-     *             index than the second.
-     */
-    static <T> int compareIndices(Map<T, Integer> indexMap,
-                                  T obj1, T obj2,
-                                  Integer fallbackIndex) {
-        Integer index1 = indexMap.getOrDefault(obj1, fallbackIndex);
-        Integer index2 = indexMap.getOrDefault(obj2, fallbackIndex);
-        return index1.compareTo(index2);
-    }
-
-    /**
-     * An IndexedComparator which compares two String charsets. The comparison
-     * follows the rules outlined in DataFlavor.selectBestTextFlavor. In order
-     * to ensure that non-Unicode, non-ASCII, non-default charsets are sorted
-     * in alphabetical order, charsets are not automatically converted to their
-     * canonical forms.
-     */
-    private static class CharsetComparator implements Comparator<String> {
-        static final CharsetComparator INSTANCE = new CharsetComparator();
-
-        private static final Map<String, Integer> charsets;
-
-        private static final Integer DEFAULT_CHARSET_INDEX = 2;
-        private static final Integer OTHER_CHARSET_INDEX = 1;
-        private static final Integer WORST_CHARSET_INDEX = 0;
-        private static final Integer UNSUPPORTED_CHARSET_INDEX = Integer.MIN_VALUE;
-
-        private static final String UNSUPPORTED_CHARSET = "UNSUPPORTED";
-
-        static {
-            Map<String, Integer> charsetsMap = new HashMap<>(8, 1.0f);
-
-            // we prefer Unicode charsets
-            charsetsMap.put(canonicalName("UTF-16LE"), 4);
-            charsetsMap.put(canonicalName("UTF-16BE"), 5);
-            charsetsMap.put(canonicalName("UTF-8"), 6);
-            charsetsMap.put(canonicalName("UTF-16"), 7);
-
-            // US-ASCII is the worst charset supported
-            charsetsMap.put(canonicalName("US-ASCII"), WORST_CHARSET_INDEX);
-
-            charsetsMap.putIfAbsent(Charset.defaultCharset().name(), DEFAULT_CHARSET_INDEX);
-
-            charsetsMap.put(UNSUPPORTED_CHARSET, UNSUPPORTED_CHARSET_INDEX);
-
-            charsets = Collections.unmodifiableMap(charsetsMap);
-        }
-
-        /**
-         * Compares charsets. Returns a negative integer, zero, or a positive
-         * integer as the first charset is worse than, equal to, or better than
-         * the second.
-         * <p>
-         * Charsets are ordered according to the following rules:
-         * <ul>
-         * <li>All unsupported charsets are equal.
-         * <li>Any unsupported charset is worse than any supported charset.
-         * <li>Unicode charsets, such as "UTF-16", "UTF-8", "UTF-16BE" and
-         *     "UTF-16LE", are considered best.
-         * <li>After them, platform default charset is selected.
-         * <li>"US-ASCII" is the worst of supported charsets.
-         * <li>For all other supported charsets, the lexicographically less
-         *     one is considered the better.
-         * </ul>
-         *
-         * @param charset1 the first charset to be compared
-         * @param charset2 the second charset to be compared.
-         * @return a negative integer, zero, or a positive integer as the
-         *             first argument is worse, equal to, or better than the
-         *             second.
-         */
-        public int compare(String charset1, String charset2) {
-            charset1 = getEncoding(charset1);
-            charset2 = getEncoding(charset2);
-
-            int comp = compareIndices(charsets, charset1, charset2, OTHER_CHARSET_INDEX);
-
-            if (comp == 0) {
-                return charset2.compareTo(charset1);
-            }
-
-            return comp;
-        }
-
-        /**
-         * Returns encoding for the specified charset according to the
-         * following rules:
-         * <ul>
-         * <li>If the charset is <code>null</code>, then <code>null</code> will
-         *     be returned.
-         * <li>Iff the charset specifies an encoding unsupported by this JRE,
-         *     <code>UNSUPPORTED_CHARSET</code> will be returned.
-         * <li>If the charset specifies an alias name, the corresponding
-         *     canonical name will be returned iff the charset is a known
-         *     Unicode, ASCII, or default charset.
-         * </ul>
-         *
-         * @param charset the charset.
-         * @return an encoding for this charset.
-         */
-        static String getEncoding(String charset) {
-            if (charset == null) {
-                return null;
-            } else if (!isEncodingSupported(charset)) {
-                return UNSUPPORTED_CHARSET;
-            } else {
-                // Only convert to canonical form if the charset is one
-                // of the charsets explicitly listed in the known charsets
-                // map. This will happen only for Unicode, ASCII, or default
-                // charsets.
-                String canonicalName = canonicalName(charset);
-                return (charsets.containsKey(canonicalName))
-                        ? canonicalName
-                        : charset;
-            }
-        }
-    }
-
-    /**
-     * An IndexedComparator which compares two DataFlavors. For text flavors,
-     * the comparison follows the rules outlined in
-     * DataFlavor.selectBestTextFlavor. For non-text flavors, unknown
-     * application MIME types are preferred, followed by known
-     * application/x-java-* MIME types. Unknown application types are preferred
-     * because if the user provides his own data flavor, it will likely be the
-     * most descriptive one. For flavors which are otherwise equal, the
-     * flavors' string representation are compared in the alphabetical order.
-     */
-    private static class DataFlavorComparator implements Comparator<DataFlavor> {
-
-        static final DataFlavorComparator INSTANCE = new DataFlavorComparator();
-
-        private static final Map<String, Integer> exactTypes;
-        private static final Map<String, Integer> primaryTypes;
-        private static final Map<Class<?>, Integer> nonTextRepresentations;
-        private static final Map<String, Integer> textTypes;
-        private static final Map<Class<?>, Integer> decodedTextRepresentations;
-        private static final Map<Class<?>, Integer> encodedTextRepresentations;
-
-        private static final Integer UNKNOWN_OBJECT_LOSES = Integer.MIN_VALUE;
-        private static final Integer UNKNOWN_OBJECT_WINS = Integer.MAX_VALUE;
-
-        static {
-            {
-                Map<String, Integer> exactTypesMap = new HashMap<>(4, 1.0f);
-
-                // application/x-java-* MIME types
-                exactTypesMap.put("application/x-java-file-list", 0);
-                exactTypesMap.put("application/x-java-serialized-object", 1);
-                exactTypesMap.put("application/x-java-jvm-local-objectref", 2);
-                exactTypesMap.put("application/x-java-remote-object", 3);
-
-                exactTypes = Collections.unmodifiableMap(exactTypesMap);
-            }
-
-            {
-                Map<String, Integer> primaryTypesMap = new HashMap<>(1, 1.0f);
-
-                primaryTypesMap.put("application", 0);
-
-                primaryTypes = Collections.unmodifiableMap(primaryTypesMap);
-            }
-
-            {
-                Map<Class<?>, Integer> nonTextRepresentationsMap = new HashMap<>(3, 1.0f);
-
-                nonTextRepresentationsMap.put(java.io.InputStream.class, 0);
-                nonTextRepresentationsMap.put(java.io.Serializable.class, 1);
-
-                nonTextRepresentationsMap.put(RMI.remoteClass(), 2);
-
-                nonTextRepresentations = Collections.unmodifiableMap(nonTextRepresentationsMap);
-            }
-
-            {
-                Map<String, Integer> textTypesMap = new HashMap<>(16, 1.0f);
-
-                // plain text
-                textTypesMap.put("text/plain", 0);
-
-                // stringFlavor
-                textTypesMap.put("application/x-java-serialized-object", 1);
-
-                // misc
-                textTypesMap.put("text/calendar", 2);
-                textTypesMap.put("text/css", 3);
-                textTypesMap.put("text/directory", 4);
-                textTypesMap.put("text/parityfec", 5);
-                textTypesMap.put("text/rfc822-headers", 6);
-                textTypesMap.put("text/t140", 7);
-                textTypesMap.put("text/tab-separated-values", 8);
-                textTypesMap.put("text/uri-list", 9);
-
-                // enriched
-                textTypesMap.put("text/richtext", 10);
-                textTypesMap.put("text/enriched", 11);
-                textTypesMap.put("text/rtf", 12);
-
-                // markup
-                textTypesMap.put("text/html", 13);
-                textTypesMap.put("text/xml", 14);
-                textTypesMap.put("text/sgml", 15);
-
-                textTypes = Collections.unmodifiableMap(textTypesMap);
-            }
-
-            {
-                Map<Class<?>, Integer> decodedTextRepresentationsMap = new HashMap<>(4, 1.0f);
-
-                decodedTextRepresentationsMap.put(char[].class, 0);
-                decodedTextRepresentationsMap.put(CharBuffer.class, 1);
-                decodedTextRepresentationsMap.put(String.class, 2);
-                decodedTextRepresentationsMap.put(Reader.class, 3);
-
-                decodedTextRepresentations =
-                        Collections.unmodifiableMap(decodedTextRepresentationsMap);
-            }
-
-            {
-                Map<Class<?>, Integer> encodedTextRepresentationsMap = new HashMap<>(3, 1.0f);
-
-                encodedTextRepresentationsMap.put(byte[].class, 0);
-                encodedTextRepresentationsMap.put(ByteBuffer.class, 1);
-                encodedTextRepresentationsMap.put(InputStream.class, 2);
-
-                encodedTextRepresentations =
-                        Collections.unmodifiableMap(encodedTextRepresentationsMap);
-            }
-        }
-
-
-        public int compare(DataFlavor flavor1, DataFlavor flavor2) {
-            if (flavor1.equals(flavor2)) {
-                return 0;
-            }
-
-            int comp;
-
-            String primaryType1 = flavor1.getPrimaryType();
-            String subType1 = flavor1.getSubType();
-            String mimeType1 = primaryType1 + "/" + subType1;
-            Class<?> class1 = flavor1.getRepresentationClass();
-
-            String primaryType2 = flavor2.getPrimaryType();
-            String subType2 = flavor2.getSubType();
-            String mimeType2 = primaryType2 + "/" + subType2;
-            Class<?> class2 = flavor2.getRepresentationClass();
-
-            if (flavor1.isFlavorTextType() && flavor2.isFlavorTextType()) {
-                // First, compare MIME types
-                comp = compareIndices(textTypes, mimeType1, mimeType2, UNKNOWN_OBJECT_LOSES);
-                if (comp != 0) {
-                    return comp;
-                }
-
-                // Only need to test one flavor because they both have the
-                // same MIME type. Also don't need to worry about accidentally
-                // passing stringFlavor because either
-                //   1. Both flavors are stringFlavor, in which case the
-                //      equality test at the top of the function succeeded.
-                //   2. Only one flavor is stringFlavor, in which case the MIME
-                //      type comparison returned a non-zero value.
-                if (doesSubtypeSupportCharset(flavor1)) {
-                    // Next, prefer the decoded text representations of Reader,
-                    // String, CharBuffer, and [C, in that order.
-                    comp = compareIndices(decodedTextRepresentations, class1,
-                            class2, UNKNOWN_OBJECT_LOSES);
-                    if (comp != 0) {
-                        return comp;
-                    }
-
-                    // Next, compare charsets
-                    comp = CharsetComparator.INSTANCE.compare(getTextCharset(flavor1),
-                            getTextCharset(flavor2));
-                    if (comp != 0) {
-                        return comp;
-                    }
-                }
-
-                // Finally, prefer the encoded text representations of
-                // InputStream, ByteBuffer, and [B, in that order.
-                comp = compareIndices(encodedTextRepresentations, class1,
-                        class2, UNKNOWN_OBJECT_LOSES);
-                if (comp != 0) {
-                    return comp;
-                }
-            } else {
-                // First, prefer application types.
-                comp = compareIndices(primaryTypes, primaryType1, primaryType2,
-                        UNKNOWN_OBJECT_LOSES);
-                if (comp != 0) {
-                    return comp;
-                }
-
-                // Next prefer text types
-                if (flavor1.isFlavorTextType()) {
-                    return 1;
-                }
-
-                if (flavor2.isFlavorTextType()) {
-                    return -1;
-                }
-
-                // Next, look for application/x-java-* types. Prefer unknown
-                // MIME types because if the user provides his own data flavor,
-                // it will likely be the most descriptive one.
-                comp = compareIndices(exactTypes, mimeType1, mimeType2,
-                        UNKNOWN_OBJECT_WINS);
-                if (comp != 0) {
-                    return comp;
-                }
-
-                // Finally, prefer the representation classes of Remote,
-                // Serializable, and InputStream, in that order.
-                comp = compareIndices(nonTextRepresentations, class1, class2,
-                        UNKNOWN_OBJECT_LOSES);
-                if (comp != 0) {
-                    return comp;
-                }
-            }
-
-            // The flavours are not equal but still not distinguishable.
-            // Compare String representations in alphabetical order
-            return flavor1.getMimeType().compareTo(flavor2.getMimeType());
-        }
-    }
-
-    /*
-     * Given the Map that maps objects to Integer indices and a boolean value,
-     * this Comparator imposes a direct or reverse order on set of objects.
-     * <p>
-     * If the specified boolean value is SELECT_BEST, the Comparator imposes the
-     * direct index-based order: an object A is greater than an object B if and
-     * only if the index of A is greater than the index of B. An object that
-     * doesn't have an associated index is less or equal than any other object.
-     * <p>
-     * If the specified boolean value is SELECT_WORST, the Comparator imposes the
-     * reverse index-based order: an object A is greater than an object B if and
-     * only if A is less than B with the direct index-based order.
-     */
-    private static class IndexOrderComparator implements Comparator<Long> {
-        private final Map<Long, Integer> indexMap;
-        private static final Integer FALLBACK_INDEX = Integer.MIN_VALUE;
-
-        public IndexOrderComparator(Map<Long, Integer> indexMap) {
-            this.indexMap = indexMap;
-        }
-
-        public int compare(Long obj1, Long obj2) {
-            return compareIndices(indexMap, obj1, obj2, FALLBACK_INDEX);
-        }
-    }
-
-    private static class TextFlavorComparator extends DataFlavorComparator {
-
-        static final TextFlavorComparator INSTANCE = new TextFlavorComparator();
-        /**
-         * Compares two <code>DataFlavor</code> objects. Returns a negative
-         * integer, zero, or a positive integer as the first
-         * <code>DataFlavor</code> is worse than, equal to, or better than the
-         * second.
-         * <p>
-         * <code>DataFlavor</code>s are ordered according to the rules outlined
-         * for <code>selectBestTextFlavor</code>.
-         *
-         * @param flavor1 the first <code>DataFlavor</code> to be compared
-         * @param flavor2 the second <code>DataFlavor</code> to be compared
-         * @return a negative integer, zero, or a positive integer as the first
-         *         argument is worse, equal to, or better than the second
-         * @throws ClassCastException if either of the arguments is not an
-         *         instance of <code>DataFlavor</code>
-         * @throws NullPointerException if either of the arguments is
-         *         <code>null</code>
-         *
-         * @see java.awt.datatransfer.DataFlavor#selectBestTextFlavor
-         */
-        public int compare(DataFlavor flavor1, DataFlavor flavor2) {
-            if (flavor1.isFlavorTextType()) {
-                if (flavor2.isFlavorTextType()) {
-                    return super.compare(flavor1, flavor2);
-                } else {
-                    return 1;
-                }
-            } else if (flavor2.isFlavorTextType()) {
-                return -1;
-            } else {
-                return 0;
-            }
-        }
-    }
-
-    /**
-     * A fallback implementation of {@link sun.datatransfer.DesktopDatatransferService}
-     * used if there is no desktop.
-     */
-    private static final class DefaultDesktopDatatransferService implements DesktopDatatransferService {
-        static final DesktopDatatransferService INSTANCE = getDesktopService();
-
-        private static DesktopDatatransferService getDesktopService() {
-            ServiceLoader<DesktopDatatransferService> loader =
-                    ServiceLoader.load(DesktopDatatransferService.class, null);
-            Iterator<DesktopDatatransferService> iterator = loader.iterator();
-            if (iterator.hasNext()) {
-                return iterator.next();
-            } else {
-                return new DefaultDesktopDatatransferService();
-            }
-        }
-
-        /**
-         * System singleton FlavorTable.
-         * Only used if there is no desktop
-         * to provide an appropriate FlavorMap.
-         */
-        private volatile FlavorMap flavorMap;
-
-        @Override
-        public void invokeOnEventThread(Runnable r) {
-            r.run();
-        }
-
-        @Override
-        public String getDefaultUnicodeEncoding() {
-            return StandardCharsets.UTF_8.name();
-        }
-
-        @Override
-        public FlavorMap getFlavorMap(Supplier<FlavorMap> supplier) {
-            FlavorMap map = flavorMap;
-            if (map == null) {
-                synchronized (this) {
-                    map = flavorMap;
-                    if (map == null) {
-                        flavorMap = map = supplier.get();
-                    }
-                }
-            }
-            return map;
-        }
-
-        @Override
-        public boolean isDesktopPresent() {
-            return false;
-        }
-
-        @Override
-        public LinkedHashSet<DataFlavor> getPlatformMappingsForNative(String nat) {
-            return new LinkedHashSet<>();
-        }
-
-        @Override
-        public LinkedHashSet<String> getPlatformMappingsForFlavor(DataFlavor df) {
-            return new LinkedHashSet<>();
-        }
-
-        @Override
-        public void registerTextFlavorProperties(String nat, String charset,
-                                                 String eoln, String terminators) {
-            // Not needed if desktop module is absent
-        }
-    }
-
-    public static DesktopDatatransferService getDesktopService() {
-        return DefaultDesktopDatatransferService.INSTANCE;
-    }
-
-    /**
-     * A class that provides access to java.rmi.Remote and java.rmi.MarshalledObject
-     * without creating a static dependency.
-     */
-    public static class RMI {
-        private static final Class<?> remoteClass = getClass("java.rmi.Remote");
-        private static final Class<?> marshallObjectClass = getClass("java.rmi.MarshalledObject");
-        private static final Constructor<?> marshallCtor = getConstructor(marshallObjectClass, Object.class);
-        private static final Method marshallGet = getMethod(marshallObjectClass, "get");
-
-        private static Class<?> getClass(String name) {
-            try {
-                return Class.forName(name, true, null);
-            } catch (ClassNotFoundException e) {
-                return null;
-            }
-        }
-
-        private static Constructor<?> getConstructor(Class<?> c, Class<?>... types) {
-            try {
-                return (c == null) ? null : c.getDeclaredConstructor(types);
-            } catch (NoSuchMethodException x) {
-                throw new AssertionError(x);
-            }
-        }
-
-        private static Method getMethod(Class<?> c, String name, Class<?>... types) {
-            try {
-                return (c == null) ? null : c.getMethod(name, types);
-            } catch (NoSuchMethodException e) {
-                throw new AssertionError(e);
-            }
-        }
-
-        /**
-         * Returns java.rmi.Remote.class if RMI is present; otherwise {@code null}.
-         */
-        static Class<?> remoteClass() {
-            return remoteClass;
-        }
-
-        /**
-         * Returns {@code true} if the given class is java.rmi.Remote.
-         */
-        public static boolean isRemote(Class<?> c) {
-            return (remoteClass != null) && remoteClass.isAssignableFrom(c);
-        }
-
-        /**
-         * Returns a new MarshalledObject containing the serialized representation
-         * of the given object.
-         */
-        public static Object newMarshalledObject(Object obj) throws IOException {
-            try {
-                return marshallCtor == null ? null : marshallCtor.newInstance(obj);
-            } catch (InstantiationException | IllegalAccessException x) {
-                throw new AssertionError(x);
-            } catch (InvocationTargetException x) {
-                Throwable cause = x.getCause();
-                if (cause instanceof IOException)
-                    throw (IOException) cause;
-                throw new AssertionError(x);
-            }
-        }
-
-        /**
-         * Returns a new copy of the contained marshalled object.
-         */
-        public static Object getMarshalledObject(Object obj)
-                throws IOException, ClassNotFoundException {
-            try {
-                return marshallGet == null ? null : marshallGet.invoke(obj);
-            } catch (IllegalAccessException x) {
-                throw new AssertionError(x);
-            } catch (InvocationTargetException x) {
-                Throwable cause = x.getCause();
-                if (cause instanceof IOException)
-                    throw (IOException) cause;
-                if (cause instanceof ClassNotFoundException)
-                    throw (ClassNotFoundException) cause;
-                throw new AssertionError(x);
-            }
-        }
-
-    }
-}
--- a/jdk/src/java.desktop/share/classes/sun/datatransfer/DesktopDatatransferService.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +0,0 @@
-/*
- * Copyright (c) 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 sun.datatransfer;
-
-import java.awt.datatransfer.DataFlavor;
-import java.awt.datatransfer.FlavorMap;
-import java.util.LinkedHashSet;
-import java.util.function.Supplier;
-
-/**
- * Contains services which desktop provides to the datatransfer system
- * to enrich it's functionality
- *
- * @author Petr Pchelko
- * @since 1.9
- */
-public interface DesktopDatatransferService {
-
-    /**
-     * If desktop is present - invokes a {@code Runnable} on
-     * the event dispatch thread. Otherwise invokes a {@code run()}
-     * method directly.
-     *
-     * @param r a {@code Runnable} to invoke
-     */
-    void invokeOnEventThread(Runnable r);
-
-    /**
-     * Get a platform-dependent default unicode encoding to use in
-     * datatransfer system.
-     *
-     * @return default unicode encoding
-     */
-    String getDefaultUnicodeEncoding();
-
-    /**
-     * Takes an appropriate {@code FlavorMap} from the desktop.
-     * If no appropriate table is found - uses a provided supplier to
-     * instantiate a table. If the desktop is absent - creates and returns
-     * a system singleton.
-     *
-     * @param supplier a constructor that should be used to create a new instance of
-     *                 the {@code FlavorMap}
-     * @return a {@code FlavorMap}
-     */
-    FlavorMap getFlavorMap(Supplier<FlavorMap> supplier);
-
-    /**
-     * Checks if desktop is present
-     *
-     * @return {@code true} is the desktop is present
-     */
-    boolean isDesktopPresent();
-
-    /**
-     * Returns platform-specific mappings for the specified native format.
-     * If there are no platform-specific mappings for this native, the method
-     * returns an empty {@code Set}
-     *
-     * @param nat a native format to return flavors for
-     * @return set of platform-specific mappings for a native format
-     */
-    LinkedHashSet<DataFlavor> getPlatformMappingsForNative(String nat);
-
-    /**
-     * Returns platform-specific mappings for the specified flavor.
-     * If there are no platform-specific mappings for this flavor, the method
-     * returns an empty {@code Set}
-     *
-     * @param df {@code DataFlavor} to return mappings for
-     * @return set of platform-specific mappings for a {@code DataFlavor}
-     */
-    LinkedHashSet<String> getPlatformMappingsForFlavor(DataFlavor df);
-
-    /**
-     * This method is called for text flavor mappings established while parsing
-     * the default flavor mappings file. It stores the "eoln" and "terminators"
-     * parameters which are not officially part of the MIME type. They are
-     * MIME parameters specific to the flavormap.properties file format.
-     */
-    void registerTextFlavorProperties(String nat, String charset,
-                                      String eoln, String terminators);
-}
--- a/jdk/src/java.desktop/share/classes/sun/font/Font2D.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.desktop/share/classes/sun/font/Font2D.java	Mon Feb 23 05:01:11 2015 -0800
@@ -157,6 +157,21 @@
         }
     }
 
+    public static final int FWIDTH_NORMAL = 5;    // OS/2 usWidthClass
+    public static final int FWEIGHT_NORMAL = 400; // OS/2 usWeightClass
+    public static final int FWEIGHT_BOLD   = 700; // OS/2 usWeightClass
+
+    public int getWidth() {
+        return FWIDTH_NORMAL;
+    }
+
+    public int getWeight() {
+        if ((style & Font.BOLD) !=0) {
+            return FWEIGHT_BOLD;
+        } else {
+            return FWEIGHT_NORMAL;
+        }
+    }
 
     int getRank() {
         return fontRank;
--- a/jdk/src/java.desktop/share/classes/sun/font/FontFamily.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.desktop/share/classes/sun/font/FontFamily.java	Mon Feb 23 05:01:11 2015 -0800
@@ -27,6 +27,7 @@
 
 import java.io.File;
 import java.awt.Font;
+import java.util.Collection;
 import java.util.HashMap;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.Locale;
@@ -77,7 +78,7 @@
             family.bolditalic = null;
         }
         if (family.plain == null && family.bold == null &&
-            family.plain == null && family.bold == null) {
+            family.italic == null && family.bolditalic == null) {
             familyNameMap.remove(name);
         }
     }
@@ -134,7 +135,98 @@
         return java.util.Objects.equals(newDir, existDir);
     }
 
+    /*
+     * We want a family to be of the same width and prefer medium/normal width.
+     * Once we find a particular width we accept more of the same width
+     * until we find one closer to normal when we 'evict' all existing fonts.
+     * So once we see a 'normal' width font we evict all members that are not
+     * normal width and then accept only new ones that are normal width.
+     *
+     * Once a font passes the width test we subject it to the weight test.
+     * For Plain we target the weight the closest that is <= NORMAL (400)
+     * For Bold we target the weight that is closest to BOLD (700).
+     *
+     * In the future, rather than discarding these fonts, we should
+     * extend the family to include these so lookups on these properties
+     * can locate them, as presently they will only be located by full name
+     * based lookup.
+     */
+
+    private int familyWidth = 0;
+    private boolean preferredWidth(Font2D font) {
+
+        int newWidth = font.getWidth();
+
+        if (familyWidth == 0) {
+            familyWidth = newWidth;
+            return true;
+        }
+
+        if (newWidth == familyWidth) {
+            return true;
+        }
+
+        if (Math.abs(Font2D.FWIDTH_NORMAL - newWidth) <
+            Math.abs(Font2D.FWIDTH_NORMAL - familyWidth))
+        {
+           if (FontUtilities.debugFonts()) {
+               FontUtilities.getLogger().info(
+               "Found more preferred width. New width = " + newWidth +
+               " Old width = " + familyWidth + " in font " + font +
+               " nulling out fonts plain: " + plain + " bold: " + bold +
+               " italic: " + italic + " bolditalic: " + bolditalic);
+           }
+           familyWidth = newWidth;
+           plain = bold = italic = bolditalic = null;
+           return true;
+        } else if (FontUtilities.debugFonts()) {
+               FontUtilities.getLogger().info(
+               "Family rejecting font " + font +
+               " of less preferred width " + newWidth);
+        }
+        return false;
+    }
+
+    private boolean closerWeight(Font2D currFont, Font2D font, int style) {
+        if (familyWidth != font.getWidth()) {
+            return false;
+        }
+
+        if (currFont == null) {
+            return true;
+        }
+
+        if (FontUtilities.debugFonts()) {
+            FontUtilities.getLogger().info(
+            "New weight for style " + style + ". Curr.font=" + currFont +
+            " New font="+font+" Curr.weight="+ + currFont.getWeight()+
+            " New weight="+font.getWeight());
+        }
+
+        int newWeight = font.getWeight();
+        switch (style) {
+            case Font.PLAIN:
+            case Font.ITALIC:
+                return (newWeight <= Font2D.FWEIGHT_NORMAL &&
+                        newWeight > currFont.getWeight());
+
+            case Font.BOLD:
+            case Font.BOLD|Font.ITALIC:
+                return (Math.abs(newWeight - Font2D.FWEIGHT_BOLD) <
+                        Math.abs(currFont.getWeight() - Font2D.FWEIGHT_BOLD));
+
+            default:
+               return false;
+        }
+    }
+
     public void setFont(Font2D font, int style) {
+
+        if (FontUtilities.isLogging()) {
+            FontUtilities.getLogger().info(
+            "Request to add " + font + " with style " + style +
+            " to family " + this);
+        }
         /* Allow a lower-rank font only if its a file font
          * from the exact same source as any previous font.
          */
@@ -152,19 +244,27 @@
         switch (style) {
 
         case Font.PLAIN:
-            plain = font;
+            if (preferredWidth(font) && closerWeight(plain, font, style)) {
+                plain = font;
+            }
             break;
 
         case Font.BOLD:
-            bold = font;
+            if (preferredWidth(font) && closerWeight(bold, font, style)) {
+                bold = font;
+            }
             break;
 
         case Font.ITALIC:
-            italic = font;
+            if (preferredWidth(font) && closerWeight(italic, font, style)) {
+                italic = font;
+            }
             break;
 
         case Font.BOLD|Font.ITALIC:
-            bolditalic = font;
+            if (preferredWidth(font) && closerWeight(bolditalic, font, style)) {
+                bolditalic = font;
+            }
             break;
 
         default:
@@ -316,6 +416,11 @@
         return allLocaleNames.get(name.toLowerCase());
     }
 
+    public static FontFamily[] getAllFontFamilies() {
+       Collection<FontFamily> families = familyNameMap.values();
+       return families.toArray(new FontFamily[0]);
+    }
+
     public String toString() {
         return
             "Font family: " + familyName +
--- a/jdk/src/java.desktop/share/classes/sun/font/TrueTypeFont.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.desktop/share/classes/sun/font/TrueTypeFont.java	Mon Feb 23 05:01:11 2015 -0800
@@ -963,6 +963,18 @@
         setStyle(getTableBuffer(os_2Tag));
     }
 
+    private int fontWidth = 0;
+    @Override
+    public int getWidth() {
+       return (fontWidth > 0) ? fontWidth : super.getWidth();
+    }
+
+    private int fontWeight = 0;
+    @Override
+    public int getWeight() {
+       return (fontWeight > 0) ? fontWeight : super.getWeight();
+    }
+
     /* TrueTypeFont can use the fsSelection fields of OS/2 table
      * to determine the style. In the unlikely case that doesn't exist,
      * can use macStyle in the 'head' table but simpler to
@@ -978,8 +990,15 @@
     private static final int fsSelectionBoldBit    = 0x00020;
     private static final int fsSelectionRegularBit = 0x00040;
     private void setStyle(ByteBuffer os_2Table) {
+        if (os_2Table == null) {
+            return;
+        }
+        if (os_2Table.capacity() >= 8) {
+            fontWeight = os_2Table.getChar(4) & 0xffff;
+            fontWidth  = os_2Table.getChar(6) & 0xffff;
+        }
         /* fsSelection is unsigned short at buffer offset 62 */
-        if (os_2Table == null || os_2Table.capacity() < 64) {
+        if (os_2Table.capacity() < 64) {
             super.setStyle();
             return;
         }
--- a/jdk/src/java.desktop/share/classes/sun/print/ServiceDialog.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.desktop/share/classes/sun/print/ServiceDialog.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1564,7 +1564,7 @@
                 bmObj = bmTmpObj;
             } else {
                 if (lmObj == null || rmObj == null ||
-                    tmObj == null || rmObj == null) {
+                    tmObj == null || bmObj == null) {
                     return;
                 } else {
                     leftMargin.setValue(lmObj);
--- a/jdk/src/java.desktop/share/classes/sun/swing/SwingUtilities2.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.desktop/share/classes/sun/swing/SwingUtilities2.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -31,6 +31,7 @@
 import java.awt.event.*;
 import java.awt.font.*;
 import java.awt.print.PrinterGraphics;
+import java.text.BreakIterator;
 import java.text.CharacterIterator;
 import java.text.AttributedCharacterIterator;
 import java.text.AttributedString;
@@ -461,16 +462,15 @@
             }
         }
         if (needsTextLayout) {
-            FontRenderContext frc = getFontRenderContext(c, fm);
             AttributedString aString = new AttributedString(string);
             if (c != null) {
                 aString.addAttribute(TextAttribute.NUMERIC_SHAPING,
                         c.getClientProperty(TextAttribute.NUMERIC_SHAPING));
             }
-            LineBreakMeasurer measurer =
-                new LineBreakMeasurer(aString.getIterator(), frc);
-            int nChars = measurer.nextOffset(availTextWidth);
-            string = string.substring(0, nChars);
+            LineBreakMeasurer measurer = new LineBreakMeasurer(
+                    aString.getIterator(), BreakIterator.getCharacterInstance(),
+                    getFontRenderContext(c, fm));
+            string = string.substring(0, measurer.nextOffset(availTextWidth));
 
         }
         return string + clipString;
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XAWTFormatter.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,150 +0,0 @@
-/*
- * Copyright (c) 2003, 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 sun.awt.X11;
-
-import java.util.logging.*;
-import java.text.*;
-import java.util.*;
-import java.io.*;
-
-/**
- * Formatter class providing ANSI output. Based on java.util.logging.SimpleFormatter sources.
- */
-
-public class XAWTFormatter extends java.util.logging.Formatter {
-    Date dat = new Date();
-    private final static String format = "{0,date} {0,time}";
-    private MessageFormat formatter;
-
-    private Object args[] = new Object[1];
-
-    // Line separator string.  This is the value of the line.separator
-    // property at the moment that the SimpleFormatter was created.
-    private String lineSeparator = System.lineSeparator();
-
-    boolean displayFullRecord = false;
-    boolean useANSI = false;
-    boolean showDate = true;
-    boolean showLevel = true;
-    boolean swapMethodClass = false;
-    public XAWTFormatter() {
-        displayFullRecord = "true".equals(LogManager.getLogManager().getProperty("XAWTFormatter.displayFullRecord"));
-        useANSI = "true".equals(LogManager.getLogManager().getProperty("XAWTFormatter.useANSI"));
-        showDate = !"false".equals(LogManager.getLogManager().getProperty("XAWTFormatter.showDate"));
-        showLevel = !"false".equals(LogManager.getLogManager().getProperty("XAWTFormatter.showLevel"));
-        swapMethodClass = "true".equals(LogManager.getLogManager().getProperty("XAWTFormatter.swapMethodClass"));
-    }
-
-    /**
-     * Format the given LogRecord.
-     * @param record the log record to be formatted.
-     * @return a formatted log record
-     */
-    public synchronized String format(LogRecord record) {
-        StringBuffer sb = new StringBuffer();
-        if (useANSI) {
-            Level lev = record.getLevel();
-            if (Level.FINEST.equals(lev)) {
-                sb.append("");
-            } else if (Level.FINER.equals(lev)) {
-                sb.append("");
-            } else if (Level.FINE.equals(lev)) {
-                sb.append("");
-            }
-        }
-        if (displayFullRecord) {
-            if (showDate) {
-                // Minimize memory allocations here.
-                dat.setTime(record.getMillis());
-                args[0] = dat;
-                StringBuffer text = new StringBuffer();
-                if (formatter == null) {
-                    formatter = new MessageFormat(format);
-                }
-                formatter.format(args, text, null);
-                sb.append(text);
-                sb.append(" ");
-            } else {
-                sb.append("    ");
-            }
-            if (swapMethodClass) {
-                if (record.getSourceMethodName() != null) {
-                    sb.append(" ");
-                    sb.append(record.getSourceMethodName());
-                    sb.append(" ");
-                }
-                if (record.getSourceClassName() != null) {
-                    sb.append(record.getSourceClassName());
-                } else {
-                    sb.append(record.getLoggerName());
-                }
-            } else {
-                if (record.getSourceClassName() != null) {
-                    sb.append(record.getSourceClassName());
-                } else {
-                    sb.append(record.getLoggerName());
-                }
-                if (record.getSourceMethodName() != null) {
-                    sb.append(" ");
-                    sb.append(record.getSourceMethodName());
-                    sb.append("");
-                }
-            }
-            sb.append(lineSeparator);
-        }
-        if (useANSI) {
-            Level lev = record.getLevel();
-            if (Level.FINEST.equals(lev)) {
-                sb.append("");
-            } else if (Level.FINER.equals(lev)) {
-                sb.append("");
-            } else if (Level.FINE.equals(lev)) {
-                sb.append("");
-            }
-        }
-        if (showLevel) {
-            sb.append(record.getLevel().getLocalizedName());
-            sb.append(": ");
-        }
-        String message = formatMessage(record);
-        sb.append(message);
-        sb.append(lineSeparator);
-        if (record.getThrown() != null) {
-            try {
-                StringWriter sw = new StringWriter();
-                PrintWriter pw = new PrintWriter(sw);
-                record.getThrown().printStackTrace(pw);
-                pw.close();
-                sb.append(sw.toString());
-            } catch (Exception ex) {
-            }
-        }
-        if (useANSI) {
-            sb.append("");
-        }
-        return sb.toString();
-    }
-}
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XEmbeddedFrame.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XEmbeddedFrame.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -25,15 +25,17 @@
 
 package sun.awt.X11;
 
+import java.awt.AWTKeyStroke;
+import java.awt.Toolkit;
+
 import sun.awt.EmbeddedFrame;
-import java.awt.*;
-import java.awt.AWTKeyStroke;
-import java.util.logging.Logger;
+import sun.util.logging.PlatformLogger;
 
 @SuppressWarnings("serial") // JDK-implementation class
 public class XEmbeddedFrame extends EmbeddedFrame {
 
-    private static final Logger log = Logger.getLogger(XEmbeddedFrame.class.getName());
+    private static final PlatformLogger log =
+            PlatformLogger.getLogger(XEmbeddedFrame.class.getName());
 
     long handle;
     public XEmbeddedFrame() {
--- a/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11GB2312.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11GB2312.java	Mon Feb 23 05:01:11 2015 -0800
@@ -28,6 +28,7 @@
 import java.nio.CharBuffer;
 import java.nio.ByteBuffer;
 import java.nio.charset.*;
+import sun.nio.cs.*;
 import sun.nio.cs.ext.*;
 import static sun.nio.cs.CharsetMapping.*;
 
--- a/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11GBK.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11GBK.java	Mon Feb 23 05:01:11 2015 -0800
@@ -26,6 +26,7 @@
 package sun.awt.motif;
 
 import java.nio.charset.*;
+import sun.nio.cs.*;
 import sun.nio.cs.ext.*;
 import static sun.nio.cs.CharsetMapping.*;
 
--- a/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11JIS0201.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11JIS0201.java	Mon Feb 23 05:01:11 2015 -0800
@@ -29,7 +29,7 @@
 import java.nio.CharBuffer;
 import java.nio.charset.*;
 import sun.nio.cs.*;
-import sun.nio.cs.ext.JIS_X_0201;
+import sun.nio.cs.ext.*;
 import static sun.nio.cs.CharsetMapping.*;
 
 public class X11JIS0201 extends Charset {
--- a/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11JIS0208.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11JIS0208.java	Mon Feb 23 05:01:11 2015 -0800
@@ -28,7 +28,8 @@
 import java.nio.charset.Charset;
 import java.nio.charset.CharsetEncoder;
 import java.nio.charset.CharsetDecoder;
-import sun.nio.cs.ext.JIS_X_0208;
+import sun.nio.cs.*;
+import sun.nio.cs.ext.*;
 
 public class X11JIS0208 extends Charset {
 
--- a/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11JIS0212.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11JIS0212.java	Mon Feb 23 05:01:11 2015 -0800
@@ -28,7 +28,8 @@
 import java.nio.charset.Charset;
 import java.nio.charset.CharsetEncoder;
 import java.nio.charset.CharsetDecoder;
-import sun.nio.cs.ext.JIS_X_0212;
+import sun.nio.cs.*;
+import sun.nio.cs.ext.*;
 
 public class X11JIS0212 extends Charset {
     private static Charset jis0212 = new JIS_X_0212();
--- a/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11KSC5601.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11KSC5601.java	Mon Feb 23 05:01:11 2015 -0800
@@ -28,6 +28,7 @@
 import java.nio.CharBuffer;
 import java.nio.ByteBuffer;
 import java.nio.charset.*;
+import sun.nio.cs.*;
 import sun.nio.cs.ext.*;
 import static sun.nio.cs.CharsetMapping.*;
 
--- a/jdk/src/java.desktop/unix/classes/sun/datatransfer/resources/flavormap.properties	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-#
-# This properties file is used to initialize the default
-# java.awt.datatransfer.SystemFlavorMap. It contains the X11 platform-specific,
-# default mappings between common X11 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=iso8859-1;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
--- a/jdk/src/java.desktop/unix/classes/sun/font/FcFontConfiguration.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.desktop/unix/classes/sun/font/FcFontConfiguration.java	Mon Feb 23 05:01:11 2015 -0800
@@ -180,7 +180,7 @@
         String[] componentFaceNames = cfi[idx].getComponentFaceNames();
         FontDescriptor[] ret = new FontDescriptor[componentFaceNames.length];
         for (int i = 0; i < componentFaceNames.length; i++) {
-            ret[i] = new FontDescriptor(componentFaceNames[i], StandardCharsets.UTF_8.newEncoder(), new int[0]);
+            ret[i] = new FontDescriptor(componentFaceNames[i], StandardCharsets.ISO_8859_1.newEncoder(), new int[0]);
         }
 
         return ret;
--- a/jdk/src/java.desktop/windows/classes/sun/datatransfer/resources/flavormap.properties	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-#
-# This properties file is used to initialize the default
-# java.awt.datatransfer.SystemFlavorMap. It contains the Win32 platform-
-# specific, default mappings between common Win32 Clipboard 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.
-
-UNICODE\ TEXT=text/plain;charset=utf-16le;eoln="\r\n";terminators=2
-TEXT=text/plain;eoln="\r\n";terminators=1
-HTML\ Format=text/html;charset=utf-8;eoln="\r\n";terminators=1
-Rich\ Text\ Format=text/rtf
-HDROP=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
-DIB=image/x-java-image;class=java.awt.Image
-ENHMETAFILE=image/x-java-image;class=java.awt.Image
-METAFILEPICT=image/x-java-image;class=java.awt.Image
-LOCALE=application/x-java-text-encoding;class="[B"
-UniformResourceLocator=application/x-java-url;class=java.net.URL,\
-                       text/uri-list;eoln="\r\n";terminators=1,\
-                       text/plain;eoln="\r\n";terminators=1
-FileGroupDescriptorW=application/x-java-file-list;class=java.util.List
-FileGroupDescriptor=application/x-java-file-list;class=java.util.List
--- a/jdk/src/java.desktop/windows/native/libawt/windows/awt_Desktop.cpp	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.desktop/windows/native/libawt/windows/awt_Desktop.cpp	Mon Feb 23 05:01:11 2015 -0800
@@ -52,6 +52,7 @@
     // 6457572: ShellExecute possibly changes FPU control word - saving it here
     unsigned oldcontrol87 = _control87(0, 0);
     HINSTANCE retval = ::ShellExecute(NULL, verb_c, fileOrUri_c, NULL, NULL, SW_SHOWNORMAL);
+    DWORD error = ::GetLastError();
     _control87(oldcontrol87, 0xffffffff);
 
     JNU_ReleaseStringPlatformChars(env, fileOrUri_j, fileOrUri_c);
@@ -65,7 +66,7 @@
                     FORMAT_MESSAGE_FROM_SYSTEM  |
                     FORMAT_MESSAGE_IGNORE_INSERTS,
                     NULL,
-                    (int)retval,
+                    error,
                     MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
                     (LPTSTR)&buffer,
                     0,
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.management/share/classes/META-INF/services/sun.management.spi.PlatformMBeanProvider	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,25 @@
+#
+# 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.
+#
+com.sun.management.internal.PlatformMBeanProviderImpl
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.management/share/classes/com/sun/management/internal/PlatformMBeanProviderImpl.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,209 @@
+/*
+ * 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 com.sun.management.internal;
+
+import java.lang.management.ManagementFactory;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+import javax.management.DynamicMBean;
+import javax.management.ObjectName;
+import sun.management.ManagementFactoryHelper;
+import sun.management.spi.PlatformMBeanProvider;
+
+public final class PlatformMBeanProviderImpl extends PlatformMBeanProvider {
+    private final List<PlatformComponent<?>> mxbeanList;
+
+    public PlatformMBeanProviderImpl() {
+        mxbeanList = Collections.unmodifiableList(init());
+    }
+
+    @Override
+    public List<PlatformComponent<?>> getPlatformComponentList() {
+        return mxbeanList;
+    }
+
+    private List<PlatformComponent<?>> init() {
+        ArrayList<PlatformComponent<?>> initMBeanList = new ArrayList<>();
+        /**
+         * Garbage Collector in the Java virtual machine.
+         */
+        initMBeanList.add(new PlatformComponent<java.lang.management.MemoryManagerMXBean>() {
+            private final Set<String> garbageCollectorMXBeanInterfaceNames
+                    = Collections.unmodifiableSet(
+                            Stream.of("java.lang.management.MemoryManagerMXBean",
+                                    "java.lang.management.GarbageCollectorMXBean",
+                                    "com.sun.management.GarbageCollectorMXBean")
+                            .collect(Collectors.toSet()));
+
+            @Override
+            public Set<Class<? extends java.lang.management.MemoryManagerMXBean>> mbeanInterfaces() {
+                return Stream.of(java.lang.management.MemoryManagerMXBean.class,
+                        java.lang.management.GarbageCollectorMXBean.class,
+                        com.sun.management.GarbageCollectorMXBean.class)
+                        .collect(Collectors.toSet());
+            }
+
+            @Override
+            public Set<String> mbeanInterfaceNames() {
+                return garbageCollectorMXBeanInterfaceNames;
+            }
+
+            @Override
+            public String getObjectNamePattern() {
+                return ManagementFactory.GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE + ",name=*";
+            }
+
+            @Override
+            public boolean isSingleton() {
+                return false; // zero or more instances
+            }
+
+            @Override
+            public Map<String, java.lang.management.MemoryManagerMXBean> nameToMBeanMap() {
+                List<java.lang.management.GarbageCollectorMXBean> list
+                        = ManagementFactoryHelper.getGarbageCollectorMXBeans();;
+                Map<String, java.lang.management.MemoryManagerMXBean> map;
+                if (list.isEmpty()) {
+                    map = Collections.<String, java.lang.management.MemoryManagerMXBean>emptyMap();
+                } else {
+                    map = new HashMap<>(list.size());
+                    for (java.lang.management.MemoryManagerMXBean gcm : list) {
+                        map.put(gcm.getObjectName().getCanonicalName(),
+                                gcm);
+                    }
+                }
+                return map;
+            }
+        });
+
+        /**
+         * OperatingSystemMXBean
+         */
+        initMBeanList.add(new PlatformComponent<java.lang.management.OperatingSystemMXBean>() {
+            private final Set<String> operatingSystemMXBeanInterfaceNames
+                    = Collections.unmodifiableSet(
+                            Stream.of("java.lang.management.OperatingSystemMXBean",
+                                    "com.sun.management.OperatingSystemMXBean",
+                                    "com.sun.management.UnixOperatingSystemMXBean")
+                            .collect(Collectors.toSet()));
+
+            @Override
+            public Set<Class<? extends java.lang.management.OperatingSystemMXBean>> mbeanInterfaces() {
+                return Stream.of(java.lang.management.OperatingSystemMXBean.class,
+                        com.sun.management.OperatingSystemMXBean.class,
+                        com.sun.management.UnixOperatingSystemMXBean.class)
+                        .collect(Collectors.toSet());
+            }
+
+            @Override
+            public Set<String> mbeanInterfaceNames() {
+                return operatingSystemMXBeanInterfaceNames;
+            }
+
+            @Override
+            public String getObjectNamePattern() {
+                return ManagementFactory.OPERATING_SYSTEM_MXBEAN_NAME;
+            }
+
+            @Override
+            public Map<String, java.lang.management.OperatingSystemMXBean> nameToMBeanMap() {
+                return Collections.<String, java.lang.management.OperatingSystemMXBean>singletonMap(
+                        ManagementFactory.OPERATING_SYSTEM_MXBEAN_NAME,
+                        ManagementFactoryHelper.getOperatingSystemMXBean());
+            }
+        });
+
+        /**
+         * Diagnostic support for the HotSpot Virtual Machine.
+         */
+        initMBeanList.add(new PlatformComponent<com.sun.management.HotSpotDiagnosticMXBean>() {
+            private final Set<String> hotSpotDiagnosticMXBeanInterfaceNames =
+                    Collections.unmodifiableSet(Collections.<String>singleton("com.sun.management.HotSpotDiagnosticMXBean"));
+
+            @Override
+            public Set<Class<? extends com.sun.management.HotSpotDiagnosticMXBean>> mbeanInterfaces() {
+                return Collections.singleton(com.sun.management.HotSpotDiagnosticMXBean.class);
+            }
+
+            @Override
+            public Set<String> mbeanInterfaceNames() {
+                return hotSpotDiagnosticMXBeanInterfaceNames;
+            }
+
+            @Override
+            public String getObjectNamePattern() {
+                return "com.sun.management:type=HotSpotDiagnostic";
+            }
+
+            @Override
+            public Map<String, com.sun.management.HotSpotDiagnosticMXBean> nameToMBeanMap() {
+                return Collections.<String, com.sun.management.HotSpotDiagnosticMXBean>singletonMap(
+                        "com.sun.management:type=HotSpotDiagnostic",
+                        ManagementFactoryHelper.getDiagnosticMXBean());
+            }
+        });
+
+        /**
+         * DynamicMBean
+         */
+        HashMap<ObjectName, DynamicMBean> dynmbeans
+                = ManagementFactoryHelper.getPlatformDynamicMBeans();
+        final Set<String> dynamicMBeanInterfaceNames =
+            Collections.unmodifiableSet(Collections.<String>singleton("javax.management.DynamicMBean"));
+        for (Map.Entry<ObjectName, DynamicMBean> e : dynmbeans.entrySet()) {
+            initMBeanList.add(new PlatformComponent<DynamicMBean>() {
+                @Override
+                public Set<String> mbeanInterfaceNames() {
+                    return dynamicMBeanInterfaceNames;
+                }
+
+                @Override
+                public Set<Class<? extends DynamicMBean>> mbeanInterfaces() {
+                    return Collections.emptySet(); // DynamicMBean cannot be used to find an MBean by ManagementFactory
+                }
+
+                @Override
+                public String getObjectNamePattern() {
+                    return e.getKey().getCanonicalName();
+                }
+
+                @Override
+                public Map<String, DynamicMBean> nameToMBeanMap() {
+                    return Collections.<String, DynamicMBean>singletonMap(
+                            e.getKey().getCanonicalName(),
+                            e.getValue());
+                }
+            });
+        }
+        initMBeanList.trimToSize();
+        return initMBeanList;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.management/share/classes/java/lang/management/DefaultPlatformMBeanProvider.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,503 @@
+/*
+ * 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 java.lang.management;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+import javax.management.DynamicMBean;
+import javax.management.ObjectName;
+import sun.management.ManagementFactoryHelper;
+import sun.management.spi.PlatformMBeanProvider;
+
+class DefaultPlatformMBeanProvider extends PlatformMBeanProvider {
+    private final List<PlatformComponent<?>> mxbeanList;
+
+    DefaultPlatformMBeanProvider() {
+        mxbeanList = Collections.unmodifiableList(init());
+    }
+
+    @Override
+    public List<PlatformComponent<?>> getPlatformComponentList() {
+        return mxbeanList;
+    }
+
+    private List<PlatformComponent<?>> init() {
+        ArrayList<PlatformComponent<?>> initMBeanList = new ArrayList<>();
+        /**
+         * Class loading system of the Java virtual machine.
+         */
+        initMBeanList.add(new PlatformComponent<ClassLoadingMXBean>() {
+            private final Set<String> classLoadingInterfaceNames =
+                    Collections.unmodifiableSet(Collections.singleton(
+                            "java.lang.management.ClassLoadingMXBean"));
+
+            @Override
+            public Set<Class<? extends ClassLoadingMXBean>> mbeanInterfaces() {
+                return Collections.singleton(ClassLoadingMXBean.class);
+            }
+
+            @Override
+            public Set<String> mbeanInterfaceNames() {
+                return classLoadingInterfaceNames;
+            }
+
+            @Override
+            public String getObjectNamePattern() {
+                return ManagementFactory.CLASS_LOADING_MXBEAN_NAME;
+            }
+
+            @Override
+            public Map<String, ClassLoadingMXBean> nameToMBeanMap() {
+                return Collections.singletonMap(
+                        ManagementFactory.CLASS_LOADING_MXBEAN_NAME,
+                        ManagementFactoryHelper.getClassLoadingMXBean());
+            }
+        });
+
+        /**
+         * Compilation system of the Java virtual machine.
+         */
+        initMBeanList.add(new PlatformComponent<CompilationMXBean>() {
+            private final Set<String> compilationMXBeanInterfaceNames
+                    = Collections.unmodifiableSet(Collections.singleton(
+                            "java.lang.management.CompilationMXBean"));
+
+            @Override
+            public Set<Class<? extends CompilationMXBean>> mbeanInterfaces() {
+                return Collections.singleton(CompilationMXBean.class);
+            }
+
+            @Override
+            public Set<String> mbeanInterfaceNames() {
+                return compilationMXBeanInterfaceNames;
+            }
+
+            @Override
+            public String getObjectNamePattern() {
+                return ManagementFactory.COMPILATION_MXBEAN_NAME;
+            }
+
+            @Override
+            public Map<String, CompilationMXBean> nameToMBeanMap() {
+                CompilationMXBean m = ManagementFactoryHelper.getCompilationMXBean();
+                if (m == null) {
+                    return Collections.emptyMap();
+                } else {
+                    return Collections.singletonMap(
+                            ManagementFactory.COMPILATION_MXBEAN_NAME,
+                            ManagementFactoryHelper.getCompilationMXBean());
+                }
+            }
+        });
+
+        /**
+         * Memory system of the Java virtual machine.
+         */
+        initMBeanList.add(new PlatformComponent<MemoryMXBean>() {
+            private final Set<String> memoryMXBeanInterfaceNames
+                    = Collections.unmodifiableSet(Collections.singleton(
+                            "java.lang.management.MemoryMXBean"));
+
+            @Override
+            public Set<Class<? extends MemoryMXBean>> mbeanInterfaces() {
+                return Collections.singleton(MemoryMXBean.class);
+            }
+
+            @Override
+            public Set<String> mbeanInterfaceNames() {
+                return memoryMXBeanInterfaceNames;
+            }
+
+            @Override
+            public String getObjectNamePattern() {
+                return ManagementFactory.MEMORY_MXBEAN_NAME;
+            }
+
+            @Override
+            public Map<String, MemoryMXBean> nameToMBeanMap() {
+                return Collections.singletonMap(
+                        ManagementFactory.MEMORY_MXBEAN_NAME,
+                        ManagementFactoryHelper.getMemoryMXBean());
+            }
+        });
+
+        /**
+         * Garbage Collector in the Java virtual machine.
+         */
+        initMBeanList.add(new PlatformComponent<MemoryManagerMXBean>() {
+            private final Set<String> garbageCollectorMXBeanInterfaceNames
+                    = Collections.unmodifiableSet(
+                            Stream.of("java.lang.management.MemoryManagerMXBean",
+                                    "java.lang.management.GarbageCollectorMXBean")
+                            .collect(Collectors.toSet()));
+            @Override
+            public Set<Class<? extends MemoryManagerMXBean>> mbeanInterfaces() {
+                return Stream.of(MemoryManagerMXBean.class,
+                        GarbageCollectorMXBean.class,
+                        com.sun.management.GarbageCollectorMXBean.class).collect(Collectors.toSet());
+            }
+
+            @Override
+            public Set<String> mbeanInterfaceNames() {
+                return garbageCollectorMXBeanInterfaceNames;
+            }
+
+            @Override
+            public String getObjectNamePattern() {
+                return ManagementFactory.GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE + ",name=*";
+            }
+
+            @Override
+            public boolean isSingleton() {
+                return false; // zero or more instances
+            }
+
+            @Override
+            public Map<String, MemoryManagerMXBean> nameToMBeanMap() {
+                List<GarbageCollectorMXBean> list
+                        = ManagementFactoryHelper.getGarbageCollectorMXBeans();
+                Map<String, MemoryManagerMXBean> map;
+                if (list.isEmpty()) {
+                    map = Collections.emptyMap();
+                } else {
+                    map = new HashMap<>(list.size());
+                    for (MemoryManagerMXBean gcm : list) {
+                        map.put(gcm.getObjectName().getCanonicalName(),
+                                gcm);
+                    }
+                }
+                return map;
+            }
+
+        });
+
+        /**
+         * Memory manager in the Java virtual machine.
+         */
+        initMBeanList.add(new PlatformComponent<MemoryManagerMXBean>() {
+            private final Set<String> memoryManagerMXBeanInterfaceNames
+                    = Collections.unmodifiableSet(Collections.singleton(
+                            "java.lang.management.MemoryManagerMXBean"));
+
+            @Override
+            public Set<Class<? extends MemoryManagerMXBean>> mbeanInterfaces() {
+                return Collections.singleton(MemoryManagerMXBean.class);
+            }
+
+            @Override
+            public Set<String> mbeanInterfaceNames() {
+                return memoryManagerMXBeanInterfaceNames;
+            }
+
+            @Override
+            public String getObjectNamePattern() {
+                return ManagementFactory.MEMORY_MANAGER_MXBEAN_DOMAIN_TYPE + ",name=*";
+            }
+
+            @Override
+            public boolean isSingleton() {
+                return false; // zero or more instances
+            }
+
+            @Override
+            public Map<String, MemoryManagerMXBean> nameToMBeanMap() {
+                List<MemoryManagerMXBean> list
+                        = ManagementFactoryHelper.getMemoryManagerMXBeans();
+                return list.stream()
+                        .filter(this::isMemoryManager)
+                        .collect(Collectors.toMap(
+                                pmo -> pmo.getObjectName().getCanonicalName(), Function.identity()));
+            }
+
+            // ManagementFactoryHelper.getMemoryManagerMXBeans() returns all
+            // memory managers - we need to filter out those that do not match
+            // the pattern for which we are registered
+            private boolean isMemoryManager(MemoryManagerMXBean mbean) {
+                final ObjectName name = mbean.getObjectName();
+                return ManagementFactory.MEMORY_MANAGER_MXBEAN_DOMAIN_TYPE.startsWith(name.getDomain())
+                        && ManagementFactory.MEMORY_MANAGER_MXBEAN_DOMAIN_TYPE.contains(
+                                "type="+name.getKeyProperty("type"));
+            }
+        });
+
+        /**
+         * Memory pool in the Java virtual machine.
+         */
+        initMBeanList.add(new PlatformComponent<MemoryPoolMXBean>() {
+            private final Set<String> memoryPoolMXBeanInterfaceNames
+                    = Collections.unmodifiableSet(Collections.singleton(
+                            "java.lang.management.MemoryPoolMXBean"));
+
+            @Override
+            public Set<Class<? extends MemoryPoolMXBean>> mbeanInterfaces() {
+                return Collections.singleton(MemoryPoolMXBean.class);
+            }
+
+            @Override
+            public Set<String> mbeanInterfaceNames() {
+                return memoryPoolMXBeanInterfaceNames;
+            }
+
+            @Override
+            public String getObjectNamePattern() {
+                return ManagementFactory.MEMORY_POOL_MXBEAN_DOMAIN_TYPE + ",name=*";
+            }
+
+            @Override
+            public boolean isSingleton() {
+                return false; // zero or more instances
+            }
+
+            @Override
+            public Map<String, MemoryPoolMXBean> nameToMBeanMap() {
+                List<MemoryPoolMXBean> list
+                        = ManagementFactoryHelper.getMemoryPoolMXBeans();
+                Map<String, MemoryPoolMXBean> map;
+                if (list.isEmpty()) {
+                    map = Collections.<String, MemoryPoolMXBean>emptyMap();
+                } else {
+                    map = new HashMap<>(list.size());
+                    for (MemoryPoolMXBean mpm : list) {
+                        map.put(mpm.getObjectName().getCanonicalName(),
+                                mpm);
+                    }
+                }
+                return map;
+            }
+        });
+
+        /**
+         * Runtime system of the Java virtual machine.
+         */
+        initMBeanList.add(new PlatformComponent<RuntimeMXBean>() {
+            private final Set<String> runtimeMXBeanInterfaceNames
+                    = Collections.unmodifiableSet(Collections.singleton(
+                            "java.lang.management.RuntimeMXBean"));
+
+            @Override
+            public Set<Class<? extends RuntimeMXBean>> mbeanInterfaces() {
+                return Collections.singleton(RuntimeMXBean.class);
+            }
+
+            @Override
+            public Set<String> mbeanInterfaceNames() {
+                return runtimeMXBeanInterfaceNames;
+            }
+
+            @Override
+            public String getObjectNamePattern() {
+                return ManagementFactory.RUNTIME_MXBEAN_NAME;
+            }
+
+            @Override
+            public Map<String, RuntimeMXBean> nameToMBeanMap() {
+                return Collections.singletonMap(
+                        ManagementFactory.RUNTIME_MXBEAN_NAME,
+                        ManagementFactoryHelper.getRuntimeMXBean());
+            }
+        });
+
+        /**
+         * Threading system of the Java virtual machine.
+         */
+        initMBeanList.add(new PlatformComponent<ThreadMXBean>() {
+            private final Set<String> threadMXBeanInterfaceNames
+                    = Collections.unmodifiableSet(Collections.singleton(
+                            "java.lang.management.ThreadMXBean"));
+
+            @Override
+            public Set<Class<? extends ThreadMXBean>> mbeanInterfaces() {
+                return Collections.singleton(ThreadMXBean.class);
+            }
+
+            @Override
+            public Set<String> mbeanInterfaceNames() {
+                return threadMXBeanInterfaceNames;
+            }
+
+            @Override
+            public String getObjectNamePattern() {
+                return ManagementFactory.THREAD_MXBEAN_NAME;
+            }
+
+            @Override
+            public Map<String, ThreadMXBean> nameToMBeanMap() {
+                return Collections.singletonMap(
+                        ManagementFactory.THREAD_MXBEAN_NAME,
+                        ManagementFactoryHelper.getThreadMXBean());
+            }
+        });
+
+        /**
+         * Logging facility.
+         */
+        initMBeanList.add(new PlatformComponent<PlatformLoggingMXBean>() {
+            private final Set<String> platformLoggingMXBeanInterfaceNames
+                    = Collections.unmodifiableSet(Collections.singleton(
+                            "java.lang.management.PlatformLoggingMXBean"));
+
+            @Override
+            public Set<Class<? extends PlatformLoggingMXBean>> mbeanInterfaces() {
+                return Collections.singleton(PlatformLoggingMXBean.class);
+            }
+
+            @Override
+            public Set<String> mbeanInterfaceNames() {
+                return platformLoggingMXBeanInterfaceNames;
+            }
+
+            @Override
+            public String getObjectNamePattern() {
+                return "java.util.logging:type=Logging";
+            }
+
+            @Override
+            public Map<String, PlatformLoggingMXBean> nameToMBeanMap() {
+                return Collections.singletonMap(
+                        "java.util.logging:type=Logging",
+                        ManagementFactoryHelper.getPlatformLoggingMXBean());
+            }
+        });
+
+        /**
+         * Buffer pools.
+         */
+        initMBeanList.add(new PlatformComponent<BufferPoolMXBean>() {
+            private final Set<String> bufferPoolMXBeanInterfaceNames
+                    = Collections.unmodifiableSet(Collections.singleton(
+                            "java.lang.management.BufferPoolMXBean"));
+
+            @Override
+            public Set<Class<? extends BufferPoolMXBean>> mbeanInterfaces() {
+                return Collections.singleton(BufferPoolMXBean.class);
+            }
+
+            @Override
+            public Set<String> mbeanInterfaceNames() {
+                return bufferPoolMXBeanInterfaceNames;
+            }
+
+            @Override
+            public String getObjectNamePattern() {
+                return "java.nio:type=BufferPool,name=*";
+            }
+
+            @Override
+            public boolean isSingleton() {
+                return false; // zero or more instances
+            }
+
+            @Override
+            public Map<String, BufferPoolMXBean> nameToMBeanMap() {
+                List<BufferPoolMXBean> list
+                        = ManagementFactoryHelper.getBufferPoolMXBeans();
+                Map<String, BufferPoolMXBean> map;
+                if (list.isEmpty()) {
+                    map = Collections.<String, BufferPoolMXBean>emptyMap();
+                } else {
+                    map = new HashMap<>(list.size());
+                    list.stream()
+                        .forEach(mbean -> map.put(mbean.getObjectName().getCanonicalName(),mbean));
+                }
+                return map;
+            }
+        });
+
+        /**
+         * OperatingSystemMXBean
+         */
+        initMBeanList.add(new PlatformComponent<OperatingSystemMXBean>() {
+            private final Set<String> operatingSystemMXBeanInterfaceNames
+                    = Collections.unmodifiableSet(Collections.singleton(
+                            "java.lang.management.OperatingSystemMXBean"));
+
+            @Override
+            public Set<Class<? extends OperatingSystemMXBean>> mbeanInterfaces() {
+                return Collections.singleton(OperatingSystemMXBean.class);
+            }
+
+            @Override
+            public Set<String> mbeanInterfaceNames() {
+                return operatingSystemMXBeanInterfaceNames;
+            }
+
+            @Override
+            public String getObjectNamePattern() {
+                return ManagementFactory.OPERATING_SYSTEM_MXBEAN_NAME;
+            }
+
+            @Override
+            public Map<String, OperatingSystemMXBean> nameToMBeanMap() {
+                return Collections.singletonMap(
+                        ManagementFactory.OPERATING_SYSTEM_MXBEAN_NAME,
+                        ManagementFactoryHelper.getOperatingSystemMXBean());
+            }
+
+        });
+
+        /**
+         * DynamicMBean
+         */
+        HashMap<ObjectName, DynamicMBean> dynmbeans
+                = ManagementFactoryHelper.getPlatformDynamicMBeans();
+        final Set<String> dynamicMBeanInterfaceNames =
+            Collections.unmodifiableSet(Collections.singleton("javax.management.DynamicMBean"));
+        for (Map.Entry<ObjectName, DynamicMBean> e : dynmbeans.entrySet()) {
+            initMBeanList.add(new PlatformComponent<DynamicMBean>() {
+                @Override
+                public Set<Class<? extends DynamicMBean>> mbeanInterfaces() {
+                    return Collections.emptySet();
+                }
+
+                @Override
+                public Set<String> mbeanInterfaceNames() {
+                    return dynamicMBeanInterfaceNames;
+                }
+
+                @Override
+                public String getObjectNamePattern() {
+                    return e.getKey().getCanonicalName();
+                }
+
+                @Override
+                public Map<String, DynamicMBean> nameToMBeanMap() {
+                    return Collections.<String, DynamicMBean>singletonMap(
+                            e.getKey().getCanonicalName(),
+                            e.getValue());
+                }
+            });
+        }
+
+        initMBeanList.trimToSize();
+        return initMBeanList;
+    }
+}
--- a/jdk/src/java.management/share/classes/java/lang/management/ManagementFactory.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.management/share/classes/java/lang/management/ManagementFactory.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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,35 +24,40 @@
  */
 
 package java.lang.management;
+import java.io.FilePermission;
+import java.io.IOException;
 import javax.management.DynamicMBean;
 import javax.management.MBeanServer;
 import javax.management.MBeanServerConnection;
 import javax.management.MBeanServerFactory;
 import javax.management.MBeanServerPermission;
 import javax.management.NotificationEmitter;
-import javax.management.ObjectInstance;
 import javax.management.ObjectName;
-import javax.management.InstanceAlreadyExistsException;
 import javax.management.InstanceNotFoundException;
 import javax.management.MalformedObjectNameException;
-import javax.management.MBeanRegistrationException;
-import javax.management.NotCompliantMBeanException;
 import javax.management.StandardEmitterMBean;
 import javax.management.StandardMBean;
 import java.util.Collections;
 import java.util.List;
 import java.util.Set;
-import java.util.HashMap;
-import java.util.HashSet;
 import java.util.Map;
 import java.security.AccessController;
 import java.security.Permission;
 import java.security.PrivilegedAction;
 import java.security.PrivilegedActionException;
 import java.security.PrivilegedExceptionAction;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Optional;
+import java.util.ServiceLoader;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+import static java.util.stream.Collectors.toMap;
+import java.util.stream.Stream;
 import javax.management.JMX;
-import sun.management.ManagementFactoryHelper;
-import sun.management.ExtendedPlatformComponent;
+import sun.management.Util;
+import sun.management.spi.PlatformMBeanProvider;
+import sun.management.spi.PlatformMBeanProvider.PlatformComponent;
 
 /**
  * The {@code ManagementFactory} class is a factory class for getting
@@ -316,7 +321,7 @@
      * the Java virtual machine.
      */
     public static ClassLoadingMXBean getClassLoadingMXBean() {
-        return ManagementFactoryHelper.getClassLoadingMXBean();
+        return getPlatformMXBean(ClassLoadingMXBean.class);
     }
 
     /**
@@ -326,7 +331,7 @@
      * @return a {@link MemoryMXBean} object for the Java virtual machine.
      */
     public static MemoryMXBean getMemoryMXBean() {
-        return ManagementFactoryHelper.getMemoryMXBean();
+        return getPlatformMXBean(MemoryMXBean.class);
     }
 
     /**
@@ -336,7 +341,7 @@
      * @return a {@link ThreadMXBean} object for the Java virtual machine.
      */
     public static ThreadMXBean getThreadMXBean() {
-        return ManagementFactoryHelper.getThreadMXBean();
+        return getPlatformMXBean(ThreadMXBean.class);
     }
 
     /**
@@ -347,7 +352,7 @@
 
      */
     public static RuntimeMXBean getRuntimeMXBean() {
-        return ManagementFactoryHelper.getRuntimeMXBean();
+        return getPlatformMXBean(RuntimeMXBean.class);
     }
 
     /**
@@ -360,7 +365,7 @@
      *   no compilation system.
      */
     public static CompilationMXBean getCompilationMXBean() {
-        return ManagementFactoryHelper.getCompilationMXBean();
+        return getPlatformMXBean(CompilationMXBean.class);
     }
 
     /**
@@ -371,7 +376,7 @@
      * the Java virtual machine.
      */
     public static OperatingSystemMXBean getOperatingSystemMXBean() {
-        return ManagementFactoryHelper.getOperatingSystemMXBean();
+        return getPlatformMXBean(OperatingSystemMXBean.class);
     }
 
     /**
@@ -384,7 +389,7 @@
      *
      */
     public static List<MemoryPoolMXBean> getMemoryPoolMXBeans() {
-        return ManagementFactoryHelper.getMemoryPoolMXBeans();
+        return getPlatformMXBeans(MemoryPoolMXBean.class);
     }
 
     /**
@@ -397,7 +402,7 @@
      *
      */
     public static List<MemoryManagerMXBean> getMemoryManagerMXBeans() {
-        return ManagementFactoryHelper.getMemoryManagerMXBeans();
+        return getPlatformMXBeans(MemoryManagerMXBean.class);
     }
 
 
@@ -413,7 +418,7 @@
      *
      */
     public static List<GarbageCollectorMXBean> getGarbageCollectorMXBeans() {
-        return ManagementFactoryHelper.getGarbageCollectorMXBeans();
+        return getPlatformMXBeans(GarbageCollectorMXBean.class);
     }
 
     private static MBeanServer platformMBeanServer;
@@ -467,35 +472,11 @@
 
         if (platformMBeanServer == null) {
             platformMBeanServer = MBeanServerFactory.createMBeanServer();
-            for (PlatformComponent pc : PlatformComponent.values()) {
-                List<? extends PlatformManagedObject> list =
-                    pc.getMXBeans(pc.getMXBeanInterface());
-                for (PlatformManagedObject o : list) {
-                    // Each PlatformComponent represents one management
-                    // interface. Some MXBean may extend another one.
-                    // The MXBean instances for one platform component
-                    // (returned by pc.getMXBeans()) might be also
-                    // the MXBean instances for another platform component.
-                    // e.g. com.sun.management.GarbageCollectorMXBean
-                    //
-                    // So need to check if an MXBean instance is registered
-                    // before registering into the platform MBeanServer
-                    if (!platformMBeanServer.isRegistered(o.getObjectName())) {
-                        addMXBean(platformMBeanServer, o);
-                    }
-                }
-            }
-            HashMap<ObjectName, DynamicMBean> dynmbeans =
-                    ManagementFactoryHelper.getPlatformDynamicMBeans();
-            for (Map.Entry<ObjectName, DynamicMBean> e : dynmbeans.entrySet()) {
-                addDynamicMBean(platformMBeanServer, e.getValue(), e.getKey());
-            }
-            for (final PlatformManagedObject o :
-                                       ExtendedPlatformComponent.getMXBeans()) {
-                if (!platformMBeanServer.isRegistered(o.getObjectName())) {
-                    addMXBean(platformMBeanServer, o);
-                }
-            }
+            platformComponents()
+                    .stream()
+                    .filter(PlatformComponent::shouldRegister)
+                    .flatMap(pc -> pc.nameToMBeanMap().entrySet().stream())
+                    .forEach(entry -> addMXBean(platformMBeanServer, entry.getKey(), entry.getValue()));
         }
         return platformMBeanServer;
     }
@@ -600,11 +581,8 @@
         // bootstrap class loader
         final Class<?> cls = mxbeanInterface;
         ClassLoader loader =
-            AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
-                public ClassLoader run() {
-                    return cls.getClassLoader();
-                }
-            });
+            AccessController.doPrivileged(
+                    (PrivilegedAction<ClassLoader>) () -> cls.getClassLoader());
         if (!sun.misc.VM.isSystemDomainLoader(loader)) {
             throw new IllegalArgumentException(mxbeanName +
                 " is not a platform MXBean");
@@ -619,7 +597,6 @@
                     " is not an instance of " + mxbeanInterface);
             }
 
-            final Class<?>[] interfaces;
             // check if the registered MBean is a notification emitter
             boolean emitter = connection.isInstanceOf(objName, NOTIF_EMITTER);
 
@@ -661,20 +638,11 @@
      */
     public static <T extends PlatformManagedObject>
             T getPlatformMXBean(Class<T> mxbeanInterface) {
-        PlatformComponent pc = PlatformComponent.getPlatformComponent(mxbeanInterface);
-        if (pc == null) {
-            T mbean = ExtendedPlatformComponent.getMXBean(mxbeanInterface);
-            if (mbean != null) {
-                return mbean;
-            }
-            throw new IllegalArgumentException(mxbeanInterface.getName() +
-                " is not a platform management interface");
-        }
-        if (!pc.isSingleton())
-            throw new IllegalArgumentException(mxbeanInterface.getName() +
-                " can have zero or more than one instances");
+        PlatformComponent<?> pc = PlatformMBeanFinder.findSingleton(mxbeanInterface);
 
-        return pc.getSingletonMXBean(mxbeanInterface);
+        List<? extends T> mbeans = pc.getMBeans(mxbeanInterface);
+        assert mbeans.isEmpty() || mbeans.size() == 1;
+        return mbeans.isEmpty() ? null : mbeans.get(0);
     }
 
     /**
@@ -701,16 +669,19 @@
      */
     public static <T extends PlatformManagedObject> List<T>
             getPlatformMXBeans(Class<T> mxbeanInterface) {
-        PlatformComponent pc = PlatformComponent.getPlatformComponent(mxbeanInterface);
+        // Validates at first the specified interface by finding at least one
+        // PlatformComponent whose MXBean implements this interface.
+        // An interface can be implemented by different MBeans, provided by
+        // different platform components.
+        PlatformComponent<?> pc = PlatformMBeanFinder.findFirst(mxbeanInterface);
         if (pc == null) {
-            T mbean = ExtendedPlatformComponent.getMXBean(mxbeanInterface);
-            if (mbean != null) {
-                return Collections.singletonList(mbean);
-            }
-            throw new IllegalArgumentException(mxbeanInterface.getName() +
-                " is not a platform management interface");
+            throw new IllegalArgumentException(mxbeanInterface.getName()
+                    + " is not a platform management interface");
         }
-        return Collections.unmodifiableList(pc.getMXBeans(mxbeanInterface));
+
+        return platformComponents().stream()
+                .flatMap(p -> p.getMBeans(mxbeanInterface).stream())
+                .collect(Collectors.toList());
     }
 
     /**
@@ -753,22 +724,8 @@
                                 Class<T> mxbeanInterface)
         throws java.io.IOException
     {
-        PlatformComponent pc = PlatformComponent.getPlatformComponent(mxbeanInterface);
-        if (pc == null) {
-            T mbean = ExtendedPlatformComponent.getMXBean(mxbeanInterface);
-            if (mbean != null) {
-                ObjectName on = mbean.getObjectName();
-                return ManagementFactory.newPlatformMXBeanProxy(connection,
-                                                                on.getCanonicalName(),
-                                                                mxbeanInterface);
-            }
-            throw new IllegalArgumentException(mxbeanInterface.getName() +
-                " is not a platform management interface");
-        }
-        if (!pc.isSingleton())
-            throw new IllegalArgumentException(mxbeanInterface.getName() +
-                " can have zero or more than one instances");
-        return pc.getSingletonMXBean(connection, mxbeanInterface);
+        PlatformComponent<?> pc = PlatformMBeanFinder.findSingleton(mxbeanInterface);
+        return newPlatformMXBeanProxy(connection, pc.getObjectNamePattern(), mxbeanInterface);
     }
 
     /**
@@ -804,19 +761,56 @@
                                        Class<T> mxbeanInterface)
         throws java.io.IOException
     {
-        PlatformComponent pc = PlatformComponent.getPlatformComponent(mxbeanInterface);
+        // Validates at first the specified interface by finding at least one
+        // PlatformComponent whose MXBean implements this interface.
+        // An interface can be implemented by different MBeans, provided by
+        // different platform components.
+        PlatformComponent<?> pc = PlatformMBeanFinder.findFirst(mxbeanInterface);
         if (pc == null) {
-            T mbean = ExtendedPlatformComponent.getMXBean(mxbeanInterface);
-            if (mbean != null) {
-                ObjectName on = mbean.getObjectName();
-                T proxy = ManagementFactory.newPlatformMXBeanProxy(connection,
-                            on.getCanonicalName(), mxbeanInterface);
-                return Collections.singletonList(proxy);
+            throw new IllegalArgumentException(mxbeanInterface.getName()
+                    + " is not a platform management interface");
+        }
+
+        // Collect all names, eliminate duplicates.
+        Stream<String> names = Stream.empty();
+        for (PlatformComponent<?> p : platformComponents()) {
+            names = Stream.concat(names, getProxyNames(p, connection, mxbeanInterface));
+        }
+        Set<String> objectNames = names.collect(Collectors.toSet());
+        if (objectNames.isEmpty()) return Collections.emptyList();
+
+        // Map names on proxies.
+        List<T> proxies = new ArrayList<>();
+        for (String name : objectNames) {
+            proxies.add(newPlatformMXBeanProxy(connection, name, mxbeanInterface));
+        }
+        return proxies;
+    }
+
+    // Returns a stream containing all ObjectNames of the MBeans represented by
+    // the specified PlatformComponent and implementing the specified interface.
+    // If the PlatformComponent is a singleton, the name returned by
+    // PlatformComponent.getObjectNamePattern() will be used, otherwise
+    // we will query the specified MBeanServerConnection (conn.queryNames)
+    // with the pattern returned by PlatformComponent.getObjectNamePattern()
+    // in order to find the names of matching MBeans.
+    // In case of singleton, we do not check whether the MBean is registered
+    // in the connection because the caller "getPlatformMXBeans" will do the check
+    // when creating a proxy.
+    private static Stream<String> getProxyNames(PlatformComponent<?> pc,
+                                                MBeanServerConnection conn,
+                                                Class<?> intf)
+            throws IOException
+    {
+        if (pc.mbeanInterfaceNames().contains(intf.getName())) {
+            if (pc.isSingleton()) {
+                return Stream.of(pc.getObjectNamePattern());
+            } else {
+                return conn.queryNames(Util.newObjectName(pc.getObjectNamePattern()), null)
+                        .stream().map(ObjectName::getCanonicalName);
             }
-            throw new IllegalArgumentException(mxbeanInterface.getName() +
-                " is not a platform management interface");
         }
-        return Collections.unmodifiableList(pc.getMXBeans(connection, mxbeanInterface));
+        return Stream.empty();
     }
 
     /**
@@ -835,63 +829,145 @@
     public static Set<Class<? extends PlatformManagedObject>>
            getPlatformManagementInterfaces()
     {
-        Set<Class<? extends PlatformManagedObject>> result =
-            new HashSet<>();
-        for (PlatformComponent component: PlatformComponent.values()) {
-            result.add(component.getMXBeanInterface());
-        }
-        return Collections.unmodifiableSet(result);
+        return platformComponents()
+                .stream()
+                .flatMap(pc -> pc.mbeanInterfaces().stream())
+                .filter(clazz -> PlatformManagedObject.class.isAssignableFrom(clazz))
+                .map(clazz -> clazz.asSubclass(PlatformManagedObject.class))
+                .collect(Collectors.toSet());
     }
 
     private static final String NOTIF_EMITTER =
         "javax.management.NotificationEmitter";
 
-    /**
-     * Registers an MXBean.
-     */
-    private static void addMXBean(final MBeanServer mbs, final PlatformManagedObject pmo) {
-        // Make DynamicMBean out of MXBean by wrapping it with a StandardMBean
+    private static void addMXBean(final MBeanServer mbs, String name, final Object pmo)
+    {
         try {
-            AccessController.doPrivileged(new PrivilegedExceptionAction<Void>() {
-                public Void run() throws InstanceAlreadyExistsException,
-                                         MBeanRegistrationException,
-                                         NotCompliantMBeanException {
-                    final DynamicMBean dmbean;
-                    if (pmo instanceof DynamicMBean) {
-                        dmbean = DynamicMBean.class.cast(pmo);
-                    } else if (pmo instanceof NotificationEmitter) {
-                        dmbean = new StandardEmitterMBean(pmo, null, true, (NotificationEmitter) pmo);
-                    } else {
-                        dmbean = new StandardMBean(pmo, null, true);
-                    }
+            ObjectName oname = ObjectName.getInstance(name);
+            // Make DynamicMBean out of MXBean by wrapping it with a StandardMBean
+            AccessController.doPrivileged((PrivilegedExceptionAction<Void>) () -> {
+                final DynamicMBean dmbean;
+                if (pmo instanceof DynamicMBean) {
+                    dmbean = DynamicMBean.class.cast(pmo);
+                } else if (pmo instanceof NotificationEmitter) {
+                    dmbean = new StandardEmitterMBean(pmo, null, true, (NotificationEmitter) pmo);
+                } else {
+                    dmbean = new StandardMBean(pmo, null, true);
+                }
 
-                    mbs.registerMBean(dmbean, pmo.getObjectName());
-                    return null;
-                }
+                mbs.registerMBean(dmbean, oname);
+                return null;
             });
+        } catch (MalformedObjectNameException mone) {
+            throw new IllegalArgumentException(mone);
         } catch (PrivilegedActionException e) {
             throw new RuntimeException(e.getException());
         }
     }
 
-    /**
-     * Registers a DynamicMBean.
-     */
-    private static void addDynamicMBean(final MBeanServer mbs,
-                                        final DynamicMBean dmbean,
-                                        final ObjectName on) {
-        try {
-            AccessController.doPrivileged(new PrivilegedExceptionAction<Void>() {
-                @Override
-                public Void run() throws InstanceAlreadyExistsException,
-                                         MBeanRegistrationException,
-                                         NotCompliantMBeanException {
-                    mbs.registerMBean(dmbean, on);
-                    return null;
-                }
-            });
-        } catch (PrivilegedActionException e) {
-            throw new RuntimeException(e.getException());
+    private static Collection<PlatformComponent<?>> platformComponents()
+    {
+        return PlatformMBeanFinder.getMap().values();
+    }
+
+    private static class PlatformMBeanFinder
+    {
+        private static final Map<String, PlatformComponent<?>> componentMap;
+        static {
+            // get all providers
+            List<PlatformMBeanProvider> providers = AccessController.doPrivileged(
+                (PrivilegedAction<List<PlatformMBeanProvider>>) () -> {
+                     List<PlatformMBeanProvider> all = new ArrayList<>();
+                     ServiceLoader.loadInstalled(PlatformMBeanProvider.class)
+                                  .forEach(all::add);
+                     all.add(new DefaultPlatformMBeanProvider());
+                     return all;
+                }, null, new FilePermission("<<ALL FILES>>", "read"),
+                         new RuntimePermission("sun.management.spi.PlatformMBeanProvider"));
+
+            // load all platform components into a map
+            componentMap = providers.stream()
+                .flatMap(p -> toPlatformComponentStream(p))
+                // The first one wins if multiple PlatformComponents
+                // with same ObjectName pattern,
+                .collect(toMap(PlatformComponent::getObjectNamePattern,
+                               Function.identity(),
+                              (p1, p2) -> p1));
+        }
+
+        static Map<String, PlatformComponent<?>> getMap() {
+            return componentMap;
+        }
+
+        // Loads all platform components from a provider into a stream
+        // Ensures that two different components are not declared with the same
+        // object name pattern. Throws InternalError if the provider incorrectly
+        // declares two platform components with the same pattern.
+        private static Stream<PlatformComponent<?>>
+            toPlatformComponentStream(PlatformMBeanProvider provider)
+        {
+            return provider.getPlatformComponentList()
+                           .stream()
+                           .collect(toMap(PlatformComponent::getObjectNamePattern,
+                                          Function.identity(),
+                                          (p1, p2) -> {
+                                              throw new InternalError(
+                                                 p1.getObjectNamePattern() +
+                                                 " has been used as key for " + p1 +
+                                                 ", it cannot be reused for " + p2);
+                                          }))
+                           .values().stream();
+        }
+
+        // Finds the first PlatformComponent whose mbeanInterfaceNames() list
+        // contains the specified class name. An MBean interface can be implemented
+        // by different MBeans, provided by different platform components.
+        // For instance the MemoryManagerMXBean interface is implemented both by
+        // regular memory managers, and garbage collector MXBeans. This method is
+        // mainly used to verify that there is at least one PlatformComponent
+        // which provides an implementation of the desired interface.
+        static PlatformComponent<?> findFirst(Class<?> mbeanIntf)
+        {
+            String name = mbeanIntf.getName();
+            Optional<PlatformComponent<?>> op = getMap().values()
+                .stream()
+                .filter(pc -> pc.mbeanInterfaceNames().contains(name))
+                .findFirst();
+
+            if (op.isPresent()) {
+                return op.get();
+            } else {
+                return null;
+            }
+        }
+
+        // Finds a PlatformComponent whose mbeanInterface name list contains
+        // the specified class name, and make sure that one and only one exists.
+        static PlatformComponent<?> findSingleton(Class<?> mbeanIntf)
+        {
+            String name = mbeanIntf.getName();
+            Optional<PlatformComponent<?>> op = getMap().values()
+                .stream()
+                .filter(pc -> pc.mbeanInterfaceNames().contains(name))
+                .reduce((p1, p2) -> {
+                    if (p2 != null) {
+                        throw new IllegalArgumentException(mbeanIntf.getName() +
+                            " can have more than one instance");
+                    } else {
+                        return p1;
+                    }
+                });
+
+            PlatformComponent<?> singleton = op.isPresent() ? op.get() : null;
+            if (singleton == null) {
+                throw new IllegalArgumentException(mbeanIntf.getName() +
+                    " is not a platform management interface");
+            }
+            if (!singleton.isSingleton()) {
+                throw new IllegalArgumentException(mbeanIntf.getName() +
+                    " can have more than one instance");
+            }
+            return singleton;
         }
     }
 }
--- a/jdk/src/java.management/share/classes/java/lang/management/PlatformComponent.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,468 +0,0 @@
-/*
- * Copyright (c) 2008, 2012, 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.lang.management;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.HashSet;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-import javax.management.MBeanServerConnection;
-import javax.management.ObjectName;
-
-import com.sun.management.HotSpotDiagnosticMXBean;
-import com.sun.management.UnixOperatingSystemMXBean;
-
-import sun.management.ManagementFactoryHelper;
-import sun.management.Util;
-
-/**
- * This enum class defines the list of platform components
- * that provides monitoring and management support.
- * Each enum represents one MXBean interface. A MXBean
- * instance could implement one or more MXBean interfaces.
- *
- * For example, com.sun.management.GarbageCollectorMXBean
- * extends java.lang.management.GarbageCollectorMXBean
- * and there is one set of garbage collection MXBean instances,
- * each of which implements both c.s.m. and j.l.m. interfaces.
- * There are two separate enums GARBAGE_COLLECTOR
- * and SUN_GARBAGE_COLLECTOR so that ManagementFactory.getPlatformMXBeans(Class)
- * will return the list of MXBeans of the specified type.
- *
- * To add a new MXBean interface for the Java platform,
- * add a new enum constant and implement the MXBeanFetcher.
- */
-enum PlatformComponent {
-
-    /**
-     * Class loading system of the Java virtual machine.
-     */
-    CLASS_LOADING(
-        "java.lang.management.ClassLoadingMXBean",
-        "java.lang", "ClassLoading", defaultKeyProperties(),
-        true, // singleton
-        new MXBeanFetcher<ClassLoadingMXBean>() {
-            public List<ClassLoadingMXBean> getMXBeans() {
-                return Collections.singletonList(ManagementFactoryHelper.getClassLoadingMXBean());
-            }
-        }),
-
-    /**
-     * Compilation system of the Java virtual machine.
-     */
-    COMPILATION(
-        "java.lang.management.CompilationMXBean",
-        "java.lang", "Compilation", defaultKeyProperties(),
-        true, // singleton
-        new MXBeanFetcher<CompilationMXBean>() {
-            public List<CompilationMXBean> getMXBeans() {
-                CompilationMXBean m = ManagementFactoryHelper.getCompilationMXBean();
-                if (m == null) {
-                   return Collections.emptyList();
-                } else {
-                   return Collections.singletonList(m);
-                }
-            }
-        }),
-
-    /**
-     * Memory system of the Java virtual machine.
-     */
-    MEMORY(
-        "java.lang.management.MemoryMXBean",
-        "java.lang", "Memory", defaultKeyProperties(),
-        true, // singleton
-        new MXBeanFetcher<MemoryMXBean>() {
-            public List<MemoryMXBean> getMXBeans() {
-                return Collections.singletonList(ManagementFactoryHelper.getMemoryMXBean());
-            }
-        }),
-
-    /**
-     * Garbage Collector in the Java virtual machine.
-     */
-    GARBAGE_COLLECTOR(
-        "java.lang.management.GarbageCollectorMXBean",
-        "java.lang", "GarbageCollector", keyProperties("name"),
-        false, // zero or more instances
-        new MXBeanFetcher<GarbageCollectorMXBean>() {
-            public List<GarbageCollectorMXBean> getMXBeans() {
-                return ManagementFactoryHelper.
-                           getGarbageCollectorMXBeans();
-            }
-        }),
-
-    /**
-     * Memory manager in the Java virtual machine.
-     */
-    MEMORY_MANAGER(
-        "java.lang.management.MemoryManagerMXBean",
-        "java.lang", "MemoryManager", keyProperties("name"),
-        false, // zero or more instances
-        new MXBeanFetcher<MemoryManagerMXBean>() {
-            public List<MemoryManagerMXBean> getMXBeans() {
-                return ManagementFactoryHelper.getMemoryManagerMXBeans();
-            }
-        },
-        GARBAGE_COLLECTOR),
-
-    /**
-     * Memory pool in the Java virtual machine.
-     */
-    MEMORY_POOL(
-        "java.lang.management.MemoryPoolMXBean",
-        "java.lang", "MemoryPool", keyProperties("name"),
-        false, // zero or more instances
-        new MXBeanFetcher<MemoryPoolMXBean>() {
-            public List<MemoryPoolMXBean> getMXBeans() {
-                return ManagementFactoryHelper.getMemoryPoolMXBeans();
-            }
-        }),
-
-    /**
-     * Operating system on which the Java virtual machine is running
-     */
-    OPERATING_SYSTEM(
-        "java.lang.management.OperatingSystemMXBean",
-        "java.lang", "OperatingSystem", defaultKeyProperties(),
-        true, // singleton
-        new MXBeanFetcher<OperatingSystemMXBean>() {
-            public List<OperatingSystemMXBean> getMXBeans() {
-                return Collections.singletonList(ManagementFactoryHelper.getOperatingSystemMXBean());
-            }
-        }),
-
-    /**
-     * Runtime system of the Java virtual machine.
-     */
-    RUNTIME(
-        "java.lang.management.RuntimeMXBean",
-        "java.lang", "Runtime", defaultKeyProperties(),
-        true, // singleton
-        new MXBeanFetcher<RuntimeMXBean>() {
-            public List<RuntimeMXBean> getMXBeans() {
-                return Collections.singletonList(ManagementFactoryHelper.getRuntimeMXBean());
-            }
-        }),
-
-    /**
-     * Threading system of the Java virtual machine.
-     */
-    THREADING(
-        "java.lang.management.ThreadMXBean",
-        "java.lang", "Threading", defaultKeyProperties(),
-        true, // singleton
-        new MXBeanFetcher<ThreadMXBean>() {
-            public List<ThreadMXBean> getMXBeans() {
-                return Collections.singletonList(ManagementFactoryHelper.getThreadMXBean());
-            }
-        }),
-
-
-    /**
-     * Logging facility.
-     */
-    LOGGING(
-        "java.lang.management.PlatformLoggingMXBean",
-        "java.util.logging", "Logging", defaultKeyProperties(),
-        true, // singleton
-        new MXBeanFetcher<PlatformLoggingMXBean>() {
-            public List<PlatformLoggingMXBean> getMXBeans() {
-                PlatformLoggingMXBean m = ManagementFactoryHelper.getPlatformLoggingMXBean();
-                if (m == null) {
-                   return Collections.emptyList();
-                } else {
-                   return Collections.singletonList(m);
-                }
-            }
-        }),
-
-    /**
-     * Buffer pools.
-     */
-    BUFFER_POOL(
-        "java.lang.management.BufferPoolMXBean",
-        "java.nio", "BufferPool", keyProperties("name"),
-        false, // zero or more instances
-        new MXBeanFetcher<BufferPoolMXBean>() {
-            public List<BufferPoolMXBean> getMXBeans() {
-                return ManagementFactoryHelper.getBufferPoolMXBeans();
-            }
-        }),
-
-
-    // Sun Platform Extension
-
-    /**
-     * Sun extension garbage collector that performs collections in cycles.
-     */
-    SUN_GARBAGE_COLLECTOR(
-        "com.sun.management.GarbageCollectorMXBean",
-        "java.lang", "GarbageCollector", keyProperties("name"),
-        false, // zero or more instances
-        new MXBeanFetcher<com.sun.management.GarbageCollectorMXBean>() {
-            public List<com.sun.management.GarbageCollectorMXBean> getMXBeans() {
-                return getGcMXBeanList(com.sun.management.GarbageCollectorMXBean.class);
-            }
-        }),
-
-    /**
-     * Sun extension operating system on which the Java virtual machine
-     * is running.
-     */
-    SUN_OPERATING_SYSTEM(
-        "com.sun.management.OperatingSystemMXBean",
-        "java.lang", "OperatingSystem", defaultKeyProperties(),
-        true, // singleton
-        new MXBeanFetcher<com.sun.management.OperatingSystemMXBean>() {
-            public List<com.sun.management.OperatingSystemMXBean> getMXBeans() {
-                return getOSMXBeanList(com.sun.management.OperatingSystemMXBean.class);
-            }
-        }),
-
-    /**
-     * Unix operating system.
-     */
-    SUN_UNIX_OPERATING_SYSTEM(
-        "com.sun.management.UnixOperatingSystemMXBean",
-        "java.lang", "OperatingSystem", defaultKeyProperties(),
-        true, // singleton
-        new MXBeanFetcher<UnixOperatingSystemMXBean>() {
-            public List<UnixOperatingSystemMXBean> getMXBeans() {
-                return getOSMXBeanList(com.sun.management.UnixOperatingSystemMXBean.class);
-            }
-        }),
-
-    /**
-     * Diagnostic support for the HotSpot Virtual Machine.
-     */
-    HOTSPOT_DIAGNOSTIC(
-        "com.sun.management.HotSpotDiagnosticMXBean",
-        "com.sun.management", "HotSpotDiagnostic", defaultKeyProperties(),
-        true, // singleton
-        new MXBeanFetcher<HotSpotDiagnosticMXBean>() {
-            public List<HotSpotDiagnosticMXBean> getMXBeans() {
-                return Collections.singletonList(ManagementFactoryHelper.getDiagnosticMXBean());
-            }
-        });
-
-
-    /**
-     * A task that returns the MXBeans for a component.
-     */
-    interface MXBeanFetcher<T extends PlatformManagedObject> {
-        public List<T> getMXBeans();
-    }
-
-    /*
-     * Returns a list of the GC MXBeans of the given type.
-     */
-    private static <T extends GarbageCollectorMXBean>
-            List<T> getGcMXBeanList(Class<T> gcMXBeanIntf) {
-        List<GarbageCollectorMXBean> list =
-            ManagementFactoryHelper.getGarbageCollectorMXBeans();
-        List<T> result = new ArrayList<>(list.size());
-        for (GarbageCollectorMXBean m : list) {
-            if (gcMXBeanIntf.isInstance(m)) {
-                result.add(gcMXBeanIntf.cast(m));
-            }
-        }
-        return result;
-    }
-
-    /*
-     * Returns the OS mxbean instance of the given type.
-     */
-    private static <T extends OperatingSystemMXBean>
-            List<T> getOSMXBeanList(Class<T> osMXBeanIntf) {
-        OperatingSystemMXBean m =
-            ManagementFactoryHelper.getOperatingSystemMXBean();
-        if (osMXBeanIntf.isInstance(m)) {
-            return Collections.singletonList(osMXBeanIntf.cast(m));
-        } else {
-            return Collections.emptyList();
-        }
-    }
-
-    private final String mxbeanInterfaceName;
-    private final String domain;
-    private final String type;
-    private final Set<String> keyProperties;
-    private final MXBeanFetcher<?> fetcher;
-    private final PlatformComponent[] subComponents;
-    private final boolean singleton;
-
-    private PlatformComponent(String intfName,
-                              String domain, String type,
-                              Set<String> keyProperties,
-                              boolean singleton,
-                              MXBeanFetcher<?> fetcher,
-                              PlatformComponent... subComponents) {
-        this.mxbeanInterfaceName = intfName;
-        this.domain = domain;
-        this.type = type;
-        this.keyProperties = keyProperties;
-        this.singleton = singleton;
-        this.fetcher = fetcher;
-        this.subComponents = subComponents;
-    }
-
-    private static Set<String> defaultKeyProps;
-    private static Set<String> defaultKeyProperties() {
-        if (defaultKeyProps == null) {
-            defaultKeyProps = Collections.singleton("type");
-        }
-        return defaultKeyProps;
-    }
-
-    private static Set<String> keyProperties(String... keyNames) {
-        Set<String> set = new HashSet<>();
-        set.add("type");
-        for (String s : keyNames) {
-            set.add(s);
-        }
-        return set;
-    }
-
-    boolean isSingleton() {
-        return singleton;
-    }
-
-    String getMXBeanInterfaceName() {
-        return mxbeanInterfaceName;
-    }
-
-    @SuppressWarnings("unchecked")
-    Class<? extends PlatformManagedObject> getMXBeanInterface() {
-        try {
-            // Lazy loading the MXBean interface only when it is needed
-            return (Class<? extends PlatformManagedObject>)
-                       Class.forName(mxbeanInterfaceName, false,
-                                     PlatformManagedObject.class.getClassLoader());
-        } catch (ClassNotFoundException x) {
-            throw new AssertionError(x);
-        }
-    }
-
-    @SuppressWarnings("unchecked")
-    <T extends PlatformManagedObject>
-        List<T> getMXBeans(Class<T> mxbeanInterface)
-    {
-        return (List<T>) fetcher.getMXBeans();
-    }
-
-    <T extends PlatformManagedObject> T getSingletonMXBean(Class<T> mxbeanInterface)
-    {
-        if (!singleton)
-            throw new IllegalArgumentException(mxbeanInterfaceName +
-                " can have zero or more than one instances");
-
-        List<T> list = getMXBeans(mxbeanInterface);
-        assert list.size() == 1;
-        return list.isEmpty() ? null : list.get(0);
-    }
-
-    <T extends PlatformManagedObject>
-            T getSingletonMXBean(MBeanServerConnection mbs, Class<T> mxbeanInterface)
-        throws java.io.IOException
-    {
-        if (!singleton)
-            throw new IllegalArgumentException(mxbeanInterfaceName +
-                " can have zero or more than one instances");
-
-        // ObjectName of a singleton MXBean contains only domain and type
-        assert keyProperties.size() == 1;
-        String on = domain + ":type=" + type;
-        return ManagementFactory.newPlatformMXBeanProxy(mbs,
-                                                        on,
-                                                        mxbeanInterface);
-    }
-
-    <T extends PlatformManagedObject>
-            List<T> getMXBeans(MBeanServerConnection mbs, Class<T> mxbeanInterface)
-        throws java.io.IOException
-    {
-        List<T> result = new ArrayList<>();
-        for (ObjectName on : getObjectNames(mbs)) {
-            result.add(ManagementFactory.
-                newPlatformMXBeanProxy(mbs,
-                                       on.getCanonicalName(),
-                                       mxbeanInterface)
-            );
-        }
-        return result;
-    }
-
-    private Set<ObjectName> getObjectNames(MBeanServerConnection mbs)
-        throws java.io.IOException
-    {
-        String domainAndType = domain + ":type=" + type;
-        if (keyProperties.size() > 1) {
-            // if there are more than 1 key properties (i.e. other than "type")
-            domainAndType += ",*";
-        }
-        ObjectName on = Util.newObjectName(domainAndType);
-        Set<ObjectName> set =  mbs.queryNames(on, null);
-        for (PlatformComponent pc : subComponents) {
-            set.addAll(pc.getObjectNames(mbs));
-        }
-        return set;
-    }
-
-    // a map from MXBean interface name to PlatformComponent
-    private static Map<String, PlatformComponent> enumMap;
-    private static synchronized void ensureInitialized() {
-        if (enumMap == null) {
-            enumMap = new HashMap<>();
-            for (PlatformComponent pc: PlatformComponent.values()) {
-                // Use String as the key rather than Class<?> to avoid
-                // causing unnecessary class loading of management interface
-                enumMap.put(pc.getMXBeanInterfaceName(), pc);
-            }
-        }
-    }
-
-    static boolean isPlatformMXBean(String cn) {
-        ensureInitialized();
-        return enumMap.containsKey(cn);
-    }
-
-    static <T extends PlatformManagedObject>
-        PlatformComponent getPlatformComponent(Class<T> mxbeanInterface)
-    {
-        ensureInitialized();
-        String cn = mxbeanInterface.getName();
-        PlatformComponent pc = enumMap.get(cn);
-        if (pc != null && pc.getMXBeanInterface() == mxbeanInterface)
-            return pc;
-        return null;
-    }
-
-    private static final long serialVersionUID = 6992337162326171013L;
-}
--- a/jdk/src/java.management/share/classes/sun/management/ExtendedPlatformComponent.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 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 sun.management;
-
-import java.util.Collections;
-import java.util.List;
-import java.lang.management.PlatformManagedObject;
-
-/**
- * Class to allow for an extended set of platform MXBeans
- */
-public final class ExtendedPlatformComponent {
-    private ExtendedPlatformComponent() {} // Don't create any instances
-
-    /**
-     * Get the extended set of platform MXBeans that should be registered in the
-     * platform MBeanServer, or an empty list if there are no such MXBeans.
-     */
-    public static List<? extends PlatformManagedObject> getMXBeans() {
-        return Collections.emptyList();
-    }
-
-    /**
-     * Returns the extended platform MXBean implementing the given
-     * mxbeanInterface, or null if there is no such MXBean.
-     */
-    public static <T extends PlatformManagedObject>
-            T getMXBean(Class<T> mxbeanInterface) {
-        return null;
-    }
-}
--- a/jdk/src/java.management/share/classes/sun/management/ManagementFactoryHelper.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.management/share/classes/sun/management/ManagementFactoryHelper.java	Mon Feb 23 05:01:11 2015 -0800
@@ -42,14 +42,11 @@
 import sun.util.logging.LoggingSupport;
 
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import com.sun.management.DiagnosticCommandMBean;
 import com.sun.management.HotSpotDiagnosticMXBean;
 
-import static java.lang.management.ManagementFactory.*;
-
 /**
  * ManagementFactoryHelper provides static factory methods to create
  * instances of the management interface.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.management/share/classes/sun/management/spi/PlatformMBeanProvider.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,233 @@
+/*
+ * 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 sun.management.spi;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.ServiceLoader;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+/**
+ * The PlatformMBeanProvider class defines the abstract service interface
+ * that the {@link java.lang.management.ManagementFactory} will invoke to find,
+ * load, and register Platform MBeans.
+ *
+ * ManagementFactory loads the {@linkplain ServiceLoader#loadInstalled(java.lang.Class)
+ * installed providers} of this service interface and each provides the
+ * {@linkplain PlatformComponent platform components} that defines MXBean
+ * or DynamicMBean to be registered in the platform MBeanServer.
+ *
+ * A {@code PlatformMBeanProvider} will implement the {@code getPlatformComponentList()}
+ * method to return the list of {@code PlatformComponents} it provides.
+ */
+public abstract class PlatformMBeanProvider {
+    /**
+     * {@code PlatformComponent} models MBeans of a management interface supported
+     * by the platform.
+     *
+     * If a PlatformComponent models a singleton MBean, the {@link #getObjectNamePattern()
+     * ObjectName pattern} must be the {@link
+     * javax.management.ObjectName#getCanonicalName() canonical name} of that
+     * singleton MBean. Otherwise, it must be an ObjectName pattern
+     * that can be used to query the MBeans for this
+     * PlatformComponent registered in a {@code MBeanServer}.
+     * <br>
+     * The {@link #getObjectNamePattern() ObjectName pattern} serves as a unique
+     * key for identifying the instance of PlatformComponent. It is thus illegal
+     * for a given {@link PlatformMBeanProvider} to export several instance of
+     * PlatformComponent with the same
+     * {@link #getObjectNamePattern() ObjectName pattern} string.
+     * <br>
+     * If two different provider instances export a PlatformComponent for the
+     * same ObjectName pattern, only the PlatformComponent instance of the first
+     * provider will be taken into account.
+     *
+     * @param <T> The higher level interface for which the MBeans modeled by
+     * this object should be recognized. For instance, for the {@link
+     *        java.lang.management.ManagementFactory#getOperatingSystemMXBean()
+     *        Operating System MXBean}, this should be {@link
+     *        java.lang.management.OperatingSystemMXBean
+     *        java.lang.management.OperatingSystemMXBean}.
+     */
+    public interface PlatformComponent<T> {
+        /**
+         * Returns the names of the management interfaces implemented by the
+         * MBeans modeled by this {@code PlatformComponent}.
+         *
+         * @implNote
+         * When {@link java.lang.management.ManagementFactory#getPlatformMXBean(java.lang.Class)
+         * ManagementFactory.getPlatformMXBean(mxbeanInterface)} or {@link
+         * java.lang.management.ManagementFactory#getPlatformMXBeans(java.lang.Class)
+         * ManagementFactory.getPlatformMXBeans(mxbeanInterface)} are invoked,
+         * this PlatformComponent instance will match only if the name of the
+         * given {@code mxbeanInterface} is found in this list.
+         *
+         * @return the names of the management interfaces exported by the MBeans
+         * modeled by this object.
+         */
+        public Set<String> mbeanInterfaceNames();
+
+        /**
+         * A map from ObjectName string to the MBean instance this
+         * {@code PlatformComponent} creates.
+         *
+         * @implNote
+         * If {@link #shouldRegister()} is {@code true}, this method
+         * will be called when the {@link java.lang.management.ManagementFactory
+         * #getPlatformMBeanServer() Platform MBeanServer} is initialized.
+         * By default, this method will also be called by {@link
+         * #getMBeans(java.lang.Class)}, when {@link
+         * java.lang.management.ManagementFactory#getPlatformMXBean(java.lang.Class)
+         * ManagementFactory.getPlatformMXBean(mxbeanInterface)} or {@link
+         * java.lang.management.ManagementFactory#getPlatformMXBeans(java.lang.Class)
+         * ManagementFactory.getPlatformMXBeans(mxbeanInterface)} are invoked,
+         * and when the name of the given {@code mxbeanInterface} is contained
+         * in the names of management interfaces returned by {@link
+         * #mbeanInterfaceNames()}.
+         *
+         * @return A map with, for each MBean, the ObjectName string as key
+         *         and the MBean as value.
+         */
+        public Map<String, T> nameToMBeanMap();
+
+        /**
+         * An ObjectName pattern uniquely identifies the MBeans
+         * modeled by this {@code PlatformComponent}.
+         * If this instance models a singleton MBean, this must be
+         * the {@link
+         * javax.management.ObjectName#getCanonicalName() canonical name}
+         * of that singleton MBean.
+         *
+         * @return An ObjectName pattern uniquely identifies the MBeans
+         * modeled by this instance.
+         */
+        public String getObjectNamePattern();
+
+        /**
+         * Returns {@code true} if this {@code PlatformComponent} models
+         * a singleton MBean. By default, {@code true} is assumed.
+         *
+         * @return {@code true} if this instance models a singleton MBean.
+         */
+        public default boolean isSingleton() {
+            return true;
+        }
+
+        /**
+         * Returns {@code true} if the MBeans modeled by this {@code PlatformComponent}
+         * should automatically be registered in the {@link
+         * java.lang.management.ManagementFactory#getPlatformMBeanServer()
+         * Platform MBeanServer}.  By default, {@code true} is assumed.
+         *
+         * @return {@code true} if the MBeans modeled by this instance should
+         * automatically be registered in the Platform MBeanServer.
+         */
+        public default boolean shouldRegister() {
+            return true;
+        }
+
+        /**
+         * The set of interfaces implemented by the MBeans modeled
+         * by this {@code PlatformComponent}.
+         *
+         * @implNote
+         * {@link java.lang.management.ManagementFactory#getPlatformManagementInterfaces()
+         * ManagementFactory.getPlatformManagementInterfaces()} calls this
+         * method to find the management interfaces supported by the platform.
+         *
+         * @return The set of interfaces implemented by the MBeans modeled
+         *   by this instance
+         */
+        public Set<Class<? extends T>> mbeanInterfaces();
+
+        /**
+         * Return the list of MBeans that implement the given {@code mbeanIntf}
+         * modeled by this {@code PlatformComponent}. This method returns an
+         * empty list if no MBean implements the given {@code mbeanIntf}.
+         *
+         * @implNote This method will be called when {@link
+         * java.lang.management.ManagementFactory#getPlatformMXBean(java.lang.Class)
+         * ManagementFactory.getPlatformMXBean(mbeanIntf)} or {@link
+         * java.lang.management.ManagementFactory#getPlatformMXBeans(java.lang.Class)
+         * ManagementFactory.getPlatformMXBeans(mbeanIntf)} are invoked.
+         * By default it first checks whether the specified {@code mbeanIntf}
+         * name is contained in the returned list from the {@link #mbeanInterfaceNames()}
+         * method. If yes, it proceeds and calls
+         * {@link #mbeans().values()} and filters out all
+         * MBeans which are not instances of the given {@code mbeanIntf}.
+         * Otherwise, it returns an empty list.
+         *
+         * @param mbeanIntf A management interface.
+         * @return A (possibly empty) list of MBeans implementing the given
+         *         {@code mbeanIntf}.
+         */
+        public default <I> List<? extends I> getMBeans(Class<I> mbeanIntf) {
+            List<I> list;
+
+            if (!mbeanInterfaceNames().contains(mbeanIntf.getName())) {
+                list = Collections.emptyList();
+            } else {
+                list = nameToMBeanMap().values().stream()
+                        .filter(mbeanIntf::isInstance)
+                        .map(mbeanIntf::cast)
+                        .collect(Collectors.toList());
+            }
+            return list;
+        }
+    }
+
+    /**
+     * Instantiates a new PlatformMBeanProvider.
+     *
+     * @throws SecurityException if the subclass (and calling code) does not
+     *    have {@code RuntimePermission("sun.management.spi.PlatformMBeanProvider", "subclass")}
+     */
+    protected PlatformMBeanProvider () {
+        this(checkSubclassPermission());
+    }
+
+    private PlatformMBeanProvider(Void unused) {
+    }
+
+    /**
+     * Returns a list of PlatformComponent instances describing the Platform
+     * MBeans provided by this provider.
+     *
+     * @return a list of PlatformComponent instances describing the Platform
+     * MBeans provided by this provider.
+     */
+    public abstract List<PlatformComponent<?>> getPlatformComponentList();
+
+    private static Void checkSubclassPermission() {
+        SecurityManager sm = System.getSecurityManager();
+        if (sm != null) {
+            sm.checkPermission(new RuntimePermission(PlatformMBeanProvider.class.getName(), "subclass"));
+        }
+        return null;
+    }
+}
--- a/jdk/src/java.scripting/share/classes/javax/script/ScriptEngineFactory.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.scripting/share/classes/javax/script/ScriptEngineFactory.java	Mon Feb 23 05:01:11 2015 -0800
@@ -138,6 +138,7 @@
      * @return The value for the given parameter. Returns <code>null</code> if no
      * value is assigned to the key.
      *
+     * @throws NullPointerException if the key is null.
      */
     public Object getParameter(String key);
 
--- a/jdk/src/java.security.acl/share/classes/java/security/acl/Acl.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,241 +0,0 @@
-/*
- * Copyright (c) 1996, 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 java.security.acl;
-
-import java.util.Enumeration;
-import java.security.Principal;
-
-/**
- * Interface representing an Access Control List (ACL).  An Access
- * Control List is a data structure used to guard access to
- * resources.<p>
- *
- * An ACL can be thought of as a data structure with multiple ACL
- * entries.  Each ACL entry, of interface type AclEntry, contains a
- * set of permissions associated with a particular principal. (A
- * principal represents an entity such as an individual user or a
- * group). Additionally, each ACL entry is specified as being either
- * positive or negative. If positive, the permissions are to be
- * granted to the associated principal. If negative, the permissions
- * are to be denied.<p>
- *
- * The ACL Entries in each ACL observe the following rules:
- *
- * <ul> <li>Each principal can have at most one positive ACL entry and
- * one negative entry; that is, multiple positive or negative ACL
- * entries are not allowed for any principal.  Each entry specifies
- * the set of permissions that are to be granted (if positive) or
- * denied (if negative).
- *
- * <li>If there is no entry for a particular principal, then the
- * principal is considered to have a null (empty) permission set.
- *
- * <li>If there is a positive entry that grants a principal a
- * particular permission, and a negative entry that denies the
- * principal the same permission, the result is as though the
- * permission was never granted or denied.
- *
- * <li>Individual permissions always override permissions of the
- * group(s) to which the individual belongs. That is, individual
- * negative permissions (specific denial of permissions) override the
- * groups' positive permissions. And individual positive permissions
- * override the groups' negative permissions.
- *
- * </ul>
- *
- * The {@code  java.security.acl } package provides the
- * interfaces to the ACL and related data structures (ACL entries,
- * groups, permissions, etc.), and the {@code  sun.security.acl }
- * classes provide a default implementation of the interfaces. For
- * example, {@code  java.security.acl.Acl } provides the
- * interface to an ACL and the {@code  sun.security.acl.AclImpl }
- * class provides the default implementation of the interface.<p>
- *
- * The {@code  java.security.acl.Acl } interface extends the
- * {@code  java.security.acl.Owner } interface. The Owner
- * interface is used to maintain a list of owners for each ACL.  Only
- * owners are allowed to modify an ACL. For example, only an owner can
- * call the ACL's {@code addEntry} method to add a new ACL entry
- * to the ACL.
- *
- * @see java.security.acl.AclEntry
- * @see java.security.acl.Owner
- * @see java.security.acl.Acl#getPermissions
- *
- * @author Satish Dharmaraj
- */
-
-public interface Acl extends Owner {
-
-    /**
-     * Sets the name of this ACL.
-     *
-     * @param caller the principal invoking this method. It must be an
-     * owner of this ACL.
-     *
-     * @param name the name to be given to this ACL.
-     *
-     * @exception NotOwnerException if the caller principal
-     * is not an owner of this ACL.
-     *
-     * @see #getName
-     */
-    public void setName(Principal caller, String name)
-      throws NotOwnerException;
-
-    /**
-     * Returns the name of this ACL.
-     *
-     * @return the name of this ACL.
-     *
-     * @see #setName
-     */
-    public String getName();
-
-    /**
-     * Adds an ACL entry to this ACL. An entry associates a principal
-     * (e.g., an individual or a group) with a set of
-     * permissions. Each principal can have at most one positive ACL
-     * entry (specifying permissions to be granted to the principal)
-     * and one negative ACL entry (specifying permissions to be
-     * denied). If there is already an ACL entry of the same type
-     * (negative or positive) already in the ACL, false is returned.
-     *
-     * @param caller the principal invoking this method. It must be an
-     * owner of this ACL.
-     *
-     * @param entry the ACL entry to be added to this ACL.
-     *
-     * @return true on success, false if an entry of the same type
-     * (positive or negative) for the same principal is already
-     * present in this ACL.
-     *
-     * @exception NotOwnerException if the caller principal
-     *  is not an owner of this ACL.
-     */
-    public boolean addEntry(Principal caller, AclEntry entry)
-      throws NotOwnerException;
-
-    /**
-     * Removes an ACL entry from this ACL.
-     *
-     * @param caller the principal invoking this method. It must be an
-     * owner of this ACL.
-     *
-     * @param entry the ACL entry to be removed from this ACL.
-     *
-     * @return true on success, false if the entry is not part of this ACL.
-     *
-     * @exception NotOwnerException if the caller principal is not
-     * an owner of this Acl.
-     */
-    public boolean removeEntry(Principal caller, AclEntry entry)
-          throws NotOwnerException;
-
-    /**
-     * Returns an enumeration for the set of allowed permissions for the
-     * specified principal (representing an entity such as an individual or
-     * a group). This set of allowed permissions is calculated as
-     * follows:
-     *
-     * <ul>
-     *
-     * <li>If there is no entry in this Access Control List for the
-     * specified principal, an empty permission set is returned.
-     *
-     * <li>Otherwise, the principal's group permission sets are determined.
-     * (A principal can belong to one or more groups, where a group is a
-     * group of principals, represented by the Group interface.)
-     * The group positive permission set is the union of all
-     * the positive permissions of each group that the principal belongs to.
-     * The group negative permission set is the union of all
-     * the negative permissions of each group that the principal belongs to.
-     * If there is a specific permission that occurs in both
-     * the positive permission set and the negative permission set,
-     * it is removed from both.<p>
-     *
-     * The individual positive and negative permission sets are also
-     * determined. The positive permission set contains the permissions
-     * specified in the positive ACL entry (if any) for the principal.
-     * Similarly, the negative permission set contains the permissions
-     * specified in the negative ACL entry (if any) for the principal.
-     * The individual positive (or negative) permission set is considered
-     * to be null if there is not a positive (negative) ACL entry for the
-     * principal in this ACL.<p>
-     *
-     * The set of permissions granted to the principal is then calculated
-     * using the simple rule that individual permissions always override
-     * the group permissions. That is, the principal's individual negative
-     * permission set (specific denial of permissions) overrides the group
-     * positive permission set, and the principal's individual positive
-     * permission set overrides the group negative permission set.
-     *
-     * </ul>
-     *
-     * @param user the principal whose permission set is to be returned.
-     *
-     * @return the permission set specifying the permissions the principal
-     * is allowed.
-     */
-    public Enumeration<Permission> getPermissions(Principal user);
-
-    /**
-     * Returns an enumeration of the entries in this ACL. Each element in
-     * the enumeration is of type AclEntry.
-     *
-     * @return an enumeration of the entries in this ACL.
-     */
-    public Enumeration<AclEntry> entries();
-
-    /**
-     * Checks whether or not the specified principal has the specified
-     * permission. If it does, true is returned, otherwise false is returned.
-     *
-     * More specifically, this method checks whether the passed permission
-     * is a member of the allowed permission set of the specified principal.
-     * The allowed permission set is determined by the same algorithm as is
-     * used by the {@code getPermissions} method.
-     *
-     * @param principal the principal, assumed to be a valid authenticated
-     * Principal.
-     *
-     * @param permission the permission to be checked for.
-     *
-     * @return true if the principal has the specified permission, false
-     * otherwise.
-     *
-     * @see #getPermissions
-     */
-    public boolean checkPermission(Principal principal, Permission permission);
-
-    /**
-     * Returns a string representation of the
-     * ACL contents.
-     *
-     * @return a string representation of the ACL contents.
-     */
-    public String toString();
-}
--- a/jdk/src/java.security.acl/share/classes/java/security/acl/AclEntry.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,154 +0,0 @@
-/*
- * Copyright (c) 1996, 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 java.security.acl;
-
-import java.util.Enumeration;
-import java.security.Principal;
-
-/**
- * This is the interface used for representing one entry in an Access
- * Control List (ACL).<p>
- *
- * An ACL can be thought of as a data structure with multiple ACL entry
- * objects. Each ACL entry object contains a set of permissions associated
- * with a particular principal. (A principal represents an entity such as
- * an individual user or a group). Additionally, each ACL entry is specified
- * as being either positive or negative. If positive, the permissions are
- * to be granted to the associated principal. If negative, the permissions
- * are to be denied. Each principal can have at most one positive ACL entry
- * and one negative entry; that is, multiple positive or negative ACL
- * entries are not allowed for any principal.
- *
- * Note: ACL entries are by default positive. An entry becomes a
- * negative entry only if the
- * {@link #setNegativePermissions() setNegativePermissions}
- * method is called on it.
- *
- * @see java.security.acl.Acl
- *
- * @author      Satish Dharmaraj
- */
-public interface AclEntry extends Cloneable {
-
-    /**
-     * Specifies the principal for which permissions are granted or denied
-     * by this ACL entry. If a principal was already set for this ACL entry,
-     * false is returned, otherwise true is returned.
-     *
-     * @param user the principal to be set for this entry.
-     *
-     * @return true if the principal is set, false if there was
-     * already a principal set for this entry.
-     *
-     * @see #getPrincipal
-     */
-    public boolean setPrincipal(Principal user);
-
-    /**
-     * Returns the principal for which permissions are granted or denied by
-     * this ACL entry. Returns null if there is no principal set for this
-     * entry yet.
-     *
-     * @return the principal associated with this entry.
-     *
-     * @see #setPrincipal
-     */
-    public Principal getPrincipal();
-
-    /**
-     * Sets this ACL entry to be a negative one. That is, the associated
-     * principal (e.g., a user or a group) will be denied the permission set
-     * specified in the entry.
-     *
-     * Note: ACL entries are by default positive. An entry becomes a
-     * negative entry only if this {@code setNegativePermissions}
-     * method is called on it.
-     */
-    public void setNegativePermissions();
-
-    /**
-     * Returns true if this is a negative ACL entry (one denying the
-     * associated principal the set of permissions in the entry), false
-     * otherwise.
-     *
-     * @return true if this is a negative ACL entry, false if it's not.
-     */
-    public boolean isNegative();
-
-    /**
-     * Adds the specified permission to this ACL entry. Note: An entry can
-     * have multiple permissions.
-     *
-     * @param permission the permission to be associated with
-     * the principal in this entry.
-     *
-     * @return true if the permission was added, false if the
-     * permission was already part of this entry's permission set.
-     */
-    public boolean addPermission(Permission permission);
-
-    /**
-     * Removes the specified permission from this ACL entry.
-     *
-     * @param permission the permission to be removed from this entry.
-     *
-     * @return true if the permission is removed, false if the
-     * permission was not part of this entry's permission set.
-     */
-    public boolean removePermission(Permission permission);
-
-    /**
-     * Checks if the specified permission is part of the
-     * permission set in this entry.
-     *
-     * @param permission the permission to be checked for.
-     *
-     * @return true if the permission is part of the
-     * permission set in this entry, false otherwise.
-     */
-    public boolean checkPermission(Permission permission);
-
-    /**
-     * Returns an enumeration of the permissions in this ACL entry.
-     *
-     * @return an enumeration of the permissions in this ACL entry.
-     */
-    public Enumeration<Permission> permissions();
-
-    /**
-     * Returns a string representation of the contents of this ACL entry.
-     *
-     * @return a string representation of the contents.
-     */
-    public String toString();
-
-    /**
-     * Clones this ACL entry.
-     *
-     * @return a clone of this ACL entry.
-     */
-    public Object clone();
-}
--- a/jdk/src/java.security.acl/share/classes/java/security/acl/AclNotFoundException.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, 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.security.acl;
-
-/**
- * This is an exception that is thrown whenever a reference is made to a
- * non-existent ACL (Access Control List).
- *
- * @author      Satish Dharmaraj
- */
-public class AclNotFoundException extends Exception {
-
-    private static final long serialVersionUID = 5684295034092681791L;
-
-    /**
-     * Constructs an AclNotFoundException.
-     */
-    public AclNotFoundException() {
-    }
-
-}
--- a/jdk/src/java.security.acl/share/classes/java/security/acl/Group.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +0,0 @@
-/*
- * Copyright (c) 1996, 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 java.security.acl;
-
-import java.util.Enumeration;
-import java.security.Principal;
-
-/**
- * This interface is used to represent a group of principals. (A principal
- * represents an entity such as an individual user or a company). <p>
- *
- * Note that Group extends Principal. Thus, either a Principal or a Group can
- * be passed as an argument to methods containing a Principal parameter. For
- * example, you can add either a Principal or a Group to a Group object by
- * calling the object's {@code addMember} method, passing it the
- * Principal or Group.
- *
- * @author      Satish Dharmaraj
- */
-public interface Group extends Principal {
-
-    /**
-     * Adds the specified member to the group.
-     *
-     * @param user the principal to add to this group.
-     *
-     * @return true if the member was successfully added,
-     * false if the principal was already a member.
-     */
-    public boolean addMember(Principal user);
-
-    /**
-     * Removes the specified member from the group.
-     *
-     * @param user the principal to remove from this group.
-     *
-     * @return true if the principal was removed, or
-     * false if the principal was not a member.
-     */
-    public boolean removeMember(Principal user);
-
-    /**
-     * Returns true if the passed principal is a member of the group.
-     * This method does a recursive search, so if a principal belongs to a
-     * group which is a member of this group, true is returned.
-     *
-     * @param member the principal whose membership is to be checked.
-     *
-     * @return true if the principal is a member of this group,
-     * false otherwise.
-     */
-    public boolean isMember(Principal member);
-
-
-    /**
-     * Returns an enumeration of the members in the group.
-     * The returned objects can be instances of either Principal
-     * or Group (which is a subclass of Principal).
-     *
-     * @return an enumeration of the group members.
-     */
-    public Enumeration<? extends Principal> members();
-
-}
--- a/jdk/src/java.security.acl/share/classes/java/security/acl/LastOwnerException.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, 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.security.acl;
-
-/**
- * This is an exception that is thrown whenever an attempt is made to delete
- * the last owner of an Access Control List.
- *
- * @see java.security.acl.Owner#deleteOwner
- *
- * @author Satish Dharmaraj
- */
-public class LastOwnerException extends Exception {
-
-    private static final long serialVersionUID = -5141997548211140359L;
-
-    /**
-     * Constructs a LastOwnerException.
-     */
-    public LastOwnerException() {
-    }
-}
--- a/jdk/src/java.security.acl/share/classes/java/security/acl/NotOwnerException.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, 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.security.acl;
-
-/**
- * This is an exception that is thrown whenever the modification of an object
- * (such as an Access Control List) is only allowed to be done by an owner of
- * the object, but the Principal attempting the modification is not an owner.
- *
- * @author      Satish Dharmaraj
- */
-public class NotOwnerException extends Exception {
-
-    private static final long serialVersionUID = -5555597911163362399L;
-
-    /**
-     * Constructs a NotOwnerException.
-     */
-    public NotOwnerException() {
-    }
-}
--- a/jdk/src/java.security.acl/share/classes/java/security/acl/Owner.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +0,0 @@
-/*
- * Copyright (c) 1996, 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 java.security.acl;
-
-import java.security.Principal;
-
-/**
- * Interface for managing owners of Access Control Lists (ACLs) or ACL
- * configurations. (Note that the Acl interface in the
- * {@code  java.security.acl} package extends this Owner
- * interface.) The initial owner Principal should be specified as an
- * argument to the constructor of the class implementing this interface.
- *
- * @see java.security.acl.Acl
- *
- */
-public interface Owner {
-
-    /**
-     * Adds an owner. Only owners can modify ACL contents. The caller
-     * principal must be an owner of the ACL in order to invoke this method.
-     * That is, only an owner can add another owner. The initial owner is
-     * configured at ACL construction time.
-     *
-     * @param caller the principal invoking this method. It must be an owner
-     * of the ACL.
-     *
-     * @param owner the owner that should be added to the list of owners.
-     *
-     * @return true if successful, false if owner is already an owner.
-     * @exception NotOwnerException if the caller principal is not an owner
-     * of the ACL.
-     */
-    public boolean addOwner(Principal caller, Principal owner)
-      throws NotOwnerException;
-
-    /**
-     * Deletes an owner. If this is the last owner in the ACL, an exception is
-     * raised.<p>
-     *
-     * The caller principal must be an owner of the ACL in order to invoke
-     * this method.
-     *
-     * @param caller the principal invoking this method. It must be an owner
-     * of the ACL.
-     *
-     * @param owner the owner to be removed from the list of owners.
-     *
-     * @return true if the owner is removed, false if the owner is not part
-     * of the list of owners.
-     *
-     * @exception NotOwnerException if the caller principal is not an owner
-     * of the ACL.
-     *
-     * @exception LastOwnerException if there is only one owner left, so that
-     * deleteOwner would leave the ACL owner-less.
-     */
-    public boolean deleteOwner(Principal caller, Principal owner)
-      throws NotOwnerException, LastOwnerException;
-
-    /**
-     * Returns true if the given principal is an owner of the ACL.
-     *
-     * @param owner the principal to be checked to determine whether or not
-     * it is an owner.
-     *
-     * @return true if the passed principal is in the list of owners, false
-     * if not.
-     */
-    public boolean isOwner(Principal owner);
-
-}
--- a/jdk/src/java.security.acl/share/classes/java/security/acl/Permission.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 1996, 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.security.acl;
-
-
-/**
- * This interface represents a permission, such as that used to grant
- * a particular type of access to a resource.
- *
- * @author Satish Dharmaraj
- */
-public interface Permission {
-
-    /**
-     * Returns true if the object passed matches the permission represented
-     * in this interface.
-     *
-     * @param another the Permission object to compare with.
-     *
-     * @return true if the Permission objects are equal, false otherwise
-     */
-    public boolean equals(Object another);
-
-    /**
-     * Prints a string representation of this permission.
-     *
-     * @return the string representation of the permission.
-     */
-    public String toString();
-
-}
--- a/jdk/src/java.security.acl/share/classes/java/security/acl/package-info.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 1998, 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.
- */
-
-/**
- * The classes and interfaces in this package have been
- * superseded by classes in the java.security package.
- * See that package and, for example, java.security.Permission for details.
- *
- * @since 1.1
- */
-package java.security.acl;
--- a/jdk/src/java.security.acl/share/classes/sun/security/acl/AclEntryImpl.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,181 +0,0 @@
-/*
- * Copyright (c) 1996, 2011, 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.security.acl;
-
-import java.util.*;
-import java.security.Principal;
-import java.security.acl.*;
-
-/**
- * This is a class that describes one entry that associates users
- * or groups with permissions in the ACL.
- * The entry may be used as a way of granting or denying permissions.
- * @author      Satish Dharmaraj
- */
-public class AclEntryImpl implements AclEntry {
-    private Principal user = null;
-    private Vector<Permission> permissionSet = new Vector<>(10, 10);
-    private boolean negative = false;
-
-    /**
-     * Construct an ACL entry that associates a user with permissions
-     * in the ACL.
-     * @param user The user that is associated with this entry.
-     */
-    public AclEntryImpl(Principal user) {
-        this.user = user;
-    }
-
-    /**
-     * Construct a null ACL entry
-     */
-    public AclEntryImpl() {
-    }
-
-    /**
-     * Sets the principal in the entity. If a group or a
-     * principal had already been set, a false value is
-     * returned, otherwise a true value is returned.
-     * @param user The user that is associated with this entry.
-     * @return true if the principal is set, false if there is
-     * one already.
-     */
-    public boolean setPrincipal(Principal user) {
-        if (this.user != null)
-          return false;
-        this.user = user;
-        return true;
-    }
-
-    /**
-     * This method sets the ACL to have negative permissions.
-     * That is the user or group is denied the permission set
-     * specified in the entry.
-     */
-    public void setNegativePermissions() {
-        negative = true;
-    }
-
-    /**
-     * Returns true if this is a negative ACL.
-     */
-    public boolean isNegative() {
-        return negative;
-    }
-
-    /**
-     * A principal or a group can be associated with multiple
-     * permissions. This method adds a permission to the ACL entry.
-     * @param permission The permission to be associated with
-     * the principal or the group in the entry.
-     * @return true if the permission was added, false if the
-     * permission was already part of the permission set.
-     */
-    public boolean addPermission(Permission permission) {
-
-        if (permissionSet.contains(permission))
-          return false;
-
-        permissionSet.addElement(permission);
-
-        return true;
-    }
-
-    /**
-     * The method disassociates the permission from the Principal
-     * or the Group in this ACL entry.
-     * @param permission The permission to be disassociated with
-     * the principal or the group in the entry.
-     * @return true if the permission is removed, false if the
-     * permission is not part of the permission set.
-     */
-    public boolean removePermission(Permission permission) {
-        return permissionSet.removeElement(permission);
-    }
-
-    /**
-     * Checks if the passed permission is part of the allowed
-     * permission set in this entry.
-     * @param permission The permission that has to be part of
-     * the permission set in the entry.
-     * @return true if the permission passed is part of the
-     * permission set in the entry, false otherwise.
-     */
-    public boolean checkPermission(Permission permission) {
-        return permissionSet.contains(permission);
-    }
-
-    /**
-     * return an enumeration of the permissions in this ACL entry.
-     */
-    public Enumeration<Permission> permissions() {
-        return permissionSet.elements();
-    }
-
-    /**
-     * Return a string representation of  the contents of the ACL entry.
-     */
-    public String toString() {
-        StringBuffer s = new StringBuffer();
-        if (negative)
-          s.append("-");
-        else
-          s.append("+");
-        if (user instanceof Group)
-            s.append("Group.");
-        else
-            s.append("User.");
-        s.append(user + "=");
-        Enumeration<Permission> e = permissions();
-        while(e.hasMoreElements()) {
-            Permission p = e.nextElement();
-            s.append(p);
-            if (e.hasMoreElements())
-                s.append(",");
-        }
-        return new String(s);
-    }
-
-    /**
-     * Clones an AclEntry.
-     */
-    @SuppressWarnings("unchecked") // Safe casts assuming clone() works correctly
-    public synchronized Object clone() {
-        AclEntryImpl cloned;
-        cloned = new AclEntryImpl(user);
-        cloned.permissionSet = (Vector<Permission>) permissionSet.clone();
-        cloned.negative = negative;
-        return cloned;
-    }
-
-    /**
-     * Return the Principal associated in this ACL entry.
-     * The method returns null if the entry uses a group
-     * instead of a principal.
-     */
-    public Principal getPrincipal() {
-        return user;
-    }
-}
--- a/jdk/src/java.security.acl/share/classes/sun/security/acl/AclImpl.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,408 +0,0 @@
-/*
- * Copyright (c) 1996, 2011, 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.security.acl;
-
-import java.io.*;
-import java.util.*;
-import java.security.Principal;
-import java.security.acl.*;
-
-/**
- * An Access Control List (ACL) is encapsulated by this class.
- * @author      Satish Dharmaraj
- */
-public class AclImpl extends OwnerImpl implements Acl {
-    //
-    // Maintain four tables. one each for positive and negative
-    // ACLs. One each depending on whether the entity is a group
-    // or principal.
-    //
-    private Hashtable<Principal, AclEntry> allowedUsersTable =
-                                        new Hashtable<>(23);
-    private Hashtable<Principal, AclEntry> allowedGroupsTable =
-                                        new Hashtable<>(23);
-    private Hashtable<Principal, AclEntry> deniedUsersTable =
-                                        new Hashtable<>(23);
-    private Hashtable<Principal, AclEntry> deniedGroupsTable =
-                                        new Hashtable<>(23);
-    private String aclName = null;
-    private Vector<Permission> zeroSet = new Vector<>(1,1);
-
-
-    /**
-     * Constructor for creating an empty ACL.
-     */
-    public AclImpl(Principal owner, String name) {
-        super(owner);
-        try {
-            setName(owner, name);
-        } catch (Exception e) {}
-    }
-
-    /**
-     * Sets the name of the ACL.
-     * @param caller the principal who is invoking this method.
-     * @param name the name of the ACL.
-     * @exception NotOwnerException if the caller principal is
-     * not on the owners list of the Acl.
-     */
-    public void setName(Principal caller, String name)
-      throws NotOwnerException
-    {
-        if (!isOwner(caller))
-            throw new NotOwnerException();
-
-        aclName = name;
-    }
-
-    /**
-     * Returns the name of the ACL.
-     * @return the name of the ACL.
-     */
-    public String getName() {
-        return aclName;
-    }
-
-    /**
-     * Adds an ACL entry to this ACL. An entry associates a
-     * group or a principal with a set of permissions. Each
-     * user or group can have one positive ACL entry and one
-     * negative ACL entry. If there is one of the type (negative
-     * or positive) already in the table, a false value is returned.
-     * The caller principal must be a part of the owners list of
-     * the ACL in order to invoke this method.
-     * @param caller the principal who is invoking this method.
-     * @param entry the ACL entry that must be added to the ACL.
-     * @return true on success, false if the entry is already present.
-     * @exception NotOwnerException if the caller principal
-     * is not on the owners list of the Acl.
-     */
-    public synchronized boolean addEntry(Principal caller, AclEntry entry)
-      throws NotOwnerException
-    {
-        if (!isOwner(caller))
-            throw new NotOwnerException();
-
-        Hashtable<Principal, AclEntry> aclTable = findTable(entry);
-        Principal key = entry.getPrincipal();
-
-        if (aclTable.get(key) != null)
-            return false;
-
-        aclTable.put(key, entry);
-        return true;
-    }
-
-    /**
-     * Removes an ACL entry from this ACL.
-     * The caller principal must be a part of the owners list of the ACL
-     * in order to invoke this method.
-     * @param caller the principal who is invoking this method.
-     * @param entry the ACL entry that must be removed from the ACL.
-     * @return true on success, false if the entry is not part of the ACL.
-     * @exception NotOwnerException if the caller principal is not
-     * the owners list of the Acl.
-     */
-    public synchronized boolean removeEntry(Principal caller, AclEntry entry)
-      throws NotOwnerException
-    {
-        if (!isOwner(caller))
-            throw new NotOwnerException();
-
-        Hashtable<Principal, AclEntry> aclTable = findTable(entry);
-        Principal key = entry.getPrincipal();
-
-        AclEntry o = aclTable.remove(key);
-        return (o != null);
-    }
-
-    /**
-     * This method returns the set of allowed permissions for the
-     * specified principal. This set of allowed permissions is calculated
-     * as follows:
-     *
-     * If there is no entry for a group or a principal an empty permission
-     * set is assumed.
-     *
-     * The group positive permission set is the union of all
-     * the positive permissions of each group that the individual belongs to.
-     * The group negative permission set is the union of all
-     * the negative permissions of each group that the individual belongs to.
-     * If there is a specific permission that occurs in both
-     * the postive permission set and the negative permission set,
-     * it is removed from both. The group positive and negatoive permission
-     * sets are calculated.
-     *
-     * The individial positive permission set and the individual negative
-     * permission set is then calculated. Again abscence of an entry means
-     * the empty set.
-     *
-     * The set of permissions granted to the principal is then calculated using
-     * the simple rule: Individual permissions always override the Group permissions.
-     * Specifically, individual negative permission set (specific
-     * denial of permissions) overrides the group positive permission set.
-     * And the individual positive permission set override the group negative
-     * permission set.
-     *
-     * @param user the principal for which the ACL entry is returned.
-     * @return The resulting permission set that the principal is allowed.
-     */
-    public synchronized Enumeration<Permission> getPermissions(Principal user) {
-
-        Enumeration<Permission> individualPositive;
-        Enumeration<Permission> individualNegative;
-        Enumeration<Permission> groupPositive;
-        Enumeration<Permission> groupNegative;
-
-        //
-        // canonicalize the sets. That is remove common permissions from
-        // positive and negative sets.
-        //
-        groupPositive =
-            subtract(getGroupPositive(user), getGroupNegative(user));
-        groupNegative  =
-            subtract(getGroupNegative(user), getGroupPositive(user));
-        individualPositive =
-            subtract(getIndividualPositive(user), getIndividualNegative(user));
-        individualNegative =
-            subtract(getIndividualNegative(user), getIndividualPositive(user));
-
-        //
-        // net positive permissions is individual positive permissions
-        // plus (group positive - individual negative).
-        //
-        Enumeration<Permission> temp1 =
-            subtract(groupPositive, individualNegative);
-        Enumeration<Permission> netPositive =
-            union(individualPositive, temp1);
-
-        // recalculate the enumeration since we lost it in performing the
-        // subtraction
-        //
-        individualPositive =
-            subtract(getIndividualPositive(user), getIndividualNegative(user));
-        individualNegative =
-            subtract(getIndividualNegative(user), getIndividualPositive(user));
-
-        //
-        // net negative permissions is individual negative permissions
-        // plus (group negative - individual positive).
-        //
-        temp1 = subtract(groupNegative, individualPositive);
-        Enumeration<Permission> netNegative = union(individualNegative, temp1);
-
-        return subtract(netPositive, netNegative);
-    }
-
-    /**
-     * This method checks whether or not the specified principal
-     * has the required permission. If permission is denied
-     * permission false is returned, a true value is returned otherwise.
-     * This method does not authenticate the principal. It presumes that
-     * the principal is a valid authenticated principal.
-     * @param principal the name of the authenticated principal
-     * @param permission the permission that the principal must have.
-     * @return true of the principal has the permission desired, false
-     * otherwise.
-     */
-    public boolean checkPermission(Principal principal, Permission permission)
-    {
-        Enumeration<Permission> permSet = getPermissions(principal);
-        while (permSet.hasMoreElements()) {
-            Permission p = permSet.nextElement();
-            if (p.equals(permission))
-              return true;
-        }
-        return false;
-    }
-
-    /**
-     * returns an enumeration of the entries in this ACL.
-     */
-    public synchronized Enumeration<AclEntry> entries() {
-        return new AclEnumerator(this,
-                                 allowedUsersTable, allowedGroupsTable,
-                                 deniedUsersTable, deniedGroupsTable);
-    }
-
-    /**
-     * return a stringified version of the
-     * ACL.
-     */
-    public String toString() {
-        StringBuilder sb = new StringBuilder();
-        Enumeration<AclEntry> entries = entries();
-        while (entries.hasMoreElements()) {
-            AclEntry entry = entries.nextElement();
-            sb.append(entry.toString().trim());
-            sb.append("\n");
-        }
-
-        return sb.toString();
-    }
-
-    //
-    // Find the table that this entry belongs to. There are 4
-    // tables that are maintained. One each for postive and
-    // negative ACLs and one each for groups and users.
-    // This method figures out which
-    // table is the one that this AclEntry belongs to.
-    //
-    private Hashtable<Principal, AclEntry> findTable(AclEntry entry) {
-        Hashtable<Principal, AclEntry> aclTable = null;
-
-        Principal p = entry.getPrincipal();
-        if (p instanceof Group) {
-            if (entry.isNegative())
-                aclTable = deniedGroupsTable;
-            else
-                aclTable = allowedGroupsTable;
-        } else {
-            if (entry.isNegative())
-                aclTable = deniedUsersTable;
-            else
-                aclTable = allowedUsersTable;
-        }
-        return aclTable;
-    }
-
-    //
-    // returns the set e1 U e2.
-    //
-    private static Enumeration<Permission> union(Enumeration<Permission> e1,
-                Enumeration<Permission> e2) {
-        Vector<Permission> v = new Vector<>(20, 20);
-
-        while (e1.hasMoreElements())
-            v.addElement(e1.nextElement());
-
-        while (e2.hasMoreElements()) {
-            Permission o = e2.nextElement();
-            if (!v.contains(o))
-                v.addElement(o);
-        }
-
-        return v.elements();
-    }
-
-    //
-    // returns the set e1 - e2.
-    //
-    private Enumeration<Permission> subtract(Enumeration<Permission> e1,
-                Enumeration<Permission> e2) {
-        Vector<Permission> v = new Vector<>(20, 20);
-
-        while (e1.hasMoreElements())
-            v.addElement(e1.nextElement());
-
-        while (e2.hasMoreElements()) {
-            Permission o = e2.nextElement();
-            if (v.contains(o))
-                v.removeElement(o);
-        }
-
-        return v.elements();
-    }
-
-    private Enumeration<Permission> getGroupPositive(Principal user) {
-        Enumeration<Permission> groupPositive = zeroSet.elements();
-        Enumeration<Principal> e = allowedGroupsTable.keys();
-        while (e.hasMoreElements()) {
-            Group g = (Group)e.nextElement();
-            if (g.isMember(user)) {
-                AclEntry ae = allowedGroupsTable.get(g);
-                groupPositive = union(ae.permissions(), groupPositive);
-            }
-        }
-        return groupPositive;
-    }
-
-    private Enumeration<Permission> getGroupNegative(Principal user) {
-        Enumeration<Permission> groupNegative = zeroSet.elements();
-        Enumeration<Principal> e = deniedGroupsTable.keys();
-        while (e.hasMoreElements()) {
-            Group g = (Group)e.nextElement();
-            if (g.isMember(user)) {
-                AclEntry ae = deniedGroupsTable.get(g);
-                groupNegative = union(ae.permissions(), groupNegative);
-            }
-        }
-        return groupNegative;
-    }
-
-    private Enumeration<Permission> getIndividualPositive(Principal user) {
-        Enumeration<Permission> individualPositive = zeroSet.elements();
-        AclEntry ae = allowedUsersTable.get(user);
-        if (ae != null)
-            individualPositive = ae.permissions();
-        return individualPositive;
-    }
-
-    private Enumeration<Permission> getIndividualNegative(Principal user) {
-        Enumeration<Permission> individualNegative = zeroSet.elements();
-        AclEntry ae  = deniedUsersTable.get(user);
-        if (ae != null)
-            individualNegative = ae.permissions();
-        return individualNegative;
-    }
-}
-
-final class AclEnumerator implements Enumeration<AclEntry> {
-    Acl acl;
-    Enumeration<AclEntry> u1, u2, g1, g2;
-
-    AclEnumerator(Acl acl, Hashtable<?,AclEntry> u1, Hashtable<?,AclEntry> g1,
-                  Hashtable<?,AclEntry> u2, Hashtable<?,AclEntry> g2) {
-        this.acl = acl;
-        this.u1 = u1.elements();
-        this.u2 = u2.elements();
-        this.g1 = g1.elements();
-        this.g2 = g2.elements();
-    }
-
-    public boolean hasMoreElements() {
-        return (u1.hasMoreElements() ||
-                u2.hasMoreElements() ||
-                g1.hasMoreElements() ||
-                g2.hasMoreElements());
-    }
-
-    public AclEntry nextElement()
-    {
-        AclEntry o;
-        synchronized (acl) {
-            if (u1.hasMoreElements())
-                return u1.nextElement();
-            if (u2.hasMoreElements())
-                return u2.nextElement();
-            if (g1.hasMoreElements())
-                return g1.nextElement();
-            if (g2.hasMoreElements())
-                return g2.nextElement();
-        }
-        throw new NoSuchElementException("Acl Enumerator");
-    }
-}
--- a/jdk/src/java.security.acl/share/classes/sun/security/acl/AllPermissionsImpl.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 1996, 1997, 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.security.acl;
-
-import java.security.Principal;
-import java.security.acl.*;
-
-/**
- * This class implements the principal interface for the set of all permissions.
- * @author Satish Dharmaraj
- */
-public class AllPermissionsImpl extends PermissionImpl {
-
-    public AllPermissionsImpl(String s) {
-        super(s);
-    }
-
-    /**
-     * This function returns true if the permission passed matches the permission represented in
-     * this interface.
-     * @param another The Permission object to compare with.
-     * @returns true always
-     */
-    public boolean equals(Permission another) {
-        return true;
-    }
-}
--- a/jdk/src/java.security.acl/share/classes/sun/security/acl/GroupImpl.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,186 +0,0 @@
-/*
- * Copyright (c) 1996, 2011, 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.security.acl;
-
-import java.util.*;
-import java.security.*;
-import java.security.acl.*;
-
-/**
- * This class implements a group of principals.
- * @author      Satish Dharmaraj
- */
-public class GroupImpl implements Group {
-    private Vector<Principal> groupMembers = new Vector<>(50, 100);
-    private String group;
-
-    /**
-     * Constructs a Group object with no members.
-     * @param groupName the name of the group
-     */
-    public GroupImpl(String groupName) {
-        this.group = groupName;
-    }
-
-    /**
-     * adds the specified member to the group.
-     * @param user The principal to add to the group.
-     * @return true if the member was added - false if the
-     * member could not be added.
-     */
-    public boolean addMember(Principal user) {
-        if (groupMembers.contains(user))
-          return false;
-
-        // do not allow groups to be added to itself.
-        if (group.equals(user.toString()))
-            throw new IllegalArgumentException();
-
-        groupMembers.addElement(user);
-        return true;
-    }
-
-    /**
-     * removes the specified member from the group.
-     * @param user The principal to remove from the group.
-     * @param true if the principal was removed false if
-     * the principal was not a member
-     */
-    public boolean removeMember(Principal user) {
-        return groupMembers.removeElement(user);
-    }
-
-    /**
-     * returns the enumeration of the members in the group.
-     */
-    public Enumeration<? extends Principal> members() {
-        return groupMembers.elements();
-    }
-
-    /**
-     * This function returns true if the group passed matches
-     * the group represented in this interface.
-     * @param another The group to compare this group to.
-     */
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj instanceof Group == false) {
-            return false;
-        }
-        Group another = (Group)obj;
-        return group.equals(another.toString());
-    }
-
-    // equals(Group) for compatibility
-    public boolean equals(Group another) {
-        return equals((Object)another);
-    }
-
-    /**
-     * Prints a stringified version of the group.
-     */
-    public String toString() {
-        return group;
-    }
-
-    /**
-     * return a hashcode for the principal.
-     */
-    public int hashCode() {
-        return group.hashCode();
-    }
-
-    /**
-     * returns true if the passed principal is a member of the group.
-     * @param member The principal whose membership must be checked for.
-     * @return true if the principal is a member of this group,
-     * false otherwise
-     */
-    public boolean isMember(Principal member) {
-
-        //
-        // if the member is part of the group (common case), return true.
-        // if not, recursively search depth first in the group looking for the
-        // principal.
-        //
-        if (groupMembers.contains(member)) {
-            return true;
-        } else {
-            Vector<Group> alreadySeen = new Vector<>(10);
-            return isMemberRecurse(member, alreadySeen);
-        }
-    }
-
-    /**
-     * return the name of the principal.
-     */
-    public String getName() {
-        return group;
-    }
-
-    //
-    // This function is the recursive search of groups for this
-    // implementation of the Group. The search proceeds building up
-    // a vector of already seen groups. Only new groups are considered,
-    // thereby avoiding loops.
-    //
-    boolean isMemberRecurse(Principal member, Vector<Group> alreadySeen) {
-        Enumeration<? extends Principal> e = members();
-        while (e.hasMoreElements()) {
-            boolean mem = false;
-            Principal p = (Principal) e.nextElement();
-
-            // if the member is in this collection, return true
-            if (p.equals(member)) {
-                return true;
-            } else if (p instanceof GroupImpl) {
-                //
-                // if not recurse if the group has not been checked already.
-                // Can call method in this package only if the object is an
-                // instance of this class. Otherwise call the method defined
-                // in the interface. (This can lead to a loop if a mixture of
-                // implementations form a loop, but we live with this improbable
-                // case rather than clutter the interface by forcing the
-                // implementation of this method.)
-                //
-                GroupImpl g = (GroupImpl) p;
-                alreadySeen.addElement(this);
-                if (!alreadySeen.contains(g))
-                  mem =  g.isMemberRecurse(member, alreadySeen);
-            } else if (p instanceof Group) {
-                Group g = (Group) p;
-                if (!alreadySeen.contains(g))
-                  mem = g.isMember(member);
-            }
-
-            if (mem)
-              return mem;
-        }
-        return false;
-    }
-}
--- a/jdk/src/java.security.acl/share/classes/sun/security/acl/OwnerImpl.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,108 +0,0 @@
-/*
- * Copyright (c) 1996, 2006, 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.security.acl;
-
-import java.util.*;
-import java.security.*;
-import java.security.acl.*;
-
-/**
- * Class implementing the Owner interface. The
- * initial owner principal is configured as
- * part of the constructor.
- * @author      Satish Dharmaraj
- */
-public class OwnerImpl implements Owner {
-    private Group ownerGroup;
-
-    public OwnerImpl(Principal owner) {
-        ownerGroup = new GroupImpl("AclOwners");
-        ownerGroup.addMember(owner);
-    }
-
-    /**
-     * Adds an owner. Owners can modify ACL contents and can disassociate
-     * ACLs from the objects they protect in the AclConfig interface.
-     * The caller principal must be a part of the owners list of the ACL in
-     * order to invoke this method. The initial owner is configured
-     * at ACL construction time.
-     * @param caller the principal who is invoking this method.
-     * @param owner The owner that should be added to the owners list.
-     * @return true if success, false if already an owner.
-     * @exception NotOwnerException if the caller principal is not on
-     * the owners list of the Acl.
-     */
-    public synchronized boolean addOwner(Principal caller, Principal owner)
-      throws NotOwnerException
-    {
-        if (!isOwner(caller))
-            throw new NotOwnerException();
-
-        ownerGroup.addMember(owner);
-        return false;
-    }
-
-    /**
-     * Delete owner. If this is the last owner in the ACL, an exception is
-     * raised.
-     * The caller principal must be a part of the owners list of the ACL in
-     * order to invoke this method.
-     * @param caller the principal who is invoking this method.
-     * @param owner The owner to be removed from the owners list.
-     * @return true if the owner is removed, false if the owner is not part
-     * of the owners list.
-     * @exception NotOwnerException if the caller principal is not on
-     * the owners list of the Acl.
-     * @exception LastOwnerException if there is only one owner left in the group, then
-     * deleteOwner would leave the ACL owner-less. This exception is raised in such a case.
-     */
-    public synchronized boolean deleteOwner(Principal caller, Principal owner)
-      throws NotOwnerException, LastOwnerException
-    {
-        if (!isOwner(caller))
-            throw new NotOwnerException();
-
-        Enumeration<? extends Principal> e = ownerGroup.members();
-        //
-        // check if there is atleast 2 members left.
-        //
-        Object o = e.nextElement();
-        if (e.hasMoreElements())
-            return ownerGroup.removeMember(owner);
-        else
-            throw new LastOwnerException();
-
-    }
-
-    /**
-     * returns if the given principal belongs to the owner list.
-     * @param owner The owner to check if part of the owners list
-     * @return true if the passed principal is in the owner list, false if not.
-     */
-    public synchronized boolean isOwner(Principal owner) {
-        return ownerGroup.isMember(owner);
-    }
-}
--- a/jdk/src/java.security.acl/share/classes/sun/security/acl/PermissionImpl.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-/*
- * Copyright (c) 1996, 1999, 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.security.acl;
-
-import java.security.Principal;
-import java.security.acl.*;
-
-/**
- * The PermissionImpl class implements the permission
- * interface for permissions that are strings.
- * @author Satish Dharmaraj
- */
-public class PermissionImpl implements Permission {
-
-    private String permission;
-
-    /**
-     * Construct a permission object using a string.
-     * @param permission the stringified version of the permission.
-     */
-    public PermissionImpl(String permission) {
-        this.permission = permission;
-    }
-
-    /**
-     * This function returns true if the object passed matches the permission
-     * represented in this interface.
-     * @param another The Permission object to compare with.
-     * @return true if the Permission objects are equal, false otherwise
-     */
-    public boolean equals(Object another) {
-        if (another instanceof Permission) {
-            Permission p = (Permission) another;
-            return permission.equals(p.toString());
-        } else {
-            return false;
-        }
-    }
-
-    /**
-     * Prints a stringified version of the permission.
-     * @return the string representation of the Permission.
-     */
-    public String toString() {
-        return permission;
-    }
-
-    /**
-     * Returns a hashcode for this PermissionImpl.
-     *
-     * @return a hashcode for this PermissionImpl.
-     */
-    public int hashCode() {
-        return toString().hashCode();
-    }
-
-}
--- a/jdk/src/java.security.acl/share/classes/sun/security/acl/PrincipalImpl.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +0,0 @@
-/*
- * Copyright (c) 1996, 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.security.acl;
-
-import java.security.*;
-
-/**
- * This class implements the principal interface.
- *
- * @author      Satish Dharmaraj
- */
-public class PrincipalImpl implements Principal {
-
-    private String user;
-
-    /**
-     * Construct a principal from a string user name.
-     * @param user The string form of the principal name.
-     */
-    public PrincipalImpl(String user) {
-        this.user = user;
-    }
-
-    /**
-     * This function returns true if the object passed matches
-     * the principal represented in this implementation
-     * @param another the Principal to compare with.
-     * @return true if the Principal passed is the same as that
-     * encapsulated in this object, false otherwise
-     */
-    public boolean equals(Object another) {
-        if (another instanceof PrincipalImpl) {
-            PrincipalImpl p = (PrincipalImpl) another;
-            return user.equals(p.toString());
-        } else
-          return false;
-    }
-
-    /**
-     * Prints a stringified version of the principal.
-     */
-    public String toString() {
-        return user;
-    }
-
-    /**
-     * return a hashcode for the principal.
-     */
-    public int hashCode() {
-        return user.hashCode();
-    }
-
-    /**
-     * return the name of the principal.
-     */
-    public String getName() {
-        return user;
-    }
-
-}
--- a/jdk/src/java.security.acl/share/classes/sun/security/acl/WorldGroupImpl.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 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.security.acl;
-
-import java.security.*;
-
-/**
- * This class implements a group of principals.
- * @author Satish Dharmaraj
- */
-public class WorldGroupImpl extends GroupImpl {
-
-    public WorldGroupImpl(String s) {
-        super(s);
-    }
-
-    /**
-     * returns true for all passed principals
-     * @param member The principal whose membership must be checked in this Group.
-     * @return true always since this is the "world" group.
-     */
-    public boolean isMember(Principal member) {
-        return true;
-    }
-}
--- a/jdk/src/java.security.jgss/share/classes/sun/security/krb5/KrbApReq.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.security.jgss/share/classes/sun/security/krb5/KrbApReq.java	Mon Feb 23 05:01:11 2015 -0800
@@ -60,16 +60,6 @@
     private static boolean DEBUG = Krb5.DEBUG;
     private static final char[] hexConst = "0123456789ABCDEF".toCharArray();
 
-    private static final MessageDigest md;
-
-    static {
-        try {
-            md = MessageDigest.getInstance("MD5");
-        } catch (NoSuchAlgorithmException ex) {
-            throw new RuntimeException("Impossible");
-        }
-    }
-
     /**
      * Constructs an AP-REQ message to send to the peer.
      * @param tgsCred the <code>Credentials</code> to be used to construct the
@@ -99,10 +89,10 @@
      * @param tgsCred the <code>Credentials</code> to be used to construct the
      *          AP Request  protocol message.
      * @param mutualRequired Whether mutual authentication is required
-     * @param useSubkey Whether the subkey is to be used to protect this
+     * @param useSubKey Whether the subkey is to be used to protect this
      *        specific application session. If this is not set then the
      *        session key from the ticket will be used.
-     * @param checksum checksum of the application data that accompanies
+     * @param cksum checksum of the application data that accompanies
      *        the KRB_AP_REQ.
      * @throws KrbException for any Kerberos protocol specific error
      * @throws IOException for any IO related errors
@@ -142,8 +132,8 @@
      * Constructs an AP-REQ message from the bytes received from the
      * peer.
      * @param message The message received from the peer
-     * @param keys <code>EncrtyptionKey</code>s to decrypt the message;
-     *       key selected will depend on etype used to encrypte data
+     * @param cred <code>KrbAcceptCredential</code> containing keys to decrypt
+     *    the message; key selected will depend on etype used to encrypt data
      * @throws KrbException for any Kerberos protocol specific error
      * @throws IOException for any IO related errors
      *          (e.g. socket operations)
@@ -311,7 +301,14 @@
         if (!authenticator.ctime.inClockSkew())
             throw new KrbApErrException(Krb5.KRB_AP_ERR_SKEW);
 
-        byte[] hash = md.digest(apReqMessg.authenticator.cipher);
+        byte[] hash;
+        try {
+            hash = MessageDigest.getInstance("MD5")
+                    .digest(apReqMessg.authenticator.cipher);
+        } catch (NoSuchAlgorithmException ex) {
+            throw new AssertionError("Impossible");
+        }
+
         char[] h = new char[hash.length * 2];
         for (int i=0; i<hash.length; i++) {
             h[2*i] = hexConst[(hash[i]&0xff)>>4];
--- a/jdk/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureMethod.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureMethod.java	Mon Feb 23 05:01:11 2015 -0800
@@ -21,7 +21,7 @@
  * under the License.
  */
 /*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
  */
 /*
  * $Id: DOMSignatureMethod.java 1333415 2012-05-03 12:03:51Z coheigea $
@@ -111,6 +111,34 @@
         }
     }
 
+    /**
+     * Returns the signature bytes with any additional formatting
+     * necessary for the signature algorithm used. For RSA signatures,
+     * no changes are required, and this method should simply return
+     * back {@code sig}. For DSA and ECDSA, this method should return the
+     * signature in the IEEE P1363 format, the concatenation of r and s.
+     *
+     * @param key the key used to sign
+     * @param sig the signature returned by {@code Signature.sign()}
+     * @return the formatted signature
+     * @throws IOException
+     */
+    abstract byte[] postSignFormat(Key key, byte[] sig) throws IOException;
+
+    /**
+     * Returns the signature bytes with any conversions that are necessary
+     * before the signature can be verified. For RSA signatures,
+     * no changes are required, and this method should simply
+     * return back {@code sig}. For DSA and ECDSA, this method should
+     * return the signature in the DER-encoded ASN.1 format.
+     *
+     * @param key the key used to sign
+     * @param sig the signature
+     * @return the formatted signature
+     * @throws IOException
+     */
+    abstract byte[] preVerifyFormat(Key key, byte[] sig) throws IOException;
+
     static SignatureMethod unmarshal(Element smElem) throws MarshalException {
         String alg = DOMUtils.getAttributeValue(smElem, "Algorithm");
         if (alg.equals(SignatureMethod.RSA_SHA1)) {
@@ -151,6 +179,23 @@
         return params;
     }
 
+    /**
+     * Returns an instance of Signature from the specified Provider.
+     * The algorithm is specified by the {@code getJCAAlgorithm()} method.
+     *
+     * @param p the Provider to use
+     * @return an instance of Signature implementing the algorithm
+     *    specified by {@code getJCAAlgorithm()}
+     * @throws NoSuchAlgorithmException if the Provider does not support the
+     *    signature algorithm
+     */
+    Signature getSignature(Provider p)
+            throws NoSuchAlgorithmException {
+        return (p == null)
+            ? Signature.getInstance(getJCAAlgorithm())
+            : Signature.getInstance(getJCAAlgorithm(), p);
+    }
+
     boolean verify(Key key, SignedInfo si, byte[] sig,
                    XMLValidateContext context)
         throws InvalidKeyException, SignatureException, XMLSignatureException
@@ -163,38 +208,30 @@
             throw new InvalidKeyException("key must be PublicKey");
         }
         if (signature == null) {
+            Provider p = (Provider)context.getProperty(
+                    "org.jcp.xml.dsig.internal.dom.SignatureProvider");
             try {
-                Provider p = (Provider)context.getProperty
-                    ("org.jcp.xml.dsig.internal.dom.SignatureProvider");
-                signature = (p == null)
-                    ? Signature.getInstance(getJCAAlgorithm())
-                    : Signature.getInstance(getJCAAlgorithm(), p);
+                signature = getSignature(p);
             } catch (NoSuchAlgorithmException nsae) {
                 throw new XMLSignatureException(nsae);
             }
         }
         signature.initVerify((PublicKey)key);
         if (log.isLoggable(java.util.logging.Level.FINE)) {
-            log.log(java.util.logging.Level.FINE, "Signature provider:" + signature.getProvider());
+            log.log(java.util.logging.Level.FINE,
+                    "Signature provider:" + signature.getProvider());
             log.log(java.util.logging.Level.FINE, "verifying with key: " + key);
         }
         ((DOMSignedInfo)si).canonicalize(context,
                                          new SignerOutputStream(signature));
-
+        byte[] s;
         try {
-            Type type = getAlgorithmType();
-            if (type == Type.DSA) {
-                int size = ((DSAKey)key).getParams().getQ().bitLength();
-                return signature.verify(JavaUtils.convertDsaXMLDSIGtoASN1(sig,
-                                                                       size/8));
-            } else if (type == Type.ECDSA) {
-                return signature.verify(SignatureECDSA.convertXMLDSIGtoASN1(sig));
-            } else {
-                return signature.verify(sig);
-            }
+            // Do any necessary format conversions
+            s = preVerifyFormat(key, sig);
         } catch (IOException ioe) {
             throw new XMLSignatureException(ioe);
         }
+        return signature.verify(s);
     }
 
     byte[] sign(Key key, SignedInfo si, XMLSignContext context)
@@ -208,19 +245,18 @@
             throw new InvalidKeyException("key must be PrivateKey");
         }
         if (signature == null) {
+            Provider p = (Provider)context.getProperty(
+                    "org.jcp.xml.dsig.internal.dom.SignatureProvider");
             try {
-                Provider p = (Provider)context.getProperty
-                    ("org.jcp.xml.dsig.internal.dom.SignatureProvider");
-                signature = (p == null)
-                    ? Signature.getInstance(getJCAAlgorithm())
-                    : Signature.getInstance(getJCAAlgorithm(), p);
+                signature = getSignature(p);
             } catch (NoSuchAlgorithmException nsae) {
                 throw new XMLSignatureException(nsae);
             }
         }
         signature.initSign((PrivateKey)key);
         if (log.isLoggable(java.util.logging.Level.FINE)) {
-            log.log(java.util.logging.Level.FINE, "Signature provider:" + signature.getProvider());
+            log.log(java.util.logging.Level.FINE,
+                    "Signature provider:" + signature.getProvider());
             log.log(java.util.logging.Level.FINE, "Signing with key: " + key);
         }
 
@@ -228,24 +264,171 @@
                                          new SignerOutputStream(signature));
 
         try {
-            Type type = getAlgorithmType();
-            if (type == Type.DSA) {
-                int size = ((DSAKey)key).getParams().getQ().bitLength();
-                return JavaUtils.convertDsaASN1toXMLDSIG(signature.sign(),
-                                                         size/8);
-            } else if (type == Type.ECDSA) {
-                return SignatureECDSA.convertASN1toXMLDSIG(signature.sign());
-            } else {
-                return signature.sign();
-            }
-        } catch (SignatureException se) {
-            throw new XMLSignatureException(se);
-        } catch (IOException ioe) {
-            throw new XMLSignatureException(ioe);
+            // Return signature with any necessary format conversions
+            return postSignFormat(key, signature.sign());
+        } catch (SignatureException | IOException ex){
+            throw new XMLSignatureException(ex);
+        }
+    }
+
+    abstract static class AbstractRSASignatureMethod
+            extends DOMSignatureMethod {
+
+        AbstractRSASignatureMethod(AlgorithmParameterSpec params)
+                throws InvalidAlgorithmParameterException {
+            super(params);
+        }
+
+        AbstractRSASignatureMethod(Element dmElem) throws MarshalException {
+            super(dmElem);
+        }
+
+        /**
+         * Returns {@code sig}. No extra formatting is necessary for RSA.
+         */
+        @Override
+        byte[] postSignFormat(Key key, byte[] sig) {
+            return sig;
+        }
+
+        /**
+         * Returns {@code sig}. No extra formatting is necessary for RSA.
+         */
+        @Override
+        byte[] preVerifyFormat(Key key, byte[] sig) {
+            return sig;
         }
     }
 
-    static final class SHA1withRSA extends DOMSignatureMethod {
+    /**
+     * Abstract class to support signature algorithms that sign and verify
+     * signatures in the IEEE P1363 format. The P1363 format is the
+     * concatenation of r and s in DSA and ECDSA signatures, and thus, only
+     * DSA and ECDSA signature methods should extend this class. Subclasses
+     * must supply a fallback algorithm to be used when the provider does
+     * not offer signature algorithms that use the P1363 format.
+     */
+    abstract static class AbstractP1363FormatSignatureMethod
+            extends DOMSignatureMethod {
+
+        /* Set to true when the fallback algorithm is used */
+        boolean asn1;
+
+        AbstractP1363FormatSignatureMethod(AlgorithmParameterSpec params)
+                throws InvalidAlgorithmParameterException {
+            super(params);
+        }
+
+        AbstractP1363FormatSignatureMethod(Element dmElem)
+                throws MarshalException {
+            super(dmElem);
+        }
+
+        /**
+         * Return the fallback algorithm to be used when the provider does not
+         * support signatures in the IEEE P1363 format. This algorithm should
+         * return signatures in the DER-encoded ASN.1 format.
+         */
+        abstract String getJCAFallbackAlgorithm();
+
+        /*
+         * Try to return an instance of Signature implementing signatures
+         * in the IEEE P1363 format. If the provider doesn't support the
+         * P1363 format, return an instance of Signature implementing
+         * signatures in the DER-encoded ASN.1 format.
+         */
+        @Override
+        Signature getSignature(Provider p)
+                throws NoSuchAlgorithmException {
+            try {
+                return (p == null)
+                    ? Signature.getInstance(getJCAAlgorithm())
+                    : Signature.getInstance(getJCAAlgorithm(), p);
+            } catch (NoSuchAlgorithmException nsae) {
+                Signature s = (p == null)
+                    ? Signature.getInstance(getJCAFallbackAlgorithm())
+                    : Signature.getInstance(getJCAFallbackAlgorithm(), p);
+                asn1 = true;
+                return s;
+            }
+        }
+    }
+
+    abstract static class AbstractDSASignatureMethod
+        extends AbstractP1363FormatSignatureMethod {
+
+        AbstractDSASignatureMethod(AlgorithmParameterSpec params)
+                throws InvalidAlgorithmParameterException {
+            super(params);
+        }
+
+        AbstractDSASignatureMethod(Element dmElem) throws MarshalException {
+            super(dmElem);
+        }
+
+        @Override
+        byte[] postSignFormat(Key key, byte[] sig) throws IOException {
+            // If signature is in ASN.1 (i.e., if the fallback algorithm
+            // was used), convert the signature to the P1363 format
+            if (asn1) {
+                int size = ((DSAKey) key).getParams().getQ().bitLength();
+                return JavaUtils.convertDsaASN1toXMLDSIG(sig, size / 8);
+            } else {
+                return sig;
+            }
+        }
+
+        @Override
+        byte[] preVerifyFormat(Key key, byte[] sig) throws IOException {
+            // If signature needs to be in ASN.1 (i.e., if the fallback
+            // algorithm will be used to verify the sig), convert the signature
+            // to the ASN.1 format
+            if (asn1) {
+                int size = ((DSAKey) key).getParams().getQ().bitLength();
+                return JavaUtils.convertDsaXMLDSIGtoASN1(sig, size / 8);
+            } else {
+                return sig;
+            }
+        }
+    }
+
+    abstract static class AbstractECDSASignatureMethod
+        extends AbstractP1363FormatSignatureMethod {
+
+        AbstractECDSASignatureMethod(AlgorithmParameterSpec params)
+                throws InvalidAlgorithmParameterException {
+            super(params);
+        }
+
+        AbstractECDSASignatureMethod(Element dmElem) throws MarshalException {
+            super(dmElem);
+        }
+
+        @Override
+        byte[] postSignFormat(Key key, byte[] sig) throws IOException {
+            // If signature is in ASN.1 (i.e., if the fallback algorithm
+            // was used), convert the signature to the P1363 format
+            if (asn1) {
+                return SignatureECDSA.convertASN1toXMLDSIG(sig);
+            } else {
+                return sig;
+            }
+        }
+
+        @Override
+        byte[] preVerifyFormat(Key key, byte[] sig) throws IOException {
+            // If signature needs to be in ASN.1 (i.e., if the fallback
+            // algorithm will be used to verify the sig), convert the signature
+            // to the ASN.1 format
+            if (asn1) {
+                return SignatureECDSA.convertXMLDSIGtoASN1(sig);
+            } else {
+                return sig;
+            }
+        }
+    }
+
+    static final class SHA1withRSA extends AbstractRSASignatureMethod {
         SHA1withRSA(AlgorithmParameterSpec params)
             throws InvalidAlgorithmParameterException {
             super(params);
@@ -264,7 +447,7 @@
         }
     }
 
-    static final class SHA256withRSA extends DOMSignatureMethod {
+    static final class SHA256withRSA extends AbstractRSASignatureMethod {
         SHA256withRSA(AlgorithmParameterSpec params)
             throws InvalidAlgorithmParameterException {
             super(params);
@@ -283,7 +466,7 @@
         }
     }
 
-    static final class SHA384withRSA extends DOMSignatureMethod {
+    static final class SHA384withRSA extends AbstractRSASignatureMethod {
         SHA384withRSA(AlgorithmParameterSpec params)
             throws InvalidAlgorithmParameterException {
             super(params);
@@ -302,7 +485,7 @@
         }
     }
 
-    static final class SHA512withRSA extends DOMSignatureMethod {
+    static final class SHA512withRSA extends AbstractRSASignatureMethod {
         SHA512withRSA(AlgorithmParameterSpec params)
             throws InvalidAlgorithmParameterException {
             super(params);
@@ -321,7 +504,7 @@
         }
     }
 
-    static final class SHA1withDSA extends DOMSignatureMethod {
+    static final class SHA1withDSA extends AbstractDSASignatureMethod {
         SHA1withDSA(AlgorithmParameterSpec params)
             throws InvalidAlgorithmParameterException {
             super(params);
@@ -333,6 +516,9 @@
             return SignatureMethod.DSA_SHA1;
         }
         String getJCAAlgorithm() {
+            return "SHA1withDSAinP1363Format";
+        }
+        String getJCAFallbackAlgorithm() {
             return "SHA1withDSA";
         }
         Type getAlgorithmType() {
@@ -340,7 +526,7 @@
         }
     }
 
-    static final class SHA256withDSA extends DOMSignatureMethod {
+    static final class SHA256withDSA extends AbstractDSASignatureMethod {
         SHA256withDSA(AlgorithmParameterSpec params)
             throws InvalidAlgorithmParameterException {
             super(params);
@@ -352,6 +538,9 @@
             return DSA_SHA256;
         }
         String getJCAAlgorithm() {
+            return "SHA256withDSAinP1363Format";
+        }
+        String getJCAFallbackAlgorithm() {
             return "SHA256withDSA";
         }
         Type getAlgorithmType() {
@@ -359,7 +548,7 @@
         }
     }
 
-    static final class SHA1withECDSA extends DOMSignatureMethod {
+    static final class SHA1withECDSA extends AbstractECDSASignatureMethod {
         SHA1withECDSA(AlgorithmParameterSpec params)
             throws InvalidAlgorithmParameterException {
             super(params);
@@ -371,6 +560,9 @@
             return ECDSA_SHA1;
         }
         String getJCAAlgorithm() {
+            return "SHA1withECDSAinP1363Format";
+        }
+        String getJCAFallbackAlgorithm() {
             return "SHA1withECDSA";
         }
         Type getAlgorithmType() {
@@ -378,7 +570,7 @@
         }
     }
 
-    static final class SHA256withECDSA extends DOMSignatureMethod {
+    static final class SHA256withECDSA extends AbstractECDSASignatureMethod {
         SHA256withECDSA(AlgorithmParameterSpec params)
             throws InvalidAlgorithmParameterException {
             super(params);
@@ -390,6 +582,9 @@
             return ECDSA_SHA256;
         }
         String getJCAAlgorithm() {
+            return "SHA256withECDSAinP1363Format";
+        }
+        String getJCAFallbackAlgorithm() {
             return "SHA256withECDSA";
         }
         Type getAlgorithmType() {
@@ -397,7 +592,7 @@
         }
     }
 
-    static final class SHA384withECDSA extends DOMSignatureMethod {
+    static final class SHA384withECDSA extends AbstractECDSASignatureMethod {
         SHA384withECDSA(AlgorithmParameterSpec params)
             throws InvalidAlgorithmParameterException {
             super(params);
@@ -409,6 +604,9 @@
             return ECDSA_SHA384;
         }
         String getJCAAlgorithm() {
+            return "SHA384withECDSAinP1363Format";
+        }
+        String getJCAFallbackAlgorithm() {
             return "SHA384withECDSA";
         }
         Type getAlgorithmType() {
@@ -416,7 +614,7 @@
         }
     }
 
-    static final class SHA512withECDSA extends DOMSignatureMethod {
+    static final class SHA512withECDSA extends AbstractECDSASignatureMethod {
         SHA512withECDSA(AlgorithmParameterSpec params)
             throws InvalidAlgorithmParameterException {
             super(params);
@@ -428,6 +626,9 @@
             return ECDSA_SHA512;
         }
         String getJCAAlgorithm() {
+            return "SHA512withECDSAinP1363Format";
+        }
+        String getJCAFallbackAlgorithm() {
             return "SHA512withECDSA";
         }
         Type getAlgorithmType() {
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/Big5_HKSCS.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,89 +0,0 @@
-/*
- * Copyright (c) 2010, 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.ext;
-
-import java.nio.charset.Charset;
-import java.nio.charset.CharsetDecoder;
-import java.nio.charset.CharsetEncoder;
-import sun.nio.cs.HistoricallyNamedCharset;
-import static sun.nio.cs.CharsetMapping.*;
-
-public class Big5_HKSCS extends Charset implements HistoricallyNamedCharset
-{
-    public Big5_HKSCS() {
-        super("Big5-HKSCS", ExtendedCharsets.aliasesFor("Big5-HKSCS"));
-    }
-
-    public String historicalName() {
-        return "Big5_HKSCS";
-    }
-
-    public boolean contains(Charset cs) {
-        return ((cs.name().equals("US-ASCII"))
-                || (cs instanceof Big5)
-                || (cs instanceof Big5_HKSCS));
-    }
-
-    public CharsetDecoder newDecoder() {
-        return new Decoder(this);
-    }
-
-    public CharsetEncoder newEncoder() {
-        return new Encoder(this);
-    }
-
-    static class Decoder extends HKSCS.Decoder {
-        private static DoubleByte.Decoder big5 =
-            (DoubleByte.Decoder)new Big5().newDecoder();
-
-        private static char[][] b2cBmp = new char[0x100][];
-        private static char[][] b2cSupp = new char[0x100][];
-        static {
-            initb2c(b2cBmp, HKSCSMapping.b2cBmpStr);
-            initb2c(b2cSupp, HKSCSMapping.b2cSuppStr);
-        }
-
-        private Decoder(Charset cs) {
-            super(cs, big5, b2cBmp, b2cSupp);
-        }
-    }
-
-    static class Encoder extends HKSCS.Encoder {
-        private static DoubleByte.Encoder big5 =
-            (DoubleByte.Encoder)new Big5().newEncoder();
-
-        static char[][] c2bBmp = new char[0x100][];
-        static char[][] c2bSupp = new char[0x100][];
-        static {
-            initc2b(c2bBmp, HKSCSMapping.b2cBmpStr, HKSCSMapping.pua);
-            initc2b(c2bSupp, HKSCSMapping.b2cSuppStr, null);
-        }
-
-        private Encoder(Charset cs) {
-            super(cs, big5, c2bBmp, c2bSupp);
-        }
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/Big5_HKSCS.java.template	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2010 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 $PACKAGE$;
+
+import java.nio.charset.Charset;
+import java.nio.charset.CharsetDecoder;
+import java.nio.charset.CharsetEncoder;
+import sun.nio.cs.DoubleByte;
+import sun.nio.cs.HKSCS;
+import sun.nio.cs.HistoricallyNamedCharset;
+import static sun.nio.cs.CharsetMapping.*;
+
+public class Big5_HKSCS extends Charset implements HistoricallyNamedCharset
+{
+    public Big5_HKSCS() {
+        super("Big5-HKSCS", $ALIASES$);
+    }
+
+    public String historicalName() {
+        return "Big5_HKSCS";
+    }
+
+    public boolean contains(Charset cs) {
+        return ((cs.name().equals("US-ASCII"))
+                || (cs instanceof Big5)
+                || (cs instanceof Big5_HKSCS));
+    }
+
+    public CharsetDecoder newDecoder() {
+        return new Decoder(this);
+    }
+
+    public CharsetEncoder newEncoder() {
+        return new Encoder(this);
+    }
+
+    static class Decoder extends HKSCS.Decoder {
+        private static DoubleByte.Decoder big5 =
+            (DoubleByte.Decoder)new Big5().newDecoder();
+
+        private static char[][] b2cBmp = new char[0x100][];
+        private static char[][] b2cSupp = new char[0x100][];
+        static {
+            initb2c(b2cBmp, HKSCSMapping.b2cBmpStr);
+            initb2c(b2cSupp, HKSCSMapping.b2cSuppStr);
+        }
+
+        private Decoder(Charset cs) {
+            super(cs, big5, b2cBmp, b2cSupp);
+        }
+    }
+
+    static class Encoder extends HKSCS.Encoder {
+        private static DoubleByte.Encoder big5 =
+            (DoubleByte.Encoder)new Big5().newEncoder();
+
+        static char[][] c2bBmp = new char[0x100][];
+        static char[][] c2bSupp = new char[0x100][];
+        static {
+            initc2b(c2bBmp, HKSCSMapping.b2cBmpStr, HKSCSMapping.pua);
+            initc2b(c2bSupp, HKSCSMapping.b2cSuppStr, null);
+        }
+
+        private Encoder(Charset cs) {
+            super(cs, big5, c2bBmp, c2bSupp);
+        }
+    }
+}
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/Big5_HKSCS_2001.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/Big5_HKSCS_2001.java	Mon Feb 23 05:01:11 2015 -0800
@@ -28,7 +28,9 @@
 import java.nio.charset.Charset;
 import java.nio.charset.CharsetDecoder;
 import java.nio.charset.CharsetEncoder;
+import sun.nio.cs.DoubleByte;
 import sun.nio.cs.HistoricallyNamedCharset;
+import sun.nio.cs.*;
 
 public class Big5_HKSCS_2001 extends Charset
 {
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/Big5_Solaris.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,126 +0,0 @@
-/*
- * Copyright (c) 2004, 2010, 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.ext;
-
-import java.nio.charset.Charset;
-import java.nio.charset.CharsetDecoder;
-import java.nio.charset.CharsetEncoder;
-import sun.nio.cs.HistoricallyNamedCharset;
-import java.util.Arrays;
-import static sun.nio.cs.CharsetMapping.*;
-
-public class Big5_Solaris extends Charset implements HistoricallyNamedCharset
-{
-    public Big5_Solaris() {
-        super("x-Big5-Solaris", ExtendedCharsets.aliasesFor("x-Big5-Solaris"));
-    }
-
-    public String historicalName() {
-        return "Big5_Solaris";
-    }
-
-    public boolean contains(Charset cs) {
-        return ((cs.name().equals("US-ASCII"))
-                || (cs instanceof Big5)
-                || (cs instanceof Big5_Solaris));
-    }
-
-    public CharsetDecoder newDecoder() {
-        initb2c();
-        return new  DoubleByte.Decoder(this, b2c, b2cSB, 0x40, 0xfe);
-    }
-
-    public CharsetEncoder newEncoder() {
-        initc2b();
-        return new DoubleByte.Encoder(this, c2b, c2bIndex);
-    }
-
-    static char[][] b2c;
-    static char[] b2cSB;
-    private static volatile boolean b2cInitialized = false;
-
-    static void initb2c() {
-        if (b2cInitialized)
-            return;
-        synchronized (Big5_Solaris.class) {
-            if (b2cInitialized)
-                return;
-            Big5.initb2c();
-            b2c = Big5.b2c.clone();
-            // Big5 Solaris implementation has 7 additional mappings
-            int[] sol = new int[] {
-                0xF9D6, 0x7881,
-                0xF9D7, 0x92B9,
-                0xF9D8, 0x88CF,
-                0xF9D9, 0x58BB,
-                0xF9DA, 0x6052,
-                0xF9DB, 0x7CA7,
-                0xF9DC, 0x5AFA };
-            if (b2c[0xf9] == DoubleByte.B2C_UNMAPPABLE) {
-                b2c[0xf9] = new char[0xfe - 0x40 + 1];
-                Arrays.fill(b2c[0xf9], UNMAPPABLE_DECODING);
-            }
-
-            for (int i = 0; i < sol.length;) {
-                b2c[0xf9][sol[i++] & 0xff - 0x40] = (char)sol[i++];
-            }
-            b2cSB = Big5.b2cSB;
-            b2cInitialized = true;
-        }
-    }
-
-    static char[] c2b;
-    static char[] c2bIndex;
-    private static volatile boolean c2bInitialized = false;
-
-    static void initc2b() {
-        if (c2bInitialized)
-            return;
-        synchronized (Big5_Solaris.class) {
-            if (c2bInitialized)
-                return;
-            Big5.initc2b();
-            c2b = Big5.c2b.clone();
-            c2bIndex = Big5.c2bIndex.clone();
-            int[] sol = new int[] {
-                0x7881, 0xF9D6,
-                0x92B9, 0xF9D7,
-                0x88CF, 0xF9D8,
-                0x58BB, 0xF9D9,
-                0x6052, 0xF9DA,
-                0x7CA7, 0xF9DB,
-                0x5AFA, 0xF9DC };
-
-            for (int i = 0; i < sol.length;) {
-                int c = sol[i++];
-                // no need to check c2bIndex[c >>8], we know it points
-                // to the appropriate place.
-                c2b[c2bIndex[c >> 8] + (c & 0xff)] = (char)sol[i++];
-            }
-            c2bInitialized = true;
-        }
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/Big5_Solaris.java.template	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,127 @@
+/*
+ * Copyright (c) 2004, 2010, 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 $PACKAGE$;
+
+import java.nio.charset.Charset;
+import java.nio.charset.CharsetDecoder;
+import java.nio.charset.CharsetEncoder;
+import sun.nio.cs.DoubleByte;
+import sun.nio.cs.HistoricallyNamedCharset;
+import java.util.Arrays;
+import static sun.nio.cs.CharsetMapping.*;
+
+public class Big5_Solaris extends Charset implements HistoricallyNamedCharset
+{
+    public Big5_Solaris() {
+        super("x-Big5-Solaris", $ALIASES$);
+    }
+
+    public String historicalName() {
+        return "Big5_Solaris";
+    }
+
+    public boolean contains(Charset cs) {
+        return ((cs.name().equals("US-ASCII"))
+                || (cs instanceof Big5)
+                || (cs instanceof Big5_Solaris));
+    }
+
+    public CharsetDecoder newDecoder() {
+        initb2c();
+        return new  DoubleByte.Decoder(this, b2c, b2cSB, 0x40, 0xfe);
+    }
+
+    public CharsetEncoder newEncoder() {
+        initc2b();
+        return new DoubleByte.Encoder(this, c2b, c2bIndex);
+    }
+
+    static char[][] b2c;
+    static char[] b2cSB;
+    private static volatile boolean b2cInitialized = false;
+
+    static void initb2c() {
+        if (b2cInitialized)
+            return;
+        synchronized (Big5_Solaris.class) {
+            if (b2cInitialized)
+                return;
+            Big5.initb2c();
+            b2c = Big5.b2c.clone();
+            // Big5 Solaris implementation has 7 additional mappings
+            int[] sol = new int[] {
+                0xF9D6, 0x7881,
+                0xF9D7, 0x92B9,
+                0xF9D8, 0x88CF,
+                0xF9D9, 0x58BB,
+                0xF9DA, 0x6052,
+                0xF9DB, 0x7CA7,
+                0xF9DC, 0x5AFA };
+            if (b2c[0xf9] == DoubleByte.B2C_UNMAPPABLE) {
+                b2c[0xf9] = new char[0xfe - 0x40 + 1];
+                Arrays.fill(b2c[0xf9], UNMAPPABLE_DECODING);
+            }
+
+            for (int i = 0; i < sol.length;) {
+                b2c[0xf9][sol[i++] & 0xff - 0x40] = (char)sol[i++];
+            }
+            b2cSB = Big5.b2cSB;
+            b2cInitialized = true;
+        }
+    }
+
+    static char[] c2b;
+    static char[] c2bIndex;
+    private static volatile boolean c2bInitialized = false;
+
+    static void initc2b() {
+        if (c2bInitialized)
+            return;
+        synchronized (Big5_Solaris.class) {
+            if (c2bInitialized)
+                return;
+            Big5.initc2b();
+            c2b = Big5.c2b.clone();
+            c2bIndex = Big5.c2bIndex.clone();
+            int[] sol = new int[] {
+                0x7881, 0xF9D6,
+                0x92B9, 0xF9D7,
+                0x88CF, 0xF9D8,
+                0x58BB, 0xF9D9,
+                0x6052, 0xF9DA,
+                0x7CA7, 0xF9DB,
+                0x5AFA, 0xF9DC };
+
+            for (int i = 0; i < sol.length;) {
+                int c = sol[i++];
+                // no need to check c2bIndex[c >>8], we know it points
+                // to the appropriate place.
+                c2b[c2bIndex[c >> 8] + (c & 0xff)] = (char)sol[i++];
+            }
+            c2bInitialized = true;
+        }
+    }
+}
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/DelegatableDecoder.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-/*
- * 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.ext;
-
-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.
- */
-interface DelegatableDecoder {
-    CoderResult decodeLoop(ByteBuffer src, CharBuffer dst);
-    void implReset();
-    CoderResult implFlush(CharBuffer out);
-}
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/DoubleByte.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,929 +0,0 @@
-/*
- * 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.ext;
-
-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);
-        }
-
-        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;
-        }
-
-        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;
-
-        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);
-        }
-        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;
-
-        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
-    {
-        final int MAX_SINGLEBYTE = 0xff;
-        private final char[] c2b;
-        private final char[] c2bIndex;
-        Surrogate.Parser sgp;
-
-        protected Encoder(Charset cs, char[] c2b, char[] c2bIndex) {
-            super(cs, 2.0f, 2.0f);
-            this.c2b = c2b;
-            this.c2bIndex = c2bIndex;
-        }
-
-        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;
-        }
-
-        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.
-        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 {
-        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;
-
-        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 {
-        Encoder_EUC_SIM(Charset cs, char[] c2b, char[] c2bIndex) {
-            super(cs, c2b, c2bIndex);
-        }
-    }
-
-}
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/EUC_JP.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,411 +0,0 @@
-/*
- * Copyright (c) 2002, 2012, 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.ext;
-
-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 sun.nio.cs.HistoricallyNamedCharset;
-import sun.nio.cs.Surrogate;
-import sun.nio.cs.SingleByte;
-import static sun.nio.cs.CharsetMapping.*;
-
-public class EUC_JP
-    extends Charset
-    implements HistoricallyNamedCharset
-{
-    public EUC_JP() {
-        super("EUC-JP", ExtendedCharsets.aliasesFor("EUC-JP"));
-    }
-
-    public String historicalName() {
-        return "EUC_JP";
-    }
-
-    public boolean contains(Charset cs) {
-        return ((cs.name().equals("US-ASCII"))
-                || (cs instanceof JIS_X_0201)
-                || (cs instanceof JIS_X_0208)
-                || (cs instanceof JIS_X_0212)
-                || (cs instanceof EUC_JP));
-    }
-
-    public CharsetDecoder newDecoder() {
-        return new Decoder(this);
-    }
-
-    public CharsetEncoder newEncoder() {
-        return new Encoder(this);
-    }
-
-    static class Decoder extends CharsetDecoder
-        implements DelegatableDecoder {
-
-        final static SingleByte.Decoder DEC0201 =
-            (SingleByte.Decoder)new JIS_X_0201().newDecoder();
-
-        final static DoubleByte.Decoder DEC0208 =
-            (DoubleByte.Decoder)new JIS_X_0208().newDecoder();
-
-        final static DoubleByte.Decoder DEC0212 =
-            (DoubleByte.Decoder)new JIS_X_0212().newDecoder();
-
-        private final SingleByte.Decoder dec0201;
-        private final DoubleByte.Decoder dec0208;
-        private final DoubleByte.Decoder dec0212;
-
-        protected Decoder(Charset cs) {
-            this(cs, 0.5f, 1.0f, DEC0201, DEC0208, DEC0212);
-        }
-
-        protected Decoder(Charset cs, float avgCpb, float maxCpb,
-                          SingleByte.Decoder dec0201,
-                          DoubleByte.Decoder dec0208,
-                          DoubleByte.Decoder dec0212) {
-            super(cs, avgCpb, maxCpb);
-            this.dec0201 = dec0201;
-            this.dec0208 = dec0208;
-            this.dec0212 = dec0212;
-        }
-
-
-        protected char decodeDouble(int byte1, int byte2) {
-            if (byte1 == 0x8e) {
-                if (byte2 < 0x80)
-                    return UNMAPPABLE_DECODING;
-                return dec0201.decode((byte)byte2);
-            }
-            return dec0208.decodeDouble(byte1 - 0x80, byte2 - 0x80);
-        }
-
-        private CoderResult decodeArrayLoop(ByteBuffer src,
-                                            CharBuffer dst)
-        {
-            byte[] sa = src.array();
-            int sp = src.arrayOffset() + src.position();
-            int sl = src.arrayOffset() + src.limit();
-            assert (sp <= sl);
-            sp = (sp <= sl ? sp : sl);
-
-            char[] da = dst.array();
-            int dp = dst.arrayOffset() + dst.position();
-            int dl = dst.arrayOffset() + dst.limit();
-            assert (dp <= dl);
-            dp = (dp <= dl ? dp : dl);
-
-            int b1 = 0, b2 = 0;
-            int inputSize = 0;
-            char outputChar = UNMAPPABLE_DECODING;
-            try {
-                while (sp < sl) {
-                    b1 = sa[sp] & 0xff;
-                    inputSize = 1;
-
-                    if ((b1 & 0x80) == 0) {
-                        outputChar = (char)b1;
-                    } else {                        // Multibyte char
-                        if (b1 == 0x8f) {           // JIS0212
-                            if (sp + 3 > sl)
-                               return CoderResult.UNDERFLOW;
-                            b1 = sa[sp + 1] & 0xff;
-                            b2 = sa[sp + 2] & 0xff;
-                            inputSize += 2;
-                            if (dec0212 == null)    // JIS02012 not supported
-                                return CoderResult.unmappableForLength(inputSize);
-                            outputChar = dec0212.decodeDouble(b1-0x80, b2-0x80);
-                        } else {                     // JIS0201, JIS0208
-                            if (sp + 2 > sl)
-                               return CoderResult.UNDERFLOW;
-                            b2 = sa[sp + 1] & 0xff;
-                            inputSize++;
-                            outputChar = decodeDouble(b1, b2);
-                        }
-                    }
-                    if (outputChar == UNMAPPABLE_DECODING) { // can't be decoded
-                        return CoderResult.unmappableForLength(inputSize);
-                    }
-                    if (dp + 1 > dl)
-                        return CoderResult.OVERFLOW;
-                    da[dp++] = outputChar;
-                    sp += inputSize;
-                }
-                return CoderResult.UNDERFLOW;
-            } finally {
-                src.position(sp - src.arrayOffset());
-                dst.position(dp - dst.arrayOffset());
-            }
-        }
-
-        private CoderResult decodeBufferLoop(ByteBuffer src,
-                                             CharBuffer dst)
-        {
-            int mark = src.position();
-            int b1 = 0, b2 = 0;
-            int inputSize = 0;
-            char outputChar = UNMAPPABLE_DECODING;
-
-            try {
-                while (src.hasRemaining()) {
-                    b1 = src.get() & 0xff;
-                    inputSize = 1;
-                    if ((b1 & 0x80) == 0) {
-                        outputChar = (char)b1;
-                    } else {                         // Multibyte char
-                        if (b1 == 0x8f) {   // JIS0212
-                            if (src.remaining() < 2)
-                               return CoderResult.UNDERFLOW;
-                            b1 = src.get() & 0xff;
-                            b2 = src.get() & 0xff;
-                            inputSize += 2;
-                            if (dec0212 == null)    // JIS02012 not supported
-                                return CoderResult.unmappableForLength(inputSize);
-                            outputChar = dec0212.decodeDouble(b1-0x80, b2-0x80);
-                        } else {                     // JIS0201 JIS0208
-                            if (src.remaining() < 1)
-                               return CoderResult.UNDERFLOW;
-                            b2 = src.get() & 0xff;
-                            inputSize++;
-                            outputChar = decodeDouble(b1, b2);
-                        }
-                    }
-                    if (outputChar == UNMAPPABLE_DECODING) {
-                        return CoderResult.unmappableForLength(inputSize);
-                    }
-                if (dst.remaining() < 1)
-                    return CoderResult.OVERFLOW;
-                dst.put(outputChar);
-                mark += inputSize;
-                }
-                return 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 void implReset() {
-            super.implReset();
-        }
-        public CoderResult implFlush(CharBuffer out) {
-            return super.implFlush(out);
-        }
-    }
-
-
-    static class Encoder extends CharsetEncoder {
-
-        final static SingleByte.Encoder ENC0201 =
-            (SingleByte.Encoder)new JIS_X_0201().newEncoder();
-
-        final static DoubleByte.Encoder ENC0208 =
-            (DoubleByte.Encoder)new JIS_X_0208().newEncoder();
-
-        final static DoubleByte.Encoder ENC0212 =
-            (DoubleByte.Encoder)new JIS_X_0212().newEncoder();
-
-        private final Surrogate.Parser sgp = new Surrogate.Parser();
-
-
-        private final SingleByte.Encoder enc0201;
-        private final DoubleByte.Encoder enc0208;
-        private final DoubleByte.Encoder enc0212;
-
-        protected Encoder(Charset cs) {
-            this(cs, 3.0f, 3.0f, ENC0201, ENC0208, ENC0212);
-        }
-
-        protected Encoder(Charset cs, float avgBpc, float maxBpc,
-                          SingleByte.Encoder enc0201,
-                          DoubleByte.Encoder enc0208,
-                          DoubleByte.Encoder enc0212) {
-            super(cs, avgBpc, maxBpc);
-            this.enc0201 = enc0201;
-            this.enc0208 = enc0208;
-            this.enc0212 = enc0212;
-        }
-
-        public boolean canEncode(char c) {
-            byte[]  encodedBytes = new byte[3];
-            return encodeSingle(c, encodedBytes) != 0 ||
-                   encodeDouble(c) != UNMAPPABLE_ENCODING;
-        }
-
-        protected int encodeSingle(char inputChar, byte[] outputByte) {
-            int b = enc0201.encode(inputChar);
-            if (b == UNMAPPABLE_ENCODING)
-                return 0;
-            if (b >= 0 && b < 128) {
-                outputByte[0] = (byte)b;
-                return 1;
-            }
-            outputByte[0] = (byte)0x8e;
-            outputByte[1] = (byte)b;
-            return 2;
-        }
-
-        protected int encodeDouble(char ch) {
-            int b = enc0208.encodeChar(ch);
-            if (b != UNMAPPABLE_ENCODING)
-                return b + 0x8080;
-            if (enc0212 != null) {
-                b = enc0212.encodeChar(ch);
-                if (b != UNMAPPABLE_ENCODING)
-                    b += 0x8F8080;
-            }
-            return b;
-        }
-
-        private CoderResult encodeArrayLoop(CharBuffer src,
-                                            ByteBuffer dst)
-        {
-            char[] sa = src.array();
-            int sp = src.arrayOffset() + src.position();
-            int sl = src.arrayOffset() + src.limit();
-            assert (sp <= sl);
-            sp = (sp <= sl ? sp : sl);
-            byte[] da = dst.array();
-            int dp = dst.arrayOffset() + dst.position();
-            int dl = dst.arrayOffset() + dst.limit();
-            assert (dp <= dl);
-            dp = (dp <= dl ? dp : dl);
-
-            int outputSize = 0;
-            byte[]  outputByte;
-            int     inputSize = 0;                 // Size of input
-            byte[]  tmpBuf = new byte[3];
-
-            try {
-                while (sp < sl) {
-                    outputByte = tmpBuf;
-                    char c = sa[sp];
-                    if (Character.isSurrogate(c)) {
-                        if (sgp.parse(c, sa, sp, sl) < 0)
-                            return sgp.error();
-                        return sgp.unmappableResult();
-                    }
-                    outputSize = encodeSingle(c, outputByte);
-                    if (outputSize == 0) { // DoubleByte
-                        int ncode = encodeDouble(c);
-                        if (ncode != UNMAPPABLE_ENCODING) {
-                            if ((ncode & 0xFF0000) == 0) {
-                                outputByte[0] = (byte) ((ncode & 0xff00) >> 8);
-                                outputByte[1] = (byte) (ncode & 0xff);
-                                outputSize = 2;
-                            } else {
-                                outputByte[0] = (byte) 0x8f;
-                                outputByte[1] = (byte) ((ncode & 0xff00) >> 8);
-                                outputByte[2] = (byte) (ncode & 0xff);
-                                outputSize = 3;
-                            }
-                        } else {
-                            return CoderResult.unmappableForLength(1);
-                        }
-                    }
-                    if (dl - dp < outputSize)
-                        return CoderResult.OVERFLOW;
-                    // Put the byte in the output buffer
-                    for (int i = 0; i < outputSize; i++) {
-                        da[dp++] = outputByte[i];
-                    }
-                    sp++;
-                }
-                return CoderResult.UNDERFLOW;
-            } finally {
-                src.position(sp - src.arrayOffset());
-                dst.position(dp - dst.arrayOffset());
-            }
-        }
-
-        private CoderResult encodeBufferLoop(CharBuffer src,
-                                             ByteBuffer dst)
-        {
-            int outputSize = 0;
-            byte[]  outputByte;
-            int     inputSize = 0;                 // Size of input
-            byte[]  tmpBuf = new byte[3];
-
-            int mark = src.position();
-
-            try {
-                while (src.hasRemaining()) {
-                    outputByte = tmpBuf;
-                    char c = src.get();
-                    if (Character.isSurrogate(c)) {
-                        if (sgp.parse(c, src) < 0)
-                            return sgp.error();
-                        return sgp.unmappableResult();
-                    }
-                    outputSize = encodeSingle(c, outputByte);
-                    if (outputSize == 0) { // DoubleByte
-                        int ncode = encodeDouble(c);
-                        if (ncode != UNMAPPABLE_ENCODING) {
-                            if ((ncode & 0xFF0000) == 0) {
-                                outputByte[0] = (byte) ((ncode & 0xff00) >> 8);
-                                outputByte[1] = (byte) (ncode & 0xff);
-                                outputSize = 2;
-                            } else {
-                                outputByte[0] = (byte) 0x8f;
-                                outputByte[1] = (byte) ((ncode & 0xff00) >> 8);
-                                outputByte[2] = (byte) (ncode & 0xff);
-                                outputSize = 3;
-                            }
-                        } else {
-                            return CoderResult.unmappableForLength(1);
-                        }
-                    }
-                    if (dst.remaining() < outputSize)
-                        return CoderResult.OVERFLOW;
-                    // Put the byte in the output buffer
-                    for (int i = 0; i < outputSize; i++) {
-                        dst.put(outputByte[i]);
-                    }
-                    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);
-        }
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/EUC_JP.java.template	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,414 @@
+/*
+ * Copyright (c) 2002, 2012, 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 $PACKAGE$;
+
+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 sun.nio.cs.HistoricallyNamedCharset;
+import sun.nio.cs.DelegatableDecoder;
+import sun.nio.cs.DoubleByte;
+import sun.nio.cs.Surrogate;
+import sun.nio.cs.SingleByte;
+import sun.nio.cs.*;
+import static sun.nio.cs.CharsetMapping.*;
+
+public class EUC_JP
+    extends Charset
+    implements HistoricallyNamedCharset
+{
+    public EUC_JP() {
+        super("EUC-JP",  $ALIASES$);
+    }
+
+    public String historicalName() {
+        return "EUC_JP";
+    }
+
+    public boolean contains(Charset cs) {
+        return ((cs.name().equals("US-ASCII"))
+                || (cs instanceof JIS_X_0201)
+                || (cs instanceof JIS_X_0208)
+                || (cs instanceof JIS_X_0212)
+                || (cs instanceof EUC_JP));
+    }
+
+    public CharsetDecoder newDecoder() {
+        return new Decoder(this);
+    }
+
+    public CharsetEncoder newEncoder() {
+        return new Encoder(this);
+    }
+
+    static class Decoder extends CharsetDecoder
+        implements DelegatableDecoder {
+
+        final static SingleByte.Decoder DEC0201 =
+            (SingleByte.Decoder)new JIS_X_0201().newDecoder();
+
+        final static DoubleByte.Decoder DEC0208 =
+            (DoubleByte.Decoder)new JIS_X_0208().newDecoder();
+
+        final static DoubleByte.Decoder DEC0212 =
+            (DoubleByte.Decoder)new JIS_X_0212().newDecoder();
+
+        private final SingleByte.Decoder dec0201;
+        private final DoubleByte.Decoder dec0208;
+        private final DoubleByte.Decoder dec0212;
+
+        protected Decoder(Charset cs) {
+            this(cs, 0.5f, 1.0f, DEC0201, DEC0208, DEC0212);
+        }
+
+        protected Decoder(Charset cs, float avgCpb, float maxCpb,
+                          SingleByte.Decoder dec0201,
+                          DoubleByte.Decoder dec0208,
+                          DoubleByte.Decoder dec0212) {
+            super(cs, avgCpb, maxCpb);
+            this.dec0201 = dec0201;
+            this.dec0208 = dec0208;
+            this.dec0212 = dec0212;
+        }
+
+
+        protected char decodeDouble(int byte1, int byte2) {
+            if (byte1 == 0x8e) {
+                if (byte2 < 0x80)
+                    return UNMAPPABLE_DECODING;
+                return dec0201.decode((byte)byte2);
+            }
+            return dec0208.decodeDouble(byte1 - 0x80, byte2 - 0x80);
+        }
+
+        private CoderResult decodeArrayLoop(ByteBuffer src,
+                                            CharBuffer dst)
+        {
+            byte[] sa = src.array();
+            int sp = src.arrayOffset() + src.position();
+            int sl = src.arrayOffset() + src.limit();
+            assert (sp <= sl);
+            sp = (sp <= sl ? sp : sl);
+
+            char[] da = dst.array();
+            int dp = dst.arrayOffset() + dst.position();
+            int dl = dst.arrayOffset() + dst.limit();
+            assert (dp <= dl);
+            dp = (dp <= dl ? dp : dl);
+
+            int b1 = 0, b2 = 0;
+            int inputSize = 0;
+            char outputChar = UNMAPPABLE_DECODING;
+            try {
+                while (sp < sl) {
+                    b1 = sa[sp] & 0xff;
+                    inputSize = 1;
+
+                    if ((b1 & 0x80) == 0) {
+                        outputChar = (char)b1;
+                    } else {                        // Multibyte char
+                        if (b1 == 0x8f) {           // JIS0212
+                            if (sp + 3 > sl)
+                               return CoderResult.UNDERFLOW;
+                            b1 = sa[sp + 1] & 0xff;
+                            b2 = sa[sp + 2] & 0xff;
+                            inputSize += 2;
+                            if (dec0212 == null)    // JIS02012 not supported
+                                return CoderResult.unmappableForLength(inputSize);
+                            outputChar = dec0212.decodeDouble(b1-0x80, b2-0x80);
+                        } else {                     // JIS0201, JIS0208
+                            if (sp + 2 > sl)
+                               return CoderResult.UNDERFLOW;
+                            b2 = sa[sp + 1] & 0xff;
+                            inputSize++;
+                            outputChar = decodeDouble(b1, b2);
+                        }
+                    }
+                    if (outputChar == UNMAPPABLE_DECODING) { // can't be decoded
+                        return CoderResult.unmappableForLength(inputSize);
+                    }
+                    if (dp + 1 > dl)
+                        return CoderResult.OVERFLOW;
+                    da[dp++] = outputChar;
+                    sp += inputSize;
+                }
+                return CoderResult.UNDERFLOW;
+            } finally {
+                src.position(sp - src.arrayOffset());
+                dst.position(dp - dst.arrayOffset());
+            }
+        }
+
+        private CoderResult decodeBufferLoop(ByteBuffer src,
+                                             CharBuffer dst)
+        {
+            int mark = src.position();
+            int b1 = 0, b2 = 0;
+            int inputSize = 0;
+            char outputChar = UNMAPPABLE_DECODING;
+
+            try {
+                while (src.hasRemaining()) {
+                    b1 = src.get() & 0xff;
+                    inputSize = 1;
+                    if ((b1 & 0x80) == 0) {
+                        outputChar = (char)b1;
+                    } else {                         // Multibyte char
+                        if (b1 == 0x8f) {   // JIS0212
+                            if (src.remaining() < 2)
+                               return CoderResult.UNDERFLOW;
+                            b1 = src.get() & 0xff;
+                            b2 = src.get() & 0xff;
+                            inputSize += 2;
+                            if (dec0212 == null)    // JIS02012 not supported
+                                return CoderResult.unmappableForLength(inputSize);
+                            outputChar = dec0212.decodeDouble(b1-0x80, b2-0x80);
+                        } else {                     // JIS0201 JIS0208
+                            if (src.remaining() < 1)
+                               return CoderResult.UNDERFLOW;
+                            b2 = src.get() & 0xff;
+                            inputSize++;
+                            outputChar = decodeDouble(b1, b2);
+                        }
+                    }
+                    if (outputChar == UNMAPPABLE_DECODING) {
+                        return CoderResult.unmappableForLength(inputSize);
+                    }
+                if (dst.remaining() < 1)
+                    return CoderResult.OVERFLOW;
+                dst.put(outputChar);
+                mark += inputSize;
+                }
+                return 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 void implReset() {
+            super.implReset();
+        }
+        public CoderResult implFlush(CharBuffer out) {
+            return super.implFlush(out);
+        }
+    }
+
+
+    static class Encoder extends CharsetEncoder {
+
+        final static SingleByte.Encoder ENC0201 =
+            (SingleByte.Encoder)new JIS_X_0201().newEncoder();
+
+        final static DoubleByte.Encoder ENC0208 =
+            (DoubleByte.Encoder)new JIS_X_0208().newEncoder();
+
+        final static DoubleByte.Encoder ENC0212 =
+            (DoubleByte.Encoder)new JIS_X_0212().newEncoder();
+
+        private final Surrogate.Parser sgp = new Surrogate.Parser();
+
+
+        private final SingleByte.Encoder enc0201;
+        private final DoubleByte.Encoder enc0208;
+        private final DoubleByte.Encoder enc0212;
+
+        protected Encoder(Charset cs) {
+            this(cs, 3.0f, 3.0f, ENC0201, ENC0208, ENC0212);
+        }
+
+        protected Encoder(Charset cs, float avgBpc, float maxBpc,
+                          SingleByte.Encoder enc0201,
+                          DoubleByte.Encoder enc0208,
+                          DoubleByte.Encoder enc0212) {
+            super(cs, avgBpc, maxBpc);
+            this.enc0201 = enc0201;
+            this.enc0208 = enc0208;
+            this.enc0212 = enc0212;
+        }
+
+        public boolean canEncode(char c) {
+            byte[]  encodedBytes = new byte[3];
+            return encodeSingle(c, encodedBytes) != 0 ||
+                   encodeDouble(c) != UNMAPPABLE_ENCODING;
+        }
+
+        protected int encodeSingle(char inputChar, byte[] outputByte) {
+            int b = enc0201.encode(inputChar);
+            if (b == UNMAPPABLE_ENCODING)
+                return 0;
+            if (b >= 0 && b < 128) {
+                outputByte[0] = (byte)b;
+                return 1;
+            }
+            outputByte[0] = (byte)0x8e;
+            outputByte[1] = (byte)b;
+            return 2;
+        }
+
+        protected int encodeDouble(char ch) {
+            int b = enc0208.encodeChar(ch);
+            if (b != UNMAPPABLE_ENCODING)
+                return b + 0x8080;
+            if (enc0212 != null) {
+                b = enc0212.encodeChar(ch);
+                if (b != UNMAPPABLE_ENCODING)
+                    b += 0x8F8080;
+            }
+            return b;
+        }
+
+        private CoderResult encodeArrayLoop(CharBuffer src,
+                                            ByteBuffer dst)
+        {
+            char[] sa = src.array();
+            int sp = src.arrayOffset() + src.position();
+            int sl = src.arrayOffset() + src.limit();
+            assert (sp <= sl);
+            sp = (sp <= sl ? sp : sl);
+            byte[] da = dst.array();
+            int dp = dst.arrayOffset() + dst.position();
+            int dl = dst.arrayOffset() + dst.limit();
+            assert (dp <= dl);
+            dp = (dp <= dl ? dp : dl);
+
+            int outputSize = 0;
+            byte[]  outputByte;
+            int     inputSize = 0;                 // Size of input
+            byte[]  tmpBuf = new byte[3];
+
+            try {
+                while (sp < sl) {
+                    outputByte = tmpBuf;
+                    char c = sa[sp];
+                    if (Character.isSurrogate(c)) {
+                        if (sgp.parse(c, sa, sp, sl) < 0)
+                            return sgp.error();
+                        return sgp.unmappableResult();
+                    }
+                    outputSize = encodeSingle(c, outputByte);
+                    if (outputSize == 0) { // DoubleByte
+                        int ncode = encodeDouble(c);
+                        if (ncode != UNMAPPABLE_ENCODING) {
+                            if ((ncode & 0xFF0000) == 0) {
+                                outputByte[0] = (byte) ((ncode & 0xff00) >> 8);
+                                outputByte[1] = (byte) (ncode & 0xff);
+                                outputSize = 2;
+                            } else {
+                                outputByte[0] = (byte) 0x8f;
+                                outputByte[1] = (byte) ((ncode & 0xff00) >> 8);
+                                outputByte[2] = (byte) (ncode & 0xff);
+                                outputSize = 3;
+                            }
+                        } else {
+                            return CoderResult.unmappableForLength(1);
+                        }
+                    }
+                    if (dl - dp < outputSize)
+                        return CoderResult.OVERFLOW;
+                    // Put the byte in the output buffer
+                    for (int i = 0; i < outputSize; i++) {
+                        da[dp++] = outputByte[i];
+                    }
+                    sp++;
+                }
+                return CoderResult.UNDERFLOW;
+            } finally {
+                src.position(sp - src.arrayOffset());
+                dst.position(dp - dst.arrayOffset());
+            }
+        }
+
+        private CoderResult encodeBufferLoop(CharBuffer src,
+                                             ByteBuffer dst)
+        {
+            int outputSize = 0;
+            byte[]  outputByte;
+            int     inputSize = 0;                 // Size of input
+            byte[]  tmpBuf = new byte[3];
+
+            int mark = src.position();
+
+            try {
+                while (src.hasRemaining()) {
+                    outputByte = tmpBuf;
+                    char c = src.get();
+                    if (Character.isSurrogate(c)) {
+                        if (sgp.parse(c, src) < 0)
+                            return sgp.error();
+                        return sgp.unmappableResult();
+                    }
+                    outputSize = encodeSingle(c, outputByte);
+                    if (outputSize == 0) { // DoubleByte
+                        int ncode = encodeDouble(c);
+                        if (ncode != UNMAPPABLE_ENCODING) {
+                            if ((ncode & 0xFF0000) == 0) {
+                                outputByte[0] = (byte) ((ncode & 0xff00) >> 8);
+                                outputByte[1] = (byte) (ncode & 0xff);
+                                outputSize = 2;
+                            } else {
+                                outputByte[0] = (byte) 0x8f;
+                                outputByte[1] = (byte) ((ncode & 0xff00) >> 8);
+                                outputByte[2] = (byte) (ncode & 0xff);
+                                outputSize = 3;
+                            }
+                        } else {
+                            return CoderResult.unmappableForLength(1);
+                        }
+                    }
+                    if (dst.remaining() < outputSize)
+                        return CoderResult.OVERFLOW;
+                    // Put the byte in the output buffer
+                    for (int i = 0; i < outputSize; i++) {
+                        dst.put(outputByte[i]);
+                    }
+                    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);
+        }
+    }
+}
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/EUC_JP_LINUX.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2002, 2012, 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.ext;
-
-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 sun.nio.cs.HistoricallyNamedCharset;
-
-public class EUC_JP_LINUX
-    extends Charset
-    implements HistoricallyNamedCharset
-{
-    public EUC_JP_LINUX() {
-        super("x-euc-jp-linux", ExtendedCharsets.aliasesFor("x-euc-jp-linux"));
-    }
-
-    public String historicalName() {
-        return "EUC_JP_LINUX";
-    }
-
-    public boolean contains(Charset cs) {
-        return ((cs instanceof JIS_X_0201)
-               || (cs.name().equals("US-ASCII"))
-               || (cs instanceof EUC_JP_LINUX));
-    }
-
-    public CharsetDecoder newDecoder() {
-        return new Decoder(this);
-    }
-
-    public CharsetEncoder newEncoder() {
-        return new Encoder(this);
-    }
-
-    private static class Decoder extends EUC_JP.Decoder {
-        private Decoder(Charset cs) {
-            super(cs, 1.0f, 1.0f, DEC0201, DEC0208, null);
-        }
-    }
-
-    private static class Encoder extends EUC_JP.Encoder {
-        private Encoder(Charset cs) {
-            super(cs, 2.0f, 2.0f, ENC0201, ENC0208, null);
-        }
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/EUC_JP_LINUX.java.template	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2002, 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 $PACKAGE$;
+
+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 sun.nio.cs.HistoricallyNamedCharset;
+import sun.nio.cs.*;
+
+public class EUC_JP_LINUX
+    extends Charset
+    implements HistoricallyNamedCharset
+{
+    public EUC_JP_LINUX() {
+        super("x-euc-jp-linux", $ALIASES$);
+    }
+
+    public String historicalName() {
+        return "EUC_JP_LINUX";
+    }
+
+    public boolean contains(Charset cs) {
+        return ((cs instanceof JIS_X_0201)
+               || (cs.name().equals("US-ASCII"))
+               || (cs instanceof EUC_JP_LINUX));
+    }
+
+    public CharsetDecoder newDecoder() {
+        return new Decoder(this);
+    }
+
+    public CharsetEncoder newEncoder() {
+        return new Encoder(this);
+    }
+
+    private static class Decoder extends EUC_JP.Decoder {
+        private Decoder(Charset cs) {
+            super(cs, 1.0f, 1.0f, DEC0201, DEC0208, null);
+        }
+    }
+
+    private static class Encoder extends EUC_JP.Encoder {
+        private Encoder(Charset cs) {
+            super(cs, 2.0f, 2.0f, ENC0201, ENC0208, null);
+        }
+    }
+}
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/EUC_JP_Open.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,111 +0,0 @@
-/*
- * Copyright (c) 2003, 2012, 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.ext;
-
-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 sun.nio.cs.HistoricallyNamedCharset;
-import static sun.nio.cs.CharsetMapping.*;
-
-public class EUC_JP_Open
-    extends Charset
-    implements HistoricallyNamedCharset
-{
-    public EUC_JP_Open() {
-        super("x-eucJP-Open", ExtendedCharsets.aliasesFor("x-eucJP-Open"));
-    }
-
-    public String historicalName() {
-        return "EUC_JP_Solaris";
-    }
-
-    public boolean contains(Charset cs) {
-        return ((cs.name().equals("US-ASCII"))
-                || (cs instanceof JIS_X_0201)
-                || (cs instanceof EUC_JP));
-    }
-
-    public CharsetDecoder newDecoder() {
-        return new Decoder(this);
-    }
-
-    public CharsetEncoder newEncoder() {
-        return new Encoder(this);
-    }
-
-    private static class Decoder extends EUC_JP.Decoder {
-        private static DoubleByte.Decoder DEC0208_Solaris =
-            (DoubleByte.Decoder)new JIS_X_0208_Solaris().newDecoder();
-        private static DoubleByte.Decoder DEC0212_Solaris =
-            (DoubleByte.Decoder)new JIS_X_0212_Solaris().newDecoder();
-
-        private Decoder(Charset cs) {
-            // JIS_X_0208_Solaris only has the "extra" mappings, it
-            // does not have the JIS_X_0208 entries
-            super(cs, 0.5f, 1.0f, DEC0201, DEC0208, DEC0212_Solaris);
-        }
-
-        protected char decodeDouble(int byte1, int byte2) {
-            char c = super.decodeDouble(byte1, byte2);
-            if (c == UNMAPPABLE_DECODING)
-                return DEC0208_Solaris.decodeDouble(byte1 - 0x80, byte2 - 0x80);
-            return c;
-        }
-    }
-
-    private static class Encoder extends EUC_JP.Encoder {
-        private static DoubleByte.Encoder ENC0208_Solaris =
-            (DoubleByte.Encoder)new JIS_X_0208_Solaris().newEncoder();
-
-        private static DoubleByte.Encoder ENC0212_Solaris =
-            (DoubleByte.Encoder)new JIS_X_0212_Solaris().newEncoder();
-
-        private Encoder(Charset cs) {
-            // The EUC_JP_Open has some interesting tweak for the
-            // encoding, so can't just pass the euc0208_solaris to
-            // the euc_jp. Have to override the encodeDouble() as
-            // showed below (mapping testing catches this).
-            // super(cs, 3.0f, 3.0f, ENC0201, ENC0208_Solaris, ENC0212_Solaris);
-            super(cs);
-        }
-
-        protected int encodeDouble(char ch) {
-            int b = super.encodeDouble(ch);
-            if (b != UNMAPPABLE_ENCODING)
-                return b;
-            b = ENC0208_Solaris.encodeChar(ch);
-            if (b != UNMAPPABLE_ENCODING && b > 0x7500) {
-                return 0x8F8080 + ENC0212_Solaris.encodeChar(ch);
-            }
-            return b == UNMAPPABLE_ENCODING ? b : b + 0x8080;
-
-        }
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/EUC_JP_Open.java.template	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2003, 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 $PACKAGE$;
+
+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 sun.nio.cs.DoubleByte;
+import sun.nio.cs.HistoricallyNamedCharset;
+import sun.nio.cs.*;
+import static sun.nio.cs.CharsetMapping.*;
+
+public class EUC_JP_Open
+    extends Charset
+    implements HistoricallyNamedCharset
+{
+    public EUC_JP_Open() {
+        super("x-eucJP-Open", $ALIASES$);
+    }
+
+    public String historicalName() {
+        return "EUC_JP_Solaris";
+    }
+
+    public boolean contains(Charset cs) {
+        return ((cs.name().equals("US-ASCII"))
+                || (cs instanceof JIS_X_0201)
+                || (cs instanceof EUC_JP));
+    }
+
+    public CharsetDecoder newDecoder() {
+        return new Decoder(this);
+    }
+
+    public CharsetEncoder newEncoder() {
+        return new Encoder(this);
+    }
+
+    private static class Decoder extends EUC_JP.Decoder {
+        private static DoubleByte.Decoder DEC0208_Solaris =
+            (DoubleByte.Decoder)new JIS_X_0208_Solaris().newDecoder();
+        private static DoubleByte.Decoder DEC0212_Solaris =
+            (DoubleByte.Decoder)new JIS_X_0212_Solaris().newDecoder();
+
+        private Decoder(Charset cs) {
+            // JIS_X_0208_Solaris only has the "extra" mappings, it
+            // does not have the JIS_X_0208 entries
+            super(cs, 0.5f, 1.0f, DEC0201, DEC0208, DEC0212_Solaris);
+        }
+
+        protected char decodeDouble(int byte1, int byte2) {
+            char c = super.decodeDouble(byte1, byte2);
+            if (c == UNMAPPABLE_DECODING)
+                return DEC0208_Solaris.decodeDouble(byte1 - 0x80, byte2 - 0x80);
+            return c;
+        }
+    }
+
+    private static class Encoder extends EUC_JP.Encoder {
+        private static DoubleByte.Encoder ENC0208_Solaris =
+            (DoubleByte.Encoder)new JIS_X_0208_Solaris().newEncoder();
+
+        private static DoubleByte.Encoder ENC0212_Solaris =
+            (DoubleByte.Encoder)new JIS_X_0212_Solaris().newEncoder();
+
+        private Encoder(Charset cs) {
+            // The EUC_JP_Open has some interesting tweak for the
+            // encoding, so can't just pass the euc0208_solaris to
+            // the euc_jp. Have to override the encodeDouble() as
+            // showed below (mapping testing catches this).
+            // super(cs, 3.0f, 3.0f, ENC0201, ENC0208_Solaris, ENC0212_Solaris);
+            super(cs);
+        }
+
+        protected int encodeDouble(char ch) {
+            int b = super.encodeDouble(ch);
+            if (b != UNMAPPABLE_ENCODING)
+                return b;
+            b = ENC0208_Solaris.encodeChar(ch);
+            if (b != UNMAPPABLE_ENCODING && b > 0x7500) {
+                return 0x8F8080 + ENC0212_Solaris.encodeChar(ch);
+            }
+            return b == UNMAPPABLE_ENCODING ? b : b + 0x8080;
+
+        }
+    }
+}
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/ExtendedCharsets.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1326 +0,0 @@
-/*
- * Copyright (c) 2002, 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.ext;
-
-import java.lang.ref.SoftReference;
-import java.nio.charset.Charset;
-import java.nio.charset.spi.CharsetProvider;
-import sun.nio.cs.AbstractCharsetProvider;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
-/**
- * Provider for extended charsets.
- */
-
-public class ExtendedCharsets
-    extends AbstractCharsetProvider
-{
-
-    static volatile ExtendedCharsets instance = null;
-
-    public ExtendedCharsets() {
-
-        super("sun.nio.cs.ext");  // identify provider pkg name.
-
-        // Traditional Chinese
-
-        charset("Big5", "Big5",
-                new String[] {
-                    // IANA aliases
-                    "csBig5"
-                });
-
-        charset("x-MS950-HKSCS-XP", "MS950_HKSCS_XP",
-                new String[] {
-                    "MS950_HKSCS_XP"  // JDK historical;
-                });
-
-        charset("x-MS950-HKSCS", "MS950_HKSCS",
-                new String[] {
-                    // IANA aliases
-                    "MS950_HKSCS"     // JDK historical;
-                });
-
-        charset("x-windows-950", "MS950",
-                new String[] {
-                    "ms950",    // JDK historical
-                    "windows-950"
-                });
-
-        charset("x-windows-874", "MS874",
-                new String[] {
-                    "ms874",  // JDK historical
-                    "ms-874",
-                    "windows-874" });
-
-        charset("x-EUC-TW", "EUC_TW",
-                new String[] {
-                    "euc_tw", // JDK historical
-                    "euctw",
-                    "cns11643",
-                    "EUC-TW"
-                });
-
-        charset("Big5-HKSCS", "Big5_HKSCS",
-                new String[] {
-                    "Big5_HKSCS", // JDK historical
-                    "big5hk",
-                    "big5-hkscs",
-                    "big5hkscs"   // Linux alias
-                });
-
-        charset("x-Big5-HKSCS-2001", "Big5_HKSCS_2001",
-                new String[] {
-                    "Big5_HKSCS_2001",
-                    "big5hk-2001",
-                    "big5-hkscs-2001",
-                    "big5-hkscs:unicode3.0",
-                    "big5hkscs-2001",
-                });
-
-        charset("x-Big5-Solaris", "Big5_Solaris",
-                new String[] {
-                    "Big5_Solaris", // JDK historical
-                });
-
-        // Simplified Chinese
-        charset("GBK", "GBK",
-                new String[] {
-                    "windows-936",
-                    "CP936"
-                });
-
-        charset("GB18030", "GB18030",
-                new String[] {
-                    "gb18030-2000"
-                });
-
-        charset("GB2312", "EUC_CN",
-                new String[] {
-                    // IANA aliases
-                    "gb2312",
-                    "gb2312-80",
-                    "gb2312-1980",
-                    "euc-cn",
-                    "euccn",
-                    "x-EUC-CN", // 1.4 compatibility
-                    "EUC_CN" //JDK historical
-                });
-
-        charset("x-mswin-936", "MS936",
-                new String[] {
-                    "ms936", // historical
-                    // IANA aliases
-                    "ms_936"
-                });
-
-        // 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",
-                new String[] {
-                    // IANA aliases
-                    "sjis", // historical
-                    "shift_jis",
-                    "shift-jis",
-                    "ms_kanji",
-                    "x-sjis",
-                    "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",
-                new String[] {
-                    "MS932", // JDK historical
-                    "windows-932",
-                    "csWindows31J"
-                });
-
-        charset("JIS_X0201", "JIS_X_0201",
-                new String[] {
-                    "JIS0201", // JDK historical
-                    // IANA aliases
-                    "JIS_X0201",
-                    "X0201",
-                    "csHalfWidthKatakana"
-                });
-
-        charset("x-JIS0208", "JIS_X_0208",
-                new String[] {
-                    "JIS0208", // JDK historical
-                    // IANA aliases
-                    "JIS_C6226-1983",
-                    "iso-ir-87",
-                    "x0208",
-                    "JIS_X0208-1983",
-                    "csISO87JISX0208"
-                });
-
-        charset("JIS_X0212-1990", "JIS_X_0212",
-                new String[] {
-                    "JIS0212", // JDK historical
-                    // IANA aliases
-                    "jis_x0212-1990",
-                    "x0212",
-                    "iso-ir-159",
-                    "csISO159JISX02121990"
-                });
-
-        charset("x-SJIS_0213", "SJIS_0213",
-                new String[] {
-                    "sjis-0213",
-                    "sjis_0213",
-                    "sjis:2004",
-                    "sjis_0213:2004",
-                    "shift_jis_0213:2004",
-                    "shift_jis:2004"
-                });
-
-        charset("x-MS932_0213", "MS932_0213",
-                new String[] {
-                    "MS932-0213",
-                    "MS932_0213",
-                    "MS932:2004",
-                    "windows-932-0213",
-                    "windows-932:2004"
-                });
-
-        charset("EUC-JP", "EUC_JP",
-                new String[] {
-                    "euc_jp", // JDK historical
-                    // IANA aliases
-                    "eucjis",
-                    "eucjp",
-                    "Extended_UNIX_Code_Packed_Format_for_Japanese",
-                    "csEUCPkdFmtjapanese",
-                    "x-euc-jp",
-                    "x-eucjp"
-                });
-
-        charset("x-euc-jp-linux", "EUC_JP_LINUX",
-                new String[] {
-                    "euc_jp_linux", // JDK historical
-                    "euc-jp-linux"
-                });
-
-        charset("x-eucjp-open", "EUC_JP_Open",
-                new String[] {
-                    "EUC_JP_Solaris",   // JDK historical
-                    "eucJP-open"
-                });
-
-        charset("x-PCK", "PCK",
-                new String[] {
-                    // IANA aliases
-                    "pck" // historical
-                });
-
-        charset("ISO-2022-JP", "ISO2022_JP",
-            new String[] {
-            // IANA aliases
-            "iso2022jp", // historical
-            "jis",
-            "csISO2022JP",
-            "jis_encoding",
-            "csjisencoding"
-        });
-
-        charset("ISO-2022-JP-2", "ISO2022_JP_2",
-            new String[] {
-            // IANA aliases
-            "csISO2022JP2",
-            "iso2022jp2"
-        });
-
-        charset("x-windows-50221", "MS50221",
-            new String[] {
-            "ms50221", // historical
-            "cp50221",
-        });
-
-        charset("x-windows-50220", "MS50220",
-            new String[] {
-            "ms50220", // historical
-            "cp50220",
-        });
-
-        charset("x-windows-iso2022jp", "MSISO2022JP",
-            new String[] {
-            "windows-iso2022jp", // historical
-        });
-
-        charset("x-JISAutoDetect", "JISAutoDetect",
-                new String[] {
-                    "JISAutoDetect" // historical
-                });
-
-        // Korean
-        charset("EUC-KR", "EUC_KR",
-                new String[] {
-                    "euc_kr", // JDK historical
-                    // IANA aliases
-                    "ksc5601",
-                    "euckr",
-                    "ks_c_5601-1987",
-                    "ksc5601-1987",
-                    "ksc5601_1987",
-                    "ksc_5601",
-                    "csEUCKR",
-                    "5601"
-                });
-
-        charset("x-windows-949", "MS949",
-                new String[] {
-                    "ms949",    // JDK historical
-                    "windows949",
-                    "windows-949",
-                    // IANA aliases
-                    "ms_949"
-                });
-
-        charset("x-Johab", "Johab",
-                new String[] {
-                        "ksc5601-1992",
-                        "ksc5601_1992",
-                        "ms1361",
-                        "johab" // JDK historical
-                });
-
-        charset("ISO-2022-KR", "ISO2022_KR",
-                new String[] {
-                        "ISO2022KR", // JDK historical
-                        "csISO2022KR"
-                });
-
-        charset("ISO-2022-CN", "ISO2022_CN",
-                new String[] {
-                        "ISO2022CN", // JDK historical
-                        "csISO2022CN"
-                });
-
-        charset("x-ISO-2022-CN-CNS", "ISO2022_CN_CNS",
-                new String[] {
-                        "ISO2022CN_CNS", // JDK historical
-                        "ISO-2022-CN-CNS"
-                });
-
-        charset("x-ISO-2022-CN-GB", "ISO2022_CN_GB",
-                new String[] {
-                        "ISO2022CN_GB", // JDK historical
-                        "ISO-2022-CN-GB"
-                });
-
-        charset("x-ISCII91", "ISCII91",
-                new String[] {
-                        "iscii",
-                        "ST_SEV_358-88",
-                        "iso-ir-153",
-                        "csISO153GOST1976874",
-                        "ISCII91" // JDK historical
-                });
-
-        charset("ISO-8859-3", "ISO_8859_3",
-                new String[] {
-                    "iso8859_3", // JDK historical
-                    "8859_3",
-                    "ISO_8859-3:1988",
-                    "iso-ir-109",
-                    "ISO_8859-3",
-                    "ISO8859-3",
-                    "latin3",
-                    "l3",
-                    "ibm913",
-                    "ibm-913",
-                    "cp913",
-                    "913",
-                    "csISOLatin3"
-                });
-
-        charset("ISO-8859-6", "ISO_8859_6",
-                new String[] {
-                    "iso8859_6", // JDK historical
-                    "8859_6",
-                    "iso-ir-127",
-                    "ISO_8859-6",
-                    "ISO_8859-6:1987",
-                    "ISO8859-6",
-                    "ECMA-114",
-                    "ASMO-708",
-                    "arabic",
-                    "ibm1089",
-                    "ibm-1089",
-                    "cp1089",
-                    "1089",
-                    "csISOLatinArabic"
-                });
-
-        charset("ISO-8859-8", "ISO_8859_8",
-                new String[] {
-                    "iso8859_8", // JDK historical
-                    "8859_8",
-                    "iso-ir-138",
-                    "ISO_8859-8",
-                    "ISO_8859-8:1988",
-                    "ISO8859-8",
-                    "cp916",
-                    "916",
-                    "ibm916",
-                    "ibm-916",
-                    "hebrew",
-                    "csISOLatinHebrew"
-                });
-
-        charset("x-ISO-8859-11", "ISO_8859_11",
-                new String[] {
-                    "iso-8859-11",
-                    "iso8859_11"
-                });
-
-        charset("TIS-620", "TIS_620",
-                new String[] {
-                    "tis620", // JDK historical
-                    "tis620.2533"
-                });
-
-        // Various Microsoft Windows international codepages
-
-        charset("windows-1255", "MS1255",
-                new String[] {
-                    "cp1255" // JDK historical
-                });
-
-        charset("windows-1256", "MS1256",
-                new String[] {
-                    "cp1256" // JDK historical
-                });
-
-        charset("windows-1258", "MS1258",
-                new String[] {
-                    "cp1258" // JDK historical
-                });
-
-        // IBM & PC/MSDOS encodings
-
-        charset("x-IBM942", "IBM942",
-                new String[] {
-                    "cp942", // JDK historical
-                    "ibm942",
-                    "ibm-942",
-                    "942"
-                });
-
-        charset("x-IBM942C", "IBM942C",
-                new String[] {
-                    "cp942C", // JDK historical
-                    "ibm942C",
-                    "ibm-942C",
-                    "942C"
-                });
-
-        charset("x-IBM943", "IBM943",
-                new String[] {
-                    "cp943", // JDK historical
-                    "ibm943",
-                    "ibm-943",
-                    "943"
-                });
-
-        charset("x-IBM943C", "IBM943C",
-                new String[] {
-                    "cp943C", // JDK historical
-                    "ibm943C",
-                    "ibm-943C",
-                    "943C"
-                });
-
-        charset("x-IBM948", "IBM948",
-                new String[] {
-                    "cp948", // JDK historical
-                    "ibm948",
-                    "ibm-948",
-                    "948"
-                });
-
-        charset("x-IBM950", "IBM950",
-                new String[] {
-                    "cp950", // JDK historical
-                    "ibm950",
-                    "ibm-950",
-                    "950"
-                });
-
-        charset("x-IBM930", "IBM930",
-                new String[] {
-                    "cp930", // JDK historical
-                    "ibm930",
-                    "ibm-930",
-                    "930"
-                });
-
-        charset("x-IBM935", "IBM935",
-                new String[] {
-                    "cp935", // JDK historical
-                    "ibm935",
-                    "ibm-935",
-                    "935"
-                });
-
-        charset("x-IBM937", "IBM937",
-                new String[] {
-                    "cp937", // JDK historical
-                    "ibm937",
-                    "ibm-937",
-                    "937"
-                });
-
-        charset("x-IBM856", "IBM856",
-                new String[] {
-                    "cp856", // JDK historical
-                    "ibm-856",
-                    "ibm856",
-                    "856"
-                });
-
-        charset("IBM860", "IBM860",
-                new String[] {
-                    "cp860", // JDK historical
-                    "ibm860",
-                    "ibm-860",
-                    "860",
-                    "csIBM860"
-                });
-        charset("IBM861", "IBM861",
-                new String[] {
-                    "cp861", // JDK historical
-                    "ibm861",
-                    "ibm-861",
-                    "861",
-                    "csIBM861",
-                    "cp-is"
-                });
-
-        charset("IBM863", "IBM863",
-                new String[] {
-                    "cp863", // JDK historical
-                    "ibm863",
-                    "ibm-863",
-                    "863",
-                    "csIBM863"
-                });
-
-        charset("IBM864", "IBM864",
-                new String[] {
-                    "cp864", // JDK historical
-                    "ibm864",
-                    "ibm-864",
-                    "864",
-                    "csIBM864"
-                });
-
-        charset("IBM865", "IBM865",
-                new String[] {
-                    "cp865", // JDK historical
-                    "ibm865",
-                    "ibm-865",
-                    "865",
-                    "csIBM865"
-                });
-
-        charset("IBM868", "IBM868",
-                new String[] {
-                    "cp868", // JDK historical
-                    "ibm868",
-                    "ibm-868",
-                    "868",
-                    "cp-ar",
-                    "csIBM868"
-                });
-
-        charset("IBM869", "IBM869",
-                new String[] {
-                    "cp869", // JDK historical
-                    "ibm869",
-                    "ibm-869",
-                    "869",
-                    "cp-gr",
-                    "csIBM869"
-                });
-
-        charset("x-IBM921", "IBM921",
-                new String[] {
-                    "cp921", // JDK historical
-                    "ibm921",
-                    "ibm-921",
-                    "921"
-                });
-
-        charset("x-IBM1006", "IBM1006",
-                new String[] {
-                    "cp1006", // JDK historical
-                    "ibm1006",
-                    "ibm-1006",
-                    "1006"
-                });
-
-        charset("x-IBM1046", "IBM1046",
-                new String[] {
-                    "cp1046", // JDK historical
-                    "ibm1046",
-                    "ibm-1046",
-                    "1046"
-                });
-
-        charset("IBM1047", "IBM1047",
-                new String[] {
-                    "cp1047", // JDK historical
-                    "ibm-1047",
-                    "1047"
-                });
-
-        charset("x-IBM1098", "IBM1098",
-                new String[] {
-                    "cp1098", // JDK historical
-                    "ibm1098",
-                    "ibm-1098",
-                    "1098",
-                });
-
-        charset("IBM037", "IBM037",
-                new String[] {
-                    "cp037", // JDK historical
-                    "ibm037",
-                    "ebcdic-cp-us",
-                    "ebcdic-cp-ca",
-                    "ebcdic-cp-wt",
-                    "ebcdic-cp-nl",
-                    "csIBM037",
-                    "cs-ebcdic-cp-us",
-                    "cs-ebcdic-cp-ca",
-                    "cs-ebcdic-cp-wt",
-                    "cs-ebcdic-cp-nl",
-                    "ibm-037",
-                    "ibm-37",
-                    "cpibm37",
-                    "037"
-                });
-
-        charset("x-IBM1025", "IBM1025",
-                new String[] {
-                    "cp1025", // JDK historical
-                    "ibm1025",
-                    "ibm-1025",
-                    "1025"
-                });
-
-        charset("IBM1026", "IBM1026",
-                new String[] {
-                    "cp1026", // JDK historical
-                    "ibm1026",
-                    "ibm-1026",
-                    "1026"
-                });
-
-        charset("x-IBM1112", "IBM1112",
-                new String[] {
-                    "cp1112", // JDK historical
-                    "ibm1112",
-                    "ibm-1112",
-                    "1112"
-                });
-
-        charset("x-IBM1122", "IBM1122",
-                new String[] {
-                    "cp1122", // JDK historical
-                    "ibm1122",
-                    "ibm-1122",
-                    "1122"
-                });
-
-        charset("x-IBM1123", "IBM1123",
-                new String[] {
-                    "cp1123", // JDK historical
-                    "ibm1123",
-                    "ibm-1123",
-                    "1123"
-                });
-
-        charset("x-IBM1124", "IBM1124",
-                new String[] {
-                    "cp1124", // JDK historical
-                    "ibm1124",
-                    "ibm-1124",
-                    "1124"
-                });
-
-        charset("x-IBM1364", "IBM1364",
-                new String[] {
-                    "cp1364",
-                    "ibm1364",
-                    "ibm-1364",
-                    "1364"
-                });
-
-        charset("IBM273", "IBM273",
-                new String[] {
-                    "cp273", // JDK historical
-                    "ibm273",
-                    "ibm-273",
-                    "273"
-                });
-
-        charset("IBM277", "IBM277",
-                new String[] {
-                    "cp277", // JDK historical
-                    "ibm277",
-                    "ibm-277",
-                    "277"
-                });
-
-        charset("IBM278", "IBM278",
-                new String[] {
-                    "cp278", // JDK historical
-                    "ibm278",
-                    "ibm-278",
-                    "278",
-                    "ebcdic-sv",
-                    "ebcdic-cp-se",
-                    "csIBM278"
-                });
-
-        charset("IBM280", "IBM280",
-                new String[] {
-                    "cp280", // JDK historical
-                    "ibm280",
-                    "ibm-280",
-                    "280"
-                });
-
-        charset("IBM284", "IBM284",
-                new String[] {
-                    "cp284", // JDK historical
-                    "ibm284",
-                    "ibm-284",
-                    "284",
-                    "csIBM284",
-                    "cpibm284"
-                });
-
-        charset("IBM285", "IBM285",
-                new String[] {
-                    "cp285", // JDK historical
-                    "ibm285",
-                    "ibm-285",
-                    "285",
-                    "ebcdic-cp-gb",
-                    "ebcdic-gb",
-                    "csIBM285",
-                    "cpibm285"
-                });
-
-        charset("IBM297", "IBM297",
-                new String[] {
-                    "cp297", // JDK historical
-                    "ibm297",
-                    "ibm-297",
-                    "297",
-                    "ebcdic-cp-fr",
-                    "cpibm297",
-                    "csIBM297",
-                });
-
-        charset("IBM420", "IBM420",
-                new String[] {
-                    "cp420", // JDK historical
-                    "ibm420",
-                    "ibm-420",
-                    "ebcdic-cp-ar1",
-                    "420",
-                    "csIBM420"
-                });
-
-        charset("IBM424", "IBM424",
-                new String[] {
-                    "cp424", // JDK historical
-                    "ibm424",
-                    "ibm-424",
-                    "424",
-                    "ebcdic-cp-he",
-                    "csIBM424"
-                });
-
-        charset("IBM500", "IBM500",
-                new String[] {
-                    "cp500", // JDK historical
-                    "ibm500",
-                    "ibm-500",
-                    "500",
-                    "ebcdic-cp-ch",
-                    "ebcdic-cp-bh",
-                    "csIBM500"
-                });
-
-        charset("x-IBM833", "IBM833",
-                new String[] {
-                     "cp833",
-                     "ibm833",
-                     "ibm-833"
-                 });
-
-        //EBCDIC DBCS-only Korean
-        charset("x-IBM834", "IBM834",
-                new String[] {
-                    "cp834",
-                    "ibm834",
-                    "834",
-                    "ibm-834"
-        });
-
-
-        charset("IBM-Thai", "IBM838",
-                new String[] {
-                    "cp838", // JDK historical
-                    "ibm838",
-                    "ibm-838",
-                    "838"
-                });
-
-        charset("IBM870", "IBM870",
-                new String[] {
-                    "cp870", // JDK historical
-                    "ibm870",
-                    "ibm-870",
-                    "870",
-                    "ebcdic-cp-roece",
-                    "ebcdic-cp-yu",
-                    "csIBM870"
-                });
-
-        charset("IBM871", "IBM871",
-                new String[] {
-                    "cp871", // JDK historical
-                    "ibm871",
-                    "ibm-871",
-                    "871",
-                    "ebcdic-cp-is",
-                    "csIBM871"
-                });
-
-        charset("x-IBM875", "IBM875",
-                new String[] {
-                    "cp875", // JDK historical
-                    "ibm875",
-                    "ibm-875",
-                    "875"
-                });
-
-        charset("IBM918", "IBM918",
-                new String[] {
-                    "cp918", // JDK historical
-                    "ibm-918",
-                    "918",
-                    "ebcdic-cp-ar2"
-                });
-
-        charset("x-IBM922", "IBM922",
-                new String[] {
-                    "cp922", // JDK historical
-                    "ibm922",
-                    "ibm-922",
-                    "922"
-                });
-
-        charset("x-IBM1097", "IBM1097",
-                new String[] {
-                    "cp1097", // JDK historical
-                    "ibm1097",
-                    "ibm-1097",
-                    "1097"
-                });
-
-        charset("x-IBM949", "IBM949",
-                new String[] {
-                    "cp949", // JDK historical
-                    "ibm949",
-                    "ibm-949",
-                    "949"
-                });
-
-        charset("x-IBM949C", "IBM949C",
-                new String[] {
-                    "cp949C", // JDK historical
-                    "ibm949C",
-                    "ibm-949C",
-                    "949C"
-                });
-
-        charset("x-IBM939", "IBM939",
-                new String[] {
-                    "cp939", // JDK historical
-                    "ibm939",
-                    "ibm-939",
-                    "939"
-                });
-
-        charset("x-IBM933", "IBM933",
-                new String[] {
-                    "cp933", // JDK historical
-                    "ibm933",
-                    "ibm-933",
-                    "933"
-                });
-
-        charset("x-IBM1381", "IBM1381",
-                new String[] {
-                    "cp1381", // JDK historical
-                    "ibm1381",
-                    "ibm-1381",
-                    "1381"
-                });
-
-        charset("x-IBM1383", "IBM1383",
-                new String[] {
-                    "cp1383", // JDK historical
-                    "ibm1383",
-                    "ibm-1383",
-                    "1383"
-                });
-
-        charset("x-IBM970", "IBM970",
-                new String[] {
-                    "cp970", // JDK historical
-                    "ibm970",
-                    "ibm-970",
-                    "ibm-eucKR",
-                    "970"
-                });
-
-        charset("x-IBM964", "IBM964",
-                new String[] {
-                    "cp964", // JDK historical
-                    "ibm964",
-                    "ibm-964",
-                    "964"
-                });
-
-        charset("x-IBM33722", "IBM33722",
-                new String[] {
-                    "cp33722", // JDK historical
-                    "ibm33722",
-                    "ibm-33722",
-                    "ibm-5050", // from IBM alias list
-                    "ibm-33722_vascii_vpua", // from IBM alias list
-                    "33722"
-                });
-
-        charset("IBM01140", "IBM1140",
-                new String[] {
-                    "cp1140", // JDK historical
-                    "ccsid01140",
-                    "cp01140",
-                    "1140",
-                    "ebcdic-us-037+euro"
-                });
-
-        charset("IBM01141", "IBM1141",
-                new String[] {
-                    "cp1141", // JDK historical
-                    "ccsid01141",
-                    "cp01141",
-                    "1141",
-                    "ebcdic-de-273+euro"
-                });
-
-        charset("IBM01142", "IBM1142",
-                new String[] {
-                    "cp1142", // JDK historical
-                    "ccsid01142",
-                    "cp01142",
-                    "1142",
-                    "ebcdic-no-277+euro",
-                    "ebcdic-dk-277+euro"
-                });
-
-        charset("IBM01143", "IBM1143",
-                new String[] {
-                    "cp1143", // JDK historical
-                    "ccsid01143",
-                    "cp01143",
-                    "1143",
-                    "ebcdic-fi-278+euro",
-                    "ebcdic-se-278+euro"
-                });
-
-        charset("IBM01144", "IBM1144",
-                new String[] {
-                    "cp1144", // JDK historical
-                    "ccsid01144",
-                    "cp01144",
-                    "1144",
-                    "ebcdic-it-280+euro"
-                });
-
-        charset("IBM01145", "IBM1145",
-                new String[] {
-                    "cp1145", // JDK historical
-                    "ccsid01145",
-                    "cp01145",
-                    "1145",
-                    "ebcdic-es-284+euro"
-                });
-
-        charset("IBM01146", "IBM1146",
-                new String[] {
-                    "cp1146", // JDK historical
-                    "ccsid01146",
-                    "cp01146",
-                    "1146",
-                    "ebcdic-gb-285+euro"
-                });
-
-        charset("IBM01147", "IBM1147",
-                new String[] {
-                    "cp1147", // JDK historical
-                    "ccsid01147",
-                    "cp01147",
-                    "1147",
-                    "ebcdic-fr-277+euro"
-                });
-
-        charset("IBM01148", "IBM1148",
-                new String[] {
-                    "cp1148", // JDK historical
-                    "ccsid01148",
-                    "cp01148",
-                    "1148",
-                    "ebcdic-international-500+euro"
-                });
-
-        charset("IBM01149", "IBM1149",
-                new String[] {
-                    "cp1149", // JDK historical
-                    "ccsid01149",
-                    "cp01149",
-                    "1149",
-                    "ebcdic-s-871+euro"
-                });
-
-        charset("IBM290", "IBM290",
-                new String[] {
-                    "cp290",
-                    "ibm290",
-                    "ibm-290",
-                    "csIBM290",
-                    "EBCDIC-JP-kana",
-                    "290"
-                });
-
-        charset("x-IBM300", "IBM300",
-                new String[] {
-                    "cp300",
-                    "ibm300",
-                    "ibm-300",
-                    "300"
-                });
-
-        // Macintosh MacOS/Apple char encodingd
-
-
-        charset("x-MacRoman", "MacRoman",
-                new String[] {
-                    "MacRoman" // JDK historical
-                });
-
-        charset("x-MacCentralEurope", "MacCentralEurope",
-                new String[] {
-                    "MacCentralEurope" // JDK historical
-                });
-
-        charset("x-MacCroatian", "MacCroatian",
-                new String[] {
-                    "MacCroatian" // JDK historical
-                });
-
-
-        charset("x-MacGreek", "MacGreek",
-                new String[] {
-                    "MacGreek" // JDK historical
-                });
-
-        charset("x-MacCyrillic", "MacCyrillic",
-                new String[] {
-                    "MacCyrillic" // JDK historical
-                });
-
-        charset("x-MacUkraine", "MacUkraine",
-                new String[] {
-                    "MacUkraine" // JDK historical
-                });
-
-        charset("x-MacTurkish", "MacTurkish",
-                new String[] {
-                    "MacTurkish" // JDK historical
-                });
-
-        charset("x-MacArabic", "MacArabic",
-                new String[] {
-                    "MacArabic" // JDK historical
-                });
-
-        charset("x-MacHebrew", "MacHebrew",
-                new String[] {
-                    "MacHebrew" // JDK historical
-                });
-
-        charset("x-MacIceland", "MacIceland",
-                new String[] {
-                    "MacIceland" // JDK historical
-                });
-
-        charset("x-MacRomania", "MacRomania",
-                new String[] {
-                    "MacRomania" // JDK historical
-                });
-
-        charset("x-MacThai", "MacThai",
-                new String[] {
-                    "MacThai" // JDK historical
-                });
-
-        charset("x-MacSymbol", "MacSymbol",
-                new String[] {
-                    "MacSymbol" // JDK historical
-                });
-
-        charset("x-MacDingbat", "MacDingbat",
-                new String[] {
-                    "MacDingbat" // JDK historical
-                });
-
-        instance = this;
-
-    }
-
-    private boolean initialized = false;
-
-    // If the sun.nio.cs.map property is defined on the command line we won't
-    // see it in the system-properties table until after the charset subsystem
-    // has been initialized.  We therefore delay the effect of this property
-    // until after the JRE has completely booted.
-    //
-    // At the moment following values for this property are supported, property
-    // value string is case insensitive.
-    //
-    // (1)"Windows-31J/Shift_JIS"
-    // In 1.4.1 we added a correct implementation of the Shift_JIS charset
-    // but in previous releases this charset name had been treated as an alias
-    // for Windows-31J, aka MS932. Users who have existing code that depends
-    // upon this alias can restore the previous behavior by defining this
-    // property to have this value.
-    //
-    // (2)"x-windows-50221/ISO-2022-JP"
-    //    "x-windows-50220/ISO-2022-JP"
-    //    "x-windows-iso2022jp/ISO-2022-JP"
-    // The charset ISO-2022-JP is a "standard based" implementation by default,
-    // which supports ASCII, JIS_X_0201 and JIS_X_0208 mappings based encoding
-    // and decoding only.
-    // There are three Microsoft iso-2022-jp variants, namely x-windows-50220,
-    // x-windows-50221 and x-windows-iso2022jp which behaves "slightly" differently
-    // compared to the "standard based" implementation. See ISO2022_JP.java for
-    // detailed description. Users who prefer the behavior of MS iso-2022-jp
-    // variants should use these names explicitly instead of using "ISO-2022-JP"
-    // and its aliases. However for those who need the ISO-2022-JP charset behaves
-    // exactly the same as MS variants do, above properties can be defined to
-    // switch.
-    //
-    // If we need to define other charset-alias mappings in the future then
-    // this property could be further extended, the general idea being that its
-    // value should be of the form
-    //
-    //     new-charset-1/old-charset-1,new-charset-2/old-charset-2,...
-    //
-    // where each charset named to the left of a slash is intended to replace
-    // (most) uses of the charset named to the right of the slash.
-    //
-    protected void init() {
-        if (initialized)
-            return;
-        if (!sun.misc.VM.isBooted())
-            return;
-
-        String map = getProperty("sun.nio.cs.map");
-        boolean sjisIsMS932 = false;
-        boolean iso2022jpIsMS50221 = false;
-        boolean iso2022jpIsMS50220 = false;
-        boolean iso2022jpIsMSISO2022JP = false;
-        if (map != null) {
-            String[] maps = map.split(",");
-            for (int i = 0; i < maps.length; i++) {
-                if (maps[i].equalsIgnoreCase("Windows-31J/Shift_JIS")) {
-                    sjisIsMS932 = true;
-                } else if (maps[i].equalsIgnoreCase("x-windows-50221/ISO-2022-JP")) {
-                    iso2022jpIsMS50221 = true;
-                } else if (maps[i].equalsIgnoreCase("x-windows-50220/ISO-2022-JP")) {
-                    iso2022jpIsMS50220 = true;
-                } else if (maps[i].equalsIgnoreCase("x-windows-iso2022jp/ISO-2022-JP")) {
-                    iso2022jpIsMSISO2022JP = true;
-                }
-            }
-        }
-        if (sjisIsMS932) {
-            deleteCharset("Shift_JIS",
-                          new String[] {
-                              // IANA aliases
-                              "sjis", // historical
-                              "shift_jis",
-                              "shift-jis",
-                              "ms_kanji",
-                              "x-sjis",
-                              "csShiftJIS"
-                          });
-            deleteCharset("windows-31j",
-                          new String[] {
-                              "MS932", // JDK historical
-                              "windows-932",
-                              "csWindows31J"
-                          });
-            charset("Shift_JIS", "SJIS",
-                    new String[] {
-                        // IANA aliases
-                        "sjis"          // JDK historical
-                    });
-            charset("windows-31j", "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"
-                    });
-        }
-        if (iso2022jpIsMS50221 ||
-            iso2022jpIsMS50220 ||
-            iso2022jpIsMSISO2022JP) {
-            deleteCharset("ISO-2022-JP",
-                          new String[] {
-                              "iso2022jp",
-                                "jis",
-                                "csISO2022JP",
-                                "jis_encoding",
-                                "csjisencoding"
-                          });
-            if (iso2022jpIsMS50221) {
-                deleteCharset("x-windows-50221",
-                              new String[] {
-                                  "cp50221",
-                                  "ms50221"
-                              });
-                charset("x-windows-50221", "MS50221",
-                        new String[] {
-                            "cp50221",
-                            "ms50221",
-                            "iso-2022-jp",
-                            "iso2022jp",
-                            "jis",
-                            "csISO2022JP",
-                            "jis_encoding",
-                            "csjisencoding"
-                        });
-            } else if (iso2022jpIsMS50220) {
-                deleteCharset("x-windows-50220",
-                              new String[] {
-                                  "cp50220",
-                                  "ms50220"
-                              });
-                charset("x-windows-50220", "MS50220",
-                        new String[] {
-                            "cp50220",
-                            "ms50220",
-                            "iso-2022-jp",
-                            "iso2022jp",
-                            "jis",
-                            "csISO2022JP",
-                            "jis_encoding",
-                            "csjisencoding"
-                        });
-            } else {
-                deleteCharset("x-windows-iso2022jp",
-                              new String[] {
-                                  "windows-iso2022jp"
-                              });
-                charset("x-windows-iso2022jp", "MSISO2022JP",
-                        new String[] {
-                            "windows-iso2022jp",
-                            "iso-2022-jp",
-                            "iso2022jp",
-                            "jis",
-                            "csISO2022JP",
-                            "jis_encoding",
-                            "csjisencoding"
-                        });
-
-
-            }
-        }
-        String osName = getProperty("os.name");
-        if ("SunOS".equals(osName) || "Linux".equals(osName) || "AIX".equals(osName)
-               || osName.contains("OS X")) {
-            charset("x-COMPOUND_TEXT", "COMPOUND_TEXT",
-                    new String[] {
-                        "COMPOUND_TEXT",        // JDK historical
-                        "x11-compound_text",
-                        "x-compound-text"
-                    });
-        }
-        initialized = true;
-    }
-
-    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);
-                }
-            });
-    }
-
-    public static String[] aliasesFor(String charsetName) {
-        if (instance == null)
-            return null;
-        return instance.aliases(charsetName);
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/ExtendedCharsets.java.template	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,256 @@
+/*
+ * 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.
+ *
+ */
+
+// -- This file was mechanically generated: Do not edit! -- //
+
+package sun.nio.cs.ext;
+
+import java.lang.ref.SoftReference;
+import java.nio.charset.Charset;
+import java.nio.charset.spi.CharsetProvider;
+import sun.nio.cs.AbstractCharsetProvider;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import sun.nio.cs.AbstractCharsetProvider;
+
+/**
+ * Provider for extended charsets.
+ */
+
+public class ExtendedCharsets extends AbstractCharsetProvider {
+
+    static volatile ExtendedCharsets instance = null;
+
+    public ExtendedCharsets() {
+
+        super("sun.nio.cs.ext");  // identify provider pkg name.
+
+        _CHARSETS_DEF_LIST_
+
+        instance = this;
+
+    }
+
+    private boolean initialized = false;
+
+    // If the sun.nio.cs.map property is defined on the command line we won't
+    // see it in the system-properties table until after the charset subsystem
+    // has been initialized.  We therefore delay the effect of this property
+    // until after the JRE has completely booted.
+    //
+    // At the moment following values for this property are supported, property
+    // value string is case insensitive.
+    //
+    // (1)"Windows-31J/Shift_JIS"
+    // In 1.4.1 we added a correct implementation of the Shift_JIS charset
+    // but in previous releases this charset name had been treated as an alias
+    // for Windows-31J, aka MS932. Users who have existing code that depends
+    // upon this alias can restore the previous behavior by defining this
+    // property to have this value.
+    //
+    // (2)"x-windows-50221/ISO-2022-JP"
+    //    "x-windows-50220/ISO-2022-JP"
+    //    "x-windows-iso2022jp/ISO-2022-JP"
+    // The charset ISO-2022-JP is a "standard based" implementation by default,
+    // which supports ASCII, JIS_X_0201 and JIS_X_0208 mappings based encoding
+    // and decoding only.
+    // There are three Microsoft iso-2022-jp variants, namely x-windows-50220,
+    // x-windows-50221 and x-windows-iso2022jp which behaves "slightly" differently
+    // compared to the "standard based" implementation. See ISO2022_JP.java for
+    // detailed description. Users who prefer the behavior of MS iso-2022-jp
+    // variants should use these names explicitly instead of using "ISO-2022-JP"
+    // and its aliases. However for those who need the ISO-2022-JP charset behaves
+    // exactly the same as MS variants do, above properties can be defined to
+    // switch.
+    //
+    // If we need to define other charset-alias mappings in the future then
+    // this property could be further extended, the general idea being that its
+    // value should be of the form
+    //
+    //     new-charset-1/old-charset-1,new-charset-2/old-charset-2,...
+    //
+    // where each charset named to the left of a slash is intended to replace
+    // (most) uses of the charset named to the right of the slash.
+    //
+    protected void init() {
+        if (initialized)
+            return;
+        if (!sun.misc.VM.isBooted())
+            return;
+
+        String map = getProperty("sun.nio.cs.map");
+        boolean sjisIsMS932 = false;
+        boolean iso2022jpIsMS50221 = false;
+        boolean iso2022jpIsMS50220 = false;
+        boolean iso2022jpIsMSISO2022JP = false;
+        if (map != null) {
+            String[] maps = map.split(",");
+            for (int i = 0; i < maps.length; i++) {
+                if (maps[i].equalsIgnoreCase("Windows-31J/Shift_JIS")) {
+                    sjisIsMS932 = true;
+                } else if (maps[i].equalsIgnoreCase("x-windows-50221/ISO-2022-JP")) {
+                    iso2022jpIsMS50221 = true;
+                } else if (maps[i].equalsIgnoreCase("x-windows-50220/ISO-2022-JP")) {
+                    iso2022jpIsMS50220 = true;
+                } else if (maps[i].equalsIgnoreCase("x-windows-iso2022jp/ISO-2022-JP")) {
+                    iso2022jpIsMSISO2022JP = true;
+                }
+            }
+        }
+        if (sjisIsMS932 && hasCharset("Shift_JIS")) {
+            deleteCharset("Shift_JIS",
+                          new String[] {
+                              // IANA aliases
+                              "sjis", // historical
+                              "shift_jis",
+                              "shift-jis",
+                              "ms_kanji",
+                              "x-sjis",
+                              "csShiftJIS"
+                          });
+            deleteCharset("windows-31j",
+                          new String[] {
+                              "MS932", // JDK historical
+                              "windows-932",
+                              "csWindows31J"
+                          });
+            charset("Shift_JIS", "SJIS",
+                    new String[] {
+                        // IANA aliases
+                        "sjis"          // JDK historical
+                    });
+            charset("windows-31j", "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"
+                    });
+        }
+        if (iso2022jpIsMS50221 ||
+            iso2022jpIsMS50220 ||
+            iso2022jpIsMSISO2022JP) {
+            deleteCharset("ISO-2022-JP",
+                          new String[] {
+                              "iso2022jp",
+                                "jis",
+                                "csISO2022JP",
+                                "jis_encoding",
+                                "csjisencoding"
+                          });
+            if (iso2022jpIsMS50221) {
+                deleteCharset("x-windows-50221",
+                              new String[] {
+                                  "cp50221",
+                                  "ms50221"
+                              });
+                charset("x-windows-50221", "MS50221",
+                        new String[] {
+                            "cp50221",
+                            "ms50221",
+                            "iso-2022-jp",
+                            "iso2022jp",
+                            "jis",
+                            "csISO2022JP",
+                            "jis_encoding",
+                            "csjisencoding"
+                        });
+            } else if (iso2022jpIsMS50220) {
+                deleteCharset("x-windows-50220",
+                              new String[] {
+                                  "cp50220",
+                                  "ms50220"
+                              });
+                charset("x-windows-50220", "MS50220",
+                        new String[] {
+                            "cp50220",
+                            "ms50220",
+                            "iso-2022-jp",
+                            "iso2022jp",
+                            "jis",
+                            "csISO2022JP",
+                            "jis_encoding",
+                            "csjisencoding"
+                        });
+            } else {
+                deleteCharset("x-windows-iso2022jp",
+                              new String[] {
+                                  "windows-iso2022jp"
+                              });
+                charset("x-windows-iso2022jp", "MSISO2022JP",
+                        new String[] {
+                            "windows-iso2022jp",
+                            "iso-2022-jp",
+                            "iso2022jp",
+                            "jis",
+                            "csISO2022JP",
+                            "jis_encoding",
+                            "csjisencoding"
+                        });
+
+
+            }
+        }
+        String osName = getProperty("os.name");
+        if ("SunOS".equals(osName) || "Linux".equals(osName) || "AIX".equals(osName)
+               || osName.contains("OS X")) {
+            charset("x-COMPOUND_TEXT", "COMPOUND_TEXT",
+                    new String[] {
+                        "COMPOUND_TEXT",        // JDK historical
+                        "x11-compound_text",
+                        "x-compound-text"
+                    });
+        }
+        initialized = true;
+    }
+
+    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);
+                }
+            });
+    }
+
+    public static String[] aliasesFor(String charsetName) {
+        if (instance == null)
+            return null;
+        return instance.aliases(charsetName);
+    }
+
+}
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/HKSCS.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,433 +0,0 @@
-/*
- * 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.ext;
-
-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 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);
-        }
-
-        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);
-        }
-
-       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/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/IBM834.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/IBM834.java	Mon Feb 23 05:01:11 2015 -0800
@@ -34,6 +34,7 @@
 import java.nio.charset.CharsetDecoder;
 import java.nio.charset.CharsetEncoder;
 import java.nio.charset.CoderResult;
+import sun.nio.cs.DoubleByte;
 import static sun.nio.cs.CharsetMapping.*;
 
 // EBCDIC DBCS-only Korean
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/IBM942C.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/IBM942C.java	Mon Feb 23 05:01:11 2015 -0800
@@ -29,6 +29,7 @@
 import java.nio.charset.CharsetDecoder;
 import java.nio.charset.CharsetEncoder;
 import java.util.Arrays;
+import sun.nio.cs.DoubleByte;
 import sun.nio.cs.HistoricallyNamedCharset;
 import static sun.nio.cs.CharsetMapping.*;
 
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/IBM943C.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/IBM943C.java	Mon Feb 23 05:01:11 2015 -0800
@@ -29,6 +29,7 @@
 import java.nio.charset.CharsetDecoder;
 import java.nio.charset.CharsetEncoder;
 import java.util.Arrays;
+import sun.nio.cs.DoubleByte;
 import sun.nio.cs.HistoricallyNamedCharset;
 
 public class IBM943C extends Charset implements HistoricallyNamedCharset
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/IBM949C.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/IBM949C.java	Mon Feb 23 05:01:11 2015 -0800
@@ -29,6 +29,7 @@
 import java.nio.charset.CharsetDecoder;
 import java.nio.charset.CharsetEncoder;
 import java.util.Arrays;
+import sun.nio.cs.DoubleByte;
 import sun.nio.cs.HistoricallyNamedCharset;
 
 public class IBM949C extends Charset implements HistoricallyNamedCharset
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/ISO2022_CN.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/ISO2022_CN.java	Mon Feb 23 05:01:11 2015 -0800
@@ -35,8 +35,10 @@
 import java.nio.charset.CharsetEncoder;
 import java.nio.charset.CoderResult;
 import java.nio.charset.CharacterCodingException;
+import sun.nio.cs.DoubleByte;
 import sun.nio.cs.HistoricallyNamedCharset;
 import sun.nio.cs.US_ASCII;
+import sun.nio.cs.*;
 
 public class ISO2022_CN
     extends Charset
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/ISO2022_CN_GB.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/ISO2022_CN_GB.java	Mon Feb 23 05:01:11 2015 -0800
@@ -34,6 +34,7 @@
 import java.nio.charset.CharsetDecoder;
 import java.nio.charset.CharsetEncoder;
 import java.nio.charset.CoderResult;
+import sun.nio.cs.*;
 import sun.nio.cs.HistoricallyNamedCharset;
 
 public class ISO2022_CN_GB extends ISO2022 implements HistoricallyNamedCharset
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/ISO2022_JP.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/ISO2022_JP.java	Mon Feb 23 05:01:11 2015 -0800
@@ -32,9 +32,12 @@
 import java.nio.charset.CharsetEncoder;
 import java.nio.charset.CoderResult;
 import java.nio.charset.CodingErrorAction;
+import sun.nio.cs.DelegatableDecoder;
+import sun.nio.cs.DoubleByte;
 import sun.nio.cs.HistoricallyNamedCharset;
 import sun.nio.cs.Surrogate;
 import sun.nio.cs.US_ASCII;
+import sun.nio.cs.*;
 import static sun.nio.cs.CharsetMapping.*;
 
 /*
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/ISO2022_JP_2.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/ISO2022_JP_2.java	Mon Feb 23 05:01:11 2015 -0800
@@ -28,6 +28,8 @@
 import java.nio.charset.Charset;
 import java.nio.charset.CharsetDecoder;
 import java.nio.charset.CharsetEncoder;
+import sun.nio.cs.DoubleByte;
+import sun.nio.cs.*;
 
 public class ISO2022_JP_2 extends ISO2022_JP
 {
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/ISO2022_KR.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/ISO2022_KR.java	Mon Feb 23 05:01:11 2015 -0800
@@ -35,7 +35,7 @@
 import java.nio.charset.CharsetEncoder;
 import java.nio.charset.CoderResult;
 import sun.nio.cs.HistoricallyNamedCharset;
-import sun.nio.cs.ext.EUC_KR;
+import sun.nio.cs.*;
 
 public class ISO2022_KR extends ISO2022
 implements HistoricallyNamedCharset
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/JISAutoDetect.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/JISAutoDetect.java	Mon Feb 23 05:01:11 2015 -0800
@@ -33,9 +33,11 @@
 import java.nio.charset.CoderResult;
 import java.nio.charset.CharacterCodingException;
 import java.nio.charset.MalformedInputException;
+import sun.nio.cs.DelegatableDecoder;
 import sun.nio.cs.HistoricallyNamedCharset;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
+import sun.nio.cs.*;
 import static java.lang.Character.UnicodeBlock;
 
 
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/MS50220.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/MS50220.java	Mon Feb 23 05:01:11 2015 -0800
@@ -28,6 +28,8 @@
 import java.nio.charset.Charset;
 import java.nio.charset.CharsetDecoder;
 import java.nio.charset.CharsetEncoder;
+import sun.nio.cs.DoubleByte;
+import sun.nio.cs.*;
 
 public class MS50220 extends ISO2022_JP
 {
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/MS50221.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/MS50221.java	Mon Feb 23 05:01:11 2015 -0800
@@ -26,6 +26,7 @@
 package sun.nio.cs.ext;
 
 import java.nio.charset.Charset;
+import sun.nio.cs.*;
 
 public class MS50221 extends MS50220
 {
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/MS932_0213.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/MS932_0213.java	Mon Feb 23 05:01:11 2015 -0800
@@ -28,6 +28,8 @@
 import java.nio.charset.Charset;
 import java.nio.charset.CharsetEncoder;
 import java.nio.charset.CharsetDecoder;
+import sun.nio.cs.DoubleByte;
+import sun.nio.cs.*;
 import static sun.nio.cs.CharsetMapping.*;
 
 public class MS932_0213 extends Charset {
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/MS950_HKSCS.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/MS950_HKSCS.java	Mon Feb 23 05:01:11 2015 -0800
@@ -29,6 +29,7 @@
 import java.nio.charset.CharsetDecoder;
 import java.nio.charset.CharsetEncoder;
 import sun.nio.cs.HistoricallyNamedCharset;
+import sun.nio.cs.*;
 import static sun.nio.cs.CharsetMapping.*;
 
 public class MS950_HKSCS extends Charset implements HistoricallyNamedCharset
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/MS950_HKSCS_XP.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +0,0 @@
-/*
- * Copyright (c) 2002, 2010, 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.ext;
-
-import java.nio.charset.Charset;
-import java.nio.charset.CharsetDecoder;
-import java.nio.charset.CharsetEncoder;
-import sun.nio.cs.HistoricallyNamedCharset;
-import static sun.nio.cs.CharsetMapping.*;
-
-public class MS950_HKSCS_XP extends Charset
-{
-    public MS950_HKSCS_XP() {
-        super("x-MS950-HKSCS-XP", ExtendedCharsets.aliasesFor("x-MS950-HKSCS-XP"));
-    }
-
-    public boolean contains(Charset cs) {
-        return ((cs.name().equals("US-ASCII"))
-                || (cs instanceof MS950)
-                || (cs instanceof MS950_HKSCS_XP));
-    }
-
-    public CharsetDecoder newDecoder() {
-        return new Decoder(this);
-    }
-
-    public CharsetEncoder newEncoder() {
-        return new Encoder(this);
-    }
-
-    static class Decoder extends HKSCS.Decoder {
-        private static DoubleByte.Decoder ms950 =
-            (DoubleByte.Decoder)new MS950().newDecoder();
-
-        /*
-         * Note current decoder decodes 0x8BC2 --> U+F53A
-         * ie. maps to Unicode PUA.
-         * Unaccounted discrepancy between this mapping
-         * inferred from MS950/windows-950 and the published
-         * MS HKSCS mappings which maps 0x8BC2 --> U+5C22
-         * a character defined with the Unified CJK block
-         */
-        private static char[][] b2cBmp = new char[0x100][];
-        static {
-            initb2c(b2cBmp, HKSCS_XPMapping.b2cBmpStr);
-        }
-
-        public char decodeDoubleEx(int b1, int b2) {
-            return UNMAPPABLE_DECODING;
-        }
-
-        private Decoder(Charset cs) {
-            super(cs, ms950, b2cBmp, null);
-        }
-    }
-
-    private static class Encoder extends HKSCS.Encoder {
-        private static DoubleByte.Encoder ms950 =
-            (DoubleByte.Encoder)new MS950().newEncoder();
-
-        /*
-         * Note current encoder encodes U+F53A --> 0x8BC2
-         * Published MS HKSCS mappings show
-         * U+5C22 <--> 0x8BC2
-         */
-        static char[][] c2bBmp = new char[0x100][];
-        static {
-            initc2b(c2bBmp, HKSCS_XPMapping.b2cBmpStr, null);
-        }
-
-        public int encodeSupp(int cp) {
-            return UNMAPPABLE_ENCODING;
-        }
-
-        private Encoder(Charset cs) {
-            super(cs, ms950, c2bBmp, null);
-        }
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/MS950_HKSCS_XP.java.template	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2002, 2010, 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 $PACKAGE$;
+
+import java.nio.charset.Charset;
+import java.nio.charset.CharsetDecoder;
+import java.nio.charset.CharsetEncoder;
+import sun.nio.cs.DoubleByte;
+import sun.nio.cs.HKSCS;
+import sun.nio.cs.HistoricallyNamedCharset;
+import static sun.nio.cs.CharsetMapping.*;
+
+public class MS950_HKSCS_XP extends Charset
+{
+    public MS950_HKSCS_XP() {
+        super("x-MS950-HKSCS-XP", $ALIASES$);
+    }
+
+    public boolean contains(Charset cs) {
+        return ((cs.name().equals("US-ASCII"))
+                || (cs instanceof MS950)
+                || (cs instanceof MS950_HKSCS_XP));
+    }
+
+    public CharsetDecoder newDecoder() {
+        return new Decoder(this);
+    }
+
+    public CharsetEncoder newEncoder() {
+        return new Encoder(this);
+    }
+
+    static class Decoder extends HKSCS.Decoder {
+        private static DoubleByte.Decoder ms950 =
+            (DoubleByte.Decoder)new MS950().newDecoder();
+
+        /*
+         * Note current decoder decodes 0x8BC2 --> U+F53A
+         * ie. maps to Unicode PUA.
+         * Unaccounted discrepancy between this mapping
+         * inferred from MS950/windows-950 and the published
+         * MS HKSCS mappings which maps 0x8BC2 --> U+5C22
+         * a character defined with the Unified CJK block
+         */
+        private static char[][] b2cBmp = new char[0x100][];
+        static {
+            initb2c(b2cBmp, HKSCS_XPMapping.b2cBmpStr);
+        }
+
+        public char decodeDoubleEx(int b1, int b2) {
+            return UNMAPPABLE_DECODING;
+        }
+
+        private Decoder(Charset cs) {
+            super(cs, ms950, b2cBmp, null);
+        }
+    }
+
+    private static class Encoder extends HKSCS.Encoder {
+        private static DoubleByte.Encoder ms950 =
+            (DoubleByte.Encoder)new MS950().newEncoder();
+
+        /*
+         * Note current encoder encodes U+F53A --> 0x8BC2
+         * Published MS HKSCS mappings show
+         * U+5C22 <--> 0x8BC2
+         */
+        static char[][] c2bBmp = new char[0x100][];
+        static {
+            initc2b(c2bBmp, HKSCS_XPMapping.b2cBmpStr, null);
+        }
+
+        public int encodeSupp(int cp) {
+            return UNMAPPABLE_ENCODING;
+        }
+
+        private Encoder(Charset cs) {
+            super(cs, ms950, c2bBmp, null);
+        }
+    }
+}
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/MSISO2022JP.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/MSISO2022JP.java	Mon Feb 23 05:01:11 2015 -0800
@@ -28,6 +28,7 @@
 import java.nio.charset.Charset;
 import java.nio.charset.CharsetDecoder;
 import java.nio.charset.CharsetEncoder;
+import sun.nio.cs.DoubleByte;
 
 public class MSISO2022JP extends ISO2022_JP
 {
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/SJIS_0213.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/SJIS_0213.java	Mon Feb 23 05:01:11 2015 -0800
@@ -35,6 +35,7 @@
 import java.security.PrivilegedAction;
 import java.util.Arrays;
 import sun.nio.cs.CharsetMapping;
+import sun.nio.cs.*;
 
 /*
  *  5 types of entry in SJIS_X_0213/Unicode mapping table
--- a/jdk/src/jdk.crypto.ec/share/classes/sun/security/ec/ECDSASignature.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/jdk.crypto.ec/share/classes/sun/security/ec/ECDSASignature.java	Mon Feb 23 05:01: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
@@ -45,6 +45,12 @@
  *   . "SHA256withECDSA"
  *   . "SHA384withECDSA"
  *   . "SHA512withECDSA"
+ *   . "NONEwithECDSAinP1363Format"
+ *   . "SHA1withECDSAinP1363Format"
+ *   . "SHA224withECDSAinP1363Format"
+ *   . "SHA256withECDSAinP1363Format"
+ *   . "SHA384withECDSAinP1363Format"
+ *   . "SHA512withECDSAinP1363Format"
  *
  * @since   1.7
  */
@@ -65,29 +71,56 @@
     // public key, if initialized for verifying
     private ECPublicKey publicKey;
 
+    // The format. true for the IEEE P1363 format. false (default) for ASN.1
+    private final boolean p1363Format;
+
     /**
-     * Constructs a new ECDSASignature. Used by Raw subclass.
+     * Constructs a new ECDSASignature.
      *
      * @exception ProviderException if the native ECC library is unavailable.
      */
     ECDSASignature() {
-        messageDigest = null;
+        this(false);
+    }
+
+    /**
+     * Constructs a new ECDSASignature 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 be used. This constructor is
+     * used by the RawECDSA subclasses.
+     */
+    ECDSASignature(boolean p1363Format) {
+        this.messageDigest = null;
+        this.p1363Format = p1363Format;
     }
 
     /**
      * Constructs a new ECDSASignature. Used by subclasses.
      */
     ECDSASignature(String digestName) {
+        this(digestName, false);
+    }
+
+    /**
+     * Constructs a new ECDSASignature that will use the specified
+     * digest and 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 be used. This
+     * constructor is used by subclasses.
+     */
+    ECDSASignature(String digestName, boolean p1363Format) {
         try {
             messageDigest = MessageDigest.getInstance(digestName);
         } catch (NoSuchAlgorithmException e) {
             throw new ProviderException(e);
         }
-        needsReset = false;
+        this.needsReset = false;
+        this.p1363Format = p1363Format;
     }
 
-    // Nested class for NONEwithECDSA signatures
-    public static final class Raw extends ECDSASignature {
+    // Class for Raw ECDSA signatures.
+    static class RawECDSA extends ECDSASignature {
 
         // the longest supported digest is 512 bits (SHA-512)
         private static final int RAW_ECDSA_MAX = 64;
@@ -95,7 +128,8 @@
         private final byte[] precomputedDigest;
         private int offset = 0;
 
-        public Raw() {
+        RawECDSA(boolean p1363Format) {
+            super(p1363Format);
             precomputedDigest = new byte[RAW_ECDSA_MAX];
         }
 
@@ -156,6 +190,20 @@
         }
     }
 
+    // Nested class for NONEwithECDSA signatures
+    public static final class Raw extends RawECDSA {
+        public Raw() {
+            super(false);
+        }
+    }
+
+    // Nested class for NONEwithECDSAinP1363Format signatures
+    public static final class RawinP1363Format extends RawECDSA {
+        public RawinP1363Format() {
+            super(true);
+        }
+    }
+
     // Nested class for SHA1withECDSA signatures
     public static final class SHA1 extends ECDSASignature {
         public SHA1() {
@@ -163,6 +211,13 @@
         }
     }
 
+    // Nested class for SHA1withECDSAinP1363Format signatures
+    public static final class SHA1inP1363Format extends ECDSASignature {
+        public SHA1inP1363Format() {
+            super("SHA1", true);
+        }
+    }
+
     // Nested class for SHA224withECDSA signatures
     public static final class SHA224 extends ECDSASignature {
         public SHA224() {
@@ -170,6 +225,13 @@
         }
     }
 
+    // Nested class for SHA224withECDSAinP1363Format signatures
+    public static final class SHA224inP1363Format extends ECDSASignature {
+        public SHA224inP1363Format() {
+           super("SHA-224", true);
+        }
+    }
+
     // Nested class for SHA256withECDSA signatures
     public static final class SHA256 extends ECDSASignature {
         public SHA256() {
@@ -177,6 +239,13 @@
         }
     }
 
+    // Nested class for SHA256withECDSAinP1363Format signatures
+    public static final class SHA256inP1363Format extends ECDSASignature {
+        public SHA256inP1363Format() {
+            super("SHA-256", true);
+        }
+    }
+
     // Nested class for SHA384withECDSA signatures
     public static final class SHA384 extends ECDSASignature {
         public SHA384() {
@@ -184,6 +253,13 @@
         }
     }
 
+    // Nested class for SHA384withECDSAinP1363Format signatures
+    public static final class SHA384inP1363Format extends ECDSASignature {
+        public SHA384inP1363Format() {
+            super("SHA-384", true);
+        }
+    }
+
     // Nested class for SHA512withECDSA signatures
     public static final class SHA512 extends ECDSASignature {
         public SHA512() {
@@ -191,6 +267,13 @@
         }
     }
 
+    // Nested class for SHA512withECDSAinP1363Format signatures
+    public static final class SHA512inP1363Format extends ECDSASignature {
+        public SHA512inP1363Format() {
+            super("SHA-512", true);
+        }
+    }
+
     // initialize for verification. See JCA doc
     @Override
     protected void engineInitVerify(PublicKey publicKey)
@@ -286,14 +369,18 @@
         }
         random.nextBytes(seed);
 
+        byte[] sig;
         try {
-
-            return encodeSignature(
-                signDigest(getDigestValue(), s, encodedParams, seed));
-
+            sig = signDigest(getDigestValue(), s, encodedParams, seed);
         } catch (GeneralSecurityException e) {
             throw new SignatureException("Could not sign data", e);
         }
+
+        if (p1363Format) {
+            return sig;
+        } else {
+            return encodeSignature(sig);
+        }
     }
 
     // verify the data and return the result. See JCA doc
@@ -311,11 +398,15 @@
             w = ECUtil.encodePoint(publicKey.getW(), params.getCurve());
         }
 
-        try {
+        byte[] sig;
+        if (p1363Format) {
+            sig = signature;
+        } else {
+            sig = decodeSignature(signature);
+        }
 
-            return verifySignedDigest(
-                decodeSignature(signature), getDigestValue(), w, encodedParams);
-
+        try {
+            return verifySignedDigest(sig, getDigestValue(), w, encodedParams);
         } catch (GeneralSecurityException e) {
             throw new SignatureException("Could not verify signature", e);
         }
--- a/jdk/src/jdk.crypto.ec/share/classes/sun/security/ec/SunECEntries.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/jdk.crypto.ec/share/classes/sun/security/ec/SunECEntries.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2014, 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
@@ -131,6 +131,19 @@
         map.put("Alg.Alias.Signature.OID.1.2.840.10045.4.3.4", "SHA512withECDSA");
         map.put("Alg.Alias.Signature.1.2.840.10045.4.3.4", "SHA512withECDSA");
 
+        map.put("Signature.NONEwithECDSAinP1363Format",
+            "sun.security.ec.ECDSASignature$RawinP1363Format");
+        map.put("Signature.SHA1withECDSAinP1363Format",
+            "sun.security.ec.ECDSASignature$SHA1inP1363Format");
+        map.put("Signature.SHA224withECDSAinP1363Format",
+            "sun.security.ec.ECDSASignature$SHA224inP1363Format");
+        map.put("Signature.SHA256withECDSAinP1363Format",
+            "sun.security.ec.ECDSASignature$SHA256inP1363Format");
+        map.put("Signature.SHA384withECDSAinP1363Format",
+            "sun.security.ec.ECDSASignature$SHA384inP1363Format");
+        map.put("Signature.SHA512withECDSAinP1363Format",
+            "sun.security.ec.ECDSASignature$SHA512inP1363Format");
+
         String ecKeyClasses = "java.security.interfaces.ECPublicKey" +
                 "|java.security.interfaces.ECPrivateKey";
         map.put("Signature.NONEwithECDSA SupportedKeyClasses", ecKeyClasses);
--- a/jdk/src/jdk.crypto.pkcs11/share/classes/sun/security/pkcs11/P11Signature.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/jdk.crypto.pkcs11/share/classes/sun/security/pkcs11/P11Signature.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -50,6 +50,8 @@
  * . DSA
  *   . NONEwithDSA (RawDSA)
  *   . SHA1withDSA
+ *   . NONEwithDSAinP1363Format (RawDSAinP1363Format)
+ *   . SHA1withDSAinP1363Format
  * . RSA:
  *   . MD2withRSA
  *   . MD5withRSA
@@ -65,6 +67,12 @@
  *   . SHA256withECDSA
  *   . SHA384withECDSA
  *   . SHA512withECDSA
+ *   . NONEwithECDSAinP1363Format
+ *   . SHA1withECDSAinP1363Format
+ *   . SHA224withECDSAinP1363Format
+ *   . SHA256withECDSAinP1363Format
+ *   . SHA384withECDSAinP1363Format
+ *   . SHA512withECDSAinP1363Format
  *
  * Note that the underlying PKCS#11 token may support complete signature
  * algorithm (e.g. CKM_DSA_SHA1, CKM_MD5_RSA_PKCS), or it may just
@@ -117,6 +125,12 @@
     // total number of bytes processed in current operation
     private int bytesProcessed;
 
+    // The format, to be used for DSA and ECDSA signatures.
+    // If true, the IEEE P1363 format will be used, the concatenation of
+    // r and s. If false (default), the signature will be formatted as a
+    // DER-encoded ASN.1 sequence of r and s.
+    private boolean p1363Format = false;
+
     // constant for signing mode
     private final static int M_SIGN   = 1;
     // constant for verification mode
@@ -166,10 +180,12 @@
             break;
         case (int)CKM_DSA:
             keyAlgorithm = "DSA";
-            if (algorithm.equals("DSA")) {
+            if (algorithm.equals("DSA") ||
+                algorithm.equals("DSAinP1363Format")) {
                 type = T_DIGEST;
                 md = MessageDigest.getInstance("SHA-1");
-            } else if (algorithm.equals("RawDSA")) {
+            } else if (algorithm.equals("RawDSA") ||
+                       algorithm.equals("RawDSAinP1363Format")) {
                 type = T_RAW;
                 buffer = new byte[20];
             } else {
@@ -178,20 +194,26 @@
             break;
         case (int)CKM_ECDSA:
             keyAlgorithm = "EC";
-            if (algorithm.equals("NONEwithECDSA")) {
+            if (algorithm.equals("NONEwithECDSA") ||
+                algorithm.equals("NONEwithECDSAinP1363Format")) {
                 type = T_RAW;
                 buffer = new byte[RAW_ECDSA_MAX];
             } else {
                 String digestAlg;
-                if (algorithm.equals("SHA1withECDSA")) {
+                if (algorithm.equals("SHA1withECDSA") ||
+                    algorithm.equals("SHA1withECDSAinP1363Format")) {
                     digestAlg = "SHA-1";
-                } else if (algorithm.equals("SHA224withECDSA")) {
+                } else if (algorithm.equals("SHA224withECDSA") ||
+                           algorithm.equals("SHA224withECDSAinP1363Format")) {
                     digestAlg = "SHA-224";
-                } else if (algorithm.equals("SHA256withECDSA")) {
+                } else if (algorithm.equals("SHA256withECDSA") ||
+                           algorithm.equals("SHA256withECDSAinP1363Format")) {
                     digestAlg = "SHA-256";
-                } else if (algorithm.equals("SHA384withECDSA")) {
+                } else if (algorithm.equals("SHA384withECDSA") ||
+                           algorithm.equals("SHA384withECDSAinP1363Format")) {
                     digestAlg = "SHA-384";
-                } else if (algorithm.equals("SHA512withECDSA")) {
+                } else if (algorithm.equals("SHA512withECDSA") ||
+                           algorithm.equals("SHA512withECDSAinP1363Format")) {
                     digestAlg = "SHA-512";
                 } else {
                     throw new ProviderException(algorithm);
@@ -235,6 +257,9 @@
         this.buffer = buffer;
         this.digestOID = digestOID;
         this.md = md;
+        if (algorithm.endsWith("inP1363Format")) {
+            this.p1363Format = true;
+        }
     }
 
     private void ensureInitialized() {
@@ -582,10 +607,14 @@
                     signature = token.p11.C_Sign(session.id(), data);
                 }
             }
-            if (keyAlgorithm.equals("RSA") == false) {
-                return dsaToASN1(signature);
+            if (keyAlgorithm.equals("RSA")) {
+                return signature;
             } else {
-                return signature;
+                if (p1363Format) {
+                    return signature;
+                } else {
+                    return dsaToASN1(signature);
+                }
             }
         } catch (PKCS11Exception e) {
             throw new ProviderException(e);
@@ -599,10 +628,12 @@
     protected boolean engineVerify(byte[] signature) throws SignatureException {
         ensureInitialized();
         try {
-            if (keyAlgorithm.equals("DSA")) {
-                signature = asn1ToDSA(signature);
-            } else if (keyAlgorithm.equals("EC")) {
-                signature = asn1ToECDSA(signature);
+            if (!p1363Format) {
+                if (keyAlgorithm.equals("DSA")) {
+                    signature = asn1ToDSA(signature);
+                } else if (keyAlgorithm.equals("EC")) {
+                    signature = asn1ToECDSA(signature);
+                }
             }
             if (type == T_UPDATE) {
                 token.p11.C_VerifyFinal(session.id(), signature);
--- a/jdk/src/jdk.crypto.pkcs11/share/classes/sun/security/pkcs11/SunPKCS11.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/jdk.crypto.pkcs11/share/classes/sun/security/pkcs11/SunPKCS11.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -680,6 +680,12 @@
                 s("SHA1withDSA", "1.3.14.3.2.13", "1.3.14.3.2.27",
                   "1.2.840.10040.4.3", "OID.1.2.840.10040.4.3"),
                 m(CKM_DSA_SHA1, CKM_DSA));
+        d(SIG, "RawDSAinP1363Format",   P11Signature,
+                s("NONEwithDSAinP1363Format"),
+                m(CKM_DSA));
+        d(SIG, "DSAinP1363Format",      P11Signature,
+                s("SHA1withDSAinP1363Format"),
+                m(CKM_DSA_SHA1, CKM_DSA));
         d(SIG, "NONEwithECDSA", P11Signature,
                 m(CKM_ECDSA));
         d(SIG, "SHA1withECDSA", P11Signature,
@@ -697,6 +703,18 @@
         d(SIG, "SHA512withECDSA",       P11Signature,
                 s("1.2.840.10045.4.3.4", "OID.1.2.840.10045.4.3.4"),
                 m(CKM_ECDSA));
+        d(SIG, "NONEwithECDSAinP1363Format",   P11Signature,
+                m(CKM_ECDSA));
+        d(SIG, "SHA1withECDSAinP1363Format",   P11Signature,
+                m(CKM_ECDSA_SHA1, CKM_ECDSA));
+        d(SIG, "SHA224withECDSAinP1363Format", P11Signature,
+                m(CKM_ECDSA));
+        d(SIG, "SHA256withECDSAinP1363Format", P11Signature,
+                m(CKM_ECDSA));
+        d(SIG, "SHA384withECDSAinP1363Format", P11Signature,
+                m(CKM_ECDSA));
+        d(SIG, "SHA512withECDSAinP1363Format", P11Signature,
+                m(CKM_ECDSA));
         d(SIG, "MD2withRSA",    P11Signature,
                 s("1.2.840.113549.1.1.2", "OID.1.2.840.113549.1.1.2"),
                 m(CKM_MD2_RSA_PKCS, CKM_RSA_PKCS, CKM_RSA_X_509));
@@ -1061,7 +1079,7 @@
             }
             // EC
             if (((type == KA) && algorithm.equals("ECDH"))
-                    || ((type == SIG) && algorithm.endsWith("ECDSA"))) {
+                    || ((type == SIG) && algorithm.contains("ECDSA"))) {
                 if (keyAlgorithm.equals("EC") == false) {
                     return false;
                 }
@@ -1070,7 +1088,8 @@
                         || (key instanceof ECPublicKey);
             }
             // DSA signatures
-            if ((type == SIG) && algorithm.endsWith("DSA")) {
+            if ((type == SIG) && algorithm.contains("DSA") &&
+                    !algorithm.contains("ECDSA")) {
                 if (keyAlgorithm.equals("DSA") == false) {
                     return false;
                 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/PolicyTool.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,4554 @@
+/*
+ * Copyright (c) 1997, 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.security.tools.policytool;
+
+import java.io.*;
+import java.util.LinkedList;
+import java.util.ListIterator;
+import java.util.Vector;
+import java.util.Enumeration;
+import java.net.URL;
+import java.net.MalformedURLException;
+import java.lang.reflect.*;
+import java.text.Collator;
+import java.text.MessageFormat;
+import sun.security.util.PropertyExpander;
+import sun.security.util.PropertyExpander.ExpandException;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.Dimension;
+import java.awt.FileDialog;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.awt.Point;
+import java.awt.Toolkit;
+import java.awt.Window;
+import java.awt.event.*;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateException;
+import java.security.*;
+import sun.security.provider.*;
+import sun.security.util.PolicyUtil;
+import javax.security.auth.x500.X500Principal;
+import javax.swing.*;
+import javax.swing.border.EmptyBorder;
+
+/**
+ * PolicyTool may be used by users and administrators to configure the
+ * overall java security policy (currently stored in the policy file).
+ * Using PolicyTool administrators may add and remove policies from
+ * the policy file. <p>
+ *
+ * @see java.security.Policy
+ * @since   1.2
+ */
+
+public class PolicyTool {
+
+    // for i18n
+    static final java.util.ResourceBundle rb =
+        java.util.ResourceBundle.getBundle(
+            "sun.security.tools.policytool.Resources");
+    static final Collator collator = Collator.getInstance();
+    static {
+        // this is for case insensitive string comparisons
+        collator.setStrength(Collator.PRIMARY);
+
+        // Support for Apple menu bar
+        if (System.getProperty("apple.laf.useScreenMenuBar") == null) {
+            System.setProperty("apple.laf.useScreenMenuBar", "true");
+        }
+        System.setProperty("apple.awt.application.name", getMessage("Policy.Tool"));
+
+        // Apply the system L&F if not specified with a system property.
+        if (System.getProperty("swing.defaultlaf") == null) {
+            try {
+                UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+            } catch (Exception e) {
+                // ignore
+            }
+        }
+    }
+
+    // anyone can add warnings
+    Vector<String> warnings;
+    boolean newWarning = false;
+
+    // set to true if policy modified.
+    // this way upon exit we know if to ask the user to save changes
+    boolean modified = false;
+
+    private static final boolean testing = false;
+    private static final Class<?>[] TWOPARAMS = { String.class, String.class };
+    private static final Class<?>[] ONEPARAMS = { String.class };
+    private static final Class<?>[] NOPARAMS  = {};
+    /*
+     * All of the policy entries are read in from the
+     * policy file and stored here.  Updates to the policy entries
+     * using addEntry() and removeEntry() are made here.  To ultimately save
+     * the policy entries back to the policy file, the SavePolicy button
+     * must be clicked.
+     **/
+    private static String policyFileName = null;
+    private Vector<PolicyEntry> policyEntries = null;
+    private PolicyParser parser = null;
+
+    /* The public key alias information is stored here.  */
+    private KeyStore keyStore = null;
+    private String keyStoreName = " ";
+    private String keyStoreType = " ";
+    private String keyStoreProvider = " ";
+    private String keyStorePwdURL = " ";
+
+    /* standard PKCS11 KeyStore type */
+    private static final String P11KEYSTORE = "PKCS11";
+
+    /* reserved word for PKCS11 KeyStores */
+    private static final String NONE = "NONE";
+
+    /**
+     * default constructor
+     */
+    private PolicyTool() {
+        policyEntries = new Vector<PolicyEntry>();
+        parser = new PolicyParser();
+        warnings = new Vector<String>();
+    }
+
+    /**
+     * get the PolicyFileName
+     */
+    String getPolicyFileName() {
+        return policyFileName;
+    }
+
+    /**
+     * set the PolicyFileName
+     */
+    void setPolicyFileName(String policyFileName) {
+        PolicyTool.policyFileName = policyFileName;
+    }
+
+   /**
+    * clear keyStore info
+    */
+    void clearKeyStoreInfo() {
+        this.keyStoreName = null;
+        this.keyStoreType = null;
+        this.keyStoreProvider = null;
+        this.keyStorePwdURL = null;
+
+        this.keyStore = null;
+    }
+
+    /**
+     * get the keyStore URL name
+     */
+    String getKeyStoreName() {
+        return keyStoreName;
+    }
+
+    /**
+     * get the keyStore Type
+     */
+    String getKeyStoreType() {
+        return keyStoreType;
+    }
+
+    /**
+     * get the keyStore Provider
+     */
+    String getKeyStoreProvider() {
+        return keyStoreProvider;
+    }
+
+    /**
+     * get the keyStore password URL
+     */
+    String getKeyStorePwdURL() {
+        return keyStorePwdURL;
+    }
+
+    /**
+     * Open and read a policy file
+     */
+    void openPolicy(String filename) throws FileNotFoundException,
+                                        PolicyParser.ParsingException,
+                                        KeyStoreException,
+                                        CertificateException,
+                                        InstantiationException,
+                                        MalformedURLException,
+                                        IOException,
+                                        NoSuchAlgorithmException,
+                                        IllegalAccessException,
+                                        NoSuchMethodException,
+                                        UnrecoverableKeyException,
+                                        NoSuchProviderException,
+                                        ClassNotFoundException,
+                                        PropertyExpander.ExpandException,
+                                        InvocationTargetException {
+
+        newWarning = false;
+
+        // start fresh - blow away the current state
+        policyEntries = new Vector<PolicyEntry>();
+        parser = new PolicyParser();
+        warnings = new Vector<String>();
+        setPolicyFileName(null);
+        clearKeyStoreInfo();
+
+        // see if user is opening a NEW policy file
+        if (filename == null) {
+            modified = false;
+            return;
+        }
+
+        // Read in the policy entries from the file and
+        // populate the parser vector table.  The parser vector
+        // table only holds the entries as strings, so it only
+        // guarantees that the policies are syntactically
+        // correct.
+        setPolicyFileName(filename);
+        parser.read(new FileReader(filename));
+
+        // open the keystore
+        openKeyStore(parser.getKeyStoreUrl(), parser.getKeyStoreType(),
+                parser.getKeyStoreProvider(), parser.getStorePassURL());
+
+        // Update the local vector with the same policy entries.
+        // This guarantees that the policy entries are not only
+        // syntactically correct, but semantically valid as well.
+        Enumeration<PolicyParser.GrantEntry> enum_ = parser.grantElements();
+        while (enum_.hasMoreElements()) {
+            PolicyParser.GrantEntry ge = enum_.nextElement();
+
+            // see if all the signers have public keys
+            if (ge.signedBy != null) {
+
+                String signers[] = parseSigners(ge.signedBy);
+                for (int i = 0; i < signers.length; i++) {
+                    PublicKey pubKey = getPublicKeyAlias(signers[i]);
+                    if (pubKey == null) {
+                        newWarning = true;
+                        MessageFormat form = new MessageFormat(getMessage
+                            ("Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured."));
+                        Object[] source = {signers[i]};
+                        warnings.addElement(form.format(source));
+                    }
+                }
+            }
+
+            // check to see if the Principals are valid
+            ListIterator<PolicyParser.PrincipalEntry> prinList =
+                                                ge.principals.listIterator(0);
+            while (prinList.hasNext()) {
+                PolicyParser.PrincipalEntry pe = prinList.next();
+                try {
+                    verifyPrincipal(pe.getPrincipalClass(),
+                                pe.getPrincipalName());
+                } catch (ClassNotFoundException fnfe) {
+                    newWarning = true;
+                    MessageFormat form = new MessageFormat(getMessage
+                                ("Warning.Class.not.found.class"));
+                    Object[] source = {pe.getPrincipalClass()};
+                    warnings.addElement(form.format(source));
+                }
+            }
+
+            // check to see if the Permissions are valid
+            Enumeration<PolicyParser.PermissionEntry> perms =
+                                                ge.permissionElements();
+            while (perms.hasMoreElements()) {
+                PolicyParser.PermissionEntry pe = perms.nextElement();
+                try {
+                    verifyPermission(pe.permission, pe.name, pe.action);
+                } catch (ClassNotFoundException fnfe) {
+                    newWarning = true;
+                    MessageFormat form = new MessageFormat(getMessage
+                                ("Warning.Class.not.found.class"));
+                    Object[] source = {pe.permission};
+                    warnings.addElement(form.format(source));
+                } catch (InvocationTargetException ite) {
+                    newWarning = true;
+                    MessageFormat form = new MessageFormat(getMessage
+                        ("Warning.Invalid.argument.s.for.constructor.arg"));
+                    Object[] source = {pe.permission};
+                    warnings.addElement(form.format(source));
+                }
+
+                // see if all the permission signers have public keys
+                if (pe.signedBy != null) {
+
+                    String signers[] = parseSigners(pe.signedBy);
+
+                    for (int i = 0; i < signers.length; i++) {
+                        PublicKey pubKey = getPublicKeyAlias(signers[i]);
+                        if (pubKey == null) {
+                            newWarning = true;
+                            MessageFormat form = new MessageFormat(getMessage
+                                ("Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured."));
+                            Object[] source = {signers[i]};
+                            warnings.addElement(form.format(source));
+                        }
+                    }
+                }
+            }
+            PolicyEntry pEntry = new PolicyEntry(this, ge);
+            policyEntries.addElement(pEntry);
+        }
+
+        // just read in the policy -- nothing has been modified yet
+        modified = false;
+    }
+
+
+    /**
+     * Save a policy to a file
+     */
+    void savePolicy(String filename)
+    throws FileNotFoundException, IOException {
+        // save the policy entries to a file
+        parser.setKeyStoreUrl(keyStoreName);
+        parser.setKeyStoreType(keyStoreType);
+        parser.setKeyStoreProvider(keyStoreProvider);
+        parser.setStorePassURL(keyStorePwdURL);
+        parser.write(new FileWriter(filename));
+        modified = false;
+    }
+
+    /**
+     * Open the KeyStore
+     */
+    void openKeyStore(String name,
+                String type,
+                String provider,
+                String pwdURL) throws   KeyStoreException,
+                                        NoSuchAlgorithmException,
+                                        UnrecoverableKeyException,
+                                        IOException,
+                                        CertificateException,
+                                        NoSuchProviderException,
+                                        ExpandException {
+
+        if (name == null && type == null &&
+            provider == null && pwdURL == null) {
+
+            // policy did not specify a keystore during open
+            // or use wants to reset keystore values
+
+            this.keyStoreName = null;
+            this.keyStoreType = null;
+            this.keyStoreProvider = null;
+            this.keyStorePwdURL = null;
+
+            // caller will set (tool.modified = true) if appropriate
+
+            return;
+        }
+
+        URL policyURL = null;
+        if (policyFileName != null) {
+            File pfile = new File(policyFileName);
+            policyURL = new URL("file:" + pfile.getCanonicalPath());
+        }
+
+        // although PolicyUtil.getKeyStore may properly handle
+        // defaults and property expansion, we do it here so that
+        // if the call is successful, we can set the proper values
+        // (PolicyUtil.getKeyStore does not return expanded values)
+
+        if (name != null && name.length() > 0) {
+            name = PropertyExpander.expand(name).replace
+                                        (File.separatorChar, '/');
+        }
+        if (type == null || type.length() == 0) {
+            type = KeyStore.getDefaultType();
+        }
+        if (pwdURL != null && pwdURL.length() > 0) {
+            pwdURL = PropertyExpander.expand(pwdURL).replace
+                                        (File.separatorChar, '/');
+        }
+
+        try {
+            this.keyStore = PolicyUtil.getKeyStore(policyURL,
+                                                name,
+                                                type,
+                                                provider,
+                                                pwdURL,
+                                                null);
+        } catch (IOException ioe) {
+
+            // copied from sun.security.pkcs11.SunPKCS11
+            String MSG = "no password provided, and no callback handler " +
+                        "available for retrieving password";
+
+            Throwable cause = ioe.getCause();
+            if (cause != null &&
+                cause instanceof javax.security.auth.login.LoginException &&
+                MSG.equals(cause.getMessage())) {
+
+                // throw a more friendly exception message
+                throw new IOException(MSG);
+            } else {
+                throw ioe;
+            }
+        }
+
+        this.keyStoreName = name;
+        this.keyStoreType = type;
+        this.keyStoreProvider = provider;
+        this.keyStorePwdURL = pwdURL;
+
+        // caller will set (tool.modified = true)
+    }
+
+    /**
+     * Add a Grant entry to the overall policy at the specified index.
+     * A policy entry consists of a CodeSource.
+     */
+    boolean addEntry(PolicyEntry pe, int index) {
+
+        if (index < 0) {
+            // new entry -- just add it to the end
+            policyEntries.addElement(pe);
+            parser.add(pe.getGrantEntry());
+        } else {
+            // existing entry -- replace old one
+            PolicyEntry origPe = policyEntries.elementAt(index);
+            parser.replace(origPe.getGrantEntry(), pe.getGrantEntry());
+            policyEntries.setElementAt(pe, index);
+        }
+        return true;
+    }
+
+    /**
+     * Add a Principal entry to an existing PolicyEntry at the specified index.
+     * A Principal entry consists of a class, and name.
+     *
+     * If the principal already exists, it is not added again.
+     */
+    boolean addPrinEntry(PolicyEntry pe,
+                        PolicyParser.PrincipalEntry newPrin,
+                        int index) {
+
+        // first add the principal to the Policy Parser entry
+        PolicyParser.GrantEntry grantEntry = pe.getGrantEntry();
+        if (grantEntry.contains(newPrin) == true)
+            return false;
+
+        LinkedList<PolicyParser.PrincipalEntry> prinList =
+                                                grantEntry.principals;
+        if (index != -1)
+            prinList.set(index, newPrin);
+        else
+            prinList.add(newPrin);
+
+        modified = true;
+        return true;
+    }
+
+    /**
+     * Add a Permission entry to an existing PolicyEntry at the specified index.
+     * A Permission entry consists of a permission, name, and actions.
+     *
+     * If the permission already exists, it is not added again.
+     */
+    boolean addPermEntry(PolicyEntry pe,
+                        PolicyParser.PermissionEntry newPerm,
+                        int index) {
+
+        // first add the permission to the Policy Parser Vector
+        PolicyParser.GrantEntry grantEntry = pe.getGrantEntry();
+        if (grantEntry.contains(newPerm) == true)
+            return false;
+
+        Vector<PolicyParser.PermissionEntry> permList =
+                                                grantEntry.permissionEntries;
+        if (index != -1)
+            permList.setElementAt(newPerm, index);
+        else
+            permList.addElement(newPerm);
+
+        modified = true;
+        return true;
+    }
+
+    /**
+     * Remove a Permission entry from an existing PolicyEntry.
+     */
+    boolean removePermEntry(PolicyEntry pe,
+                        PolicyParser.PermissionEntry perm) {
+
+        // remove the Permission from the GrantEntry
+        PolicyParser.GrantEntry ppge = pe.getGrantEntry();
+        modified = ppge.remove(perm);
+        return modified;
+    }
+
+    /**
+     * remove an entry from the overall policy
+     */
+    boolean removeEntry(PolicyEntry pe) {
+
+        parser.remove(pe.getGrantEntry());
+        modified = true;
+        return (policyEntries.removeElement(pe));
+    }
+
+    /**
+     * retrieve all Policy Entries
+     */
+    PolicyEntry[] getEntry() {
+
+        if (policyEntries.size() > 0) {
+            PolicyEntry entries[] = new PolicyEntry[policyEntries.size()];
+            for (int i = 0; i < policyEntries.size(); i++)
+                entries[i] = policyEntries.elementAt(i);
+            return entries;
+        }
+        return null;
+    }
+
+    /**
+     * Retrieve the public key mapped to a particular name.
+     * If the key has expired, a KeyException is thrown.
+     */
+    PublicKey getPublicKeyAlias(String name) throws KeyStoreException {
+        if (keyStore == null) {
+            return null;
+        }
+
+        Certificate cert = keyStore.getCertificate(name);
+        if (cert == null) {
+            return null;
+        }
+        PublicKey pubKey = cert.getPublicKey();
+        return pubKey;
+    }
+
+    /**
+     * Retrieve all the alias names stored in the certificate database
+     */
+    String[] getPublicKeyAlias() throws KeyStoreException {
+
+        int numAliases = 0;
+        String aliases[] = null;
+
+        if (keyStore == null) {
+            return null;
+        }
+        Enumeration<String> enum_ = keyStore.aliases();
+
+        // first count the number of elements
+        while (enum_.hasMoreElements()) {
+            enum_.nextElement();
+            numAliases++;
+        }
+
+        if (numAliases > 0) {
+            // now copy them into an array
+            aliases = new String[numAliases];
+            numAliases = 0;
+            enum_ = keyStore.aliases();
+            while (enum_.hasMoreElements()) {
+                aliases[numAliases] = new String(enum_.nextElement());
+                numAliases++;
+            }
+        }
+        return aliases;
+    }
+
+    /**
+     * This method parses a single string of signers separated by commas
+     * ("jordan, duke, pippen") into an array of individual strings.
+     */
+    String[] parseSigners(String signedBy) {
+
+        String signers[] = null;
+        int numSigners = 1;
+        int signedByIndex = 0;
+        int commaIndex = 0;
+        int signerNum = 0;
+
+        // first pass thru "signedBy" counts the number of signers
+        while (commaIndex >= 0) {
+            commaIndex = signedBy.indexOf(',', signedByIndex);
+            if (commaIndex >= 0) {
+                numSigners++;
+                signedByIndex = commaIndex + 1;
+            }
+        }
+        signers = new String[numSigners];
+
+        // second pass thru "signedBy" transfers signers to array
+        commaIndex = 0;
+        signedByIndex = 0;
+        while (commaIndex >= 0) {
+            if ((commaIndex = signedBy.indexOf(',', signedByIndex)) >= 0) {
+                // transfer signer and ignore trailing part of the string
+                signers[signerNum] =
+                        signedBy.substring(signedByIndex, commaIndex).trim();
+                signerNum++;
+                signedByIndex = commaIndex + 1;
+            } else {
+                // we are at the end of the string -- transfer signer
+                signers[signerNum] = signedBy.substring(signedByIndex).trim();
+            }
+        }
+        return signers;
+    }
+
+    /**
+     * Check to see if the Principal contents are OK
+     */
+    void verifyPrincipal(String type, String name)
+        throws ClassNotFoundException,
+               InstantiationException
+    {
+        if (type.equals(PolicyParser.PrincipalEntry.WILDCARD_CLASS) ||
+            type.equals(PolicyParser.PrincipalEntry.REPLACE_NAME)) {
+            return;
+        }
+        Class<?> PRIN = Class.forName("java.security.Principal");
+        Class<?> pc = Class.forName(type, true,
+                Thread.currentThread().getContextClassLoader());
+        if (!PRIN.isAssignableFrom(pc)) {
+            MessageFormat form = new MessageFormat(getMessage
+                        ("Illegal.Principal.Type.type"));
+            Object[] source = {type};
+            throw new InstantiationException(form.format(source));
+        }
+
+        if (ToolDialog.X500_PRIN_CLASS.equals(pc.getName())) {
+            // PolicyParser checks validity of X500Principal name
+            // - PolicyTool needs to as well so that it doesn't store
+            //   an invalid name that can't be read in later
+            //
+            // this can throw an IllegalArgumentException
+            X500Principal newP = new X500Principal(name);
+        }
+    }
+
+    /**
+     * Check to see if the Permission contents are OK
+     */
+    @SuppressWarnings("fallthrough")
+    void verifyPermission(String type,
+                                    String name,
+                                    String actions)
+        throws ClassNotFoundException,
+               InstantiationException,
+               IllegalAccessException,
+               NoSuchMethodException,
+               InvocationTargetException
+    {
+
+        //XXX we might want to keep a hash of created factories...
+        Class<?> pc = Class.forName(type, true,
+                Thread.currentThread().getContextClassLoader());
+        Constructor<?> c = null;
+        Vector<String> objects = new Vector<>(2);
+        if (name != null) objects.add(name);
+        if (actions != null) objects.add(actions);
+        switch (objects.size()) {
+        case 0:
+            try {
+                c = pc.getConstructor(NOPARAMS);
+                break;
+            } catch (NoSuchMethodException ex) {
+                // proceed to the one-param constructor
+                objects.add(null);
+            }
+            /* fall through */
+        case 1:
+            try {
+                c = pc.getConstructor(ONEPARAMS);
+                break;
+            } catch (NoSuchMethodException ex) {
+                // proceed to the two-param constructor
+                objects.add(null);
+            }
+            /* fall through */
+        case 2:
+            c = pc.getConstructor(TWOPARAMS);
+            break;
+        }
+        Object parameters[] = objects.toArray();
+        Permission p = (Permission)c.newInstance(parameters);
+    }
+
+    /*
+     * Parse command line arguments.
+     */
+    static void parseArgs(String args[]) {
+        /* parse flags */
+        int n = 0;
+
+        for (n=0; (n < args.length) && args[n].startsWith("-"); n++) {
+
+            String flags = args[n];
+
+            if (collator.compare(flags, "-file") == 0) {
+                if (++n == args.length) usage();
+                policyFileName = args[n];
+            } else {
+                MessageFormat form = new MessageFormat(getMessage
+                                ("Illegal.option.option"));
+                Object[] source = { flags };
+                System.err.println(form.format(source));
+                usage();
+            }
+        }
+    }
+
+    static void usage() {
+        System.out.println(getMessage("Usage.policytool.options."));
+        System.out.println();
+        System.out.println(getMessage
+                (".file.file.policy.file.location"));
+        System.out.println();
+
+        System.exit(1);
+    }
+
+    /**
+     * run the PolicyTool
+     */
+    public static void main(String args[]) {
+        parseArgs(args);
+        SwingUtilities.invokeLater(new Runnable() {
+            public void run() {
+                ToolWindow tw = new ToolWindow(new PolicyTool());
+                tw.displayToolWindow(args);
+            }
+        });
+    }
+
+    // split instr to words according to capitalization,
+    // like, AWTControl -> A W T Control
+    // this method is for easy pronounciation
+    static String splitToWords(String instr) {
+        return instr.replaceAll("([A-Z])", " $1");
+    }
+
+    /**
+     * Returns the message corresponding to the key in the bundle.
+     * This is preferred over {@link #getString} because it removes
+     * any mnemonic '&' character in the string.
+     *
+     * @param key the key
+     *
+     * @return the message
+     */
+    static String getMessage(String key) {
+        return removeMnemonicAmpersand(rb.getString(key));
+    }
+
+
+    /**
+     * Returns the mnemonic for a message.
+     *
+     * @param key the key
+     *
+     * @return the mnemonic <code>int</code>
+     */
+    static int getMnemonicInt(String key) {
+        String message = rb.getString(key);
+        return (findMnemonicInt(message));
+    }
+
+    /**
+     * Returns the mnemonic display index for a message.
+     *
+     * @param key the key
+     *
+     * @return the mnemonic display index
+     */
+    static int getDisplayedMnemonicIndex(String key) {
+        String message = rb.getString(key);
+        return (findMnemonicIndex(message));
+    }
+
+    /**
+     * Finds the mnemonic character in a message.
+     *
+     * The mnemonic character is the first character followed by the first
+     * <code>&</code> that is not followed by another <code>&</code>.
+     *
+     * @return the mnemonic as an <code>int</code>, or <code>0</code> if it
+     *         can't be found.
+     */
+    private static int findMnemonicInt(String s) {
+        for (int i = 0; i < s.length() - 1; i++) {
+            if (s.charAt(i) == '&') {
+                if (s.charAt(i + 1) != '&') {
+                    return KeyEvent.getExtendedKeyCodeForChar(s.charAt(i + 1));
+                } else {
+                    i++;
+                }
+            }
+        }
+        return 0;
+    }
+
+    /**
+     * Finds the index of the mnemonic character in a message.
+     *
+     * The mnemonic character is the first character followed by the first
+     * <code>&</code> that is not followed by another <code>&</code>.
+     *
+     * @return the mnemonic character index as an <code>int</code>, or <code>-1</code> if it
+     *         can't be found.
+     */
+    private static int findMnemonicIndex(String s) {
+        for (int i = 0; i < s.length() - 1; i++) {
+            if (s.charAt(i) == '&') {
+                if (s.charAt(i + 1) != '&') {
+                    // Return the index of the '&' since it will be removed
+                    return i;
+                } else {
+                    i++;
+                }
+            }
+        }
+        return -1;
+    }
+
+    /**
+     * Removes the mnemonic identifier (<code>&</code>) from a string unless
+     * it's escaped by <code>&&</code> or placed at the end.
+     *
+     * @param message the message
+     *
+     * @return a message with the mnemonic identifier removed
+     */
+    private static String removeMnemonicAmpersand(String message) {
+        StringBuilder s = new StringBuilder();
+        for (int i = 0; i < message.length(); i++) {
+            char current = message.charAt(i);
+            if (current != '&' || i == message.length() - 1
+                    || message.charAt(i + 1) == '&') {
+                s.append(current);
+            }
+        }
+        return s.toString();
+    }
+}
+
+/**
+ * Each entry in the policy configuration file is represented by a
+ * PolicyEntry object.
+ *
+ * A PolicyEntry is a (CodeSource,Permission) pair.  The
+ * CodeSource contains the (URL, PublicKey) that together identify
+ * where the Java bytecodes come from and who (if anyone) signed
+ * them.  The URL could refer to localhost.  The URL could also be
+ * null, meaning that this policy entry is given to all comers, as
+ * long as they match the signer field.  The signer could be null,
+ * meaning the code is not signed.
+ *
+ * The Permission contains the (Type, Name, Action) triplet.
+ *
+ */
+class PolicyEntry {
+
+    private CodeSource codesource;
+    private PolicyTool tool;
+    private PolicyParser.GrantEntry grantEntry;
+    private boolean testing = false;
+
+    /**
+     * Create a PolicyEntry object from the information read in
+     * from a policy file.
+     */
+    PolicyEntry(PolicyTool tool, PolicyParser.GrantEntry ge)
+    throws MalformedURLException, NoSuchMethodException,
+    ClassNotFoundException, InstantiationException, IllegalAccessException,
+    InvocationTargetException, CertificateException,
+    IOException, NoSuchAlgorithmException, UnrecoverableKeyException {
+
+        this.tool = tool;
+
+        URL location = null;
+
+        // construct the CodeSource
+        if (ge.codeBase != null)
+            location = new URL(ge.codeBase);
+        this.codesource = new CodeSource(location,
+            (java.security.cert.Certificate[]) null);
+
+        if (testing) {
+            System.out.println("Adding Policy Entry:");
+            System.out.println("    CodeBase = " + location);
+            System.out.println("    Signers = " + ge.signedBy);
+            System.out.println("    with " + ge.principals.size() +
+                    " Principals");
+        }
+
+        this.grantEntry = ge;
+    }
+
+    /**
+     * get the codesource associated with this PolicyEntry
+     */
+    CodeSource getCodeSource() {
+        return codesource;
+    }
+
+    /**
+     * get the GrantEntry associated with this PolicyEntry
+     */
+    PolicyParser.GrantEntry getGrantEntry() {
+        return grantEntry;
+    }
+
+    /**
+     * convert the header portion, i.e. codebase, signer, principals, of
+     * this policy entry into a string
+     */
+    String headerToString() {
+        String pString = principalsToString();
+        if (pString.length() == 0) {
+            return codebaseToString();
+        } else {
+            return codebaseToString() + ", " + pString;
+        }
+    }
+
+    /**
+     * convert the Codebase/signer portion of this policy entry into a string
+     */
+    String codebaseToString() {
+
+        String stringEntry = new String();
+
+        if (grantEntry.codeBase != null &&
+            grantEntry.codeBase.equals("") == false)
+            stringEntry = stringEntry.concat
+                                ("CodeBase \"" +
+                                grantEntry.codeBase +
+                                "\"");
+
+        if (grantEntry.signedBy != null &&
+            grantEntry.signedBy.equals("") == false)
+            stringEntry = ((stringEntry.length() > 0) ?
+                stringEntry.concat(", SignedBy \"" +
+                                grantEntry.signedBy +
+                                "\"") :
+                stringEntry.concat("SignedBy \"" +
+                                grantEntry.signedBy +
+                                "\""));
+
+        if (stringEntry.length() == 0)
+            return new String("CodeBase <ALL>");
+        return stringEntry;
+    }
+
+    /**
+     * convert the Principals portion of this policy entry into a string
+     */
+    String principalsToString() {
+        String result = "";
+        if ((grantEntry.principals != null) &&
+            (!grantEntry.principals.isEmpty())) {
+            StringBuilder sb = new StringBuilder(200);
+            ListIterator<PolicyParser.PrincipalEntry> list =
+                                grantEntry.principals.listIterator();
+            while (list.hasNext()) {
+                PolicyParser.PrincipalEntry pppe = list.next();
+                sb.append(" Principal ").append(pppe.getDisplayClass())
+                        .append(' ')
+                        .append(pppe.getDisplayName(true));
+                if (list.hasNext()) sb.append(", ");
+            }
+            result = sb.toString();
+        }
+        return result;
+    }
+
+    /**
+     * convert this policy entry into a PolicyParser.PermissionEntry
+     */
+    PolicyParser.PermissionEntry toPermissionEntry(Permission perm) {
+
+        String actions = null;
+
+        // get the actions
+        if (perm.getActions() != null &&
+            perm.getActions().trim() != "")
+                actions = perm.getActions();
+
+        PolicyParser.PermissionEntry pe = new PolicyParser.PermissionEntry
+                        (perm.getClass().getName(),
+                        perm.getName(),
+                        actions);
+        return pe;
+    }
+}
+
+/**
+ * The main window for the PolicyTool
+ */
+class ToolWindow extends JFrame {
+    // use serialVersionUID from JDK 1.2.2 for interoperability
+    private static final long serialVersionUID = 5682568601210376777L;
+
+    /* ESCAPE key */
+    static final KeyStroke escKey = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0);
+
+    /* external paddings */
+    public static final Insets TOP_PADDING = new Insets(25,0,0,0);
+    public static final Insets BOTTOM_PADDING = new Insets(0,0,25,0);
+    public static final Insets LITE_BOTTOM_PADDING = new Insets(0,0,10,0);
+    public static final Insets LR_PADDING = new Insets(0,10,0,10);
+    public static final Insets TOP_BOTTOM_PADDING = new Insets(15, 0, 15, 0);
+    public static final Insets L_TOP_BOTTOM_PADDING = new Insets(5,10,15,0);
+    public static final Insets LR_TOP_BOTTOM_PADDING = new Insets(15, 4, 15, 4);
+    public static final Insets LR_BOTTOM_PADDING = new Insets(0,10,5,10);
+    public static final Insets L_BOTTOM_PADDING = new Insets(0,10,5,0);
+    public static final Insets R_BOTTOM_PADDING = new Insets(0, 0, 25, 5);
+    public static final Insets R_PADDING = new Insets(0, 0, 0, 5);
+
+    /* buttons and menus */
+    public static final String NEW_POLICY_FILE          = "New";
+    public static final String OPEN_POLICY_FILE         = "Open";
+    public static final String SAVE_POLICY_FILE         = "Save";
+    public static final String SAVE_AS_POLICY_FILE      = "Save.As";
+    public static final String VIEW_WARNINGS            = "View.Warning.Log";
+    public static final String QUIT                     = "Exit";
+    public static final String ADD_POLICY_ENTRY         = "Add.Policy.Entry";
+    public static final String EDIT_POLICY_ENTRY        = "Edit.Policy.Entry";
+    public static final String REMOVE_POLICY_ENTRY      = "Remove.Policy.Entry";
+    public static final String EDIT_KEYSTORE            = "Edit";
+    public static final String ADD_PUBKEY_ALIAS         = "Add.Public.Key.Alias";
+    public static final String REMOVE_PUBKEY_ALIAS      = "Remove.Public.Key.Alias";
+
+    /* gridbag index for components in the main window (MW) */
+    public static final int MW_FILENAME_LABEL           = 0;
+    public static final int MW_FILENAME_TEXTFIELD       = 1;
+    public static final int MW_PANEL                    = 2;
+    public static final int MW_ADD_BUTTON               = 0;
+    public static final int MW_EDIT_BUTTON              = 1;
+    public static final int MW_REMOVE_BUTTON            = 2;
+    public static final int MW_POLICY_LIST              = 3; // follows MW_PANEL
+
+    /* The preferred height of JTextField should match JComboBox. */
+    static final int TEXTFIELD_HEIGHT = new JComboBox<>().getPreferredSize().height;
+
+    private PolicyTool tool;
+
+    /**
+     * Constructor
+     */
+    ToolWindow(PolicyTool tool) {
+        this.tool = tool;
+    }
+
+    /**
+     * Don't call getComponent directly on the window
+     */
+    public Component getComponent(int n) {
+        Component c = getContentPane().getComponent(n);
+        if (c instanceof JScrollPane) {
+            c = ((JScrollPane)c).getViewport().getView();
+        }
+        return c;
+    }
+
+    /**
+     * Initialize the PolicyTool window with the necessary components
+     */
+    private void initWindow() {
+        // The ToolWindowListener will handle closing the window.
+        setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
+
+        // create the top menu bar
+        JMenuBar menuBar = new JMenuBar();
+
+        // create a File menu
+        JMenu menu = new JMenu();
+        configureButton(menu, "File");
+        ActionListener actionListener = new FileMenuListener(tool, this);
+        addMenuItem(menu, NEW_POLICY_FILE, actionListener, "N");
+        addMenuItem(menu, OPEN_POLICY_FILE, actionListener, "O");
+        addMenuItem(menu, SAVE_POLICY_FILE, actionListener, "S");
+        addMenuItem(menu, SAVE_AS_POLICY_FILE, actionListener, null);
+        addMenuItem(menu, VIEW_WARNINGS, actionListener, null);
+        addMenuItem(menu, QUIT, actionListener, null);
+        menuBar.add(menu);
+
+        // create a KeyStore menu
+        menu = new JMenu();
+        configureButton(menu, "KeyStore");
+        actionListener = new MainWindowListener(tool, this);
+        addMenuItem(menu, EDIT_KEYSTORE, actionListener, null);
+        menuBar.add(menu);
+        setJMenuBar(menuBar);
+
+        // Create some space around components
+        ((JPanel)getContentPane()).setBorder(new EmptyBorder(6, 6, 6, 6));
+
+        // policy entry listing
+        JLabel label = new JLabel(PolicyTool.getMessage("Policy.File."));
+        addNewComponent(this, label, MW_FILENAME_LABEL,
+                        0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                        LR_TOP_BOTTOM_PADDING);
+        JTextField tf = new JTextField(50);
+        tf.setPreferredSize(new Dimension(tf.getPreferredSize().width, TEXTFIELD_HEIGHT));
+        tf.getAccessibleContext().setAccessibleName(
+                PolicyTool.getMessage("Policy.File."));
+        tf.setEditable(false);
+        addNewComponent(this, tf, MW_FILENAME_TEXTFIELD,
+                        1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                        LR_TOP_BOTTOM_PADDING);
+
+
+        // add ADD/REMOVE/EDIT buttons in a new panel
+        JPanel panel = new JPanel();
+        panel.setLayout(new GridBagLayout());
+
+        JButton button = new JButton();
+        configureButton(button, ADD_POLICY_ENTRY);
+        button.addActionListener(new MainWindowListener(tool, this));
+        addNewComponent(panel, button, MW_ADD_BUTTON,
+                        0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                        LR_PADDING);
+
+        button = new JButton();
+        configureButton(button, EDIT_POLICY_ENTRY);
+        button.addActionListener(new MainWindowListener(tool, this));
+        addNewComponent(panel, button, MW_EDIT_BUTTON,
+                        1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                        LR_PADDING);
+
+        button = new JButton();
+        configureButton(button, REMOVE_POLICY_ENTRY);
+        button.addActionListener(new MainWindowListener(tool, this));
+        addNewComponent(panel, button, MW_REMOVE_BUTTON,
+                        2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                        LR_PADDING);
+
+        addNewComponent(this, panel, MW_PANEL,
+                        0, 2, 2, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                        BOTTOM_PADDING);
+
+
+        String policyFile = tool.getPolicyFileName();
+        if (policyFile == null) {
+            String userHome;
+            userHome = java.security.AccessController.doPrivileged(
+                (PrivilegedAction<String>) () -> System.getProperty("user.home"));
+            policyFile = userHome + File.separatorChar + ".java.policy";
+        }
+
+        try {
+            // open the policy file
+            tool.openPolicy(policyFile);
+
+            // display the policy entries via the policy list textarea
+            DefaultListModel<String> listModel = new DefaultListModel<>();
+            JList<String> list = new JList<>(listModel);
+            list.setVisibleRowCount(15);
+            list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+            list.addMouseListener(new PolicyListListener(tool, this));
+            PolicyEntry entries[] = tool.getEntry();
+            if (entries != null) {
+                for (int i = 0; i < entries.length; i++) {
+                    listModel.addElement(entries[i].headerToString());
+                }
+            }
+            JTextField newFilename = (JTextField)
+                                getComponent(MW_FILENAME_TEXTFIELD);
+            newFilename.setText(policyFile);
+            initPolicyList(list);
+
+        } catch (FileNotFoundException fnfe) {
+            // add blank policy listing
+            JList<String> list = new JList<>(new DefaultListModel<>());
+            list.setVisibleRowCount(15);
+            list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+            list.addMouseListener(new PolicyListListener(tool, this));
+            initPolicyList(list);
+            tool.setPolicyFileName(null);
+            tool.modified = false;
+
+            // just add warning
+            tool.warnings.addElement(fnfe.toString());
+
+        } catch (Exception e) {
+            // add blank policy listing
+            JList<String> list = new JList<>(new DefaultListModel<>());
+            list.setVisibleRowCount(15);
+            list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+            list.addMouseListener(new PolicyListListener(tool, this));
+            initPolicyList(list);
+            tool.setPolicyFileName(null);
+            tool.modified = false;
+
+            // display the error
+            MessageFormat form = new MessageFormat(PolicyTool.getMessage
+                ("Could.not.open.policy.file.policyFile.e.toString."));
+            Object[] source = {policyFile, e.toString()};
+            displayErrorDialog(null, form.format(source));
+        }
+    }
+
+
+    // Platform specific modifier (control / command).
+    private int shortCutModifier = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
+
+    private void addMenuItem(JMenu menu, String key, ActionListener actionListener, String accelerator) {
+        JMenuItem menuItem = new JMenuItem();
+        configureButton(menuItem, key);
+
+        if (PolicyTool.rb.containsKey(key + ".accelerator")) {
+            // Accelerator from resources takes precedence
+            accelerator = PolicyTool.getMessage(key + ".accelerator");
+        }
+
+        if (accelerator != null && !accelerator.isEmpty()) {
+            KeyStroke keyStroke;
+            if (accelerator.length() == 1) {
+                keyStroke = KeyStroke.getKeyStroke(KeyEvent.getExtendedKeyCodeForChar(accelerator.charAt(0)),
+                                                   shortCutModifier);
+            } else {
+                keyStroke = KeyStroke.getKeyStroke(accelerator);
+            }
+            menuItem.setAccelerator(keyStroke);
+        }
+
+        menuItem.addActionListener(actionListener);
+        menu.add(menuItem);
+    }
+
+    static void configureButton(AbstractButton button, String key) {
+        button.setText(PolicyTool.getMessage(key));
+        button.setActionCommand(key);
+
+        int mnemonicInt = PolicyTool.getMnemonicInt(key);
+        if (mnemonicInt > 0) {
+            button.setMnemonic(mnemonicInt);
+            button.setDisplayedMnemonicIndex(PolicyTool.getDisplayedMnemonicIndex(key));
+         }
+    }
+
+    static void configureLabelFor(JLabel label, JComponent component, String key) {
+        label.setText(PolicyTool.getMessage(key));
+        label.setLabelFor(component);
+
+        int mnemonicInt = PolicyTool.getMnemonicInt(key);
+        if (mnemonicInt > 0) {
+            label.setDisplayedMnemonic(mnemonicInt);
+            label.setDisplayedMnemonicIndex(PolicyTool.getDisplayedMnemonicIndex(key));
+         }
+    }
+
+
+    /**
+     * Add a component to the PolicyTool window
+     */
+    void addNewComponent(Container container, JComponent component,
+        int index, int gridx, int gridy, int gridwidth, int gridheight,
+        double weightx, double weighty, int fill, Insets is) {
+
+        if (container instanceof JFrame) {
+            container = ((JFrame)container).getContentPane();
+        } else if (container instanceof JDialog) {
+            container = ((JDialog)container).getContentPane();
+        }
+
+        // add the component at the specified gridbag index
+        container.add(component, index);
+
+        // set the constraints
+        GridBagLayout gbl = (GridBagLayout)container.getLayout();
+        GridBagConstraints gbc = new GridBagConstraints();
+        gbc.gridx = gridx;
+        gbc.gridy = gridy;
+        gbc.gridwidth = gridwidth;
+        gbc.gridheight = gridheight;
+        gbc.weightx = weightx;
+        gbc.weighty = weighty;
+        gbc.fill = fill;
+        if (is != null) gbc.insets = is;
+        gbl.setConstraints(component, gbc);
+    }
+
+
+    /**
+     * Add a component to the PolicyTool window without external padding
+     */
+    void addNewComponent(Container container, JComponent component,
+        int index, int gridx, int gridy, int gridwidth, int gridheight,
+        double weightx, double weighty, int fill) {
+
+        // delegate with "null" external padding
+        addNewComponent(container, component, index, gridx, gridy,
+                        gridwidth, gridheight, weightx, weighty,
+                        fill, null);
+    }
+
+
+    /**
+     * Init the policy_entry_list TEXTAREA component in the
+     * PolicyTool window
+     */
+    void initPolicyList(JList<String> policyList) {
+
+        // add the policy list to the window
+        //policyList.setPreferredSize(new Dimension(500, 350));
+        JScrollPane scrollPane = new JScrollPane(policyList);
+        addNewComponent(this, scrollPane, MW_POLICY_LIST,
+                        0, 3, 2, 1, 1.0, 1.0, GridBagConstraints.BOTH);
+    }
+
+    /**
+     * Replace the policy_entry_list TEXTAREA component in the
+     * PolicyTool window with an updated one.
+     */
+    void replacePolicyList(JList<String> policyList) {
+
+        // remove the original list of Policy Entries
+        // and add the new list of entries
+        @SuppressWarnings("unchecked")
+        JList<String> list = (JList<String>)getComponent(MW_POLICY_LIST);
+        list.setModel(policyList.getModel());
+    }
+
+    /**
+     * display the main PolicyTool window
+     */
+    void displayToolWindow(String args[]) {
+
+        setTitle(PolicyTool.getMessage("Policy.Tool"));
+        setResizable(true);
+        addWindowListener(new ToolWindowListener(tool, this));
+        //setBounds(135, 80, 500, 500);
+        getContentPane().setLayout(new GridBagLayout());
+
+        initWindow();
+        pack();
+        setLocationRelativeTo(null);
+
+        // display it
+        setVisible(true);
+
+        if (tool.newWarning == true) {
+            displayStatusDialog(this, PolicyTool.getMessage
+                ("Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information."));
+        }
+    }
+
+    /**
+     * displays a dialog box describing an error which occurred.
+     */
+    void displayErrorDialog(Window w, String error) {
+        ToolDialog ed = new ToolDialog
+                (PolicyTool.getMessage("Error"), tool, this, true);
+
+        // find where the PolicyTool gui is
+        Point location = ((w == null) ?
+                getLocationOnScreen() : w.getLocationOnScreen());
+        //ed.setBounds(location.x + 50, location.y + 50, 600, 100);
+        ed.setLayout(new GridBagLayout());
+
+        JLabel label = new JLabel(error);
+        addNewComponent(ed, label, 0,
+                        0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH);
+
+        JButton okButton = new JButton(PolicyTool.getMessage("OK"));
+        ActionListener okListener = new ErrorOKButtonListener(ed);
+        okButton.addActionListener(okListener);
+        addNewComponent(ed, okButton, 1,
+                        0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL);
+
+        ed.getRootPane().setDefaultButton(okButton);
+        ed.getRootPane().registerKeyboardAction(okListener, escKey, JComponent.WHEN_IN_FOCUSED_WINDOW);
+
+        ed.pack();
+        ed.setLocationRelativeTo(w);
+        ed.setVisible(true);
+    }
+
+    /**
+     * displays a dialog box describing an error which occurred.
+     */
+    void displayErrorDialog(Window w, Throwable t) {
+        if (t instanceof NoDisplayException) {
+            return;
+        }
+        if (t.getClass() == Exception.class) {
+            // Exception is usually thrown inside policytool for user
+            // interaction error. There is no need to show the type.
+            displayErrorDialog(w, t.getLocalizedMessage());
+        } else {
+            displayErrorDialog(w, t.toString());
+        }
+    }
+
+    /**
+     * displays a dialog box describing the status of an event
+     */
+    void displayStatusDialog(Window w, String status) {
+        ToolDialog sd = new ToolDialog
+                (PolicyTool.getMessage("Status"), tool, this, true);
+
+        // find the location of the PolicyTool gui
+        Point location = ((w == null) ?
+                getLocationOnScreen() : w.getLocationOnScreen());
+        //sd.setBounds(location.x + 50, location.y + 50, 500, 100);
+        sd.setLayout(new GridBagLayout());
+
+        JLabel label = new JLabel(status);
+        addNewComponent(sd, label, 0,
+                        0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH);
+
+        JButton okButton = new JButton(PolicyTool.getMessage("OK"));
+        ActionListener okListener = new StatusOKButtonListener(sd);
+        okButton.addActionListener(okListener);
+        addNewComponent(sd, okButton, 1,
+                        0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL);
+
+        sd.getRootPane().setDefaultButton(okButton);
+        sd.getRootPane().registerKeyboardAction(okListener, escKey, JComponent.WHEN_IN_FOCUSED_WINDOW);
+
+        sd.pack();
+        sd.setLocationRelativeTo(w);
+        sd.setVisible(true);
+    }
+
+    /**
+     * display the warning log
+     */
+    void displayWarningLog(Window w) {
+
+        ToolDialog wd = new ToolDialog
+                (PolicyTool.getMessage("Warning"), tool, this, true);
+
+        // find the location of the PolicyTool gui
+        Point location = ((w == null) ?
+                getLocationOnScreen() : w.getLocationOnScreen());
+        //wd.setBounds(location.x + 50, location.y + 50, 500, 100);
+        wd.setLayout(new GridBagLayout());
+
+        JTextArea ta = new JTextArea();
+        ta.setEditable(false);
+        for (int i = 0; i < tool.warnings.size(); i++) {
+            ta.append(tool.warnings.elementAt(i));
+            ta.append(PolicyTool.getMessage("NEWLINE"));
+        }
+        addNewComponent(wd, ta, 0,
+                        0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                        BOTTOM_PADDING);
+        ta.setFocusable(false);
+
+        JButton okButton = new JButton(PolicyTool.getMessage("OK"));
+        ActionListener okListener = new CancelButtonListener(wd);
+        okButton.addActionListener(okListener);
+        addNewComponent(wd, okButton, 1,
+                        0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL,
+                        LR_PADDING);
+
+        wd.getRootPane().setDefaultButton(okButton);
+        wd.getRootPane().registerKeyboardAction(okListener, escKey, JComponent.WHEN_IN_FOCUSED_WINDOW);
+
+        wd.pack();
+        wd.setLocationRelativeTo(w);
+        wd.setVisible(true);
+    }
+
+    char displayYesNoDialog(Window w, String title, String prompt, String yes, String no) {
+
+        final ToolDialog tw = new ToolDialog
+                (title, tool, this, true);
+        Point location = ((w == null) ?
+                getLocationOnScreen() : w.getLocationOnScreen());
+        //tw.setBounds(location.x + 75, location.y + 100, 400, 150);
+        tw.setLayout(new GridBagLayout());
+
+        JTextArea ta = new JTextArea(prompt, 10, 50);
+        ta.setEditable(false);
+        ta.setLineWrap(true);
+        ta.setWrapStyleWord(true);
+        JScrollPane scrollPane = new JScrollPane(ta,
+                                                 JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
+                                                 JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
+        addNewComponent(tw, scrollPane, 0,
+                0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH);
+        ta.setFocusable(false);
+
+        JPanel panel = new JPanel();
+        panel.setLayout(new GridBagLayout());
+
+        // StringBuffer to store button press. Must be final.
+        final StringBuffer chooseResult = new StringBuffer();
+
+        JButton button = new JButton(yes);
+        button.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                chooseResult.append('Y');
+                tw.setVisible(false);
+                tw.dispose();
+            }
+        });
+        addNewComponent(panel, button, 0,
+                           0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL,
+                           LR_PADDING);
+
+        button = new JButton(no);
+        button.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                chooseResult.append('N');
+                tw.setVisible(false);
+                tw.dispose();
+            }
+        });
+        addNewComponent(panel, button, 1,
+                           1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL,
+                           LR_PADDING);
+
+        addNewComponent(tw, panel, 1,
+                0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL);
+
+        tw.pack();
+        tw.setLocationRelativeTo(w);
+        tw.setVisible(true);
+        if (chooseResult.length() > 0) {
+            return chooseResult.charAt(0);
+        } else {
+            // I did encounter this once, don't why.
+            return 'N';
+        }
+    }
+
+}
+
+/**
+ * General dialog window
+ */
+class ToolDialog extends JDialog {
+    // use serialVersionUID from JDK 1.2.2 for interoperability
+    private static final long serialVersionUID = -372244357011301190L;
+
+    /* ESCAPE key */
+    static final KeyStroke escKey = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0);
+
+    /* necessary constants */
+    public static final int NOACTION            = 0;
+    public static final int QUIT                = 1;
+    public static final int NEW                 = 2;
+    public static final int OPEN                = 3;
+
+    public static final String ALL_PERM_CLASS   =
+                "java.security.AllPermission";
+    public static final String FILE_PERM_CLASS  =
+                "java.io.FilePermission";
+
+    public static final String X500_PRIN_CLASS         =
+                "javax.security.auth.x500.X500Principal";
+
+    /* popup menus */
+    public static final String PERM             =
+        PolicyTool.getMessage
+        ("Permission.");
+
+    public static final String PRIN_TYPE        =
+        PolicyTool.getMessage("Principal.Type.");
+    public static final String PRIN_NAME        =
+        PolicyTool.getMessage("Principal.Name.");
+
+    /* more popu menus */
+    public static final String PERM_NAME        =
+        PolicyTool.getMessage
+        ("Target.Name.");
+
+    /* and more popup menus */
+    public static final String PERM_ACTIONS             =
+      PolicyTool.getMessage
+      ("Actions.");
+
+    /* gridbag index for display PolicyEntry (PE) components */
+    public static final int PE_CODEBASE_LABEL           = 0;
+    public static final int PE_CODEBASE_TEXTFIELD       = 1;
+    public static final int PE_SIGNEDBY_LABEL           = 2;
+    public static final int PE_SIGNEDBY_TEXTFIELD       = 3;
+
+    public static final int PE_PANEL0                   = 4;
+    public static final int PE_ADD_PRIN_BUTTON          = 0;
+    public static final int PE_EDIT_PRIN_BUTTON         = 1;
+    public static final int PE_REMOVE_PRIN_BUTTON       = 2;
+
+    public static final int PE_PRIN_LABEL               = 5;
+    public static final int PE_PRIN_LIST                = 6;
+
+    public static final int PE_PANEL1                   = 7;
+    public static final int PE_ADD_PERM_BUTTON          = 0;
+    public static final int PE_EDIT_PERM_BUTTON         = 1;
+    public static final int PE_REMOVE_PERM_BUTTON       = 2;
+
+    public static final int PE_PERM_LIST                = 8;
+
+    public static final int PE_PANEL2                   = 9;
+    public static final int PE_CANCEL_BUTTON            = 1;
+    public static final int PE_DONE_BUTTON              = 0;
+
+    /* the gridbag index for components in the Principal Dialog (PRD) */
+    public static final int PRD_DESC_LABEL              = 0;
+    public static final int PRD_PRIN_CHOICE             = 1;
+    public static final int PRD_PRIN_TEXTFIELD          = 2;
+    public static final int PRD_NAME_LABEL              = 3;
+    public static final int PRD_NAME_TEXTFIELD          = 4;
+    public static final int PRD_CANCEL_BUTTON           = 6;
+    public static final int PRD_OK_BUTTON               = 5;
+
+    /* the gridbag index for components in the Permission Dialog (PD) */
+    public static final int PD_DESC_LABEL               = 0;
+    public static final int PD_PERM_CHOICE              = 1;
+    public static final int PD_PERM_TEXTFIELD           = 2;
+    public static final int PD_NAME_CHOICE              = 3;
+    public static final int PD_NAME_TEXTFIELD           = 4;
+    public static final int PD_ACTIONS_CHOICE           = 5;
+    public static final int PD_ACTIONS_TEXTFIELD        = 6;
+    public static final int PD_SIGNEDBY_LABEL           = 7;
+    public static final int PD_SIGNEDBY_TEXTFIELD       = 8;
+    public static final int PD_CANCEL_BUTTON            = 10;
+    public static final int PD_OK_BUTTON                = 9;
+
+    /* modes for KeyStore */
+    public static final int EDIT_KEYSTORE               = 0;
+
+    /* the gridbag index for components in the Change KeyStore Dialog (KSD) */
+    public static final int KSD_NAME_LABEL              = 0;
+    public static final int KSD_NAME_TEXTFIELD          = 1;
+    public static final int KSD_TYPE_LABEL              = 2;
+    public static final int KSD_TYPE_TEXTFIELD          = 3;
+    public static final int KSD_PROVIDER_LABEL          = 4;
+    public static final int KSD_PROVIDER_TEXTFIELD      = 5;
+    public static final int KSD_PWD_URL_LABEL           = 6;
+    public static final int KSD_PWD_URL_TEXTFIELD       = 7;
+    public static final int KSD_CANCEL_BUTTON           = 9;
+    public static final int KSD_OK_BUTTON               = 8;
+
+    /* the gridbag index for components in the User Save Changes Dialog (USC) */
+    public static final int USC_LABEL                   = 0;
+    public static final int USC_PANEL                   = 1;
+    public static final int USC_YES_BUTTON              = 0;
+    public static final int USC_NO_BUTTON               = 1;
+    public static final int USC_CANCEL_BUTTON           = 2;
+
+    /* gridbag index for the ConfirmRemovePolicyEntryDialog (CRPE) */
+    public static final int CRPE_LABEL1                 = 0;
+    public static final int CRPE_LABEL2                 = 1;
+    public static final int CRPE_PANEL                  = 2;
+    public static final int CRPE_PANEL_OK               = 0;
+    public static final int CRPE_PANEL_CANCEL           = 1;
+
+    /* some private static finals */
+    private static final int PERMISSION                 = 0;
+    private static final int PERMISSION_NAME            = 1;
+    private static final int PERMISSION_ACTIONS         = 2;
+    private static final int PERMISSION_SIGNEDBY        = 3;
+    private static final int PRINCIPAL_TYPE             = 4;
+    private static final int PRINCIPAL_NAME             = 5;
+
+    /* The preferred height of JTextField should match JComboBox. */
+    static final int TEXTFIELD_HEIGHT = new JComboBox<>().getPreferredSize().height;
+
+    public static java.util.ArrayList<Perm> PERM_ARRAY;
+    public static java.util.ArrayList<Prin> PRIN_ARRAY;
+    PolicyTool tool;
+    ToolWindow tw;
+
+    static {
+
+        // set up permission objects
+
+        PERM_ARRAY = new java.util.ArrayList<Perm>();
+        PERM_ARRAY.add(new AllPerm());
+        PERM_ARRAY.add(new AudioPerm());
+        PERM_ARRAY.add(new AuthPerm());
+        PERM_ARRAY.add(new AWTPerm());
+        PERM_ARRAY.add(new DelegationPerm());
+        PERM_ARRAY.add(new FilePerm());
+        PERM_ARRAY.add(new URLPerm());
+        PERM_ARRAY.add(new InqSecContextPerm());
+        PERM_ARRAY.add(new LogPerm());
+        PERM_ARRAY.add(new MgmtPerm());
+        PERM_ARRAY.add(new MBeanPerm());
+        PERM_ARRAY.add(new MBeanSvrPerm());
+        PERM_ARRAY.add(new MBeanTrustPerm());
+        PERM_ARRAY.add(new NetPerm());
+        PERM_ARRAY.add(new NetworkPerm());
+        PERM_ARRAY.add(new PrivCredPerm());
+        PERM_ARRAY.add(new PropPerm());
+        PERM_ARRAY.add(new ReflectPerm());
+        PERM_ARRAY.add(new RuntimePerm());
+        PERM_ARRAY.add(new SecurityPerm());
+        PERM_ARRAY.add(new SerialPerm());
+        PERM_ARRAY.add(new ServicePerm());
+        PERM_ARRAY.add(new SocketPerm());
+        PERM_ARRAY.add(new SQLPerm());
+        PERM_ARRAY.add(new SSLPerm());
+        PERM_ARRAY.add(new SubjDelegPerm());
+
+        // set up principal objects
+
+        PRIN_ARRAY = new java.util.ArrayList<Prin>();
+        PRIN_ARRAY.add(new KrbPrin());
+        PRIN_ARRAY.add(new X500Prin());
+    }
+
+    ToolDialog(String title, PolicyTool tool, ToolWindow tw, boolean modal) {
+        super(tw, modal);
+        setTitle(title);
+        this.tool = tool;
+        this.tw = tw;
+        addWindowListener(new ChildWindowListener(this));
+
+        // Create some space around components
+        ((JPanel)getContentPane()).setBorder(new EmptyBorder(6, 6, 6, 6));
+    }
+
+    /**
+     * Don't call getComponent directly on the window
+     */
+    public Component getComponent(int n) {
+        Component c = getContentPane().getComponent(n);
+        if (c instanceof JScrollPane) {
+            c = ((JScrollPane)c).getViewport().getView();
+        }
+        return c;
+    }
+
+    /**
+     * get the Perm instance based on either the (shortened) class name
+     * or the fully qualified class name
+     */
+    static Perm getPerm(String clazz, boolean fullClassName) {
+        for (int i = 0; i < PERM_ARRAY.size(); i++) {
+            Perm next = PERM_ARRAY.get(i);
+            if (fullClassName) {
+                if (next.FULL_CLASS.equals(clazz)) {
+                    return next;
+                }
+            } else {
+                if (next.CLASS.equals(clazz)) {
+                    return next;
+                }
+            }
+        }
+        return null;
+    }
+
+    /**
+     * get the Prin instance based on either the (shortened) class name
+     * or the fully qualified class name
+     */
+    static Prin getPrin(String clazz, boolean fullClassName) {
+        for (int i = 0; i < PRIN_ARRAY.size(); i++) {
+            Prin next = PRIN_ARRAY.get(i);
+            if (fullClassName) {
+                if (next.FULL_CLASS.equals(clazz)) {
+                    return next;
+                }
+            } else {
+                if (next.CLASS.equals(clazz)) {
+                    return next;
+                }
+            }
+        }
+        return null;
+    }
+
+    /**
+     * pop up a dialog so the user can enter info to add a new PolicyEntry
+     * - if edit is TRUE, then the user is editing an existing entry
+     *   and we should display the original info as well.
+     *
+     * - the other reason we need the 'edit' boolean is we need to know
+     *   when we are adding a NEW policy entry.  in this case, we can
+     *   not simply update the existing entry, because it doesn't exist.
+     *   we ONLY update the GUI listing/info, and then when the user
+     *   finally clicks 'OK' or 'DONE', then we can collect that info
+     *   and add it to the policy.
+     */
+    void displayPolicyEntryDialog(boolean edit) {
+
+        int listIndex = 0;
+        PolicyEntry entries[] = null;
+        TaggedList prinList = new TaggedList(3, false);
+        prinList.getAccessibleContext().setAccessibleName(
+                PolicyTool.getMessage("Principal.List"));
+        prinList.addMouseListener
+                (new EditPrinButtonListener(tool, tw, this, edit));
+        TaggedList permList = new TaggedList(10, false);
+        permList.getAccessibleContext().setAccessibleName(
+                PolicyTool.getMessage("Permission.List"));
+        permList.addMouseListener
+                (new EditPermButtonListener(tool, tw, this, edit));
+
+        // find where the PolicyTool gui is
+        Point location = tw.getLocationOnScreen();
+        //setBounds(location.x + 75, location.y + 200, 650, 500);
+        setLayout(new GridBagLayout());
+        setResizable(true);
+
+        if (edit) {
+            // get the selected item
+            entries = tool.getEntry();
+            @SuppressWarnings("unchecked")
+            JList<String> policyList = (JList<String>)tw.getComponent(ToolWindow.MW_POLICY_LIST);
+            listIndex = policyList.getSelectedIndex();
+
+            // get principal list
+            LinkedList<PolicyParser.PrincipalEntry> principals =
+                entries[listIndex].getGrantEntry().principals;
+            for (int i = 0; i < principals.size(); i++) {
+                String prinString = null;
+                PolicyParser.PrincipalEntry nextPrin = principals.get(i);
+                prinList.addTaggedItem(PrincipalEntryToUserFriendlyString(nextPrin), nextPrin);
+            }
+
+            // get permission list
+            Vector<PolicyParser.PermissionEntry> permissions =
+                entries[listIndex].getGrantEntry().permissionEntries;
+            for (int i = 0; i < permissions.size(); i++) {
+                String permString = null;
+                PolicyParser.PermissionEntry nextPerm =
+                                                permissions.elementAt(i);
+                permList.addTaggedItem(ToolDialog.PermissionEntryToUserFriendlyString(nextPerm), nextPerm);
+            }
+        }
+
+        // codebase label and textfield
+        JLabel label = new JLabel();
+        tw.addNewComponent(this, label, PE_CODEBASE_LABEL,
+                0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                ToolWindow.R_PADDING);
+        JTextField tf;
+        tf = (edit ?
+                new JTextField(entries[listIndex].getGrantEntry().codeBase) :
+                new JTextField());
+        ToolWindow.configureLabelFor(label, tf, "CodeBase.");
+        tf.setPreferredSize(new Dimension(tf.getPreferredSize().width, TEXTFIELD_HEIGHT));
+        tf.getAccessibleContext().setAccessibleName(
+                PolicyTool.getMessage("Code.Base"));
+        tw.addNewComponent(this, tf, PE_CODEBASE_TEXTFIELD,
+                1, 0, 1, 1, 1.0, 0.0, GridBagConstraints.BOTH);
+
+        // signedby label and textfield
+        label = new JLabel();
+        tw.addNewComponent(this, label, PE_SIGNEDBY_LABEL,
+                           0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                           ToolWindow.R_PADDING);
+        tf = (edit ?
+                new JTextField(entries[listIndex].getGrantEntry().signedBy) :
+                new JTextField());
+        ToolWindow.configureLabelFor(label, tf, "SignedBy.");
+        tf.setPreferredSize(new Dimension(tf.getPreferredSize().width, TEXTFIELD_HEIGHT));
+        tf.getAccessibleContext().setAccessibleName(
+                PolicyTool.getMessage("Signed.By."));
+        tw.addNewComponent(this, tf, PE_SIGNEDBY_TEXTFIELD,
+                           1, 1, 1, 1, 1.0, 0.0, GridBagConstraints.BOTH);
+
+        // panel for principal buttons
+        JPanel panel = new JPanel();
+        panel.setLayout(new GridBagLayout());
+
+        JButton button = new JButton();
+        ToolWindow.configureButton(button, "Add.Principal");
+        button.addActionListener
+                (new AddPrinButtonListener(tool, tw, this, edit));
+        tw.addNewComponent(panel, button, PE_ADD_PRIN_BUTTON,
+                0, 0, 1, 1, 100.0, 0.0, GridBagConstraints.HORIZONTAL);
+
+        button = new JButton();
+        ToolWindow.configureButton(button, "Edit.Principal");
+        button.addActionListener(new EditPrinButtonListener
+                                                (tool, tw, this, edit));
+        tw.addNewComponent(panel, button, PE_EDIT_PRIN_BUTTON,
+                1, 0, 1, 1, 100.0, 0.0, GridBagConstraints.HORIZONTAL);
+
+        button = new JButton();
+        ToolWindow.configureButton(button, "Remove.Principal");
+        button.addActionListener(new RemovePrinButtonListener
+                                        (tool, tw, this, edit));
+        tw.addNewComponent(panel, button, PE_REMOVE_PRIN_BUTTON,
+                2, 0, 1, 1, 100.0, 0.0, GridBagConstraints.HORIZONTAL);
+
+        tw.addNewComponent(this, panel, PE_PANEL0,
+                1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.HORIZONTAL,
+                           ToolWindow.LITE_BOTTOM_PADDING);
+
+        // principal label and list
+        label = new JLabel();
+        tw.addNewComponent(this, label, PE_PRIN_LABEL,
+                           0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                           ToolWindow.R_BOTTOM_PADDING);
+        JScrollPane scrollPane = new JScrollPane(prinList);
+        ToolWindow.configureLabelFor(label, scrollPane, "Principals.");
+        tw.addNewComponent(this, scrollPane, PE_PRIN_LIST,
+                           1, 3, 3, 1, 0.0, prinList.getVisibleRowCount(), GridBagConstraints.BOTH,
+                           ToolWindow.BOTTOM_PADDING);
+
+        // panel for permission buttons
+        panel = new JPanel();
+        panel.setLayout(new GridBagLayout());
+
+        button = new JButton();
+        ToolWindow.configureButton(button, ".Add.Permission");
+        button.addActionListener(new AddPermButtonListener
+                                                (tool, tw, this, edit));
+        tw.addNewComponent(panel, button, PE_ADD_PERM_BUTTON,
+                0, 0, 1, 1, 100.0, 0.0, GridBagConstraints.HORIZONTAL);
+
+        button = new JButton();
+        ToolWindow.configureButton(button, ".Edit.Permission");
+        button.addActionListener(new EditPermButtonListener
+                                                (tool, tw, this, edit));
+        tw.addNewComponent(panel, button, PE_EDIT_PERM_BUTTON,
+                1, 0, 1, 1, 100.0, 0.0, GridBagConstraints.HORIZONTAL);
+
+
+        button = new JButton();
+        ToolWindow.configureButton(button, "Remove.Permission");
+        button.addActionListener(new RemovePermButtonListener
+                                        (tool, tw, this, edit));
+        tw.addNewComponent(panel, button, PE_REMOVE_PERM_BUTTON,
+                2, 0, 1, 1, 100.0, 0.0, GridBagConstraints.HORIZONTAL);
+
+        tw.addNewComponent(this, panel, PE_PANEL1,
+                0, 4, 2, 1, 0.0, 0.0, GridBagConstraints.HORIZONTAL,
+                ToolWindow.LITE_BOTTOM_PADDING);
+
+        // permission list
+        scrollPane = new JScrollPane(permList);
+        tw.addNewComponent(this, scrollPane, PE_PERM_LIST,
+                           0, 5, 3, 1, 0.0, permList.getVisibleRowCount(), GridBagConstraints.BOTH,
+                           ToolWindow.BOTTOM_PADDING);
+
+
+        // panel for Done and Cancel buttons
+        panel = new JPanel();
+        panel.setLayout(new GridBagLayout());
+
+        // Done Button
+        JButton okButton = new JButton(PolicyTool.getMessage("Done"));
+        okButton.addActionListener
+                (new AddEntryDoneButtonListener(tool, tw, this, edit));
+        tw.addNewComponent(panel, okButton, PE_DONE_BUTTON,
+                           0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL,
+                           ToolWindow.LR_PADDING);
+
+        // Cancel Button
+        JButton cancelButton = new JButton(PolicyTool.getMessage("Cancel"));
+        ActionListener cancelListener = new CancelButtonListener(this);
+        cancelButton.addActionListener(cancelListener);
+        tw.addNewComponent(panel, cancelButton, PE_CANCEL_BUTTON,
+                           1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL,
+                           ToolWindow.LR_PADDING);
+
+        // add the panel
+        tw.addNewComponent(this, panel, PE_PANEL2,
+                0, 6, 2, 1, 0.0, 0.0, GridBagConstraints.VERTICAL);
+
+        getRootPane().setDefaultButton(okButton);
+        getRootPane().registerKeyboardAction(cancelListener, escKey, JComponent.WHEN_IN_FOCUSED_WINDOW);
+
+        pack();
+        setLocationRelativeTo(tw);
+        setVisible(true);
+    }
+
+    /**
+     * Read all the Policy information data in the dialog box
+     * and construct a PolicyEntry object with it.
+     */
+    PolicyEntry getPolicyEntryFromDialog()
+        throws InvalidParameterException, MalformedURLException,
+        NoSuchMethodException, ClassNotFoundException, InstantiationException,
+        IllegalAccessException, InvocationTargetException,
+        CertificateException, IOException, Exception {
+
+        // get the Codebase
+        JTextField tf = (JTextField)getComponent(PE_CODEBASE_TEXTFIELD);
+        String codebase = null;
+        if (tf.getText().trim().equals("") == false)
+                codebase = new String(tf.getText().trim());
+
+        // get the SignedBy
+        tf = (JTextField)getComponent(PE_SIGNEDBY_TEXTFIELD);
+        String signedby = null;
+        if (tf.getText().trim().equals("") == false)
+                signedby = new String(tf.getText().trim());
+
+        // construct a new GrantEntry
+        PolicyParser.GrantEntry ge =
+                        new PolicyParser.GrantEntry(signedby, codebase);
+
+        // get the new Principals
+        LinkedList<PolicyParser.PrincipalEntry> prins = new LinkedList<>();
+        TaggedList prinList = (TaggedList)getComponent(PE_PRIN_LIST);
+        for (int i = 0; i < prinList.getModel().getSize(); i++) {
+            prins.add((PolicyParser.PrincipalEntry)prinList.getObject(i));
+        }
+        ge.principals = prins;
+
+        // get the new Permissions
+        Vector<PolicyParser.PermissionEntry> perms = new Vector<>();
+        TaggedList permList = (TaggedList)getComponent(PE_PERM_LIST);
+        for (int i = 0; i < permList.getModel().getSize(); i++) {
+            perms.addElement((PolicyParser.PermissionEntry)permList.getObject(i));
+        }
+        ge.permissionEntries = perms;
+
+        // construct a new PolicyEntry object
+        PolicyEntry entry = new PolicyEntry(tool, ge);
+
+        return entry;
+    }
+
+    /**
+     * display a dialog box for the user to enter KeyStore information
+     */
+    void keyStoreDialog(int mode) {
+
+        // find where the PolicyTool gui is
+        Point location = tw.getLocationOnScreen();
+        //setBounds(location.x + 25, location.y + 100, 500, 300);
+        setLayout(new GridBagLayout());
+
+        if (mode == EDIT_KEYSTORE) {
+
+            // KeyStore label and textfield
+            JLabel label = new JLabel();
+            tw.addNewComponent(this, label, KSD_NAME_LABEL,
+                               0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                               ToolWindow.R_BOTTOM_PADDING);
+            JTextField tf = new JTextField(tool.getKeyStoreName(), 30);
+            ToolWindow.configureLabelFor(label, tf, "KeyStore.URL.");
+            tf.setPreferredSize(new Dimension(tf.getPreferredSize().width, TEXTFIELD_HEIGHT));
+
+            // URL to U R L, so that accessibility reader will pronounce well
+            tf.getAccessibleContext().setAccessibleName(
+                PolicyTool.getMessage("KeyStore.U.R.L."));
+            tw.addNewComponent(this, tf, KSD_NAME_TEXTFIELD,
+                               1, 0, 1, 1, 1.0, 0.0, GridBagConstraints.BOTH,
+                               ToolWindow.BOTTOM_PADDING);
+
+            // KeyStore type and textfield
+            label = new JLabel();
+            tw.addNewComponent(this, label, KSD_TYPE_LABEL,
+                               0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                               ToolWindow.R_BOTTOM_PADDING);
+            tf = new JTextField(tool.getKeyStoreType(), 30);
+            ToolWindow.configureLabelFor(label, tf, "KeyStore.Type.");
+            tf.setPreferredSize(new Dimension(tf.getPreferredSize().width, TEXTFIELD_HEIGHT));
+            tf.getAccessibleContext().setAccessibleName(
+                PolicyTool.getMessage("KeyStore.Type."));
+            tw.addNewComponent(this, tf, KSD_TYPE_TEXTFIELD,
+                               1, 1, 1, 1, 1.0, 0.0, GridBagConstraints.BOTH,
+                               ToolWindow.BOTTOM_PADDING);
+
+            // KeyStore provider and textfield
+            label = new JLabel();
+            tw.addNewComponent(this, label, KSD_PROVIDER_LABEL,
+                               0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                               ToolWindow.R_BOTTOM_PADDING);
+            tf = new JTextField(tool.getKeyStoreProvider(), 30);
+            ToolWindow.configureLabelFor(label, tf, "KeyStore.Provider.");
+            tf.setPreferredSize(new Dimension(tf.getPreferredSize().width, TEXTFIELD_HEIGHT));
+            tf.getAccessibleContext().setAccessibleName(
+                PolicyTool.getMessage("KeyStore.Provider."));
+            tw.addNewComponent(this, tf, KSD_PROVIDER_TEXTFIELD,
+                               1, 2, 1, 1, 1.0, 0.0, GridBagConstraints.BOTH,
+                               ToolWindow.BOTTOM_PADDING);
+
+            // KeyStore password URL and textfield
+            label = new JLabel();
+            tw.addNewComponent(this, label, KSD_PWD_URL_LABEL,
+                               0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                               ToolWindow.R_BOTTOM_PADDING);
+            tf = new JTextField(tool.getKeyStorePwdURL(), 30);
+            ToolWindow.configureLabelFor(label, tf, "KeyStore.Password.URL.");
+            tf.setPreferredSize(new Dimension(tf.getPreferredSize().width, TEXTFIELD_HEIGHT));
+            tf.getAccessibleContext().setAccessibleName(
+                PolicyTool.getMessage("KeyStore.Password.U.R.L."));
+            tw.addNewComponent(this, tf, KSD_PWD_URL_TEXTFIELD,
+                               1, 3, 1, 1, 1.0, 0.0, GridBagConstraints.BOTH,
+                               ToolWindow.BOTTOM_PADDING);
+
+            // OK button
+            JButton okButton = new JButton(PolicyTool.getMessage("OK"));
+            okButton.addActionListener
+                        (new ChangeKeyStoreOKButtonListener(tool, tw, this));
+            tw.addNewComponent(this, okButton, KSD_OK_BUTTON,
+                        0, 4, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL);
+
+            // cancel button
+            JButton cancelButton = new JButton(PolicyTool.getMessage("Cancel"));
+            ActionListener cancelListener = new CancelButtonListener(this);
+            cancelButton.addActionListener(cancelListener);
+            tw.addNewComponent(this, cancelButton, KSD_CANCEL_BUTTON,
+                        1, 4, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL);
+
+            getRootPane().setDefaultButton(okButton);
+            getRootPane().registerKeyboardAction(cancelListener, escKey, JComponent.WHEN_IN_FOCUSED_WINDOW);
+        }
+
+        pack();
+        setLocationRelativeTo(tw);
+        setVisible(true);
+    }
+
+    /**
+     * display a dialog box for the user to input Principal info
+     *
+     * if editPolicyEntry is false, then we are adding Principals to
+     * a new PolicyEntry, and we only update the GUI listing
+     * with the new Principal.
+     *
+     * if edit is true, then we are editing an existing Policy entry.
+     */
+    void displayPrincipalDialog(boolean editPolicyEntry, boolean edit) {
+
+        PolicyParser.PrincipalEntry editMe = null;
+
+        // get the Principal selected from the Principal List
+        TaggedList prinList = (TaggedList)getComponent(PE_PRIN_LIST);
+        int prinIndex = prinList.getSelectedIndex();
+
+        if (edit) {
+            editMe = (PolicyParser.PrincipalEntry)prinList.getObject(prinIndex);
+        }
+
+        ToolDialog newTD = new ToolDialog
+                (PolicyTool.getMessage("Principals"), tool, tw, true);
+        newTD.addWindowListener(new ChildWindowListener(newTD));
+
+        // find where the PolicyTool gui is
+        Point location = getLocationOnScreen();
+        //newTD.setBounds(location.x + 50, location.y + 100, 650, 190);
+        newTD.setLayout(new GridBagLayout());
+        newTD.setResizable(true);
+
+        // description label
+        JLabel label = (edit ?
+                new JLabel(PolicyTool.getMessage(".Edit.Principal.")) :
+                new JLabel(PolicyTool.getMessage(".Add.New.Principal.")));
+        tw.addNewComponent(newTD, label, PRD_DESC_LABEL,
+                           0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                           ToolWindow.TOP_BOTTOM_PADDING);
+
+        // principal choice
+        JComboBox<String> choice = new JComboBox<>();
+        choice.addItem(PRIN_TYPE);
+        choice.getAccessibleContext().setAccessibleName(PRIN_TYPE);
+        for (int i = 0; i < PRIN_ARRAY.size(); i++) {
+            Prin next = PRIN_ARRAY.get(i);
+            choice.addItem(next.CLASS);
+        }
+
+        if (edit) {
+            if (PolicyParser.PrincipalEntry.WILDCARD_CLASS.equals
+                                (editMe.getPrincipalClass())) {
+                choice.setSelectedItem(PRIN_TYPE);
+            } else {
+                Prin inputPrin = getPrin(editMe.getPrincipalClass(), true);
+                if (inputPrin != null) {
+                    choice.setSelectedItem(inputPrin.CLASS);
+                }
+            }
+        }
+        // Add listener after selected item is set
+        choice.addItemListener(new PrincipalTypeMenuListener(newTD));
+
+        tw.addNewComponent(newTD, choice, PRD_PRIN_CHOICE,
+                           0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                           ToolWindow.LR_PADDING);
+
+        // principal textfield
+        JTextField tf;
+        tf = (edit ?
+                new JTextField(editMe.getDisplayClass(), 30) :
+                new JTextField(30));
+        tf.setPreferredSize(new Dimension(tf.getPreferredSize().width, TEXTFIELD_HEIGHT));
+        tf.getAccessibleContext().setAccessibleName(PRIN_TYPE);
+        tw.addNewComponent(newTD, tf, PRD_PRIN_TEXTFIELD,
+                           1, 1, 1, 1, 1.0, 0.0, GridBagConstraints.BOTH,
+                           ToolWindow.LR_PADDING);
+
+        // name label and textfield
+        label = new JLabel(PRIN_NAME);
+        tf = (edit ?
+                new JTextField(editMe.getDisplayName(), 40) :
+                new JTextField(40));
+        tf.setPreferredSize(new Dimension(tf.getPreferredSize().width, TEXTFIELD_HEIGHT));
+        tf.getAccessibleContext().setAccessibleName(PRIN_NAME);
+
+        tw.addNewComponent(newTD, label, PRD_NAME_LABEL,
+                           0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                           ToolWindow.LR_PADDING);
+        tw.addNewComponent(newTD, tf, PRD_NAME_TEXTFIELD,
+                           1, 2, 1, 1, 1.0, 0.0, GridBagConstraints.BOTH,
+                           ToolWindow.LR_PADDING);
+
+        // OK button
+        JButton okButton = new JButton(PolicyTool.getMessage("OK"));
+        okButton.addActionListener(
+            new NewPolicyPrinOKButtonListener
+                                        (tool, tw, this, newTD, edit));
+        tw.addNewComponent(newTD, okButton, PRD_OK_BUTTON,
+                           0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL,
+                           ToolWindow.TOP_BOTTOM_PADDING);
+        // cancel button
+        JButton cancelButton = new JButton(PolicyTool.getMessage("Cancel"));
+        ActionListener cancelListener = new CancelButtonListener(newTD);
+        cancelButton.addActionListener(cancelListener);
+        tw.addNewComponent(newTD, cancelButton, PRD_CANCEL_BUTTON,
+                           1, 3, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL,
+                           ToolWindow.TOP_BOTTOM_PADDING);
+
+        newTD.getRootPane().setDefaultButton(okButton);
+        newTD.getRootPane().registerKeyboardAction(cancelListener, escKey, JComponent.WHEN_IN_FOCUSED_WINDOW);
+
+        newTD.pack();
+        newTD.setLocationRelativeTo(tw);
+        newTD.setVisible(true);
+    }
+
+    /**
+     * display a dialog box for the user to input Permission info
+     *
+     * if editPolicyEntry is false, then we are adding Permissions to
+     * a new PolicyEntry, and we only update the GUI listing
+     * with the new Permission.
+     *
+     * if edit is true, then we are editing an existing Permission entry.
+     */
+    void displayPermissionDialog(boolean editPolicyEntry, boolean edit) {
+
+        PolicyParser.PermissionEntry editMe = null;
+
+        // get the Permission selected from the Permission List
+        TaggedList permList = (TaggedList)getComponent(PE_PERM_LIST);
+        int permIndex = permList.getSelectedIndex();
+
+        if (edit) {
+            editMe = (PolicyParser.PermissionEntry)permList.getObject(permIndex);
+        }
+
+        ToolDialog newTD = new ToolDialog
+                (PolicyTool.getMessage("Permissions"), tool, tw, true);
+        newTD.addWindowListener(new ChildWindowListener(newTD));
+
+        // find where the PolicyTool gui is
+        Point location = getLocationOnScreen();
+        //newTD.setBounds(location.x + 50, location.y + 100, 700, 250);
+        newTD.setLayout(new GridBagLayout());
+        newTD.setResizable(true);
+
+        // description label
+        JLabel label = (edit ?
+                new JLabel(PolicyTool.getMessage(".Edit.Permission.")) :
+                new JLabel(PolicyTool.getMessage(".Add.New.Permission.")));
+        tw.addNewComponent(newTD, label, PD_DESC_LABEL,
+                           0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                           ToolWindow.TOP_BOTTOM_PADDING);
+
+        // permission choice (added in alphabetical order)
+        JComboBox<String> choice = new JComboBox<>();
+        choice.addItem(PERM);
+        choice.getAccessibleContext().setAccessibleName(PERM);
+        for (int i = 0; i < PERM_ARRAY.size(); i++) {
+            Perm next = PERM_ARRAY.get(i);
+            choice.addItem(next.CLASS);
+        }
+        tw.addNewComponent(newTD, choice, PD_PERM_CHOICE,
+                           0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                           ToolWindow.LR_BOTTOM_PADDING);
+
+        // permission textfield
+        JTextField tf;
+        tf = (edit ? new JTextField(editMe.permission, 30) : new JTextField(30));
+        tf.setPreferredSize(new Dimension(tf.getPreferredSize().width, TEXTFIELD_HEIGHT));
+        tf.getAccessibleContext().setAccessibleName(PERM);
+        if (edit) {
+            Perm inputPerm = getPerm(editMe.permission, true);
+            if (inputPerm != null) {
+                choice.setSelectedItem(inputPerm.CLASS);
+            }
+        }
+        tw.addNewComponent(newTD, tf, PD_PERM_TEXTFIELD,
+                           1, 1, 1, 1, 1.0, 0.0, GridBagConstraints.BOTH,
+                           ToolWindow.LR_BOTTOM_PADDING);
+        choice.addItemListener(new PermissionMenuListener(newTD));
+
+        // name label and textfield
+        choice = new JComboBox<>();
+        choice.addItem(PERM_NAME);
+        choice.getAccessibleContext().setAccessibleName(PERM_NAME);
+        tf = (edit ? new JTextField(editMe.name, 40) : new JTextField(40));
+        tf.setPreferredSize(new Dimension(tf.getPreferredSize().width, TEXTFIELD_HEIGHT));
+        tf.getAccessibleContext().setAccessibleName(PERM_NAME);
+        if (edit) {
+            setPermissionNames(getPerm(editMe.permission, true), choice, tf);
+        }
+        tw.addNewComponent(newTD, choice, PD_NAME_CHOICE,
+                           0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                           ToolWindow.LR_BOTTOM_PADDING);
+        tw.addNewComponent(newTD, tf, PD_NAME_TEXTFIELD,
+                           1, 2, 1, 1, 1.0, 0.0, GridBagConstraints.BOTH,
+                           ToolWindow.LR_BOTTOM_PADDING);
+        choice.addItemListener(new PermissionNameMenuListener(newTD));
+
+        // actions label and textfield
+        choice = new JComboBox<>();
+        choice.addItem(PERM_ACTIONS);
+        choice.getAccessibleContext().setAccessibleName(PERM_ACTIONS);
+        tf = (edit ? new JTextField(editMe.action, 40) : new JTextField(40));
+        tf.setPreferredSize(new Dimension(tf.getPreferredSize().width, TEXTFIELD_HEIGHT));
+        tf.getAccessibleContext().setAccessibleName(PERM_ACTIONS);
+        if (edit) {
+            setPermissionActions(getPerm(editMe.permission, true), choice, tf);
+        }
+        tw.addNewComponent(newTD, choice, PD_ACTIONS_CHOICE,
+                           0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                           ToolWindow.LR_BOTTOM_PADDING);
+        tw.addNewComponent(newTD, tf, PD_ACTIONS_TEXTFIELD,
+                           1, 3, 1, 1, 1.0, 0.0, GridBagConstraints.BOTH,
+                           ToolWindow.LR_BOTTOM_PADDING);
+        choice.addItemListener(new PermissionActionsMenuListener(newTD));
+
+        // signedby label and textfield
+        label = new JLabel(PolicyTool.getMessage("Signed.By."));
+        tw.addNewComponent(newTD, label, PD_SIGNEDBY_LABEL,
+                           0, 4, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                           ToolWindow.LR_BOTTOM_PADDING);
+        tf = (edit ? new JTextField(editMe.signedBy, 40) : new JTextField(40));
+        tf.setPreferredSize(new Dimension(tf.getPreferredSize().width, TEXTFIELD_HEIGHT));
+        tf.getAccessibleContext().setAccessibleName(
+                PolicyTool.getMessage("Signed.By."));
+        tw.addNewComponent(newTD, tf, PD_SIGNEDBY_TEXTFIELD,
+                           1, 4, 1, 1, 1.0, 0.0, GridBagConstraints.BOTH,
+                           ToolWindow.LR_BOTTOM_PADDING);
+
+        // OK button
+        JButton okButton = new JButton(PolicyTool.getMessage("OK"));
+        okButton.addActionListener(
+            new NewPolicyPermOKButtonListener
+                                    (tool, tw, this, newTD, edit));
+        tw.addNewComponent(newTD, okButton, PD_OK_BUTTON,
+                           0, 5, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL,
+                           ToolWindow.TOP_BOTTOM_PADDING);
+
+        // cancel button
+        JButton cancelButton = new JButton(PolicyTool.getMessage("Cancel"));
+        ActionListener cancelListener = new CancelButtonListener(newTD);
+        cancelButton.addActionListener(cancelListener);
+        tw.addNewComponent(newTD, cancelButton, PD_CANCEL_BUTTON,
+                           1, 5, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL,
+                           ToolWindow.TOP_BOTTOM_PADDING);
+
+        newTD.getRootPane().setDefaultButton(okButton);
+        newTD.getRootPane().registerKeyboardAction(cancelListener, escKey, JComponent.WHEN_IN_FOCUSED_WINDOW);
+
+        newTD.pack();
+        newTD.setLocationRelativeTo(tw);
+        newTD.setVisible(true);
+    }
+
+    /**
+     * construct a Principal object from the Principal Info Dialog Box
+     */
+    PolicyParser.PrincipalEntry getPrinFromDialog() throws Exception {
+
+        JTextField tf = (JTextField)getComponent(PRD_PRIN_TEXTFIELD);
+        String pclass = new String(tf.getText().trim());
+        tf = (JTextField)getComponent(PRD_NAME_TEXTFIELD);
+        String pname = new String(tf.getText().trim());
+        if (pclass.equals("*")) {
+            pclass = PolicyParser.PrincipalEntry.WILDCARD_CLASS;
+        }
+        if (pname.equals("*")) {
+            pname = PolicyParser.PrincipalEntry.WILDCARD_NAME;
+        }
+
+        PolicyParser.PrincipalEntry pppe = null;
+
+        if ((pclass.equals(PolicyParser.PrincipalEntry.WILDCARD_CLASS)) &&
+            (!pname.equals(PolicyParser.PrincipalEntry.WILDCARD_NAME))) {
+            throw new Exception
+                        (PolicyTool.getMessage("Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name"));
+        } else if (pname.equals("")) {
+            throw new Exception
+                        (PolicyTool.getMessage("Cannot.Specify.Principal.without.a.Name"));
+        } else if (pclass.equals("")) {
+            // make this consistent with what PolicyParser does
+            // when it sees an empty principal class
+            pclass = PolicyParser.PrincipalEntry.REPLACE_NAME;
+            tool.warnings.addElement(
+                        "Warning: Principal name '" + pname +
+                                "' specified without a Principal class.\n" +
+                        "\t'" + pname + "' will be interpreted " +
+                                "as a key store alias.\n" +
+                        "\tThe final principal class will be " +
+                                ToolDialog.X500_PRIN_CLASS + ".\n" +
+                        "\tThe final principal name will be " +
+                                "determined by the following:\n" +
+                        "\n" +
+                        "\tIf the key store entry identified by '"
+                                + pname + "'\n" +
+                        "\tis a key entry, then the principal name will be\n" +
+                        "\tthe subject distinguished name from the first\n" +
+                        "\tcertificate in the entry's certificate chain.\n" +
+                        "\n" +
+                        "\tIf the key store entry identified by '" +
+                                pname + "'\n" +
+                        "\tis a trusted certificate entry, then the\n" +
+                        "\tprincipal name will be the subject distinguished\n" +
+                        "\tname from the trusted public key certificate.");
+            tw.displayStatusDialog(this,
+                        "'" + pname + "' will be interpreted as a key " +
+                        "store alias.  View Warning Log for details.");
+        }
+        return new PolicyParser.PrincipalEntry(pclass, pname);
+    }
+
+
+    /**
+     * construct a Permission object from the Permission Info Dialog Box
+     */
+    PolicyParser.PermissionEntry getPermFromDialog() {
+
+        JTextField tf = (JTextField)getComponent(PD_PERM_TEXTFIELD);
+        String permission = new String(tf.getText().trim());
+        tf = (JTextField)getComponent(PD_NAME_TEXTFIELD);
+        String name = null;
+        if (tf.getText().trim().equals("") == false)
+            name = new String(tf.getText().trim());
+        if (permission.equals("") ||
+            (!permission.equals(ALL_PERM_CLASS) && name == null)) {
+            throw new InvalidParameterException(PolicyTool.getMessage
+                ("Permission.and.Target.Name.must.have.a.value"));
+        }
+
+        // When the permission is FilePermission, we need to check the name
+        // to make sure it's not escaped. We believe --
+        //
+        // String             name.lastIndexOf("\\\\")
+        // ----------------   ------------------------
+        // c:\foo\bar         -1, legal
+        // c:\\foo\\bar       2, illegal
+        // \\server\share     0, legal
+        // \\\\server\share   2, illegal
+
+        if (permission.equals(FILE_PERM_CLASS) && name.lastIndexOf("\\\\") > 0) {
+            char result = tw.displayYesNoDialog(this,
+                    PolicyTool.getMessage("Warning"),
+                    PolicyTool.getMessage(
+                        "Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes"),
+                    PolicyTool.getMessage("Retain"),
+                    PolicyTool.getMessage("Edit")
+                    );
+            if (result != 'Y') {
+                // an invisible exception
+                throw new NoDisplayException();
+            }
+        }
+        // get the Actions
+        tf = (JTextField)getComponent(PD_ACTIONS_TEXTFIELD);
+        String actions = null;
+        if (tf.getText().trim().equals("") == false)
+            actions = new String(tf.getText().trim());
+
+        // get the Signed By
+        tf = (JTextField)getComponent(PD_SIGNEDBY_TEXTFIELD);
+        String signedBy = null;
+        if (tf.getText().trim().equals("") == false)
+            signedBy = new String(tf.getText().trim());
+
+        PolicyParser.PermissionEntry pppe = new PolicyParser.PermissionEntry
+                                (permission, name, actions);
+        pppe.signedBy = signedBy;
+
+        // see if the signers have public keys
+        if (signedBy != null) {
+                String signers[] = tool.parseSigners(pppe.signedBy);
+                for (int i = 0; i < signers.length; i++) {
+                try {
+                    PublicKey pubKey = tool.getPublicKeyAlias(signers[i]);
+                    if (pubKey == null) {
+                        MessageFormat form = new MessageFormat
+                            (PolicyTool.getMessage
+                            ("Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured."));
+                        Object[] source = {signers[i]};
+                        tool.warnings.addElement(form.format(source));
+                        tw.displayStatusDialog(this, form.format(source));
+                    }
+                } catch (Exception e) {
+                    tw.displayErrorDialog(this, e);
+                }
+            }
+        }
+        return pppe;
+    }
+
+    /**
+     * confirm that the user REALLY wants to remove the Policy Entry
+     */
+    void displayConfirmRemovePolicyEntry() {
+
+        // find the entry to be removed
+        @SuppressWarnings("unchecked")
+        JList<String> list = (JList<String>)tw.getComponent(ToolWindow.MW_POLICY_LIST);
+        int index = list.getSelectedIndex();
+        PolicyEntry entries[] = tool.getEntry();
+
+        // find where the PolicyTool gui is
+        Point location = tw.getLocationOnScreen();
+        //setBounds(location.x + 25, location.y + 100, 600, 400);
+        setLayout(new GridBagLayout());
+
+        // ask the user do they really want to do this?
+        JLabel label = new JLabel
+                (PolicyTool.getMessage("Remove.this.Policy.Entry."));
+        tw.addNewComponent(this, label, CRPE_LABEL1,
+                           0, 0, 2, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                           ToolWindow.BOTTOM_PADDING);
+
+        // display the policy entry
+        label = new JLabel(entries[index].codebaseToString());
+        tw.addNewComponent(this, label, CRPE_LABEL2,
+                        0, 1, 2, 1, 0.0, 0.0, GridBagConstraints.BOTH);
+        label = new JLabel(entries[index].principalsToString().trim());
+        tw.addNewComponent(this, label, CRPE_LABEL2+1,
+                        0, 2, 2, 1, 0.0, 0.0, GridBagConstraints.BOTH);
+        Vector<PolicyParser.PermissionEntry> perms =
+                        entries[index].getGrantEntry().permissionEntries;
+        for (int i = 0; i < perms.size(); i++) {
+            PolicyParser.PermissionEntry nextPerm = perms.elementAt(i);
+            String permString = ToolDialog.PermissionEntryToUserFriendlyString(nextPerm);
+            label = new JLabel("    " + permString);
+            if (i == (perms.size()-1)) {
+                tw.addNewComponent(this, label, CRPE_LABEL2 + 2 + i,
+                                 1, 3 + i, 1, 1, 0.0, 0.0,
+                                 GridBagConstraints.BOTH,
+                                 ToolWindow.BOTTOM_PADDING);
+            } else {
+                tw.addNewComponent(this, label, CRPE_LABEL2 + 2 + i,
+                                 1, 3 + i, 1, 1, 0.0, 0.0,
+                                 GridBagConstraints.BOTH);
+            }
+        }
+
+
+        // add OK/CANCEL buttons in a new panel
+        JPanel panel = new JPanel();
+        panel.setLayout(new GridBagLayout());
+
+        // OK button
+        JButton okButton = new JButton(PolicyTool.getMessage("OK"));
+        okButton.addActionListener
+                (new ConfirmRemovePolicyEntryOKButtonListener(tool, tw, this));
+        tw.addNewComponent(panel, okButton, CRPE_PANEL_OK,
+                           0, 0, 1, 1, 0.0, 0.0,
+                           GridBagConstraints.VERTICAL, ToolWindow.LR_PADDING);
+
+        // cancel button
+        JButton cancelButton = new JButton(PolicyTool.getMessage("Cancel"));
+        ActionListener cancelListener = new CancelButtonListener(this);
+        cancelButton.addActionListener(cancelListener);
+        tw.addNewComponent(panel, cancelButton, CRPE_PANEL_CANCEL,
+                           1, 0, 1, 1, 0.0, 0.0,
+                           GridBagConstraints.VERTICAL, ToolWindow.LR_PADDING);
+
+        tw.addNewComponent(this, panel, CRPE_LABEL2 + 2 + perms.size(),
+                           0, 3 + perms.size(), 2, 1, 0.0, 0.0,
+                           GridBagConstraints.VERTICAL, ToolWindow.TOP_BOTTOM_PADDING);
+
+        getRootPane().setDefaultButton(okButton);
+        getRootPane().registerKeyboardAction(cancelListener, escKey, JComponent.WHEN_IN_FOCUSED_WINDOW);
+
+        pack();
+        setLocationRelativeTo(tw);
+        setVisible(true);
+    }
+
+    /**
+     * perform SAVE AS
+     */
+    void displaySaveAsDialog(int nextEvent) {
+
+        // pop up a dialog box for the user to enter a filename.
+        FileDialog fd = new FileDialog
+                (tw, PolicyTool.getMessage("Save.As"), FileDialog.SAVE);
+        fd.addWindowListener(new WindowAdapter() {
+            public void windowClosing(WindowEvent e) {
+                e.getWindow().setVisible(false);
+            }
+        });
+        fd.setVisible(true);
+
+        // see if the user hit cancel
+        if (fd.getFile() == null ||
+            fd.getFile().equals(""))
+            return;
+
+        // get the entered filename
+        File saveAsFile = new File(fd.getDirectory(), fd.getFile());
+        String filename = saveAsFile.getPath();
+        fd.dispose();
+
+        try {
+            // save the policy entries to a file
+            tool.savePolicy(filename);
+
+            // display status
+            MessageFormat form = new MessageFormat(PolicyTool.getMessage
+                    ("Policy.successfully.written.to.filename"));
+            Object[] source = {filename};
+            tw.displayStatusDialog(null, form.format(source));
+
+            // display the new policy filename
+            JTextField newFilename = (JTextField)tw.getComponent
+                            (ToolWindow.MW_FILENAME_TEXTFIELD);
+            newFilename.setText(filename);
+            tw.setVisible(true);
+
+            // now continue with the originally requested command
+            // (QUIT, NEW, or OPEN)
+            userSaveContinue(tool, tw, this, nextEvent);
+
+        } catch (FileNotFoundException fnfe) {
+            if (filename == null || filename.equals("")) {
+                tw.displayErrorDialog(null, new FileNotFoundException
+                            (PolicyTool.getMessage("null.filename")));
+            } else {
+                tw.displayErrorDialog(null, fnfe);
+            }
+        } catch (Exception ee) {
+            tw.displayErrorDialog(null, ee);
+        }
+    }
+
+    /**
+     * ask user if they want to save changes
+     */
+    void displayUserSave(int select) {
+
+        if (tool.modified == true) {
+
+            // find where the PolicyTool gui is
+            Point location = tw.getLocationOnScreen();
+            //setBounds(location.x + 75, location.y + 100, 400, 150);
+            setLayout(new GridBagLayout());
+
+            JLabel label = new JLabel
+                (PolicyTool.getMessage("Save.changes."));
+            tw.addNewComponent(this, label, USC_LABEL,
+                               0, 0, 3, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                               ToolWindow.L_TOP_BOTTOM_PADDING);
+
+            JPanel panel = new JPanel();
+            panel.setLayout(new GridBagLayout());
+
+            JButton yesButton = new JButton();
+            ToolWindow.configureButton(yesButton, "Yes");
+            yesButton.addActionListener
+                        (new UserSaveYesButtonListener(this, tool, tw, select));
+            tw.addNewComponent(panel, yesButton, USC_YES_BUTTON,
+                               0, 0, 1, 1, 0.0, 0.0,
+                               GridBagConstraints.VERTICAL,
+                               ToolWindow.LR_BOTTOM_PADDING);
+            JButton noButton = new JButton();
+            ToolWindow.configureButton(noButton, "No");
+            noButton.addActionListener
+                        (new UserSaveNoButtonListener(this, tool, tw, select));
+            tw.addNewComponent(panel, noButton, USC_NO_BUTTON,
+                               1, 0, 1, 1, 0.0, 0.0,
+                               GridBagConstraints.VERTICAL,
+                               ToolWindow.LR_BOTTOM_PADDING);
+            JButton cancelButton = new JButton();
+            ToolWindow.configureButton(cancelButton, "Cancel");
+            ActionListener cancelListener = new CancelButtonListener(this);
+            cancelButton.addActionListener(cancelListener);
+            tw.addNewComponent(panel, cancelButton, USC_CANCEL_BUTTON,
+                               2, 0, 1, 1, 0.0, 0.0,
+                               GridBagConstraints.VERTICAL,
+                               ToolWindow.LR_BOTTOM_PADDING);
+
+            tw.addNewComponent(this, panel, USC_PANEL,
+                               0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH);
+
+            getRootPane().registerKeyboardAction(cancelListener, escKey, JComponent.WHEN_IN_FOCUSED_WINDOW);
+
+            pack();
+            setLocationRelativeTo(tw);
+            setVisible(true);
+        } else {
+            // just do the original request (QUIT, NEW, or OPEN)
+            userSaveContinue(tool, tw, this, select);
+        }
+    }
+
+    /**
+     * when the user sees the 'YES', 'NO', 'CANCEL' buttons on the
+     * displayUserSave dialog, and the click on one of them,
+     * we need to continue the originally requested action
+     * (either QUITting, opening NEW policy file, or OPENing an existing
+     * policy file.  do that now.
+     */
+    @SuppressWarnings("fallthrough")
+    void userSaveContinue(PolicyTool tool, ToolWindow tw,
+                        ToolDialog us, int select) {
+
+        // now either QUIT, open a NEW policy file, or OPEN an existing policy
+        switch(select) {
+        case ToolDialog.QUIT:
+
+            tw.setVisible(false);
+            tw.dispose();
+            System.exit(0);
+
+        case ToolDialog.NEW:
+
+            try {
+                tool.openPolicy(null);
+            } catch (Exception ee) {
+                tool.modified = false;
+                tw.displayErrorDialog(null, ee);
+            }
+
+            // display the policy entries via the policy list textarea
+            JList<String> list = new JList<>(new DefaultListModel<>());
+            list.setVisibleRowCount(15);
+            list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+            list.addMouseListener(new PolicyListListener(tool, tw));
+            tw.replacePolicyList(list);
+
+            // display null policy filename and keystore
+            JTextField newFilename = (JTextField)tw.getComponent(
+                    ToolWindow.MW_FILENAME_TEXTFIELD);
+            newFilename.setText("");
+            tw.setVisible(true);
+            break;
+
+        case ToolDialog.OPEN:
+
+            // pop up a dialog box for the user to enter a filename.
+            FileDialog fd = new FileDialog
+                (tw, PolicyTool.getMessage("Open"), FileDialog.LOAD);
+            fd.addWindowListener(new WindowAdapter() {
+                public void windowClosing(WindowEvent e) {
+                    e.getWindow().setVisible(false);
+                }
+            });
+            fd.setVisible(true);
+
+            // see if the user hit 'cancel'
+            if (fd.getFile() == null ||
+                fd.getFile().equals(""))
+                return;
+
+            // get the entered filename
+            String policyFile = new File(fd.getDirectory(), fd.getFile()).getPath();
+
+            try {
+                // open the policy file
+                tool.openPolicy(policyFile);
+
+                // display the policy entries via the policy list textarea
+                DefaultListModel<String> listModel = new DefaultListModel<>();
+                list = new JList<>(listModel);
+                list.setVisibleRowCount(15);
+                list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+                list.addMouseListener(new PolicyListListener(tool, tw));
+                PolicyEntry entries[] = tool.getEntry();
+                if (entries != null) {
+                    for (int i = 0; i < entries.length; i++) {
+                        listModel.addElement(entries[i].headerToString());
+                    }
+                }
+                tw.replacePolicyList(list);
+                tool.modified = false;
+
+                // display the new policy filename
+                newFilename = (JTextField)tw.getComponent(
+                        ToolWindow.MW_FILENAME_TEXTFIELD);
+                newFilename.setText(policyFile);
+                tw.setVisible(true);
+
+                // inform user of warnings
+                if (tool.newWarning == true) {
+                    tw.displayStatusDialog(null, PolicyTool.getMessage
+                        ("Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information."));
+                }
+
+            } catch (Exception e) {
+                // add blank policy listing
+                list = new JList<>(new DefaultListModel<>());
+                list.setVisibleRowCount(15);
+                list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+                list.addMouseListener(new PolicyListListener(tool, tw));
+                tw.replacePolicyList(list);
+                tool.setPolicyFileName(null);
+                tool.modified = false;
+
+                // display a null policy filename
+                newFilename = (JTextField)tw.getComponent(
+                        ToolWindow.MW_FILENAME_TEXTFIELD);
+                newFilename.setText("");
+                tw.setVisible(true);
+
+                // display the error
+                MessageFormat form = new MessageFormat(PolicyTool.getMessage
+                    ("Could.not.open.policy.file.policyFile.e.toString."));
+                Object[] source = {policyFile, e.toString()};
+                tw.displayErrorDialog(null, form.format(source));
+            }
+            break;
+        }
+    }
+
+    /**
+     * Return a Menu list of names for a given permission
+     *
+     * If inputPerm's TARGETS are null, then this means TARGETS are
+     * not allowed to be entered (and the TextField is set to be
+     * non-editable).
+     *
+     * If TARGETS are valid but there are no standard ones
+     * (user must enter them by hand) then the TARGETS array may be empty
+     * (and of course non-null).
+     */
+    void setPermissionNames(Perm inputPerm, JComboBox<String> names, JTextField field) {
+        names.removeAllItems();
+        names.addItem(PERM_NAME);
+
+        if (inputPerm == null) {
+            // custom permission
+            field.setEditable(true);
+        } else if (inputPerm.TARGETS == null) {
+            // standard permission with no targets
+            field.setEditable(false);
+        } else {
+            // standard permission with standard targets
+            field.setEditable(true);
+            for (int i = 0; i < inputPerm.TARGETS.length; i++) {
+                names.addItem(inputPerm.TARGETS[i]);
+            }
+        }
+    }
+
+    /**
+     * Return a Menu list of actions for a given permission
+     *
+     * If inputPerm's ACTIONS are null, then this means ACTIONS are
+     * not allowed to be entered (and the TextField is set to be
+     * non-editable).  This is typically true for BasicPermissions.
+     *
+     * If ACTIONS are valid but there are no standard ones
+     * (user must enter them by hand) then the ACTIONS array may be empty
+     * (and of course non-null).
+     */
+    void setPermissionActions(Perm inputPerm, JComboBox<String> actions, JTextField field) {
+        actions.removeAllItems();
+        actions.addItem(PERM_ACTIONS);
+
+        if (inputPerm == null) {
+            // custom permission
+            field.setEditable(true);
+        } else if (inputPerm.ACTIONS == null) {
+            // standard permission with no actions
+            field.setEditable(false);
+        } else {
+            // standard permission with standard actions
+            field.setEditable(true);
+            for (int i = 0; i < inputPerm.ACTIONS.length; i++) {
+                actions.addItem(inputPerm.ACTIONS[i]);
+            }
+        }
+    }
+
+    static String PermissionEntryToUserFriendlyString(PolicyParser.PermissionEntry pppe) {
+        String result = pppe.permission;
+        if (pppe.name != null) {
+            result += " " + pppe.name;
+        }
+        if (pppe.action != null) {
+            result += ", \"" + pppe.action + "\"";
+        }
+        if (pppe.signedBy != null) {
+            result += ", signedBy " + pppe.signedBy;
+        }
+        return result;
+    }
+
+    static String PrincipalEntryToUserFriendlyString(PolicyParser.PrincipalEntry pppe) {
+        StringWriter sw = new StringWriter();
+        PrintWriter pw = new PrintWriter(sw);
+        pppe.write(pw);
+        return sw.toString();
+    }
+}
+
+/**
+ * Event handler for the PolicyTool window
+ */
+class ToolWindowListener implements WindowListener {
+
+    private PolicyTool tool;
+    private ToolWindow tw;
+
+    ToolWindowListener(PolicyTool tool, ToolWindow tw) {
+        this.tool = tool;
+        this.tw = tw;
+    }
+
+    public void windowOpened(WindowEvent we) {
+    }
+
+    public void windowClosing(WindowEvent we) {
+        // Closing the window acts the same as choosing Menu->Exit.
+
+        // ask user if they want to save changes
+        ToolDialog td = new ToolDialog(PolicyTool.getMessage("Save.Changes"), tool, tw, true);
+        td.displayUserSave(ToolDialog.QUIT);
+
+        // the above method will perform the QUIT as long as the
+        // user does not CANCEL the request
+    }
+
+    public void windowClosed(WindowEvent we) {
+        System.exit(0);
+    }
+
+    public void windowIconified(WindowEvent we) {
+    }
+
+    public void windowDeiconified(WindowEvent we) {
+    }
+
+    public void windowActivated(WindowEvent we) {
+    }
+
+    public void windowDeactivated(WindowEvent we) {
+    }
+}
+
+/**
+ * Event handler for the Policy List
+ */
+class PolicyListListener extends MouseAdapter implements ActionListener {
+
+    private PolicyTool tool;
+    private ToolWindow tw;
+
+    PolicyListListener(PolicyTool tool, ToolWindow tw) {
+        this.tool = tool;
+        this.tw = tw;
+
+    }
+
+    public void actionPerformed(ActionEvent e) {
+
+        // display the permission list for a policy entry
+        ToolDialog td = new ToolDialog
+                (PolicyTool.getMessage("Policy.Entry"), tool, tw, true);
+        td.displayPolicyEntryDialog(true);
+    }
+
+    public void mouseClicked(MouseEvent evt) {
+        if (evt.getClickCount() == 2) {
+            actionPerformed(null);
+        }
+    }
+}
+
+/**
+ * Event handler for the File Menu
+ */
+class FileMenuListener implements ActionListener {
+
+    private PolicyTool tool;
+    private ToolWindow tw;
+
+    FileMenuListener(PolicyTool tool, ToolWindow tw) {
+        this.tool = tool;
+        this.tw = tw;
+    }
+
+    public void actionPerformed(ActionEvent e) {
+
+        if (PolicyTool.collator.compare(e.getActionCommand(),
+                                       ToolWindow.QUIT) == 0) {
+
+            // ask user if they want to save changes
+            ToolDialog td = new ToolDialog
+                (PolicyTool.getMessage("Save.Changes"), tool, tw, true);
+            td.displayUserSave(ToolDialog.QUIT);
+
+            // the above method will perform the QUIT as long as the
+            // user does not CANCEL the request
+
+        } else if (PolicyTool.collator.compare(e.getActionCommand(),
+                                   ToolWindow.NEW_POLICY_FILE) == 0) {
+
+            // ask user if they want to save changes
+            ToolDialog td = new ToolDialog
+                (PolicyTool.getMessage("Save.Changes"), tool, tw, true);
+            td.displayUserSave(ToolDialog.NEW);
+
+            // the above method will perform the NEW as long as the
+            // user does not CANCEL the request
+
+        } else if (PolicyTool.collator.compare(e.getActionCommand(),
+                                  ToolWindow.OPEN_POLICY_FILE) == 0) {
+
+            // ask user if they want to save changes
+            ToolDialog td = new ToolDialog
+                (PolicyTool.getMessage("Save.Changes"), tool, tw, true);
+            td.displayUserSave(ToolDialog.OPEN);
+
+            // the above method will perform the OPEN as long as the
+            // user does not CANCEL the request
+
+        } else if (PolicyTool.collator.compare(e.getActionCommand(),
+                                  ToolWindow.SAVE_POLICY_FILE) == 0) {
+
+            // get the previously entered filename
+            String filename = ((JTextField)tw.getComponent(
+                    ToolWindow.MW_FILENAME_TEXTFIELD)).getText();
+
+            // if there is no filename, do a SAVE_AS
+            if (filename == null || filename.length() == 0) {
+                // user wants to SAVE AS
+                ToolDialog td = new ToolDialog
+                        (PolicyTool.getMessage("Save.As"), tool, tw, true);
+                td.displaySaveAsDialog(ToolDialog.NOACTION);
+            } else {
+                try {
+                    // save the policy entries to a file
+                    tool.savePolicy(filename);
+
+                    // display status
+                    MessageFormat form = new MessageFormat
+                        (PolicyTool.getMessage
+                        ("Policy.successfully.written.to.filename"));
+                    Object[] source = {filename};
+                    tw.displayStatusDialog(null, form.format(source));
+                } catch (FileNotFoundException fnfe) {
+                    if (filename == null || filename.equals("")) {
+                        tw.displayErrorDialog(null, new FileNotFoundException
+                                (PolicyTool.getMessage("null.filename")));
+                    } else {
+                        tw.displayErrorDialog(null, fnfe);
+                    }
+                } catch (Exception ee) {
+                    tw.displayErrorDialog(null, ee);
+                }
+            }
+        } else if (PolicyTool.collator.compare(e.getActionCommand(),
+                               ToolWindow.SAVE_AS_POLICY_FILE) == 0) {
+
+            // user wants to SAVE AS
+            ToolDialog td = new ToolDialog
+                (PolicyTool.getMessage("Save.As"), tool, tw, true);
+            td.displaySaveAsDialog(ToolDialog.NOACTION);
+
+        } else if (PolicyTool.collator.compare(e.getActionCommand(),
+                                     ToolWindow.VIEW_WARNINGS) == 0) {
+            tw.displayWarningLog(null);
+        }
+    }
+}
+
+/**
+ * Event handler for the main window buttons and Edit Menu
+ */
+class MainWindowListener implements ActionListener {
+
+    private PolicyTool tool;
+    private ToolWindow tw;
+
+    MainWindowListener(PolicyTool tool, ToolWindow tw) {
+        this.tool = tool;
+        this.tw = tw;
+    }
+
+    public void actionPerformed(ActionEvent e) {
+
+        if (PolicyTool.collator.compare(e.getActionCommand(),
+                           ToolWindow.ADD_POLICY_ENTRY) == 0) {
+
+            // display a dialog box for the user to enter policy info
+            ToolDialog td = new ToolDialog
+                (PolicyTool.getMessage("Policy.Entry"), tool, tw, true);
+            td.displayPolicyEntryDialog(false);
+
+        } else if (PolicyTool.collator.compare(e.getActionCommand(),
+                               ToolWindow.REMOVE_POLICY_ENTRY) == 0) {
+
+            // get the selected entry
+            @SuppressWarnings("unchecked")
+            JList<String> list = (JList<String>)tw.getComponent(ToolWindow.MW_POLICY_LIST);
+            int index = list.getSelectedIndex();
+            if (index < 0) {
+                tw.displayErrorDialog(null, new Exception
+                        (PolicyTool.getMessage("No.Policy.Entry.selected")));
+                return;
+            }
+
+            // ask the user if they really want to remove the policy entry
+            ToolDialog td = new ToolDialog(PolicyTool.getMessage
+                ("Remove.Policy.Entry"), tool, tw, true);
+            td.displayConfirmRemovePolicyEntry();
+
+        } else if (PolicyTool.collator.compare(e.getActionCommand(),
+                                 ToolWindow.EDIT_POLICY_ENTRY) == 0) {
+
+            // get the selected entry
+            @SuppressWarnings("unchecked")
+            JList<String> list = (JList<String>)tw.getComponent(ToolWindow.MW_POLICY_LIST);
+            int index = list.getSelectedIndex();
+            if (index < 0) {
+                tw.displayErrorDialog(null, new Exception
+                        (PolicyTool.getMessage("No.Policy.Entry.selected")));
+                return;
+            }
+
+            // display the permission list for a policy entry
+            ToolDialog td = new ToolDialog
+                (PolicyTool.getMessage("Policy.Entry"), tool, tw, true);
+            td.displayPolicyEntryDialog(true);
+
+        } else if (PolicyTool.collator.compare(e.getActionCommand(),
+                                     ToolWindow.EDIT_KEYSTORE) == 0) {
+
+            // display a dialog box for the user to enter keystore info
+            ToolDialog td = new ToolDialog
+                (PolicyTool.getMessage("KeyStore"), tool, tw, true);
+            td.keyStoreDialog(ToolDialog.EDIT_KEYSTORE);
+        }
+    }
+}
+
+/**
+ * Event handler for AddEntryDoneButton button
+ *
+ * -- if edit is TRUE, then we are EDITing an existing PolicyEntry
+ *    and we need to update both the policy and the GUI listing.
+ *    if edit is FALSE, then we are ADDing a new PolicyEntry,
+ *    so we only need to update the GUI listing.
+ */
+class AddEntryDoneButtonListener implements ActionListener {
+
+    private PolicyTool tool;
+    private ToolWindow tw;
+    private ToolDialog td;
+    private boolean edit;
+
+    AddEntryDoneButtonListener(PolicyTool tool, ToolWindow tw,
+                                ToolDialog td, boolean edit) {
+        this.tool = tool;
+        this.tw = tw;
+        this.td = td;
+        this.edit = edit;
+    }
+
+    public void actionPerformed(ActionEvent e) {
+
+        try {
+            // get a PolicyEntry object from the dialog policy info
+            PolicyEntry newEntry = td.getPolicyEntryFromDialog();
+            PolicyParser.GrantEntry newGe = newEntry.getGrantEntry();
+
+            // see if all the signers have public keys
+            if (newGe.signedBy != null) {
+                String signers[] = tool.parseSigners(newGe.signedBy);
+                for (int i = 0; i < signers.length; i++) {
+                    PublicKey pubKey = tool.getPublicKeyAlias(signers[i]);
+                    if (pubKey == null) {
+                        MessageFormat form = new MessageFormat
+                            (PolicyTool.getMessage
+                            ("Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured."));
+                        Object[] source = {signers[i]};
+                        tool.warnings.addElement(form.format(source));
+                        tw.displayStatusDialog(td, form.format(source));
+                    }
+                }
+            }
+
+            // add the entry
+            @SuppressWarnings("unchecked")
+            JList<String> policyList = (JList<String>)tw.getComponent(ToolWindow.MW_POLICY_LIST);
+            if (edit) {
+                int listIndex = policyList.getSelectedIndex();
+                tool.addEntry(newEntry, listIndex);
+                String newCodeBaseStr = newEntry.headerToString();
+                if (PolicyTool.collator.compare
+                        (newCodeBaseStr, policyList.getModel().getElementAt(listIndex)) != 0)
+                    tool.modified = true;
+                ((DefaultListModel<String>)policyList.getModel()).set(listIndex, newCodeBaseStr);
+            } else {
+                tool.addEntry(newEntry, -1);
+                ((DefaultListModel<String>)policyList.getModel()).addElement(newEntry.headerToString());
+                tool.modified = true;
+            }
+            td.setVisible(false);
+            td.dispose();
+
+        } catch (Exception eee) {
+            tw.displayErrorDialog(td, eee);
+        }
+    }
+}
+
+/**
+ * Event handler for ChangeKeyStoreOKButton button
+ */
+class ChangeKeyStoreOKButtonListener implements ActionListener {
+
+    private PolicyTool tool;
+    private ToolWindow tw;
+    private ToolDialog td;
+
+    ChangeKeyStoreOKButtonListener(PolicyTool tool, ToolWindow tw,
+                ToolDialog td) {
+        this.tool = tool;
+        this.tw = tw;
+        this.td = td;
+    }
+
+    public void actionPerformed(ActionEvent e) {
+
+        String URLString = ((JTextField)td.getComponent(
+                ToolDialog.KSD_NAME_TEXTFIELD)).getText().trim();
+        String type = ((JTextField)td.getComponent(
+                ToolDialog.KSD_TYPE_TEXTFIELD)).getText().trim();
+        String provider = ((JTextField)td.getComponent(
+                ToolDialog.KSD_PROVIDER_TEXTFIELD)).getText().trim();
+        String pwdURL = ((JTextField)td.getComponent(
+                ToolDialog.KSD_PWD_URL_TEXTFIELD)).getText().trim();
+
+        try {
+            tool.openKeyStore
+                        ((URLString.length() == 0 ? null : URLString),
+                        (type.length() == 0 ? null : type),
+                        (provider.length() == 0 ? null : provider),
+                        (pwdURL.length() == 0 ? null : pwdURL));
+            tool.modified = true;
+        } catch (Exception ex) {
+            MessageFormat form = new MessageFormat(PolicyTool.getMessage
+                ("Unable.to.open.KeyStore.ex.toString."));
+            Object[] source = {ex.toString()};
+            tw.displayErrorDialog(td, form.format(source));
+            return;
+        }
+
+        td.dispose();
+    }
+}
+
+/**
+ * Event handler for AddPrinButton button
+ */
+class AddPrinButtonListener implements ActionListener {
+
+    private PolicyTool tool;
+    private ToolWindow tw;
+    private ToolDialog td;
+    private boolean editPolicyEntry;
+
+    AddPrinButtonListener(PolicyTool tool, ToolWindow tw,
+                                ToolDialog td, boolean editPolicyEntry) {
+        this.tool = tool;
+        this.tw = tw;
+        this.td = td;
+        this.editPolicyEntry = editPolicyEntry;
+    }
+
+    public void actionPerformed(ActionEvent e) {
+
+        // display a dialog box for the user to enter principal info
+        td.displayPrincipalDialog(editPolicyEntry, false);
+    }
+}
+
+/**
+ * Event handler for AddPermButton button
+ */
+class AddPermButtonListener implements ActionListener {
+
+    private PolicyTool tool;
+    private ToolWindow tw;
+    private ToolDialog td;
+    private boolean editPolicyEntry;
+
+    AddPermButtonListener(PolicyTool tool, ToolWindow tw,
+                                ToolDialog td, boolean editPolicyEntry) {
+        this.tool = tool;
+        this.tw = tw;
+        this.td = td;
+        this.editPolicyEntry = editPolicyEntry;
+    }
+
+    public void actionPerformed(ActionEvent e) {
+
+        // display a dialog box for the user to enter permission info
+        td.displayPermissionDialog(editPolicyEntry, false);
+    }
+}
+
+/**
+ * Event handler for AddPrinOKButton button
+ */
+class NewPolicyPrinOKButtonListener implements ActionListener {
+
+    private PolicyTool tool;
+    private ToolWindow tw;
+    private ToolDialog listDialog;
+    private ToolDialog infoDialog;
+    private boolean edit;
+
+    NewPolicyPrinOKButtonListener(PolicyTool tool,
+                                ToolWindow tw,
+                                ToolDialog listDialog,
+                                ToolDialog infoDialog,
+                                boolean edit) {
+        this.tool = tool;
+        this.tw = tw;
+        this.listDialog = listDialog;
+        this.infoDialog = infoDialog;
+        this.edit = edit;
+    }
+
+    public void actionPerformed(ActionEvent e) {
+
+        try {
+            // read in the new principal info from Dialog Box
+            PolicyParser.PrincipalEntry pppe =
+                        infoDialog.getPrinFromDialog();
+            if (pppe != null) {
+                try {
+                    tool.verifyPrincipal(pppe.getPrincipalClass(),
+                                        pppe.getPrincipalName());
+                } catch (ClassNotFoundException cnfe) {
+                    MessageFormat form = new MessageFormat
+                                (PolicyTool.getMessage
+                                ("Warning.Class.not.found.class"));
+                    Object[] source = {pppe.getPrincipalClass()};
+                    tool.warnings.addElement(form.format(source));
+                    tw.displayStatusDialog(infoDialog, form.format(source));
+                }
+
+                // add the principal to the GUI principal list
+                TaggedList prinList =
+                    (TaggedList)listDialog.getComponent(ToolDialog.PE_PRIN_LIST);
+
+                String prinString = ToolDialog.PrincipalEntryToUserFriendlyString(pppe);
+                if (edit) {
+                    // if editing, replace the original principal
+                    int index = prinList.getSelectedIndex();
+                    prinList.replaceTaggedItem(prinString, pppe, index);
+                } else {
+                    // if adding, just add it to the end
+                    prinList.addTaggedItem(prinString, pppe);
+                }
+            }
+            infoDialog.dispose();
+        } catch (Exception ee) {
+            tw.displayErrorDialog(infoDialog, ee);
+        }
+    }
+}
+
+/**
+ * Event handler for AddPermOKButton button
+ */
+class NewPolicyPermOKButtonListener implements ActionListener {
+
+    private PolicyTool tool;
+    private ToolWindow tw;
+    private ToolDialog listDialog;
+    private ToolDialog infoDialog;
+    private boolean edit;
+
+    NewPolicyPermOKButtonListener(PolicyTool tool,
+                                ToolWindow tw,
+                                ToolDialog listDialog,
+                                ToolDialog infoDialog,
+                                boolean edit) {
+        this.tool = tool;
+        this.tw = tw;
+        this.listDialog = listDialog;
+        this.infoDialog = infoDialog;
+        this.edit = edit;
+    }
+
+    public void actionPerformed(ActionEvent e) {
+
+        try {
+            // read in the new permission info from Dialog Box
+            PolicyParser.PermissionEntry pppe =
+                        infoDialog.getPermFromDialog();
+
+            try {
+                tool.verifyPermission(pppe.permission, pppe.name, pppe.action);
+            } catch (ClassNotFoundException cnfe) {
+                MessageFormat form = new MessageFormat(PolicyTool.getMessage
+                                ("Warning.Class.not.found.class"));
+                Object[] source = {pppe.permission};
+                tool.warnings.addElement(form.format(source));
+                tw.displayStatusDialog(infoDialog, form.format(source));
+            }
+
+            // add the permission to the GUI permission list
+            TaggedList permList =
+                (TaggedList)listDialog.getComponent(ToolDialog.PE_PERM_LIST);
+
+            String permString = ToolDialog.PermissionEntryToUserFriendlyString(pppe);
+            if (edit) {
+                // if editing, replace the original permission
+                int which = permList.getSelectedIndex();
+                permList.replaceTaggedItem(permString, pppe, which);
+            } else {
+                // if adding, just add it to the end
+                permList.addTaggedItem(permString, pppe);
+            }
+            infoDialog.dispose();
+
+        } catch (InvocationTargetException ite) {
+            tw.displayErrorDialog(infoDialog, ite.getTargetException());
+        } catch (Exception ee) {
+            tw.displayErrorDialog(infoDialog, ee);
+        }
+    }
+}
+
+/**
+ * Event handler for RemovePrinButton button
+ */
+class RemovePrinButtonListener implements ActionListener {
+
+    private PolicyTool tool;
+    private ToolWindow tw;
+    private ToolDialog td;
+    private boolean edit;
+
+    RemovePrinButtonListener(PolicyTool tool, ToolWindow tw,
+                                ToolDialog td, boolean edit) {
+        this.tool = tool;
+        this.tw = tw;
+        this.td = td;
+        this.edit = edit;
+    }
+
+    public void actionPerformed(ActionEvent e) {
+
+        // get the Principal selected from the Principal List
+        TaggedList prinList = (TaggedList)td.getComponent(
+                ToolDialog.PE_PRIN_LIST);
+        int prinIndex = prinList.getSelectedIndex();
+
+        if (prinIndex < 0) {
+            tw.displayErrorDialog(td, new Exception
+                (PolicyTool.getMessage("No.principal.selected")));
+            return;
+        }
+        // remove the principal from the display
+        prinList.removeTaggedItem(prinIndex);
+    }
+}
+
+/**
+ * Event handler for RemovePermButton button
+ */
+class RemovePermButtonListener implements ActionListener {
+
+    private PolicyTool tool;
+    private ToolWindow tw;
+    private ToolDialog td;
+    private boolean edit;
+
+    RemovePermButtonListener(PolicyTool tool, ToolWindow tw,
+                                ToolDialog td, boolean edit) {
+        this.tool = tool;
+        this.tw = tw;
+        this.td = td;
+        this.edit = edit;
+    }
+
+    public void actionPerformed(ActionEvent e) {
+
+        // get the Permission selected from the Permission List
+        TaggedList permList = (TaggedList)td.getComponent(
+                ToolDialog.PE_PERM_LIST);
+        int permIndex = permList.getSelectedIndex();
+
+        if (permIndex < 0) {
+            tw.displayErrorDialog(td, new Exception
+                (PolicyTool.getMessage("No.permission.selected")));
+            return;
+        }
+        // remove the permission from the display
+        permList.removeTaggedItem(permIndex);
+
+    }
+}
+
+/**
+ * Event handler for Edit Principal button
+ *
+ * We need the editPolicyEntry boolean to tell us if the user is
+ * adding a new PolicyEntry at this time, or editing an existing entry.
+ * If the user is adding a new PolicyEntry, we ONLY update the
+ * GUI listing.  If the user is editing an existing PolicyEntry, we
+ * update both the GUI listing and the actual PolicyEntry.
+ */
+class EditPrinButtonListener extends MouseAdapter implements ActionListener {
+
+    private PolicyTool tool;
+    private ToolWindow tw;
+    private ToolDialog td;
+    private boolean editPolicyEntry;
+
+    EditPrinButtonListener(PolicyTool tool, ToolWindow tw,
+                                ToolDialog td, boolean editPolicyEntry) {
+        this.tool = tool;
+        this.tw = tw;
+        this.td = td;
+        this.editPolicyEntry = editPolicyEntry;
+    }
+
+    public void actionPerformed(ActionEvent e) {
+
+        // get the Principal selected from the Principal List
+        TaggedList list = (TaggedList)td.getComponent(
+                ToolDialog.PE_PRIN_LIST);
+        int prinIndex = list.getSelectedIndex();
+
+        if (prinIndex < 0) {
+            tw.displayErrorDialog(td, new Exception
+                (PolicyTool.getMessage("No.principal.selected")));
+            return;
+        }
+        td.displayPrincipalDialog(editPolicyEntry, true);
+    }
+
+    public void mouseClicked(MouseEvent evt) {
+        if (evt.getClickCount() == 2) {
+            actionPerformed(null);
+        }
+    }
+}
+
+/**
+ * Event handler for Edit Permission button
+ *
+ * We need the editPolicyEntry boolean to tell us if the user is
+ * adding a new PolicyEntry at this time, or editing an existing entry.
+ * If the user is adding a new PolicyEntry, we ONLY update the
+ * GUI listing.  If the user is editing an existing PolicyEntry, we
+ * update both the GUI listing and the actual PolicyEntry.
+ */
+class EditPermButtonListener extends MouseAdapter implements ActionListener {
+
+    private PolicyTool tool;
+    private ToolWindow tw;
+    private ToolDialog td;
+    private boolean editPolicyEntry;
+
+    EditPermButtonListener(PolicyTool tool, ToolWindow tw,
+                                ToolDialog td, boolean editPolicyEntry) {
+        this.tool = tool;
+        this.tw = tw;
+        this.td = td;
+        this.editPolicyEntry = editPolicyEntry;
+    }
+
+    public void actionPerformed(ActionEvent e) {
+
+        // get the Permission selected from the Permission List
+        @SuppressWarnings("unchecked")
+        JList<String> list = (JList<String>)td.getComponent(ToolDialog.PE_PERM_LIST);
+        int permIndex = list.getSelectedIndex();
+
+        if (permIndex < 0) {
+            tw.displayErrorDialog(td, new Exception
+                (PolicyTool.getMessage("No.permission.selected")));
+            return;
+        }
+        td.displayPermissionDialog(editPolicyEntry, true);
+    }
+
+    public void mouseClicked(MouseEvent evt) {
+        if (evt.getClickCount() == 2) {
+            actionPerformed(null);
+        }
+    }
+}
+
+/**
+ * Event handler for Principal Popup Menu
+ */
+class PrincipalTypeMenuListener implements ItemListener {
+
+    private ToolDialog td;
+
+    PrincipalTypeMenuListener(ToolDialog td) {
+        this.td = td;
+    }
+
+    public void itemStateChanged(ItemEvent e) {
+        if (e.getStateChange() == ItemEvent.DESELECTED) {
+            // We're only interested in SELECTED events
+            return;
+        }
+
+        @SuppressWarnings("unchecked")
+        JComboBox<String> prin = (JComboBox<String>)td.getComponent(ToolDialog.PRD_PRIN_CHOICE);
+        JTextField prinField = (JTextField)td.getComponent(
+                ToolDialog.PRD_PRIN_TEXTFIELD);
+        JTextField nameField = (JTextField)td.getComponent(
+                ToolDialog.PRD_NAME_TEXTFIELD);
+
+        prin.getAccessibleContext().setAccessibleName(
+            PolicyTool.splitToWords((String)e.getItem()));
+        if (((String)e.getItem()).equals(ToolDialog.PRIN_TYPE)) {
+            // ignore if they choose "Principal Type:" item
+            if (prinField.getText() != null &&
+                prinField.getText().length() > 0) {
+                Prin inputPrin = ToolDialog.getPrin(prinField.getText(), true);
+                prin.setSelectedItem(inputPrin.CLASS);
+            }
+            return;
+        }
+
+        // if you change the principal, clear the name
+        if (prinField.getText().indexOf((String)e.getItem()) == -1) {
+            nameField.setText("");
+        }
+
+        // set the text in the textfield and also modify the
+        // pull-down choice menus to reflect the correct possible
+        // set of names and actions
+        Prin inputPrin = ToolDialog.getPrin((String)e.getItem(), false);
+        if (inputPrin != null) {
+            prinField.setText(inputPrin.FULL_CLASS);
+        }
+    }
+}
+
+/**
+ * Event handler for Permission Popup Menu
+ */
+class PermissionMenuListener implements ItemListener {
+
+    private ToolDialog td;
+
+    PermissionMenuListener(ToolDialog td) {
+        this.td = td;
+    }
+
+    public void itemStateChanged(ItemEvent e) {
+        if (e.getStateChange() == ItemEvent.DESELECTED) {
+            // We're only interested in SELECTED events
+            return;
+        }
+
+        @SuppressWarnings("unchecked")
+        JComboBox<String> perms = (JComboBox<String>)td.getComponent(
+                ToolDialog.PD_PERM_CHOICE);
+        @SuppressWarnings("unchecked")
+        JComboBox<String> names = (JComboBox<String>)td.getComponent(
+                ToolDialog.PD_NAME_CHOICE);
+        @SuppressWarnings("unchecked")
+        JComboBox<String> actions = (JComboBox<String>)td.getComponent(
+                ToolDialog.PD_ACTIONS_CHOICE);
+        JTextField nameField = (JTextField)td.getComponent(
+                ToolDialog.PD_NAME_TEXTFIELD);
+        JTextField actionsField = (JTextField)td.getComponent(
+                ToolDialog.PD_ACTIONS_TEXTFIELD);
+        JTextField permField = (JTextField)td.getComponent(
+                ToolDialog.PD_PERM_TEXTFIELD);
+        JTextField signedbyField = (JTextField)td.getComponent(
+                ToolDialog.PD_SIGNEDBY_TEXTFIELD);
+
+        perms.getAccessibleContext().setAccessibleName(
+            PolicyTool.splitToWords((String)e.getItem()));
+
+        // ignore if they choose the 'Permission:' item
+        if (PolicyTool.collator.compare((String)e.getItem(),
+                                      ToolDialog.PERM) == 0) {
+            if (permField.getText() != null &&
+                permField.getText().length() > 0) {
+
+                Perm inputPerm = ToolDialog.getPerm(permField.getText(), true);
+                if (inputPerm != null) {
+                    perms.setSelectedItem(inputPerm.CLASS);
+                }
+            }
+            return;
+        }
+
+        // if you change the permission, clear the name, actions, and signedBy
+        if (permField.getText().indexOf((String)e.getItem()) == -1) {
+            nameField.setText("");
+            actionsField.setText("");
+            signedbyField.setText("");
+        }
+
+        // set the text in the textfield and also modify the
+        // pull-down choice menus to reflect the correct possible
+        // set of names and actions
+
+        Perm inputPerm = ToolDialog.getPerm((String)e.getItem(), false);
+        if (inputPerm == null) {
+            permField.setText("");
+        } else {
+            permField.setText(inputPerm.FULL_CLASS);
+        }
+        td.setPermissionNames(inputPerm, names, nameField);
+        td.setPermissionActions(inputPerm, actions, actionsField);
+    }
+}
+
+/**
+ * Event handler for Permission Name Popup Menu
+ */
+class PermissionNameMenuListener implements ItemListener {
+
+    private ToolDialog td;
+
+    PermissionNameMenuListener(ToolDialog td) {
+        this.td = td;
+    }
+
+    public void itemStateChanged(ItemEvent e) {
+        if (e.getStateChange() == ItemEvent.DESELECTED) {
+            // We're only interested in SELECTED events
+            return;
+        }
+
+        @SuppressWarnings("unchecked")
+        JComboBox<String> names = (JComboBox<String>)td.getComponent(ToolDialog.PD_NAME_CHOICE);
+        names.getAccessibleContext().setAccessibleName(
+            PolicyTool.splitToWords((String)e.getItem()));
+
+        if (((String)e.getItem()).indexOf(ToolDialog.PERM_NAME) != -1)
+            return;
+
+        JTextField tf = (JTextField)td.getComponent(ToolDialog.PD_NAME_TEXTFIELD);
+        tf.setText((String)e.getItem());
+    }
+}
+
+/**
+ * Event handler for Permission Actions Popup Menu
+ */
+class PermissionActionsMenuListener implements ItemListener {
+
+    private ToolDialog td;
+
+    PermissionActionsMenuListener(ToolDialog td) {
+        this.td = td;
+    }
+
+    public void itemStateChanged(ItemEvent e) {
+        if (e.getStateChange() == ItemEvent.DESELECTED) {
+            // We're only interested in SELECTED events
+            return;
+        }
+
+        @SuppressWarnings("unchecked")
+        JComboBox<String> actions = (JComboBox<String>)td.getComponent(
+                ToolDialog.PD_ACTIONS_CHOICE);
+        actions.getAccessibleContext().setAccessibleName((String)e.getItem());
+
+        if (((String)e.getItem()).indexOf(ToolDialog.PERM_ACTIONS) != -1)
+            return;
+
+        JTextField tf = (JTextField)td.getComponent(
+                ToolDialog.PD_ACTIONS_TEXTFIELD);
+        if (tf.getText() == null || tf.getText().equals("")) {
+            tf.setText((String)e.getItem());
+        } else {
+            if (tf.getText().indexOf((String)e.getItem()) == -1)
+                tf.setText(tf.getText() + ", " + (String)e.getItem());
+        }
+    }
+}
+
+/**
+ * Event handler for all the children dialogs/windows
+ */
+class ChildWindowListener implements WindowListener {
+
+    private ToolDialog td;
+
+    ChildWindowListener(ToolDialog td) {
+        this.td = td;
+    }
+
+    public void windowOpened(WindowEvent we) {
+    }
+
+    public void windowClosing(WindowEvent we) {
+        // same as pressing the "cancel" button
+        td.setVisible(false);
+        td.dispose();
+    }
+
+    public void windowClosed(WindowEvent we) {
+    }
+
+    public void windowIconified(WindowEvent we) {
+    }
+
+    public void windowDeiconified(WindowEvent we) {
+    }
+
+    public void windowActivated(WindowEvent we) {
+    }
+
+    public void windowDeactivated(WindowEvent we) {
+    }
+}
+
+/**
+ * Event handler for CancelButton button
+ */
+class CancelButtonListener implements ActionListener {
+
+    private ToolDialog td;
+
+    CancelButtonListener(ToolDialog td) {
+        this.td = td;
+    }
+
+    public void actionPerformed(ActionEvent e) {
+        td.setVisible(false);
+        td.dispose();
+    }
+}
+
+/**
+ * Event handler for ErrorOKButton button
+ */
+class ErrorOKButtonListener implements ActionListener {
+
+    private ToolDialog ed;
+
+    ErrorOKButtonListener(ToolDialog ed) {
+        this.ed = ed;
+    }
+
+    public void actionPerformed(ActionEvent e) {
+        ed.setVisible(false);
+        ed.dispose();
+    }
+}
+
+/**
+ * Event handler for StatusOKButton button
+ */
+class StatusOKButtonListener implements ActionListener {
+
+    private ToolDialog sd;
+
+    StatusOKButtonListener(ToolDialog sd) {
+        this.sd = sd;
+    }
+
+    public void actionPerformed(ActionEvent e) {
+        sd.setVisible(false);
+        sd.dispose();
+    }
+}
+
+/**
+ * Event handler for UserSaveYes button
+ */
+class UserSaveYesButtonListener implements ActionListener {
+
+    private ToolDialog us;
+    private PolicyTool tool;
+    private ToolWindow tw;
+    private int select;
+
+    UserSaveYesButtonListener(ToolDialog us, PolicyTool tool,
+                        ToolWindow tw, int select) {
+        this.us = us;
+        this.tool = tool;
+        this.tw = tw;
+        this.select = select;
+    }
+
+    public void actionPerformed(ActionEvent e) {
+
+        // first get rid of the window
+        us.setVisible(false);
+        us.dispose();
+
+        try {
+            String filename = ((JTextField)tw.getComponent(
+                    ToolWindow.MW_FILENAME_TEXTFIELD)).getText();
+            if (filename == null || filename.equals("")) {
+                us.displaySaveAsDialog(select);
+
+                // the above dialog will continue with the originally
+                // requested command if necessary
+            } else {
+                // save the policy entries to a file
+                tool.savePolicy(filename);
+
+                // display status
+                MessageFormat form = new MessageFormat
+                        (PolicyTool.getMessage
+                        ("Policy.successfully.written.to.filename"));
+                Object[] source = {filename};
+                tw.displayStatusDialog(null, form.format(source));
+
+                // now continue with the originally requested command
+                // (QUIT, NEW, or OPEN)
+                us.userSaveContinue(tool, tw, us, select);
+            }
+        } catch (Exception ee) {
+            // error -- just report it and bail
+            tw.displayErrorDialog(null, ee);
+        }
+    }
+}
+
+/**
+ * Event handler for UserSaveNoButton
+ */
+class UserSaveNoButtonListener implements ActionListener {
+
+    private PolicyTool tool;
+    private ToolWindow tw;
+    private ToolDialog us;
+    private int select;
+
+    UserSaveNoButtonListener(ToolDialog us, PolicyTool tool,
+                        ToolWindow tw, int select) {
+        this.us = us;
+        this.tool = tool;
+        this.tw = tw;
+        this.select = select;
+    }
+
+    public void actionPerformed(ActionEvent e) {
+        us.setVisible(false);
+        us.dispose();
+
+        // now continue with the originally requested command
+        // (QUIT, NEW, or OPEN)
+        us.userSaveContinue(tool, tw, us, select);
+    }
+}
+
+/**
+ * Event handler for UserSaveCancelButton
+ */
+class UserSaveCancelButtonListener implements ActionListener {
+
+    private ToolDialog us;
+
+    UserSaveCancelButtonListener(ToolDialog us) {
+        this.us = us;
+    }
+
+    public void actionPerformed(ActionEvent e) {
+        us.setVisible(false);
+        us.dispose();
+
+        // do NOT continue with the originally requested command
+        // (QUIT, NEW, or OPEN)
+    }
+}
+
+/**
+ * Event handler for ConfirmRemovePolicyEntryOKButtonListener
+ */
+class ConfirmRemovePolicyEntryOKButtonListener implements ActionListener {
+
+    private PolicyTool tool;
+    private ToolWindow tw;
+    private ToolDialog us;
+
+    ConfirmRemovePolicyEntryOKButtonListener(PolicyTool tool,
+                                ToolWindow tw, ToolDialog us) {
+        this.tool = tool;
+        this.tw = tw;
+        this.us = us;
+    }
+
+    public void actionPerformed(ActionEvent e) {
+        // remove the entry
+        @SuppressWarnings("unchecked")
+        JList<String> list = (JList<String>)tw.getComponent(ToolWindow.MW_POLICY_LIST);
+        int index = list.getSelectedIndex();
+        PolicyEntry entries[] = tool.getEntry();
+        tool.removeEntry(entries[index]);
+
+        // redraw the window listing
+        DefaultListModel<String> listModel = new DefaultListModel<>();
+        list = new JList<>(listModel);
+        list.setVisibleRowCount(15);
+        list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+        list.addMouseListener(new PolicyListListener(tool, tw));
+        entries = tool.getEntry();
+        if (entries != null) {
+                for (int i = 0; i < entries.length; i++) {
+                    listModel.addElement(entries[i].headerToString());
+                }
+        }
+        tw.replacePolicyList(list);
+        us.setVisible(false);
+        us.dispose();
+    }
+}
+
+/**
+ * Just a special name, so that the codes dealing with this exception knows
+ * it's special, and does not pop out a warning box.
+ */
+class NoDisplayException extends RuntimeException {
+    private static final long serialVersionUID = -4611761427108719794L;
+}
+
+/**
+ * This is a java.awt.List that bind an Object to each String it holds.
+ */
+class TaggedList extends JList<String> {
+    private static final long serialVersionUID = -5676238110427785853L;
+
+    private java.util.List<Object> data = new LinkedList<>();
+    public TaggedList(int i, boolean b) {
+        super(new DefaultListModel<>());
+        setVisibleRowCount(i);
+        setSelectionMode(b ? ListSelectionModel.MULTIPLE_INTERVAL_SELECTION : ListSelectionModel.SINGLE_SELECTION);
+    }
+
+    public Object getObject(int index) {
+        return data.get(index);
+    }
+
+    public void addTaggedItem(String string, Object object) {
+        ((DefaultListModel<String>)getModel()).addElement(string);
+        data.add(object);
+    }
+
+    public void replaceTaggedItem(String string, Object object, int index) {
+        ((DefaultListModel<String>)getModel()).set(index, string);
+        data.set(index, object);
+    }
+
+    public void removeTaggedItem(int index) {
+        ((DefaultListModel<String>)getModel()).remove(index);
+        data.remove(index);
+    }
+}
+
+/**
+ * Convenience Principal Classes
+ */
+
+class Prin {
+    public final String CLASS;
+    public final String FULL_CLASS;
+
+    public Prin(String clazz, String fullClass) {
+        this.CLASS = clazz;
+        this.FULL_CLASS = fullClass;
+    }
+}
+
+class KrbPrin extends Prin {
+    public KrbPrin() {
+        super("KerberosPrincipal",
+                "javax.security.auth.kerberos.KerberosPrincipal");
+    }
+}
+
+class X500Prin extends Prin {
+    public X500Prin() {
+        super("X500Principal",
+                "javax.security.auth.x500.X500Principal");
+    }
+}
+
+/**
+ * Convenience Permission Classes
+ */
+
+class Perm {
+    public final String CLASS;
+    public final String FULL_CLASS;
+    public final String[] TARGETS;
+    public final String[] ACTIONS;
+
+    public Perm(String clazz, String fullClass,
+                String[] targets, String[] actions) {
+
+        this.CLASS = clazz;
+        this.FULL_CLASS = fullClass;
+        this.TARGETS = targets;
+        this.ACTIONS = actions;
+    }
+}
+
+class AllPerm extends Perm {
+    public AllPerm() {
+        super("AllPermission", "java.security.AllPermission", null, null);
+    }
+}
+
+class AudioPerm extends Perm {
+    public AudioPerm() {
+        super("AudioPermission",
+        "javax.sound.sampled.AudioPermission",
+        new String[]    {
+                "play",
+                "record"
+                },
+        null);
+    }
+}
+
+class AuthPerm extends Perm {
+    public AuthPerm() {
+    super("AuthPermission",
+        "javax.security.auth.AuthPermission",
+        new String[]    {
+                "doAs",
+                "doAsPrivileged",
+                "getSubject",
+                "getSubjectFromDomainCombiner",
+                "setReadOnly",
+                "modifyPrincipals",
+                "modifyPublicCredentials",
+                "modifyPrivateCredentials",
+                "refreshCredential",
+                "destroyCredential",
+                "createLoginContext.<" + PolicyTool.getMessage("name") + ">",
+                "getLoginConfiguration",
+                "setLoginConfiguration",
+                "createLoginConfiguration.<" +
+                        PolicyTool.getMessage("configuration.type") + ">",
+                "refreshLoginConfiguration"
+                },
+        null);
+    }
+}
+
+class AWTPerm extends Perm {
+    public AWTPerm() {
+    super("AWTPermission",
+        "java.awt.AWTPermission",
+        new String[]    {
+                "accessClipboard",
+                "accessEventQueue",
+                "accessSystemTray",
+                "createRobot",
+                "fullScreenExclusive",
+                "listenToAllAWTEvents",
+                "readDisplayPixels",
+                "replaceKeyboardFocusManager",
+                "setAppletStub",
+                "setWindowAlwaysOnTop",
+                "showWindowWithoutWarningBanner",
+                "toolkitModality",
+                "watchMousePointer"
+        },
+        null);
+    }
+}
+
+class DelegationPerm extends Perm {
+    public DelegationPerm() {
+    super("DelegationPermission",
+        "javax.security.auth.kerberos.DelegationPermission",
+        new String[]    {
+                // allow user input
+                },
+        null);
+    }
+}
+
+class FilePerm extends Perm {
+    public FilePerm() {
+    super("FilePermission",
+        "java.io.FilePermission",
+        new String[]    {
+                "<<ALL FILES>>"
+                },
+        new String[]    {
+                "read",
+                "write",
+                "delete",
+                "execute"
+                });
+    }
+}
+
+class URLPerm extends Perm {
+    public URLPerm() {
+        super("URLPermission",
+                "java.net.URLPermission",
+                new String[]    {
+                    "<"+ PolicyTool.getMessage("url") + ">",
+                },
+                new String[]    {
+                    "<" + PolicyTool.getMessage("method.list") + ">:<"
+                        + PolicyTool.getMessage("request.headers.list") + ">",
+                });
+    }
+}
+
+class InqSecContextPerm extends Perm {
+    public InqSecContextPerm() {
+    super("InquireSecContextPermission",
+        "com.sun.security.jgss.InquireSecContextPermission",
+        new String[]    {
+                "KRB5_GET_SESSION_KEY",
+                "KRB5_GET_TKT_FLAGS",
+                "KRB5_GET_AUTHZ_DATA",
+                "KRB5_GET_AUTHTIME"
+                },
+        null);
+    }
+}
+
+class LogPerm extends Perm {
+    public LogPerm() {
+    super("LoggingPermission",
+        "java.util.logging.LoggingPermission",
+        new String[]    {
+                "control"
+                },
+        null);
+    }
+}
+
+class MgmtPerm extends Perm {
+    public MgmtPerm() {
+    super("ManagementPermission",
+        "java.lang.management.ManagementPermission",
+        new String[]    {
+                "control",
+                "monitor"
+                },
+        null);
+    }
+}
+
+class MBeanPerm extends Perm {
+    public MBeanPerm() {
+    super("MBeanPermission",
+        "javax.management.MBeanPermission",
+        new String[]    {
+                // allow user input
+                },
+        new String[]    {
+                "addNotificationListener",
+                "getAttribute",
+                "getClassLoader",
+                "getClassLoaderFor",
+                "getClassLoaderRepository",
+                "getDomains",
+                "getMBeanInfo",
+                "getObjectInstance",
+                "instantiate",
+                "invoke",
+                "isInstanceOf",
+                "queryMBeans",
+                "queryNames",
+                "registerMBean",
+                "removeNotificationListener",
+                "setAttribute",
+                "unregisterMBean"
+                });
+    }
+}
+
+class MBeanSvrPerm extends Perm {
+    public MBeanSvrPerm() {
+    super("MBeanServerPermission",
+        "javax.management.MBeanServerPermission",
+        new String[]    {
+                "createMBeanServer",
+                "findMBeanServer",
+                "newMBeanServer",
+                "releaseMBeanServer"
+                },
+        null);
+    }
+}
+
+class MBeanTrustPerm extends Perm {
+    public MBeanTrustPerm() {
+    super("MBeanTrustPermission",
+        "javax.management.MBeanTrustPermission",
+        new String[]    {
+                "register"
+                },
+        null);
+    }
+}
+
+class NetPerm extends Perm {
+    public NetPerm() {
+    super("NetPermission",
+        "java.net.NetPermission",
+        new String[]    {
+                "allowHttpTrace",
+                "setDefaultAuthenticator",
+                "requestPasswordAuthentication",
+                "specifyStreamHandler",
+                "getNetworkInformation",
+                "setProxySelector",
+                "getProxySelector",
+                "setCookieHandler",
+                "getCookieHandler",
+                "setResponseCache",
+                "getResponseCache"
+                },
+        null);
+    }
+}
+
+class NetworkPerm extends Perm {
+    public NetworkPerm() {
+    super("NetworkPermission",
+        "jdk.net.NetworkPermission",
+        new String[]    {
+                "setOption.SO_FLOW_SLA",
+                "getOption.SO_FLOW_SLA"
+                },
+        null);
+    }
+}
+
+class PrivCredPerm extends Perm {
+    public PrivCredPerm() {
+    super("PrivateCredentialPermission",
+        "javax.security.auth.PrivateCredentialPermission",
+        new String[]    {
+                // allow user input
+                },
+        new String[]    {
+                "read"
+                });
+    }
+}
+
+class PropPerm extends Perm {
+    public PropPerm() {
+    super("PropertyPermission",
+        "java.util.PropertyPermission",
+        new String[]    {
+                // allow user input
+                },
+        new String[]    {
+                "read",
+                "write"
+                });
+    }
+}
+
+class ReflectPerm extends Perm {
+    public ReflectPerm() {
+    super("ReflectPermission",
+        "java.lang.reflect.ReflectPermission",
+        new String[]    {
+                "suppressAccessChecks"
+                },
+        null);
+    }
+}
+
+class RuntimePerm extends Perm {
+    public RuntimePerm() {
+    super("RuntimePermission",
+        "java.lang.RuntimePermission",
+        new String[]    {
+                "createClassLoader",
+                "getClassLoader",
+                "setContextClassLoader",
+                "enableContextClassLoaderOverride",
+                "setSecurityManager",
+                "createSecurityManager",
+                "getenv.<" +
+                    PolicyTool.getMessage("environment.variable.name") + ">",
+                "exitVM",
+                "shutdownHooks",
+                "setFactory",
+                "setIO",
+                "modifyThread",
+                "stopThread",
+                "modifyThreadGroup",
+                "getProtectionDomain",
+                "readFileDescriptor",
+                "writeFileDescriptor",
+                "loadLibrary.<" +
+                    PolicyTool.getMessage("library.name") + ">",
+                "accessClassInPackage.<" +
+                    PolicyTool.getMessage("package.name")+">",
+                "defineClassInPackage.<" +
+                    PolicyTool.getMessage("package.name")+">",
+                "accessDeclaredMembers",
+                "queuePrintJob",
+                "getStackTrace",
+                "setDefaultUncaughtExceptionHandler",
+                "preferences",
+                "usePolicy",
+                // "inheritedChannel"
+                },
+        null);
+    }
+}
+
+class SecurityPerm extends Perm {
+    public SecurityPerm() {
+    super("SecurityPermission",
+        "java.security.SecurityPermission",
+        new String[]    {
+                "createAccessControlContext",
+                "getDomainCombiner",
+                "getPolicy",
+                "setPolicy",
+                "createPolicy.<" +
+                    PolicyTool.getMessage("policy.type") + ">",
+                "getProperty.<" +
+                    PolicyTool.getMessage("property.name") + ">",
+                "setProperty.<" +
+                    PolicyTool.getMessage("property.name") + ">",
+                "insertProvider.<" +
+                    PolicyTool.getMessage("provider.name") + ">",
+                "removeProvider.<" +
+                    PolicyTool.getMessage("provider.name") + ">",
+                //"setSystemScope",
+                //"setIdentityPublicKey",
+                //"setIdentityInfo",
+                //"addIdentityCertificate",
+                //"removeIdentityCertificate",
+                //"printIdentity",
+                "clearProviderProperties.<" +
+                    PolicyTool.getMessage("provider.name") + ">",
+                "putProviderProperty.<" +
+                    PolicyTool.getMessage("provider.name") + ">",
+                "removeProviderProperty.<" +
+                    PolicyTool.getMessage("provider.name") + ">",
+                //"getSignerPrivateKey",
+                //"setSignerKeyPair"
+                },
+        null);
+    }
+}
+
+class SerialPerm extends Perm {
+    public SerialPerm() {
+    super("SerializablePermission",
+        "java.io.SerializablePermission",
+        new String[]    {
+                "enableSubclassImplementation",
+                "enableSubstitution"
+                },
+        null);
+    }
+}
+
+class ServicePerm extends Perm {
+    public ServicePerm() {
+    super("ServicePermission",
+        "javax.security.auth.kerberos.ServicePermission",
+        new String[]    {
+                // allow user input
+                },
+        new String[]    {
+                "initiate",
+                "accept"
+                });
+    }
+}
+
+class SocketPerm extends Perm {
+    public SocketPerm() {
+    super("SocketPermission",
+        "java.net.SocketPermission",
+        new String[]    {
+                // allow user input
+                },
+        new String[]    {
+                "accept",
+                "connect",
+                "listen",
+                "resolve"
+                });
+    }
+}
+
+class SQLPerm extends Perm {
+    public SQLPerm() {
+    super("SQLPermission",
+        "java.sql.SQLPermission",
+        new String[]    {
+                "setLog",
+                "callAbort",
+                "setSyncFactory",
+                "setNetworkTimeout",
+                },
+        null);
+    }
+}
+
+class SSLPerm extends Perm {
+    public SSLPerm() {
+    super("SSLPermission",
+        "javax.net.ssl.SSLPermission",
+        new String[]    {
+                "setHostnameVerifier",
+                "getSSLSessionContext"
+                },
+        null);
+    }
+}
+
+class SubjDelegPerm extends Perm {
+    public SubjDelegPerm() {
+    super("SubjectDelegationPermission",
+        "javax.management.remote.SubjectDelegationPermission",
+        new String[]    {
+                // allow user input
+                },
+        null);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,164 @@
+/*
+ * Copyright (c) 2000, 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.security.tools.policytool;
+
+/**
+ * <p> This class represents the <code>ResourceBundle</code>
+ * for the policytool.
+ *
+ */
+public class Resources extends java.util.ListResourceBundle {
+
+    private static final Object[][] contents = {
+        {"NEWLINE", "\n"},
+        {"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.",
+                "Warning: A public key for alias {0} does not exist.  Make sure a KeyStore is properly configured."},
+        {"Warning.Class.not.found.class", "Warning: Class not found: {0}"},
+        {"Warning.Invalid.argument.s.for.constructor.arg",
+                "Warning: Invalid argument(s) for constructor: {0}"},
+        {"Illegal.Principal.Type.type", "Illegal Principal Type: {0}"},
+        {"Illegal.option.option", "Illegal option: {0}"},
+        {"Usage.policytool.options.", "Usage: policytool [options]"},
+        {".file.file.policy.file.location",
+                "  [-file <file>]    policy file location"},
+        {"New", "&New"},
+        {"Open", "&Open..."},
+        {"Save", "&Save"},
+        {"Save.As", "Save &As..."},
+        {"View.Warning.Log", "View &Warning Log"},
+        {"Exit", "E&xit"},
+        {"Add.Policy.Entry", "&Add Policy Entry"},
+        {"Edit.Policy.Entry", "&Edit Policy Entry"},
+        {"Remove.Policy.Entry", "&Remove Policy Entry"},
+        {"Edit", "&Edit"},
+        {"Retain", "Retain"},
+
+        {"Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes",
+            "Warning: File name may include escaped backslash characters. " +
+                        "It is not necessary to escape backslash characters " +
+                        "(the tool escapes characters as necessary when writing " +
+                        "the policy contents to the persistent store).\n\n" +
+                        "Click on Retain to retain the entered name, or click on " +
+                        "Edit to edit the name."},
+
+        {"Add.Public.Key.Alias", "Add Public Key Alias"},
+        {"Remove.Public.Key.Alias", "Remove Public Key Alias"},
+        {"File", "&File"},
+        {"KeyStore", "&KeyStore"},
+        {"Policy.File.", "Policy File:"},
+        {"Could.not.open.policy.file.policyFile.e.toString.",
+                "Could not open policy file: {0}: {1}"},
+        {"Policy.Tool", "Policy Tool"},
+        {"Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.",
+                "Errors have occurred while opening the policy configuration.  View the Warning Log for more information."},
+        {"Error", "Error"},
+        {"OK", "OK"},
+        {"Status", "Status"},
+        {"Warning", "Warning"},
+        {"Permission.",
+                "Permission:                                                       "},
+        {"Principal.Type.", "Principal Type:"},
+        {"Principal.Name.", "Principal Name:"},
+        {"Target.Name.",
+                "Target Name:                                                    "},
+        {"Actions.",
+                "Actions:                                                             "},
+        {"OK.to.overwrite.existing.file.filename.",
+                "OK to overwrite existing file {0}?"},
+        {"Cancel", "Cancel"},
+        {"CodeBase.", "&CodeBase:"},
+        {"SignedBy.", "&SignedBy:"},
+        {"Add.Principal", "&Add Principal"},
+        {"Edit.Principal", "&Edit Principal"},
+        {"Remove.Principal", "&Remove Principal"},
+        {"Principals.", "&Principals:"},
+        {".Add.Permission", "  A&dd Permission"},
+        {".Edit.Permission", "  Ed&it Permission"},
+        {"Remove.Permission", "Re&move Permission"},
+        {"Done", "Done"},
+        {"KeyStore.URL.", "KeyStore &URL:"},
+        {"KeyStore.Type.", "KeyStore &Type:"},
+        {"KeyStore.Provider.", "KeyStore &Provider:"},
+        {"KeyStore.Password.URL.", "KeyStore Pass&word URL:"},
+        {"Principals", "Principals"},
+        {".Edit.Principal.", "  Edit Principal:"},
+        {".Add.New.Principal.", "  Add New Principal:"},
+        {"Permissions", "Permissions"},
+        {".Edit.Permission.", "  Edit Permission:"},
+        {".Add.New.Permission.", "  Add New Permission:"},
+        {"Signed.By.", "Signed By:"},
+        {"Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name",
+            "Cannot Specify Principal with a Wildcard Class without a Wildcard Name"},
+        {"Cannot.Specify.Principal.without.a.Name",
+            "Cannot Specify Principal without a Name"},
+        {"Permission.and.Target.Name.must.have.a.value",
+                "Permission and Target Name must have a value"},
+        {"Remove.this.Policy.Entry.", "Remove this Policy Entry?"},
+        {"Overwrite.File", "Overwrite File"},
+        {"Policy.successfully.written.to.filename",
+                "Policy successfully written to {0}"},
+        {"null.filename", "null filename"},
+        {"Save.changes.", "Save changes?"},
+        {"Yes", "&Yes"},
+        {"No", "&No"},
+        {"Policy.Entry", "Policy Entry"},
+        {"Save.Changes", "Save Changes"},
+        {"No.Policy.Entry.selected", "No Policy Entry selected"},
+        {"Unable.to.open.KeyStore.ex.toString.",
+                "Unable to open KeyStore: {0}"},
+        {"No.principal.selected", "No principal selected"},
+        {"No.permission.selected", "No permission selected"},
+        {"name", "name"},
+        {"configuration.type", "configuration type"},
+        {"environment.variable.name", "environment variable name"},
+        {"library.name", "library name"},
+        {"package.name", "package name"},
+        {"policy.type", "policy type"},
+        {"property.name", "property name"},
+        {"provider.name", "provider name"},
+        {"url", "url"},
+        {"method.list", "method list"},
+        {"request.headers.list", "request headers list"},
+        {"Principal.List", "Principal List"},
+        {"Permission.List", "Permission List"},
+        {"Code.Base", "Code Base"},
+        {"KeyStore.U.R.L.", "KeyStore U R L:"},
+        {"KeyStore.Password.U.R.L.", "KeyStore Password U R L:"}
+    };
+
+
+    /**
+     * Returns the contents of this <code>ResourceBundle</code>.
+     *
+     * <p>
+     *
+     * @return the contents of this <code>ResourceBundle</code>.
+     */
+    @Override
+    public Object[][] getContents() {
+        return contents;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_de.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,159 @@
+/*
+ * Copyright (c) 2000, 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.security.tools.policytool;
+
+/**
+ * <p> This class represents the <code>ResourceBundle</code>
+ * for the policytool.
+ *
+ */
+public class Resources_de extends java.util.ListResourceBundle {
+
+    private static final Object[][] contents = {
+        {"NEWLINE", "\n"},
+        {"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.",
+                "Warnung: Kein Public Key f\u00FCr Alias {0} vorhanden. Vergewissern Sie sich, dass der KeyStore ordnungsgem\u00E4\u00DF konfiguriert ist."},
+        {"Warning.Class.not.found.class", "Warnung: Klasse nicht gefunden: {0}"},
+        {"Warning.Invalid.argument.s.for.constructor.arg",
+                "Warnung: Ung\u00FCltige(s) Argument(e) f\u00FCr Constructor: {0}"},
+        {"Illegal.Principal.Type.type", "Ung\u00FCltiger Principal-Typ: {0}"},
+        {"Illegal.option.option", "Ung\u00FCltige Option: {0}"},
+        {"Usage.policytool.options.", "Verwendung: policytool [Optionen]"},
+        {".file.file.policy.file.location",
+                " [-file <Datei>]    Policy-Dateiverzeichnis"},
+        {"New", "Neu"},
+        {"Open", "\u00D6ffnen"},
+        {"Save", "Speichern"},
+        {"Save.As", "Speichern unter"},
+        {"View.Warning.Log", "Warnungslog anzeigen"},
+        {"Exit", "Beenden"},
+        {"Add.Policy.Entry", "Policy-Eintrag hinzuf\u00FCgen"},
+        {"Edit.Policy.Entry", "Policy-Eintrag bearbeiten"},
+        {"Remove.Policy.Entry", "Policy-Eintrag entfernen"},
+        {"Edit", "Bearbeiten"},
+        {"Retain", "Beibehalten"},
+
+        {"Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes",
+            "Warnung: M\u00F6glicherweise enth\u00E4lt der Dateiname Escapezeichen mit Backslash. Es ist nicht notwendig, Backslash-Zeichen zu escapen (das Tool f\u00FChrt dies automatisch beim Schreiben des Policy-Contents in den persistenten Speicher aus).\n\nKlicken Sie auf \"Beibehalten\", um den eingegebenen Namen beizubehalten oder auf \"Bearbeiten\", um den Namen zu bearbeiten."},
+
+        {"Add.Public.Key.Alias", "Public Key-Alias hinzuf\u00FCgen"},
+        {"Remove.Public.Key.Alias", "Public Key-Alias entfernen"},
+        {"File", "Datei"},
+        {"KeyStore", "KeyStore"},
+        {"Policy.File.", "Policy-Datei:"},
+        {"Could.not.open.policy.file.policyFile.e.toString.",
+                "Policy-Datei konnte nicht ge\u00F6ffnet werden: {0}: {1}"},
+        {"Policy.Tool", "Policy-Tool"},
+        {"Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.",
+                "Beim \u00D6ffnen der Policy-Konfiguration sind Fehler aufgetreten. Weitere Informationen finden Sie im Warnungslog."},
+        {"Error", "Fehler"},
+        {"OK", "OK"},
+        {"Status", "Status"},
+        {"Warning", "Warnung"},
+        {"Permission.",
+                "Berechtigung:                                                       "},
+        {"Principal.Type.", "Principal-Typ:"},
+        {"Principal.Name.", "Principal-Name:"},
+        {"Target.Name.",
+                "Zielname:                                                    "},
+        {"Actions.",
+                "Aktionen:                                                             "},
+        {"OK.to.overwrite.existing.file.filename.",
+                "Vorhandene Datei {0} \u00FCberschreiben?"},
+        {"Cancel", "Abbrechen"},
+        {"CodeBase.", "CodeBase:"},
+        {"SignedBy.", "SignedBy:"},
+        {"Add.Principal", "Principal hinzuf\u00FCgen"},
+        {"Edit.Principal", "Principal bearbeiten"},
+        {"Remove.Principal", "Principal entfernen"},
+        {"Principals.", "Principals:"},
+        {".Add.Permission", "  Berechtigung hinzuf\u00FCgen"},
+        {".Edit.Permission", "  Berechtigung bearbeiten"},
+        {"Remove.Permission", "Berechtigung entfernen"},
+        {"Done", "Fertig"},
+        {"KeyStore.URL.", "KeyStore-URL:"},
+        {"KeyStore.Type.", "KeyStore-Typ:"},
+        {"KeyStore.Provider.", "KeyStore-Provider:"},
+        {"KeyStore.Password.URL.", "KeyStore-Kennwort-URL:"},
+        {"Principals", "Principals"},
+        {".Edit.Principal.", "  Principal bearbeiten:"},
+        {".Add.New.Principal.", "  Neuen Principal hinzuf\u00FCgen:"},
+        {"Permissions", "Berechtigungen"},
+        {".Edit.Permission.", "  Berechtigung bearbeiten:"},
+        {".Add.New.Permission.", "  Neue Berechtigung hinzuf\u00FCgen:"},
+        {"Signed.By.", "Signiert von:"},
+        {"Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name",
+            "Principal kann nicht mit einer Platzhalterklasse ohne Platzhalternamen angegeben werden"},
+        {"Cannot.Specify.Principal.without.a.Name",
+            "Principal kann nicht ohne einen Namen angegeben werden"},
+        {"Permission.and.Target.Name.must.have.a.value",
+                "Berechtigung und Zielname m\u00FCssen einen Wert haben"},
+        {"Remove.this.Policy.Entry.", "Diesen Policy-Eintrag entfernen?"},
+        {"Overwrite.File", "Datei \u00FCberschreiben"},
+        {"Policy.successfully.written.to.filename",
+                "Policy erfolgreich in {0} geschrieben"},
+        {"null.filename", "Null-Dateiname"},
+        {"Save.changes.", "\u00C4nderungen speichern?"},
+        {"Yes", "Ja"},
+        {"No", "Nein"},
+        {"Policy.Entry", "Policy-Eintrag"},
+        {"Save.Changes", "\u00C4nderungen speichern"},
+        {"No.Policy.Entry.selected", "Kein Policy-Eintrag ausgew\u00E4hlt"},
+        {"Unable.to.open.KeyStore.ex.toString.",
+                "KeyStore kann nicht ge\u00F6ffnet werden: {0}"},
+        {"No.principal.selected", "Kein Principal ausgew\u00E4hlt"},
+        {"No.permission.selected", "Keine Berechtigung ausgew\u00E4hlt"},
+        {"name", "Name"},
+        {"configuration.type", "Konfigurationstyp"},
+        {"environment.variable.name", "Umgebungsvariablenname"},
+        {"library.name", "Library-Name"},
+        {"package.name", "Packagename"},
+        {"policy.type", "Policy-Typ"},
+        {"property.name", "Eigenschaftsname"},
+        {"provider.name", "Providername"},
+        {"url", "URL"},
+        {"method.list", "Methodenliste"},
+        {"request.headers.list", "Headerliste anfordern"},
+        {"Principal.List", "Principal-Liste"},
+        {"Permission.List", "Berechtigungsliste"},
+        {"Code.Base", "Codebase"},
+        {"KeyStore.U.R.L.", "KeyStore-URL:"},
+        {"KeyStore.Password.U.R.L.", "KeyStore-Kennwort-URL:"}
+    };
+
+
+    /**
+     * Returns the contents of this <code>ResourceBundle</code>.
+     *
+     * <p>
+     *
+     * @return the contents of this <code>ResourceBundle</code>.
+     */
+    @Override
+    public Object[][] getContents() {
+        return contents;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_es.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,159 @@
+/*
+ * Copyright (c) 2000, 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.security.tools.policytool;
+
+/**
+ * <p> This class represents the <code>ResourceBundle</code>
+ * for the policytool.
+ *
+ */
+public class Resources_es extends java.util.ListResourceBundle {
+
+    private static final Object[][] contents = {
+        {"NEWLINE", "\n"},
+        {"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.",
+                "Advertencia: no hay clave p\u00FAblica para el alias {0}. Aseg\u00FArese de que se ha configurado correctamente un almac\u00E9n de claves."},
+        {"Warning.Class.not.found.class", "Advertencia: no se ha encontrado la clase: {0}"},
+        {"Warning.Invalid.argument.s.for.constructor.arg",
+                "Advertencia: argumento(s) no v\u00E1lido(s) para el constructor: {0}"},
+        {"Illegal.Principal.Type.type", "Tipo de principal no permitido: {0}"},
+        {"Illegal.option.option", "Opci\u00F3n no permitida: {0}"},
+        {"Usage.policytool.options.", "Sintaxis: policytool [opciones]"},
+        {".file.file.policy.file.location",
+                "  [-file <archivo>]    ubicaci\u00F3n del archivo de normas"},
+        {"New", "Nuevo"},
+        {"Open", "Abrir"},
+        {"Save", "Guardar"},
+        {"Save.As", "Guardar como"},
+        {"View.Warning.Log", "Ver Log de Advertencias"},
+        {"Exit", "Salir"},
+        {"Add.Policy.Entry", "Agregar Entrada de Pol\u00EDtica"},
+        {"Edit.Policy.Entry", "Editar Entrada de Pol\u00EDtica"},
+        {"Remove.Policy.Entry", "Eliminar Entrada de Pol\u00EDtica"},
+        {"Edit", "Editar"},
+        {"Retain", "Mantener"},
+
+        {"Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes",
+            "Advertencia: el nombre del archivo puede contener caracteres de barra invertida de escape. No es necesario utilizar barras invertidas de escape (la herramienta aplica caracteres de escape seg\u00FAn sea necesario al escribir el contenido de las pol\u00EDticas en el almac\u00E9n persistente).\n\nHaga clic en Mantener para conservar el nombre introducido o en Editar para modificarlo."},
+
+        {"Add.Public.Key.Alias", "Agregar Alias de Clave P\u00FAblico"},
+        {"Remove.Public.Key.Alias", "Eliminar Alias de Clave P\u00FAblico"},
+        {"File", "Archivo"},
+        {"KeyStore", "Almac\u00E9n de Claves"},
+        {"Policy.File.", "Archivo de Pol\u00EDtica:"},
+        {"Could.not.open.policy.file.policyFile.e.toString.",
+                "No se ha podido abrir el archivo de pol\u00EDtica: {0}: {1}"},
+        {"Policy.Tool", "Herramienta de Pol\u00EDticas"},
+        {"Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.",
+                "Ha habido errores al abrir la configuraci\u00F3n de pol\u00EDticas. V\u00E9ase el log de advertencias para obtener m\u00E1s informaci\u00F3n."},
+        {"Error", "Error"},
+        {"OK", "Aceptar"},
+        {"Status", "Estado"},
+        {"Warning", "Advertencia"},
+        {"Permission.",
+                "Permiso:                                                       "},
+        {"Principal.Type.", "Tipo de Principal:"},
+        {"Principal.Name.", "Nombre de Principal:"},
+        {"Target.Name.",
+                "Nombre de Destino:                                                    "},
+        {"Actions.",
+                "Acciones:                                                             "},
+        {"OK.to.overwrite.existing.file.filename.",
+                "\u00BFSobrescribir el archivo existente {0}?"},
+        {"Cancel", "Cancelar"},
+        {"CodeBase.", "CodeBase:"},
+        {"SignedBy.", "SignedBy:"},
+        {"Add.Principal", "Agregar Principal"},
+        {"Edit.Principal", "Editar Principal"},
+        {"Remove.Principal", "Eliminar Principal"},
+        {"Principals.", "Principales:"},
+        {".Add.Permission", "  Agregar Permiso"},
+        {".Edit.Permission", "  Editar Permiso"},
+        {"Remove.Permission", "Eliminar Permiso"},
+        {"Done", "Listo"},
+        {"KeyStore.URL.", "URL de Almac\u00E9n de Claves:"},
+        {"KeyStore.Type.", "Tipo de Almac\u00E9n de Claves:"},
+        {"KeyStore.Provider.", "Proveedor de Almac\u00E9n de Claves:"},
+        {"KeyStore.Password.URL.", "URL de Contrase\u00F1a de Almac\u00E9n de Claves:"},
+        {"Principals", "Principales"},
+        {".Edit.Principal.", "  Editar Principal:"},
+        {".Add.New.Principal.", "  Agregar Nuevo Principal:"},
+        {"Permissions", "Permisos"},
+        {".Edit.Permission.", "  Editar Permiso:"},
+        {".Add.New.Permission.", "  Agregar Permiso Nuevo:"},
+        {"Signed.By.", "Firmado Por:"},
+        {"Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name",
+            "No se puede especificar un principal con una clase de comod\u00EDn sin un nombre de comod\u00EDn"},
+        {"Cannot.Specify.Principal.without.a.Name",
+            "No se puede especificar el principal sin un nombre"},
+        {"Permission.and.Target.Name.must.have.a.value",
+                "Permiso y Nombre de Destino deben tener un valor"},
+        {"Remove.this.Policy.Entry.", "\u00BFEliminar esta entrada de pol\u00EDtica?"},
+        {"Overwrite.File", "Sobrescribir Archivo"},
+        {"Policy.successfully.written.to.filename",
+                "Pol\u00EDtica escrita correctamente en {0}"},
+        {"null.filename", "nombre de archivo nulo"},
+        {"Save.changes.", "\u00BFGuardar los cambios?"},
+        {"Yes", "S\u00ED"},
+        {"No", "No"},
+        {"Policy.Entry", "Entrada de Pol\u00EDtica"},
+        {"Save.Changes", "Guardar Cambios"},
+        {"No.Policy.Entry.selected", "No se ha seleccionado la entrada de pol\u00EDtica"},
+        {"Unable.to.open.KeyStore.ex.toString.",
+                "No se ha podido abrir el almac\u00E9n de claves: {0}"},
+        {"No.principal.selected", "No se ha seleccionado un principal"},
+        {"No.permission.selected", "No se ha seleccionado un permiso"},
+        {"name", "nombre"},
+        {"configuration.type", "tipo de configuraci\u00F3n"},
+        {"environment.variable.name", "nombre de variable de entorno"},
+        {"library.name", "nombre de la biblioteca"},
+        {"package.name", "nombre del paquete"},
+        {"policy.type", "tipo de pol\u00EDtica"},
+        {"property.name", "nombre de la propiedad"},
+        {"provider.name", "nombre del proveedor"},
+        {"url", "url"},
+        {"method.list", "lista de m\u00E9todos"},
+        {"request.headers.list", "lista de cabeceras de solicitudes"},
+        {"Principal.List", "Lista de Principales"},
+        {"Permission.List", "Lista de Permisos"},
+        {"Code.Base", "Base de C\u00F3digo"},
+        {"KeyStore.U.R.L.", "URL de Almac\u00E9n de Claves:"},
+        {"KeyStore.Password.U.R.L.", "URL de Contrase\u00F1a de Almac\u00E9n de Claves:"}
+    };
+
+
+    /**
+     * Returns the contents of this <code>ResourceBundle</code>.
+     *
+     * <p>
+     *
+     * @return the contents of this <code>ResourceBundle</code>.
+     */
+    @Override
+    public Object[][] getContents() {
+        return contents;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_fr.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,159 @@
+/*
+ * Copyright (c) 2000, 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.security.tools.policytool;
+
+/**
+ * <p> This class represents the <code>ResourceBundle</code>
+ * for the policytool.
+ *
+ */
+public class Resources_fr extends java.util.ListResourceBundle {
+
+    private static final Object[][] contents = {
+        {"NEWLINE", "\n"},
+        {"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.",
+                "Avertissement\u00A0: il n''existe pas de cl\u00E9 publique pour l''alias {0}. V\u00E9rifiez que le fichier de cl\u00E9s d''acc\u00E8s est correctement configur\u00E9."},
+        {"Warning.Class.not.found.class", "Avertissement : classe introuvable - {0}"},
+        {"Warning.Invalid.argument.s.for.constructor.arg",
+                "Avertissement\u00A0: arguments non valides pour le constructeur\u00A0- {0}"},
+        {"Illegal.Principal.Type.type", "Type de principal non admis : {0}"},
+        {"Illegal.option.option", "Option non admise : {0}"},
+        {"Usage.policytool.options.", "Syntaxe : policytool [options]"},
+        {".file.file.policy.file.location",
+                "  [-file <file>]    emplacement du fichier de r\u00E8gles"},
+        {"New", "Nouveau"},
+        {"Open", "Ouvrir"},
+        {"Save", "Enregistrer"},
+        {"Save.As", "Enregistrer sous"},
+        {"View.Warning.Log", "Afficher le journal des avertissements"},
+        {"Exit", "Quitter"},
+        {"Add.Policy.Entry", "Ajouter une r\u00E8gle"},
+        {"Edit.Policy.Entry", "Modifier une r\u00E8gle"},
+        {"Remove.Policy.Entry", "Enlever une r\u00E8gle"},
+        {"Edit", "Modifier"},
+        {"Retain", "Conserver"},
+
+        {"Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes",
+            "Avertissement : il se peut que le nom de fichier contienne des barres obliques inverses avec caract\u00E8re d'\u00E9chappement. Il n'est pas n\u00E9cessaire d'ajouter un caract\u00E8re d'\u00E9chappement aux barres obliques inverses. L'outil proc\u00E8de \u00E0 l'\u00E9chappement si n\u00E9cessaire lorsqu'il \u00E9crit le contenu des r\u00E8gles dans la zone de stockage persistant).\n\nCliquez sur Conserver pour garder le nom saisi ou sur Modifier pour le remplacer."},
+
+        {"Add.Public.Key.Alias", "Ajouter un alias de cl\u00E9 publique"},
+        {"Remove.Public.Key.Alias", "Enlever un alias de cl\u00E9 publique"},
+        {"File", "Fichier"},
+        {"KeyStore", "Fichier de cl\u00E9s"},
+        {"Policy.File.", "Fichier de r\u00E8gles :"},
+        {"Could.not.open.policy.file.policyFile.e.toString.",
+                "Impossible d''ouvrir le fichier de r\u00E8gles\u00A0: {0}: {1}"},
+        {"Policy.Tool", "Policy Tool"},
+        {"Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.",
+                "Des erreurs se sont produites \u00E0 l'ouverture de la configuration de r\u00E8gles. Pour plus d'informations, consultez le journal des avertissements."},
+        {"Error", "Erreur"},
+        {"OK", "OK"},
+        {"Status", "Statut"},
+        {"Warning", "Avertissement"},
+        {"Permission.",
+                "Droit :                                                       "},
+        {"Principal.Type.", "Type de principal :"},
+        {"Principal.Name.", "Nom de principal :"},
+        {"Target.Name.",
+                "Nom de cible :                                                    "},
+        {"Actions.",
+                "Actions :                                                             "},
+        {"OK.to.overwrite.existing.file.filename.",
+                "Remplacer le fichier existant {0} ?"},
+        {"Cancel", "Annuler"},
+        {"CodeBase.", "Base de code :"},
+        {"SignedBy.", "Sign\u00E9 par :"},
+        {"Add.Principal", "Ajouter un principal"},
+        {"Edit.Principal", "Modifier un principal"},
+        {"Remove.Principal", "Enlever un principal"},
+        {"Principals.", "Principaux :"},
+        {".Add.Permission", "  Ajouter un droit"},
+        {".Edit.Permission", "  Modifier un droit"},
+        {"Remove.Permission", "Enlever un droit"},
+        {"Done", "Termin\u00E9"},
+        {"KeyStore.URL.", "URL du fichier de cl\u00E9s :"},
+        {"KeyStore.Type.", "Type du fichier de cl\u00E9s :"},
+        {"KeyStore.Provider.", "Fournisseur du fichier de cl\u00E9s :"},
+        {"KeyStore.Password.URL.", "URL du mot de passe du fichier de cl\u00E9s :"},
+        {"Principals", "Principaux"},
+        {".Edit.Principal.", "  Modifier un principal :"},
+        {".Add.New.Principal.", "  Ajouter un principal :"},
+        {"Permissions", "Droits"},
+        {".Edit.Permission.", "  Modifier un droit :"},
+        {".Add.New.Permission.", "  Ajouter un droit :"},
+        {"Signed.By.", "Sign\u00E9 par :"},
+        {"Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name",
+            "Impossible de sp\u00E9cifier un principal avec une classe g\u00E9n\u00E9rique sans nom g\u00E9n\u00E9rique"},
+        {"Cannot.Specify.Principal.without.a.Name",
+            "Impossible de sp\u00E9cifier un principal sans nom"},
+        {"Permission.and.Target.Name.must.have.a.value",
+                "Le droit et le nom de cible doivent avoir une valeur"},
+        {"Remove.this.Policy.Entry.", "Enlever cette r\u00E8gle ?"},
+        {"Overwrite.File", "Remplacer le fichier"},
+        {"Policy.successfully.written.to.filename",
+                "R\u00E8gle \u00E9crite dans {0}"},
+        {"null.filename", "nom de fichier NULL"},
+        {"Save.changes.", "Enregistrer les modifications ?"},
+        {"Yes", "Oui"},
+        {"No", "Non"},
+        {"Policy.Entry", "R\u00E8gle"},
+        {"Save.Changes", "Enregistrer les modifications"},
+        {"No.Policy.Entry.selected", "Aucune r\u00E8gle s\u00E9lectionn\u00E9e"},
+        {"Unable.to.open.KeyStore.ex.toString.",
+                "Impossible d''ouvrir le fichier de cl\u00E9s d''acc\u00E8s : {0}"},
+        {"No.principal.selected", "Aucun principal s\u00E9lectionn\u00E9"},
+        {"No.permission.selected", "Aucun droit s\u00E9lectionn\u00E9"},
+        {"name", "nom"},
+        {"configuration.type", "type de configuration"},
+        {"environment.variable.name", "Nom de variable d'environnement"},
+        {"library.name", "nom de biblioth\u00E8que"},
+        {"package.name", "nom de package"},
+        {"policy.type", "type de r\u00E8gle"},
+        {"property.name", "nom de propri\u00E9t\u00E9"},
+        {"provider.name", "nom du fournisseur"},
+        {"url", "url"},
+        {"method.list", "liste des m\u00E9thodes"},
+        {"request.headers.list", "liste des en-t\u00EAtes de demande"},
+        {"Principal.List", "Liste de principaux"},
+        {"Permission.List", "Liste de droits"},
+        {"Code.Base", "Base de code"},
+        {"KeyStore.U.R.L.", "URL du fichier de cl\u00E9s :"},
+        {"KeyStore.Password.U.R.L.", "URL du mot de passe du fichier de cl\u00E9s :"}
+    };
+
+
+    /**
+     * Returns the contents of this <code>ResourceBundle</code>.
+     *
+     * <p>
+     *
+     * @return the contents of this <code>ResourceBundle</code>.
+     */
+    @Override
+    public Object[][] getContents() {
+        return contents;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_it.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,159 @@
+/*
+ * Copyright (c) 2000, 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.security.tools.policytool;
+
+/**
+ * <p> This class represents the <code>ResourceBundle</code>
+ * for the policytool.
+ *
+ */
+public class Resources_it extends java.util.ListResourceBundle {
+
+    private static final Object[][] contents = {
+        {"NEWLINE", "\n"},
+        {"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.",
+                "Avvertenza: non esiste una chiave pubblica per l''alias {0}. Verificare che il keystore sia configurato correttamente."},
+        {"Warning.Class.not.found.class", "Avvertenza: classe non trovata: {0}"},
+        {"Warning.Invalid.argument.s.for.constructor.arg",
+                "Avvertenza: argomento o argomenti non validi per il costruttore {0}"},
+        {"Illegal.Principal.Type.type", "Tipo principal non valido: {0}"},
+        {"Illegal.option.option", "Opzione non valida: {0}"},
+        {"Usage.policytool.options.", "Uso: policytool [opzioni]"},
+        {".file.file.policy.file.location",
+                "  [-file <file>]    posizione del file dei criteri"},
+        {"New", "Nuovo"},
+        {"Open", "Apri"},
+        {"Save", "Salva"},
+        {"Save.As", "Salva con nome"},
+        {"View.Warning.Log", "Visualizza registro avvertenze"},
+        {"Exit", "Esci"},
+        {"Add.Policy.Entry", "Aggiungi voce dei criteri"},
+        {"Edit.Policy.Entry", "Modifica voce dei criteri"},
+        {"Remove.Policy.Entry", "Rimuovi voce dei criteri"},
+        {"Edit", "Modifica"},
+        {"Retain", "Mantieni"},
+
+        {"Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes",
+            "Avvertenza: il nome file pu\u00F2 includere barre rovesciate con escape. Non \u00E8 necessario eseguire l'escape delle barre rovesciate (se necessario lo strumento esegue l'escape dei caratteri al momento della scrittura del contenuto dei criteri nell'area di memorizzazione persistente).\n\nFare click su Mantieni per conservare il nome immesso, oppure su Modifica per modificare il nome."},
+
+        {"Add.Public.Key.Alias", "Aggiungi alias chiave pubblica"},
+        {"Remove.Public.Key.Alias", "Rimuovi alias chiave pubblica"},
+        {"File", "File"},
+        {"KeyStore", "Keystore"},
+        {"Policy.File.", "File dei criteri:"},
+        {"Could.not.open.policy.file.policyFile.e.toString.",
+                "Impossibile aprire il file di criteri {0}: {1}"},
+        {"Policy.Tool", "Strumento criteri"},
+        {"Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.",
+                "Si sono verificati errori durante l'apertura della configurazione dei criteri. Consultare il registro delle avvertenze per ulteriori informazioni."},
+        {"Error", "Errore"},
+        {"OK", "OK"},
+        {"Status", "Stato"},
+        {"Warning", "Avvertenza"},
+        {"Permission.",
+                "Autorizzazione:                                                       "},
+        {"Principal.Type.", "Tipo principal:"},
+        {"Principal.Name.", "Nome principal:"},
+        {"Target.Name.",
+                "Nome destinazione:                                                    "},
+        {"Actions.",
+                "Azioni:                                                             "},
+        {"OK.to.overwrite.existing.file.filename.",
+                "OK per sovrascrivere il file {0}?"},
+        {"Cancel", "Annulla"},
+        {"CodeBase.", "CodeBase:"},
+        {"SignedBy.", "SignedBy:"},
+        {"Add.Principal", "Aggiungi principal"},
+        {"Edit.Principal", "Modifica principal"},
+        {"Remove.Principal", "Rimuovi principal"},
+        {"Principals.", "Principal:"},
+        {".Add.Permission", "  Aggiungi autorizzazione"},
+        {".Edit.Permission", "  Modifica autorizzazione"},
+        {"Remove.Permission", "Rimuovi autorizzazione"},
+        {"Done", "Fine"},
+        {"KeyStore.URL.", "URL keystore:"},
+        {"KeyStore.Type.", "Tipo keystore:"},
+        {"KeyStore.Provider.", "Provider keystore:"},
+        {"KeyStore.Password.URL.", "URL password keystore:"},
+        {"Principals", "Principal:"},
+        {".Edit.Principal.", "  Modifica principal:"},
+        {".Add.New.Principal.", "  Aggiungi nuovo principal:"},
+        {"Permissions", "Autorizzazioni"},
+        {".Edit.Permission.", "  Modifica autorizzazione:"},
+        {".Add.New.Permission.", "  Aggiungi nuova autorizzazione:"},
+        {"Signed.By.", "Firmato da:"},
+        {"Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name",
+            "Impossibile specificare principal con una classe carattere jolly senza un nome carattere jolly"},
+        {"Cannot.Specify.Principal.without.a.Name",
+            "Impossibile specificare principal senza un nome"},
+        {"Permission.and.Target.Name.must.have.a.value",
+                "L'autorizzazione e il nome destinazione non possono essere nulli"},
+        {"Remove.this.Policy.Entry.", "Rimuovere questa voce dei criteri?"},
+        {"Overwrite.File", "Sovrascrivi file"},
+        {"Policy.successfully.written.to.filename",
+                "I criteri sono stati scritti in {0}"},
+        {"null.filename", "nome file nullo"},
+        {"Save.changes.", "Salvare le modifiche?"},
+        {"Yes", "S\u00EC"},
+        {"No", "No"},
+        {"Policy.Entry", "Voce dei criteri"},
+        {"Save.Changes", "Salva le modifiche"},
+        {"No.Policy.Entry.selected", "Nessuna voce dei criteri selezionata"},
+        {"Unable.to.open.KeyStore.ex.toString.",
+                "Impossibile aprire il keystore: {0}"},
+        {"No.principal.selected", "Nessun principal selezionato"},
+        {"No.permission.selected", "Nessuna autorizzazione selezionata"},
+        {"name", "nome"},
+        {"configuration.type", "tipo di configurazione"},
+        {"environment.variable.name", "nome variabile ambiente"},
+        {"library.name", "nome libreria"},
+        {"package.name", "nome package"},
+        {"policy.type", "tipo di criteri"},
+        {"property.name", "nome propriet\u00E0"},
+        {"provider.name", "nome provider"},
+        {"url", "url"},
+        {"method.list", "lista metodi"},
+        {"request.headers.list", "lista intestazioni di richiesta"},
+        {"Principal.List", "Lista principal"},
+        {"Permission.List", "Lista autorizzazioni"},
+        {"Code.Base", "Codebase"},
+        {"KeyStore.U.R.L.", "URL keystore:"},
+        {"KeyStore.Password.U.R.L.", "URL password keystore:"}
+    };
+
+
+    /**
+     * Returns the contents of this <code>ResourceBundle</code>.
+     *
+     * <p>
+     *
+     * @return the contents of this <code>ResourceBundle</code>.
+     */
+    @Override
+    public Object[][] getContents() {
+        return contents;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_ja.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,159 @@
+/*
+ * Copyright (c) 2000, 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.security.tools.policytool;
+
+/**
+ * <p> This class represents the <code>ResourceBundle</code>
+ * for the policytool.
+ *
+ */
+public class Resources_ja extends java.util.ListResourceBundle {
+
+    private static final Object[][] contents = {
+        {"NEWLINE", "\n"},
+        {"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.",
+                "\u8B66\u544A: \u5225\u540D{0}\u306E\u516C\u958B\u9375\u304C\u5B58\u5728\u3057\u307E\u305B\u3093\u3002\u30AD\u30FC\u30B9\u30C8\u30A2\u304C\u6B63\u3057\u304F\u69CB\u6210\u3055\u308C\u3066\u3044\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},
+        {"Warning.Class.not.found.class", "\u8B66\u544A: \u30AF\u30E9\u30B9\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: {0}"},
+        {"Warning.Invalid.argument.s.for.constructor.arg",
+                "\u8B66\u544A: \u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u306E\u5F15\u6570\u304C\u7121\u52B9\u3067\u3059: {0}"},
+        {"Illegal.Principal.Type.type", "\u4E0D\u6B63\u306A\u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u306E\u30BF\u30A4\u30D7: {0}"},
+        {"Illegal.option.option", "\u4E0D\u6B63\u306A\u30AA\u30D7\u30B7\u30E7\u30F3: {0}"},
+        {"Usage.policytool.options.", "\u4F7F\u7528\u65B9\u6CD5: policytool [options]"},
+        {".file.file.policy.file.location",
+                "  [-file <file>]  \u30DD\u30EA\u30B7\u30FC\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u5834\u6240"},
+        {"New", "\u65B0\u898F"},
+        {"Open", "\u958B\u304F"},
+        {"Save", "\u4FDD\u5B58"},
+        {"Save.As", "\u5225\u540D\u4FDD\u5B58"},
+        {"View.Warning.Log", "\u8B66\u544A\u30ED\u30B0\u306E\u8868\u793A"},
+        {"Exit", "\u7D42\u4E86"},
+        {"Add.Policy.Entry", "\u30DD\u30EA\u30B7\u30FC\u30FB\u30A8\u30F3\u30C8\u30EA\u306E\u8FFD\u52A0"},
+        {"Edit.Policy.Entry", "\u30DD\u30EA\u30B7\u30FC\u30FB\u30A8\u30F3\u30C8\u30EA\u306E\u7DE8\u96C6"},
+        {"Remove.Policy.Entry", "\u30DD\u30EA\u30B7\u30FC\u30FB\u30A8\u30F3\u30C8\u30EA\u306E\u524A\u9664"},
+        {"Edit", "\u7DE8\u96C6"},
+        {"Retain", "\u4FDD\u6301"},
+
+        {"Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes",
+            "\u8B66\u544A: \u30D5\u30A1\u30A4\u30EB\u540D\u306B\u30A8\u30B9\u30B1\u30FC\u30D7\u3055\u308C\u305F\u30D0\u30C3\u30AF\u30B9\u30E9\u30C3\u30B7\u30E5\u6587\u5B57\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002\u30D0\u30C3\u30AF\u30B9\u30E9\u30C3\u30B7\u30E5\u6587\u5B57\u3092\u30A8\u30B9\u30B1\u30FC\u30D7\u3059\u308B\u5FC5\u8981\u306F\u3042\u308A\u307E\u305B\u3093(\u30C4\u30FC\u30EB\u306F\u30DD\u30EA\u30B7\u30FC\u5185\u5BB9\u3092\u6C38\u7D9A\u30B9\u30C8\u30A2\u306B\u66F8\u304D\u8FBC\u3080\u3068\u304D\u306B\u3001\u5FC5\u8981\u306B\u5FDC\u3058\u3066\u6587\u5B57\u3092\u30A8\u30B9\u30B1\u30FC\u30D7\u3057\u307E\u3059)\u3002\n\n\u5165\u529B\u6E08\u306E\u540D\u524D\u3092\u4FDD\u6301\u3059\u308B\u306B\u306F\u300C\u4FDD\u6301\u300D\u3092\u30AF\u30EA\u30C3\u30AF\u3057\u3001\u540D\u524D\u3092\u7DE8\u96C6\u3059\u308B\u306B\u306F\u300C\u7DE8\u96C6\u300D\u3092\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},
+
+        {"Add.Public.Key.Alias", "\u516C\u958B\u9375\u306E\u5225\u540D\u306E\u8FFD\u52A0"},
+        {"Remove.Public.Key.Alias", "\u516C\u958B\u9375\u306E\u5225\u540D\u3092\u524A\u9664"},
+        {"File", "\u30D5\u30A1\u30A4\u30EB"},
+        {"KeyStore", "\u30AD\u30FC\u30B9\u30C8\u30A2"},
+        {"Policy.File.", "\u30DD\u30EA\u30B7\u30FC\u30FB\u30D5\u30A1\u30A4\u30EB:"},
+        {"Could.not.open.policy.file.policyFile.e.toString.",
+                "\u30DD\u30EA\u30B7\u30FC\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u958B\u3051\u307E\u305B\u3093\u3067\u3057\u305F: {0}: {1}"},
+        {"Policy.Tool", "\u30DD\u30EA\u30B7\u30FC\u30FB\u30C4\u30FC\u30EB"},
+        {"Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.",
+                "\u30DD\u30EA\u30B7\u30FC\u69CB\u6210\u3092\u958B\u304F\u3068\u304D\u306B\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002\u8A73\u7D30\u306F\u8B66\u544A\u30ED\u30B0\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},
+        {"Error", "\u30A8\u30E9\u30FC"},
+        {"OK", "OK"},
+        {"Status", "\u72B6\u614B"},
+        {"Warning", "\u8B66\u544A"},
+        {"Permission.",
+                "\u30A2\u30AF\u30BB\u30B9\u6A29:                                                       "},
+        {"Principal.Type.", "\u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u306E\u30BF\u30A4\u30D7:"},
+        {"Principal.Name.", "\u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u306E\u540D\u524D:"},
+        {"Target.Name.",
+                "\u30BF\u30FC\u30B2\u30C3\u30C8\u540D:                                                    "},
+        {"Actions.",
+                "\u30A2\u30AF\u30B7\u30E7\u30F3:                                                             "},
+        {"OK.to.overwrite.existing.file.filename.",
+                "\u65E2\u5B58\u306E\u30D5\u30A1\u30A4\u30EB{0}\u306B\u4E0A\u66F8\u304D\u3057\u307E\u3059\u304B\u3002"},
+        {"Cancel", "\u53D6\u6D88"},
+        {"CodeBase.", "CodeBase:"},
+        {"SignedBy.", "SignedBy:"},
+        {"Add.Principal", "\u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u306E\u8FFD\u52A0"},
+        {"Edit.Principal", "\u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u306E\u7DE8\u96C6"},
+        {"Remove.Principal", "\u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u306E\u524A\u9664"},
+        {"Principals.", "\u30D7\u30EA\u30F3\u30B7\u30D1\u30EB:"},
+        {".Add.Permission", "  \u30A2\u30AF\u30BB\u30B9\u6A29\u306E\u8FFD\u52A0"},
+        {".Edit.Permission", "  \u30A2\u30AF\u30BB\u30B9\u6A29\u306E\u7DE8\u96C6"},
+        {"Remove.Permission", "\u30A2\u30AF\u30BB\u30B9\u6A29\u306E\u524A\u9664"},
+        {"Done", "\u5B8C\u4E86"},
+        {"KeyStore.URL.", "\u30AD\u30FC\u30B9\u30C8\u30A2URL:"},
+        {"KeyStore.Type.", "\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u30BF\u30A4\u30D7:"},
+        {"KeyStore.Provider.", "\u30AD\u30FC\u30B9\u30C8\u30A2\u30FB\u30D7\u30ED\u30D0\u30A4\u30C0:"},
+        {"KeyStore.Password.URL.", "\u30AD\u30FC\u30B9\u30C8\u30A2\u30FB\u30D1\u30B9\u30EF\u30FC\u30C9URL:"},
+        {"Principals", "\u30D7\u30EA\u30F3\u30B7\u30D1\u30EB"},
+        {".Edit.Principal.", "  \u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u306E\u7DE8\u96C6:"},
+        {".Add.New.Principal.", "  \u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u306E\u65B0\u898F\u8FFD\u52A0:"},
+        {"Permissions", "\u30A2\u30AF\u30BB\u30B9\u6A29"},
+        {".Edit.Permission.", "  \u30A2\u30AF\u30BB\u30B9\u6A29\u306E\u7DE8\u96C6:"},
+        {".Add.New.Permission.", "  \u65B0\u898F\u30A2\u30AF\u30BB\u30B9\u6A29\u306E\u8FFD\u52A0:"},
+        {"Signed.By.", "\u7F72\u540D\u8005:"},
+        {"Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name",
+            "\u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9\u540D\u306E\u306A\u3044\u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9\u30FB\u30AF\u30E9\u30B9\u3092\u4F7F\u7528\u3057\u3066\u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u3092\u6307\u5B9A\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093"},
+        {"Cannot.Specify.Principal.without.a.Name",
+            "\u540D\u524D\u3092\u4F7F\u7528\u305B\u305A\u306B\u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u3092\u6307\u5B9A\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093"},
+        {"Permission.and.Target.Name.must.have.a.value",
+                "\u30A2\u30AF\u30BB\u30B9\u6A29\u3068\u30BF\u30FC\u30B2\u30C3\u30C8\u540D\u306F\u3001\u5024\u3092\u4FDD\u6301\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
+        {"Remove.this.Policy.Entry.", "\u3053\u306E\u30DD\u30EA\u30B7\u30FC\u30FB\u30A8\u30F3\u30C8\u30EA\u3092\u524A\u9664\u3057\u307E\u3059\u304B\u3002"},
+        {"Overwrite.File", "\u30D5\u30A1\u30A4\u30EB\u3092\u4E0A\u66F8\u304D\u3057\u307E\u3059"},
+        {"Policy.successfully.written.to.filename",
+                "\u30DD\u30EA\u30B7\u30FC\u306E{0}\u3078\u306E\u66F8\u8FBC\u307F\u306B\u6210\u529F\u3057\u307E\u3057\u305F"},
+        {"null.filename", "\u30D5\u30A1\u30A4\u30EB\u540D\u304Cnull\u3067\u3059"},
+        {"Save.changes.", "\u5909\u66F4\u3092\u4FDD\u5B58\u3057\u307E\u3059\u304B\u3002"},
+        {"Yes", "\u306F\u3044"},
+        {"No", "\u3044\u3044\u3048"},
+        {"Policy.Entry", "\u30DD\u30EA\u30B7\u30FC\u30FB\u30A8\u30F3\u30C8\u30EA"},
+        {"Save.Changes", "\u5909\u66F4\u3092\u4FDD\u5B58\u3057\u307E\u3059"},
+        {"No.Policy.Entry.selected", "\u30DD\u30EA\u30B7\u30FC\u30FB\u30A8\u30F3\u30C8\u30EA\u304C\u9078\u629E\u3055\u308C\u3066\u3044\u307E\u305B\u3093"},
+        {"Unable.to.open.KeyStore.ex.toString.",
+                "\u30AD\u30FC\u30B9\u30C8\u30A2{0}\u3092\u958B\u3051\u307E\u305B\u3093"},
+        {"No.principal.selected", "\u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u304C\u9078\u629E\u3055\u308C\u3066\u3044\u307E\u305B\u3093"},
+        {"No.permission.selected", "\u30A2\u30AF\u30BB\u30B9\u6A29\u304C\u9078\u629E\u3055\u308C\u3066\u3044\u307E\u305B\u3093"},
+        {"name", "\u540D\u524D"},
+        {"configuration.type", "\u69CB\u6210\u30BF\u30A4\u30D7"},
+        {"environment.variable.name", "\u74B0\u5883\u5909\u6570\u540D"},
+        {"library.name", "\u30E9\u30A4\u30D6\u30E9\u30EA\u540D"},
+        {"package.name", "\u30D1\u30C3\u30B1\u30FC\u30B8\u540D"},
+        {"policy.type", "\u30DD\u30EA\u30B7\u30FC\u30FB\u30BF\u30A4\u30D7"},
+        {"property.name", "\u30D7\u30ED\u30D1\u30C6\u30A3\u540D"},
+        {"provider.name", "\u30D7\u30ED\u30D0\u30A4\u30C0\u540D"},
+        {"url", "URL"},
+        {"method.list", "\u30E1\u30BD\u30C3\u30C9\u30FB\u30EA\u30B9\u30C8"},
+        {"request.headers.list", "\u30EA\u30AF\u30A8\u30B9\u30C8\u30FB\u30D8\u30C3\u30C0\u30FC\u30FB\u30EA\u30B9\u30C8"},
+        {"Principal.List", "\u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u306E\u30EA\u30B9\u30C8"},
+        {"Permission.List", "\u30A2\u30AF\u30BB\u30B9\u6A29\u306E\u30EA\u30B9\u30C8"},
+        {"Code.Base", "\u30B3\u30FC\u30C9\u30FB\u30D9\u30FC\u30B9"},
+        {"KeyStore.U.R.L.", "\u30AD\u30FC\u30B9\u30C8\u30A2U R L:"},
+        {"KeyStore.Password.U.R.L.", "\u30AD\u30FC\u30B9\u30C8\u30A2\u30FB\u30D1\u30B9\u30EF\u30FC\u30C9U R L:"}
+    };
+
+
+    /**
+     * Returns the contents of this <code>ResourceBundle</code>.
+     *
+     * <p>
+     *
+     * @return the contents of this <code>ResourceBundle</code>.
+     */
+    @Override
+    public Object[][] getContents() {
+        return contents;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_ko.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,159 @@
+/*
+ * Copyright (c) 2000, 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.security.tools.policytool;
+
+/**
+ * <p> This class represents the <code>ResourceBundle</code>
+ * for the policytool.
+ *
+ */
+public class Resources_ko extends java.util.ListResourceBundle {
+
+    private static final Object[][] contents = {
+        {"NEWLINE", "\n"},
+        {"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.",
+                "\uACBD\uACE0: {0} \uBCC4\uCE6D\uC5D0 \uB300\uD55C \uACF5\uC6A9 \uD0A4\uAC00 \uC874\uC7AC\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. \uD0A4 \uC800\uC7A5\uC18C\uAC00 \uC81C\uB300\uB85C \uAD6C\uC131\uB418\uC5B4 \uC788\uB294\uC9C0 \uD655\uC778\uD558\uC2ED\uC2DC\uC624."},
+        {"Warning.Class.not.found.class", "\uACBD\uACE0: \uD074\uB798\uC2A4\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC74C: {0}"},
+        {"Warning.Invalid.argument.s.for.constructor.arg",
+                "\uACBD\uACE0: \uC0DD\uC131\uC790\uC5D0 \uB300\uD574 \uBD80\uC801\uD569\uD55C \uC778\uC218: {0}"},
+        {"Illegal.Principal.Type.type", "\uC798\uBABB\uB41C \uC8FC\uCCB4 \uC720\uD615: {0}"},
+        {"Illegal.option.option", "\uC798\uBABB\uB41C \uC635\uC158: {0}"},
+        {"Usage.policytool.options.", "\uC0AC\uC6A9\uBC95: policytool [options]"},
+        {".file.file.policy.file.location",
+                "  [-file <file>]    \uC815\uCC45 \uD30C\uC77C \uC704\uCE58"},
+        {"New", "\uC0C8\uB85C \uB9CC\uB4E4\uAE30"},
+        {"Open", "\uC5F4\uAE30"},
+        {"Save", "\uC800\uC7A5"},
+        {"Save.As", "\uB2E4\uB978 \uC774\uB984\uC73C\uB85C \uC800\uC7A5"},
+        {"View.Warning.Log", "\uACBD\uACE0 \uB85C\uADF8 \uBCF4\uAE30"},
+        {"Exit", "\uC885\uB8CC"},
+        {"Add.Policy.Entry", "\uC815\uCC45 \uD56D\uBAA9 \uCD94\uAC00"},
+        {"Edit.Policy.Entry", "\uC815\uCC45 \uD56D\uBAA9 \uD3B8\uC9D1"},
+        {"Remove.Policy.Entry", "\uC815\uCC45 \uD56D\uBAA9 \uC81C\uAC70"},
+        {"Edit", "\uD3B8\uC9D1"},
+        {"Retain", "\uC720\uC9C0"},
+
+        {"Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes",
+            "\uACBD\uACE0: \uD30C\uC77C \uC774\uB984\uC5D0 \uC774\uC2A4\uCF00\uC774\uD504\uB41C \uBC31\uC2AC\uB798\uC2DC \uBB38\uC790\uAC00 \uD3EC\uD568\uB418\uC5C8\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4. \uBC31\uC2AC\uB798\uC2DC \uBB38\uC790\uB294 \uC774\uC2A4\uCF00\uC774\uD504\uD560 \uD544\uC694\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. \uC601\uAD6C \uC800\uC7A5\uC18C\uC5D0 \uC815\uCC45 \uCF58\uD150\uCE20\uB97C \uC4F8 \uB54C \uD544\uC694\uC5D0 \uB530\uB77C \uC790\uB3D9\uC73C\uB85C \uBB38\uC790\uAC00 \uC774\uC2A4\uCF00\uC774\uD504\uB429\uB2C8\uB2E4.\n\n\uC785\uB825\uB41C \uC774\uB984\uC744 \uADF8\uB300\uB85C \uC720\uC9C0\uD558\uB824\uBA74 [\uC720\uC9C0]\uB97C \uB204\uB974\uACE0, \uC774\uB984\uC744 \uD3B8\uC9D1\uD558\uB824\uBA74 [\uD3B8\uC9D1]\uC744 \uB204\uB974\uC2ED\uC2DC\uC624."},
+
+        {"Add.Public.Key.Alias", "\uACF5\uC6A9 \uD0A4 \uBCC4\uCE6D \uCD94\uAC00"},
+        {"Remove.Public.Key.Alias", "\uACF5\uC6A9 \uD0A4 \uBCC4\uCE6D \uC81C\uAC70"},
+        {"File", "\uD30C\uC77C"},
+        {"KeyStore", "\uD0A4 \uC800\uC7A5\uC18C"},
+        {"Policy.File.", "\uC815\uCC45 \uD30C\uC77C:"},
+        {"Could.not.open.policy.file.policyFile.e.toString.",
+                "\uC815\uCC45 \uD30C\uC77C\uC744 \uC5F4 \uC218 \uC5C6\uC74C: {0}: {1}"},
+        {"Policy.Tool", "\uC815\uCC45 \uD234"},
+        {"Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.",
+                "\uC815\uCC45 \uAD6C\uC131\uC744 \uC5EC\uB294 \uC911 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. \uC790\uC138\uD55C \uB0B4\uC6A9\uC740 \uACBD\uACE0 \uB85C\uADF8\uB97C \uD655\uC778\uD558\uC2ED\uC2DC\uC624."},
+        {"Error", "\uC624\uB958"},
+        {"OK", "\uD655\uC778"},
+        {"Status", "\uC0C1\uD0DC"},
+        {"Warning", "\uACBD\uACE0"},
+        {"Permission.",
+                "\uAD8C\uD55C:                                                       "},
+        {"Principal.Type.", "\uC8FC\uCCB4 \uC720\uD615:"},
+        {"Principal.Name.", "\uC8FC\uCCB4 \uC774\uB984:"},
+        {"Target.Name.",
+                "\uB300\uC0C1 \uC774\uB984:                                                    "},
+        {"Actions.",
+                "\uC791\uC5C5:                                                             "},
+        {"OK.to.overwrite.existing.file.filename.",
+                "\uAE30\uC874 \uD30C\uC77C {0}\uC744(\uB97C) \uACB9\uCCD0 \uC4F0\uACA0\uC2B5\uB2C8\uAE4C?"},
+        {"Cancel", "\uCDE8\uC18C"},
+        {"CodeBase.", "CodeBase:"},
+        {"SignedBy.", "SignedBy:"},
+        {"Add.Principal", "\uC8FC\uCCB4 \uCD94\uAC00"},
+        {"Edit.Principal", "\uC8FC\uCCB4 \uD3B8\uC9D1"},
+        {"Remove.Principal", "\uC8FC\uCCB4 \uC81C\uAC70"},
+        {"Principals.", "\uC8FC\uCCB4:"},
+        {".Add.Permission", "  \uAD8C\uD55C \uCD94\uAC00"},
+        {".Edit.Permission", "  \uAD8C\uD55C \uD3B8\uC9D1"},
+        {"Remove.Permission", "\uAD8C\uD55C \uC81C\uAC70"},
+        {"Done", "\uC644\uB8CC"},
+        {"KeyStore.URL.", "\uD0A4 \uC800\uC7A5\uC18C URL:"},
+        {"KeyStore.Type.", "\uD0A4 \uC800\uC7A5\uC18C \uC720\uD615:"},
+        {"KeyStore.Provider.", "\uD0A4 \uC800\uC7A5\uC18C \uC81C\uACF5\uC790:"},
+        {"KeyStore.Password.URL.", "\uD0A4 \uC800\uC7A5\uC18C \uBE44\uBC00\uBC88\uD638 URL:"},
+        {"Principals", "\uC8FC\uCCB4"},
+        {".Edit.Principal.", "  \uC8FC\uCCB4 \uD3B8\uC9D1:"},
+        {".Add.New.Principal.", "  \uC0C8 \uC8FC\uCCB4 \uCD94\uAC00:"},
+        {"Permissions", "\uAD8C\uD55C"},
+        {".Edit.Permission.", "  \uAD8C\uD55C \uD3B8\uC9D1:"},
+        {".Add.New.Permission.", "  \uC0C8 \uAD8C\uD55C \uCD94\uAC00:"},
+        {"Signed.By.", "\uC11C\uBA85\uC790:"},
+        {"Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name",
+            "\uC640\uC77C\uB4DC \uCE74\uB4DC \uBB38\uC790 \uC774\uB984 \uC5C6\uC774 \uC640\uC77C\uB4DC \uCE74\uB4DC \uBB38\uC790 \uD074\uB798\uC2A4\uB97C \uC0AC\uC6A9\uD558\uB294 \uC8FC\uCCB4\uB97C \uC9C0\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
+        {"Cannot.Specify.Principal.without.a.Name",
+            "\uC774\uB984 \uC5C6\uC774 \uC8FC\uCCB4\uB97C \uC9C0\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
+        {"Permission.and.Target.Name.must.have.a.value",
+                "\uAD8C\uD55C\uACFC \uB300\uC0C1 \uC774\uB984\uC758 \uAC12\uC774 \uC788\uC5B4\uC57C \uD569\uB2C8\uB2E4."},
+        {"Remove.this.Policy.Entry.", "\uC774 \uC815\uCC45 \uD56D\uBAA9\uC744 \uC81C\uAC70\uD558\uACA0\uC2B5\uB2C8\uAE4C?"},
+        {"Overwrite.File", "\uD30C\uC77C \uACB9\uCCD0\uC4F0\uAE30"},
+        {"Policy.successfully.written.to.filename",
+                "{0}\uC5D0 \uC131\uACF5\uC801\uC73C\uB85C \uC815\uCC45\uC744 \uC37C\uC2B5\uB2C8\uB2E4."},
+        {"null.filename", "\uB110 \uD30C\uC77C \uC774\uB984"},
+        {"Save.changes.", "\uBCC0\uACBD \uC0AC\uD56D\uC744 \uC800\uC7A5\uD558\uACA0\uC2B5\uB2C8\uAE4C?"},
+        {"Yes", "\uC608"},
+        {"No", "\uC544\uB2C8\uC624"},
+        {"Policy.Entry", "\uC815\uCC45 \uD56D\uBAA9"},
+        {"Save.Changes", "\uBCC0\uACBD \uC0AC\uD56D \uC800\uC7A5"},
+        {"No.Policy.Entry.selected", "\uC120\uD0DD\uB41C \uC815\uCC45 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."},
+        {"Unable.to.open.KeyStore.ex.toString.",
+                "\uD0A4 \uC800\uC7A5\uC18C\uB97C \uC5F4 \uC218 \uC5C6\uC74C: {0}"},
+        {"No.principal.selected", "\uC120\uD0DD\uB41C \uC8FC\uCCB4\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."},
+        {"No.permission.selected", "\uC120\uD0DD\uB41C \uAD8C\uD55C\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."},
+        {"name", "\uC774\uB984"},
+        {"configuration.type", "\uAD6C\uC131 \uC720\uD615"},
+        {"environment.variable.name", "\uD658\uACBD \uBCC0\uC218 \uC774\uB984"},
+        {"library.name", "\uB77C\uC774\uBE0C\uB7EC\uB9AC \uC774\uB984"},
+        {"package.name", "\uD328\uD0A4\uC9C0 \uC774\uB984"},
+        {"policy.type", "\uC815\uCC45 \uC720\uD615"},
+        {"property.name", "\uC18D\uC131 \uC774\uB984"},
+        {"provider.name", "\uC81C\uACF5\uC790 \uC774\uB984"},
+        {"url", "URL"},
+        {"method.list", "\uBA54\uC18C\uB4DC \uBAA9\uB85D"},
+        {"request.headers.list", "\uC694\uCCAD \uD5E4\uB354 \uBAA9\uB85D"},
+        {"Principal.List", "\uC8FC\uCCB4 \uBAA9\uB85D"},
+        {"Permission.List", "\uAD8C\uD55C \uBAA9\uB85D"},
+        {"Code.Base", "\uCF54\uB4DC \uBCA0\uC774\uC2A4"},
+        {"KeyStore.U.R.L.", "\uD0A4 \uC800\uC7A5\uC18C URL:"},
+        {"KeyStore.Password.U.R.L.", "\uD0A4 \uC800\uC7A5\uC18C \uBE44\uBC00\uBC88\uD638 URL:"}
+    };
+
+
+    /**
+     * Returns the contents of this <code>ResourceBundle</code>.
+     *
+     * <p>
+     *
+     * @return the contents of this <code>ResourceBundle</code>.
+     */
+    @Override
+    public Object[][] getContents() {
+        return contents;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_pt_BR.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,159 @@
+/*
+ * Copyright (c) 2000, 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.security.tools.policytool;
+
+/**
+ * <p> This class represents the <code>ResourceBundle</code>
+ * for the policytool.
+ *
+ */
+public class Resources_pt_BR extends java.util.ListResourceBundle {
+
+    private static final Object[][] contents = {
+        {"NEWLINE", "\n"},
+        {"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.",
+                "Advert\u00EAncia: N\u00E3o existe uma chave p\u00FAblica para o alias {0}. Certifique-se de que um KeyStore esteja configurado adequadamente."},
+        {"Warning.Class.not.found.class", "Advert\u00EAncia: Classe n\u00E3o encontrada: {0}"},
+        {"Warning.Invalid.argument.s.for.constructor.arg",
+                "Advert\u00EAncia: Argumento(s) inv\u00E1lido(s) para o construtor: {0}"},
+        {"Illegal.Principal.Type.type", "Tipo Principal Inv\u00E1lido: {0}"},
+        {"Illegal.option.option", "Op\u00E7\u00E3o inv\u00E1lida: {0}"},
+        {"Usage.policytool.options.", "Uso: policytool [op\u00E7\u00F5es]"},
+        {".file.file.policy.file.location",
+                "  [-file <arquivo>]    localiza\u00E7\u00E3o do arquivo de pol\u00EDtica"},
+        {"New", "Novo"},
+        {"Open", "Abrir"},
+        {"Save", "Salvar"},
+        {"Save.As", "Salvar Como"},
+        {"View.Warning.Log", "Exibir Log de Advert\u00EAncias"},
+        {"Exit", "Sair"},
+        {"Add.Policy.Entry", "Adicionar Entrada de Pol\u00EDtica"},
+        {"Edit.Policy.Entry", "Editar Entrada de Pol\u00EDtica"},
+        {"Remove.Policy.Entry", "Remover Entrada de Pol\u00EDtica"},
+        {"Edit", "Editar"},
+        {"Retain", "Reter"},
+
+        {"Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes",
+            "Advert\u00EAncia: O nome do arquivo pode conter caracteres de escape barra invertida. N\u00E3o \u00E9 necess\u00E1rio fazer o escape dos caracteres de barra invertida (a ferramenta faz o escape dos caracteres conforme necess\u00E1rio ao gravar o conte\u00FAdo da pol\u00EDtica no armazenamento persistente).\n\nClique em Reter para reter o nome da entrada ou clique em Editar para edit\u00E1-lo."},
+
+        {"Add.Public.Key.Alias", "Adicionar Alias de Chave P\u00FAblica"},
+        {"Remove.Public.Key.Alias", "Remover Alias de Chave P\u00FAblica"},
+        {"File", "Arquivo"},
+        {"KeyStore", "KeyStore"},
+        {"Policy.File.", "Arquivo de Pol\u00EDtica:"},
+        {"Could.not.open.policy.file.policyFile.e.toString.",
+                "N\u00E3o foi poss\u00EDvel abrir o arquivo de pol\u00EDtica: {0}: {1}"},
+        {"Policy.Tool", "Ferramenta de Pol\u00EDtica"},
+        {"Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.",
+                "Erros durante a abertura da configura\u00E7\u00E3o da pol\u00EDtica. Consulte o Log de Advert\u00EAncias para obter mais informa\u00E7\u00F5es."},
+        {"Error", "Erro"},
+        {"OK", "OK"},
+        {"Status", "Status"},
+        {"Warning", "Advert\u00EAncia"},
+        {"Permission.",
+                "Permiss\u00E3o:                                                       "},
+        {"Principal.Type.", "Tipo do Principal:"},
+        {"Principal.Name.", "Nome do Principal:"},
+        {"Target.Name.",
+                "Nome do Alvo:                                                    "},
+        {"Actions.",
+                "A\u00E7\u00F5es:                                                             "},
+        {"OK.to.overwrite.existing.file.filename.",
+                "Est\u00E1 correto substituir o arquivo existente {0}?"},
+        {"Cancel", "Cancelar"},
+        {"CodeBase.", "CodeBase:"},
+        {"SignedBy.", "SignedBy:"},
+        {"Add.Principal", "Adicionar Principal"},
+        {"Edit.Principal", "Editar Principal"},
+        {"Remove.Principal", "Remover Principal"},
+        {"Principals.", "Principais:"},
+        {".Add.Permission", "  Adicionar Permiss\u00E3o"},
+        {".Edit.Permission", "  Editar Permiss\u00E3o"},
+        {"Remove.Permission", "Remover Permiss\u00E3o"},
+        {"Done", "Conclu\u00EDdo"},
+        {"KeyStore.URL.", "URL do KeyStore:"},
+        {"KeyStore.Type.", "Tipo de KeyStore:"},
+        {"KeyStore.Provider.", "Fornecedor de KeyStore:"},
+        {"KeyStore.Password.URL.", "URL da Senha do KeyStore:"},
+        {"Principals", "Principais"},
+        {".Edit.Principal.", "  Editar Principal:"},
+        {".Add.New.Principal.", "  Adicionar Novo Principal:"},
+        {"Permissions", "Permiss\u00F5es"},
+        {".Edit.Permission.", "  Editar Permiss\u00E3o:"},
+        {".Add.New.Permission.", "  Adicionar Nova Permiss\u00E3o:"},
+        {"Signed.By.", "Assinado por:"},
+        {"Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name",
+            "N\u00E3o \u00E9 Poss\u00EDvel Especificar um Principal com uma Classe de Curinga sem um Nome de Curinga"},
+        {"Cannot.Specify.Principal.without.a.Name",
+            "N\u00E3o \u00E9 Poss\u00EDvel Especificar um Principal sem um Nome"},
+        {"Permission.and.Target.Name.must.have.a.value",
+                "O Nome de Destino e a Permiss\u00E3o devem ter um Valor"},
+        {"Remove.this.Policy.Entry.", "Remover esta Entrada de Pol\u00EDtica?"},
+        {"Overwrite.File", "Substituir Arquivo"},
+        {"Policy.successfully.written.to.filename",
+                "Pol\u00EDtica gravada com \u00EAxito em {0}"},
+        {"null.filename", "nome de arquivo nulo"},
+        {"Save.changes.", "Salvar altera\u00E7\u00F5es?"},
+        {"Yes", "Sim"},
+        {"No", "N\u00E3o"},
+        {"Policy.Entry", "Entrada de Pol\u00EDtica"},
+        {"Save.Changes", "Salvar Altera\u00E7\u00F5es"},
+        {"No.Policy.Entry.selected", "Nenhuma Entrada de Pol\u00EDtica Selecionada"},
+        {"Unable.to.open.KeyStore.ex.toString.",
+                "N\u00E3o \u00E9 poss\u00EDvel abrir a KeyStore: {0}"},
+        {"No.principal.selected", "Nenhum principal selecionado"},
+        {"No.permission.selected", "Nenhuma permiss\u00E3o selecionada"},
+        {"name", "nome"},
+        {"configuration.type", "tipo de configura\u00E7\u00E3o"},
+        {"environment.variable.name", "nome da vari\u00E1vel de ambiente"},
+        {"library.name", "nome da biblioteca"},
+        {"package.name", "nome do pacote"},
+        {"policy.type", "tipo de pol\u00EDtica"},
+        {"property.name", "nome da propriedade"},
+        {"provider.name", "nome do fornecedor"},
+        {"url", "url"},
+        {"method.list", "lista de m\u00E9todos"},
+        {"request.headers.list", "solicitar lista de cabe\u00E7alhos"},
+        {"Principal.List", "Lista de Principais"},
+        {"Permission.List", "Lista de Permiss\u00F5es"},
+        {"Code.Base", "Base de C\u00F3digo"},
+        {"KeyStore.U.R.L.", "U R L da KeyStore:"},
+        {"KeyStore.Password.U.R.L.", "U R L da Senha do KeyStore:"}
+    };
+
+
+    /**
+     * Returns the contents of this <code>ResourceBundle</code>.
+     *
+     * <p>
+     *
+     * @return the contents of this <code>ResourceBundle</code>.
+     */
+    @Override
+    public Object[][] getContents() {
+        return contents;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_sv.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,159 @@
+/*
+ * Copyright (c) 2000, 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.security.tools.policytool;
+
+/**
+ * <p> This class represents the <code>ResourceBundle</code>
+ * for the policytool.
+ *
+ */
+public class Resources_sv extends java.util.ListResourceBundle {
+
+    private static final Object[][] contents = {
+        {"NEWLINE", "\n"},
+        {"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.",
+                "Varning! Det finns ingen offentlig nyckel f\u00F6r aliaset {0}. Kontrollera att det aktuella nyckellagret \u00E4r korrekt konfigurerat."},
+        {"Warning.Class.not.found.class", "Varning! Klassen hittades inte: {0}"},
+        {"Warning.Invalid.argument.s.for.constructor.arg",
+                "Varning! Ogiltiga argument f\u00F6r konstruktor: {0}"},
+        {"Illegal.Principal.Type.type", "Otill\u00E5ten identitetshavaretyp: {0}"},
+        {"Illegal.option.option", "Otill\u00E5tet alternativ: {0}"},
+        {"Usage.policytool.options.", "Syntax: policytool [alternativ]"},
+        {".file.file.policy.file.location",
+                "  [-file <fil>]    policyfilens plats"},
+        {"New", "Nytt"},
+        {"Open", "\u00D6ppna"},
+        {"Save", "Spara"},
+        {"Save.As", "Spara som"},
+        {"View.Warning.Log", "Visa varningslogg"},
+        {"Exit", "Avsluta"},
+        {"Add.Policy.Entry", "L\u00E4gg till policypost"},
+        {"Edit.Policy.Entry", "Redigera policypost"},
+        {"Remove.Policy.Entry", "Ta bort policypost"},
+        {"Edit", "Redigera"},
+        {"Retain", "Beh\u00E5ll"},
+
+        {"Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes",
+            "Varning! Filnamnet kan inneh\u00E5lla omv\u00E4nda snedstreck inom citattecken. Citattecken kr\u00E4vs inte f\u00F6r omv\u00E4nda snedstreck (verktyget hanterar detta n\u00E4r policyinneh\u00E5llet skrivs till det best\u00E4ndiga lagret).\n\nKlicka p\u00E5 Beh\u00E5ll f\u00F6r att beh\u00E5lla det angivna namnet, eller klicka p\u00E5 Redigera f\u00F6r att \u00E4ndra det."},
+
+        {"Add.Public.Key.Alias", "L\u00E4gg till offentligt nyckelalias"},
+        {"Remove.Public.Key.Alias", "Ta bort offentligt nyckelalias"},
+        {"File", "Fil"},
+        {"KeyStore", "Nyckellager"},
+        {"Policy.File.", "Policyfil:"},
+        {"Could.not.open.policy.file.policyFile.e.toString.",
+                "Kan inte \u00F6ppna policyfilen: {0}: {1}"},
+        {"Policy.Tool", "Policyverktyg"},
+        {"Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.",
+                "Det uppstod ett fel n\u00E4r policykonfigurationen skulle \u00F6ppnas. Se varningsloggen f\u00F6r mer information."},
+        {"Error", "Fel"},
+        {"OK", "OK"},
+        {"Status", "Status"},
+        {"Warning", "Varning"},
+        {"Permission.",
+                "Beh\u00F6righet:                                                       "},
+        {"Principal.Type.", "Identitetshavaretyp:"},
+        {"Principal.Name.", "Identitetshavare:"},
+        {"Target.Name.",
+                "M\u00E5l:                                                    "},
+        {"Actions.",
+                "Funktioner:                                                             "},
+        {"OK.to.overwrite.existing.file.filename.",
+                "Ska den befintliga filen {0} skrivas \u00F6ver?"},
+        {"Cancel", "Avbryt"},
+        {"CodeBase.", "Kodbas:"},
+        {"SignedBy.", "Signerad av:"},
+        {"Add.Principal", "L\u00E4gg till identitetshavare"},
+        {"Edit.Principal", "Redigera identitetshavare"},
+        {"Remove.Principal", "Ta bort identitetshavare"},
+        {"Principals.", "Identitetshavare:"},
+        {".Add.Permission", "  L\u00E4gg till beh\u00F6righet"},
+        {".Edit.Permission", "  Redigera beh\u00F6righet"},
+        {"Remove.Permission", "Ta bort beh\u00F6righet"},
+        {"Done", "Utf\u00F6rd"},
+        {"KeyStore.URL.", "URL f\u00F6r nyckellager:"},
+        {"KeyStore.Type.", "Nyckellagertyp:"},
+        {"KeyStore.Provider.", "Nyckellagerleverant\u00F6r:"},
+        {"KeyStore.Password.URL.", "URL f\u00F6r l\u00F6senord till nyckellager:"},
+        {"Principals", "Identitetshavare"},
+        {".Edit.Principal.", "  Redigera identitetshavare:"},
+        {".Add.New.Principal.", "  L\u00E4gg till ny identitetshavare:"},
+        {"Permissions", "Beh\u00F6righet"},
+        {".Edit.Permission.", "  Redigera beh\u00F6righet:"},
+        {".Add.New.Permission.", "  L\u00E4gg till ny beh\u00F6righet:"},
+        {"Signed.By.", "Signerad av:"},
+        {"Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name",
+            "Kan inte specificera identitetshavare med jokerteckenklass utan jokerteckennamn"},
+        {"Cannot.Specify.Principal.without.a.Name",
+            "Kan inte specificera identitetshavare utan namn"},
+        {"Permission.and.Target.Name.must.have.a.value",
+                "Beh\u00F6righet och m\u00E5lnamn m\u00E5ste ha ett v\u00E4rde"},
+        {"Remove.this.Policy.Entry.", "Vill du ta bort den h\u00E4r policyposten?"},
+        {"Overwrite.File", "Skriv \u00F6ver fil"},
+        {"Policy.successfully.written.to.filename",
+                "Policy har skrivits till {0}"},
+        {"null.filename", "nullfilnamn"},
+        {"Save.changes.", "Vill du spara \u00E4ndringarna?"},
+        {"Yes", "Ja"},
+        {"No", "Nej"},
+        {"Policy.Entry", "Policyfel"},
+        {"Save.Changes", "Spara \u00E4ndringar"},
+        {"No.Policy.Entry.selected", "Ingen policypost har valts"},
+        {"Unable.to.open.KeyStore.ex.toString.",
+                "Kan inte \u00F6ppna nyckellagret: {0}"},
+        {"No.principal.selected", "Ingen identitetshavare har valts"},
+        {"No.permission.selected", "Ingen beh\u00F6righet har valts"},
+        {"name", "namn"},
+        {"configuration.type", "konfigurationstyp"},
+        {"environment.variable.name", "variabelnamn f\u00F6r milj\u00F6"},
+        {"library.name", "biblioteksnamn"},
+        {"package.name", "paketnamn"},
+        {"policy.type", "policytyp"},
+        {"property.name", "egenskapsnamn"},
+        {"provider.name", "leverant\u00F6rsnamn"},
+        {"url", "url"},
+        {"method.list", "metodlista"},
+        {"request.headers.list", "beg\u00E4ranrubriklista"},
+        {"Principal.List", "Lista \u00F6ver identitetshavare"},
+        {"Permission.List", "Beh\u00F6righetslista"},
+        {"Code.Base", "Kodbas"},
+        {"KeyStore.U.R.L.", "URL f\u00F6r nyckellager:"},
+        {"KeyStore.Password.U.R.L.", "URL f\u00F6r l\u00F6senord till nyckellager:"}
+    };
+
+
+    /**
+     * Returns the contents of this <code>ResourceBundle</code>.
+     *
+     * <p>
+     *
+     * @return the contents of this <code>ResourceBundle</code>.
+     */
+    @Override
+    public Object[][] getContents() {
+        return contents;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_zh_CN.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,159 @@
+/*
+ * Copyright (c) 2000, 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.security.tools.policytool;
+
+/**
+ * <p> This class represents the <code>ResourceBundle</code>
+ * for the policytool.
+ *
+ */
+public class Resources_zh_CN extends java.util.ListResourceBundle {
+
+    private static final Object[][] contents = {
+        {"NEWLINE", "\n"},
+        {"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.",
+                "\u8B66\u544A: \u522B\u540D {0} \u7684\u516C\u5171\u5BC6\u94A5\u4E0D\u5B58\u5728\u3002\u8BF7\u786E\u4FDD\u5DF2\u6B63\u786E\u914D\u7F6E\u5BC6\u94A5\u5E93\u3002"},
+        {"Warning.Class.not.found.class", "\u8B66\u544A: \u627E\u4E0D\u5230\u7C7B: {0}"},
+        {"Warning.Invalid.argument.s.for.constructor.arg",
+                "\u8B66\u544A: \u6784\u9020\u5668\u7684\u53C2\u6570\u65E0\u6548: {0}"},
+        {"Illegal.Principal.Type.type", "\u975E\u6CD5\u7684\u4E3B\u7528\u6237\u7C7B\u578B: {0}"},
+        {"Illegal.option.option", "\u975E\u6CD5\u9009\u9879: {0}"},
+        {"Usage.policytool.options.", "\u7528\u6CD5: policytool [\u9009\u9879]"},
+        {".file.file.policy.file.location",
+                "  [-file <file>]    \u7B56\u7565\u6587\u4EF6\u4F4D\u7F6E"},
+        {"New", "\u65B0\u5EFA"},
+        {"Open", "\u6253\u5F00"},
+        {"Save", "\u4FDD\u5B58"},
+        {"Save.As", "\u53E6\u5B58\u4E3A"},
+        {"View.Warning.Log", "\u67E5\u770B\u8B66\u544A\u65E5\u5FD7"},
+        {"Exit", "\u9000\u51FA"},
+        {"Add.Policy.Entry", "\u6DFB\u52A0\u7B56\u7565\u6761\u76EE"},
+        {"Edit.Policy.Entry", "\u7F16\u8F91\u7B56\u7565\u6761\u76EE"},
+        {"Remove.Policy.Entry", "\u5220\u9664\u7B56\u7565\u6761\u76EE"},
+        {"Edit", "\u7F16\u8F91"},
+        {"Retain", "\u4FDD\u7559"},
+
+        {"Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes",
+            "\u8B66\u544A: \u6587\u4EF6\u540D\u5305\u542B\u8F6C\u4E49\u7684\u53CD\u659C\u6760\u5B57\u7B26\u3002\u4E0D\u9700\u8981\u5BF9\u53CD\u659C\u6760\u5B57\u7B26\u8FDB\u884C\u8F6C\u4E49 (\u8BE5\u5DE5\u5177\u5728\u5C06\u7B56\u7565\u5185\u5BB9\u5199\u5165\u6C38\u4E45\u5B58\u50A8\u65F6\u4F1A\u6839\u636E\u9700\u8981\u5BF9\u5B57\u7B26\u8FDB\u884C\u8F6C\u4E49)\u3002\n\n\u5355\u51FB\u201C\u4FDD\u7559\u201D\u53EF\u4FDD\u7559\u8F93\u5165\u7684\u540D\u79F0, \u6216\u8005\u5355\u51FB\u201C\u7F16\u8F91\u201D\u53EF\u7F16\u8F91\u8BE5\u540D\u79F0\u3002"},
+
+        {"Add.Public.Key.Alias", "\u6DFB\u52A0\u516C\u5171\u5BC6\u94A5\u522B\u540D"},
+        {"Remove.Public.Key.Alias", "\u5220\u9664\u516C\u5171\u5BC6\u94A5\u522B\u540D"},
+        {"File", "\u6587\u4EF6"},
+        {"KeyStore", "\u5BC6\u94A5\u5E93"},
+        {"Policy.File.", "\u7B56\u7565\u6587\u4EF6:"},
+        {"Could.not.open.policy.file.policyFile.e.toString.",
+                "\u65E0\u6CD5\u6253\u5F00\u7B56\u7565\u6587\u4EF6: {0}: {1}"},
+        {"Policy.Tool", "\u7B56\u7565\u5DE5\u5177"},
+        {"Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.",
+                "\u6253\u5F00\u7B56\u7565\u914D\u7F6E\u65F6\u51FA\u9519\u3002\u6709\u5173\u8BE6\u7EC6\u4FE1\u606F, \u8BF7\u67E5\u770B\u8B66\u544A\u65E5\u5FD7\u3002"},
+        {"Error", "\u9519\u8BEF"},
+        {"OK", "\u786E\u5B9A"},
+        {"Status", "\u72B6\u6001"},
+        {"Warning", "\u8B66\u544A"},
+        {"Permission.",
+                "\u6743\u9650:                                                       "},
+        {"Principal.Type.", "\u4E3B\u7528\u6237\u7C7B\u578B:"},
+        {"Principal.Name.", "\u4E3B\u7528\u6237\u540D\u79F0:"},
+        {"Target.Name.",
+                "\u76EE\u6807\u540D\u79F0:                                                    "},
+        {"Actions.",
+                "\u64CD\u4F5C:                                                             "},
+        {"OK.to.overwrite.existing.file.filename.",
+                "\u786E\u8BA4\u8986\u76D6\u73B0\u6709\u7684\u6587\u4EF6{0}?"},
+        {"Cancel", "\u53D6\u6D88"},
+        {"CodeBase.", "CodeBase:"},
+        {"SignedBy.", "SignedBy:"},
+        {"Add.Principal", "\u6DFB\u52A0\u4E3B\u7528\u6237"},
+        {"Edit.Principal", "\u7F16\u8F91\u4E3B\u7528\u6237"},
+        {"Remove.Principal", "\u5220\u9664\u4E3B\u7528\u6237"},
+        {"Principals.", "\u4E3B\u7528\u6237:"},
+        {".Add.Permission", "  \u6DFB\u52A0\u6743\u9650"},
+        {".Edit.Permission", "  \u7F16\u8F91\u6743\u9650"},
+        {"Remove.Permission", "\u5220\u9664\u6743\u9650"},
+        {"Done", "\u5B8C\u6210"},
+        {"KeyStore.URL.", "\u5BC6\u94A5\u5E93 URL:"},
+        {"KeyStore.Type.", "\u5BC6\u94A5\u5E93\u7C7B\u578B:"},
+        {"KeyStore.Provider.", "\u5BC6\u94A5\u5E93\u63D0\u4F9B\u65B9:"},
+        {"KeyStore.Password.URL.", "\u5BC6\u94A5\u5E93\u53E3\u4EE4 URL:"},
+        {"Principals", "\u4E3B\u7528\u6237"},
+        {".Edit.Principal.", "  \u7F16\u8F91\u4E3B\u7528\u6237:"},
+        {".Add.New.Principal.", "  \u6DFB\u52A0\u65B0\u4E3B\u7528\u6237:"},
+        {"Permissions", "\u6743\u9650"},
+        {".Edit.Permission.", "  \u7F16\u8F91\u6743\u9650:"},
+        {".Add.New.Permission.", "  \u52A0\u5165\u65B0\u7684\u6743\u9650:"},
+        {"Signed.By.", "\u7B7E\u7F72\u4EBA: "},
+        {"Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name",
+            "\u6CA1\u6709\u901A\u914D\u7B26\u540D\u79F0, \u65E0\u6CD5\u4F7F\u7528\u901A\u914D\u7B26\u7C7B\u6307\u5B9A\u4E3B\u7528\u6237"},
+        {"Cannot.Specify.Principal.without.a.Name",
+            "\u6CA1\u6709\u540D\u79F0, \u65E0\u6CD5\u6307\u5B9A\u4E3B\u7528\u6237"},
+        {"Permission.and.Target.Name.must.have.a.value",
+                "\u6743\u9650\u53CA\u76EE\u6807\u540D\u5FC5\u987B\u6709\u4E00\u4E2A\u503C"},
+        {"Remove.this.Policy.Entry.", "\u662F\u5426\u5220\u9664\u6B64\u7B56\u7565\u6761\u76EE?"},
+        {"Overwrite.File", "\u8986\u76D6\u6587\u4EF6"},
+        {"Policy.successfully.written.to.filename",
+                "\u7B56\u7565\u5DF2\u6210\u529F\u5199\u5165\u5230{0}"},
+        {"null.filename", "\u7A7A\u6587\u4EF6\u540D"},
+        {"Save.changes.", "\u662F\u5426\u4FDD\u5B58\u6240\u505A\u7684\u66F4\u6539?"},
+        {"Yes", "\u662F"},
+        {"No", "\u5426"},
+        {"Policy.Entry", "\u7B56\u7565\u6761\u76EE"},
+        {"Save.Changes", "\u4FDD\u5B58\u66F4\u6539"},
+        {"No.Policy.Entry.selected", "\u6CA1\u6709\u9009\u62E9\u7B56\u7565\u6761\u76EE"},
+        {"Unable.to.open.KeyStore.ex.toString.",
+                "\u65E0\u6CD5\u6253\u5F00\u5BC6\u94A5\u5E93: {0}"},
+        {"No.principal.selected", "\u672A\u9009\u62E9\u4E3B\u7528\u6237"},
+        {"No.permission.selected", "\u6CA1\u6709\u9009\u62E9\u6743\u9650"},
+        {"name", "\u540D\u79F0"},
+        {"configuration.type", "\u914D\u7F6E\u7C7B\u578B"},
+        {"environment.variable.name", "\u73AF\u5883\u53D8\u91CF\u540D"},
+        {"library.name", "\u5E93\u540D\u79F0"},
+        {"package.name", "\u7A0B\u5E8F\u5305\u540D\u79F0"},
+        {"policy.type", "\u7B56\u7565\u7C7B\u578B"},
+        {"property.name", "\u5C5E\u6027\u540D\u79F0"},
+        {"provider.name", "\u63D0\u4F9B\u65B9\u540D\u79F0"},
+        {"url", "URL"},
+        {"method.list", "\u65B9\u6CD5\u5217\u8868"},
+        {"request.headers.list", "\u8BF7\u6C42\u6807\u5934\u5217\u8868"},
+        {"Principal.List", "\u4E3B\u7528\u6237\u5217\u8868"},
+        {"Permission.List", "\u6743\u9650\u5217\u8868"},
+        {"Code.Base", "\u4EE3\u7801\u5E93"},
+        {"KeyStore.U.R.L.", "\u5BC6\u94A5\u5E93 URL:"},
+        {"KeyStore.Password.U.R.L.", "\u5BC6\u94A5\u5E93\u53E3\u4EE4 URL:"}
+    };
+
+
+    /**
+     * Returns the contents of this <code>ResourceBundle</code>.
+     *
+     * <p>
+     *
+     * @return the contents of this <code>ResourceBundle</code>.
+     */
+    @Override
+    public Object[][] getContents() {
+        return contents;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_zh_HK.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,156 @@
+/*
+ * Copyright (c) 2000, 2012, 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.security.tools.policytool;
+
+/**
+ * <p> This class represents the <code>ResourceBundle</code>
+ * for the policytool.
+ *
+ */
+public class Resources_zh_HK extends java.util.ListResourceBundle {
+
+    private static final Object[][] contents = {
+        {"NEWLINE", "\n"},
+        {"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.",
+                "\u8B66\u544A: \u5225\u540D {0} \u7684\u516C\u958B\u91D1\u9470\u4E0D\u5B58\u5728\u3002\u8ACB\u78BA\u5B9A\u91D1\u9470\u5132\u5B58\u5EAB\u914D\u7F6E\u6B63\u78BA\u3002"},
+        {"Warning.Class.not.found.class", "\u8B66\u544A: \u627E\u4E0D\u5230\u985E\u5225 {0}"},
+        {"Warning.Invalid.argument.s.for.constructor.arg",
+                "\u8B66\u544A: \u7121\u6548\u7684\u5EFA\u69CB\u5B50\u5F15\u6578: {0}"},
+        {"Illegal.Principal.Type.type", "\u7121\u6548\u7684 Principal \u985E\u578B: {0}"},
+        {"Illegal.option.option", "\u7121\u6548\u7684\u9078\u9805: {0}"},
+        {"Usage.policytool.options.", "\u7528\u6CD5: policytool [options]"},
+        {".file.file.policy.file.location",
+                "  [-file <file>]    \u539F\u5247\u6A94\u6848\u4F4D\u7F6E"},
+        {"New", "\u65B0\u589E"},
+        {"Open", "\u958B\u555F"},
+        {"Save", "\u5132\u5B58"},
+        {"Save.As", "\u53E6\u5B58\u65B0\u6A94"},
+        {"View.Warning.Log", "\u6AA2\u8996\u8B66\u544A\u8A18\u9304"},
+        {"Exit", "\u7D50\u675F"},
+        {"Add.Policy.Entry", "\u65B0\u589E\u539F\u5247\u9805\u76EE"},
+        {"Edit.Policy.Entry", "\u7DE8\u8F2F\u539F\u5247\u9805\u76EE"},
+        {"Remove.Policy.Entry", "\u79FB\u9664\u539F\u5247\u9805\u76EE"},
+        {"Edit", "\u7DE8\u8F2F"},
+        {"Retain", "\u4FDD\u7559"},
+
+        {"Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes",
+            "\u8B66\u544A: \u6A94\u6848\u540D\u7A31\u5305\u542B\u9041\u96E2\u53CD\u659C\u7DDA\u5B57\u5143\u3002\u4E0D\u9700\u8981\u9041\u96E2\u53CD\u659C\u7DDA\u5B57\u5143 (\u64B0\u5BEB\u539F\u5247\u5167\u5BB9\u81F3\u6C38\u4E45\u5B58\u653E\u5340\u6642\u9700\u8981\u5DE5\u5177\u9041\u96E2\u5B57\u5143)\u3002\n\n\u6309\u4E00\u4E0B\u300C\u4FDD\u7559\u300D\u4EE5\u4FDD\u7559\u8F38\u5165\u7684\u540D\u7A31\uFF0C\u6216\u6309\u4E00\u4E0B\u300C\u7DE8\u8F2F\u300D\u4EE5\u7DE8\u8F2F\u540D\u7A31\u3002"},
+
+        {"Add.Public.Key.Alias", "\u65B0\u589E\u516C\u958B\u91D1\u9470\u5225\u540D"},
+        {"Remove.Public.Key.Alias", "\u79FB\u9664\u516C\u958B\u91D1\u9470\u5225\u540D"},
+        {"File", "\u6A94\u6848"},
+        {"KeyStore", "\u91D1\u9470\u5132\u5B58\u5EAB"},
+        {"Policy.File.", "\u539F\u5247\u6A94\u6848: "},
+        {"Could.not.open.policy.file.policyFile.e.toString.",
+                "\u7121\u6CD5\u958B\u555F\u539F\u5247\u6A94\u6848: {0}: {1}"},
+        {"Policy.Tool", "\u539F\u5247\u5DE5\u5177"},
+        {"Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.",
+                "\u958B\u555F\u539F\u5247\u8A18\u7F6E\u6642\u767C\u751F\u932F\u8AA4\u3002\u8ACB\u6AA2\u8996\u8B66\u544A\u8A18\u9304\u4EE5\u53D6\u5F97\u66F4\u591A\u7684\u8CC7\u8A0A"},
+        {"Error", "\u932F\u8AA4"},
+        {"OK", "\u78BA\u5B9A"},
+        {"Status", "\u72C0\u614B"},
+        {"Warning", "\u8B66\u544A"},
+        {"Permission.",
+                "\u6B0A\u9650:                                                       "},
+        {"Principal.Type.", "Principal \u985E\u578B: "},
+        {"Principal.Name.", "Principal \u540D\u7A31: "},
+        {"Target.Name.",
+                "\u76EE\u6A19\u540D\u7A31:                                                    "},
+        {"Actions.",
+                "\u52D5\u4F5C:                                                             "},
+        {"OK.to.overwrite.existing.file.filename.",
+                "\u78BA\u8A8D\u8986\u5BEB\u73FE\u5B58\u7684\u6A94\u6848 {0}\uFF1F"},
+        {"Cancel", "\u53D6\u6D88"},
+        {"CodeBase.", "CodeBase:"},
+        {"SignedBy.", "SignedBy:"},
+        {"Add.Principal", "\u65B0\u589E Principal"},
+        {"Edit.Principal", "\u7DE8\u8F2F Principal"},
+        {"Remove.Principal", "\u79FB\u9664 Principal"},
+        {"Principals.", "Principal:"},
+        {".Add.Permission", "  \u65B0\u589E\u6B0A\u9650"},
+        {".Edit.Permission", "  \u7DE8\u8F2F\u6B0A\u9650"},
+        {"Remove.Permission", "\u79FB\u9664\u6B0A\u9650"},
+        {"Done", "\u5B8C\u6210"},
+        {"KeyStore.URL.", "\u91D1\u9470\u5132\u5B58\u5EAB URL: "},
+        {"KeyStore.Type.", "\u91D1\u9470\u5132\u5B58\u5EAB\u985E\u578B:"},
+        {"KeyStore.Provider.", "\u91D1\u9470\u5132\u5B58\u5EAB\u63D0\u4F9B\u8005:"},
+        {"KeyStore.Password.URL.", "\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC URL: "},
+        {"Principals", "Principal"},
+        {".Edit.Principal.", "  \u7DE8\u8F2F Principal: "},
+        {".Add.New.Principal.", "  \u65B0\u589E Principal: "},
+        {"Permissions", "\u6B0A\u9650"},
+        {".Edit.Permission.", "  \u7DE8\u8F2F\u6B0A\u9650:"},
+        {".Add.New.Permission.", "  \u65B0\u589E\u6B0A\u9650:"},
+        {"Signed.By.", "\u7C3D\u7F72\u4EBA: "},
+        {"Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name",
+            "\u6C92\u6709\u842C\u7528\u5B57\u5143\u540D\u7A31\uFF0C\u7121\u6CD5\u6307\u5B9A\u542B\u6709\u842C\u7528\u5B57\u5143\u985E\u5225\u7684 Principal"},
+        {"Cannot.Specify.Principal.without.a.Name",
+            "\u6C92\u6709\u540D\u7A31\uFF0C\u7121\u6CD5\u6307\u5B9A Principal"},
+        {"Permission.and.Target.Name.must.have.a.value",
+                "\u6B0A\u9650\u53CA\u76EE\u6A19\u540D\u7A31\u5FC5\u9808\u6709\u4E00\u500B\u503C\u3002"},
+        {"Remove.this.Policy.Entry.", "\u79FB\u9664\u9019\u500B\u539F\u5247\u9805\u76EE\uFF1F"},
+        {"Overwrite.File", "\u8986\u5BEB\u6A94\u6848"},
+        {"Policy.successfully.written.to.filename",
+                "\u539F\u5247\u6210\u529F\u5BEB\u5165\u81F3 {0}"},
+        {"null.filename", "\u7A7A\u503C\u6A94\u540D"},
+        {"Save.changes.", "\u5132\u5B58\u8B8A\u66F4\uFF1F"},
+        {"Yes", "\u662F"},
+        {"No", "\u5426"},
+        {"Policy.Entry", "\u539F\u5247\u9805\u76EE"},
+        {"Save.Changes", "\u5132\u5B58\u8B8A\u66F4"},
+        {"No.Policy.Entry.selected", "\u6C92\u6709\u9078\u53D6\u539F\u5247\u9805\u76EE"},
+        {"Unable.to.open.KeyStore.ex.toString.",
+                "\u7121\u6CD5\u958B\u555F\u91D1\u9470\u5132\u5B58\u5EAB: {0}"},
+        {"No.principal.selected", "\u672A\u9078\u53D6 Principal"},
+        {"No.permission.selected", "\u6C92\u6709\u9078\u53D6\u6B0A\u9650"},
+        {"name", "\u540D\u7A31"},
+        {"configuration.type", "\u7D44\u614B\u985E\u578B"},
+        {"environment.variable.name", "\u74B0\u5883\u8B8A\u6578\u540D\u7A31"},
+        {"library.name", "\u7A0B\u5F0F\u5EAB\u540D\u7A31"},
+        {"package.name", "\u5957\u88DD\u7A0B\u5F0F\u540D\u7A31"},
+        {"policy.type", "\u539F\u5247\u985E\u578B"},
+        {"property.name", "\u5C6C\u6027\u540D\u7A31"},
+        {"provider.name", "\u63D0\u4F9B\u8005\u540D\u7A31"},
+        {"Principal.List", "Principal \u6E05\u55AE"},
+        {"Permission.List", "\u6B0A\u9650\u6E05\u55AE"},
+        {"Code.Base", "\u4EE3\u78BC\u57FA\u6E96"},
+        {"KeyStore.U.R.L.", "\u91D1\u9470\u5132\u5B58\u5EAB URL:"},
+        {"KeyStore.Password.U.R.L.", "\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC URL:"}
+    };
+
+
+    /**
+     * Returns the contents of this <code>ResourceBundle</code>.
+     *
+     * <p>
+     *
+     * @return the contents of this <code>ResourceBundle</code>.
+     */
+    @Override
+    public Object[][] getContents() {
+        return contents;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_zh_TW.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,159 @@
+/*
+ * Copyright (c) 2000, 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.security.tools.policytool;
+
+/**
+ * <p> This class represents the <code>ResourceBundle</code>
+ * for the policytool.
+ *
+ */
+public class Resources_zh_TW extends java.util.ListResourceBundle {
+
+    private static final Object[][] contents = {
+        {"NEWLINE", "\n"},
+        {"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.",
+                "\u8B66\u544A: \u5225\u540D {0} \u7684\u516C\u958B\u91D1\u9470\u4E0D\u5B58\u5728\u3002\u8ACB\u78BA\u5B9A\u91D1\u9470\u5132\u5B58\u5EAB\u914D\u7F6E\u6B63\u78BA\u3002"},
+        {"Warning.Class.not.found.class", "\u8B66\u544A: \u627E\u4E0D\u5230\u985E\u5225 {0}"},
+        {"Warning.Invalid.argument.s.for.constructor.arg",
+                "\u8B66\u544A: \u7121\u6548\u7684\u5EFA\u69CB\u5B50\u5F15\u6578: {0}"},
+        {"Illegal.Principal.Type.type", "\u7121\u6548\u7684 Principal \u985E\u578B: {0}"},
+        {"Illegal.option.option", "\u7121\u6548\u7684\u9078\u9805: {0}"},
+        {"Usage.policytool.options.", "\u7528\u6CD5: policytool [options]"},
+        {".file.file.policy.file.location",
+                "  [-file <file>]    \u539F\u5247\u6A94\u6848\u4F4D\u7F6E"},
+        {"New", "\u65B0\u589E"},
+        {"Open", "\u958B\u555F"},
+        {"Save", "\u5132\u5B58"},
+        {"Save.As", "\u53E6\u5B58\u65B0\u6A94"},
+        {"View.Warning.Log", "\u6AA2\u8996\u8B66\u544A\u8A18\u9304"},
+        {"Exit", "\u7D50\u675F"},
+        {"Add.Policy.Entry", "\u65B0\u589E\u539F\u5247\u9805\u76EE"},
+        {"Edit.Policy.Entry", "\u7DE8\u8F2F\u539F\u5247\u9805\u76EE"},
+        {"Remove.Policy.Entry", "\u79FB\u9664\u539F\u5247\u9805\u76EE"},
+        {"Edit", "\u7DE8\u8F2F"},
+        {"Retain", "\u4FDD\u7559"},
+
+        {"Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes",
+            "\u8B66\u544A: \u6A94\u6848\u540D\u7A31\u5305\u542B\u9041\u96E2\u53CD\u659C\u7DDA\u5B57\u5143\u3002\u4E0D\u9700\u8981\u9041\u96E2\u53CD\u659C\u7DDA\u5B57\u5143 (\u64B0\u5BEB\u539F\u5247\u5167\u5BB9\u81F3\u6C38\u4E45\u5B58\u653E\u5340\u6642\u9700\u8981\u5DE5\u5177\u9041\u96E2\u5B57\u5143)\u3002\n\n\u6309\u4E00\u4E0B\u300C\u4FDD\u7559\u300D\u4EE5\u4FDD\u7559\u8F38\u5165\u7684\u540D\u7A31\uFF0C\u6216\u6309\u4E00\u4E0B\u300C\u7DE8\u8F2F\u300D\u4EE5\u7DE8\u8F2F\u540D\u7A31\u3002"},
+
+        {"Add.Public.Key.Alias", "\u65B0\u589E\u516C\u958B\u91D1\u9470\u5225\u540D"},
+        {"Remove.Public.Key.Alias", "\u79FB\u9664\u516C\u958B\u91D1\u9470\u5225\u540D"},
+        {"File", "\u6A94\u6848"},
+        {"KeyStore", "\u91D1\u9470\u5132\u5B58\u5EAB"},
+        {"Policy.File.", "\u539F\u5247\u6A94\u6848: "},
+        {"Could.not.open.policy.file.policyFile.e.toString.",
+                "\u7121\u6CD5\u958B\u555F\u539F\u5247\u6A94\u6848: {0}: {1}"},
+        {"Policy.Tool", "\u539F\u5247\u5DE5\u5177"},
+        {"Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.",
+                "\u958B\u555F\u539F\u5247\u8A18\u7F6E\u6642\u767C\u751F\u932F\u8AA4\u3002\u8ACB\u6AA2\u8996\u8B66\u544A\u8A18\u9304\u4EE5\u53D6\u5F97\u66F4\u591A\u7684\u8CC7\u8A0A"},
+        {"Error", "\u932F\u8AA4"},
+        {"OK", "\u78BA\u5B9A"},
+        {"Status", "\u72C0\u614B"},
+        {"Warning", "\u8B66\u544A"},
+        {"Permission.",
+                "\u6B0A\u9650:                                                       "},
+        {"Principal.Type.", "Principal \u985E\u578B: "},
+        {"Principal.Name.", "Principal \u540D\u7A31: "},
+        {"Target.Name.",
+                "\u76EE\u6A19\u540D\u7A31:                                                    "},
+        {"Actions.",
+                "\u52D5\u4F5C:                                                             "},
+        {"OK.to.overwrite.existing.file.filename.",
+                "\u78BA\u8A8D\u8986\u5BEB\u73FE\u5B58\u7684\u6A94\u6848 {0}\uFF1F"},
+        {"Cancel", "\u53D6\u6D88"},
+        {"CodeBase.", "CodeBase:"},
+        {"SignedBy.", "SignedBy:"},
+        {"Add.Principal", "\u65B0\u589E Principal"},
+        {"Edit.Principal", "\u7DE8\u8F2F Principal"},
+        {"Remove.Principal", "\u79FB\u9664 Principal"},
+        {"Principals.", "Principal:"},
+        {".Add.Permission", "  \u65B0\u589E\u6B0A\u9650"},
+        {".Edit.Permission", "  \u7DE8\u8F2F\u6B0A\u9650"},
+        {"Remove.Permission", "\u79FB\u9664\u6B0A\u9650"},
+        {"Done", "\u5B8C\u6210"},
+        {"KeyStore.URL.", "\u91D1\u9470\u5132\u5B58\u5EAB URL: "},
+        {"KeyStore.Type.", "\u91D1\u9470\u5132\u5B58\u5EAB\u985E\u578B:"},
+        {"KeyStore.Provider.", "\u91D1\u9470\u5132\u5B58\u5EAB\u63D0\u4F9B\u8005:"},
+        {"KeyStore.Password.URL.", "\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC URL: "},
+        {"Principals", "Principal"},
+        {".Edit.Principal.", "  \u7DE8\u8F2F Principal: "},
+        {".Add.New.Principal.", "  \u65B0\u589E Principal: "},
+        {"Permissions", "\u6B0A\u9650"},
+        {".Edit.Permission.", "  \u7DE8\u8F2F\u6B0A\u9650:"},
+        {".Add.New.Permission.", "  \u65B0\u589E\u6B0A\u9650:"},
+        {"Signed.By.", "\u7C3D\u7F72\u4EBA: "},
+        {"Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name",
+            "\u6C92\u6709\u842C\u7528\u5B57\u5143\u540D\u7A31\uFF0C\u7121\u6CD5\u6307\u5B9A\u542B\u6709\u842C\u7528\u5B57\u5143\u985E\u5225\u7684 Principal"},
+        {"Cannot.Specify.Principal.without.a.Name",
+            "\u6C92\u6709\u540D\u7A31\uFF0C\u7121\u6CD5\u6307\u5B9A Principal"},
+        {"Permission.and.Target.Name.must.have.a.value",
+                "\u6B0A\u9650\u53CA\u76EE\u6A19\u540D\u7A31\u5FC5\u9808\u6709\u4E00\u500B\u503C\u3002"},
+        {"Remove.this.Policy.Entry.", "\u79FB\u9664\u9019\u500B\u539F\u5247\u9805\u76EE\uFF1F"},
+        {"Overwrite.File", "\u8986\u5BEB\u6A94\u6848"},
+        {"Policy.successfully.written.to.filename",
+                "\u539F\u5247\u6210\u529F\u5BEB\u5165\u81F3 {0}"},
+        {"null.filename", "\u7A7A\u503C\u6A94\u540D"},
+        {"Save.changes.", "\u5132\u5B58\u8B8A\u66F4\uFF1F"},
+        {"Yes", "\u662F"},
+        {"No", "\u5426"},
+        {"Policy.Entry", "\u539F\u5247\u9805\u76EE"},
+        {"Save.Changes", "\u5132\u5B58\u8B8A\u66F4"},
+        {"No.Policy.Entry.selected", "\u6C92\u6709\u9078\u53D6\u539F\u5247\u9805\u76EE"},
+        {"Unable.to.open.KeyStore.ex.toString.",
+                "\u7121\u6CD5\u958B\u555F\u91D1\u9470\u5132\u5B58\u5EAB: {0}"},
+        {"No.principal.selected", "\u672A\u9078\u53D6 Principal"},
+        {"No.permission.selected", "\u6C92\u6709\u9078\u53D6\u6B0A\u9650"},
+        {"name", "\u540D\u7A31"},
+        {"configuration.type", "\u7D44\u614B\u985E\u578B"},
+        {"environment.variable.name", "\u74B0\u5883\u8B8A\u6578\u540D\u7A31"},
+        {"library.name", "\u7A0B\u5F0F\u5EAB\u540D\u7A31"},
+        {"package.name", "\u5957\u88DD\u7A0B\u5F0F\u540D\u7A31"},
+        {"policy.type", "\u539F\u5247\u985E\u578B"},
+        {"property.name", "\u5C6C\u6027\u540D\u7A31"},
+        {"provider.name", "\u63D0\u4F9B\u8005\u540D\u7A31"},
+        {"url", "URL"},
+        {"method.list", "\u65B9\u6CD5\u6E05\u55AE"},
+        {"request.headers.list", "\u8981\u6C42\u6A19\u982D\u6E05\u55AE"},
+        {"Principal.List", "Principal \u6E05\u55AE"},
+        {"Permission.List", "\u6B0A\u9650\u6E05\u55AE"},
+        {"Code.Base", "\u4EE3\u78BC\u57FA\u6E96"},
+        {"KeyStore.U.R.L.", "\u91D1\u9470\u5132\u5B58\u5EAB URL:"},
+        {"KeyStore.Password.U.R.L.", "\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC URL:"}
+    };
+
+
+    /**
+     * Returns the contents of this <code>ResourceBundle</code>.
+     *
+     * <p>
+     *
+     * @return the contents of this <code>ResourceBundle</code>.
+     */
+    @Override
+    public Object[][] getContents() {
+        return contents;
+    }
+}
--- a/jdk/src/jdk.localedata/share/classes/sun/util/resources/de/TimeZoneNames_de.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/jdk.localedata/share/classes/sun/util/resources/de/TimeZoneNames_de.java	Mon Feb 23 05:01: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
@@ -409,7 +409,7 @@
             {"America/Buenos_Aires", AGT},
             {"America/Cambridge_Bay", MST},
             {"America/Campo_Grande", AMT},
-            {"America/Cancun", CST},
+            {"America/Cancun", EST},
             {"America/Caracas", new String[] {"Venezuelanische Zeit", "VET",
                                               "Venezuelanische Sommerzeit", "VEST",
                                               "Venezuelanische Zeit", "VET"}},
--- a/jdk/src/jdk.localedata/share/classes/sun/util/resources/es/TimeZoneNames_es.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/jdk.localedata/share/classes/sun/util/resources/es/TimeZoneNames_es.java	Mon Feb 23 05:01: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
@@ -409,7 +409,7 @@
             {"America/Buenos_Aires", AGT},
             {"America/Cambridge_Bay", MST},
             {"America/Campo_Grande", AMT},
-            {"America/Cancun", CST},
+            {"America/Cancun", EST},
             {"America/Caracas", new String[] {"Hora de Venezuela", "VET",
                                               "Hora de verano de Venezuela", "VEST",
                                               "Hora de Venezuela", "VET"}},
--- a/jdk/src/jdk.localedata/share/classes/sun/util/resources/fr/TimeZoneNames_fr.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/jdk.localedata/share/classes/sun/util/resources/fr/TimeZoneNames_fr.java	Mon Feb 23 05:01: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
@@ -409,7 +409,7 @@
             {"America/Buenos_Aires", AGT},
             {"America/Cambridge_Bay", MST},
             {"America/Campo_Grande", AMT},
-            {"America/Cancun", CST},
+            {"America/Cancun", EST},
             {"America/Caracas", new String[] {"Heure du Venezuela", "VET",
                                               "Heure d'\u00e9t\u00e9 du Venezuela", "VEST",
                                               "Heure du Venezuela", "VET"}},
--- a/jdk/src/jdk.localedata/share/classes/sun/util/resources/it/TimeZoneNames_it.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/jdk.localedata/share/classes/sun/util/resources/it/TimeZoneNames_it.java	Mon Feb 23 05:01: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
@@ -409,7 +409,7 @@
             {"America/Buenos_Aires", AGT},
             {"America/Cambridge_Bay", MST},
             {"America/Campo_Grande", AMT},
-            {"America/Cancun", CST},
+            {"America/Cancun", EST},
             {"America/Caracas", new String[] {"Ora del Venezuela", "VET",
                                               "Ora estiva del Venezuela", "VEST",
                                               "Ora del Venezuela", "VET"}},
--- a/jdk/src/jdk.localedata/share/classes/sun/util/resources/ja/TimeZoneNames_ja.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/jdk.localedata/share/classes/sun/util/resources/ja/TimeZoneNames_ja.java	Mon Feb 23 05:01: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
@@ -409,7 +409,7 @@
             {"America/Buenos_Aires", AGT},
             {"America/Cambridge_Bay", MST},
             {"America/Campo_Grande", AMT},
-            {"America/Cancun", CST},
+            {"America/Cancun", EST},
             {"America/Caracas", new String[] {"\u30d9\u30cd\u30ba\u30a8\u30e9\u6642\u9593", "VET",
                                               "\u30d9\u30cd\u30ba\u30a8\u30e9\u590f\u6642\u9593", "VEST",
                                               "\u30D9\u30CD\u30BA\u30A8\u30E9\u6642\u9593", "VET"}},
--- a/jdk/src/jdk.localedata/share/classes/sun/util/resources/ko/TimeZoneNames_ko.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/jdk.localedata/share/classes/sun/util/resources/ko/TimeZoneNames_ko.java	Mon Feb 23 05:01: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
@@ -409,7 +409,7 @@
             {"America/Buenos_Aires", AGT},
             {"America/Cambridge_Bay", MST},
             {"America/Campo_Grande", AMT},
-            {"America/Cancun", CST},
+            {"America/Cancun", EST},
             {"America/Caracas", new String[] {"\ubca0\ub124\uc218\uc5d8\ub77c \uc2dc\uac04", "VET",
                                               "\ubca0\ub124\uc218\uc5d8\ub77c \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "VEST",
                                               "\uBCA0\uB124\uC218\uC5D8\uB77C \uD45C\uC900\uC2DC", "VET"}},
--- a/jdk/src/jdk.localedata/share/classes/sun/util/resources/pt/TimeZoneNames_pt_BR.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/jdk.localedata/share/classes/sun/util/resources/pt/TimeZoneNames_pt_BR.java	Mon Feb 23 05:01: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
@@ -409,7 +409,7 @@
             {"America/Buenos_Aires", AGT},
             {"America/Cambridge_Bay", MST},
             {"America/Campo_Grande", AMT},
-            {"America/Cancun", CST},
+            {"America/Cancun", EST},
             {"America/Caracas", new String[] {"Fuso hor\u00e1rio da Venezuela", "VET",
                                               "Fuso hor\u00e1rio de ver\u00e3o da Venezuela", "VEST",
                                               "Hor\u00E1rio da Venezuela", "VET"}},
--- a/jdk/src/jdk.localedata/share/classes/sun/util/resources/sv/TimeZoneNames_sv.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/jdk.localedata/share/classes/sun/util/resources/sv/TimeZoneNames_sv.java	Mon Feb 23 05:01: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
@@ -409,7 +409,7 @@
             {"America/Buenos_Aires", AGT},
             {"America/Cambridge_Bay", MST},
             {"America/Campo_Grande", AMT},
-            {"America/Cancun", CST},
+            {"America/Cancun", EST},
             {"America/Caracas", new String[] {"Venezuela, normaltid", "VET",
                                               "Venezuela, sommartid", "VEST",
                                               "Venezuelansk tid", "VET"}},
--- a/jdk/src/jdk.localedata/share/classes/sun/util/resources/zh/TimeZoneNames_zh_CN.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/jdk.localedata/share/classes/sun/util/resources/zh/TimeZoneNames_zh_CN.java	Mon Feb 23 05:01: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
@@ -409,7 +409,7 @@
             {"America/Buenos_Aires", AGT},
             {"America/Cambridge_Bay", MST},
             {"America/Campo_Grande", AMT},
-            {"America/Cancun", CST},
+            {"America/Cancun", EST},
             {"America/Caracas", new String[] {"\u59d4\u5185\u745e\u62c9\u65f6\u95f4", "VET",
                                               "\u59d4\u5185\u745e\u62c9\u590f\u4ee4\u65f6", "VEST",
                                               "\u59D4\u5185\u745E\u62C9\u65F6\u95F4", "VET"}},
--- a/jdk/src/jdk.localedata/share/classes/sun/util/resources/zh/TimeZoneNames_zh_TW.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/jdk.localedata/share/classes/sun/util/resources/zh/TimeZoneNames_zh_TW.java	Mon Feb 23 05:01: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
@@ -409,7 +409,7 @@
             {"America/Buenos_Aires", AGT},
             {"America/Cambridge_Bay", MST},
             {"America/Campo_Grande", AMT},
-            {"America/Cancun", CST},
+            {"America/Cancun", EST},
             {"America/Caracas", new String[] {"\u59d4\u5167\u745e\u62c9\u6642\u9593", "VET",
                                               "\u59d4\u5167\u745e\u62c9\u590f\u4ee4\u6642\u9593", "VEST",
                                               "\u59D4\u5167\u745E\u62C9\u6642\u9593", "VET"}},
--- a/jdk/src/jdk.rmic/share/classes/sun/rmi/rmic/BatchEnvironment.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/jdk.rmic/share/classes/sun/rmi/rmic/BatchEnvironment.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2012, 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
@@ -61,6 +61,7 @@
  * they are subject to change or removal without notice.
  */
 
+@SuppressWarnings("deprecation")
 public class BatchEnvironment extends sun.tools.javac.BatchEnvironment {
 
     /** instance of Main which created this environment */
--- a/jdk/src/jdk.rmic/share/classes/sun/rmi/rmic/Main.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/jdk.rmic/share/classes/sun/rmi/rmic/Main.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, 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
@@ -676,7 +676,7 @@
      * Compile a single class.
      * Fallthrough is intentional
      */
-    @SuppressWarnings("fallthrough")
+    @SuppressWarnings({"fallthrough", "deprecation"})
     public boolean compileClass (ClassDeclaration c,
                                  ByteArrayOutputStream buf,
                                  BatchEnvironment env)
--- a/jdk/src/jdk.rmic/share/classes/sun/tools/java/BinaryClass.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/jdk.rmic/share/classes/sun/tools/java/BinaryClass.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 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
@@ -39,6 +39,7 @@
  * supported API.  Code that depends on them does so at its own risk:
  * they are subject to change or removal without notice.
  */
+@SuppressWarnings("deprecation")
 public final
 class BinaryClass extends ClassDefinition implements Constants {
     BinaryConstantPool cpool;
--- a/jdk/src/jdk.rmic/share/classes/sun/tools/java/ClassDefinition.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/jdk.rmic/share/classes/sun/tools/java/ClassDefinition.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 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
@@ -41,6 +41,7 @@
  * supported API.  Code that depends on them does so at its own risk:
  * they are subject to change or removal without notice.
  */
+@SuppressWarnings("deprecation")
 public
 class ClassDefinition implements Constants {
 
--- a/jdk/src/jdk.rmic/share/classes/sun/tools/java/MemberDefinition.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/jdk.rmic/share/classes/sun/tools/java/MemberDefinition.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 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
@@ -44,6 +44,7 @@
  * supported API.  Code that depends on them does so at its own risk:
  * they are subject to change or removal without notice.
  */
+@SuppressWarnings("deprecation")
 public
 class MemberDefinition implements Constants {
     protected long where;
--- a/jdk/src/jdk.rmic/share/classes/sun/tools/java/Scanner.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/jdk.rmic/share/classes/sun/tools/java/Scanner.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 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
@@ -58,6 +58,7 @@
  * @author      Arthur van Hoff
  */
 
+@SuppressWarnings("deprecation")
 public
 class Scanner implements Constants {
     /**
--- a/jdk/src/jdk.runtime/share/classes/com/sun/tracing/Probe.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 2008, 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 com.sun.tracing;
-
-/**
- * The {@code Probe} interface represents a tracepoint.
- *
- * A {@code Probe} instance is obtained by calling the
- * {@code Provider.getProbe()} method of a provider instance created by
- * {@code ProviderFactory.createProvider()}.  A {@code Probe} can be used to
- * trigger a probe manually (provided the correct arguments are passed to
- * it), or to check a probe to see if anything is currently tracing it.
- * <p>
- * A tracing check can be used to avoid lengthy work that might be
- * needed to set up the probe's arguments.  However, checking
- * whether the probe is enabled generally takes the same amount of time
- * as actually triggering the probe. So, you should only check a probe's status
- * without triggering it if setting up the arguments is very expensive.
- * <p>
- * Users do not need to implement this interface: instances are
- * created automatically by the system when a {@code Provider)} instance is
- * created.
- * <p>
- * @since 1.7
- */
-
-public interface Probe {
-    /**
-     * Checks whether there is an active trace of this probe.
-     *
-     * @return true if an active trace is detected.
-     */
-    boolean isEnabled();
-
-    /**
-     * Determines whether a tracepoint is enabled.
-     *
-     * Typically, users do not need to use this method. It is called
-     * automatically when a Provider's instance method is called. Calls to
-     * this method expect the arguments to match the declared parameters for
-     * the method associated with the probe.
-     *
-     * @param args the parameters to pass to the method.
-     * @throws IllegalArgumentException if the provided parameters do not
-     * match the method declaration for this probe.
-     */
-    void trigger(Object ... args);
-}
--- a/jdk/src/jdk.runtime/share/classes/com/sun/tracing/ProbeName.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2008, 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 com.sun.tracing;
-
-import java.lang.annotation.Target;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.ElementType;
-
-/**
- * An annotation used to override the name of a probe.
- * <p>
- * This annotation can be added to a method in a user-defined {@code Provider}
- * interface, to set the name that will be used for the generated probe
- * associated with that method.  Without this annotation, the name will be the
- * name of the method.
- * <p>
- * @since 1.7
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.METHOD)
-public @interface ProbeName {
-    String value();
-}
-
--- a/jdk/src/jdk.runtime/share/classes/com/sun/tracing/Provider.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2008, 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 com.sun.tracing;
-
-/**
- * {@code Provider} is a superinterface for user-defined tracing providers.
- * <p>
- * To define tracepoints, users must extend this interface
- * and then use a {@code ProviderFactory} to create an instance of the
- * newly-defined interface.  Each method in the defined interface represents a
- * tracepoint (or probe), which can be triggered by calling the associated
- * method on the returned instance.
- * <p>
- * This interface also contains a {@code getProbe()} method, which can be
- * used to get direct handles to the {@code Probe} objects themselves.
- * {@code Probe} objects can be triggered manually, or they can be queried to
- * check their state.
- * <p>
- * When an application has finished triggering probes, it should call
- * {@code dispose()} to free up any system resources associated with the
- * Provider.
- * <p>
- * All methods declared in a subclass of this interface should have a
- * {@code void} return type. Methods can have parameters, and when called the
- * values of the arguments will be passed to the tracing implementation.
- * If any methods do not have a {@code void} return type, an
- * {@code java.lang.IllegalArgumentException} will be thrown when the
- * provider is registered.
- * @since 1.7
- */
-
-public interface Provider {
-    /**
-     * Retrieves a reference to a Probe object, which is used to check status
-     * or to trigger the probe manually.
-     *
-     * If the provided method parameter is not a method of the provider
-     * interface,  or if the provider interface has been disposed, then
-     * this returns null
-     *
-     * @param method a method declared in the provider.
-     * @return the specified probe represented by that method, or null.
-     */
-    Probe getProbe(java.lang.reflect.Method method);
-
-    /**
-     * Disposes system resources associated with this provider.
-     *
-     * After calling this method, triggering the probes will have no effect.
-     * Additional calls to this method after the first call are ignored.
-     */
-    void dispose();
-}
--- a/jdk/src/jdk.runtime/share/classes/com/sun/tracing/ProviderFactory.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,114 +0,0 @@
-
-package com.sun.tracing;
-
-import java.util.HashSet;
-import java.io.PrintStream;
-import java.lang.reflect.Field;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-
-import sun.tracing.NullProviderFactory;
-import sun.tracing.PrintStreamProviderFactory;
-import sun.tracing.MultiplexProviderFactory;
-import sun.tracing.dtrace.DTraceProviderFactory;
-
-/**
- * {@code ProviderFactory} is a factory class used to create instances of
- * providers.
- *
- * To enable tracing in an application, this class must be used to create
- * instances of the provider interfaces defined by users.
- * The system-defined factory is obtained by using the
- * {@code getDefaultFactory()} static method.  The resulting instance can be
- * used to create any number of providers.
- *
- * @since 1.7
- */
-public abstract class ProviderFactory {
-
-    protected ProviderFactory() {}
-
-    /**
-     * Creates an implementation of a Provider interface.
-     *
-     * @param cls the provider interface to be defined.
-     * @return an implementation of {@code cls}, whose methods, when called,
-     * will trigger tracepoints in the application.
-     * @throws NullPointerException if cls is null
-     * @throws IllegalArgumentException if the class definition contains
-     * non-void methods
-     */
-    public abstract <T extends Provider> T createProvider(Class<T> cls);
-
-    /**
-     * Returns an implementation of a {@code ProviderFactory} which
-     * creates instances of Providers.
-     *
-     * The created Provider instances will be linked to all appropriate
-     * and enabled system-defined tracing mechanisms in the JDK.
-     *
-     * @return a {@code ProviderFactory} that is used to create Providers.
-     */
-    public static ProviderFactory getDefaultFactory() {
-        HashSet<ProviderFactory> factories = new HashSet<ProviderFactory>();
-
-        // Try to instantiate a DTraceProviderFactory
-        String prop = AccessController.doPrivileged(
-            (PrivilegedAction<String>) () -> System.getProperty("com.sun.tracing.dtrace"));
-
-        if ( (prop == null || !prop.equals("disable")) &&
-             DTraceProviderFactory.isSupported() ) {
-            factories.add(new DTraceProviderFactory());
-        }
-
-        // Try to instantiate an output stream factory
-        prop = AccessController.doPrivileged(
-            (PrivilegedAction<String>) () -> System.getProperty("sun.tracing.stream"));
-        if (prop != null) {
-            for (String spec : prop.split(",")) {
-                PrintStream ps = getPrintStreamFromSpec(spec);
-                if (ps != null) {
-                    factories.add(new PrintStreamProviderFactory(ps));
-                }
-            }
-        }
-
-        // See how many factories we instantiated, and return an appropriate
-        // factory that encapsulates that.
-        if (factories.size() == 0) {
-            return new NullProviderFactory();
-        } else if (factories.size() == 1) {
-            return factories.toArray(new ProviderFactory[1])[0];
-        } else {
-            return new MultiplexProviderFactory(factories);
-        }
-    }
-
-    private static PrintStream getPrintStreamFromSpec(final String spec) {
-        try {
-            // spec is in the form of <class>.<field>, where <class> is
-            // a fully specified class name, and <field> is a static member
-            // in that class.  The <field> must be a 'PrintStream' or subtype
-            // in order to be used.
-            final int fieldpos = spec.lastIndexOf('.');
-            final Class<?> cls = Class.forName(spec.substring(0, fieldpos));
-
-            Field f = AccessController.doPrivileged(new PrivilegedExceptionAction<Field>() {
-                public Field run() throws NoSuchFieldException {
-                    return cls.getField(spec.substring(fieldpos + 1));
-                }
-            });
-
-            return (PrintStream)f.get(null);
-        } catch (ClassNotFoundException e) {
-            throw new AssertionError(e);
-        } catch (IllegalAccessException e) {
-            throw new AssertionError(e);
-        } catch (PrivilegedActionException e) {
-            throw new AssertionError(e);
-        }
-    }
-}
-
--- a/jdk/src/jdk.runtime/share/classes/com/sun/tracing/ProviderName.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2008, 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 com.sun.tracing;
-
-import java.lang.annotation.Target;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.ElementType;
-
-/**
- * An annotation used to specify the name of a provider.
- * <p>
- * This annotation can be added to a user-defined {@code Provider}
- * interface, to set the name that will be used
- * for the provider in the generated probes.  Without this annotation,
- * the simple class name of the provider interface is used.
- * <p>
- * @since 1.7
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.TYPE)
-public @interface ProviderName {
-    String value();
-}
-
--- a/jdk/src/jdk.runtime/share/classes/com/sun/tracing/dtrace/ArgsAttributes.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2008, 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 com.sun.tracing.dtrace;
-
-import java.lang.annotation.Target;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.ElementType;
-
-
-/**
- * This annotation describes the interface attributes of the probe arguments in
- * a single provider.
- *
- * This annotation can be added to a user-defined {@code Provider} specification
- * interface to set the stability attributes of the probe arguments, for
- * all the probes specified in that provider.
- * <p>
- * If this annotation is not present, the interface attributes for the
- * arguments are Private/Private/Unknown.
- * <p>
- * @see <a href="http://docs.sun.com/app/docs/doc/817-6223/6mlkidlnp?a=view">Solaris Dynamic Tracing Guide, Chapter 39: Stability</a>
- * @since 1.7
- */
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target({ ElementType.TYPE })
-public @interface ArgsAttributes {
-  Attributes value();
-}
--- a/jdk/src/jdk.runtime/share/classes/com/sun/tracing/dtrace/Attributes.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 2008, 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 com.sun.tracing.dtrace;
-
-import java.lang.annotation.Target;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.ElementType;
-
-
-/**
- * This annotation describes the interface's field attributes
- * for the probes in a provider.
- *
- * This annotation provides the contents of field-specific annotations
- * that specify the stability attributes and dependency class of a
- * particular field, for the probes in a provider.
- * <p>
- * The default interface attributes for unspecified fields is
- * Private/Private/Unknown.
- * <p>
- * @see <a href="http://docs.sun.com/app/docs/doc/817-6223/6mlkidlnp?a=view">Solaris Dynamic Tracing Guide, Chapter 39: Stability</a>
- * @since 1.7
- */
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target({})
-public @interface Attributes {
-  /**
-   * The stability level of the name.
-   */
-  StabilityLevel name() default StabilityLevel.PRIVATE;
-
-  /**
-   * The stability level of the data.
-   */
-  StabilityLevel data() default StabilityLevel.PRIVATE;
-
-  /**
-   * The interface attribute's dependency class.
-   */
-  DependencyClass dependency()  default DependencyClass.UNKNOWN;
-}
--- a/jdk/src/jdk.runtime/share/classes/com/sun/tracing/dtrace/DependencyClass.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2008, 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 com.sun.tracing.dtrace;
-
-/**
- * Enumeration for the DTrace dependency classes.
- *
- * @see <a href="http://docs.sun.com/app/docs/doc/817-6223/6mlkidlnp?a=view">Solaris Dynamic Tracing Guide for details, Chapter 39: Stability</a>
- * @since 1.7
- */
-public enum DependencyClass {
-    /**
-     * The interface has an unknown set of architectural dependencies.
-     */
-    UNKNOWN  (0),
-    /**
-     * The interface is specific to the CPU model of the current system.
-     */
-    CPU      (1),
-    /**
-     * The interface is specific to the hardware platform of the current
-     * system.
-     */
-    PLATFORM (2),
-    /**
-     * The interface is specific to the hardware platform group of the
-     * current system.
-     */
-    GROUP    (3),
-    /**
-     * The interface is specific to the instruction set architecture (ISA)
-     * supported by the microprocessors on this system.
-     */
-    ISA      (4),
-    /**
-     * The interface is common to all Solaris systems regardless of the
-     * underlying hardware.
-     */
-    COMMON   (5);
-
-    public String toDisplayString() {
-        return toString().substring(0,1) +
-               toString().substring(1).toLowerCase();
-    }
-
-    public int getEncoding() { return encoding; }
-
-    private int encoding;
-
-    private DependencyClass(int encoding) {
-        this.encoding = encoding;
-    }
-}
-
--- a/jdk/src/jdk.runtime/share/classes/com/sun/tracing/dtrace/FunctionAttributes.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2008, 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 com.sun.tracing.dtrace;
-
-import java.lang.annotation.Target;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.ElementType;
-
-/**
- * This annotation describes the interface attributes of the
- * {@code function} field for a single provider.
- *
- * This annotation can be added to a user-defined {@code Provider} specification
- * interface to set the stability attributes of the {@code function} field for
- * all probes specified in that provider.
- * <p>
- * If this annotation is not present, the interface attributes for the
- * {@code function} field are Private/Private/Unknown.
- * <p>
- * @see <a href="http://docs.sun.com/app/docs/doc/817-6223/6mlkidlnp?a=view">Solaris Dynamic Tracing Guide, Chapter 39: Stability</a>
- * @since 1.7
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target({ ElementType.TYPE })
-public @interface FunctionAttributes {
-    Attributes value();
-}
--- a/jdk/src/jdk.runtime/share/classes/com/sun/tracing/dtrace/FunctionName.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2008, 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 com.sun.tracing.dtrace;
-
-import java.lang.annotation.Target;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.ElementType;
-
-/**
- * An annotation used to specify the {@code function} field for a DTrace probe.
- *
- * This annotation can be added to a method in a user-defined Provider
- * specification interface to set the {@code function} field that is used
- * for the generated DTrace probe associated with that method.
- * <p>
- * @since 1.7
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.METHOD)
-public @interface FunctionName {
-    String value();
-}
-
--- a/jdk/src/jdk.runtime/share/classes/com/sun/tracing/dtrace/ModuleAttributes.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2008, 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 com.sun.tracing.dtrace;
-
-import java.lang.annotation.Target;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.ElementType;
-
-/**
- * This annotation is used to describe the interface attributes of the
- * {@code module} field for a single provider.
- *
- * This annotation can be added to a user-defined Provider specification
- * interface to set the stability attributes of the {@code module} field for
- * all probes specified in that provider.
- * <p>
- * If this annotation is not present, the interface attributes for the
- * {@code module} field is Private/Private/Unknown.
- * <p>
- * @see <a href="http://docs.sun.com/app/docs/doc/817-6223/6mlkidlnp?a=view">Solaris Dynamic Tracing Guide, Chapter 39: Stability</a>
- * @since 1.7
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target({ ElementType.TYPE })
-public @interface ModuleAttributes {
-    Attributes value();
-}
--- a/jdk/src/jdk.runtime/share/classes/com/sun/tracing/dtrace/ModuleName.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2008, 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 com.sun.tracing.dtrace;
-
-import java.lang.annotation.Target;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.ElementType;
-
-/**
- * An annotation used to specify the {@code module} field for a DTrace probe.
- *
- * This annotation can be added to a method in a user-defined Provider
- * specification interface to set the {@code module} field that will be used
- * for the generated DTrace probe associated with that method.
- * <p>
- * @since 1.7
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.TYPE)
-public @interface ModuleName {
-    String value();
-}
-
--- a/jdk/src/jdk.runtime/share/classes/com/sun/tracing/dtrace/NameAttributes.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2008, 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 com.sun.tracing.dtrace;
-
-import java.lang.annotation.Target;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.ElementType;
-
-/**
- * This annotation describes the interface attributes of the
- * {@code name} field for a single provider.
- *
- * This annotation can be added to a user-defined Provider specification
- * interface to set the stability attributes of the {@code name} field for
- * all probes specified in that provider.
- * <p>
- * If this annotation is not present, the interface attributes for the
- * {@code name} field will be Private/Private/Unknown.
- * <p>
- * @see <a href="http://docs.sun.com/app/docs/doc/817-6223/6mlkidlnp?a=view">Solaris Dynamic Tracing Guide, Chapter 39: Stability</a>
- * @since 1.7
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target({ ElementType.TYPE })
-public @interface NameAttributes {
-    Attributes value();
-}
--- a/jdk/src/jdk.runtime/share/classes/com/sun/tracing/dtrace/ProviderAttributes.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2008, 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 com.sun.tracing.dtrace;
-
-import java.lang.annotation.Target;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.ElementType;
-
-/**
- * This annotation is used to describe the interface attributes of the
- * {@code provider} field for a single provider.
- *
- * This annotation can be added to a user-defined Provider specification
- * interface to set the stability attributes of the {@code provider} field for
- * all probes specified in that provider.
- * <p>
- * If this annotation is not present, the interface attributes for the
- * {@code provider} field will be Private/Private/Unknown.
- * <p>
- * @see <a href="http://docs.sun.com/app/docs/doc/817-6223/6mlkidlnp?a=view">Solaris Dynamic Tracing Guide, Chapter 39: Stability</a>
- * @since 1.7
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target({ ElementType.TYPE })
-public @interface ProviderAttributes {
-    Attributes value();
-}
--- a/jdk/src/jdk.runtime/share/classes/com/sun/tracing/dtrace/StabilityLevel.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-/*
- * Copyright (c) 2008, 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 com.sun.tracing.dtrace;
-
-/**
- * Enumeration for the DTrace stability levels.
- *
- * @see <a href="http://docs.sun.com/app/docs/doc/817-6223/6mlkidlnp?a=view">Solaris Dynamic Tracing Guide, Chapter 39: Stability</a>
- * @since 1.7
- */
-public enum StabilityLevel {
-    /**
-     * The interface is private to DTrace and represents an implementation
-     * detail of DTrace.
-     */
-    INTERNAL  (0),
-    /**
-     * The interface is private to Sun for use by other Sun products. It is
-     * not yet publicly documented for use by customers and ISVs.
-     */
-    PRIVATE  (1),
-    /**
-     * The interface is supported in the current release but is scheduled
-     * to be removed, most likely in a future minor release.
-     */
-    OBSOLETE (2),
-    /**
-     * The interface is controlled by an entity other than Sun.
-     */
-    EXTERNAL (3),
-    /**
-     * The interface gives developers early access to new or
-     * rapidly changing technology or to an implementation artifact that is
-     * essential for observing or debugging system behavior. A more
-     * stable solution is anticipated in the future.
-     */
-    UNSTABLE (4),
-    /**
-     * The interface might eventually become Standard or Stable but is
-     * still in transition.
-     */
-    EVOLVING (5),
-    /**
-     * The interface is a mature interface under Sun's control.
-     */
-    STABLE   (6),
-    /**
-     * The interface complies with an industry standard.
-     */
-    STANDARD (7);
-
-    String toDisplayString() {
-        return toString().substring(0,1) +
-               toString().substring(1).toLowerCase();
-    }
-
-    public int getEncoding() { return encoding; }
-
-    private int encoding;
-
-    private StabilityLevel(int encoding) {
-        this.encoding = encoding;
-    }
-}
-
--- a/jdk/src/jdk.runtime/share/classes/com/sun/tracing/dtrace/package-info.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 2008, 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.
- */
-
-/**
- * This package contains annotations and enumerations that are used to
- * add DTrace-specific information to a tracing provider.
- * <p>
- * The DTrace-specific annotations modify the attributes of a DTrace provider
- * implementation when it is used by the tracing subsystem.  The annotations are
- * added to a {@code com.sun.tracing} provider specification to control
- * specific attributes of the provider as it relates to DTrace.
- * <p>
- * Any other tracing subsystems supported by the system will ignore these
- * annotations.
- * <p>
- * DTrace probes have additional fields and stability attributes that are
- * not accounted for in the generic tracing package.  If unspecified, the
- * default values are used for the stability and dependency attributes of
- * probes, as well as for the module and field names of the generated probes.
- * The values can be specified by adding the appropriate annotations to the
- * provider specification.
- * <p>
- * The {@code FunctionName} annotation is used to annotate the tracepoint
- * methods defined in the provider specification.  The value of this annotation
- * is used as the {@code function} field in the generated DTrace probes. It
- * is typically set to the name of the enclosing function where the
- * tracepoint is triggered.
- * <p>
- * The {@code ModuleName} annotation is used to annotate the provider
- * specification itself and applies to all the probes in the provider.  It
- * sets the value of the {@code module} field in the generated DTrace probes.
- * <p>
- * The remaining annotations, are also applied to the provider itself, and
- * are used to set the stability and dependency attributes of all probes in
- * that provider.  Each probe field and the probe arguments can be
- * independently assigned interface attributes to control the stability
- * ratings of the probes.
- * <p>
- * Here is an example of how to declare a provider, specifying additional DTrace
- * data:
-<PRE>
-    &#064;ProviderName("my_app_provider")
-    &#064;ModuleName("app.jar")
-    &#064;ProviderAttributes(&#064;Attributes={
-        name=StabilityLevel.STABLE,data=StabilityLevel.STABLE,
-        dependency=DependencyClass.COMMON})
-    &#064;ProbeAttributes(&#064;Attributes={
-        name=StabilityLevel.STABLE,data=StabilityLevel.STABLE,
-        dependency=DependencyClass.COMMON})
-    &#064;ModuleAttributes(&#064;Attributes={name=StabilityLevel.UNSTABLE})
-    public class MyProvider {
-        &#064;FunctionName("main") void startProbe();
-    }
-</PRE>
- * <p>
- * @see <a href="http://docs.sun.com/app/docs/doc/817-6223/6mlkidlms?a=view">Solaris Dynamic Tracing Guide, Chapter 34: Statically Defined Tracing for User Applications</a>
- * @see <a href="http://docs.sun.com/app/docs/doc/817-6223/6mlkidlnp?a=view">Solaris Dynamic Tracing Guide, Chapter 39: Stability</a>
- */
-
-package com.sun.tracing.dtrace;
--- a/jdk/src/jdk.runtime/share/classes/com/sun/tracing/package-info.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,183 +0,0 @@
-/*
- * Copyright (c) 2008, 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.
- */
-
-/**
- * This package provides a mechanism for defining and
- * inserting tracepoints into Java-technology based applications, which
- * can then be monitored by the tracing tools available on the system.
- * <p>
- * To add tracepoints to a program, you must first decide where to place the
- * tracepoints, what the logical names are for these points, what information
- * will be available to the tracing mechanisms at each point, and decide upon
- * any logical grouping.
- * <p>
- * You add instrumentation to a program in three steps:
- * <ul>
- * <li>First, declare tracepoints by creating interfaces to define
- * them, and include these interfaces in the program definition.
- * The declared interfaces are standard Java technology-based
- * interfaces and are compiled with the program.</li>
- * <li>Second, add code in the application to create an instance of the
- * interface at some point during the initialization of the application,
- * using a factory class provided by the system. The reference to the
- * instance can be stored as a global static, or passed as context to all
- * the places where it is needed.</li>
- * <li>Finally, add the actual tracepoints to the desired locations in the
- * application by inserting a call to one of the methods defined in the
- * interface, via the factory-created reference.</li>
- * </ul>
- * <p>
- * The method calls representing the tracepoints have no logical
- * impact on the program.  The side effect of the call is that any
- * activated tracing mechanisms will be notified that the tracepoint has
- * been hit, and will take whatever actions are appropriate (for example,
- * logging  the tracepoint, or triggering a DTrace probe, etc.).  In most
- * cases, the impact on performance of adding tracepoints to the application
- * will be minimal.
- * <p>
- * Each logical grouping of tracepoints should be defined in a common
- * interface, called a <i>provider</i>.  An application can have one or many
- * providers.  Each provider is independent and can be created whenever
- * it is appropriate for that provider, for example, when a subsytem is
- * initialized.  Providers should be disposed of when they are no longer
- * needed, to free up any associated system resources.  Each tracepoint
- * in a provider is represented by a method in that interface.  These methods
- * are referred to as <i>probes</i>.  The method signature determines the probe
- * parameters.  A call to the method with the specified parameters triggers
- * the probe and makes its parameter values visible to any associated tracing
- * mechanism.
- * <p>
- * User-defined interfaces which represent providers must extend the
- * {@code Provider} interface.  To activate the system-defined
- * tracing mechanisms, you must obtain an instance of the
- * {@code ProviderFactory} class, and pass the class of the provider to
- * the {@code createProvider()} method.  The returned instance is then used to
- * trigger the probes later in the application.
- * <p>
- * In addition to triggering the probes, the provider instance can be used
- * to obtain direct references to the {@code Probe} objects, which can be used
- * directly for triggering, or can be queried to determine whether the probe is
- * currently being traced.  The {@code Provider} interface also defines a
- * {@code Provider.dispose()} method which is used to free up any resources
- * that might be associated with that provider.
- * <p>
- * When a probe is triggered, any activated tracing system will be given
- * the provider name, the probe name, and the values of the probe arguments.
- * The tracing system is free to consume this data is whatever way is
- * appropriate.
- * By default, the provider name is the same as the class name of the interface
- * that defines the provider. Similarly, the probe name is
- * the name of the method that defines the probe. These default values
- * can be over-ridden by annotations.  The provider definition can be
- * annotated with the {@code @ProviderName} annotation, whose value will
- * indicate the provider name that the tracing system will use.  Similarly,
- * the {@code @ProbeName} annotation annotates a declared method and
- * indicates the probe name that should be used in the place of the
- * method name.  These annotations can be used to define providers and
- * probes with the same name, in cases where the semantics of the Java language
- * may prevent this.
- * <p>
- * Here is a very small and simple usage example:
- * <p>
- *
-<PRE>
-   import com.sun.tracing.Provider;
-   import com.sun.tracing.ProviderFactory;
-
-   interface MyProvider extends Provider {
-       void startProbe();
-       void finishProbe(int value);
-   }
-
-   public class MyApplication {
-       public static void main(String argv[]) {
-           ProviderFactory factory = ProviderFactory.getDefaultFactory();
-           MyProvider trace = factory.createProvider(MyProvider.class);
-
-           trace.startProbe();
-           int result = foo();
-           trace.finishProbe(result);
-
-           trace.dispose();
-       }
-   }
-</PRE>
- * <p>
- * The Java Development Kit (JDK) currently only includes one system-defined
- * tracing framework: DTrace. DTrace is enabled automatically whenever an
- * application is run on a system and a JDK release that supports it. When
- * DTrace is enabled, probes are made available for listing and matching by
- * DTrace scripts as soon as the provider is created. At the tracepoint, an
- * associated DTrace script is informed of the creation of the provider, and
- * it takes whatever action it is designed to take. Tracepoints in the
- * program have the following DTrace probe names:<br>
- *   {@code <provider><pid>:<module>:<function>:<probe>}
- * Where:
- * <ul>
- * <li>{@code <provider>} the provider name as specified by the application</li>
- * <li>{@code <pid>} the operating system process ID</li>
- * <li>{@code <module>} undefined, unless specified by the application</li>
- * <li>{@code <function>} undefined, unless specified by the application</li>
- * <li>{@code <probe>} the probe name as specified by the application</li>
- * </ul>
- * <p>
- * The {@code com.sun.tracing.dtrace} package contains additional
- * annotations that can be used to control the names used for the
- * <code>module</code> and <code>function</code> fields, as well as annotations
- * that can be added to the provider to control probe stability and dependency
- * attributes.
- * <p>
- * Integer, float and string probe parameters are made available to DTrace
- * using
- * the built-in argument variables, {@code arg0 ... arg_n}.  Integer-types
- * are passed by value (boxed values are unboxed), floating-point types are
- * passed as encoded integer
- * arguments, and {@code java.lang.String} objects are converted
- * to UTF8 strings, so they can be read into the DTrace script using the
- * {@code copyinstr()} intrinsic.  Non-string and non-boxed primitive
- * reference arguments are only
- * placeholders and have no value.
- * <p>
- * Using the example above, with a theoretical process ID of 123, these are
- * the probes that can be traced from DTrace:
-<PRE>
-    MyProvider123:::startProbe
-    MyProvider123:::finishProbe
-</PRE>
- * When {@code finishProbe} executes, {@code arg0} will contain the
- * value of {@code result}.
- * <p>
- * The DTrace tracing mechanism is enabled for all providers, apart from in the
- * following circumstances:
- * <ul>
- * <li>DTrace is not supported on the underlying system.</li>
- * <li>The property {@code com.sun.tracing.dtrace} is set to "disable".</li>
- * <li>The RuntimePermission {@code com.sun.tracing.dtrace.createProvider}
- * is denied to the process.</li>
- * </ul>
- * <p>
- */
-
-package com.sun.tracing;
--- a/jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/PolicyTool.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4554 +0,0 @@
-/*
- * Copyright (c) 1997, 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.security.tools.policytool;
-
-import java.io.*;
-import java.util.LinkedList;
-import java.util.ListIterator;
-import java.util.Vector;
-import java.util.Enumeration;
-import java.net.URL;
-import java.net.MalformedURLException;
-import java.lang.reflect.*;
-import java.text.Collator;
-import java.text.MessageFormat;
-import sun.security.util.PropertyExpander;
-import sun.security.util.PropertyExpander.ExpandException;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.Dimension;
-import java.awt.FileDialog;
-import java.awt.GridBagConstraints;
-import java.awt.GridBagLayout;
-import java.awt.Insets;
-import java.awt.Point;
-import java.awt.Toolkit;
-import java.awt.Window;
-import java.awt.event.*;
-import java.security.cert.Certificate;
-import java.security.cert.CertificateException;
-import java.security.*;
-import sun.security.provider.*;
-import sun.security.util.PolicyUtil;
-import javax.security.auth.x500.X500Principal;
-import javax.swing.*;
-import javax.swing.border.EmptyBorder;
-
-/**
- * PolicyTool may be used by users and administrators to configure the
- * overall java security policy (currently stored in the policy file).
- * Using PolicyTool administrators may add and remove policies from
- * the policy file. <p>
- *
- * @see java.security.Policy
- * @since   1.2
- */
-
-public class PolicyTool {
-
-    // for i18n
-    static final java.util.ResourceBundle rb =
-        java.util.ResourceBundle.getBundle(
-            "sun.security.tools.policytool.Resources");
-    static final Collator collator = Collator.getInstance();
-    static {
-        // this is for case insensitive string comparisons
-        collator.setStrength(Collator.PRIMARY);
-
-        // Support for Apple menu bar
-        if (System.getProperty("apple.laf.useScreenMenuBar") == null) {
-            System.setProperty("apple.laf.useScreenMenuBar", "true");
-        }
-        System.setProperty("apple.awt.application.name", getMessage("Policy.Tool"));
-
-        // Apply the system L&F if not specified with a system property.
-        if (System.getProperty("swing.defaultlaf") == null) {
-            try {
-                UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
-            } catch (Exception e) {
-                // ignore
-            }
-        }
-    }
-
-    // anyone can add warnings
-    Vector<String> warnings;
-    boolean newWarning = false;
-
-    // set to true if policy modified.
-    // this way upon exit we know if to ask the user to save changes
-    boolean modified = false;
-
-    private static final boolean testing = false;
-    private static final Class<?>[] TWOPARAMS = { String.class, String.class };
-    private static final Class<?>[] ONEPARAMS = { String.class };
-    private static final Class<?>[] NOPARAMS  = {};
-    /*
-     * All of the policy entries are read in from the
-     * policy file and stored here.  Updates to the policy entries
-     * using addEntry() and removeEntry() are made here.  To ultimately save
-     * the policy entries back to the policy file, the SavePolicy button
-     * must be clicked.
-     **/
-    private static String policyFileName = null;
-    private Vector<PolicyEntry> policyEntries = null;
-    private PolicyParser parser = null;
-
-    /* The public key alias information is stored here.  */
-    private KeyStore keyStore = null;
-    private String keyStoreName = " ";
-    private String keyStoreType = " ";
-    private String keyStoreProvider = " ";
-    private String keyStorePwdURL = " ";
-
-    /* standard PKCS11 KeyStore type */
-    private static final String P11KEYSTORE = "PKCS11";
-
-    /* reserved word for PKCS11 KeyStores */
-    private static final String NONE = "NONE";
-
-    /**
-     * default constructor
-     */
-    private PolicyTool() {
-        policyEntries = new Vector<PolicyEntry>();
-        parser = new PolicyParser();
-        warnings = new Vector<String>();
-    }
-
-    /**
-     * get the PolicyFileName
-     */
-    String getPolicyFileName() {
-        return policyFileName;
-    }
-
-    /**
-     * set the PolicyFileName
-     */
-    void setPolicyFileName(String policyFileName) {
-        PolicyTool.policyFileName = policyFileName;
-    }
-
-   /**
-    * clear keyStore info
-    */
-    void clearKeyStoreInfo() {
-        this.keyStoreName = null;
-        this.keyStoreType = null;
-        this.keyStoreProvider = null;
-        this.keyStorePwdURL = null;
-
-        this.keyStore = null;
-    }
-
-    /**
-     * get the keyStore URL name
-     */
-    String getKeyStoreName() {
-        return keyStoreName;
-    }
-
-    /**
-     * get the keyStore Type
-     */
-    String getKeyStoreType() {
-        return keyStoreType;
-    }
-
-    /**
-     * get the keyStore Provider
-     */
-    String getKeyStoreProvider() {
-        return keyStoreProvider;
-    }
-
-    /**
-     * get the keyStore password URL
-     */
-    String getKeyStorePwdURL() {
-        return keyStorePwdURL;
-    }
-
-    /**
-     * Open and read a policy file
-     */
-    void openPolicy(String filename) throws FileNotFoundException,
-                                        PolicyParser.ParsingException,
-                                        KeyStoreException,
-                                        CertificateException,
-                                        InstantiationException,
-                                        MalformedURLException,
-                                        IOException,
-                                        NoSuchAlgorithmException,
-                                        IllegalAccessException,
-                                        NoSuchMethodException,
-                                        UnrecoverableKeyException,
-                                        NoSuchProviderException,
-                                        ClassNotFoundException,
-                                        PropertyExpander.ExpandException,
-                                        InvocationTargetException {
-
-        newWarning = false;
-
-        // start fresh - blow away the current state
-        policyEntries = new Vector<PolicyEntry>();
-        parser = new PolicyParser();
-        warnings = new Vector<String>();
-        setPolicyFileName(null);
-        clearKeyStoreInfo();
-
-        // see if user is opening a NEW policy file
-        if (filename == null) {
-            modified = false;
-            return;
-        }
-
-        // Read in the policy entries from the file and
-        // populate the parser vector table.  The parser vector
-        // table only holds the entries as strings, so it only
-        // guarantees that the policies are syntactically
-        // correct.
-        setPolicyFileName(filename);
-        parser.read(new FileReader(filename));
-
-        // open the keystore
-        openKeyStore(parser.getKeyStoreUrl(), parser.getKeyStoreType(),
-                parser.getKeyStoreProvider(), parser.getStorePassURL());
-
-        // Update the local vector with the same policy entries.
-        // This guarantees that the policy entries are not only
-        // syntactically correct, but semantically valid as well.
-        Enumeration<PolicyParser.GrantEntry> enum_ = parser.grantElements();
-        while (enum_.hasMoreElements()) {
-            PolicyParser.GrantEntry ge = enum_.nextElement();
-
-            // see if all the signers have public keys
-            if (ge.signedBy != null) {
-
-                String signers[] = parseSigners(ge.signedBy);
-                for (int i = 0; i < signers.length; i++) {
-                    PublicKey pubKey = getPublicKeyAlias(signers[i]);
-                    if (pubKey == null) {
-                        newWarning = true;
-                        MessageFormat form = new MessageFormat(getMessage
-                            ("Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured."));
-                        Object[] source = {signers[i]};
-                        warnings.addElement(form.format(source));
-                    }
-                }
-            }
-
-            // check to see if the Principals are valid
-            ListIterator<PolicyParser.PrincipalEntry> prinList =
-                                                ge.principals.listIterator(0);
-            while (prinList.hasNext()) {
-                PolicyParser.PrincipalEntry pe = prinList.next();
-                try {
-                    verifyPrincipal(pe.getPrincipalClass(),
-                                pe.getPrincipalName());
-                } catch (ClassNotFoundException fnfe) {
-                    newWarning = true;
-                    MessageFormat form = new MessageFormat(getMessage
-                                ("Warning.Class.not.found.class"));
-                    Object[] source = {pe.getPrincipalClass()};
-                    warnings.addElement(form.format(source));
-                }
-            }
-
-            // check to see if the Permissions are valid
-            Enumeration<PolicyParser.PermissionEntry> perms =
-                                                ge.permissionElements();
-            while (perms.hasMoreElements()) {
-                PolicyParser.PermissionEntry pe = perms.nextElement();
-                try {
-                    verifyPermission(pe.permission, pe.name, pe.action);
-                } catch (ClassNotFoundException fnfe) {
-                    newWarning = true;
-                    MessageFormat form = new MessageFormat(getMessage
-                                ("Warning.Class.not.found.class"));
-                    Object[] source = {pe.permission};
-                    warnings.addElement(form.format(source));
-                } catch (InvocationTargetException ite) {
-                    newWarning = true;
-                    MessageFormat form = new MessageFormat(getMessage
-                        ("Warning.Invalid.argument.s.for.constructor.arg"));
-                    Object[] source = {pe.permission};
-                    warnings.addElement(form.format(source));
-                }
-
-                // see if all the permission signers have public keys
-                if (pe.signedBy != null) {
-
-                    String signers[] = parseSigners(pe.signedBy);
-
-                    for (int i = 0; i < signers.length; i++) {
-                        PublicKey pubKey = getPublicKeyAlias(signers[i]);
-                        if (pubKey == null) {
-                            newWarning = true;
-                            MessageFormat form = new MessageFormat(getMessage
-                                ("Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured."));
-                            Object[] source = {signers[i]};
-                            warnings.addElement(form.format(source));
-                        }
-                    }
-                }
-            }
-            PolicyEntry pEntry = new PolicyEntry(this, ge);
-            policyEntries.addElement(pEntry);
-        }
-
-        // just read in the policy -- nothing has been modified yet
-        modified = false;
-    }
-
-
-    /**
-     * Save a policy to a file
-     */
-    void savePolicy(String filename)
-    throws FileNotFoundException, IOException {
-        // save the policy entries to a file
-        parser.setKeyStoreUrl(keyStoreName);
-        parser.setKeyStoreType(keyStoreType);
-        parser.setKeyStoreProvider(keyStoreProvider);
-        parser.setStorePassURL(keyStorePwdURL);
-        parser.write(new FileWriter(filename));
-        modified = false;
-    }
-
-    /**
-     * Open the KeyStore
-     */
-    void openKeyStore(String name,
-                String type,
-                String provider,
-                String pwdURL) throws   KeyStoreException,
-                                        NoSuchAlgorithmException,
-                                        UnrecoverableKeyException,
-                                        IOException,
-                                        CertificateException,
-                                        NoSuchProviderException,
-                                        ExpandException {
-
-        if (name == null && type == null &&
-            provider == null && pwdURL == null) {
-
-            // policy did not specify a keystore during open
-            // or use wants to reset keystore values
-
-            this.keyStoreName = null;
-            this.keyStoreType = null;
-            this.keyStoreProvider = null;
-            this.keyStorePwdURL = null;
-
-            // caller will set (tool.modified = true) if appropriate
-
-            return;
-        }
-
-        URL policyURL = null;
-        if (policyFileName != null) {
-            File pfile = new File(policyFileName);
-            policyURL = new URL("file:" + pfile.getCanonicalPath());
-        }
-
-        // although PolicyUtil.getKeyStore may properly handle
-        // defaults and property expansion, we do it here so that
-        // if the call is successful, we can set the proper values
-        // (PolicyUtil.getKeyStore does not return expanded values)
-
-        if (name != null && name.length() > 0) {
-            name = PropertyExpander.expand(name).replace
-                                        (File.separatorChar, '/');
-        }
-        if (type == null || type.length() == 0) {
-            type = KeyStore.getDefaultType();
-        }
-        if (pwdURL != null && pwdURL.length() > 0) {
-            pwdURL = PropertyExpander.expand(pwdURL).replace
-                                        (File.separatorChar, '/');
-        }
-
-        try {
-            this.keyStore = PolicyUtil.getKeyStore(policyURL,
-                                                name,
-                                                type,
-                                                provider,
-                                                pwdURL,
-                                                null);
-        } catch (IOException ioe) {
-
-            // copied from sun.security.pkcs11.SunPKCS11
-            String MSG = "no password provided, and no callback handler " +
-                        "available for retrieving password";
-
-            Throwable cause = ioe.getCause();
-            if (cause != null &&
-                cause instanceof javax.security.auth.login.LoginException &&
-                MSG.equals(cause.getMessage())) {
-
-                // throw a more friendly exception message
-                throw new IOException(MSG);
-            } else {
-                throw ioe;
-            }
-        }
-
-        this.keyStoreName = name;
-        this.keyStoreType = type;
-        this.keyStoreProvider = provider;
-        this.keyStorePwdURL = pwdURL;
-
-        // caller will set (tool.modified = true)
-    }
-
-    /**
-     * Add a Grant entry to the overall policy at the specified index.
-     * A policy entry consists of a CodeSource.
-     */
-    boolean addEntry(PolicyEntry pe, int index) {
-
-        if (index < 0) {
-            // new entry -- just add it to the end
-            policyEntries.addElement(pe);
-            parser.add(pe.getGrantEntry());
-        } else {
-            // existing entry -- replace old one
-            PolicyEntry origPe = policyEntries.elementAt(index);
-            parser.replace(origPe.getGrantEntry(), pe.getGrantEntry());
-            policyEntries.setElementAt(pe, index);
-        }
-        return true;
-    }
-
-    /**
-     * Add a Principal entry to an existing PolicyEntry at the specified index.
-     * A Principal entry consists of a class, and name.
-     *
-     * If the principal already exists, it is not added again.
-     */
-    boolean addPrinEntry(PolicyEntry pe,
-                        PolicyParser.PrincipalEntry newPrin,
-                        int index) {
-
-        // first add the principal to the Policy Parser entry
-        PolicyParser.GrantEntry grantEntry = pe.getGrantEntry();
-        if (grantEntry.contains(newPrin) == true)
-            return false;
-
-        LinkedList<PolicyParser.PrincipalEntry> prinList =
-                                                grantEntry.principals;
-        if (index != -1)
-            prinList.set(index, newPrin);
-        else
-            prinList.add(newPrin);
-
-        modified = true;
-        return true;
-    }
-
-    /**
-     * Add a Permission entry to an existing PolicyEntry at the specified index.
-     * A Permission entry consists of a permission, name, and actions.
-     *
-     * If the permission already exists, it is not added again.
-     */
-    boolean addPermEntry(PolicyEntry pe,
-                        PolicyParser.PermissionEntry newPerm,
-                        int index) {
-
-        // first add the permission to the Policy Parser Vector
-        PolicyParser.GrantEntry grantEntry = pe.getGrantEntry();
-        if (grantEntry.contains(newPerm) == true)
-            return false;
-
-        Vector<PolicyParser.PermissionEntry> permList =
-                                                grantEntry.permissionEntries;
-        if (index != -1)
-            permList.setElementAt(newPerm, index);
-        else
-            permList.addElement(newPerm);
-
-        modified = true;
-        return true;
-    }
-
-    /**
-     * Remove a Permission entry from an existing PolicyEntry.
-     */
-    boolean removePermEntry(PolicyEntry pe,
-                        PolicyParser.PermissionEntry perm) {
-
-        // remove the Permission from the GrantEntry
-        PolicyParser.GrantEntry ppge = pe.getGrantEntry();
-        modified = ppge.remove(perm);
-        return modified;
-    }
-
-    /**
-     * remove an entry from the overall policy
-     */
-    boolean removeEntry(PolicyEntry pe) {
-
-        parser.remove(pe.getGrantEntry());
-        modified = true;
-        return (policyEntries.removeElement(pe));
-    }
-
-    /**
-     * retrieve all Policy Entries
-     */
-    PolicyEntry[] getEntry() {
-
-        if (policyEntries.size() > 0) {
-            PolicyEntry entries[] = new PolicyEntry[policyEntries.size()];
-            for (int i = 0; i < policyEntries.size(); i++)
-                entries[i] = policyEntries.elementAt(i);
-            return entries;
-        }
-        return null;
-    }
-
-    /**
-     * Retrieve the public key mapped to a particular name.
-     * If the key has expired, a KeyException is thrown.
-     */
-    PublicKey getPublicKeyAlias(String name) throws KeyStoreException {
-        if (keyStore == null) {
-            return null;
-        }
-
-        Certificate cert = keyStore.getCertificate(name);
-        if (cert == null) {
-            return null;
-        }
-        PublicKey pubKey = cert.getPublicKey();
-        return pubKey;
-    }
-
-    /**
-     * Retrieve all the alias names stored in the certificate database
-     */
-    String[] getPublicKeyAlias() throws KeyStoreException {
-
-        int numAliases = 0;
-        String aliases[] = null;
-
-        if (keyStore == null) {
-            return null;
-        }
-        Enumeration<String> enum_ = keyStore.aliases();
-
-        // first count the number of elements
-        while (enum_.hasMoreElements()) {
-            enum_.nextElement();
-            numAliases++;
-        }
-
-        if (numAliases > 0) {
-            // now copy them into an array
-            aliases = new String[numAliases];
-            numAliases = 0;
-            enum_ = keyStore.aliases();
-            while (enum_.hasMoreElements()) {
-                aliases[numAliases] = new String(enum_.nextElement());
-                numAliases++;
-            }
-        }
-        return aliases;
-    }
-
-    /**
-     * This method parses a single string of signers separated by commas
-     * ("jordan, duke, pippen") into an array of individual strings.
-     */
-    String[] parseSigners(String signedBy) {
-
-        String signers[] = null;
-        int numSigners = 1;
-        int signedByIndex = 0;
-        int commaIndex = 0;
-        int signerNum = 0;
-
-        // first pass thru "signedBy" counts the number of signers
-        while (commaIndex >= 0) {
-            commaIndex = signedBy.indexOf(',', signedByIndex);
-            if (commaIndex >= 0) {
-                numSigners++;
-                signedByIndex = commaIndex + 1;
-            }
-        }
-        signers = new String[numSigners];
-
-        // second pass thru "signedBy" transfers signers to array
-        commaIndex = 0;
-        signedByIndex = 0;
-        while (commaIndex >= 0) {
-            if ((commaIndex = signedBy.indexOf(',', signedByIndex)) >= 0) {
-                // transfer signer and ignore trailing part of the string
-                signers[signerNum] =
-                        signedBy.substring(signedByIndex, commaIndex).trim();
-                signerNum++;
-                signedByIndex = commaIndex + 1;
-            } else {
-                // we are at the end of the string -- transfer signer
-                signers[signerNum] = signedBy.substring(signedByIndex).trim();
-            }
-        }
-        return signers;
-    }
-
-    /**
-     * Check to see if the Principal contents are OK
-     */
-    void verifyPrincipal(String type, String name)
-        throws ClassNotFoundException,
-               InstantiationException
-    {
-        if (type.equals(PolicyParser.PrincipalEntry.WILDCARD_CLASS) ||
-            type.equals(PolicyParser.PrincipalEntry.REPLACE_NAME)) {
-            return;
-        }
-        Class<?> PRIN = Class.forName("java.security.Principal");
-        Class<?> pc = Class.forName(type, true,
-                Thread.currentThread().getContextClassLoader());
-        if (!PRIN.isAssignableFrom(pc)) {
-            MessageFormat form = new MessageFormat(getMessage
-                        ("Illegal.Principal.Type.type"));
-            Object[] source = {type};
-            throw new InstantiationException(form.format(source));
-        }
-
-        if (ToolDialog.X500_PRIN_CLASS.equals(pc.getName())) {
-            // PolicyParser checks validity of X500Principal name
-            // - PolicyTool needs to as well so that it doesn't store
-            //   an invalid name that can't be read in later
-            //
-            // this can throw an IllegalArgumentException
-            X500Principal newP = new X500Principal(name);
-        }
-    }
-
-    /**
-     * Check to see if the Permission contents are OK
-     */
-    @SuppressWarnings("fallthrough")
-    void verifyPermission(String type,
-                                    String name,
-                                    String actions)
-        throws ClassNotFoundException,
-               InstantiationException,
-               IllegalAccessException,
-               NoSuchMethodException,
-               InvocationTargetException
-    {
-
-        //XXX we might want to keep a hash of created factories...
-        Class<?> pc = Class.forName(type, true,
-                Thread.currentThread().getContextClassLoader());
-        Constructor<?> c = null;
-        Vector<String> objects = new Vector<>(2);
-        if (name != null) objects.add(name);
-        if (actions != null) objects.add(actions);
-        switch (objects.size()) {
-        case 0:
-            try {
-                c = pc.getConstructor(NOPARAMS);
-                break;
-            } catch (NoSuchMethodException ex) {
-                // proceed to the one-param constructor
-                objects.add(null);
-            }
-            /* fall through */
-        case 1:
-            try {
-                c = pc.getConstructor(ONEPARAMS);
-                break;
-            } catch (NoSuchMethodException ex) {
-                // proceed to the two-param constructor
-                objects.add(null);
-            }
-            /* fall through */
-        case 2:
-            c = pc.getConstructor(TWOPARAMS);
-            break;
-        }
-        Object parameters[] = objects.toArray();
-        Permission p = (Permission)c.newInstance(parameters);
-    }
-
-    /*
-     * Parse command line arguments.
-     */
-    static void parseArgs(String args[]) {
-        /* parse flags */
-        int n = 0;
-
-        for (n=0; (n < args.length) && args[n].startsWith("-"); n++) {
-
-            String flags = args[n];
-
-            if (collator.compare(flags, "-file") == 0) {
-                if (++n == args.length) usage();
-                policyFileName = args[n];
-            } else {
-                MessageFormat form = new MessageFormat(getMessage
-                                ("Illegal.option.option"));
-                Object[] source = { flags };
-                System.err.println(form.format(source));
-                usage();
-            }
-        }
-    }
-
-    static void usage() {
-        System.out.println(getMessage("Usage.policytool.options."));
-        System.out.println();
-        System.out.println(getMessage
-                (".file.file.policy.file.location"));
-        System.out.println();
-
-        System.exit(1);
-    }
-
-    /**
-     * run the PolicyTool
-     */
-    public static void main(String args[]) {
-        parseArgs(args);
-        SwingUtilities.invokeLater(new Runnable() {
-            public void run() {
-                ToolWindow tw = new ToolWindow(new PolicyTool());
-                tw.displayToolWindow(args);
-            }
-        });
-    }
-
-    // split instr to words according to capitalization,
-    // like, AWTControl -> A W T Control
-    // this method is for easy pronounciation
-    static String splitToWords(String instr) {
-        return instr.replaceAll("([A-Z])", " $1");
-    }
-
-    /**
-     * Returns the message corresponding to the key in the bundle.
-     * This is preferred over {@link #getString} because it removes
-     * any mnemonic '&' character in the string.
-     *
-     * @param key the key
-     *
-     * @return the message
-     */
-    static String getMessage(String key) {
-        return removeMnemonicAmpersand(rb.getString(key));
-    }
-
-
-    /**
-     * Returns the mnemonic for a message.
-     *
-     * @param key the key
-     *
-     * @return the mnemonic <code>int</code>
-     */
-    static int getMnemonicInt(String key) {
-        String message = rb.getString(key);
-        return (findMnemonicInt(message));
-    }
-
-    /**
-     * Returns the mnemonic display index for a message.
-     *
-     * @param key the key
-     *
-     * @return the mnemonic display index
-     */
-    static int getDisplayedMnemonicIndex(String key) {
-        String message = rb.getString(key);
-        return (findMnemonicIndex(message));
-    }
-
-    /**
-     * Finds the mnemonic character in a message.
-     *
-     * The mnemonic character is the first character followed by the first
-     * <code>&</code> that is not followed by another <code>&</code>.
-     *
-     * @return the mnemonic as an <code>int</code>, or <code>0</code> if it
-     *         can't be found.
-     */
-    private static int findMnemonicInt(String s) {
-        for (int i = 0; i < s.length() - 1; i++) {
-            if (s.charAt(i) == '&') {
-                if (s.charAt(i + 1) != '&') {
-                    return KeyEvent.getExtendedKeyCodeForChar(s.charAt(i + 1));
-                } else {
-                    i++;
-                }
-            }
-        }
-        return 0;
-    }
-
-    /**
-     * Finds the index of the mnemonic character in a message.
-     *
-     * The mnemonic character is the first character followed by the first
-     * <code>&</code> that is not followed by another <code>&</code>.
-     *
-     * @return the mnemonic character index as an <code>int</code>, or <code>-1</code> if it
-     *         can't be found.
-     */
-    private static int findMnemonicIndex(String s) {
-        for (int i = 0; i < s.length() - 1; i++) {
-            if (s.charAt(i) == '&') {
-                if (s.charAt(i + 1) != '&') {
-                    // Return the index of the '&' since it will be removed
-                    return i;
-                } else {
-                    i++;
-                }
-            }
-        }
-        return -1;
-    }
-
-    /**
-     * Removes the mnemonic identifier (<code>&</code>) from a string unless
-     * it's escaped by <code>&&</code> or placed at the end.
-     *
-     * @param message the message
-     *
-     * @return a message with the mnemonic identifier removed
-     */
-    private static String removeMnemonicAmpersand(String message) {
-        StringBuilder s = new StringBuilder();
-        for (int i = 0; i < message.length(); i++) {
-            char current = message.charAt(i);
-            if (current != '&' || i == message.length() - 1
-                    || message.charAt(i + 1) == '&') {
-                s.append(current);
-            }
-        }
-        return s.toString();
-    }
-}
-
-/**
- * Each entry in the policy configuration file is represented by a
- * PolicyEntry object.
- *
- * A PolicyEntry is a (CodeSource,Permission) pair.  The
- * CodeSource contains the (URL, PublicKey) that together identify
- * where the Java bytecodes come from and who (if anyone) signed
- * them.  The URL could refer to localhost.  The URL could also be
- * null, meaning that this policy entry is given to all comers, as
- * long as they match the signer field.  The signer could be null,
- * meaning the code is not signed.
- *
- * The Permission contains the (Type, Name, Action) triplet.
- *
- */
-class PolicyEntry {
-
-    private CodeSource codesource;
-    private PolicyTool tool;
-    private PolicyParser.GrantEntry grantEntry;
-    private boolean testing = false;
-
-    /**
-     * Create a PolicyEntry object from the information read in
-     * from a policy file.
-     */
-    PolicyEntry(PolicyTool tool, PolicyParser.GrantEntry ge)
-    throws MalformedURLException, NoSuchMethodException,
-    ClassNotFoundException, InstantiationException, IllegalAccessException,
-    InvocationTargetException, CertificateException,
-    IOException, NoSuchAlgorithmException, UnrecoverableKeyException {
-
-        this.tool = tool;
-
-        URL location = null;
-
-        // construct the CodeSource
-        if (ge.codeBase != null)
-            location = new URL(ge.codeBase);
-        this.codesource = new CodeSource(location,
-            (java.security.cert.Certificate[]) null);
-
-        if (testing) {
-            System.out.println("Adding Policy Entry:");
-            System.out.println("    CodeBase = " + location);
-            System.out.println("    Signers = " + ge.signedBy);
-            System.out.println("    with " + ge.principals.size() +
-                    " Principals");
-        }
-
-        this.grantEntry = ge;
-    }
-
-    /**
-     * get the codesource associated with this PolicyEntry
-     */
-    CodeSource getCodeSource() {
-        return codesource;
-    }
-
-    /**
-     * get the GrantEntry associated with this PolicyEntry
-     */
-    PolicyParser.GrantEntry getGrantEntry() {
-        return grantEntry;
-    }
-
-    /**
-     * convert the header portion, i.e. codebase, signer, principals, of
-     * this policy entry into a string
-     */
-    String headerToString() {
-        String pString = principalsToString();
-        if (pString.length() == 0) {
-            return codebaseToString();
-        } else {
-            return codebaseToString() + ", " + pString;
-        }
-    }
-
-    /**
-     * convert the Codebase/signer portion of this policy entry into a string
-     */
-    String codebaseToString() {
-
-        String stringEntry = new String();
-
-        if (grantEntry.codeBase != null &&
-            grantEntry.codeBase.equals("") == false)
-            stringEntry = stringEntry.concat
-                                ("CodeBase \"" +
-                                grantEntry.codeBase +
-                                "\"");
-
-        if (grantEntry.signedBy != null &&
-            grantEntry.signedBy.equals("") == false)
-            stringEntry = ((stringEntry.length() > 0) ?
-                stringEntry.concat(", SignedBy \"" +
-                                grantEntry.signedBy +
-                                "\"") :
-                stringEntry.concat("SignedBy \"" +
-                                grantEntry.signedBy +
-                                "\""));
-
-        if (stringEntry.length() == 0)
-            return new String("CodeBase <ALL>");
-        return stringEntry;
-    }
-
-    /**
-     * convert the Principals portion of this policy entry into a string
-     */
-    String principalsToString() {
-        String result = "";
-        if ((grantEntry.principals != null) &&
-            (!grantEntry.principals.isEmpty())) {
-            StringBuilder sb = new StringBuilder(200);
-            ListIterator<PolicyParser.PrincipalEntry> list =
-                                grantEntry.principals.listIterator();
-            while (list.hasNext()) {
-                PolicyParser.PrincipalEntry pppe = list.next();
-                sb.append(" Principal ").append(pppe.getDisplayClass())
-                        .append(' ')
-                        .append(pppe.getDisplayName(true));
-                if (list.hasNext()) sb.append(", ");
-            }
-            result = sb.toString();
-        }
-        return result;
-    }
-
-    /**
-     * convert this policy entry into a PolicyParser.PermissionEntry
-     */
-    PolicyParser.PermissionEntry toPermissionEntry(Permission perm) {
-
-        String actions = null;
-
-        // get the actions
-        if (perm.getActions() != null &&
-            perm.getActions().trim() != "")
-                actions = perm.getActions();
-
-        PolicyParser.PermissionEntry pe = new PolicyParser.PermissionEntry
-                        (perm.getClass().getName(),
-                        perm.getName(),
-                        actions);
-        return pe;
-    }
-}
-
-/**
- * The main window for the PolicyTool
- */
-class ToolWindow extends JFrame {
-    // use serialVersionUID from JDK 1.2.2 for interoperability
-    private static final long serialVersionUID = 5682568601210376777L;
-
-    /* ESCAPE key */
-    static final KeyStroke escKey = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0);
-
-    /* external paddings */
-    public static final Insets TOP_PADDING = new Insets(25,0,0,0);
-    public static final Insets BOTTOM_PADDING = new Insets(0,0,25,0);
-    public static final Insets LITE_BOTTOM_PADDING = new Insets(0,0,10,0);
-    public static final Insets LR_PADDING = new Insets(0,10,0,10);
-    public static final Insets TOP_BOTTOM_PADDING = new Insets(15, 0, 15, 0);
-    public static final Insets L_TOP_BOTTOM_PADDING = new Insets(5,10,15,0);
-    public static final Insets LR_TOP_BOTTOM_PADDING = new Insets(15, 4, 15, 4);
-    public static final Insets LR_BOTTOM_PADDING = new Insets(0,10,5,10);
-    public static final Insets L_BOTTOM_PADDING = new Insets(0,10,5,0);
-    public static final Insets R_BOTTOM_PADDING = new Insets(0, 0, 25, 5);
-    public static final Insets R_PADDING = new Insets(0, 0, 0, 5);
-
-    /* buttons and menus */
-    public static final String NEW_POLICY_FILE          = "New";
-    public static final String OPEN_POLICY_FILE         = "Open";
-    public static final String SAVE_POLICY_FILE         = "Save";
-    public static final String SAVE_AS_POLICY_FILE      = "Save.As";
-    public static final String VIEW_WARNINGS            = "View.Warning.Log";
-    public static final String QUIT                     = "Exit";
-    public static final String ADD_POLICY_ENTRY         = "Add.Policy.Entry";
-    public static final String EDIT_POLICY_ENTRY        = "Edit.Policy.Entry";
-    public static final String REMOVE_POLICY_ENTRY      = "Remove.Policy.Entry";
-    public static final String EDIT_KEYSTORE            = "Edit";
-    public static final String ADD_PUBKEY_ALIAS         = "Add.Public.Key.Alias";
-    public static final String REMOVE_PUBKEY_ALIAS      = "Remove.Public.Key.Alias";
-
-    /* gridbag index for components in the main window (MW) */
-    public static final int MW_FILENAME_LABEL           = 0;
-    public static final int MW_FILENAME_TEXTFIELD       = 1;
-    public static final int MW_PANEL                    = 2;
-    public static final int MW_ADD_BUTTON               = 0;
-    public static final int MW_EDIT_BUTTON              = 1;
-    public static final int MW_REMOVE_BUTTON            = 2;
-    public static final int MW_POLICY_LIST              = 3; // follows MW_PANEL
-
-    /* The preferred height of JTextField should match JComboBox. */
-    static final int TEXTFIELD_HEIGHT = new JComboBox<>().getPreferredSize().height;
-
-    private PolicyTool tool;
-
-    /**
-     * Constructor
-     */
-    ToolWindow(PolicyTool tool) {
-        this.tool = tool;
-    }
-
-    /**
-     * Don't call getComponent directly on the window
-     */
-    public Component getComponent(int n) {
-        Component c = getContentPane().getComponent(n);
-        if (c instanceof JScrollPane) {
-            c = ((JScrollPane)c).getViewport().getView();
-        }
-        return c;
-    }
-
-    /**
-     * Initialize the PolicyTool window with the necessary components
-     */
-    private void initWindow() {
-        // The ToolWindowListener will handle closing the window.
-        setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
-
-        // create the top menu bar
-        JMenuBar menuBar = new JMenuBar();
-
-        // create a File menu
-        JMenu menu = new JMenu();
-        configureButton(menu, "File");
-        ActionListener actionListener = new FileMenuListener(tool, this);
-        addMenuItem(menu, NEW_POLICY_FILE, actionListener, "N");
-        addMenuItem(menu, OPEN_POLICY_FILE, actionListener, "O");
-        addMenuItem(menu, SAVE_POLICY_FILE, actionListener, "S");
-        addMenuItem(menu, SAVE_AS_POLICY_FILE, actionListener, null);
-        addMenuItem(menu, VIEW_WARNINGS, actionListener, null);
-        addMenuItem(menu, QUIT, actionListener, null);
-        menuBar.add(menu);
-
-        // create a KeyStore menu
-        menu = new JMenu();
-        configureButton(menu, "KeyStore");
-        actionListener = new MainWindowListener(tool, this);
-        addMenuItem(menu, EDIT_KEYSTORE, actionListener, null);
-        menuBar.add(menu);
-        setJMenuBar(menuBar);
-
-        // Create some space around components
-        ((JPanel)getContentPane()).setBorder(new EmptyBorder(6, 6, 6, 6));
-
-        // policy entry listing
-        JLabel label = new JLabel(PolicyTool.getMessage("Policy.File."));
-        addNewComponent(this, label, MW_FILENAME_LABEL,
-                        0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                        LR_TOP_BOTTOM_PADDING);
-        JTextField tf = new JTextField(50);
-        tf.setPreferredSize(new Dimension(tf.getPreferredSize().width, TEXTFIELD_HEIGHT));
-        tf.getAccessibleContext().setAccessibleName(
-                PolicyTool.getMessage("Policy.File."));
-        tf.setEditable(false);
-        addNewComponent(this, tf, MW_FILENAME_TEXTFIELD,
-                        1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                        LR_TOP_BOTTOM_PADDING);
-
-
-        // add ADD/REMOVE/EDIT buttons in a new panel
-        JPanel panel = new JPanel();
-        panel.setLayout(new GridBagLayout());
-
-        JButton button = new JButton();
-        configureButton(button, ADD_POLICY_ENTRY);
-        button.addActionListener(new MainWindowListener(tool, this));
-        addNewComponent(panel, button, MW_ADD_BUTTON,
-                        0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                        LR_PADDING);
-
-        button = new JButton();
-        configureButton(button, EDIT_POLICY_ENTRY);
-        button.addActionListener(new MainWindowListener(tool, this));
-        addNewComponent(panel, button, MW_EDIT_BUTTON,
-                        1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                        LR_PADDING);
-
-        button = new JButton();
-        configureButton(button, REMOVE_POLICY_ENTRY);
-        button.addActionListener(new MainWindowListener(tool, this));
-        addNewComponent(panel, button, MW_REMOVE_BUTTON,
-                        2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                        LR_PADDING);
-
-        addNewComponent(this, panel, MW_PANEL,
-                        0, 2, 2, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                        BOTTOM_PADDING);
-
-
-        String policyFile = tool.getPolicyFileName();
-        if (policyFile == null) {
-            String userHome;
-            userHome = java.security.AccessController.doPrivileged(
-                (PrivilegedAction<String>) () -> System.getProperty("user.home"));
-            policyFile = userHome + File.separatorChar + ".java.policy";
-        }
-
-        try {
-            // open the policy file
-            tool.openPolicy(policyFile);
-
-            // display the policy entries via the policy list textarea
-            DefaultListModel<String> listModel = new DefaultListModel<>();
-            JList<String> list = new JList<>(listModel);
-            list.setVisibleRowCount(15);
-            list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
-            list.addMouseListener(new PolicyListListener(tool, this));
-            PolicyEntry entries[] = tool.getEntry();
-            if (entries != null) {
-                for (int i = 0; i < entries.length; i++) {
-                    listModel.addElement(entries[i].headerToString());
-                }
-            }
-            JTextField newFilename = (JTextField)
-                                getComponent(MW_FILENAME_TEXTFIELD);
-            newFilename.setText(policyFile);
-            initPolicyList(list);
-
-        } catch (FileNotFoundException fnfe) {
-            // add blank policy listing
-            JList<String> list = new JList<>(new DefaultListModel<>());
-            list.setVisibleRowCount(15);
-            list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
-            list.addMouseListener(new PolicyListListener(tool, this));
-            initPolicyList(list);
-            tool.setPolicyFileName(null);
-            tool.modified = false;
-
-            // just add warning
-            tool.warnings.addElement(fnfe.toString());
-
-        } catch (Exception e) {
-            // add blank policy listing
-            JList<String> list = new JList<>(new DefaultListModel<>());
-            list.setVisibleRowCount(15);
-            list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
-            list.addMouseListener(new PolicyListListener(tool, this));
-            initPolicyList(list);
-            tool.setPolicyFileName(null);
-            tool.modified = false;
-
-            // display the error
-            MessageFormat form = new MessageFormat(PolicyTool.getMessage
-                ("Could.not.open.policy.file.policyFile.e.toString."));
-            Object[] source = {policyFile, e.toString()};
-            displayErrorDialog(null, form.format(source));
-        }
-    }
-
-
-    // Platform specific modifier (control / command).
-    private int shortCutModifier = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
-
-    private void addMenuItem(JMenu menu, String key, ActionListener actionListener, String accelerator) {
-        JMenuItem menuItem = new JMenuItem();
-        configureButton(menuItem, key);
-
-        if (PolicyTool.rb.containsKey(key + ".accelerator")) {
-            // Accelerator from resources takes precedence
-            accelerator = PolicyTool.getMessage(key + ".accelerator");
-        }
-
-        if (accelerator != null && !accelerator.isEmpty()) {
-            KeyStroke keyStroke;
-            if (accelerator.length() == 1) {
-                keyStroke = KeyStroke.getKeyStroke(KeyEvent.getExtendedKeyCodeForChar(accelerator.charAt(0)),
-                                                   shortCutModifier);
-            } else {
-                keyStroke = KeyStroke.getKeyStroke(accelerator);
-            }
-            menuItem.setAccelerator(keyStroke);
-        }
-
-        menuItem.addActionListener(actionListener);
-        menu.add(menuItem);
-    }
-
-    static void configureButton(AbstractButton button, String key) {
-        button.setText(PolicyTool.getMessage(key));
-        button.setActionCommand(key);
-
-        int mnemonicInt = PolicyTool.getMnemonicInt(key);
-        if (mnemonicInt > 0) {
-            button.setMnemonic(mnemonicInt);
-            button.setDisplayedMnemonicIndex(PolicyTool.getDisplayedMnemonicIndex(key));
-         }
-    }
-
-    static void configureLabelFor(JLabel label, JComponent component, String key) {
-        label.setText(PolicyTool.getMessage(key));
-        label.setLabelFor(component);
-
-        int mnemonicInt = PolicyTool.getMnemonicInt(key);
-        if (mnemonicInt > 0) {
-            label.setDisplayedMnemonic(mnemonicInt);
-            label.setDisplayedMnemonicIndex(PolicyTool.getDisplayedMnemonicIndex(key));
-         }
-    }
-
-
-    /**
-     * Add a component to the PolicyTool window
-     */
-    void addNewComponent(Container container, JComponent component,
-        int index, int gridx, int gridy, int gridwidth, int gridheight,
-        double weightx, double weighty, int fill, Insets is) {
-
-        if (container instanceof JFrame) {
-            container = ((JFrame)container).getContentPane();
-        } else if (container instanceof JDialog) {
-            container = ((JDialog)container).getContentPane();
-        }
-
-        // add the component at the specified gridbag index
-        container.add(component, index);
-
-        // set the constraints
-        GridBagLayout gbl = (GridBagLayout)container.getLayout();
-        GridBagConstraints gbc = new GridBagConstraints();
-        gbc.gridx = gridx;
-        gbc.gridy = gridy;
-        gbc.gridwidth = gridwidth;
-        gbc.gridheight = gridheight;
-        gbc.weightx = weightx;
-        gbc.weighty = weighty;
-        gbc.fill = fill;
-        if (is != null) gbc.insets = is;
-        gbl.setConstraints(component, gbc);
-    }
-
-
-    /**
-     * Add a component to the PolicyTool window without external padding
-     */
-    void addNewComponent(Container container, JComponent component,
-        int index, int gridx, int gridy, int gridwidth, int gridheight,
-        double weightx, double weighty, int fill) {
-
-        // delegate with "null" external padding
-        addNewComponent(container, component, index, gridx, gridy,
-                        gridwidth, gridheight, weightx, weighty,
-                        fill, null);
-    }
-
-
-    /**
-     * Init the policy_entry_list TEXTAREA component in the
-     * PolicyTool window
-     */
-    void initPolicyList(JList<String> policyList) {
-
-        // add the policy list to the window
-        //policyList.setPreferredSize(new Dimension(500, 350));
-        JScrollPane scrollPane = new JScrollPane(policyList);
-        addNewComponent(this, scrollPane, MW_POLICY_LIST,
-                        0, 3, 2, 1, 1.0, 1.0, GridBagConstraints.BOTH);
-    }
-
-    /**
-     * Replace the policy_entry_list TEXTAREA component in the
-     * PolicyTool window with an updated one.
-     */
-    void replacePolicyList(JList<String> policyList) {
-
-        // remove the original list of Policy Entries
-        // and add the new list of entries
-        @SuppressWarnings("unchecked")
-        JList<String> list = (JList<String>)getComponent(MW_POLICY_LIST);
-        list.setModel(policyList.getModel());
-    }
-
-    /**
-     * display the main PolicyTool window
-     */
-    void displayToolWindow(String args[]) {
-
-        setTitle(PolicyTool.getMessage("Policy.Tool"));
-        setResizable(true);
-        addWindowListener(new ToolWindowListener(tool, this));
-        //setBounds(135, 80, 500, 500);
-        getContentPane().setLayout(new GridBagLayout());
-
-        initWindow();
-        pack();
-        setLocationRelativeTo(null);
-
-        // display it
-        setVisible(true);
-
-        if (tool.newWarning == true) {
-            displayStatusDialog(this, PolicyTool.getMessage
-                ("Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information."));
-        }
-    }
-
-    /**
-     * displays a dialog box describing an error which occurred.
-     */
-    void displayErrorDialog(Window w, String error) {
-        ToolDialog ed = new ToolDialog
-                (PolicyTool.getMessage("Error"), tool, this, true);
-
-        // find where the PolicyTool gui is
-        Point location = ((w == null) ?
-                getLocationOnScreen() : w.getLocationOnScreen());
-        //ed.setBounds(location.x + 50, location.y + 50, 600, 100);
-        ed.setLayout(new GridBagLayout());
-
-        JLabel label = new JLabel(error);
-        addNewComponent(ed, label, 0,
-                        0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH);
-
-        JButton okButton = new JButton(PolicyTool.getMessage("OK"));
-        ActionListener okListener = new ErrorOKButtonListener(ed);
-        okButton.addActionListener(okListener);
-        addNewComponent(ed, okButton, 1,
-                        0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL);
-
-        ed.getRootPane().setDefaultButton(okButton);
-        ed.getRootPane().registerKeyboardAction(okListener, escKey, JComponent.WHEN_IN_FOCUSED_WINDOW);
-
-        ed.pack();
-        ed.setLocationRelativeTo(w);
-        ed.setVisible(true);
-    }
-
-    /**
-     * displays a dialog box describing an error which occurred.
-     */
-    void displayErrorDialog(Window w, Throwable t) {
-        if (t instanceof NoDisplayException) {
-            return;
-        }
-        if (t.getClass() == Exception.class) {
-            // Exception is usually thrown inside policytool for user
-            // interaction error. There is no need to show the type.
-            displayErrorDialog(w, t.getLocalizedMessage());
-        } else {
-            displayErrorDialog(w, t.toString());
-        }
-    }
-
-    /**
-     * displays a dialog box describing the status of an event
-     */
-    void displayStatusDialog(Window w, String status) {
-        ToolDialog sd = new ToolDialog
-                (PolicyTool.getMessage("Status"), tool, this, true);
-
-        // find the location of the PolicyTool gui
-        Point location = ((w == null) ?
-                getLocationOnScreen() : w.getLocationOnScreen());
-        //sd.setBounds(location.x + 50, location.y + 50, 500, 100);
-        sd.setLayout(new GridBagLayout());
-
-        JLabel label = new JLabel(status);
-        addNewComponent(sd, label, 0,
-                        0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH);
-
-        JButton okButton = new JButton(PolicyTool.getMessage("OK"));
-        ActionListener okListener = new StatusOKButtonListener(sd);
-        okButton.addActionListener(okListener);
-        addNewComponent(sd, okButton, 1,
-                        0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL);
-
-        sd.getRootPane().setDefaultButton(okButton);
-        sd.getRootPane().registerKeyboardAction(okListener, escKey, JComponent.WHEN_IN_FOCUSED_WINDOW);
-
-        sd.pack();
-        sd.setLocationRelativeTo(w);
-        sd.setVisible(true);
-    }
-
-    /**
-     * display the warning log
-     */
-    void displayWarningLog(Window w) {
-
-        ToolDialog wd = new ToolDialog
-                (PolicyTool.getMessage("Warning"), tool, this, true);
-
-        // find the location of the PolicyTool gui
-        Point location = ((w == null) ?
-                getLocationOnScreen() : w.getLocationOnScreen());
-        //wd.setBounds(location.x + 50, location.y + 50, 500, 100);
-        wd.setLayout(new GridBagLayout());
-
-        JTextArea ta = new JTextArea();
-        ta.setEditable(false);
-        for (int i = 0; i < tool.warnings.size(); i++) {
-            ta.append(tool.warnings.elementAt(i));
-            ta.append(PolicyTool.getMessage("NEWLINE"));
-        }
-        addNewComponent(wd, ta, 0,
-                        0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                        BOTTOM_PADDING);
-        ta.setFocusable(false);
-
-        JButton okButton = new JButton(PolicyTool.getMessage("OK"));
-        ActionListener okListener = new CancelButtonListener(wd);
-        okButton.addActionListener(okListener);
-        addNewComponent(wd, okButton, 1,
-                        0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL,
-                        LR_PADDING);
-
-        wd.getRootPane().setDefaultButton(okButton);
-        wd.getRootPane().registerKeyboardAction(okListener, escKey, JComponent.WHEN_IN_FOCUSED_WINDOW);
-
-        wd.pack();
-        wd.setLocationRelativeTo(w);
-        wd.setVisible(true);
-    }
-
-    char displayYesNoDialog(Window w, String title, String prompt, String yes, String no) {
-
-        final ToolDialog tw = new ToolDialog
-                (title, tool, this, true);
-        Point location = ((w == null) ?
-                getLocationOnScreen() : w.getLocationOnScreen());
-        //tw.setBounds(location.x + 75, location.y + 100, 400, 150);
-        tw.setLayout(new GridBagLayout());
-
-        JTextArea ta = new JTextArea(prompt, 10, 50);
-        ta.setEditable(false);
-        ta.setLineWrap(true);
-        ta.setWrapStyleWord(true);
-        JScrollPane scrollPane = new JScrollPane(ta,
-                                                 JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
-                                                 JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
-        addNewComponent(tw, scrollPane, 0,
-                0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH);
-        ta.setFocusable(false);
-
-        JPanel panel = new JPanel();
-        panel.setLayout(new GridBagLayout());
-
-        // StringBuffer to store button press. Must be final.
-        final StringBuffer chooseResult = new StringBuffer();
-
-        JButton button = new JButton(yes);
-        button.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent e) {
-                chooseResult.append('Y');
-                tw.setVisible(false);
-                tw.dispose();
-            }
-        });
-        addNewComponent(panel, button, 0,
-                           0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL,
-                           LR_PADDING);
-
-        button = new JButton(no);
-        button.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent e) {
-                chooseResult.append('N');
-                tw.setVisible(false);
-                tw.dispose();
-            }
-        });
-        addNewComponent(panel, button, 1,
-                           1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL,
-                           LR_PADDING);
-
-        addNewComponent(tw, panel, 1,
-                0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL);
-
-        tw.pack();
-        tw.setLocationRelativeTo(w);
-        tw.setVisible(true);
-        if (chooseResult.length() > 0) {
-            return chooseResult.charAt(0);
-        } else {
-            // I did encounter this once, don't why.
-            return 'N';
-        }
-    }
-
-}
-
-/**
- * General dialog window
- */
-class ToolDialog extends JDialog {
-    // use serialVersionUID from JDK 1.2.2 for interoperability
-    private static final long serialVersionUID = -372244357011301190L;
-
-    /* ESCAPE key */
-    static final KeyStroke escKey = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0);
-
-    /* necessary constants */
-    public static final int NOACTION            = 0;
-    public static final int QUIT                = 1;
-    public static final int NEW                 = 2;
-    public static final int OPEN                = 3;
-
-    public static final String ALL_PERM_CLASS   =
-                "java.security.AllPermission";
-    public static final String FILE_PERM_CLASS  =
-                "java.io.FilePermission";
-
-    public static final String X500_PRIN_CLASS         =
-                "javax.security.auth.x500.X500Principal";
-
-    /* popup menus */
-    public static final String PERM             =
-        PolicyTool.getMessage
-        ("Permission.");
-
-    public static final String PRIN_TYPE        =
-        PolicyTool.getMessage("Principal.Type.");
-    public static final String PRIN_NAME        =
-        PolicyTool.getMessage("Principal.Name.");
-
-    /* more popu menus */
-    public static final String PERM_NAME        =
-        PolicyTool.getMessage
-        ("Target.Name.");
-
-    /* and more popup menus */
-    public static final String PERM_ACTIONS             =
-      PolicyTool.getMessage
-      ("Actions.");
-
-    /* gridbag index for display PolicyEntry (PE) components */
-    public static final int PE_CODEBASE_LABEL           = 0;
-    public static final int PE_CODEBASE_TEXTFIELD       = 1;
-    public static final int PE_SIGNEDBY_LABEL           = 2;
-    public static final int PE_SIGNEDBY_TEXTFIELD       = 3;
-
-    public static final int PE_PANEL0                   = 4;
-    public static final int PE_ADD_PRIN_BUTTON          = 0;
-    public static final int PE_EDIT_PRIN_BUTTON         = 1;
-    public static final int PE_REMOVE_PRIN_BUTTON       = 2;
-
-    public static final int PE_PRIN_LABEL               = 5;
-    public static final int PE_PRIN_LIST                = 6;
-
-    public static final int PE_PANEL1                   = 7;
-    public static final int PE_ADD_PERM_BUTTON          = 0;
-    public static final int PE_EDIT_PERM_BUTTON         = 1;
-    public static final int PE_REMOVE_PERM_BUTTON       = 2;
-
-    public static final int PE_PERM_LIST                = 8;
-
-    public static final int PE_PANEL2                   = 9;
-    public static final int PE_CANCEL_BUTTON            = 1;
-    public static final int PE_DONE_BUTTON              = 0;
-
-    /* the gridbag index for components in the Principal Dialog (PRD) */
-    public static final int PRD_DESC_LABEL              = 0;
-    public static final int PRD_PRIN_CHOICE             = 1;
-    public static final int PRD_PRIN_TEXTFIELD          = 2;
-    public static final int PRD_NAME_LABEL              = 3;
-    public static final int PRD_NAME_TEXTFIELD          = 4;
-    public static final int PRD_CANCEL_BUTTON           = 6;
-    public static final int PRD_OK_BUTTON               = 5;
-
-    /* the gridbag index for components in the Permission Dialog (PD) */
-    public static final int PD_DESC_LABEL               = 0;
-    public static final int PD_PERM_CHOICE              = 1;
-    public static final int PD_PERM_TEXTFIELD           = 2;
-    public static final int PD_NAME_CHOICE              = 3;
-    public static final int PD_NAME_TEXTFIELD           = 4;
-    public static final int PD_ACTIONS_CHOICE           = 5;
-    public static final int PD_ACTIONS_TEXTFIELD        = 6;
-    public static final int PD_SIGNEDBY_LABEL           = 7;
-    public static final int PD_SIGNEDBY_TEXTFIELD       = 8;
-    public static final int PD_CANCEL_BUTTON            = 10;
-    public static final int PD_OK_BUTTON                = 9;
-
-    /* modes for KeyStore */
-    public static final int EDIT_KEYSTORE               = 0;
-
-    /* the gridbag index for components in the Change KeyStore Dialog (KSD) */
-    public static final int KSD_NAME_LABEL              = 0;
-    public static final int KSD_NAME_TEXTFIELD          = 1;
-    public static final int KSD_TYPE_LABEL              = 2;
-    public static final int KSD_TYPE_TEXTFIELD          = 3;
-    public static final int KSD_PROVIDER_LABEL          = 4;
-    public static final int KSD_PROVIDER_TEXTFIELD      = 5;
-    public static final int KSD_PWD_URL_LABEL           = 6;
-    public static final int KSD_PWD_URL_TEXTFIELD       = 7;
-    public static final int KSD_CANCEL_BUTTON           = 9;
-    public static final int KSD_OK_BUTTON               = 8;
-
-    /* the gridbag index for components in the User Save Changes Dialog (USC) */
-    public static final int USC_LABEL                   = 0;
-    public static final int USC_PANEL                   = 1;
-    public static final int USC_YES_BUTTON              = 0;
-    public static final int USC_NO_BUTTON               = 1;
-    public static final int USC_CANCEL_BUTTON           = 2;
-
-    /* gridbag index for the ConfirmRemovePolicyEntryDialog (CRPE) */
-    public static final int CRPE_LABEL1                 = 0;
-    public static final int CRPE_LABEL2                 = 1;
-    public static final int CRPE_PANEL                  = 2;
-    public static final int CRPE_PANEL_OK               = 0;
-    public static final int CRPE_PANEL_CANCEL           = 1;
-
-    /* some private static finals */
-    private static final int PERMISSION                 = 0;
-    private static final int PERMISSION_NAME            = 1;
-    private static final int PERMISSION_ACTIONS         = 2;
-    private static final int PERMISSION_SIGNEDBY        = 3;
-    private static final int PRINCIPAL_TYPE             = 4;
-    private static final int PRINCIPAL_NAME             = 5;
-
-    /* The preferred height of JTextField should match JComboBox. */
-    static final int TEXTFIELD_HEIGHT = new JComboBox<>().getPreferredSize().height;
-
-    public static java.util.ArrayList<Perm> PERM_ARRAY;
-    public static java.util.ArrayList<Prin> PRIN_ARRAY;
-    PolicyTool tool;
-    ToolWindow tw;
-
-    static {
-
-        // set up permission objects
-
-        PERM_ARRAY = new java.util.ArrayList<Perm>();
-        PERM_ARRAY.add(new AllPerm());
-        PERM_ARRAY.add(new AudioPerm());
-        PERM_ARRAY.add(new AuthPerm());
-        PERM_ARRAY.add(new AWTPerm());
-        PERM_ARRAY.add(new DelegationPerm());
-        PERM_ARRAY.add(new FilePerm());
-        PERM_ARRAY.add(new URLPerm());
-        PERM_ARRAY.add(new InqSecContextPerm());
-        PERM_ARRAY.add(new LogPerm());
-        PERM_ARRAY.add(new MgmtPerm());
-        PERM_ARRAY.add(new MBeanPerm());
-        PERM_ARRAY.add(new MBeanSvrPerm());
-        PERM_ARRAY.add(new MBeanTrustPerm());
-        PERM_ARRAY.add(new NetPerm());
-        PERM_ARRAY.add(new NetworkPerm());
-        PERM_ARRAY.add(new PrivCredPerm());
-        PERM_ARRAY.add(new PropPerm());
-        PERM_ARRAY.add(new ReflectPerm());
-        PERM_ARRAY.add(new RuntimePerm());
-        PERM_ARRAY.add(new SecurityPerm());
-        PERM_ARRAY.add(new SerialPerm());
-        PERM_ARRAY.add(new ServicePerm());
-        PERM_ARRAY.add(new SocketPerm());
-        PERM_ARRAY.add(new SQLPerm());
-        PERM_ARRAY.add(new SSLPerm());
-        PERM_ARRAY.add(new SubjDelegPerm());
-
-        // set up principal objects
-
-        PRIN_ARRAY = new java.util.ArrayList<Prin>();
-        PRIN_ARRAY.add(new KrbPrin());
-        PRIN_ARRAY.add(new X500Prin());
-    }
-
-    ToolDialog(String title, PolicyTool tool, ToolWindow tw, boolean modal) {
-        super(tw, modal);
-        setTitle(title);
-        this.tool = tool;
-        this.tw = tw;
-        addWindowListener(new ChildWindowListener(this));
-
-        // Create some space around components
-        ((JPanel)getContentPane()).setBorder(new EmptyBorder(6, 6, 6, 6));
-    }
-
-    /**
-     * Don't call getComponent directly on the window
-     */
-    public Component getComponent(int n) {
-        Component c = getContentPane().getComponent(n);
-        if (c instanceof JScrollPane) {
-            c = ((JScrollPane)c).getViewport().getView();
-        }
-        return c;
-    }
-
-    /**
-     * get the Perm instance based on either the (shortened) class name
-     * or the fully qualified class name
-     */
-    static Perm getPerm(String clazz, boolean fullClassName) {
-        for (int i = 0; i < PERM_ARRAY.size(); i++) {
-            Perm next = PERM_ARRAY.get(i);
-            if (fullClassName) {
-                if (next.FULL_CLASS.equals(clazz)) {
-                    return next;
-                }
-            } else {
-                if (next.CLASS.equals(clazz)) {
-                    return next;
-                }
-            }
-        }
-        return null;
-    }
-
-    /**
-     * get the Prin instance based on either the (shortened) class name
-     * or the fully qualified class name
-     */
-    static Prin getPrin(String clazz, boolean fullClassName) {
-        for (int i = 0; i < PRIN_ARRAY.size(); i++) {
-            Prin next = PRIN_ARRAY.get(i);
-            if (fullClassName) {
-                if (next.FULL_CLASS.equals(clazz)) {
-                    return next;
-                }
-            } else {
-                if (next.CLASS.equals(clazz)) {
-                    return next;
-                }
-            }
-        }
-        return null;
-    }
-
-    /**
-     * pop up a dialog so the user can enter info to add a new PolicyEntry
-     * - if edit is TRUE, then the user is editing an existing entry
-     *   and we should display the original info as well.
-     *
-     * - the other reason we need the 'edit' boolean is we need to know
-     *   when we are adding a NEW policy entry.  in this case, we can
-     *   not simply update the existing entry, because it doesn't exist.
-     *   we ONLY update the GUI listing/info, and then when the user
-     *   finally clicks 'OK' or 'DONE', then we can collect that info
-     *   and add it to the policy.
-     */
-    void displayPolicyEntryDialog(boolean edit) {
-
-        int listIndex = 0;
-        PolicyEntry entries[] = null;
-        TaggedList prinList = new TaggedList(3, false);
-        prinList.getAccessibleContext().setAccessibleName(
-                PolicyTool.getMessage("Principal.List"));
-        prinList.addMouseListener
-                (new EditPrinButtonListener(tool, tw, this, edit));
-        TaggedList permList = new TaggedList(10, false);
-        permList.getAccessibleContext().setAccessibleName(
-                PolicyTool.getMessage("Permission.List"));
-        permList.addMouseListener
-                (new EditPermButtonListener(tool, tw, this, edit));
-
-        // find where the PolicyTool gui is
-        Point location = tw.getLocationOnScreen();
-        //setBounds(location.x + 75, location.y + 200, 650, 500);
-        setLayout(new GridBagLayout());
-        setResizable(true);
-
-        if (edit) {
-            // get the selected item
-            entries = tool.getEntry();
-            @SuppressWarnings("unchecked")
-            JList<String> policyList = (JList<String>)tw.getComponent(ToolWindow.MW_POLICY_LIST);
-            listIndex = policyList.getSelectedIndex();
-
-            // get principal list
-            LinkedList<PolicyParser.PrincipalEntry> principals =
-                entries[listIndex].getGrantEntry().principals;
-            for (int i = 0; i < principals.size(); i++) {
-                String prinString = null;
-                PolicyParser.PrincipalEntry nextPrin = principals.get(i);
-                prinList.addTaggedItem(PrincipalEntryToUserFriendlyString(nextPrin), nextPrin);
-            }
-
-            // get permission list
-            Vector<PolicyParser.PermissionEntry> permissions =
-                entries[listIndex].getGrantEntry().permissionEntries;
-            for (int i = 0; i < permissions.size(); i++) {
-                String permString = null;
-                PolicyParser.PermissionEntry nextPerm =
-                                                permissions.elementAt(i);
-                permList.addTaggedItem(ToolDialog.PermissionEntryToUserFriendlyString(nextPerm), nextPerm);
-            }
-        }
-
-        // codebase label and textfield
-        JLabel label = new JLabel();
-        tw.addNewComponent(this, label, PE_CODEBASE_LABEL,
-                0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                ToolWindow.R_PADDING);
-        JTextField tf;
-        tf = (edit ?
-                new JTextField(entries[listIndex].getGrantEntry().codeBase) :
-                new JTextField());
-        ToolWindow.configureLabelFor(label, tf, "CodeBase.");
-        tf.setPreferredSize(new Dimension(tf.getPreferredSize().width, TEXTFIELD_HEIGHT));
-        tf.getAccessibleContext().setAccessibleName(
-                PolicyTool.getMessage("Code.Base"));
-        tw.addNewComponent(this, tf, PE_CODEBASE_TEXTFIELD,
-                1, 0, 1, 1, 1.0, 0.0, GridBagConstraints.BOTH);
-
-        // signedby label and textfield
-        label = new JLabel();
-        tw.addNewComponent(this, label, PE_SIGNEDBY_LABEL,
-                           0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                           ToolWindow.R_PADDING);
-        tf = (edit ?
-                new JTextField(entries[listIndex].getGrantEntry().signedBy) :
-                new JTextField());
-        ToolWindow.configureLabelFor(label, tf, "SignedBy.");
-        tf.setPreferredSize(new Dimension(tf.getPreferredSize().width, TEXTFIELD_HEIGHT));
-        tf.getAccessibleContext().setAccessibleName(
-                PolicyTool.getMessage("Signed.By."));
-        tw.addNewComponent(this, tf, PE_SIGNEDBY_TEXTFIELD,
-                           1, 1, 1, 1, 1.0, 0.0, GridBagConstraints.BOTH);
-
-        // panel for principal buttons
-        JPanel panel = new JPanel();
-        panel.setLayout(new GridBagLayout());
-
-        JButton button = new JButton();
-        ToolWindow.configureButton(button, "Add.Principal");
-        button.addActionListener
-                (new AddPrinButtonListener(tool, tw, this, edit));
-        tw.addNewComponent(panel, button, PE_ADD_PRIN_BUTTON,
-                0, 0, 1, 1, 100.0, 0.0, GridBagConstraints.HORIZONTAL);
-
-        button = new JButton();
-        ToolWindow.configureButton(button, "Edit.Principal");
-        button.addActionListener(new EditPrinButtonListener
-                                                (tool, tw, this, edit));
-        tw.addNewComponent(panel, button, PE_EDIT_PRIN_BUTTON,
-                1, 0, 1, 1, 100.0, 0.0, GridBagConstraints.HORIZONTAL);
-
-        button = new JButton();
-        ToolWindow.configureButton(button, "Remove.Principal");
-        button.addActionListener(new RemovePrinButtonListener
-                                        (tool, tw, this, edit));
-        tw.addNewComponent(panel, button, PE_REMOVE_PRIN_BUTTON,
-                2, 0, 1, 1, 100.0, 0.0, GridBagConstraints.HORIZONTAL);
-
-        tw.addNewComponent(this, panel, PE_PANEL0,
-                1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.HORIZONTAL,
-                           ToolWindow.LITE_BOTTOM_PADDING);
-
-        // principal label and list
-        label = new JLabel();
-        tw.addNewComponent(this, label, PE_PRIN_LABEL,
-                           0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                           ToolWindow.R_BOTTOM_PADDING);
-        JScrollPane scrollPane = new JScrollPane(prinList);
-        ToolWindow.configureLabelFor(label, scrollPane, "Principals.");
-        tw.addNewComponent(this, scrollPane, PE_PRIN_LIST,
-                           1, 3, 3, 1, 0.0, prinList.getVisibleRowCount(), GridBagConstraints.BOTH,
-                           ToolWindow.BOTTOM_PADDING);
-
-        // panel for permission buttons
-        panel = new JPanel();
-        panel.setLayout(new GridBagLayout());
-
-        button = new JButton();
-        ToolWindow.configureButton(button, ".Add.Permission");
-        button.addActionListener(new AddPermButtonListener
-                                                (tool, tw, this, edit));
-        tw.addNewComponent(panel, button, PE_ADD_PERM_BUTTON,
-                0, 0, 1, 1, 100.0, 0.0, GridBagConstraints.HORIZONTAL);
-
-        button = new JButton();
-        ToolWindow.configureButton(button, ".Edit.Permission");
-        button.addActionListener(new EditPermButtonListener
-                                                (tool, tw, this, edit));
-        tw.addNewComponent(panel, button, PE_EDIT_PERM_BUTTON,
-                1, 0, 1, 1, 100.0, 0.0, GridBagConstraints.HORIZONTAL);
-
-
-        button = new JButton();
-        ToolWindow.configureButton(button, "Remove.Permission");
-        button.addActionListener(new RemovePermButtonListener
-                                        (tool, tw, this, edit));
-        tw.addNewComponent(panel, button, PE_REMOVE_PERM_BUTTON,
-                2, 0, 1, 1, 100.0, 0.0, GridBagConstraints.HORIZONTAL);
-
-        tw.addNewComponent(this, panel, PE_PANEL1,
-                0, 4, 2, 1, 0.0, 0.0, GridBagConstraints.HORIZONTAL,
-                ToolWindow.LITE_BOTTOM_PADDING);
-
-        // permission list
-        scrollPane = new JScrollPane(permList);
-        tw.addNewComponent(this, scrollPane, PE_PERM_LIST,
-                           0, 5, 3, 1, 0.0, permList.getVisibleRowCount(), GridBagConstraints.BOTH,
-                           ToolWindow.BOTTOM_PADDING);
-
-
-        // panel for Done and Cancel buttons
-        panel = new JPanel();
-        panel.setLayout(new GridBagLayout());
-
-        // Done Button
-        JButton okButton = new JButton(PolicyTool.getMessage("Done"));
-        okButton.addActionListener
-                (new AddEntryDoneButtonListener(tool, tw, this, edit));
-        tw.addNewComponent(panel, okButton, PE_DONE_BUTTON,
-                           0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL,
-                           ToolWindow.LR_PADDING);
-
-        // Cancel Button
-        JButton cancelButton = new JButton(PolicyTool.getMessage("Cancel"));
-        ActionListener cancelListener = new CancelButtonListener(this);
-        cancelButton.addActionListener(cancelListener);
-        tw.addNewComponent(panel, cancelButton, PE_CANCEL_BUTTON,
-                           1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL,
-                           ToolWindow.LR_PADDING);
-
-        // add the panel
-        tw.addNewComponent(this, panel, PE_PANEL2,
-                0, 6, 2, 1, 0.0, 0.0, GridBagConstraints.VERTICAL);
-
-        getRootPane().setDefaultButton(okButton);
-        getRootPane().registerKeyboardAction(cancelListener, escKey, JComponent.WHEN_IN_FOCUSED_WINDOW);
-
-        pack();
-        setLocationRelativeTo(tw);
-        setVisible(true);
-    }
-
-    /**
-     * Read all the Policy information data in the dialog box
-     * and construct a PolicyEntry object with it.
-     */
-    PolicyEntry getPolicyEntryFromDialog()
-        throws InvalidParameterException, MalformedURLException,
-        NoSuchMethodException, ClassNotFoundException, InstantiationException,
-        IllegalAccessException, InvocationTargetException,
-        CertificateException, IOException, Exception {
-
-        // get the Codebase
-        JTextField tf = (JTextField)getComponent(PE_CODEBASE_TEXTFIELD);
-        String codebase = null;
-        if (tf.getText().trim().equals("") == false)
-                codebase = new String(tf.getText().trim());
-
-        // get the SignedBy
-        tf = (JTextField)getComponent(PE_SIGNEDBY_TEXTFIELD);
-        String signedby = null;
-        if (tf.getText().trim().equals("") == false)
-                signedby = new String(tf.getText().trim());
-
-        // construct a new GrantEntry
-        PolicyParser.GrantEntry ge =
-                        new PolicyParser.GrantEntry(signedby, codebase);
-
-        // get the new Principals
-        LinkedList<PolicyParser.PrincipalEntry> prins = new LinkedList<>();
-        TaggedList prinList = (TaggedList)getComponent(PE_PRIN_LIST);
-        for (int i = 0; i < prinList.getModel().getSize(); i++) {
-            prins.add((PolicyParser.PrincipalEntry)prinList.getObject(i));
-        }
-        ge.principals = prins;
-
-        // get the new Permissions
-        Vector<PolicyParser.PermissionEntry> perms = new Vector<>();
-        TaggedList permList = (TaggedList)getComponent(PE_PERM_LIST);
-        for (int i = 0; i < permList.getModel().getSize(); i++) {
-            perms.addElement((PolicyParser.PermissionEntry)permList.getObject(i));
-        }
-        ge.permissionEntries = perms;
-
-        // construct a new PolicyEntry object
-        PolicyEntry entry = new PolicyEntry(tool, ge);
-
-        return entry;
-    }
-
-    /**
-     * display a dialog box for the user to enter KeyStore information
-     */
-    void keyStoreDialog(int mode) {
-
-        // find where the PolicyTool gui is
-        Point location = tw.getLocationOnScreen();
-        //setBounds(location.x + 25, location.y + 100, 500, 300);
-        setLayout(new GridBagLayout());
-
-        if (mode == EDIT_KEYSTORE) {
-
-            // KeyStore label and textfield
-            JLabel label = new JLabel();
-            tw.addNewComponent(this, label, KSD_NAME_LABEL,
-                               0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                               ToolWindow.R_BOTTOM_PADDING);
-            JTextField tf = new JTextField(tool.getKeyStoreName(), 30);
-            ToolWindow.configureLabelFor(label, tf, "KeyStore.URL.");
-            tf.setPreferredSize(new Dimension(tf.getPreferredSize().width, TEXTFIELD_HEIGHT));
-
-            // URL to U R L, so that accessibility reader will pronounce well
-            tf.getAccessibleContext().setAccessibleName(
-                PolicyTool.getMessage("KeyStore.U.R.L."));
-            tw.addNewComponent(this, tf, KSD_NAME_TEXTFIELD,
-                               1, 0, 1, 1, 1.0, 0.0, GridBagConstraints.BOTH,
-                               ToolWindow.BOTTOM_PADDING);
-
-            // KeyStore type and textfield
-            label = new JLabel();
-            tw.addNewComponent(this, label, KSD_TYPE_LABEL,
-                               0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                               ToolWindow.R_BOTTOM_PADDING);
-            tf = new JTextField(tool.getKeyStoreType(), 30);
-            ToolWindow.configureLabelFor(label, tf, "KeyStore.Type.");
-            tf.setPreferredSize(new Dimension(tf.getPreferredSize().width, TEXTFIELD_HEIGHT));
-            tf.getAccessibleContext().setAccessibleName(
-                PolicyTool.getMessage("KeyStore.Type."));
-            tw.addNewComponent(this, tf, KSD_TYPE_TEXTFIELD,
-                               1, 1, 1, 1, 1.0, 0.0, GridBagConstraints.BOTH,
-                               ToolWindow.BOTTOM_PADDING);
-
-            // KeyStore provider and textfield
-            label = new JLabel();
-            tw.addNewComponent(this, label, KSD_PROVIDER_LABEL,
-                               0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                               ToolWindow.R_BOTTOM_PADDING);
-            tf = new JTextField(tool.getKeyStoreProvider(), 30);
-            ToolWindow.configureLabelFor(label, tf, "KeyStore.Provider.");
-            tf.setPreferredSize(new Dimension(tf.getPreferredSize().width, TEXTFIELD_HEIGHT));
-            tf.getAccessibleContext().setAccessibleName(
-                PolicyTool.getMessage("KeyStore.Provider."));
-            tw.addNewComponent(this, tf, KSD_PROVIDER_TEXTFIELD,
-                               1, 2, 1, 1, 1.0, 0.0, GridBagConstraints.BOTH,
-                               ToolWindow.BOTTOM_PADDING);
-
-            // KeyStore password URL and textfield
-            label = new JLabel();
-            tw.addNewComponent(this, label, KSD_PWD_URL_LABEL,
-                               0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                               ToolWindow.R_BOTTOM_PADDING);
-            tf = new JTextField(tool.getKeyStorePwdURL(), 30);
-            ToolWindow.configureLabelFor(label, tf, "KeyStore.Password.URL.");
-            tf.setPreferredSize(new Dimension(tf.getPreferredSize().width, TEXTFIELD_HEIGHT));
-            tf.getAccessibleContext().setAccessibleName(
-                PolicyTool.getMessage("KeyStore.Password.U.R.L."));
-            tw.addNewComponent(this, tf, KSD_PWD_URL_TEXTFIELD,
-                               1, 3, 1, 1, 1.0, 0.0, GridBagConstraints.BOTH,
-                               ToolWindow.BOTTOM_PADDING);
-
-            // OK button
-            JButton okButton = new JButton(PolicyTool.getMessage("OK"));
-            okButton.addActionListener
-                        (new ChangeKeyStoreOKButtonListener(tool, tw, this));
-            tw.addNewComponent(this, okButton, KSD_OK_BUTTON,
-                        0, 4, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL);
-
-            // cancel button
-            JButton cancelButton = new JButton(PolicyTool.getMessage("Cancel"));
-            ActionListener cancelListener = new CancelButtonListener(this);
-            cancelButton.addActionListener(cancelListener);
-            tw.addNewComponent(this, cancelButton, KSD_CANCEL_BUTTON,
-                        1, 4, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL);
-
-            getRootPane().setDefaultButton(okButton);
-            getRootPane().registerKeyboardAction(cancelListener, escKey, JComponent.WHEN_IN_FOCUSED_WINDOW);
-        }
-
-        pack();
-        setLocationRelativeTo(tw);
-        setVisible(true);
-    }
-
-    /**
-     * display a dialog box for the user to input Principal info
-     *
-     * if editPolicyEntry is false, then we are adding Principals to
-     * a new PolicyEntry, and we only update the GUI listing
-     * with the new Principal.
-     *
-     * if edit is true, then we are editing an existing Policy entry.
-     */
-    void displayPrincipalDialog(boolean editPolicyEntry, boolean edit) {
-
-        PolicyParser.PrincipalEntry editMe = null;
-
-        // get the Principal selected from the Principal List
-        TaggedList prinList = (TaggedList)getComponent(PE_PRIN_LIST);
-        int prinIndex = prinList.getSelectedIndex();
-
-        if (edit) {
-            editMe = (PolicyParser.PrincipalEntry)prinList.getObject(prinIndex);
-        }
-
-        ToolDialog newTD = new ToolDialog
-                (PolicyTool.getMessage("Principals"), tool, tw, true);
-        newTD.addWindowListener(new ChildWindowListener(newTD));
-
-        // find where the PolicyTool gui is
-        Point location = getLocationOnScreen();
-        //newTD.setBounds(location.x + 50, location.y + 100, 650, 190);
-        newTD.setLayout(new GridBagLayout());
-        newTD.setResizable(true);
-
-        // description label
-        JLabel label = (edit ?
-                new JLabel(PolicyTool.getMessage(".Edit.Principal.")) :
-                new JLabel(PolicyTool.getMessage(".Add.New.Principal.")));
-        tw.addNewComponent(newTD, label, PRD_DESC_LABEL,
-                           0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                           ToolWindow.TOP_BOTTOM_PADDING);
-
-        // principal choice
-        JComboBox<String> choice = new JComboBox<>();
-        choice.addItem(PRIN_TYPE);
-        choice.getAccessibleContext().setAccessibleName(PRIN_TYPE);
-        for (int i = 0; i < PRIN_ARRAY.size(); i++) {
-            Prin next = PRIN_ARRAY.get(i);
-            choice.addItem(next.CLASS);
-        }
-
-        if (edit) {
-            if (PolicyParser.PrincipalEntry.WILDCARD_CLASS.equals
-                                (editMe.getPrincipalClass())) {
-                choice.setSelectedItem(PRIN_TYPE);
-            } else {
-                Prin inputPrin = getPrin(editMe.getPrincipalClass(), true);
-                if (inputPrin != null) {
-                    choice.setSelectedItem(inputPrin.CLASS);
-                }
-            }
-        }
-        // Add listener after selected item is set
-        choice.addItemListener(new PrincipalTypeMenuListener(newTD));
-
-        tw.addNewComponent(newTD, choice, PRD_PRIN_CHOICE,
-                           0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                           ToolWindow.LR_PADDING);
-
-        // principal textfield
-        JTextField tf;
-        tf = (edit ?
-                new JTextField(editMe.getDisplayClass(), 30) :
-                new JTextField(30));
-        tf.setPreferredSize(new Dimension(tf.getPreferredSize().width, TEXTFIELD_HEIGHT));
-        tf.getAccessibleContext().setAccessibleName(PRIN_TYPE);
-        tw.addNewComponent(newTD, tf, PRD_PRIN_TEXTFIELD,
-                           1, 1, 1, 1, 1.0, 0.0, GridBagConstraints.BOTH,
-                           ToolWindow.LR_PADDING);
-
-        // name label and textfield
-        label = new JLabel(PRIN_NAME);
-        tf = (edit ?
-                new JTextField(editMe.getDisplayName(), 40) :
-                new JTextField(40));
-        tf.setPreferredSize(new Dimension(tf.getPreferredSize().width, TEXTFIELD_HEIGHT));
-        tf.getAccessibleContext().setAccessibleName(PRIN_NAME);
-
-        tw.addNewComponent(newTD, label, PRD_NAME_LABEL,
-                           0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                           ToolWindow.LR_PADDING);
-        tw.addNewComponent(newTD, tf, PRD_NAME_TEXTFIELD,
-                           1, 2, 1, 1, 1.0, 0.0, GridBagConstraints.BOTH,
-                           ToolWindow.LR_PADDING);
-
-        // OK button
-        JButton okButton = new JButton(PolicyTool.getMessage("OK"));
-        okButton.addActionListener(
-            new NewPolicyPrinOKButtonListener
-                                        (tool, tw, this, newTD, edit));
-        tw.addNewComponent(newTD, okButton, PRD_OK_BUTTON,
-                           0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL,
-                           ToolWindow.TOP_BOTTOM_PADDING);
-        // cancel button
-        JButton cancelButton = new JButton(PolicyTool.getMessage("Cancel"));
-        ActionListener cancelListener = new CancelButtonListener(newTD);
-        cancelButton.addActionListener(cancelListener);
-        tw.addNewComponent(newTD, cancelButton, PRD_CANCEL_BUTTON,
-                           1, 3, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL,
-                           ToolWindow.TOP_BOTTOM_PADDING);
-
-        newTD.getRootPane().setDefaultButton(okButton);
-        newTD.getRootPane().registerKeyboardAction(cancelListener, escKey, JComponent.WHEN_IN_FOCUSED_WINDOW);
-
-        newTD.pack();
-        newTD.setLocationRelativeTo(tw);
-        newTD.setVisible(true);
-    }
-
-    /**
-     * display a dialog box for the user to input Permission info
-     *
-     * if editPolicyEntry is false, then we are adding Permissions to
-     * a new PolicyEntry, and we only update the GUI listing
-     * with the new Permission.
-     *
-     * if edit is true, then we are editing an existing Permission entry.
-     */
-    void displayPermissionDialog(boolean editPolicyEntry, boolean edit) {
-
-        PolicyParser.PermissionEntry editMe = null;
-
-        // get the Permission selected from the Permission List
-        TaggedList permList = (TaggedList)getComponent(PE_PERM_LIST);
-        int permIndex = permList.getSelectedIndex();
-
-        if (edit) {
-            editMe = (PolicyParser.PermissionEntry)permList.getObject(permIndex);
-        }
-
-        ToolDialog newTD = new ToolDialog
-                (PolicyTool.getMessage("Permissions"), tool, tw, true);
-        newTD.addWindowListener(new ChildWindowListener(newTD));
-
-        // find where the PolicyTool gui is
-        Point location = getLocationOnScreen();
-        //newTD.setBounds(location.x + 50, location.y + 100, 700, 250);
-        newTD.setLayout(new GridBagLayout());
-        newTD.setResizable(true);
-
-        // description label
-        JLabel label = (edit ?
-                new JLabel(PolicyTool.getMessage(".Edit.Permission.")) :
-                new JLabel(PolicyTool.getMessage(".Add.New.Permission.")));
-        tw.addNewComponent(newTD, label, PD_DESC_LABEL,
-                           0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                           ToolWindow.TOP_BOTTOM_PADDING);
-
-        // permission choice (added in alphabetical order)
-        JComboBox<String> choice = new JComboBox<>();
-        choice.addItem(PERM);
-        choice.getAccessibleContext().setAccessibleName(PERM);
-        for (int i = 0; i < PERM_ARRAY.size(); i++) {
-            Perm next = PERM_ARRAY.get(i);
-            choice.addItem(next.CLASS);
-        }
-        tw.addNewComponent(newTD, choice, PD_PERM_CHOICE,
-                           0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                           ToolWindow.LR_BOTTOM_PADDING);
-
-        // permission textfield
-        JTextField tf;
-        tf = (edit ? new JTextField(editMe.permission, 30) : new JTextField(30));
-        tf.setPreferredSize(new Dimension(tf.getPreferredSize().width, TEXTFIELD_HEIGHT));
-        tf.getAccessibleContext().setAccessibleName(PERM);
-        if (edit) {
-            Perm inputPerm = getPerm(editMe.permission, true);
-            if (inputPerm != null) {
-                choice.setSelectedItem(inputPerm.CLASS);
-            }
-        }
-        tw.addNewComponent(newTD, tf, PD_PERM_TEXTFIELD,
-                           1, 1, 1, 1, 1.0, 0.0, GridBagConstraints.BOTH,
-                           ToolWindow.LR_BOTTOM_PADDING);
-        choice.addItemListener(new PermissionMenuListener(newTD));
-
-        // name label and textfield
-        choice = new JComboBox<>();
-        choice.addItem(PERM_NAME);
-        choice.getAccessibleContext().setAccessibleName(PERM_NAME);
-        tf = (edit ? new JTextField(editMe.name, 40) : new JTextField(40));
-        tf.setPreferredSize(new Dimension(tf.getPreferredSize().width, TEXTFIELD_HEIGHT));
-        tf.getAccessibleContext().setAccessibleName(PERM_NAME);
-        if (edit) {
-            setPermissionNames(getPerm(editMe.permission, true), choice, tf);
-        }
-        tw.addNewComponent(newTD, choice, PD_NAME_CHOICE,
-                           0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                           ToolWindow.LR_BOTTOM_PADDING);
-        tw.addNewComponent(newTD, tf, PD_NAME_TEXTFIELD,
-                           1, 2, 1, 1, 1.0, 0.0, GridBagConstraints.BOTH,
-                           ToolWindow.LR_BOTTOM_PADDING);
-        choice.addItemListener(new PermissionNameMenuListener(newTD));
-
-        // actions label and textfield
-        choice = new JComboBox<>();
-        choice.addItem(PERM_ACTIONS);
-        choice.getAccessibleContext().setAccessibleName(PERM_ACTIONS);
-        tf = (edit ? new JTextField(editMe.action, 40) : new JTextField(40));
-        tf.setPreferredSize(new Dimension(tf.getPreferredSize().width, TEXTFIELD_HEIGHT));
-        tf.getAccessibleContext().setAccessibleName(PERM_ACTIONS);
-        if (edit) {
-            setPermissionActions(getPerm(editMe.permission, true), choice, tf);
-        }
-        tw.addNewComponent(newTD, choice, PD_ACTIONS_CHOICE,
-                           0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                           ToolWindow.LR_BOTTOM_PADDING);
-        tw.addNewComponent(newTD, tf, PD_ACTIONS_TEXTFIELD,
-                           1, 3, 1, 1, 1.0, 0.0, GridBagConstraints.BOTH,
-                           ToolWindow.LR_BOTTOM_PADDING);
-        choice.addItemListener(new PermissionActionsMenuListener(newTD));
-
-        // signedby label and textfield
-        label = new JLabel(PolicyTool.getMessage("Signed.By."));
-        tw.addNewComponent(newTD, label, PD_SIGNEDBY_LABEL,
-                           0, 4, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                           ToolWindow.LR_BOTTOM_PADDING);
-        tf = (edit ? new JTextField(editMe.signedBy, 40) : new JTextField(40));
-        tf.setPreferredSize(new Dimension(tf.getPreferredSize().width, TEXTFIELD_HEIGHT));
-        tf.getAccessibleContext().setAccessibleName(
-                PolicyTool.getMessage("Signed.By."));
-        tw.addNewComponent(newTD, tf, PD_SIGNEDBY_TEXTFIELD,
-                           1, 4, 1, 1, 1.0, 0.0, GridBagConstraints.BOTH,
-                           ToolWindow.LR_BOTTOM_PADDING);
-
-        // OK button
-        JButton okButton = new JButton(PolicyTool.getMessage("OK"));
-        okButton.addActionListener(
-            new NewPolicyPermOKButtonListener
-                                    (tool, tw, this, newTD, edit));
-        tw.addNewComponent(newTD, okButton, PD_OK_BUTTON,
-                           0, 5, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL,
-                           ToolWindow.TOP_BOTTOM_PADDING);
-
-        // cancel button
-        JButton cancelButton = new JButton(PolicyTool.getMessage("Cancel"));
-        ActionListener cancelListener = new CancelButtonListener(newTD);
-        cancelButton.addActionListener(cancelListener);
-        tw.addNewComponent(newTD, cancelButton, PD_CANCEL_BUTTON,
-                           1, 5, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL,
-                           ToolWindow.TOP_BOTTOM_PADDING);
-
-        newTD.getRootPane().setDefaultButton(okButton);
-        newTD.getRootPane().registerKeyboardAction(cancelListener, escKey, JComponent.WHEN_IN_FOCUSED_WINDOW);
-
-        newTD.pack();
-        newTD.setLocationRelativeTo(tw);
-        newTD.setVisible(true);
-    }
-
-    /**
-     * construct a Principal object from the Principal Info Dialog Box
-     */
-    PolicyParser.PrincipalEntry getPrinFromDialog() throws Exception {
-
-        JTextField tf = (JTextField)getComponent(PRD_PRIN_TEXTFIELD);
-        String pclass = new String(tf.getText().trim());
-        tf = (JTextField)getComponent(PRD_NAME_TEXTFIELD);
-        String pname = new String(tf.getText().trim());
-        if (pclass.equals("*")) {
-            pclass = PolicyParser.PrincipalEntry.WILDCARD_CLASS;
-        }
-        if (pname.equals("*")) {
-            pname = PolicyParser.PrincipalEntry.WILDCARD_NAME;
-        }
-
-        PolicyParser.PrincipalEntry pppe = null;
-
-        if ((pclass.equals(PolicyParser.PrincipalEntry.WILDCARD_CLASS)) &&
-            (!pname.equals(PolicyParser.PrincipalEntry.WILDCARD_NAME))) {
-            throw new Exception
-                        (PolicyTool.getMessage("Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name"));
-        } else if (pname.equals("")) {
-            throw new Exception
-                        (PolicyTool.getMessage("Cannot.Specify.Principal.without.a.Name"));
-        } else if (pclass.equals("")) {
-            // make this consistent with what PolicyParser does
-            // when it sees an empty principal class
-            pclass = PolicyParser.PrincipalEntry.REPLACE_NAME;
-            tool.warnings.addElement(
-                        "Warning: Principal name '" + pname +
-                                "' specified without a Principal class.\n" +
-                        "\t'" + pname + "' will be interpreted " +
-                                "as a key store alias.\n" +
-                        "\tThe final principal class will be " +
-                                ToolDialog.X500_PRIN_CLASS + ".\n" +
-                        "\tThe final principal name will be " +
-                                "determined by the following:\n" +
-                        "\n" +
-                        "\tIf the key store entry identified by '"
-                                + pname + "'\n" +
-                        "\tis a key entry, then the principal name will be\n" +
-                        "\tthe subject distinguished name from the first\n" +
-                        "\tcertificate in the entry's certificate chain.\n" +
-                        "\n" +
-                        "\tIf the key store entry identified by '" +
-                                pname + "'\n" +
-                        "\tis a trusted certificate entry, then the\n" +
-                        "\tprincipal name will be the subject distinguished\n" +
-                        "\tname from the trusted public key certificate.");
-            tw.displayStatusDialog(this,
-                        "'" + pname + "' will be interpreted as a key " +
-                        "store alias.  View Warning Log for details.");
-        }
-        return new PolicyParser.PrincipalEntry(pclass, pname);
-    }
-
-
-    /**
-     * construct a Permission object from the Permission Info Dialog Box
-     */
-    PolicyParser.PermissionEntry getPermFromDialog() {
-
-        JTextField tf = (JTextField)getComponent(PD_PERM_TEXTFIELD);
-        String permission = new String(tf.getText().trim());
-        tf = (JTextField)getComponent(PD_NAME_TEXTFIELD);
-        String name = null;
-        if (tf.getText().trim().equals("") == false)
-            name = new String(tf.getText().trim());
-        if (permission.equals("") ||
-            (!permission.equals(ALL_PERM_CLASS) && name == null)) {
-            throw new InvalidParameterException(PolicyTool.getMessage
-                ("Permission.and.Target.Name.must.have.a.value"));
-        }
-
-        // When the permission is FilePermission, we need to check the name
-        // to make sure it's not escaped. We believe --
-        //
-        // String             name.lastIndexOf("\\\\")
-        // ----------------   ------------------------
-        // c:\foo\bar         -1, legal
-        // c:\\foo\\bar       2, illegal
-        // \\server\share     0, legal
-        // \\\\server\share   2, illegal
-
-        if (permission.equals(FILE_PERM_CLASS) && name.lastIndexOf("\\\\") > 0) {
-            char result = tw.displayYesNoDialog(this,
-                    PolicyTool.getMessage("Warning"),
-                    PolicyTool.getMessage(
-                        "Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes"),
-                    PolicyTool.getMessage("Retain"),
-                    PolicyTool.getMessage("Edit")
-                    );
-            if (result != 'Y') {
-                // an invisible exception
-                throw new NoDisplayException();
-            }
-        }
-        // get the Actions
-        tf = (JTextField)getComponent(PD_ACTIONS_TEXTFIELD);
-        String actions = null;
-        if (tf.getText().trim().equals("") == false)
-            actions = new String(tf.getText().trim());
-
-        // get the Signed By
-        tf = (JTextField)getComponent(PD_SIGNEDBY_TEXTFIELD);
-        String signedBy = null;
-        if (tf.getText().trim().equals("") == false)
-            signedBy = new String(tf.getText().trim());
-
-        PolicyParser.PermissionEntry pppe = new PolicyParser.PermissionEntry
-                                (permission, name, actions);
-        pppe.signedBy = signedBy;
-
-        // see if the signers have public keys
-        if (signedBy != null) {
-                String signers[] = tool.parseSigners(pppe.signedBy);
-                for (int i = 0; i < signers.length; i++) {
-                try {
-                    PublicKey pubKey = tool.getPublicKeyAlias(signers[i]);
-                    if (pubKey == null) {
-                        MessageFormat form = new MessageFormat
-                            (PolicyTool.getMessage
-                            ("Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured."));
-                        Object[] source = {signers[i]};
-                        tool.warnings.addElement(form.format(source));
-                        tw.displayStatusDialog(this, form.format(source));
-                    }
-                } catch (Exception e) {
-                    tw.displayErrorDialog(this, e);
-                }
-            }
-        }
-        return pppe;
-    }
-
-    /**
-     * confirm that the user REALLY wants to remove the Policy Entry
-     */
-    void displayConfirmRemovePolicyEntry() {
-
-        // find the entry to be removed
-        @SuppressWarnings("unchecked")
-        JList<String> list = (JList<String>)tw.getComponent(ToolWindow.MW_POLICY_LIST);
-        int index = list.getSelectedIndex();
-        PolicyEntry entries[] = tool.getEntry();
-
-        // find where the PolicyTool gui is
-        Point location = tw.getLocationOnScreen();
-        //setBounds(location.x + 25, location.y + 100, 600, 400);
-        setLayout(new GridBagLayout());
-
-        // ask the user do they really want to do this?
-        JLabel label = new JLabel
-                (PolicyTool.getMessage("Remove.this.Policy.Entry."));
-        tw.addNewComponent(this, label, CRPE_LABEL1,
-                           0, 0, 2, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                           ToolWindow.BOTTOM_PADDING);
-
-        // display the policy entry
-        label = new JLabel(entries[index].codebaseToString());
-        tw.addNewComponent(this, label, CRPE_LABEL2,
-                        0, 1, 2, 1, 0.0, 0.0, GridBagConstraints.BOTH);
-        label = new JLabel(entries[index].principalsToString().trim());
-        tw.addNewComponent(this, label, CRPE_LABEL2+1,
-                        0, 2, 2, 1, 0.0, 0.0, GridBagConstraints.BOTH);
-        Vector<PolicyParser.PermissionEntry> perms =
-                        entries[index].getGrantEntry().permissionEntries;
-        for (int i = 0; i < perms.size(); i++) {
-            PolicyParser.PermissionEntry nextPerm = perms.elementAt(i);
-            String permString = ToolDialog.PermissionEntryToUserFriendlyString(nextPerm);
-            label = new JLabel("    " + permString);
-            if (i == (perms.size()-1)) {
-                tw.addNewComponent(this, label, CRPE_LABEL2 + 2 + i,
-                                 1, 3 + i, 1, 1, 0.0, 0.0,
-                                 GridBagConstraints.BOTH,
-                                 ToolWindow.BOTTOM_PADDING);
-            } else {
-                tw.addNewComponent(this, label, CRPE_LABEL2 + 2 + i,
-                                 1, 3 + i, 1, 1, 0.0, 0.0,
-                                 GridBagConstraints.BOTH);
-            }
-        }
-
-
-        // add OK/CANCEL buttons in a new panel
-        JPanel panel = new JPanel();
-        panel.setLayout(new GridBagLayout());
-
-        // OK button
-        JButton okButton = new JButton(PolicyTool.getMessage("OK"));
-        okButton.addActionListener
-                (new ConfirmRemovePolicyEntryOKButtonListener(tool, tw, this));
-        tw.addNewComponent(panel, okButton, CRPE_PANEL_OK,
-                           0, 0, 1, 1, 0.0, 0.0,
-                           GridBagConstraints.VERTICAL, ToolWindow.LR_PADDING);
-
-        // cancel button
-        JButton cancelButton = new JButton(PolicyTool.getMessage("Cancel"));
-        ActionListener cancelListener = new CancelButtonListener(this);
-        cancelButton.addActionListener(cancelListener);
-        tw.addNewComponent(panel, cancelButton, CRPE_PANEL_CANCEL,
-                           1, 0, 1, 1, 0.0, 0.0,
-                           GridBagConstraints.VERTICAL, ToolWindow.LR_PADDING);
-
-        tw.addNewComponent(this, panel, CRPE_LABEL2 + 2 + perms.size(),
-                           0, 3 + perms.size(), 2, 1, 0.0, 0.0,
-                           GridBagConstraints.VERTICAL, ToolWindow.TOP_BOTTOM_PADDING);
-
-        getRootPane().setDefaultButton(okButton);
-        getRootPane().registerKeyboardAction(cancelListener, escKey, JComponent.WHEN_IN_FOCUSED_WINDOW);
-
-        pack();
-        setLocationRelativeTo(tw);
-        setVisible(true);
-    }
-
-    /**
-     * perform SAVE AS
-     */
-    void displaySaveAsDialog(int nextEvent) {
-
-        // pop up a dialog box for the user to enter a filename.
-        FileDialog fd = new FileDialog
-                (tw, PolicyTool.getMessage("Save.As"), FileDialog.SAVE);
-        fd.addWindowListener(new WindowAdapter() {
-            public void windowClosing(WindowEvent e) {
-                e.getWindow().setVisible(false);
-            }
-        });
-        fd.setVisible(true);
-
-        // see if the user hit cancel
-        if (fd.getFile() == null ||
-            fd.getFile().equals(""))
-            return;
-
-        // get the entered filename
-        File saveAsFile = new File(fd.getDirectory(), fd.getFile());
-        String filename = saveAsFile.getPath();
-        fd.dispose();
-
-        try {
-            // save the policy entries to a file
-            tool.savePolicy(filename);
-
-            // display status
-            MessageFormat form = new MessageFormat(PolicyTool.getMessage
-                    ("Policy.successfully.written.to.filename"));
-            Object[] source = {filename};
-            tw.displayStatusDialog(null, form.format(source));
-
-            // display the new policy filename
-            JTextField newFilename = (JTextField)tw.getComponent
-                            (ToolWindow.MW_FILENAME_TEXTFIELD);
-            newFilename.setText(filename);
-            tw.setVisible(true);
-
-            // now continue with the originally requested command
-            // (QUIT, NEW, or OPEN)
-            userSaveContinue(tool, tw, this, nextEvent);
-
-        } catch (FileNotFoundException fnfe) {
-            if (filename == null || filename.equals("")) {
-                tw.displayErrorDialog(null, new FileNotFoundException
-                            (PolicyTool.getMessage("null.filename")));
-            } else {
-                tw.displayErrorDialog(null, fnfe);
-            }
-        } catch (Exception ee) {
-            tw.displayErrorDialog(null, ee);
-        }
-    }
-
-    /**
-     * ask user if they want to save changes
-     */
-    void displayUserSave(int select) {
-
-        if (tool.modified == true) {
-
-            // find where the PolicyTool gui is
-            Point location = tw.getLocationOnScreen();
-            //setBounds(location.x + 75, location.y + 100, 400, 150);
-            setLayout(new GridBagLayout());
-
-            JLabel label = new JLabel
-                (PolicyTool.getMessage("Save.changes."));
-            tw.addNewComponent(this, label, USC_LABEL,
-                               0, 0, 3, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                               ToolWindow.L_TOP_BOTTOM_PADDING);
-
-            JPanel panel = new JPanel();
-            panel.setLayout(new GridBagLayout());
-
-            JButton yesButton = new JButton();
-            ToolWindow.configureButton(yesButton, "Yes");
-            yesButton.addActionListener
-                        (new UserSaveYesButtonListener(this, tool, tw, select));
-            tw.addNewComponent(panel, yesButton, USC_YES_BUTTON,
-                               0, 0, 1, 1, 0.0, 0.0,
-                               GridBagConstraints.VERTICAL,
-                               ToolWindow.LR_BOTTOM_PADDING);
-            JButton noButton = new JButton();
-            ToolWindow.configureButton(noButton, "No");
-            noButton.addActionListener
-                        (new UserSaveNoButtonListener(this, tool, tw, select));
-            tw.addNewComponent(panel, noButton, USC_NO_BUTTON,
-                               1, 0, 1, 1, 0.0, 0.0,
-                               GridBagConstraints.VERTICAL,
-                               ToolWindow.LR_BOTTOM_PADDING);
-            JButton cancelButton = new JButton();
-            ToolWindow.configureButton(cancelButton, "Cancel");
-            ActionListener cancelListener = new CancelButtonListener(this);
-            cancelButton.addActionListener(cancelListener);
-            tw.addNewComponent(panel, cancelButton, USC_CANCEL_BUTTON,
-                               2, 0, 1, 1, 0.0, 0.0,
-                               GridBagConstraints.VERTICAL,
-                               ToolWindow.LR_BOTTOM_PADDING);
-
-            tw.addNewComponent(this, panel, USC_PANEL,
-                               0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH);
-
-            getRootPane().registerKeyboardAction(cancelListener, escKey, JComponent.WHEN_IN_FOCUSED_WINDOW);
-
-            pack();
-            setLocationRelativeTo(tw);
-            setVisible(true);
-        } else {
-            // just do the original request (QUIT, NEW, or OPEN)
-            userSaveContinue(tool, tw, this, select);
-        }
-    }
-
-    /**
-     * when the user sees the 'YES', 'NO', 'CANCEL' buttons on the
-     * displayUserSave dialog, and the click on one of them,
-     * we need to continue the originally requested action
-     * (either QUITting, opening NEW policy file, or OPENing an existing
-     * policy file.  do that now.
-     */
-    @SuppressWarnings("fallthrough")
-    void userSaveContinue(PolicyTool tool, ToolWindow tw,
-                        ToolDialog us, int select) {
-
-        // now either QUIT, open a NEW policy file, or OPEN an existing policy
-        switch(select) {
-        case ToolDialog.QUIT:
-
-            tw.setVisible(false);
-            tw.dispose();
-            System.exit(0);
-
-        case ToolDialog.NEW:
-
-            try {
-                tool.openPolicy(null);
-            } catch (Exception ee) {
-                tool.modified = false;
-                tw.displayErrorDialog(null, ee);
-            }
-
-            // display the policy entries via the policy list textarea
-            JList<String> list = new JList<>(new DefaultListModel<>());
-            list.setVisibleRowCount(15);
-            list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
-            list.addMouseListener(new PolicyListListener(tool, tw));
-            tw.replacePolicyList(list);
-
-            // display null policy filename and keystore
-            JTextField newFilename = (JTextField)tw.getComponent(
-                    ToolWindow.MW_FILENAME_TEXTFIELD);
-            newFilename.setText("");
-            tw.setVisible(true);
-            break;
-
-        case ToolDialog.OPEN:
-
-            // pop up a dialog box for the user to enter a filename.
-            FileDialog fd = new FileDialog
-                (tw, PolicyTool.getMessage("Open"), FileDialog.LOAD);
-            fd.addWindowListener(new WindowAdapter() {
-                public void windowClosing(WindowEvent e) {
-                    e.getWindow().setVisible(false);
-                }
-            });
-            fd.setVisible(true);
-
-            // see if the user hit 'cancel'
-            if (fd.getFile() == null ||
-                fd.getFile().equals(""))
-                return;
-
-            // get the entered filename
-            String policyFile = new File(fd.getDirectory(), fd.getFile()).getPath();
-
-            try {
-                // open the policy file
-                tool.openPolicy(policyFile);
-
-                // display the policy entries via the policy list textarea
-                DefaultListModel<String> listModel = new DefaultListModel<>();
-                list = new JList<>(listModel);
-                list.setVisibleRowCount(15);
-                list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
-                list.addMouseListener(new PolicyListListener(tool, tw));
-                PolicyEntry entries[] = tool.getEntry();
-                if (entries != null) {
-                    for (int i = 0; i < entries.length; i++) {
-                        listModel.addElement(entries[i].headerToString());
-                    }
-                }
-                tw.replacePolicyList(list);
-                tool.modified = false;
-
-                // display the new policy filename
-                newFilename = (JTextField)tw.getComponent(
-                        ToolWindow.MW_FILENAME_TEXTFIELD);
-                newFilename.setText(policyFile);
-                tw.setVisible(true);
-
-                // inform user of warnings
-                if (tool.newWarning == true) {
-                    tw.displayStatusDialog(null, PolicyTool.getMessage
-                        ("Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information."));
-                }
-
-            } catch (Exception e) {
-                // add blank policy listing
-                list = new JList<>(new DefaultListModel<>());
-                list.setVisibleRowCount(15);
-                list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
-                list.addMouseListener(new PolicyListListener(tool, tw));
-                tw.replacePolicyList(list);
-                tool.setPolicyFileName(null);
-                tool.modified = false;
-
-                // display a null policy filename
-                newFilename = (JTextField)tw.getComponent(
-                        ToolWindow.MW_FILENAME_TEXTFIELD);
-                newFilename.setText("");
-                tw.setVisible(true);
-
-                // display the error
-                MessageFormat form = new MessageFormat(PolicyTool.getMessage
-                    ("Could.not.open.policy.file.policyFile.e.toString."));
-                Object[] source = {policyFile, e.toString()};
-                tw.displayErrorDialog(null, form.format(source));
-            }
-            break;
-        }
-    }
-
-    /**
-     * Return a Menu list of names for a given permission
-     *
-     * If inputPerm's TARGETS are null, then this means TARGETS are
-     * not allowed to be entered (and the TextField is set to be
-     * non-editable).
-     *
-     * If TARGETS are valid but there are no standard ones
-     * (user must enter them by hand) then the TARGETS array may be empty
-     * (and of course non-null).
-     */
-    void setPermissionNames(Perm inputPerm, JComboBox<String> names, JTextField field) {
-        names.removeAllItems();
-        names.addItem(PERM_NAME);
-
-        if (inputPerm == null) {
-            // custom permission
-            field.setEditable(true);
-        } else if (inputPerm.TARGETS == null) {
-            // standard permission with no targets
-            field.setEditable(false);
-        } else {
-            // standard permission with standard targets
-            field.setEditable(true);
-            for (int i = 0; i < inputPerm.TARGETS.length; i++) {
-                names.addItem(inputPerm.TARGETS[i]);
-            }
-        }
-    }
-
-    /**
-     * Return a Menu list of actions for a given permission
-     *
-     * If inputPerm's ACTIONS are null, then this means ACTIONS are
-     * not allowed to be entered (and the TextField is set to be
-     * non-editable).  This is typically true for BasicPermissions.
-     *
-     * If ACTIONS are valid but there are no standard ones
-     * (user must enter them by hand) then the ACTIONS array may be empty
-     * (and of course non-null).
-     */
-    void setPermissionActions(Perm inputPerm, JComboBox<String> actions, JTextField field) {
-        actions.removeAllItems();
-        actions.addItem(PERM_ACTIONS);
-
-        if (inputPerm == null) {
-            // custom permission
-            field.setEditable(true);
-        } else if (inputPerm.ACTIONS == null) {
-            // standard permission with no actions
-            field.setEditable(false);
-        } else {
-            // standard permission with standard actions
-            field.setEditable(true);
-            for (int i = 0; i < inputPerm.ACTIONS.length; i++) {
-                actions.addItem(inputPerm.ACTIONS[i]);
-            }
-        }
-    }
-
-    static String PermissionEntryToUserFriendlyString(PolicyParser.PermissionEntry pppe) {
-        String result = pppe.permission;
-        if (pppe.name != null) {
-            result += " " + pppe.name;
-        }
-        if (pppe.action != null) {
-            result += ", \"" + pppe.action + "\"";
-        }
-        if (pppe.signedBy != null) {
-            result += ", signedBy " + pppe.signedBy;
-        }
-        return result;
-    }
-
-    static String PrincipalEntryToUserFriendlyString(PolicyParser.PrincipalEntry pppe) {
-        StringWriter sw = new StringWriter();
-        PrintWriter pw = new PrintWriter(sw);
-        pppe.write(pw);
-        return sw.toString();
-    }
-}
-
-/**
- * Event handler for the PolicyTool window
- */
-class ToolWindowListener implements WindowListener {
-
-    private PolicyTool tool;
-    private ToolWindow tw;
-
-    ToolWindowListener(PolicyTool tool, ToolWindow tw) {
-        this.tool = tool;
-        this.tw = tw;
-    }
-
-    public void windowOpened(WindowEvent we) {
-    }
-
-    public void windowClosing(WindowEvent we) {
-        // Closing the window acts the same as choosing Menu->Exit.
-
-        // ask user if they want to save changes
-        ToolDialog td = new ToolDialog(PolicyTool.getMessage("Save.Changes"), tool, tw, true);
-        td.displayUserSave(ToolDialog.QUIT);
-
-        // the above method will perform the QUIT as long as the
-        // user does not CANCEL the request
-    }
-
-    public void windowClosed(WindowEvent we) {
-        System.exit(0);
-    }
-
-    public void windowIconified(WindowEvent we) {
-    }
-
-    public void windowDeiconified(WindowEvent we) {
-    }
-
-    public void windowActivated(WindowEvent we) {
-    }
-
-    public void windowDeactivated(WindowEvent we) {
-    }
-}
-
-/**
- * Event handler for the Policy List
- */
-class PolicyListListener extends MouseAdapter implements ActionListener {
-
-    private PolicyTool tool;
-    private ToolWindow tw;
-
-    PolicyListListener(PolicyTool tool, ToolWindow tw) {
-        this.tool = tool;
-        this.tw = tw;
-
-    }
-
-    public void actionPerformed(ActionEvent e) {
-
-        // display the permission list for a policy entry
-        ToolDialog td = new ToolDialog
-                (PolicyTool.getMessage("Policy.Entry"), tool, tw, true);
-        td.displayPolicyEntryDialog(true);
-    }
-
-    public void mouseClicked(MouseEvent evt) {
-        if (evt.getClickCount() == 2) {
-            actionPerformed(null);
-        }
-    }
-}
-
-/**
- * Event handler for the File Menu
- */
-class FileMenuListener implements ActionListener {
-
-    private PolicyTool tool;
-    private ToolWindow tw;
-
-    FileMenuListener(PolicyTool tool, ToolWindow tw) {
-        this.tool = tool;
-        this.tw = tw;
-    }
-
-    public void actionPerformed(ActionEvent e) {
-
-        if (PolicyTool.collator.compare(e.getActionCommand(),
-                                       ToolWindow.QUIT) == 0) {
-
-            // ask user if they want to save changes
-            ToolDialog td = new ToolDialog
-                (PolicyTool.getMessage("Save.Changes"), tool, tw, true);
-            td.displayUserSave(ToolDialog.QUIT);
-
-            // the above method will perform the QUIT as long as the
-            // user does not CANCEL the request
-
-        } else if (PolicyTool.collator.compare(e.getActionCommand(),
-                                   ToolWindow.NEW_POLICY_FILE) == 0) {
-
-            // ask user if they want to save changes
-            ToolDialog td = new ToolDialog
-                (PolicyTool.getMessage("Save.Changes"), tool, tw, true);
-            td.displayUserSave(ToolDialog.NEW);
-
-            // the above method will perform the NEW as long as the
-            // user does not CANCEL the request
-
-        } else if (PolicyTool.collator.compare(e.getActionCommand(),
-                                  ToolWindow.OPEN_POLICY_FILE) == 0) {
-
-            // ask user if they want to save changes
-            ToolDialog td = new ToolDialog
-                (PolicyTool.getMessage("Save.Changes"), tool, tw, true);
-            td.displayUserSave(ToolDialog.OPEN);
-
-            // the above method will perform the OPEN as long as the
-            // user does not CANCEL the request
-
-        } else if (PolicyTool.collator.compare(e.getActionCommand(),
-                                  ToolWindow.SAVE_POLICY_FILE) == 0) {
-
-            // get the previously entered filename
-            String filename = ((JTextField)tw.getComponent(
-                    ToolWindow.MW_FILENAME_TEXTFIELD)).getText();
-
-            // if there is no filename, do a SAVE_AS
-            if (filename == null || filename.length() == 0) {
-                // user wants to SAVE AS
-                ToolDialog td = new ToolDialog
-                        (PolicyTool.getMessage("Save.As"), tool, tw, true);
-                td.displaySaveAsDialog(ToolDialog.NOACTION);
-            } else {
-                try {
-                    // save the policy entries to a file
-                    tool.savePolicy(filename);
-
-                    // display status
-                    MessageFormat form = new MessageFormat
-                        (PolicyTool.getMessage
-                        ("Policy.successfully.written.to.filename"));
-                    Object[] source = {filename};
-                    tw.displayStatusDialog(null, form.format(source));
-                } catch (FileNotFoundException fnfe) {
-                    if (filename == null || filename.equals("")) {
-                        tw.displayErrorDialog(null, new FileNotFoundException
-                                (PolicyTool.getMessage("null.filename")));
-                    } else {
-                        tw.displayErrorDialog(null, fnfe);
-                    }
-                } catch (Exception ee) {
-                    tw.displayErrorDialog(null, ee);
-                }
-            }
-        } else if (PolicyTool.collator.compare(e.getActionCommand(),
-                               ToolWindow.SAVE_AS_POLICY_FILE) == 0) {
-
-            // user wants to SAVE AS
-            ToolDialog td = new ToolDialog
-                (PolicyTool.getMessage("Save.As"), tool, tw, true);
-            td.displaySaveAsDialog(ToolDialog.NOACTION);
-
-        } else if (PolicyTool.collator.compare(e.getActionCommand(),
-                                     ToolWindow.VIEW_WARNINGS) == 0) {
-            tw.displayWarningLog(null);
-        }
-    }
-}
-
-/**
- * Event handler for the main window buttons and Edit Menu
- */
-class MainWindowListener implements ActionListener {
-
-    private PolicyTool tool;
-    private ToolWindow tw;
-
-    MainWindowListener(PolicyTool tool, ToolWindow tw) {
-        this.tool = tool;
-        this.tw = tw;
-    }
-
-    public void actionPerformed(ActionEvent e) {
-
-        if (PolicyTool.collator.compare(e.getActionCommand(),
-                           ToolWindow.ADD_POLICY_ENTRY) == 0) {
-
-            // display a dialog box for the user to enter policy info
-            ToolDialog td = new ToolDialog
-                (PolicyTool.getMessage("Policy.Entry"), tool, tw, true);
-            td.displayPolicyEntryDialog(false);
-
-        } else if (PolicyTool.collator.compare(e.getActionCommand(),
-                               ToolWindow.REMOVE_POLICY_ENTRY) == 0) {
-
-            // get the selected entry
-            @SuppressWarnings("unchecked")
-            JList<String> list = (JList<String>)tw.getComponent(ToolWindow.MW_POLICY_LIST);
-            int index = list.getSelectedIndex();
-            if (index < 0) {
-                tw.displayErrorDialog(null, new Exception
-                        (PolicyTool.getMessage("No.Policy.Entry.selected")));
-                return;
-            }
-
-            // ask the user if they really want to remove the policy entry
-            ToolDialog td = new ToolDialog(PolicyTool.getMessage
-                ("Remove.Policy.Entry"), tool, tw, true);
-            td.displayConfirmRemovePolicyEntry();
-
-        } else if (PolicyTool.collator.compare(e.getActionCommand(),
-                                 ToolWindow.EDIT_POLICY_ENTRY) == 0) {
-
-            // get the selected entry
-            @SuppressWarnings("unchecked")
-            JList<String> list = (JList<String>)tw.getComponent(ToolWindow.MW_POLICY_LIST);
-            int index = list.getSelectedIndex();
-            if (index < 0) {
-                tw.displayErrorDialog(null, new Exception
-                        (PolicyTool.getMessage("No.Policy.Entry.selected")));
-                return;
-            }
-
-            // display the permission list for a policy entry
-            ToolDialog td = new ToolDialog
-                (PolicyTool.getMessage("Policy.Entry"), tool, tw, true);
-            td.displayPolicyEntryDialog(true);
-
-        } else if (PolicyTool.collator.compare(e.getActionCommand(),
-                                     ToolWindow.EDIT_KEYSTORE) == 0) {
-
-            // display a dialog box for the user to enter keystore info
-            ToolDialog td = new ToolDialog
-                (PolicyTool.getMessage("KeyStore"), tool, tw, true);
-            td.keyStoreDialog(ToolDialog.EDIT_KEYSTORE);
-        }
-    }
-}
-
-/**
- * Event handler for AddEntryDoneButton button
- *
- * -- if edit is TRUE, then we are EDITing an existing PolicyEntry
- *    and we need to update both the policy and the GUI listing.
- *    if edit is FALSE, then we are ADDing a new PolicyEntry,
- *    so we only need to update the GUI listing.
- */
-class AddEntryDoneButtonListener implements ActionListener {
-
-    private PolicyTool tool;
-    private ToolWindow tw;
-    private ToolDialog td;
-    private boolean edit;
-
-    AddEntryDoneButtonListener(PolicyTool tool, ToolWindow tw,
-                                ToolDialog td, boolean edit) {
-        this.tool = tool;
-        this.tw = tw;
-        this.td = td;
-        this.edit = edit;
-    }
-
-    public void actionPerformed(ActionEvent e) {
-
-        try {
-            // get a PolicyEntry object from the dialog policy info
-            PolicyEntry newEntry = td.getPolicyEntryFromDialog();
-            PolicyParser.GrantEntry newGe = newEntry.getGrantEntry();
-
-            // see if all the signers have public keys
-            if (newGe.signedBy != null) {
-                String signers[] = tool.parseSigners(newGe.signedBy);
-                for (int i = 0; i < signers.length; i++) {
-                    PublicKey pubKey = tool.getPublicKeyAlias(signers[i]);
-                    if (pubKey == null) {
-                        MessageFormat form = new MessageFormat
-                            (PolicyTool.getMessage
-                            ("Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured."));
-                        Object[] source = {signers[i]};
-                        tool.warnings.addElement(form.format(source));
-                        tw.displayStatusDialog(td, form.format(source));
-                    }
-                }
-            }
-
-            // add the entry
-            @SuppressWarnings("unchecked")
-            JList<String> policyList = (JList<String>)tw.getComponent(ToolWindow.MW_POLICY_LIST);
-            if (edit) {
-                int listIndex = policyList.getSelectedIndex();
-                tool.addEntry(newEntry, listIndex);
-                String newCodeBaseStr = newEntry.headerToString();
-                if (PolicyTool.collator.compare
-                        (newCodeBaseStr, policyList.getModel().getElementAt(listIndex)) != 0)
-                    tool.modified = true;
-                ((DefaultListModel<String>)policyList.getModel()).set(listIndex, newCodeBaseStr);
-            } else {
-                tool.addEntry(newEntry, -1);
-                ((DefaultListModel<String>)policyList.getModel()).addElement(newEntry.headerToString());
-                tool.modified = true;
-            }
-            td.setVisible(false);
-            td.dispose();
-
-        } catch (Exception eee) {
-            tw.displayErrorDialog(td, eee);
-        }
-    }
-}
-
-/**
- * Event handler for ChangeKeyStoreOKButton button
- */
-class ChangeKeyStoreOKButtonListener implements ActionListener {
-
-    private PolicyTool tool;
-    private ToolWindow tw;
-    private ToolDialog td;
-
-    ChangeKeyStoreOKButtonListener(PolicyTool tool, ToolWindow tw,
-                ToolDialog td) {
-        this.tool = tool;
-        this.tw = tw;
-        this.td = td;
-    }
-
-    public void actionPerformed(ActionEvent e) {
-
-        String URLString = ((JTextField)td.getComponent(
-                ToolDialog.KSD_NAME_TEXTFIELD)).getText().trim();
-        String type = ((JTextField)td.getComponent(
-                ToolDialog.KSD_TYPE_TEXTFIELD)).getText().trim();
-        String provider = ((JTextField)td.getComponent(
-                ToolDialog.KSD_PROVIDER_TEXTFIELD)).getText().trim();
-        String pwdURL = ((JTextField)td.getComponent(
-                ToolDialog.KSD_PWD_URL_TEXTFIELD)).getText().trim();
-
-        try {
-            tool.openKeyStore
-                        ((URLString.length() == 0 ? null : URLString),
-                        (type.length() == 0 ? null : type),
-                        (provider.length() == 0 ? null : provider),
-                        (pwdURL.length() == 0 ? null : pwdURL));
-            tool.modified = true;
-        } catch (Exception ex) {
-            MessageFormat form = new MessageFormat(PolicyTool.getMessage
-                ("Unable.to.open.KeyStore.ex.toString."));
-            Object[] source = {ex.toString()};
-            tw.displayErrorDialog(td, form.format(source));
-            return;
-        }
-
-        td.dispose();
-    }
-}
-
-/**
- * Event handler for AddPrinButton button
- */
-class AddPrinButtonListener implements ActionListener {
-
-    private PolicyTool tool;
-    private ToolWindow tw;
-    private ToolDialog td;
-    private boolean editPolicyEntry;
-
-    AddPrinButtonListener(PolicyTool tool, ToolWindow tw,
-                                ToolDialog td, boolean editPolicyEntry) {
-        this.tool = tool;
-        this.tw = tw;
-        this.td = td;
-        this.editPolicyEntry = editPolicyEntry;
-    }
-
-    public void actionPerformed(ActionEvent e) {
-
-        // display a dialog box for the user to enter principal info
-        td.displayPrincipalDialog(editPolicyEntry, false);
-    }
-}
-
-/**
- * Event handler for AddPermButton button
- */
-class AddPermButtonListener implements ActionListener {
-
-    private PolicyTool tool;
-    private ToolWindow tw;
-    private ToolDialog td;
-    private boolean editPolicyEntry;
-
-    AddPermButtonListener(PolicyTool tool, ToolWindow tw,
-                                ToolDialog td, boolean editPolicyEntry) {
-        this.tool = tool;
-        this.tw = tw;
-        this.td = td;
-        this.editPolicyEntry = editPolicyEntry;
-    }
-
-    public void actionPerformed(ActionEvent e) {
-
-        // display a dialog box for the user to enter permission info
-        td.displayPermissionDialog(editPolicyEntry, false);
-    }
-}
-
-/**
- * Event handler for AddPrinOKButton button
- */
-class NewPolicyPrinOKButtonListener implements ActionListener {
-
-    private PolicyTool tool;
-    private ToolWindow tw;
-    private ToolDialog listDialog;
-    private ToolDialog infoDialog;
-    private boolean edit;
-
-    NewPolicyPrinOKButtonListener(PolicyTool tool,
-                                ToolWindow tw,
-                                ToolDialog listDialog,
-                                ToolDialog infoDialog,
-                                boolean edit) {
-        this.tool = tool;
-        this.tw = tw;
-        this.listDialog = listDialog;
-        this.infoDialog = infoDialog;
-        this.edit = edit;
-    }
-
-    public void actionPerformed(ActionEvent e) {
-
-        try {
-            // read in the new principal info from Dialog Box
-            PolicyParser.PrincipalEntry pppe =
-                        infoDialog.getPrinFromDialog();
-            if (pppe != null) {
-                try {
-                    tool.verifyPrincipal(pppe.getPrincipalClass(),
-                                        pppe.getPrincipalName());
-                } catch (ClassNotFoundException cnfe) {
-                    MessageFormat form = new MessageFormat
-                                (PolicyTool.getMessage
-                                ("Warning.Class.not.found.class"));
-                    Object[] source = {pppe.getPrincipalClass()};
-                    tool.warnings.addElement(form.format(source));
-                    tw.displayStatusDialog(infoDialog, form.format(source));
-                }
-
-                // add the principal to the GUI principal list
-                TaggedList prinList =
-                    (TaggedList)listDialog.getComponent(ToolDialog.PE_PRIN_LIST);
-
-                String prinString = ToolDialog.PrincipalEntryToUserFriendlyString(pppe);
-                if (edit) {
-                    // if editing, replace the original principal
-                    int index = prinList.getSelectedIndex();
-                    prinList.replaceTaggedItem(prinString, pppe, index);
-                } else {
-                    // if adding, just add it to the end
-                    prinList.addTaggedItem(prinString, pppe);
-                }
-            }
-            infoDialog.dispose();
-        } catch (Exception ee) {
-            tw.displayErrorDialog(infoDialog, ee);
-        }
-    }
-}
-
-/**
- * Event handler for AddPermOKButton button
- */
-class NewPolicyPermOKButtonListener implements ActionListener {
-
-    private PolicyTool tool;
-    private ToolWindow tw;
-    private ToolDialog listDialog;
-    private ToolDialog infoDialog;
-    private boolean edit;
-
-    NewPolicyPermOKButtonListener(PolicyTool tool,
-                                ToolWindow tw,
-                                ToolDialog listDialog,
-                                ToolDialog infoDialog,
-                                boolean edit) {
-        this.tool = tool;
-        this.tw = tw;
-        this.listDialog = listDialog;
-        this.infoDialog = infoDialog;
-        this.edit = edit;
-    }
-
-    public void actionPerformed(ActionEvent e) {
-
-        try {
-            // read in the new permission info from Dialog Box
-            PolicyParser.PermissionEntry pppe =
-                        infoDialog.getPermFromDialog();
-
-            try {
-                tool.verifyPermission(pppe.permission, pppe.name, pppe.action);
-            } catch (ClassNotFoundException cnfe) {
-                MessageFormat form = new MessageFormat(PolicyTool.getMessage
-                                ("Warning.Class.not.found.class"));
-                Object[] source = {pppe.permission};
-                tool.warnings.addElement(form.format(source));
-                tw.displayStatusDialog(infoDialog, form.format(source));
-            }
-
-            // add the permission to the GUI permission list
-            TaggedList permList =
-                (TaggedList)listDialog.getComponent(ToolDialog.PE_PERM_LIST);
-
-            String permString = ToolDialog.PermissionEntryToUserFriendlyString(pppe);
-            if (edit) {
-                // if editing, replace the original permission
-                int which = permList.getSelectedIndex();
-                permList.replaceTaggedItem(permString, pppe, which);
-            } else {
-                // if adding, just add it to the end
-                permList.addTaggedItem(permString, pppe);
-            }
-            infoDialog.dispose();
-
-        } catch (InvocationTargetException ite) {
-            tw.displayErrorDialog(infoDialog, ite.getTargetException());
-        } catch (Exception ee) {
-            tw.displayErrorDialog(infoDialog, ee);
-        }
-    }
-}
-
-/**
- * Event handler for RemovePrinButton button
- */
-class RemovePrinButtonListener implements ActionListener {
-
-    private PolicyTool tool;
-    private ToolWindow tw;
-    private ToolDialog td;
-    private boolean edit;
-
-    RemovePrinButtonListener(PolicyTool tool, ToolWindow tw,
-                                ToolDialog td, boolean edit) {
-        this.tool = tool;
-        this.tw = tw;
-        this.td = td;
-        this.edit = edit;
-    }
-
-    public void actionPerformed(ActionEvent e) {
-
-        // get the Principal selected from the Principal List
-        TaggedList prinList = (TaggedList)td.getComponent(
-                ToolDialog.PE_PRIN_LIST);
-        int prinIndex = prinList.getSelectedIndex();
-
-        if (prinIndex < 0) {
-            tw.displayErrorDialog(td, new Exception
-                (PolicyTool.getMessage("No.principal.selected")));
-            return;
-        }
-        // remove the principal from the display
-        prinList.removeTaggedItem(prinIndex);
-    }
-}
-
-/**
- * Event handler for RemovePermButton button
- */
-class RemovePermButtonListener implements ActionListener {
-
-    private PolicyTool tool;
-    private ToolWindow tw;
-    private ToolDialog td;
-    private boolean edit;
-
-    RemovePermButtonListener(PolicyTool tool, ToolWindow tw,
-                                ToolDialog td, boolean edit) {
-        this.tool = tool;
-        this.tw = tw;
-        this.td = td;
-        this.edit = edit;
-    }
-
-    public void actionPerformed(ActionEvent e) {
-
-        // get the Permission selected from the Permission List
-        TaggedList permList = (TaggedList)td.getComponent(
-                ToolDialog.PE_PERM_LIST);
-        int permIndex = permList.getSelectedIndex();
-
-        if (permIndex < 0) {
-            tw.displayErrorDialog(td, new Exception
-                (PolicyTool.getMessage("No.permission.selected")));
-            return;
-        }
-        // remove the permission from the display
-        permList.removeTaggedItem(permIndex);
-
-    }
-}
-
-/**
- * Event handler for Edit Principal button
- *
- * We need the editPolicyEntry boolean to tell us if the user is
- * adding a new PolicyEntry at this time, or editing an existing entry.
- * If the user is adding a new PolicyEntry, we ONLY update the
- * GUI listing.  If the user is editing an existing PolicyEntry, we
- * update both the GUI listing and the actual PolicyEntry.
- */
-class EditPrinButtonListener extends MouseAdapter implements ActionListener {
-
-    private PolicyTool tool;
-    private ToolWindow tw;
-    private ToolDialog td;
-    private boolean editPolicyEntry;
-
-    EditPrinButtonListener(PolicyTool tool, ToolWindow tw,
-                                ToolDialog td, boolean editPolicyEntry) {
-        this.tool = tool;
-        this.tw = tw;
-        this.td = td;
-        this.editPolicyEntry = editPolicyEntry;
-    }
-
-    public void actionPerformed(ActionEvent e) {
-
-        // get the Principal selected from the Principal List
-        TaggedList list = (TaggedList)td.getComponent(
-                ToolDialog.PE_PRIN_LIST);
-        int prinIndex = list.getSelectedIndex();
-
-        if (prinIndex < 0) {
-            tw.displayErrorDialog(td, new Exception
-                (PolicyTool.getMessage("No.principal.selected")));
-            return;
-        }
-        td.displayPrincipalDialog(editPolicyEntry, true);
-    }
-
-    public void mouseClicked(MouseEvent evt) {
-        if (evt.getClickCount() == 2) {
-            actionPerformed(null);
-        }
-    }
-}
-
-/**
- * Event handler for Edit Permission button
- *
- * We need the editPolicyEntry boolean to tell us if the user is
- * adding a new PolicyEntry at this time, or editing an existing entry.
- * If the user is adding a new PolicyEntry, we ONLY update the
- * GUI listing.  If the user is editing an existing PolicyEntry, we
- * update both the GUI listing and the actual PolicyEntry.
- */
-class EditPermButtonListener extends MouseAdapter implements ActionListener {
-
-    private PolicyTool tool;
-    private ToolWindow tw;
-    private ToolDialog td;
-    private boolean editPolicyEntry;
-
-    EditPermButtonListener(PolicyTool tool, ToolWindow tw,
-                                ToolDialog td, boolean editPolicyEntry) {
-        this.tool = tool;
-        this.tw = tw;
-        this.td = td;
-        this.editPolicyEntry = editPolicyEntry;
-    }
-
-    public void actionPerformed(ActionEvent e) {
-
-        // get the Permission selected from the Permission List
-        @SuppressWarnings("unchecked")
-        JList<String> list = (JList<String>)td.getComponent(ToolDialog.PE_PERM_LIST);
-        int permIndex = list.getSelectedIndex();
-
-        if (permIndex < 0) {
-            tw.displayErrorDialog(td, new Exception
-                (PolicyTool.getMessage("No.permission.selected")));
-            return;
-        }
-        td.displayPermissionDialog(editPolicyEntry, true);
-    }
-
-    public void mouseClicked(MouseEvent evt) {
-        if (evt.getClickCount() == 2) {
-            actionPerformed(null);
-        }
-    }
-}
-
-/**
- * Event handler for Principal Popup Menu
- */
-class PrincipalTypeMenuListener implements ItemListener {
-
-    private ToolDialog td;
-
-    PrincipalTypeMenuListener(ToolDialog td) {
-        this.td = td;
-    }
-
-    public void itemStateChanged(ItemEvent e) {
-        if (e.getStateChange() == ItemEvent.DESELECTED) {
-            // We're only interested in SELECTED events
-            return;
-        }
-
-        @SuppressWarnings("unchecked")
-        JComboBox<String> prin = (JComboBox<String>)td.getComponent(ToolDialog.PRD_PRIN_CHOICE);
-        JTextField prinField = (JTextField)td.getComponent(
-                ToolDialog.PRD_PRIN_TEXTFIELD);
-        JTextField nameField = (JTextField)td.getComponent(
-                ToolDialog.PRD_NAME_TEXTFIELD);
-
-        prin.getAccessibleContext().setAccessibleName(
-            PolicyTool.splitToWords((String)e.getItem()));
-        if (((String)e.getItem()).equals(ToolDialog.PRIN_TYPE)) {
-            // ignore if they choose "Principal Type:" item
-            if (prinField.getText() != null &&
-                prinField.getText().length() > 0) {
-                Prin inputPrin = ToolDialog.getPrin(prinField.getText(), true);
-                prin.setSelectedItem(inputPrin.CLASS);
-            }
-            return;
-        }
-
-        // if you change the principal, clear the name
-        if (prinField.getText().indexOf((String)e.getItem()) == -1) {
-            nameField.setText("");
-        }
-
-        // set the text in the textfield and also modify the
-        // pull-down choice menus to reflect the correct possible
-        // set of names and actions
-        Prin inputPrin = ToolDialog.getPrin((String)e.getItem(), false);
-        if (inputPrin != null) {
-            prinField.setText(inputPrin.FULL_CLASS);
-        }
-    }
-}
-
-/**
- * Event handler for Permission Popup Menu
- */
-class PermissionMenuListener implements ItemListener {
-
-    private ToolDialog td;
-
-    PermissionMenuListener(ToolDialog td) {
-        this.td = td;
-    }
-
-    public void itemStateChanged(ItemEvent e) {
-        if (e.getStateChange() == ItemEvent.DESELECTED) {
-            // We're only interested in SELECTED events
-            return;
-        }
-
-        @SuppressWarnings("unchecked")
-        JComboBox<String> perms = (JComboBox<String>)td.getComponent(
-                ToolDialog.PD_PERM_CHOICE);
-        @SuppressWarnings("unchecked")
-        JComboBox<String> names = (JComboBox<String>)td.getComponent(
-                ToolDialog.PD_NAME_CHOICE);
-        @SuppressWarnings("unchecked")
-        JComboBox<String> actions = (JComboBox<String>)td.getComponent(
-                ToolDialog.PD_ACTIONS_CHOICE);
-        JTextField nameField = (JTextField)td.getComponent(
-                ToolDialog.PD_NAME_TEXTFIELD);
-        JTextField actionsField = (JTextField)td.getComponent(
-                ToolDialog.PD_ACTIONS_TEXTFIELD);
-        JTextField permField = (JTextField)td.getComponent(
-                ToolDialog.PD_PERM_TEXTFIELD);
-        JTextField signedbyField = (JTextField)td.getComponent(
-                ToolDialog.PD_SIGNEDBY_TEXTFIELD);
-
-        perms.getAccessibleContext().setAccessibleName(
-            PolicyTool.splitToWords((String)e.getItem()));
-
-        // ignore if they choose the 'Permission:' item
-        if (PolicyTool.collator.compare((String)e.getItem(),
-                                      ToolDialog.PERM) == 0) {
-            if (permField.getText() != null &&
-                permField.getText().length() > 0) {
-
-                Perm inputPerm = ToolDialog.getPerm(permField.getText(), true);
-                if (inputPerm != null) {
-                    perms.setSelectedItem(inputPerm.CLASS);
-                }
-            }
-            return;
-        }
-
-        // if you change the permission, clear the name, actions, and signedBy
-        if (permField.getText().indexOf((String)e.getItem()) == -1) {
-            nameField.setText("");
-            actionsField.setText("");
-            signedbyField.setText("");
-        }
-
-        // set the text in the textfield and also modify the
-        // pull-down choice menus to reflect the correct possible
-        // set of names and actions
-
-        Perm inputPerm = ToolDialog.getPerm((String)e.getItem(), false);
-        if (inputPerm == null) {
-            permField.setText("");
-        } else {
-            permField.setText(inputPerm.FULL_CLASS);
-        }
-        td.setPermissionNames(inputPerm, names, nameField);
-        td.setPermissionActions(inputPerm, actions, actionsField);
-    }
-}
-
-/**
- * Event handler for Permission Name Popup Menu
- */
-class PermissionNameMenuListener implements ItemListener {
-
-    private ToolDialog td;
-
-    PermissionNameMenuListener(ToolDialog td) {
-        this.td = td;
-    }
-
-    public void itemStateChanged(ItemEvent e) {
-        if (e.getStateChange() == ItemEvent.DESELECTED) {
-            // We're only interested in SELECTED events
-            return;
-        }
-
-        @SuppressWarnings("unchecked")
-        JComboBox<String> names = (JComboBox<String>)td.getComponent(ToolDialog.PD_NAME_CHOICE);
-        names.getAccessibleContext().setAccessibleName(
-            PolicyTool.splitToWords((String)e.getItem()));
-
-        if (((String)e.getItem()).indexOf(ToolDialog.PERM_NAME) != -1)
-            return;
-
-        JTextField tf = (JTextField)td.getComponent(ToolDialog.PD_NAME_TEXTFIELD);
-        tf.setText((String)e.getItem());
-    }
-}
-
-/**
- * Event handler for Permission Actions Popup Menu
- */
-class PermissionActionsMenuListener implements ItemListener {
-
-    private ToolDialog td;
-
-    PermissionActionsMenuListener(ToolDialog td) {
-        this.td = td;
-    }
-
-    public void itemStateChanged(ItemEvent e) {
-        if (e.getStateChange() == ItemEvent.DESELECTED) {
-            // We're only interested in SELECTED events
-            return;
-        }
-
-        @SuppressWarnings("unchecked")
-        JComboBox<String> actions = (JComboBox<String>)td.getComponent(
-                ToolDialog.PD_ACTIONS_CHOICE);
-        actions.getAccessibleContext().setAccessibleName((String)e.getItem());
-
-        if (((String)e.getItem()).indexOf(ToolDialog.PERM_ACTIONS) != -1)
-            return;
-
-        JTextField tf = (JTextField)td.getComponent(
-                ToolDialog.PD_ACTIONS_TEXTFIELD);
-        if (tf.getText() == null || tf.getText().equals("")) {
-            tf.setText((String)e.getItem());
-        } else {
-            if (tf.getText().indexOf((String)e.getItem()) == -1)
-                tf.setText(tf.getText() + ", " + (String)e.getItem());
-        }
-    }
-}
-
-/**
- * Event handler for all the children dialogs/windows
- */
-class ChildWindowListener implements WindowListener {
-
-    private ToolDialog td;
-
-    ChildWindowListener(ToolDialog td) {
-        this.td = td;
-    }
-
-    public void windowOpened(WindowEvent we) {
-    }
-
-    public void windowClosing(WindowEvent we) {
-        // same as pressing the "cancel" button
-        td.setVisible(false);
-        td.dispose();
-    }
-
-    public void windowClosed(WindowEvent we) {
-    }
-
-    public void windowIconified(WindowEvent we) {
-    }
-
-    public void windowDeiconified(WindowEvent we) {
-    }
-
-    public void windowActivated(WindowEvent we) {
-    }
-
-    public void windowDeactivated(WindowEvent we) {
-    }
-}
-
-/**
- * Event handler for CancelButton button
- */
-class CancelButtonListener implements ActionListener {
-
-    private ToolDialog td;
-
-    CancelButtonListener(ToolDialog td) {
-        this.td = td;
-    }
-
-    public void actionPerformed(ActionEvent e) {
-        td.setVisible(false);
-        td.dispose();
-    }
-}
-
-/**
- * Event handler for ErrorOKButton button
- */
-class ErrorOKButtonListener implements ActionListener {
-
-    private ToolDialog ed;
-
-    ErrorOKButtonListener(ToolDialog ed) {
-        this.ed = ed;
-    }
-
-    public void actionPerformed(ActionEvent e) {
-        ed.setVisible(false);
-        ed.dispose();
-    }
-}
-
-/**
- * Event handler for StatusOKButton button
- */
-class StatusOKButtonListener implements ActionListener {
-
-    private ToolDialog sd;
-
-    StatusOKButtonListener(ToolDialog sd) {
-        this.sd = sd;
-    }
-
-    public void actionPerformed(ActionEvent e) {
-        sd.setVisible(false);
-        sd.dispose();
-    }
-}
-
-/**
- * Event handler for UserSaveYes button
- */
-class UserSaveYesButtonListener implements ActionListener {
-
-    private ToolDialog us;
-    private PolicyTool tool;
-    private ToolWindow tw;
-    private int select;
-
-    UserSaveYesButtonListener(ToolDialog us, PolicyTool tool,
-                        ToolWindow tw, int select) {
-        this.us = us;
-        this.tool = tool;
-        this.tw = tw;
-        this.select = select;
-    }
-
-    public void actionPerformed(ActionEvent e) {
-
-        // first get rid of the window
-        us.setVisible(false);
-        us.dispose();
-
-        try {
-            String filename = ((JTextField)tw.getComponent(
-                    ToolWindow.MW_FILENAME_TEXTFIELD)).getText();
-            if (filename == null || filename.equals("")) {
-                us.displaySaveAsDialog(select);
-
-                // the above dialog will continue with the originally
-                // requested command if necessary
-            } else {
-                // save the policy entries to a file
-                tool.savePolicy(filename);
-
-                // display status
-                MessageFormat form = new MessageFormat
-                        (PolicyTool.getMessage
-                        ("Policy.successfully.written.to.filename"));
-                Object[] source = {filename};
-                tw.displayStatusDialog(null, form.format(source));
-
-                // now continue with the originally requested command
-                // (QUIT, NEW, or OPEN)
-                us.userSaveContinue(tool, tw, us, select);
-            }
-        } catch (Exception ee) {
-            // error -- just report it and bail
-            tw.displayErrorDialog(null, ee);
-        }
-    }
-}
-
-/**
- * Event handler for UserSaveNoButton
- */
-class UserSaveNoButtonListener implements ActionListener {
-
-    private PolicyTool tool;
-    private ToolWindow tw;
-    private ToolDialog us;
-    private int select;
-
-    UserSaveNoButtonListener(ToolDialog us, PolicyTool tool,
-                        ToolWindow tw, int select) {
-        this.us = us;
-        this.tool = tool;
-        this.tw = tw;
-        this.select = select;
-    }
-
-    public void actionPerformed(ActionEvent e) {
-        us.setVisible(false);
-        us.dispose();
-
-        // now continue with the originally requested command
-        // (QUIT, NEW, or OPEN)
-        us.userSaveContinue(tool, tw, us, select);
-    }
-}
-
-/**
- * Event handler for UserSaveCancelButton
- */
-class UserSaveCancelButtonListener implements ActionListener {
-
-    private ToolDialog us;
-
-    UserSaveCancelButtonListener(ToolDialog us) {
-        this.us = us;
-    }
-
-    public void actionPerformed(ActionEvent e) {
-        us.setVisible(false);
-        us.dispose();
-
-        // do NOT continue with the originally requested command
-        // (QUIT, NEW, or OPEN)
-    }
-}
-
-/**
- * Event handler for ConfirmRemovePolicyEntryOKButtonListener
- */
-class ConfirmRemovePolicyEntryOKButtonListener implements ActionListener {
-
-    private PolicyTool tool;
-    private ToolWindow tw;
-    private ToolDialog us;
-
-    ConfirmRemovePolicyEntryOKButtonListener(PolicyTool tool,
-                                ToolWindow tw, ToolDialog us) {
-        this.tool = tool;
-        this.tw = tw;
-        this.us = us;
-    }
-
-    public void actionPerformed(ActionEvent e) {
-        // remove the entry
-        @SuppressWarnings("unchecked")
-        JList<String> list = (JList<String>)tw.getComponent(ToolWindow.MW_POLICY_LIST);
-        int index = list.getSelectedIndex();
-        PolicyEntry entries[] = tool.getEntry();
-        tool.removeEntry(entries[index]);
-
-        // redraw the window listing
-        DefaultListModel<String> listModel = new DefaultListModel<>();
-        list = new JList<>(listModel);
-        list.setVisibleRowCount(15);
-        list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
-        list.addMouseListener(new PolicyListListener(tool, tw));
-        entries = tool.getEntry();
-        if (entries != null) {
-                for (int i = 0; i < entries.length; i++) {
-                    listModel.addElement(entries[i].headerToString());
-                }
-        }
-        tw.replacePolicyList(list);
-        us.setVisible(false);
-        us.dispose();
-    }
-}
-
-/**
- * Just a special name, so that the codes dealing with this exception knows
- * it's special, and does not pop out a warning box.
- */
-class NoDisplayException extends RuntimeException {
-    private static final long serialVersionUID = -4611761427108719794L;
-}
-
-/**
- * This is a java.awt.List that bind an Object to each String it holds.
- */
-class TaggedList extends JList<String> {
-    private static final long serialVersionUID = -5676238110427785853L;
-
-    private java.util.List<Object> data = new LinkedList<>();
-    public TaggedList(int i, boolean b) {
-        super(new DefaultListModel<>());
-        setVisibleRowCount(i);
-        setSelectionMode(b ? ListSelectionModel.MULTIPLE_INTERVAL_SELECTION : ListSelectionModel.SINGLE_SELECTION);
-    }
-
-    public Object getObject(int index) {
-        return data.get(index);
-    }
-
-    public void addTaggedItem(String string, Object object) {
-        ((DefaultListModel<String>)getModel()).addElement(string);
-        data.add(object);
-    }
-
-    public void replaceTaggedItem(String string, Object object, int index) {
-        ((DefaultListModel<String>)getModel()).set(index, string);
-        data.set(index, object);
-    }
-
-    public void removeTaggedItem(int index) {
-        ((DefaultListModel<String>)getModel()).remove(index);
-        data.remove(index);
-    }
-}
-
-/**
- * Convenience Principal Classes
- */
-
-class Prin {
-    public final String CLASS;
-    public final String FULL_CLASS;
-
-    public Prin(String clazz, String fullClass) {
-        this.CLASS = clazz;
-        this.FULL_CLASS = fullClass;
-    }
-}
-
-class KrbPrin extends Prin {
-    public KrbPrin() {
-        super("KerberosPrincipal",
-                "javax.security.auth.kerberos.KerberosPrincipal");
-    }
-}
-
-class X500Prin extends Prin {
-    public X500Prin() {
-        super("X500Principal",
-                "javax.security.auth.x500.X500Principal");
-    }
-}
-
-/**
- * Convenience Permission Classes
- */
-
-class Perm {
-    public final String CLASS;
-    public final String FULL_CLASS;
-    public final String[] TARGETS;
-    public final String[] ACTIONS;
-
-    public Perm(String clazz, String fullClass,
-                String[] targets, String[] actions) {
-
-        this.CLASS = clazz;
-        this.FULL_CLASS = fullClass;
-        this.TARGETS = targets;
-        this.ACTIONS = actions;
-    }
-}
-
-class AllPerm extends Perm {
-    public AllPerm() {
-        super("AllPermission", "java.security.AllPermission", null, null);
-    }
-}
-
-class AudioPerm extends Perm {
-    public AudioPerm() {
-        super("AudioPermission",
-        "javax.sound.sampled.AudioPermission",
-        new String[]    {
-                "play",
-                "record"
-                },
-        null);
-    }
-}
-
-class AuthPerm extends Perm {
-    public AuthPerm() {
-    super("AuthPermission",
-        "javax.security.auth.AuthPermission",
-        new String[]    {
-                "doAs",
-                "doAsPrivileged",
-                "getSubject",
-                "getSubjectFromDomainCombiner",
-                "setReadOnly",
-                "modifyPrincipals",
-                "modifyPublicCredentials",
-                "modifyPrivateCredentials",
-                "refreshCredential",
-                "destroyCredential",
-                "createLoginContext.<" + PolicyTool.getMessage("name") + ">",
-                "getLoginConfiguration",
-                "setLoginConfiguration",
-                "createLoginConfiguration.<" +
-                        PolicyTool.getMessage("configuration.type") + ">",
-                "refreshLoginConfiguration"
-                },
-        null);
-    }
-}
-
-class AWTPerm extends Perm {
-    public AWTPerm() {
-    super("AWTPermission",
-        "java.awt.AWTPermission",
-        new String[]    {
-                "accessClipboard",
-                "accessEventQueue",
-                "accessSystemTray",
-                "createRobot",
-                "fullScreenExclusive",
-                "listenToAllAWTEvents",
-                "readDisplayPixels",
-                "replaceKeyboardFocusManager",
-                "setAppletStub",
-                "setWindowAlwaysOnTop",
-                "showWindowWithoutWarningBanner",
-                "toolkitModality",
-                "watchMousePointer"
-        },
-        null);
-    }
-}
-
-class DelegationPerm extends Perm {
-    public DelegationPerm() {
-    super("DelegationPermission",
-        "javax.security.auth.kerberos.DelegationPermission",
-        new String[]    {
-                // allow user input
-                },
-        null);
-    }
-}
-
-class FilePerm extends Perm {
-    public FilePerm() {
-    super("FilePermission",
-        "java.io.FilePermission",
-        new String[]    {
-                "<<ALL FILES>>"
-                },
-        new String[]    {
-                "read",
-                "write",
-                "delete",
-                "execute"
-                });
-    }
-}
-
-class URLPerm extends Perm {
-    public URLPerm() {
-        super("URLPermission",
-                "java.net.URLPermission",
-                new String[]    {
-                    "<"+ PolicyTool.getMessage("url") + ">",
-                },
-                new String[]    {
-                    "<" + PolicyTool.getMessage("method.list") + ">:<"
-                        + PolicyTool.getMessage("request.headers.list") + ">",
-                });
-    }
-}
-
-class InqSecContextPerm extends Perm {
-    public InqSecContextPerm() {
-    super("InquireSecContextPermission",
-        "com.sun.security.jgss.InquireSecContextPermission",
-        new String[]    {
-                "KRB5_GET_SESSION_KEY",
-                "KRB5_GET_TKT_FLAGS",
-                "KRB5_GET_AUTHZ_DATA",
-                "KRB5_GET_AUTHTIME"
-                },
-        null);
-    }
-}
-
-class LogPerm extends Perm {
-    public LogPerm() {
-    super("LoggingPermission",
-        "java.util.logging.LoggingPermission",
-        new String[]    {
-                "control"
-                },
-        null);
-    }
-}
-
-class MgmtPerm extends Perm {
-    public MgmtPerm() {
-    super("ManagementPermission",
-        "java.lang.management.ManagementPermission",
-        new String[]    {
-                "control",
-                "monitor"
-                },
-        null);
-    }
-}
-
-class MBeanPerm extends Perm {
-    public MBeanPerm() {
-    super("MBeanPermission",
-        "javax.management.MBeanPermission",
-        new String[]    {
-                // allow user input
-                },
-        new String[]    {
-                "addNotificationListener",
-                "getAttribute",
-                "getClassLoader",
-                "getClassLoaderFor",
-                "getClassLoaderRepository",
-                "getDomains",
-                "getMBeanInfo",
-                "getObjectInstance",
-                "instantiate",
-                "invoke",
-                "isInstanceOf",
-                "queryMBeans",
-                "queryNames",
-                "registerMBean",
-                "removeNotificationListener",
-                "setAttribute",
-                "unregisterMBean"
-                });
-    }
-}
-
-class MBeanSvrPerm extends Perm {
-    public MBeanSvrPerm() {
-    super("MBeanServerPermission",
-        "javax.management.MBeanServerPermission",
-        new String[]    {
-                "createMBeanServer",
-                "findMBeanServer",
-                "newMBeanServer",
-                "releaseMBeanServer"
-                },
-        null);
-    }
-}
-
-class MBeanTrustPerm extends Perm {
-    public MBeanTrustPerm() {
-    super("MBeanTrustPermission",
-        "javax.management.MBeanTrustPermission",
-        new String[]    {
-                "register"
-                },
-        null);
-    }
-}
-
-class NetPerm extends Perm {
-    public NetPerm() {
-    super("NetPermission",
-        "java.net.NetPermission",
-        new String[]    {
-                "allowHttpTrace",
-                "setDefaultAuthenticator",
-                "requestPasswordAuthentication",
-                "specifyStreamHandler",
-                "getNetworkInformation",
-                "setProxySelector",
-                "getProxySelector",
-                "setCookieHandler",
-                "getCookieHandler",
-                "setResponseCache",
-                "getResponseCache"
-                },
-        null);
-    }
-}
-
-class NetworkPerm extends Perm {
-    public NetworkPerm() {
-    super("NetworkPermission",
-        "jdk.net.NetworkPermission",
-        new String[]    {
-                "setOption.SO_FLOW_SLA",
-                "getOption.SO_FLOW_SLA"
-                },
-        null);
-    }
-}
-
-class PrivCredPerm extends Perm {
-    public PrivCredPerm() {
-    super("PrivateCredentialPermission",
-        "javax.security.auth.PrivateCredentialPermission",
-        new String[]    {
-                // allow user input
-                },
-        new String[]    {
-                "read"
-                });
-    }
-}
-
-class PropPerm extends Perm {
-    public PropPerm() {
-    super("PropertyPermission",
-        "java.util.PropertyPermission",
-        new String[]    {
-                // allow user input
-                },
-        new String[]    {
-                "read",
-                "write"
-                });
-    }
-}
-
-class ReflectPerm extends Perm {
-    public ReflectPerm() {
-    super("ReflectPermission",
-        "java.lang.reflect.ReflectPermission",
-        new String[]    {
-                "suppressAccessChecks"
-                },
-        null);
-    }
-}
-
-class RuntimePerm extends Perm {
-    public RuntimePerm() {
-    super("RuntimePermission",
-        "java.lang.RuntimePermission",
-        new String[]    {
-                "createClassLoader",
-                "getClassLoader",
-                "setContextClassLoader",
-                "enableContextClassLoaderOverride",
-                "setSecurityManager",
-                "createSecurityManager",
-                "getenv.<" +
-                    PolicyTool.getMessage("environment.variable.name") + ">",
-                "exitVM",
-                "shutdownHooks",
-                "setFactory",
-                "setIO",
-                "modifyThread",
-                "stopThread",
-                "modifyThreadGroup",
-                "getProtectionDomain",
-                "readFileDescriptor",
-                "writeFileDescriptor",
-                "loadLibrary.<" +
-                    PolicyTool.getMessage("library.name") + ">",
-                "accessClassInPackage.<" +
-                    PolicyTool.getMessage("package.name")+">",
-                "defineClassInPackage.<" +
-                    PolicyTool.getMessage("package.name")+">",
-                "accessDeclaredMembers",
-                "queuePrintJob",
-                "getStackTrace",
-                "setDefaultUncaughtExceptionHandler",
-                "preferences",
-                "usePolicy",
-                // "inheritedChannel"
-                },
-        null);
-    }
-}
-
-class SecurityPerm extends Perm {
-    public SecurityPerm() {
-    super("SecurityPermission",
-        "java.security.SecurityPermission",
-        new String[]    {
-                "createAccessControlContext",
-                "getDomainCombiner",
-                "getPolicy",
-                "setPolicy",
-                "createPolicy.<" +
-                    PolicyTool.getMessage("policy.type") + ">",
-                "getProperty.<" +
-                    PolicyTool.getMessage("property.name") + ">",
-                "setProperty.<" +
-                    PolicyTool.getMessage("property.name") + ">",
-                "insertProvider.<" +
-                    PolicyTool.getMessage("provider.name") + ">",
-                "removeProvider.<" +
-                    PolicyTool.getMessage("provider.name") + ">",
-                //"setSystemScope",
-                //"setIdentityPublicKey",
-                //"setIdentityInfo",
-                //"addIdentityCertificate",
-                //"removeIdentityCertificate",
-                //"printIdentity",
-                "clearProviderProperties.<" +
-                    PolicyTool.getMessage("provider.name") + ">",
-                "putProviderProperty.<" +
-                    PolicyTool.getMessage("provider.name") + ">",
-                "removeProviderProperty.<" +
-                    PolicyTool.getMessage("provider.name") + ">",
-                //"getSignerPrivateKey",
-                //"setSignerKeyPair"
-                },
-        null);
-    }
-}
-
-class SerialPerm extends Perm {
-    public SerialPerm() {
-    super("SerializablePermission",
-        "java.io.SerializablePermission",
-        new String[]    {
-                "enableSubclassImplementation",
-                "enableSubstitution"
-                },
-        null);
-    }
-}
-
-class ServicePerm extends Perm {
-    public ServicePerm() {
-    super("ServicePermission",
-        "javax.security.auth.kerberos.ServicePermission",
-        new String[]    {
-                // allow user input
-                },
-        new String[]    {
-                "initiate",
-                "accept"
-                });
-    }
-}
-
-class SocketPerm extends Perm {
-    public SocketPerm() {
-    super("SocketPermission",
-        "java.net.SocketPermission",
-        new String[]    {
-                // allow user input
-                },
-        new String[]    {
-                "accept",
-                "connect",
-                "listen",
-                "resolve"
-                });
-    }
-}
-
-class SQLPerm extends Perm {
-    public SQLPerm() {
-    super("SQLPermission",
-        "java.sql.SQLPermission",
-        new String[]    {
-                "setLog",
-                "callAbort",
-                "setSyncFactory",
-                "setNetworkTimeout",
-                },
-        null);
-    }
-}
-
-class SSLPerm extends Perm {
-    public SSLPerm() {
-    super("SSLPermission",
-        "javax.net.ssl.SSLPermission",
-        new String[]    {
-                "setHostnameVerifier",
-                "getSSLSessionContext"
-                },
-        null);
-    }
-}
-
-class SubjDelegPerm extends Perm {
-    public SubjDelegPerm() {
-    super("SubjectDelegationPermission",
-        "javax.management.remote.SubjectDelegationPermission",
-        new String[]    {
-                // allow user input
-                },
-        null);
-    }
-}
--- a/jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,164 +0,0 @@
-/*
- * Copyright (c) 2000, 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.security.tools.policytool;
-
-/**
- * <p> This class represents the <code>ResourceBundle</code>
- * for the policytool.
- *
- */
-public class Resources extends java.util.ListResourceBundle {
-
-    private static final Object[][] contents = {
-        {"NEWLINE", "\n"},
-        {"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.",
-                "Warning: A public key for alias {0} does not exist.  Make sure a KeyStore is properly configured."},
-        {"Warning.Class.not.found.class", "Warning: Class not found: {0}"},
-        {"Warning.Invalid.argument.s.for.constructor.arg",
-                "Warning: Invalid argument(s) for constructor: {0}"},
-        {"Illegal.Principal.Type.type", "Illegal Principal Type: {0}"},
-        {"Illegal.option.option", "Illegal option: {0}"},
-        {"Usage.policytool.options.", "Usage: policytool [options]"},
-        {".file.file.policy.file.location",
-                "  [-file <file>]    policy file location"},
-        {"New", "&New"},
-        {"Open", "&Open..."},
-        {"Save", "&Save"},
-        {"Save.As", "Save &As..."},
-        {"View.Warning.Log", "View &Warning Log"},
-        {"Exit", "E&xit"},
-        {"Add.Policy.Entry", "&Add Policy Entry"},
-        {"Edit.Policy.Entry", "&Edit Policy Entry"},
-        {"Remove.Policy.Entry", "&Remove Policy Entry"},
-        {"Edit", "&Edit"},
-        {"Retain", "Retain"},
-
-        {"Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes",
-            "Warning: File name may include escaped backslash characters. " +
-                        "It is not necessary to escape backslash characters " +
-                        "(the tool escapes characters as necessary when writing " +
-                        "the policy contents to the persistent store).\n\n" +
-                        "Click on Retain to retain the entered name, or click on " +
-                        "Edit to edit the name."},
-
-        {"Add.Public.Key.Alias", "Add Public Key Alias"},
-        {"Remove.Public.Key.Alias", "Remove Public Key Alias"},
-        {"File", "&File"},
-        {"KeyStore", "&KeyStore"},
-        {"Policy.File.", "Policy File:"},
-        {"Could.not.open.policy.file.policyFile.e.toString.",
-                "Could not open policy file: {0}: {1}"},
-        {"Policy.Tool", "Policy Tool"},
-        {"Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.",
-                "Errors have occurred while opening the policy configuration.  View the Warning Log for more information."},
-        {"Error", "Error"},
-        {"OK", "OK"},
-        {"Status", "Status"},
-        {"Warning", "Warning"},
-        {"Permission.",
-                "Permission:                                                       "},
-        {"Principal.Type.", "Principal Type:"},
-        {"Principal.Name.", "Principal Name:"},
-        {"Target.Name.",
-                "Target Name:                                                    "},
-        {"Actions.",
-                "Actions:                                                             "},
-        {"OK.to.overwrite.existing.file.filename.",
-                "OK to overwrite existing file {0}?"},
-        {"Cancel", "Cancel"},
-        {"CodeBase.", "&CodeBase:"},
-        {"SignedBy.", "&SignedBy:"},
-        {"Add.Principal", "&Add Principal"},
-        {"Edit.Principal", "&Edit Principal"},
-        {"Remove.Principal", "&Remove Principal"},
-        {"Principals.", "&Principals:"},
-        {".Add.Permission", "  A&dd Permission"},
-        {".Edit.Permission", "  Ed&it Permission"},
-        {"Remove.Permission", "Re&move Permission"},
-        {"Done", "Done"},
-        {"KeyStore.URL.", "KeyStore &URL:"},
-        {"KeyStore.Type.", "KeyStore &Type:"},
-        {"KeyStore.Provider.", "KeyStore &Provider:"},
-        {"KeyStore.Password.URL.", "KeyStore Pass&word URL:"},
-        {"Principals", "Principals"},
-        {".Edit.Principal.", "  Edit Principal:"},
-        {".Add.New.Principal.", "  Add New Principal:"},
-        {"Permissions", "Permissions"},
-        {".Edit.Permission.", "  Edit Permission:"},
-        {".Add.New.Permission.", "  Add New Permission:"},
-        {"Signed.By.", "Signed By:"},
-        {"Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name",
-            "Cannot Specify Principal with a Wildcard Class without a Wildcard Name"},
-        {"Cannot.Specify.Principal.without.a.Name",
-            "Cannot Specify Principal without a Name"},
-        {"Permission.and.Target.Name.must.have.a.value",
-                "Permission and Target Name must have a value"},
-        {"Remove.this.Policy.Entry.", "Remove this Policy Entry?"},
-        {"Overwrite.File", "Overwrite File"},
-        {"Policy.successfully.written.to.filename",
-                "Policy successfully written to {0}"},
-        {"null.filename", "null filename"},
-        {"Save.changes.", "Save changes?"},
-        {"Yes", "&Yes"},
-        {"No", "&No"},
-        {"Policy.Entry", "Policy Entry"},
-        {"Save.Changes", "Save Changes"},
-        {"No.Policy.Entry.selected", "No Policy Entry selected"},
-        {"Unable.to.open.KeyStore.ex.toString.",
-                "Unable to open KeyStore: {0}"},
-        {"No.principal.selected", "No principal selected"},
-        {"No.permission.selected", "No permission selected"},
-        {"name", "name"},
-        {"configuration.type", "configuration type"},
-        {"environment.variable.name", "environment variable name"},
-        {"library.name", "library name"},
-        {"package.name", "package name"},
-        {"policy.type", "policy type"},
-        {"property.name", "property name"},
-        {"provider.name", "provider name"},
-        {"url", "url"},
-        {"method.list", "method list"},
-        {"request.headers.list", "request headers list"},
-        {"Principal.List", "Principal List"},
-        {"Permission.List", "Permission List"},
-        {"Code.Base", "Code Base"},
-        {"KeyStore.U.R.L.", "KeyStore U R L:"},
-        {"KeyStore.Password.U.R.L.", "KeyStore Password U R L:"}
-    };
-
-
-    /**
-     * Returns the contents of this <code>ResourceBundle</code>.
-     *
-     * <p>
-     *
-     * @return the contents of this <code>ResourceBundle</code>.
-     */
-    @Override
-    public Object[][] getContents() {
-        return contents;
-    }
-}
--- a/jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_de.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,159 +0,0 @@
-/*
- * Copyright (c) 2000, 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.security.tools.policytool;
-
-/**
- * <p> This class represents the <code>ResourceBundle</code>
- * for the policytool.
- *
- */
-public class Resources_de extends java.util.ListResourceBundle {
-
-    private static final Object[][] contents = {
-        {"NEWLINE", "\n"},
-        {"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.",
-                "Warnung: Kein Public Key f\u00FCr Alias {0} vorhanden. Vergewissern Sie sich, dass der KeyStore ordnungsgem\u00E4\u00DF konfiguriert ist."},
-        {"Warning.Class.not.found.class", "Warnung: Klasse nicht gefunden: {0}"},
-        {"Warning.Invalid.argument.s.for.constructor.arg",
-                "Warnung: Ung\u00FCltige(s) Argument(e) f\u00FCr Constructor: {0}"},
-        {"Illegal.Principal.Type.type", "Ung\u00FCltiger Principal-Typ: {0}"},
-        {"Illegal.option.option", "Ung\u00FCltige Option: {0}"},
-        {"Usage.policytool.options.", "Verwendung: policytool [Optionen]"},
-        {".file.file.policy.file.location",
-                " [-file <Datei>]    Policy-Dateiverzeichnis"},
-        {"New", "Neu"},
-        {"Open", "\u00D6ffnen"},
-        {"Save", "Speichern"},
-        {"Save.As", "Speichern unter"},
-        {"View.Warning.Log", "Warnungslog anzeigen"},
-        {"Exit", "Beenden"},
-        {"Add.Policy.Entry", "Policy-Eintrag hinzuf\u00FCgen"},
-        {"Edit.Policy.Entry", "Policy-Eintrag bearbeiten"},
-        {"Remove.Policy.Entry", "Policy-Eintrag entfernen"},
-        {"Edit", "Bearbeiten"},
-        {"Retain", "Beibehalten"},
-
-        {"Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes",
-            "Warnung: M\u00F6glicherweise enth\u00E4lt der Dateiname Escapezeichen mit Backslash. Es ist nicht notwendig, Backslash-Zeichen zu escapen (das Tool f\u00FChrt dies automatisch beim Schreiben des Policy-Contents in den persistenten Speicher aus).\n\nKlicken Sie auf \"Beibehalten\", um den eingegebenen Namen beizubehalten oder auf \"Bearbeiten\", um den Namen zu bearbeiten."},
-
-        {"Add.Public.Key.Alias", "Public Key-Alias hinzuf\u00FCgen"},
-        {"Remove.Public.Key.Alias", "Public Key-Alias entfernen"},
-        {"File", "Datei"},
-        {"KeyStore", "KeyStore"},
-        {"Policy.File.", "Policy-Datei:"},
-        {"Could.not.open.policy.file.policyFile.e.toString.",
-                "Policy-Datei konnte nicht ge\u00F6ffnet werden: {0}: {1}"},
-        {"Policy.Tool", "Policy-Tool"},
-        {"Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.",
-                "Beim \u00D6ffnen der Policy-Konfiguration sind Fehler aufgetreten. Weitere Informationen finden Sie im Warnungslog."},
-        {"Error", "Fehler"},
-        {"OK", "OK"},
-        {"Status", "Status"},
-        {"Warning", "Warnung"},
-        {"Permission.",
-                "Berechtigung:                                                       "},
-        {"Principal.Type.", "Principal-Typ:"},
-        {"Principal.Name.", "Principal-Name:"},
-        {"Target.Name.",
-                "Zielname:                                                    "},
-        {"Actions.",
-                "Aktionen:                                                             "},
-        {"OK.to.overwrite.existing.file.filename.",
-                "Vorhandene Datei {0} \u00FCberschreiben?"},
-        {"Cancel", "Abbrechen"},
-        {"CodeBase.", "CodeBase:"},
-        {"SignedBy.", "SignedBy:"},
-        {"Add.Principal", "Principal hinzuf\u00FCgen"},
-        {"Edit.Principal", "Principal bearbeiten"},
-        {"Remove.Principal", "Principal entfernen"},
-        {"Principals.", "Principals:"},
-        {".Add.Permission", "  Berechtigung hinzuf\u00FCgen"},
-        {".Edit.Permission", "  Berechtigung bearbeiten"},
-        {"Remove.Permission", "Berechtigung entfernen"},
-        {"Done", "Fertig"},
-        {"KeyStore.URL.", "KeyStore-URL:"},
-        {"KeyStore.Type.", "KeyStore-Typ:"},
-        {"KeyStore.Provider.", "KeyStore-Provider:"},
-        {"KeyStore.Password.URL.", "KeyStore-Kennwort-URL:"},
-        {"Principals", "Principals"},
-        {".Edit.Principal.", "  Principal bearbeiten:"},
-        {".Add.New.Principal.", "  Neuen Principal hinzuf\u00FCgen:"},
-        {"Permissions", "Berechtigungen"},
-        {".Edit.Permission.", "  Berechtigung bearbeiten:"},
-        {".Add.New.Permission.", "  Neue Berechtigung hinzuf\u00FCgen:"},
-        {"Signed.By.", "Signiert von:"},
-        {"Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name",
-            "Principal kann nicht mit einer Platzhalterklasse ohne Platzhalternamen angegeben werden"},
-        {"Cannot.Specify.Principal.without.a.Name",
-            "Principal kann nicht ohne einen Namen angegeben werden"},
-        {"Permission.and.Target.Name.must.have.a.value",
-                "Berechtigung und Zielname m\u00FCssen einen Wert haben"},
-        {"Remove.this.Policy.Entry.", "Diesen Policy-Eintrag entfernen?"},
-        {"Overwrite.File", "Datei \u00FCberschreiben"},
-        {"Policy.successfully.written.to.filename",
-                "Policy erfolgreich in {0} geschrieben"},
-        {"null.filename", "Null-Dateiname"},
-        {"Save.changes.", "\u00C4nderungen speichern?"},
-        {"Yes", "Ja"},
-        {"No", "Nein"},
-        {"Policy.Entry", "Policy-Eintrag"},
-        {"Save.Changes", "\u00C4nderungen speichern"},
-        {"No.Policy.Entry.selected", "Kein Policy-Eintrag ausgew\u00E4hlt"},
-        {"Unable.to.open.KeyStore.ex.toString.",
-                "KeyStore kann nicht ge\u00F6ffnet werden: {0}"},
-        {"No.principal.selected", "Kein Principal ausgew\u00E4hlt"},
-        {"No.permission.selected", "Keine Berechtigung ausgew\u00E4hlt"},
-        {"name", "Name"},
-        {"configuration.type", "Konfigurationstyp"},
-        {"environment.variable.name", "Umgebungsvariablenname"},
-        {"library.name", "Library-Name"},
-        {"package.name", "Packagename"},
-        {"policy.type", "Policy-Typ"},
-        {"property.name", "Eigenschaftsname"},
-        {"provider.name", "Providername"},
-        {"url", "URL"},
-        {"method.list", "Methodenliste"},
-        {"request.headers.list", "Headerliste anfordern"},
-        {"Principal.List", "Principal-Liste"},
-        {"Permission.List", "Berechtigungsliste"},
-        {"Code.Base", "Codebase"},
-        {"KeyStore.U.R.L.", "KeyStore-URL:"},
-        {"KeyStore.Password.U.R.L.", "KeyStore-Kennwort-URL:"}
-    };
-
-
-    /**
-     * Returns the contents of this <code>ResourceBundle</code>.
-     *
-     * <p>
-     *
-     * @return the contents of this <code>ResourceBundle</code>.
-     */
-    @Override
-    public Object[][] getContents() {
-        return contents;
-    }
-}
--- a/jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_es.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,159 +0,0 @@
-/*
- * Copyright (c) 2000, 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.security.tools.policytool;
-
-/**
- * <p> This class represents the <code>ResourceBundle</code>
- * for the policytool.
- *
- */
-public class Resources_es extends java.util.ListResourceBundle {
-
-    private static final Object[][] contents = {
-        {"NEWLINE", "\n"},
-        {"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.",
-                "Advertencia: no hay clave p\u00FAblica para el alias {0}. Aseg\u00FArese de que se ha configurado correctamente un almac\u00E9n de claves."},
-        {"Warning.Class.not.found.class", "Advertencia: no se ha encontrado la clase: {0}"},
-        {"Warning.Invalid.argument.s.for.constructor.arg",
-                "Advertencia: argumento(s) no v\u00E1lido(s) para el constructor: {0}"},
-        {"Illegal.Principal.Type.type", "Tipo de principal no permitido: {0}"},
-        {"Illegal.option.option", "Opci\u00F3n no permitida: {0}"},
-        {"Usage.policytool.options.", "Sintaxis: policytool [opciones]"},
-        {".file.file.policy.file.location",
-                "  [-file <archivo>]    ubicaci\u00F3n del archivo de normas"},
-        {"New", "Nuevo"},
-        {"Open", "Abrir"},
-        {"Save", "Guardar"},
-        {"Save.As", "Guardar como"},
-        {"View.Warning.Log", "Ver Log de Advertencias"},
-        {"Exit", "Salir"},
-        {"Add.Policy.Entry", "Agregar Entrada de Pol\u00EDtica"},
-        {"Edit.Policy.Entry", "Editar Entrada de Pol\u00EDtica"},
-        {"Remove.Policy.Entry", "Eliminar Entrada de Pol\u00EDtica"},
-        {"Edit", "Editar"},
-        {"Retain", "Mantener"},
-
-        {"Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes",
-            "Advertencia: el nombre del archivo puede contener caracteres de barra invertida de escape. No es necesario utilizar barras invertidas de escape (la herramienta aplica caracteres de escape seg\u00FAn sea necesario al escribir el contenido de las pol\u00EDticas en el almac\u00E9n persistente).\n\nHaga clic en Mantener para conservar el nombre introducido o en Editar para modificarlo."},
-
-        {"Add.Public.Key.Alias", "Agregar Alias de Clave P\u00FAblico"},
-        {"Remove.Public.Key.Alias", "Eliminar Alias de Clave P\u00FAblico"},
-        {"File", "Archivo"},
-        {"KeyStore", "Almac\u00E9n de Claves"},
-        {"Policy.File.", "Archivo de Pol\u00EDtica:"},
-        {"Could.not.open.policy.file.policyFile.e.toString.",
-                "No se ha podido abrir el archivo de pol\u00EDtica: {0}: {1}"},
-        {"Policy.Tool", "Herramienta de Pol\u00EDticas"},
-        {"Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.",
-                "Ha habido errores al abrir la configuraci\u00F3n de pol\u00EDticas. V\u00E9ase el log de advertencias para obtener m\u00E1s informaci\u00F3n."},
-        {"Error", "Error"},
-        {"OK", "Aceptar"},
-        {"Status", "Estado"},
-        {"Warning", "Advertencia"},
-        {"Permission.",
-                "Permiso:                                                       "},
-        {"Principal.Type.", "Tipo de Principal:"},
-        {"Principal.Name.", "Nombre de Principal:"},
-        {"Target.Name.",
-                "Nombre de Destino:                                                    "},
-        {"Actions.",
-                "Acciones:                                                             "},
-        {"OK.to.overwrite.existing.file.filename.",
-                "\u00BFSobrescribir el archivo existente {0}?"},
-        {"Cancel", "Cancelar"},
-        {"CodeBase.", "CodeBase:"},
-        {"SignedBy.", "SignedBy:"},
-        {"Add.Principal", "Agregar Principal"},
-        {"Edit.Principal", "Editar Principal"},
-        {"Remove.Principal", "Eliminar Principal"},
-        {"Principals.", "Principales:"},
-        {".Add.Permission", "  Agregar Permiso"},
-        {".Edit.Permission", "  Editar Permiso"},
-        {"Remove.Permission", "Eliminar Permiso"},
-        {"Done", "Listo"},
-        {"KeyStore.URL.", "URL de Almac\u00E9n de Claves:"},
-        {"KeyStore.Type.", "Tipo de Almac\u00E9n de Claves:"},
-        {"KeyStore.Provider.", "Proveedor de Almac\u00E9n de Claves:"},
-        {"KeyStore.Password.URL.", "URL de Contrase\u00F1a de Almac\u00E9n de Claves:"},
-        {"Principals", "Principales"},
-        {".Edit.Principal.", "  Editar Principal:"},
-        {".Add.New.Principal.", "  Agregar Nuevo Principal:"},
-        {"Permissions", "Permisos"},
-        {".Edit.Permission.", "  Editar Permiso:"},
-        {".Add.New.Permission.", "  Agregar Permiso Nuevo:"},
-        {"Signed.By.", "Firmado Por:"},
-        {"Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name",
-            "No se puede especificar un principal con una clase de comod\u00EDn sin un nombre de comod\u00EDn"},
-        {"Cannot.Specify.Principal.without.a.Name",
-            "No se puede especificar el principal sin un nombre"},
-        {"Permission.and.Target.Name.must.have.a.value",
-                "Permiso y Nombre de Destino deben tener un valor"},
-        {"Remove.this.Policy.Entry.", "\u00BFEliminar esta entrada de pol\u00EDtica?"},
-        {"Overwrite.File", "Sobrescribir Archivo"},
-        {"Policy.successfully.written.to.filename",
-                "Pol\u00EDtica escrita correctamente en {0}"},
-        {"null.filename", "nombre de archivo nulo"},
-        {"Save.changes.", "\u00BFGuardar los cambios?"},
-        {"Yes", "S\u00ED"},
-        {"No", "No"},
-        {"Policy.Entry", "Entrada de Pol\u00EDtica"},
-        {"Save.Changes", "Guardar Cambios"},
-        {"No.Policy.Entry.selected", "No se ha seleccionado la entrada de pol\u00EDtica"},
-        {"Unable.to.open.KeyStore.ex.toString.",
-                "No se ha podido abrir el almac\u00E9n de claves: {0}"},
-        {"No.principal.selected", "No se ha seleccionado un principal"},
-        {"No.permission.selected", "No se ha seleccionado un permiso"},
-        {"name", "nombre"},
-        {"configuration.type", "tipo de configuraci\u00F3n"},
-        {"environment.variable.name", "nombre de variable de entorno"},
-        {"library.name", "nombre de la biblioteca"},
-        {"package.name", "nombre del paquete"},
-        {"policy.type", "tipo de pol\u00EDtica"},
-        {"property.name", "nombre de la propiedad"},
-        {"provider.name", "nombre del proveedor"},
-        {"url", "url"},
-        {"method.list", "lista de m\u00E9todos"},
-        {"request.headers.list", "lista de cabeceras de solicitudes"},
-        {"Principal.List", "Lista de Principales"},
-        {"Permission.List", "Lista de Permisos"},
-        {"Code.Base", "Base de C\u00F3digo"},
-        {"KeyStore.U.R.L.", "URL de Almac\u00E9n de Claves:"},
-        {"KeyStore.Password.U.R.L.", "URL de Contrase\u00F1a de Almac\u00E9n de Claves:"}
-    };
-
-
-    /**
-     * Returns the contents of this <code>ResourceBundle</code>.
-     *
-     * <p>
-     *
-     * @return the contents of this <code>ResourceBundle</code>.
-     */
-    @Override
-    public Object[][] getContents() {
-        return contents;
-    }
-}
--- a/jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_fr.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,159 +0,0 @@
-/*
- * Copyright (c) 2000, 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.security.tools.policytool;
-
-/**
- * <p> This class represents the <code>ResourceBundle</code>
- * for the policytool.
- *
- */
-public class Resources_fr extends java.util.ListResourceBundle {
-
-    private static final Object[][] contents = {
-        {"NEWLINE", "\n"},
-        {"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.",
-                "Avertissement\u00A0: il n''existe pas de cl\u00E9 publique pour l''alias {0}. V\u00E9rifiez que le fichier de cl\u00E9s d''acc\u00E8s est correctement configur\u00E9."},
-        {"Warning.Class.not.found.class", "Avertissement : classe introuvable - {0}"},
-        {"Warning.Invalid.argument.s.for.constructor.arg",
-                "Avertissement\u00A0: arguments non valides pour le constructeur\u00A0- {0}"},
-        {"Illegal.Principal.Type.type", "Type de principal non admis : {0}"},
-        {"Illegal.option.option", "Option non admise : {0}"},
-        {"Usage.policytool.options.", "Syntaxe : policytool [options]"},
-        {".file.file.policy.file.location",
-                "  [-file <file>]    emplacement du fichier de r\u00E8gles"},
-        {"New", "Nouveau"},
-        {"Open", "Ouvrir"},
-        {"Save", "Enregistrer"},
-        {"Save.As", "Enregistrer sous"},
-        {"View.Warning.Log", "Afficher le journal des avertissements"},
-        {"Exit", "Quitter"},
-        {"Add.Policy.Entry", "Ajouter une r\u00E8gle"},
-        {"Edit.Policy.Entry", "Modifier une r\u00E8gle"},
-        {"Remove.Policy.Entry", "Enlever une r\u00E8gle"},
-        {"Edit", "Modifier"},
-        {"Retain", "Conserver"},
-
-        {"Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes",
-            "Avertissement : il se peut que le nom de fichier contienne des barres obliques inverses avec caract\u00E8re d'\u00E9chappement. Il n'est pas n\u00E9cessaire d'ajouter un caract\u00E8re d'\u00E9chappement aux barres obliques inverses. L'outil proc\u00E8de \u00E0 l'\u00E9chappement si n\u00E9cessaire lorsqu'il \u00E9crit le contenu des r\u00E8gles dans la zone de stockage persistant).\n\nCliquez sur Conserver pour garder le nom saisi ou sur Modifier pour le remplacer."},
-
-        {"Add.Public.Key.Alias", "Ajouter un alias de cl\u00E9 publique"},
-        {"Remove.Public.Key.Alias", "Enlever un alias de cl\u00E9 publique"},
-        {"File", "Fichier"},
-        {"KeyStore", "Fichier de cl\u00E9s"},
-        {"Policy.File.", "Fichier de r\u00E8gles :"},
-        {"Could.not.open.policy.file.policyFile.e.toString.",
-                "Impossible d''ouvrir le fichier de r\u00E8gles\u00A0: {0}: {1}"},
-        {"Policy.Tool", "Policy Tool"},
-        {"Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.",
-                "Des erreurs se sont produites \u00E0 l'ouverture de la configuration de r\u00E8gles. Pour plus d'informations, consultez le journal des avertissements."},
-        {"Error", "Erreur"},
-        {"OK", "OK"},
-        {"Status", "Statut"},
-        {"Warning", "Avertissement"},
-        {"Permission.",
-                "Droit :                                                       "},
-        {"Principal.Type.", "Type de principal :"},
-        {"Principal.Name.", "Nom de principal :"},
-        {"Target.Name.",
-                "Nom de cible :                                                    "},
-        {"Actions.",
-                "Actions :                                                             "},
-        {"OK.to.overwrite.existing.file.filename.",
-                "Remplacer le fichier existant {0} ?"},
-        {"Cancel", "Annuler"},
-        {"CodeBase.", "Base de code :"},
-        {"SignedBy.", "Sign\u00E9 par :"},
-        {"Add.Principal", "Ajouter un principal"},
-        {"Edit.Principal", "Modifier un principal"},
-        {"Remove.Principal", "Enlever un principal"},
-        {"Principals.", "Principaux :"},
-        {".Add.Permission", "  Ajouter un droit"},
-        {".Edit.Permission", "  Modifier un droit"},
-        {"Remove.Permission", "Enlever un droit"},
-        {"Done", "Termin\u00E9"},
-        {"KeyStore.URL.", "URL du fichier de cl\u00E9s :"},
-        {"KeyStore.Type.", "Type du fichier de cl\u00E9s :"},
-        {"KeyStore.Provider.", "Fournisseur du fichier de cl\u00E9s :"},
-        {"KeyStore.Password.URL.", "URL du mot de passe du fichier de cl\u00E9s :"},
-        {"Principals", "Principaux"},
-        {".Edit.Principal.", "  Modifier un principal :"},
-        {".Add.New.Principal.", "  Ajouter un principal :"},
-        {"Permissions", "Droits"},
-        {".Edit.Permission.", "  Modifier un droit :"},
-        {".Add.New.Permission.", "  Ajouter un droit :"},
-        {"Signed.By.", "Sign\u00E9 par :"},
-        {"Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name",
-            "Impossible de sp\u00E9cifier un principal avec une classe g\u00E9n\u00E9rique sans nom g\u00E9n\u00E9rique"},
-        {"Cannot.Specify.Principal.without.a.Name",
-            "Impossible de sp\u00E9cifier un principal sans nom"},
-        {"Permission.and.Target.Name.must.have.a.value",
-                "Le droit et le nom de cible doivent avoir une valeur"},
-        {"Remove.this.Policy.Entry.", "Enlever cette r\u00E8gle ?"},
-        {"Overwrite.File", "Remplacer le fichier"},
-        {"Policy.successfully.written.to.filename",
-                "R\u00E8gle \u00E9crite dans {0}"},
-        {"null.filename", "nom de fichier NULL"},
-        {"Save.changes.", "Enregistrer les modifications ?"},
-        {"Yes", "Oui"},
-        {"No", "Non"},
-        {"Policy.Entry", "R\u00E8gle"},
-        {"Save.Changes", "Enregistrer les modifications"},
-        {"No.Policy.Entry.selected", "Aucune r\u00E8gle s\u00E9lectionn\u00E9e"},
-        {"Unable.to.open.KeyStore.ex.toString.",
-                "Impossible d''ouvrir le fichier de cl\u00E9s d''acc\u00E8s : {0}"},
-        {"No.principal.selected", "Aucun principal s\u00E9lectionn\u00E9"},
-        {"No.permission.selected", "Aucun droit s\u00E9lectionn\u00E9"},
-        {"name", "nom"},
-        {"configuration.type", "type de configuration"},
-        {"environment.variable.name", "Nom de variable d'environnement"},
-        {"library.name", "nom de biblioth\u00E8que"},
-        {"package.name", "nom de package"},
-        {"policy.type", "type de r\u00E8gle"},
-        {"property.name", "nom de propri\u00E9t\u00E9"},
-        {"provider.name", "nom du fournisseur"},
-        {"url", "url"},
-        {"method.list", "liste des m\u00E9thodes"},
-        {"request.headers.list", "liste des en-t\u00EAtes de demande"},
-        {"Principal.List", "Liste de principaux"},
-        {"Permission.List", "Liste de droits"},
-        {"Code.Base", "Base de code"},
-        {"KeyStore.U.R.L.", "URL du fichier de cl\u00E9s :"},
-        {"KeyStore.Password.U.R.L.", "URL du mot de passe du fichier de cl\u00E9s :"}
-    };
-
-
-    /**
-     * Returns the contents of this <code>ResourceBundle</code>.
-     *
-     * <p>
-     *
-     * @return the contents of this <code>ResourceBundle</code>.
-     */
-    @Override
-    public Object[][] getContents() {
-        return contents;
-    }
-}
--- a/jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_it.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,159 +0,0 @@
-/*
- * Copyright (c) 2000, 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.security.tools.policytool;
-
-/**
- * <p> This class represents the <code>ResourceBundle</code>
- * for the policytool.
- *
- */
-public class Resources_it extends java.util.ListResourceBundle {
-
-    private static final Object[][] contents = {
-        {"NEWLINE", "\n"},
-        {"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.",
-                "Avvertenza: non esiste una chiave pubblica per l''alias {0}. Verificare che il keystore sia configurato correttamente."},
-        {"Warning.Class.not.found.class", "Avvertenza: classe non trovata: {0}"},
-        {"Warning.Invalid.argument.s.for.constructor.arg",
-                "Avvertenza: argomento o argomenti non validi per il costruttore {0}"},
-        {"Illegal.Principal.Type.type", "Tipo principal non valido: {0}"},
-        {"Illegal.option.option", "Opzione non valida: {0}"},
-        {"Usage.policytool.options.", "Uso: policytool [opzioni]"},
-        {".file.file.policy.file.location",
-                "  [-file <file>]    posizione del file dei criteri"},
-        {"New", "Nuovo"},
-        {"Open", "Apri"},
-        {"Save", "Salva"},
-        {"Save.As", "Salva con nome"},
-        {"View.Warning.Log", "Visualizza registro avvertenze"},
-        {"Exit", "Esci"},
-        {"Add.Policy.Entry", "Aggiungi voce dei criteri"},
-        {"Edit.Policy.Entry", "Modifica voce dei criteri"},
-        {"Remove.Policy.Entry", "Rimuovi voce dei criteri"},
-        {"Edit", "Modifica"},
-        {"Retain", "Mantieni"},
-
-        {"Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes",
-            "Avvertenza: il nome file pu\u00F2 includere barre rovesciate con escape. Non \u00E8 necessario eseguire l'escape delle barre rovesciate (se necessario lo strumento esegue l'escape dei caratteri al momento della scrittura del contenuto dei criteri nell'area di memorizzazione persistente).\n\nFare click su Mantieni per conservare il nome immesso, oppure su Modifica per modificare il nome."},
-
-        {"Add.Public.Key.Alias", "Aggiungi alias chiave pubblica"},
-        {"Remove.Public.Key.Alias", "Rimuovi alias chiave pubblica"},
-        {"File", "File"},
-        {"KeyStore", "Keystore"},
-        {"Policy.File.", "File dei criteri:"},
-        {"Could.not.open.policy.file.policyFile.e.toString.",
-                "Impossibile aprire il file di criteri {0}: {1}"},
-        {"Policy.Tool", "Strumento criteri"},
-        {"Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.",
-                "Si sono verificati errori durante l'apertura della configurazione dei criteri. Consultare il registro delle avvertenze per ulteriori informazioni."},
-        {"Error", "Errore"},
-        {"OK", "OK"},
-        {"Status", "Stato"},
-        {"Warning", "Avvertenza"},
-        {"Permission.",
-                "Autorizzazione:                                                       "},
-        {"Principal.Type.", "Tipo principal:"},
-        {"Principal.Name.", "Nome principal:"},
-        {"Target.Name.",
-                "Nome destinazione:                                                    "},
-        {"Actions.",
-                "Azioni:                                                             "},
-        {"OK.to.overwrite.existing.file.filename.",
-                "OK per sovrascrivere il file {0}?"},
-        {"Cancel", "Annulla"},
-        {"CodeBase.", "CodeBase:"},
-        {"SignedBy.", "SignedBy:"},
-        {"Add.Principal", "Aggiungi principal"},
-        {"Edit.Principal", "Modifica principal"},
-        {"Remove.Principal", "Rimuovi principal"},
-        {"Principals.", "Principal:"},
-        {".Add.Permission", "  Aggiungi autorizzazione"},
-        {".Edit.Permission", "  Modifica autorizzazione"},
-        {"Remove.Permission", "Rimuovi autorizzazione"},
-        {"Done", "Fine"},
-        {"KeyStore.URL.", "URL keystore:"},
-        {"KeyStore.Type.", "Tipo keystore:"},
-        {"KeyStore.Provider.", "Provider keystore:"},
-        {"KeyStore.Password.URL.", "URL password keystore:"},
-        {"Principals", "Principal:"},
-        {".Edit.Principal.", "  Modifica principal:"},
-        {".Add.New.Principal.", "  Aggiungi nuovo principal:"},
-        {"Permissions", "Autorizzazioni"},
-        {".Edit.Permission.", "  Modifica autorizzazione:"},
-        {".Add.New.Permission.", "  Aggiungi nuova autorizzazione:"},
-        {"Signed.By.", "Firmato da:"},
-        {"Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name",
-            "Impossibile specificare principal con una classe carattere jolly senza un nome carattere jolly"},
-        {"Cannot.Specify.Principal.without.a.Name",
-            "Impossibile specificare principal senza un nome"},
-        {"Permission.and.Target.Name.must.have.a.value",
-                "L'autorizzazione e il nome destinazione non possono essere nulli"},
-        {"Remove.this.Policy.Entry.", "Rimuovere questa voce dei criteri?"},
-        {"Overwrite.File", "Sovrascrivi file"},
-        {"Policy.successfully.written.to.filename",
-                "I criteri sono stati scritti in {0}"},
-        {"null.filename", "nome file nullo"},
-        {"Save.changes.", "Salvare le modifiche?"},
-        {"Yes", "S\u00EC"},
-        {"No", "No"},
-        {"Policy.Entry", "Voce dei criteri"},
-        {"Save.Changes", "Salva le modifiche"},
-        {"No.Policy.Entry.selected", "Nessuna voce dei criteri selezionata"},
-        {"Unable.to.open.KeyStore.ex.toString.",
-                "Impossibile aprire il keystore: {0}"},
-        {"No.principal.selected", "Nessun principal selezionato"},
-        {"No.permission.selected", "Nessuna autorizzazione selezionata"},
-        {"name", "nome"},
-        {"configuration.type", "tipo di configurazione"},
-        {"environment.variable.name", "nome variabile ambiente"},
-        {"library.name", "nome libreria"},
-        {"package.name", "nome package"},
-        {"policy.type", "tipo di criteri"},
-        {"property.name", "nome propriet\u00E0"},
-        {"provider.name", "nome provider"},
-        {"url", "url"},
-        {"method.list", "lista metodi"},
-        {"request.headers.list", "lista intestazioni di richiesta"},
-        {"Principal.List", "Lista principal"},
-        {"Permission.List", "Lista autorizzazioni"},
-        {"Code.Base", "Codebase"},
-        {"KeyStore.U.R.L.", "URL keystore:"},
-        {"KeyStore.Password.U.R.L.", "URL password keystore:"}
-    };
-
-
-    /**
-     * Returns the contents of this <code>ResourceBundle</code>.
-     *
-     * <p>
-     *
-     * @return the contents of this <code>ResourceBundle</code>.
-     */
-    @Override
-    public Object[][] getContents() {
-        return contents;
-    }
-}
--- a/jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_ja.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,159 +0,0 @@
-/*
- * Copyright (c) 2000, 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.security.tools.policytool;
-
-/**
- * <p> This class represents the <code>ResourceBundle</code>
- * for the policytool.
- *
- */
-public class Resources_ja extends java.util.ListResourceBundle {
-
-    private static final Object[][] contents = {
-        {"NEWLINE", "\n"},
-        {"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.",
-                "\u8B66\u544A: \u5225\u540D{0}\u306E\u516C\u958B\u9375\u304C\u5B58\u5728\u3057\u307E\u305B\u3093\u3002\u30AD\u30FC\u30B9\u30C8\u30A2\u304C\u6B63\u3057\u304F\u69CB\u6210\u3055\u308C\u3066\u3044\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},
-        {"Warning.Class.not.found.class", "\u8B66\u544A: \u30AF\u30E9\u30B9\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: {0}"},
-        {"Warning.Invalid.argument.s.for.constructor.arg",
-                "\u8B66\u544A: \u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u306E\u5F15\u6570\u304C\u7121\u52B9\u3067\u3059: {0}"},
-        {"Illegal.Principal.Type.type", "\u4E0D\u6B63\u306A\u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u306E\u30BF\u30A4\u30D7: {0}"},
-        {"Illegal.option.option", "\u4E0D\u6B63\u306A\u30AA\u30D7\u30B7\u30E7\u30F3: {0}"},
-        {"Usage.policytool.options.", "\u4F7F\u7528\u65B9\u6CD5: policytool [options]"},
-        {".file.file.policy.file.location",
-                "  [-file <file>]  \u30DD\u30EA\u30B7\u30FC\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u5834\u6240"},
-        {"New", "\u65B0\u898F"},
-        {"Open", "\u958B\u304F"},
-        {"Save", "\u4FDD\u5B58"},
-        {"Save.As", "\u5225\u540D\u4FDD\u5B58"},
-        {"View.Warning.Log", "\u8B66\u544A\u30ED\u30B0\u306E\u8868\u793A"},
-        {"Exit", "\u7D42\u4E86"},
-        {"Add.Policy.Entry", "\u30DD\u30EA\u30B7\u30FC\u30FB\u30A8\u30F3\u30C8\u30EA\u306E\u8FFD\u52A0"},
-        {"Edit.Policy.Entry", "\u30DD\u30EA\u30B7\u30FC\u30FB\u30A8\u30F3\u30C8\u30EA\u306E\u7DE8\u96C6"},
-        {"Remove.Policy.Entry", "\u30DD\u30EA\u30B7\u30FC\u30FB\u30A8\u30F3\u30C8\u30EA\u306E\u524A\u9664"},
-        {"Edit", "\u7DE8\u96C6"},
-        {"Retain", "\u4FDD\u6301"},
-
-        {"Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes",
-            "\u8B66\u544A: \u30D5\u30A1\u30A4\u30EB\u540D\u306B\u30A8\u30B9\u30B1\u30FC\u30D7\u3055\u308C\u305F\u30D0\u30C3\u30AF\u30B9\u30E9\u30C3\u30B7\u30E5\u6587\u5B57\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002\u30D0\u30C3\u30AF\u30B9\u30E9\u30C3\u30B7\u30E5\u6587\u5B57\u3092\u30A8\u30B9\u30B1\u30FC\u30D7\u3059\u308B\u5FC5\u8981\u306F\u3042\u308A\u307E\u305B\u3093(\u30C4\u30FC\u30EB\u306F\u30DD\u30EA\u30B7\u30FC\u5185\u5BB9\u3092\u6C38\u7D9A\u30B9\u30C8\u30A2\u306B\u66F8\u304D\u8FBC\u3080\u3068\u304D\u306B\u3001\u5FC5\u8981\u306B\u5FDC\u3058\u3066\u6587\u5B57\u3092\u30A8\u30B9\u30B1\u30FC\u30D7\u3057\u307E\u3059)\u3002\n\n\u5165\u529B\u6E08\u306E\u540D\u524D\u3092\u4FDD\u6301\u3059\u308B\u306B\u306F\u300C\u4FDD\u6301\u300D\u3092\u30AF\u30EA\u30C3\u30AF\u3057\u3001\u540D\u524D\u3092\u7DE8\u96C6\u3059\u308B\u306B\u306F\u300C\u7DE8\u96C6\u300D\u3092\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},
-
-        {"Add.Public.Key.Alias", "\u516C\u958B\u9375\u306E\u5225\u540D\u306E\u8FFD\u52A0"},
-        {"Remove.Public.Key.Alias", "\u516C\u958B\u9375\u306E\u5225\u540D\u3092\u524A\u9664"},
-        {"File", "\u30D5\u30A1\u30A4\u30EB"},
-        {"KeyStore", "\u30AD\u30FC\u30B9\u30C8\u30A2"},
-        {"Policy.File.", "\u30DD\u30EA\u30B7\u30FC\u30FB\u30D5\u30A1\u30A4\u30EB:"},
-        {"Could.not.open.policy.file.policyFile.e.toString.",
-                "\u30DD\u30EA\u30B7\u30FC\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u958B\u3051\u307E\u305B\u3093\u3067\u3057\u305F: {0}: {1}"},
-        {"Policy.Tool", "\u30DD\u30EA\u30B7\u30FC\u30FB\u30C4\u30FC\u30EB"},
-        {"Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.",
-                "\u30DD\u30EA\u30B7\u30FC\u69CB\u6210\u3092\u958B\u304F\u3068\u304D\u306B\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002\u8A73\u7D30\u306F\u8B66\u544A\u30ED\u30B0\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},
-        {"Error", "\u30A8\u30E9\u30FC"},
-        {"OK", "OK"},
-        {"Status", "\u72B6\u614B"},
-        {"Warning", "\u8B66\u544A"},
-        {"Permission.",
-                "\u30A2\u30AF\u30BB\u30B9\u6A29:                                                       "},
-        {"Principal.Type.", "\u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u306E\u30BF\u30A4\u30D7:"},
-        {"Principal.Name.", "\u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u306E\u540D\u524D:"},
-        {"Target.Name.",
-                "\u30BF\u30FC\u30B2\u30C3\u30C8\u540D:                                                    "},
-        {"Actions.",
-                "\u30A2\u30AF\u30B7\u30E7\u30F3:                                                             "},
-        {"OK.to.overwrite.existing.file.filename.",
-                "\u65E2\u5B58\u306E\u30D5\u30A1\u30A4\u30EB{0}\u306B\u4E0A\u66F8\u304D\u3057\u307E\u3059\u304B\u3002"},
-        {"Cancel", "\u53D6\u6D88"},
-        {"CodeBase.", "CodeBase:"},
-        {"SignedBy.", "SignedBy:"},
-        {"Add.Principal", "\u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u306E\u8FFD\u52A0"},
-        {"Edit.Principal", "\u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u306E\u7DE8\u96C6"},
-        {"Remove.Principal", "\u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u306E\u524A\u9664"},
-        {"Principals.", "\u30D7\u30EA\u30F3\u30B7\u30D1\u30EB:"},
-        {".Add.Permission", "  \u30A2\u30AF\u30BB\u30B9\u6A29\u306E\u8FFD\u52A0"},
-        {".Edit.Permission", "  \u30A2\u30AF\u30BB\u30B9\u6A29\u306E\u7DE8\u96C6"},
-        {"Remove.Permission", "\u30A2\u30AF\u30BB\u30B9\u6A29\u306E\u524A\u9664"},
-        {"Done", "\u5B8C\u4E86"},
-        {"KeyStore.URL.", "\u30AD\u30FC\u30B9\u30C8\u30A2URL:"},
-        {"KeyStore.Type.", "\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u30BF\u30A4\u30D7:"},
-        {"KeyStore.Provider.", "\u30AD\u30FC\u30B9\u30C8\u30A2\u30FB\u30D7\u30ED\u30D0\u30A4\u30C0:"},
-        {"KeyStore.Password.URL.", "\u30AD\u30FC\u30B9\u30C8\u30A2\u30FB\u30D1\u30B9\u30EF\u30FC\u30C9URL:"},
-        {"Principals", "\u30D7\u30EA\u30F3\u30B7\u30D1\u30EB"},
-        {".Edit.Principal.", "  \u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u306E\u7DE8\u96C6:"},
-        {".Add.New.Principal.", "  \u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u306E\u65B0\u898F\u8FFD\u52A0:"},
-        {"Permissions", "\u30A2\u30AF\u30BB\u30B9\u6A29"},
-        {".Edit.Permission.", "  \u30A2\u30AF\u30BB\u30B9\u6A29\u306E\u7DE8\u96C6:"},
-        {".Add.New.Permission.", "  \u65B0\u898F\u30A2\u30AF\u30BB\u30B9\u6A29\u306E\u8FFD\u52A0:"},
-        {"Signed.By.", "\u7F72\u540D\u8005:"},
-        {"Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name",
-            "\u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9\u540D\u306E\u306A\u3044\u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9\u30FB\u30AF\u30E9\u30B9\u3092\u4F7F\u7528\u3057\u3066\u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u3092\u6307\u5B9A\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093"},
-        {"Cannot.Specify.Principal.without.a.Name",
-            "\u540D\u524D\u3092\u4F7F\u7528\u305B\u305A\u306B\u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u3092\u6307\u5B9A\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093"},
-        {"Permission.and.Target.Name.must.have.a.value",
-                "\u30A2\u30AF\u30BB\u30B9\u6A29\u3068\u30BF\u30FC\u30B2\u30C3\u30C8\u540D\u306F\u3001\u5024\u3092\u4FDD\u6301\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
-        {"Remove.this.Policy.Entry.", "\u3053\u306E\u30DD\u30EA\u30B7\u30FC\u30FB\u30A8\u30F3\u30C8\u30EA\u3092\u524A\u9664\u3057\u307E\u3059\u304B\u3002"},
-        {"Overwrite.File", "\u30D5\u30A1\u30A4\u30EB\u3092\u4E0A\u66F8\u304D\u3057\u307E\u3059"},
-        {"Policy.successfully.written.to.filename",
-                "\u30DD\u30EA\u30B7\u30FC\u306E{0}\u3078\u306E\u66F8\u8FBC\u307F\u306B\u6210\u529F\u3057\u307E\u3057\u305F"},
-        {"null.filename", "\u30D5\u30A1\u30A4\u30EB\u540D\u304Cnull\u3067\u3059"},
-        {"Save.changes.", "\u5909\u66F4\u3092\u4FDD\u5B58\u3057\u307E\u3059\u304B\u3002"},
-        {"Yes", "\u306F\u3044"},
-        {"No", "\u3044\u3044\u3048"},
-        {"Policy.Entry", "\u30DD\u30EA\u30B7\u30FC\u30FB\u30A8\u30F3\u30C8\u30EA"},
-        {"Save.Changes", "\u5909\u66F4\u3092\u4FDD\u5B58\u3057\u307E\u3059"},
-        {"No.Policy.Entry.selected", "\u30DD\u30EA\u30B7\u30FC\u30FB\u30A8\u30F3\u30C8\u30EA\u304C\u9078\u629E\u3055\u308C\u3066\u3044\u307E\u305B\u3093"},
-        {"Unable.to.open.KeyStore.ex.toString.",
-                "\u30AD\u30FC\u30B9\u30C8\u30A2{0}\u3092\u958B\u3051\u307E\u305B\u3093"},
-        {"No.principal.selected", "\u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u304C\u9078\u629E\u3055\u308C\u3066\u3044\u307E\u305B\u3093"},
-        {"No.permission.selected", "\u30A2\u30AF\u30BB\u30B9\u6A29\u304C\u9078\u629E\u3055\u308C\u3066\u3044\u307E\u305B\u3093"},
-        {"name", "\u540D\u524D"},
-        {"configuration.type", "\u69CB\u6210\u30BF\u30A4\u30D7"},
-        {"environment.variable.name", "\u74B0\u5883\u5909\u6570\u540D"},
-        {"library.name", "\u30E9\u30A4\u30D6\u30E9\u30EA\u540D"},
-        {"package.name", "\u30D1\u30C3\u30B1\u30FC\u30B8\u540D"},
-        {"policy.type", "\u30DD\u30EA\u30B7\u30FC\u30FB\u30BF\u30A4\u30D7"},
-        {"property.name", "\u30D7\u30ED\u30D1\u30C6\u30A3\u540D"},
-        {"provider.name", "\u30D7\u30ED\u30D0\u30A4\u30C0\u540D"},
-        {"url", "URL"},
-        {"method.list", "\u30E1\u30BD\u30C3\u30C9\u30FB\u30EA\u30B9\u30C8"},
-        {"request.headers.list", "\u30EA\u30AF\u30A8\u30B9\u30C8\u30FB\u30D8\u30C3\u30C0\u30FC\u30FB\u30EA\u30B9\u30C8"},
-        {"Principal.List", "\u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u306E\u30EA\u30B9\u30C8"},
-        {"Permission.List", "\u30A2\u30AF\u30BB\u30B9\u6A29\u306E\u30EA\u30B9\u30C8"},
-        {"Code.Base", "\u30B3\u30FC\u30C9\u30FB\u30D9\u30FC\u30B9"},
-        {"KeyStore.U.R.L.", "\u30AD\u30FC\u30B9\u30C8\u30A2U R L:"},
-        {"KeyStore.Password.U.R.L.", "\u30AD\u30FC\u30B9\u30C8\u30A2\u30FB\u30D1\u30B9\u30EF\u30FC\u30C9U R L:"}
-    };
-
-
-    /**
-     * Returns the contents of this <code>ResourceBundle</code>.
-     *
-     * <p>
-     *
-     * @return the contents of this <code>ResourceBundle</code>.
-     */
-    @Override
-    public Object[][] getContents() {
-        return contents;
-    }
-}
--- a/jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_ko.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,159 +0,0 @@
-/*
- * Copyright (c) 2000, 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.security.tools.policytool;
-
-/**
- * <p> This class represents the <code>ResourceBundle</code>
- * for the policytool.
- *
- */
-public class Resources_ko extends java.util.ListResourceBundle {
-
-    private static final Object[][] contents = {
-        {"NEWLINE", "\n"},
-        {"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.",
-                "\uACBD\uACE0: {0} \uBCC4\uCE6D\uC5D0 \uB300\uD55C \uACF5\uC6A9 \uD0A4\uAC00 \uC874\uC7AC\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. \uD0A4 \uC800\uC7A5\uC18C\uAC00 \uC81C\uB300\uB85C \uAD6C\uC131\uB418\uC5B4 \uC788\uB294\uC9C0 \uD655\uC778\uD558\uC2ED\uC2DC\uC624."},
-        {"Warning.Class.not.found.class", "\uACBD\uACE0: \uD074\uB798\uC2A4\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC74C: {0}"},
-        {"Warning.Invalid.argument.s.for.constructor.arg",
-                "\uACBD\uACE0: \uC0DD\uC131\uC790\uC5D0 \uB300\uD574 \uBD80\uC801\uD569\uD55C \uC778\uC218: {0}"},
-        {"Illegal.Principal.Type.type", "\uC798\uBABB\uB41C \uC8FC\uCCB4 \uC720\uD615: {0}"},
-        {"Illegal.option.option", "\uC798\uBABB\uB41C \uC635\uC158: {0}"},
-        {"Usage.policytool.options.", "\uC0AC\uC6A9\uBC95: policytool [options]"},
-        {".file.file.policy.file.location",
-                "  [-file <file>]    \uC815\uCC45 \uD30C\uC77C \uC704\uCE58"},
-        {"New", "\uC0C8\uB85C \uB9CC\uB4E4\uAE30"},
-        {"Open", "\uC5F4\uAE30"},
-        {"Save", "\uC800\uC7A5"},
-        {"Save.As", "\uB2E4\uB978 \uC774\uB984\uC73C\uB85C \uC800\uC7A5"},
-        {"View.Warning.Log", "\uACBD\uACE0 \uB85C\uADF8 \uBCF4\uAE30"},
-        {"Exit", "\uC885\uB8CC"},
-        {"Add.Policy.Entry", "\uC815\uCC45 \uD56D\uBAA9 \uCD94\uAC00"},
-        {"Edit.Policy.Entry", "\uC815\uCC45 \uD56D\uBAA9 \uD3B8\uC9D1"},
-        {"Remove.Policy.Entry", "\uC815\uCC45 \uD56D\uBAA9 \uC81C\uAC70"},
-        {"Edit", "\uD3B8\uC9D1"},
-        {"Retain", "\uC720\uC9C0"},
-
-        {"Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes",
-            "\uACBD\uACE0: \uD30C\uC77C \uC774\uB984\uC5D0 \uC774\uC2A4\uCF00\uC774\uD504\uB41C \uBC31\uC2AC\uB798\uC2DC \uBB38\uC790\uAC00 \uD3EC\uD568\uB418\uC5C8\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4. \uBC31\uC2AC\uB798\uC2DC \uBB38\uC790\uB294 \uC774\uC2A4\uCF00\uC774\uD504\uD560 \uD544\uC694\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. \uC601\uAD6C \uC800\uC7A5\uC18C\uC5D0 \uC815\uCC45 \uCF58\uD150\uCE20\uB97C \uC4F8 \uB54C \uD544\uC694\uC5D0 \uB530\uB77C \uC790\uB3D9\uC73C\uB85C \uBB38\uC790\uAC00 \uC774\uC2A4\uCF00\uC774\uD504\uB429\uB2C8\uB2E4.\n\n\uC785\uB825\uB41C \uC774\uB984\uC744 \uADF8\uB300\uB85C \uC720\uC9C0\uD558\uB824\uBA74 [\uC720\uC9C0]\uB97C \uB204\uB974\uACE0, \uC774\uB984\uC744 \uD3B8\uC9D1\uD558\uB824\uBA74 [\uD3B8\uC9D1]\uC744 \uB204\uB974\uC2ED\uC2DC\uC624."},
-
-        {"Add.Public.Key.Alias", "\uACF5\uC6A9 \uD0A4 \uBCC4\uCE6D \uCD94\uAC00"},
-        {"Remove.Public.Key.Alias", "\uACF5\uC6A9 \uD0A4 \uBCC4\uCE6D \uC81C\uAC70"},
-        {"File", "\uD30C\uC77C"},
-        {"KeyStore", "\uD0A4 \uC800\uC7A5\uC18C"},
-        {"Policy.File.", "\uC815\uCC45 \uD30C\uC77C:"},
-        {"Could.not.open.policy.file.policyFile.e.toString.",
-                "\uC815\uCC45 \uD30C\uC77C\uC744 \uC5F4 \uC218 \uC5C6\uC74C: {0}: {1}"},
-        {"Policy.Tool", "\uC815\uCC45 \uD234"},
-        {"Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.",
-                "\uC815\uCC45 \uAD6C\uC131\uC744 \uC5EC\uB294 \uC911 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. \uC790\uC138\uD55C \uB0B4\uC6A9\uC740 \uACBD\uACE0 \uB85C\uADF8\uB97C \uD655\uC778\uD558\uC2ED\uC2DC\uC624."},
-        {"Error", "\uC624\uB958"},
-        {"OK", "\uD655\uC778"},
-        {"Status", "\uC0C1\uD0DC"},
-        {"Warning", "\uACBD\uACE0"},
-        {"Permission.",
-                "\uAD8C\uD55C:                                                       "},
-        {"Principal.Type.", "\uC8FC\uCCB4 \uC720\uD615:"},
-        {"Principal.Name.", "\uC8FC\uCCB4 \uC774\uB984:"},
-        {"Target.Name.",
-                "\uB300\uC0C1 \uC774\uB984:                                                    "},
-        {"Actions.",
-                "\uC791\uC5C5:                                                             "},
-        {"OK.to.overwrite.existing.file.filename.",
-                "\uAE30\uC874 \uD30C\uC77C {0}\uC744(\uB97C) \uACB9\uCCD0 \uC4F0\uACA0\uC2B5\uB2C8\uAE4C?"},
-        {"Cancel", "\uCDE8\uC18C"},
-        {"CodeBase.", "CodeBase:"},
-        {"SignedBy.", "SignedBy:"},
-        {"Add.Principal", "\uC8FC\uCCB4 \uCD94\uAC00"},
-        {"Edit.Principal", "\uC8FC\uCCB4 \uD3B8\uC9D1"},
-        {"Remove.Principal", "\uC8FC\uCCB4 \uC81C\uAC70"},
-        {"Principals.", "\uC8FC\uCCB4:"},
-        {".Add.Permission", "  \uAD8C\uD55C \uCD94\uAC00"},
-        {".Edit.Permission", "  \uAD8C\uD55C \uD3B8\uC9D1"},
-        {"Remove.Permission", "\uAD8C\uD55C \uC81C\uAC70"},
-        {"Done", "\uC644\uB8CC"},
-        {"KeyStore.URL.", "\uD0A4 \uC800\uC7A5\uC18C URL:"},
-        {"KeyStore.Type.", "\uD0A4 \uC800\uC7A5\uC18C \uC720\uD615:"},
-        {"KeyStore.Provider.", "\uD0A4 \uC800\uC7A5\uC18C \uC81C\uACF5\uC790:"},
-        {"KeyStore.Password.URL.", "\uD0A4 \uC800\uC7A5\uC18C \uBE44\uBC00\uBC88\uD638 URL:"},
-        {"Principals", "\uC8FC\uCCB4"},
-        {".Edit.Principal.", "  \uC8FC\uCCB4 \uD3B8\uC9D1:"},
-        {".Add.New.Principal.", "  \uC0C8 \uC8FC\uCCB4 \uCD94\uAC00:"},
-        {"Permissions", "\uAD8C\uD55C"},
-        {".Edit.Permission.", "  \uAD8C\uD55C \uD3B8\uC9D1:"},
-        {".Add.New.Permission.", "  \uC0C8 \uAD8C\uD55C \uCD94\uAC00:"},
-        {"Signed.By.", "\uC11C\uBA85\uC790:"},
-        {"Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name",
-            "\uC640\uC77C\uB4DC \uCE74\uB4DC \uBB38\uC790 \uC774\uB984 \uC5C6\uC774 \uC640\uC77C\uB4DC \uCE74\uB4DC \uBB38\uC790 \uD074\uB798\uC2A4\uB97C \uC0AC\uC6A9\uD558\uB294 \uC8FC\uCCB4\uB97C \uC9C0\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-        {"Cannot.Specify.Principal.without.a.Name",
-            "\uC774\uB984 \uC5C6\uC774 \uC8FC\uCCB4\uB97C \uC9C0\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-        {"Permission.and.Target.Name.must.have.a.value",
-                "\uAD8C\uD55C\uACFC \uB300\uC0C1 \uC774\uB984\uC758 \uAC12\uC774 \uC788\uC5B4\uC57C \uD569\uB2C8\uB2E4."},
-        {"Remove.this.Policy.Entry.", "\uC774 \uC815\uCC45 \uD56D\uBAA9\uC744 \uC81C\uAC70\uD558\uACA0\uC2B5\uB2C8\uAE4C?"},
-        {"Overwrite.File", "\uD30C\uC77C \uACB9\uCCD0\uC4F0\uAE30"},
-        {"Policy.successfully.written.to.filename",
-                "{0}\uC5D0 \uC131\uACF5\uC801\uC73C\uB85C \uC815\uCC45\uC744 \uC37C\uC2B5\uB2C8\uB2E4."},
-        {"null.filename", "\uB110 \uD30C\uC77C \uC774\uB984"},
-        {"Save.changes.", "\uBCC0\uACBD \uC0AC\uD56D\uC744 \uC800\uC7A5\uD558\uACA0\uC2B5\uB2C8\uAE4C?"},
-        {"Yes", "\uC608"},
-        {"No", "\uC544\uB2C8\uC624"},
-        {"Policy.Entry", "\uC815\uCC45 \uD56D\uBAA9"},
-        {"Save.Changes", "\uBCC0\uACBD \uC0AC\uD56D \uC800\uC7A5"},
-        {"No.Policy.Entry.selected", "\uC120\uD0DD\uB41C \uC815\uCC45 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."},
-        {"Unable.to.open.KeyStore.ex.toString.",
-                "\uD0A4 \uC800\uC7A5\uC18C\uB97C \uC5F4 \uC218 \uC5C6\uC74C: {0}"},
-        {"No.principal.selected", "\uC120\uD0DD\uB41C \uC8FC\uCCB4\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."},
-        {"No.permission.selected", "\uC120\uD0DD\uB41C \uAD8C\uD55C\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."},
-        {"name", "\uC774\uB984"},
-        {"configuration.type", "\uAD6C\uC131 \uC720\uD615"},
-        {"environment.variable.name", "\uD658\uACBD \uBCC0\uC218 \uC774\uB984"},
-        {"library.name", "\uB77C\uC774\uBE0C\uB7EC\uB9AC \uC774\uB984"},
-        {"package.name", "\uD328\uD0A4\uC9C0 \uC774\uB984"},
-        {"policy.type", "\uC815\uCC45 \uC720\uD615"},
-        {"property.name", "\uC18D\uC131 \uC774\uB984"},
-        {"provider.name", "\uC81C\uACF5\uC790 \uC774\uB984"},
-        {"url", "URL"},
-        {"method.list", "\uBA54\uC18C\uB4DC \uBAA9\uB85D"},
-        {"request.headers.list", "\uC694\uCCAD \uD5E4\uB354 \uBAA9\uB85D"},
-        {"Principal.List", "\uC8FC\uCCB4 \uBAA9\uB85D"},
-        {"Permission.List", "\uAD8C\uD55C \uBAA9\uB85D"},
-        {"Code.Base", "\uCF54\uB4DC \uBCA0\uC774\uC2A4"},
-        {"KeyStore.U.R.L.", "\uD0A4 \uC800\uC7A5\uC18C URL:"},
-        {"KeyStore.Password.U.R.L.", "\uD0A4 \uC800\uC7A5\uC18C \uBE44\uBC00\uBC88\uD638 URL:"}
-    };
-
-
-    /**
-     * Returns the contents of this <code>ResourceBundle</code>.
-     *
-     * <p>
-     *
-     * @return the contents of this <code>ResourceBundle</code>.
-     */
-    @Override
-    public Object[][] getContents() {
-        return contents;
-    }
-}
--- a/jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_pt_BR.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,159 +0,0 @@
-/*
- * Copyright (c) 2000, 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.security.tools.policytool;
-
-/**
- * <p> This class represents the <code>ResourceBundle</code>
- * for the policytool.
- *
- */
-public class Resources_pt_BR extends java.util.ListResourceBundle {
-
-    private static final Object[][] contents = {
-        {"NEWLINE", "\n"},
-        {"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.",
-                "Advert\u00EAncia: N\u00E3o existe uma chave p\u00FAblica para o alias {0}. Certifique-se de que um KeyStore esteja configurado adequadamente."},
-        {"Warning.Class.not.found.class", "Advert\u00EAncia: Classe n\u00E3o encontrada: {0}"},
-        {"Warning.Invalid.argument.s.for.constructor.arg",
-                "Advert\u00EAncia: Argumento(s) inv\u00E1lido(s) para o construtor: {0}"},
-        {"Illegal.Principal.Type.type", "Tipo Principal Inv\u00E1lido: {0}"},
-        {"Illegal.option.option", "Op\u00E7\u00E3o inv\u00E1lida: {0}"},
-        {"Usage.policytool.options.", "Uso: policytool [op\u00E7\u00F5es]"},
-        {".file.file.policy.file.location",
-                "  [-file <arquivo>]    localiza\u00E7\u00E3o do arquivo de pol\u00EDtica"},
-        {"New", "Novo"},
-        {"Open", "Abrir"},
-        {"Save", "Salvar"},
-        {"Save.As", "Salvar Como"},
-        {"View.Warning.Log", "Exibir Log de Advert\u00EAncias"},
-        {"Exit", "Sair"},
-        {"Add.Policy.Entry", "Adicionar Entrada de Pol\u00EDtica"},
-        {"Edit.Policy.Entry", "Editar Entrada de Pol\u00EDtica"},
-        {"Remove.Policy.Entry", "Remover Entrada de Pol\u00EDtica"},
-        {"Edit", "Editar"},
-        {"Retain", "Reter"},
-
-        {"Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes",
-            "Advert\u00EAncia: O nome do arquivo pode conter caracteres de escape barra invertida. N\u00E3o \u00E9 necess\u00E1rio fazer o escape dos caracteres de barra invertida (a ferramenta faz o escape dos caracteres conforme necess\u00E1rio ao gravar o conte\u00FAdo da pol\u00EDtica no armazenamento persistente).\n\nClique em Reter para reter o nome da entrada ou clique em Editar para edit\u00E1-lo."},
-
-        {"Add.Public.Key.Alias", "Adicionar Alias de Chave P\u00FAblica"},
-        {"Remove.Public.Key.Alias", "Remover Alias de Chave P\u00FAblica"},
-        {"File", "Arquivo"},
-        {"KeyStore", "KeyStore"},
-        {"Policy.File.", "Arquivo de Pol\u00EDtica:"},
-        {"Could.not.open.policy.file.policyFile.e.toString.",
-                "N\u00E3o foi poss\u00EDvel abrir o arquivo de pol\u00EDtica: {0}: {1}"},
-        {"Policy.Tool", "Ferramenta de Pol\u00EDtica"},
-        {"Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.",
-                "Erros durante a abertura da configura\u00E7\u00E3o da pol\u00EDtica. Consulte o Log de Advert\u00EAncias para obter mais informa\u00E7\u00F5es."},
-        {"Error", "Erro"},
-        {"OK", "OK"},
-        {"Status", "Status"},
-        {"Warning", "Advert\u00EAncia"},
-        {"Permission.",
-                "Permiss\u00E3o:                                                       "},
-        {"Principal.Type.", "Tipo do Principal:"},
-        {"Principal.Name.", "Nome do Principal:"},
-        {"Target.Name.",
-                "Nome do Alvo:                                                    "},
-        {"Actions.",
-                "A\u00E7\u00F5es:                                                             "},
-        {"OK.to.overwrite.existing.file.filename.",
-                "Est\u00E1 correto substituir o arquivo existente {0}?"},
-        {"Cancel", "Cancelar"},
-        {"CodeBase.", "CodeBase:"},
-        {"SignedBy.", "SignedBy:"},
-        {"Add.Principal", "Adicionar Principal"},
-        {"Edit.Principal", "Editar Principal"},
-        {"Remove.Principal", "Remover Principal"},
-        {"Principals.", "Principais:"},
-        {".Add.Permission", "  Adicionar Permiss\u00E3o"},
-        {".Edit.Permission", "  Editar Permiss\u00E3o"},
-        {"Remove.Permission", "Remover Permiss\u00E3o"},
-        {"Done", "Conclu\u00EDdo"},
-        {"KeyStore.URL.", "URL do KeyStore:"},
-        {"KeyStore.Type.", "Tipo de KeyStore:"},
-        {"KeyStore.Provider.", "Fornecedor de KeyStore:"},
-        {"KeyStore.Password.URL.", "URL da Senha do KeyStore:"},
-        {"Principals", "Principais"},
-        {".Edit.Principal.", "  Editar Principal:"},
-        {".Add.New.Principal.", "  Adicionar Novo Principal:"},
-        {"Permissions", "Permiss\u00F5es"},
-        {".Edit.Permission.", "  Editar Permiss\u00E3o:"},
-        {".Add.New.Permission.", "  Adicionar Nova Permiss\u00E3o:"},
-        {"Signed.By.", "Assinado por:"},
-        {"Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name",
-            "N\u00E3o \u00E9 Poss\u00EDvel Especificar um Principal com uma Classe de Curinga sem um Nome de Curinga"},
-        {"Cannot.Specify.Principal.without.a.Name",
-            "N\u00E3o \u00E9 Poss\u00EDvel Especificar um Principal sem um Nome"},
-        {"Permission.and.Target.Name.must.have.a.value",
-                "O Nome de Destino e a Permiss\u00E3o devem ter um Valor"},
-        {"Remove.this.Policy.Entry.", "Remover esta Entrada de Pol\u00EDtica?"},
-        {"Overwrite.File", "Substituir Arquivo"},
-        {"Policy.successfully.written.to.filename",
-                "Pol\u00EDtica gravada com \u00EAxito em {0}"},
-        {"null.filename", "nome de arquivo nulo"},
-        {"Save.changes.", "Salvar altera\u00E7\u00F5es?"},
-        {"Yes", "Sim"},
-        {"No", "N\u00E3o"},
-        {"Policy.Entry", "Entrada de Pol\u00EDtica"},
-        {"Save.Changes", "Salvar Altera\u00E7\u00F5es"},
-        {"No.Policy.Entry.selected", "Nenhuma Entrada de Pol\u00EDtica Selecionada"},
-        {"Unable.to.open.KeyStore.ex.toString.",
-                "N\u00E3o \u00E9 poss\u00EDvel abrir a KeyStore: {0}"},
-        {"No.principal.selected", "Nenhum principal selecionado"},
-        {"No.permission.selected", "Nenhuma permiss\u00E3o selecionada"},
-        {"name", "nome"},
-        {"configuration.type", "tipo de configura\u00E7\u00E3o"},
-        {"environment.variable.name", "nome da vari\u00E1vel de ambiente"},
-        {"library.name", "nome da biblioteca"},
-        {"package.name", "nome do pacote"},
-        {"policy.type", "tipo de pol\u00EDtica"},
-        {"property.name", "nome da propriedade"},
-        {"provider.name", "nome do fornecedor"},
-        {"url", "url"},
-        {"method.list", "lista de m\u00E9todos"},
-        {"request.headers.list", "solicitar lista de cabe\u00E7alhos"},
-        {"Principal.List", "Lista de Principais"},
-        {"Permission.List", "Lista de Permiss\u00F5es"},
-        {"Code.Base", "Base de C\u00F3digo"},
-        {"KeyStore.U.R.L.", "U R L da KeyStore:"},
-        {"KeyStore.Password.U.R.L.", "U R L da Senha do KeyStore:"}
-    };
-
-
-    /**
-     * Returns the contents of this <code>ResourceBundle</code>.
-     *
-     * <p>
-     *
-     * @return the contents of this <code>ResourceBundle</code>.
-     */
-    @Override
-    public Object[][] getContents() {
-        return contents;
-    }
-}
--- a/jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_sv.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,159 +0,0 @@
-/*
- * Copyright (c) 2000, 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.security.tools.policytool;
-
-/**
- * <p> This class represents the <code>ResourceBundle</code>
- * for the policytool.
- *
- */
-public class Resources_sv extends java.util.ListResourceBundle {
-
-    private static final Object[][] contents = {
-        {"NEWLINE", "\n"},
-        {"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.",
-                "Varning! Det finns ingen offentlig nyckel f\u00F6r aliaset {0}. Kontrollera att det aktuella nyckellagret \u00E4r korrekt konfigurerat."},
-        {"Warning.Class.not.found.class", "Varning! Klassen hittades inte: {0}"},
-        {"Warning.Invalid.argument.s.for.constructor.arg",
-                "Varning! Ogiltiga argument f\u00F6r konstruktor: {0}"},
-        {"Illegal.Principal.Type.type", "Otill\u00E5ten identitetshavaretyp: {0}"},
-        {"Illegal.option.option", "Otill\u00E5tet alternativ: {0}"},
-        {"Usage.policytool.options.", "Syntax: policytool [alternativ]"},
-        {".file.file.policy.file.location",
-                "  [-file <fil>]    policyfilens plats"},
-        {"New", "Nytt"},
-        {"Open", "\u00D6ppna"},
-        {"Save", "Spara"},
-        {"Save.As", "Spara som"},
-        {"View.Warning.Log", "Visa varningslogg"},
-        {"Exit", "Avsluta"},
-        {"Add.Policy.Entry", "L\u00E4gg till policypost"},
-        {"Edit.Policy.Entry", "Redigera policypost"},
-        {"Remove.Policy.Entry", "Ta bort policypost"},
-        {"Edit", "Redigera"},
-        {"Retain", "Beh\u00E5ll"},
-
-        {"Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes",
-            "Varning! Filnamnet kan inneh\u00E5lla omv\u00E4nda snedstreck inom citattecken. Citattecken kr\u00E4vs inte f\u00F6r omv\u00E4nda snedstreck (verktyget hanterar detta n\u00E4r policyinneh\u00E5llet skrivs till det best\u00E4ndiga lagret).\n\nKlicka p\u00E5 Beh\u00E5ll f\u00F6r att beh\u00E5lla det angivna namnet, eller klicka p\u00E5 Redigera f\u00F6r att \u00E4ndra det."},
-
-        {"Add.Public.Key.Alias", "L\u00E4gg till offentligt nyckelalias"},
-        {"Remove.Public.Key.Alias", "Ta bort offentligt nyckelalias"},
-        {"File", "Fil"},
-        {"KeyStore", "Nyckellager"},
-        {"Policy.File.", "Policyfil:"},
-        {"Could.not.open.policy.file.policyFile.e.toString.",
-                "Kan inte \u00F6ppna policyfilen: {0}: {1}"},
-        {"Policy.Tool", "Policyverktyg"},
-        {"Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.",
-                "Det uppstod ett fel n\u00E4r policykonfigurationen skulle \u00F6ppnas. Se varningsloggen f\u00F6r mer information."},
-        {"Error", "Fel"},
-        {"OK", "OK"},
-        {"Status", "Status"},
-        {"Warning", "Varning"},
-        {"Permission.",
-                "Beh\u00F6righet:                                                       "},
-        {"Principal.Type.", "Identitetshavaretyp:"},
-        {"Principal.Name.", "Identitetshavare:"},
-        {"Target.Name.",
-                "M\u00E5l:                                                    "},
-        {"Actions.",
-                "Funktioner:                                                             "},
-        {"OK.to.overwrite.existing.file.filename.",
-                "Ska den befintliga filen {0} skrivas \u00F6ver?"},
-        {"Cancel", "Avbryt"},
-        {"CodeBase.", "Kodbas:"},
-        {"SignedBy.", "Signerad av:"},
-        {"Add.Principal", "L\u00E4gg till identitetshavare"},
-        {"Edit.Principal", "Redigera identitetshavare"},
-        {"Remove.Principal", "Ta bort identitetshavare"},
-        {"Principals.", "Identitetshavare:"},
-        {".Add.Permission", "  L\u00E4gg till beh\u00F6righet"},
-        {".Edit.Permission", "  Redigera beh\u00F6righet"},
-        {"Remove.Permission", "Ta bort beh\u00F6righet"},
-        {"Done", "Utf\u00F6rd"},
-        {"KeyStore.URL.", "URL f\u00F6r nyckellager:"},
-        {"KeyStore.Type.", "Nyckellagertyp:"},
-        {"KeyStore.Provider.", "Nyckellagerleverant\u00F6r:"},
-        {"KeyStore.Password.URL.", "URL f\u00F6r l\u00F6senord till nyckellager:"},
-        {"Principals", "Identitetshavare"},
-        {".Edit.Principal.", "  Redigera identitetshavare:"},
-        {".Add.New.Principal.", "  L\u00E4gg till ny identitetshavare:"},
-        {"Permissions", "Beh\u00F6righet"},
-        {".Edit.Permission.", "  Redigera beh\u00F6righet:"},
-        {".Add.New.Permission.", "  L\u00E4gg till ny beh\u00F6righet:"},
-        {"Signed.By.", "Signerad av:"},
-        {"Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name",
-            "Kan inte specificera identitetshavare med jokerteckenklass utan jokerteckennamn"},
-        {"Cannot.Specify.Principal.without.a.Name",
-            "Kan inte specificera identitetshavare utan namn"},
-        {"Permission.and.Target.Name.must.have.a.value",
-                "Beh\u00F6righet och m\u00E5lnamn m\u00E5ste ha ett v\u00E4rde"},
-        {"Remove.this.Policy.Entry.", "Vill du ta bort den h\u00E4r policyposten?"},
-        {"Overwrite.File", "Skriv \u00F6ver fil"},
-        {"Policy.successfully.written.to.filename",
-                "Policy har skrivits till {0}"},
-        {"null.filename", "nullfilnamn"},
-        {"Save.changes.", "Vill du spara \u00E4ndringarna?"},
-        {"Yes", "Ja"},
-        {"No", "Nej"},
-        {"Policy.Entry", "Policyfel"},
-        {"Save.Changes", "Spara \u00E4ndringar"},
-        {"No.Policy.Entry.selected", "Ingen policypost har valts"},
-        {"Unable.to.open.KeyStore.ex.toString.",
-                "Kan inte \u00F6ppna nyckellagret: {0}"},
-        {"No.principal.selected", "Ingen identitetshavare har valts"},
-        {"No.permission.selected", "Ingen beh\u00F6righet har valts"},
-        {"name", "namn"},
-        {"configuration.type", "konfigurationstyp"},
-        {"environment.variable.name", "variabelnamn f\u00F6r milj\u00F6"},
-        {"library.name", "biblioteksnamn"},
-        {"package.name", "paketnamn"},
-        {"policy.type", "policytyp"},
-        {"property.name", "egenskapsnamn"},
-        {"provider.name", "leverant\u00F6rsnamn"},
-        {"url", "url"},
-        {"method.list", "metodlista"},
-        {"request.headers.list", "beg\u00E4ranrubriklista"},
-        {"Principal.List", "Lista \u00F6ver identitetshavare"},
-        {"Permission.List", "Beh\u00F6righetslista"},
-        {"Code.Base", "Kodbas"},
-        {"KeyStore.U.R.L.", "URL f\u00F6r nyckellager:"},
-        {"KeyStore.Password.U.R.L.", "URL f\u00F6r l\u00F6senord till nyckellager:"}
-    };
-
-
-    /**
-     * Returns the contents of this <code>ResourceBundle</code>.
-     *
-     * <p>
-     *
-     * @return the contents of this <code>ResourceBundle</code>.
-     */
-    @Override
-    public Object[][] getContents() {
-        return contents;
-    }
-}
--- a/jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_zh_CN.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,159 +0,0 @@
-/*
- * Copyright (c) 2000, 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.security.tools.policytool;
-
-/**
- * <p> This class represents the <code>ResourceBundle</code>
- * for the policytool.
- *
- */
-public class Resources_zh_CN extends java.util.ListResourceBundle {
-
-    private static final Object[][] contents = {
-        {"NEWLINE", "\n"},
-        {"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.",
-                "\u8B66\u544A: \u522B\u540D {0} \u7684\u516C\u5171\u5BC6\u94A5\u4E0D\u5B58\u5728\u3002\u8BF7\u786E\u4FDD\u5DF2\u6B63\u786E\u914D\u7F6E\u5BC6\u94A5\u5E93\u3002"},
-        {"Warning.Class.not.found.class", "\u8B66\u544A: \u627E\u4E0D\u5230\u7C7B: {0}"},
-        {"Warning.Invalid.argument.s.for.constructor.arg",
-                "\u8B66\u544A: \u6784\u9020\u5668\u7684\u53C2\u6570\u65E0\u6548: {0}"},
-        {"Illegal.Principal.Type.type", "\u975E\u6CD5\u7684\u4E3B\u7528\u6237\u7C7B\u578B: {0}"},
-        {"Illegal.option.option", "\u975E\u6CD5\u9009\u9879: {0}"},
-        {"Usage.policytool.options.", "\u7528\u6CD5: policytool [\u9009\u9879]"},
-        {".file.file.policy.file.location",
-                "  [-file <file>]    \u7B56\u7565\u6587\u4EF6\u4F4D\u7F6E"},
-        {"New", "\u65B0\u5EFA"},
-        {"Open", "\u6253\u5F00"},
-        {"Save", "\u4FDD\u5B58"},
-        {"Save.As", "\u53E6\u5B58\u4E3A"},
-        {"View.Warning.Log", "\u67E5\u770B\u8B66\u544A\u65E5\u5FD7"},
-        {"Exit", "\u9000\u51FA"},
-        {"Add.Policy.Entry", "\u6DFB\u52A0\u7B56\u7565\u6761\u76EE"},
-        {"Edit.Policy.Entry", "\u7F16\u8F91\u7B56\u7565\u6761\u76EE"},
-        {"Remove.Policy.Entry", "\u5220\u9664\u7B56\u7565\u6761\u76EE"},
-        {"Edit", "\u7F16\u8F91"},
-        {"Retain", "\u4FDD\u7559"},
-
-        {"Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes",
-            "\u8B66\u544A: \u6587\u4EF6\u540D\u5305\u542B\u8F6C\u4E49\u7684\u53CD\u659C\u6760\u5B57\u7B26\u3002\u4E0D\u9700\u8981\u5BF9\u53CD\u659C\u6760\u5B57\u7B26\u8FDB\u884C\u8F6C\u4E49 (\u8BE5\u5DE5\u5177\u5728\u5C06\u7B56\u7565\u5185\u5BB9\u5199\u5165\u6C38\u4E45\u5B58\u50A8\u65F6\u4F1A\u6839\u636E\u9700\u8981\u5BF9\u5B57\u7B26\u8FDB\u884C\u8F6C\u4E49)\u3002\n\n\u5355\u51FB\u201C\u4FDD\u7559\u201D\u53EF\u4FDD\u7559\u8F93\u5165\u7684\u540D\u79F0, \u6216\u8005\u5355\u51FB\u201C\u7F16\u8F91\u201D\u53EF\u7F16\u8F91\u8BE5\u540D\u79F0\u3002"},
-
-        {"Add.Public.Key.Alias", "\u6DFB\u52A0\u516C\u5171\u5BC6\u94A5\u522B\u540D"},
-        {"Remove.Public.Key.Alias", "\u5220\u9664\u516C\u5171\u5BC6\u94A5\u522B\u540D"},
-        {"File", "\u6587\u4EF6"},
-        {"KeyStore", "\u5BC6\u94A5\u5E93"},
-        {"Policy.File.", "\u7B56\u7565\u6587\u4EF6:"},
-        {"Could.not.open.policy.file.policyFile.e.toString.",
-                "\u65E0\u6CD5\u6253\u5F00\u7B56\u7565\u6587\u4EF6: {0}: {1}"},
-        {"Policy.Tool", "\u7B56\u7565\u5DE5\u5177"},
-        {"Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.",
-                "\u6253\u5F00\u7B56\u7565\u914D\u7F6E\u65F6\u51FA\u9519\u3002\u6709\u5173\u8BE6\u7EC6\u4FE1\u606F, \u8BF7\u67E5\u770B\u8B66\u544A\u65E5\u5FD7\u3002"},
-        {"Error", "\u9519\u8BEF"},
-        {"OK", "\u786E\u5B9A"},
-        {"Status", "\u72B6\u6001"},
-        {"Warning", "\u8B66\u544A"},
-        {"Permission.",
-                "\u6743\u9650:                                                       "},
-        {"Principal.Type.", "\u4E3B\u7528\u6237\u7C7B\u578B:"},
-        {"Principal.Name.", "\u4E3B\u7528\u6237\u540D\u79F0:"},
-        {"Target.Name.",
-                "\u76EE\u6807\u540D\u79F0:                                                    "},
-        {"Actions.",
-                "\u64CD\u4F5C:                                                             "},
-        {"OK.to.overwrite.existing.file.filename.",
-                "\u786E\u8BA4\u8986\u76D6\u73B0\u6709\u7684\u6587\u4EF6{0}?"},
-        {"Cancel", "\u53D6\u6D88"},
-        {"CodeBase.", "CodeBase:"},
-        {"SignedBy.", "SignedBy:"},
-        {"Add.Principal", "\u6DFB\u52A0\u4E3B\u7528\u6237"},
-        {"Edit.Principal", "\u7F16\u8F91\u4E3B\u7528\u6237"},
-        {"Remove.Principal", "\u5220\u9664\u4E3B\u7528\u6237"},
-        {"Principals.", "\u4E3B\u7528\u6237:"},
-        {".Add.Permission", "  \u6DFB\u52A0\u6743\u9650"},
-        {".Edit.Permission", "  \u7F16\u8F91\u6743\u9650"},
-        {"Remove.Permission", "\u5220\u9664\u6743\u9650"},
-        {"Done", "\u5B8C\u6210"},
-        {"KeyStore.URL.", "\u5BC6\u94A5\u5E93 URL:"},
-        {"KeyStore.Type.", "\u5BC6\u94A5\u5E93\u7C7B\u578B:"},
-        {"KeyStore.Provider.", "\u5BC6\u94A5\u5E93\u63D0\u4F9B\u65B9:"},
-        {"KeyStore.Password.URL.", "\u5BC6\u94A5\u5E93\u53E3\u4EE4 URL:"},
-        {"Principals", "\u4E3B\u7528\u6237"},
-        {".Edit.Principal.", "  \u7F16\u8F91\u4E3B\u7528\u6237:"},
-        {".Add.New.Principal.", "  \u6DFB\u52A0\u65B0\u4E3B\u7528\u6237:"},
-        {"Permissions", "\u6743\u9650"},
-        {".Edit.Permission.", "  \u7F16\u8F91\u6743\u9650:"},
-        {".Add.New.Permission.", "  \u52A0\u5165\u65B0\u7684\u6743\u9650:"},
-        {"Signed.By.", "\u7B7E\u7F72\u4EBA: "},
-        {"Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name",
-            "\u6CA1\u6709\u901A\u914D\u7B26\u540D\u79F0, \u65E0\u6CD5\u4F7F\u7528\u901A\u914D\u7B26\u7C7B\u6307\u5B9A\u4E3B\u7528\u6237"},
-        {"Cannot.Specify.Principal.without.a.Name",
-            "\u6CA1\u6709\u540D\u79F0, \u65E0\u6CD5\u6307\u5B9A\u4E3B\u7528\u6237"},
-        {"Permission.and.Target.Name.must.have.a.value",
-                "\u6743\u9650\u53CA\u76EE\u6807\u540D\u5FC5\u987B\u6709\u4E00\u4E2A\u503C"},
-        {"Remove.this.Policy.Entry.", "\u662F\u5426\u5220\u9664\u6B64\u7B56\u7565\u6761\u76EE?"},
-        {"Overwrite.File", "\u8986\u76D6\u6587\u4EF6"},
-        {"Policy.successfully.written.to.filename",
-                "\u7B56\u7565\u5DF2\u6210\u529F\u5199\u5165\u5230{0}"},
-        {"null.filename", "\u7A7A\u6587\u4EF6\u540D"},
-        {"Save.changes.", "\u662F\u5426\u4FDD\u5B58\u6240\u505A\u7684\u66F4\u6539?"},
-        {"Yes", "\u662F"},
-        {"No", "\u5426"},
-        {"Policy.Entry", "\u7B56\u7565\u6761\u76EE"},
-        {"Save.Changes", "\u4FDD\u5B58\u66F4\u6539"},
-        {"No.Policy.Entry.selected", "\u6CA1\u6709\u9009\u62E9\u7B56\u7565\u6761\u76EE"},
-        {"Unable.to.open.KeyStore.ex.toString.",
-                "\u65E0\u6CD5\u6253\u5F00\u5BC6\u94A5\u5E93: {0}"},
-        {"No.principal.selected", "\u672A\u9009\u62E9\u4E3B\u7528\u6237"},
-        {"No.permission.selected", "\u6CA1\u6709\u9009\u62E9\u6743\u9650"},
-        {"name", "\u540D\u79F0"},
-        {"configuration.type", "\u914D\u7F6E\u7C7B\u578B"},
-        {"environment.variable.name", "\u73AF\u5883\u53D8\u91CF\u540D"},
-        {"library.name", "\u5E93\u540D\u79F0"},
-        {"package.name", "\u7A0B\u5E8F\u5305\u540D\u79F0"},
-        {"policy.type", "\u7B56\u7565\u7C7B\u578B"},
-        {"property.name", "\u5C5E\u6027\u540D\u79F0"},
-        {"provider.name", "\u63D0\u4F9B\u65B9\u540D\u79F0"},
-        {"url", "URL"},
-        {"method.list", "\u65B9\u6CD5\u5217\u8868"},
-        {"request.headers.list", "\u8BF7\u6C42\u6807\u5934\u5217\u8868"},
-        {"Principal.List", "\u4E3B\u7528\u6237\u5217\u8868"},
-        {"Permission.List", "\u6743\u9650\u5217\u8868"},
-        {"Code.Base", "\u4EE3\u7801\u5E93"},
-        {"KeyStore.U.R.L.", "\u5BC6\u94A5\u5E93 URL:"},
-        {"KeyStore.Password.U.R.L.", "\u5BC6\u94A5\u5E93\u53E3\u4EE4 URL:"}
-    };
-
-
-    /**
-     * Returns the contents of this <code>ResourceBundle</code>.
-     *
-     * <p>
-     *
-     * @return the contents of this <code>ResourceBundle</code>.
-     */
-    @Override
-    public Object[][] getContents() {
-        return contents;
-    }
-}
--- a/jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_zh_HK.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,156 +0,0 @@
-/*
- * Copyright (c) 2000, 2012, 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.security.tools.policytool;
-
-/**
- * <p> This class represents the <code>ResourceBundle</code>
- * for the policytool.
- *
- */
-public class Resources_zh_HK extends java.util.ListResourceBundle {
-
-    private static final Object[][] contents = {
-        {"NEWLINE", "\n"},
-        {"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.",
-                "\u8B66\u544A: \u5225\u540D {0} \u7684\u516C\u958B\u91D1\u9470\u4E0D\u5B58\u5728\u3002\u8ACB\u78BA\u5B9A\u91D1\u9470\u5132\u5B58\u5EAB\u914D\u7F6E\u6B63\u78BA\u3002"},
-        {"Warning.Class.not.found.class", "\u8B66\u544A: \u627E\u4E0D\u5230\u985E\u5225 {0}"},
-        {"Warning.Invalid.argument.s.for.constructor.arg",
-                "\u8B66\u544A: \u7121\u6548\u7684\u5EFA\u69CB\u5B50\u5F15\u6578: {0}"},
-        {"Illegal.Principal.Type.type", "\u7121\u6548\u7684 Principal \u985E\u578B: {0}"},
-        {"Illegal.option.option", "\u7121\u6548\u7684\u9078\u9805: {0}"},
-        {"Usage.policytool.options.", "\u7528\u6CD5: policytool [options]"},
-        {".file.file.policy.file.location",
-                "  [-file <file>]    \u539F\u5247\u6A94\u6848\u4F4D\u7F6E"},
-        {"New", "\u65B0\u589E"},
-        {"Open", "\u958B\u555F"},
-        {"Save", "\u5132\u5B58"},
-        {"Save.As", "\u53E6\u5B58\u65B0\u6A94"},
-        {"View.Warning.Log", "\u6AA2\u8996\u8B66\u544A\u8A18\u9304"},
-        {"Exit", "\u7D50\u675F"},
-        {"Add.Policy.Entry", "\u65B0\u589E\u539F\u5247\u9805\u76EE"},
-        {"Edit.Policy.Entry", "\u7DE8\u8F2F\u539F\u5247\u9805\u76EE"},
-        {"Remove.Policy.Entry", "\u79FB\u9664\u539F\u5247\u9805\u76EE"},
-        {"Edit", "\u7DE8\u8F2F"},
-        {"Retain", "\u4FDD\u7559"},
-
-        {"Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes",
-            "\u8B66\u544A: \u6A94\u6848\u540D\u7A31\u5305\u542B\u9041\u96E2\u53CD\u659C\u7DDA\u5B57\u5143\u3002\u4E0D\u9700\u8981\u9041\u96E2\u53CD\u659C\u7DDA\u5B57\u5143 (\u64B0\u5BEB\u539F\u5247\u5167\u5BB9\u81F3\u6C38\u4E45\u5B58\u653E\u5340\u6642\u9700\u8981\u5DE5\u5177\u9041\u96E2\u5B57\u5143)\u3002\n\n\u6309\u4E00\u4E0B\u300C\u4FDD\u7559\u300D\u4EE5\u4FDD\u7559\u8F38\u5165\u7684\u540D\u7A31\uFF0C\u6216\u6309\u4E00\u4E0B\u300C\u7DE8\u8F2F\u300D\u4EE5\u7DE8\u8F2F\u540D\u7A31\u3002"},
-
-        {"Add.Public.Key.Alias", "\u65B0\u589E\u516C\u958B\u91D1\u9470\u5225\u540D"},
-        {"Remove.Public.Key.Alias", "\u79FB\u9664\u516C\u958B\u91D1\u9470\u5225\u540D"},
-        {"File", "\u6A94\u6848"},
-        {"KeyStore", "\u91D1\u9470\u5132\u5B58\u5EAB"},
-        {"Policy.File.", "\u539F\u5247\u6A94\u6848: "},
-        {"Could.not.open.policy.file.policyFile.e.toString.",
-                "\u7121\u6CD5\u958B\u555F\u539F\u5247\u6A94\u6848: {0}: {1}"},
-        {"Policy.Tool", "\u539F\u5247\u5DE5\u5177"},
-        {"Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.",
-                "\u958B\u555F\u539F\u5247\u8A18\u7F6E\u6642\u767C\u751F\u932F\u8AA4\u3002\u8ACB\u6AA2\u8996\u8B66\u544A\u8A18\u9304\u4EE5\u53D6\u5F97\u66F4\u591A\u7684\u8CC7\u8A0A"},
-        {"Error", "\u932F\u8AA4"},
-        {"OK", "\u78BA\u5B9A"},
-        {"Status", "\u72C0\u614B"},
-        {"Warning", "\u8B66\u544A"},
-        {"Permission.",
-                "\u6B0A\u9650:                                                       "},
-        {"Principal.Type.", "Principal \u985E\u578B: "},
-        {"Principal.Name.", "Principal \u540D\u7A31: "},
-        {"Target.Name.",
-                "\u76EE\u6A19\u540D\u7A31:                                                    "},
-        {"Actions.",
-                "\u52D5\u4F5C:                                                             "},
-        {"OK.to.overwrite.existing.file.filename.",
-                "\u78BA\u8A8D\u8986\u5BEB\u73FE\u5B58\u7684\u6A94\u6848 {0}\uFF1F"},
-        {"Cancel", "\u53D6\u6D88"},
-        {"CodeBase.", "CodeBase:"},
-        {"SignedBy.", "SignedBy:"},
-        {"Add.Principal", "\u65B0\u589E Principal"},
-        {"Edit.Principal", "\u7DE8\u8F2F Principal"},
-        {"Remove.Principal", "\u79FB\u9664 Principal"},
-        {"Principals.", "Principal:"},
-        {".Add.Permission", "  \u65B0\u589E\u6B0A\u9650"},
-        {".Edit.Permission", "  \u7DE8\u8F2F\u6B0A\u9650"},
-        {"Remove.Permission", "\u79FB\u9664\u6B0A\u9650"},
-        {"Done", "\u5B8C\u6210"},
-        {"KeyStore.URL.", "\u91D1\u9470\u5132\u5B58\u5EAB URL: "},
-        {"KeyStore.Type.", "\u91D1\u9470\u5132\u5B58\u5EAB\u985E\u578B:"},
-        {"KeyStore.Provider.", "\u91D1\u9470\u5132\u5B58\u5EAB\u63D0\u4F9B\u8005:"},
-        {"KeyStore.Password.URL.", "\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC URL: "},
-        {"Principals", "Principal"},
-        {".Edit.Principal.", "  \u7DE8\u8F2F Principal: "},
-        {".Add.New.Principal.", "  \u65B0\u589E Principal: "},
-        {"Permissions", "\u6B0A\u9650"},
-        {".Edit.Permission.", "  \u7DE8\u8F2F\u6B0A\u9650:"},
-        {".Add.New.Permission.", "  \u65B0\u589E\u6B0A\u9650:"},
-        {"Signed.By.", "\u7C3D\u7F72\u4EBA: "},
-        {"Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name",
-            "\u6C92\u6709\u842C\u7528\u5B57\u5143\u540D\u7A31\uFF0C\u7121\u6CD5\u6307\u5B9A\u542B\u6709\u842C\u7528\u5B57\u5143\u985E\u5225\u7684 Principal"},
-        {"Cannot.Specify.Principal.without.a.Name",
-            "\u6C92\u6709\u540D\u7A31\uFF0C\u7121\u6CD5\u6307\u5B9A Principal"},
-        {"Permission.and.Target.Name.must.have.a.value",
-                "\u6B0A\u9650\u53CA\u76EE\u6A19\u540D\u7A31\u5FC5\u9808\u6709\u4E00\u500B\u503C\u3002"},
-        {"Remove.this.Policy.Entry.", "\u79FB\u9664\u9019\u500B\u539F\u5247\u9805\u76EE\uFF1F"},
-        {"Overwrite.File", "\u8986\u5BEB\u6A94\u6848"},
-        {"Policy.successfully.written.to.filename",
-                "\u539F\u5247\u6210\u529F\u5BEB\u5165\u81F3 {0}"},
-        {"null.filename", "\u7A7A\u503C\u6A94\u540D"},
-        {"Save.changes.", "\u5132\u5B58\u8B8A\u66F4\uFF1F"},
-        {"Yes", "\u662F"},
-        {"No", "\u5426"},
-        {"Policy.Entry", "\u539F\u5247\u9805\u76EE"},
-        {"Save.Changes", "\u5132\u5B58\u8B8A\u66F4"},
-        {"No.Policy.Entry.selected", "\u6C92\u6709\u9078\u53D6\u539F\u5247\u9805\u76EE"},
-        {"Unable.to.open.KeyStore.ex.toString.",
-                "\u7121\u6CD5\u958B\u555F\u91D1\u9470\u5132\u5B58\u5EAB: {0}"},
-        {"No.principal.selected", "\u672A\u9078\u53D6 Principal"},
-        {"No.permission.selected", "\u6C92\u6709\u9078\u53D6\u6B0A\u9650"},
-        {"name", "\u540D\u7A31"},
-        {"configuration.type", "\u7D44\u614B\u985E\u578B"},
-        {"environment.variable.name", "\u74B0\u5883\u8B8A\u6578\u540D\u7A31"},
-        {"library.name", "\u7A0B\u5F0F\u5EAB\u540D\u7A31"},
-        {"package.name", "\u5957\u88DD\u7A0B\u5F0F\u540D\u7A31"},
-        {"policy.type", "\u539F\u5247\u985E\u578B"},
-        {"property.name", "\u5C6C\u6027\u540D\u7A31"},
-        {"provider.name", "\u63D0\u4F9B\u8005\u540D\u7A31"},
-        {"Principal.List", "Principal \u6E05\u55AE"},
-        {"Permission.List", "\u6B0A\u9650\u6E05\u55AE"},
-        {"Code.Base", "\u4EE3\u78BC\u57FA\u6E96"},
-        {"KeyStore.U.R.L.", "\u91D1\u9470\u5132\u5B58\u5EAB URL:"},
-        {"KeyStore.Password.U.R.L.", "\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC URL:"}
-    };
-
-
-    /**
-     * Returns the contents of this <code>ResourceBundle</code>.
-     *
-     * <p>
-     *
-     * @return the contents of this <code>ResourceBundle</code>.
-     */
-    @Override
-    public Object[][] getContents() {
-        return contents;
-    }
-}
--- a/jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_zh_TW.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,159 +0,0 @@
-/*
- * Copyright (c) 2000, 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.security.tools.policytool;
-
-/**
- * <p> This class represents the <code>ResourceBundle</code>
- * for the policytool.
- *
- */
-public class Resources_zh_TW extends java.util.ListResourceBundle {
-
-    private static final Object[][] contents = {
-        {"NEWLINE", "\n"},
-        {"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.",
-                "\u8B66\u544A: \u5225\u540D {0} \u7684\u516C\u958B\u91D1\u9470\u4E0D\u5B58\u5728\u3002\u8ACB\u78BA\u5B9A\u91D1\u9470\u5132\u5B58\u5EAB\u914D\u7F6E\u6B63\u78BA\u3002"},
-        {"Warning.Class.not.found.class", "\u8B66\u544A: \u627E\u4E0D\u5230\u985E\u5225 {0}"},
-        {"Warning.Invalid.argument.s.for.constructor.arg",
-                "\u8B66\u544A: \u7121\u6548\u7684\u5EFA\u69CB\u5B50\u5F15\u6578: {0}"},
-        {"Illegal.Principal.Type.type", "\u7121\u6548\u7684 Principal \u985E\u578B: {0}"},
-        {"Illegal.option.option", "\u7121\u6548\u7684\u9078\u9805: {0}"},
-        {"Usage.policytool.options.", "\u7528\u6CD5: policytool [options]"},
-        {".file.file.policy.file.location",
-                "  [-file <file>]    \u539F\u5247\u6A94\u6848\u4F4D\u7F6E"},
-        {"New", "\u65B0\u589E"},
-        {"Open", "\u958B\u555F"},
-        {"Save", "\u5132\u5B58"},
-        {"Save.As", "\u53E6\u5B58\u65B0\u6A94"},
-        {"View.Warning.Log", "\u6AA2\u8996\u8B66\u544A\u8A18\u9304"},
-        {"Exit", "\u7D50\u675F"},
-        {"Add.Policy.Entry", "\u65B0\u589E\u539F\u5247\u9805\u76EE"},
-        {"Edit.Policy.Entry", "\u7DE8\u8F2F\u539F\u5247\u9805\u76EE"},
-        {"Remove.Policy.Entry", "\u79FB\u9664\u539F\u5247\u9805\u76EE"},
-        {"Edit", "\u7DE8\u8F2F"},
-        {"Retain", "\u4FDD\u7559"},
-
-        {"Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes",
-            "\u8B66\u544A: \u6A94\u6848\u540D\u7A31\u5305\u542B\u9041\u96E2\u53CD\u659C\u7DDA\u5B57\u5143\u3002\u4E0D\u9700\u8981\u9041\u96E2\u53CD\u659C\u7DDA\u5B57\u5143 (\u64B0\u5BEB\u539F\u5247\u5167\u5BB9\u81F3\u6C38\u4E45\u5B58\u653E\u5340\u6642\u9700\u8981\u5DE5\u5177\u9041\u96E2\u5B57\u5143)\u3002\n\n\u6309\u4E00\u4E0B\u300C\u4FDD\u7559\u300D\u4EE5\u4FDD\u7559\u8F38\u5165\u7684\u540D\u7A31\uFF0C\u6216\u6309\u4E00\u4E0B\u300C\u7DE8\u8F2F\u300D\u4EE5\u7DE8\u8F2F\u540D\u7A31\u3002"},
-
-        {"Add.Public.Key.Alias", "\u65B0\u589E\u516C\u958B\u91D1\u9470\u5225\u540D"},
-        {"Remove.Public.Key.Alias", "\u79FB\u9664\u516C\u958B\u91D1\u9470\u5225\u540D"},
-        {"File", "\u6A94\u6848"},
-        {"KeyStore", "\u91D1\u9470\u5132\u5B58\u5EAB"},
-        {"Policy.File.", "\u539F\u5247\u6A94\u6848: "},
-        {"Could.not.open.policy.file.policyFile.e.toString.",
-                "\u7121\u6CD5\u958B\u555F\u539F\u5247\u6A94\u6848: {0}: {1}"},
-        {"Policy.Tool", "\u539F\u5247\u5DE5\u5177"},
-        {"Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.",
-                "\u958B\u555F\u539F\u5247\u8A18\u7F6E\u6642\u767C\u751F\u932F\u8AA4\u3002\u8ACB\u6AA2\u8996\u8B66\u544A\u8A18\u9304\u4EE5\u53D6\u5F97\u66F4\u591A\u7684\u8CC7\u8A0A"},
-        {"Error", "\u932F\u8AA4"},
-        {"OK", "\u78BA\u5B9A"},
-        {"Status", "\u72C0\u614B"},
-        {"Warning", "\u8B66\u544A"},
-        {"Permission.",
-                "\u6B0A\u9650:                                                       "},
-        {"Principal.Type.", "Principal \u985E\u578B: "},
-        {"Principal.Name.", "Principal \u540D\u7A31: "},
-        {"Target.Name.",
-                "\u76EE\u6A19\u540D\u7A31:                                                    "},
-        {"Actions.",
-                "\u52D5\u4F5C:                                                             "},
-        {"OK.to.overwrite.existing.file.filename.",
-                "\u78BA\u8A8D\u8986\u5BEB\u73FE\u5B58\u7684\u6A94\u6848 {0}\uFF1F"},
-        {"Cancel", "\u53D6\u6D88"},
-        {"CodeBase.", "CodeBase:"},
-        {"SignedBy.", "SignedBy:"},
-        {"Add.Principal", "\u65B0\u589E Principal"},
-        {"Edit.Principal", "\u7DE8\u8F2F Principal"},
-        {"Remove.Principal", "\u79FB\u9664 Principal"},
-        {"Principals.", "Principal:"},
-        {".Add.Permission", "  \u65B0\u589E\u6B0A\u9650"},
-        {".Edit.Permission", "  \u7DE8\u8F2F\u6B0A\u9650"},
-        {"Remove.Permission", "\u79FB\u9664\u6B0A\u9650"},
-        {"Done", "\u5B8C\u6210"},
-        {"KeyStore.URL.", "\u91D1\u9470\u5132\u5B58\u5EAB URL: "},
-        {"KeyStore.Type.", "\u91D1\u9470\u5132\u5B58\u5EAB\u985E\u578B:"},
-        {"KeyStore.Provider.", "\u91D1\u9470\u5132\u5B58\u5EAB\u63D0\u4F9B\u8005:"},
-        {"KeyStore.Password.URL.", "\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC URL: "},
-        {"Principals", "Principal"},
-        {".Edit.Principal.", "  \u7DE8\u8F2F Principal: "},
-        {".Add.New.Principal.", "  \u65B0\u589E Principal: "},
-        {"Permissions", "\u6B0A\u9650"},
-        {".Edit.Permission.", "  \u7DE8\u8F2F\u6B0A\u9650:"},
-        {".Add.New.Permission.", "  \u65B0\u589E\u6B0A\u9650:"},
-        {"Signed.By.", "\u7C3D\u7F72\u4EBA: "},
-        {"Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name",
-            "\u6C92\u6709\u842C\u7528\u5B57\u5143\u540D\u7A31\uFF0C\u7121\u6CD5\u6307\u5B9A\u542B\u6709\u842C\u7528\u5B57\u5143\u985E\u5225\u7684 Principal"},
-        {"Cannot.Specify.Principal.without.a.Name",
-            "\u6C92\u6709\u540D\u7A31\uFF0C\u7121\u6CD5\u6307\u5B9A Principal"},
-        {"Permission.and.Target.Name.must.have.a.value",
-                "\u6B0A\u9650\u53CA\u76EE\u6A19\u540D\u7A31\u5FC5\u9808\u6709\u4E00\u500B\u503C\u3002"},
-        {"Remove.this.Policy.Entry.", "\u79FB\u9664\u9019\u500B\u539F\u5247\u9805\u76EE\uFF1F"},
-        {"Overwrite.File", "\u8986\u5BEB\u6A94\u6848"},
-        {"Policy.successfully.written.to.filename",
-                "\u539F\u5247\u6210\u529F\u5BEB\u5165\u81F3 {0}"},
-        {"null.filename", "\u7A7A\u503C\u6A94\u540D"},
-        {"Save.changes.", "\u5132\u5B58\u8B8A\u66F4\uFF1F"},
-        {"Yes", "\u662F"},
-        {"No", "\u5426"},
-        {"Policy.Entry", "\u539F\u5247\u9805\u76EE"},
-        {"Save.Changes", "\u5132\u5B58\u8B8A\u66F4"},
-        {"No.Policy.Entry.selected", "\u6C92\u6709\u9078\u53D6\u539F\u5247\u9805\u76EE"},
-        {"Unable.to.open.KeyStore.ex.toString.",
-                "\u7121\u6CD5\u958B\u555F\u91D1\u9470\u5132\u5B58\u5EAB: {0}"},
-        {"No.principal.selected", "\u672A\u9078\u53D6 Principal"},
-        {"No.permission.selected", "\u6C92\u6709\u9078\u53D6\u6B0A\u9650"},
-        {"name", "\u540D\u7A31"},
-        {"configuration.type", "\u7D44\u614B\u985E\u578B"},
-        {"environment.variable.name", "\u74B0\u5883\u8B8A\u6578\u540D\u7A31"},
-        {"library.name", "\u7A0B\u5F0F\u5EAB\u540D\u7A31"},
-        {"package.name", "\u5957\u88DD\u7A0B\u5F0F\u540D\u7A31"},
-        {"policy.type", "\u539F\u5247\u985E\u578B"},
-        {"property.name", "\u5C6C\u6027\u540D\u7A31"},
-        {"provider.name", "\u63D0\u4F9B\u8005\u540D\u7A31"},
-        {"url", "URL"},
-        {"method.list", "\u65B9\u6CD5\u6E05\u55AE"},
-        {"request.headers.list", "\u8981\u6C42\u6A19\u982D\u6E05\u55AE"},
-        {"Principal.List", "Principal \u6E05\u55AE"},
-        {"Permission.List", "\u6B0A\u9650\u6E05\u55AE"},
-        {"Code.Base", "\u4EE3\u78BC\u57FA\u6E96"},
-        {"KeyStore.U.R.L.", "\u91D1\u9470\u5132\u5B58\u5EAB URL:"},
-        {"KeyStore.Password.U.R.L.", "\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC URL:"}
-    };
-
-
-    /**
-     * Returns the contents of this <code>ResourceBundle</code>.
-     *
-     * <p>
-     *
-     * @return the contents of this <code>ResourceBundle</code>.
-     */
-    @Override
-    public Object[][] getContents() {
-        return contents;
-    }
-}
--- a/jdk/src/jdk.runtime/share/classes/sun/tracing/MultiplexProviderFactory.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,137 +0,0 @@
-/*
- * Copyright (c) 2008, 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.tracing;
-
-import java.lang.reflect.Method;
-import java.lang.reflect.InvocationTargetException;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Set;
-
-import com.sun.tracing.ProviderFactory;
-import com.sun.tracing.Provider;
-import com.sun.tracing.Probe;
-
-/**
- * Factory class to create tracing Providers.
- *
- * This factory creates a "multiplex provider", which is a provider that
- * encapsulates a list of providers and whose probes trigger a corresponding
- * trigger in each of the encapsulated providers' probes.
- *
- * This is used when there are multiple tracing frameworks activated at once.
- * A user-defined provider gets implementation for each of the activated
- * frameworks and this multiplex framework is what is ultimately passed
- * back to the user.  All probe triggers are multiplexed to each
- * active framework.
- *
- * @since 1.7
- */
-public class MultiplexProviderFactory extends ProviderFactory {
-
-    private Set<ProviderFactory> factories;
-
-    public MultiplexProviderFactory(Set<ProviderFactory> factories) {
-        this.factories = factories;
-    }
-
-    public <T extends Provider> T createProvider(Class<T> cls) {
-        HashSet<Provider> providers = new HashSet<Provider>();
-        for (ProviderFactory factory : factories) {
-            providers.add(factory.createProvider(cls));
-        }
-        MultiplexProvider provider = new MultiplexProvider(cls, providers);
-        provider.init();
-        return provider.newProxyInstance();
-    }
-}
-
-class MultiplexProvider extends ProviderSkeleton {
-
-    private Set<Provider> providers;
-
-    protected ProbeSkeleton createProbe(Method m) {
-        return new MultiplexProbe(m, providers);
-    }
-
-    MultiplexProvider(Class<? extends Provider> type, Set<Provider> providers) {
-        super(type);
-        this.providers = providers;
-    }
-
-    public void dispose() {
-        for (Provider p : providers) {
-            p.dispose();
-        }
-        super.dispose();
-    }
-}
-
-class MultiplexProbe extends ProbeSkeleton {
-
-    private Set<Probe> probes;
-
-    MultiplexProbe(Method m, Set<Provider> providers) {
-        super(m.getParameterTypes());
-        probes = new HashSet<Probe>();
-        for (Provider p : providers) {
-            Probe probe = p.getProbe(m);
-            if (probe != null) {
-                probes.add(probe);
-            }
-        }
-    }
-
-    public boolean isEnabled() {
-        for (Probe p : probes) {
-            if (p.isEnabled()) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    public void uncheckedTrigger(Object[] args) {
-        for (Probe p : probes) {
-            try {
-                // try the fast path
-                ProbeSkeleton ps = (ProbeSkeleton)p;
-                ps.uncheckedTrigger(args);
-            } catch (ClassCastException e) {
-                // Probe.trigger takes an "Object ..." varargs parameter,
-                // so we can't call it directly.
-                try {
-                    Method m = Probe.class.getMethod(
-                        "trigger", Class.forName("[java.lang.Object"));
-                    m.invoke(p, args);
-                } catch (Exception e1) {
-                    assert false; // This shouldn't happen
-                }
-            }
-        }
-    }
-}
-
--- a/jdk/src/jdk.runtime/share/classes/sun/tracing/NullProviderFactory.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2008, 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.tracing;
-
-import java.lang.reflect.Method;
-
-import com.sun.tracing.ProviderFactory;
-import com.sun.tracing.Provider;
-
-/**
- * Factory class to create tracing Providers.
- *
- * This factory will create tracing instances that do nothing.
- * It is used when no tracing is desired, but Provider instances still
- * must be generated so that tracing calls in the application continue to
- * run.
- *
- * @since 1.7
- */
-public class NullProviderFactory extends ProviderFactory {
-
-    /**
-     * Creates and returns a Null provider.
-     *
-     * See comments at {@code ProviderSkeleton.createProvider()} for more
-     * details.
-     *
-     * @return a provider whose probe trigger are no-ops.
-     */
-    public <T extends Provider> T createProvider(Class<T> cls) {
-        NullProvider provider = new NullProvider(cls);
-        provider.init();
-        return provider.newProxyInstance();
-    }
-}
-
-class NullProvider extends ProviderSkeleton {
-
-    NullProvider(Class<? extends Provider> type) {
-        super(type);
-    }
-
-    protected ProbeSkeleton createProbe(Method m) {
-        return new NullProbe(m.getParameterTypes());
-    }
-}
-
-class NullProbe extends ProbeSkeleton {
-
-    public NullProbe(Class<?>[] parameters) {
-        super(parameters);
-    }
-
-    public boolean isEnabled() {
-        return false;
-    }
-
-    public void uncheckedTrigger(Object[] args) {
-    }
-}
-
--- a/jdk/src/jdk.runtime/share/classes/sun/tracing/PrintStreamProviderFactory.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,120 +0,0 @@
-/*
- * Copyright (c) 2008, 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.tracing;
-
-import java.lang.reflect.Method;
-import java.io.PrintStream;
-import java.util.HashMap;
-
-import com.sun.tracing.ProviderFactory;
-import com.sun.tracing.Provider;
-import com.sun.tracing.ProviderName;
-import com.sun.tracing.Probe;
-import com.sun.tracing.ProbeName;
-
-/**
- * Factory class to create tracing Providers.
- *
- * This factory will create tracing instances that print to a PrintStream
- * when activated.
- *
- * @since 1.7
- */
-public class PrintStreamProviderFactory extends ProviderFactory {
-
-    private PrintStream stream;
-
-    public PrintStreamProviderFactory(PrintStream stream) {
-        this.stream = stream;
-    }
-
-    public <T extends Provider> T createProvider(Class<T> cls) {
-        PrintStreamProvider provider = new PrintStreamProvider(cls, stream);
-        provider.init();
-        return provider.newProxyInstance();
-    }
-}
-
-class PrintStreamProvider extends ProviderSkeleton {
-
-    private PrintStream stream;
-    private String providerName;
-
-    protected ProbeSkeleton createProbe(Method m) {
-        String probeName = getAnnotationString(m, ProbeName.class, m.getName());
-        return new PrintStreamProbe(this, probeName, m.getParameterTypes());
-    }
-
-    PrintStreamProvider(Class<? extends Provider> type, PrintStream stream) {
-        super(type);
-        this.stream = stream;
-        this.providerName = getProviderName();
-    }
-
-    PrintStream getStream() {
-        return stream;
-    }
-
-    String getName() {
-        return providerName;
-    }
-}
-
-class PrintStreamProbe extends ProbeSkeleton {
-
-    private PrintStreamProvider provider;
-    private String name;
-
-    PrintStreamProbe(PrintStreamProvider p, String name, Class<?>[] params) {
-        super(params);
-        this.provider = p;
-        this.name = name;
-    }
-
-    public boolean isEnabled() {
-        return true;
-    }
-
-    public void uncheckedTrigger(Object[] args) {
-        StringBuilder sb = new StringBuilder();
-        sb.append(provider.getName());
-        sb.append(".");
-        sb.append(name);
-        sb.append("(");
-        boolean first = true;
-        for (Object o : args) {
-            if (first == false) {
-                sb.append(",");
-            } else {
-                first = false;
-            }
-            sb.append(o.toString());
-        }
-        sb.append(")");
-        provider.getStream().println(sb.toString());
-    }
-}
-
--- a/jdk/src/jdk.runtime/share/classes/sun/tracing/ProbeSkeleton.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 2008, 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.tracing;
-
-import java.lang.reflect.Method;
-import java.lang.reflect.Field;
-import com.sun.tracing.Probe;
-
-/**
- * Provides common code for implementation of {@code Probe} classes.
- *
- * @since 1.7
- */
-public abstract class ProbeSkeleton implements Probe {
-
-    protected Class<?>[] parameters;
-
-    protected ProbeSkeleton(Class<?>[] parameters) {
-        this.parameters = parameters;
-    }
-
-    public abstract boolean isEnabled();  // framework-dependent
-
-    /**
-     * Triggers the probe with verified arguments.
-     *
-     * The caller of this method must have already determined that the
-     * arity and types of the arguments match what the probe was
-     * declared with.
-     */
-    public abstract void uncheckedTrigger(Object[] args); // framework-dependent
-
-    private static boolean isAssignable(Object o, Class<?> formal) {
-        if (o != null) {
-            if ( !formal.isInstance(o) ) {
-                if ( formal.isPrimitive() ) { // o might be a boxed primitive
-                    try {
-                        // Yuck.  There must be a better way of doing this
-                        Field f = o.getClass().getField("TYPE");
-                        return formal.isAssignableFrom((Class<?>)f.get(null));
-                    } catch (Exception e) {
-                        /* fall-through. */
-                    }
-                }
-                return false;
-            }
-        }
-        return true;
-    }
-
-    /**
-     * Performs a type-check of the parameters before triggering the probe.
-     */
-    public void trigger(Object ... args) {
-        if (args.length != parameters.length) {
-            throw new IllegalArgumentException("Wrong number of arguments");
-        } else {
-            for (int i = 0; i < parameters.length; ++i) {
-                if ( !isAssignable(args[i], parameters[i]) ) {
-                    throw new IllegalArgumentException(
-                            "Wrong type of argument at position " + i);
-                }
-            }
-            uncheckedTrigger(args);
-        }
-    }
-}
--- a/jdk/src/jdk.runtime/share/classes/sun/tracing/ProviderSkeleton.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,273 +0,0 @@
-/*
- * Copyright (c) 2008, 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 sun.tracing;
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.AnnotatedElement;
-import java.lang.annotation.Annotation;
-import java.util.HashMap;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
-import com.sun.tracing.Provider;
-import com.sun.tracing.Probe;
-import com.sun.tracing.ProviderName;
-
-/**
- * Provides a common code for implementation of {@code Provider} classes.
- *
- * Each tracing subsystem needs to provide three classes, a factory
- * (derived from {@code ProviderFactory}, a provider (a subclass of
- * {@code Provider}, and a probe type (subclass of {@code ProbeSkeleton}).
- *
- * The factory object takes a user-defined interface and provides an
- * implementation of it whose method calls will trigger probes in the
- * tracing framework.
- *
- * The framework's provider class, and its instances, are not seen by the
- * user at all -- they usually sit in the background and receive and dispatch
- * the calls to the user's provider interface.  The {@code ProviderSkeleton}
- * class provides almost all of the implementation needed by a framework
- * provider.  Framework providers must only provide a constructor and
- * disposal method, and implement the {@code createProbe} method to create
- * an appropriate {@code ProbeSkeleton} subclass.
- *
- * The framework's probe class provides the implementation of the two
- * probe methods, {@code isEnabled()} and {@code uncheckedTrigger()}.  Both are
- * framework-dependent implementations.
- *
- * @since 1.7
- */
-
-public abstract class ProviderSkeleton implements InvocationHandler, Provider {
-
-    protected boolean active; // set to false after dispose() is called
-    protected Class<? extends Provider> providerType; // user's interface
-    protected HashMap<Method, ProbeSkeleton> probes; // methods to probes
-
-
-    /**
-     * Creates a framework-specific probe subtype.
-     *
-     * This method is implemented by the framework's provider and returns
-     * framework-specific probes for a method.
-     *
-     * @param method A method in the user's interface
-     * @return a subclass of ProbeSkeleton for the particular framework.
-     */
-    protected abstract ProbeSkeleton createProbe(Method method);
-
-    /**
-     * Initializes the provider.
-     *
-     * @param type the user's interface
-     */
-    protected ProviderSkeleton(Class<? extends Provider> type) {
-        this.active = false; // in case of some error during initialization
-        this.providerType = type;
-        this.probes = new HashMap<Method,ProbeSkeleton>();
-    }
-
-    /**
-     * Post-constructor initialization routine.
-     *
-     * Subclass instances must be initialized before they can create probes.
-     * It is up to the factory implementations to call this after construction.
-     */
-    public void init() {
-        Method[] methods = AccessController.doPrivileged(new PrivilegedAction<Method[]>() {
-            public Method[] run() {
-                return providerType.getDeclaredMethods();
-            }
-        });
-
-        for (Method m : methods) {
-            if ( m.getReturnType() != Void.TYPE ) {
-                throw new IllegalArgumentException(
-                   "Return value of method is not void");
-            } else {
-                probes.put(m, createProbe(m));
-            }
-        }
-        this.active = true;
-    }
-
-    /**
-     * Magic routine which creates an implementation of the user's interface.
-     *
-     * This method creates the instance of the user's interface which is
-     * passed back to the user.  Every call upon that interface will be
-     * redirected to the {@code invoke()} method of this class (until
-     * overridden by the VM).
-     *
-     * @return an implementation of the user's interface
-     */
-    @SuppressWarnings("unchecked")
-    public <T extends Provider> T newProxyInstance() {
-        final InvocationHandler ih = this;
-        return AccessController.doPrivileged(new PrivilegedAction<T>() {
-            public T run() {
-               return (T)Proxy.newProxyInstance(providerType.getClassLoader(),
-                   new Class<?>[] { providerType }, ih);
-            }});
-    }
-
-    /**
-     * Triggers a framework probe when a user interface method is called.
-     *
-     * This method dispatches a user interface method call to the appropriate
-     * probe associated with this framework.
-     *
-     * If the invoked method is not a user-defined member of the interface,
-     * then it is a member of {@code Provider} or {@code Object} and we
-     * invoke the method directly.
-     *
-     * @param proxy the instance whose method was invoked
-     * @param method the method that was called
-     * @param args the arguments passed in the call.
-     * @return always null, if the method is a user-defined probe
-     */
-    public Object invoke(Object proxy, Method method, Object[] args) {
-        Class<?> declaringClass = method.getDeclaringClass();
-        // not a provider subtype's own method
-        if (declaringClass != providerType) {
-            try {
-                // delegate only to methods declared by
-                // com.sun.tracing.Provider or java.lang.Object
-                if (declaringClass == Provider.class ||
-                    declaringClass == Object.class) {
-                    return method.invoke(this, args);
-                } else {
-                    // assert false : "this should never happen"
-                    //    reaching here would indicate a breach
-                    //    in security in the higher layers
-                    throw new SecurityException();
-                }
-            } catch (IllegalAccessException e) {
-                assert false;
-            } catch (InvocationTargetException e) {
-                assert false;
-            }
-        } else {
-            triggerProbe(method, args);
-        }
-        return null;
-    }
-
-    /**
-     * Direct accessor for {@code Probe} objects.
-     *
-     * @param m the method corresponding to a probe
-     * @return the method associated probe object, or null
-     */
-    public Probe getProbe(Method m) {
-        return active ? probes.get(m) : null;
-    }
-
-    /**
-     * Default provider disposal method.
-     *
-     * This is overridden in subclasses as needed.
-     */
-    public void dispose() {
-        active = false;
-        probes.clear();
-    }
-
-    /**
-     * Gets the user-specified provider name for the user's interface.
-     *
-     * If the user's interface has a {@ProviderName} annotation, that value
-     * is used.  Otherwise we use the simple name of the user interface's class.
-     * @return the provider name
-     */
-    protected String getProviderName() {
-        return getAnnotationString(
-                providerType, ProviderName.class, providerType.getSimpleName());
-    }
-
-    /**
-     * Utility method for getting a string value from an annotation.
-     *
-     * Used for getting a string value from an annotation with a 'value' method.
-     *
-     * @param element the element that was annotated, either a class or method
-     * @param annotation the class of the annotation we're interested in
-     * @param defaultValue the value to return if the annotation doesn't
-     * exist, doesn't have a "value", or the value is empty.
-     */
-    protected static String getAnnotationString(
-            AnnotatedElement element, Class<? extends Annotation> annotation,
-            String defaultValue) {
-        String ret = (String)getAnnotationValue(
-                element, annotation, "value", defaultValue);
-        return ret.isEmpty() ? defaultValue : ret;
-    }
-
-    /**
-     * Utility method for calling an arbitrary method in an annotation.
-     *
-     * @param element the element that was annotated, either a class or method
-     * @param annotation the class of the annotation we're interested in
-     * @param methodName the name of the method in the annotation we wish
-     * to call.
-     * @param defaultValue the value to return if the annotation doesn't
-     * exist, or we couldn't invoke the method for some reason.
-     * @return the result of calling the annotation method, or the default.
-     */
-    protected static Object getAnnotationValue(
-            AnnotatedElement element, Class<? extends Annotation> annotation,
-            String methodName, Object defaultValue) {
-        Object ret = defaultValue;
-        try {
-            Method m = annotation.getMethod(methodName);
-            Annotation a = element.getAnnotation(annotation);
-            ret = m.invoke(a);
-        } catch (NoSuchMethodException e) {
-            assert false;
-        } catch (IllegalAccessException e) {
-            assert false;
-        } catch (InvocationTargetException e) {
-            assert false;
-        } catch (NullPointerException e) {
-            assert false;
-        }
-        return ret;
-    }
-
-    protected void triggerProbe(Method method, Object[] args) {
-        if (active) {
-            ProbeSkeleton p = probes.get(method);
-            if (p != null) {
-                // Skips argument check -- already done by javac
-                p.uncheckedTrigger(args);
-            }
-        }
-    }
-}
--- a/jdk/src/jdk.runtime/share/classes/sun/tracing/dtrace/Activation.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,107 +0,0 @@
-/*
- * Copyright (c) 2008, 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.tracing.dtrace;
-
-import java.lang.ref.WeakReference;
-import java.lang.ref.ReferenceQueue;
-import java.security.Permission;
-import java.util.HashSet;
-
-class Activation {
-    private SystemResource resource;
-    private int referenceCount;
-
-    Activation(String moduleName, DTraceProvider[] providers) {
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            Permission perm =
-                new RuntimePermission("com.sun.tracing.dtrace.createProvider");
-            security.checkPermission(perm);
-        }
-        referenceCount = providers.length;
-        for (DTraceProvider p : providers) {
-            p.setActivation(this);
-        }
-        resource = new SystemResource(
-            this, JVM.activate(moduleName, providers));
-    }
-
-    void disposeProvider(DTraceProvider p) {
-        if (--referenceCount == 0) {
-            resource.dispose();
-        }
-    }
-}
-
-/**
- * The native resource part of an Activation.
- *
- * This holds the native handle.
- *
- * If the user loses a reference to a set of Providers without disposing them,
- * and GC determines the Activation is unreachable, then the next
- * activation or flush call will automatically dispose the unreachable objects
- *
- * The SystemResource instances are creating during activation, and
- * unattached during disposal.  When created, they always have a
- * strong reference to them via the {@code resources} static member.  Explicit
- * {@code dispose} calls will unregister the native resource and remove
- * references to the SystemResource object.  Absent an explicit dispose,
- * when their associated Activation object becomes garbage, the SystemResource
- * object will be enqueued on the reference queue and disposed at the
- * next call to {@code flush}.
- */
-class SystemResource extends WeakReference<Activation> {
-
-    private long handle;
-
-    private static ReferenceQueue<Activation> referenceQueue =
-        referenceQueue = new ReferenceQueue<Activation>();
-    static HashSet<SystemResource> resources = new HashSet<SystemResource>();
-
-    SystemResource(Activation activation, long handle) {
-        super(activation, referenceQueue);
-        this.handle = handle;
-        flush();
-        resources.add(this);
-    }
-
-    void dispose() {
-        JVM.dispose(handle);
-        resources.remove(this);
-        handle = 0;
-    }
-
-    static void flush() {
-        SystemResource resource = null;
-        while ((resource = (SystemResource)referenceQueue.poll()) != null) {
-            if (resource.handle != 0) {
-                resource.dispose();
-            }
-        }
-    }
-}
-
--- a/jdk/src/jdk.runtime/share/classes/sun/tracing/dtrace/DTraceProbe.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 2008, 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.tracing.dtrace;
-
-import java.lang.reflect.Method;
-import java.lang.reflect.InvocationTargetException;
-
-import sun.tracing.ProbeSkeleton;
-
-class DTraceProbe extends ProbeSkeleton {
-    private Object proxy;
-    private Method declared_method;
-    private Method implementing_method;
-
-    DTraceProbe(Object proxy, Method m) {
-        super(m.getParameterTypes());
-        this.proxy = proxy;
-        this.declared_method = m;
-        try {
-            // The JVM will override the proxy method's implementation with
-            // a version that will invoke the probe.
-            this.implementing_method =  proxy.getClass().getMethod(
-                m.getName(), m.getParameterTypes());
-        } catch (NoSuchMethodException e) {
-            throw new RuntimeException("Internal error, wrong proxy class");
-        }
-    }
-
-    public boolean isEnabled() {
-        return JVM.isEnabled(implementing_method);
-    }
-
-    public void uncheckedTrigger(Object[] args) {
-        try {
-            implementing_method.invoke(proxy, args);
-        } catch (IllegalAccessException e) {
-            assert false;
-        } catch (InvocationTargetException e) {
-            assert false;
-        }
-    }
-
-    String getProbeName() {
-        return DTraceProvider.getProbeName(declared_method);
-    }
-
-    String getFunctionName() {
-        return DTraceProvider.getFunctionName(declared_method);
-    }
-
-    Method getMethod() {
-        return implementing_method;
-    }
-
-    Class<?>[] getParameterTypes() {
-        return this.parameters;
-    }
-}
-
--- a/jdk/src/jdk.runtime/share/classes/sun/tracing/dtrace/DTraceProvider.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,210 +0,0 @@
-/*
- * Copyright (c) 2008, 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 sun.tracing.dtrace;
-
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.annotation.Annotation;
-
-import sun.tracing.ProviderSkeleton;
-import sun.tracing.ProbeSkeleton;
-import com.sun.tracing.Provider;
-import com.sun.tracing.ProbeName;
-import com.sun.tracing.dtrace.Attributes;
-import com.sun.tracing.dtrace.ModuleName;
-import com.sun.tracing.dtrace.FunctionName;
-import com.sun.tracing.dtrace.StabilityLevel;
-import com.sun.tracing.dtrace.DependencyClass;
-
-import sun.misc.ProxyGenerator;
-
-class DTraceProvider extends ProviderSkeleton {
-
-    private Activation activation;
-    private Object proxy;
-
-    // For proxy generation
-    private final static Class<?>[] constructorParams = { InvocationHandler.class };
-    private final String proxyClassNamePrefix = "$DTraceTracingProxy";
-
-    static final String DEFAULT_MODULE = "java_tracing";
-    static final String DEFAULT_FUNCTION = "unspecified";
-
-    private static long nextUniqueNumber = 0;
-    private static synchronized long getUniqueNumber() {
-        return nextUniqueNumber++;
-    }
-
-    protected ProbeSkeleton createProbe(Method m) {
-        return new DTraceProbe(proxy, m);
-    }
-
-    DTraceProvider(Class<? extends Provider> type) {
-        super(type);
-    }
-
-    void setProxy(Object p) {
-        proxy = p;
-    }
-
-    void setActivation(Activation a) {
-        this.activation = a;
-    }
-
-    public void dispose() {
-        if (activation != null) {
-            activation.disposeProvider(this);
-            activation = null;
-        }
-        super.dispose();
-    }
-
-    /**
-     * Magic routine which creates an implementation of the user's interface.
-     *
-     * This method uses the ProxyGenerator directly to bypass the
-     * java.lang.reflect.proxy cache so that we get a unique class each
-     * time it's called and can't accidently reuse a $Proxy class.
-     *
-     * @return an implementation of the user's interface
-     */
-    @SuppressWarnings("unchecked")
-    public <T extends Provider> T newProxyInstance() {
-        /*
-         * Choose a name for the proxy class to generate.
-         */
-        long num = getUniqueNumber();
-
-        String proxyPkg = "";
-        if (!Modifier.isPublic(providerType.getModifiers())) {
-            String name = providerType.getName();
-            int n = name.lastIndexOf('.');
-            proxyPkg = ((n == -1) ? "" : name.substring(0, n + 1));
-        }
-
-        String proxyName = proxyPkg + proxyClassNamePrefix + num;
-
-        /*
-         * Generate the specified proxy class.
-         */
-        Class<?> proxyClass = null;
-        byte[] proxyClassFile = ProxyGenerator.generateProxyClass(
-                proxyName, new Class<?>[] { providerType });
-        try {
-            proxyClass = JVM.defineClass(
-                providerType.getClassLoader(), proxyName,
-                proxyClassFile, 0, proxyClassFile.length);
-        } catch (ClassFormatError e) {
-            /*
-             * A ClassFormatError here means that (barring bugs in the
-             * proxy class generation code) there was some other
-             * invalid aspect of the arguments supplied to the proxy
-             * class creation (such as virtual machine limitations
-             * exceeded).
-             */
-            throw new IllegalArgumentException(e.toString());
-        }
-
-        /*
-         * Invoke its constructor with the designated invocation handler.
-         */
-        try {
-            Constructor<?> cons = proxyClass.getConstructor(constructorParams);
-            return (T)cons.newInstance(new Object[] { this });
-        } catch (ReflectiveOperationException e) {
-            throw new InternalError(e.toString(), e);
-        }
-    }
-
-    // In the normal case, the proxy object's method implementations will call
-    // this method (it usually calls the ProviderSkeleton's version).  That
-    // method uses the passed 'method' object to lookup the associated
-    // 'ProbeSkeleton' and calls uncheckedTrigger() on that probe to cause the
-    // probe to fire.  DTrace probes are different in that the proxy class's
-    // methods are immediately overridden with native code to fire the probe
-    // directly.  So this method should never get invoked.  We also wire up the
-    // DTraceProbe.uncheckedTrigger() method to call the proxy method instead
-    // of doing the work itself.
-    protected void triggerProbe(Method method, Object[] args) {
-        assert false : "This method should have been overridden by the JVM";
-    }
-
-    public String getProviderName() {
-        return super.getProviderName();
-    }
-
-    String getModuleName() {
-        return getAnnotationString(
-            providerType, ModuleName.class, DEFAULT_MODULE);
-    }
-
-    static String getProbeName(Method method) {
-        return getAnnotationString(
-            method, ProbeName.class, method.getName());
-    }
-
-    static String getFunctionName(Method method) {
-        return getAnnotationString(
-            method, FunctionName.class, DEFAULT_FUNCTION);
-    }
-
-    DTraceProbe[] getProbes() {
-        return probes.values().toArray(new DTraceProbe[0]);
-    }
-
-    StabilityLevel getNameStabilityFor(Class<? extends Annotation> type) {
-        Attributes attrs = (Attributes)getAnnotationValue(
-            providerType, type, "value", null);
-        if (attrs == null) {
-            return StabilityLevel.PRIVATE;
-        } else {
-            return attrs.name();
-        }
-    }
-
-    StabilityLevel getDataStabilityFor(Class<? extends Annotation> type) {
-        Attributes attrs = (Attributes)getAnnotationValue(
-            providerType, type, "value", null);
-        if (attrs == null) {
-            return StabilityLevel.PRIVATE;
-        } else {
-            return attrs.data();
-        }
-    }
-
-    DependencyClass getDependencyClassFor(Class<? extends Annotation> type) {
-        Attributes attrs = (Attributes)getAnnotationValue(
-            providerType, type, "value", null);
-        if (attrs == null) {
-            return DependencyClass.UNKNOWN;
-        } else {
-            return attrs.dependency();
-        }
-    }
-}
--- a/jdk/src/jdk.runtime/share/classes/sun/tracing/dtrace/DTraceProviderFactory.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,156 +0,0 @@
-/*
- * Copyright (c) 2008, 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.tracing.dtrace;
-
-import java.util.Map;
-import java.util.Set;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.security.Permission;
-
-import com.sun.tracing.ProviderFactory;
-import com.sun.tracing.Provider;
-
-/**
- * Factory class to create JSDT Providers.
- *
- * This class contains methods to create an instance of a Provider
- * interface which can be used to place tracepoints in an application.
- * Method calls upon that instance trigger DTrace probes that
- * are visible from DTrace scripts.   Such calls have no other
- * side effects in the application.
- * <p>
- * The DTrace script mechanisms for listing and matching probes will not see
- * nor match any probes until the provider they reside in is created by a
- * call to {@code createProvider()} (or {@code createProviders()}).
- * <p>
- * Providers that are created should be disposed of when they are no longer
- * needed to free up system resources, at which point the associated
- * DTrace probes will no longer be available to DTrace.  One disposes a
- * provider by calling
- * {@link com.sun.tracing.Provider#dispose Provider.dispose()} on a
- * created provider instance.
- *
- * @since 1.7
- */
-public final class DTraceProviderFactory extends ProviderFactory {
-    /**
-     * Creates an instance of a provider which can then be used to trigger
-     * DTrace probes.
-     *
-     * The provider specification, provided as an argument, should only
-     * contain methods which have a 'void' return type and String or
-     * integer-based typed arguments (long, int, short, char, byte, or boolean).
-     *
-     * @param cls A user-defined interface which extends {@code Provider}.
-     * @return An instance of the interface which is used to trigger
-     * the DTrace probes.
-     * @throws java.lang.SecurityException if a security manager has been
-     * installed and it denies
-     * RuntimePermission("com.sun.dtrace.jsdt.createProvider")
-     * @throws java.lang.IllegalArgumentException if the interface contains
-     * methods that do not return null, or that contain arguments that are
-     * not String or integer types.
-     */
-    public <T extends Provider> T createProvider(Class<T> cls) {
-        DTraceProvider jsdt = new DTraceProvider(cls);
-        T proxy = jsdt.newProxyInstance();
-        jsdt.setProxy(proxy);
-        jsdt.init();
-        new Activation(jsdt.getModuleName(), new DTraceProvider[] { jsdt });
-        return proxy;
-    }
-
-    /**
-     * Creates multiple providers at once.
-     *
-     * This method batches together a number of provider instantiations.
-     * It works similarly
-     * to {@code createProvider}, but operates on a set of providers instead
-     * of one at a time.  This method is in place since some DTrace
-     * implementations limit the number of times that providers can be
-     * created.  When numerous providers can be created at once with this
-     * method, it will count only as a single creation point to DTrace, thus
-     * it uses less system resources.
-     * <p>
-     * All of the probes in the providers will be visible to DTrace after
-     * this call and all will remain visible until all of the providers
-     * are disposed.
-     * <p>
-     * The {@code moduleName} parameter will override any {@code ModuleName}
-     * annotation associated with any of the providers in the set.
-     * All of the probes created by this call will share the same
-     * module name.
-     * <p>
-     * @param providers a set of provider specification interfaces
-     * @param moduleName the module name to associate with all probes
-     * @return A map which maps the provider interface specification to an
-     * implementing instance.
-     * @throws java.lang.SecurityException if a security manager has been
-     * installed and it denies
-     * RuntimePermission("com.sun.dtrace.jsdt.createProvider")
-     * @throws java.lang.IllegalArgumentException if any of the interface
-     * contains methods that do not return null, or that contain arguments
-     * that are not String or integer types.
-     */
-    public Map<Class<? extends Provider>,Provider> createProviders(
-            Set<Class<? extends Provider>> providers, String moduleName) {
-        HashMap<Class<? extends Provider>,Provider> map =
-            new HashMap<Class<? extends Provider>,Provider>();
-        HashSet<DTraceProvider> jsdts = new HashSet<DTraceProvider>();
-        for (Class<? extends Provider> cls : providers) {
-            DTraceProvider jsdt = new DTraceProvider(cls);
-            jsdts.add(jsdt);
-            map.put(cls, jsdt.newProxyInstance());
-        }
-        new Activation(moduleName, jsdts.toArray(new DTraceProvider[0]));
-        return map;
-    }
-
-    /**
-     * Used to check the status of DTrace support in the underlying JVM and
-     * operating system.
-     *
-     * This is an informative method only - the Java-level effects of
-     * creating providers and triggering probes will not change whether or
-     * not DTrace is supported by the underlying systems.
-     *
-     * @return true if DTrace is supported
-     */
-    public static boolean isSupported() {
-        try {
-            SecurityManager security = System.getSecurityManager();
-            if (security != null) {
-                Permission perm = new RuntimePermission(
-                        "com.sun.tracing.dtrace.createProvider");
-                security.checkPermission(perm);
-            }
-            return JVM.isSupported();
-        } catch (SecurityException e) {
-            return false;
-        }
-    }
-}
--- a/jdk/src/jdk.runtime/share/classes/sun/tracing/dtrace/JVM.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 2008, 2012, 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.tracing.dtrace;
-
-import java.lang.reflect.Method;
-
-/**
- * Container class for JVM interface native methods
- *
- * @since 1.7
- */
-class JVM {
-
-    static {
-        java.security.AccessController.doPrivileged(
-            new java.security.PrivilegedAction<Void>() {
-                public Void run() {
-                    System.loadLibrary("jsdt");
-                    return null;
-                }
-            });
-    }
-
-    static long activate(String moduleName, DTraceProvider[] providers) {
-        return activate0(moduleName, providers);
-    }
-
-    static void dispose(long handle) {
-        dispose0(handle);
-    }
-
-    static boolean isEnabled(Method m) {
-        return isEnabled0(m);
-    }
-
-    static boolean isSupported() {
-        return isSupported0();
-    }
-
-    static Class<?> defineClass(
-            ClassLoader loader, String name, byte[] b, int off, int len) {
-        return defineClass0(loader, name, b, off, len);
-    }
-
-    private static native long activate0(
-        String moduleName, DTraceProvider[] providers);
-    private static native void dispose0(long activation_handle);
-    private static native boolean isEnabled0(Method m);
-    private static native boolean isSupported0();
-    private static native Class<?> defineClass0(
-        ClassLoader loader, String name, byte[] b, int off, int len);
-}
--- a/jdk/src/jdk.runtime/share/classes/sun/tracing/package-info.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2008, 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.
- */
-
-/**
- * This package contains internal common code for implementing tracing
- * frameworks, and defined a number of existing frameworks.
- * <p>
- * There are four tracing frameworks currently defined.  The "Null" and
- * "Multiplex" frameworks are used internally as part of the implementation.
- * The "DTrace" framework is the prime consumer framework at the moment,
- * while the "PrintStream" framework is a functional, but hidden, framework
- * which can be used to track probe firings.  All but the "DTrace" framework
- * are defined in this package.  The "DTrace" framework is implemented in the
- * {@code sun.tracing.dtrace} package.
- * <p>
- * This package also contains the {@code ProviderSkeleton} class, which
- * holds most of the common code needed for implementing frameworks.
- * <p>
- * The "Null" framework is used when there are no other active frameworks.
- * It accomplishes absolutely nothing and is merely a placeholder so that
- * the application can call the tracing routines without error.
- * <p>
- * The "Multiplex" framework is used when there are multiple active frameworks.
- * It is initialized with the framework factories and create providers and
- * probes that dispatch to each active framework in turn.
- * <p>
- * The "PrintStream" framework is currently a debugging framework which
- * dispatches trace calls to a user-defined PrintStream class, defined by
- * a property.  It may some day be opened up to general use.
- * <p>
- * See the {@code sun.tracing.dtrace} and {@code com.sun.tracing.dtrace}
- * packages for information on the "DTrace" framework.
- */
-
-package sun.tracing;
--- a/jdk/src/jdk.runtime/share/native/libjsdt/JVM.c	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,334 +0,0 @@
-/*
- * Copyright (c) 2008, 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.
- */
-
-#include <stdlib.h>
-
-#include "jvm.h"
-#include "jni.h"
-#include "jni_util.h"
-
-#include "jvm_symbols.h"
-#include "sun_tracing_dtrace_JVM.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-static JvmSymbols* jvm_symbols = NULL;
-
-static void initialize() {
-    static int initialized = 0;
-    if (initialized == 0) {
-        jvm_symbols = lookupJvmSymbols();
-        initialized = 1;
-    }
-}
-
-/*
- * Class:     sun_tracing_dtrace_JVM
- * Method:    isSupported0
- * Signature: ()I
- */
-JNIEXPORT jboolean JNICALL Java_sun_tracing_dtrace_JVM_isSupported0(
-        JNIEnv* env, jclass cls) {
-    initialize();
-    if (jvm_symbols != NULL) {
-        return jvm_symbols->IsSupported(env) ? JNI_TRUE : JNI_FALSE;
-    } else {
-        return JNI_FALSE;
-    }
-}
-
-// Macros that cause an immediate return if we detect an exception
-#define CHECK if ((*env)->ExceptionOccurred(env)) { return; }
-#define CHECK_(x) if ((*env)->ExceptionOccurred(env)) { return x; }
-
-static void readProbeData (
-        JNIEnv* env, jobject probe, JVM_DTraceProbe* jvm_probe) {
-    jclass clazz;
-    jmethodID mid;
-    jobject method;
-
-    if (jvm_probe == NULL) {
-        return; // just in case
-    }
-
-    clazz = (*env)->GetObjectClass(env, probe); CHECK
-
-    mid = (*env)->GetMethodID(
-        env, clazz, "getFunctionName", "()Ljava/lang/String;"); CHECK
-    jvm_probe->function = (jstring)(*env)->CallObjectMethod(
-        env, probe, mid); CHECK
-
-    mid = (*env)->GetMethodID(
-        env, clazz, "getProbeName", "()Ljava/lang/String;"); CHECK
-    jvm_probe->name = (jstring)(*env)->CallObjectMethod(env, probe, mid); CHECK
-
-    mid = (*env)->GetMethodID(
-        env, clazz, "getMethod", "()Ljava/lang/reflect/Method;"); CHECK
-    method = (*env)->CallObjectMethod(env, probe, mid); CHECK
-    jvm_probe->method = (*env)->FromReflectedMethod(env, method); CHECK
-}
-
-static void readFieldInterfaceAttributes(
-        char* annotationName, JNIEnv* env, jobject provider,
-        JVM_DTraceInterfaceAttributes* attrs) {
-    jobject result;
-    jobject result_clazz;
-    jclass provider_clazz;
-    jclass annotation_clazz;
-    jmethodID get;
-    jmethodID enc;
-
-    provider_clazz = (*env)->GetObjectClass(env, provider); CHECK
-    annotation_clazz = (*env)->FindClass(env, annotationName); CHECK
-
-    get = (*env)->GetMethodID(env, provider_clazz, "getNameStabilityFor",
-        "(Ljava/lang/Class;)Lcom/sun/tracing/dtrace/StabilityLevel;"); CHECK
-    result = (*env)->CallObjectMethod(
-        env, provider, get, annotation_clazz); CHECK
-    result_clazz = (*env)->GetObjectClass(env, result); CHECK
-    enc = (*env)->GetMethodID(env, result_clazz, "getEncoding", "()I"); CHECK
-    attrs->nameStability = (*env)->CallIntMethod(env, result, enc); CHECK
-
-    get = (*env)->GetMethodID(env, provider_clazz, "getDataStabilityFor",
-        "(Ljava/lang/Class;)Lcom/sun/tracing/dtrace/StabilityLevel;"); CHECK
-    result = (*env)->CallObjectMethod(
-        env, provider, get, annotation_clazz); CHECK
-    result_clazz = (*env)->GetObjectClass(env, result); CHECK
-    enc = (*env)->GetMethodID(env, result_clazz, "getEncoding", "()I"); CHECK
-    attrs->dataStability = (*env)->CallIntMethod(env, result, enc); CHECK
-
-    get = (*env)->GetMethodID(env, provider_clazz, "getDependencyClassFor",
-        "(Ljava/lang/Class;)Lcom/sun/tracing/dtrace/DependencyClass;"); CHECK
-    result = (*env)->CallObjectMethod(
-        env, provider, get, annotation_clazz); CHECK
-    result_clazz = (*env)->GetObjectClass(env, result); CHECK
-    enc = (*env)->GetMethodID(env, result_clazz, "getEncoding", "()I"); CHECK
-    attrs->dependencyClass = (*env)->CallIntMethod(env, result, enc); CHECK
-}
-
-static void readInterfaceAttributes(
-        JNIEnv* env, jobject provider, JVM_DTraceProvider* jvm_provider) {
-    readFieldInterfaceAttributes("com/sun/tracing/dtrace/ProviderAttributes",
-        env, provider, &(jvm_provider->providerAttributes));
-    readFieldInterfaceAttributes("com/sun/tracing/dtrace/ModuleAttributes",
-        env, provider, &(jvm_provider->moduleAttributes));
-    readFieldInterfaceAttributes("com/sun/tracing/dtrace/FunctionAttributes",
-        env, provider, &(jvm_provider->functionAttributes));
-    readFieldInterfaceAttributes("com/sun/tracing/dtrace/NameAttributes",
-        env, provider, &(jvm_provider->nameAttributes));
-    readFieldInterfaceAttributes("com/sun/tracing/dtrace/ArgsAttributes",
-        env, provider, &(jvm_provider->argsAttributes));
-}
-
-static int readProviderData(
-        JNIEnv* env, jobject provider, JVM_DTraceProvider* jvm_provider) {
-    jmethodID mid;
-    jobjectArray probes;
-    jsize i;
-    jclass clazz = (*env)->GetObjectClass(env, provider); CHECK_(0)
-    mid = (*env)->GetMethodID(
-        env, clazz, "getProbes", "()[Lsun/tracing/dtrace/DTraceProbe;"); CHECK_(0)
-    probes = (jobjectArray)(*env)->CallObjectMethod(
-        env, provider, mid); CHECK_(0)
-
-    // Fill JVM structure, describing provider
-    jvm_provider->probe_count = (*env)->GetArrayLength(env, probes); CHECK_(0)
-    jvm_provider->probes = (JVM_DTraceProbe*)calloc(
-        jvm_provider->probe_count, sizeof(*jvm_provider->probes));
-    mid = (*env)->GetMethodID(
-        env, clazz, "getProviderName", "()Ljava/lang/String;"); CHECK_(0)
-    jvm_provider->name = (jstring)(*env)->CallObjectMethod(
-        env, provider, mid); CHECK_(0)
-
-    readInterfaceAttributes(env, provider, jvm_provider); CHECK_(0)
-
-    for (i = 0; i < jvm_provider->probe_count; ++i) {
-        jobject probe = (*env)->GetObjectArrayElement(env, probes, i); CHECK_(0)
-        readProbeData(env, probe, &jvm_provider->probes[i]); CHECK_(0)
-    }
-
-    return 1;
-}
-
-/*
- * Class:     sun_tracing_dtrace_JVM
- * Method:    activate0
- * Signature: ()J
- */
-JNIEXPORT jlong JNICALL Java_sun_tracing_dtrace_JVM_activate0(
-        JNIEnv* env, jclass cls, jstring moduleName, jobjectArray providers) {
-    jlong handle = 0;
-    jsize num_providers;
-    jsize i;
-    jsize count = 0;
-    JVM_DTraceProvider* jvm_providers;
-
-    initialize();
-
-    if (jvm_symbols == NULL) {
-      return 0;
-    }
-
-    num_providers = (*env)->GetArrayLength(env, providers); CHECK_(0L)
-
-    jvm_providers = (JVM_DTraceProvider*)calloc(
-        num_providers, sizeof(*jvm_providers));
-
-    for (; count < num_providers; ++count) {
-        JVM_DTraceProvider* p = &(jvm_providers[count]);
-        jobject provider = (*env)->GetObjectArrayElement(
-            env, providers, count);
-        if ((*env)->ExceptionOccurred(env) ||
-            ! readProviderData(env, provider, p)) {
-            // got an error, bail out!
-            break;
-        }
-    }
-
-    if (count == num_providers) {
-        // all providers successfully loaded - get the handle
-        handle = jvm_symbols->Activate(
-            env, JVM_TRACING_DTRACE_VERSION, moduleName,
-            num_providers, jvm_providers);
-    }
-
-    for (i = 0; i < num_providers; ++i) {
-        JVM_DTraceProvider* p = &(jvm_providers[i]);
-        free(p->probes);
-    }
-    free(jvm_providers);
-
-    return handle;
-}
-
-/*
- * Class:     sun_tracing_dtrace_JVM
- * Method:    dispose0
- * Signature: (J)V
- */
-JNIEXPORT void JNICALL Java_sun_tracing_dtrace_JVM_dispose0(
-        JNIEnv* env, jclass cls, jlong handle) {
-    if (jvm_symbols != NULL && handle != 0) {
-        jvm_symbols->Dispose(env, handle);
-    }
-}
-
-/*
- * Class:     sun_tracing_dtrace_JVM
- * Method:    isEnabled0
- * Signature: (Ljava/lang/String;Ljava/lang/String;)Z
- */
-JNIEXPORT jboolean JNICALL Java_sun_tracing_dtrace_JVM_isEnabled0(
-        JNIEnv* env, jclass cls, jobject method) {
-    jmethodID mid;
-    if (jvm_symbols != NULL && method != NULL) {
-        mid = (*env)->FromReflectedMethod(env, method);
-        return jvm_symbols->IsProbeEnabled(env, mid);
-    }
-    return JNI_FALSE;
-}
-
-/*
- * Class:     sun_tracing_dtrace_JVM
- * Method:    defineClass0
- * Signature: (Ljava/lang/ClassLoader;Ljava/lang/String;[BII)Ljava/lang/Class;
- *
- * The implementation of this native static method is a copy of that of
- * the native instance method Java_java_lang_ClassLoader_defineClass0()
- * with the implicit "this" parameter becoming the "loader" parameter.
- *
- * This code was cloned and modified from java_lang_reflect_Proxy
- */
-JNIEXPORT jclass JNICALL
-Java_sun_tracing_dtrace_JVM_defineClass0(
-        JNIEnv *env, jclass ignore, jobject loader, jstring name, jbyteArray data,
-        jint offset, jint length)
-{
-    jbyte *body;
-    char *utfName;
-    jclass result = 0;
-    char buf[128];
-
-    if (data == NULL) {
-        return 0;
-    }
-
-    /* Work around 4153825. malloc crashes on Solaris when passed a
-     * negative size.
-     */
-    if (length < 0) {
-        return 0;
-    }
-
-    body = (jbyte *)malloc(length);
-
-    if (body == 0) {
-        return 0;
-    }
-
-    (*env)->GetByteArrayRegion(env, data, offset, length, body);
-
-    if ((*env)->ExceptionOccurred(env))
-        goto free_body;
-
-    if (name != NULL) {
-        int i;
-        jsize len = (*env)->GetStringUTFLength(env, name);
-        int unicode_len = (*env)->GetStringLength(env, name);
-        if (len >= (jsize)sizeof(buf)) {
-            utfName = malloc(len + 1);
-            if (utfName == NULL) {
-                goto free_body;
-            }
-        } else {
-            utfName = buf;
-        }
-        (*env)->GetStringUTFRegion(env, name, 0, unicode_len, utfName);
-
-        // Convert '.' to '/' in the package name
-        for (i = 0; i < unicode_len; ++i) {
-            if (utfName[i] == '.') {
-                utfName[i] = '/';
-            }
-        }
-    } else {
-        utfName = NULL;
-    }
-
-    result = (*env)->DefineClass(env, utfName, loader, body, length);
-
-    if (utfName && utfName != buf)
-        free(utfName);
-
- free_body:
-    free(body);
-    return result;
-}
-
-#ifdef __cplusplus
-}
-#endif
--- a/jdk/src/jdk.runtime/share/native/libjsdt/jvm_symbols.h	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2008, 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.
- */
-
-#ifndef _JVM_SYMBOLS_H
-#define _JVM_SYMBOLS_H
-
-#include "jvm.h"
-
-typedef jint (JNICALL* GetVersion_t)(JNIEnv*);
-typedef jboolean (JNICALL *IsSupported_t)(JNIEnv*);
-typedef jlong (JNICALL* Activate_t)(
-    JNIEnv*, jint, jstring, jint, JVM_DTraceProvider*);
-typedef void (JNICALL *Dispose_t)(JNIEnv*, jlong);
-typedef jboolean (JNICALL *IsProbeEnabled_t)(JNIEnv*, jmethodID);
-
-typedef struct {
-    GetVersion_t     GetVersion;
-    IsSupported_t    IsSupported;
-    Activate_t       Activate;
-    Dispose_t        Dispose;
-    IsProbeEnabled_t IsProbeEnabled;
-} JvmSymbols;
-
-// Platform-dependent implementation.
-// Returns NULL if the symbols are not found
-extern JvmSymbols* lookupJvmSymbols();
-
-#endif // def _JVM_SYMBOLS_H
--- a/jdk/src/jdk.runtime/unix/native/libjsdt/jvm_symbols_md.c	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2008, 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.
- */
-
-#include <dlfcn.h>
-#include <stdlib.h>
-
-#include <jvm.h>
-
-#include "jvm_symbols.h"
-
-JvmSymbols* lookupJvmSymbols() {
-    JvmSymbols* syms = (JvmSymbols*)malloc(sizeof(JvmSymbols));
-    if (syms != NULL) {
-        syms->GetVersion = (GetVersion_t)
-            dlsym(RTLD_DEFAULT, "JVM_DTraceGetVersion");
-        syms->IsSupported = (IsSupported_t)
-            dlsym(RTLD_DEFAULT, "JVM_DTraceIsSupported");
-        syms->Activate = (Activate_t)
-            dlsym(RTLD_DEFAULT, "JVM_DTraceActivate");
-        syms->Dispose = (Dispose_t)
-            dlsym(RTLD_DEFAULT, "JVM_DTraceDispose");
-        syms->IsProbeEnabled = (IsProbeEnabled_t)
-            dlsym(RTLD_DEFAULT, "JVM_DTraceIsProbeEnabled");
-
-        if ( syms->GetVersion == NULL || syms->Activate == NULL ||
-             syms->IsProbeEnabled == NULL || syms->Dispose == NULL ||
-             syms->IsSupported == NULL) {
-            free(syms);
-            syms = NULL;
-        }
-    }
-    return syms;
-}
--- a/jdk/src/jdk.runtime/windows/native/libjsdt/jvm_symbols_md.c	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2008, 2011, 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.
- */
-
-#include <windows.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-
-#include <jvm.h>
-
-#include "jvm_symbols.h"
-
-JvmSymbols* lookupJvmSymbols() {
-    JvmSymbols* syms = (JvmSymbols*)malloc(sizeof(JvmSymbols));
-    if (syms != NULL) {
-        HINSTANCE jvm = GetModuleHandle("jvm.dll");
-        if (jvm == NULL) {
-            free(syms);
-            return NULL;
-        }
-        syms->GetVersion = (GetVersion_t)
-            GetProcAddress(jvm, "JVM_DTraceGetVersion");
-        syms->IsSupported = (IsSupported_t)
-            GetProcAddress(jvm, "JVM_DTraceIsSupported");
-        syms->Activate = (Activate_t)
-            GetProcAddress(jvm, "JVM_DTraceActivate");
-        syms->Dispose = (Dispose_t)
-            GetProcAddress(jvm, "JVM_DTraceDispose");
-        syms->IsProbeEnabled = (IsProbeEnabled_t)
-            GetProcAddress(jvm, "JVM_DTraceIsProbeEnabled");
-
-        (void)FreeLibrary(jvm);
-        if ( syms->GetVersion == NULL || syms->IsSupported == NULL ||
-             syms->Activate == NULL || syms->Dispose == NULL ||
-             syms->IsProbeEnabled == NULL) {
-            free(syms);
-            syms = NULL;
-        }
-
-    }
-    return syms;
-}
--- a/jdk/src/jdk.sctp/unix/native/libsctp/SctpChannelImpl.c	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/src/jdk.sctp/unix/native/libsctp/SctpChannelImpl.c	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2012, 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
@@ -464,11 +464,6 @@
             union sctp_notification *snp;
             jboolean allocated = JNI_FALSE;
 
-            if (rv > SCTP_NOTIFICATION_SIZE) {
-                JNU_ThrowInternalError(env, "should not reach here");
-                return -1;
-            }
-
             if (!(msg->msg_flags & MSG_EOR) && length < SCTP_NOTIFICATION_SIZE) {
                 char* newBuf;
                 int rvSAVE = rv;
--- a/jdk/test/Makefile	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/Makefile	Mon Feb 23 05:01:11 2015 -0800
@@ -267,8 +267,8 @@
   EXTRA_JTREG_OPTIONS += -concurrency:$(CONCURRENCY)
 endif
 
-# Default JTREG to run (win32 script works for everybody)
-JTREG = $(JT_HOME)/win32/bin/jtreg
+# Default JTREG to run
+JTREG = $(JT_HOME)/bin/jtreg
 # run in agentvm mode
 JTREG_BASIC_OPTIONS += -agentvm
 # Only run automatic tests
--- a/jdk/test/ProblemList.txt	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/ProblemList.txt	Mon Feb 23 05:01:11 2015 -0800
@@ -1,6 +1,6 @@
 ###########################################################################
 #
-# Copyright (c) 2009, 2014, 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
@@ -123,7 +123,6 @@
 # 8029891
 java/lang/ClassLoader/deadlock/GetResource.java                 generic-all
 
-
 ############################################################################
 
 # jdk_instrument
@@ -132,6 +131,9 @@
 java/lang/instrument/RedefineBigClass.sh                        generic-all
 java/lang/instrument/RetransformBigClass.sh                     generic-all
 
+# 8072130
+java/lang/instrument/BootClassPath/BootClassPathTest.sh         macosx-all
+
 ############################################################################
 
 # jdk_management
@@ -162,6 +164,9 @@
 # 6988950
 demo/jvmti/compiledMethodLoad/CompiledMethodLoadTest.java	generic-all
 
+# 8071968
+javax/xml/ws/8046817/GenerateEnumSchema.java                windows-all
+
 ############################################################################
 
 # jdk_net
@@ -290,15 +295,18 @@
 # 8043571
 com/sun/jdi/RepStep.java                                        generic-all
 
-# 8044419
-com/sun/jdi/JdbReadTwiceTest.sh                                 generic-all
-
 # 8058616
 com/sun/jdi/RedefinePop.sh                                      generic-all
 
 # 8068645
 com/sun/jdi/CatchPatternTest.sh                                 generic-all
 
+# 8069402
+com/sun/jdi/ConnectedVMs.java					generic-all
+
+# 8067354
+com/sun/jdi/GetLocalVariables4Test.sh				windows-all
+
 ############################################################################
 
 # jdk_util
@@ -317,6 +325,9 @@
 # 8031482
 sun/tools/jcmd/TestJcmdSanity.java				windows-all
 
+# 8072131
+sun/tools/jmap/heapconfig/JMapHeapConfigTest.java macosx-all
+
 # 8027668
 sun/tools/jstatd/TestJstatdDefaults.java                generic-all
 sun/tools/jstatd/TestJstatdServer.java                  generic-all
@@ -338,7 +349,4 @@
 # 8064572 8060736 8062938
 sun/jvmstat/monitor/MonitoredVm/CR6672135.java			generic-all
 
-# 8060088
-com/sun/tracing/BasicWithSecurityMgr.java                       generic-all
-
 ############################################################################
--- a/jdk/test/TEST.groups	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/TEST.groups	Mon Feb 23 05:01:11 2015 -0800
@@ -190,7 +190,6 @@
 
 svc_tools = \
     com/sun/tools/attach \
-    com/sun/tracing \
     sun/tools \
     -sun/tools/java \
     -sun/tools/native2ascii \
@@ -407,6 +406,7 @@
   com/sun/tools \
   demo \
   sun/security/tools/jarsigner \
+  sun/security/tools/policytool \
   sun/rmi/rmic \
   sun/tools \
   sun/jvmstat \
@@ -456,7 +456,6 @@
   com/oracle/security/ucrypto/TestRSA.java \
   sun/net/ftp \
   sun/net/www/protocol/ftp \
-  sun/security/tools/policytool \
   java/net/URI/URItoURLTest.java \
   java/net/URL/URIToURLTest.java \
   java/net/URLConnection/HandleContentTypeWithAttrs.java \
@@ -562,7 +561,6 @@
   com/sun/security/auth \
   com/sun/security/sasl \
   com/sun/security/jgss \
-  com/sun/tracing \
   java/util/prefs \
   javax/naming \
   javax/security \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/com/sun/crypto/provider/Cipher/AES/TestGHASH.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,166 @@
+/*
+ * Copyright (c) 2015, Red Hat, Inc.
+ * 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.
+ *
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8069072
+ * @summary Test vectors for com.sun.crypto.provider.GHASH
+ */
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+import java.nio.ByteBuffer;
+
+public class TestGHASH {
+
+    private final Constructor<?> GHASH;
+    private final Method UPDATE;
+    private final Method DIGEST;
+
+    TestGHASH(String className) throws Exception {
+        Class<?> cls = Class.forName(className);
+        GHASH = cls.getDeclaredConstructor(byte[].class);
+        GHASH.setAccessible(true);
+        UPDATE = cls.getDeclaredMethod("update", byte[].class);
+        UPDATE.setAccessible(true);
+        DIGEST = cls.getDeclaredMethod("digest");
+        DIGEST.setAccessible(true);
+    }
+
+
+    private Object newGHASH(byte[] H) throws Exception {
+        return GHASH.newInstance(H);
+    }
+
+    private void updateGHASH(Object hash, byte[] data)
+            throws Exception {
+        UPDATE.invoke(hash, data);
+    }
+
+    private byte[] digestGHASH(Object hash) throws Exception {
+        return (byte[]) DIGEST.invoke(hash);
+    }
+
+    private static final String HEX_DIGITS = "0123456789abcdef";
+
+    private static String hex(byte[] bs) {
+        StringBuilder sb = new StringBuilder(2 * bs.length);
+        for (byte b : bs) {
+            sb.append(HEX_DIGITS.charAt((b >> 4) & 0xF));
+            sb.append(HEX_DIGITS.charAt(b & 0xF));
+        }
+        return sb.toString();
+    }
+
+    private static byte[] bytes(String hex) {
+        if ((hex.length() & 1) != 0) {
+            throw new AssertionError();
+        }
+        byte[] result = new byte[hex.length() / 2];
+        for (int i = 0; i < result.length; ++i) {
+            int a = HEX_DIGITS.indexOf(hex.charAt(2 * i));
+            int b = HEX_DIGITS.indexOf(hex.charAt(2 * i + 1));
+            if ((a | b) < 0) {
+                if (a < 0) {
+                    throw new AssertionError(
+                            "bad character " + (int) hex.charAt(2 * i));
+                }
+                throw new AssertionError(
+                        "bad character " + (int) hex.charAt(2 * i + 1));
+            }
+            result[i] = (byte) ((a << 4) | b);
+        }
+        return result;
+    }
+
+    private static byte[] bytes(long L0, long L1) {
+        return ByteBuffer.allocate(16)
+                .putLong(L0)
+                .putLong(L1)
+                .array();
+    }
+
+    private void check(int testCase, String H, String A,
+            String C, String expected) throws Exception {
+        int lenA = A.length() * 4;
+        while ((A.length() % 32) != 0) {
+            A += '0';
+        }
+        int lenC = C.length() * 4;
+        while ((C.length() % 32) != 0) {
+            C += '0';
+        }
+
+        Object hash = newGHASH(bytes(H));
+        updateGHASH(hash, bytes(A));
+        updateGHASH(hash, bytes(C));
+        updateGHASH(hash, bytes(lenA, lenC));
+        byte[] digest = digestGHASH(hash);
+        String actual = hex(digest);
+        if (!expected.equals(actual)) {
+            throw new AssertionError(String.format("%d: expected %s, got %s",
+                    testCase, expected, actual));
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        TestGHASH test;
+        if (args.length == 0) {
+            test = new TestGHASH("com.sun.crypto.provider.GHASH");
+        } else {
+            test = new TestGHASH(args[0]);
+        }
+
+        // Test vectors from David A. McGrew, John Viega,
+        // "The Galois/Counter Mode of Operation (GCM)", 2005.
+        // <http://csrc.nist.gov/groups/ST/toolkit/BCM/documents/proposedmodes/gcm/gcm-revised-spec.pdf>
+
+        test.check(1, "66e94bd4ef8a2c3b884cfa59ca342b2e", "", "",
+                "00000000000000000000000000000000");
+        test.check(2,
+                "66e94bd4ef8a2c3b884cfa59ca342b2e", "",
+                "0388dace60b6a392f328c2b971b2fe78",
+                "f38cbb1ad69223dcc3457ae5b6b0f885");
+        test.check(3,
+                "b83b533708bf535d0aa6e52980d53b78", "",
+                "42831ec2217774244b7221b784d0d49c" +
+                "e3aa212f2c02a4e035c17e2329aca12e" +
+                "21d514b25466931c7d8f6a5aac84aa05" +
+                "1ba30b396a0aac973d58e091473f5985",
+                "7f1b32b81b820d02614f8895ac1d4eac");
+        test.check(4,
+                "b83b533708bf535d0aa6e52980d53b78",
+                "feedfacedeadbeeffeedfacedeadbeef" + "abaddad2",
+                "42831ec2217774244b7221b784d0d49c" +
+                "e3aa212f2c02a4e035c17e2329aca12e" +
+                "21d514b25466931c7d8f6a5aac84aa05" +
+                "1ba30b396a0aac973d58e091",
+                "698e57f70e6ecc7fd9463b7260a9ae5f");
+        test.check(5, "b83b533708bf535d0aa6e52980d53b78",
+                "feedfacedeadbeeffeedfacedeadbeef" + "abaddad2",
+                "61353b4c2806934a777ff51fa22a4755" +
+                "699b2a714fcdc6f83766e5f97b6c7423" +
+                "73806900e49f24b22b097544d4896b42" +
+                "4989b5e1ebac0f07c23f4598",
+                "df586bb4c249b92cb6922877e444d37b");
+    }
+}
--- a/jdk/test/com/sun/jdi/ImmutableResourceTest.sh	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/com/sun/jdi/ImmutableResourceTest.sh	Mon Feb 23 05:01:11 2015 -0800
@@ -92,7 +92,7 @@
 #
 echo "JDK under test is: $TESTJAVA"
 #
-CP="-classpath ${TESTCLASSES}${PATHSEP}${TESTJAVA}/lib/tools.jar"
+CP="-classpath ${TESTCLASSES}"
 # Compile the test class using the classpath we need:
 #
 env
--- a/jdk/test/com/sun/jdi/JITDebug.sh	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/com/sun/jdi/JITDebug.sh	Mon Feb 23 05:01:11 2015 -0800
@@ -103,15 +103,15 @@
    #if running standalone (no test harness of any kind), compile the
    #support files and the test case
    ${TESTJAVA}/bin/javac -d ${TESTCLASSES} \
-            -classpath "$TESTJAVA/lib/tools.jar${PATHSEP}${TESTSRC}" \
+            -classpath "${TESTSRC}" \
             TestScaffold.java VMConnection.java TargetListener.java TargetAdapter.java
    ${TESTJAVA}/bin/javac  -d ${TESTCLASSES} \
-            -classpath "$TESTJAVA/lib/tools.jar${PATHSEP}${TESTSRC}" -g \
+            -classpath "${TESTSRC}" -g \
             JITDebug.java
 fi
 echo "JDK under test is: $TESTJAVA"
 #
-CLASSPATH="$TESTJAVA/lib/tools.jar${PATHSEP}${TESTCLASSES}"
+CLASSPATH="${TESTCLASSES}"
 export CLASSPATH
 CP="-classpath \"${CLASSPATH}\""
 #
--- a/jdk/test/com/sun/jdi/JdbReadTwiceTest.sh	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/com/sun/jdi/JdbReadTwiceTest.sh	Mon Feb 23 05:01:11 2015 -0800
@@ -204,27 +204,37 @@
     clean
 fi
 
+echo
+echo "+++++++++++++++++++++++++++++++++++"
+echo "Read an unreadable file - verify the read fails."
 
-if [ ! -r c:/ ] ; then
-    # Can't make a file unreadable under MKS.
-    echo
-    echo "+++++++++++++++++++++++++++++++++++"
-    echo "Read an unreadable file - verify the read fails."
-    # If the file exists, we try to read it.  The
-    # read will fail.
-    mkFiles $HOME/jdb.ini
-    id > $HOME/jdb.ini
-    chmod a-r $HOME/jdb.ini
-    if grep -q "uid=" $HOME/jdb.ini  ; then
-      echo "Unable to make file unreadable, so test will fail. chmod: $HOME/jdb.ini"
-      if grep -q "uid=0" $HOME/jdb.ini  ; then
-        echo "The test is running as root. Fix infrastructure!"
-      fi
-    fi  
+canMakeUnreadable=No
+id > $HOME/jdb.ini
+if chmod a-r $HOME/jdb.ini 
+then
+  grep -q 'uid=0(' $HOME/jdb.ini 2> /dev/null
+  case $? in
+    0)
+      echo "Error! Can't make file unreadable running as root"
+    ;;
+    1)
+      echo "Error! Can't make file unreadable for some other reason (windows?)"
+    ;;
+    *)
+      echo "OK. the file is unreadable"
+      canMakeUnreadable=Yes 
+    ;;
+   esac
+else    
+  echo "Error! Can't create or chmod file"
+fi  
+
+if [ "$canMakeUnreadable" = "Yes" ]
+then
     doit
     failIfNot 1 "open: $HOME/jdb.ini"
-    clean
 fi
+clean
 
 
 echo
@@ -246,8 +256,8 @@
     doit
     failIfNot 1 "from $fred"
 
-    if [ ! -r c:/ ] ; then
-        # Can't make a file unreadable under MKS
+    if [ "$canMakeUnreadable" = "Yes" ]
+    then
         chmod a-r $fred
         doit
         failIfNot 1 "open: $fred"
--- a/jdk/test/com/sun/jdi/ShellScaffold.sh	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/com/sun/jdi/ShellScaffold.sh	Mon Feb 23 05:01:11 2015 -0800
@@ -259,7 +259,7 @@
                     ;;
             esac
 
-            if [ -r $jdk/bin/dt_shmem.dll -o -r $jdk/jre/bin/dt_shmem.dll ] ; then
+            if [ -r $jdk/bin/dt_shmem.dll ] ; then
                 transport=dt_shmem
                 address=kkkk.$$
             else
@@ -933,18 +933,10 @@
         debuggeeCmd=`$jdk/bin/jps -v | $grep $debuggeeKeyword`
         realDebuggeePid=`echo "$debuggeeCmd" | sed -e 's@ .*@@'`
         if [ ! -z "$realDebuggeePid" ] ; then
-            if [ -r "$jdk/lib/sa-jdi.jar" ] ; then
-                # disableVersionCheck can be removed after 6475822
-                # is fixed.
-                moption="-m -J-Dsun.jvm.hotspot.runtime.VM.disableVersionCheck"
-            else
-                moption=
-            fi
-
             echo "-- debuggee process info ----------------------" >&2
             echo "      $debuggeeCmd"                              >&2
             echo "-- debuggee threads: jstack $moption $realDebuggeePid" >&2
-            $jdk/bin/$jstack $moption $realDebuggeePid             >&2
+            $jdk/bin/$jstack $realDebuggeePid                      >&2
             echo "============================================="   >&2
             echo                                                   >&2
         fi
--- a/jdk/test/com/sun/jdi/connect/spi/JdiLoadedByCustomLoader.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/com/sun/jdi/connect/spi/JdiLoadedByCustomLoader.java	Mon Feb 23 05:01:11 2015 -0800
@@ -22,9 +22,8 @@
  */
 
 /*
- * Creates a URLClassLoader from 2 file URLs. The first
- * file URL is constructed from the given argument. The
- * second is the SDK tools.jar. Once created the test
+ * Creates a URLClassLoader from a file URL. The file URL
+ * is constructed from the given argument. Once created the test
  * attempts to load another test case (ListConnectors)
  * using the class loader and then it invokes the list()
  * method.
@@ -39,13 +38,9 @@
     public static void main(String args[]) throws Exception {
         // create files from given arguments and tools.jar
         File f1 = new File(args[0]);
-        String home = System.getProperty("java.home");
-        String tools = ".." + File.separatorChar + "lib" +
-            File.separatorChar + "tools.jar";
-        File f2 = (new File(home, tools)).getCanonicalFile();
 
         // create class loader
-        URL[] urls = { f1.toURL(), f2.toURL() };
+        URL[] urls = { f1.toURL() };
         URLClassLoader cl = new URLClassLoader(urls);
 
         // load ListConnectors using the class loader
--- a/jdk/test/com/sun/jdi/connect/spi/JdiLoadedByCustomLoader.sh	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/com/sun/jdi/connect/spi/JdiLoadedByCustomLoader.sh	Mon Feb 23 05:01:11 2015 -0800
@@ -68,7 +68,7 @@
 $JAVAC -d "${TESTCLASSES}" "${TESTSRC}"/JdiLoadedByCustomLoader.java
 
 mkdir "${SOMEOTHERDIR}"
-$JAVAC -d "${SOMEOTHERDIR}" -classpath "${TESTSRC}${PS}${TESTJAVA}/lib/tools.jar" \
+$JAVAC -d "${SOMEOTHERDIR}" -classpath "${TESTSRC}" \
     "${TESTSRC}"/ListConnectors.java
 
 # Run the test
--- a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java	Mon Feb 23 05:01:11 2015 -0800
@@ -62,7 +62,7 @@
                     "-XX:+UseConcMarkSweepGC",  // this will cause UseParNewGC to be FLAG_SET_ERGO
                     "-XX:+PrintGCDetails",
                     "-XX:Flags=" + flagsFile.getAbsolutePath(),
-                    "-cp", System.getProperty("test.class.path") + File.pathSeparator + getToolsJarPath(),
+                    "-cp", System.getProperty("test.class.path"),
                     "CheckOrigin",
                     "-runtests");
 
@@ -137,8 +137,4 @@
         vm.detach();
     }
 
-    private static String getToolsJarPath() {
-        return System.getProperty("java.home") +
-            "/../lib/tools.jar".replace("/", File.separator);
-    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/com/sun/nio/sctp/SctpMultiChannel/SendFailed.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,189 @@
+/*
+ * 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.
+ *
+ * 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.
+ */
+
+/* @test
+ * @bug 8067846
+ * @summary Test for send failed notification
+ */
+
+import com.sun.nio.sctp.*;
+import java.io.IOException;
+import java.net.InetSocketAddress;
+import java.net.SocketAddress;
+import java.nio.ByteBuffer;
+import static java.lang.System.out;
+import static java.nio.ByteBuffer.*;
+
+public class SendFailed {
+
+    static final SocketAddress remoteAddress = new InetSocketAddress("127.0.0.1", 3000);
+
+    static final int[] bufferSizes =
+            { 20, 49, 50, 51, 100, 101, 1024, 1025, 4095, 4096, 4097, 8191, 8192, 8193};
+
+    void test(String[] args) throws IOException {
+        SocketAddress address = null;
+
+        if (!Util.isSCTPSupported()) {
+            out.println("SCTP protocol is not supported");
+            out.println("Test cannot be run");
+            return;
+        }
+
+        System.out.println("remote address: " + remoteAddress);
+        System.out.println("Note, remote address should not be up");
+
+        /* combinations with various buffer sizes, and offsets */
+        for (int send=0; send < bufferSizes.length; send++) {
+            for (int recv=0; recv < bufferSizes.length; recv++) {
+                for (boolean direct : new boolean[] {true, false})
+                    runWithManyOffsets(bufferSizes[send], bufferSizes[recv], direct);
+            }
+        }
+    }
+
+    void runWithManyOffsets(int sendBufferSize, int recvBufferSize, boolean direct)
+        throws IOException
+    {
+        doTest(sendBufferSize, recvBufferSize, direct, 0);
+        doTest(sendBufferSize, recvBufferSize, direct, 1);
+        doTest(sendBufferSize, recvBufferSize, direct, 3);
+        doTest(sendBufferSize, recvBufferSize, direct, 7);
+        doTest(sendBufferSize, recvBufferSize, direct, 9);
+        doTest(sendBufferSize, recvBufferSize, direct, 13);
+        doTest(sendBufferSize, recvBufferSize, direct, 15);
+    }
+
+    void doTest(int sendBufferSize, int recvBufferSize, boolean direct, int offset)
+        throws IOException
+    {
+        debug("%n--- Testing with send size:[%d], recv size:[%d], offset:[%d] "
+                + ", direct [%s]. ", sendBufferSize, recvBufferSize, offset, direct);
+
+        try (SctpMultiChannel channel = SctpMultiChannel.open()) {
+            MessageInfo messageInfo = MessageInfo.createOutgoing(remoteAddress, 0);
+            ByteBuffer sendBuffer = filledBuffer(sendBufferSize, direct);
+
+            debug("%nAttempting to send to %s. ", remoteAddress);
+            int sent = channel.send(sendBuffer, messageInfo);
+            sendBuffer.flip();
+
+            SendFailedNotificationHandler handler =
+                    new SendFailedNotificationHandler();
+            ByteBuffer recvBuffer = direct ? allocateDirect(recvBufferSize)
+                                           : allocate((recvBufferSize));
+            channel.receive(recvBuffer, null, handler);
+
+            // verify sent buffer received by send failed notification
+            ByteBuffer buffer = handler.getSendFailedByteBuffer();
+            check(buffer.remaining() == sent);
+            check(buffer.position() == 0);
+            check(buffer.limit() == sent);
+            assertSameContent(sendBuffer, handler.getSendFailedByteBuffer());
+        }
+    }
+
+    class SendFailedNotificationHandler extends AbstractNotificationHandler<Object>
+    {
+        /** Reference to the buffer captured in send failed notification */
+        private ByteBuffer sentBuffer;
+
+        @Override
+        public HandlerResult handleNotification(
+                Notification notification, Object attachment) {
+            fail("Unknown notification type");
+            return HandlerResult.CONTINUE;
+        }
+
+        @Override
+        public HandlerResult handleNotification(
+                AssociationChangeNotification notification, Object attachment) {
+            AssociationChangeNotification.AssocChangeEvent event = notification.event();
+            debug("%nAssociationChangeNotification");
+            debug("%n  Association: %s. ", notification.association());
+            debug("%n  Event: %s. ", event);
+            return HandlerResult.CONTINUE;
+        }
+
+        @Override
+        public HandlerResult handleNotification(
+                SendFailedNotification notification, Object attachment) {
+            debug("%nSendFailedNotification: %s. ", notification);
+            sentBuffer = notification.buffer();
+            return HandlerResult.RETURN;
+        }
+
+        public ByteBuffer getSendFailedByteBuffer() {
+            return sentBuffer;
+        }
+
+        @Override
+        public HandlerResult handleNotification(
+                PeerAddressChangeNotification pacn, Object attachment)
+        {
+            debug("%nPeerAddressChangeNotification: %s", pacn);
+            return HandlerResult.CONTINUE;
+        }
+
+        @Override
+        public HandlerResult handleNotification(
+                ShutdownNotification notification, Object attachment) {
+            debug("%nShutdownNotification");
+            debug("%n  Association: %s. ", notification.association());
+            return HandlerResult.CONTINUE;
+        }
+    }
+
+    static ByteBuffer filledBuffer(int size, boolean direct) {
+        ByteBuffer buffer = direct ? allocateDirect(size) : allocate((size));
+        for (int i=0; i< size; i++)
+            buffer.put((byte)i);
+        buffer.flip();
+        return buffer;
+    }
+
+    static void assertSameContent(ByteBuffer bb1, ByteBuffer bb2) {
+        if (!bb1.equals(bb2))
+            throw new RuntimeException("Buffers are not equal; bb1: " + bb1 + ", bb2: " + bb2);
+    }
+
+    //--------------------- Infrastructure ---------------------------
+    boolean debug = true;
+    volatile int passed = 0, failed = 0;
+    void pass() {passed++;}
+    void fail() {failed++; Thread.dumpStack();}
+    void fail(String msg) {System.err.println(msg); fail();}
+    void unexpected(Throwable t) {failed++; t.printStackTrace();}
+    void check(boolean cond) {if (cond) pass(); else fail();}
+    void check(boolean cond, String failMessage) {if (cond) pass(); else fail(failMessage);}
+    void debug(String message, Object... args) {if(debug) { out.printf(message, args); } }
+    public static void main(String[] args) throws Throwable {
+        Class<?> k = new Object(){}.getClass().getEnclosingClass();
+        try {k.getMethod("instanceMain",String[].class)
+                .invoke( k.newInstance(), (Object) args);}
+        catch (Throwable e) {throw e.getCause();}}
+    public void instanceMain(String[] args) throws Throwable {
+        try {test(args);} catch (Throwable t) {unexpected(t);}
+        out.printf("%nPassed = %d, failed = %d%n%n", passed, failed);
+        if (failed > 0) throw new AssertionError("Some tests failed");}
+}
--- a/jdk/test/com/sun/tools/attach/BasicTests.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/com/sun/tools/attach/BasicTests.java	Mon Feb 23 05:01:11 2015 -0800
@@ -80,8 +80,7 @@
 
         // Need to add jdk/lib/tools.jar to classpath.
         String classpath =
-            System.getProperty("test.class.path", "") + File.pathSeparator +
-            System.getProperty("test.jdk", ".") + sep + "lib" + sep + "tools.jar";
+            System.getProperty("test.class.path", "");
         String testClassDir = System.getProperty("test.classes", "") + sep;
 
         // Argumenta : -classpath cp BasicTests$TestMain pid agent badagent redefineagent
--- a/jdk/test/com/sun/tools/attach/PermissionTest.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/com/sun/tools/attach/PermissionTest.java	Mon Feb 23 05:01:11 2015 -0800
@@ -71,10 +71,8 @@
     private static void runTests(long pid) throws Throwable {
         final String sep = File.separator;
 
-        // Need to add jdk/lib/tools.jar to classpath.
         String classpath =
-            System.getProperty("test.class.path", "") + File.pathSeparator +
-            System.getProperty("test.jdk", ".") + sep + "lib" + sep + "tools.jar";
+            System.getProperty("test.class.path", "");
         String testSrc = System.getProperty("test.src", "") + sep;
 
         // Use a policy that will NOT allow attach. Test will verify exception.
--- a/jdk/test/com/sun/tools/attach/ProviderTest.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/com/sun/tools/attach/ProviderTest.java	Mon Feb 23 05:01:11 2015 -0800
@@ -68,11 +68,10 @@
         String testClasses = System.getProperty("test.classes", "") + sep;
         String jdkLib = System.getProperty("test.jdk", ".") + sep + "lib" + sep;
 
-        // Need to add SimpleProvider.jar and tools.jar to classpath.
+        // Need to add SimpleProvider.jar to classpath.
         String classpath =
                 testClassPath + File.pathSeparator +
-                testClasses + "SimpleProvider.jar" + File.pathSeparator +
-                jdkLib + "tools.jar";
+                testClasses + "SimpleProvider.jar";
 
         String[] args = {
                 "-classpath",
--- a/jdk/test/com/sun/tools/attach/TempDirTest.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/com/sun/tools/attach/TempDirTest.java	Mon Feb 23 05:01:11 2015 -0800
@@ -120,10 +120,8 @@
     private static void launchTests(long pid, Path clientTmpDir) throws Throwable {
         final String sep = File.separator;
 
-        // Need to add jdk/lib/tools.jar to classpath.
         String classpath =
-            System.getProperty("test.class.path", "") + File.pathSeparator +
-            System.getProperty("test.jdk", ".") + sep + "lib" + sep + "tools.jar";
+            System.getProperty("test.class.path", "");
 
         String[] tmpDirArg = null;
         if (clientTmpDir != null) {
--- a/jdk/test/com/sun/tracing/BasicFunctionality.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,147 +0,0 @@
-/*
- * Copyright (c) 2008, 2010, 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.
- *
- * 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.
- */
-
-/**
- * @test
- * @bug 6537506
- * @ignore 6962535
- * @summary Basic unit test for tracing framework
- */
-
-import com.sun.tracing.*;
-import java.lang.reflect.Method;
-
-@ProviderName("NamedProvider")
-interface BasicProvider extends Provider {
-    void plainProbe();
-    void probeWithArgs(int a, float f, String s, Long l);
-    @ProbeName("namedProbe") void probeWithName();
-    void overloadedProbe();
-    void overloadedProbe(int i);
-}
-
-interface InvalidProvider extends Provider {
-    int nonVoidProbe();
-}
-
-public class BasicFunctionality {
-
-    public static ProviderFactory factory;
-    public static BasicProvider bp;
-
-    public static void main(String[] args) throws Exception {
-
-        factory = ProviderFactory.getDefaultFactory();
-        if (factory != null) {
-            bp = factory.createProvider(BasicProvider.class);
-        }
-
-        testProviderFactory();
-        testProbe();
-        testProvider();
-    }
-
-    static void fail(String s) throws Exception {
-        throw new Exception(s);
-    }
-
-    static void testProviderFactory() throws Exception {
-        if (factory == null) {
-            fail("ProviderFactory.getDefaultFactory: Did not create factory");
-        }
-        if (bp == null) {
-            fail("ProviderFactory.createProvider: Did not create provider");
-        }
-        try {
-            factory.createProvider(null);
-            fail("ProviderFactory.createProvider: Did not throw NPE for null");
-        } catch (NullPointerException e) {}
-
-       try {
-           factory.createProvider(InvalidProvider.class);
-           fail("Factory.createProvider: Should error with non-void probes");
-       } catch (IllegalArgumentException e) {}
-    }
-
-    public static void testProvider() throws Exception {
-
-       // These just shouldn't throw any exeptions:
-       bp.plainProbe();
-       bp.probeWithArgs(42, (float)3.14, "spam", new Long(2L));
-       bp.probeWithArgs(42, (float)3.14, null, null);
-       bp.probeWithName();
-       bp.overloadedProbe();
-       bp.overloadedProbe(42);
-
-       Method m = BasicProvider.class.getMethod("plainProbe");
-       Probe p = bp.getProbe(m);
-       if (p == null) {
-           fail("Provider.getProbe: Did not return probe");
-       }
-
-       Method m2 = BasicFunctionality.class.getMethod("testProvider");
-       p = bp.getProbe(m2);
-       if (p != null) {
-           fail("Provider.getProbe: Got probe with invalid spec");
-       }
-
-       bp.dispose();
-       // These just shouldn't throw any exeptions:
-       bp.plainProbe();
-       bp.probeWithArgs(42, (float)3.14, "spam", new Long(2L));
-       bp.probeWithArgs(42, (float)3.14, null, null);
-       bp.probeWithName();
-       bp.overloadedProbe();
-       bp.overloadedProbe(42);
-
-       if (bp.getProbe(m) != null) {
-           fail("Provider.getProbe: Should return null after dispose()");
-       }
-
-       bp.dispose(); // just to make sure nothing bad happens
-    }
-
-    static void testProbe() throws Exception {
-       Method m = BasicProvider.class.getMethod("plainProbe");
-       Probe p = bp.getProbe(m);
-       p.isEnabled(); // just make sure it doesn't do anything bad
-       p.trigger();
-
-       try {
-         p.trigger(0);
-         fail("Probe.trigger: too many arguments not caught");
-       } catch (IllegalArgumentException e) {}
-
-       p = bp.getProbe(BasicProvider.class.getMethod(
-           "probeWithArgs", int.class, float.class, String.class, Long.class));
-       try {
-         p.trigger();
-         fail("Probe.trigger: too few arguments not caught");
-       } catch (IllegalArgumentException e) {}
-
-       try {
-         p.trigger((float)3.14, (float)3.14, "", new Long(0L));
-         fail("Probe.trigger: wrong type primitive arguments not caught");
-       } catch (IllegalArgumentException e) {}
-    }
-}
--- a/jdk/test/com/sun/tracing/BasicWithSecurityMgr.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,149 +0,0 @@
-/*
- * Copyright (c) 2008, 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.
- *
- * 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.
- */
-
-/**
- * @test
- * @bug 6899605
- * @summary Basic unit test for tracing framework with security manager
- *          enabled
- */
-
-import com.sun.tracing.*;
-import java.lang.reflect.Method;
-
-@ProviderName("NamedProvider")
-interface BasicProvider extends Provider {
-    void plainProbe();
-    void probeWithArgs(int a, float f, String s, Long l);
-    @ProbeName("namedProbe") void probeWithName();
-    void overloadedProbe();
-    void overloadedProbe(int i);
-}
-
-interface InvalidProvider extends Provider {
-    int nonVoidProbe();
-}
-
-public class BasicWithSecurityMgr {
-
-    public static ProviderFactory factory;
-    public static BasicProvider bp;
-
-    public static void main(String[] args) throws Exception {
-        // enable security manager
-        System.setSecurityManager(new SecurityManager());
-
-        factory = ProviderFactory.getDefaultFactory();
-        if (factory != null) {
-            bp = factory.createProvider(BasicProvider.class);
-        }
-
-        testProviderFactory();
-        testProbe();
-        testProvider();
-    }
-
-    static void fail(String s) throws Exception {
-        throw new Exception(s);
-    }
-
-    static void testProviderFactory() throws Exception {
-        if (factory == null) {
-            fail("ProviderFactory.getDefaultFactory: Did not create factory");
-        }
-        if (bp == null) {
-            fail("ProviderFactory.createProvider: Did not create provider");
-        }
-        try {
-            factory.createProvider(null);
-            fail("ProviderFactory.createProvider: Did not throw NPE for null");
-        } catch (NullPointerException e) {}
-
-       try {
-           factory.createProvider(InvalidProvider.class);
-           fail("Factory.createProvider: Should error with non-void probes");
-       } catch (IllegalArgumentException e) {}
-    }
-
-    public static void testProvider() throws Exception {
-
-       // These just shouldn't throw any exeptions:
-       bp.plainProbe();
-       bp.probeWithArgs(42, (float)3.14, "spam", new Long(2L));
-       bp.probeWithArgs(42, (float)3.14, null, null);
-       bp.probeWithName();
-       bp.overloadedProbe();
-       bp.overloadedProbe(42);
-
-       Method m = BasicProvider.class.getMethod("plainProbe");
-       Probe p = bp.getProbe(m);
-       if (p == null) {
-           fail("Provider.getProbe: Did not return probe");
-       }
-
-       Method m2 = BasicWithSecurityMgr.class.getMethod("testProvider");
-       p = bp.getProbe(m2);
-       if (p != null) {
-           fail("Provider.getProbe: Got probe with invalid spec");
-       }
-
-       bp.dispose();
-       // These just shouldn't throw any exeptions:
-       bp.plainProbe();
-       bp.probeWithArgs(42, (float)3.14, "spam", new Long(2L));
-       bp.probeWithArgs(42, (float)3.14, null, null);
-       bp.probeWithName();
-       bp.overloadedProbe();
-       bp.overloadedProbe(42);
-
-       if (bp.getProbe(m) != null) {
-           fail("Provider.getProbe: Should return null after dispose()");
-       }
-
-       bp.dispose(); // just to make sure nothing bad happens
-    }
-
-    static void testProbe() throws Exception {
-       Method m = BasicProvider.class.getMethod("plainProbe");
-       Probe p = bp.getProbe(m);
-       p.isEnabled(); // just make sure it doesn't do anything bad
-       p.trigger();
-
-       try {
-         p.trigger(0);
-         fail("Probe.trigger: too many arguments not caught");
-       } catch (IllegalArgumentException e) {}
-
-       p = bp.getProbe(BasicProvider.class.getMethod(
-           "probeWithArgs", int.class, float.class, String.class, Long.class));
-       try {
-         p.trigger();
-         fail("Probe.trigger: too few arguments not caught");
-       } catch (IllegalArgumentException e) {}
-
-       try {
-         p.trigger((float)3.14, (float)3.14, "", new Long(0L));
-         fail("Probe.trigger: wrong type primitive arguments not caught");
-       } catch (IllegalArgumentException e) {}
-    }
-}
--- a/jdk/test/demo/jvmti/DemoRun.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/demo/jvmti/DemoRun.java	Mon Feb 23 05:01:11 2015 -0800
@@ -115,10 +115,7 @@
      */
     public void runit(String class_name, String vm_options[])
     {
-        String jre_home  = System.getProperty("java.home");
-        String sdk_home  = (jre_home.endsWith("jre") ?
-                            (jre_home + File.separator + "..") :
-                            jre_home );
+        String sdk_home  = System.getProperty("java.home");
         String cdir      = System.getProperty("test.classes", ".");
         String os_arch   = System.getProperty("os.arch");
         String os_name   = System.getProperty("os.name");
@@ -126,7 +123,7 @@
         String libsuffix = os_name.contains("Windows")?".dll":
                                 os_name.contains("OS X")?".dylib":".so";
         boolean hprof    = demo_name.equals("hprof");
-        String java      = jre_home
+        String java      = sdk_home
                              + File.separator + "bin"
                              + File.separator + "java";
         /* Array of strings to be passed in for exec:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Color/LoadProfileWithSM.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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.
+ */
+
+import java.awt.color.*;
+
+/*
+ * @test
+ * @bug 8058969
+ * @summary test standard profiles loads with SecurityManager installed.
+ * @run main/othervm LoadProfileWithSM
+ */
+
+public class LoadProfileWithSM {
+
+    public static void main(String[] args) {
+        System.setSecurityManager(new SecurityManager());
+        ICC_Profile profile =
+            ((ICC_ColorSpace)(ColorSpace.getInstance(
+                ColorSpace.CS_GRAY))).getProfile();
+        /* request profile data in order to force profile loading */
+        profile.getData();
+   }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Color/LoadStandardProfilesTest.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8039271
+ * @summary test all standard profiles load correctly.
+ */
+
+import java.awt.color.ICC_Profile;
+
+public class LoadStandardProfilesTest {
+
+    public static void main(String args[]) {
+        try {
+            ICC_Profile sRGB      = ICC_Profile.getInstance("sRGB.pf");
+            ICC_Profile gray      = ICC_Profile.getInstance("GRAY.pf");
+            ICC_Profile pycc      = ICC_Profile.getInstance("PYCC.pf");
+            ICC_Profile ciexyz    = ICC_Profile.getInstance("CIEXYZ.pf");
+            ICC_Profile linearRGB = ICC_Profile.getInstance("LINEAR_RGB.pf");
+
+            if (sRGB == null ||
+                gray == null ||
+                pycc == null ||
+                ciexyz == null ||
+                linearRGB == null)
+            {
+                throw new RuntimeException("null profile.");
+            }
+        } catch (Exception e) {
+           throw new RuntimeException(e);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Component/DimensionEncapsulation/DimensionEncapsulation.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,215 @@
+/*
+ * 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.
+ *
+ * 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.
+ */
+
+import java.awt.Button;
+import java.awt.Canvas;
+import java.awt.Checkbox;
+import java.awt.Choice;
+import java.awt.Component;
+import java.awt.Dialog;
+import java.awt.Dimension;
+import java.awt.FileDialog;
+import java.awt.Frame;
+import java.awt.Label;
+import java.awt.List;
+import java.awt.Panel;
+import java.awt.ScrollPane;
+import java.awt.Scrollbar;
+import java.awt.TextArea;
+import java.awt.TextField;
+import java.awt.Window;
+import java.util.ArrayList;
+import java.util.Objects;
+
+import javax.swing.Box;
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JCheckBoxMenuItem;
+import javax.swing.JColorChooser;
+import javax.swing.JDesktopPane;
+import javax.swing.JDialog;
+import javax.swing.JEditorPane;
+import javax.swing.JFileChooser;
+import javax.swing.JFormattedTextField;
+import javax.swing.JFrame;
+import javax.swing.JInternalFrame;
+import javax.swing.JLabel;
+import javax.swing.JLayeredPane;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
+import javax.swing.JPasswordField;
+import javax.swing.JPopupMenu;
+import javax.swing.JProgressBar;
+import javax.swing.JRadioButton;
+import javax.swing.JRadioButtonMenuItem;
+import javax.swing.JRootPane;
+import javax.swing.JScrollPane;
+import javax.swing.JSeparator;
+import javax.swing.JSlider;
+import javax.swing.JSpinner;
+import javax.swing.JSplitPane;
+import javax.swing.JTabbedPane;
+import javax.swing.JTable;
+import javax.swing.JTextArea;
+import javax.swing.JTextField;
+import javax.swing.JTextPane;
+import javax.swing.JToggleButton;
+import javax.swing.JToolBar;
+import javax.swing.JTree;
+import javax.swing.JViewport;
+import javax.swing.JWindow;
+import javax.swing.SwingUtilities;
+import javax.swing.UIManager;
+import javax.swing.UIManager.LookAndFeelInfo;
+import javax.swing.UnsupportedLookAndFeelException;
+import javax.swing.table.JTableHeader;
+
+import static javax.swing.UIManager.getInstalledLookAndFeels;
+
+/**
+ * @test
+ * @bug 6459798
+ * @author Sergey Bylokhov
+ */
+public final class DimensionEncapsulation implements Runnable {
+
+    java.util.List<Component> failures = new ArrayList<>();
+
+    public static void main(final String[] args) throws Exception {
+        for (final LookAndFeelInfo laf : getInstalledLookAndFeels()) {
+            SwingUtilities.invokeAndWait(() -> setLookAndFeel(laf));
+            SwingUtilities.invokeAndWait(new DimensionEncapsulation());
+        }
+    }
+
+    @Override
+    public void run() {
+        runTest(new Panel());
+        runTest(new Button());
+        runTest(new Checkbox());
+        runTest(new Canvas());
+        runTest(new Choice());
+        runTest(new Label());
+        runTest(new Scrollbar());
+        runTest(new TextArea());
+        runTest(new TextField());
+        runTest(new Dialog(new JFrame()));
+        runTest(new Frame());
+        runTest(new Window(new JFrame()));
+        runTest(new FileDialog(new JFrame()));
+        runTest(new List());
+        runTest(new ScrollPane());
+        runTest(new JFrame());
+        runTest(new JDialog(new JFrame()));
+        runTest(new JWindow(new JFrame()));
+        runTest(new JLabel("hi"));
+        runTest(new JMenu());
+        runTest(new JTree());
+        runTest(new JTable());
+        runTest(new JMenuItem());
+        runTest(new JCheckBoxMenuItem());
+        runTest(new JToggleButton());
+        runTest(new JSpinner());
+        runTest(new JSlider());
+        runTest(Box.createVerticalBox());
+        runTest(Box.createHorizontalBox());
+        runTest(new JTextField());
+        runTest(new JTextArea());
+        runTest(new JTextPane());
+        runTest(new JPasswordField());
+        runTest(new JFormattedTextField());
+        runTest(new JEditorPane());
+        runTest(new JButton());
+        runTest(new JColorChooser());
+        runTest(new JFileChooser());
+        runTest(new JCheckBox());
+        runTest(new JInternalFrame());
+        runTest(new JDesktopPane());
+        runTest(new JTableHeader());
+        runTest(new JLayeredPane());
+        runTest(new JRootPane());
+        runTest(new JMenuBar());
+        runTest(new JOptionPane());
+        runTest(new JRadioButton());
+        runTest(new JRadioButtonMenuItem());
+        runTest(new JPopupMenu());
+        //runTest(new JScrollBar()); --> don't test defines max and min in
+        // terms of preferred
+        runTest(new JScrollPane());
+        runTest(new JViewport());
+        runTest(new JSplitPane());
+        runTest(new JTabbedPane());
+        runTest(new JToolBar());
+        runTest(new JSeparator());
+        runTest(new JProgressBar());
+        if (!failures.isEmpty()) {
+            System.out.println("These classes failed");
+            for (final Component failure : failures) {
+                System.out.println(failure.getClass());
+            }
+            throw new RuntimeException("Test failed");
+        }
+    }
+
+    public void runTest(final Component c) {
+        try {
+            test(c);
+            c.setMinimumSize(new Dimension(100, 10));
+            c.setMaximumSize(new Dimension(200, 20));
+            c.setPreferredSize(new Dimension(300, 30));
+            test(c);
+        } catch (final Throwable ignored) {
+            failures.add(c);
+        }
+    }
+
+    public void test(final Component component) {
+        final Dimension psize = component.getPreferredSize();
+        psize.width += 200;
+        if (Objects.equals(psize, component.getPreferredSize())) {
+            throw new RuntimeException("PreferredSize is wrong");
+        }
+        final Dimension msize = component.getMaximumSize();
+        msize.width += 200;
+        if (Objects.equals(msize, component.getMaximumSize())) {
+            throw new RuntimeException("MaximumSize is wrong");
+        }
+        final Dimension misize = component.getMinimumSize();
+        misize.width += 200;
+        if (Objects.equals(misize, component.getMinimumSize())) {
+            throw new RuntimeException("MinimumSize is wrong");
+        }
+    }
+
+    private static void setLookAndFeel(final LookAndFeelInfo laf) {
+        try {
+            UIManager.setLookAndFeel(laf.getClassName());
+            System.out.println("LookAndFeel: " + laf.getClassName());
+        } catch (ClassNotFoundException | InstantiationException |
+                UnsupportedLookAndFeelException | IllegalAccessException e) {
+            throw new RuntimeException(e);
+        }
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Component/InsetsEncapsulation/InsetsEncapsulation.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,166 @@
+/*
+ * 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.
+ *
+ * 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.
+ */
+
+import java.awt.Component;
+import java.awt.Insets;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import javax.swing.Box;
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JCheckBoxMenuItem;
+import javax.swing.JColorChooser;
+import javax.swing.JComponent;
+import javax.swing.JDesktopPane;
+import javax.swing.JEditorPane;
+import javax.swing.JFileChooser;
+import javax.swing.JFormattedTextField;
+import javax.swing.JInternalFrame;
+import javax.swing.JLabel;
+import javax.swing.JLayeredPane;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
+import javax.swing.JPasswordField;
+import javax.swing.JPopupMenu;
+import javax.swing.JProgressBar;
+import javax.swing.JRadioButton;
+import javax.swing.JRadioButtonMenuItem;
+import javax.swing.JRootPane;
+import javax.swing.JScrollBar;
+import javax.swing.JScrollPane;
+import javax.swing.JSeparator;
+import javax.swing.JSlider;
+import javax.swing.JSpinner;
+import javax.swing.JSplitPane;
+import javax.swing.JTabbedPane;
+import javax.swing.JTable;
+import javax.swing.JTextArea;
+import javax.swing.JTextField;
+import javax.swing.JTextPane;
+import javax.swing.JToggleButton;
+import javax.swing.JToolBar;
+import javax.swing.JTree;
+import javax.swing.JViewport;
+import javax.swing.SwingUtilities;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+import javax.swing.table.JTableHeader;
+
+import static javax.swing.UIManager.LookAndFeelInfo;
+import static javax.swing.UIManager.getInstalledLookAndFeels;
+
+/**
+ * @test
+ * @bug 6459800
+ * @author Sergey Bylokhov
+ */
+public final class InsetsEncapsulation implements Runnable {
+
+    private final Collection<Component> failures = new ArrayList<>();
+
+    public static void main(final String[] args) throws Exception {
+        for (final LookAndFeelInfo laf : getInstalledLookAndFeels()) {
+            SwingUtilities.invokeAndWait(() -> setLookAndFeel(laf));
+            SwingUtilities.invokeAndWait(new InsetsEncapsulation());
+        }
+    }
+
+    @Override
+    public void run() {
+        runTest(new JLabel("hi"));
+        runTest(new JMenu());
+        runTest(new JTree());
+        runTest(new JTable());
+        runTest(new JMenuItem());
+        runTest(new JCheckBoxMenuItem());
+        runTest(new JToggleButton());
+        runTest(new JSpinner());
+        runTest(new JSlider());
+        runTest(Box.createVerticalBox());
+        runTest(Box.createHorizontalBox());
+        runTest(new JTextField());
+        runTest(new JTextArea());
+        runTest(new JTextPane());
+        runTest(new JPasswordField());
+        runTest(new JFormattedTextField());
+        runTest(new JEditorPane());
+        runTest(new JButton());
+        runTest(new JColorChooser());
+        runTest(new JFileChooser());
+        runTest(new JCheckBox());
+        runTest(new JInternalFrame());
+        runTest(new JDesktopPane());
+        runTest(new JTableHeader());
+        runTest(new JLayeredPane());
+        runTest(new JRootPane());
+        runTest(new JMenuBar());
+        runTest(new JOptionPane());
+        runTest(new JRadioButton());
+        runTest(new JRadioButtonMenuItem());
+        runTest(new JPopupMenu());
+        runTest(new JScrollBar());
+        runTest(new JScrollPane());
+        runTest(new JViewport());
+        runTest(new JSplitPane());
+        runTest(new JTabbedPane());
+        runTest(new JToolBar());
+        runTest(new JSeparator());
+        runTest(new JProgressBar());
+        if (!failures.isEmpty()) {
+            System.out.println("These classes failed");
+            for (final Component failure : failures) {
+                System.out.println(failure.getClass());
+            }
+            throw new RuntimeException("Test failed");
+        }
+    }
+
+    void runTest(final JComponent component) {
+        try {
+            test(component);
+        } catch (final Throwable ignored) {
+            failures.add(component);
+        }
+    }
+
+    void test(final JComponent component) {
+        final Insets p = component.getInsets();
+        p.top += 3;
+        if (p.equals(component.getInsets())) {
+            throw new RuntimeException("Insets altered by altering Insets!");
+        }
+    }
+
+    private static void setLookAndFeel(final LookAndFeelInfo laf) {
+        try {
+            UIManager.setLookAndFeel(laf.getClassName());
+            System.out.println("LookAndFeel: " + laf.getClassName());
+        } catch (ClassNotFoundException | InstantiationException |
+                UnsupportedLookAndFeelException | IllegalAccessException e) {
+            throw new RuntimeException(e);
+        }
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Desktop/8064934/bug8064934.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,83 @@
+/*
+ * 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.
+ *
+ * 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.
+ */
+
+/* @test
+ * @bug 8064934
+ * @summary Incorrect Exception message from java.awt.Desktop.open()
+ * @author Dmitry Markov
+ * @run main bug8064934
+ */
+import sun.awt.OSInfo;
+
+import java.awt.*;
+import java.io.File;
+import java.io.IOException;
+import java.security.AccessController;
+
+public class bug8064934 {
+    private static final String NO_ASSOCIATION_ERROR_MESSAGE = "Error message: No application is associated with" +
+            " the specified file for this operation.";
+
+    public static void main(String[] args) {
+        // This test is intended only for Windows
+        if (AccessController.doPrivileged(OSInfo.getOSTypeAction()) != OSInfo.OSType.WINDOWS) {
+            System.out.println("The test is for Windows platform only");
+            return;
+        }
+
+        // Test whether Desktop is supported of not
+        if (!Desktop.isDesktopSupported()) {
+            System.out.println("Desktop is not supported");
+            return;
+        }
+
+        Desktop desktop = Desktop.getDesktop();
+        // Test whether open action is supported or not
+        if (!desktop.isSupported(Desktop.Action.OPEN)) {
+            System.out.println("Desktop.Action.OPEN is not supported");
+            return;
+        }
+
+        File file = null;
+        try {
+            file = File.createTempFile("test", ".foo");
+            if (!file.exists()) {
+                throw new RuntimeException("Can not create temp file");
+            }
+            desktop.open(file);
+        } catch (IOException ioe) {
+            String errorMessage = ioe.getMessage().trim();
+            if (errorMessage != null && !errorMessage.endsWith(NO_ASSOCIATION_ERROR_MESSAGE)) {
+                throw new RuntimeException("Test FAILED! Wrong Error message: \n" +
+                        "Actual " + errorMessage.substring(errorMessage.indexOf("Error message:")) + "\n" +
+                        "Expected " + NO_ASSOCIATION_ERROR_MESSAGE);
+            }
+        } finally {
+            if (file != null) {
+                file.delete();
+            }
+        }
+
+        System.out.println("Test PASSED!");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/FontClass/HelvLtOblTest.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,166 @@
+/*
+ * 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.
+ *
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8064833
+ * @summary Test correct font is obtained via famil+style
+ * @run main HelvLtOblTest
+ */
+
+import javax.swing.JComponent;
+import javax.swing.JFrame;
+import javax.swing.SwingUtilities;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.GraphicsEnvironment;
+import java.awt.RenderingHints;
+import java.awt.font.FontRenderContext;
+import java.awt.font.GlyphVector;
+import java.awt.image.BufferedImage;
+
+public class HelvLtOblTest extends JComponent {
+
+    static Font helvFont = null;
+
+    static int[] codes = { 0x23, 0x4a, 0x48, 0x3, 0x4a, 0x55, 0x42, 0x4d,
+                    0x4a, 0x44, 0x3,
+                    0x53, 0x46, 0x45, 0x3, 0x55, 0x46, 0x59, 0x55, };
+
+    static String str = "Big italic red text";
+
+    public static void main(String[] args) throws Exception {
+        String os = System.getProperty("os.name");
+        if (!os.startsWith("Mac")) {
+             return;
+        }
+        GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
+        Font[] fonts = ge.getAllFonts();
+        for (int i=0; i<fonts.length; i++) {
+            if (fonts[i].getPSName().equals("Helvetica-LightOblique")) {
+                 helvFont = fonts[i];
+                 break;
+            }
+        }
+        if (helvFont == null) {
+            return;
+        }
+        final HelvLtOblTest test = new HelvLtOblTest();
+        SwingUtilities.invokeLater(() -> {
+            JFrame f = new JFrame();
+            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+            f.add("Center", test);
+            f.pack();
+            f.setVisible(true);
+        });
+        test.compareImages();
+    }
+
+    public Dimension getPreferredSize() {
+      return new Dimension(400,400);
+    }
+
+    public void paintComponent(Graphics g) {
+         super.paintComponent(g);
+         Graphics2D g2 = (Graphics2D)g;
+         FontRenderContext frc = new FontRenderContext(null, true, true);
+         Font f = helvFont.deriveFont(Font.PLAIN, 40);
+         System.out.println("font = " +f.getFontName());
+         GlyphVector gv = f.createGlyphVector(frc, codes);
+         g.setFont(f);
+         g.setColor(Color.white);
+         g.fillRect(0,0,400,400);
+         g.setColor(Color.black);
+         g2.drawGlyphVector(gv, 5,200);
+         g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
+                             RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
+         g2.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,
+                             RenderingHints.VALUE_FRACTIONALMETRICS_ON);
+         g2.drawString(str, 5, 250);
+    }
+
+    void compareImages() {
+         BufferedImage bi0 = drawText(false);
+         BufferedImage bi1 = drawText(true);
+         compare(bi0, bi1);
+    }
+
+    BufferedImage drawText(boolean doGV) {
+        int w = 400;
+        int h = 50;
+        BufferedImage bi = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
+        Graphics2D g = bi.createGraphics();
+        g.setColor(Color.white);
+        g.fillRect(0,0,w,h);
+        g.setColor(Color.black);
+        Font f = helvFont.deriveFont(Font.PLAIN, 40);
+        g.setFont(f);
+        int x = 5;
+        int y = h - 10;
+        if (doGV) {
+            FontRenderContext frc = new FontRenderContext(null, true, true);
+            GlyphVector gv = f.createGlyphVector(frc, codes);
+            g.drawGlyphVector(gv, 5, y);
+       } else {
+           g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
+                              RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
+           g.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,
+                              RenderingHints.VALUE_FRACTIONALMETRICS_ON);
+           g.drawString(str, x, y);
+       }
+       return bi;
+    }
+
+    // Need to allow for minimal rounding error, so allow each component
+    // to differ by 1.
+    void compare(BufferedImage bi0, BufferedImage bi1) {
+        int wid = bi0.getWidth();
+        int hgt = bi0.getHeight();
+        for (int x=0; x<wid; x++) {
+            for (int y=0; y<hgt; y++) {
+                int rgb0 = bi0.getRGB(x, y);
+                int rgb1 = bi1.getRGB(x, y);
+                if (rgb0 == rgb1) continue;
+                int r0 = (rgb0 & 0xff0000) >> 16;
+                int r1 = (rgb1 & 0xff0000) >> 16;
+                int rdiff = r0-r1; if (rdiff<0) rdiff = -rdiff;
+                int g0 = (rgb0 & 0x00ff00) >> 8;
+                int g1 = (rgb1 & 0x00ff00) >> 8;
+                int gdiff = g0-g1; if (gdiff<0) gdiff = -gdiff;
+                int b0 = (rgb0 & 0x0000ff);
+                int b1 = (rgb1 & 0x0000ff);
+                int bdiff = b0-b1; if (bdiff<0) bdiff = -bdiff;
+                if (rdiff > 1 || gdiff > 1 || bdiff > 1) {
+                    throw new RuntimeException(
+                      "Images differ at x=" + x + " y="+ y + " " +
+                      Integer.toHexString(rgb0) + " vs " +
+                      Integer.toHexString(rgb1));
+                }
+            }
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/FullScreen/NonExistentDisplayModeTest/NonExistentDisplayModeTest.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,152 @@
+/*
+ * Copyright (c) 2006, 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.
+ *
+ * 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.
+ */
+
+import java.awt.DisplayMode;
+import java.awt.Frame;
+import java.awt.GraphicsDevice;
+import java.util.ArrayList;
+import java.util.Random;
+
+import static java.awt.DisplayMode.REFRESH_RATE_UNKNOWN;
+
+/**
+ * @test
+ * @bug 6430607
+ * @summary Test that we throw an exception for incorrect display modes
+ * @author Dmitri.Trembovetski@Sun.COM area=FullScreen
+ * @run main/othervm NonExistentDisplayModeTest
+ * @run main/othervm -Dsun.java2d.noddraw=true NonExistentDisplayModeTest
+ * @run main/othervm -Dsun.java2d.opengl=true NonExistentDisplayModeTest
+ */
+public class NonExistentDisplayModeTest {
+
+    public static void main(String[] args) {
+        new NonExistentDisplayModeTest().start();
+    }
+
+    private void start() {
+        Frame f = new Frame("Testing, please wait..");
+        f.pack();
+        GraphicsDevice gd = f.getGraphicsConfiguration().getDevice();
+        if (!gd.isFullScreenSupported()) {
+            System.out.println("Exclusive FS mode not supported, test passed.");
+            f.dispose();
+            return;
+        }
+
+        gd.setFullScreenWindow(f);
+        if (!gd.isDisplayChangeSupported()) {
+            System.out.println("DisplayMode change not supported, test passed.");
+            f.dispose();
+            return;
+        }
+
+        DisplayMode dms[] = gd.getDisplayModes();
+        ArrayList<DisplayMode> dmList = new ArrayList<DisplayMode>(dms.length);
+        for (DisplayMode dm : dms) {
+            dmList.add(dm);
+        }
+
+        ArrayList<DisplayMode> nonExistentDms = createNonExistentDMList(dmList);
+
+        for (DisplayMode dm : nonExistentDms) {
+            boolean exThrown = false;
+            try {
+                System.out.printf("Testing mode: (%4dx%4d) depth=%3d rate=%d\n",
+                                  dm.getWidth(), dm.getHeight(),
+                                  dm.getBitDepth(), dm.getRefreshRate());
+                gd.setDisplayMode(dm);
+            } catch (IllegalArgumentException e) {
+                exThrown = true;
+            }
+            if (!exThrown) {
+                gd.setFullScreenWindow(null);
+                f.dispose();
+                throw new
+                    RuntimeException("Failed: No exception thrown for dm "+dm);
+            }
+        }
+        gd.setFullScreenWindow(null);
+        f.dispose();
+        System.out.println("Test passed.");
+    }
+
+    private static final Random rnd = new Random();
+    private ArrayList<DisplayMode>
+        createNonExistentDMList(ArrayList<DisplayMode> dmList)
+    {
+        ArrayList<DisplayMode> newList =
+            new ArrayList<DisplayMode>(dmList.size());
+        // vary one parameter at a time
+        int param = 0;
+        for (DisplayMode dm : dmList) {
+            param = ++param % 3;
+            switch (param) {
+                case 0: {
+                    DisplayMode newDM = deriveSize(dm);
+                    if (!dmList.contains(newDM)) {
+                        newList.add(newDM);
+                    }
+                    break;
+                }
+                case 1: {
+                    DisplayMode newDM = deriveDepth(dm);
+                    if (!dmList.contains(newDM)) {
+                        newList.add(newDM);
+                    }
+                    break;
+                }
+                case 2: {
+                    if (dm.getRefreshRate() != REFRESH_RATE_UNKNOWN) {
+                        DisplayMode newDM = deriveRR(dm);
+                        if (!dmList.contains(newDM)) {
+                            newList.add(newDM);
+                        }
+                    }
+                    break;
+                }
+            }
+        }
+        return newList;
+    }
+
+    private static DisplayMode deriveSize(DisplayMode dm) {
+        int w = dm.getWidth() / 7;
+        int h = dm.getHeight() / 3;
+        return new DisplayMode(w, h, dm.getBitDepth(), dm.getRefreshRate());
+    }
+    private static DisplayMode deriveRR(DisplayMode dm) {
+        return new DisplayMode(dm.getWidth(), dm.getHeight(),
+                               dm.getBitDepth(), 777);
+    }
+    private static DisplayMode deriveDepth(DisplayMode dm) {
+        int depth;
+        if (dm.getBitDepth() == DisplayMode.BIT_DEPTH_MULTI) {
+            depth = 77;
+        } else {
+            depth = DisplayMode.BIT_DEPTH_MULTI;
+        }
+        return new DisplayMode(dm.getWidth(), dm.getHeight(),
+                               depth, dm.getRefreshRate());
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/MenuBar/RemoveHelpMenu/RemoveHelpMenu.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,132 @@
+/*
+ * 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.
+ *
+ * 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.
+ */
+
+import java.awt.Frame;
+import java.awt.Menu;
+import java.awt.MenuBar;
+
+/**
+ * @test
+ * @bug 6475361
+ * @author Sergey Bylokhov
+ */
+public final class RemoveHelpMenu {
+
+    public static void main(final String[] args) {
+        final Frame frame = new Frame("RemoveHelpMenu Test");
+        try {
+            frame.pack();
+            // peer exists
+            test1(getMenuBar(frame));
+            test2(getMenuBar(frame));
+            test3(getMenuBar(frame));
+            test4(getMenuBar(frame));
+        } finally {
+            frame.dispose();
+        }
+        // peer is null
+        test1(getMenuBar(frame));
+        test2(getMenuBar(frame));
+        test3(getMenuBar(frame));
+        test4(getMenuBar(frame));
+    }
+
+    private static MenuBar getMenuBar(final Frame frame) {
+        final MenuBar menuBar = new MenuBar();
+        frame.setMenuBar(menuBar);
+        return menuBar;
+    }
+
+    private static void checkHelpMenu(final Menu menu, final boolean expected) {
+        final boolean actual = menu.toString().contains("isHelpMenu=true");
+        if (actual != expected) {
+            throw new RuntimeException("Incorrect menu type");
+        }
+    }
+
+    private static void checkMenuCount(final MenuBar bar, final int expected) {
+        final int actual = bar.getMenuCount();
+        if (actual != expected) {
+            throw new RuntimeException("Incorrect menus count");
+        }
+    }
+
+    private static void checkCurrentMenu(final MenuBar bar, final Menu menu) {
+        if (bar.getHelpMenu() != menu) {
+            throw new RuntimeException("Wrong HelpMenu");
+        }
+    }
+
+    private static void test1(final MenuBar menuBar) {
+        checkCurrentMenu(menuBar, null);
+        checkMenuCount(menuBar, 0);
+    }
+
+    private static void test2(final MenuBar menuBar) {
+        final Menu helpMenu = new Menu("Help Menu");
+        menuBar.setHelpMenu(helpMenu);
+        checkCurrentMenu(menuBar, helpMenu);
+        checkMenuCount(menuBar, 1);
+        checkHelpMenu(helpMenu, true);
+
+        menuBar.remove(helpMenu);
+        checkCurrentMenu(menuBar, null);
+        checkMenuCount(menuBar, 0);
+        checkHelpMenu(helpMenu, false);
+    }
+
+    private static void test3(final MenuBar menuBar) {
+        final Menu helpMenu1 = new Menu("Help Menu1");
+        final Menu helpMenu2 = new Menu("Help Menu2");
+        menuBar.setHelpMenu(helpMenu1);
+        checkCurrentMenu(menuBar, helpMenu1);
+        checkMenuCount(menuBar, 1);
+        checkHelpMenu(helpMenu1, true);
+        checkHelpMenu(helpMenu2, false);
+
+        menuBar.setHelpMenu(helpMenu2);
+        checkCurrentMenu(menuBar, helpMenu2);
+        checkMenuCount(menuBar, 1);
+        checkHelpMenu(helpMenu1, false);
+        checkHelpMenu(helpMenu2, true);
+
+        menuBar.remove(helpMenu2);
+        checkCurrentMenu(menuBar, null);
+        checkMenuCount(menuBar, 0);
+        checkHelpMenu(helpMenu1, false);
+        checkHelpMenu(helpMenu2, false);
+    }
+
+    private static void test4(final MenuBar menuBar) {
+        final Menu helpMenu = new Menu("Help Menu");
+        menuBar.setHelpMenu(helpMenu);
+        checkCurrentMenu(menuBar, helpMenu);
+        checkMenuCount(menuBar, 1);
+        checkHelpMenu(helpMenu, true);
+
+        menuBar.setHelpMenu(null);
+        checkCurrentMenu(menuBar, null);
+        checkMenuCount(menuBar, 0);
+        checkHelpMenu(helpMenu, false);
+    }
+}
\ No newline at end of file
--- a/jdk/test/java/awt/Mixing/HWDisappear.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/java/awt/Mixing/HWDisappear.java	Mon Feb 23 05:01:11 2015 -0800
@@ -40,6 +40,7 @@
 import java.awt.*;
 import java.awt.event.*;
 import javax.swing.*;
+import javax.swing.plaf.metal.MetalLookAndFeel;
 import test.java.awt.regtesthelpers.Util;
 
 public class HWDisappear
@@ -109,7 +110,7 @@
 
         // Click on the button.
         Point bLoc = b.getLocationOnScreen();
-        robot.mouseMove(bLoc.x + b.getWidth() / 2, bLoc.y + 5);
+        robot.mouseMove(bLoc.x + b.getWidth() / 2, bLoc.y + b.getHeight() / 2);
 
         robot.mousePress(InputEvent.BUTTON1_MASK);
         robot.mouseRelease(InputEvent.BUTTON1_MASK);
@@ -148,8 +149,9 @@
     //  instantiated in the same VM.  Being static (and using
     //  static vars), it aint gonna work.  Not worrying about
     //  it for now.
-    public static void main( String args[] ) throws InterruptedException
+    public static void main( String args[] ) throws Exception
     {
+        UIManager.setLookAndFeel(new MetalLookAndFeel());
         mainThread = Thread.currentThread();
         try
         {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Mouse/RemovedComponentMouseListener/RemovedComponentMouseListener.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,94 @@
+/*
+ * 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.
+ *
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8061636
+ * @summary fix for 7079254 changes behavior of MouseListener, MouseMotionListener
+ * @library ../../regtesthelpers
+ * @build Util
+ * @author Alexander Zvegintsev
+ * @run main RemovedComponentMouseListener
+ */
+
+import java.awt.Robot;
+import java.awt.event.InputEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import javax.swing.*;
+import test.java.awt.regtesthelpers.Util;
+
+public class RemovedComponentMouseListener extends JFrame {
+
+    static boolean mouseReleasedReceived;
+    static JButton button;
+
+    public RemovedComponentMouseListener() {
+        JPanel panel = new JPanel();
+        JPanel buttonPanel = new JPanel();
+        button = new JButton("Button");
+
+        setSize(300, 300);
+
+        buttonPanel.add(button);
+        panel.add(buttonPanel);
+        setContentPane(panel);
+
+        button.addMouseListener(new MouseAdapter() {
+            @Override
+            public void mousePressed(MouseEvent e) {
+                buttonPanel.remove(button);
+                panel.add(button);
+                button.revalidate();
+                button.repaint();
+            }
+
+            @Override
+            public void mouseReleased(MouseEvent e) {
+                mouseReleasedReceived = true;
+            }
+        });
+
+        setVisible(true);
+    }
+
+    public static void main(String[] args) throws Exception {
+        SwingUtilities.invokeAndWait(() -> {
+            new RemovedComponentMouseListener();
+        });
+
+        Robot r = Util.createRobot();
+        r.setAutoDelay(100);
+        r.waitForIdle();
+        Util.pointOnComp(button, r);
+
+        r.waitForIdle();
+        r.mousePress(InputEvent.BUTTON1_MASK);
+        r.waitForIdle();
+        r.mouseRelease(InputEvent.BUTTON1_MASK);
+        r.waitForIdle();
+        if (!mouseReleasedReceived) {
+            throw new RuntimeException("mouseReleased event was not received");
+        }
+    }
+}
--- a/jdk/test/java/awt/color/LoadProfileWithSM.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 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.
- *
- * 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.
- */
-
-import java.awt.color.*;
-
-/*
- * @test
- * @bug 8058969
- * @summary test standard profiles loads with SecurityManager installed.
- * @run main/othervm LoadProfileWithSM
- */
-
-public class LoadProfileWithSM {
-
-    public static void main(String[] args) {
-        System.setSecurityManager(new SecurityManager());
-        ICC_Profile profile =
-            ((ICC_ColorSpace)(ColorSpace.getInstance(
-                ColorSpace.CS_GRAY))).getProfile();
-        /* request profile data in order to force profile loading */
-        profile.getData();
-   }
-}
--- a/jdk/test/java/awt/color/LoadStandardProfilesTest.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 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.
- *
- * 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.
- */
-
-/*
- * @test
- * @bug 8039271
- * @summary test all standard profiles load correctly.
- */
-
-import java.awt.color.ICC_Profile;
-
-public class LoadStandardProfilesTest {
-
-    public static void main(String args[]) {
-        try {
-            ICC_Profile sRGB      = ICC_Profile.getInstance("sRGB.pf");
-            ICC_Profile gray      = ICC_Profile.getInstance("GRAY.pf");
-            ICC_Profile pycc      = ICC_Profile.getInstance("PYCC.pf");
-            ICC_Profile ciexyz    = ICC_Profile.getInstance("CIEXYZ.pf");
-            ICC_Profile linearRGB = ICC_Profile.getInstance("LINEAR_RGB.pf");
-
-            if (sRGB == null ||
-                gray == null ||
-                pycc == null ||
-                ciexyz == null ||
-                linearRGB == null)
-            {
-                throw new RuntimeException("null profile.");
-            }
-        } catch (Exception e) {
-           throw new RuntimeException(e);
-        }
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/event/KeyEvent/AltCharAcceleratorTest/AltCharAcceleratorTest.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,136 @@
+/*
+ * 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.
+ *
+ * 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.
+ */
+
+/*
+@test
+@bug 8068283
+@summary Checks that <Alt>+Char accelerators work when pressed in a text component
+@author Anton Nashatyrev
+@run main AltCharAcceleratorTest
+*/
+
+import sun.awt.SunToolkit;
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.*;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+public class AltCharAcceleratorTest {
+
+    boolean action1 = false;
+    boolean action2 = false;
+
+    CountDownLatch focusLatch = new CountDownLatch(1);
+    CountDownLatch actionLatch = new CountDownLatch(2);
+
+    public AltCharAcceleratorTest() throws Exception {
+        SwingUtilities.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                JFrame f = new JFrame("frame");
+                final JTextField t = new JTextField();
+                JMenuBar mb = new JMenuBar();
+                JMenu m1 = new JMenu("File");
+                JMenuItem i1 = new JMenuItem("Save");
+                JMenuItem i2 = new JMenuItem("Load");
+
+                i1.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_T, KeyEvent.ALT_MASK));
+                i2.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F, KeyEvent.ALT_MASK));
+
+                i1.addActionListener(new ActionListener() {
+                    @Override
+                    public void actionPerformed(ActionEvent e) {
+                        System.out.println("Action1!");
+                        action1 = true;
+                        actionLatch.countDown();
+                    }
+                });
+
+                i2.addActionListener(new ActionListener() {
+                    @Override
+                    public void actionPerformed(ActionEvent e) {
+                        System.out.println("Action2!");
+                        action2 = true;
+                        actionLatch.countDown();
+                    }
+                });
+
+                t.addFocusListener(new FocusAdapter() {
+                    @Override
+                    public void focusGained(FocusEvent e) {
+                        System.out.println("Focused!");
+                        focusLatch.countDown();
+                    }
+                });
+
+                t.setColumns(10);
+                t.requestFocusInWindow();
+
+                f.setJMenuBar(mb);
+                mb.add(m1);
+                m1.add(i1);
+                m1.add(i2);
+
+                f.setLayout(new FlowLayout());
+                f.add(t);
+                f.setSize(200, 200);
+
+                f.setVisible(true);
+            }
+        });
+    }
+
+    void test() throws Exception {
+        ((SunToolkit) Toolkit.getDefaultToolkit()).realSync();
+
+        focusLatch.await(5, TimeUnit.SECONDS);
+
+        Robot robot = new Robot();
+        robot.setAutoDelay(100);
+
+        robot.keyPress(KeyEvent.VK_ALT);
+        robot.keyPress(KeyEvent.VK_T);
+        robot.keyRelease(KeyEvent.VK_T);
+        robot.keyRelease(KeyEvent.VK_ALT);
+
+        robot.keyPress(KeyEvent.VK_ALT);
+        robot.keyPress(KeyEvent.VK_F);
+        robot.keyRelease(KeyEvent.VK_F);
+        robot.keyRelease(KeyEvent.VK_ALT);
+
+        actionLatch.await(5, TimeUnit.SECONDS);
+
+        if (!action1 || !action2) {
+            throw new RuntimeException("Actions not performed");
+        }
+
+        System.out.println("Passed.");
+    }
+
+    public static void main(String[] args) throws Exception {
+        AltCharAcceleratorTest t = new AltCharAcceleratorTest();
+        t.test();
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/image/BufferedImage/GetPropertyNames.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,103 @@
+/*
+ * 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.
+ *
+ * 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.
+ */
+
+import java.awt.Image;
+import java.awt.image.BufferedImage;
+import java.util.Properties;
+
+import static java.awt.image.BufferedImage.TYPE_INT_ARGB;
+
+/**
+ * @test
+ * @bug 8066132
+ * @author Sergey Bylokhov
+ */
+public final class GetPropertyNames {
+
+    static BufferedImage defaultProps = new BufferedImage(1, 1, TYPE_INT_ARGB);
+
+    public static void main(final String[] args) {
+        // default result is null
+        if (defaultProps.getPropertyNames() != null) {
+            throw new RuntimeException("PropertyNames should be null");
+        }
+        // for null properties result is null
+        final BufferedImage emptyProps = getBufferedImage(null);
+        if (emptyProps.getPropertyNames() != null) {
+            throw new RuntimeException("PropertyNames should be null");
+        }
+        // for empty properties result is null
+        final BufferedImage nullProps = getBufferedImage(new Properties());
+        if (nullProps.getPropertyNames() != null) {
+            throw new RuntimeException("PropertyNames should be null");
+        }
+        // for non-string keys result is null
+        final Properties properties = new Properties();
+        properties.put(1, 1);
+        properties.put(2, 2);
+        properties.put(3, 3);
+        final BufferedImage nonStringProps = getBufferedImage(properties);
+        if (nonStringProps.getPropertyNames() != null) {
+            throw new RuntimeException("PropertyNames should be null");
+        }
+        // for string keys result is not null
+        properties.clear();
+        properties.setProperty("1", "1");
+        properties.setProperty("2", "2");
+        validate(getBufferedImage(properties), 2);
+        // for the mix of strings and objects result is not null
+        properties.clear();
+        properties.put(1, 1);
+        properties.put(2, 2);
+        properties.put(3, 3);
+        properties.setProperty("key1", "value1");
+        properties.setProperty("key2", "value2");
+        final BufferedImage mixProps = getBufferedImage(properties);
+        validate(mixProps, 2);
+        if (!"value1".equals(mixProps.getProperty("key1"))
+            || !"value2".equals(mixProps.getProperty("key2"))) {
+            throw new RuntimeException("Wrong key-value pair");
+        }
+    }
+
+
+    private static BufferedImage getBufferedImage(final Properties properties) {
+        return new BufferedImage(defaultProps.getColorModel(),
+                                 defaultProps.getRaster(),
+                                 defaultProps.isAlphaPremultiplied(),
+                                 properties);
+    }
+
+    private static void validate(final BufferedImage bi, final int expected) {
+        final String[] names = bi.getPropertyNames();
+        if (names.length != expected) {
+            throw new RuntimeException("Wrong number of names");
+        }
+        for (final String name : names) {
+            final Object property = bi.getProperty(name);
+            if (property == Image.UndefinedProperty || property == null) {
+                throw new RuntimeException("Unexpected property");
+            }
+        }
+    }
+}
--- a/jdk/test/java/beans/Introspector/7064279/Test7064279.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/java/beans/Introspector/7064279/Test7064279.java	Mon Feb 23 05:01:11 2015 -0800
@@ -26,6 +26,7 @@
  * @bug 7064279
  * @summary Tests that Introspector does not have strong references to context class loader
  * @author Sergey Malenkov
+ * @run main/othervm -Xmx128m Test7064279
  */
 
 import java.beans.Introspector;
--- a/jdk/test/java/beans/Introspector/Test7172865.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/java/beans/Introspector/Test7172865.java	Mon Feb 23 05:01:11 2015 -0800
@@ -30,6 +30,7 @@
  * @bug 7172854 7172865
  * @summary Tests that cached methods are not lost
  * @author Sergey Malenkov
+ * @run main/othervm -Xmx128m Test7172865
  */
 
 public class Test7172865 {
--- a/jdk/test/java/beans/Introspector/Test7195106.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/java/beans/Introspector/Test7195106.java	Mon Feb 23 05:01:11 2015 -0800
@@ -26,6 +26,7 @@
  * @bug 7195106
  * @summary Tests that explicit BeanInfo is not collected
  * @author Sergey Malenkov
+ * @run main/othervm -Xmx128m Test7195106
  */
 
 import java.awt.Image;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/ProcessBuilder/RedirectWithLongFilename.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,79 @@
+/*
+ * Copyright 2015 SAP SE.  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.
+ *
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8072611
+ * @summary ProcessBuilder Redirect to file appending on Windows should work with long file names
+ * @author Thomas Stuefe
+ */
+
+import java.io.File;
+import java.lang.ProcessBuilder.Redirect;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+public class RedirectWithLongFilename {
+
+    public static void main(String[] args) throws Exception {
+
+        // windows only
+        if (!Basic.Windows.is()) {
+            return;
+        }
+
+        // Redirect ProcessBuilder output to a file whose pathlen is > 255.
+        Path tmpDir = Paths.get(System.getProperty("java.io.tmpdir"));
+        File dir2 = null;
+        File longFileName = null;
+
+        try {
+            dir2 = Files.createTempDirectory(tmpDir, "RedirectWithLongFilename").toFile();
+            dir2.mkdirs();
+            longFileName = new File(dir2,
+                "012345678901234567890123456789012345678901234567890123456789" +
+                "012345678901234567890123456789012345678901234567890123456789" +
+                "012345678901234567890123456789012345678901234567890123456789" +
+                "012345678901234567890123456789012345678901234567890123456789" +
+                "0123456789");
+
+            ProcessBuilder pb = new ProcessBuilder("hostname.exe");
+            pb.redirectOutput(Redirect.appendTo(longFileName));
+            Process p = pb.start();
+            p.waitFor();
+
+            if (longFileName.exists()) {
+                System.out.println("OK");
+            } else {
+                throw new RuntimeException("Test failed.");
+            }
+
+        } finally {
+            longFileName.delete();
+            dir2.delete();
+        }
+
+    }
+
+}
--- a/jdk/test/java/lang/instrument/IsModifiableClassAgent.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/java/lang/instrument/IsModifiableClassAgent.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -23,7 +23,6 @@
 
 /**
  * @test
- * @ignore JDK-8068162
  * @bug 6331574
  * @summary test isModifiableClass
  * @author Robert Field, Sun Microsystems
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/invoke/lambda/LambdaStackTrace.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,204 @@
+/*
+ * 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.
+ *
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8025636
+ * @summary Synthetic frames should be hidden in exceptions
+ * @compile -XDignore.symbol.file LUtils.java LambdaStackTrace.java
+ * @run main LambdaStackTrace
+ */
+
+import jdk.internal.org.objectweb.asm.ClassWriter;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+
+import static jdk.internal.org.objectweb.asm.Opcodes.ACC_ABSTRACT;
+import static jdk.internal.org.objectweb.asm.Opcodes.ACC_INTERFACE;
+import static jdk.internal.org.objectweb.asm.Opcodes.ACC_PUBLIC;
+import static jdk.internal.org.objectweb.asm.Opcodes.V1_7;
+
+public class LambdaStackTrace {
+
+    static File classes = new File(System.getProperty("test.classes"));
+
+    public static void main(String[] args) throws Exception {
+        testBasic();
+        testBridgeMethods();
+    }
+
+    /**
+     * Test the simple case
+     */
+    private static void testBasic() throws Exception {
+        try {
+            Runnable r = () -> {
+                throw new RuntimeException();
+            };
+            r.run();
+        } catch (Exception ex) {
+            // Before 8025636 the stacktrace would look like:
+            //  at LambdaStackTrace.lambda$main$0(LambdaStackTrace.java:37)
+            //  at LambdaStackTrace$$Lambda$1/1937396743.run(<Unknown>:1000000)
+            //  at LambdaStackTrace.testBasic(LambdaStackTrace.java:40)
+            //  at ...
+            //
+            // We are verifying that the middle frame above is gone.
+
+            verifyFrames(ex.getStackTrace(),
+                    "LambdaStackTrace\\..*",
+                    "LambdaStackTrace.testBasic");
+        }
+    }
+
+    /**
+     * Test the more complicated case with bridge methods.
+     *
+     * We set up the following interfaces:
+     *
+     * interface Maker {
+     *   Object make();
+     * }
+     * interface StringMaker extends Maker {
+     *   String make();
+     * }
+     *
+     * And we will use them like so:
+     *
+     * StringMaker sm = () -> { throw new RuntimeException(); };
+     * sm.make();
+     * ((Maker)m).make();
+     *
+     * The first call is a "normal" interface call, the second will use a
+     * bridge method. In both cases the generated lambda frame should
+     * be removed from the stack trace.
+     */
+    private static void testBridgeMethods() throws Exception {
+        // setup
+        generateInterfaces();
+        compileCaller();
+
+        // test
+        StackTraceElement[] frames = call("Caller", "callStringMaker");
+        verifyFrames(frames,
+                "Caller\\..*",
+                "Caller.callStringMaker");
+
+        frames = call("Caller", "callMaker");
+        verifyFrames(frames,
+                "Caller\\..*",
+                "Caller.callMaker");
+    }
+
+    private static void generateInterfaces() throws IOException {
+        // We can't let javac compile these interfaces because in > 1.8 it will insert
+        // bridge methods into the interfaces - we want code that looks like <= 1.7,
+        // so we generate it.
+        try (FileOutputStream fw = new FileOutputStream(new File(classes, "Maker.class"))) {
+            fw.write(generateMaker());
+        }
+        try (FileOutputStream fw = new FileOutputStream(new File(classes, "StringMaker.class"))) {
+            fw.write(generateStringMaker());
+        }
+    }
+
+    private static byte[] generateMaker() {
+        // interface Maker {
+        //   Object make();
+        // }
+        ClassWriter cw = new ClassWriter(0);
+        cw.visit(V1_7, ACC_INTERFACE | ACC_ABSTRACT, "Maker", null, "java/lang/Object", null);
+        cw.visitMethod(ACC_PUBLIC | ACC_ABSTRACT, "make",
+                "()Ljava/lang/Object;", null, null);
+        cw.visitEnd();
+        return cw.toByteArray();
+    }
+
+    private static byte[] generateStringMaker() {
+        // interface StringMaker extends Maker {
+        //   String make();
+        // }
+        ClassWriter cw = new ClassWriter(0);
+        cw.visit(V1_7, ACC_INTERFACE | ACC_ABSTRACT, "StringMaker", null, "java/lang/Object", new String[]{"Maker"});
+        cw.visitMethod(ACC_PUBLIC | ACC_ABSTRACT, "make",
+                "()Ljava/lang/String;", null, null);
+        cw.visitEnd();
+        return cw.toByteArray();
+    }
+
+
+    static void emitCode(File f) {
+        ArrayList<String> scratch = new ArrayList<>();
+        scratch.add("public class Caller {");
+        scratch.add("    public static void callStringMaker() {");
+        scratch.add("        StringMaker sm = () -> { throw new RuntimeException(); };");
+        scratch.add("        sm.make();");
+        scratch.add("    }");
+        scratch.add("    public static void callMaker() {");
+        scratch.add("        StringMaker sm = () -> { throw new RuntimeException(); };");
+        scratch.add("        ((Maker) sm).make();");  // <-- This will call the bridge method
+        scratch.add("    }");
+        scratch.add("}");
+        LUtils.createFile(f, scratch);
+    }
+
+    static void compileCaller() {
+        File caller = new File(classes, "Caller.java");
+        emitCode(caller);
+        LUtils.compile("-cp", classes.getAbsolutePath(), "-d", classes.getAbsolutePath(), caller.getAbsolutePath());
+    }
+
+    private static void verifyFrames(StackTraceElement[] stack, String... patterns) throws Exception {
+        for (int i = 0; i < patterns.length; i++) {
+            String cm = stack[i].getClassName() + "." + stack[i].getMethodName();
+            if (!cm.matches(patterns[i])) {
+                System.err.println("Actual trace did not match expected trace at frame " + i);
+                System.err.println("Expected frame patterns:");
+                for (int j = 0; j < patterns.length; j++) {
+                    System.err.println("  " + j + ": " + patterns[j]);
+                }
+                System.err.println("Actual frames:");
+                for (int j = 0; j < patterns.length; j++) {
+                    System.err.println("  " + j + ": " + stack[j]);
+                }
+                throw new Exception("Incorrect stack frames found");
+            }
+        }
+    }
+
+    private static StackTraceElement[] call(String clazz, String method) throws Exception {
+        Class<?> c = Class.forName(clazz);
+        try {
+            Method m = c.getDeclaredMethod(method);
+            m.invoke(null);
+        } catch(InvocationTargetException ex) {
+            return ex.getTargetException().getStackTrace();
+        }
+        throw new Exception("Expected exception to be thrown");
+    }
+}
--- a/jdk/test/java/lang/management/MemoryMXBean/LowMemoryTest.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/java/lang/management/MemoryMXBean/LowMemoryTest.java	Mon Feb 23 05:01:11 2015 -0800
@@ -32,8 +32,7 @@
  *
  * @library /lib/testlibrary/
  * @build jdk.testlibrary.* LowMemoryTest MemoryUtil RunUtil
- * @requires vm.opt.ExplicitGCInvokesConcurrent == "false" | vm.opt.ExplicitGCInvokesConcurrent == "null"
- * @run main/timeout=600 LowMemoryTest
+  * @run main/timeout=600 LowMemoryTest
  * @requires vm.opt.ExplicitGCInvokesConcurrent != "true"
  * @requires vm.opt.ExplicitGCInvokesConcurrentAndUnloadsClasses != "true"
  * @requires vm.opt.DisableExplicitGC != "true"
@@ -116,14 +115,13 @@
             triggers++;
         }
         public void checkResult() throws Exception {
-            if ((!isRelaxed && triggers != NUM_TRIGGERS) ||
-                (isRelaxed && triggers < NUM_TRIGGERS)) {
+            if (!checkValue(triggers, NUM_TRIGGERS)) {
                 throw new RuntimeException("Unexpected number of triggers = " +
                     triggers + " but expected to be " + NUM_TRIGGERS);
             }
 
             for (int i = 0; i < triggers; i++) {
-                if (count[i] != i+1) {
+                if (!checkValue(count[i], i + 1)) {
                     throw new RuntimeException("Unexpected count of" +
                         " notification #" + i +
                         " count = " + count[i] +
@@ -136,6 +134,18 @@
                 }
             }
         }
+
+        private boolean checkValue(int value, int target) {
+            return checkValue((long)value, target);
+        }
+
+        private boolean checkValue(long value, int target) {
+            if (!isRelaxed) {
+                return value == target;
+            } else {
+                return value >= target;
+            }
+        }
     }
 
     private static long newThreshold;
--- a/jdk/test/java/lang/management/MemoryMXBean/Pending.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/java/lang/management/MemoryMXBean/Pending.java	Mon Feb 23 05:01:11 2015 -0800
@@ -39,7 +39,7 @@
 
 public class Pending {
     final static int NO_REF_COUNT = 600;
-    final static int REF_COUNT = 600;
+    final static int REF_COUNT = 500;
     final static int TOTAL_FINALIZABLE = (NO_REF_COUNT + REF_COUNT);
     private static int finalized = 0;
     private static MemoryMXBean mbean
@@ -83,31 +83,22 @@
         // Clean the memory and remove all objects that are pending
         // finalization
         System.gc();
-        Runtime.getRuntime().runFinalization();
-
-        // Let the finalizer to finish
-        try {
-            Thread.sleep(200);
-        } catch (Exception e) {
-            throw e;
-        }
-
-        // Create a number of new objects but no references to them
-        int startCount = mbean.getObjectPendingFinalizationCount();
+        Snapshot snapshot = getSnapshotAfterFinalization();
 
         System.out.println("Number of objects pending for finalization:");
-        System.out.println("   Before creating object: " + startCount +
-            " finalized = " + finalized);
+        System.out.println("   Before creating object: " + snapshot);
         printFinalizerInstanceCount();
 
+        // Create objects without saving reference. Should be removed at next GC.
         for (int i = 0; i < NO_REF_COUNT; i++) {
             new MyObject();
         }
 
-        Snapshot snapshot = getSnapshot();
+        snapshot = getSnapshot();
         System.out.println("   Afer creating objects with no ref: " + snapshot);
         printFinalizerInstanceCount();
 
+        // Create objects and save references.
         objs = new Object[REF_COUNT];
         for (int i = 0; i < REF_COUNT; i++) {
             objs[i] = new MyObject();
@@ -139,9 +130,8 @@
                                      + TOTAL_FINALIZABLE);
         }
 
-        if (startCount != 0 || snapshot.curPending != 0) {
+        if (snapshot.curPending != 0) {
             throw new RuntimeException("Wrong number of objects pending "
-                                     + "finalization start = " + startCount
                                      + " end = " + snapshot);
         }
 
@@ -161,29 +151,8 @@
              snapshot.curFinalized != expectedTotal && i <= MAX_GC_LOOP;
              i++) {
             System.gc();
-
-            // Pause to give a chance to Finalizer thread to run
-            pause();
+            snapshot = getSnapshotAfterFinalization();
 
-            printFinalizerInstanceCount();
-            // Race condition may occur; attempt to check this
-            // a few times before throwing exception.
-            for (int j = 0; j < 5; j++) {
-                // poll for another current pending count
-                snapshot = getSnapshot();
-                if (snapshot.curFinalized == expectedTotal ||
-                    snapshot.curPending != 0) {
-                    break;
-                }
-            }
-            System.out.println("   After GC " + i + ": " + snapshot);
-
-            Runtime.getRuntime().runFinalization();
-
-            // Pause to give a chance to Finalizer thread to run
-            pause();
-
-            snapshot = getSnapshot();
             if (snapshot.curFinalized == expectedTotal &&
                 snapshot.curPending != 0) {
                 throw new RuntimeException(
@@ -237,17 +206,21 @@
         }
     }
 
-    private static Object pauseObj = new Object();
-    private static void pause() {
-        // Enter lock a without blocking
-        synchronized (pauseObj) {
-            try {
-                // may need to tune this timeout for different platforms
-                pauseObj.wait(20);
-            } catch (Exception e) {
-                System.err.println("Unexpected exception.");
-                e.printStackTrace(System.err);
+    // Repeat getSnapshot until no pending finalization.
+    private static Snapshot getSnapshotAfterFinalization() throws Exception {
+        int loopCount = 0;
+        Snapshot snapshot = null;
+        while (loopCount < 100) {
+            Runtime.getRuntime().runFinalization();
+            Thread.sleep(50);
+            snapshot = getSnapshot();
+            if (snapshot.curPending == 0) {
+                return snapshot;
             }
+            ++loopCount;
+            System.out.println("Waiting for curPending to be 0. snapshot=" + snapshot);
         }
+        String msg = "Objects pending finalization is not 0. snapshot=%s";
+        throw new RuntimeException(String.format(msg, snapshot));
     }
 }
--- a/jdk/test/java/lang/management/ThreadMXBean/SynchronizationStatistics.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/java/lang/management/ThreadMXBean/SynchronizationStatistics.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -75,7 +75,7 @@
     }
 
     private static void waitForThreadState(Thread t, Thread.State state) throws InterruptedException {
-        while (!t.isInterrupted() && t.getState() != state) {
+        while (t.getState() != state) {
             Thread.sleep(3);
         }
     }
@@ -109,7 +109,9 @@
         synchronized(lock1) {
             p.arriveAndAwaitAdvance(); // phase[1]
             waitForThreadState(lt, Thread.State.BLOCKED);
-            lockName = mbean.getThreadInfo(tid).getLockName();
+            do {
+                lockName = mbean.getThreadInfo(tid).getLockName();
+            } while (lockName == null);
         }
 
         p.arriveAndAwaitAdvance(); // phase[2]
@@ -159,7 +161,9 @@
         synchronized(lock1) {
             p.arriveAndAwaitAdvance(); // phase[1]
             waitForThreadState(lt, Thread.State.BLOCKED);
-            lockName = mbean.getThreadInfo(tid).getLockName();
+            do {
+                lockName = mbean.getThreadInfo(tid).getLockName();
+            } while (lockName == null);
         }
         p.arriveAndAwaitAdvance(); // phase[2]
 
@@ -168,7 +172,9 @@
         synchronized(lock2) {
             p.arriveAndAwaitAdvance(); // phase [3]
             waitForThreadState(lt, Thread.State.BLOCKED);
-            lockName = mbean.getThreadInfo(tid).getLockName();
+            do {
+                lockName = mbean.getThreadInfo(tid).getLockName();
+            } while (lockName == null);
         }
         p.arriveAndAwaitAdvance(); // phase [4]
         testBlocked(ti, () -> mbean.getThreadInfo(tid), lockName, lock2);
--- a/jdk/test/java/lang/reflect/Proxy/ClassRestrictions.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/java/lang/reflect/Proxy/ClassRestrictions.java	Mon Feb 23 05:01:11 2015 -0800
@@ -22,7 +22,7 @@
  */
 
 /* @test
- * @bug 4227192 8004928
+ * @bug 4227192 8004928 8072656
  * @summary This is a test of the restrictions on the parameters that may
  * be passed to the Proxy.getProxyClass method.
  * @author Peter Jones
@@ -31,9 +31,12 @@
  * @run main ClassRestrictions
  */
 
+import java.io.File;
 import java.lang.reflect.Modifier;
 import java.lang.reflect.Proxy;
 import java.net.URLClassLoader;
+import java.net.URL;
+import java.nio.file.Paths;
 
 public class ClassRestrictions {
 
@@ -105,8 +108,13 @@
              * All of the interfaces types must be visible by name though the
              * specified class loader.
              */
-            ClassLoader altLoader = new URLClassLoader(
-                ((URLClassLoader) loader).getURLs(), null);
+            String[] cpaths = System.getProperty("test.classes", ".")
+                                    .split(File.pathSeparator);
+            URL[] urls = new URL[cpaths.length];
+            for (int i=0; i < cpaths.length; i++) {
+                urls[i] = Paths.get(cpaths[i]).toUri().toURL();
+            }
+            ClassLoader altLoader = new URLClassLoader(urls, null);
             Class altBarClass;
             altBarClass = Class.forName(Bar.class.getName(), false, altLoader);
             try {
--- a/jdk/test/java/math/BigDecimal/DivideTests.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/java/math/BigDecimal/DivideTests.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 4851776 4907265 6177836 6876282
+ * @bug 4851776 4907265 6177836 6876282 8066842
  * @summary Some tests for the divide methods.
  * @author Joseph D. Darcy
  */
@@ -358,6 +358,57 @@
         return failures;
     }
 
+    private static int divideByOneTests() {
+        int failures = 0;
+
+        //problematic divisor: one with scale 17
+        BigDecimal one = BigDecimal.ONE.setScale(17);
+        RoundingMode rounding = RoundingMode.UNNECESSARY;
+
+        long[][] unscaledAndScale = new long[][] {
+            { Long.MAX_VALUE,  17},
+            {-Long.MAX_VALUE,  17},
+            { Long.MAX_VALUE,   0},
+            {-Long.MAX_VALUE,   0},
+            { Long.MAX_VALUE, 100},
+            {-Long.MAX_VALUE, 100}
+        };
+
+        for (long[] uas : unscaledAndScale) {
+            long unscaled = uas[0];
+            int scale = (int)uas[1];
+
+            BigDecimal noRound = null;
+            try {
+                noRound = BigDecimal.valueOf(unscaled, scale).
+                    divide(one, RoundingMode.UNNECESSARY);
+            } catch (ArithmeticException e) {
+                failures++;
+                System.err.println("ArithmeticException for value " + unscaled
+                    + " and scale " + scale + " without rounding");
+            }
+
+            BigDecimal roundDown = null;
+            try {
+                roundDown = BigDecimal.valueOf(unscaled, scale).
+                        divide(one, RoundingMode.DOWN);
+            } catch (ArithmeticException e) {
+                failures++;
+                System.err.println("ArithmeticException for value " + unscaled
+                    + " and scale " + scale + " with rounding down");
+            }
+
+            if (noRound != null && roundDown != null
+                && noRound.compareTo(roundDown) != 0) {
+                failures++;
+                System.err.println("Equality failure for value " + unscaled
+                        + " and scale " + scale);
+            }
+        }
+
+        return failures;
+    }
+
     public static void main(String argv[]) {
         int failures = 0;
 
@@ -366,10 +417,11 @@
         failures += properScaleTests();
         failures += trailingZeroTests();
         failures += scaledRoundedDivideTests();
+        failures += divideByOneTests();
 
         if (failures > 0) {
             throw new RuntimeException("Incurred " + failures +
-                                       " failures while testing exact divide.");
+                                       " failures while testing division.");
         }
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/nio/channels/FileLock/FileLockConstructor.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,169 @@
+/*
+ * 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.
+ *
+ * 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.
+ */
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.channels.AsynchronousFileChannel;
+import java.nio.channels.FileChannel;
+import java.nio.channels.FileLock;
+import java.nio.file.StandardOpenOption;
+
+/*
+ * @test
+ * @bug 6880737
+ * @summary Test FileLock constructor parameter validation.
+ */
+public class FileLockConstructor {
+    public static void main(String[] args) throws IOException {
+        FileLock fileLock = null;
+        int failures = 0;
+
+        // null FileChannel
+        boolean exceptionThrown = false;
+        try {
+            fileLock = new FileLockSub((FileChannel)null, 0, 0, false);
+        } catch (NullPointerException npe) {
+            exceptionThrown = true;
+        }
+        if (!exceptionThrown) {
+            System.err.println("FileLock constructor did not throw NPE for null FileChannel");
+            failures++;
+        }
+
+        // null AsynchronousFileChannel
+        exceptionThrown = false;
+        try {
+            fileLock = new FileLockSub((AsynchronousFileChannel)null, 0, 0, true);
+        } catch (NullPointerException npe) {
+            exceptionThrown = true;
+        }
+        if (!exceptionThrown) {
+            System.err.println("FileLock constructor did not throw NPE for null AsynchronousFileChannel");
+            failures++;
+        }
+
+        // create temporary file
+        File tmpFile = File.createTempFile("FileLock", "tmp");
+        tmpFile.deleteOnExit();
+
+        // position and size preconditions
+        long[][] posAndSize = new long[][] {
+            {0, 42},            // valid
+            {-1, 42},           // invalid: position < 0
+            {0, -1},            // invalid: size < 0
+            {Long.MAX_VALUE, 1} // invalid: position + size < 0
+        };
+
+        // test position and size preconditions for FileChannel case
+        try (FileChannel syncChannel = FileChannel.open(tmpFile.toPath(),
+                StandardOpenOption.READ, StandardOpenOption.WRITE)) {
+
+            for (int i = 0; i < posAndSize.length; i++) {
+                boolean preconditionsHold = i == 0;
+                exceptionThrown = false;
+                try {
+                    fileLock = new FileLockSub(syncChannel, posAndSize[i][0],
+                            posAndSize[i][1], true);
+                } catch (IllegalArgumentException iae) {
+                    exceptionThrown = true;
+                } catch (Exception e) {
+                    System.err.println("Unexpected exception \"" + e + "\" caught"
+                            + " for position " + posAndSize[i][0] + " and size "
+                            + posAndSize[i][1] + " for FileChannel variant");
+                    failures++;
+                    continue;
+                }
+                if (preconditionsHold && exceptionThrown) {
+                    System.err.println("FileLock constructor incorrectly threw IAE"
+                            + " for position " + posAndSize[i][0] + " and size "
+                            + posAndSize[i][1] + " for FileChannel variant");
+                    failures++;
+                } else if (!preconditionsHold && !exceptionThrown) {
+                    System.err.println("FileLock constructor did not throw IAE"
+                            + " for position " + posAndSize[i][0] + " and size "
+                            + posAndSize[i][1] + " for FileChannel variant");
+                    failures++;
+                }
+            }
+        }
+
+        // test position and size preconditions for AsynchronousFileChannel case
+        try (AsynchronousFileChannel asyncChannel
+                = AsynchronousFileChannel.open(tmpFile.toPath(),
+                        StandardOpenOption.READ, StandardOpenOption.WRITE)) {
+            for (int i = 0; i < posAndSize.length; i++) {
+                boolean preconditionsHold = i == 0;
+                exceptionThrown = false;
+                try {
+                    fileLock = new FileLockSub(asyncChannel, posAndSize[i][0],
+                            posAndSize[i][1], true);
+                } catch (IllegalArgumentException iae) {
+                    exceptionThrown = true;
+                } catch (Exception e) {
+                    System.err.println("Unexpected exception \"" + e + "\" caught"
+                            + " for position " + posAndSize[i][0] + " and size "
+                            + posAndSize[i][1] + " for AsynchronousFileChannel variant");
+                    failures++;
+                    continue;
+                }
+                if (preconditionsHold && exceptionThrown) {
+                    System.err.println("FileLock constructor incorrectly threw IAE"
+                            + " for position " + posAndSize[i][0] + " and size "
+                            + posAndSize[i][1] + " for AsynchronousFileChannel variant");
+                    failures++;
+                } else if (!preconditionsHold && !exceptionThrown) {
+                    System.err.println("FileLock constructor did not throw IAE"
+                            + " for position " + posAndSize[i][0] + " and size "
+                            + posAndSize[i][1] + " for AsynchronousFileChannel variant");
+                    failures++;
+                }
+            }
+        }
+
+        if (failures > 0) {
+            throw new RuntimeException("Incurred " + failures +
+                                       " failures while testing FileLock.");
+        }
+    }
+}
+
+class FileLockSub extends FileLock {
+    FileLockSub(FileChannel channel, long position, long size, boolean shared) {
+        super(channel, position, size, shared);
+    }
+
+    FileLockSub(AsynchronousFileChannel channel, long position, long size,
+                boolean shared) {
+        super(channel, position, size, shared);
+    }
+
+    @Override
+    public boolean isValid() {
+        return false;
+    }
+
+    @Override
+    public void release() throws IOException {
+        // do nothing
+    }
+}
--- a/jdk/test/java/nio/charset/Charset/NIOCharsetAvailabilityTest.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/java/nio/charset/Charset/NIOCharsetAvailabilityTest.java	Mon Feb 23 05:01:11 2015 -0800
@@ -65,11 +65,17 @@
         charsets.remove(Class.forName("sun.nio.cs.ext.ISO2022"));
         charsets.remove(Class.forName("sun.nio.cs.ext.ISO2022_CN_GB"));
         charsets.remove(Class.forName("sun.nio.cs.ext.ISO2022_CN_CNS"));
-        charsets.remove(Class.forName("sun.nio.cs.ext.JIS_X_0208_Solaris"));
         charsets.remove(Class.forName("sun.nio.cs.ext.JIS_X_0208_MS932"));
         charsets.remove(Class.forName("sun.nio.cs.ext.JIS_X_0212_MS5022X"));
-        charsets.remove(Class.forName("sun.nio.cs.ext.JIS_X_0212_Solaris"));
         charsets.remove(Class.forName("sun.nio.cs.ext.JIS_X_0208_MS5022X"));
+        try {
+            charsets.remove(Class.forName("sun.nio.cs.ext.JIS_X_0208_Solaris"));
+            charsets.remove(Class.forName("sun.nio.cs.ext.JIS_X_0212_Solaris"));
+        } catch (ClassNotFoundException x) {
+            // these two might be moved into stdcs
+            charsets.remove(Class.forName("sun.nio.cs.JIS_X_0208_Solaris"));
+            charsets.remove(Class.forName("sun.nio.cs.JIS_X_0212_Solaris"));
+        }
 
         // report the charsets that are implemented but not available
         iter = charsets.iterator();
--- a/jdk/test/java/nio/file/Path/PathOps.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/java/nio/file/Path/PathOps.java	Mon Feb 23 05:01:11 2015 -0800
@@ -22,7 +22,7 @@
  */
 
 /* @test
- * @bug 4313887 6838333 6925932 7006126 8037945
+ * @bug 4313887 6838333 6925932 7006126 8037945 8072495
  * @summary Unit test for java.nio.file.Path path operations
  */
 
@@ -516,7 +516,9 @@
             .relativize("\\\\server\\share\\bar", "..\\bar")
             .relativize("\\\\server\\share\\foo", "");
         test("")
-            .relativize("", "");
+            .relativize("", "")
+            .relativize("a", "a")
+            .relativize("a\\b\\c", "a\\b\\c");
 
         // normalize
         test("C:\\")
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/security/ProtectionDomain/PreserveCombinerTest.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,67 @@
+/*
+ * 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.
+ *
+ * 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.
+ */
+
+import java.security.AccessControlContext;
+import java.security.AccessController;
+import java.security.DomainCombiner;
+import java.security.PrivilegedAction;
+import java.security.ProtectionDomain;
+import sun.misc.SharedSecrets;
+
+/*
+ * @test
+ * @bug 8064331
+ * @summary Make sure that JavaSecurityAccess.doIntersectionPrivilege()
+ *          is not dropping the information about the domain combiner of
+ *          the stack ACC
+ */
+
+public class PreserveCombinerTest {
+    public static void main(String[]args) throws Exception {
+        final DomainCombiner dc = new DomainCombiner() {
+            @Override
+            public ProtectionDomain[] combine(ProtectionDomain[] currentDomains, ProtectionDomain[] assignedDomains) {
+                return currentDomains; // basically a no-op
+            }
+        };
+
+        // Get an instance of the saved ACC
+        AccessControlContext saved = AccessController.getContext();
+        // Simulate the stack ACC with a DomainCombiner attached
+        AccessControlContext stack = new AccessControlContext(AccessController.getContext(), dc);
+
+        // Now try to run JavaSecurityAccess.doIntersectionPrivilege() and assert
+        // whether the DomainCombiner from the stack ACC is preserved
+        boolean ret = SharedSecrets.getJavaSecurityAccess().doIntersectionPrivilege(new PrivilegedAction<Boolean>() {
+            @Override
+            public Boolean run() {
+                return dc == AccessController.getContext().getDomainCombiner();
+            }
+        }, stack, saved);
+
+        if (!ret) {
+            System.exit(1);
+        }
+    }
+}
+
--- a/jdk/test/java/time/tck/java/time/TCKLocalDateTime.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/java/time/tck/java/time/TCKLocalDateTime.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -292,7 +292,8 @@
             expected = LocalDateTime.now(Clock.system(zone));
             test = LocalDateTime.now(zone);
         }
-        assertEquals(test, expected);
+        assertEquals(test.truncatedTo(ChronoUnit.SECONDS),
+                     expected.truncatedTo(ChronoUnit.SECONDS));
     }
 
     //-----------------------------------------------------------------------
--- a/jdk/test/java/time/tck/java/time/TCKLocalTime.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/java/time/tck/java/time/TCKLocalTime.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -246,7 +246,8 @@
             expected = LocalTime.now(Clock.system(zone));
             test = LocalTime.now(zone);
         }
-        assertEquals(test, expected);
+        assertEquals(test.truncatedTo(ChronoUnit.SECONDS),
+                     expected.truncatedTo(ChronoUnit.SECONDS));
     }
 
     //-----------------------------------------------------------------------
--- a/jdk/test/java/time/tck/java/time/TCKZonedDateTime.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/java/time/tck/java/time/TCKZonedDateTime.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -260,7 +260,8 @@
             expected = ZonedDateTime.now(Clock.system(zone));
             test = ZonedDateTime.now(zone);
         }
-        assertEquals(test, expected);
+        assertEquals(test.truncatedTo(ChronoUnit.SECONDS),
+                     expected.truncatedTo(ChronoUnit.SECONDS));
     }
 
     //-----------------------------------------------------------------------
--- a/jdk/test/java/time/tck/java/time/chrono/TCKJapaneseEra.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/java/time/tck/java/time/chrono/TCKJapaneseEra.java	Mon Feb 23 05:01:11 2015 -0800
@@ -59,6 +59,7 @@
 import static java.time.temporal.ChronoField.ERA;
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertTrue;
+import static org.testng.Assert.fail;
 
 import java.time.chrono.Era;
 import java.time.chrono.JapaneseChronology;
@@ -69,7 +70,8 @@
 import org.testng.annotations.Test;
 
 /**
- * Test.
+ * Tests for JapaneseEra
+ * @bug 8068278
  */
 @Test
 public class TCKJapaneseEra {
@@ -84,6 +86,20 @@
         };
     }
 
+    @DataProvider(name = "InvalidJapaneseEras")
+    Object[][] data_of_invalid_eras() {
+        return new Object[][] {
+                {-2},
+                {-3},
+                {3},
+                {Integer.MIN_VALUE},
+                {Integer.MAX_VALUE},
+        };
+    }
+
+    //-----------------------------------------------------------------------
+    // JapaneseEra value test
+    //-----------------------------------------------------------------------
     @Test(dataProvider="JapaneseEras")
     public void test_valueOf(JapaneseEra era , String eraName, int eraValue) {
         assertEquals(era.getValue(), eraValue);
@@ -118,4 +134,11 @@
         }
     }
 
+    //-----------------------------------------------------------------------
+    // JapaneseChronology.INSTANCE.eraOf invalid era test
+    //-----------------------------------------------------------------------
+    @Test(dataProvider="InvalidJapaneseEras", expectedExceptions=java.time.DateTimeException.class)
+    public void test_outofrange(int era) {
+        JapaneseChronology.INSTANCE.eraOf(era);
+    }
 }
--- a/jdk/test/java/time/test/java/time/TestClock_System.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/java/time/test/java/time/TestClock_System.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -62,7 +62,9 @@
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertSame;
 
+import java.lang.reflect.Field;
 import java.time.Clock;
+import java.time.Instant;
 import java.time.ZoneId;
 
 import org.testng.annotations.Test;
@@ -87,4 +89,298 @@
         assertEquals(test.toString(), "SystemClock[Europe/Paris]");
     }
 
+    //-----------------------------------------------------------------------
+
+    private static String formatTime(String prefix, Instant time) {
+        return prefix + ": " + time + " - seconds: "
+                        + time.getEpochSecond() + ", nanos: "
+                        + time.getNano();
+    }
+
+    public void test_ClockResolution() {
+        Clock highestUTC = Clock.systemUTC();
+
+        Instant start = Instant.ofEpochMilli(System.currentTimeMillis());
+
+        try {
+            // smoke test
+            Instant system1 = Instant.ofEpochMilli(System.currentTimeMillis());
+            Instant system2 = Instant.ofEpochMilli(System.currentTimeMillis());
+            Instant highest1 = highestUTC.instant();
+            Instant highest2 = highestUTC.instant();
+            System.out.println(formatTime("\nsystemUTC #1            ", system1));
+            System.out.println(formatTime("systemUTC #2            ", system2));
+            System.out.println(formatTime("highestResolutionUTC #1 ", highest1));
+            System.out.println(formatTime("highestResolutionUTC #2 ", highest2));
+
+            if (system2.isBefore(system1)) {
+                System.err.println("system2 is before system1!");
+                System.err.println(formatTime("\n\tsystem1", system1));
+                System.err.println(formatTime("\n\tsystem2", system2));
+                throw new RuntimeException("system2 is before system1!"
+                        + formatTime("\n\tsystem1", system1)
+                        + formatTime("\n\tsystem2", system2));
+            }
+            if (highest2.isBefore(highest1)) {
+                System.err.println("highest2 is before highest1!");
+                System.err.println(formatTime("\n\thighest1", system1));
+                System.err.println(formatTime("\n\tsystem2", highest2));
+                throw new RuntimeException("highest2 is before system1!"
+                        + formatTime("\n\thighest1", system1)
+                        + formatTime("\n\tsystem2", highest2));
+            }
+
+            // better test - but depends on implementation details.
+            // we're not rounding - so highest1 should be greater or equal to
+            // system1
+            system1 = Instant.ofEpochMilli(System.currentTimeMillis());
+            highest1 = highestUTC.instant();
+
+            System.out.println(formatTime("\nsystemUTC            ", system1));
+            System.out.println(formatTime("highestResolutionUTC ", highest1));
+
+            if (highest1.isBefore(system1)) {
+                System.err.println("highest1 is before system1!");
+                System.err.println(formatTime("\n\tsystem1", system1));
+                System.err.println(formatTime("\n\thighest1", highest1));
+                throw new RuntimeException("highest1 is before system1!"
+                        + formatTime("\n\tsystem1", system1)
+                        + formatTime("\n\thighest1", highest1));
+            }
+
+            int count=0;
+            // let's preheat the system a bit:
+            for (int i = 0; i < 1000 ; i++) {
+                system1 = Instant.ofEpochMilli(System.currentTimeMillis());
+                highest1 = highestUTC.instant();
+                final int sysnan = system1.getNano();
+                final int nanos = highest1.getNano();
+                if ((nanos % 1000000) > 0) {
+                    count++; // we have micro seconds
+                }
+                if ((sysnan % 1000000) > 0) {
+                    throw new RuntimeException("Expected only millisecconds "
+                            + "precision for systemUTC, found "
+                            + (sysnan % 1000000) + " remainder.");
+                }
+            }
+            System.out.println("\nNumber of time stamps which had better than"
+                    + " millisecond precision: "+count+"/"+1000);
+            System.out.println(formatTime("\nsystemUTC            ", system1));
+            System.out.println(formatTime("highestResolutionUTC ", highest1));
+            if (count == 0) {
+                System.err.println("Something is strange: no microsecond "
+                        + "precision with highestResolutionUTC?");
+                throw new RuntimeException("Micro second preccision not reached");
+            }
+
+            // check again
+            if (highest1.isBefore(system1)) {
+                System.err.println("highest1 is before system1!");
+                System.err.println(formatTime("\n\tsystem1", system1));
+                System.err.println(formatTime("\n\thighest1", highest1));
+                throw new RuntimeException("highest1 is before system1!"
+                        + formatTime("\n\tsystem1", system1)
+                        + formatTime("\n\thighest1", highest1));
+            }
+
+            // leap of faith: ensure that highest1 is from within 10 secs of
+            //   system1
+            if (highest1.toEpochMilli() != system1.toEpochMilli()) {
+                long delta = highest1.getEpochSecond() - system1.getEpochSecond();
+                if (delta > 10) {
+                    throw new RuntimeException("Unexpected long delay between two clocks ("
+                            + delta + " seconds)"
+                            + formatTime("\n\t system1", system1)
+                            + formatTime("\n\t highest1", highest1));
+
+                }
+            } else {
+                System.out.println("You won the lottery: the two dates are within 1 millisecond!\n");
+            }
+
+        } finally {
+            Instant stop = Instant.ofEpochMilli(System.currentTimeMillis());
+            if (start.isAfter(stop)) {
+                // This should not happen - but can (un)probably be observed
+                // when switching to summer time, or if another application
+                // is switching the system date...
+                System.err.println("Cannot test - date was setback: "
+                        + formatTime("\n\tstarted at", start)
+                        + formatTime("\n\tstopped at", stop) + "\n");
+                return; // will prevent exceptions from being propagated.
+            }
+        }
+    }
+
+    static final long MAX_OFFSET = 0x0100000000L;
+    static final long MIN_OFFSET = -MAX_OFFSET;
+
+    // A helper class to test that SystemClock correctly recomputes
+    // its offset.
+    static class SystemClockOffset {
+
+        static final int MILLIS_IN_SECOND = 1000;
+        static final int NANOS_IN_MILLI = 1000_000;
+        static final int NANOS_IN_MICRO = 1000;
+        static final int NANOS_IN_SECOND = 1000_000_000;
+
+        static final boolean verbose = true;
+        static final Clock systemUTC = Clock.systemUTC();
+        static final Field offsetField;
+
+        static {
+            try {
+                offsetField = Class.forName("java.time.Clock$SystemClock").getDeclaredField("offset");
+                offsetField.setAccessible(true);
+            } catch (ClassNotFoundException | NoSuchFieldException ex) {
+                throw new ExceptionInInitializerError(ex);
+            }
+        }
+
+        static enum Answer {
+
+            YES, // isOffLimit = YES:   we must get -1
+            NO, // isOffLimit = NO:    we must not not get -1
+            MAYBE  // isOffLimit = MAYBE: we might get -1 or a valid adjustment.
+        };
+
+        static long distance(long one, long two) {
+            return one > two ? Math.subtractExact(one, two)
+                    : Math.subtractExact(two, one);
+        }
+
+        static Answer isOffLimits(long before, long after, long offset) {
+            long relativeDistanceBefore = distance(before, offset);
+            long relativeDistanceAfter = distance(after, offset);
+            if (relativeDistanceBefore >= MAX_OFFSET && relativeDistanceAfter >= MAX_OFFSET) {
+                return Answer.YES;
+            }
+            if (relativeDistanceBefore < MAX_OFFSET && relativeDistanceAfter < MAX_OFFSET) {
+                if (relativeDistanceBefore == 0 || relativeDistanceAfter == 0) {
+                    return Answer.MAYBE; // unlucky case where
+                }
+                return Answer.NO;
+            }
+            return Answer.MAYBE;
+        }
+
+        static void testWithOffset(String name, long offset)
+                throws IllegalAccessException {
+            testWithOffset(name, offset, systemUTC);
+        }
+
+        static void testWithOffset(String name, long offset, Clock clock)
+                throws IllegalAccessException {
+            offsetField.set(clock, offset);
+            long beforeMillis = System.currentTimeMillis();
+            final Instant instant = clock.instant();
+            long afterMillis = System.currentTimeMillis();
+            long actualOffset = offsetField.getLong(clock);
+            long instantMillis = instant.getEpochSecond() * MILLIS_IN_SECOND
+                    + instant.getNano() / NANOS_IN_MILLI;
+            if (instantMillis < beforeMillis || instantMillis > afterMillis) {
+                throw new RuntimeException(name
+                        + ": Invalid instant: " + instant
+                        + " (~" + instantMillis + "ms)"
+                        + " when time in millis is in ["
+                        + beforeMillis + ", " + afterMillis
+                        + "] and offset in seconds is " + offset);
+            }
+            Answer isOffLimits = isOffLimits(beforeMillis / MILLIS_IN_SECOND,
+                    afterMillis / MILLIS_IN_SECOND, offset);
+            switch (isOffLimits) {
+                case YES:
+                    if (actualOffset == offset) {
+                        throw new RuntimeException(name
+                                + ": offset was offlimit but was not recomputed "
+                                + " when time in millis is in ["
+                                + beforeMillis + ", " + afterMillis
+                                + "] and offset in seconds was " + offset);
+                    }
+                    break;
+                case NO:
+                    if (actualOffset != offset) {
+                        throw new RuntimeException(name
+                                + ": offset was not offlimit but was recomputed.");
+                    }
+                    break;
+                default:
+                    break;
+            }
+            if (distance(actualOffset, instant.getEpochSecond()) >= MAX_OFFSET) {
+                throw new RuntimeException(name + ": Actual offset is too far off:"
+                        + " offset=" + actualOffset
+                        + "instant.seconds=" + instant.getEpochSecond());
+            }
+            long adjustment = (instant.getEpochSecond() - actualOffset) * NANOS_IN_SECOND
+                    + instant.getNano();
+            validateAdjustment(name, actualOffset, beforeMillis, afterMillis, adjustment);
+        }
+
+        static void validateAdjustment(String name, long offset, long beforeMillis,
+                long afterMillis, long adjustment) {
+            System.out.println("Validating adjustment: " + adjustment);
+            long expectedMax = distance(offset, beforeMillis / MILLIS_IN_SECOND)
+                    * NANOS_IN_SECOND
+                    + (beforeMillis % MILLIS_IN_SECOND) * NANOS_IN_MILLI
+                    + (afterMillis - beforeMillis + 1) * NANOS_IN_MILLI;
+            long absoluteAdjustment = distance(0, adjustment);
+            if (absoluteAdjustment > expectedMax) {
+                long adjSec = absoluteAdjustment / NANOS_IN_SECOND;
+                long adjMil = (absoluteAdjustment % NANOS_IN_SECOND) / NANOS_IN_MILLI;
+                long adjMic = (absoluteAdjustment % NANOS_IN_MILLI) / NANOS_IN_MICRO;
+                long adjNan = (absoluteAdjustment % NANOS_IN_MICRO);
+                long expSec = expectedMax / NANOS_IN_SECOND;
+                long expMil = (expectedMax % NANOS_IN_SECOND) / NANOS_IN_MILLI;
+                long expMic = (expectedMax % NANOS_IN_MILLI) / NANOS_IN_MICRO;
+                long expNan = (expectedMax % NANOS_IN_MICRO);
+                System.err.println("Excessive adjustment: " + adjSec + "s, "
+                        + adjMil + "ms, " + adjMic + "mics, " + adjNan + "ns");
+                System.err.println("Epected max: " + expSec + "s, "
+                        + expMil + "ms, " + expMic + "mics, " + expNan + "ns");
+
+                throw new RuntimeException(name
+                        + ": Excessive adjustment: " + adjustment
+                        + " when time in millis is in ["
+                        + beforeMillis + ", " + afterMillis
+                        + "] and offset in seconds is " + offset);
+            }
+        }
+    }
+
+    public void test_OffsetRegular() throws IllegalAccessException {
+        System.out.println("*** Testing regular cases ***");
+        SystemClockOffset.testWithOffset("System.currentTimeMillis()/1000",
+                System.currentTimeMillis()/1000);
+        SystemClockOffset.testWithOffset("System.currentTimeMillis()/1000 - 1024",
+                System.currentTimeMillis()/1000 - 1024);
+        SystemClockOffset.testWithOffset("System.currentTimeMillis()/1000 + 1024",
+                System.currentTimeMillis()/1000 + 1024);
+    }
+
+    public void test_OffsetLimits() throws IllegalAccessException {
+        System.out.println("*** Testing limits ***");
+        SystemClockOffset.testWithOffset("System.currentTimeMillis()/1000 - MAX_OFFSET + 1",
+                System.currentTimeMillis()/1000 - MAX_OFFSET + 1);
+        SystemClockOffset.testWithOffset("System.currentTimeMillis()/1000 + MAX_OFFSET - 1",
+                System.currentTimeMillis()/1000 + MAX_OFFSET - 1);
+        SystemClockOffset.testWithOffset("System.currentTimeMillis()/1000 - MAX_OFFSET",
+                System.currentTimeMillis()/1000 - MAX_OFFSET);
+        SystemClockOffset.testWithOffset("System.currentTimeMillis()/1000 + MAX_OFFSET",
+                System.currentTimeMillis()/1000 + MAX_OFFSET);
+        SystemClockOffset.testWithOffset("System.currentTimeMillis()/1000 - MAX_OFFSET - 1024",
+                System.currentTimeMillis()/1000 - MAX_OFFSET - 1024);
+        SystemClockOffset.testWithOffset("System.currentTimeMillis()/1000 + MAX_OFFSET + 1024",
+                System.currentTimeMillis()/1000 + MAX_OFFSET + 1024);
+        SystemClockOffset.testWithOffset("0", 0);
+        SystemClockOffset.testWithOffset("-1", -1);
+        SystemClockOffset.testWithOffset("Integer.MAX_VALUE + System.currentTimeMillis()/1000",
+                ((long)Integer.MAX_VALUE) + System.currentTimeMillis()/1000);
+        SystemClockOffset.testWithOffset("System.currentTimeMillis()/1000 - Integer.MIN_VALUE",
+                System.currentTimeMillis()/1000 - Integer.MIN_VALUE);
+        SystemClockOffset.testWithOffset("Long.MAX_VALUE", Long.MAX_VALUE);
+        SystemClockOffset.testWithOffset("System.currentTimeMillis()/1000 - Long.MIN_VALUE",
+                (Long.MIN_VALUE + System.currentTimeMillis()/1000)*-1);
+    }
 }
--- a/jdk/test/java/time/test/java/time/chrono/TestUmmAlQuraChronology.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/java/time/test/java/time/chrono/TestUmmAlQuraChronology.java	Mon Feb 23 05:01:11 2015 -0800
@@ -30,6 +30,7 @@
 import static java.time.temporal.ChronoField.MONTH_OF_YEAR;
 import static java.time.temporal.ChronoField.YEAR;
 import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
 import static org.testng.Assert.assertTrue;
 import static org.testng.Assert.fail;
 
@@ -71,6 +72,7 @@
 /**
  * Tests for the Umm alQura chronology and data.
  * Note: The dates used for testing are just a sample of calendar data.
+ * @bug 8067800
  */
 @Test
 public class TestUmmAlQuraChronology {
@@ -530,6 +532,24 @@
         assertEquals(date.isLeapYear(), leapyear);
     }
 
+    // Data provider to verify that a given hijrah year is outside the range of supported years
+    // The values are dependent on the currently configured UmmAlQura calendar data
+    @DataProvider(name="OutOfRangeLeapYears")
+    Object[][] data_invalid_leapyears() {
+        return new Object[][] {
+                {1299},
+                {1601},
+                {Integer.MAX_VALUE},
+                {Integer.MIN_VALUE},
+        };
+    }
+
+    @Test(dataProvider="OutOfRangeLeapYears")
+    public void test_notLeapYears(int y) {
+        assertFalse(HijrahChronology.INSTANCE.isLeapYear(y), "Out of range leap year");
+    }
+
+
     // Date samples to convert HijrahDate to LocalDate and vice versa
     @DataProvider(name="samples")
     Object[][] data_samples() {
--- a/jdk/test/java/time/test/java/util/TestFormatter.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/java/time/test/java/util/TestFormatter.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -38,6 +38,7 @@
 import java.time.temporal.ChronoField;
 import java.time.temporal.TemporalQueries;
 import java.time.temporal.TemporalAccessor;
+import java.time.temporal.UnsupportedTemporalTypeException;
 
 import java.util.*;
 
@@ -153,6 +154,44 @@
         if (verbose) {
             System.out.printf("%-24s  : %s%n", getClassName(dt), out);
         }
+
+        // expected usually comes from Calendar which only has milliseconds
+        // precision. So we're going to replace it's N:[nanos] stamp with
+        // the correct value for nanos.
+        if ((dt instanceof TemporalAccessor) && expected != null) {
+            try {
+                // Get millis & nanos from the dt
+                final TemporalAccessor ta = (TemporalAccessor) dt;
+                final int nanos = ta.get(ChronoField.NANO_OF_SECOND);
+                final int millis = ta.get(ChronoField.MILLI_OF_SECOND);
+                final String nanstr = String.valueOf(nanos);
+                final String mistr = String.valueOf(millis);
+
+                // Compute the value of the N:[nanos] field that we expect
+                // to find in 'out'
+                final StringBuilder sb = new StringBuilder();
+                sb.append("N:[");
+                for (int i=nanstr.length(); i<9; i++) {
+                    sb.append('0');
+                }
+                sb.append(nanos).append("]");
+
+                // Compute the truncated value of N:[nanos] field that might
+                // be in 'expected' when expected was built from Calendar.
+                final StringBuilder sbm = new StringBuilder();
+                sbm.append("N:[");
+                for (int i=mistr.length(); i<3; i++) {
+                    sbm.append('0');
+                }
+                sbm.append(mistr).append("000000]");
+
+                // if expected contains the truncated value, replace it with
+                // the complete value.
+                expected = expected.replace(sbm.toString(), sb.toString());
+            } catch (UnsupportedTemporalTypeException e) {
+                // nano seconds unsupported - nothing to do...
+            }
+        }
         if (expected != null && !out.equals(expected)) {
             System.out.printf("%-24s  actual: %s%n                FAILED; expected: %s%n",
                               getClassName(dt), out, expected);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/Arrays/TimSortStackSize2.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,177 @@
+/*
+ * 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.
+ *
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8072909
+ * @run main/othervm -Xmx385m TimSortStackSize2 67108864
+ * not for regular execution on all platforms:
+ * run main/othervm -Xmx8g TimSortStackSize2 1073741824
+ * run main/othervm -Xmx16g TimSortStackSize2 2147483644
+ * @summary Test TimSort stack size on big arrays
+ */
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Comparator;
+import java.util.List;
+
+public class TimSortStackSize2 {
+
+    public static void main(String[] args) {
+        int lengthOfTest = Integer.parseInt(args[0]);
+        boolean passed = true;
+        try {
+            Integer [] a = new TimSortStackSize2(lengthOfTest).createArray();
+            long begin = System.nanoTime();
+            Arrays.sort(a, new Comparator<Object>() {
+                    @SuppressWarnings("unchecked")
+                    public int compare(Object first, Object second) {
+                        return ((Comparable<Object>)first).compareTo(second);
+                    }
+                });
+            long end = System.nanoTime();
+            System.out.println("TimSort: " + (end - begin));
+            a = null;
+        } catch (ArrayIndexOutOfBoundsException e){
+            System.out.println("TimSort broken:");
+            e.printStackTrace();
+            passed = false;
+        }
+
+        try {
+            Integer [] a = new TimSortStackSize2(lengthOfTest).createArray();
+            long begin = System.nanoTime();
+            Arrays.sort(a);
+            long end = System.nanoTime();
+            System.out.println("ComparableTimSort: " + (end - begin));
+            a = null;
+        } catch (ArrayIndexOutOfBoundsException e){
+            System.out.println("ComparableTimSort broken:");
+            e.printStackTrace();
+            passed = false;
+        }
+        if ( !passed ){
+            throw new RuntimeException();
+        }
+    }
+
+    private static final int MIN_MERGE = 32;
+    private final int minRun;
+    private final int length;
+    private final List<Long> runs = new ArrayList<Long>();
+
+    public TimSortStackSize2(int len) {
+        this.length = len;
+        minRun = minRunLength(len);
+        fillRunsJDKWorstCase();
+    }
+
+    private static int minRunLength(int n) {
+        assert n >= 0;
+        int r = 0;      // Becomes 1 if any 1 bits are shifted off
+        while (n >= MIN_MERGE) {
+            r |= (n & 1);
+            n >>= 1;
+        }
+        return n + r;
+    }
+
+    /**
+     * Adds a sequence x_1, ..., x_n of run lengths to <code>runs</code> such that:<br>
+     * 1. X = x_1 + ... + x_n <br>
+     * 2. x_j >= minRun for all j <br>
+     * 3. x_1 + ... + x_{j-2}  <  x_j  <  x_1 + ... + x_{j-1} for all j <br>
+     * These conditions guarantee that TimSort merges all x_j's one by one
+     * (resulting in X) using only merges on the second-to-last element.
+     * @param X  The sum of the sequence that should be added to runs.
+     */
+    private void generateJDKWrongElem(long X) {
+        for(long newTotal; X >= 2*minRun+1; X = newTotal) {
+            //Default strategy
+            newTotal = X/2 + 1;
+            //Specialized strategies
+            if(3*minRun+3 <= X && X <= 4*minRun+1) {
+                // add x_1=MIN+1, x_2=MIN, x_3=X-newTotal  to runs
+                newTotal = 2*minRun+1;
+            } else if(5*minRun+5 <= X && X <= 6*minRun+5) {
+                // add x_1=MIN+1, x_2=MIN, x_3=MIN+2, x_4=X-newTotal  to runs
+                newTotal = 3*minRun+3;
+            } else if(8*minRun+9 <= X && X <= 10*minRun+9) {
+                // add x_1=MIN+1, x_2=MIN, x_3=MIN+2, x_4=2MIN+2, x_5=X-newTotal  to runs
+                newTotal = 5*minRun+5;
+            } else if(13*minRun+15 <= X && X <= 16*minRun+17) {
+                // add x_1=MIN+1, x_2=MIN, x_3=MIN+2, x_4=2MIN+2, x_5=3MIN+4, x_6=X-newTotal  to runs
+                newTotal = 8*minRun+9;
+            }
+            runs.add(0, X-newTotal);
+        }
+        runs.add(0, X);
+    }
+
+    /**
+     * Fills <code>runs</code> with a sequence of run lengths of the form<br>
+     * Y_n     x_{n,1}   x_{n,2}   ... x_{n,l_n} <br>
+     * Y_{n-1} x_{n-1,1} x_{n-1,2} ... x_{n-1,l_{n-1}} <br>
+     * ... <br>
+     * Y_1     x_{1,1}   x_{1,2}   ... x_{1,l_1}<br>
+     * The Y_i's are chosen to satisfy the invariant throughout execution,
+     * but the x_{i,j}'s are merged (by <code>TimSort.mergeCollapse</code>)
+     * into an X_i that violates the invariant.
+     * X is the sum of all run lengths that will be added to <code>runs</code>.
+     */
+    private void fillRunsJDKWorstCase() {
+        long runningTotal = 0;
+        long Y = minRun + 4;
+        long X = minRun;
+
+        while(runningTotal+Y+X <= length) {
+            runningTotal += X + Y;
+            generateJDKWrongElem(X);
+            runs.add(0,Y);
+
+            // X_{i+1} = Y_i + x_{i,1} + 1, since runs.get(1) = x_{i,1}
+            X = Y + runs.get(1) + 1;
+
+            // Y_{i+1} = X_{i+1} + Y_i + 1
+            Y += X + 1;
+        }
+
+        if(runningTotal + X <= length) {
+            runningTotal += X;
+            generateJDKWrongElem(X);
+        }
+
+        runs.add(length-runningTotal);
+    }
+
+    private Integer[] createArray() {
+        Integer[] a = new Integer[length];
+        Arrays.fill(a, 0);
+        int endRun = -1;
+        for(long len : runs)
+            a[endRun+=len] = 1;
+        a[length-1]=0;
+        return a;
+    }
+
+}
--- a/jdk/test/java/util/Optional/Basic.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/java/util/Optional/Basic.java	Mon Feb 23 05:01:11 2015 -0800
@@ -27,8 +27,13 @@
  * @run testng Basic
  */
 
+import java.lang.AssertionError;
+import java.lang.NullPointerException;
+import java.lang.Throwable;
 import java.util.NoSuchElementException;
 import java.util.Optional;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.stream.Stream;
 
 import static org.testng.Assert.*;
 import org.testng.annotations.Test;
@@ -50,12 +55,53 @@
         assertTrue(!empty.toString().isEmpty());
         assertTrue(!empty.toString().equals(presentEmptyString.toString()));
         assertTrue(!empty.isPresent());
-        empty.ifPresent(v -> { fail(); });
+
+        empty.ifPresent(v -> fail());
+
+        AtomicBoolean emptyCheck = new AtomicBoolean();
+        empty.ifPresentOrElse(v -> fail(), () -> emptyCheck.set(true));
+        assertTrue(emptyCheck.get());
+
+        try {
+            empty.ifPresentOrElse(v -> fail(), () -> { throw new ObscureException(); });
+            fail();
+        } catch (ObscureException expected) {
+        } catch (AssertionError e) {
+            throw e;
+        } catch (Throwable t) {
+            fail();
+        }
+
         assertSame(null, empty.orElse(null));
         RuntimeException orElse = new RuntimeException() { };
         assertSame(Boolean.FALSE, empty.orElse(Boolean.FALSE));
-        assertSame(null, empty.orElseGet(()-> null));
-        assertSame(Boolean.FALSE, empty.orElseGet(()-> Boolean.FALSE));
+        assertSame(null, empty.orElseGet(() -> null));
+        assertSame(Boolean.FALSE, empty.orElseGet(() -> Boolean.FALSE));
+    }
+
+    @Test(groups = "unit")
+    public void testIfPresentAndOrElseAndNull() {
+        Optional<Boolean> empty = Optional.empty();
+        Optional<Boolean> present = Optional.of(Boolean.TRUE);
+
+        // No NPE
+        present.ifPresentOrElse(v -> {}, null);
+        empty.ifPresent(null);
+        empty.ifPresentOrElse(null, () -> {});
+
+        // NPE
+        try {
+            present.ifPresent(null);
+            fail();
+        } catch (NullPointerException ex) {}
+        try {
+            present.ifPresentOrElse(null, () -> {});
+            fail();
+        } catch (NullPointerException ex) {}
+        try {
+            empty.ifPresentOrElse(v -> {}, null);
+            fail();
+        } catch (NullPointerException ex) {}
     }
 
     @Test(expectedExceptions=NoSuchElementException.class)
@@ -101,18 +147,39 @@
         assertTrue(!present.toString().equals(presentEmptyString.toString()));
         assertTrue(-1 != present.toString().indexOf(Boolean.TRUE.toString()));
         assertSame(Boolean.TRUE, present.get());
+
+        AtomicBoolean presentCheck = new AtomicBoolean();
+        present.ifPresent(v -> presentCheck.set(true));
+        assertTrue(presentCheck.get());
+        presentCheck.set(false);
+        present.ifPresentOrElse(v -> presentCheck.set(true), () -> fail());
+        assertTrue(presentCheck.get());
+
         try {
             present.ifPresent(v -> { throw new ObscureException(); });
             fail();
-        } catch(ObscureException expected) {
+        } catch (ObscureException expected) {
+        } catch (AssertionError e) {
+            throw e;
+        } catch (Throwable t) {
+            fail();
+        }
+        try {
+            present.ifPresentOrElse(v -> { throw new ObscureException(); }, () -> fail());
+            fail();
+        } catch (ObscureException expected) {
+        } catch (AssertionError e) {
+            throw e;
+        } catch (Throwable t) {
+            fail();
+        }
 
-        }
         assertSame(Boolean.TRUE, present.orElse(null));
         assertSame(Boolean.TRUE, present.orElse(Boolean.FALSE));
         assertSame(Boolean.TRUE, present.orElseGet(null));
-        assertSame(Boolean.TRUE, present.orElseGet(()-> null));
-        assertSame(Boolean.TRUE, present.orElseGet(()-> Boolean.FALSE));
-        assertSame(Boolean.TRUE, present.<RuntimeException>orElseThrow( null));
+        assertSame(Boolean.TRUE, present.orElseGet(() -> null));
+        assertSame(Boolean.TRUE, present.orElseGet(() -> Boolean.FALSE));
+        assertSame(Boolean.TRUE, present.<RuntimeException>orElseThrow(null));
         assertSame(Boolean.TRUE, present.<RuntimeException>orElseThrow(ObscureException::new));
     }
 
@@ -226,6 +293,26 @@
         assertSame(l, fixture);
     }
 
+    @Test(groups = "unit")
+    public void testStream() {
+        {
+            Stream<String> s = Optional.<String>empty().stream();
+            assertFalse(s.isParallel());
+
+            Object[] es = s.toArray();
+            assertEquals(es.length, 0);
+        }
+
+        {
+            Stream<String> s = Optional.of("Duke").stream();
+            assertFalse(s.isParallel());
+
+            String[] es = s.toArray(String[]::new);
+            assertEquals(es.length, 1);
+            assertEquals(es[0], "Duke");
+        }
+    }
+
     private static class ObscureException extends RuntimeException {
 
     }
--- a/jdk/test/java/util/Optional/BasicDouble.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/java/util/Optional/BasicDouble.java	Mon Feb 23 05:01:11 2015 -0800
@@ -29,6 +29,8 @@
 
 import java.util.NoSuchElementException;
 import java.util.OptionalDouble;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.stream.DoubleStream;
 
 import static org.testng.Assert.*;
 import org.testng.annotations.Test;
@@ -48,41 +50,82 @@
         assertTrue(0 == empty.hashCode());
         assertTrue(!empty.toString().isEmpty());
         assertTrue(!empty.isPresent());
+
         empty.ifPresent(v -> { fail(); });
+
+        AtomicBoolean emptyCheck = new AtomicBoolean();
+        empty.ifPresentOrElse(v -> fail(), () -> emptyCheck.set(true));
+        assertTrue(emptyCheck.get());
+
+        try {
+            empty.ifPresentOrElse(v -> fail(), () -> { throw new ObscureException(); });
+            fail();
+        } catch (ObscureException expected) {
+        } catch (AssertionError e) {
+            throw e;
+        } catch (Throwable t) {
+            fail();
+        }
+
         assertEquals(2.0, empty.orElse(2.0));
         assertEquals(2.0, empty.orElseGet(()-> 2.0));
     }
 
-        @Test(expectedExceptions=NoSuchElementException.class)
-        public void testEmptyGet() {
-            OptionalDouble empty = OptionalDouble.empty();
+    @Test(groups = "unit")
+    public void testIfPresentAndOrElseAndNull() {
+        OptionalDouble empty = OptionalDouble.empty();
+        OptionalDouble present = OptionalDouble.of(1.0);
 
-            double got = empty.getAsDouble();
-        }
+        // No NPE
+        present.ifPresentOrElse(v -> {}, null);
+        empty.ifPresent(null);
+        empty.ifPresentOrElse(null, () -> {});
 
-        @Test(expectedExceptions=NullPointerException.class)
-        public void testEmptyOrElseGetNull() {
-            OptionalDouble empty = OptionalDouble.empty();
-
-            double got = empty.orElseGet(null);
-        }
+        // NPE
+        try {
+            present.ifPresent(null);
+            fail();
+        } catch (NullPointerException ex) {}
+        try {
+            present.ifPresentOrElse(null, () -> {});
+            fail();
+        } catch (NullPointerException ex) {}
+        try {
+            empty.ifPresentOrElse(v -> {}, null);
+            fail();
+        } catch (NullPointerException ex) {}
+    }
 
-        @Test(expectedExceptions=NullPointerException.class)
-        public void testEmptyOrElseThrowNull() throws Throwable {
-            OptionalDouble empty = OptionalDouble.empty();
+    @Test(expectedExceptions=NoSuchElementException.class)
+    public void testEmptyGet() {
+        OptionalDouble empty = OptionalDouble.empty();
+
+        double got = empty.getAsDouble();
+    }
 
-            double got = empty.orElseThrow(null);
-        }
+    @Test(expectedExceptions=NullPointerException.class)
+    public void testEmptyOrElseGetNull() {
+        OptionalDouble empty = OptionalDouble.empty();
+
+        double got = empty.orElseGet(null);
+    }
 
-        @Test(expectedExceptions=ObscureException.class)
-        public void testEmptyOrElseThrow() throws Exception {
-            OptionalDouble empty = OptionalDouble.empty();
+    @Test(expectedExceptions=NullPointerException.class)
+    public void testEmptyOrElseThrowNull() throws Throwable {
+        OptionalDouble empty = OptionalDouble.empty();
+
+        double got = empty.orElseThrow(null);
+    }
 
-            double got = empty.orElseThrow(ObscureException::new);
-        }
+    @Test(expectedExceptions=ObscureException.class)
+    public void testEmptyOrElseThrow() throws Exception {
+        OptionalDouble empty = OptionalDouble.empty();
 
-        @Test(groups = "unit")
-        public void testPresent() {
+        double got = empty.orElseThrow(ObscureException::new);
+    }
+
+    @Test(groups = "unit")
+    public void testPresent() {
         OptionalDouble empty = OptionalDouble.empty();
         OptionalDouble present = OptionalDouble.of(1.0);
 
@@ -95,12 +138,33 @@
         assertFalse(present.toString().isEmpty());
         assertTrue(-1 != present.toString().indexOf(Double.toString(present.getAsDouble()).toString()));
         assertEquals(1.0, present.getAsDouble());
+
+        AtomicBoolean presentCheck = new AtomicBoolean();
+        present.ifPresent(v -> presentCheck.set(true));
+        assertTrue(presentCheck.get());
+        presentCheck.set(false);
+        present.ifPresentOrElse(v -> presentCheck.set(true), () -> fail());
+        assertTrue(presentCheck.get());
+
         try {
             present.ifPresent(v -> { throw new ObscureException(); });
             fail();
-        } catch(ObscureException expected) {
+        } catch (ObscureException expected) {
+        } catch (AssertionError e) {
+            throw e;
+        } catch (Throwable t) {
+            fail();
+        }
+        try {
+            present.ifPresentOrElse(v -> { throw new ObscureException(); }, () -> fail());
+            fail();
+        } catch (ObscureException expected) {
+        } catch (AssertionError e) {
+            throw e;
+        } catch (Throwable t) {
+            fail();
+        }
 
-        }
         assertEquals(1.0, present.orElse(2.0));
         assertEquals(1.0, present.orElseGet(null));
         assertEquals(1.0, present.orElseGet(()-> 2.0));
@@ -109,6 +173,26 @@
         assertEquals(1.0, present.<RuntimeException>orElseThrow(ObscureException::new));
     }
 
+    @Test(groups = "unit")
+    public void testStream() {
+        {
+            DoubleStream s = OptionalDouble.empty().stream();
+            assertFalse(s.isParallel());
+
+            double[] es = s.toArray();
+            assertEquals(es.length, 0);
+        }
+
+        {
+            DoubleStream s = OptionalDouble.of(42.0).stream();
+            assertFalse(s.isParallel());
+
+            double[] es = s.toArray();
+            assertEquals(es.length, 1);
+            assertEquals(es[0], 42.0);
+        }
+    }
+
     private static class ObscureException extends RuntimeException {
 
     }
--- a/jdk/test/java/util/Optional/BasicInt.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/java/util/Optional/BasicInt.java	Mon Feb 23 05:01:11 2015 -0800
@@ -29,6 +29,8 @@
 
 import java.util.NoSuchElementException;
 import java.util.OptionalInt;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.stream.IntStream;
 
 import static org.testng.Assert.*;
 import org.testng.annotations.Test;
@@ -48,41 +50,82 @@
         assertTrue(0 == empty.hashCode());
         assertTrue(!empty.toString().isEmpty());
         assertTrue(!empty.isPresent());
+
         empty.ifPresent(v -> { fail(); });
+
+        AtomicBoolean emptyCheck = new AtomicBoolean();
+        empty.ifPresentOrElse(v -> fail(), () -> emptyCheck.set(true));
+        assertTrue(emptyCheck.get());
+
+        try {
+            empty.ifPresentOrElse(v -> fail(), () -> { throw new ObscureException(); });
+            fail();
+        } catch (ObscureException expected) {
+        } catch (AssertionError e) {
+            throw e;
+        } catch (Throwable t) {
+            fail();
+        }
+
         assertEquals(2, empty.orElse(2));
         assertEquals(2, empty.orElseGet(()-> 2));
     }
 
-        @Test(expectedExceptions=NoSuchElementException.class)
-        public void testEmptyGet() {
-            OptionalInt empty = OptionalInt.empty();
+    @Test(groups = "unit")
+    public void testIfPresentAndOrElseAndNull() {
+        OptionalInt empty = OptionalInt.empty();
+        OptionalInt present = OptionalInt.of(1);
 
-            int got = empty.getAsInt();
-        }
+        // No NPE
+        present.ifPresentOrElse(v -> {}, null);
+        empty.ifPresent(null);
+        empty.ifPresentOrElse(null, () -> {});
 
-        @Test(expectedExceptions=NullPointerException.class)
-        public void testEmptyOrElseGetNull() {
-            OptionalInt empty = OptionalInt.empty();
-
-            int got = empty.orElseGet(null);
-        }
+        // NPE
+        try {
+            present.ifPresent(null);
+            fail();
+        } catch (NullPointerException ex) {}
+        try {
+            present.ifPresentOrElse(null, () -> {});
+            fail();
+        } catch (NullPointerException ex) {}
+        try {
+            empty.ifPresentOrElse(v -> {}, null);
+            fail();
+        } catch (NullPointerException ex) {}
+    }
 
-        @Test(expectedExceptions=NullPointerException.class)
-        public void testEmptyOrElseThrowNull() throws Throwable {
-            OptionalInt empty = OptionalInt.empty();
+    @Test(expectedExceptions=NoSuchElementException.class)
+    public void testEmptyGet() {
+        OptionalInt empty = OptionalInt.empty();
+
+        int got = empty.getAsInt();
+    }
 
-            int got = empty.orElseThrow(null);
-        }
+    @Test(expectedExceptions=NullPointerException.class)
+    public void testEmptyOrElseGetNull() {
+        OptionalInt empty = OptionalInt.empty();
+
+        int got = empty.orElseGet(null);
+    }
 
-        @Test(expectedExceptions=ObscureException.class)
-        public void testEmptyOrElseThrow() throws Exception {
-            OptionalInt empty = OptionalInt.empty();
+    @Test(expectedExceptions=NullPointerException.class)
+    public void testEmptyOrElseThrowNull() throws Throwable {
+        OptionalInt empty = OptionalInt.empty();
+
+        int got = empty.orElseThrow(null);
+    }
 
-            int got = empty.orElseThrow(ObscureException::new);
-        }
+    @Test(expectedExceptions=ObscureException.class)
+    public void testEmptyOrElseThrow() throws Exception {
+        OptionalInt empty = OptionalInt.empty();
 
-        @Test(groups = "unit")
-        public void testPresent() {
+        int got = empty.orElseThrow(ObscureException::new);
+    }
+
+    @Test(groups = "unit")
+    public void testPresent() {
         OptionalInt empty = OptionalInt.empty();
         OptionalInt present = OptionalInt.of(1);
 
@@ -95,12 +138,33 @@
         assertFalse(present.toString().isEmpty());
         assertTrue(-1 != present.toString().indexOf(Integer.toString(present.getAsInt()).toString()));
         assertEquals(1, present.getAsInt());
+
+        AtomicBoolean presentCheck = new AtomicBoolean();
+        present.ifPresent(v -> presentCheck.set(true));
+        assertTrue(presentCheck.get());
+        presentCheck.set(false);
+        present.ifPresentOrElse(v -> presentCheck.set(true), () -> fail());
+        assertTrue(presentCheck.get());
+
         try {
             present.ifPresent(v -> { throw new ObscureException(); });
             fail();
-        } catch(ObscureException expected) {
+        } catch (ObscureException expected) {
+        } catch (AssertionError e) {
+            throw e;
+        } catch (Throwable t) {
+            fail();
+        }
+        try {
+            present.ifPresentOrElse(v -> { throw new ObscureException(); }, () -> fail());
+            fail();
+        } catch (ObscureException expected) {
+        } catch (AssertionError e) {
+            throw e;
+        } catch (Throwable t) {
+            fail();
+        }
 
-        }
         assertEquals(1, present.orElse(2));
         assertEquals(1, present.orElseGet(null));
         assertEquals(1, present.orElseGet(()-> 2));
@@ -109,6 +173,26 @@
         assertEquals(1, present.<RuntimeException>orElseThrow(ObscureException::new));
     }
 
+    @Test(groups = "unit")
+    public void testStream() {
+        {
+            IntStream s = OptionalInt.empty().stream();
+            assertFalse(s.isParallel());
+
+            int[] es = s.toArray();
+            assertEquals(es.length, 0);
+        }
+
+        {
+            IntStream s = OptionalInt.of(42).stream();
+            assertFalse(s.isParallel());
+
+            int[] es = OptionalInt.of(42).stream().toArray();
+            assertEquals(es.length, 1);
+            assertEquals(es[0], 42);
+        }
+    }
+
     private static class ObscureException extends RuntimeException {
 
     }
--- a/jdk/test/java/util/Optional/BasicLong.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/java/util/Optional/BasicLong.java	Mon Feb 23 05:01:11 2015 -0800
@@ -29,6 +29,8 @@
 
 import java.util.NoSuchElementException;
 import java.util.OptionalLong;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.stream.LongStream;
 
 import static org.testng.Assert.*;
 import org.testng.annotations.Test;
@@ -48,41 +50,82 @@
         assertTrue(0 == empty.hashCode());
         assertTrue(!empty.toString().isEmpty());
         assertTrue(!empty.isPresent());
+
         empty.ifPresent(v -> { fail(); });
+
+        AtomicBoolean emptyCheck = new AtomicBoolean();
+        empty.ifPresentOrElse(v -> fail(), () -> emptyCheck.set(true));
+        assertTrue(emptyCheck.get());
+
+        try {
+            empty.ifPresentOrElse(v -> fail(), () -> { throw new ObscureException(); });
+            fail();
+        } catch (ObscureException expected) {
+        } catch (AssertionError e) {
+            throw e;
+        } catch (Throwable t) {
+            fail();
+        }
+
         assertEquals(2, empty.orElse(2));
         assertEquals(2, empty.orElseGet(()-> 2));
     }
 
-        @Test(expectedExceptions=NoSuchElementException.class)
-        public void testEmptyGet() {
-            OptionalLong empty = OptionalLong.empty();
+    @Test(groups = "unit")
+    public void testIfPresentAndOrElseAndNull() {
+        OptionalLong empty = OptionalLong.empty();
+        OptionalLong present = OptionalLong.of(1);
 
-            long got = empty.getAsLong();
-        }
+        // No NPE
+        present.ifPresentOrElse(v -> {}, null);
+        empty.ifPresent(null);
+        empty.ifPresentOrElse(null, () -> {});
 
-        @Test(expectedExceptions=NullPointerException.class)
-        public void testEmptyOrElseGetNull() {
-            OptionalLong empty = OptionalLong.empty();
-
-            long got = empty.orElseGet(null);
-        }
+        // NPE
+        try {
+            present.ifPresent(null);
+            fail();
+        } catch (NullPointerException ex) {}
+        try {
+            present.ifPresentOrElse(null, () -> {});
+            fail();
+        } catch (NullPointerException ex) {}
+        try {
+            empty.ifPresentOrElse(v -> {}, null);
+            fail();
+        } catch (NullPointerException ex) {}
+    }
 
-        @Test(expectedExceptions=NullPointerException.class)
-        public void testEmptyOrElseThrowNull() throws Throwable {
-            OptionalLong empty = OptionalLong.empty();
+    @Test(expectedExceptions=NoSuchElementException.class)
+    public void testEmptyGet() {
+        OptionalLong empty = OptionalLong.empty();
+
+        long got = empty.getAsLong();
+    }
 
-            long got = empty.orElseThrow(null);
-        }
+    @Test(expectedExceptions=NullPointerException.class)
+    public void testEmptyOrElseGetNull() {
+        OptionalLong empty = OptionalLong.empty();
+
+        long got = empty.orElseGet(null);
+    }
 
-        @Test(expectedExceptions=ObscureException.class)
-        public void testEmptyOrElseThrow() throws Exception {
-            OptionalLong empty = OptionalLong.empty();
+    @Test(expectedExceptions=NullPointerException.class)
+    public void testEmptyOrElseThrowNull() throws Throwable {
+        OptionalLong empty = OptionalLong.empty();
+
+        long got = empty.orElseThrow(null);
+    }
 
-            long got = empty.orElseThrow(ObscureException::new);
-        }
+    @Test(expectedExceptions=ObscureException.class)
+    public void testEmptyOrElseThrow() throws Exception {
+        OptionalLong empty = OptionalLong.empty();
 
-        @Test(groups = "unit")
-        public void testPresent() {
+        long got = empty.orElseThrow(ObscureException::new);
+    }
+
+    @Test(groups = "unit")
+    public void testPresent() {
         OptionalLong empty = OptionalLong.empty();
         OptionalLong present = OptionalLong.of(1L);
 
@@ -95,12 +138,35 @@
         assertFalse(present.toString().isEmpty());
         assertTrue(-1 != present.toString().indexOf(Long.toString(present.getAsLong()).toString()));
         assertEquals(1L, present.getAsLong());
+
+        AtomicBoolean presentCheck = new AtomicBoolean();
+        present.ifPresent(v -> presentCheck.set(true));
+        assertTrue(presentCheck.get());
+        presentCheck.set(false);
+        present.ifPresentOrElse(v -> presentCheck.set(true), () -> fail());
+        assertTrue(presentCheck.get());
+
         try {
             present.ifPresent(v -> { throw new ObscureException(); });
             fail();
-        } catch(ObscureException expected) {
+        } catch (ObscureException expected) {
+        } catch (AssertionError e) {
+            throw e;
+        } catch (Throwable t) {
+            fail();
+        }
+        try {
+            present.ifPresentOrElse(v -> {
+                throw new ObscureException();
+            }, () -> fail());
+            fail();
+        } catch (ObscureException expected) {
+        } catch (AssertionError e) {
+            throw e;
+        } catch (Throwable t) {
+            fail();
+        }
 
-        }
         assertEquals(1, present.orElse(2));
         assertEquals(1, present.orElseGet(null));
         assertEquals(1, present.orElseGet(()-> 2));
@@ -109,6 +175,24 @@
         assertEquals(1, present.<RuntimeException>orElseThrow(ObscureException::new));
     }
 
+    @Test(groups = "unit")
+    public void testStream() {
+        {
+            LongStream s = OptionalLong.empty().stream();
+
+            long[] es = s.toArray();
+            assertEquals(es.length, 0);
+        }
+
+        {
+            LongStream s = OptionalLong.of(42L).stream();
+
+            long[] es = s.toArray();
+            assertEquals(es.length, 1);
+            assertEquals(es[0], 42L);
+        }
+    }
+
     private static class ObscureException extends RuntimeException {
 
     }
--- a/jdk/test/java/util/concurrent/CompletableFuture/ThenComposeExceptionTest.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/java/util/concurrent/CompletableFuture/ThenComposeExceptionTest.java	Mon Feb 23 05:01:11 2015 -0800
@@ -36,7 +36,7 @@
 
 /**
  * @test
- * @bug 8068432
+ * @bug 8068432 8072030
  * @run testng ThenComposeExceptionTest
  * @summary Test that CompletableFuture.thenCompose works correctly if the
  * composing future completes exceptionally
@@ -92,7 +92,8 @@
         Assert.assertNotSame(f_thenCompose, fe, "Composed CompletableFuture returned directly");
 
         AtomicReference<Throwable> eOnWhenComplete = new AtomicReference<>();
-        f_thenCompose.whenComplete((r, e) -> eOnWhenComplete.set(e));
+        CompletableFuture<String> f_whenComplete = f_thenCompose.
+                whenComplete((r, e) -> eOnWhenComplete.set(e));
 
         afterAction.accept(fe);
 
@@ -103,10 +104,20 @@
         catch (Throwable t) {
             eOnJoined = t;
         }
-
-        Assert.assertTrue(eOnWhenComplete.get() instanceof CompletionException,
-                          "Incorrect exception reported on whenComplete");
         Assert.assertTrue(eOnJoined instanceof CompletionException,
-                          "Incorrect exception reported when joined");
+                          "Incorrect exception reported when joined on thenCompose: " + eOnJoined);
+
+        // Need to wait for f_whenComplete to complete to avoid
+        // race condition when updating eOnWhenComplete
+        eOnJoined = null;
+        try {
+            f_whenComplete.join();
+        } catch (Throwable t) {
+            eOnJoined = t;
+        }
+        Assert.assertTrue(eOnJoined instanceof CompletionException,
+                          "Incorrect exception reported when joined on whenComplete: " + eOnJoined);
+        Assert.assertTrue(eOnWhenComplete.get() instanceof CompletionException,
+                          "Incorrect exception passed to whenComplete: " + eOnWhenComplete.get());
     }
-}
+}
\ No newline at end of file
--- a/jdk/test/java/util/regex/PatternStreamTest.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/java/util/regex/PatternStreamTest.java	Mon Feb 23 05:01:11 2015 -0800
@@ -114,9 +114,20 @@
         data.add(new Object[]{description, input, pattern, expected});
 
 
+        description = "Empty input";
         input = "";
         pattern = Pattern.compile("\u56da");
         expected = new ArrayList<>();
+        expected.add("");
+
+        data.add(new Object[]{description, input, pattern, expected});
+
+
+        description = "Empty input with empty pattern";
+        input = "";
+        pattern = Pattern.compile("");
+        expected = new ArrayList<>();
+        expected.add("");
 
         data.add(new Object[]{description, input, pattern, expected});
 
--- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/StreamBuilderTest.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/StreamBuilderTest.java	Mon Feb 23 05:01:11 2015 -0800
@@ -55,8 +55,30 @@
 
 
     @Test
+    public void testOfNullableWithNonNull() {
+        TestData.OfRef<Integer> data = TestData.Factory.ofSupplier("{1}",
+                                                                   () -> Stream.ofNullable(1));
+
+        withData(data).
+                stream(s -> s).
+                expectedResult(Collections.singletonList(1)).
+                exercise();
+    }
+
+    @Test
+    public void testOfNullableWithNull() {
+        TestData.OfRef<Integer> data = TestData.Factory.ofSupplier("{null})",
+                                                                   () -> Stream.ofNullable(null));
+
+        withData(data).
+                stream(s -> s).
+                expectedResult(Collections.emptyList()).
+                exercise();
+    }
+
+    @Test
     public void testSingleton() {
-        TestData.OfRef<Integer> data = TestData.Factory.ofSupplier("[0, 1)",
+        TestData.OfRef<Integer> data = TestData.Factory.ofSupplier("{1}",
                                                                    () -> Stream.of(1));
 
         withData(data).
@@ -118,7 +140,7 @@
 
     @Test
     public void testIntSingleton() {
-        TestData.OfInt data = TestData.Factory.ofIntSupplier("[0, 1)",
+        TestData.OfInt data = TestData.Factory.ofIntSupplier("{1}",
                                                              () -> IntStream.of(1));
 
         withData(data).
@@ -180,7 +202,7 @@
 
     @Test
     public void testLongSingleton() {
-        TestData.OfLong data = TestData.Factory.ofLongSupplier("[0, 1)",
+        TestData.OfLong data = TestData.Factory.ofLongSupplier("{1}",
                                                                () -> LongStream.of(1));
 
         withData(data).
@@ -242,7 +264,7 @@
 
     @Test
     public void testDoubleSingleton() {
-        TestData.OfDouble data = TestData.Factory.ofDoubleSupplier("[0, 1)", () -> DoubleStream.of(1));
+        TestData.OfDouble data = TestData.Factory.ofDoubleSupplier("{1}", () -> DoubleStream.of(1));
 
         withData(data).
                 stream(s -> s).
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/imageio/plugins/jpeg/MagentaEXIFTest.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,205 @@
+/*
+ * 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.
+ *
+ * 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.
+ */
+
+/**
+ * @test
+ * @bug     8071707 6243376
+ * @summary Test verifies that EXIF images with differing sampling factors
+ *          are written correctly
+ *
+ * @run     main MagentaEXIFTest
+ */
+
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.image.BufferedImage;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+
+import javax.imageio.IIOImage;
+import javax.imageio.ImageIO;
+import javax.imageio.ImageReader;
+import javax.imageio.ImageTypeSpecifier;
+import javax.imageio.ImageWriteParam;
+import javax.imageio.ImageWriter;
+import javax.imageio.metadata.IIOInvalidTreeException;
+import javax.imageio.metadata.IIOMetadata;
+import javax.imageio.metadata.IIOMetadataNode;
+import javax.imageio.stream.ImageInputStream;
+import javax.imageio.stream.ImageOutputStream;
+
+import org.w3c.dom.Attr;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+
+public class MagentaEXIFTest {
+
+    public static void main(final String[] argv) throws Exception {
+
+        IIOMetadata jpegmetadata = null;
+        ImageWriter jpgWriter = ImageIO.getImageWritersByFormatName("jpg").next();
+        try {
+        jpegmetadata = createJPEGMetadata(jpgWriter);
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        ImageOutputStream output = ImageIO.createImageOutputStream(baos);
+        jpgWriter.setOutput(output);
+        int w=100, h=100;
+        BufferedImage bi = new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB);
+        Graphics2D g2d = bi.createGraphics();
+        g2d.setColor(Color.white);
+        g2d.fillRect(0, 0, w, h);
+        IIOImage image = new IIOImage(bi, null, jpegmetadata);
+        jpgWriter.write(null, image, null);
+        jpgWriter.dispose();
+
+        baos.flush();
+        ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
+        ImageInputStream iis = ImageIO.createImageInputStream(bais);
+        bi = ImageIO.read(iis);
+        for (int i=0; i<bi.getWidth(); i++) {
+            for(int j=0; j<bi.getHeight(); j++) {
+               if (bi.getRGB(i, j) != Color.white.getRGB()) {
+                   throw new RuntimeException("Wrong color : " + Integer.toHexString(bi.getRGB(i, j)));
+               }
+            }
+        }
+
+    }
+
+
+    static void displayMetadata(Node node, int level) {
+        for (int i = 0; i < level; i++) System.out.print("  ");
+        System.out.print("<" + node.getNodeName());
+        NamedNodeMap map = node.getAttributes();
+        if (map != null) { // print attribute values
+            int length = map.getLength();
+            for (int i = 0; i < length; i++) {
+                Node attr = map.item(i);
+                System.out.print(" " + attr.getNodeName() +
+                                 "=\"" + attr.getNodeValue() + "\"");
+            }
+        }
+
+        Node child = node.getFirstChild();
+        if (child != null) {
+            System.out.println(">"); // close current tag
+            while (child != null) { // emit child tags recursively
+                displayMetadata(child, level + 1);
+                child = child.getNextSibling();
+            }
+            for (int i = 0; i < level; i++) System.out.print("  ");
+            System.out.println("</" + node.getNodeName() + ">");
+        } else {
+            System.out.println("/>");
+        }
+    }
+
+    /*
+     * Construct a JPEG IIOMetadata that has had the JFIF marker removed and
+     * an APP1 EXIF marker added, and further massaged so that we have differing
+     * horizontal and vertical sampling factors for one channel.
+     */
+    static IIOMetadata createJPEGMetadata(ImageWriter iw) throws IIOInvalidTreeException {
+        String jpegMDName = "javax_imageio_jpeg_image_1.0";
+        ImageWriter imgWriter = ImageIO.getImageWritersByFormatName("jpg").next();
+        BufferedImage bi = new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB);
+        ImageTypeSpecifier ist = new ImageTypeSpecifier(bi);
+        IIOMetadata metadata = imgWriter.getDefaultImageMetadata(ist, null);
+
+        IIOMetadataNode root = new IIOMetadataNode(jpegMDName);
+        IIOMetadataNode header = new IIOMetadataNode("JPEGvariety");
+        IIOMetadataNode sequence = new IIOMetadataNode("markerSequence");
+
+        root.appendChild(header);
+        root.appendChild(sequence);
+
+        IIOMetadataNode app1 = new IIOMetadataNode("unknown");
+        app1.setUserObject(new byte[255]);
+        app1.setAttribute("MarkerTag", "255");
+        sequence.appendChild(app1);
+
+        IIOMetadataNode sof = new IIOMetadataNode("sof");
+        sof.setAttribute("process", "0");
+        sof.setAttribute("samplePrecision", "8");
+        sof.setAttribute("numLines", "100");
+        sof.setAttribute("samplesPerLine", "100");
+        sof.setAttribute("numFrameComponents", "3");
+        IIOMetadataNode c1 = new IIOMetadataNode("componentSpec");
+        c1.setAttribute("componentId", "1");
+        c1.setAttribute("HsamplingFactor", "1");
+        c1.setAttribute("VsamplingFactor", "2");
+        c1.setAttribute("QtableSelector", "1");
+        sof.appendChild(c1);
+        IIOMetadataNode c2 = new IIOMetadataNode("componentSpec");
+        c2.setAttribute("componentId", "2");
+        c2.setAttribute("HsamplingFactor", "1");
+        c2.setAttribute("VsamplingFactor", "1");
+        c2.setAttribute("QtableSelector", "1");
+        sof.appendChild(c2);
+        IIOMetadataNode c3 = new IIOMetadataNode("componentSpec");
+        c3.setAttribute("componentId", "3");
+        c3.setAttribute("HsamplingFactor", "1");
+        c3.setAttribute("VsamplingFactor", "1");
+        c3.setAttribute("QtableSelector", "1");
+        sof.appendChild(c3);
+        sequence.appendChild(sof);
+        metadata.setFromTree(jpegMDName, root);
+        IIOMetadata def = imgWriter.getDefaultImageMetadata(ist, null);
+        metadata.mergeTree(jpegMDName, def.getAsTree(jpegMDName));
+        Node tree = metadata.getAsTree(jpegMDName);
+        Node variety = tree.getFirstChild();
+        Node jfif = variety.getFirstChild();
+        variety.removeChild(jfif);
+        sequence = (IIOMetadataNode)tree.getLastChild();
+        NodeList markers = sequence.getChildNodes();
+        IIOMetadataNode n, sofNode=null;
+        for (int i=0;i<markers.getLength();i++) {
+           n = (IIOMetadataNode)markers.item(i);
+           if (n.getNodeName().equals("sof")) {
+                sofNode = n;
+                break;
+           }
+        }
+        IIOMetadataNode componentSpec = (IIOMetadataNode)sofNode.getFirstChild();
+        Attr attr = componentSpec.getAttributeNode("HsamplingFactor");
+        attr.setValue("1");
+        attr = componentSpec.getAttributeNode("VsamplingFactor");
+        attr.setValue("2");
+        metadata.setFromTree(jpegMDName, tree);
+        String[] names = metadata.getMetadataFormatNames();
+        int length = names.length;
+        for (int i = 0; i < length; i++) {
+            System.out.println( "Format name: " + names[ i ] );
+            displayMetadata(metadata.getAsTree(names[i]), 0);
+        }
+
+        return metadata;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/imageio/plugins/shared/WriteAfterAbort.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,212 @@
+/*
+ * 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.
+ *
+ * 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.
+ */
+
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.Iterator;
+
+import javax.imageio.ImageIO;
+import javax.imageio.ImageWriter;
+import javax.imageio.event.IIOWriteProgressListener;
+import javax.imageio.spi.IIORegistry;
+import javax.imageio.spi.ImageWriterSpi;
+import javax.imageio.stream.ImageOutputStream;
+
+import static java.awt.image.BufferedImage.TYPE_BYTE_BINARY;
+
+/**
+ * @test
+ * @bug 4952954
+ * @summary abortFlag must be cleared for every ImageWriter.write operation
+ * @author Sergey Bylokhov
+ */
+public final class WriteAfterAbort implements IIOWriteProgressListener {
+
+    private volatile boolean abortFlag = true;
+    private volatile boolean isAbortCalled;
+    private volatile boolean isCompleteCalled;
+    private volatile boolean isProgressCalled;
+    private volatile boolean isStartedCalled;
+    private static final int WIDTH = 100;
+    private static final int HEIGHT = 100;
+
+    private void test(final ImageWriter writer) throws IOException {
+        // Image initialization
+        final BufferedImage imageWrite = new BufferedImage(WIDTH, HEIGHT,
+                                                           TYPE_BYTE_BINARY);
+        final Graphics2D g = imageWrite.createGraphics();
+        g.setColor(Color.WHITE);
+        g.fillRect(0, 0, WIDTH, HEIGHT);
+        g.dispose();
+
+        // File initialization
+        final File file = File.createTempFile("temp", ".img");
+        file.deleteOnExit();
+        final FileOutputStream fos = new SkipWriteOnAbortOutputStream(file);
+        final ImageOutputStream ios = ImageIO.createImageOutputStream(fos);
+        writer.setOutput(ios);
+        writer.addIIOWriteProgressListener(this);
+
+        // This write will be aborted, and file will not be touched
+        writer.write(imageWrite);
+        if (!isStartedCalled) {
+            throw new RuntimeException("Started should be called");
+        }
+        if (!isProgressCalled) {
+            throw new RuntimeException("Progress should be called");
+        }
+        if (!isAbortCalled) {
+            throw new RuntimeException("Abort should be called");
+        }
+        if (isCompleteCalled) {
+            throw new RuntimeException("Complete should not be called");
+        }
+        // Flush aborted data
+        ios.flush();
+
+        // This write should be completed successfully and the file should
+        // contain correct image data.
+        abortFlag = false;
+        isAbortCalled = false;
+        isCompleteCalled = false;
+        isProgressCalled = false;
+        isStartedCalled = false;
+        writer.write(imageWrite);
+
+        if (!isStartedCalled) {
+            throw new RuntimeException("Started should be called");
+        }
+        if (!isProgressCalled) {
+            throw new RuntimeException("Progress should be called");
+        }
+        if (isAbortCalled) {
+            throw new RuntimeException("Abort should not be called");
+        }
+        if (!isCompleteCalled) {
+            throw new RuntimeException("Complete should be called");
+        }
+        writer.dispose();
+        ios.close();
+
+        // Validates content of the file.
+        final BufferedImage imageRead = ImageIO.read(file);
+        for (int x = 0; x < WIDTH; ++x) {
+            for (int y = 0; y < HEIGHT; ++y) {
+                if (imageRead.getRGB(x, y) != imageWrite.getRGB(x, y)) {
+                    throw new RuntimeException("Test failed.");
+                }
+            }
+        }
+    }
+
+    public static void main(final String[] args) throws IOException {
+        final IIORegistry registry = IIORegistry.getDefaultInstance();
+        final Iterator<ImageWriterSpi> iter = registry.getServiceProviders(
+                ImageWriterSpi.class, provider -> true, true);
+
+        // Validates all supported ImageWriters
+        while (iter.hasNext()) {
+            final WriteAfterAbort writeAfterAbort = new WriteAfterAbort();
+            final ImageWriter writer = iter.next().createWriterInstance();
+            System.out.println("ImageWriter = " + writer);
+            writeAfterAbort.test(writer);
+        }
+        System.out.println("Test passed");
+    }
+
+    // Callbacks
+
+    @Override
+    public void imageComplete(ImageWriter source) {
+        isCompleteCalled = true;
+    }
+
+    @Override
+    public void imageProgress(ImageWriter source, float percentageDone) {
+        isProgressCalled = true;
+        if (percentageDone > 50 && abortFlag) {
+            source.abort();
+        }
+    }
+
+    @Override
+    public void imageStarted(ImageWriter source, int imageIndex) {
+        isStartedCalled = true;
+    }
+
+    @Override
+    public void writeAborted(final ImageWriter source) {
+        isAbortCalled = true;
+    }
+
+    @Override
+    public void thumbnailComplete(ImageWriter source) {
+    }
+
+    @Override
+    public void thumbnailProgress(ImageWriter source, float percentageDone) {
+    }
+
+    @Override
+    public void thumbnailStarted(ImageWriter source, int imageIndex,
+                                 int thumbnailIndex) {
+    }
+
+    /**
+     * We need to skip writes on abort, because content of the file after abort
+     * is undefined.
+     */
+    private class SkipWriteOnAbortOutputStream extends FileOutputStream {
+
+        SkipWriteOnAbortOutputStream(File file) throws FileNotFoundException {
+            super(file);
+        }
+
+        @Override
+        public void write(int b) throws IOException {
+            if (!abortFlag) {
+                super.write(b);
+            }
+        }
+
+        @Override
+        public void write(byte[] b) throws IOException {
+            if (!abortFlag) {
+                super.write(b);
+            }
+        }
+
+        @Override
+        public void write(byte[] b, int off, int len) throws IOException {
+            if (!abortFlag) {
+                super.write(b, off, len);
+            }
+        }
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/print/PrintSEUmlauts/PrintSEUmlauts.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 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.
+ */
+import java.awt.Graphics;
+import java.awt.GraphicsEnvironment;
+import java.awt.print.PageFormat;
+import java.awt.print.Printable;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import javax.print.DocFlavor;
+import javax.print.DocPrintJob;
+import javax.print.SimpleDoc;
+import javax.print.StreamPrintService;
+import javax.print.StreamPrintServiceFactory;
+import javax.print.attribute.HashDocAttributeSet;
+import javax.print.attribute.HashPrintRequestAttributeSet;
+import javax.print.event.PrintJobAdapter;
+import javax.print.event.PrintJobEvent;
+
+/*
+ * @test
+ * @bug 8067364
+ * @summary Printing to Postscript doesn't support dieresis
+ * @build PrintSEUmlauts
+ * @run main/othervm PrintSEUmlauts
+ */
+public class PrintSEUmlauts implements Printable {
+
+    public static void main(String[] args) throws Exception {
+
+        GraphicsEnvironment.getLocalGraphicsEnvironment();
+
+        DocFlavor flavor = DocFlavor.SERVICE_FORMATTED.PRINTABLE;
+        String mime = DocFlavor.BYTE_ARRAY.POSTSCRIPT.getMimeType();
+
+        StreamPrintServiceFactory[] factories =
+                StreamPrintServiceFactory.
+                        lookupStreamPrintServiceFactories(flavor, mime);
+        if (factories.length == 0) {
+            System.out.println("No print service found.");
+            return;
+        }
+
+        FileOutputStream output = new FileOutputStream("out.ps");
+        StreamPrintService service = factories[0].getPrintService(output);
+
+        SimpleDoc doc =
+             new SimpleDoc(new PrintSEUmlauts(),
+                           DocFlavor.SERVICE_FORMATTED.PRINTABLE,
+                           new HashDocAttributeSet());
+        DocPrintJob job = service.createPrintJob();
+        job.addPrintJobListener(new PrintJobAdapter() {
+            @Override
+            public void printJobCompleted(PrintJobEvent pje) {
+                testPrintAndExit();
+            }
+        });
+
+        job.print(doc, new HashPrintRequestAttributeSet());
+    }
+
+    private static final boolean DEBUG = false;
+    private static void testPrintAndExit() {
+        String expected = "<e4> 7.44 100.0 100.0 S";
+        String content = "";
+
+        File file = new File("out.ps");
+        if (!DEBUG) {
+            file.deleteOnExit();
+        }
+
+        try (FileInputStream stream = new FileInputStream(file)) {
+            byte[] data = new byte[(int) file.length()];
+            stream.read(data);
+            content = new String(data, StandardCharsets.ISO_8859_1);
+        } catch (IOException ex) {
+            ex.printStackTrace();
+        }
+
+        if (!content.contains(expected)) {
+            System.err.println("FAIL");
+            if (DEBUG) {
+                System.err.println("printing content");
+                System.err.println(content);
+            }
+            throw new RuntimeException("Expected <e4> to represent 'ä' but not found!");
+        }
+        System.err.println("SUCCESS");
+    }
+
+    public int print(Graphics g, PageFormat pf, int pg) {
+       if (pg > 0) return NO_SUCH_PAGE;
+       g.drawString("ä", 100, 100);
+       return PAGE_EXISTS;
+   }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/AbstractButton/AnimatedIcon/AnimatedIcon.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,76 @@
+/*
+ * 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.
+ *
+ * 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.
+ */
+
+import java.awt.image.BufferedImage;
+import java.awt.image.ImageObserver;
+
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.SwingUtilities;
+
+import static java.awt.image.BufferedImage.TYPE_INT_RGB;
+
+/**
+ * @test
+ * @bug 6573305
+ * @summary Animated icon should animate when the JButton is pressed.
+ * @author Sergey Bylokhov
+ */
+public final class AnimatedIcon {
+
+    public static void main(final String[] args) throws Exception {
+        SwingUtilities.invokeAndWait(() -> {
+            final BufferedImage bi = new BufferedImage(1, 1, TYPE_INT_RGB);
+            final ImageIcon icon = new ImageIcon(bi);
+            final JButton button = new JButton(icon);
+            // Default icon is set => imageUpdate should return true for it
+            isAnimated(bi, button);
+            button.getModel().setPressed(true);
+            button.getModel().setArmed(true);
+            isAnimated(bi, button);
+            button.getModel().setPressed(false);
+            button.getModel().setArmed(false);
+            button.getModel().setSelected(true);
+            isAnimated(bi, button);
+            button.getModel().setSelected(false);
+            button.getModel().setRollover(true);
+            button.setRolloverEnabled(true);
+            isAnimated(bi, button);
+            button.getModel().setSelected(true);
+            isAnimated(bi, button);
+            // Default icon is not set => imageUpdate should return true for
+            // other icons if any
+            button.setIcon(null);
+            button.setPressedIcon(icon);
+            button.getModel().setPressed(true);
+            button.getModel().setArmed(true);
+            isAnimated(bi, button);
+        });
+    }
+
+    private static void isAnimated(BufferedImage bi, JButton button) {
+        if (!button.imageUpdate(bi, ImageObserver.SOMEBITS, 0, 0, 1, 1)) {
+            throw new RuntimeException();
+        }
+    }
+}
--- a/jdk/test/javax/swing/JColorChooser/Test4177735.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/javax/swing/JColorChooser/Test4177735.java	Mon Feb 23 05:01:11 2015 -0800
@@ -38,9 +38,20 @@
     private static final long DELAY = 1000L;
 
     public static void main(String[] args) throws Exception {
+        int hsvIndex = 0;
+        int panelsLength;
+        int finalIndex;
         JColorChooser chooser = new JColorChooser();
         AbstractColorChooserPanel[] panels = chooser.getChooserPanels();
-        chooser.setChooserPanels(new AbstractColorChooserPanel[] { panels[1] });
+        panelsLength = panels.length;
+
+        for(int i = 0; i < panelsLength; i++) {
+            if(panels[i].getDisplayName().equals("HSV")) {
+                hsvIndex = i;
+            }
+        }
+        finalIndex = Math.min(hsvIndex, panelsLength - 1);
+        chooser.setChooserPanels(new AbstractColorChooserPanel[] { panels[finalIndex] });
 
         JDialog dialog = show(chooser);
         pause(DELAY);
--- a/jdk/test/javax/swing/JLayer/6824395/bug6824395.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/javax/swing/JLayer/6824395/bug6824395.java	Mon Feb 23 05:01:11 2015 -0800
@@ -59,7 +59,7 @@
                 editorPaneLayer.setUI(layerUI);
 
                 scrollPane = new JScrollPane(editorPaneLayer);
-
+                scrollPane.setViewportBorder(null);
                 scrollPane.setPreferredSize(new Dimension(200, 250));
                 frame.add(scrollPane);
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JTabbedPane/4209065/bug4209065.html	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,35 @@
+<!--
+ Copyright (c) 1999, 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.
+
+ 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.
+-->
+
+<Html>
+<Body>
+<!--
+<H1>Test</H1>
+<Center>
+<APPLET  code="bug4209065.class" WIDTH = 600 HEIGHT = 400>
+</APPLET>
+</Center>
+-->
+
+</Body>
+</Html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JTabbedPane/4209065/bug4209065.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 1999, 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.
+ *
+ * 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.
+ */
+
+import java.awt.EventQueue;
+import java.lang.reflect.InvocationTargetException;
+
+import javax.swing.JApplet;
+import javax.swing.JLabel;
+import javax.swing.JTabbedPane;
+
+/**
+ * @test
+ * @bug 4209065
+ * @author Georges Saab
+ * @run applet/manual=yesno bug4209065.html
+ */
+public final class bug4209065 extends JApplet {
+
+    @Override
+    public void init() {
+        try {
+            EventQueue.invokeAndWait(this::createTabbedPane);
+        } catch (InterruptedException | InvocationTargetException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    private void createTabbedPane() {
+        JTabbedPane tp = new JTabbedPane();
+        getContentPane().add(tp);
+        String text = "<html><center>If the style of the text on the tabs matches"
+                      + "<br>the descriptions, press <em><b>PASS</b></em></center></html>";
+        tp.addTab("<html><center><font size=+3>big</font></center></html>", new JLabel(text));
+        tp.addTab("<html><center><font color=red>red</font></center></html>", new JLabel(text));
+        tp.addTab("<html><center><em><b>Bold Italic!</b></em></center></html>", new JLabel(text));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/SwingUtilities/TestBadBreak/TestBadBreak.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,92 @@
+/*
+ * 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.
+ *
+ * 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.
+ */
+
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.Robot;
+import java.awt.image.BufferedImage;
+import java.io.File;
+
+import javax.imageio.ImageIO;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.SwingUtilities;
+
+import static java.awt.image.BufferedImage.TYPE_INT_ARGB;
+
+/**
+ * @test
+ * @bug 8015085
+ * @summary Shortening via " ... " is broken for Strings containing a combining
+ *          diaeresis.
+ * @author Sergey Bylokhov
+ */
+public class TestBadBreak {
+
+    static JFrame frame;
+    static Robot robot;
+    static final String withCombiningDiaeresis =    "123p://.aaaaaaaaaaaaaaaaaaaaaa.123/a\u0308" ;
+    static final String withoutCombiningDiaeresis = "123p://.aaaaaaaaaaaaaaaaaaaaaa.123/\u00E4" ;
+
+    public static void main(final String[] args) throws Exception {
+        robot = new Robot();
+        final BufferedImage bi1 = new BufferedImage(200, 90, TYPE_INT_ARGB);
+        final BufferedImage bi2 = new BufferedImage(200, 90, TYPE_INT_ARGB);
+        test(withCombiningDiaeresis, bi1);
+        test(withoutCombiningDiaeresis, bi2);
+        for (int x = 0; x < bi1.getWidth(); ++x) {
+            for (int y = 0; y < bi1.getHeight(); ++y) {
+                if (bi1.getRGB(x, y) != bi2.getRGB(x, y)) {
+                    ImageIO.write(bi1, "png", new File("image1.png"));
+                    ImageIO.write(bi2, "png", new File("image2.png"));
+                    throw new RuntimeException("Wrong color");
+                }
+            }
+        }
+    }
+
+    private static void test(final String text, final BufferedImage i1)
+            throws Exception {
+        SwingUtilities.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                frame = new JFrame();
+                final JLabel label = new JLabel(text) {
+                    @Override
+                    protected void paintComponent(Graphics g) {
+                        Graphics2D g2d = i1.createGraphics();
+                        super.paintComponent(g2d);
+                        g2d.dispose();
+                    }
+                };
+                frame.getContentPane().add(label);
+                frame.setBounds(200, 200, 200, 90);
+            }
+        });
+        robot.waitForIdle();
+        SwingUtilities.invokeAndWait(() -> frame.setVisible(true));
+        robot.waitForIdle();
+        SwingUtilities.invokeAndWait(frame::dispose);
+        robot.waitForIdle();
+    }
+}
--- a/jdk/test/lib/testlibrary/jdk/testlibrary/Platform.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/lib/testlibrary/jdk/testlibrary/Platform.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -22,13 +22,20 @@
  */
 
 package jdk.testlibrary;
+import java.util.regex.Pattern;
+import java.io.RandomAccessFile;
+import java.io.FileNotFoundException;
+import java.io.IOException;
 
 public class Platform {
     private static final String osName      = System.getProperty("os.name");
     private static final String dataModel   = System.getProperty("sun.arch.data.model");
     private static final String vmVersion   = System.getProperty("java.vm.version");
+    private static final String javaVersion = System.getProperty("java.version");
     private static final String osArch      = System.getProperty("os.arch");
     private static final String vmName      = System.getProperty("java.vm.name");
+    private static final String userName    = System.getProperty("user.name");
+    private static final String compiler    = System.getProperty("sun.management.compiler");
 
     public static boolean isClient() {
         return vmName.endsWith(" Client VM");
@@ -38,6 +45,23 @@
         return vmName.endsWith(" Server VM");
     }
 
+    public static boolean isGraal() {
+        return vmName.endsWith(" Graal VM");
+    }
+
+    public static boolean isMinimal() {
+        return vmName.endsWith(" Minimal VM");
+    }
+
+    public static boolean isEmbedded() {
+        return vmName.contains("Embedded");
+    }
+
+    public static boolean isTieredSupported() {
+        return compiler.contains("Tiered Compilers");
+    }
+
+
     public static boolean is32bit() {
         return dataModel.equals("32");
     }
@@ -46,6 +70,18 @@
         return dataModel.equals("64");
     }
 
+    public static boolean isAix() {
+        return isOs("aix");
+    }
+
+    public static boolean isLinux() {
+        return isOs("linux");
+    }
+
+    public static boolean isOSX() {
+        return isOs("mac");
+    }
+
     public static boolean isSolaris() {
         return isOs("sunos");
     }
@@ -54,14 +90,6 @@
         return isOs("win");
     }
 
-    public static boolean isOSX() {
-        return isOs("mac");
-    }
-
-    public static boolean isLinux() {
-        return isOs("linux");
-    }
-
     private static boolean isOs(String osname) {
         return osName.toLowerCase().startsWith(osname.toLowerCase());
     }
@@ -71,7 +99,8 @@
     }
 
     public static boolean isDebugBuild() {
-        return vmVersion.toLowerCase().contains("debug");
+        return (vmVersion.toLowerCase().contains("debug") ||
+                javaVersion.toLowerCase().contains("debug"));
     }
 
     public static String getVMVersion() {
@@ -80,33 +109,101 @@
 
     // Returns true for sparc and sparcv9.
     public static boolean isSparc() {
-        return isArch("sparc");
+        return isArch("sparc.*");
     }
 
     public static boolean isARM() {
-        return isArch("arm");
+        return isArch("arm.*");
     }
 
     public static boolean isPPC() {
-        return isArch("ppc");
+        return isArch("ppc.*");
     }
 
     public static boolean isX86() {
-        // On Linux it's 'i386', Windows 'x86'
-        return (isArch("i386") || isArch("x86"));
+        // On Linux it's 'i386', Windows 'x86' without '_64' suffix.
+        return isArch("(i386)|(x86(?!_64))");
     }
 
     public static boolean isX64() {
         // On OSX it's 'x86_64' and on other (Linux, Windows and Solaris) platforms it's 'amd64'
-        return (isArch("amd64") || isArch("x86_64"));
+        return isArch("(amd64)|(x86_64)");
     }
 
-    private static boolean isArch(String archname) {
-        return osArch.toLowerCase().startsWith(archname.toLowerCase());
+    private static boolean isArch(String archnameRE) {
+        return Pattern.compile(archnameRE, Pattern.CASE_INSENSITIVE)
+                .matcher(osArch)
+                .matches();
     }
 
     public static String getOsArch() {
         return osArch;
     }
 
+    /**
+     * Return a boolean for whether we expect to be able to attach
+     * the SA to our own processes on this system.
+     */
+    public static boolean shouldSAAttach()
+                               throws IOException {
+
+        if (isAix()) {
+            return false;   // SA not implemented.
+        } else if (isLinux()) {
+            return canPtraceAttachLinux();
+        } else if (isOSX()) {
+            return canAttachOSX();
+        } else {
+            // Other platforms expected to work:
+            return true;
+        }
+    }
+
+    /**
+     * On Linux, first check the SELinux boolean "deny_ptrace" and return false
+     * as we expect to be denied if that is "1".
+     */
+    public static boolean canPtraceAttachLinux()
+                               throws IOException {
+
+        // SELinux deny_ptrace:
+        try(RandomAccessFile file = new RandomAccessFile("/sys/fs/selinux/booleans/deny_ptrace", "r")) {
+            if (file.readByte() != '0') {
+                return false;
+            }
+        }
+        catch(FileNotFoundException ex) {
+            // Ignored
+        }
+
+        // YAMA enhanced security ptrace_scope:
+        // 0 - a process can PTRACE_ATTACH to any other process running under the same uid
+        // 1 - restricted ptrace: a process must be a children of the inferior or user is root
+        // 2 - only processes with CAP_SYS_PTRACE may use ptrace or user is root
+        // 3 - no attach: no processes may use ptrace with PTRACE_ATTACH
+
+        try(RandomAccessFile file = new RandomAccessFile("/proc/sys/kernel/yama/ptrace_scope", "r")) {
+            byte yama_scope = file.readByte();
+            if (yama_scope == '3') {
+                return false;
+            }
+
+            if (!userName.equals("root") && yama_scope != '0') {
+                return false;
+            }
+        }
+        catch(FileNotFoundException ex) {
+            // Ignored
+        }
+
+        // Otherwise expect to be permitted:
+        return true;
+    }
+
+    /**
+     * On OSX, expect permission to attach only if we are root.
+     */
+    public static boolean canAttachOSX() {
+        return userName.equals("root");
+    }
 }
--- a/jdk/test/lib/testlibrary/jdk/testlibrary/ProcessTools.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/lib/testlibrary/jdk/testlibrary/ProcessTools.java	Mon Feb 23 05:01:11 2015 -0800
@@ -218,19 +218,8 @@
      * @return Process id
      */
     public static int getProcessId() throws Exception {
-
-        // Get the current process id using a reflection hack
         RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean();
-        Field jvm = runtime.getClass().getDeclaredField("jvm");
-
-        jvm.setAccessible(true);
-        VMManagement mgmt = (sun.management.VMManagement) jvm.get(runtime);
-
-        Method pid_method = mgmt.getClass().getDeclaredMethod("getProcessId");
-
-        pid_method.setAccessible(true);
-
-        int pid = (Integer) pid_method.invoke(mgmt);
+        int pid = Integer.parseInt(runtime.getName().split("@")[0]);
 
         return pid;
     }
--- a/jdk/test/lib/testlibrary/jdk/testlibrary/SimpleSSLContext.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/lib/testlibrary/jdk/testlibrary/SimpleSSLContext.java	Mon Feb 23 05:01:11 2015 -0800
@@ -56,7 +56,7 @@
      */
     public SimpleSSLContext () throws IOException {
         String paths = System.getProperty("test.src.path");
-        StringTokenizer st = new StringTokenizer(paths,":");
+        StringTokenizer st = new StringTokenizer(paths, File.pathSeparator);
         boolean securityExceptions = false;
         while (st.hasMoreTokens()) {
             String path = st.nextToken();
--- a/jdk/test/sun/management/jmxremote/bootstrap/CustomLauncherTest.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/sun/management/jmxremote/bootstrap/CustomLauncherTest.java	Mon Feb 23 05:01:11 2015 -0800
@@ -145,13 +145,7 @@
 
             ProcessBuilder client = ProcessTools.createJavaProcessBuilder(
                 "-cp",
-                TEST_CLASSPATH +
-                    File.pathSeparator +
-                    TEST_JDK +
-                    File.separator +
-                    "lib" +
-                    File.separator +
-                    "tools.jar",
+                TEST_CLASSPATH,
                 "TestManager",
                 String.valueOf(serverPrc.getPid()),
                 port.get(),
--- a/jdk/test/sun/management/jmxremote/bootstrap/LocalManagementTest.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/sun/management/jmxremote/bootstrap/LocalManagementTest.java	Mon Feb 23 05:01:11 2015 -0800
@@ -132,13 +132,7 @@
 
             ProcessBuilder client = ProcessTools.createJavaProcessBuilder(
                 "-cp",
-                TEST_CLASSPATH +
-                    File.pathSeparator +
-                    TEST_JDK +
-                    File.separator +
-                    "lib" +
-                    File.separator +
-                    "tools.jar",
+                TEST_CLASSPATH,
                 "TestManager",
                 String.valueOf(serverPrc.getPid()),
                 port.get(),
--- a/jdk/test/sun/management/jmxremote/startstop/JMXStartStopTest.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/sun/management/jmxremote/startstop/JMXStartStopTest.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -23,7 +23,9 @@
 
 import java.io.File;
 import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
+import java.net.BindException;
 import java.net.ConnectException;
 import java.net.ServerSocket;
 import java.rmi.RemoteException;
@@ -31,15 +33,15 @@
 import java.rmi.registry.Registry;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Objects;
+import java.util.Random;
 import java.util.Set;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
 import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicInteger;
 import java.util.function.Consumer;
+import java.util.stream.Collectors;
 
 import javax.management.*;
 import javax.management.remote.*;
@@ -47,6 +49,8 @@
 
 import jdk.testlibrary.ProcessTools;
 import jdk.testlibrary.JDKToolLauncher;
+import sun.management.Agent;
+import sun.management.AgentConfigurationError;
 
 /**
  * @test
@@ -54,65 +58,55 @@
  * @library /lib/testlibrary
  * @build jdk.testlibrary.* JMXStartStopTest JMXStartStopDoSomething
  * @run main/othervm/timeout=600 -XX:+UsePerfData JMXStartStopTest
- * @summary Makes sure that enabling/disabling the management agent through
- *          JCMD achieves the desired results
+ * @summary Makes sure that enabling/disabling the management agent through JCMD
+ *          achieves the desired results
  */
 public class JMXStartStopTest {
+
     private static final String TEST_SRC = System.getProperty("test.src");
 
     private static final boolean verbose = false;
 
     /**
-     * Dynamically allocates two distinct ports using {@linkplain java.net.ServerSocket}
-     * It keeps each of those ports blocked until it is first accessed by its getter
+     * Dynamically allocates distinct ports from the ephemeral range 49152-65535
      */
     private static class PortAllocator {
-        private final int port1, port2;
-        private final ServerSocket ss1, ss2;
-        PortAllocator() {
-            try {
-                ss1 = new ServerSocket(0);
-                ss2 = new ServerSocket(0);
-                port1 = ss1.getLocalPort();
-                port2 = ss2.getLocalPort();
-            } catch (IOException e) {
-                throw new Error("Error while obtaining free ports", e);
-            }
-        }
+
+        private final static int LOWER_BOUND = 49152;
+        private final static int UPPER_BOUND = 65535;
+
+        private final static Random RND = new Random(System.currentTimeMillis());
 
-        public int getPort1() {
-            if (!ss1.isClosed()) {
-                try {
-                    ss1.close();
-                } catch (IOException e) {
-                    // just ignore
+        private static int[] allocatePorts(final int numPorts) {
+            int[] ports = new int[numPorts];
+            for (int i = 0; i < numPorts; i++) {
+                int port = -1;
+                while (port == -1) {
+                    port = RND.nextInt(UPPER_BOUND - LOWER_BOUND + 1) + LOWER_BOUND;
+                    for (int j = 0; j < i; j++) {
+                        if (ports[j] == port) {
+                            port = -1;
+                            break;
+                        }
+                    }
                 }
+                System.err.println("*** port = " + port);
+                ports[i] = port;
             }
-            return port1;
-        }
-
-        public int getPort2() {
-            if (!ss2.isClosed()) {
-                try {
-                    ss2.close();
-                } catch (IOException e) {
-                    // just ignore
-                }
-            }
-            return port2;
+            return ports;
         }
     }
 
-    private static void dbg_print(String msg){
+    private static void dbg_print(String msg) {
         if (verbose) {
-            System.out.println("DBG: " +msg);
+            System.out.println("DBG: " + msg);
         }
     }
 
     private static int listMBeans(MBeanServerConnection server,
-                                  ObjectName pattern,
-                                  QueryExp query)
-    throws Exception {
+            ObjectName pattern,
+            QueryExp query)
+            throws Exception {
 
         Set<ObjectName> names = server.queryNames(pattern,query);
         for (ObjectName name : names) {
@@ -131,9 +125,8 @@
         return names.size();
     }
 
-
     private static void testConnectLocal(long pid)
-    throws Exception {
+            throws Exception {
 
         String jmxUrlStr = null;
 
@@ -208,12 +201,12 @@
 
         String jmxUrlStr = (rmiPort != 0) ?
             String.format(
-                "service:jmx:rmi://localhost:%d/jndi/rmi://localhost:%d/jmxrmi",
-                rmiPort,
+                        "service:jmx:rmi://localhost:%d/jndi/rmi://localhost:%d/jmxrmi",
+                        rmiPort,
                 port) :
             String.format(
-                "service:jmx:rmi:///jndi/rmi://localhost:%d/jmxrmi",
-                port);
+                        "service:jmx:rmi:///jndi/rmi://localhost:%d/jmxrmi",
+                        port);
 
         JMXServiceURL url = new JMXServiceURL(jmxUrlStr);
 
@@ -292,7 +285,21 @@
             if (m.getName().startsWith("test_")) {
                 long t1 = System.currentTimeMillis();
                 try {
-                    m.invoke(null);
+                    boolean retry = false;
+                    do {
+                        try {
+                            m.invoke(null);
+                            retry = false;
+                        } catch (InvocationTargetException e) {
+                            if (e.getCause() instanceof BindException ||
+                                e.getCause() instanceof java.rmi.ConnectException) {
+                                System.out.println("Failed to allocate ports. Retrying ...");
+                                retry = true;
+                            } else {
+                                throw e;
+                            }
+                        }
+                    } while (retry);
                     System.out.println("=== PASSED");
                 } catch (Throwable e) {
                     failures.add(new Failure(e, m.getName() + " failed"));
@@ -326,13 +333,23 @@
         public synchronized void start() throws InterruptedException, IOException, TimeoutException {
             if (started.compareAndSet(false, true)) {
                 try {
+                    AtomicBoolean error = new AtomicBoolean(false);
                     p = ProcessTools.startProcess(
-                        "JMXStartStopDoSomething",
-                        pb,
-                        (line) -> line.equals("main enter"),
-                        5,
-                        TimeUnit.SECONDS
+                            "JMXStartStopDoSomething{" + name + "}",
+                            pb,
+                            (line) -> {
+                                boolean ok = line.equals("main enter");
+                                error.set(line.contains("BindException"));
+
+                                return ok || error.get();
+                            },
+                            5,
+                            TimeUnit.SECONDS
                     );
+                    if (error.get()) {
+                        throw new BindException("Starting process failed due to " +
+                                                "the requested port not being available");
+                    }
                     pid = p.getPid();
                 } catch (TimeoutException e) {
                     p.destroy();
@@ -347,7 +364,7 @@
         }
 
         public synchronized void stop()
-            throws IOException, InterruptedException {
+                throws IOException, InterruptedException {
             if (started.compareAndSet(true, false)) {
                 p.getOutputStream().write(0);
                 p.getOutputStream().flush();
@@ -374,16 +391,16 @@
      * @throws TimeoutException
      */
     private static Something doSomething(String name, String ... args)
-    throws Exception {
+            throws Exception {
         List<String> pbArgs = new ArrayList<>(Arrays.asList(
-            "-cp",
-            System.getProperty("test.class.path")
+                "-cp",
+                System.getProperty("test.class.path")
         ));
         pbArgs.addAll(Arrays.asList(args));
         pbArgs.add("JMXStartStopDoSomething");
 
         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
-            pbArgs.toArray(new String[pbArgs.size()])
+                pbArgs.toArray(new String[pbArgs.size()])
         );
         Something s = new Something(pb, name);
         s.start();
@@ -399,7 +416,7 @@
      */
     private static void jcmd(String ... command) throws IOException, InterruptedException {
         if (command.length == 0) {
-            jcmd(null, (Consumer<String>)null);
+            jcmd(null, c->{});
         } else {
             jcmd(null, command);
         }
@@ -408,7 +425,7 @@
     /**
      * Run the "jcmd" command
      *
-     * @param c {@linkplain Consumer} instance; may be null
+     * @param c {@linkplain Consumer} instance
      * @param command Command with parameters; space separated string
      * @throws IOException
      * @throws InterruptedException
@@ -419,8 +436,9 @@
 
     /**
      * Run the "jcmd" command
+     *
      * @param target The target application name (or PID)
-     * @param c {@linkplain Consumer} instance; may be null
+     * @param c {@linkplain Consumer} instance
      * @param command Command with parameters; space separated string
      * @throws IOException
      * @throws InterruptedException
@@ -430,21 +448,37 @@
 
         JDKToolLauncher l = JDKToolLauncher.createUsingTestJDK("jcmd");
         l.addToolArg(target);
-        for(String cmd : command) {
+        for (String cmd : command) {
             l.addToolArg(cmd);
         }
+
+        AtomicBoolean portUnavailable = new AtomicBoolean(false);
         Process p = ProcessTools.startProcess(
             "jcmd",
             new ProcessBuilder(l.getCommand()),
-            c
+            line -> {
+                if (line.contains("BindException") ||
+                    line.contains(Agent.getText(AgentConfigurationError.CONNECTOR_SERVER_IO_ERROR))) {
+                    portUnavailable.set(true);
+                } else {
+                    c.accept(line);
+                }
+            }
         );
 
         p.waitFor();
         dbg_print("[jcmd] --------");
+        if (portUnavailable.get()) {
+            String cmd = Arrays.asList(l.getCommand()).stream()
+                    .collect(
+                            Collectors.joining(" ", "", ": Unable to bind address")
+                    );
+            throw new BindException(cmd);
+        }
     }
 
     private static final String CMD_STOP = "ManagementAgent.stop";
-    private static final String CMD_START= "ManagementAgent.start";
+    private static final String CMD_START = "ManagementAgent.start";
     private static final String CMD_START_LOCAL = "ManagementAgent.start_local";
 
     static void test_01() throws Exception {
@@ -452,22 +486,22 @@
         // restart on other port
 
         System.out.println("**** Test one ****");
-        PortAllocator pa = new PortAllocator();
+        int ports[] = PortAllocator.allocatePorts(2);
 
         Something s = doSomething(
-            "test_01",
-            "-Dcom.sun.management.jmxremote.port=" + pa.getPort1(),
-            "-Dcom.sun.management.jmxremote.authenticate=false",
-            "-Dcom.sun.management.jmxremote.ssl=false");
+                "test_01",
+                "-Dcom.sun.management.jmxremote.port=" + ports[0],
+                "-Dcom.sun.management.jmxremote.authenticate=false",
+                "-Dcom.sun.management.jmxremote.ssl=false");
 
         try {
-            testConnect(pa.getPort1());
+            testConnect(ports[0]);
 
             jcmd(CMD_STOP);
-            testNoConnect(pa.getPort1());
+            testNoConnect(ports[0]);
 
-            jcmd(CMD_START, "jmxremote.port=" + pa.getPort2());
-            testConnect(pa.getPort2());
+            jcmd(CMD_START, "jmxremote.port=" + ports[1]);
+            testConnect(ports[1]);
         } finally {
             s.stop();
         }
@@ -479,15 +513,15 @@
 
         System.out.println("**** Test two ****");
 
+        int[] ports = PortAllocator.allocatePorts(1);
         Something s = doSomething("test_02");
-        PortAllocator pa = new PortAllocator();
         try {
             jcmd(CMD_START,
-                "jmxremote.port=" + pa.getPort1(),
-                "jmxremote.authenticate=false",
-                "jmxremote.ssl=false");
+                    "jmxremote.port=" + ports[0],
+                    "jmxremote.authenticate=false",
+                    "jmxremote.ssl=false");
 
-            testConnect(pa.getPort1());
+            testConnect(ports[0]);
         } finally {
 //            debugPortUsage(pa);
             s.stop();
@@ -500,25 +534,25 @@
 
         System.out.println("**** Test three ****");
 
+        int[] ports = PortAllocator.allocatePorts(2);
         Something s = doSomething("test_03");
-        PortAllocator pa = new PortAllocator();
         try {
             jcmd(CMD_START,
-                "jmxremote.port=" + pa.getPort1(),
-                "jmxremote.authenticate=false",
-                "jmxremote.ssl=false");
+                    "jmxremote.port=" + ports[0],
+                    "jmxremote.authenticate=false",
+                    "jmxremote.ssl=false");
 
             // Second agent shouldn't start
             jcmd(CMD_START,
-                "jmxremote.port=" + pa.getPort2(),
-                "jmxremote.authenticate=false",
-                "jmxremote.ssl=false");
+                    "jmxremote.port=" + ports[1],
+                    "jmxremote.authenticate=false",
+                    "jmxremote.ssl=false");
 
             // First agent should connect
-            testConnect(pa.getPort1());
+            testConnect(ports[0]);
 
             // Second agent should not connect
-            testNoConnect(pa.getPort2());
+            testNoConnect(ports[1]);
         } finally {
             s.stop();
         }
@@ -530,16 +564,16 @@
 
         System.out.println("**** Test four ****");
 
+        int[] ports = PortAllocator.allocatePorts(2);
         Something s = doSomething("test_04");
-        PortAllocator pa = new PortAllocator();
         try {
             jcmd(CMD_START,
-                 "jmxremote.port=" + pa.getPort1(),
-                 "jmxremote.rmi.port=" + pa.getPort2(),
-                 "jmxremote.authenticate=false",
-                 "jmxremote.ssl=false");
+                    "jmxremote.port=" + ports[0],
+                    "jmxremote.rmi.port=" + ports[1],
+                    "jmxremote.authenticate=false",
+                    "jmxremote.ssl=false");
 
-            testConnect(pa.getPort1(), pa.getPort2());
+            testConnect(ports[0], ports[1]);
         } finally {
             s.stop();
         }
@@ -550,13 +584,12 @@
         // but should leave remote server disabled
 
         System.out.println("**** Test five ****");
-
+        int[] ports = PortAllocator.allocatePorts(1);
         Something s = doSomething("test_05");
-        PortAllocator pa = new PortAllocator();
         try {
             jcmd(CMD_START_LOCAL);
 
-            testNoConnect(pa.getPort1());
+            testNoConnect(ports[0]);
             testConnectLocal(s.getPid());
         } finally {
             s.stop();
@@ -566,94 +599,36 @@
     static void test_06() throws Exception {
         // Run an app without JMX enabled
         // start JMX by jcmd on one port, specify rmi port explicitly
-        // attempt to start it again
-        // 1) with the same port
-        // 2) with other port
-        // 3) attempt to stop it twice
+        // attempt to start it again with the same port
         // Check for valid messages in the output
 
         System.out.println("**** Test six ****");
 
+        int[] ports = PortAllocator.allocatePorts(2);
         Something s = doSomething("test_06");
-        PortAllocator pa = new PortAllocator();
         try {
             jcmd(CMD_START,
-                 "jmxremote.port=" + pa.getPort1(),
-                 "jmxremote.authenticate=false",
-                 "jmxremote.ssl=false");
-
-            testConnect(pa.getPort1(), pa.getPort2());
+                    "jmxremote.port=" + ports[0],
+                    "jmxremote.authenticate=false",
+                    "jmxremote.ssl=false");
 
-            final AtomicInteger checks = new AtomicInteger();
-            jcmd(
-                line -> {
-                    if (line.contains("java.lang.RuntimeException: Invalid agent state")) {
-                        checks.getAndUpdate((op) -> op | 1);
-                    }
-                },
-                CMD_START,
-                 "jmxremote.port=" + pa.getPort1(),
-                 "jmxremote.authenticate=false",
-                 "jmxremote.ssl=false");
-
-            jcmd(
-                line -> {
-                    if (line.contains("java.lang.RuntimeException: Invalid agent state")) {
-                        checks.getAndUpdate((op) -> op | 2);
-                    }
-                },
-                CMD_START,
-                "jmxremote.port=" + pa.getPort2(),
-                "jmxremote.authenticate=false",
-                "jmxremote.ssl=false");
-
-            jcmd(CMD_STOP);
-            jcmd(CMD_STOP);
+            testConnect(ports[0], ports[1]);
 
-            int busyPort;
-            try (ServerSocket ss = new ServerSocket(0))
-            {
-                busyPort = ss.getLocalPort();
-                int retryCntr = 1;
-                do {
-                    final boolean[] retry = new boolean[]{false};
-                    jcmd(
-                        line -> {
-                            boolean match = line.contains("Port already in use: " +
-                                                          busyPort);
-                            System.out.println("[match] " + line + " => "  + match);
-                            if (match) {
-                                checks.getAndUpdate((op) -> op | 4);
-                                retry[0] = false;
-                            } else if (line.contains("Exception thrown by the agent")) {
-                                retry[0] = true;
-                            }
-                        },
-                        CMD_START,
-                        "jmxremote.port=" + ss.getLocalPort(),
-                        "jmxremote.rmi.port=" + pa.getPort2(),
-                        "jmxremote.authenticate=false",
-                        "jmxremote.ssl=false"
-                    );
-                    if (!retry[0]) {
-                        break;
-                    }
-                    System.out.println("Attempt " + retryCntr + " >>>");
-                    System.out.println("Unexpected reply from the agent. Retrying in 500ms ...");
-                    Thread.sleep(500);
-                } while (retryCntr++ < 10);
-            }
-            if ((checks.get() & 1) == 0) {
-                throw new Exception("Starting agent on port " + pa.getPort1() + " should " +
-                                    "report an invalid agent state");
-            }
-            if ((checks.get() & 2) == 0) {
-                throw new Exception("Starting agent on poprt " + pa.getPort2() + " should " +
-                                    "report an invalid agent state");
-            }
-            if ((checks.get() & 4) == 0) {
-                throw new Exception("Starting agent on port " + busyPort + " should " +
-                                    "report port in use");
+            final AtomicBoolean checks = new AtomicBoolean(false);
+            jcmd(
+                    line -> {
+                        if (line.contains("java.lang.RuntimeException: Invalid agent state")) {
+                            checks.set(true);
+                        }
+                    },
+                    CMD_START,
+                    "jmxremote.port=" + ports[0],
+                    "jmxremote.authenticate=false",
+                    "jmxremote.ssl=false");
+
+            if (!checks.get()) {
+                throw new Exception("Starting agent on port " + ports[0] + " should "
+                        + "report an invalid agent state");
             }
         } finally {
             s.stop();
@@ -661,68 +636,188 @@
     }
 
     static void test_07() throws Exception {
-        // Run an app without JMX enabled, but with some properties set
-        // in command line.
-        // make sure these properties overridden corectly
+        // Run an app without JMX enabled
+        // start JMX by jcmd on one port, specify rmi port explicitly
+        // attempt to start it again with other port
+        // Check for valid messages in the output
 
         System.out.println("**** Test seven ****");
 
-        Something s = doSomething(
-            "test_07",
-            "-Dcom.sun.management.jmxremote.authenticate=false",
-            "-Dcom.sun.management.jmxremote.ssl=true");
-        PortAllocator pa = new PortAllocator();
-
+        int[] ports = PortAllocator.allocatePorts(2);
+        Something s = doSomething("test_07");
         try {
-            testNoConnect(pa.getPort1());
+            jcmd(CMD_START,
+                    "jmxremote.port=" + ports[0],
+                    "jmxremote.authenticate=false",
+                    "jmxremote.ssl=false");
+
+            testConnect(ports[0], ports[1]);
+
+            final AtomicBoolean checks = new AtomicBoolean(false);
+
             jcmd(
-                CMD_START,
-                "jmxremote.port=" + pa.getPort2(),
-                "jmxremote.authenticate=false",
-                "jmxremote.ssl=false"
-            );
-            testConnect(pa.getPort2());
+                    line -> {
+                        if (line.contains("java.lang.RuntimeException: Invalid agent state")) {
+                            checks.set(true);
+                        }
+                    },
+                    CMD_START,
+                    "jmxremote.port=" + ports[1],
+                    "jmxremote.authenticate=false",
+                    "jmxremote.ssl=false");
+
+            if (!checks.get()) {
+                throw new Exception("Starting agent on poprt " + ports[1] + " should "
+                        + "report an invalid agent state");
+            }
         } finally {
             s.stop();
         }
     }
 
     static void test_08() throws Exception {
-        // Run an app with JMX enabled and with some properties set
-        // in command line.
-        // stop JMX agent and then start it again with different property values
-        // make sure these properties overridden corectly
+        // Run an app without JMX enabled
+        // start JMX by jcmd on one port, specify rmi port explicitly
+        // attempt to stop it twice
+        // Check for valid messages in the output
 
         System.out.println("**** Test eight ****");
-        PortAllocator pa = new PortAllocator();
 
-        Something s = doSomething(
-            "test_08",
-            "-Dcom.sun.management.jmxremote.port=" + pa.getPort1(),
-            "-Dcom.sun.management.jmxremote.authenticate=false",
-            "-Dcom.sun.management.jmxremote.ssl=true");
+        int[] ports = PortAllocator.allocatePorts(2);
+        Something s = doSomething("test_08");
+        try {
+            jcmd(CMD_START,
+                    "jmxremote.port=" + ports[0],
+                    "jmxremote.authenticate=false",
+                    "jmxremote.ssl=false");
 
-        try {
-            testNoConnect(pa.getPort1());
+            testConnect(ports[0], ports[1]);
 
             jcmd(CMD_STOP);
-
-            testNoConnect(pa.getPort1());
-
-            jcmd(
-                CMD_START,
-                "jmxremote.port=" + pa.getPort2(),
-                "jmxremote.authenticate=false",
-                "jmxremote.ssl=false"
-            );
-
-            testConnect(pa.getPort2());
+            jcmd(CMD_STOP);
         } finally {
             s.stop();
         }
     }
 
     static void test_09() throws Exception {
+        // Run an app without JMX enabled
+        // attempt to start JMX using a non-available port
+        // Check for valid messages in the output
+
+        System.out.println("**** Test nine ****");
+
+        Something s = doSomething("test_09");
+
+        try (ServerSocket ss = new ServerSocket(0)) {
+            int localPort = ss.getLocalPort();
+            int[] ports;
+            do {
+                ports = PortAllocator.allocatePorts(1);
+            } while (localPort == ports[0]);
+
+            final AtomicBoolean checks = new AtomicBoolean(false);
+
+            int retryCntr = 1;
+            do {
+                final AtomicBoolean retry = new AtomicBoolean(false);
+
+                try {
+                    jcmd(
+                        line -> {
+                            if (line.contains(Agent.getText(AgentConfigurationError.AGENT_EXCEPTION))) {
+                                retry.set(true);
+                            }
+                        },
+                        CMD_START,
+                        "jmxremote.port=" + ports[0],
+                        "jmxremote.rmi.port=" + localPort,
+                        "jmxremote.authenticate=false",
+                        "jmxremote.ssl=false"
+                    );
+                } catch (BindException e) {
+                    checks.set(true);
+                }
+                if (!retry.get()) {
+                    break;
+                }
+                System.out.println("Attempt " + retryCntr + " >>>");
+                System.out.println("Unexpected reply from the agent. Retrying in 500ms ...");
+                Thread.sleep(500);
+            } while (retryCntr++ < 10);
+
+            if (!checks.get()) {
+                throw new Exception("Starting agent on port " + ports[0] + " should "
+                        + "report port in use");
+            }
+        } finally {
+            s.stop();
+        }
+
+    }
+
+    static void test_10() throws Exception {
+        // Run an app without JMX enabled, but with some properties set
+        // in command line.
+        // make sure these properties overridden corectly
+
+        System.out.println("**** Test ten ****");
+
+        int[] ports = PortAllocator.allocatePorts(2);
+        Something s = doSomething(
+                "test_10",
+                "-Dcom.sun.management.jmxremote.authenticate=false",
+                "-Dcom.sun.management.jmxremote.ssl=true");
+
+        try {
+            testNoConnect(ports[0]);
+            jcmd(
+                    CMD_START,
+                    "jmxremote.port=" + ports[1],
+                    "jmxremote.authenticate=false",
+                    "jmxremote.ssl=false"
+            );
+            testConnect(ports[1]);
+        } finally {
+            s.stop();
+        }
+    }
+
+    static void test_11() throws Exception {
+        // Run an app with JMX enabled and with some properties set
+        // in command line.
+        // stop JMX agent and then start it again with different property values
+        // make sure these properties overridden corectly
+
+        System.out.println("**** Test eleven ****");
+        int[] ports = PortAllocator.allocatePorts(2);
+        Something s = doSomething(
+                "test_11",
+                "-Dcom.sun.management.jmxremote.port=" + ports[0],
+                "-Dcom.sun.management.jmxremote.authenticate=false",
+                "-Dcom.sun.management.jmxremote.ssl=true");
+
+        try {
+            testNoConnect(ports[0]);
+
+            jcmd(CMD_STOP);
+
+            testNoConnect(ports[0]);
+
+            jcmd(
+                    CMD_START,
+                    "jmxremote.port=" + ports[1],
+                    "jmxremote.authenticate=false",
+                    "jmxremote.ssl=false"
+            );
+
+            testConnect(ports[1]);
+        } finally {
+            s.stop();
+        }
+    }
+
+    static void test_12() throws Exception {
         // Run an app with JMX enabled and with some properties set
         // in command line.
         // stop JMX agent and then start it again with different property values
@@ -730,87 +825,85 @@
         // in command line
         // make sure these properties overridden corectly
 
-        System.out.println("**** Test nine ****");
+        System.out.println("**** Test twelve ****");
 
-        Something s = doSomething("test_09",
-            "-Dcom.sun.management.config.file=" +
-                TEST_SRC + File.separator + "management_cl.properties",
-            "-Dcom.sun.management.jmxremote.authenticate=false"
+        int[] ports = PortAllocator.allocatePorts(2);
+        Something s = doSomething("test_12",
+                "-Dcom.sun.management.config.file="
+                + TEST_SRC + File.separator + "management_cl.properties",
+                "-Dcom.sun.management.jmxremote.authenticate=false"
         );
-        PortAllocator pa = new PortAllocator();
 
         try {
-            testNoConnect(pa.getPort1());
+            testNoConnect(ports[0]);
 
             jcmd(CMD_STOP);
 
-            testNoConnect(pa.getPort1());
+            testNoConnect(ports[0]);
 
             jcmd(CMD_START,
-                "config.file=" + TEST_SRC + File.separator +
-                    "management_jcmd.properties",
-                "jmxremote.authenticate=false",
-                "jmxremote.port=" + pa.getPort2()
+                    "config.file=" + TEST_SRC + File.separator
+                    + "management_jcmd.properties",
+                    "jmxremote.authenticate=false",
+                    "jmxremote.port=" + ports[1]
             );
 
-            testConnect(pa.getPort2());
+            testConnect(ports[1]);
         } finally {
             s.stop();
         }
     }
 
-    static void test_10() throws Exception {
+    static void test_13() throws Exception {
         // Run an app with JMX enabled and with some properties set
         // in command line.
         // stop JMX agent and then start it again with different property values
         // stop JMX agent again and then start it without property value
         // make sure these properties overridden corectly
 
-        System.out.println("**** Test ten ****");
-        PortAllocator pa = new PortAllocator();
-
+        System.out.println("**** Test thirteen ****");
+        int[] ports = PortAllocator.allocatePorts(1);
         Something s = doSomething(
-            "test_10",
-            "-Dcom.sun.management.jmxremote.port=" + pa.getPort1(),
-            "-Dcom.sun.management.jmxremote.authenticate=false",
-            "-Dcom.sun.management.jmxremote.ssl=true");
+                "test_13",
+                "-Dcom.sun.management.jmxremote.port=" + ports[0],
+                "-Dcom.sun.management.jmxremote.authenticate=false",
+                "-Dcom.sun.management.jmxremote.ssl=true");
 
         try {
-            testNoConnect(pa.getPort1());
+            testNoConnect(ports[0]);
 
             jcmd(CMD_STOP);
             jcmd(CMD_START,
-                "jmxremote.ssl=false",
-                "jmxremote.port=" + pa.getPort1()
+                    "jmxremote.ssl=false",
+                    "jmxremote.port=" + ports[0]
             );
-            testConnect(pa.getPort1());
+            testConnect(ports[0]);
 
             jcmd(CMD_STOP);
             jcmd(CMD_START,
-                "jmxremote.port=" + pa.getPort1()
+                    "jmxremote.port=" + ports[0]
             );
 
-            testNoConnect(pa.getPort1());
+            testNoConnect(ports[0]);
         } finally {
             s.stop();
         }
     }
 
-    static void test_11() throws Exception {
+    static void test_14() throws Exception {
         // Run an app with JMX enabled
         // stop remote agent
         // make sure local agent is not affected
 
-        System.out.println("**** Test eleven ****");
-        PortAllocator pa = new PortAllocator();
-
+        System.out.println("**** Test fourteen ****");
+        int[] ports = PortAllocator.allocatePorts(1);
         Something s = doSomething(
-            "test_11",
-            "-Dcom.sun.management.jmxremote.port=" + pa.getPort1(),
-            "-Dcom.sun.management.jmxremote.authenticate=false",
-            "-Dcom.sun.management.jmxremote.ssl=false");
+                "test_14",
+                "-Dcom.sun.management.jmxremote.port=" + ports[0],
+                "-Dcom.sun.management.jmxremote.authenticate=false",
+                "-Dcom.sun.management.jmxremote.ssl=false");
         try {
-            testConnect(pa.getPort1());
+            testConnect(ports[0]);
             jcmd(CMD_STOP);
             testConnectLocal(s.getPid());
         } finally {
@@ -818,17 +911,17 @@
         }
     }
 
-    static void test_12() throws Exception {
+    static void test_15() throws Exception {
         // Run an app with JMX disabled
         // start local agent only
 
-        System.out.println("**** Test twelve ****");
+        System.out.println("**** Test fifteen ****");
 
-        Something s = doSomething("test_12");
-        PortAllocator pa = new PortAllocator();
+        int[] ports = PortAllocator.allocatePorts(1);
+        Something s = doSomething("test_15");
 
         try {
-            testNoConnect(pa.getPort1());
+            testNoConnect(ports[0]);
             jcmd(CMD_START + "_local");
 
             testConnectLocal(s.getPid());
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/misc/VM/GetNanoTimeAdjustment.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,249 @@
+/*
+ * 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.
+ *
+ * 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.
+ */
+import java.util.Objects;
+import sun.misc.VM;
+
+/**
+ * @test
+ * @bug 8068730
+ * @summary tests that VM.getgetNanoTimeAdjustment() works as expected.
+ * @run main GetNanoTimeAdjustment
+ * @author danielfuchs
+ */
+public class GetNanoTimeAdjustment {
+
+    static final int MILLIS_IN_SECOND = 1000;
+    static final int NANOS_IN_MILLI = 1000_000;
+    static final int NANOS_IN_MICRO = 1000;
+    static final int NANOS_IN_SECOND = 1000_000_000;
+
+    static final boolean verbose = true;
+
+    static final class TestAssertException extends RuntimeException {
+        TestAssertException(String msg) { super(msg); }
+    }
+
+    private static void assertEquals(long expected, long received, String msg) {
+        if (expected != received) {
+            throw new TestAssertException("Unexpected result for " + msg
+                    + ".\n\texpected: " + expected
+                    +  "\n\tactual:   " + received);
+        } else if (verbose) {
+            System.out.println("Got expected " + msg + ": " + received);
+        }
+    }
+
+    private static void assertEquals(Object expected, Object received, String msg) {
+        if (!Objects.equals(expected, received)) {
+            throw new TestAssertException("Unexpected result for " + msg
+                    + ".\n\texpected: " + expected
+                    +  "\n\tactual:   " + received);
+        } else if (verbose) {
+            System.out.println("Got expected " + msg + ": " + received);
+        }
+    }
+
+    static final long MAX_OFFSET = 0x0100000000L;
+    static final long MIN_OFFSET = -MAX_OFFSET;
+    static enum Answer {
+        YES,   // isOffLimit = YES:   we must get -1
+        NO,    // isOffLimit = NO:    we must not not get -1
+        MAYBE  // isOffLimit = MAYBE: we might get -1 or a valid adjustment.
+    };
+    static long distance(long one, long two) {
+        return one > two ? Math.subtractExact(one, two)
+                : Math.subtractExact(two, one);
+    }
+
+
+    static Answer isOffLimits(long before, long after, long offset) {
+        long relativeDistanceBefore = distance(before, offset);
+        long relativeDistanceAfter  = distance(after, offset);
+        if (relativeDistanceBefore >= MAX_OFFSET && relativeDistanceAfter >= MAX_OFFSET) {
+            return Answer.YES;
+        }
+        if (relativeDistanceBefore < MAX_OFFSET && relativeDistanceAfter < MAX_OFFSET) {
+            if (relativeDistanceBefore == 0 || relativeDistanceAfter == 0) {
+                return Answer.MAYBE; // unlucky case where
+            }
+            return Answer.NO;
+        }
+        return Answer.MAYBE;
+    }
+
+    static void testWithOffset(String name, long offset) {
+        System.out.println("Testing with offset: " + name);
+        long beforeMillis = System.currentTimeMillis();
+        long adjustment = VM.getNanoTimeAdjustment(offset);
+        long afterMillis = System.currentTimeMillis();
+
+        if (offset >= beforeMillis/MILLIS_IN_SECOND
+                && offset <= afterMillis/MILLIS_IN_SECOND) {
+            if (adjustment == -1) {
+                // it's possible that we have fallen in the unlucky case
+                // where -1 was the genuine result. let's go backward a bit.
+                offset = offset - 10;
+                beforeMillis = System.currentTimeMillis();
+                adjustment = VM.getNanoTimeAdjustment(offset);
+                afterMillis = System.currentTimeMillis();
+                if (adjustment == -1) {
+                    throw new RuntimeException(name + ": VM says " + offset
+                            + " secs is too far off, "
+                            + " when time in seconds is in ["
+                            + beforeMillis/MILLIS_IN_SECOND + ", "
+                            + afterMillis/MILLIS_IN_SECOND
+                            + "]");
+                }
+            }
+        }
+
+        Answer isOffLimit = isOffLimits(beforeMillis/MILLIS_IN_SECOND,
+                afterMillis/MILLIS_IN_SECOND, offset);
+        switch (isOffLimit) {
+            case YES:
+                if (adjustment != -1) {
+                    throw new RuntimeException(name
+                        + ": VM should have returned -1 for "
+                        + offset
+                        + " when time in seconds is in ["
+                        + beforeMillis/MILLIS_IN_SECOND + ", "
+                        + afterMillis/MILLIS_IN_SECOND + "]");
+                }
+                System.out.println("Got expected exception value: " + adjustment);
+                break;
+            case NO:
+                if (adjustment == -1) {
+                    throw new RuntimeException(name
+                            + "VM says "  + offset
+                            + " secs is too far off, "
+                            + " when time in seconds is in ["
+                            + beforeMillis/MILLIS_IN_SECOND + ", "
+                            + afterMillis/MILLIS_IN_SECOND
+                            + "]");
+                }
+                break;
+            case MAYBE:
+                System.out.println("Adjustment: " + adjustment);
+                System.out.println("Can't assert for -1 with offset "
+                        + offset + "(" + name + ")"
+                        + " when time in seconds is in ["
+                        + beforeMillis/MILLIS_IN_SECOND + ", "
+                        + afterMillis/MILLIS_IN_SECOND
+                        + "]");
+                // not conclusive
+        }
+
+        if (isOffLimit == Answer.NO || adjustment != -1) {
+            System.out.println("Validating adjustment: " + adjustment);
+            long expectedMax = distance(offset, beforeMillis/MILLIS_IN_SECOND)
+                      * NANOS_IN_SECOND
+                    + (beforeMillis % MILLIS_IN_SECOND) * NANOS_IN_MILLI
+                    + (afterMillis - beforeMillis + 1) * NANOS_IN_MILLI;
+            long absoluteAdjustment = distance(0, adjustment);
+            if (absoluteAdjustment > expectedMax) {
+                long adjSec = absoluteAdjustment / NANOS_IN_SECOND;
+                long adjMil = (absoluteAdjustment % NANOS_IN_SECOND) / NANOS_IN_MILLI;
+                long adjMic = (absoluteAdjustment % NANOS_IN_MILLI) / NANOS_IN_MICRO;
+                long adjNan = (absoluteAdjustment % NANOS_IN_MICRO);
+                long expSec = expectedMax / NANOS_IN_SECOND;
+                long expMil = (expectedMax % NANOS_IN_SECOND) / NANOS_IN_MILLI;
+                long expMic = (expectedMax % NANOS_IN_MILLI) / NANOS_IN_MICRO;
+                long expNan = (expectedMax % NANOS_IN_MICRO);
+                System.err.println("Excessive adjustment: " + adjSec + "s, "
+                        + adjMil + "ms, " + adjMic + "mics, " + adjNan + "ns");
+                System.err.println("Epected max: " + expSec + "s, "
+                        + expMil + "ms, " + expMic + "mics, " + expNan + "ns");
+
+                throw new RuntimeException(name
+                    + ": Excessive adjustment: " + adjustment
+                    + " when time in millis is in ["
+                    + beforeMillis + ", " + afterMillis
+                    + "] and offset in seconds is " + offset);
+            }
+        }
+
+    }
+
+    static void regular() {
+        System.out.println("*** Testing regular cases ***");
+        final long start = System.currentTimeMillis();
+        long offset = start/1000;
+        long adjustment = VM.getNanoTimeAdjustment(offset);
+        if (start != offset*1000) {
+            if (adjustment == -1) {
+                throw new RuntimeException("VM says " + offset
+                        + " secs is too far off, but time millis is "
+                        + System.currentTimeMillis());
+            }
+        }
+        if (adjustment == -1) {
+            offset = System.currentTimeMillis()/1000 - 1024;
+            adjustment = VM.getNanoTimeAdjustment(offset);
+            if (adjustment == -1) {
+                throw new RuntimeException("VM says " + offset
+                        + " secs is too far off, but time millis is "
+                        + System.currentTimeMillis());
+            }
+        }
+        if (adjustment > (start/1000 - offset + 20)*NANOS_IN_SECOND) {
+            throw new RuntimeException("Excessive adjustment: " + adjustment);
+        }
+        testWithOffset("System.currentTimeMillis()/1000",
+                System.currentTimeMillis()/1000);
+        testWithOffset("System.currentTimeMillis()/1000 - 1024",
+                System.currentTimeMillis()/1000 - 1024);
+        testWithOffset("System.currentTimeMillis()/1000 + 1024",
+                System.currentTimeMillis()/1000 + 1024);
+    }
+
+    static void testLimits() {
+        System.out.println("*** Testing limits ***");
+        testWithOffset("System.currentTimeMillis()/1000 - MAX_OFFSET + 1",
+                System.currentTimeMillis()/1000 - MAX_OFFSET + 1);
+        testWithOffset("System.currentTimeMillis()/1000 + MAX_OFFSET - 1",
+                System.currentTimeMillis()/1000 + MAX_OFFSET - 1);
+        testWithOffset("System.currentTimeMillis()/1000 - MAX_OFFSET",
+                System.currentTimeMillis()/1000 - MAX_OFFSET);
+        testWithOffset("System.currentTimeMillis()/1000 + MAX_OFFSET",
+                System.currentTimeMillis()/1000 + MAX_OFFSET);
+        testWithOffset("System.currentTimeMillis()/1000 - MAX_OFFSET - 1024",
+                System.currentTimeMillis()/1000 - MAX_OFFSET - 1024);
+        testWithOffset("System.currentTimeMillis()/1000 + MAX_OFFSET + 1024",
+                System.currentTimeMillis()/1000 + MAX_OFFSET + 1024);
+        testWithOffset("0", 0);
+        testWithOffset("-1", -1);
+        testWithOffset("Integer.MAX_VALUE + System.currentTimeMillis()/1000",
+                ((long)Integer.MAX_VALUE) + System.currentTimeMillis()/1000);
+        testWithOffset("System.currentTimeMillis()/1000 - Integer.MIN_VALUE",
+                System.currentTimeMillis()/1000 - Integer.MIN_VALUE);
+        testWithOffset("Long.MAX_VALUE", Long.MAX_VALUE);
+        testWithOffset("System.currentTimeMillis()/1000 - Long.MIN_VALUE",
+                (Long.MIN_VALUE + System.currentTimeMillis()/1000)*-1);
+    }
+
+    public static void main(String[] args) throws Exception {
+        regular();
+        testLimits();
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/nio/cs/StreamEncoderOut.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,90 @@
+/*
+ * 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.
+ *
+ * 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.
+ */
+
+/* @test
+   @bug 8030179
+   @summary test if the charset encoder deails with surrogate correctly
+ * @run testng/othervm -esa StreamEncoderOut
+ */
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.nio.charset.Charset;
+import java.util.stream.Stream;
+
+import static java.util.stream.Collectors.joining;
+
+@Test
+public class StreamEncoderOut {
+
+    enum Input {
+        HIGH("\ud834"),
+        LOW("\udd1e"),
+        HIGH_LOW("\ud834\udd1e");
+
+        final String value;
+
+        Input(String value) {
+            this.value = value;
+        }
+
+        @Override
+        public String toString() {
+            return name() + " : \'" + value + "\"";
+        }
+    }
+
+    @DataProvider(name = "CharsetAndString")
+    // [Charset, Input]
+    public static Object[][] makeStreamTestData() {
+        // Cross product of supported charsets and inputs
+        return Charset.availableCharsets().values().stream().
+                filter(Charset::canEncode).
+                flatMap(cs -> Stream.of(Input.values()).map(i -> new Object[]{cs, i})).
+                toArray(Object[][]::new);
+    }
+
+    private static String generate(String s, int n) {
+        return Stream.generate(() -> s).limit(n).collect(joining());
+    }
+
+    static final OutputStream DEV_NULL = new OutputStream() {
+        @Override
+        public void write(byte b[], int off, int len) throws IOException {}
+
+        @Override
+        public void write(int b) throws IOException {}
+    };
+
+    @Test(dataProvider = "CharsetAndString")
+    public void test(Charset cs, Input input) throws IOException {
+        OutputStreamWriter w = new OutputStreamWriter(DEV_NULL, cs);
+        String t = generate(input.value, 8193);
+        for (int i = 0; i < 10; i++) {
+            w.append(t);
+        }
+    }
+}
--- a/jdk/test/sun/security/pkcs11/ec/TestECDSA.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/sun/security/pkcs11/ec/TestECDSA.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 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
@@ -23,7 +23,7 @@
 
 /**
  * @test
- * @bug 6405536
+ * @bug 6405536 8042967
  * @summary basic test of SHA1withECDSA and NONEwithECDSA signing/verifying
  * @author Andreas Sterbenz
  * @library ..
@@ -176,17 +176,28 @@
         verify(provider, "NONEwithECDSA", publicKey, data1SHA, sig, true);
         verify(provider, "NONEwithECDSA", publicKey, data2SHA, sig, false);
 
-        testSigning(provider, privateKey, publicKey);
+        System.out.println("Testing with default signature format: ASN.1");
+        testSigning(provider, privateKey, publicKey, false);
+
+        System.out.println("Testing with IEEE P1363 signature format");
+        testSigning(provider, privateKey, publicKey, true);
     }
 
-    private void testSigning(Provider provider, PrivateKey privateKey,
-            PublicKey publicKey) throws Exception {
+    private void testSigning(Provider provider,
+                             PrivateKey privateKey,
+                             PublicKey publicKey,
+                             boolean p1363Format) throws Exception {
         byte[] data = new byte[2048];
         new Random().nextBytes(data);
 
         // sign random data using SHA1withECDSA and verify using
         // SHA1withECDSA and NONEwithECDSA
-        Signature s = Signature.getInstance("SHA1withECDSA", provider);
+        Signature s;
+        if (p1363Format) {
+            s = Signature.getInstance("SHA1withECDSAinP1363Format", provider);
+        } else {
+            s = Signature.getInstance("SHA1withECDSA", provider);
+        }
         s.initSign(privateKey);
         s.update(data);
         byte[] s1 = s.sign();
@@ -197,7 +208,11 @@
             throw new Exception("Sign/verify 1 failed");
         }
 
-        s = Signature.getInstance("NONEwithECDSA", provider);
+        if (p1363Format) {
+            s = Signature.getInstance("NONEwithECDSAinP1363Format", provider);
+        } else {
+            s = Signature.getInstance("NONEwithECDSA", provider);
+        }
         MessageDigest md = MessageDigest.getInstance("SHA-1");
         byte[] digest = md.digest(data);
         s.initVerify(publicKey);
@@ -218,7 +233,11 @@
             throw new Exception("Sign/verify 3 failed");
         }
 
-        s = Signature.getInstance("SHA1withECDSA", provider);
+        if (p1363Format) {
+            s = Signature.getInstance("SHA1withECDSAinP1363Format", provider);
+        } else {
+            s = Signature.getInstance("SHA1withECDSA", provider);
+        }
         s.initVerify(publicKey);
         s.update(data);
         if (!s.verify(s2)) {
--- a/jdk/test/sun/security/pkcs11/rsa/TestKeyPairGenerator.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/sun/security/pkcs11/rsa/TestKeyPairGenerator.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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,6 +27,7 @@
  * @summary Verify that the RSA KeyPairGenerator works
  * @author Andreas Sterbenz
  * @library ..
+ * @run main/othervm TestKeyPairGenerator
  */
 
 import java.io.*;
--- a/jdk/test/sun/security/provider/DSA/TestDSA2.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/sun/security/provider/DSA/TestDSA2.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -22,9 +22,10 @@
  */
 /*
  * @test
- * @bug 7044060
+ * @bug 7044060 8042967
  * @run main/othervm/timeout=250 TestDSA2
- * @summary verify that DSA signature works using SHA and SHA-224 and SHA-256 digests.
+ * @summary verify that DSA signature works using SHA and SHA-224 and
+ *          SHA-256 digests.
  */
 
 
@@ -40,7 +41,14 @@
     private static final String PROV = "SUN";
 
     private static final String[] SIG_ALGOS = {
-        "SHA1withDSA", "SHA224withDSA", "SHA256withDSA"
+        "NONEwithDSA",
+        "SHA1withDSA",
+        "SHA224withDSA",
+        "SHA256withDSA",
+        "NONEwithDSAinP1363Format",
+        "SHA1withDSAinP1363Format",
+        "SHA224withDSAinP1363Format",
+        "SHA256withDSAinP1363Format"
     };
 
     private static final int[] KEYSIZES = {
@@ -48,15 +56,20 @@
     };
 
     public static void main(String[] args) throws Exception {
-        boolean[] expectedToPass = { true, true, true };
+        boolean[] expectedToPass = { true, true, true, true,
+                                     true, true, true, true };
         test(1024, expectedToPass);
-        boolean[] expectedToPass2 = { true, true, true };
+        boolean[] expectedToPass2 = { true, true, true, true,
+                                      true, true, true, true };
         test(2048, expectedToPass2);
     }
 
     private static void test(int keySize, boolean[] testStatus)
-        throws Exception {
-        byte[] data = "1234567890".getBytes();
+            throws Exception {
+        // Raw DSA requires the data to be exactly 20 bytes long. Use a
+        // 20-byte array for these tests so that the NONEwithDSA* algorithms
+        // don't complain.
+        byte[] data = "12345678901234567890".getBytes();
         System.out.println("Test against key size: " + keySize);
 
         KeyPairGenerator keyGen = KeyPairGenerator.getInstance("DSA", PROV);
--- a/jdk/test/sun/security/util/HostnameMatcher/TestHostnameChecker.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/sun/security/util/HostnameMatcher/TestHostnameChecker.java	Mon Feb 23 05:01:11 2015 -0800
@@ -187,6 +187,9 @@
         in = new FileInputStream(new File(PATH, "cert4.crt"));
         X509Certificate cert4 = (X509Certificate)cf.generateCertificate(in);
         in.close();
+        in = new FileInputStream(new File(PATH, "cert5.crt"));
+        X509Certificate cert5 = (X509Certificate)cf.generateCertificate(in);
+        in.close();
 
         HostnameChecker checker = HostnameChecker.getInstance(
                                         HostnameChecker.TYPE_TLS);
@@ -202,6 +205,9 @@
         check(checker, "5.6.7.8", cert3, true);
         check(checker, "foo.bar.com", cert4, true);
         check(checker, "altfoo.bar.com", cert4, true);
+        check(checker, "2001:db8:3c4d:15::1a2f:1a2b", cert5, true);
+        check(checker, "2001:0db8:3c4d:0015:0000:0000:1a2f:1a2b", cert5, true);
+        check(checker, "2002:db8:3c4d:15::1a2f:1a2b", cert5, false);
 
         checker = HostnameChecker.getInstance(
                                 HostnameChecker.TYPE_LDAP);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/security/util/HostnameMatcher/cert5.crt	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,24 @@
+-----BEGIN CERTIFICATE-----
+MIIECDCCAvCgAwIBAgIJAJaBmuUlfY8sMA0GCSqGSIb3DQEBBQUAMIGmMQswCQYD
+VQQGEwJVUzETMBEGA1UECAwKU29tZS1TdGF0ZTESMBAGA1UEBwwJU29tZS1DaXR5
+MSowKAYDVQQKDCFVbmNvbmZpZ3VyZWQgT3BlblNTTCBJbnN0YWxsYXRpb24xEDAO
+BgNVBAsMB3NlY3Rpb24xMDAuBgNVBAMMJzIwMDE6MGRiODozYzRkOjAwMTU6MDAw
+MDowMDAwOjFhMmY6MWEyYjAeFw0xNTAyMTAxODMzMjBaFw0xNTAzMTIxODMzMjBa
+MIGmMQswCQYDVQQGEwJVUzETMBEGA1UECAwKU29tZS1TdGF0ZTESMBAGA1UEBwwJ
+U29tZS1DaXR5MSowKAYDVQQKDCFVbmNvbmZpZ3VyZWQgT3BlblNTTCBJbnN0YWxs
+YXRpb24xEDAOBgNVBAsMB3NlY3Rpb24xMDAuBgNVBAMMJzIwMDE6MGRiODozYzRk
+OjAwMTU6MDAwMDowMDAwOjFhMmY6MWEyYjCCASIwDQYJKoZIhvcNAQEBBQADggEP
+ADCCAQoCggEBAMcigWxmeF6Dmo3xAw3y/8d3vB8Th4YsmvwXb9DxwNWV+B3vxJgq
+ww6T6VBxrle1bgu/RtZDJwLf5vMhVElxuuE86di2qyurKFbpe29C9xnCxuMlXpje
+X2pNknz4ZzOqD4opmIAFjXZ2Xp1kLt+HJX7ABoz7Uga+IbVfDRPPf2KOqYNpBQkp
+dgI5VOZDQNVNb+8vdXDwyanMQ0TgPXKL4BQIkGB4RM8sgpPMUvB+tEB7zmUtgSco
+2a5M84wIhxv85CmFFoTVSzXsRCDhVAZj0aHRkkmAsMSmzPa4HiPnuVRV740oQjDy
+oMGLndaEs2nxIqckUFHOHcSTf0/wmcvPbIsCAwEAAaM3MDUwCQYDVR0TBAIwADAL
+BgNVHQ8EBAMCBeAwGwYDVR0RBBQwEocQIAENuDxNABUAAAAAGi8aKzANBgkqhkiG
+9w0BAQUFAAOCAQEAtnelRbYPPZRgTd4oxOiPqwc01EE9JgtkFWlooCwVUDChOR2k
+us1qlhKsvbN2Tcsm1Ss3p0Uxk/g1o2/mY8rA/dJ8qiN6jbfjpEi8b2MirP5tQSE0
+QNXbVGr5FnLbuUmn+82pB0vBSaq7gxehbV6S7dteyQUnb2imltC5wS9PwYb8wWx7
+IpyXWt0jkYkC8KJEevVYI7qtwpjYhyc1FqwzUiPmdqGz2AFLQ4RgTXJi93SPoyKM
+s65oPV+r6/0qwnslScxVfszHxxFn1Yfsc5Oseare1MnlNzH69PmWs523C/fBvnB2
+MsHKLPdoN7uSpBLB7j46g5jQG/ceri/cquZKYA==
+-----END CERTIFICATE-----
--- a/jdk/test/sun/tools/jmap/heapconfig/JMapHeapConfigTest.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/sun/tools/jmap/heapconfig/JMapHeapConfigTest.java	Mon Feb 23 05:01:11 2015 -0800
@@ -37,6 +37,7 @@
 import java.util.List;
 import java.util.Map;
 import jdk.testlibrary.Utils;
+import jdk.testlibrary.Platform;
 
 public class JMapHeapConfigTest {
 
@@ -55,6 +56,8 @@
 
     // ignoring MaxMetaspaceSize
 
+    static final String desiredMaxHeapSize = "-Xmx128m";
+
     private static Map<String, String> parseJMapOutput(List<String> jmapOutput) {
         Map<String, String> heapConfigMap = new HashMap<String, String>();
         boolean shouldParse = false;
@@ -107,12 +110,38 @@
         }
     }
 
-    public static void main(String[] args) {
+    public static void main(String[] args) throws Exception {
         System.out.println("Starting JMapHeapConfigTest");
 
+        if (!Platform.shouldSAAttach()) {
+            // Silently skip the test if we don't have enough permissions to attach
+            System.err.println("Error! Insufficient permissions to attach.");
+            return;
+        }
+
+        if (!LingeredApp.isLastModifiedWorking()) {
+            // Exact behaviour of the test depends to operating system and the test nature,
+            // so just print the warning and continue
+            System.err.println("Warning! Last modified time doesn't work.");
+        }
+
+        boolean mx_found = false;
+        List<String> jvmOptions = Utils.getVmOptions();
+        for (String option : jvmOptions) {
+            if (option.startsWith("-Xmx")) {
+               System.out.println("INFO: maximum heap size set by JTREG as " + option);
+               mx_found = true;
+               break;
+           }
+        }
+
         // Forward vm options to LingeredApp
         ArrayList<String> cmd = new ArrayList();
         cmd.addAll(Utils.getVmOptions());
+        if (!mx_found) {
+            cmd.add(desiredMaxHeapSize);
+            System.out.println("INFO: maximum heap size set explicitly as " + desiredMaxHeapSize);
+        }
         cmd.add("-XX:+PrintFlagsFinal");
 
         TmtoolTestScenario tmt = TmtoolTestScenario.create("jmap", "-heap");
--- a/jdk/test/sun/tools/jmap/heapconfig/LingeredApp.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/sun/tools/jmap/heapconfig/LingeredApp.java	Mon Feb 23 05:01:11 2015 -0800
@@ -363,6 +363,41 @@
     }
 
     /**
+     * LastModified time might not work correctly in some cases it might
+     * cause later failures
+     */
+
+    public static boolean isLastModifiedWorking() {
+        boolean sane = true;
+        try {
+            long lm = lastModified(".");
+            if (lm == 0) {
+                System.err.println("SANITY Warning! The lastModifiedTime() doesn't work on this system, it returns 0");
+                sane = false;
+            }
+
+            long now = epoch();
+            if (lm > now) {
+                System.err.println("SANITY Warning! The Clock is wrong on this system lastModifiedTime() > getTime()");
+                sane = false;
+            }
+
+            setLastModified(".", epoch());
+            long lm1 = lastModified(".");
+            if (lm1 <= lm) {
+                System.err.println("SANITY Warning! The setLastModified doesn't work on this system");
+                sane = false;
+            }
+        }
+        catch(IOException e) {
+            System.err.println("SANITY Warning! IOException during sanity check " + e);
+            sane = false;
+        }
+
+        return sane;
+    }
+
+    /**
      * This part is the application it self
      */
     public static void main(String args[]) {
@@ -378,16 +413,8 @@
             Path path = Paths.get(theLockFileName);
 
             while (Files.exists(path)) {
-                long lm = lastModified(theLockFileName);
-                long now = epoch();
-
-                // A bit of paranoja, don't allow test app to run more than an hour
-                if (now - lm > 3600) {
-                    throw new IOException("Lock is too old. Aborting");
-                }
-
-                // Touch lock to indicate our rediness
-                setLastModified(theLockFileName, now);
+                // Touch the lock to indicate our readiness
+                setLastModified(theLockFileName, epoch());
                 Thread.sleep(spinDelay);
             }
 
--- a/jdk/test/sun/tools/jmap/heapconfig/LingeredAppTest.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/sun/tools/jmap/heapconfig/LingeredAppTest.java	Mon Feb 23 05:01:11 2015 -0800
@@ -31,8 +31,6 @@
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 
 public class LingeredAppTest {
 
--- a/jdk/test/sun/util/calendar/zi/tzdata/VERSION	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/sun/util/calendar/zi/tzdata/VERSION	Mon Feb 23 05:01:11 2015 -0800
@@ -21,4 +21,4 @@
 # or visit www.oracle.com if you need additional information or have any
 # questions.
 #
-tzdata2014j
+tzdata2015a
--- a/jdk/test/sun/util/calendar/zi/tzdata/antarctica	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/sun/util/calendar/zi/tzdata/antarctica	Mon Feb 23 05:01:11 2015 -0800
@@ -70,8 +70,8 @@
 Rule	ChileAQ	2010	only	-	Apr	Sun>=1	3:00u	0	-
 Rule	ChileAQ	2011	only	-	May	Sun>=2	3:00u	0	-
 Rule	ChileAQ	2011	only	-	Aug	Sun>=16	4:00u	1:00	S
-Rule	ChileAQ	2012	max	-	Apr	Sun>=23	3:00u	0	-
-Rule	ChileAQ	2012	max	-	Sep	Sun>=2	4:00u	1:00	S
+Rule	ChileAQ	2012	2015	-	Apr	Sun>=23	3:00u	0	-
+Rule	ChileAQ	2012	2014	-	Sep	Sun>=2	4:00u	1:00	S
 
 # Argentina - year-round bases
 # Belgrano II, Confin Coast, -770227-0343737, since 1972-02-05
@@ -377,9 +377,10 @@
 #
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Antarctica/Palmer	0	-	zzz	1965
-			-4:00	ArgAQ	AR%sT	1969 Oct 5
+			-4:00	ArgAQ	AR%sT	1969 Oct  5
 			-3:00	ArgAQ	AR%sT	1982 May
-			-4:00	ChileAQ	CL%sT
+			-4:00	ChileAQ	CL%sT	2015 Apr 26 3:00u
+			-3:00	-	CLT
 #
 #
 # McMurdo Station, Ross Island, since 1955-12
--- a/jdk/test/sun/util/calendar/zi/tzdata/asia	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/sun/util/calendar/zi/tzdata/asia	Mon Feb 23 05:01:11 2015 -0800
@@ -168,10 +168,7 @@
 			4:00	Azer	AZ%sT
 
 # Bahrain
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Bahrain	3:22:20 -	LMT	1920     # Manamah
-			4:00	-	GST	1972 Jun
-			3:00	-	AST
+# See Asia/Qatar.
 
 # Bangladesh
 # From Alexander Krivenyshev (2009-05-13):
@@ -1754,9 +1751,7 @@
 ###############################################################################
 
 # Kuwait
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Kuwait	3:11:56 -	LMT	1950
-			3:00	-	AST
+# See Asia/Riyadh.
 
 # Laos
 # See Asia/Bangkok.
@@ -1977,12 +1972,7 @@
 			5:45	-	NPT	# Nepal Time
 
 # Oman
-
-# Milne says 3:54:24 was the meridian of the Muscat Tidal Observatory.
-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Muscat	3:54:24 -	LMT	1920
-			4:00	-	GST
+# See Asia/Dubai.
 
 # Pakistan
 
@@ -2476,6 +2466,7 @@
 Zone	Asia/Qatar	3:26:08 -	LMT	1920     # Al Dawhah / Doha
 			4:00	-	GST	1972 Jun
 			3:00	-	AST
+Link Asia/Qatar Asia/Bahrain
 
 # Saudi Arabia
 #
@@ -2502,6 +2493,8 @@
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Riyadh	3:06:52 -	LMT	1947 Mar 14
 			3:00	-	AST
+Link Asia/Riyadh Asia/Aden	# Yemen
+Link Asia/Riyadh Asia/Kuwait
 
 # Singapore
 # taken from Mok Ly Yng (2003-10-30)
@@ -2790,6 +2783,7 @@
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Dubai	3:41:12 -	LMT	1920
 			4:00	-	GST
+Link Asia/Dubai Asia/Muscat	# Oman
 
 # Uzbekistan
 # Byalokoz 1919 says Uzbekistan was 4:27:53.
@@ -2874,10 +2868,4 @@
 			7:00	-	ICT
 
 # Yemen
-
-# Milne says 2:59:54 was the meridian of the saluting battery at Aden,
-# and that Yemen was at 1:55:56, the meridian of the Hagia Sophia.
-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Aden	2:59:54	-	LMT	1950
-			3:00	-	AST
+# See Asia/Riyadh.
--- a/jdk/test/sun/util/calendar/zi/tzdata/backward	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/sun/util/calendar/zi/tzdata/backward	Mon Feb 23 05:01:11 2015 -0800
@@ -28,7 +28,7 @@
 # and their old names.  Many names changed in late 1993.
 
 # Link	TARGET			LINK-NAME
-Link	Africa/Asmara		Africa/Asmera
+Link	Africa/Nairobi		Africa/Asmera
 Link	Africa/Abidjan		Africa/Timbuktu
 Link	America/Argentina/Catamarca	America/Argentina/ComodRivadavia
 Link	America/Adak		America/Atka
--- a/jdk/test/sun/util/calendar/zi/tzdata/europe	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/sun/util/calendar/zi/tzdata/europe	Mon Feb 23 05:01:11 2015 -0800
@@ -1430,35 +1430,32 @@
 # might be a reference to the Julian calendar as opposed to Gregorian, or it
 # might mean something else (???).
 #
-# From Paul Eggert (2006-03-22):
-# The Iceland Almanak, Shanks & Pottenger, and Whitman disagree on many points.
-# We go with the Almanak, except for one claim from Shanks & Pottenger, namely
-# that Reykavik was 21W57 from 1837 to 1908, local mean time before that.
+# From Paul Eggert (2014-11-22):
+# The information below is taken from the 1988 Almanak; see
+# http://www.almanak.hi.is/klukkan.html
 #
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Iceland	1917	1918	-	Feb	19	23:00	1:00	S
+Rule	Iceland	1917	1919	-	Feb	19	23:00	1:00	S
 Rule	Iceland	1917	only	-	Oct	21	 1:00	0	-
-Rule	Iceland	1918	only	-	Nov	16	 1:00	0	-
+Rule	Iceland	1918	1919	-	Nov	16	 1:00	0	-
+Rule	Iceland	1921	only	-	Mar	19	23:00	1:00	S
+Rule	Iceland	1921	only	-	Jun	23	 1:00	0	-
 Rule	Iceland	1939	only	-	Apr	29	23:00	1:00	S
-Rule	Iceland	1939	only	-	Nov	29	 2:00	0	-
+Rule	Iceland	1939	only	-	Oct	29	 2:00	0	-
 Rule	Iceland	1940	only	-	Feb	25	 2:00	1:00	S
-Rule	Iceland	1940	only	-	Nov	 3	 2:00	0	-
-Rule	Iceland	1941	only	-	Mar	 2	 1:00s	1:00	S
-Rule	Iceland	1941	only	-	Nov	 2	 1:00s	0	-
-Rule	Iceland	1942	only	-	Mar	 8	 1:00s	1:00	S
-Rule	Iceland	1942	only	-	Oct	25	 1:00s	0	-
+Rule	Iceland	1940	1941	-	Nov	Sun>=2	 1:00s	0	-
+Rule	Iceland	1941	1942	-	Mar	Sun>=2	 1:00s	1:00	S
 # 1943-1946 - first Sunday in March until first Sunday in winter
 Rule	Iceland	1943	1946	-	Mar	Sun>=1	 1:00s	1:00	S
-Rule	Iceland	1943	1948	-	Oct	Sun>=22	 1:00s	0	-
+Rule	Iceland	1942	1948	-	Oct	Sun>=22	 1:00s	0	-
 # 1947-1967 - first Sunday in April until first Sunday in winter
 Rule	Iceland	1947	1967	-	Apr	Sun>=1	 1:00s	1:00	S
-# 1949 Oct transition delayed by 1 week
+# 1949 and 1967 Oct transitions delayed by 1 week
 Rule	Iceland	1949	only	-	Oct	30	 1:00s	0	-
 Rule	Iceland	1950	1966	-	Oct	Sun>=22	 1:00s	0	-
 Rule	Iceland	1967	only	-	Oct	29	 1:00s	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Atlantic/Reykjavik	-1:27:24 -	LMT	1837
-			-1:27:48 -	RMT	1908 # Reykjavik Mean Time?
+Zone Atlantic/Reykjavik	-1:28	-	LMT	1908
 			-1:00	Iceland	IS%sT	1968 Apr  7  1:00s
 			 0:00	-	GMT
 
--- a/jdk/test/sun/util/calendar/zi/tzdata/leapseconds	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/sun/util/calendar/zi/tzdata/leapseconds	Mon Feb 23 05:01:11 2015 -0800
@@ -77,3 +77,7 @@
 Leap	2005	Dec	31	23:59:60	+	S
 Leap	2008	Dec	31	23:59:60	+	S
 Leap	2012	Jun	30	23:59:60	+	S
+Leap	2015	Jun	30	23:59:60	+	S
+
+#	Updated through IERS Bulletin C49
+#	File expires on:  28 December 2015
--- a/jdk/test/sun/util/calendar/zi/tzdata/northamerica	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/sun/util/calendar/zi/tzdata/northamerica	Mon Feb 23 05:01:11 2015 -0800
@@ -147,7 +147,7 @@
 Rule	US	1918	1919	-	Oct	lastSun	2:00	0	S
 Rule	US	1942	only	-	Feb	9	2:00	1:00	W # War
 Rule	US	1945	only	-	Aug	14	23:00u	1:00	P # Peace
-Rule	US	1945	only	-	Sep	30	2:00	0	S
+Rule	US	1945	only	-	Sep	lastSun	2:00	0	S
 Rule	US	1967	2006	-	Oct	lastSun	2:00	0	S
 Rule	US	1967	1973	-	Apr	lastSun	2:00	1:00	D
 Rule	US	1974	only	-	Jan	6	2:00	1:00	D
@@ -2147,11 +2147,11 @@
 
 # Mexico
 
-# From Paul Eggert (2001-03-05):
+# From Paul Eggert (2014-12-07):
 # The Investigation and Analysis Service of the
 # Mexican Library of Congress (MLoC) has published a
 # history of Mexican local time (in Spanish)
-# http://www.cddhcu.gob.mx/bibliot/publica/inveyana/polisoc/horver/
+# http://www.diputados.gob.mx/bibliot/publica/inveyana/polisoc/horver/index.htm
 #
 # Here are the discrepancies between Shanks & Pottenger (S&P) and the MLoC.
 # (In all cases we go with the MLoC.)
@@ -2320,6 +2320,24 @@
 # efecto desde las dos horas del segundo domingo de marzo y concluirá a
 # las dos horas del primer domingo de noviembre.
 
+# From Steffen Thorsen (2014-12-08), translated by Gwillim Law:
+# The Mexican state of Quintana Roo will likely change to EST in 2015.
+#
+# http://www.unioncancun.mx/articulo/2014/12/04/medio-ambiente/congreso-aprueba-una-hora-mas-de-sol-en-qroo
+# "With this change, the time conflict that has existed between the municipios
+# of Quintana Roo and the municipio of Felipe Carrillo Puerto may come to an
+# end. The latter declared itself in rebellion 15 years ago when a time change
+# was initiated in Mexico, and since then it has refused to change its time
+# zone along with the rest of the country."
+#
+# From Steffen Thorsen (2015-01-14), translated by Gwillim Law:
+# http://sipse.com/novedades/confirman-aplicacion-de-nueva-zona-horaria-para-quintana-roo-132331.html
+# "...the new time zone will come into effect at two o'clock on the first Sunday
+# of February, when we will have to advance the clock one hour from its current
+# time..."
+#
+# Also, the new zone will not use DST.
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Mexico	1939	only	-	Feb	5	0:00	1:00	D
 Rule	Mexico	1939	only	-	Jun	25	0:00	0	S
@@ -2340,7 +2358,8 @@
 Zone America/Cancun	-5:47:04 -	LMT	1922 Jan  1  0:12:56
 			-6:00	-	CST	1981 Dec 23
 			-5:00	Mexico	E%sT	1998 Aug  2  2:00
-			-6:00	Mexico	C%sT
+			-6:00	Mexico	C%sT	2015 Feb  1  2:00
+			-5:00	-	EST
 # Campeche, Yucatán; represented by Mérida
 Zone America/Merida	-5:58:28 -	LMT	1922 Jan  1  0:01:32
 			-6:00	-	CST	1981 Dec 23
--- a/jdk/test/sun/util/calendar/zi/tzdata/southamerica	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/sun/util/calendar/zi/tzdata/southamerica	Mon Feb 23 05:01:11 2015 -0800
@@ -1229,6 +1229,11 @@
 # DST Start: first Saturday of September 2014 (Sun 07 Sep 2014 04:00 UTC)
 # http://www.diariooficial.interior.gob.cl//media/2014/02/19/do-20140219.pdf
 
+# From Juan Correa (2015-01-28):
+# ... today the Ministry of Energy announced that Chile will drop DST, will keep
+# "summer time" (UTC -3 / UTC -5) all year round....
+# http://www.minenergia.cl/ministerio/noticias/generales/ministerio-de-energia-anuncia.html
+
 # NOTE: ChileAQ rules for Antarctic bases are stored separately in the
 # 'antarctica' file.
 
@@ -1270,8 +1275,8 @@
 Rule	Chile	2010	only	-	Apr	Sun>=1	3:00u	0	-
 Rule	Chile	2011	only	-	May	Sun>=2	3:00u	0	-
 Rule	Chile	2011	only	-	Aug	Sun>=16	4:00u	1:00	S
-Rule	Chile	2012	max	-	Apr	Sun>=23	3:00u	0	-
-Rule	Chile	2012	max	-	Sep	Sun>=2	4:00u	1:00	S
+Rule	Chile	2012	2015	-	Apr	Sun>=23	3:00u	0	-
+Rule	Chile	2012	2014	-	Sep	Sun>=2	4:00u	1:00	S
 # IATA SSIM anomalies: (1992-02) says 1992-03-14;
 # (1996-09) says 1998-03-08.  Ignore these.
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
@@ -1282,11 +1287,13 @@
 			-4:00	-	CLT	1919 Jul  1 # Chile Time
 			-4:42:46 -	SMT	1927 Sep  1 # Santiago Mean Time
 			-5:00	Chile	CL%sT	1947 May 22 # Chile Time
-			-4:00	Chile	CL%sT
+			-4:00	Chile	CL%sT	2015 Apr 26  3:00u
+			-3:00	-	CLT
 Zone Pacific/Easter	-7:17:44 -	LMT	1890
 			-7:17:28 -	EMT	1932 Sep    # Easter Mean Time
-			-7:00	Chile	EAS%sT	1982 Mar 13 21:00 # Easter Time
-			-6:00	Chile	EAS%sT
+			-7:00	Chile	EAS%sT	1982 Mar 13 3:00u # Easter Time
+			-6:00	Chile	EAS%sT	2015 Apr 26 3:00u
+			-5:00	-	EAST
 #
 # Salas y Gómez Island is uninhabited.
 # Other Chilean locations, including Juan Fernández Is, Desventuradas Is,
--- a/jdk/test/sun/util/calendar/zi/tzdata/zone.tab	Wed Feb 18 22:19:47 2015 -0500
+++ b/jdk/test/sun/util/calendar/zi/tzdata/zone.tab	Mon Feb 23 05:01:11 2015 -0800
@@ -297,7 +297,7 @@
 MV	+0410+07330	Indian/Maldives
 MW	-1547+03500	Africa/Blantyre
 MX	+1924-09909	America/Mexico_City	Central Time - most locations
-MX	+2105-08646	America/Cancun	Central Time - Quintana Roo
+MX	+2105-08646	America/Cancun	Eastern Standard Time - Quintana Roo
 MX	+2058-08937	America/Merida	Central Time - Campeche, Yucatan
 MX	+2540-10019	America/Monterrey	Mexican Central Time - Coahuila, Durango, Nuevo Leon, Tamaulipas away from US border
 MX	+2550-09730	America/Matamoros	US Central Time - Coahuila, Durango, Nuevo Leon, Tamaulipas near US border
--- a/langtools/.hgtags	Wed Feb 18 22:19:47 2015 -0500
+++ b/langtools/.hgtags	Mon Feb 23 05:01:11 2015 -0800
@@ -291,3 +291,6 @@
 e272d9be5f90edb6bb6b40f7816ec85eec0f5dc2 jdk9-b46
 230c139552501e612dd0d4423ac30f94c1201c0d jdk9-b47
 5b102fc29edf8b7eee7df208d8a8bba0e0a52f3a jdk9-b48
+15c79f28e30a1be561abe0d67674232ad5034d32 jdk9-b49
+1ccb6ef2f40bf9961b27adac390a6fc5181aa1fc jdk9-b50
+7c44d9a33bbea75f5d91625df9bbccea360aea2a jdk9-b51
--- a/langtools/make/tools/propertiesparser/gen/ClassGenerator.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/langtools/make/tools/propertiesparser/gen/ClassGenerator.java	Mon Feb 23 05:01:11 2015 -0800
@@ -192,8 +192,8 @@
      */
     String packageName(File file) {
         String path = file.getAbsolutePath();
-        int begin = path.indexOf("com" + File.separatorChar);
-        String packagePath = path.substring(begin, path.lastIndexOf(File.separatorChar));
+        int begin = path.lastIndexOf(File.separatorChar + "com" + File.separatorChar);
+        String packagePath = path.substring(begin + 1, path.lastIndexOf(File.separatorChar));
         String packageName =  packagePath.replace(File.separatorChar, '.');
         return packageName;
     }
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symtab.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symtab.java	Mon Feb 23 05:01:11 2015 -0800
@@ -200,9 +200,6 @@
      */
     public final VarSymbol lengthVar;
 
-    /** The null check operator. */
-    public final OperatorSymbol nullcheck;
-
     /** The symbol representing the final finalize method on enums */
     public final MethodSymbol enumFinalFinalize;
 
@@ -217,10 +214,6 @@
      */
     public final Name[] boxedName = new Name[TypeTag.getTypeTagCount()];
 
-    /** A set containing all operator names.
-     */
-    public final Set<Name> operatorNames = new HashSet<>();
-
     /** A hashtable containing the encountered top-level and member classes,
      *  indexed by flat names. The table does not contain local classes.
      *  It should be updated from the outside to reflect classes defined
@@ -255,85 +248,6 @@
      */
     public final ClassSymbol predefClass;
 
-    /** Enter a constant into symbol table.
-     *  @param name   The constant's name.
-     *  @param type   The constant's type.
-     */
-    private VarSymbol enterConstant(String name, Type type) {
-        VarSymbol c = new VarSymbol(
-            PUBLIC | STATIC | FINAL,
-            names.fromString(name),
-            type,
-            predefClass);
-        c.setData(type.constValue());
-        predefClass.members().enter(c);
-        return c;
-    }
-
-    /** Enter a binary operation into symbol table.
-     *  @param name     The name of the operator.
-     *  @param left     The type of the left operand.
-     *  @param right    The type of the left operand.
-     *  @param res      The operation's result type.
-     *  @param opcode   The operation's bytecode instruction.
-     */
-    private void enterBinop(String name,
-                            Type left, Type right, Type res,
-                            int opcode) {
-        predefClass.members().enter(
-            new OperatorSymbol(
-                makeOperatorName(name),
-                new MethodType(List.of(left, right), res,
-                               List.<Type>nil(), methodClass),
-                opcode,
-                predefClass));
-    }
-
-    /** Enter a binary operation, as above but with two opcodes,
-     *  which get encoded as
-     *  {@code (opcode1 << ByteCodeTags.preShift) + opcode2 }.
-     *  @param opcode1     First opcode.
-     *  @param opcode2     Second opcode.
-     */
-    private void enterBinop(String name,
-                            Type left, Type right, Type res,
-                            int opcode1, int opcode2) {
-        enterBinop(
-            name, left, right, res, (opcode1 << ByteCodes.preShift) | opcode2);
-    }
-
-    /** Enter a unary operation into symbol table.
-     *  @param name     The name of the operator.
-     *  @param arg      The type of the operand.
-     *  @param res      The operation's result type.
-     *  @param opcode   The operation's bytecode instruction.
-     */
-    private OperatorSymbol enterUnop(String name,
-                                     Type arg,
-                                     Type res,
-                                     int opcode) {
-        OperatorSymbol sym =
-            new OperatorSymbol(makeOperatorName(name),
-                               new MethodType(List.of(arg),
-                                              res,
-                                              List.<Type>nil(),
-                                              methodClass),
-                               opcode,
-                               predefClass);
-        predefClass.members().enter(sym);
-        return sym;
-    }
-
-    /**
-     * Create a new operator name from corresponding String representation
-     * and add the name to the set of known operator names.
-     */
-    private Name makeOperatorName(String name) {
-        Name opName = names.fromString(name);
-        operatorNames.add(opName);
-        return opName;
-    }
-
     /** Enter a class into symbol table.
      *  @param s The name of the class.
      */
@@ -591,163 +505,6 @@
                            List.<Type>nil(), methodClass),
             arrayClass);
         arrayClass.members().enter(arrayCloneMethod);
-
-        // Enter operators.
-        /*  Internally we use +++, --- for unary +, - to reduce +, - operators
-         *  overloading
-         */
-        enterUnop("+++", doubleType, doubleType, nop);
-        enterUnop("+++", floatType, floatType, nop);
-        enterUnop("+++", longType, longType, nop);
-        enterUnop("+++", intType, intType, nop);
-
-        enterUnop("---", doubleType, doubleType, dneg);
-        enterUnop("---", floatType, floatType, fneg);
-        enterUnop("---", longType, longType, lneg);
-        enterUnop("---", intType, intType, ineg);
-
-        enterUnop("~", longType, longType, lxor);
-        enterUnop("~", intType, intType, ixor);
-
-        enterUnop("++", doubleType, doubleType, dadd);
-        enterUnop("++", floatType, floatType, fadd);
-        enterUnop("++", longType, longType, ladd);
-        enterUnop("++", intType, intType, iadd);
-        enterUnop("++", charType, charType, iadd);
-        enterUnop("++", shortType, shortType, iadd);
-        enterUnop("++", byteType, byteType, iadd);
-
-        enterUnop("--", doubleType, doubleType, dsub);
-        enterUnop("--", floatType, floatType, fsub);
-        enterUnop("--", longType, longType, lsub);
-        enterUnop("--", intType, intType, isub);
-        enterUnop("--", charType, charType, isub);
-        enterUnop("--", shortType, shortType, isub);
-        enterUnop("--", byteType, byteType, isub);
-
-        enterUnop("!", booleanType, booleanType, bool_not);
-        nullcheck = enterUnop("<*nullchk*>", objectType, objectType, nullchk);
-
-        // string concatenation
-        enterBinop("+", stringType, objectType, stringType, string_add);
-        enterBinop("+", objectType, stringType, stringType, string_add);
-        enterBinop("+", stringType, stringType, stringType, string_add);
-        enterBinop("+", stringType, intType, stringType, string_add);
-        enterBinop("+", stringType, longType, stringType, string_add);
-        enterBinop("+", stringType, floatType, stringType, string_add);
-        enterBinop("+", stringType, doubleType, stringType, string_add);
-        enterBinop("+", stringType, booleanType, stringType, string_add);
-        enterBinop("+", stringType, botType, stringType, string_add);
-        enterBinop("+", intType, stringType, stringType, string_add);
-        enterBinop("+", longType, stringType, stringType, string_add);
-        enterBinop("+", floatType, stringType, stringType, string_add);
-        enterBinop("+", doubleType, stringType, stringType, string_add);
-        enterBinop("+", booleanType, stringType, stringType, string_add);
-        enterBinop("+", botType, stringType, stringType, string_add);
-
-        // these errors would otherwise be matched as string concatenation
-        enterBinop("+", botType, botType, botType, error);
-        enterBinop("+", botType, intType, botType, error);
-        enterBinop("+", botType, longType, botType, error);
-        enterBinop("+", botType, floatType, botType, error);
-        enterBinop("+", botType, doubleType, botType, error);
-        enterBinop("+", botType, booleanType, botType, error);
-        enterBinop("+", botType, objectType, botType, error);
-        enterBinop("+", intType, botType, botType, error);
-        enterBinop("+", longType, botType, botType, error);
-        enterBinop("+", floatType, botType, botType, error);
-        enterBinop("+", doubleType, botType, botType, error);
-        enterBinop("+", booleanType, botType, botType, error);
-        enterBinop("+", objectType, botType, botType, error);
-
-        enterBinop("+", doubleType, doubleType, doubleType, dadd);
-        enterBinop("+", floatType, floatType, floatType, fadd);
-        enterBinop("+", longType, longType, longType, ladd);
-        enterBinop("+", intType, intType, intType, iadd);
-
-        enterBinop("-", doubleType, doubleType, doubleType, dsub);
-        enterBinop("-", floatType, floatType, floatType, fsub);
-        enterBinop("-", longType, longType, longType, lsub);
-        enterBinop("-", intType, intType, intType, isub);
-
-        enterBinop("*", doubleType, doubleType, doubleType, dmul);
-        enterBinop("*", floatType, floatType, floatType, fmul);
-        enterBinop("*", longType, longType, longType, lmul);
-        enterBinop("*", intType, intType, intType, imul);
-
-        enterBinop("/", doubleType, doubleType, doubleType, ddiv);
-        enterBinop("/", floatType, floatType, floatType, fdiv);
-        enterBinop("/", longType, longType, longType, ldiv);
-        enterBinop("/", intType, intType, intType, idiv);
-
-        enterBinop("%", doubleType, doubleType, doubleType, dmod);
-        enterBinop("%", floatType, floatType, floatType, fmod);
-        enterBinop("%", longType, longType, longType, lmod);
-        enterBinop("%", intType, intType, intType, imod);
-
-        enterBinop("&", booleanType, booleanType, booleanType, iand);
-        enterBinop("&", longType, longType, longType, land);
-        enterBinop("&", intType, intType, intType, iand);
-
-        enterBinop("|", booleanType, booleanType, booleanType, ior);
-        enterBinop("|", longType, longType, longType, lor);
-        enterBinop("|", intType, intType, intType, ior);
-
-        enterBinop("^", booleanType, booleanType, booleanType, ixor);
-        enterBinop("^", longType, longType, longType, lxor);
-        enterBinop("^", intType, intType, intType, ixor);
-
-        enterBinop("<<", longType, longType, longType, lshll);
-        enterBinop("<<", intType, longType, intType, ishll);
-        enterBinop("<<", longType, intType, longType, lshl);
-        enterBinop("<<", intType, intType, intType, ishl);
-
-        enterBinop(">>", longType, longType, longType, lshrl);
-        enterBinop(">>", intType, longType, intType, ishrl);
-        enterBinop(">>", longType, intType, longType, lshr);
-        enterBinop(">>", intType, intType, intType, ishr);
-
-        enterBinop(">>>", longType, longType, longType, lushrl);
-        enterBinop(">>>", intType, longType, intType, iushrl);
-        enterBinop(">>>", longType, intType, longType, lushr);
-        enterBinop(">>>", intType, intType, intType, iushr);
-
-        enterBinop("<", doubleType, doubleType, booleanType, dcmpg, iflt);
-        enterBinop("<", floatType, floatType, booleanType, fcmpg, iflt);
-        enterBinop("<", longType, longType, booleanType, lcmp, iflt);
-        enterBinop("<", intType, intType, booleanType, if_icmplt);
-
-        enterBinop(">", doubleType, doubleType, booleanType, dcmpl, ifgt);
-        enterBinop(">", floatType, floatType, booleanType, fcmpl, ifgt);
-        enterBinop(">", longType, longType, booleanType, lcmp, ifgt);
-        enterBinop(">", intType, intType, booleanType, if_icmpgt);
-
-        enterBinop("<=", doubleType, doubleType, booleanType, dcmpg, ifle);
-        enterBinop("<=", floatType, floatType, booleanType, fcmpg, ifle);
-        enterBinop("<=", longType, longType, booleanType, lcmp, ifle);
-        enterBinop("<=", intType, intType, booleanType, if_icmple);
-
-        enterBinop(">=", doubleType, doubleType, booleanType, dcmpl, ifge);
-        enterBinop(">=", floatType, floatType, booleanType, fcmpl, ifge);
-        enterBinop(">=", longType, longType, booleanType, lcmp, ifge);
-        enterBinop(">=", intType, intType, booleanType, if_icmpge);
-
-        enterBinop("==", objectType, objectType, booleanType, if_acmpeq);
-        enterBinop("==", booleanType, booleanType, booleanType, if_icmpeq);
-        enterBinop("==", doubleType, doubleType, booleanType, dcmpl, ifeq);
-        enterBinop("==", floatType, floatType, booleanType, fcmpl, ifeq);
-        enterBinop("==", longType, longType, booleanType, lcmp, ifeq);
-        enterBinop("==", intType, intType, booleanType, if_icmpeq);
-
-        enterBinop("!=", objectType, objectType, booleanType, if_acmpne);
-        enterBinop("!=", booleanType, booleanType, booleanType, if_icmpne);
-        enterBinop("!=", doubleType, doubleType, booleanType, dcmpl, ifne);
-        enterBinop("!=", floatType, floatType, booleanType, fcmpl, ifne);
-        enterBinop("!=", longType, longType, booleanType, lcmp, ifne);
-        enterBinop("!=", intType, intType, booleanType, if_icmpne);
-
-        enterBinop("&&", booleanType, booleanType, booleanType, bool_and);
-        enterBinop("||", booleanType, booleanType, booleanType, bool_or);
     }
 
     /** Define a new class given its name and owner.
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -1445,26 +1445,6 @@
     }
     // </editor-fold>
 
-    /**
-     * Can t and s be compared for equality?  Any primitive ==
-     * primitive or primitive == object comparisons here are an error.
-     * Unboxing and correct primitive == primitive comparisons are
-     * already dealt with in Attr.visitBinary.
-     *
-     */
-    public boolean isEqualityComparable(Type s, Type t, Warner warn) {
-        if (t.isNumeric() && s.isNumeric())
-            return true;
-
-        boolean tPrimitive = t.isPrimitive();
-        boolean sPrimitive = s.isPrimitive();
-        if (!tPrimitive && !sPrimitive) {
-            return isCastable(s, t, warn) || isCastable(t, s, warn);
-        } else {
-            return false;
-        }
-    }
-
     // <editor-fold defaultstate="collapsed" desc="isCastable">
     public boolean isCastable(Type t, Type s) {
         return isCastable(t, s, noWarnings);
@@ -1931,6 +1911,11 @@
      * Return the (most specific) base type of t that starts with the
      * given symbol.  If none exists, return null.
      *
+     * Caveat Emptor: Since javac represents the class of all arrays with a singleton
+     * symbol Symtab.arrayClass, which by being a singleton cannot hold any discriminant,
+     * this method could yield surprising answers when invoked on arrays. For example when
+     * invoked with t being byte [] and sym being t.sym itself, asSuper would answer null.
+     *
      * @param t a type
      * @param sym a symbol
      */
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java	Mon Feb 23 05:01:11 2015 -0800
@@ -82,6 +82,7 @@
     final Log log;
     final Symtab syms;
     final Resolve rs;
+    final Operators operators;
     final Infer infer;
     final Analyzer analyzer;
     final DeferredAttr deferredAttr;
@@ -115,6 +116,7 @@
         log = Log.instance(context);
         syms = Symtab.instance(context);
         rs = Resolve.instance(context);
+        operators = Operators.instance(context);
         chk = Check.instance(context);
         flow = Flow.instance(context);
         memberEnter = MemberEnter.instance(context);
@@ -1467,7 +1469,7 @@
          *  @param thentype The type of the expression's then-part.
          *  @param elsetype The type of the expression's else-part.
          */
-        private Type condType(DiagnosticPosition pos,
+        Type condType(DiagnosticPosition pos,
                                Type thentype, Type elsetype) {
             // If same type, that is the result
             if (types.isSameType(thentype, elsetype))
@@ -2142,7 +2144,7 @@
 
         JCTree.Tag optag = NULLCHK;
         JCUnary tree = make.at(arg.pos).Unary(optag, arg);
-        tree.operator = syms.nullcheck;
+        tree.operator = operators.resolveUnary(arg, optag, arg.type);
         tree.type = arg.type;
         return tree;
     }
@@ -2903,18 +2905,10 @@
         Type owntype = attribTree(tree.lhs, env, varAssignmentInfo);
         Type operand = attribExpr(tree.rhs, env);
         // Find operator.
-        Symbol operator = tree.operator = rs.resolveBinaryOperator(
-            tree.pos(), tree.getTag().noAssignOp(), env,
-            owntype, operand);
-
+        Symbol operator = tree.operator = operators.resolveBinary(tree, tree.getTag().noAssignOp(), owntype, operand);
         if (operator.kind == MTH &&
                 !owntype.isErroneous() &&
                 !operand.isErroneous()) {
-            chk.checkOperator(tree.pos(),
-                              (OperatorSymbol)operator,
-                              tree.getTag().noAssignOp(),
-                              owntype,
-                              operand);
             chk.checkDivZero(tree.rhs.pos(), operator, operand);
             chk.checkCastable(tree.rhs.pos(),
                               operator.type.getReturnType(),
@@ -2930,9 +2924,7 @@
             : chk.checkNonVoid(tree.arg.pos(), attribExpr(tree.arg, env));
 
         // Find operator.
-        Symbol operator = tree.operator =
-            rs.resolveUnaryOperator(tree.pos(), tree.getTag(), env, argtype);
-
+        Symbol operator = tree.operator = operators.resolveUnary(tree, tree.getTag(), argtype);
         Type owntype = types.createErrorType(tree.type);
         if (operator.kind == MTH &&
                 !argtype.isErroneous()) {
@@ -2957,22 +2949,13 @@
         Type left = chk.checkNonVoid(tree.lhs.pos(), attribExpr(tree.lhs, env));
         Type right = chk.checkNonVoid(tree.lhs.pos(), attribExpr(tree.rhs, env));
         // Find operator.
-        Symbol operator = tree.operator =
-            rs.resolveBinaryOperator(tree.pos(), tree.getTag(), env, left, right);
-
+        Symbol operator = tree.operator = operators.resolveBinary(tree, tree.getTag(), left, right);
         Type owntype = types.createErrorType(tree.type);
         if (operator.kind == MTH &&
                 !left.isErroneous() &&
                 !right.isErroneous()) {
             owntype = operator.type.getReturnType();
-            // This will figure out when unboxing can happen and
-            // choose the right comparison operator.
-            int opc = chk.checkOperator(tree.lhs.pos(),
-                                        (OperatorSymbol)operator,
-                                        tree.getTag(),
-                                        left,
-                                        right);
-
+            int opc = ((OperatorSymbol)operator).opcode;
             // If both arguments are constants, fold them.
             if (left.constValue() != null && right.constValue() != null) {
                 Type ctype = cfolder.fold2(opc, left, right);
@@ -2985,8 +2968,7 @@
             // castable to each other, (JLS 15.21).  Note: unboxing
             // comparisons will not have an acmp* opc at this point.
             if ((opc == ByteCodes.if_acmpeq || opc == ByteCodes.if_acmpne)) {
-                if (!types.isEqualityComparable(left, right,
-                                                new Warner(tree.pos()))) {
+                if (!types.isCastable(left, right, new Warner(tree.pos()))) {
                     log.error(tree.pos(), "incomparable.types", left, right);
                 }
             }
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java	Mon Feb 23 05:01:11 2015 -0800
@@ -83,7 +83,6 @@
     private boolean warnOnSyntheticConflicts;
     private boolean suppressAbortOnBadClassFile;
     private boolean enableSunApiLintControl;
-    private final TreeInfo treeinfo;
     private final JavaFileManager fileManager;
     private final Profile profile;
     private final boolean warnOnAccessToSensitiveMembers;
@@ -121,7 +120,6 @@
         diags = JCDiagnostic.Factory.instance(context);
         Options options = Options.instance(context);
         lint = Lint.instance(context);
-        treeinfo = TreeInfo.instance(context);
         fileManager = context.get(JavaFileManager.class);
 
         Source source = Source.instance(context);
@@ -3265,30 +3263,6 @@
  **************************************************************************/
 
     /**
-     * Return the opcode of the operator but emit an error if it is an
-     * error.
-     * @param pos        position for error reporting.
-     * @param operator   an operator
-     * @param tag        a tree tag
-     * @param left       type of left hand side
-     * @param right      type of right hand side
-     */
-    int checkOperator(DiagnosticPosition pos,
-                       OperatorSymbol operator,
-                       JCTree.Tag tag,
-                       Type left,
-                       Type right) {
-        if (operator.opcode == ByteCodes.error) {
-            log.error(pos,
-                      "operator.cant.be.applied.1",
-                      treeinfo.operatorName(tag),
-                      left, right);
-        }
-        return operator.opcode;
-    }
-
-
-    /**
      *  Check for division by integer constant zero
      *  @param pos           Position for error reporting.
      *  @param operator      The operator for the expression
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/DeferredAttr.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/DeferredAttr.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -236,7 +236,8 @@
             DeferredStuckPolicy deferredStuckPolicy;
             if (resultInfo.pt.hasTag(NONE) || resultInfo.pt.isErroneous()) {
                 deferredStuckPolicy = dummyStuckPolicy;
-            } else if (resultInfo.checkContext.deferredAttrContext().mode == AttrMode.SPECULATIVE) {
+            } else if (resultInfo.checkContext.deferredAttrContext().mode == AttrMode.SPECULATIVE ||
+                    resultInfo.checkContext.deferredAttrContext().insideOverloadPhase()) {
                 deferredStuckPolicy = new OverloadStuckPolicy(resultInfo, this);
             } else {
                 deferredStuckPolicy = new CheckStuckPolicy(resultInfo, this);
@@ -1385,7 +1386,7 @@
                 Symbol lookup(Env<AttrContext> env, MethodResolutionPhase phase) {
                     return rec == null ?
                         rs.findFun(env, name, argtypes, typeargtypes, phase.isBoxingRequired(), phase.isVarargsRequired()) :
-                        rs.findMethod(env, site, name, argtypes, typeargtypes, phase.isBoxingRequired(), phase.isVarargsRequired(), false);
+                        rs.findMethod(env, site, name, argtypes, typeargtypes, phase.isBoxingRequired(), phase.isVarargsRequired());
                 }
                 @Override
                 Symbol access(Env<AttrContext> env, DiagnosticPosition pos, Symbol location, Symbol sym) {
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -353,17 +353,17 @@
                 this.tree = tree;
             }
 
-            void resolveJump(JCTree tree) {
+            void resolveJump() {
                 //do nothing
             }
         }
 
-        abstract void markDead(JCTree tree);
+        abstract void markDead();
 
         /** Record an outward transfer of control. */
-        void recordExit(JCTree tree, P pe) {
+        void recordExit(P pe) {
             pendingExits.append(pe);
-            markDead(tree);
+            markDead();
         }
 
         /** Resolve all jumps of this statement. */
@@ -377,7 +377,7 @@
                 P exit = exits.head;
                 if (exit.tree.hasTag(jk.treeTag) &&
                         jk.getTarget(exit.tree) == tree) {
-                    exit.resolveJump(tree);
+                    exit.resolveJump();
                     resolved = true;
                 } else {
                     pendingExits.append(exit);
@@ -424,7 +424,7 @@
         private boolean alive;
 
         @Override
-        void markDead(JCTree tree) {
+        void markDead() {
             alive = false;
         }
 
@@ -692,21 +692,21 @@
         }
 
         public void visitBreak(JCBreak tree) {
-            recordExit(tree, new PendingExit(tree));
+            recordExit(new PendingExit(tree));
         }
 
         public void visitContinue(JCContinue tree) {
-            recordExit(tree, new PendingExit(tree));
+            recordExit(new PendingExit(tree));
         }
 
         public void visitReturn(JCReturn tree) {
             scan(tree.expr);
-            recordExit(tree, new PendingExit(tree));
+            recordExit(new PendingExit(tree));
         }
 
         public void visitThrow(JCThrow tree) {
             scan(tree.expr);
-            markDead(tree);
+            markDead();
         }
 
         public void visitApply(JCMethodInvocation tree) {
@@ -803,7 +803,7 @@
         }
 
         @Override
-        void markDead(JCTree tree) {
+        void markDead() {
             //do nothing
         }
 
@@ -1201,16 +1201,16 @@
             }
 
         public void visitBreak(JCBreak tree) {
-            recordExit(tree, new FlowPendingExit(tree, null));
+            recordExit(new FlowPendingExit(tree, null));
         }
 
         public void visitContinue(JCContinue tree) {
-            recordExit(tree, new FlowPendingExit(tree, null));
+            recordExit(new FlowPendingExit(tree, null));
         }
 
         public void visitReturn(JCReturn tree) {
             scan(tree.expr);
-            recordExit(tree, new FlowPendingExit(tree, null));
+            recordExit(new FlowPendingExit(tree, null));
         }
 
         public void visitThrow(JCThrow tree) {
@@ -1228,7 +1228,7 @@
             else {
                 markThrown(tree, tree.expr.type);
             }
-            markDead(tree);
+            markDead();
         }
 
         public void visitApply(JCMethodInvocation tree) {
@@ -1375,12 +1375,11 @@
      * effectively-final local variables/parameters.
      */
 
-    public abstract class AbstractAssignAnalyzer<P extends AbstractAssignAnalyzer<P>.AbstractAssignPendingExit>
-        extends BaseAnalyzer<P> {
+    public class AssignAnalyzer extends BaseAnalyzer<AssignAnalyzer.AssignPendingExit> {
 
         /** The set of definitely assigned variables.
          */
-        protected Bits inits;
+        final Bits inits;
 
         /** The set of definitely unassigned variables.
          */
@@ -1428,20 +1427,20 @@
          */
         WriteableScope unrefdResources;
 
-        /** Set when processing a loop body the second time for DU analysis. */
+        /** Modified when processing a loop body the second time for DU analysis. */
         FlowKind flowKind = FlowKind.NORMAL;
 
-        /** The starting position of the analysed tree */
+        /** The starting position of the analyzed tree */
         int startPos;
 
-        public class AbstractAssignPendingExit extends BaseAnalyzer.PendingExit {
+        public class AssignPendingExit extends BaseAnalyzer.PendingExit {
 
             final Bits inits;
             final Bits uninits;
             final Bits exit_inits = new Bits(true);
             final Bits exit_uninits = new Bits(true);
 
-            public AbstractAssignPendingExit(JCTree tree, final Bits inits, final Bits uninits) {
+            public AssignPendingExit(JCTree tree, final Bits inits, final Bits uninits) {
                 super(tree);
                 this.inits = inits;
                 this.uninits = uninits;
@@ -1450,13 +1449,13 @@
             }
 
             @Override
-            public void resolveJump(JCTree tree) {
+            public void resolveJump() {
                 inits.andSet(exit_inits);
                 uninits.andSet(exit_uninits);
             }
         }
 
-        public AbstractAssignAnalyzer() {
+        public AssignAnalyzer() {
             this.inits = new Bits();
             uninits = new Bits();
             uninitsTry = new Bits();
@@ -1469,7 +1468,7 @@
         private boolean isInitialConstructor = false;
 
         @Override
-        protected void markDead(JCTree tree) {
+        protected void markDead() {
             if (!isInitialConstructor) {
                 inits.inclRange(returnadr, nextadr);
             } else {
@@ -1516,35 +1515,43 @@
             }
             sym.adr = nextadr;
             vardecls[nextadr] = varDecl;
-            exclVarFromInits(varDecl, nextadr);
+            inits.excl(nextadr);
             uninits.incl(nextadr);
             nextadr++;
         }
 
-        protected void exclVarFromInits(JCTree tree, int adr) {
-            inits.excl(adr);
-        }
-
-        protected void assignToInits(JCTree tree, Bits bits) {
-            inits.assign(bits);
-        }
-
-        protected void andSetInits(JCTree tree, Bits bits) {
-            inits.andSet(bits);
-        }
-
-        protected void orSetInits(JCTree tree, Bits bits) {
-            inits.orSet(bits);
-        }
-
         /** Record an initialization of a trackable variable.
          */
         void letInit(DiagnosticPosition pos, VarSymbol sym) {
             if (sym.adr >= firstadr && trackable(sym)) {
-                if (uninits.isMember(sym.adr)) {
-                    uninit(sym);
+                if ((sym.flags() & EFFECTIVELY_FINAL) != 0) {
+                    if (!uninits.isMember(sym.adr)) {
+                        //assignment targeting an effectively final variable
+                        //makes the variable lose its status of effectively final
+                        //if the variable is _not_ definitively unassigned
+                        sym.flags_field &= ~EFFECTIVELY_FINAL;
+                    } else {
+                        uninit(sym);
+                    }
+                }
+                else if ((sym.flags() & FINAL) != 0) {
+                    if ((sym.flags() & PARAMETER) != 0) {
+                        if ((sym.flags() & UNION) != 0) { //multi-catch parameter
+                            log.error(pos, "multicatch.parameter.may.not.be.assigned", sym);
+                        }
+                        else {
+                            log.error(pos, "final.parameter.may.not.be.assigned",
+                                  sym);
+                        }
+                    } else if (!uninits.isMember(sym.adr)) {
+                        log.error(pos, flowKind.errKey, sym);
+                    } else {
+                        uninit(sym);
+                    }
                 }
                 inits.incl(sym.adr);
+            } else if ((sym.flags() & FINAL) != 0) {
+                log.error(pos, "var.might.already.be.assigned", sym);
             }
         }
         //where
@@ -1579,7 +1586,14 @@
             checkInit(pos, sym, "var.might.not.have.been.initialized");
         }
 
-        void checkInit(DiagnosticPosition pos, VarSymbol sym, String errkey) {}
+        void checkInit(DiagnosticPosition pos, VarSymbol sym, String errkey) {
+            if ((sym.adr >= firstadr || sym.owner.kind != TYP) &&
+                trackable(sym) &&
+                !inits.isMember(sym.adr)) {
+                log.error(pos, errkey, sym);
+                inits.incl(sym.adr);
+            }
+        }
 
         /** Utility method to reset several Bits instances.
          */
@@ -1603,7 +1617,7 @@
 
         /** Merge (intersect) inits/uninits from WhenTrue/WhenFalse sets.
          */
-        protected void merge(JCTree tree) {
+        protected void merge() {
             inits.assign(initsWhenFalse.andSet(initsWhenTrue));
             uninits.assign(uninitsWhenFalse.andSet(uninitsWhenTrue));
         }
@@ -1619,7 +1633,7 @@
             if (tree != null) {
                 scan(tree);
                 if (inits.isReset()) {
-                    merge(tree);
+                    merge();
                 }
             }
         }
@@ -1637,7 +1651,7 @@
          */
         void scanCond(JCTree tree) {
             if (tree.type.isFalse()) {
-                if (inits.isReset()) merge(tree);
+                if (inits.isReset()) merge();
                 initsWhenTrue.assign(inits);
                 initsWhenTrue.inclRange(firstadr, nextadr);
                 uninitsWhenTrue.assign(uninits);
@@ -1645,7 +1659,7 @@
                 initsWhenFalse.assign(inits);
                 uninitsWhenFalse.assign(uninits);
             } else if (tree.type.isTrue()) {
-                if (inits.isReset()) merge(tree);
+                if (inits.isReset()) merge();
                 initsWhenFalse.assign(inits);
                 initsWhenFalse.inclRange(firstadr, nextadr);
                 uninitsWhenFalse.assign(uninits);
@@ -1664,173 +1678,203 @@
 
         /* ------------ Visitor methods for various sorts of trees -------------*/
 
-        @Override
         public void visitClassDef(JCClassDecl tree) {
             if (tree.sym == null) {
                 return;
             }
 
-            JCClassDecl classDefPrev = classDef;
-            int firstadrPrev = firstadr;
-            int nextadrPrev = nextadr;
-            ListBuffer<P> pendingExitsPrev = pendingExits;
+            Lint lintPrev = lint;
+            lint = lint.augment(tree.sym);
+            try {
+                if (tree.sym == null) {
+                    return;
+                }
+
+                JCClassDecl classDefPrev = classDef;
+                int firstadrPrev = firstadr;
+                int nextadrPrev = nextadr;
+                ListBuffer<AssignPendingExit> pendingExitsPrev = pendingExits;
 
-            pendingExits = new ListBuffer<>();
-            if (tree.name != names.empty) {
-                firstadr = nextadr;
-            }
-            classDef = tree;
-            try {
-                // define all the static fields
-                for (List<JCTree> l = tree.defs; l.nonEmpty(); l = l.tail) {
-                    if (l.head.hasTag(VARDEF)) {
-                        JCVariableDecl def = (JCVariableDecl)l.head;
-                        if ((def.mods.flags & STATIC) != 0) {
-                            VarSymbol sym = def.sym;
-                            if (trackable(sym)) {
-                                newVar(def);
+                pendingExits = new ListBuffer<>();
+                if (tree.name != names.empty) {
+                    firstadr = nextadr;
+                }
+                classDef = tree;
+                try {
+                    // define all the static fields
+                    for (List<JCTree> l = tree.defs; l.nonEmpty(); l = l.tail) {
+                        if (l.head.hasTag(VARDEF)) {
+                            JCVariableDecl def = (JCVariableDecl)l.head;
+                            if ((def.mods.flags & STATIC) != 0) {
+                                VarSymbol sym = def.sym;
+                                if (trackable(sym)) {
+                                    newVar(def);
+                                }
                             }
                         }
                     }
-                }
 
-                // process all the static initializers
-                for (List<JCTree> l = tree.defs; l.nonEmpty(); l = l.tail) {
-                    if (!l.head.hasTag(METHODDEF) &&
-                        (TreeInfo.flags(l.head) & STATIC) != 0) {
-                        scan(l.head);
+                    // process all the static initializers
+                    for (List<JCTree> l = tree.defs; l.nonEmpty(); l = l.tail) {
+                        if (!l.head.hasTag(METHODDEF) &&
+                            (TreeInfo.flags(l.head) & STATIC) != 0) {
+                            scan(l.head);
+                        }
                     }
-                }
 
-                // define all the instance fields
-                for (List<JCTree> l = tree.defs; l.nonEmpty(); l = l.tail) {
-                    if (l.head.hasTag(VARDEF)) {
-                        JCVariableDecl def = (JCVariableDecl)l.head;
-                        if ((def.mods.flags & STATIC) == 0) {
-                            VarSymbol sym = def.sym;
-                            if (trackable(sym)) {
-                                newVar(def);
+                    // define all the instance fields
+                    for (List<JCTree> l = tree.defs; l.nonEmpty(); l = l.tail) {
+                        if (l.head.hasTag(VARDEF)) {
+                            JCVariableDecl def = (JCVariableDecl)l.head;
+                            if ((def.mods.flags & STATIC) == 0) {
+                                VarSymbol sym = def.sym;
+                                if (trackable(sym)) {
+                                    newVar(def);
+                                }
                             }
                         }
                     }
-                }
 
-                // process all the instance initializers
-                for (List<JCTree> l = tree.defs; l.nonEmpty(); l = l.tail) {
-                    if (!l.head.hasTag(METHODDEF) &&
-                        (TreeInfo.flags(l.head) & STATIC) == 0) {
-                        scan(l.head);
+                    // process all the instance initializers
+                    for (List<JCTree> l = tree.defs; l.nonEmpty(); l = l.tail) {
+                        if (!l.head.hasTag(METHODDEF) &&
+                            (TreeInfo.flags(l.head) & STATIC) == 0) {
+                            scan(l.head);
+                        }
                     }
-                }
 
-                // process all the methods
-                for (List<JCTree> l = tree.defs; l.nonEmpty(); l = l.tail) {
-                    if (l.head.hasTag(METHODDEF)) {
-                        scan(l.head);
+                    // process all the methods
+                    for (List<JCTree> l = tree.defs; l.nonEmpty(); l = l.tail) {
+                        if (l.head.hasTag(METHODDEF)) {
+                            scan(l.head);
+                        }
                     }
+                } finally {
+                    pendingExits = pendingExitsPrev;
+                    nextadr = nextadrPrev;
+                    firstadr = firstadrPrev;
+                    classDef = classDefPrev;
                 }
             } finally {
-                pendingExits = pendingExitsPrev;
-                nextadr = nextadrPrev;
-                firstadr = firstadrPrev;
-                classDef = classDefPrev;
+                lint = lintPrev;
             }
         }
 
-        @Override
         public void visitMethodDef(JCMethodDecl tree) {
             if (tree.body == null) {
                 return;
             }
-            /*  Ignore synthetic methods, except for translated lambda methods.
+
+            /*  MemberEnter can generate synthetic methods ignore them
              */
-            if ((tree.sym.flags() & (SYNTHETIC | LAMBDA_METHOD)) == SYNTHETIC) {
+            if ((tree.sym.flags() & SYNTHETIC) != 0) {
                 return;
             }
 
-            final Bits initsPrev = new Bits(inits);
-            final Bits uninitsPrev = new Bits(uninits);
-            int nextadrPrev = nextadr;
-            int firstadrPrev = firstadr;
-            int returnadrPrev = returnadr;
-
-            Assert.check(pendingExits.isEmpty());
-            boolean lastInitialConstructor = isInitialConstructor;
+            Lint lintPrev = lint;
+            lint = lint.augment(tree.sym);
             try {
-                isInitialConstructor = TreeInfo.isInitialConstructor(tree);
-
-                if (!isInitialConstructor) {
-                    firstadr = nextadr;
+                if (tree.body == null) {
+                    return;
+                }
+                /*  Ignore synthetic methods, except for translated lambda methods.
+                 */
+                if ((tree.sym.flags() & (SYNTHETIC | LAMBDA_METHOD)) == SYNTHETIC) {
+                    return;
                 }
-                for (List<JCVariableDecl> l = tree.params; l.nonEmpty(); l = l.tail) {
-                    JCVariableDecl def = l.head;
-                    scan(def);
-                    Assert.check((def.sym.flags() & PARAMETER) != 0, "Method parameter without PARAMETER flag");
-                    /*  If we are executing the code from Gen, then there can be
-                     *  synthetic or mandated variables, ignore them.
-                     */
-                    initParam(def);
-                }
-                // else we are in an instance initializer block;
-                // leave caught unchanged.
-                scan(tree.body);
+
+                final Bits initsPrev = new Bits(inits);
+                final Bits uninitsPrev = new Bits(uninits);
+                int nextadrPrev = nextadr;
+                int firstadrPrev = firstadr;
+                int returnadrPrev = returnadr;
+
+                Assert.check(pendingExits.isEmpty());
+                boolean lastInitialConstructor = isInitialConstructor;
+                try {
+                    isInitialConstructor = TreeInfo.isInitialConstructor(tree);
 
-                if (isInitialConstructor) {
-                    boolean isSynthesized = (tree.sym.flags() &
-                                             GENERATEDCONSTR) != 0;
-                    for (int i = firstadr; i < nextadr; i++) {
-                        JCVariableDecl vardecl = vardecls[i];
-                        VarSymbol var = vardecl.sym;
-                        if (var.owner == classDef.sym) {
-                            // choose the diagnostic position based on whether
-                            // the ctor is default(synthesized) or not
-                            if (isSynthesized) {
-                                checkInit(TreeInfo.diagnosticPositionFor(var, vardecl),
-                                    var, "var.not.initialized.in.default.constructor");
-                            } else {
-                                checkInit(TreeInfo.diagEndPos(tree.body), var);
+                    if (!isInitialConstructor) {
+                        firstadr = nextadr;
+                    }
+                    for (List<JCVariableDecl> l = tree.params; l.nonEmpty(); l = l.tail) {
+                        JCVariableDecl def = l.head;
+                        scan(def);
+                        Assert.check((def.sym.flags() & PARAMETER) != 0, "Method parameter without PARAMETER flag");
+                        /*  If we are executing the code from Gen, then there can be
+                         *  synthetic or mandated variables, ignore them.
+                         */
+                        initParam(def);
+                    }
+                    // else we are in an instance initializer block;
+                    // leave caught unchanged.
+                    scan(tree.body);
+
+                    if (isInitialConstructor) {
+                        boolean isSynthesized = (tree.sym.flags() &
+                                                 GENERATEDCONSTR) != 0;
+                        for (int i = firstadr; i < nextadr; i++) {
+                            JCVariableDecl vardecl = vardecls[i];
+                            VarSymbol var = vardecl.sym;
+                            if (var.owner == classDef.sym) {
+                                // choose the diagnostic position based on whether
+                                // the ctor is default(synthesized) or not
+                                if (isSynthesized) {
+                                    checkInit(TreeInfo.diagnosticPositionFor(var, vardecl),
+                                        var, "var.not.initialized.in.default.constructor");
+                                } else {
+                                    checkInit(TreeInfo.diagEndPos(tree.body), var);
+                                }
                             }
                         }
                     }
-                }
-                List<P> exits = pendingExits.toList();
-                pendingExits = new ListBuffer<>();
-                while (exits.nonEmpty()) {
-                    P exit = exits.head;
-                    exits = exits.tail;
-                    Assert.check(exit.tree.hasTag(RETURN), exit.tree);
-                    if (isInitialConstructor) {
-                        assignToInits(exit.tree, exit.exit_inits);
-                        for (int i = firstadr; i < nextadr; i++) {
-                            checkInit(exit.tree.pos(), vardecls[i].sym);
+                    List<AssignPendingExit> exits = pendingExits.toList();
+                    pendingExits = new ListBuffer<>();
+                    while (exits.nonEmpty()) {
+                        AssignPendingExit exit = exits.head;
+                        exits = exits.tail;
+                        Assert.check(exit.tree.hasTag(RETURN), exit.tree);
+                        if (isInitialConstructor) {
+                            inits.assign(exit.exit_inits);
+                            for (int i = firstadr; i < nextadr; i++) {
+                                checkInit(exit.tree.pos(), vardecls[i].sym);
+                            }
                         }
                     }
+                } finally {
+                    inits.assign(initsPrev);
+                    uninits.assign(uninitsPrev);
+                    nextadr = nextadrPrev;
+                    firstadr = firstadrPrev;
+                    returnadr = returnadrPrev;
+                    isInitialConstructor = lastInitialConstructor;
                 }
             } finally {
-                assignToInits(tree, initsPrev);
-                uninits.assign(uninitsPrev);
-                nextadr = nextadrPrev;
-                firstadr = firstadrPrev;
-                returnadr = returnadrPrev;
-                isInitialConstructor = lastInitialConstructor;
+                lint = lintPrev;
             }
         }
 
         protected void initParam(JCVariableDecl def) {
             inits.incl(def.sym.adr);
             uninits.excl(def.sym.adr);
-            }
+        }
 
         public void visitVarDef(JCVariableDecl tree) {
-            boolean track = trackable(tree.sym);
-            if (track && tree.sym.owner.kind == MTH) {
-                newVar(tree);
-            }
-            if (tree.init != null) {
-                scanExpr(tree.init);
-                if (track) {
-                    letInit(tree.pos(), tree.sym);
+            Lint lintPrev = lint;
+            lint = lint.augment(tree.sym);
+            try{
+                boolean track = trackable(tree.sym);
+                if (track && tree.sym.owner.kind == MTH) {
+                    newVar(tree);
                 }
+                if (tree.init != null) {
+                    scanExpr(tree.init);
+                    if (track) {
+                        letInit(tree.pos(), tree.sym);
+                    }
+                }
+            } finally {
+                lint = lintPrev;
             }
         }
 
@@ -1840,18 +1884,14 @@
             nextadr = nextadrPrev;
         }
 
-        int getLogNumberOfErrors() {
-            return 0;
-        }
-
         public void visitDoLoop(JCDoWhileLoop tree) {
-            ListBuffer<P> prevPendingExits = pendingExits;
+            ListBuffer<AssignPendingExit> prevPendingExits = pendingExits;
             FlowKind prevFlowKind = flowKind;
             flowKind = FlowKind.NORMAL;
             final Bits initsSkip = new Bits(true);
             final Bits uninitsSkip = new Bits(true);
             pendingExits = new ListBuffer<>();
-            int prevErrors = getLogNumberOfErrors();
+            int prevErrors = log.nerrors;
             do {
                 final Bits uninitsEntry = new Bits(uninits);
                 uninitsEntry.excludeFrom(nextadr);
@@ -1862,28 +1902,28 @@
                     initsSkip.assign(initsWhenFalse);
                     uninitsSkip.assign(uninitsWhenFalse);
                 }
-                if (getLogNumberOfErrors() !=  prevErrors ||
+                if (log.nerrors !=  prevErrors ||
                     flowKind.isFinal() ||
                     new Bits(uninitsEntry).diffSet(uninitsWhenTrue).nextBit(firstadr)==-1)
                     break;
-                assignToInits(tree.cond, initsWhenTrue);
+                inits.assign(initsWhenTrue);
                 uninits.assign(uninitsEntry.andSet(uninitsWhenTrue));
                 flowKind = FlowKind.SPECULATIVE_LOOP;
             } while (true);
             flowKind = prevFlowKind;
-            assignToInits(tree, initsSkip);
+            inits.assign(initsSkip);
             uninits.assign(uninitsSkip);
             resolveBreaks(tree, prevPendingExits);
         }
 
         public void visitWhileLoop(JCWhileLoop tree) {
-            ListBuffer<P> prevPendingExits = pendingExits;
+            ListBuffer<AssignPendingExit> prevPendingExits = pendingExits;
             FlowKind prevFlowKind = flowKind;
             flowKind = FlowKind.NORMAL;
             final Bits initsSkip = new Bits(true);
             final Bits uninitsSkip = new Bits(true);
             pendingExits = new ListBuffer<>();
-            int prevErrors = getLogNumberOfErrors();
+            int prevErrors = log.nerrors;
             final Bits uninitsEntry = new Bits(uninits);
             uninitsEntry.excludeFrom(nextadr);
             do {
@@ -1892,11 +1932,11 @@
                     initsSkip.assign(initsWhenFalse) ;
                     uninitsSkip.assign(uninitsWhenFalse);
                 }
-                assignToInits(tree, initsWhenTrue);
+                inits.assign(initsWhenTrue);
                 uninits.assign(uninitsWhenTrue);
                 scan(tree.body);
                 resolveContinues(tree);
-                if (getLogNumberOfErrors() != prevErrors ||
+                if (log.nerrors != prevErrors ||
                     flowKind.isFinal() ||
                     new Bits(uninitsEntry).diffSet(uninits).nextBit(firstadr) == -1) {
                     break;
@@ -1907,13 +1947,13 @@
             flowKind = prevFlowKind;
             //a variable is DA/DU after the while statement, if it's DA/DU assuming the
             //branch is not taken AND if it's DA/DU before any break statement
-            assignToInits(tree.body, initsSkip);
+            inits.assign(initsSkip);
             uninits.assign(uninitsSkip);
             resolveBreaks(tree, prevPendingExits);
         }
 
         public void visitForLoop(JCForLoop tree) {
-            ListBuffer<P> prevPendingExits = pendingExits;
+            ListBuffer<AssignPendingExit> prevPendingExits = pendingExits;
             FlowKind prevFlowKind = flowKind;
             flowKind = FlowKind.NORMAL;
             int nextadrPrev = nextadr;
@@ -1921,7 +1961,7 @@
             final Bits initsSkip = new Bits(true);
             final Bits uninitsSkip = new Bits(true);
             pendingExits = new ListBuffer<>();
-            int prevErrors = getLogNumberOfErrors();
+            int prevErrors = log.nerrors;
             do {
                 final Bits uninitsEntry = new Bits(uninits);
                 uninitsEntry.excludeFrom(nextadr);
@@ -1931,7 +1971,7 @@
                         initsSkip.assign(initsWhenFalse);
                         uninitsSkip.assign(uninitsWhenFalse);
                     }
-                    assignToInits(tree.body, initsWhenTrue);
+                    inits.assign(initsWhenTrue);
                     uninits.assign(uninitsWhenTrue);
                 } else if (!flowKind.isFinal()) {
                     initsSkip.assign(inits);
@@ -1942,7 +1982,7 @@
                 scan(tree.body);
                 resolveContinues(tree);
                 scan(tree.step);
-                if (getLogNumberOfErrors() != prevErrors ||
+                if (log.nerrors != prevErrors ||
                     flowKind.isFinal() ||
                     new Bits(uninitsEntry).diffSet(uninits).nextBit(firstadr) == -1)
                     break;
@@ -1952,7 +1992,7 @@
             flowKind = prevFlowKind;
             //a variable is DA/DU after a for loop, if it's DA/DU assuming the
             //branch is not taken AND if it's DA/DU before any break statement
-            assignToInits(tree.body, initsSkip);
+            inits.assign(initsSkip);
             uninits.assign(uninitsSkip);
             resolveBreaks(tree, prevPendingExits);
             nextadr = nextadrPrev;
@@ -1961,7 +2001,7 @@
         public void visitForeachLoop(JCEnhancedForLoop tree) {
             visitVarDef(tree.var);
 
-            ListBuffer<P> prevPendingExits = pendingExits;
+            ListBuffer<AssignPendingExit> prevPendingExits = pendingExits;
             FlowKind prevFlowKind = flowKind;
             flowKind = FlowKind.NORMAL;
             int nextadrPrev = nextadr;
@@ -1971,13 +2011,13 @@
 
             letInit(tree.pos(), tree.var.sym);
             pendingExits = new ListBuffer<>();
-            int prevErrors = getLogNumberOfErrors();
+            int prevErrors = log.nerrors;
             do {
                 final Bits uninitsEntry = new Bits(uninits);
                 uninitsEntry.excludeFrom(nextadr);
                 scan(tree.body);
                 resolveContinues(tree);
-                if (getLogNumberOfErrors() != prevErrors ||
+                if (log.nerrors != prevErrors ||
                     flowKind.isFinal() ||
                     new Bits(uninitsEntry).diffSet(uninits).nextBit(firstadr) == -1)
                     break;
@@ -1985,21 +2025,21 @@
                 flowKind = FlowKind.SPECULATIVE_LOOP;
             } while (true);
             flowKind = prevFlowKind;
-            assignToInits(tree.body, initsStart);
+            inits.assign(initsStart);
             uninits.assign(uninitsStart.andSet(uninits));
             resolveBreaks(tree, prevPendingExits);
             nextadr = nextadrPrev;
         }
 
         public void visitLabelled(JCLabeledStatement tree) {
-            ListBuffer<P> prevPendingExits = pendingExits;
+            ListBuffer<AssignPendingExit> prevPendingExits = pendingExits;
             pendingExits = new ListBuffer<>();
             scan(tree.body);
             resolveBreaks(tree, prevPendingExits);
         }
 
         public void visitSwitch(JCSwitch tree) {
-            ListBuffer<P> prevPendingExits = pendingExits;
+            ListBuffer<AssignPendingExit> prevPendingExits = pendingExits;
             pendingExits = new ListBuffer<>();
             int nextadrPrev = nextadr;
             scanExpr(tree.selector);
@@ -2007,7 +2047,7 @@
             final Bits uninitsSwitch = new Bits(uninits);
             boolean hasDefault = false;
             for (List<JCCase> l = tree.cases; l.nonEmpty(); l = l.tail) {
-                assignToInits(l.head, initsSwitch);
+                inits.assign(initsSwitch);
                 uninits.assign(uninits.andSet(uninitsSwitch));
                 JCCase c = l.head;
                 if (c.pat == null) {
@@ -2016,19 +2056,19 @@
                     scanExpr(c.pat);
                 }
                 if (hasDefault) {
-                    assignToInits(null, initsSwitch);
+                    inits.assign(initsSwitch);
                     uninits.assign(uninits.andSet(uninitsSwitch));
                 }
                 scan(c.stats);
                 addVars(c.stats, initsSwitch, uninitsSwitch);
                 if (!hasDefault) {
-                    assignToInits(l.head.stats.last(), initsSwitch);
+                    inits.assign(initsSwitch);
                     uninits.assign(uninits.andSet(uninitsSwitch));
                 }
                 // Warn about fall-through if lint switch fallthrough enabled.
             }
             if (!hasDefault) {
-                andSetInits(null, initsSwitch);
+                inits.andSet(initsSwitch);
             }
             resolveBreaks(tree, prevPendingExits);
             nextadr = nextadrPrev;
@@ -2047,16 +2087,10 @@
                 }
             }
 
-        boolean isEnabled(Lint.LintCategory lc) {
-            return false;
-        }
-
-        void reportWarning(Lint.LintCategory lc, DiagnosticPosition pos, String key, Object ... args) {}
-
         public void visitTry(JCTry tree) {
             ListBuffer<JCVariableDecl> resourceVarDecls = new ListBuffer<>();
             final Bits uninitsTryPrev = new Bits(uninitsTry);
-            ListBuffer<P> prevPendingExits = pendingExits;
+            ListBuffer<AssignPendingExit> prevPendingExits = pendingExits;
             pendingExits = new ListBuffer<>();
             final Bits initsTry = new Bits(inits);
             uninitsTry.assign(uninits);
@@ -2079,10 +2113,10 @@
             int nextadrCatch = nextadr;
 
             if (!resourceVarDecls.isEmpty() &&
-                    isEnabled(Lint.LintCategory.TRY)) {
+                    lint.isEnabled(Lint.LintCategory.TRY)) {
                 for (JCVariableDecl resVar : resourceVarDecls) {
                     if (unrefdResources.includes(resVar.sym)) {
-                        reportWarning(Lint.LintCategory.TRY, resVar.pos(),
+                        log.warning(Lint.LintCategory.TRY, resVar.pos(),
                                     "try.resource.not.referenced", resVar.sym);
                         unrefdResources.remove(resVar.sym);
                     }
@@ -2098,7 +2132,7 @@
 
             for (List<JCCatch> l = tree.catchers; l.nonEmpty(); l = l.tail) {
                 JCVariableDecl param = l.head.param;
-                assignToInits(tree.body, initsCatchPrev);
+                inits.assign(initsCatchPrev);
                 uninits.assign(uninitsCatchPrev);
                 scan(param);
                 /* If this is a TWR and we are executing the code from Gen,
@@ -2111,9 +2145,9 @@
                 nextadr = nextadrCatch;
             }
             if (tree.finalizer != null) {
-                assignToInits(tree.finalizer, initsTry);
+                inits.assign(initsTry);
                 uninits.assign(uninitsTry);
-                ListBuffer<P> exits = pendingExits;
+                ListBuffer<AssignPendingExit> exits = pendingExits;
                 pendingExits = prevPendingExits;
                 scan(tree.finalizer);
                 if (!tree.finallyCanCompleteNormally) {
@@ -2123,19 +2157,19 @@
                     // FIX: this doesn't preserve source order of exits in catch
                     // versus finally!
                     while (exits.nonEmpty()) {
-                        P exit = exits.next();
+                        AssignPendingExit exit = exits.next();
                         if (exit.exit_inits != null) {
                             exit.exit_inits.orSet(inits);
                             exit.exit_uninits.andSet(uninits);
                         }
                         pendingExits.append(exit);
                     }
-                    orSetInits(tree, initsEnd);
+                    inits.orSet(initsEnd);
                 }
             } else {
-                assignToInits(tree, initsEnd);
+                inits.assign(initsEnd);
                 uninits.assign(uninitsEnd);
-                ListBuffer<P> exits = pendingExits;
+                ListBuffer<AssignPendingExit> exits = pendingExits;
                 pendingExits = prevPendingExits;
                 while (exits.nonEmpty()) pendingExits.append(exits.next());
             }
@@ -2146,7 +2180,7 @@
             scanCond(tree.cond);
             final Bits initsBeforeElse = new Bits(initsWhenFalse);
             final Bits uninitsBeforeElse = new Bits(uninitsWhenFalse);
-            assignToInits(tree.cond, initsWhenTrue);
+            inits.assign(initsWhenTrue);
             uninits.assign(uninitsWhenTrue);
             if (tree.truepart.type.hasTag(BOOLEAN) &&
                 tree.falsepart.type.hasTag(BOOLEAN)) {
@@ -2159,7 +2193,7 @@
                 final Bits initsAfterThenWhenFalse = new Bits(initsWhenFalse);
                 final Bits uninitsAfterThenWhenTrue = new Bits(uninitsWhenTrue);
                 final Bits uninitsAfterThenWhenFalse = new Bits(uninitsWhenFalse);
-                assignToInits(tree.truepart, initsBeforeElse);
+                inits.assign(initsBeforeElse);
                 uninits.assign(uninitsBeforeElse);
                 scanCond(tree.falsepart);
                 initsWhenTrue.andSet(initsAfterThenWhenTrue);
@@ -2170,10 +2204,10 @@
                 scanExpr(tree.truepart);
                 final Bits initsAfterThen = new Bits(inits);
                 final Bits uninitsAfterThen = new Bits(uninits);
-                assignToInits(tree.truepart, initsBeforeElse);
+                inits.assign(initsBeforeElse);
                 uninits.assign(uninitsBeforeElse);
                 scanExpr(tree.falsepart);
-                andSetInits(tree.falsepart, initsAfterThen);
+                inits.andSet(initsAfterThen);
                 uninits.andSet(uninitsAfterThen);
             }
         }
@@ -2182,46 +2216,42 @@
             scanCond(tree.cond);
             final Bits initsBeforeElse = new Bits(initsWhenFalse);
             final Bits uninitsBeforeElse = new Bits(uninitsWhenFalse);
-            assignToInits(tree.cond, initsWhenTrue);
+            inits.assign(initsWhenTrue);
             uninits.assign(uninitsWhenTrue);
             scan(tree.thenpart);
             if (tree.elsepart != null) {
                 final Bits initsAfterThen = new Bits(inits);
                 final Bits uninitsAfterThen = new Bits(uninits);
-                assignToInits(tree.thenpart, initsBeforeElse);
+                inits.assign(initsBeforeElse);
                 uninits.assign(uninitsBeforeElse);
                 scan(tree.elsepart);
-                andSetInits(tree.elsepart, initsAfterThen);
+                inits.andSet(initsAfterThen);
                 uninits.andSet(uninitsAfterThen);
             } else {
-                andSetInits(tree.thenpart, initsBeforeElse);
+                inits.andSet(initsBeforeElse);
                 uninits.andSet(uninitsBeforeElse);
             }
         }
 
-        protected P createNewPendingExit(JCTree tree, Bits inits, Bits uninits) {
-            return null;
-        }
-
         @Override
         public void visitBreak(JCBreak tree) {
-            recordExit(tree, createNewPendingExit(tree, inits, uninits));
+            recordExit(new AssignPendingExit(tree, inits, uninits));
         }
 
         @Override
         public void visitContinue(JCContinue tree) {
-            recordExit(tree, createNewPendingExit(tree, inits, uninits));
+            recordExit(new AssignPendingExit(tree, inits, uninits));
         }
 
         @Override
         public void visitReturn(JCReturn tree) {
             scanExpr(tree.expr);
-            recordExit(tree, createNewPendingExit(tree, inits, uninits));
+            recordExit(new AssignPendingExit(tree, inits, uninits));
         }
 
         public void visitThrow(JCThrow tree) {
             scanExpr(tree.expr);
-            markDead(tree.expr);
+            markDead();
         }
 
         public void visitApply(JCMethodInvocation tree) {
@@ -2240,7 +2270,7 @@
             final Bits prevUninits = new Bits(uninits);
             final Bits prevInits = new Bits(inits);
             int returnadrPrev = returnadr;
-            ListBuffer<P> prevPending = pendingExits;
+            ListBuffer<AssignPendingExit> prevPending = pendingExits;
             try {
                 returnadr = nextadr;
                 pendingExits = new ListBuffer<>();
@@ -2259,7 +2289,7 @@
             finally {
                 returnadr = returnadrPrev;
                 uninits.assign(prevUninits);
-                assignToInits(tree, prevInits);
+                inits.assign(prevInits);
                 pendingExits = prevPending;
             }
         }
@@ -2275,11 +2305,11 @@
             scanCond(tree.cond);
             uninitsExit.andSet(uninitsWhenTrue);
             if (tree.detail != null) {
-                assignToInits(tree, initsWhenFalse);
+                inits.assign(initsWhenFalse);
                 uninits.assign(uninitsWhenFalse);
                 scanExpr(tree.detail);
             }
-            assignToInits(tree, initsExit);
+            inits.assign(initsExit);
             uninits.assign(uninitsExit);
         }
 
@@ -2308,8 +2338,7 @@
             if (enforceThisDotInit &&
                 tree.selected.hasTag(IDENT) &&
                 ((JCIdent)tree.selected).name == names._this &&
-                tree.sym.kind == VAR)
-            {
+                tree.sym.kind == VAR) {
                 checkInit(tree.pos(), (VarSymbol)tree.sym);
             }
         }
@@ -2347,7 +2376,7 @@
                 scanCond(tree.lhs);
                 final Bits initsWhenFalseLeft = new Bits(initsWhenFalse);
                 final Bits uninitsWhenFalseLeft = new Bits(uninitsWhenFalse);
-                assignToInits(tree.lhs, initsWhenTrue);
+                inits.assign(initsWhenTrue);
                 uninits.assign(uninitsWhenTrue);
                 scanCond(tree.rhs);
                 initsWhenFalse.andSet(initsWhenFalseLeft);
@@ -2357,7 +2386,7 @@
                 scanCond(tree.lhs);
                 final Bits initsWhenTrueLeft = new Bits(initsWhenTrue);
                 final Bits uninitsWhenTrueLeft = new Bits(uninitsWhenTrue);
-                assignToInits(tree.lhs, initsWhenFalse);
+                inits.assign(initsWhenFalse);
                 uninits.assign(uninitsWhenFalse);
                 scanCond(tree.rhs);
                 initsWhenTrue.andSet(initsWhenTrueLeft);
@@ -2428,136 +2457,6 @@
         }
     }
 
-    public class AssignAnalyzer extends AbstractAssignAnalyzer<AssignAnalyzer.AssignPendingExit> {
-
-        public class AssignPendingExit extends AbstractAssignAnalyzer<AssignPendingExit>.AbstractAssignPendingExit {
-
-            public AssignPendingExit(JCTree tree, final Bits inits, final Bits uninits) {
-                super(tree, inits, uninits);
-            }
-        }
-
-        @Override
-        protected AssignPendingExit createNewPendingExit(JCTree tree,
-            Bits inits, Bits uninits) {
-            return new AssignPendingExit(tree, inits, uninits);
-        }
-
-        /** Record an initialization of a trackable variable.
-         */
-        @Override
-        void letInit(DiagnosticPosition pos, VarSymbol sym) {
-            if (sym.adr >= firstadr && trackable(sym)) {
-                if ((sym.flags() & EFFECTIVELY_FINAL) != 0) {
-                    if (!uninits.isMember(sym.adr)) {
-                        //assignment targeting an effectively final variable
-                        //makes the variable lose its status of effectively final
-                        //if the variable is _not_ definitively unassigned
-                        sym.flags_field &= ~EFFECTIVELY_FINAL;
-                    } else {
-                        uninit(sym);
-                    }
-                }
-                else if ((sym.flags() & FINAL) != 0) {
-                    if ((sym.flags() & PARAMETER) != 0) {
-                        if ((sym.flags() & UNION) != 0) { //multi-catch parameter
-                            log.error(pos, "multicatch.parameter.may.not.be.assigned", sym);
-                        }
-                        else {
-                            log.error(pos, "final.parameter.may.not.be.assigned",
-                                  sym);
-                        }
-                    } else if (!uninits.isMember(sym.adr)) {
-                        log.error(pos, flowKind.errKey, sym);
-                    } else {
-                        uninit(sym);
-                    }
-                }
-                inits.incl(sym.adr);
-            } else if ((sym.flags() & FINAL) != 0) {
-                log.error(pos, "var.might.already.be.assigned", sym);
-            }
-        }
-
-        @Override
-        void checkInit(DiagnosticPosition pos, VarSymbol sym, String errkey) {
-            if ((sym.adr >= firstadr || sym.owner.kind != TYP) &&
-                trackable(sym) &&
-                !inits.isMember(sym.adr)) {
-                log.error(pos, errkey, sym);
-                inits.incl(sym.adr);
-            }
-        }
-
-        @Override
-        void reportWarning(Lint.LintCategory lc, DiagnosticPosition pos,
-            String key, Object ... args) {
-            log.warning(lc, pos, key, args);
-        }
-
-        @Override
-        int getLogNumberOfErrors() {
-            return log.nerrors;
-        }
-
-        @Override
-        boolean isEnabled(Lint.LintCategory lc) {
-            return lint.isEnabled(lc);
-        }
-
-        @Override
-        public void visitClassDef(JCClassDecl tree) {
-            if (tree.sym == null) {
-                return;
-            }
-
-            Lint lintPrev = lint;
-            lint = lint.augment(tree.sym);
-            try {
-                super.visitClassDef(tree);
-            } finally {
-                lint = lintPrev;
-            }
-        }
-
-        @Override
-        public void visitMethodDef(JCMethodDecl tree) {
-            if (tree.body == null) {
-                return;
-            }
-
-            /*  MemberEnter can generate synthetic methods ignore them
-             */
-            if ((tree.sym.flags() & SYNTHETIC) != 0) {
-                return;
-            }
-
-            Lint lintPrev = lint;
-            lint = lint.augment(tree.sym);
-            try {
-                super.visitMethodDef(tree);
-            } finally {
-                lint = lintPrev;
-            }
-        }
-
-        @Override
-        public void visitVarDef(JCVariableDecl tree) {
-            if (tree.init == null) {
-                super.visitVarDef(tree);
-            } else {
-                Lint lintPrev = lint;
-                lint = lint.augment(tree.sym);
-                try{
-                    super.visitVarDef(tree);
-                } finally {
-                    lint = lintPrev;
-                }
-            }
-        }
-
-    }
-
     /**
      * This pass implements the last step of the dataflow analysis, namely
      * the effectively-final analysis check. This checks that every local variable
@@ -2572,7 +2471,7 @@
         JCTree currentTree; //local class or lambda
 
         @Override
-        void markDead(JCTree tree) {
+        void markDead() {
             //do nothing
         }
 
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java	Mon Feb 23 05:01:11 2015 -0800
@@ -80,6 +80,7 @@
     private Names names;
     private Symtab syms;
     private Resolve rs;
+    private Operators operators;
     private TreeMaker make;
     private Types types;
     private TransTypes transTypes;
@@ -130,6 +131,7 @@
         names = Names.instance(context);
         syms = Symtab.instance(context);
         rs = Resolve.instance(context);
+        operators = Operators.instance(context);
         make = TreeMaker.instance(context);
         types = Types.instance(context);
         transTypes = TransTypes.instance(context);
@@ -654,7 +656,7 @@
 
     private JCExpression eqTest(Type argType, JCExpression arg1, JCExpression arg2) {
         JCBinary testExpr = make.Binary(JCTree.Tag.EQ, arg1, arg2);
-        testExpr.operator = rs.resolveBinaryOperator(null, JCTree.Tag.EQ, attrEnv, argType, argType);
+        testExpr.operator = operators.resolveBinary(testExpr, JCTree.Tag.EQ, argType, argType);
         testExpr.setType(syms.booleanType);
         return testExpr;
     }
@@ -668,7 +670,7 @@
                 List.<JCExpression>of(make.Literal(lit)));
         eqtest.setType(syms.booleanType);
         JCBinary compound = make.Binary(JCTree.Tag.AND, prev, eqtest);
-        compound.operator = rs.resolveBinaryOperator(null, JCTree.Tag.AND, attrEnv, syms.booleanType, syms.booleanType);
+        compound.operator = operators.resolveBinary(compound, JCTree.Tag.AND, syms.booleanType, syms.booleanType);
         compound.setType(syms.booleanType);
         return compound;
     }
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java	Mon Feb 23 05:01:11 2015 -0800
@@ -74,6 +74,7 @@
     private final Log log;
     private final Symtab syms;
     private final Resolve rs;
+    private final Operators operators;
     private final Check chk;
     private final Attr attr;
     private TreeMaker make;
@@ -95,6 +96,7 @@
         log = Log.instance(context);
         syms = Symtab.instance(context);
         rs = Resolve.instance(context);
+        operators = Operators.instance(context);
         chk = Check.instance(context);
         attr = Attr.instance(context);
         make = TreeMaker.instance(context);
@@ -575,8 +577,7 @@
      */
     JCUnary makeUnary(JCTree.Tag optag, JCExpression arg) {
         JCUnary tree = make.Unary(optag, arg);
-        tree.operator = rs.resolveUnaryOperator(
-            make_pos, optag, attrEnv, arg.type);
+        tree.operator = operators.resolveUnary(tree, optag, arg.type);
         tree.type = tree.operator.type.getReturnType();
         return tree;
     }
@@ -588,8 +589,7 @@
      */
     JCBinary makeBinary(JCTree.Tag optag, JCExpression lhs, JCExpression rhs) {
         JCBinary tree = make.Binary(optag, lhs, rhs);
-        tree.operator = rs.resolveBinaryOperator(
-            make_pos, optag, attrEnv, lhs.type, rhs.type);
+        tree.operator = operators.resolveBinary(tree, optag, lhs.type, rhs.type);
         tree.type = tree.operator.type.getReturnType();
         return tree;
     }
@@ -601,8 +601,7 @@
      */
     JCAssignOp makeAssignop(JCTree.Tag optag, JCTree lhs, JCTree rhs) {
         JCAssignOp tree = make.Assignop(optag, lhs, rhs);
-        tree.operator = rs.resolveBinaryOperator(
-            make_pos, tree.getTag().noAssignOp(), attrEnv, lhs.type, rhs.type);
+        tree.operator = operators.resolveBinary(tree, tree.getTag().noAssignOp(), lhs.type, rhs.type);
         tree.type = lhs.type;
         return tree;
     }
@@ -2644,7 +2643,6 @@
 
             MethodSymbol m = tree.sym;
             tree.params = tree.params.prepend(ordParam).prepend(nameParam);
-            incrementParamTypeAnnoIndexes(m, 2);
 
             m.extraParams = m.extraParams.prepend(ordParam.sym);
             m.extraParams = m.extraParams.prepend(nameParam.sym);
@@ -2667,17 +2665,6 @@
             currentMethodSym = prevMethodSym;
         }
     }
-    //where
-    private void incrementParamTypeAnnoIndexes(MethodSymbol m,
-                                               int amount) {
-        for (final Attribute.TypeCompound anno : m.getRawTypeAttributes()) {
-            // Increment the parameter_index of any existing formal
-            // parameter annotations.
-            if (anno.position.type == TargetType.METHOD_FORMAL_PARAMETER) {
-                anno.position.parameter_index += amount;
-            }
-        }
-    }
 
     private void visitMethodDefInternal(JCMethodDecl tree) {
         if (tree.name == names.init &&
@@ -2711,7 +2698,6 @@
             tree.params = tree.params.appendList(fvdefs);
             if (currentClass.hasOuterInstance()) {
                 tree.params = tree.params.prepend(otdef);
-                incrementParamTypeAnnoIndexes(m, 1);
             }
 
             // If this is an initial constructor, i.e., it does not start with
@@ -3206,9 +3192,8 @@
                         // tree.lhs.  However, we can still get the
                         // unerased type of tree.lhs as it is stored
                         // in tree.type in Attr.
-                        Symbol newOperator = rs.resolveBinaryOperator(tree.pos(),
+                        Symbol newOperator = operators.resolveBinary(tree,
                                                                       newTag,
-                                                                      attrEnv,
                                                                       tree.type,
                                                                       tree.rhs.type);
                         JCExpression expr = (JCExpression)lhs;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Operators.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,850 @@
+/*
+ * 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 com.sun.tools.javac.comp;
+
+import com.sun.tools.javac.code.Symbol;
+import com.sun.tools.javac.code.Symbol.OperatorSymbol;
+import com.sun.tools.javac.code.Symtab;
+import com.sun.tools.javac.code.Type;
+import com.sun.tools.javac.code.Type.MethodType;
+import com.sun.tools.javac.code.TypeTag;
+import com.sun.tools.javac.code.Types;
+import com.sun.tools.javac.jvm.ByteCodes;
+import com.sun.tools.javac.resources.CompilerProperties.Errors;
+import com.sun.tools.javac.tree.JCTree;
+import com.sun.tools.javac.tree.JCTree.Tag;
+import com.sun.tools.javac.util.Assert;
+import com.sun.tools.javac.util.Context;
+import com.sun.tools.javac.util.JCDiagnostic;
+import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
+import com.sun.tools.javac.util.List;
+import com.sun.tools.javac.util.Log;
+import com.sun.tools.javac.util.Name;
+import com.sun.tools.javac.util.Names;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Optional;
+import java.util.function.BiPredicate;
+import java.util.function.Function;
+import java.util.function.Predicate;
+import java.util.function.Supplier;
+import java.util.stream.Stream;
+
+import static com.sun.tools.javac.jvm.ByteCodes.*;
+import static com.sun.tools.javac.comp.Operators.OperatorType.*;
+
+/**
+ * This class contains the logic for unary and binary operator resolution/lookup.
+ *
+ * <p><b>This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own risk.
+ * This code and its internal interfaces are subject to change or
+ * deletion without notice.</b>
+ */
+public class Operators {
+    protected static final Context.Key<Operators> operatorsKey = new Context.Key<>();
+
+    private final Names names;
+    private final Log log;
+    private final Symtab syms;
+    private final Types types;
+
+    /** Unary operators map. */
+    private Map<Name, List<UnaryOperatorHelper>> unaryOperators = new HashMap<>(Tag.getNumberOfOperators());
+
+    /** Binary operators map. */
+    private Map<Name, List<BinaryOperatorHelper>> binaryOperators = new HashMap<>(Tag.getNumberOfOperators());
+
+    /** The names of all operators. */
+    private Name[] opname = new Name[Tag.getNumberOfOperators()];
+
+    public static Operators instance(Context context) {
+        Operators instance = context.get(operatorsKey);
+        if (instance == null)
+            instance = new Operators(context);
+        return instance;
+    }
+
+    protected Operators(Context context) {
+        context.put(operatorsKey, this);
+        syms = Symtab.instance(context);
+        names = Names.instance(context);
+        log = Log.instance(context);
+        types = Types.instance(context);
+        initOperatorNames();
+        initUnaryOperators();
+        initBinaryOperators();
+    }
+
+    /**
+     * Perform unary promotion of a type; this routine implements JLS 5.6.1.
+     * If the input type is not supported by unary promotion, it is returned unaltered.
+     */
+    Type unaryPromotion(Type t) {
+        Type unboxed = types.unboxedTypeOrType(t);
+        switch (unboxed.getTag()) {
+            case BYTE:
+            case SHORT:
+            case CHAR:
+                return syms.intType;
+            default:
+                return unboxed;
+        }
+    }
+
+    /**
+     * Perform binary promotion of a pair of types; this routine implements JLS 5.6.2.
+     * If the input types are not supported by unary promotion, if such types are identical to
+     * a type C, then C is returned, otherwise Object is returned.
+     */
+    Type binaryPromotion(Type t1, Type t2) {
+        Type unboxedT1 = types.unboxedTypeOrType(t1);
+        Type unboxedT2 = types.unboxedTypeOrType(t2);
+
+        if (unboxedT1.isNumeric() && unboxedT2.isNumeric()) {
+            if (unboxedT1.hasTag(TypeTag.DOUBLE) || unboxedT2.hasTag(TypeTag.DOUBLE)) {
+                return syms.doubleType;
+            } else if (unboxedT1.hasTag(TypeTag.FLOAT) || unboxedT2.hasTag(TypeTag.FLOAT)) {
+                return syms.floatType;
+            } else if (unboxedT1.hasTag(TypeTag.LONG) || unboxedT2.hasTag(TypeTag.LONG)) {
+                return syms.longType;
+            } else {
+                return syms.intType;
+            }
+        } else if (types.isSameType(unboxedT1, unboxedT2)) {
+            return unboxedT1;
+        } else {
+            return syms.objectType;
+        }
+    }
+
+    /**
+     * Entry point for resolving a unary operator given an operator tag and an argument type.
+     */
+    Symbol resolveUnary(DiagnosticPosition pos, JCTree.Tag tag, Type op) {
+        return resolve(tag,
+                unaryOperators,
+                unop -> unop.test(op),
+                unop -> unop.resolve(op),
+                () -> reportErrorIfNeeded(pos, tag, op));
+    }
+
+    /**
+     * Entry point for resolving a binary operator given an operator tag and a pair of argument types.
+     */
+    Symbol resolveBinary(DiagnosticPosition pos, JCTree.Tag tag, Type op1, Type op2) {
+        return resolve(tag,
+                binaryOperators,
+                binop -> binop.test(op1, op2),
+                binop -> binop.resolve(op1, op2),
+                () -> reportErrorIfNeeded(pos, tag, op1, op2));
+    }
+
+    /**
+     * Main operator lookup routine; lookup an operator (either unary or binary) in its corresponding
+     * map. If there's a matching operator, its resolve routine is called and the result is returned;
+     * otherwise the result of a fallback function is returned.
+     */
+    private <O> Symbol resolve(Tag tag, Map<Name, List<O>> opMap, Predicate<O> opTestFunc,
+                       Function<O, Symbol> resolveFunc, Supplier<Symbol> noResultFunc) {
+        return opMap.get(operatorName(tag)).stream()
+                .filter(opTestFunc)
+                .map(resolveFunc)
+                .findFirst()
+                .orElseGet(noResultFunc);
+    }
+
+    /**
+     * Creates an operator symbol.
+     */
+    private Symbol makeOperator(Name name, List<OperatorType> formals, OperatorType res, int... opcodes) {
+        MethodType opType = new MethodType(
+                formals.stream()
+                        .map(o -> o.asType(syms))
+                        .collect(List.collector()),
+                res.asType(syms), List.nil(), syms.methodClass);
+        return new OperatorSymbol(name, opType, mergeOpcodes(opcodes), syms.noSymbol);
+    }
+
+    /**
+     * Fold two opcodes in a single int value (if required).
+     */
+    private int mergeOpcodes(int... opcodes) {
+        int opcodesLen = opcodes.length;
+        Assert.check(opcodesLen == 1 || opcodesLen == 2);
+        return (opcodesLen == 1) ?
+                opcodes[0] :
+                ((opcodes[0] << ByteCodes.preShift) | opcodes[1]);
+    }
+
+    /**
+     * Report an operator lookup error.
+     */
+    private Symbol reportErrorIfNeeded(DiagnosticPosition pos, Tag tag, Type... args) {
+        if (Stream.of(args).noneMatch(Type::isErroneous)) {
+            Name opName = operatorName(tag);
+            JCDiagnostic.Error opError = (args.length) == 1 ?
+                    Errors.OperatorCantBeApplied(opName, args[0]) :
+                    Errors.OperatorCantBeApplied1(opName, args[0], args[1]);
+            log.error(pos, opError);
+        }
+        return syms.noSymbol;
+    }
+
+    /**
+     * Return name of operator with given tree tag.
+     */
+    public Name operatorName(JCTree.Tag tag) {
+        return opname[tag.operatorIndex()];
+    }
+
+    /**
+     * The constants in this enum represent the types upon which all the operator helpers
+     * operate upon. This allows lazy and consise mapping between a type name and a type instance.
+     */
+    enum OperatorType {
+        BYTE(syms -> syms.byteType),
+        SHORT(syms -> syms.shortType),
+        INT(syms -> syms.intType),
+        LONG(syms -> syms.longType),
+        FLOAT(syms -> syms.floatType),
+        DOUBLE(syms -> syms.doubleType),
+        CHAR(syms -> syms.charType),
+        BOOLEAN(syms -> syms.booleanType),
+        OBJECT(syms -> syms.objectType),
+        STRING(syms -> syms.stringType),
+        BOT(syms -> syms.botType);
+
+        final Function<Symtab, Type> asTypeFunc;
+
+        OperatorType(Function<Symtab, Type> asTypeFunc) {
+            this.asTypeFunc = asTypeFunc;
+        }
+
+        Type asType(Symtab syms) {
+            return asTypeFunc.apply(syms);
+        }
+    }
+
+    /**
+     * Common root for all operator helpers. An operator helper instance is associated with a
+     * given operator (i.e. '+'); it contains routines to perform operator lookup, i.e. find
+     * which version of the '+' operator is the best given an argument type list. Supported
+     * operator symbols are initialized lazily upon first lookup request - this is in order to avoid
+     * initialization circularities between this class and {@code Symtab}.
+     */
+    abstract class OperatorHelper {
+
+        /** The operator name. */
+        final Name name;
+
+        /** The list of symbols associated with this operator (lazily populated). */
+        Optional<Symbol[]> alternatives = Optional.empty();
+
+        /** An array of operator symbol suppliers (used to lazily populate the symbol list). */
+        List<Supplier<Symbol>> operatorSuppliers = List.nil();
+
+        @SuppressWarnings("varargs")
+        OperatorHelper(Tag tag) {
+            this.name = operatorName(tag);
+        }
+
+        /**
+         * This routine implements the main operator lookup process. Each operator is tested
+         * using an applicability predicate; if the test suceeds that same operator is returned,
+         * otherwise a dummy symbol is returned.
+         */
+        final Symbol doLookup(Predicate<Symbol> applicabilityTest) {
+            return Stream.of(alternatives.orElseGet(this::initOperators))
+                    .filter(applicabilityTest)
+                    .findFirst()
+                    .orElse(syms.noSymbol);
+        }
+
+        /**
+         * This routine performs lazy instantiation of the operator symbols supported by this helper.
+         * After initialization is done, the suppliers are cleared, to free up memory.
+         */
+        private Symbol[] initOperators() {
+            Symbol[] operators = operatorSuppliers.stream()
+                    .map(op -> op.get())
+                    .toArray(Symbol[]::new);
+            alternatives = Optional.of(operators);
+            operatorSuppliers = null; //let GC do its work
+            return operators;
+        }
+    }
+
+    /**
+     * Common superclass for all unary operator helpers.
+     */
+    abstract class UnaryOperatorHelper extends OperatorHelper implements Predicate<Type> {
+
+        UnaryOperatorHelper(Tag tag) {
+            super(tag);
+        }
+
+        /**
+         * This routine implements the unary operator lookup process. It customizes the behavior
+         * of the shared lookup routine in {@link OperatorHelper}, by using an unary applicability test
+         * (see {@link UnaryOperatorHelper#isUnaryOperatorApplicable(OperatorSymbol, Type)}
+         */
+        final Symbol doLookup(Type t) {
+            return doLookup(op -> isUnaryOperatorApplicable((OperatorSymbol)op, t));
+        }
+
+        /**
+         * Unary operator applicability test - is the input type the same as the expected operand type?
+         */
+        boolean isUnaryOperatorApplicable(OperatorSymbol op, Type t) {
+            return types.isSameType(op.type.getParameterTypes().head, t);
+        }
+
+        /**
+         * Adds a unary operator symbol.
+         */
+        final UnaryOperatorHelper addUnaryOperator(OperatorType arg, OperatorType res, int... opcode) {
+            operatorSuppliers = operatorSuppliers.prepend(() -> makeOperator(name, List.of(arg), res, opcode));
+            return this;
+        }
+
+        /**
+         * This method will be overridden by unary operator helpers to provide custom resolution
+         * logic.
+         */
+        abstract Symbol resolve(Type t);
+    }
+
+    abstract class BinaryOperatorHelper extends OperatorHelper implements BiPredicate<Type, Type> {
+
+        BinaryOperatorHelper(Tag tag) {
+            super(tag);
+        }
+
+        /**
+         * This routine implements the binary operator lookup process. It customizes the behavior
+         * of the shared lookup routine in {@link OperatorHelper}, by using an unary applicability test
+         * (see {@link BinaryOperatorHelper#isBinaryOperatorApplicable(OperatorSymbol, Type, Type)}
+         */
+        final Symbol doLookup(Type t1, Type t2) {
+            return doLookup(op -> isBinaryOperatorApplicable((OperatorSymbol)op, t1, t2));
+        }
+
+        /**
+         * Binary operator applicability test - are the input types the same as the expected operand types?
+         */
+        boolean isBinaryOperatorApplicable(OperatorSymbol op, Type t1, Type t2) {
+            List<Type> formals = op.type.getParameterTypes();
+            return types.isSameType(formals.head, t1) &&
+                    types.isSameType(formals.tail.head, t2);
+        }
+
+        /**
+         * Adds a binary operator symbol.
+         */
+        final BinaryOperatorHelper addBinaryOperator(OperatorType arg1, OperatorType arg2, OperatorType res, int... opcode) {
+            operatorSuppliers = operatorSuppliers.prepend(() -> makeOperator(name, List.of(arg1, arg2), res, opcode));
+            return this;
+        }
+
+        /**
+         * This method will be overridden by binary operator helpers to provide custom resolution
+         * logic.
+         */
+        abstract Symbol resolve(Type t1, Type t2);
+    }
+
+    /**
+     * Class representing unary operator helpers that operate on reference types.
+     */
+    class UnaryReferenceOperator extends UnaryOperatorHelper {
+
+        UnaryReferenceOperator(Tag tag) {
+            super(tag);
+        }
+
+        @Override
+        public boolean test(Type type) {
+            return type.isNullOrReference();
+        }
+
+        @Override
+        public Symbol resolve(Type arg) {
+            return doLookup(syms.objectType);
+        }
+    }
+
+    /**
+     * Class representing unary operator helpers that operate on numeric types (either boxed or unboxed).
+     * Operator lookup is performed after applying numeric promotion of the input type.
+     */
+    class UnaryNumericOperator extends UnaryOperatorHelper {
+
+        UnaryNumericOperator(Tag tag) {
+            super(tag);
+        }
+
+        @Override
+        public boolean test(Type type) {
+            return unaryPromotion(type).isNumeric();
+        }
+
+        @Override
+        public Symbol resolve(Type arg) {
+            return doLookup(unaryPromotion(arg));
+        }
+    }
+
+    /**
+     * Class representing unary operator helpers that operate on boolean types  (either boxed or unboxed).
+     * Operator lookup is performed assuming the input type is a boolean type.
+     */
+    class UnaryBooleanOperator extends UnaryOperatorHelper {
+
+        UnaryBooleanOperator(Tag tag) {
+            super(tag);
+        }
+
+        @Override
+        public boolean test(Type type) {
+            return types.unboxedTypeOrType(type).hasTag(TypeTag.BOOLEAN);
+        }
+
+        @Override
+        public Symbol resolve(Type arg) {
+            return doLookup(syms.booleanType);
+        }
+    }
+
+    /**
+     * Class representing prefix/postfix unary operator helpers. Operates on numeric types (either
+     * boxed or unboxed). Operator lookup is performed on the unboxed version of the input type.
+     */
+    class UnaryPrefixPostfixOperator extends UnaryNumericOperator {
+
+        UnaryPrefixPostfixOperator(Tag tag) {
+            super(tag);
+        }
+
+        @Override
+        public Symbol resolve(Type arg) {
+            return doLookup(types.unboxedTypeOrType(arg));
+        }
+    }
+
+    /**
+     * Class representing binary operator helpers that operate on numeric types (either boxed or unboxed).
+     * Operator lookup is performed after applying binary numeric promotion of the input types.
+     */
+    class BinaryNumericOperator extends BinaryOperatorHelper {
+
+        BinaryNumericOperator(Tag tag) {
+            super(tag);
+        }
+
+        @Override
+        public Symbol resolve(Type arg1, Type arg2) {
+            Type t = binaryPromotion(arg1, arg2);
+            return doLookup(t, t);
+        }
+
+        @Override
+        public boolean test(Type arg1, Type arg2) {
+            return unaryPromotion(arg1).isNumeric() && unaryPromotion(arg2).isNumeric();
+        }
+    }
+
+    /**
+     * Class representing bitwise operator helpers that operate on all primitive types (either boxed or unboxed).
+     * Operator lookup is performed after applying binary numeric promotion of the input types.
+     */
+    class BinaryBitwiseOperator extends BinaryNumericOperator {
+
+        BinaryBitwiseOperator(Tag tag) {
+            super(tag);
+        }
+
+        @Override
+        public boolean test(Type arg1, Type arg2) {
+            return unaryPromotion(arg1).isPrimitive() && unaryPromotion(arg2).isPrimitive();
+        }
+    }
+
+    /**
+     * Class representing bitwise operator helpers that operate on boolean types (either boxed or unboxed).
+     * Operator lookup is performed assuming both input types are boolean types.
+     */
+    class BinaryBooleanOperator extends BinaryOperatorHelper {
+
+        BinaryBooleanOperator(Tag tag) {
+            super(tag);
+        }
+
+        @Override
+        public Symbol resolve(Type arg1, Type arg2) {
+            return doLookup(syms.booleanType, syms.booleanType);
+        }
+
+        @Override
+        public boolean test(Type arg1, Type arg2) {
+            return types.unboxedTypeOrType(arg1).hasTag(TypeTag.BOOLEAN) &&
+                    types.unboxedTypeOrType(arg2).hasTag(TypeTag.BOOLEAN);
+        }
+    }
+
+    /**
+     * Class representing string concatenation operator helper that operates on at least an
+     * string operand. Input types subject to an operator lookup undergoes a special string promotion
+     * (see {@link BinaryStringOperator#stringPromotion(Type)}.
+     */
+    class BinaryStringOperator extends BinaryOperatorHelper {
+
+        BinaryStringOperator(Tag tag) {
+            super(tag);
+        }
+
+        @Override
+        public Symbol resolve(Type arg1, Type arg2) {
+            return doLookup(stringPromotion(arg1), stringPromotion(arg2));
+        }
+
+        @Override
+        public boolean test(Type arg1, Type arg2) {
+            return types.isSameType(arg1, syms.stringType) ||
+                    types.isSameType(arg2, syms.stringType);
+        }
+
+        /**
+         * This routine applies following mappings:
+         * - if input type is primitive, apply numeric promotion
+         * - if input type is either 'null' or 'String' leave it untouched
+         * - otherwise return 'Object'
+         */
+        private Type stringPromotion(Type t) {
+            if (t.isPrimitive()) {
+                return unaryPromotion(t);
+            } else if (t.hasTag(TypeTag.BOT) ||
+                    types.isSameType(t, syms.stringType)) {
+                return t;
+            } else if (t.hasTag(TypeTag.TYPEVAR)) {
+                return stringPromotion(t.getUpperBound());
+            } else {
+                return syms.objectType;
+            }
+        }
+    }
+
+    /**
+     * Class representing shift operator helper that operates on integral operand types (either boxed
+     * or unboxed). Operator lookup is performed after applying unary numeric promotion to each input type.
+     */
+    class BinaryShiftOperator extends BinaryOperatorHelper {
+
+        BinaryShiftOperator(Tag tag) {
+            super(tag);
+        }
+
+        @Override
+        public Symbol resolve(Type arg1, Type arg2) {
+            return doLookup(unaryPromotion(arg1), unaryPromotion(arg2));
+        }
+
+        @Override
+        public boolean test(Type arg1, Type arg2) {
+            TypeTag op1 = unaryPromotion(arg1).getTag();
+            TypeTag op2 = unaryPromotion(arg2).getTag();
+            return (op1 == TypeTag.LONG || op1 == TypeTag.INT) &&
+                    (op2 == TypeTag.LONG || op2 == TypeTag.INT);
+        }
+    }
+
+    /**
+     * This enum represent the possible kinds of an comparison test ('==' and '!=').
+     */
+    enum ComparisonKind {
+        /** equality between numeric or boolean operands. */
+        NUMERIC_OR_BOOLEAN,
+        /** equality between reference operands. */
+        REFERENCE,
+        /** erroneous equality */
+        INVALID
+    }
+
+    /**
+     * Class representing equality operator helper that operates on either numeric, boolean or reference
+     * types. Operator lookup for numeric/boolean equality test is performed after binary numeric
+     * promotion to the input types. Operator lookup for reference equality test is performed assuming
+     * the input type is 'Object'.
+     */
+    class BinaryEqualityOperator extends BinaryOperatorHelper {
+
+        BinaryEqualityOperator(Tag tag) {
+            super(tag);
+        }
+
+        @Override
+        public boolean test(Type arg1, Type arg2) {
+            return getKind(arg1, arg2) != ComparisonKind.INVALID;
+        }
+
+        @Override
+        public Symbol resolve(Type t1, Type t2) {
+            ComparisonKind kind = getKind(t1, t2);
+            Type t = (kind == ComparisonKind.NUMERIC_OR_BOOLEAN) ?
+                    binaryPromotion(t1, t2) :
+                    syms.objectType;
+            return doLookup(t, t);
+        }
+
+        /**
+         * Retrieve the comparison kind associated with the given argument type pair.
+         */
+        private ComparisonKind getKind(Type arg1, Type arg2) {
+            boolean arg1Primitive = arg1.isPrimitive();
+            boolean arg2Primitive = arg2.isPrimitive();
+            if (arg1Primitive && arg2Primitive) {
+                return ComparisonKind.NUMERIC_OR_BOOLEAN;
+            } else if (arg1Primitive) {
+                return unaryPromotion(arg2).isPrimitive() ?
+                        ComparisonKind.NUMERIC_OR_BOOLEAN : ComparisonKind.INVALID;
+            } else if (arg2Primitive) {
+                return unaryPromotion(arg1).isPrimitive() ?
+                        ComparisonKind.NUMERIC_OR_BOOLEAN : ComparisonKind.INVALID;
+            } else {
+                return arg1.isNullOrReference() && arg2.isNullOrReference() ?
+                        ComparisonKind.REFERENCE : ComparisonKind.INVALID;
+            }
+        }
+    }
+
+    /**
+     * Initialize all unary operators.
+     */
+    private void initUnaryOperators() {
+        initOperators(unaryOperators,
+                new UnaryNumericOperator(Tag.POS)
+                        .addUnaryOperator(DOUBLE, DOUBLE, nop)
+                        .addUnaryOperator(FLOAT, FLOAT, nop)
+                        .addUnaryOperator(LONG, LONG, nop)
+                        .addUnaryOperator(INT, INT, nop),
+                new UnaryNumericOperator(Tag.NEG)
+                        .addUnaryOperator(DOUBLE, DOUBLE, dneg)
+                        .addUnaryOperator(FLOAT, FLOAT, fneg)
+                        .addUnaryOperator(LONG, LONG, lneg)
+                        .addUnaryOperator(INT, INT, ineg),
+                new UnaryNumericOperator(Tag.COMPL)
+                        .addUnaryOperator(LONG, LONG, lxor)
+                        .addUnaryOperator(INT, INT, ixor),
+                new UnaryPrefixPostfixOperator(Tag.POSTINC)
+                        .addUnaryOperator(DOUBLE, DOUBLE, dadd)
+                        .addUnaryOperator(FLOAT, FLOAT, fadd)
+                        .addUnaryOperator(LONG, LONG, ladd)
+                        .addUnaryOperator(INT, INT, iadd)
+                        .addUnaryOperator(CHAR, CHAR, iadd)
+                        .addUnaryOperator(SHORT, SHORT, iadd)
+                        .addUnaryOperator(BYTE, BYTE, iadd),
+                new UnaryPrefixPostfixOperator(Tag.POSTDEC)
+                        .addUnaryOperator(DOUBLE, DOUBLE, dsub)
+                        .addUnaryOperator(FLOAT, FLOAT, fsub)
+                        .addUnaryOperator(LONG, LONG, lsub)
+                        .addUnaryOperator(INT, INT, isub)
+                        .addUnaryOperator(CHAR, CHAR, isub)
+                        .addUnaryOperator(SHORT, SHORT, isub)
+                        .addUnaryOperator(BYTE, BYTE, isub),
+                new UnaryBooleanOperator(Tag.NOT)
+                        .addUnaryOperator(BOOLEAN, BOOLEAN, bool_not),
+                new UnaryReferenceOperator(Tag.NULLCHK)
+                        .addUnaryOperator(OBJECT, OBJECT, nullchk));
+    }
+
+    /**
+     * Initialize all binary operators.
+     */
+    private void initBinaryOperators() {
+        initOperators(binaryOperators,
+            new BinaryStringOperator(Tag.PLUS)
+                    .addBinaryOperator(STRING, OBJECT, STRING, string_add)
+                    .addBinaryOperator(OBJECT, STRING, STRING, string_add)
+                    .addBinaryOperator(STRING, STRING, STRING, string_add)
+                    .addBinaryOperator(STRING, INT, STRING, string_add)
+                    .addBinaryOperator(STRING, LONG, STRING, string_add)
+                    .addBinaryOperator(STRING, FLOAT, STRING, string_add)
+                    .addBinaryOperator(STRING, DOUBLE, STRING, string_add)
+                    .addBinaryOperator(STRING, BOOLEAN, STRING, string_add)
+                    .addBinaryOperator(STRING, BOT, STRING, string_add)
+                    .addBinaryOperator(INT, STRING, STRING, string_add)
+                    .addBinaryOperator(LONG, STRING, STRING, string_add)
+                    .addBinaryOperator(FLOAT, STRING, STRING, string_add)
+                    .addBinaryOperator(DOUBLE, STRING, STRING, string_add)
+                    .addBinaryOperator(BOOLEAN, STRING, STRING, string_add)
+                    .addBinaryOperator(BOT, STRING, STRING, string_add),
+            new BinaryNumericOperator(Tag.PLUS)
+                    .addBinaryOperator(DOUBLE, DOUBLE, DOUBLE, dadd)
+                    .addBinaryOperator(FLOAT, FLOAT, FLOAT, fadd)
+                    .addBinaryOperator(LONG, LONG, LONG, ladd)
+                    .addBinaryOperator(INT, INT, INT, iadd),
+            new BinaryNumericOperator(Tag.MINUS)
+                    .addBinaryOperator(DOUBLE, DOUBLE, DOUBLE, dsub)
+                    .addBinaryOperator(FLOAT, FLOAT, FLOAT, fsub)
+                    .addBinaryOperator(LONG, LONG, LONG, lsub)
+                    .addBinaryOperator(INT, INT, INT, isub),
+            new BinaryNumericOperator(Tag.MUL)
+                    .addBinaryOperator(DOUBLE, DOUBLE, DOUBLE, dmul)
+                    .addBinaryOperator(FLOAT, FLOAT, FLOAT, fmul)
+                    .addBinaryOperator(LONG, LONG, LONG, lmul)
+                    .addBinaryOperator(INT, INT, INT, imul),
+            new BinaryNumericOperator(Tag.DIV)
+                    .addBinaryOperator(DOUBLE, DOUBLE, DOUBLE, ddiv)
+                    .addBinaryOperator(FLOAT, FLOAT, FLOAT, fdiv)
+                    .addBinaryOperator(LONG, LONG, LONG, ldiv)
+                    .addBinaryOperator(INT, INT, INT, idiv),
+            new BinaryNumericOperator(Tag.MOD)
+                    .addBinaryOperator(DOUBLE, DOUBLE, DOUBLE, dmod)
+                    .addBinaryOperator(FLOAT, FLOAT, FLOAT, fmod)
+                    .addBinaryOperator(LONG, LONG, LONG, lmod)
+                    .addBinaryOperator(INT, INT, INT, imod),
+            new BinaryBitwiseOperator(Tag.BITAND)
+                    .addBinaryOperator(BOOLEAN, BOOLEAN, BOOLEAN, iand)
+                    .addBinaryOperator(LONG, LONG, LONG, land)
+                    .addBinaryOperator(INT, INT, INT, iand),
+            new BinaryBitwiseOperator(Tag.BITOR)
+                    .addBinaryOperator(BOOLEAN, BOOLEAN, BOOLEAN, ior)
+                    .addBinaryOperator(LONG, LONG, LONG, lor)
+                    .addBinaryOperator(INT, INT, INT, ior),
+            new BinaryBitwiseOperator(Tag.BITXOR)
+                    .addBinaryOperator(BOOLEAN, BOOLEAN, BOOLEAN, ixor)
+                    .addBinaryOperator(LONG, LONG, LONG, lxor)
+                    .addBinaryOperator(INT, INT, INT, ixor),
+            new BinaryShiftOperator(Tag.SL)
+                    .addBinaryOperator(INT, INT, INT, ishl)
+                    .addBinaryOperator(INT, LONG, INT, ishll)
+                    .addBinaryOperator(LONG, INT, LONG, lshl)
+                    .addBinaryOperator(LONG, LONG, LONG, lshll),
+            new BinaryShiftOperator(Tag.SR)
+                    .addBinaryOperator(INT, INT, INT, ishr)
+                    .addBinaryOperator(INT, LONG, INT, ishrl)
+                    .addBinaryOperator(LONG, INT, LONG, lshr)
+                    .addBinaryOperator(LONG, LONG, LONG, lshrl),
+            new BinaryShiftOperator(Tag.USR)
+                    .addBinaryOperator(INT, INT, INT, iushr)
+                    .addBinaryOperator(INT, LONG, INT, iushrl)
+                    .addBinaryOperator(LONG, INT, LONG, lushr)
+                    .addBinaryOperator(LONG, LONG, LONG, lushrl),
+            new BinaryNumericOperator(Tag.LT)
+                    .addBinaryOperator(DOUBLE, DOUBLE, BOOLEAN, dcmpg, iflt)
+                    .addBinaryOperator(FLOAT, FLOAT, BOOLEAN, fcmpg, iflt)
+                    .addBinaryOperator(LONG, LONG, BOOLEAN, lcmp, iflt)
+                    .addBinaryOperator(INT, INT, BOOLEAN, if_icmplt),
+            new BinaryNumericOperator(Tag.GT)
+                    .addBinaryOperator(DOUBLE, DOUBLE, BOOLEAN, dcmpl, ifgt)
+                    .addBinaryOperator(FLOAT, FLOAT, BOOLEAN, fcmpl, ifgt)
+                    .addBinaryOperator(LONG, LONG, BOOLEAN, lcmp, ifgt)
+                    .addBinaryOperator(INT, INT, BOOLEAN, if_icmpgt),
+            new BinaryNumericOperator(Tag.LE)
+                    .addBinaryOperator(DOUBLE, DOUBLE, BOOLEAN, dcmpg, ifle)
+                    .addBinaryOperator(FLOAT, FLOAT, BOOLEAN, fcmpg, ifle)
+                    .addBinaryOperator(LONG, LONG, BOOLEAN, lcmp, ifle)
+                    .addBinaryOperator(INT, INT, BOOLEAN, if_icmple),
+            new BinaryNumericOperator(Tag.GE)
+                    .addBinaryOperator(DOUBLE, DOUBLE, BOOLEAN, dcmpl, ifge)
+                    .addBinaryOperator(FLOAT, FLOAT, BOOLEAN, fcmpl, ifge)
+                    .addBinaryOperator(LONG, LONG, BOOLEAN, lcmp, ifge)
+                    .addBinaryOperator(INT, INT, BOOLEAN, if_icmpge),
+            new BinaryEqualityOperator(Tag.EQ)
+                    .addBinaryOperator(OBJECT, OBJECT, BOOLEAN, if_acmpeq)
+                    .addBinaryOperator(BOOLEAN, BOOLEAN, BOOLEAN, if_icmpeq)
+                    .addBinaryOperator(DOUBLE, DOUBLE, BOOLEAN, dcmpl, ifeq)
+                    .addBinaryOperator(FLOAT, FLOAT, BOOLEAN, fcmpl, ifeq)
+                    .addBinaryOperator(LONG, LONG, BOOLEAN, lcmp, ifeq)
+                    .addBinaryOperator(INT, INT, BOOLEAN, if_icmpeq),
+            new BinaryEqualityOperator(Tag.NE)
+                    .addBinaryOperator(OBJECT, OBJECT, BOOLEAN, if_acmpne)
+                    .addBinaryOperator(BOOLEAN, BOOLEAN, BOOLEAN, if_icmpne)
+                    .addBinaryOperator(DOUBLE, DOUBLE, BOOLEAN, dcmpl, ifne)
+                    .addBinaryOperator(FLOAT, FLOAT, BOOLEAN, fcmpl, ifne)
+                    .addBinaryOperator(LONG, LONG, BOOLEAN, lcmp, ifne)
+                    .addBinaryOperator(INT, INT, BOOLEAN, if_icmpne),
+            new BinaryBooleanOperator(Tag.AND)
+                    .addBinaryOperator(BOOLEAN, BOOLEAN, BOOLEAN, bool_and),
+            new BinaryBooleanOperator(Tag.OR)
+                    .addBinaryOperator(BOOLEAN, BOOLEAN, BOOLEAN, bool_or));
+    }
+
+    /**
+     * Complete the initialization of an operator helper by storing it into the corresponding operator map.
+     */
+    @SafeVarargs
+    private final <O extends OperatorHelper> void initOperators(Map<Name, List<O>> opsMap, O... ops) {
+        for (O o : ops) {
+            Name opName = o.name;
+            List<O> helpers = opsMap.getOrDefault(opName, List.nil());
+            opsMap.put(opName, helpers.prepend(o));
+        }
+    }
+
+    /**
+     * Initialize operator name array.
+     */
+    private void initOperatorNames() {
+        setOperatorName(Tag.POS, "+");
+        setOperatorName(Tag.NEG, "-");
+        setOperatorName(Tag.NOT, "!");
+        setOperatorName(Tag.COMPL, "~");
+        setOperatorName(Tag.PREINC, "++");
+        setOperatorName(Tag.PREDEC, "--");
+        setOperatorName(Tag.POSTINC, "++");
+        setOperatorName(Tag.POSTDEC, "--");
+        setOperatorName(Tag.NULLCHK, "<*nullchk*>");
+        setOperatorName(Tag.OR, "||");
+        setOperatorName(Tag.AND, "&&");
+        setOperatorName(Tag.EQ, "==");
+        setOperatorName(Tag.NE, "!=");
+        setOperatorName(Tag.LT, "<");
+        setOperatorName(Tag.GT, ">");
+        setOperatorName(Tag.LE, "<=");
+        setOperatorName(Tag.GE, ">=");
+        setOperatorName(Tag.BITOR, "|");
+        setOperatorName(Tag.BITXOR, "^");
+        setOperatorName(Tag.BITAND, "&");
+        setOperatorName(Tag.SL, "<<");
+        setOperatorName(Tag.SR, ">>");
+        setOperatorName(Tag.USR, ">>>");
+        setOperatorName(Tag.PLUS, "+");
+        setOperatorName(Tag.MINUS, names.hyphen);
+        setOperatorName(Tag.MUL, names.asterisk);
+        setOperatorName(Tag.DIV, names.slash);
+        setOperatorName(Tag.MOD, "%");
+    }
+    //where
+        private void setOperatorName(Tag tag, String name) {
+            setOperatorName(tag, names.fromString(name));
+        }
+
+        private void setOperatorName(Tag tag, Name name) {
+            opname[tag.operatorIndex()] = name;
+        }
+}
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java	Mon Feb 23 05:01:11 2015 -0800
@@ -90,7 +90,6 @@
     Check chk;
     Infer infer;
     ClassFinder finder;
-    TreeInfo treeinfo;
     Types types;
     JCDiagnostic.Factory diags;
     public final boolean allowMethodHandles;
@@ -118,7 +117,6 @@
         chk = Check.instance(context);
         infer = Infer.instance(context);
         finder = ClassFinder.instance(context);
-        treeinfo = TreeInfo.instance(context);
         types = Types.instance(context);
         diags = JCDiagnostic.Factory.instance(context);
         Source source = Source.instance(context);
@@ -652,7 +650,7 @@
          * Retrieve the method check object that will be used during a
          * most specific check.
          */
-        MethodCheck mostSpecificCheck(List<Type> actuals, boolean strict);
+        MethodCheck mostSpecificCheck(List<Type> actuals);
     }
 
     /**
@@ -698,7 +696,7 @@
             //do nothing - method always applicable regardless of actuals
         }
 
-        public MethodCheck mostSpecificCheck(List<Type> actuals, boolean strict) {
+        public MethodCheck mostSpecificCheck(List<Type> actuals) {
             return this;
         }
     };
@@ -773,7 +771,7 @@
             throw ex.setMessage(diags.create(DiagnosticType.FRAGMENT, log.currentSource(), pos, key, args));
         }
 
-        public MethodCheck mostSpecificCheck(List<Type> actuals, boolean strict) {
+        public MethodCheck mostSpecificCheck(List<Type> actuals) {
             return nilMethodCheck;
         }
 
@@ -881,8 +879,8 @@
         }
 
         @Override
-        public MethodCheck mostSpecificCheck(List<Type> actuals, boolean strict) {
-            return new MostSpecificCheck(strict, actuals);
+        public MethodCheck mostSpecificCheck(List<Type> actuals) {
+            return new MostSpecificCheck(actuals);
         }
 
         @Override
@@ -935,8 +933,8 @@
         }
 
         @Override
-        public MethodCheck mostSpecificCheck(List<Type> actuals, boolean strict) {
-            return new MostSpecificCheck(strict, actuals);
+        public MethodCheck mostSpecificCheck(List<Type> actuals) {
+            return new MostSpecificCheck(actuals);
         }
 
         @Override
@@ -1047,11 +1045,9 @@
      */
     class MostSpecificCheck implements MethodCheck {
 
-        boolean strict;
         List<Type> actuals;
 
-        MostSpecificCheck(boolean strict, List<Type> actuals) {
-            this.strict = strict;
+        MostSpecificCheck(List<Type> actuals) {
             this.actuals = actuals;
         }
 
@@ -1077,7 +1073,7 @@
         ResultInfo methodCheckResult(Type to, DeferredAttr.DeferredAttrContext deferredAttrContext,
                Warner rsWarner, Type actual) {
             return attr.new ResultInfo(KindSelector.VAL, to,
-                   new MostSpecificCheckContext(strict, deferredAttrContext, rsWarner, actual));
+                   new MostSpecificCheckContext(deferredAttrContext, rsWarner, actual));
         }
 
         /**
@@ -1089,8 +1085,8 @@
 
             Type actual;
 
-            public MostSpecificCheckContext(boolean strict, DeferredAttrContext deferredAttrContext, Warner rsWarner, Type actual) {
-                super(strict, deferredAttrContext, rsWarner);
+            public MostSpecificCheckContext(DeferredAttrContext deferredAttrContext, Warner rsWarner, Type actual) {
+                super(true, deferredAttrContext, rsWarner);
                 this.actual = actual;
             }
 
@@ -1236,7 +1232,7 @@
 
         }
 
-        public MethodCheck mostSpecificCheck(List<Type> actuals, boolean strict) {
+        public MethodCheck mostSpecificCheck(List<Type> actuals) {
             Assert.error("Cannot get here!");
             return null;
         }
@@ -1427,8 +1423,7 @@
                       Symbol sym,
                       Symbol bestSoFar,
                       boolean allowBoxing,
-                      boolean useVarargs,
-                      boolean operator) {
+                      boolean useVarargs) {
         if (sym.kind == ERR ||
                 !sym.isInheritedIn(site.tsym, types)) {
             return bestSoFar;
@@ -1441,16 +1436,13 @@
         try {
             Type mt = rawInstantiate(env, site, sym, null, argtypes, typeargtypes,
                                allowBoxing, useVarargs, types.noWarnings);
-            if (!operator || verboseResolutionMode.contains(VerboseResolutionMode.PREDEF))
-                currentResolutionContext.addApplicableCandidate(sym, mt);
+            currentResolutionContext.addApplicableCandidate(sym, mt);
         } catch (InapplicableMethodException ex) {
-            if (!operator)
-                currentResolutionContext.addInapplicableCandidate(sym, ex.getDiagnostic());
+            currentResolutionContext.addInapplicableCandidate(sym, ex.getDiagnostic());
             switch (bestSoFar.kind) {
                 case ABSENT_MTH:
                     return new InapplicableSymbolError(currentResolutionContext);
                 case WRONG_MTH:
-                    if (operator) return bestSoFar;
                     bestSoFar = new InapplicableSymbolsError(currentResolutionContext);
                 default:
                     return bestSoFar;
@@ -1463,8 +1455,7 @@
         }
         return (bestSoFar.kind.isOverloadError() && bestSoFar.kind != AMBIGUOUS)
             ? sym
-            : mostSpecific(argtypes, sym, bestSoFar, env, site,
-                           allowBoxing && operator, useVarargs);
+            : mostSpecific(argtypes, sym, bestSoFar, env, site, useVarargs);
     }
 
     /* Return the most specific of the two methods for a call,
@@ -1481,15 +1472,14 @@
                         Symbol m2,
                         Env<AttrContext> env,
                         final Type site,
-                        boolean allowBoxing,
                         boolean useVarargs) {
         switch (m2.kind) {
         case MTH:
             if (m1 == m2) return m1;
             boolean m1SignatureMoreSpecific =
-                    signatureMoreSpecific(argtypes, env, site, m1, m2, allowBoxing, useVarargs);
+                    signatureMoreSpecific(argtypes, env, site, m1, m2, useVarargs);
             boolean m2SignatureMoreSpecific =
-                    signatureMoreSpecific(argtypes, env, site, m2, m1, allowBoxing, useVarargs);
+                    signatureMoreSpecific(argtypes, env, site, m2, m1, useVarargs);
             if (m1SignatureMoreSpecific && m2SignatureMoreSpecific) {
                 Type mt1 = types.memberType(site, m1);
                 Type mt2 = types.memberType(site, m2);
@@ -1531,7 +1521,7 @@
             boolean m1MoreSpecificThanAnyAmbiguous = true;
             boolean allAmbiguousMoreSpecificThanM1 = true;
             for (Symbol s : e.ambiguousSyms) {
-                Symbol moreSpecific = mostSpecific(argtypes, m1, s, env, site, allowBoxing, useVarargs);
+                Symbol moreSpecific = mostSpecific(argtypes, m1, s, env, site, useVarargs);
                 m1MoreSpecificThanAnyAmbiguous &= moreSpecific == m1;
                 allAmbiguousMoreSpecificThanM1 &= moreSpecific == s;
             }
@@ -1547,7 +1537,7 @@
         }
     }
     //where
-    private boolean signatureMoreSpecific(List<Type> actuals, Env<AttrContext> env, Type site, Symbol m1, Symbol m2, boolean allowBoxing, boolean useVarargs) {
+    private boolean signatureMoreSpecific(List<Type> actuals, Env<AttrContext> env, Type site, Symbol m1, Symbol m2, boolean useVarargs) {
         noteWarner.clear();
         int maxLength = Math.max(
                             Math.max(m1.type.getParameterTypes().length(), actuals.length()),
@@ -1557,10 +1547,10 @@
             currentResolutionContext = new MethodResolutionContext();
             currentResolutionContext.step = prevResolutionContext.step;
             currentResolutionContext.methodCheck =
-                    prevResolutionContext.methodCheck.mostSpecificCheck(actuals, !allowBoxing);
+                    prevResolutionContext.methodCheck.mostSpecificCheck(actuals);
             Type mst = instantiate(env, site, m2, null,
                     adjustArgs(types.cvarLowerBounds(types.memberType(site, m1).getParameterTypes()), m1, maxLength, useVarargs), null,
-                    allowBoxing, useVarargs, noteWarner);
+                    false, useVarargs, noteWarner);
             return mst != null &&
                     !noteWarner.hasLint(Lint.LintCategory.UNCHECKED);
         } finally {
@@ -1623,11 +1613,10 @@
             Symbol bestSoFar,
             boolean allowBoxing,
             boolean useVarargs,
-            boolean operator,
             boolean abstractok) {
         for (Symbol s : sc.getSymbolsByName(name, new LookupFilter(abstractok))) {
             bestSoFar = selectBest(env, site, argtypes, typeargtypes, s,
-                    bestSoFar, allowBoxing, useVarargs, operator);
+                    bestSoFar, allowBoxing, useVarargs);
         }
         return bestSoFar;
     }
@@ -1667,8 +1656,7 @@
                       List<Type> argtypes,
                       List<Type> typeargtypes,
                       boolean allowBoxing,
-                      boolean useVarargs,
-                      boolean operator) {
+                      boolean useVarargs) {
         Symbol bestSoFar = methodNotFound;
         bestSoFar = findMethod(env,
                           site,
@@ -1678,8 +1666,7 @@
                           site.tsym.type,
                           bestSoFar,
                           allowBoxing,
-                          useVarargs,
-                          operator);
+                          useVarargs);
         return bestSoFar;
     }
     // where
@@ -1691,15 +1678,14 @@
                               Type intype,
                               Symbol bestSoFar,
                               boolean allowBoxing,
-                              boolean useVarargs,
-                              boolean operator) {
+                              boolean useVarargs) {
         @SuppressWarnings({"unchecked","rawtypes"})
         List<Type>[] itypes = (List<Type>[])new List[] { List.<Type>nil(), List.<Type>nil() };
 
         InterfaceLookupPhase iphase = InterfaceLookupPhase.ABSTRACT_OK;
         for (TypeSymbol s : superclasses(intype)) {
             bestSoFar = findMethodInScope(env, site, name, argtypes, typeargtypes,
-                    s.members(), bestSoFar, allowBoxing, useVarargs, operator, true);
+                    s.members(), bestSoFar, allowBoxing, useVarargs, true);
             if (name == names.init) return bestSoFar;
             iphase = (iphase == null) ? null : iphase.update(s, this);
             if (iphase != null) {
@@ -1720,7 +1706,7 @@
                 if (iphase2 == InterfaceLookupPhase.DEFAULT_OK &&
                         (itype.tsym.flags() & DEFAULT) == 0) continue;
                 bestSoFar = findMethodInScope(env, site, name, argtypes, typeargtypes,
-                        itype.tsym.members(), bestSoFar, allowBoxing, useVarargs, operator, true);
+                        itype.tsym.members(), bestSoFar, allowBoxing, useVarargs, true);
                 if (concrete != bestSoFar &&
                     concrete.kind.isValid() &&
                     bestSoFar.kind.isValid() &&
@@ -1833,7 +1819,7 @@
             if (isStatic(env1)) staticOnly = true;
             Symbol sym = findMethod(
                 env1, env1.enclClass.sym.type, name, argtypes, typeargtypes,
-                allowBoxing, useVarargs, false);
+                allowBoxing, useVarargs);
             if (sym.exists()) {
                 if (staticOnly &&
                     sym.kind == MTH &&
@@ -1848,7 +1834,7 @@
         }
 
         Symbol sym = findMethod(env, syms.predefClass.type, name, argtypes,
-                                typeargtypes, allowBoxing, useVarargs, false);
+                                typeargtypes, allowBoxing, useVarargs);
         if (sym.exists())
             return sym;
 
@@ -1862,7 +1848,7 @@
                 bestSoFar = selectBest(env, origin.type,
                                        argtypes, typeargtypes,
                                        currentSym, bestSoFar,
-                                       allowBoxing, useVarargs, false);
+                                       allowBoxing, useVarargs);
             }
         }
         if (bestSoFar.exists())
@@ -1878,7 +1864,7 @@
                 bestSoFar = selectBest(env, origin.type,
                                        argtypes, typeargtypes,
                                        currentSym, bestSoFar,
-                                       allowBoxing, useVarargs, false);
+                                       allowBoxing, useVarargs);
             }
         }
         return bestSoFar;
@@ -2269,9 +2255,7 @@
                         (typeargtypes == null || !Type.isErroneous(typeargtypes));
         }
         public List<Type> getArgumentTypes(ResolveError errSym, Symbol accessedSym, Name name, List<Type> argtypes) {
-            return (syms.operatorNames.contains(name)) ?
-                    argtypes :
-                    Type.map(argtypes, new ResolveDeferredRecoveryMap(AttrMode.SPECULATIVE, accessedSym, currentResolutionContext.step));
+            return Type.map(argtypes, new ResolveDeferredRecoveryMap(AttrMode.SPECULATIVE, accessedSym, currentResolutionContext.step));
         }
     };
 
@@ -2375,7 +2359,7 @@
             Symbol doLookup(Env<AttrContext> env, MethodResolutionPhase phase) {
                 return findMethod(env, site, name, argtypes, typeargtypes,
                         phase.isBoxingRequired(),
-                        phase.isVarargsRequired(), false);
+                        phase.isVarargsRequired());
             }
             @Override
             Symbol access(Env<AttrContext> env, DiagnosticPosition pos, Symbol location, Symbol sym) {
@@ -2506,7 +2490,7 @@
         Symbol sym = findMethod(env, site,
                                     names.init, argtypes,
                                     typeargtypes, allowBoxing,
-                                    useVarargs, false);
+                                    useVarargs);
         chk.checkDeprecated(pos, env.info.scope.owner, sym);
         return sym;
     }
@@ -2587,71 +2571,12 @@
                             newConstr,
                             bestSoFar,
                             allowBoxing,
-                            useVarargs,
-                            false);
+                            useVarargs);
             }
         }
         return bestSoFar;
     }
 
-
-
-    /** Resolve operator.
-     *  @param pos       The position to use for error reporting.
-     *  @param optag     The tag of the operation tree.
-     *  @param env       The environment current at the operation.
-     *  @param argtypes  The types of the operands.
-     */
-    Symbol resolveOperator(DiagnosticPosition pos, JCTree.Tag optag,
-                           Env<AttrContext> env, List<Type> argtypes) {
-        MethodResolutionContext prevResolutionContext = currentResolutionContext;
-        try {
-            currentResolutionContext = new MethodResolutionContext();
-            Name name = treeinfo.operatorName(optag);
-            return lookupMethod(env, pos, syms.predefClass, currentResolutionContext,
-                    new BasicLookupHelper(name, syms.predefClass.type, argtypes, null, BOX) {
-                @Override
-                Symbol doLookup(Env<AttrContext> env, MethodResolutionPhase phase) {
-                    return findMethod(env, site, name, argtypes, typeargtypes,
-                            phase.isBoxingRequired(),
-                            phase.isVarargsRequired(), true);
-                }
-                @Override
-                Symbol access(Env<AttrContext> env, DiagnosticPosition pos, Symbol location, Symbol sym) {
-                    return accessMethod(sym, pos, env.enclClass.sym.type, name,
-                          false, argtypes, null);
-                }
-            });
-        } finally {
-            currentResolutionContext = prevResolutionContext;
-        }
-    }
-
-    /** Resolve operator.
-     *  @param pos       The position to use for error reporting.
-     *  @param optag     The tag of the operation tree.
-     *  @param env       The environment current at the operation.
-     *  @param arg       The type of the operand.
-     */
-    Symbol resolveUnaryOperator(DiagnosticPosition pos, JCTree.Tag optag, Env<AttrContext> env, Type arg) {
-        return resolveOperator(pos, optag, env, List.of(arg));
-    }
-
-    /** Resolve binary operator.
-     *  @param pos       The position to use for error reporting.
-     *  @param optag     The tag of the operation tree.
-     *  @param env       The environment current at the operation.
-     *  @param left      The types of the left operand.
-     *  @param right     The types of the right operand.
-     */
-    Symbol resolveBinaryOperator(DiagnosticPosition pos,
-                                 JCTree.Tag optag,
-                                 Env<AttrContext> env,
-                                 Type left,
-                                 Type right) {
-        return resolveOperator(pos, optag, env, List.of(left, right));
-    }
-
     Symbol getMemberReference(DiagnosticPosition pos,
             Env<AttrContext> env,
             JCMemberReference referenceTree,
@@ -3122,7 +3047,7 @@
         @Override
         final Symbol lookup(Env<AttrContext> env, MethodResolutionPhase phase) {
             return findMethod(env, site, name, argtypes, typeargtypes,
-                    phase.isBoxingRequired(), phase.isVarargsRequired(), syms.operatorNames.contains(name));
+                    phase.isBoxingRequired(), phase.isVarargsRequired());
         }
 
         @Override
@@ -3217,7 +3142,7 @@
             MethodSymbol arrayConstr = new MethodSymbol(PUBLIC, name, null, site.tsym);
             arrayConstr.type = new MethodType(List.<Type>of(syms.intType), site, List.<Type>nil(), syms.methodClass);
             sc.enter(arrayConstr);
-            return findMethodInScope(env, site, name, argtypes, typeargtypes, sc, methodNotFound, phase.isBoxingRequired(), phase.isVarargsRequired(), false, false);
+            return findMethodInScope(env, site, name, argtypes, typeargtypes, sc, methodNotFound, phase.isBoxingRequired(), phase.isVarargsRequired(), false);
         }
 
         @Override
@@ -3252,7 +3177,7 @@
             Symbol sym = needsInference ?
                 findDiamond(env, site, argtypes, typeargtypes, phase.isBoxingRequired(), phase.isVarargsRequired()) :
                 findMethod(env, site, name, argtypes, typeargtypes,
-                        phase.isBoxingRequired(), phase.isVarargsRequired(), syms.operatorNames.contains(name));
+                        phase.isBoxingRequired(), phase.isVarargsRequired());
             return (sym.kind != MTH ||
                     site.getEnclosingType().hasTag(NONE) ||
                     hasEnclosingInstance(env, site)) ?
@@ -3607,16 +3532,6 @@
             if (name == names.error)
                 return null;
 
-            if (syms.operatorNames.contains(name)) {
-                boolean isUnaryOp = argtypes.size() == 1;
-                String key = argtypes.size() == 1 ?
-                    "operator.cant.be.applied" :
-                    "operator.cant.be.applied.1";
-                Type first = argtypes.head;
-                Type second = !isUnaryOp ? argtypes.tail.head : null;
-                return diags.create(dkind, log.currentSource(), pos,
-                        key, name, first, second);
-            }
             boolean hasLocation = false;
             if (location == null) {
                 location = site.tsym;
@@ -3716,36 +3631,24 @@
             if (name == names.error)
                 return null;
 
-            if (syms.operatorNames.contains(name)) {
-                boolean isUnaryOp = argtypes.size() == 1;
-                String key = argtypes.size() == 1 ?
-                    "operator.cant.be.applied" :
-                    "operator.cant.be.applied.1";
-                Type first = argtypes.head;
-                Type second = !isUnaryOp ? argtypes.tail.head : null;
-                return diags.create(dkind, log.currentSource(), pos,
-                        key, name, first, second);
+            Pair<Symbol, JCDiagnostic> c = errCandidate();
+            if (compactMethodDiags) {
+                JCDiagnostic simpleDiag =
+                    MethodResolutionDiagHelper.rewrite(diags, pos, log.currentSource(), dkind, c.snd);
+                if (simpleDiag != null) {
+                    return simpleDiag;
+                }
             }
-            else {
-                Pair<Symbol, JCDiagnostic> c = errCandidate();
-                if (compactMethodDiags) {
-                    JCDiagnostic simpleDiag =
-                        MethodResolutionDiagHelper.rewrite(diags, pos, log.currentSource(), dkind, c.snd);
-                    if (simpleDiag != null) {
-                        return simpleDiag;
-                    }
-                }
-                Symbol ws = c.fst.asMemberOf(site, types);
-                return diags.create(dkind, log.currentSource(), pos,
-                          "cant.apply.symbol",
-                          kindName(ws),
-                          ws.name == names.init ? ws.owner.name : ws.name,
-                          methodArguments(ws.type.getParameterTypes()),
-                          methodArguments(argtypes),
-                          kindName(ws.owner),
-                          ws.owner.type,
-                          c.snd);
-            }
+            Symbol ws = c.fst.asMemberOf(site, types);
+            return diags.create(dkind, log.currentSource(), pos,
+                      "cant.apply.symbol",
+                      kindName(ws),
+                      ws.name == names.init ? ws.owner.name : ws.name,
+                      methodArguments(ws.type.getParameterTypes()),
+                      methodArguments(argtypes),
+                      kindName(ws.owner),
+                      ws.owner.type,
+                      c.snd);
         }
 
         @Override
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransTypes.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransTypes.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -720,7 +720,7 @@
 
     public void visitParens(JCParens tree) {
         tree.expr = translate(tree.expr, pt);
-        tree.type = erasure(tree.type);
+        tree.type = erasure(tree.expr.type);
         result = tree;
     }
 
@@ -755,7 +755,7 @@
         tree.clazz = translate(tree.clazz, null);
         Type originalTarget = tree.type;
         tree.type = erasure(tree.type);
-        JCExpression newExpression = translate(tree.expr, erasure(tree.expr.type));
+        JCExpression newExpression = translate(tree.expr, tree.type);
         if (newExpression != tree.expr) {
             JCTypeCast typeCast = newExpression.hasTag(Tag.TYPECAST)
                 ? (JCTypeCast) newExpression
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/Locations.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/Locations.java	Mon Feb 23 05:01:11 2015 -0800
@@ -678,29 +678,43 @@
                     boolean haveJImageFiles =
                             files.anyMatch(f -> f.getFileName().toString().endsWith(".jimage"));
                     if (haveJImageFiles) {
-                        return Collections.singleton(JRT_MARKER_FILE);
+                        return addAdditionalBootEntries(Collections.singleton(JRT_MARKER_FILE));
                     }
                 }
             }
 
-            // Temporary: if no .jimage files, return individual modules
-            if (Files.exists(libModules.resolve("java.base"))) {
-                return Files.list(libModules)
-                            .map(d -> d.resolve("classes"))
-                            .collect(Collectors.toList());
-            }
-
             // Exploded module image
             Path modules = Paths.get(java_home, "modules");
             if (Files.isDirectory(modules.resolve("java.base"))) {
-                return Files.list(modules)
-                            .collect(Collectors.toList());
+                try (Stream<Path> listedModules = Files.list(modules)) {
+                    return addAdditionalBootEntries(listedModules.collect(Collectors.toList()));
+                }
             }
 
             // not a modular image that we know about
             return null;
         }
 
+        //ensure bootclasspath prepends/appends are reflected in the systemClasses
+        private Collection<Path> addAdditionalBootEntries(Collection<Path> modules) throws IOException {
+            String files = System.getProperty("sun.boot.class.path");
+
+            if (files == null)
+                return modules;
+
+            Set<Path> paths = new LinkedHashSet<>();
+
+            for (String s : files.split(Pattern.quote(File.pathSeparator))) {
+                if (s.endsWith(".jimage")) {
+                    paths.addAll(modules);
+                } else if (!s.isEmpty()) {
+                    paths.add(Paths.get(s));
+                }
+            }
+
+            return paths;
+        }
+
         private void lazy() {
             if (searchPath == null) {
                 try {
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassWriter.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassWriter.java	Mon Feb 23 05:01:11 2015 -0800
@@ -656,8 +656,7 @@
 
     private void writeParamAnnotations(MethodSymbol m,
                                        RetentionPolicy retention) {
-        databuf.appendByte(m.params.length() + m.extraParams.length());
-        writeParamAnnotations(m.extraParams, retention);
+        databuf.appendByte(m.params.length());
         writeParamAnnotations(m.params, retention);
     }
 
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java	Mon Feb 23 05:01:11 2015 -0800
@@ -2145,7 +2145,8 @@
         // For basic types, the coerce(...) in genExpr(...) will do
         // the conversion.
         if (!tree.clazz.type.isPrimitive() &&
-            types.asSuper(tree.expr.type, tree.clazz.type.tsym) == null) {
+           !types.isSameType(tree.expr.type, tree.clazz.type) &&
+           types.asSuper(tree.expr.type, tree.clazz.type.tsym) == null) {
             code.emitop2(checkcast, makeRef(tree.pos(), tree.clazz.type));
         }
     }
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties	Wed Feb 18 22:19:47 2015 -0500
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties	Mon Feb 23 05:01:11 2015 -0800
@@ -828,7 +828,7 @@
 compiler.err.not.encl.class=\
     not an enclosing class: {0}
 
-# 0: name, 1: type, 2: unused
+# 0: name, 1: type
 compiler.err.operator.cant.be.applied=\
     bad operand type {1} for unary operator ''{0}''
 
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/ct.properties	Wed Feb 18 22:19:47 2015 -0500
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/ct.properties	Mon Feb 23 05:01:11 2015 -0800
@@ -477,7 +477,7 @@
 java.rmi.registry.*: compact2
 java.rmi.server.*: compact2
 java.security.*: compact1
-java.security.acl.*: compact3
+java.security.acl.*: compact1
 java.security.cert.*: compact1
 java.security.interfaces.*: compact1
 java.security.spec.*: compact1
@@ -687,7 +687,7 @@
 sun.rmi.transport.*: proprietary compact2
 sun.rmi.transport.proxy.*: proprietary compact2
 sun.rmi.transport.tcp.*: proprietary compact2
-sun.security.acl.*: proprietary compact3
+sun.security.acl.*: proprietary compact1
 sun.security.action.*: proprietary compact1
 sun.security.jca.*: proprietary compact1
 sun.security.jgss.*: proprietary compact3
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeInfo.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeInfo.java	Mon Feb 23 05:01:11 2015 -0800
@@ -51,62 +51,6 @@
  *  deletion without notice.</b>
  */
 public class TreeInfo {
-    protected static final Context.Key<TreeInfo> treeInfoKey = new Context.Key<>();
-
-    public static TreeInfo instance(Context context) {
-        TreeInfo instance = context.get(treeInfoKey);
-        if (instance == null)
-            instance = new TreeInfo(context);
-        return instance;
-    }
-
-    /** The names of all operators.
-     */
-    private Name[] opname = new Name[Tag.getNumberOfOperators()];
-
-    private void setOpname(Tag tag, String name, Names names) {
-         setOpname(tag, names.fromString(name));
-     }
-     private void setOpname(Tag tag, Name name) {
-         opname[tag.operatorIndex()] = name;
-     }
-
-    private TreeInfo(Context context) {
-        context.put(treeInfoKey, this);
-
-        Names names = Names.instance(context);
-        /*  Internally we use +++, --- for unary +, - to reduce +, - operators
-         *  overloading
-         */
-        setOpname(POS, "+++", names);
-        setOpname(NEG, "---", names);
-        setOpname(NOT, "!", names);
-        setOpname(COMPL, "~", names);
-        setOpname(PREINC, "++", names);
-        setOpname(PREDEC, "--", names);
-        setOpname(POSTINC, "++", names);
-        setOpname(POSTDEC, "--", names);
-        setOpname(NULLCHK, "<*nullchk*>", names);
-        setOpname(OR, "||", names);
-        setOpname(AND, "&&", names);
-        setOpname(EQ, "==", names);
-        setOpname(NE, "!=", names);
-        setOpname(LT, "<", names);
-        setOpname(GT, ">", names);
-        setOpname(LE, "<=", names);
-        setOpname(GE, ">=", names);
-        setOpname(BITOR, "|", names);
-        setOpname(BITXOR, "^", names);
-        setOpname(BITAND, "&", names);
-        setOpname(SL, "<<", names);
-        setOpname(SR, ">>", names);
-        setOpname(USR, ">>>", names);
-        setOpname(PLUS, "+", names);
-        setOpname(MINUS, names.hyphen);
-        setOpname(MUL, names.asterisk);
-        setOpname(DIV, names.slash);
-        setOpname(MOD, "%", names);
-    }
 
     public static List<JCExpression> args(JCTree t) {
         switch (t.getTag()) {
@@ -119,12 +63,6 @@
         }
     }
 
-    /** Return name of operator with given tree tag.
-     */
-    public Name operatorName(JCTree.Tag tag) {
-        return opname[tag.operatorIndex()];
-    }
-
     /** Is tree a constructor declaration?
      */
     public static boolean isConstructor(JCTree tree) {
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/util/Bits.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/util/Bits.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -84,20 +84,6 @@
 
     }
 
-    public enum BitsOpKind {
-        INIT,
-        CLEAR,
-        INCL_BIT,
-        EXCL_BIT,
-        ASSIGN,
-        AND_SET,
-        OR_SET,
-        DIFF_SET,
-        XOR_SET,
-        INCL_RANGE,
-        EXCL_RANGE,
-    }
-
     private final static int wordlen = 32;
     private final static int wordshift = 5;
     private final static int wordmask = wordlen - 1;
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/util/JavacMessages.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/util/JavacMessages.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -56,7 +56,7 @@
 
     private Map<Locale, SoftReference<List<ResourceBundle>>> bundleCache;
 
-    private List<String> bundleNames;
+    private List<ResourceBundleHelper> bundleHelpers;
 
     private Locale currentLocale;
     private List<ResourceBundle> currentBundles;
@@ -91,7 +91,7 @@
      * @param bundleName the name to identify the resource bundle of localized messages.
      */
     public JavacMessages(String bundleName, Locale locale) throws MissingResourceException {
-        bundleNames = List.nil();
+        bundleHelpers = List.nil();
         bundleCache = new HashMap<>();
         add(bundleName);
         setCurrentLocale(locale);
@@ -101,8 +101,13 @@
         this(defaultBundleName);
     }
 
+    @Override
     public void add(String bundleName) throws MissingResourceException {
-        bundleNames = bundleNames.prepend(bundleName);
+        add(locale -> ResourceBundle.getBundle(bundleName, locale));
+    }
+
+    public void add(ResourceBundleHelper ma) {
+        bundleHelpers = bundleHelpers.prepend(ma);
         if (!bundleCache.isEmpty())
             bundleCache.clear();
         currentBundles = null;
@@ -115,12 +120,13 @@
         List<ResourceBundle> bundleList = bundles == null ? null : bundles.get();
         if (bundleList == null) {
             bundleList = List.nil();
-            for (String bundleName : bundleNames) {
+            for (ResourceBundleHelper helper : bundleHelpers) {
                 try {
-                    ResourceBundle rb = ResourceBundle.getBundle(bundleName, locale);
+                    ResourceBundle rb = helper.getResourceBundle(locale);
                     bundleList = bundleList.prepend(rb);
                 } catch (MissingResourceException e) {
-                    throw new InternalError("Cannot find javac resource bundle for locale " + locale);
+                    throw new InternalError("Cannot find requested resource bundle for locale " +
+                            locale, e);
                 }
             }
             bundleCache.put(locale, new SoftReference<>(bundleList));
@@ -134,6 +140,7 @@
         return getLocalizedString(currentLocale, key, args);
     }
 
+    @Override
     public String getLocalizedString(Locale l, String key, Object... args) {
         if (l == null)
             l = getCurrentLocale();
@@ -146,8 +153,7 @@
      * easy access to simple localized strings.
      */
 
-    private static final String defaultBundleName =
-        "com.sun.tools.javac.resources.compiler";
+    private static final String defaultBundleName = "com.sun.tools.javac.resources.compiler";
     private static ResourceBundle defaultBundle;
     private static JavacMessages defaultMessages;
 
@@ -198,4 +204,17 @@
        }
        return MessageFormat.format(msg, args);
     }
+
+    /**
+     * This provides a way for the JavacMessager to retrieve a
+     * ResourceBundle from another module such as jdk.javadoc.
+     */
+    public interface ResourceBundleHelper {
+        /**
+         * Gets the ResourceBundle.
+         * @param locale the requested bundle's locale
+         * @return ResourceBundle
+         */
+        ResourceBundle getResourceBundle(Locale locale);
+    }
 }
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/Messager.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/Messager.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, 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,6 +27,7 @@
 
 import java.io.PrintWriter;
 import java.util.Locale;
+import java.util.ResourceBundle;
 
 import com.sun.javadoc.*;
 import com.sun.tools.javac.util.Context;
@@ -126,9 +127,11 @@
                        PrintWriter noticeWriter) {
         super(context, errWriter, warnWriter, noticeWriter);
         messages = JavacMessages.instance(context);
-        messages.add("com.sun.tools.javadoc.resources.javadoc");
+        messages.add(locale -> ResourceBundle.getBundle("com.sun.tools.javadoc.resources.javadoc",
+                                                         locale));
         javadocDiags = new JCDiagnostic.Factory(messages, "javadoc");
         this.programName = programName;
+
     }
 
     public void setLocale(Locale locale) {
--- a/langtools/test/tools/javac/7102515/T7102515.out	Wed Feb 18 22:19:47 2015 -0500
+++ b/langtools/test/tools/javac/7102515/T7102515.out	Mon Feb 23 05:01:11 2015 -0800
@@ -1,3 +1,3 @@
 T7102515.java:9:41: compiler.err.operator.cant.be.applied.1: +, T7102515, T7102515
-T7102515.java:10:32: compiler.err.operator.cant.be.applied: ++, T7102515, null
+T7102515.java:10:32: compiler.err.operator.cant.be.applied: ++, T7102515
 2 errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/CheckNoClassCastException.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,69 @@
+/*
+ * 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.
+ *
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8069265
+ * @summary ClassCastException when compiled with JDK 9b08+, JDK8 compiles OK.
+ * @run main CheckNoClassCastException
+ */
+import java.util.*;
+
+public class CheckNoClassCastException {
+    static String result = "";
+    public static void main(String[] args) {
+        ListFail.main(null);
+        MapFail.main(null);
+        if (!result.equals("ListFailDoneMapFailDone"))
+            throw new AssertionError("Incorrect result");
+    }
+}
+
+class ListFail {
+    static interface Foo {
+    }
+
+    public static void main(String[] args) {
+        List<Date> list = new ArrayList<>();
+        list.add(new Date());
+
+        List<Foo> cList = (List<Foo>) (List<?>) list;
+        Date date = (Date) cList.get(0);
+        CheckNoClassCastException.result += "ListFailDone";
+    }
+}
+
+
+class MapFail {
+    static interface Foo {
+    }
+
+    public static void main(String[] args) {
+        Map<String,Date> aMap = new HashMap<>();
+        aMap.put("test",new Date());
+
+        Map<String,Foo> m = (Map<String,Foo>) (Map<?,?>) aMap;
+        Date q = (Date) m.get("test");
+        CheckNoClassCastException.result += "MapFailDone";
+    }
+}
--- a/langtools/test/tools/javac/T7053059/DoubleCastTest.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/langtools/test/tools/javac/T7053059/DoubleCastTest.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -47,6 +47,7 @@
             m1((byte[])m());
             m1((byte[])os[0]);
             m1((byte[])this.x);
+            m1((byte[])((byte []) (o = null)));
         }
     }
 
--- a/langtools/test/tools/javac/annotations/SyntheticParameters.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/langtools/test/tools/javac/annotations/SyntheticParameters.java	Mon Feb 23 05:01:11 2015 -0800
@@ -46,20 +46,11 @@
                      null,
                      new ExpectedParameterAnnotation[] {
                          (ExpectedParameterAnnotation)
-                         // Assert there is no annotation on the
-                         // this$0 parameter.
-                         new ExpectedParameterAnnotation(
-                             "<init>",
-                             0,
-                             "A",
-                             true,
-                             0),
-                         (ExpectedParameterAnnotation)
                          // Assert there is an annotation on the
                          // first parameter.
                          new ExpectedParameterAnnotation(
                              "<init>",
-                             1,
+                             0,
                              "A",
                              true,
                              1),
@@ -71,27 +62,11 @@
                              true,
                              1),
                          (ExpectedParameterAnnotation)
-                         new ExpectedParameterAnnotation(
-                             "foo",
-                             1,
-                             "A",
-                             true,
-                             0),
-                         (ExpectedParameterAnnotation)
-                         // Assert there is no annotation on the
-                         // this$0 parameter.
-                         new ExpectedParameterAnnotation(
-                             "<init>",
-                             0,
-                             "B",
-                             false,
-                             0),
-                         (ExpectedParameterAnnotation)
                          // Assert there is an annotation on the
                          // first parameter.
                          new ExpectedParameterAnnotation(
                              "<init>",
-                             1,
+                             0,
                              "B",
                              false,
                              1),
@@ -117,58 +92,22 @@
                      null,
                      new ExpectedParameterAnnotation[] {
                          (ExpectedParameterAnnotation)
-                         // Assert there is no annotation on the
-                         // $enum$name parameter.
+                         // Assert there is an annotation on the
+                         // first parameter.
                          new ExpectedParameterAnnotation(
                              "<init>",
                              0,
                              "A",
                              true,
-                             0),
-                         (ExpectedParameterAnnotation)
-                         // Assert there is no annotation on the
-                         // $enum$ordinal parameter.
-                         new ExpectedParameterAnnotation(
-                             "<init>",
-                             1,
-                             "A",
-                             true,
-                             0),
+                             1),
                          (ExpectedParameterAnnotation)
                          // Assert there is an annotation on the
                          // first parameter.
                          new ExpectedParameterAnnotation(
                              "<init>",
-                             2,
-                             "A",
-                             true,
-                             1),
-                         (ExpectedParameterAnnotation)
-                         // Assert there is no annotation on the
-                         // $enum$name parameter.
-                         new ExpectedParameterAnnotation(
-                             "<init>",
                              0,
                              "B",
                              false,
-                             0),
-                         (ExpectedParameterAnnotation)
-                         // Assert there is no annotation on the
-                         // $enum$ordinal parameter.
-                         new ExpectedParameterAnnotation(
-                             "<init>",
-                             1,
-                             "B",
-                             false,
-                             0),
-                         (ExpectedParameterAnnotation)
-                         // Assert there is an annotation on the
-                         // first parameter.
-                         new ExpectedParameterAnnotation(
-                             "<init>",
-                             2,
-                             "B",
-                             false,
                              1)
                      },
                      null);
--- a/langtools/test/tools/javac/annotations/typeAnnotations/classfile/SyntheticParameters.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/classfile/SyntheticParameters.java	Mon Feb 23 05:01:11 2015 -0800
@@ -44,15 +44,6 @@
                      null,
                      new ExpectedMethodTypeAnnotation[] {
                          (ExpectedMethodTypeAnnotation)
-                         // Assert there is no annotation on the
-                         // this$0 parameter.
-                         new ExpectedMethodTypeAnnotation.Builder(
-                             "<init>",
-                             "A",
-                             TypeAnnotation.TargetType.METHOD_FORMAL_PARAMETER,
-                             false,
-                             0).setParameterIndex(0).build(),
-                         (ExpectedMethodTypeAnnotation)
                          // Assert there is an annotation on the
                          // first parameter.
                          new ExpectedMethodTypeAnnotation.Builder(
@@ -60,21 +51,7 @@
                              "A",
                              TypeAnnotation.TargetType.METHOD_FORMAL_PARAMETER,
                              false,
-                             1).setParameterIndex(1).build(),
-                         (ExpectedMethodTypeAnnotation)
-                         new ExpectedMethodTypeAnnotation.Builder(
-                             "foo",
-                             "A",
-                             TypeAnnotation.TargetType.METHOD_FORMAL_PARAMETER,
-                             false,
-                             1).setParameterIndex(0).build(),
-                         (ExpectedMethodTypeAnnotation)
-                         new ExpectedMethodTypeAnnotation.Builder(
-                             "foo",
-                             "A",
-                             TypeAnnotation.TargetType.METHOD_FORMAL_PARAMETER,
-                             false,
-                             0).setParameterIndex(1).build()
+                             1).setParameterIndex(0).build()
                      },
                      null);
     private static final Expected Foo_expected =
@@ -89,26 +66,7 @@
                              "A",
                              TypeAnnotation.TargetType.METHOD_FORMAL_PARAMETER,
                              false,
-                             0).setParameterIndex(0).build(),
-                         (ExpectedMethodTypeAnnotation)
-                         // Assert there is no annotation on the
-                         // $enum$ordinal parameter.
-                         new ExpectedMethodTypeAnnotation.Builder(
-                             "<init>",
-                             "A",
-                             TypeAnnotation.TargetType.METHOD_FORMAL_PARAMETER,
-                             false,
-                             0).setParameterIndex(1).build(),
-                         (ExpectedMethodTypeAnnotation)
-                         // Assert there is an annotation on the
-                         // first parameter.
-                         new ExpectedMethodTypeAnnotation.Builder(
-                             "<init>",
-                             "A",
-                             TypeAnnotation.TargetType.METHOD_FORMAL_PARAMETER,
-                             false,
-                             1).setParameterIndex(2).build()
-                     },
+                             1).setParameterIndex(0).build()                     },
                      null);
 
     public static void main(String... args) throws Exception {
--- a/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/Constructors.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/Constructors.java	Mon Feb 23 05:01:11 2015 -0800
@@ -43,7 +43,7 @@
 
     @TADescription(annotation = "TA", type = METHOD_RETURN, genericLocation = {1, 0})
     @TADescription(annotation = "TB", type = METHOD_RETURN, genericLocation = {1, 0})
-    @TADescription(annotation = "TC", type = METHOD_FORMAL_PARAMETER, paramIndex = 1)
+    @TADescription(annotation = "TC", type = METHOD_FORMAL_PARAMETER, paramIndex = 0)
     @TestClass("%TEST_CLASS_NAME%$Inner")
     public String innerClass() {
         return "class %TEST_CLASS_NAME% { class Inner {" +
@@ -56,7 +56,7 @@
     @TADescription(annotation = "TB", type = METHOD_RETURN, genericLocation = {1, 0})
     @TADescription(annotation = "TC", type = METHOD_RECEIVER)
     @TADescription(annotation = "TD", type = METHOD_RETURN, genericLocation = {1, 0})
-    @TADescription(annotation = "TE", type = METHOD_FORMAL_PARAMETER, paramIndex = 1)
+    @TADescription(annotation = "TE", type = METHOD_FORMAL_PARAMETER, paramIndex = 0)
     @TestClass("%TEST_CLASS_NAME%$Inner")
     public String innerClass2() {
         return "class %TEST_CLASS_NAME% { class Inner {" +
@@ -70,7 +70,7 @@
     @TADescription(annotation = "TC", type = METHOD_RETURN, genericLocation = {1, 0, 1, 0})
     @TADescription(annotation = "TD", type = METHOD_RECEIVER, genericLocation = {1, 0})
     @TADescription(annotation = "TE", type = METHOD_RETURN, genericLocation = {1, 0, 1, 0})
-    @TADescription(annotation = "TF", type = METHOD_FORMAL_PARAMETER, paramIndex = 1)
+    @TADescription(annotation = "TF", type = METHOD_FORMAL_PARAMETER, paramIndex = 0)
     @TestClass("Outer$Middle$Inner")
     public String innerClass3() {
         return "class Outer { class Middle { class Inner {" +
@@ -89,7 +89,7 @@
 
     @TADescription(annotation = "RTAs", type = METHOD_RETURN, genericLocation = {1, 0})
     @TADescription(annotation = "RTBs", type = METHOD_RETURN, genericLocation = {1, 0})
-    @TADescription(annotation = "RTCs", type = METHOD_FORMAL_PARAMETER, paramIndex = 1)
+    @TADescription(annotation = "RTCs", type = METHOD_FORMAL_PARAMETER, paramIndex = 0)
     @TestClass("%TEST_CLASS_NAME%$Inner")
     public String innerClassRepeatableAnnotation() {
         return "class %TEST_CLASS_NAME% { class Inner {" +
@@ -102,7 +102,7 @@
     @TADescription(annotation = "RTBs", type = METHOD_RETURN, genericLocation = {1, 0})
     @TADescription(annotation = "RTCs", type = METHOD_RECEIVER)
     @TADescription(annotation = "RTDs", type = METHOD_RETURN, genericLocation = {1, 0})
-    @TADescription(annotation = "RTEs", type = METHOD_FORMAL_PARAMETER, paramIndex = 1)
+    @TADescription(annotation = "RTEs", type = METHOD_FORMAL_PARAMETER, paramIndex = 0)
     @TestClass("%TEST_CLASS_NAME%$Inner")
     public String innerClassRepeatableAnnotation2() {
         return "class %TEST_CLASS_NAME% { class Inner {" +
@@ -116,7 +116,7 @@
     @TADescription(annotation = "RTCs", type = METHOD_RETURN, genericLocation = {1, 0, 1, 0})
     @TADescription(annotation = "RTDs", type = METHOD_RECEIVER, genericLocation = {1, 0})
     @TADescription(annotation = "RTEs", type = METHOD_RETURN, genericLocation = {1, 0, 1, 0})
-    @TADescription(annotation = "RTFs", type = METHOD_FORMAL_PARAMETER, paramIndex = 1)
+    @TADescription(annotation = "RTFs", type = METHOD_FORMAL_PARAMETER, paramIndex = 0)
     @TestClass("Outer$Middle$Inner")
     public String innerClassRepatableAnnotation3() {
         return "class Outer { class Middle { class Inner {" +
--- a/langtools/test/tools/javac/diags/examples/IncomparableTypes.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/langtools/test/tools/javac/diags/examples/IncomparableTypes.java	Mon Feb 23 05:01:11 2015 -0800
@@ -24,5 +24,5 @@
 // key: compiler.err.incomparable.types
 
 class X {
-    boolean b = (this == 1);
+    boolean b = (this == "");
 }
--- a/langtools/test/tools/javac/expression/NullAppend.out	Wed Feb 18 22:19:47 2015 -0500
+++ b/langtools/test/tools/javac/expression/NullAppend.out	Mon Feb 23 05:01:11 2015 -0800
@@ -1,2 +1,2 @@
-NullAppend.java:11:16: compiler.err.operator.cant.be.applied.1: +, compiler.misc.type.null, compiler.misc.type.null
+NullAppend.java:11:21: compiler.err.operator.cant.be.applied.1: +, compiler.misc.type.null, compiler.misc.type.null
 1 error
--- a/langtools/test/tools/javac/expression/NullAppend2.out	Wed Feb 18 22:19:47 2015 -0500
+++ b/langtools/test/tools/javac/expression/NullAppend2.out	Mon Feb 23 05:01:11 2015 -0800
@@ -1,2 +1,2 @@
-NullAppend2.java:10:16: compiler.err.operator.cant.be.applied.1: +, compiler.misc.type.null, int
+NullAppend2.java:10:21: compiler.err.operator.cant.be.applied.1: +, compiler.misc.type.null, int
 1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/file/BootClassPathPrepend.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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.
+ */
+
+/**
+ * @test
+ * @bug 8067445
+ * @summary Verify that file.Locations analyze sun.boot.class.path for BCP prepends/appends
+ * @library /tools/lib
+ */
+
+import java.io.IOException;
+import java.util.EnumSet;
+import javax.tools.JavaCompiler;
+import javax.tools.JavaFileManager;
+import javax.tools.JavaFileObject;
+import javax.tools.JavaFileObject.Kind;
+import javax.tools.StandardLocation;
+import javax.tools.ToolProvider;
+
+public class BootClassPathPrepend {
+    public static void main(String... args) throws IOException {
+        if (args.length == 0) {
+            new BootClassPathPrepend().reRun();
+        } else {
+            new BootClassPathPrepend().run();
+        }
+    }
+
+    void reRun() {
+        String testClasses = System.getProperty("test.classes");
+        ToolBox tb = new ToolBox();
+        tb.new JavaTask().vmOptions("-Xbootclasspath/p:" + testClasses)
+                         .classArgs("real-run")
+                         .className("BootClassPathPrepend")
+                         .run()
+                         .writeAll();
+    }
+
+    EnumSet<Kind> classKind = EnumSet.of(JavaFileObject.Kind.CLASS);
+
+    void run() throws IOException {
+        JavaCompiler toolProvider = ToolProvider.getSystemJavaCompiler();
+        try (JavaFileManager fm = toolProvider.getStandardFileManager(null, null, null)) {
+            Iterable<JavaFileObject> files =
+                    fm.list(StandardLocation.PLATFORM_CLASS_PATH, "", classKind, false);
+            for (JavaFileObject fo : files) {
+                if (fo.isNameCompatible("BootClassPathPrepend", JavaFileObject.Kind.CLASS)) {
+                    System.err.println("Found BootClassPathPrepend on bootclasspath");
+                    return ;//found
+                }
+            }
+
+            throw new AssertionError("Cannot find class that was prepended on BCP");
+        }
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/file/ExplodedImage.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,186 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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.
+ */
+
+import com.sun.source.util.JavacTask;
+import com.sun.tools.javac.code.Symbol.ClassSymbol;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URI;
+import java.nio.file.DirectoryStream;
+import java.nio.file.FileSystems;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.Arrays;
+import java.util.EnumSet;
+import java.util.List;
+import javax.lang.model.element.TypeElement;
+import javax.tools.Diagnostic;
+import javax.tools.DiagnosticListener;
+import javax.tools.JavaCompiler;
+import javax.tools.JavaFileObject;
+import javax.tools.StandardJavaFileManager;
+import javax.tools.StandardLocation;
+import javax.tools.ToolProvider;
+
+/**
+ * @test
+ * @bug 8067138
+ * @summary Verify that compiling against the exploded JDK image works, and that Locations close
+ *          the directory streams properly when working with exploded JDK image.
+ * @library /tools/lib
+ * @build ToolBox ExplodedImage
+ * @run main ExplodedImage
+ */
+
+public class ExplodedImage {
+    public static void main(String... args) throws IOException {
+        new ExplodedImage().run();
+    }
+
+    void run() throws IOException {
+        for (String moduleLocations : new String[] {"modules/*"}) {
+            System.setProperty("java.home", originalJavaHome);
+            testDirectoryStreamClosed(moduleLocations);
+            System.setProperty("java.home", originalJavaHome);
+            testCanCompileAgainstExplodedImage(moduleLocations);
+        }
+    }
+
+    void testDirectoryStreamClosed(String loc) throws IOException {
+        System.err.println("testDirectoryStreamClosed(" + loc + ")");
+        Path javaHome = prepareJavaHome();
+        Path targetPath = javaHome.resolve(loc.replace("*", "/java.base").replace("/", sep));
+        Path testClass = targetPath.resolve(("java/lang/" + TEST_FILE).replace("/", sep));
+        Files.createDirectories(testClass.getParent());
+        Files.createFile(testClass);
+        System.setProperty("java.home", javaHome.toString());
+
+        for (int i = 0; i < REPEATS; i++) {
+            try (StandardJavaFileManager fm = javaCompiler.getStandardFileManager(null, null, null)) {
+                Iterable<JavaFileObject> javaLangContent =
+                        fm.list(StandardLocation.PLATFORM_CLASS_PATH,
+                                "java.lang",
+                                EnumSet.allOf(JavaFileObject.Kind.class),
+                                false);
+                boolean found = false;
+
+                for (JavaFileObject fo : javaLangContent) {
+                    if (!fo.getName().endsWith(TEST_FILE)) {
+                        throw new IllegalStateException("Wrong file: " + fo);
+                    }
+                    found = true;
+                }
+
+                if (!found)
+                    throw new IllegalStateException("Could not find the expected file!");
+            }
+        }
+
+        System.err.println("finished.");
+    }
+    //where:
+        static final String TEST_FILE = "ExplodedImageTestFile.class";
+        static final int REPEATS = 16 * 1024 + 1;
+
+    void testCanCompileAgainstExplodedImage(String loc) throws IOException {
+        System.err.println("testCanCompileAgainstExplodedImage(" + loc + ")");
+        Path javaHome = prepareJavaHome();
+        Path targetPath = javaHome.resolve(loc.replace("*", "/java.base").replace("/", sep));
+        try (StandardJavaFileManager fm = javaCompiler.getStandardFileManager(null, null, null)) {
+            for (String pack : REQUIRED_PACKAGES) {
+                Iterable<JavaFileObject> content = fm.list(StandardLocation.PLATFORM_CLASS_PATH,
+                                                           pack,
+                                                           EnumSet.allOf(JavaFileObject.Kind.class),
+                                                           false);
+
+                for (JavaFileObject jfo : content) {
+                    String name = jfo.getName();
+                    int lastSlash = name.lastIndexOf('/');
+                    name = lastSlash >= 0 ? name.substring(lastSlash + 1) : name;
+                    Path target = targetPath.resolve(pack.replace(".", sep) + sep + name);
+                    Files.createDirectories(target.getParent());
+                    try (InputStream in = jfo.openInputStream()) {
+                        Files.copy(in, target);
+                    }
+                }
+            }
+        }
+
+        System.setProperty("java.home", javaHome.toString());
+
+        try (StandardJavaFileManager fm = javaCompiler.getStandardFileManager(null, null, null)) {
+            DiagnosticListener<JavaFileObject> noErrors = d -> {
+                if (d.getKind() == Diagnostic.Kind.ERROR)
+                    throw new IllegalStateException("Unexpected error: " + d);
+            };
+            ToolBox.JavaSource inputFile =
+                    new ToolBox.JavaSource("import java.util.List; class Test { List l; }");
+            List<JavaFileObject> inputFiles = Arrays.asList(inputFile);
+            boolean result =
+                    javaCompiler.getTask(null, fm, noErrors, null, null, inputFiles).call();
+            if (!result) {
+                throw new IllegalStateException("Could not compile correctly!");
+            }
+            JavacTask task =
+                    (JavacTask) javaCompiler.getTask(null, fm, noErrors, null, null, inputFiles);
+            task.parse();
+            TypeElement juList = task.getElements().getTypeElement("java.util.List");
+            if (juList == null)
+                throw new IllegalStateException("Cannot resolve java.util.List!");
+            URI listSource = ((ClassSymbol) juList).classfile.toUri();
+            if (!listSource.toString().startsWith(javaHome.toUri().toString()))
+                throw new IllegalStateException(  "Did not load java.util.List from correct place, " +
+                                                  "actual location: " + listSource.toString() +
+                                                "; expected prefix: " + javaHome.toUri());
+        }
+
+        System.err.println("finished.");
+    }
+    //where:
+        static final String[] REQUIRED_PACKAGES = {"java.lang", "java.io", "java.util"};
+
+    Path prepareJavaHome() throws IOException {
+        Path javaHome = new File("javahome").getAbsoluteFile().toPath();
+        delete(javaHome);
+        Files.createDirectory(javaHome);
+        return javaHome;
+    }
+
+    String sep = FileSystems.getDefault().getSeparator();
+    JavaCompiler javaCompiler = ToolProvider.getSystemJavaCompiler();
+    String originalJavaHome = System.getProperty("java.home");
+
+    void delete(Path p) throws IOException {
+        if (!Files.exists(p))
+            return ;
+        if (Files.isDirectory(p)) {
+            try (DirectoryStream<Path> dir = Files.newDirectoryStream(p)) {
+                for (Path child : dir) {
+                    delete(child);
+                }
+            }
+        }
+        Files.delete(p);
+    }
+}
--- a/langtools/test/tools/javac/lambda/8016177/T8016177g.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/langtools/test/tools/javac/lambda/8016177/T8016177g.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,6 +1,6 @@
 /*
  * @test /nodynamiccopyright/
- * @bug 8016081 8016178
+ * @bug 8016081 8016178 8069545
  * @summary structural most specific and stuckness
  * @compile/fail/ref=T8016177g.out -XDrawDiagnostics T8016177g.java
  */
--- a/langtools/test/tools/javac/lambda/8016177/T8016177g.out	Wed Feb 18 22:19:47 2015 -0500
+++ b/langtools/test/tools/javac/lambda/8016177/T8016177g.out	Mon Feb 23 05:01:11 2015 -0800
@@ -1,2 +1,3 @@
-T8016177g.java:35:20: compiler.err.prob.found.req: (compiler.misc.possible.loss.of.precision: double, int)
-1 error
+T8016177g.java:34:14: compiler.err.cant.apply.symbol: kindname.method, print, java.lang.String, Test.Person, kindname.class, Test, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inferred.do.not.conform.to.upper.bounds: Test.Person, java.lang.String,java.lang.Object))
+T8016177g.java:35:20: compiler.err.cant.apply.symbol: kindname.method, abs, int, java.lang.Double, kindname.class, Test, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.infer.no.conforming.instance.exists: , R, int))
+2 errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/8068399/T8068399.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,119 @@
+/*
+ * 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.
+ */
+/*
+ * @test
+ * @bug 8068399 8069545
+ * @summary structural most specific and stuckness
+ */
+
+import java.util.function.Function;
+import java.util.stream.IntStream;
+import java.util.stream.Stream;
+
+public class T8068399 {
+
+    public static class Spectrum {
+        public double[] getEnergy() {
+            return new double[0];
+        }
+    }
+
+    protected Spectrum spectrum;
+
+    public static class Ref<T> {
+
+        T value;
+
+        public Ref() {
+        }
+
+        public Ref(T value) {
+            this.value = value;
+        }
+
+        public boolean isNull() {
+            return value == null;
+        }
+
+        public T get() {
+            return value;
+        }
+
+        public void set(T value) {
+            this.value = value;
+        }
+    }
+
+    public static <T>T maxKey(Stream<T> stream, Function<T, Double> function) {
+        Ref<Double> max = new Ref<>();
+        Ref<T> index = new Ref<>();
+        stream.forEach(v -> {
+            Double value = function.apply(v);
+
+            if (max.isNull() || value > max.get()) {
+                max.set(value);
+                index.set(v);
+            }
+        });
+
+        return index.get();
+    }
+
+    public static int interpolate(int x, int x0, int x1, int y0, int y1) {
+        return y0 + (x - x0) * (y1 - y0) / (x1 - x0);
+    }
+
+    public static double interpolate(double x, double x0, double x1, double y0, double y1) {
+        return y0 + (x - x0) * (y1 - y0) / (x1 - x0);
+    }
+
+    protected int getXByFrequency(double frequency) {
+        return (int) Math.round(interpolate(frequency,
+                                            getMinSpectrumCoord(),
+                                            getMaxSpectrumCoord(),
+                                            0, getWidth()));
+    }
+
+    private int getWidth() {
+        return 0;
+    }
+
+    private double getMaxSpectrumCoord() {
+        return 0;
+    }
+
+    private double getMinSpectrumCoord() {
+        return 0;
+    }
+
+    void foo() {
+        int maxBpmIndex = 0;
+        int xcur = getXByFrequency(maxKey(IntStream.range(0, maxBpmIndex).boxed(),
+                                          i -> Math.abs(spectrum.getEnergy()[i])));
+    }
+
+    public static void main(String [] args) {
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/8068430/T8068430.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8068430 8069545
+ * @summary structural most specific and stuckness
+ */
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class T8068430 {
+    public static void main(String[] args) {
+        Map<Integer, String> mp = new HashMap<>();
+        mp.put(1, "a");
+        mp.put(2, "b");
+        mp.put(3, "c");
+        mp.put(4, "d");
+        System.out.println(mp.entrySet().stream().reduce(0,
+                (i, e) -> i + e.getKey(),
+                (i1, i2) -> i1 + i2));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/8071432/T8071432.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,50 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8071432 8069545
+ * @summary structural most specific and stuckness
+ * @compile/fail/ref=T8071432.out -XDrawDiagnostics T8071432.java
+ */
+
+import java.util.Arrays;
+import java.util.Collection;
+
+class T8071432 {
+
+    static class Point {
+
+        private double x, y;
+
+        public Point(double x, double y) {
+            this.x = x;
+            this.y = y;
+        }
+
+        public double getX() {
+            return x;
+        }
+
+        public double getY() {
+            return y;
+        }
+
+        public double distance(Point p) {
+            return Math.sqrt((this.x - p.x) * (this.x - p.x) +
+                             (this.y - p.y) * (this.y - p.y));
+        }
+
+        public double distance() {
+            return Math.sqrt(this.x * this.x + this.y * this.y);
+        }
+
+        public String toString() {
+            return "(" + x + ":" + y + ")";
+        }
+    }
+
+    public static void main(String[] args) {
+        Collection<Point> c = Arrays.asList(new Point(1.0, 0.1));
+        System.out.println("------- 1 ---------------");
+        System.out.println(c.stream().reduce(0.0,
+                                            (s, p) -> s += p.distance(), (d1, d2) -> 0));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/8071432/T8071432.out	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,3 @@
+T8071432.java:47:45: compiler.err.prob.found.req: (compiler.misc.infer.no.conforming.assignment.exists: U, (compiler.misc.incompatible.ret.type.in.lambda: (compiler.misc.inconvertible.types: int, java.lang.Double)))
+T8071432.java:47:27: compiler.err.cant.apply.symbol: kindname.method, println, java.lang.Object, <any>, kindname.class, java.io.PrintStream, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.infer.no.conforming.assignment.exists: U, (compiler.misc.incompatible.ret.type.in.lambda: (compiler.misc.inconvertible.types: int, java.lang.Double))))
+2 errors
--- a/langtools/test/tools/javac/lambda/MethodReference55.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/langtools/test/tools/javac/lambda/MethodReference55.java	Mon Feb 23 05:01:11 2015 -0800
@@ -1,29 +1,6 @@
 /*
- * Copyright (c) 2012, 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.
- *
- * 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.
- */
-
-/*
- * @test
- * @bug 8004101
+ * @test /nodynamiccopyright/
+ * @bug 8004101 8072445
  * @summary Add checks for method reference well-formedness
  * @compile/fail/ref=MethodReference55.out -XDrawDiagnostics MethodReference55.java
  */
--- a/langtools/test/tools/javac/lambda/MethodReference55.out	Wed Feb 18 22:19:47 2015 -0500
+++ b/langtools/test/tools/javac/lambda/MethodReference55.out	Mon Feb 23 05:01:11 2015 -0800
@@ -1,3 +1,3 @@
-MethodReference55.java:36:11: compiler.err.prob.found.req: (compiler.misc.invalid.mref: kindname.method, (compiler.misc.bad.static.method.in.bound.lookup: kindname.method, m(java.lang.Object)))
-MethodReference55.java:39:9: compiler.err.cant.apply.symbol: kindname.method, g, MethodReference55.V, @1384, kindname.class, MethodReference55<X>, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.invalid.mref: kindname.method, (compiler.misc.bad.static.method.in.bound.lookup: kindname.method, m(java.lang.Object))))
+MethodReference55.java:13:11: compiler.err.prob.found.req: (compiler.misc.invalid.mref: kindname.method, (compiler.misc.bad.static.method.in.bound.lookup: kindname.method, m(java.lang.Object)))
+MethodReference55.java:16:9: compiler.err.cant.apply.symbol: kindname.method, g, MethodReference55.V, @361, kindname.class, MethodReference55<X>, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.invalid.mref: kindname.method, (compiler.misc.bad.static.method.in.bound.lookup: kindname.method, m(java.lang.Object))))
 2 errors
--- a/langtools/test/tools/javac/resolve/tests/PrimitiveBinopOverload.java	Wed Feb 18 22:19:47 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 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.
- *
- * 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.
- */
-
-@TraceResolve
-class PrimitiveBinopOverload {
-
-    @Candidate(applicable=Phase.BASIC, mostSpecific=true)
-    int _plus(int x, int y) { return -1; }
-    @Candidate(applicable=Phase.BASIC)
-    long _plus(long x, long y) { return -1; }
-    @Candidate(applicable=Phase.BASIC)
-    float _plus(float x, float y) { return -1; }
-    @Candidate(applicable=Phase.BASIC)
-    double _plus(double x, double y) { return -1; }
-    //not a candidate
-    Object _plus(Object x, Object y) { return -1; }
-
-    @Candidate(applicable= { Phase.BASIC, Phase.BOX }, mostSpecific=true)
-    int _minus(int x, int y) { return -1; }
-    @Candidate(applicable= { Phase.BASIC, Phase.BOX })
-    long _minus(long x, long y) { return -1; }
-    @Candidate(applicable= { Phase.BASIC, Phase.BOX })
-    float _minus(float x, float y) { return -1; }
-    @Candidate(applicable= { Phase.BASIC, Phase.BOX })
-    double _minus(double x, double y) { return -1; }
-
-    @Candidate(applicable= { Phase.BASIC, Phase.BOX }, mostSpecific=true)
-    int _mul(int x, int y) { return -1; }
-    @Candidate(applicable= { Phase.BASIC, Phase.BOX })
-    long _mul(long x, long y) { return -1; }
-    @Candidate(applicable= { Phase.BASIC, Phase.BOX })
-    float _mul(float x, float y) { return -1; }
-    @Candidate(applicable= { Phase.BASIC, Phase.BOX })
-    double _mul(double x, double y) { return -1; }
-
-    @Candidate(applicable= { Phase.BASIC, Phase.BOX }, mostSpecific=true)
-    int _div(int x, int y) { return -1; }
-    @Candidate(applicable= { Phase.BASIC, Phase.BOX })
-    long _div(long x, long y) { return -1; }
-    @Candidate(applicable= { Phase.BASIC, Phase.BOX })
-    float _div(float x, float y) { return -1; }
-    @Candidate(applicable= { Phase.BASIC, Phase.BOX })
-    double _div(double x, double y) { return -1; }
-
-    {
-        int i1 = 1 + 1;
-        int i2 = 5 - new Integer(3);
-        int i3 = new Integer(5) * 3;
-        int i4 = new Integer(6) / new Integer(2);
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/sjavac/ParallelCompilations.java	Mon Feb 23 05:01: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.
+ */
+
+/*
+ * @test
+ * @summary Test to check that -j option works with more than one value
+ * @bug 8071629
+ * @author sogoel
+ * @library /tools/lib
+ * @build Wrapper ToolBox
+ * @run main Wrapper ParallelCompilations
+ */
+
+import java.io.*;
+import java.nio.file.*;
+import com.sun.tools.sjavac.Main;
+
+class ParallelCompilations extends SJavacTester {
+  public static void main(String[] args) throws Exception {
+    new ParallelCompilations().run();
+  }
+
+  public void run() throws Exception {
+    ToolBox tb = new ToolBox();
+    final String SERVER_ARG = "--server:"
+            + "portfile=testportfile,"
+            + "background=false";
+
+    // Generate 10 files
+    for (int i = 0; i < 10; i++) {
+      String fileName = "Test" + i;
+      String content = "package foo"+ i + ";\n" +
+                       "public class "+ fileName + "{\n" +
+                       "  public static void main(String[] args) {}\n" +
+                       "\n}";
+      Path srcDir = Paths.get("src");
+      tb.writeJavaFiles(srcDir,content);
+    }
+    //Method will throw an exception if compilation fails
+    compile("src", "-d", "classes", "-j", "10", SERVER_ARG, "--log=debug");
+  }
+}
--- a/make/CompileJavaModules.gmk	Wed Feb 18 22:19:47 2015 -0500
+++ b/make/CompileJavaModules.gmk	Mon Feb 23 05:01:11 2015 -0800
@@ -89,7 +89,11 @@
 
 ################################################################################
 
-java.desktop_COPY := .gif .png .wav .txt .xml .css flavormap.properties .pf
+java.datatransfer_COPY := flavormap.properties
+
+################################################################################
+
+java.desktop_COPY := .gif .png .wav .txt .xml .css .pf
 java.desktop_CLEAN := iio-plugin.properties
 
 java.desktop_EXCLUDES += \
--- a/make/Images.gmk	Wed Feb 18 22:19:47 2015 -0500
+++ b/make/Images.gmk	Mon Feb 23 05:01:11 2015 -0800
@@ -183,7 +183,6 @@
       keytool.1 \
       orbd.1 \
       pack200.1 \
-      policytool.1 \
       rmid.1 \
       rmiregistry.1 \
       servertool.1 \
@@ -220,6 +219,7 @@
       jstat.1 \
       jstatd.1 \
       native2ascii.1 \
+      policytool.1 \
       rmic.1 \
       schemagen.1 \
       serialver.1 \
--- a/make/Main.gmk	Wed Feb 18 22:19:47 2015 -0500
+++ b/make/Main.gmk	Mon Feb 23 05:01:11 2015 -0800
@@ -212,7 +212,7 @@
 	@$(RM) $@
 	@$(call GetSourceTips)
 
-BOOTCYCLE_TARGET := images
+BOOTCYCLE_TARGET := product-images
 bootcycle-images:
 	@$(ECHO) Boot cycle build step 2: Building a new JDK image using previously built image
 	+$(MAKE) $(MAKE_ARGS) -f Main.gmk SPEC=$(dir $(SPEC))bootcycle-spec.gmk $(BOOTCYCLE_TARGET)
@@ -347,8 +347,8 @@
   $(foreach m, $(RMIC_MODULES), $(eval $m-rmic: $m-java))
 
   # Declare dependencies from <module>-lib to <module>-java
-  # Skip jdk.jdwp.agent as it contains no java code.
-  $(foreach m, $(filter-out jdk.jdwp.agent, $(LIBS_MODULES)), $(eval $m-libs: $m-java))
+  # Skip modules that do not have java source.
+  $(foreach m, $(filter $(JAVA_MODULES), $(LIBS_MODULES)), $(eval $m-libs: $m-java))
 
   # Declare dependencies from all other <module>-lib to java.base-lib
   $(foreach t, $(filter-out java.base-libs, $(LIBS_TARGETS)), \
@@ -443,31 +443,45 @@
 ALL_MODULE_TARGETS := $(sort $(GENSRC_MODULES) $(JAVA_MODULES) \
     $(GENDATA_MODULES) $(LIBS_MODULES) $(LAUNCHER_MODULES) $(COPY_MODULES))
 
+# The "exploded image" is a locally runnable JDK in $(BUILD_OUTPUT)/jdk.
 exploded-image: $(ALL_MODULE_TARGETS)
-# The old 'jdk' target most closely matches the new exploded-image. Keep an
-# alias for ease of use.
-jdk: exploded-image
+
+# The $(BUILD_OUTPUT)/images directory contain the resulting deliverables, 
+# and in line with this, our targets for creating these are named *-image[s].
 
-images: test-image jimages demos samples zip-security verify-modules
+# This target builds the product images, e.g. the JRE and JDK image
+# (and possibly other, more specific versions)
+product-images: jimages demos samples zip-security verify-modules
 
 ifeq ($(OPENJDK_TARGET_OS), macosx)
-  images: mac-bundles
+  product-images: mac-bundles
 endif
 
-docs: docs-javadoc docs-jvmtidoc
+# This target builds the documentation image
+docs-image: docs-javadoc docs-jvmtidoc
 
+# This target builds the test image
 test-image: prepare-test-image
 
+# all-images is the top-most target, it builds all our deliverables ("images").
+all-images: product-images test-image docs-image
+
 ALL_TARGETS += buildtools gensrc gendata copy java rmic libs launchers \
-    jdk.jdwp.agent-gensrc $(ALL_MODULE_TARGETS) exploded-image jdk images \
-    docs test-image
+    jdk.jdwp.agent-gensrc $(ALL_MODULE_TARGETS) exploded-image \
+    product-images docs-image test-image all-images
 
 ################################################################################
 
-all: images
+# Traditional targets typically run by users.
+# These can be considered aliases for the targets now named by a more
+# "modern" naming scheme.
 default: exploded-image
+jdk: exploded-image
+images: product-images
+docs: docs-image
+all: all-images
 
-ALL_TARGETS += default all
+ALL_TARGETS += default jdk images docs all
 
 ################################################################################
 ################################################################################
@@ -553,7 +567,8 @@
         else
 	  @$(ECHO) "Re-running configure using default settings"
         endif
-	@( cd $(OUTPUT_ROOT) && $(BASH) $(TOPDIR)/configure $(CONFIGURE_COMMAND_LINE) )
+	@( cd $(OUTPUT_ROOT) && PATH="$(ORIGINAL_PATH)" \
+	    $(BASH) $(TOPDIR)/configure $(CONFIGURE_COMMAND_LINE) )
 
 ALL_TARGETS += reconfigure
 
--- a/make/StripBinaries.gmk	Wed Feb 18 22:19:47 2015 -0500
+++ b/make/StripBinaries.gmk	Mon Feb 23 05:01:11 2015 -0800
@@ -53,7 +53,7 @@
 endif
 
 # Don't include debug info for executables.
-ALL_CMDS_SRC := $(filter-out %.debuginfo %.diz %.map %.pdb, \
+ALL_CMDS_SRC := $(filter-out %.bc %.debuginfo %.diz %.map %.pdb, \
     $(shell $(FIND) $(SUPPORT_OUTPUTDIR)/modules_cmds -type f -o -type l))
 COPY_CMDS_SRC := $(filter %.cgi, $(ALL_CMDS_SRC))
 STRIP_CMDS_SRC := $(filter-out $(COPY_CMDS_SRC), $(ALL_CMDS_SRC))
--- a/make/common/IdlCompilation.gmk	Wed Feb 18 22:19:47 2015 -0500
+++ b/make/common/IdlCompilation.gmk	Mon Feb 23 05:01:11 2015 -0800
@@ -94,7 +94,7 @@
 endef
 
 define SetupIdlCompilationInner
-  $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE))
+  $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $(strip $($i)),$1_$(strip $($i)))$(NEWLINE))
   $(call LogSetupMacroEntry,SetupIdlCompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15))
   $(if $(16),$(error Internal makefile error: Too many arguments to SetupIdlCompilation, please update IdlCompilation.gmk))
 
--- a/make/common/JavaCompilation.gmk	Wed Feb 18 22:19:47 2015 -0500
+++ b/make/common/JavaCompilation.gmk	Mon Feb 23 05:01:11 2015 -0800
@@ -65,7 +65,7 @@
 endef
 
 define SetupJavaCompilerInner
-  $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE))
+  $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $(strip $($i)),$1_$(strip $($i)))$(NEWLINE))
   $(call LogSetupMacroEntry,SetupJavaCompiler($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15))
   $(if $(16),$(error Internal makefile error: Too many arguments to SetupJavaCompiler, please update JavaCompilation.gmk))
 
@@ -84,6 +84,9 @@
 # Parameter 1 is the name of the rule. This name is used as variable prefix,
 # and the targets generated are listed in a variable by that name.
 #
+# Parameter 2 is a list of dependencies for the jar target. If left empty,
+# dependencies are searched using SRCS, which should not be empty.
+#
 # Remaining parameters are named arguments. These include:
 #   SRCS:=List of directories in where to find files to add to archive
 #   SUFFIXES:=File suffixes to include in jar
@@ -106,7 +109,7 @@
 
 define SetupArchiveInner
   # NOTE: $2 is dependencies, not a named argument!
-  $(foreach i,3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE))
+  $(foreach i,3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $(strip $($i)),$1_$(strip $($i)))$(NEWLINE))
   $(call LogSetupMacroEntry,SetupArchive($1),<dependencies>,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15))
   $(if $(findstring $(LOG_LEVEL),trace), $(info *[2] <dependencies> = $(strip $2)))
   $(if $(16),$(error Internal makefile error: Too many arguments to SetupArchive, please update JavaCompilation.gmk))
@@ -362,6 +365,10 @@
 # This is the new clean standard. Though it is to be superseded by
 # a standard annotation processor from with sjavac.
 #
+# An empty echo ensures that the input to sed always ends with a newline.
+# Certain implementations (e.g. Solaris) will skip the last line without
+# it.
+#
 # The sed expression does this:
 # 1. Add a backslash before any :, = or ! that do not have a backslash already.
 # 2. Apply the file unicode2x.sed which does a whole bunch of \u00XX to \xXX
@@ -384,7 +391,7 @@
   # Now we can setup the depency that will trigger the copying.
   $$($1_BIN)$$($2_TARGET) : $2
 	$(MKDIR) -p $$(@D)
-	export LC_ALL=C ; $(CAT) $$< \
+	export LC_ALL=C ; ( $(CAT) $$< && $(ECHO) "" ) \
 	    | $(SED) -e 's/\([^\\]\):/\1\\:/g' -e 's/\([^\\]\)=/\1\\=/g' \
 	        -e 's/\([^\\]\)!/\1\\!/g' -e 's/#.*/#/g' \
 	    | $(SED) -f "$(SRC_ROOT)/make/common/support/unicode2x.sed" \
@@ -434,10 +441,15 @@
 endef
 
 define SetupJavaCompilationInner
-  $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE))
+  $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $(strip $($i)),$1_$(strip $($i)))$(NEWLINE))
   $(call LogSetupMacroEntry,SetupJavaCompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15))
   $(if $(16),$(error Internal makefile error: Too many arguments to SetupJavaCompilation, please update JavaCompilation.gmk))
 
+  # Verify arguments
+  ifeq ($$($1_BIN),)
+    $$(error Must specify BIN (in $1))
+  endif
+
   # Extract the info from the java compiler setup.
   $1_JVM := $$($$($1_SETUP)_JVM)
   $1_JAVAC := $$($$($1_SETUP)_JAVAC)
--- a/make/common/MakeBase.gmk	Wed Feb 18 22:19:47 2015 -0500
+++ b/make/common/MakeBase.gmk	Mon Feb 23 05:01:11 2015 -0800
@@ -377,7 +377,7 @@
 # This is to be called by all SetupFoo macros
 define LogSetupMacroEntry
   $(if $(27),$(error Internal makefile error: Too many arguments to LogSetupMacroEntry, please update MakeBase.gmk))
-  $(if $(findstring $(LOG_LEVEL),debug trace), $(info $1 $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26,$(if $($i),$(NEWLINE) $(strip [$i] $($i))))))
+  $(if $(findstring $(LOG_LEVEL),debug trace), $(info $1 $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26,$(if $(strip $($i)),$(NEWLINE) $(strip [$i] $($i))))))
 endef
 
 # Support macro for all SetupFoo macros.
@@ -515,7 +515,6 @@
   # 2 : Dest file
   # 3 : Variable to add targets to
   # 4 : Macro to call for copy operation
-
   $2: $1
 	$(ECHO) $(LOG_INFO) Copying $$(patsubst $(OUTPUT_ROOT)/%,%,$$@)
 	$$($$(strip $4))
@@ -523,22 +522,43 @@
   $3 += $2
 endef
 
+# Setup make rules for copying files, with an option to do more complex
+# processing instead of copying.
+#
+# Parameter 1 is the name of the rule. This name is used as variable prefix,
+# and the targets generated are listed in a variable by that name.
+#
+# Remaining parameters are named arguments. These include:
+#   SRC     : Source root dir (defaults to dir of first file)
+#   DEST    : Dest root dir
+#   FILES   : List of files to copy with absolute paths, or path relative to SRC.
+#             Must be in SRC.
+#   FLATTEN : Set to flatten the directory structure in the DEST dir.
+#   MACRO   : Optionally override the default macro used for making the copy.
+#             Default is 'install-file'
+
 define SetupCopyFiles
-  # param 1 is for example COPY_MYFILES
-  # param 2,3,4,5 are named args.
-  #   SRC   : Source root dir
-  #   DEST  : Dest root dir
-  #   FILES : List of files to copy with absolute paths, or path relative to SRC. Must be in SRC.
-  #   FLATTEN : Set to flatten the directory structure in the DEST dir.
-  #   MACRO : Optionally override the default macro used for making the copy. Default is 'install-file'
-  $(foreach i,2 3 4 5 6, $(if $($i),$1_$(strip $($i)))$(NEWLINE))
+  $(if $(16),$(error Internal makefile error: Too many arguments to SetupCopyFiles, please update MakeBase.gmk))
+  $(call EvalDebugWrapper,$(strip $1),$(call SetupCopyFilesInner,$(strip $1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)))
+endef
+
+define SetupCopyFilesInner
+  $(foreach i,2 3 4 5 6, $(if $(strip $($i)),$1_$(strip $($i)))$(NEWLINE))
   $(call LogSetupMacroEntry,SetupCopyFiles($1),$2,$3,$4,$5,$6)
-  $(if $(7),$(error Internal makefile error: Too many arguments to SetupCopyFiles))
+  $(if $(7),$(error Internal makefile error: Too many arguments to SetupCopyFiles, please update MakeBase.gmk))
 
   ifeq ($$($1_MACRO), )
     $1_MACRO := install-file
   endif
 
+  # Default SRC to the dir of the first file.
+  ifeq ($$($1_SRC), )
+    $1_SRC := $$(dir $$(firstword $$($1_FILES)))
+  endif
+
+  # Remove any trailing slash from SRC
+  $1_SRC := $$(patsubst %/,%,$$($1_SRC))
+
   $$(foreach f, $$(patsubst $$($1_SRC)/%,%,$$($1_FILES)), \
       $$(eval $$(call AddFileToCopy, $$($1_SRC)/$$f, \
       $$($1_DEST)/$$(if $$($1_FLATTEN),$$(notdir $$f),$$f), $1, $$($1_MACRO))))
--- a/make/common/NativeCompilation.gmk	Wed Feb 18 22:19:47 2015 -0500
+++ b/make/common/NativeCompilation.gmk	Mon Feb 23 05:01:11 2015 -0800
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 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
@@ -53,6 +53,8 @@
   UNIX_PATH_PREFIX :=
 endif
 
+# This pattern is used to transform the output of the microsoft CL compiler
+# into a make syntax dependency file (.d)
 WINDOWS_SHOWINCLUDE_SED_PATTERN := \
     -e '/^Note: including file:/!d' \
     -e 's|Note: including file: *||' \
@@ -62,6 +64,16 @@
     -e 's|$$$$| \\|g' \
     #
 
+# This pattern is used to transform a dependency file (.d) to a list
+# of make targets for dependent files (.d.targets)
+DEPENDENCY_TARGET_SED_PATTERN := \
+    -e 's/\#.*//' \
+    -e 's/^[^:]*: *//' \
+    -e 's/ *\\$$$$//' \
+    -e '/^$$$$/ d' \
+    -e 's/$$$$/ :/' \
+    #
+
 define add_native_source
   # param 1 = BUILD_MYPACKAGE
   # parma 2 = the source file name (..../alfa.c or .../beta.cpp)
@@ -75,12 +87,12 @@
 
   ifneq (,$$(filter %.c,$2))
     # Compile as a C file
-    $1_$2_FLAGS=$4 $$($1_$(notdir $2)_CFLAGS) -DTHIS_FILE='"$$(<F)"' -c
+    $1_$2_FLAGS=$(CFLAGS_CCACHE) $4 $$($1_$(notdir $2)_CFLAGS) -DTHIS_FILE='"$$(<F)"' -c
     $1_$2_COMP=$5
     $1_$2_DEP_FLAG:=$(C_FLAG_DEPS)
   else ifneq (,$$(filter %.m,$2))
     # Compile as a objective-c file
-    $1_$2_FLAGS=-x objective-c $4 $$($1_$(notdir $2)_CFLAGS) -DTHIS_FILE='"$$(<F)"' -c
+    $1_$2_FLAGS=-x objective-c $(CFLAGS_CCACHE) $4 $$($1_$(notdir $2)_CFLAGS) -DTHIS_FILE='"$$(<F)"' -c
     $1_$2_COMP=$8
     $1_$2_DEP_FLAG:=$(C_FLAG_DEPS)
   else ifneq (,$$(filter %.s,$2))
@@ -90,7 +102,7 @@
     $1_$2_DEP_FLAG:=
   else ifneq (,$$(filter %.cpp,$2)$$(filter %.mm,$2))
     # Compile as a C++ file
-    $1_$2_FLAGS=$6 $$($1_$(notdir $2)_CXXFLAGS) -DTHIS_FILE='"$$(<F)"' -c
+    $1_$2_FLAGS=$(CFLAGS_CCACHE) $6 $$($1_$(notdir $2)_CXXFLAGS) -DTHIS_FILE='"$$(<F)"' -c
     $1_$2_COMP=$7
     $1_$2_DEP_FLAG:=$(CXX_FLAG_DEPS)
   else
@@ -105,8 +117,13 @@
     ifeq (,$$(filter %.s,$2))
       # And this is the dependency file for this obj file.
       $1_$2_DEP:=$$(patsubst %$(OBJ_SUFFIX),%.d,$$($1_$2_OBJ))
+      # The dependency target file lists all dependencies as empty targets
+      # to avoid make error "No rule to make target" for removed files
+      $1_$2_DEP_TARGETS:=$$(patsubst %$(OBJ_SUFFIX),%.d.targets,$$($1_$2_OBJ))
+
       # Include previously generated dependency information. (if it exists)
       -include $$($1_$2_DEP)
+      -include $$($1_$2_DEP_TARGETS)
 
       ifeq ($(TOOLCHAIN_TYPE), microsoft)
         $1_$2_DEBUG_OUT_FLAGS:=-Fd$$(patsubst %$(OBJ_SUFFIX),%.pdb,$$($1_$2_OBJ)) \
@@ -139,6 +156,11 @@
 	  ($(ECHO) $$@: \\ \
 	  && $(SED) $(WINDOWS_SHOWINCLUDE_SED_PATTERN) $$($1_$2_DEP).raw) > $$($1_$2_DEP)
         endif
+        # Create a dependency target file from the dependency file.
+        # Solution suggested by http://make.mad-scientist.net/papers/advanced-auto-dependency-generation/
+        ifneq ($$($1_$2_DEP),)
+	  $(SED) $(DEPENDENCY_TARGET_SED_PATTERN) $$($1_$2_DEP) > $$($1_$2_DEP_TARGETS)
+        endif
   endif
 endef
 
@@ -179,7 +201,7 @@
 endef
 
 define SetupNativeCompilationInner
-  $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26, $(if $($i),$1_$(strip $($i)))$(NEWLINE))
+  $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26, $(if $(strip $($i)),$1_$(strip $($i)))$(NEWLINE))
   $(call LogSetupMacroEntry,SetupNativeCompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15),$(16),$(17),$(18),$(19),$(20),$(21),$(22),$(23),$(24),$(25),$(26))
   $(if $(27),$(error Internal makefile error: Too many arguments to SetupNativeCompilation, please update NativeCompilation.gmk))
 
@@ -428,7 +450,7 @@
   $1_BUILD_INFO := $$($1_OBJECT_DIR)/_build-info.marker
 
   # Track variable changes for all variables that affect the compilation command
-  # lines for all object files in this setup. This includes at least all the 
+  # lines for all object files in this setup. This includes at least all the
   # variables used in the call to add_native_source below.
   $1_COMPILE_VARDEPS := $$($1_CFLAGS) $$($1_EXTRA_CFLAGS) $(SYSROOT_CFLAGS) \
       $$($1_CXXFLAGS) $$($1_EXTRA_CXXFLAGS) \
@@ -452,7 +474,10 @@
         ifeq ($$(wildcard $$($1_TARGET)),)
 	  $(ECHO) 'Creating $$($1_BASENAME) from $$(words $$(filter-out %.vardeps, $$?)) file(s)'
         else
-	  $(ECHO) 'Updating $$($1_BASENAME) from $$(words $$(filter-out %.vardeps, $$?)) file(s)'
+	  $(ECHO) $$(strip 'Updating $$($1_BASENAME)' \
+	      $$(if $$(filter-out %.vardeps, $$?), \
+	        'from $$(words $$(filter-out %.vardeps, $$?)) file(s)') \
+	      $$(if $$(filter %.vardeps, $$?), 'due to makefile changes'))
         endif
 	$(TOUCH) $$@
 
@@ -461,7 +486,9 @@
     ifneq (,$$($1_VERSIONINFO_RESOURCE))
       $1_RES:=$$($1_OBJECT_DIR)/$$($1_BASENAME).res
       $1_RES_DEP:=$$($1_RES).d
+      $1_RES_DEP_TARGETS:=$$($1_RES).d.targets
       -include $$($1_RES_DEP)
+      -include $$($1_RES_DEP_TARGETS)
 
       $1_RES_VARDEPS := $(RC) $$($1_RC_FLAGS)
       $1_RES_VARDEPS_FILE := $$(call DependOnVariable, $1_RES_VARDEPS, \
@@ -469,12 +496,14 @@
 
       $$($1_RES): $$($1_VERSIONINFO_RESOURCE) $$($1_RES_VARDEPS_FILE)
 		$(ECHO) $(LOG_INFO) "Compiling resource $$(notdir $$($1_VERSIONINFO_RESOURCE)) (for $$(notdir $$($1_TARGET)))"
-		$(RC) $$($1_RC_FLAGS) $(CC_OUT_OPTION)$$@ $$($1_VERSIONINFO_RESOURCE)
+		$(RC) $$($1_RC_FLAGS) $(SYSROOT_CFLAGS) $(CC_OUT_OPTION)$$@ \
+		    $$($1_VERSIONINFO_RESOURCE)
                 # Windows RC compiler does not support -showIncludes, so we mis-use CL for this.
-		$(CC) $$($1_RC_FLAGS) -showIncludes -nologo -TC \
+		$(CC) $$($1_RC_FLAGS) $(SYSROOT_CFLAGS) -showIncludes -nologo -TC \
 		    $(CC_OUT_OPTION)$$($1_RES_DEP).obj $$($1_VERSIONINFO_RESOURCE) > $$($1_RES_DEP).raw 2>&1 || exit 0
 		($(ECHO) $$($1_RES): \\ \
 		&& $(SED) $(WINDOWS_SHOWINCLUDE_SED_PATTERN) $$($1_RES_DEP).raw) > $$($1_RES_DEP)
+		$(SED) $(DEPENDENCY_TARGET_SED_PATTERN) $$($1_RES_DEP) > $$($1_RES_DEP_TARGETS)
     endif
     ifneq (,$$($1_MANIFEST))
       $1_GEN_MANIFEST:=$$($1_OBJECT_DIR)/$$($1_PROGRAM).manifest
--- a/make/common/RMICompilation.gmk	Wed Feb 18 22:19:47 2015 -0500
+++ b/make/common/RMICompilation.gmk	Mon Feb 23 05:01:11 2015 -0800
@@ -43,7 +43,7 @@
 endef
 
 define SetupRMICompilationInner
-  $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE))
+  $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $(strip $($i)),$1_$(strip $($i)))$(NEWLINE))
   $(call LogSetupMacroEntry,SetupRMICompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15))
   $(if $(16),$(error Internal makefile error: Too many arguments to SetupRMICompilation, please update RMICompilation.gmk))
 
--- a/modules.xml	Wed Feb 18 22:19:47 2015 -0500
+++ b/modules.xml	Mon Feb 23 05:01:11 2015 -0800
@@ -41,7 +41,8 @@
   <module>
     <name>java.activation</name>
     <depend>java.base</depend>
-    <depend re-exports="true">java.desktop</depend>
+    <depend re-exports="true">java.datatransfer</depend>
+    <depend>java.desktop</depend>
     <depend>java.logging</depend>
     <export>
       <name>javax.activation</name>
@@ -108,6 +109,9 @@
       <name>java.security</name>
     </export>
     <export>
+      <name>java.security.acl</name>
+    </export>
+    <export>
       <name>java.security.cert</name>
     </export>
     <export>
@@ -312,6 +316,7 @@
     <export>
       <name>sun.reflect.misc</name>
       <to>java.corba</to>
+      <to>java.datatransfer</to>
       <to>java.desktop</to>
       <to>java.management</to>
       <to>java.rmi</to>
@@ -355,7 +360,7 @@
       <to>java.rmi</to>
       <to>java.security.jgss</to>
       <to>jdk.crypto.pkcs11</to>
-      <to>jdk.runtime</to>
+      <to>jdk.dev</to>
       <to>jdk.security.auth</to>
     </export>
     <export>
@@ -388,7 +393,6 @@
       <to>jdk.crypto.ucrypto</to>
       <to>jdk.deploy.osx</to>
       <to>jdk.dev</to>
-      <to>jdk.runtime</to>
       <to>jdk.security.auth</to>
     </export>
     <export>
@@ -446,7 +450,6 @@
     <depend re-exports="true">java.management</depend>
     <depend re-exports="true">java.naming</depend>
     <depend re-exports="true">java.prefs</depend>
-    <depend re-exports="true">java.security.acl</depend>
     <depend re-exports="true">java.security.jgss</depend>
     <depend re-exports="true">java.security.sasl</depend>
     <depend re-exports="true">java.sql.rowset</depend>
@@ -582,11 +585,23 @@
     </export>
   </module>
   <module>
+    <name>java.datatransfer</name>
+    <depend>java.base</depend>
+    <export>
+      <name>java.awt.datatransfer</name>
+    </export>
+    <export>
+      <name>sun.datatransfer</name>
+      <to>java.desktop</to>
+    </export>
+  </module>
+  <module>
     <name>java.desktop</name>
     <depend>java.base</depend>
     <depend>java.logging</depend>
     <depend>java.prefs</depend>
     <depend re-exports="true">java.xml</depend>
+    <depend re-exports="true">java.datatransfer</depend>
     <depend>jdk.charsets</depend>
     <export>
       <name>java.applet</name>
@@ -598,9 +613,6 @@
       <name>java.awt.color</name>
     </export>
     <export>
-      <name>java.awt.datatransfer</name>
-    </export>
-    <export>
       <name>java.awt.dnd</name>
     </export>
     <export>
@@ -885,19 +897,13 @@
     <depend re-exports="true">java.activation</depend>
     <depend re-exports="true">java.compact3</depend>
     <depend re-exports="true">java.corba</depend>
+    <depend re-exports="true">java.datatransfer</depend>
     <depend re-exports="true">java.desktop</depend>
     <depend re-exports="true">java.transaction</depend>
     <depend re-exports="true">java.xml.bind</depend>
     <depend re-exports="true">java.xml.ws</depend>
   </module>
   <module>
-    <name>java.security.acl</name>
-    <depend>java.base</depend>
-    <export>
-      <name>java.security.acl</name>
-    </export>
-  </module>
-  <module>
     <name>java.security.jgss</name>
     <depend>java.base</depend>
     <depend>java.naming</depend>
@@ -1118,6 +1124,7 @@
     <depend re-exports="true">java.activation</depend>
     <depend>java.base</depend>
     <depend>java.compiler</depend>
+    <depend>java.datatransfer</depend>
     <depend>java.desktop</depend>
     <depend>java.logging</depend>
     <depend re-exports="true">java.xml</depend>
@@ -1325,6 +1332,7 @@
     <name>java.xml.ws</name>
     <depend>java.annotations.common</depend>
     <depend>java.base</depend>
+    <depend>java.datatransfer</depend>
     <depend>java.desktop</depend>
     <depend>java.logging</depend>
     <depend>java.management</depend>
@@ -1581,6 +1589,7 @@
     <depend>java.base</depend>
     <depend>java.scripting</depend>
     <depend>java.xml</depend>
+    <depend>java.desktop</depend>
     <depend>jdk.compiler</depend>
     <depend>jdk.rmic</depend>
     <depend>jdk.xml.bind</depend>
@@ -1592,6 +1601,7 @@
   <module>
     <name>jdk.hotspot.agent</name>
     <depend>java.base</depend>
+    <depend>java.datatransfer</depend>
     <depend>java.desktop</depend>
     <depend>java.rmi</depend>
     <depend>java.scripting</depend>
@@ -1715,8 +1725,6 @@
   <module>
     <name>jdk.runtime</name>
     <depend>java.base</depend>
-    <depend>java.desktop</depend>
-    <depend>java.se</depend>
   </module>
   <module>
     <name>jdk.scripting.nashorn</name>
@@ -1764,6 +1772,7 @@
     <depend>java.activation</depend>
     <depend>java.base</depend>
     <depend>java.compiler</depend>
+    <depend>java.datatransfer</depend>
     <depend>java.desktop</depend>
     <depend>java.logging</depend>
     <depend>java.xml</depend>
--- a/nashorn/.hgtags	Wed Feb 18 22:19:47 2015 -0500
+++ b/nashorn/.hgtags	Mon Feb 23 05:01:11 2015 -0800
@@ -282,3 +282,6 @@
 2ecf0a617f0f9af1ffd278a0c70e76f1946ce773 jdk9-b46
 29046d42a95e5b9f105ab086a628bbd7f81c915d jdk9-b47
 f08660f30051ba0b38ad00e692979b37d107c9c4 jdk9-b48
+2ae58b5f05f803a469f0f6c1ed72c6b5313f4ff0 jdk9-b49
+32e48a0d59e186df8a041e1e5f8bfb0b8d2bc4cd jdk9-b50
+10b32cc48ccc2592621b28558a1cf70a0ce22fe5 jdk9-b51
--- a/nashorn/make/build.xml	Wed Feb 18 22:19:47 2015 -0500
+++ b/nashorn/make/build.xml	Mon Feb 23 05:01:11 2015 -0800
@@ -504,7 +504,7 @@
 
     <testng outputdir="${build.test.results.dir}" classfilesetref="test.classes"
        verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
-      <jvmarg line="${ext.class.path}"/>
+      <jvmarg line="${boot.class.path}"/>
       <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} -Dbuild.dir=${build.dir}"/>
       <propertyset>
         <propertyref prefix="testjfx-test-sys-prop."/>
@@ -524,7 +524,7 @@
 
     <testng outputdir="${build.test.results.dir}" classfilesetref="test.classes"
        verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
-      <jvmarg line="${ext.class.path}"/>
+      <jvmarg line="${boot.class.path}"/>
       <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs} -Dbuild.dir=${build.dir}"/>
       <propertyset>
         <propertyref prefix="testmarkdown-test-sys-prop."/>
@@ -543,7 +543,7 @@
 
     <testng outputdir="${build.test.results.dir}" classfilesetref="test.classes"
        verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
-      <jvmarg line="${ext.class.path}"/>
+      <jvmarg line="${boot.class.path}"/>
       <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs} -Dbuild.dir=${build.dir}"/>
       <propertyset>
         <propertyref prefix="nashorn."/>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/samples/getclassnpe.js	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,122 @@
+#// Usage: jjs getclassnpe.js -- <directory>
+
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   - Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *
+ *   - Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ *   - Neither the name of Oracle nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * java.lang.Object.getClass() is sometimes used to do null check. This
+ * obfuscating Object.getClass() check relies on non-related intrinsic
+ * performance, which is potentially not available everywhere.
+ * See also http://cr.openjdk.java.net/~shade/scratch/NullChecks.java
+ * This nashorn script checks for such uses in your .java files in the
+ * given directory (recursively).
+ */
+
+if (arguments.length == 0) {
+    print("Usage: jjs getclassnpe.js -- <directory>");
+    exit(1);
+}
+
+// Java types used
+var File = Java.type("java.io.File");
+var Files = Java.type("java.nio.file.Files");
+var StringArray = Java.type("java.lang.String[]");
+var ToolProvider = Java.type("javax.tools.ToolProvider");
+var MethodInvocationTree = Java.type("com.sun.source.tree.MethodInvocationTree");
+var TreeScanner = Java.type("com.sun.source.util.TreeScanner");
+
+// parse a specific .java file to check if it uses
+// Object.getClass() for null check.
+function checkGetClassNPE() {
+    // get the system compiler tool
+    var compiler = ToolProvider.systemJavaCompiler;
+    // get standard file manager
+    var fileMgr = compiler.getStandardFileManager(null, null, null);
+    // Using Java.to convert script array (arguments) to a Java String[]
+    var compUnits = fileMgr.getJavaFileObjects(
+        Java.to(arguments, StringArray));
+    // create a new compilation task
+    var task = compiler.getTask(null, fileMgr, null, null, null, compUnits);
+    // subclass SimpleTreeVisitor - to check for obj.getClass(); statements
+    var GetClassNPEChecker = Java.extend(TreeScanner);
+
+    var visitor = new GetClassNPEChecker() {
+        lineMap: null,
+        sourceFile: null,
+
+        // save compilation unit details for reporting
+        visitCompilationUnit: function(node, p) {
+           this.sourceFile = node.sourceFile;
+           this.lineMap = node.lineMap;
+           return Java.super(visitor).visitCompilationUnit(node, p);
+        },
+
+        // look for "foo.getClass();" expression statements
+        visitExpressionStatement: function(node, p) {
+            var expr = node.expression;
+            if (expr instanceof MethodInvocationTree) {
+                var name = String(expr.methodSelect.identifier);
+
+                // will match any "getClass" call with zero arguments!
+                if (name == "getClass" && expr.arguments.size() == 0) {
+                    print(this.sourceFile.getName()
+                     + " @ "
+                     + this.lineMap.getLineNumber(node.pos)
+                     + ":"
+                     + this.lineMap.getColumnNumber(node.pos));
+
+                    print("\t", node);
+                }
+            }
+        }
+    }
+
+    for each (var cu in task.parse()) {
+        cu.accept(visitor, null);
+    }
+}
+
+// for each ".java" file in the directory (recursively)
+function main(dir) {
+    Files.walk(dir.toPath()).
+      forEach(function(p) {
+          var name = p.toFile().absolutePath;
+          if (name.endsWith(".java")) {
+              try {
+                  checkGetClassNPE(p.toFile().getAbsolutePath());
+              } catch (e) {
+                  print(e);
+              }
+          }
+      });
+}
+
+main(new File(arguments[0]));
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/internal/dynalink/DynamicLinker.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/internal/dynalink/DynamicLinker.java	Mon Feb 23 05:01:11 2015 -0800
@@ -88,6 +88,7 @@
 import java.lang.invoke.MethodType;
 import java.lang.invoke.MutableCallSite;
 import java.util.List;
+import java.util.Objects;
 import jdk.internal.dynalink.linker.GuardedInvocation;
 import jdk.internal.dynalink.linker.GuardingDynamicLinker;
 import jdk.internal.dynalink.linker.LinkRequest;
@@ -252,7 +253,7 @@
         // Make sure we filter the invocation before linking it into the call site. This is typically used to match the
         // return type of the invocation to the call site.
         guardedInvocation = prelinkFilter.filter(guardedInvocation, linkRequest, linkerServices);
-        guardedInvocation.getClass(); // null pointer check
+        Objects.requireNonNull(guardedInvocation);
 
         int newRelinkCount = relinkCount;
         // Note that the short-circuited "&&" evaluation below ensures we'll increment the relinkCount until
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/internal/dynalink/DynamicLinkerFactory.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/internal/dynalink/DynamicLinkerFactory.java	Mon Feb 23 05:01:11 2015 -0800
@@ -97,6 +97,8 @@
 import jdk.internal.dynalink.linker.GuardingDynamicLinker;
 import jdk.internal.dynalink.linker.GuardingTypeConverterFactory;
 import jdk.internal.dynalink.linker.LinkRequest;
+import jdk.internal.dynalink.linker.LinkerServices;
+import jdk.internal.dynalink.linker.MethodHandleTransformer;
 import jdk.internal.dynalink.linker.MethodTypeConversionStrategy;
 import jdk.internal.dynalink.support.AutoDiscovery;
 import jdk.internal.dynalink.support.BottomGuardingDynamicLinker;
@@ -132,6 +134,7 @@
     private int unstableRelinkThreshold = DEFAULT_UNSTABLE_RELINK_THRESHOLD;
     private GuardedInvocationFilter prelinkFilter;
     private MethodTypeConversionStrategy autoConversionStrategy;
+    private MethodHandleTransformer internalObjectsFilter;
 
     /**
      * Sets the class loader for automatic discovery of available linkers. If not set explicitly, then the thread
@@ -284,6 +287,15 @@
     }
 
     /**
+     * Sets a method handle transformer that is supposed to act as the implementation of this linker factory's linkers'
+     * services {@link LinkerServices#filterInternalObjects(java.lang.invoke.MethodHandle)} method.
+     * @param internalObjectsFilter a method handle transformer filtering out internal objects, or null.
+     */
+    public void setInternalObjectsFilter(final MethodHandleTransformer internalObjectsFilter) {
+        this.internalObjectsFilter = internalObjectsFilter;
+    }
+
+    /**
      * Creates a new dynamic linker consisting of all the prioritized, autodiscovered, and fallback linkers as well as
      * the pre-link filter.
      *
@@ -350,8 +362,8 @@
         }
 
         return new DynamicLinker(new LinkerServicesImpl(new TypeConverterFactory(typeConverters,
-                autoConversionStrategy), composite), prelinkFilter, runtimeContextArgCount, syncOnRelink,
-                unstableRelinkThreshold);
+                autoConversionStrategy), composite, internalObjectsFilter), prelinkFilter, runtimeContextArgCount,
+                syncOnRelink, unstableRelinkThreshold);
     }
 
     private static ClassLoader getThreadContextClassLoader() {
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/internal/dynalink/beans/AbstractJavaLinker.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/internal/dynalink/beans/AbstractJavaLinker.java	Mon Feb 23 05:01:11 2015 -0800
@@ -570,7 +570,7 @@
     private static final MethodHandle CONSTANT_NULL_DROP_ANNOTATED_METHOD = MethodHandles.dropArguments(
             MethodHandles.constant(Object.class, null), 0, AnnotatedDynamicMethod.class);
     private static final MethodHandle GET_ANNOTATED_METHOD = privateLookup.findVirtual(AnnotatedDynamicMethod.class,
-            "getTarget", MethodType.methodType(MethodHandle.class, MethodHandles.Lookup.class));
+            "getTarget", MethodType.methodType(MethodHandle.class, MethodHandles.Lookup.class, LinkerServices.class));
     private static final MethodHandle GETTER_INVOKER = MethodHandles.invoker(MethodType.methodType(Object.class, Object.class));
 
     private GuardedInvocationComponent getPropertyGetter(final CallSiteDescriptor callSiteDescriptor,
@@ -593,7 +593,7 @@
                 final MethodHandle typedGetter = linkerServices.asType(getPropertyGetterHandle, type.changeReturnType(
                         AnnotatedDynamicMethod.class));
                 final MethodHandle callSiteBoundMethodGetter = MethodHandles.insertArguments(
-                        GET_ANNOTATED_METHOD, 1, callSiteDescriptor.getLookup());
+                        GET_ANNOTATED_METHOD, 1, callSiteDescriptor.getLookup(), linkerServices);
                 final MethodHandle callSiteBoundInvoker = MethodHandles.filterArguments(GETTER_INVOKER, 0,
                         callSiteBoundMethodGetter);
                 // Object(AnnotatedDynamicMethod, Object)->Object(AnnotatedDynamicMethod, T0)
@@ -873,8 +873,8 @@
         }
 
         @SuppressWarnings("unused")
-        MethodHandle getTarget(final MethodHandles.Lookup lookup) {
-            final MethodHandle inv = method.getTarget(lookup);
+        MethodHandle getTarget(final MethodHandles.Lookup lookup, final LinkerServices linkerServices) {
+            final MethodHandle inv = linkerServices.filterInternalObjects(method.getTarget(lookup));
             assert inv != null;
             return inv;
         }
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/internal/dynalink/beans/BeanLinker.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/internal/dynalink/beans/BeanLinker.java	Mon Feb 23 05:01:11 2015 -0800
@@ -165,6 +165,10 @@
     private static MethodHandle LIST_GUARD = Guards.getInstanceOfGuard(List.class);
     private static MethodHandle MAP_GUARD = Guards.getInstanceOfGuard(Map.class);
 
+    private enum CollectionType {
+        ARRAY, LIST, MAP
+    };
+
     private GuardedInvocationComponent getElementGetter(final CallSiteDescriptor callSiteDescriptor,
             final LinkerServices linkerServices, final List<String> operations) throws Exception {
         final MethodType callSiteType = callSiteDescriptor.getMethodType();
@@ -178,27 +182,27 @@
         // Note that for arrays and lists, using LinkerServices.asType() will ensure that any language specific linkers
         // in use will get a chance to perform any (if there's any) implicit conversion to integer for the indices.
         final GuardedInvocationComponent gic;
-        final boolean isMap;
+        final CollectionType collectionType;
         if(declaredType.isArray()) {
-            gic = new GuardedInvocationComponent(MethodHandles.arrayElementGetter(declaredType));
-            isMap = false;
+            gic = createInternalFilteredGuardedInvocationComponent(MethodHandles.arrayElementGetter(declaredType), linkerServices);
+            collectionType = CollectionType.ARRAY;
         } else if(List.class.isAssignableFrom(declaredType)) {
-            gic = new GuardedInvocationComponent(GET_LIST_ELEMENT);
-            isMap = false;
+            gic = createInternalFilteredGuardedInvocationComponent(GET_LIST_ELEMENT, linkerServices);
+            collectionType = CollectionType.LIST;
         } else if(Map.class.isAssignableFrom(declaredType)) {
-            gic = new GuardedInvocationComponent(GET_MAP_ELEMENT);
-            isMap = true;
+            gic = createInternalFilteredGuardedInvocationComponent(GET_MAP_ELEMENT, linkerServices);
+            collectionType = CollectionType.MAP;
         } else if(clazz.isArray()) {
-            gic = getClassGuardedInvocationComponent(MethodHandles.arrayElementGetter(clazz), callSiteType);
-            isMap = false;
+            gic = getClassGuardedInvocationComponent(linkerServices.filterInternalObjects(MethodHandles.arrayElementGetter(clazz)), callSiteType);
+            collectionType = CollectionType.ARRAY;
         } else if(List.class.isAssignableFrom(clazz)) {
-            gic = new GuardedInvocationComponent(GET_LIST_ELEMENT, Guards.asType(LIST_GUARD, callSiteType), List.class,
-                    ValidationType.INSTANCE_OF);
-            isMap = false;
+            gic = createInternalFilteredGuardedInvocationComponent(GET_LIST_ELEMENT, Guards.asType(LIST_GUARD, callSiteType), List.class, ValidationType.INSTANCE_OF,
+                    linkerServices);
+            collectionType = CollectionType.LIST;
         } else if(Map.class.isAssignableFrom(clazz)) {
-            gic = new GuardedInvocationComponent(GET_MAP_ELEMENT, Guards.asType(MAP_GUARD, callSiteType), Map.class,
-                    ValidationType.INSTANCE_OF);
-            isMap = true;
+            gic = createInternalFilteredGuardedInvocationComponent(GET_MAP_ELEMENT, Guards.asType(MAP_GUARD, callSiteType), Map.class, ValidationType.INSTANCE_OF,
+                    linkerServices);
+            collectionType = CollectionType.MAP;
         } else {
             // Can't retrieve elements for objects that are neither arrays, nor list, nor maps.
             return nextComponent;
@@ -208,7 +212,7 @@
         final String fixedKey = getFixedKey(callSiteDescriptor);
         // Convert the key to a number if we're working with a list or array
         final Object typedFixedKey;
-        if(!isMap && fixedKey != null) {
+        if(collectionType != CollectionType.MAP && fixedKey != null) {
             typedFixedKey = convertKeyToInteger(fixedKey, linkerServices);
             if(typedFixedKey == null) {
                 // key is not numeric, it can never succeed
@@ -227,15 +231,21 @@
         }
 
         final MethodHandle checkGuard;
-        if(invocation == GET_LIST_ELEMENT) {
+        switch(collectionType) {
+        case LIST:
             checkGuard = convertArgToInt(RANGE_CHECK_LIST, linkerServices, callSiteDescriptor);
-        } else if(invocation == GET_MAP_ELEMENT) {
+            break;
+        case MAP:
             // TODO: A more complex solution could be devised for maps, one where we do a get() first, and fold it
             // into a GWT that tests if it returned null, and if it did, do another GWT with containsKey()
             // that returns constant null (on true), or falls back to next component (on false)
-            checkGuard = CONTAINS_MAP;
-        } else {
+            checkGuard = linkerServices.filterInternalObjects(CONTAINS_MAP);
+            break;
+        case ARRAY:
             checkGuard = convertArgToInt(RANGE_CHECK_ARRAY, linkerServices, callSiteDescriptor);
+            break;
+        default:
+            throw new AssertionError();
         }
         final MethodPair matchedInvocations = matchReturnTypes(binder.bind(invocation),
                 nextComponent.getGuardedInvocation().getInvocation());
@@ -243,6 +253,18 @@
                 gic.getValidatorClass(), gic.getValidationType());
     }
 
+    private static GuardedInvocationComponent createInternalFilteredGuardedInvocationComponent(
+            final MethodHandle invocation, final LinkerServices linkerServices) {
+        return new GuardedInvocationComponent(linkerServices.filterInternalObjects(invocation));
+    }
+
+    private static GuardedInvocationComponent createInternalFilteredGuardedInvocationComponent(
+            final MethodHandle invocation, final MethodHandle guard, final Class<?> validatorClass,
+            final ValidationType validationType, final LinkerServices linkerServices) {
+        return new GuardedInvocationComponent(linkerServices.filterInternalObjects(invocation), guard,
+                validatorClass, validationType);
+    }
+
     private static String getFixedKey(final CallSiteDescriptor callSiteDescriptor) {
         return callSiteDescriptor.getNameTokenCount() == 2 ? null : callSiteDescriptor.getNameToken(
                 CallSiteDescriptor.NAME_OPERAND);
@@ -381,37 +403,38 @@
         // dealing with an array, or a list or map, but hey...
         // Note that for arrays and lists, using LinkerServices.asType() will ensure that any language specific linkers
         // in use will get a chance to perform any (if there's any) implicit conversion to integer for the indices.
-        final boolean isMap;
+        final CollectionType collectionType;
         if(declaredType.isArray()) {
-            gic = new GuardedInvocationComponent(MethodHandles.arrayElementSetter(declaredType));
-            isMap = false;
+            gic = createInternalFilteredGuardedInvocationComponent(MethodHandles.arrayElementSetter(declaredType), linkerServices);
+            collectionType = CollectionType.ARRAY;
         } else if(List.class.isAssignableFrom(declaredType)) {
-            gic = new GuardedInvocationComponent(SET_LIST_ELEMENT);
-            isMap = false;
+            gic = createInternalFilteredGuardedInvocationComponent(SET_LIST_ELEMENT, linkerServices);
+            collectionType = CollectionType.LIST;
         } else if(Map.class.isAssignableFrom(declaredType)) {
-            gic = new GuardedInvocationComponent(PUT_MAP_ELEMENT);
-            isMap = true;
+            gic = createInternalFilteredGuardedInvocationComponent(PUT_MAP_ELEMENT, linkerServices);
+            collectionType = CollectionType.MAP;
         } else if(clazz.isArray()) {
-            gic = getClassGuardedInvocationComponent(MethodHandles.arrayElementSetter(clazz), callSiteType);
-            isMap = false;
+            gic = getClassGuardedInvocationComponent(linkerServices.filterInternalObjects(
+                    MethodHandles.arrayElementSetter(clazz)), callSiteType);
+            collectionType = CollectionType.ARRAY;
         } else if(List.class.isAssignableFrom(clazz)) {
-            gic = new GuardedInvocationComponent(SET_LIST_ELEMENT, Guards.asType(LIST_GUARD, callSiteType), List.class,
-                    ValidationType.INSTANCE_OF);
-            isMap = false;
+            gic = createInternalFilteredGuardedInvocationComponent(SET_LIST_ELEMENT, Guards.asType(LIST_GUARD, callSiteType), List.class, ValidationType.INSTANCE_OF,
+                    linkerServices);
+            collectionType = CollectionType.LIST;
         } else if(Map.class.isAssignableFrom(clazz)) {
-            gic = new GuardedInvocationComponent(PUT_MAP_ELEMENT, Guards.asType(MAP_GUARD, callSiteType), Map.class,
-                    ValidationType.INSTANCE_OF);
-            isMap = true;
+            gic = createInternalFilteredGuardedInvocationComponent(PUT_MAP_ELEMENT, Guards.asType(MAP_GUARD, callSiteType),
+                    Map.class, ValidationType.INSTANCE_OF, linkerServices);
+            collectionType = CollectionType.MAP;
         } else {
             // Can't set elements for objects that are neither arrays, nor list, nor maps.
             gic = null;
-            isMap = false;
+            collectionType = null;
         }
 
         // In contrast to, say, getElementGetter, we only compute the nextComponent if the target object is not a map,
         // as maps will always succeed in setting the element and will never need to fall back to the next component
         // operation.
-        final GuardedInvocationComponent nextComponent = isMap ? null : getGuardedInvocationComponent(
+        final GuardedInvocationComponent nextComponent = collectionType == CollectionType.MAP ? null : getGuardedInvocationComponent(
                 callSiteDescriptor, linkerServices, operations);
         if(gic == null) {
             return nextComponent;
@@ -421,7 +444,7 @@
         final String fixedKey = getFixedKey(callSiteDescriptor);
         // Convert the key to a number if we're working with a list or array
         final Object typedFixedKey;
-        if(!isMap && fixedKey != null) {
+        if(collectionType != CollectionType.MAP && fixedKey != null) {
             typedFixedKey = convertKeyToInteger(fixedKey, linkerServices);
             if(typedFixedKey == null) {
                 // key is not numeric, it can never succeed
@@ -439,7 +462,8 @@
             return gic.replaceInvocation(binder.bind(invocation));
         }
 
-        final MethodHandle checkGuard = convertArgToInt(invocation == SET_LIST_ELEMENT ? RANGE_CHECK_LIST :
+        assert collectionType == CollectionType.LIST || collectionType == CollectionType.ARRAY;
+        final MethodHandle checkGuard = convertArgToInt(collectionType == CollectionType.LIST ? RANGE_CHECK_LIST :
             RANGE_CHECK_ARRAY, linkerServices, callSiteDescriptor);
         final MethodPair matchedInvocations = matchReturnTypes(binder.bind(invocation),
                 nextComponent.getGuardedInvocation().getInvocation());
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/internal/dynalink/beans/OverloadedMethod.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/internal/dynalink/beans/OverloadedMethod.java	Mon Feb 23 05:01:11 2015 -0800
@@ -139,7 +139,8 @@
         final MethodHandle bound = SELECT_METHOD.bindTo(this);
         final MethodHandle collecting = SingleDynamicMethod.collectArguments(bound, argNum).asType(
                 callSiteType.changeReturnType(MethodHandle.class));
-        invoker = MethodHandles.foldArguments(MethodHandles.exactInvoker(this.callSiteType), collecting);
+        invoker = linkerServices.asTypeLosslessReturn(MethodHandles.foldArguments(
+                MethodHandles.exactInvoker(this.callSiteType), collecting), callSiteType);
     }
 
     MethodHandle getInvoker() {
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/internal/dynalink/beans/SingleDynamicMethod.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/internal/dynalink/beans/SingleDynamicMethod.java	Mon Feb 23 05:01:11 2015 -0800
@@ -165,10 +165,11 @@
      * @return the adapted method handle.
      */
     static MethodHandle getInvocation(final MethodHandle target, final MethodType callSiteType, final LinkerServices linkerServices) {
-        final MethodType methodType = target.type();
+        final MethodHandle filteredTarget = linkerServices.filterInternalObjects(target);
+        final MethodType methodType = filteredTarget.type();
         final int paramsLen = methodType.parameterCount();
         final boolean varArgs = target.isVarargsCollector();
-        final MethodHandle fixTarget = varArgs ? target.asFixedArity() : target;
+        final MethodHandle fixTarget = varArgs ? filteredTarget.asFixedArity() : filteredTarget;
         final int fixParamsLen = varArgs ? paramsLen - 1 : paramsLen;
         final int argsLen = callSiteType.parameterCount();
         if(argsLen < fixParamsLen) {
@@ -204,7 +205,7 @@
             if(varArgType.isAssignableFrom(callSiteLastArgType)) {
                 // Call site signature guarantees we'll always be passed a single compatible array; just link directly
                 // to the method, introducing necessary conversions. Also, preserve it being a variable arity method.
-                return createConvertingInvocation(target, linkerServices, callSiteType).asVarargsCollector(
+                return createConvertingInvocation(filteredTarget, linkerServices, callSiteType).asVarargsCollector(
                         callSiteLastArgType);
             }
 
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/internal/dynalink/beans/StaticClass.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/internal/dynalink/beans/StaticClass.java	Mon Feb 23 05:01:11 2015 -0800
@@ -84,6 +84,7 @@
 package jdk.internal.dynalink.beans;
 
 import java.io.Serializable;
+import java.util.Objects;
 
 /**
  * Object that represents the static facet of a class (its static methods, properties, and fields, as well as
@@ -106,8 +107,7 @@
     private final Class<?> clazz;
 
     /*private*/ StaticClass(final Class<?> clazz) {
-        clazz.getClass(); // NPE check
-        this.clazz = clazz;
+        this.clazz = Objects.requireNonNull(clazz);
     }
 
     /**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/internal/dynalink/linker/GuardedInvocation.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/internal/dynalink/linker/GuardedInvocation.java	Mon Feb 23 05:01:11 2015 -0800
@@ -91,6 +91,7 @@
 import java.lang.invoke.SwitchPoint;
 import java.lang.invoke.WrongMethodTypeException;
 import java.util.List;
+import java.util.Objects;
 import jdk.internal.dynalink.CallSiteDescriptor;
 import jdk.internal.dynalink.support.Guards;
 
@@ -170,8 +171,7 @@
      * @throws NullPointerException if invocation is null.
      */
     public GuardedInvocation(final MethodHandle invocation, final MethodHandle guard, final SwitchPoint switchPoint, final Class<? extends Throwable> exception) {
-        invocation.getClass(); // NPE check
-        this.invocation = invocation;
+        this.invocation = Objects.requireNonNull(invocation);
         this.guard = guard;
         this.switchPoints = switchPoint == null ? null : new SwitchPoint[] { switchPoint };
         this.exception = exception;
@@ -190,8 +190,7 @@
      * @throws NullPointerException if invocation is null.
      */
     public GuardedInvocation(final MethodHandle invocation, final MethodHandle guard, final SwitchPoint[] switchPoints, final Class<? extends Throwable> exception) {
-        invocation.getClass(); // NPE check
-        this.invocation = invocation;
+        this.invocation = Objects.requireNonNull(invocation);
         this.guard = guard;
         this.switchPoints = switchPoints == null ? null : switchPoints.clone();
         this.exception = exception;
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/internal/dynalink/linker/LinkerServices.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/internal/dynalink/linker/LinkerServices.java	Mon Feb 23 05:01:11 2015 -0800
@@ -181,6 +181,15 @@
     public Comparison compareConversion(Class<?> sourceType, Class<?> targetType1, Class<?> targetType2);
 
     /**
+     * Modifies the method handle so that any parameters that can receive potentially internal language runtime objects
+     * will have a filter added on them to prevent them from escaping, potentially by wrapping them.
+     * It can also potentially add an unwrapping filter to the return value.
+     * @param target the target method handle
+     * @return a method handle with parameters and/or return type potentially filtered for wrapping and unwrapping.
+     */
+    public MethodHandle filterInternalObjects(final MethodHandle target);
+
+    /**
      * If we could just use Java 8 constructs, then {@code asTypeSafeReturn} would be a method with default
      * implementation. Since we can't do that, we extract common default implementations into this static class.
      */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/internal/dynalink/linker/MethodHandleTransformer.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,98 @@
+/*
+ * 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.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file, and Oracle licenses the original version of this file under the BSD
+ * license:
+ */
+/*
+   Copyright 2009-2015 Attila Szegedi
+
+   Licensed under both the Apache License, Version 2.0 (the "Apache License")
+   and the BSD License (the "BSD License"), with licensee being free to
+   choose either of the two at their discretion.
+
+   You may not use this file except in compliance with either the Apache
+   License or the BSD License.
+
+   If you choose to use this file in compliance with the Apache License, the
+   following notice applies to you:
+
+       You may obtain a copy of the Apache License at
+
+           http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing, software
+       distributed under the License is distributed on an "AS IS" BASIS,
+       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+       implied. See the License for the specific language governing
+       permissions and limitations under the License.
+
+   If you choose to use this file in compliance with the BSD License, the
+   following notice applies to you:
+
+       Redistribution and use in source and binary forms, with or without
+       modification, are permitted provided that the following conditions are
+       met:
+       * Redistributions of source code must retain the above copyright
+         notice, this list of conditions and the following disclaimer.
+       * Redistributions in binary form must reproduce the above copyright
+         notice, this list of conditions and the following disclaimer in the
+         documentation and/or other materials provided with the distribution.
+       * Neither the name of the copyright holder nor the names of
+         contributors may be used to endorse or promote products derived from
+         this software without specific prior written permission.
+
+       THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+       IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+       TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+       PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER
+       BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+       CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+       SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+       BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+       WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+       OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+       ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+package jdk.internal.dynalink.linker;
+
+import java.lang.invoke.MethodHandle;
+
+/**
+ * A generic interface describing operations that transform method handles.
+ */
+public interface MethodHandleTransformer {
+    /**
+     * Transforms a method handle.
+     * @param target the method handle being transformed.
+     * @return transformed method handle.
+     */
+    public MethodHandle transform(final MethodHandle target);
+}
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/internal/dynalink/support/CallSiteDescriptorFactory.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/internal/dynalink/support/CallSiteDescriptorFactory.java	Mon Feb 23 05:01:11 2015 -0800
@@ -91,6 +91,7 @@
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
+import java.util.Objects;
 import java.util.StringTokenizer;
 import java.util.WeakHashMap;
 import jdk.internal.dynalink.CallSiteDescriptor;
@@ -123,9 +124,9 @@
      * in fact return a weakly-referenced canonical instance.
      */
     public static CallSiteDescriptor create(final Lookup lookup, final String name, final MethodType methodType) {
-        name.getClass(); // NPE check
-        methodType.getClass(); // NPE check
-        lookup.getClass(); // NPE check
+        Objects.requireNonNull(name);
+        Objects.requireNonNull(methodType);
+        Objects.requireNonNull(lookup);
         final String[] tokenizedName = tokenizeName(name);
         if(isPublicLookup(lookup)) {
             return getCanonicalPublicDescriptor(createPublicCallSiteDescriptor(tokenizedName, methodType));
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/internal/dynalink/support/DefaultInternalObjectFilter.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,177 @@
+/*
+ * 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.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file, and Oracle licenses the original version of this file under the BSD
+ * license:
+ */
+/*
+   Copyright 2009-2015 Attila Szegedi
+
+   Licensed under both the Apache License, Version 2.0 (the "Apache License")
+   and the BSD License (the "BSD License"), with licensee being free to
+   choose either of the two at their discretion.
+
+   You may not use this file except in compliance with either the Apache
+   License or the BSD License.
+
+   If you choose to use this file in compliance with the Apache License, the
+   following notice applies to you:
+
+       You may obtain a copy of the Apache License at
+
+           http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing, software
+       distributed under the License is distributed on an "AS IS" BASIS,
+       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+       implied. See the License for the specific language governing
+       permissions and limitations under the License.
+
+   If you choose to use this file in compliance with the BSD License, the
+   following notice applies to you:
+
+       Redistribution and use in source and binary forms, with or without
+       modification, are permitted provided that the following conditions are
+       met:
+       * Redistributions of source code must retain the above copyright
+         notice, this list of conditions and the following disclaimer.
+       * Redistributions in binary form must reproduce the above copyright
+         notice, this list of conditions and the following disclaimer in the
+         documentation and/or other materials provided with the distribution.
+       * Neither the name of the copyright holder nor the names of
+         contributors may be used to endorse or promote products derived from
+         this software without specific prior written permission.
+
+       THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+       IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+       TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+       PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER
+       BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+       CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+       SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+       BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+       WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+       OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+       ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+package jdk.internal.dynalink.support;
+
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodType;
+import jdk.internal.dynalink.DynamicLinkerFactory;
+import jdk.internal.dynalink.linker.MethodHandleTransformer;
+
+/**
+ * Default implementation for a {@link DynamicLinkerFactory#setInternalObjectsFilter(MethodHandleTransformer)}.
+ * Given a method handle of {@code Object(Object)} type for filtering parameter and another one of the same type for
+ * filtering return values, applies them to passed method handles where their parameter types and/or return value types
+ * are declared to be {@link Object}.
+ */
+public class DefaultInternalObjectFilter implements MethodHandleTransformer {
+    private static final MethodHandle FILTER_VARARGS = new Lookup(MethodHandles.lookup()).findStatic(
+            DefaultInternalObjectFilter.class, "filterVarArgs", MethodType.methodType(Object[].class, MethodHandle.class, Object[].class));
+
+    private final MethodHandle parameterFilter;
+    private final MethodHandle returnFilter;
+    private final MethodHandle varArgFilter;
+
+    /**
+     * Creates a new filter.
+     * @param parameterFilter the filter for method parameters. Must be of type {@code Object(Object)}, or null.
+     * @param returnFilter the filter for return values. Must be of type {@code Object(Object)}, or null.
+     * @throws IllegalArgumentException if one or both filters are not of the expected type.
+     */
+    public DefaultInternalObjectFilter(final MethodHandle parameterFilter, final MethodHandle returnFilter) {
+        this.parameterFilter = checkHandle(parameterFilter, "parameterFilter");
+        this.returnFilter = checkHandle(returnFilter, "returnFilter");
+        this.varArgFilter = parameterFilter == null ? null : FILTER_VARARGS.bindTo(parameterFilter);
+    }
+
+    @Override
+    public MethodHandle transform(final MethodHandle target) {
+        assert target != null;
+        MethodHandle[] filters = null;
+        final MethodType type = target.type();
+        final boolean isVarArg = target.isVarargsCollector();
+        final int paramCount = type.parameterCount();
+        final MethodHandle paramsFiltered;
+        // Filter parameters
+        if (parameterFilter != null) {
+            int firstFilter = -1;
+            // Ignore receiver, start from argument 1
+            for(int i = 1; i < paramCount; ++i) {
+                final Class<?> paramType = type.parameterType(i);
+                final boolean filterVarArg = isVarArg && i == paramCount - 1 && paramType == Object[].class;
+                if (filterVarArg || paramType == Object.class) {
+                    if (filters == null) {
+                        firstFilter = i;
+                        filters = new MethodHandle[paramCount - firstFilter];
+                    }
+                    filters[i - firstFilter] = filterVarArg ? varArgFilter : parameterFilter;
+                }
+            }
+            paramsFiltered = filters != null ? MethodHandles.filterArguments(target, firstFilter, filters) : target;
+        } else {
+            paramsFiltered = target;
+        }
+        // Filter return value if needed
+        final MethodHandle returnFiltered = returnFilter != null && type.returnType() == Object.class ? MethodHandles.filterReturnValue(paramsFiltered, returnFilter) : paramsFiltered;
+        // Preserve varargs collector state
+        return isVarArg && !returnFiltered.isVarargsCollector() ? returnFiltered.asVarargsCollector(type.parameterType(paramCount - 1)) : returnFiltered;
+
+    }
+
+    private static MethodHandle checkHandle(final MethodHandle handle, final String handleKind) {
+        if (handle != null) {
+            final MethodType objectObjectType = MethodType.methodType(Object.class, Object.class);
+            if (!handle.type().equals(objectObjectType)) {
+                throw new IllegalArgumentException("Method type for " + handleKind + " must be " + objectObjectType);
+            }
+        }
+        return handle;
+    }
+
+    @SuppressWarnings("unused")
+    private static Object[] filterVarArgs(final MethodHandle parameterFilter, final Object[] args) throws Throwable {
+        Object[] newArgs = null;
+        for(int i = 0; i < args.length; ++i) {
+            final Object arg = args[i];
+            final Object newArg = parameterFilter.invokeExact(arg);
+            if (arg != newArg) {
+                if (newArgs == null) {
+                    newArgs = args.clone();
+                }
+                newArgs[i] = newArg;
+            }
+        }
+        return newArgs == null ? args : newArgs;
+    }
+}
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/internal/dynalink/support/LinkerServicesImpl.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/internal/dynalink/support/LinkerServicesImpl.java	Mon Feb 23 05:01:11 2015 -0800
@@ -90,6 +90,7 @@
 import jdk.internal.dynalink.linker.GuardingDynamicLinker;
 import jdk.internal.dynalink.linker.LinkRequest;
 import jdk.internal.dynalink.linker.LinkerServices;
+import jdk.internal.dynalink.linker.MethodHandleTransformer;
 
 /**
  * Default implementation of the {@link LinkerServices} interface.
@@ -103,17 +104,21 @@
 
     private final TypeConverterFactory typeConverterFactory;
     private final GuardingDynamicLinker topLevelLinker;
+    private final MethodHandleTransformer internalObjectsFilter;
 
     /**
      * Creates a new linker services object.
      *
      * @param typeConverterFactory the type converter factory exposed by the services.
      * @param topLevelLinker the top level linker used by the services.
+     * @param internalObjectsFilter a method handle transformer that is supposed to act as the implementation of this
+     * services' {@link #filterInternalObjects(java.lang.invoke.MethodHandle)} method.
      */
     public LinkerServicesImpl(final TypeConverterFactory typeConverterFactory,
-            final GuardingDynamicLinker topLevelLinker) {
+            final GuardingDynamicLinker topLevelLinker, final MethodHandleTransformer internalObjectsFilter) {
         this.typeConverterFactory = typeConverterFactory;
         this.topLevelLinker = topLevelLinker;
+        this.internalObjectsFilter = internalObjectsFilter;
     }
 
     @Override
@@ -152,6 +157,11 @@
         }
     }
 
+    @Override
+    public MethodHandle filterInternalObjects(final MethodHandle target) {
+        return internalObjectsFilter != null ? internalObjectsFilter.transform(target) : target;
+    }
+
     /**
      * Returns the currently processed link request, or null if the method is invoked outside of the linking process.
      * @return the currently processed link request, or null.
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/NashornScriptEngine.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/NashornScriptEngine.java	Mon Feb 23 05:01:11 2015 -0800
@@ -39,6 +39,7 @@
 import java.security.ProtectionDomain;
 import java.text.MessageFormat;
 import java.util.Locale;
+import java.util.Objects;
 import java.util.ResourceBundle;
 import javax.script.AbstractScriptEngine;
 import javax.script.Bindings;
@@ -360,7 +361,7 @@
     }
 
     private Object invokeImpl(final Object selfObject, final String name, final Object... args) throws ScriptException, NoSuchMethodException {
-        name.getClass(); // null check
+        Objects.requireNonNull(name);
         assert !(selfObject instanceof ScriptObject) : "raw ScriptObject not expected here";
 
         Global invokeGlobal = null;
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/NashornScriptEngineFactory.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/NashornScriptEngineFactory.java	Mon Feb 23 05:01:11 2015 -0800
@@ -28,6 +28,7 @@
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
+import java.util.Objects;
 import javax.script.ScriptEngine;
 import javax.script.ScriptEngineFactory;
 import jdk.nashorn.internal.runtime.Context;
@@ -177,7 +178,7 @@
      *         denies {@code RuntimePermission("nashorn.setConfig")}
      */
     public ScriptEngine getScriptEngine(final ClassFilter classFilter) {
-        classFilter.getClass(); // null check
+        Objects.requireNonNull(classFilter);
         return newEngine(DEFAULT_OPTIONS, getAppClassLoader(), classFilter);
     }
 
@@ -192,7 +193,7 @@
      *         denies {@code RuntimePermission("nashorn.setConfig")}
      */
     public ScriptEngine getScriptEngine(final String... args) {
-        args.getClass(); // null check
+        Objects.requireNonNull(args);
         return newEngine(args, getAppClassLoader(), null);
     }
 
@@ -208,7 +209,7 @@
      *         denies {@code RuntimePermission("nashorn.setConfig")}
      */
     public ScriptEngine getScriptEngine(final String[] args, final ClassLoader appLoader) {
-        args.getClass(); // null check
+        Objects.requireNonNull(args);
         return newEngine(args, appLoader, null);
     }
 
@@ -225,8 +226,8 @@
      *         denies {@code RuntimePermission("nashorn.setConfig")}
      */
     public ScriptEngine getScriptEngine(final String[] args, final ClassLoader appLoader, final ClassFilter classFilter) {
-        args.getClass(); // null check
-        classFilter.getClass(); // null check
+        Objects.requireNonNull(args);
+        Objects.requireNonNull(classFilter);
         return newEngine(args, appLoader, classFilter);
     }
 
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/ScriptObjectMirror.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/ScriptObjectMirror.java	Mon Feb 23 05:01:11 2015 -0800
@@ -39,6 +39,7 @@
 import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 import java.util.Set;
 import java.util.concurrent.Callable;
 import javax.script.Bindings;
@@ -180,7 +181,7 @@
      * @return return value of function
      */
     public Object callMember(final String functionName, final Object... args) {
-        functionName.getClass(); // null check
+        Objects.requireNonNull(functionName);
         final Global oldGlobal = Context.getGlobal();
         final boolean globalChanged = (oldGlobal != global);
 
@@ -213,7 +214,7 @@
 
     @Override
     public Object getMember(final String name) {
-        name.getClass();
+        Objects.requireNonNull(name);
         return inGlobal(new Callable<Object>() {
             @Override public Object call() {
                 return wrap(sobj.get(name), global);
@@ -232,7 +233,7 @@
 
     @Override
     public boolean hasMember(final String name) {
-        name.getClass();
+        Objects.requireNonNull(name);
         return inGlobal(new Callable<Boolean>() {
             @Override public Boolean call() {
                 return sobj.has(name);
@@ -251,13 +252,13 @@
 
     @Override
     public void removeMember(final String name) {
-        name.getClass();
+        Objects.requireNonNull(name);
         remove(name);
     }
 
     @Override
     public void setMember(final String name, final Object value) {
-        name.getClass();
+        Objects.requireNonNull(name);
         put(name, value);
     }
 
@@ -425,9 +426,7 @@
 
     @Override
     public void putAll(final Map<? extends String, ? extends Object> map) {
-        if (map == null) {
-            throw new NullPointerException("map is null");
-        }
+        Objects.requireNonNull(map, "map is null");
         final ScriptObject oldGlobal = Context.getGlobal();
         final boolean globalChanged = (oldGlobal != global);
         inGlobal(new Callable<Object>() {
@@ -449,7 +448,7 @@
         checkKey(key);
         return inGlobal(new Callable<Object>() {
             @Override public Object call() {
-                return wrap(sobj.remove(key, strict), global);
+                return translateUndefined(wrap(sobj.remove(key, strict), global));
             }
         });
     }
@@ -804,9 +803,9 @@
      * @throws IllegalArgumentException if key is empty string
      */
     private static void checkKey(final Object key) {
-        if (key == null) {
-            throw new NullPointerException("key can not be null");
-        } else if (!(key instanceof String)) {
+        Objects.requireNonNull(key, "key can not be null");
+
+        if (!(key instanceof String)) {
             throw new ClassCastException("key should be a String. It is " + key.getClass().getName() + " instead.");
         } else if (((String)key).length() == 0) {
             throw new IllegalArgumentException("key can not be empty");
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/URLReader.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/URLReader.java	Mon Feb 23 05:01:11 2015 -0800
@@ -30,6 +30,7 @@
 import java.io.Reader;
 import java.net.URL;
 import java.nio.charset.Charset;
+import java.util.Objects;
 import jdk.nashorn.internal.runtime.Source;
 
 /**
@@ -77,8 +78,7 @@
      * @throws NullPointerException if url is null
      */
     public URLReader(final URL url, final Charset cs) {
-        // null check
-        url.getClass();
+        Objects.requireNonNull(url);
         this.url = url;
         this.cs  = cs;
     }
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/CompileUnit.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/CompileUnit.java	Mon Feb 23 05:01:11 2015 -0800
@@ -26,6 +26,7 @@
 package jdk.nashorn.internal.codegen;
 
 import java.io.Serializable;
+import java.util.Objects;
 import java.util.Set;
 import java.util.TreeSet;
 import jdk.nashorn.internal.ir.CompileUnitHolder;
@@ -113,7 +114,7 @@
      * @param clazz class with code for this compile unit
      */
     void setCode(final Class<?> clazz) {
-        clazz.getClass(); // null check
+        Objects.requireNonNull(clazz);
         this.clazz = clazz;
         // Revisit this - refactor to avoid null-ed out non-final fields
         // null out emitter
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/Lower.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/Lower.java	Mon Feb 23 05:01:11 2015 -0800
@@ -326,6 +326,7 @@
         return addStatement(throwNode); //ThrowNodes are always terminal, marked as such in constructor
     }
 
+    @SuppressWarnings("unchecked")
     private static <T extends Node> T ensureUniqueNamesIn(final T node) {
         return (T)node.accept(new NodeVisitor<LexicalContext>(new LexicalContext()) {
             @Override
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/debug/ObjectSizeCalculator.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/debug/ObjectSizeCalculator.java	Mon Feb 23 05:01:11 2015 -0800
@@ -38,6 +38,7 @@
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 
 /**
  * Contains utility methods for calculating the memory usage of objects. It
@@ -150,7 +151,7 @@
      * @param memoryLayoutSpecification a description of the JVM memory layout.
      */
     public ObjectSizeCalculator(final MemoryLayoutSpecification memoryLayoutSpecification) {
-        memoryLayoutSpecification.getClass();
+        Objects.requireNonNull(memoryLayoutSpecification);
         arrayHeaderSize = memoryLayoutSpecification.getArrayHeaderSize();
         objectHeaderSize = memoryLayoutSpecification.getObjectHeaderSize();
         objectPadding = memoryLayoutSpecification.getObjectPadding();
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/Global.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/Global.java	Mon Feb 23 05:01:11 2015 -0800
@@ -41,6 +41,7 @@
 import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 import java.util.concurrent.Callable;
 import java.util.concurrent.ConcurrentHashMap;
 import javax.script.ScriptContext;
@@ -463,8 +464,7 @@
             sm.checkPermission(new RuntimePermission(Context.NASHORN_CREATE_GLOBAL));
         }
 
-        // null check on context
-        context.getClass();
+        Objects.requireNonNull(context);
 
         return $nasgenmap$;
     }
@@ -488,7 +488,7 @@
      */
     public static Global instance() {
         final Global global = Context.getGlobal();
-        global.getClass(); // null check
+        Objects.requireNonNull(global);
         return global;
     }
 
@@ -580,13 +580,15 @@
         } else if (obj instanceof String || obj instanceof ConsString) {
             return new NativeString((CharSequence)obj, this);
         } else if (obj instanceof Object[]) { // extension
-            return new NativeArray((Object[])obj);
+            return new NativeArray(ArrayData.allocate((Object[])obj), this);
         } else if (obj instanceof double[]) { // extension
-            return new NativeArray((double[])obj);
+            return new NativeArray(ArrayData.allocate((double[])obj), this);
         } else if (obj instanceof long[]) {
-            return new NativeArray((long[])obj);
+            return new NativeArray(ArrayData.allocate((long[])obj), this);
         } else if (obj instanceof int[]) {
-            return new NativeArray((int[])obj);
+            return new NativeArray(ArrayData.allocate((int[]) obj), this);
+        } else if (obj instanceof ArrayData) {
+            return new NativeArray((ArrayData) obj, this);
         } else {
             // FIXME: more special cases? Map? List?
             return obj;
@@ -1028,14 +1030,19 @@
     }
 
     // builtin prototype accessors
+
+    /**
+     * Get the builtin Object prototype.
+      * @return the object prototype.
+     */
+    public ScriptObject getObjectPrototype() {
+        return ScriptFunction.getPrototype(builtinObject);
+    }
+
     ScriptObject getFunctionPrototype() {
         return ScriptFunction.getPrototype(builtinFunction);
     }
 
-    ScriptObject getObjectPrototype() {
-        return ScriptFunction.getPrototype(builtinObject);
-    }
-
     ScriptObject getArrayPrototype() {
         return ScriptFunction.getPrototype(builtinArray);
     }
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeArray.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeArray.java	Mon Feb 23 05:01:11 2015 -0800
@@ -120,9 +120,6 @@
         this(ArrayData.allocate(array.length));
 
         ArrayData arrayData = this.getArray();
-        if (array.length > 0) {
-            arrayData.ensure(array.length - 1);
-        }
 
         for (int index = 0; index < array.length; index++) {
             final Object value = array[index];
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/parser/JSONParser.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/parser/JSONParser.java	Mon Feb 23 05:01: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
@@ -25,38 +25,59 @@
 
 package jdk.nashorn.internal.parser;
 
-import static jdk.nashorn.internal.parser.TokenType.COLON;
-import static jdk.nashorn.internal.parser.TokenType.COMMARIGHT;
-import static jdk.nashorn.internal.parser.TokenType.EOF;
-import static jdk.nashorn.internal.parser.TokenType.ESCSTRING;
-import static jdk.nashorn.internal.parser.TokenType.RBRACE;
-import static jdk.nashorn.internal.parser.TokenType.RBRACKET;
-import static jdk.nashorn.internal.parser.TokenType.STRING;
 import java.util.ArrayList;
 import java.util.List;
-import jdk.nashorn.internal.ir.Expression;
-import jdk.nashorn.internal.ir.LiteralNode;
-import jdk.nashorn.internal.ir.Node;
-import jdk.nashorn.internal.ir.ObjectNode;
-import jdk.nashorn.internal.ir.PropertyNode;
-import jdk.nashorn.internal.ir.UnaryNode;
+import jdk.nashorn.internal.codegen.ObjectClassGenerator;
+import jdk.nashorn.internal.objects.Global;
+import jdk.nashorn.internal.runtime.ECMAErrors;
 import jdk.nashorn.internal.runtime.ErrorManager;
+import jdk.nashorn.internal.runtime.JSErrorType;
+import jdk.nashorn.internal.runtime.JSType;
+import jdk.nashorn.internal.runtime.ParserException;
+import jdk.nashorn.internal.runtime.Property;
+import jdk.nashorn.internal.runtime.PropertyMap;
+import jdk.nashorn.internal.runtime.ScriptObject;
 import jdk.nashorn.internal.runtime.Source;
+import jdk.nashorn.internal.runtime.SpillProperty;
+import jdk.nashorn.internal.runtime.arrays.ArrayData;
+import jdk.nashorn.internal.runtime.arrays.ArrayIndex;
+import jdk.nashorn.internal.scripts.JO;
+
+import static jdk.nashorn.internal.parser.TokenType.STRING;
 
 /**
  * Parses JSON text and returns the corresponding IR node. This is derived from the objectLiteral production of the main parser.
  *
  * See: 15.12.1.2 The JSON Syntactic Grammar
  */
-public class JSONParser extends AbstractParser {
+public class JSONParser {
+
+    final private String source;
+    final private Global global;
+    final int length;
+    int pos = 0;
+
+    private static PropertyMap EMPTY_MAP = PropertyMap.newMap();
+
+    private static final int EOF = -1;
+
+    private static final String TRUE  = "true";
+    private static final String FALSE = "false";
+    private static final String NULL  = "null";
+
+    private static final int STATE_EMPTY          = 0;
+    private static final int STATE_ELEMENT_PARSED = 1;
+    private static final int STATE_COMMA_PARSED   = 2;
 
     /**
      * Constructor
      * @param source  the source
-     * @param errors  the error manager
+     * @param global the global object
      */
-    public JSONParser(final Source source, final ErrorManager errors) {
-        super(source, errors, false, 0);
+    public JSONParser(final String source, final Global global ) {
+        this.source = source;
+        this.global = global;
+        this.length = source.length();
     }
 
     /**
@@ -114,329 +135,409 @@
     }
 
     /**
-     * Public parsed method - start lexing a new token stream for
-     * a JSON script
+     * Public parse method. Parse a string into a JSON object.
      *
-     * @return the JSON literal
+     * @return the parsed JSON Object
      */
-    public Node parse() {
-        stream = new TokenStream();
-
-        lexer = new Lexer(source, stream) {
-
-            @Override
-            protected boolean skipComments() {
-                return false;
-            }
-
-            @Override
-            protected boolean isStringDelimiter(final char ch) {
-                return ch == '\"';
-            }
-
-            // ECMA 15.12.1.1 The JSON Lexical Grammar - JSONWhiteSpace
-            @Override
-            protected boolean isWhitespace(final char ch) {
-                return Lexer.isJsonWhitespace(ch);
-            }
-
-            @Override
-            protected boolean isEOL(final char ch) {
-                return Lexer.isJsonEOL(ch);
-            }
+    public Object parse() {
+        final Object value = parseLiteral();
+        skipWhiteSpace();
+        if (pos < length) {
+            throw expectedError(pos, "eof", toString(peek()));
+        }
+        return value;
+    }
 
-            // ECMA 15.12.1.1 The JSON Lexical Grammar - JSONNumber
-            @Override
-            protected void scanNumber() {
-                // Record beginning of number.
-                final int startPosition = position;
-                // Assume value is a decimal.
-                TokenType valueType = TokenType.DECIMAL;
-
-                // floating point can't start with a "." with no leading digit before
-                if (ch0 == '.') {
-                    error(Lexer.message("json.invalid.number"), STRING, position, limit);
-                }
-
-                // First digit of number.
-                final int digit = convertDigit(ch0, 10);
-
-                // skip first digit
-                skip(1);
-
-                if (digit != 0) {
-                    // Skip over remaining digits.
-                    while (convertDigit(ch0, 10) != -1) {
-                        skip(1);
-                    }
-                }
-
-                if (ch0 == '.' || ch0 == 'E' || ch0 == 'e') {
-                    // Must be a double.
-                    if (ch0 == '.') {
-                        // Skip period.
-                        skip(1);
+    private Object parseLiteral() {
+        skipWhiteSpace();
 
-                        boolean mantissa = false;
-                        // Skip mantissa.
-                        while (convertDigit(ch0, 10) != -1) {
-                            mantissa = true;
-                            skip(1);
-                        }
-
-                        if (! mantissa) {
-                            // no digit after "."
-                            error(Lexer.message("json.invalid.number"), STRING, position, limit);
-                        }
-                    }
-
-                    // Detect exponent.
-                    if (ch0 == 'E' || ch0 == 'e') {
-                        // Skip E.
-                        skip(1);
-                        // Detect and skip exponent sign.
-                        if (ch0 == '+' || ch0 == '-') {
-                            skip(1);
-                        }
-                        boolean exponent = false;
-                        // Skip exponent.
-                        while (convertDigit(ch0, 10) != -1) {
-                            exponent = true;
-                            skip(1);
-                        }
-
-                        if (! exponent) {
-                            // no digit after "E"
-                            error(Lexer.message("json.invalid.number"), STRING, position, limit);
-                        }
-                    }
-
-                    valueType = TokenType.FLOATING;
-                }
-
-                // Add number token.
-                add(valueType, startPosition);
+        final int c = peek();
+        if (c == EOF) {
+            throw expectedError(pos, "json literal", "eof");
+        }
+        switch (c) {
+        case '{':
+            return parseObject();
+        case '[':
+            return parseArray();
+        case '"':
+            return parseString();
+        case 'f':
+            return parseKeyword(FALSE, Boolean.FALSE);
+        case 't':
+            return parseKeyword(TRUE, Boolean.TRUE);
+        case 'n':
+            return parseKeyword(NULL, null);
+        default:
+            if (isDigit(c) || c == '-') {
+                return parseNumber();
+            } else if (c == '.') {
+                throw numberError(pos);
+            } else {
+                throw expectedError(pos, "json literal", toString(c));
             }
-
-            // ECMA 15.12.1.1 The JSON Lexical Grammar - JSONEscapeCharacter
-            @Override
-            protected boolean isEscapeCharacter(final char ch) {
-                switch (ch) {
-                    case '"':
-                    case '/':
-                    case '\\':
-                    case 'b':
-                    case 'f':
-                    case 'n':
-                    case 'r':
-                    case 't':
-                    // could be unicode escape
-                    case 'u':
-                        return true;
-                    default:
-                        return false;
-                }
-            }
-        };
-
-        k = -1;
-
-        next();
-
-        final Node resultNode = jsonLiteral();
-        expect(EOF);
-
-        return resultNode;
+        }
     }
 
-    @SuppressWarnings("fallthrough")
-    private LiteralNode<?> getStringLiteral() {
-        final LiteralNode<?> literal = getLiteral();
-        final String         str     = (String)literal.getValue();
+    private Object parseObject() {
+        PropertyMap propertyMap = EMPTY_MAP;
+        ArrayData arrayData = ArrayData.EMPTY_ARRAY;
+        final ArrayList<Object> values = new ArrayList<>();
+        int state = STATE_EMPTY;
+
+        assert peek() == '{';
+        pos++;
+
+        while (pos < length) {
+            skipWhiteSpace();
+            final int c = peek();
 
-        for (int i = 0; i < str.length(); i++) {
-            final char ch = str.charAt(i);
-            switch (ch) {
+            switch (c) {
+            case '"':
+                if (state == STATE_ELEMENT_PARSED) {
+                    throw expectedError(pos - 1, ", or }", toString(c));
+                }
+                final String id = parseString();
+                expectColon();
+                final Object value = parseLiteral();
+                final int index = ArrayIndex.getArrayIndex(id);
+                if (ArrayIndex.isValidArrayIndex(index)) {
+                    arrayData = addArrayElement(arrayData, index, value);
+                } else {
+                    propertyMap = addObjectProperty(propertyMap, values, id, value);
+                }
+                state = STATE_ELEMENT_PARSED;
+                break;
+            case ',':
+                if (state != STATE_ELEMENT_PARSED) {
+                    throw error(AbstractParser.message("trailing.comma.in.json"), pos);
+                }
+                state = STATE_COMMA_PARSED;
+                pos++;
+                break;
+            case '}':
+                if (state == STATE_COMMA_PARSED) {
+                    throw error(AbstractParser.message("trailing.comma.in.json"), pos);
+                }
+                pos++;
+                return createObject(propertyMap, values, arrayData);
             default:
-                if (ch > 0x001f) {
-                    break;
-                }
-            case '"':
-            case '\\':
-                throw error(AbstractParser.message("unexpected.token", str));
+                throw expectedError(pos, ", or }", toString(c));
+            }
+        }
+        throw expectedError(pos, ", or }", "eof");
+    }
+
+    private static ArrayData addArrayElement(final ArrayData arrayData, final int index, final Object value) {
+        final long oldLength = arrayData.length();
+        final long longIndex = ArrayIndex.toLongIndex(index);
+        ArrayData newArrayData = arrayData;
+        if (longIndex >= oldLength) {
+            newArrayData = newArrayData.ensure(longIndex);
+            if (longIndex > oldLength) {
+                newArrayData = newArrayData.delete(oldLength, longIndex - 1);
+            }
+        }
+        return newArrayData.set(index, value, false);
+    }
+
+    private static PropertyMap addObjectProperty(final PropertyMap propertyMap, final List<Object> values,
+                                                 final String id, final Object value) {
+        final Property oldProperty = propertyMap.findProperty(id);
+        final Property newProperty;
+        final PropertyMap newMap;
+        final Class<?> type = ObjectClassGenerator.OBJECT_FIELDS_ONLY ? Object.class : getType(value);
+
+        if (oldProperty != null) {
+            values.set(oldProperty.getSlot(), value);
+            newProperty = new SpillProperty(id, 0, oldProperty.getSlot());
+            newProperty.setType(type);
+            newMap = propertyMap.replaceProperty(oldProperty, newProperty);;
+        } else {
+            values.add(value);
+            newProperty = new SpillProperty(id, 0, propertyMap.size());
+            newProperty.setType(type);
+            newMap = propertyMap.addProperty(newProperty);
+        }
+
+        return newMap;
+    }
+
+    private Object createObject(final PropertyMap propertyMap, final List<Object> values, final ArrayData arrayData) {
+        final long[] primitiveSpill = new long[values.size()];
+        final Object[] objectSpill = new Object[values.size()];
+
+        for (final Property property : propertyMap.getProperties()) {
+            if (property.getType() == Object.class) {
+                objectSpill[property.getSlot()] = values.get(property.getSlot());
+            } else {
+                primitiveSpill[property.getSlot()] = ObjectClassGenerator.pack((Number) values.get(property.getSlot()));
             }
         }
 
-        return literal;
+        final ScriptObject object = new JO(propertyMap, primitiveSpill, objectSpill);
+        object.setInitialProto(global.getObjectPrototype());
+        object.setArray(arrayData);
+        return object;
+    }
+
+    private static Class<?> getType(final Object value) {
+        if (value instanceof Integer) {
+            return int.class;
+        } else if (value instanceof Long) {
+            return long.class;
+        } else if (value instanceof Double) {
+            return double.class;
+        } else {
+            return Object.class;
+        }
+    }
+
+    private void expectColon() {
+        skipWhiteSpace();
+        final int n = next();
+        if (n != ':') {
+            throw expectedError(pos - 1, ":", toString(n));
+        }
     }
 
-    /**
-     * Parse a JSON literal from the token stream
-     * @return the JSON literal as a Node
-     */
-    private Expression jsonLiteral() {
-        final long literalToken = token;
+    private Object parseArray() {
+        ArrayData arrayData = ArrayData.EMPTY_ARRAY;
+        int state = STATE_EMPTY;
 
-        switch (type) {
-        case STRING:
-            return getStringLiteral();
-        case ESCSTRING:
-        case DECIMAL:
-        case FLOATING:
-            return getLiteral();
-        case FALSE:
-            next();
-            return LiteralNode.newInstance(literalToken, finish, false);
-        case TRUE:
-            next();
-            return LiteralNode.newInstance(literalToken, finish, true);
-        case NULL:
-            next();
-            return LiteralNode.newInstance(literalToken, finish);
-        case LBRACKET:
-            return arrayLiteral();
-        case LBRACE:
-            return objectLiteral();
-        /*
-         * A.8.1 JSON Lexical Grammar
-         *
-         * JSONNumber :: See 15.12.1.1
-         *    -opt DecimalIntegerLiteral JSONFractionopt ExponentPartopt
-         */
-        case SUB:
-            next();
+        assert peek() == '[';
+        pos++;
 
-            final long realToken = token;
-            final Object value = getValue();
-
-            if (value instanceof Number) {
-                next();
-                return new UnaryNode(literalToken, LiteralNode.newInstance(realToken, finish, (Number)value));
-            }
+        while (pos < length) {
+            skipWhiteSpace();
+            final int c = peek();
 
-            throw error(AbstractParser.message("expected", "number", type.getNameOrType()));
-        default:
-            break;
-        }
-
-        throw error(AbstractParser.message("expected", "json literal", type.getNameOrType()));
-    }
-
-    /**
-     * Parse an array literal from the token stream
-     * @return the array literal as a Node
-     */
-    private LiteralNode<Expression[]> arrayLiteral() {
-        // Unlike JavaScript array literals, elison is not permitted in JSON.
-
-        // Capture LBRACKET token.
-        final long arrayToken = token;
-        // LBRACKET tested in caller.
-        next();
-
-        LiteralNode<Expression[]> result = null;
-        // Prepare to accummulating elements.
-        final List<Expression> elements = new ArrayList<>();
-
-loop:
-        while (true) {
-            switch (type) {
-            case RBRACKET:
-                next();
-                result = LiteralNode.newInstance(arrayToken, finish, elements);
-                break loop;
-
-            case COMMARIGHT:
-                next();
-                // check for trailing comma - not allowed in JSON
-                if (type == RBRACKET) {
-                    throw error(AbstractParser.message("trailing.comma.in.json", type.getNameOrType()));
+            switch (c) {
+            case ',':
+                if (state != STATE_ELEMENT_PARSED) {
+                    throw error(AbstractParser.message("trailing.comma.in.json"), pos);
                 }
+                state = STATE_COMMA_PARSED;
+                pos++;
                 break;
-
+            case ']':
+                if (state == STATE_COMMA_PARSED) {
+                    throw error(AbstractParser.message("trailing.comma.in.json"), pos);
+                }
+                pos++;
+                return global.wrapAsObject(arrayData);
             default:
-                // Add expression element.
-                elements.add(jsonLiteral());
-                // Comma between array elements is mandatory in JSON.
-                if (type != COMMARIGHT && type != RBRACKET) {
-                   throw error(AbstractParser.message("expected", ", or ]", type.getNameOrType()));
+                if (state == STATE_ELEMENT_PARSED) {
+                    throw expectedError(pos, ", or ]", toString(c));
                 }
+                final long index = arrayData.length();
+                arrayData = arrayData.ensure(index).set((int) index, parseLiteral(), true);
+                state = STATE_ELEMENT_PARSED;
                 break;
             }
         }
 
-        return result;
+        throw expectedError(pos, ", or ]", "eof");
     }
 
-    /**
-     * Parse an object literal from the token stream
-     * @return the object literal as a Node
-     */
-    private ObjectNode objectLiteral() {
-        // Capture LBRACE token.
-        final long objectToken = token;
-        // LBRACE tested in caller.
-        next();
+    private String parseString() {
+        // String buffer is only instantiated if string contains escape sequences.
+        int start = ++pos;
+        StringBuilder sb = null;
 
-        // Prepare to accumulate elements.
-        final List<PropertyNode> elements = new ArrayList<>();
+        while (pos < length) {
+            final int c = next();
+            if (c <= 0x1f) {
+                // Characters < 0x1f are not allowed in JSON strings.
+                throw syntaxError(pos, "String contains control character");
 
-        // Create a block for the object literal.
-loop:
-        while (true) {
-            switch (type) {
-            case RBRACE:
-                next();
-                break loop;
+            } else if (c == '\\') {
+                if (sb == null) {
+                    sb = new StringBuilder(pos - start + 16);
+                }
+                sb.append(source, start, pos - 1);
+                sb.append(parseEscapeSequence());
+                start = pos;
 
-            case COMMARIGHT:
-                next();
-                // check for trailing comma - not allowed in JSON
-                if (type == RBRACE) {
-                    throw error(AbstractParser.message("trailing.comma.in.json", type.getNameOrType()));
+            } else if (c == '"') {
+                if (sb != null) {
+                    sb.append(source, start, pos - 1);
+                    return sb.toString();
                 }
-                break;
-
-            default:
-                // Get and add the next property.
-                final PropertyNode property = propertyAssignment();
-                elements.add(property);
-
-                // Comma between property assigments is mandatory in JSON.
-                if (type != RBRACE && type != COMMARIGHT) {
-                    throw error(AbstractParser.message("expected", ", or }", type.getNameOrType()));
-                }
-                break;
+                return source.substring(start, pos - 1);
             }
         }
 
-        // Construct new object literal.
-        return new ObjectNode(objectToken, finish, elements);
+        throw error(Lexer.message("missing.close.quote"), pos, length);
+    }
+
+    private char parseEscapeSequence() {
+        final int c = next();
+        switch (c) {
+        case '"':
+            return '"';
+        case '\\':
+            return '\\';
+        case '/':
+            return '/';
+        case 'b':
+            return '\b';
+        case 'f':
+            return '\f';
+        case 'n':
+            return '\n';
+        case 'r':
+            return '\r';
+        case 't':
+            return '\t';
+        case 'u':
+            return parseUnicodeEscape();
+        default:
+            throw error(Lexer.message("invalid.escape.char"), pos - 1, length);
+        }
+    }
+
+    private char parseUnicodeEscape() {
+        return (char) (parseHexDigit() << 12 | parseHexDigit() << 8 | parseHexDigit() << 4 | parseHexDigit());
+    }
+
+    private int parseHexDigit() {
+        final int c = next();
+        if (c >= '0' && c <= '9') {
+            return c - '0';
+        } else if (c >= 'A' && c <= 'F') {
+            return c + 10 - 'A';
+        } else if (c >= 'a' && c <= 'f') {
+            return c + 10 - 'a';
+        }
+        throw error(Lexer.message("invalid.hex"), pos - 1, length);
+    }
+
+    private boolean isDigit(final int c) {
+        return c >= '0' && c <= '9';
+    }
+
+    private void skipDigits() {
+        while (pos < length) {
+            final int c = peek();
+            if (!isDigit(c)) {
+                break;
+            }
+            pos++;
+        }
     }
 
-    /**
-     * Parse a property assignment from the token stream
-     * @return the property assignment as a Node
-     */
-    private PropertyNode propertyAssignment() {
-        // Capture firstToken.
-        final long propertyToken = token;
-        LiteralNode<?> name = null;
+    private Number parseNumber() {
+        final int start = pos;
+        int c = next();
+
+        if (c == '-') {
+            c = next();
+        }
+        if (!isDigit(c)) {
+            throw numberError(start);
+        }
+        // no more digits allowed after 0
+        if (c != '0') {
+            skipDigits();
+        }
 
-        if (type == STRING) {
-            name = getStringLiteral();
-        } else if (type == ESCSTRING) {
-            name = getLiteral();
+        // fraction
+        if (peek() == '.') {
+            pos++;
+            if (!isDigit(next())) {
+                throw numberError(pos - 1);
+            }
+            skipDigits();
+        }
+
+        // exponent
+        c = peek();
+        if (c == 'e' || c == 'E') {
+            pos++;
+            c = next();
+            if (c == '-' || c == '+') {
+                c = next();
+            }
+            if (!isDigit(c)) {
+                throw numberError(pos - 1);
+            }
+            skipDigits();
         }
 
-        if (name != null) {
-            expect(COLON);
-            final Expression value = jsonLiteral();
-            return new PropertyNode(propertyToken, value.getFinish(), name, value, null, null);
+        final double d = Double.parseDouble(source.substring(start, pos));
+        if (JSType.isRepresentableAsInt(d)) {
+            return (int) d;
+        } else if (JSType.isRepresentableAsLong(d)) {
+            return (long) d;
+        }
+        return d;
+    }
+
+    private Object parseKeyword(final String keyword, final Object value) {
+        if (!source.regionMatches(pos, keyword, 0, keyword.length())) {
+            throw expectedError(pos, "json literal", "ident");
         }
+        pos += keyword.length();
+        return value;
+    }
 
-        // Raise an error.
-        throw error(AbstractParser.message("expected", "string", type.getNameOrType()));
+    private int peek() {
+        if (pos >= length) {
+            return -1;
+        }
+        return source.charAt(pos);
+    }
+
+    private int next() {
+        final int next = peek();
+        pos++;
+        return next;
     }
 
+    private void skipWhiteSpace() {
+        while (pos < length) {
+            switch (peek()) {
+            case '\t':
+            case '\r':
+            case '\n':
+            case ' ':
+                pos++;
+                break;
+            default:
+                return;
+            }
+        }
+    }
+
+    private static String toString(final int c) {
+        return c == EOF ? "eof" : String.valueOf((char) c);
+    }
+
+    ParserException error(final String message, final int start, final int length) throws ParserException {
+        final long token     = Token.toDesc(STRING, start, length);
+        final int  pos       = Token.descPosition(token);
+        final Source src     = Source.sourceFor("<json>", source);
+        final int  lineNum   = src.getLine(pos);
+        final int  columnNum = src.getColumn(pos);
+        final String formatted = ErrorManager.format(message, src, lineNum, columnNum, token);
+        return new ParserException(JSErrorType.SYNTAX_ERROR, formatted, src, lineNum, columnNum, token);
+    }
+
+    private ParserException error(final String message, final int start) {
+        return error(message, start, length);
+    }
+
+    private ParserException numberError(final int start) {
+        return error(Lexer.message("json.invalid.number"), start);
+    }
+
+    private ParserException expectedError(final int start, final String expected, final String found) {
+        return error(AbstractParser.message("expected", expected, found), start);
+    }
+
+    private ParserException syntaxError(final int start, final String reason) {
+        final String message = ECMAErrors.getMessage("syntax.error.invalid.json", reason);
+        return error(message, start);
+    }
 }
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/parser/Lexer.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/parser/Lexer.java	Mon Feb 23 05:01:11 2015 -0800
@@ -93,9 +93,6 @@
     private static final String SPACETAB = " \t";  // ASCII space and tab
     private static final String LFCR     = "\n\r"; // line feed and carriage return (ctrl-m)
 
-    private static final String JSON_WHITESPACE_EOL = LFCR;
-    private static final String JSON_WHITESPACE     = SPACETAB + LFCR;
-
     private static final String JAVASCRIPT_WHITESPACE_EOL =
         LFCR +
         "\u2028" + // line separator
@@ -385,24 +382,6 @@
     }
 
     /**
-     * Test whether a char is valid JSON whitespace
-     * @param ch a char
-     * @return true if valid JSON whitespace
-     */
-    public static boolean isJsonWhitespace(final char ch) {
-        return JSON_WHITESPACE.indexOf(ch) != -1;
-    }
-
-    /**
-     * Test whether a char is valid JSON end of line
-     * @param ch a char
-     * @return true if valid JSON end of line
-     */
-    public static boolean isJsonEOL(final char ch) {
-        return JSON_WHITESPACE_EOL.indexOf(ch) != -1;
-    }
-
-    /**
      * Test if char is a string delimiter, e.g. '\' or '"'.  Also scans exec
      * strings ('`') in scripting mode.
      * @param ch a char
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/Context.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/Context.java	Mon Feb 23 05:01:11 2015 -0800
@@ -60,6 +60,7 @@
 import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.Map;
+import java.util.Objects;
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.concurrent.atomic.AtomicReference;
 import java.util.function.Consumer;
@@ -904,7 +905,7 @@
      * @throw SecurityException if not accessible
      */
     private static void checkPackageAccess(final SecurityManager sm, final String fullName) {
-        sm.getClass(); // null check
+        Objects.requireNonNull(sm);
         final int index = fullName.lastIndexOf('.');
         if (index != -1) {
             final String pkgName = fullName.substring(0, index);
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/JSONFunctions.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/JSONFunctions.java	Mon Feb 23 05:01:11 2015 -0800
@@ -25,19 +25,11 @@
 
 package jdk.nashorn.internal.runtime;
 
-import static jdk.nashorn.internal.runtime.Source.sourceFor;
-
 import java.lang.invoke.MethodHandle;
 import java.util.Iterator;
 import java.util.concurrent.Callable;
-import jdk.nashorn.internal.ir.LiteralNode;
-import jdk.nashorn.internal.ir.Node;
-import jdk.nashorn.internal.ir.ObjectNode;
-import jdk.nashorn.internal.ir.PropertyNode;
-import jdk.nashorn.internal.ir.UnaryNode;
 import jdk.nashorn.internal.objects.Global;
 import jdk.nashorn.internal.parser.JSONParser;
-import jdk.nashorn.internal.parser.TokenType;
 import jdk.nashorn.internal.runtime.arrays.ArrayIndex;
 import jdk.nashorn.internal.runtime.linker.Bootstrap;
 
@@ -78,20 +70,18 @@
      * @return Object representation of JSON text given
      */
     public static Object parse(final Object text, final Object reviver) {
-        final String     str     = JSType.toString(text);
-        final JSONParser parser  = new JSONParser(sourceFor("<json>", str), new Context.ThrowErrorManager());
-
-        Node node;
+        final String     str    = JSType.toString(text);
+        final Global     global = Context.getGlobal();
+        final JSONParser parser = new JSONParser(str, global);
+        final Object     value;
 
         try {
-            node = parser.parse();
+            value = parser.parse();
         } catch (final ParserException e) {
             throw ECMAErrors.syntaxError(e, "invalid.json", e.getMessage());
         }
 
-        final Global global = Context.getGlobal();
-        final Object unfiltered = convertNode(global, node);
-        return applyReviver(global, unfiltered, reviver);
+        return applyReviver(global, value, reviver);
     }
 
     // -- Internals only below this point
@@ -137,61 +127,6 @@
         }
     }
 
-    // Converts IR node to runtime value
-    private static Object convertNode(final Global global, final Node node) {
-        if (node instanceof LiteralNode) {
-            // check for array literal
-            if (node.tokenType() == TokenType.ARRAY) {
-                assert node instanceof LiteralNode.ArrayLiteralNode;
-                final Node[] elements = ((LiteralNode.ArrayLiteralNode)node).getValue();
-
-                // NOTE: We cannot use LiteralNode.isNumericArray() here as that
-                // method uses symbols of element nodes. Since we don't do lower
-                // pass, there won't be any symbols!
-                if (isNumericArray(elements)) {
-                    final double[] values = new double[elements.length];
-                    int   index = 0;
-
-                    for (final Node elem : elements) {
-                        values[index++] = JSType.toNumber(convertNode(global, elem));
-                    }
-                    return global.wrapAsObject(values);
-                }
-
-                final Object[] values = new Object[elements.length];
-                int   index = 0;
-
-                for (final Node elem : elements) {
-                    values[index++] = convertNode(global, elem);
-                }
-
-                return global.wrapAsObject(values);
-            }
-
-            return ((LiteralNode<?>)node).getValue();
-
-        } else if (node instanceof ObjectNode) {
-            final ObjectNode   objNode  = (ObjectNode) node;
-            final ScriptObject object   = global.newObject();
-
-            for (final PropertyNode pNode: objNode.getElements()) {
-                final Node         valueNode = pNode.getValue();
-
-                final String name = pNode.getKeyName();
-                final Object value = convertNode(global, valueNode);
-                setPropertyValue(object, name, value);
-            }
-
-            return object;
-        } else if (node instanceof UnaryNode) {
-            // UnaryNode used only to represent negative number JSON value
-            final UnaryNode unaryNode = (UnaryNode)node;
-            return -((LiteralNode<?>)unaryNode.getExpression()).getNumber();
-        } else {
-            return null;
-        }
-    }
-
     // add a new property if does not exist already, or else set old property
     private static void setPropertyValue(final ScriptObject sobj, final String name, final Object value) {
         final int index = ArrayIndex.getArrayIndex(name);
@@ -207,14 +142,4 @@
         }
     }
 
-    // does the given IR node represent a numeric array?
-    private static boolean isNumericArray(final Node[] values) {
-        for (final Node node : values) {
-            if (node instanceof LiteralNode && ((LiteralNode<?>)node).getValue() instanceof Number) {
-                continue;
-            }
-            return false;
-        }
-        return true;
-    }
 }
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/PropertyMap.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/PropertyMap.java	Mon Feb 23 05:01:11 2015 -0800
@@ -486,7 +486,7 @@
      *
      * @return New {@link PropertyMap} with {@link Property} replaced.
      */
-    PropertyMap replaceProperty(final Property oldProperty, final Property newProperty) {
+    public PropertyMap replaceProperty(final Property oldProperty, final Property newProperty) {
         if (listeners != null) {
             listeners.propertyModified(oldProperty, newProperty);
         }
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptLoader.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptLoader.java	Mon Feb 23 05:01:11 2015 -0800
@@ -26,6 +26,7 @@
 package jdk.nashorn.internal.runtime;
 
 import java.security.CodeSource;
+import java.util.Objects;
 
 /**
  * Responsible for loading script generated classes.
@@ -69,8 +70,7 @@
      * @return Installed class.
      */
     synchronized Class<?> installClass(final String name, final byte[] data, final CodeSource cs) {
-        // null check
-        cs.getClass();
+        Objects.requireNonNull(cs);
         return defineClass(name, data, 0, data.length, cs);
     }
 }
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptObject.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptObject.java	Mon Feb 23 05:01:11 2015 -0800
@@ -722,8 +722,12 @@
     public void defineOwnProperty(final int index, final Object value) {
         assert isValidArrayIndex(index) : "invalid array index";
         final long longIndex = ArrayIndex.toLongIndex(index);
-        doesNotHaveEnsureDelete(longIndex, getArray().length(), false);
-        setArray(getArray().ensure(longIndex).set(index,value, false));
+        final long oldLength = getArray().length();
+        if (longIndex >= oldLength) {
+            setArray(getArray().ensure(longIndex));
+            doesNotHaveEnsureDelete(longIndex, oldLength, false);
+        }
+        setArray(getArray().set(index,value, false));
     }
 
     private void checkIntegerKey(final String key) {
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/ArrayData.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/ArrayData.java	Mon Feb 23 05:01:11 2015 -0800
@@ -118,7 +118,7 @@
                     return new SparseArrayData(this, safeIndex + 1);
                 }
                 //known to fit in int
-                return toRealArrayData((int)safeIndex).ensure(safeIndex);
+                return toRealArrayData((int)safeIndex);
            }
            return this;
         }
@@ -497,7 +497,9 @@
     public abstract ArrayData shiftRight(final int by);
 
     /**
-     * Ensure that the given index exists and won't fail subsequent
+     * Ensure that the given index exists and won't fail in a subsequent access.
+     * If {@code safeIndex} is equal or greater than the current length the length is
+     * updated to {@code safeIndex + 1}.
      *
      * @param safeIndex the index to ensure wont go out of bounds
      * @return new array data (or same)
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/ContinuousArrayData.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/ContinuousArrayData.java	Mon Feb 23 05:01:11 2015 -0800
@@ -57,7 +57,7 @@
     }
 
     /**
-     * Check if we can put one more element at the end of this continous
+     * Check if we can put one more element at the end of this continuous
      * array without reallocating, or if we are overwriting an already
      * allocated element
      *
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/IntArrayData.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/IntArrayData.java	Mon Feb 23 05:01:11 2015 -0800
@@ -221,7 +221,9 @@
             final int newLength = ArrayData.nextSize((int)safeIndex);
             array = Arrays.copyOf(array, newLength);
         }
-        setLength(safeIndex + 1);
+        if (safeIndex >= length()) {
+            setLength(safeIndex + 1);
+        }
         return this;
     }
 
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/LongArrayData.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/LongArrayData.java	Mon Feb 23 05:01:11 2015 -0800
@@ -157,7 +157,9 @@
             final int newLength = ArrayData.nextSize((int)safeIndex);
             array = Arrays.copyOf(array, newLength);
         }
-        setLength(safeIndex + 1);
+        if (safeIndex >= length()) {
+            setLength(safeIndex + 1);
+        }
         return this;
     }
 
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/NumberArrayData.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/NumberArrayData.java	Mon Feb 23 05:01:11 2015 -0800
@@ -139,7 +139,9 @@
             final int newLength = ArrayData.nextSize((int)safeIndex);
             array = Arrays.copyOf(array, newLength); //todo fill with nan or never accessed?
         }
-        setLength(safeIndex + 1);
+        if (safeIndex >= length()) {
+            setLength(safeIndex + 1);
+        }
         return this;
 
     }
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/ObjectArrayData.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/ObjectArrayData.java	Mon Feb 23 05:01:11 2015 -0800
@@ -123,7 +123,9 @@
             final int newLength = ArrayData.nextSize((int)safeIndex);
             array = Arrays.copyOf(array, newLength); //fill with undefined or OK? TODO
         }
-        setLength(safeIndex + 1);
+        if (safeIndex >= length()) {
+            setLength(safeIndex + 1);
+        }
         return this;
     }
 
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/SparseArrayData.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/SparseArrayData.java	Mon Feb 23 05:01:11 2015 -0800
@@ -135,10 +135,17 @@
 
     @Override
     public ArrayData ensure(final long safeIndex) {
+        // Usually #ensure only needs to be called if safeIndex is greater or equal current length.
+        // SparseArrayData is an exception as an index smaller than our current length may still
+        // exceed the underlying ArrayData's capacity. Because of this, SparseArrayData invokes
+        // its ensure method internally in various places where other ArrayData subclasses don't,
+        // making it safe for outside uses to only call ensure(safeIndex) if safeIndex >= length.
         if (safeIndex < maxDenseLength && underlying.length() <= safeIndex) {
             underlying = underlying.ensure(safeIndex);
         }
-        setLength(Math.max(safeIndex + 1, length()));
+        if (safeIndex >= length()) {
+            setLength(safeIndex + 1);
+        }
         return this;
     }
 
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/Bootstrap.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/Bootstrap.java	Mon Feb 23 05:01:11 2015 -0800
@@ -119,6 +119,7 @@
                 return unboxReturnType(target, newType);
             }
         });
+        factory.setInternalObjectsFilter(NashornBeansLinker.createHiddenObjectFilter());
         final int relinkThreshold = Options.getIntProperty("nashorn.unstable.relink.threshold", NASHORN_DEFAULT_UNSTABLE_RELINK_THRESHOLD);
         if (relinkThreshold > -1) {
             factory.setUnstableRelinkThreshold(relinkThreshold);
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/JavaSuperAdapter.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/JavaSuperAdapter.java	Mon Feb 23 05:01:11 2015 -0800
@@ -25,6 +25,8 @@
 
 package jdk.nashorn.internal.runtime.linker;
 
+import java.util.Objects;
+
 /**
  * Represents a an adapter for invoking superclass methods on an adapter instance generated by
  * {@code JavaAdapterBytecodeGenerator}. Note that objects of this class are just wrappers around the adapter instances,
@@ -34,7 +36,7 @@
     private final Object adapter;
 
     JavaSuperAdapter(final Object adapter) {
-        adapter.getClass(); // NPE check
+        Objects.requireNonNull(adapter);
         this.adapter = adapter;
     }
 
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/NashornBeansLinker.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/NashornBeansLinker.java	Mon Feb 23 05:01:11 2015 -0800
@@ -40,10 +40,11 @@
 import jdk.internal.dynalink.linker.GuardingDynamicLinker;
 import jdk.internal.dynalink.linker.LinkRequest;
 import jdk.internal.dynalink.linker.LinkerServices;
+import jdk.internal.dynalink.linker.MethodHandleTransformer;
+import jdk.internal.dynalink.support.DefaultInternalObjectFilter;
 import jdk.internal.dynalink.support.Guards;
 import jdk.internal.dynalink.support.Lookup;
 import jdk.nashorn.api.scripting.ScriptUtils;
-import jdk.nashorn.internal.objects.NativeArray;
 import jdk.nashorn.internal.runtime.ConsString;
 import jdk.nashorn.internal.runtime.Context;
 import jdk.nashorn.internal.runtime.ScriptObject;
@@ -52,10 +53,14 @@
 
 /**
  * This linker delegates to a {@code BeansLinker} but passes it a special linker services object that has a modified
- * {@code asType} method that will ensure that we never pass internal engine objects that should not be externally
- * observable (currently ConsString and ScriptObject) to Java APIs, but rather that we flatten it into a String. We can't just add
- * this functionality as custom converters via {@code GuaardingTypeConverterFactory}, since they are not consulted when
- * the target method handle parameter signature is {@code Object}.
+ * {@code compareConversion} method that favors conversion of {@link ConsString} to either {@link String} or
+ * {@link CharSequence}. It also provides a {@link #createHiddenObjectFilter()} method for use with bootstrap that will
+ * ensure that we never pass internal engine objects that should not be externally observable (currently ConsString and
+ * ScriptObject) to Java APIs, but rather that we flatten it into a String. We can't just add this functionality as
+ * custom converters via {@code GuaardingTypeConverterFactory}, since they are not consulted when
+ * the target method handle parameter signature is {@code Object}. This linker also makes sure that primitive
+ * {@link String} operations can be invoked on a {@link ConsString}, and allows invocation of objects implementing
+ * the {@link FunctionalInterface} attribute.
  */
 public class NashornBeansLinker implements GuardingDynamicLinker {
     // System property to control whether to wrap ScriptObject->ScriptObjectMirror for
@@ -63,16 +68,12 @@
     private static final boolean MIRROR_ALWAYS = Options.getBooleanProperty("nashorn.mirror.always", true);
 
     private static final MethodHandle EXPORT_ARGUMENT;
-    private static final MethodHandle EXPORT_NATIVE_ARRAY;
-    private static final MethodHandle EXPORT_SCRIPT_OBJECT;
     private static final MethodHandle IMPORT_RESULT;
     private static final MethodHandle FILTER_CONSSTRING;
 
     static {
         final Lookup lookup  = new Lookup(MethodHandles.lookup());
         EXPORT_ARGUMENT      = lookup.findOwnStatic("exportArgument", Object.class, Object.class);
-        EXPORT_NATIVE_ARRAY  = lookup.findOwnStatic("exportNativeArray", Object.class, NativeArray.class);
-        EXPORT_SCRIPT_OBJECT = lookup.findOwnStatic("exportScriptObject", Object.class, ScriptObject.class);
         IMPORT_RESULT        = lookup.findOwnStatic("importResult", Object.class, Object.class);
         FILTER_CONSSTRING    = lookup.findOwnStatic("consStringFilter", Object.class, Object.class);
     }
@@ -115,9 +116,10 @@
                 }
                 return new GuardedInvocation(
                         // drop 'thiz' passed from the script.
-                        MH.dropArguments(desc.getLookup().unreflect(m), 1, callType.parameterType(1)),
-                        Guards.getInstanceOfGuard(m.getDeclaringClass())).asTypeSafeReturn(
-                                new NashornBeansLinkerServices(linkerServices), callType);
+                        MH.dropArguments(linkerServices.filterInternalObjects(desc.getLookup().unreflect(m)), 1,
+                                callType.parameterType(1)), Guards.getInstanceOfGuard(
+                                        m.getDeclaringClass())).asTypeSafeReturn(
+                                                new NashornBeansLinkerServices(linkerServices), callType);
             }
         }
         return getGuardedInvocation(beansLinker, linkRequest, linkerServices);
@@ -141,21 +143,6 @@
         return exportArgument(arg, MIRROR_ALWAYS);
     }
 
-    @SuppressWarnings("unused")
-    private static Object exportNativeArray(final NativeArray arg) {
-        return exportArgument(arg, MIRROR_ALWAYS);
-    }
-
-    @SuppressWarnings("unused")
-    private static Object exportScriptObject(final ScriptObject arg) {
-        return exportArgument(arg, MIRROR_ALWAYS);
-    }
-
-    @SuppressWarnings("unused")
-    private static Object exportScriptArray(final NativeArray arg) {
-        return exportArgument(arg, MIRROR_ALWAYS);
-    }
-
     static Object exportArgument(final Object arg, final boolean mirrorAlways) {
         if (arg instanceof ConsString) {
             return arg.toString();
@@ -208,6 +195,10 @@
         return FUNCTIONAL_IFACE_METHOD.get(clazz);
     }
 
+    static MethodHandleTransformer createHiddenObjectFilter() {
+        return new DefaultInternalObjectFilter(EXPORT_ARGUMENT, MIRROR_ALWAYS ? IMPORT_RESULT : null);
+    }
+
     private static class NashornBeansLinkerServices implements LinkerServices {
         private final LinkerServices linkerServices;
 
@@ -217,50 +208,7 @@
 
         @Override
         public MethodHandle asType(final MethodHandle handle, final MethodType fromType) {
-            final MethodType handleType = handle.type();
-            final int paramCount = handleType.parameterCount();
-            assert fromType.parameterCount() == handleType.parameterCount();
-
-            MethodType newFromType = fromType;
-            MethodHandle[] filters = null;
-            for(int i = 0; i < paramCount; ++i) {
-                final MethodHandle filter = argConversionFilter(handleType.parameterType(i), fromType.parameterType(i));
-                if (filter != null) {
-                    if (filters == null) {
-                        filters = new MethodHandle[paramCount];
-                    }
-                    // "erase" specific type with Object type or else we'll get filter mismatch
-                    newFromType = newFromType.changeParameterType(i, Object.class);
-                    filters[i] = filter;
-                }
-            }
-
-            final MethodHandle typed = linkerServices.asType(handle, newFromType);
-            MethodHandle result = filters != null ? MethodHandles.filterArguments(typed, 0, filters) : typed;
-            // Filter Object typed return value for possible ScriptObjectMirror. We convert
-            // ScriptObjectMirror as ScriptObject (if it is mirror from current global).
-            if (MIRROR_ALWAYS && areBothObjects(handleType.returnType(), fromType.returnType())) {
-                result = MethodHandles.filterReturnValue(result, IMPORT_RESULT);
-            }
-
-            return result;
-        }
-
-        private static MethodHandle argConversionFilter(final Class<?> handleType, final Class<?> fromType) {
-            if (handleType == Object.class) {
-                if (fromType == Object.class) {
-                    return EXPORT_ARGUMENT;
-                } else if (fromType == NativeArray.class) {
-                    return EXPORT_NATIVE_ARRAY;
-                } else if (fromType == ScriptObject.class) {
-                    return EXPORT_SCRIPT_OBJECT;
-                }
-            }
-            return null;
-        }
-
-        private static boolean areBothObjects(final Class<?> handleType, final Class<?> fromType) {
-            return handleType == Object.class && fromType == Object.class;
+            return linkerServices.asType(handle, fromType);
         }
 
         @Override
@@ -296,5 +244,10 @@
             }
             return linkerServices.compareConversion(sourceType, targetType1, targetType2);
         }
+
+        @Override
+        public MethodHandle filterInternalObjects(MethodHandle target) {
+            return linkerServices.filterInternalObjects(target);
+        }
     }
 }
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/options/Options.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/options/Options.java	Mon Feb 23 05:01:11 2015 -0800
@@ -42,6 +42,7 @@
 import java.util.Locale;
 import java.util.Map;
 import java.util.MissingResourceException;
+import java.util.Objects;
 import java.util.PropertyPermission;
 import java.util.ResourceBundle;
 import java.util.StringTokenizer;
@@ -143,7 +144,7 @@
      * @return true if set to true, default value if unset or set to false
      */
     public static boolean getBooleanProperty(final String name, final Boolean defValue) {
-        name.getClass(); // null check
+        Objects.requireNonNull(name);
         if (!name.startsWith("nashorn.")) {
             throw new IllegalArgumentException(name);
         }
@@ -184,7 +185,7 @@
      * @return string property if set or default value
      */
     public static String getStringProperty(final String name, final String defValue) {
-        name.getClass(); // null check
+        Objects.requireNonNull(name);
         if (! name.startsWith("nashorn.")) {
             throw new IllegalArgumentException(name);
         }
@@ -211,7 +212,7 @@
      * @return integer property if set or default value
      */
     public static int getIntProperty(final String name, final int defValue) {
-        name.getClass(); // null check
+        Objects.requireNonNull(name);
         if (! name.startsWith("nashorn.")) {
             throw new IllegalArgumentException(name);
         }
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/scripts/JO.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/scripts/JO.java	Mon Feb 23 05:01:11 2015 -0800
@@ -25,7 +25,6 @@
 
 package jdk.nashorn.internal.scripts;
 
-import jdk.nashorn.internal.codegen.SpillObjectCreator;
 import jdk.nashorn.internal.runtime.PropertyMap;
 import jdk.nashorn.internal.runtime.ScriptObject;
 
@@ -64,8 +63,9 @@
     }
 
     /**
-     * Constructor that takes a pre-initialized spill pool. Used for
-     * by {@link SpillObjectCreator} for intializing object literals
+     * Constructor that takes a pre-initialized spill pool. Used by
+     * {@link jdk.nashorn.internal.codegen.SpillObjectCreator} and
+     * {@link jdk.nashorn.internal.parser.JSONParser} for initializing object literals
      *
      * @param map            property map
      * @param primitiveSpill primitive spill pool
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/examples/json-parser-micro.js	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,315 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   - Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *
+ *   - Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ *   - Neither the name of Oracle nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+function bench() {
+    var start = Date.now();
+    for (var i = 0; i < 2000; i++) {
+        JSON.parse(String(json));
+    }
+    print("1000 iterations in", Date.now() - start, "millis");
+}
+
+var json = '[\
+  {\
+    "_id": "54ca34171d3ade49782294c8",\
+    "index": 0,\
+    "guid": "ed0e74d5-ac63-47b6-8938-1750abab5770",\
+    "isActive": false,\
+    "balance": "$1,996.19",\
+    "picture": "http://placehold.it/32x32",\
+    "age": 39,\
+    "eyeColor": "green",\
+    "name": "Rose Graham",\
+    "gender": "male",\
+    "company": "PRIMORDIA",\
+    "email": "rosegraham@primordia.com",\
+    "phone": "+1 (985) 600-3551",\
+    "address": "364 Melba Court, Succasunna, Texas, 8393",\
+    "about": "Sunt commodo cillum occaecat velit eu eiusmod ex eiusmod sunt deserunt nulla proident incididunt. Incididunt ullamco Lorem elit do culpa esse do ex dolor aliquip labore. Ullamco velit laboris incididunt dolor. Nostrud dolor sint pariatur fugiat ullamco exercitation. Eu laboris do cupidatat eiusmod incididunt mollit occaecat voluptate.",\
+    "registered": "2014-03-13T12:05:14 -01:00",\
+    "latitude": 18.55665,\
+    "longitude": 81.641001,\
+    "tags": [\
+      "sint",\
+      "Lorem",\
+      "veniam",\
+      "quis",\
+      "proident",\
+      "consectetur",\
+      "consequat"\
+    ],\
+    "friends": [\
+      {\
+        "id": 0,\
+        "name": "Evangelina Morgan"\
+      },\
+      {\
+        "id": 1,\
+        "name": "Saunders Snyder"\
+      },\
+      {\
+        "id": 2,\
+        "name": "Walker Wood"\
+      }\
+    ],\
+    "greeting": "Hello, Rose Graham! You have 1 unread messages.",\
+    "favoriteFruit": "strawberry"\
+  },\
+  {\
+    "_id": "54ca34176790c4c60fcae085",\
+    "index": 1,\
+    "guid": "9dc42e4c-b58f-4d92-a2ee-968d2b627d92",\
+    "isActive": true,\
+    "balance": "$3,832.97",\
+    "picture": "http://placehold.it/32x32",\
+    "age": 40,\
+    "eyeColor": "brown",\
+    "name": "Delaney Cherry",\
+    "gender": "male",\
+    "company": "INJOY",\
+    "email": "delaneycherry@injoy.com",\
+    "phone": "+1 (807) 463-2295",\
+    "address": "470 Hale Avenue, Mulberry, District Of Columbia, 5455",\
+    "about": "Deserunt sit cupidatat elit Lorem excepteur ex. Magna officia minim cupidatat nulla enim deserunt. Amet ex in tempor commodo consequat non ad qui elit cupidatat esse labore sint.",\
+    "registered": "2014-03-27T23:06:33 -01:00",\
+    "latitude": -4.984238,\
+    "longitude": 116.039285,\
+    "tags": [\
+      "minim",\
+      "velit",\
+      "aute",\
+      "minim",\
+      "id",\
+      "enim",\
+      "enim"\
+    ],\
+    "friends": [\
+      {\
+        "id": 0,\
+        "name": "Barrera Flowers"\
+      },\
+      {\
+        "id": 1,\
+        "name": "Leann Larson"\
+      },\
+      {\
+        "id": 2,\
+        "name": "Latoya Petty"\
+      }\
+    ],\
+    "greeting": "Hello, Delaney Cherry! You have 2 unread messages.",\
+    "favoriteFruit": "strawberry"\
+  },\
+  {\
+    "_id": "54ca3417920666f00c54bfc4",\
+    "index": 2,\
+    "guid": "f91e08f8-1598-49bc-a08b-bb48f0cc1751",\
+    "isActive": true,\
+    "balance": "$2,932.84",\
+    "picture": "http://placehold.it/32x32",\
+    "age": 28,\
+    "eyeColor": "brown",\
+    "name": "Mosley Hammond",\
+    "gender": "male",\
+    "company": "AQUACINE",\
+    "email": "mosleyhammond@aquacine.com",\
+    "phone": "+1 (836) 598-2591",\
+    "address": "879 Columbia Place, Seymour, Montana, 4897",\
+    "about": "Sunt laborum incididunt et elit in deserunt deserunt irure enim ea qui non. Minim nisi sint aute veniam reprehenderit veniam reprehenderit. Elit enim eu voluptate eu cupidatat nulla ea incididunt exercitation voluptate ut aliquip excepteur ipsum. Consequat anim fugiat irure Lorem anim consectetur est.",\
+    "registered": "2014-07-27T05:05:58 -02:00",\
+    "latitude": -43.608015,\
+    "longitude": -38.33894,\
+    "tags": [\
+      "proident",\
+      "incididunt",\
+      "eiusmod",\
+      "anim",\
+      "consectetur",\
+      "qui",\
+      "excepteur"\
+    ],\
+    "friends": [\
+      {\
+        "id": 0,\
+        "name": "Hanson Davidson"\
+      },\
+      {\
+        "id": 1,\
+        "name": "Autumn Kaufman"\
+      },\
+      {\
+        "id": 2,\
+        "name": "Tammy Foley"\
+      }\
+    ],\
+    "greeting": "Hello, Mosley Hammond! You have 4 unread messages.",\
+    "favoriteFruit": "apple"\
+  },\
+  {\
+    "_id": "54ca341753b67572a2b04935",\
+    "index": 3,\
+    "guid": "3377416b-43a2-4f9e-ada3-2479e13b44b8",\
+    "isActive": false,\
+    "balance": "$3,821.54",\
+    "picture": "http://placehold.it/32x32",\
+    "age": 31,\
+    "eyeColor": "green",\
+    "name": "Mueller Barrett",\
+    "gender": "male",\
+    "company": "GROK",\
+    "email": "muellerbarrett@grok.com",\
+    "phone": "+1 (890) 535-2834",\
+    "address": "571 Norwood Avenue, Westwood, Arkansas, 2164",\
+    "about": "Occaecat est sunt commodo ut ex excepteur elit nulla velit minim commodo commodo esse. Lorem quis eu minim consectetur. Cupidatat cupidatat consequat sit eu ex non quis nulla veniam sint enim excepteur. Consequat minim duis do do minim fugiat minim elit laborum ut velit. Occaecat laboris veniam sint reprehenderit.",\
+    "registered": "2014-07-18T17:15:35 -02:00",\
+    "latitude": 10.746577,\
+    "longitude": -160.266041,\
+    "tags": [\
+      "reprehenderit",\
+      "veniam",\
+      "sint",\
+      "commodo",\
+      "exercitation",\
+      "cillum",\
+      "sunt"\
+    ],\
+    "friends": [\
+      {\
+        "id": 0,\
+        "name": "Summers Finch"\
+      },\
+      {\
+        "id": 1,\
+        "name": "Tracie Mcdaniel"\
+      },\
+      {\
+        "id": 2,\
+        "name": "Ayers Patrick"\
+      }\
+    ],\
+    "greeting": "Hello, Mueller Barrett! You have 7 unread messages.",\
+    "favoriteFruit": "apple"\
+  },\
+  {\
+    "_id": "54ca34172775ab9615db0d1d",\
+    "index": 4,\
+    "guid": "a3102a3e-3f08-4df3-b5b5-62eff985d5ca",\
+    "isActive": true,\
+    "balance": "$3,962.27",\
+    "picture": "http://placehold.it/32x32",\
+    "age": 34,\
+    "eyeColor": "green",\
+    "name": "Patrick Foster",\
+    "gender": "male",\
+    "company": "QUAREX",\
+    "email": "patrickfoster@quarex.com",\
+    "phone": "+1 (805) 577-2362",\
+    "address": "640 Richards Street, Roberts, American Samoa, 5530",\
+    "about": "Aute occaecat occaecat ad eiusmod esse aliqua ullamco minim. Exercitation aute ut ex nostrud deserunt laboris officia amet enim do. Cillum officia laborum occaecat eiusmod reprehenderit ex et aliqua minim elit ex aliqua mollit. Occaecat dolor in fugiat laboris aliquip nisi ad voluptate duis eiusmod ad do.",\
+    "registered": "2014-07-22T16:45:35 -02:00",\
+    "latitude": 6.609025,\
+    "longitude": -5.357026,\
+    "tags": [\
+      "ea",\
+      "ut",\
+      "excepteur",\
+      "enim",\
+      "ad",\
+      "non",\
+      "sit"\
+    ],\
+    "friends": [\
+      {\
+        "id": 0,\
+        "name": "Duncan Lewis"\
+      },\
+      {\
+        "id": 1,\
+        "name": "Alyce Benton"\
+      },\
+      {\
+        "id": 2,\
+        "name": "Angelique Larsen"\
+      }\
+    ],\
+    "greeting": "Hello, Patrick Foster! You have 1 unread messages.",\
+    "favoriteFruit": "strawberry"\
+  },\
+  {\
+    "_id": "54ca3417a190f26fef815f6d",\
+    "index": 5,\
+    "guid": "c09663dd-bb0e-45a4-960c-232c0e8a9486",\
+    "isActive": false,\
+    "balance": "$1,871.12",\
+    "picture": "http://placehold.it/32x32",\
+    "age": 20,\
+    "eyeColor": "blue",\
+    "name": "Foreman Chaney",\
+    "gender": "male",\
+    "company": "DEMINIMUM",\
+    "email": "foremanchaney@deminimum.com",\
+    "phone": "+1 (966) 523-2182",\
+    "address": "960 Granite Street, Sunnyside, Tennessee, 1097",\
+    "about": "Adipisicing nisi qui id sit incididunt aute exercitation veniam consequat ipsum sit irure. Aute officia commodo Lorem consequat. Labore exercitation consequat voluptate deserunt consequat do est fugiat nisi eu dolor minim id ea.",\
+    "registered": "2015-01-21T00:18:00 -01:00",\
+    "latitude": -69.841726,\
+    "longitude": 121.809383,\
+    "tags": [\
+      "laboris",\
+      "sunt",\
+      "exercitation",\
+      "enim",\
+      "anim",\
+      "excepteur",\
+      "tempor"\
+    ],\
+    "friends": [\
+      {\
+        "id": 0,\
+        "name": "Espinoza Johnston"\
+      },\
+      {\
+        "id": 1,\
+        "name": "Doreen Holder"\
+      },\
+      {\
+        "id": 2,\
+        "name": "William Ellison"\
+      }\
+    ],\
+    "greeting": "Hello, Foreman Chaney! You have 5 unread messages.",\
+    "favoriteFruit": "strawberry"\
+  }\
+]';
+
+for (var i = 0; i < 100; i++) {
+    bench();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8062141.js	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,91 @@
+/*
+ * 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.
+ * 
+ * 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.
+ */
+
+/**
+ * JDK-8062141: Various performance issues parsing JSON
+ *
+ * @test
+ * @run
+ */
+
+function testJson(json) {
+    try {
+        print(JSON.stringify(JSON.parse(json)));
+    } catch (error) {
+        print(error);
+    }
+}
+
+testJson('"\\u003f"');
+testJson('"\\u0"');
+testJson('"\\u0"');
+testJson('"\\u00"');
+testJson('"\\u003"');
+testJson('"\\u003x"');
+testJson('"\\"');
+testJson('"');
+testJson('+1');
+testJson('-1');
+testJson('1.');
+testJson('.1');
+testJson('01');
+testJson('1e');
+testJson('1e0');
+testJson('1a');
+testJson('1e+');
+testJson('1e-');
+testJson('0.0e+0');
+testJson('0.0e-0');
+testJson('[]');
+testJson('[ 1 ]');
+testJson('[1,]');
+testJson('[ 1 , 2 ]');
+testJson('[1, 2');
+testJson('{}');
+testJson('{ "a" : "b" }');
+testJson('{ "a" : "b" ');
+testJson('{ "a" : }');
+testJson('true');
+testJson('tru');
+testJson('true1');
+testJson('false');
+testJson('fals');
+testJson('falser');
+testJson('null');
+testJson('nul');
+testJson('null0');
+testJson('{} 0');
+testJson('{} a');
+testJson('[] 0');
+testJson('[] a');
+testJson('1 0');
+testJson('1 a');
+testJson('["a":true]');
+testJson('{"a",truer}');
+testJson('{"a":truer}');
+testJson('[1, 2, 3]');
+testJson('[9223372036854774000, 9223372036854775000, 9223372036854776000]');
+testJson('[1.1, 1.2, 1.3]');
+testJson('[1, 1.2, 9223372036854776000, null, true]');
+testJson('{ "a" : "string" , "b": 1 , "c" : 1.2 , "d" : 9223372036854776000 , "e" : null , "f" : true }');
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8062141.js.EXPECTED	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,120 @@
+"?"
+SyntaxError: Invalid JSON: <json>:1:4 Invalid hex digit
+"\u0"
+    ^
+SyntaxError: Invalid JSON: <json>:1:4 Invalid hex digit
+"\u0"
+    ^
+SyntaxError: Invalid JSON: <json>:1:5 Invalid hex digit
+"\u00"
+     ^
+SyntaxError: Invalid JSON: <json>:1:6 Invalid hex digit
+"\u003"
+      ^
+SyntaxError: Invalid JSON: <json>:1:6 Invalid hex digit
+"\u003x"
+      ^
+SyntaxError: Invalid JSON: <json>:1:3 Missing close quote
+"\"
+   ^
+SyntaxError: Invalid JSON: <json>:1:1 Missing close quote
+"
+ ^
+SyntaxError: Invalid JSON: <json>:1:0 Expected json literal but found +
++1
+^
+-1
+SyntaxError: Invalid JSON: <json>:1:2 Invalid JSON number format
+1.
+  ^
+SyntaxError: Invalid JSON: <json>:1:0 Invalid JSON number format
+.1
+^
+SyntaxError: Invalid JSON: <json>:1:1 Expected eof but found 1
+01
+ ^
+SyntaxError: Invalid JSON: <json>:1:2 Invalid JSON number format
+1e
+  ^
+1
+SyntaxError: Invalid JSON: <json>:1:1 Expected eof but found a
+1a
+ ^
+SyntaxError: Invalid JSON: <json>:1:3 Invalid JSON number format
+1e+
+   ^
+SyntaxError: Invalid JSON: <json>:1:3 Invalid JSON number format
+1e-
+   ^
+0
+0
+[]
+[1]
+SyntaxError: Invalid JSON: <json>:1:3 Trailing comma is not allowed in JSON
+[1,]
+   ^
+[1,2]
+SyntaxError: Invalid JSON: <json>:1:5 Expected , or ] but found eof
+[1, 2
+     ^
+{}
+{"a":"b"}
+SyntaxError: Invalid JSON: <json>:1:12 Expected , or } but found eof
+{ "a" : "b" 
+            ^
+SyntaxError: Invalid JSON: <json>:1:8 Expected json literal but found }
+{ "a" : }
+        ^
+true
+SyntaxError: Invalid JSON: <json>:1:0 Expected json literal but found ident
+tru
+^
+SyntaxError: Invalid JSON: <json>:1:4 Expected eof but found 1
+true1
+    ^
+false
+SyntaxError: Invalid JSON: <json>:1:0 Expected json literal but found ident
+fals
+^
+SyntaxError: Invalid JSON: <json>:1:5 Expected eof but found r
+falser
+     ^
+null
+SyntaxError: Invalid JSON: <json>:1:0 Expected json literal but found ident
+nul
+^
+SyntaxError: Invalid JSON: <json>:1:4 Expected eof but found 0
+null0
+    ^
+SyntaxError: Invalid JSON: <json>:1:3 Expected eof but found 0
+{} 0
+   ^
+SyntaxError: Invalid JSON: <json>:1:3 Expected eof but found a
+{} a
+   ^
+SyntaxError: Invalid JSON: <json>:1:3 Expected eof but found 0
+[] 0
+   ^
+SyntaxError: Invalid JSON: <json>:1:3 Expected eof but found a
+[] a
+   ^
+SyntaxError: Invalid JSON: <json>:1:2 Expected eof but found 0
+1 0
+  ^
+SyntaxError: Invalid JSON: <json>:1:2 Expected eof but found a
+1 a
+  ^
+SyntaxError: Invalid JSON: <json>:1:4 Expected , or ] but found :
+["a":true]
+    ^
+SyntaxError: Invalid JSON: <json>:1:4 Expected : but found ,
+{"a",truer}
+    ^
+SyntaxError: Invalid JSON: <json>:1:9 Expected , or } but found r
+{"a":truer}
+         ^
+[1,2,3]
+[9223372036854773800,9223372036854774800,9223372036854776000]
+[1.1,1.2,1.3]
+[1,1.2,9223372036854776000,null,true]
+{"a":"string","b":1,"c":1.2,"d":9223372036854776000,"e":null,"f":true}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8068872.js	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ * 
+ * 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.
+ */
+
+/**
+ * JDK-8068872:  Nashorn JSON.parse drops numeric keys
+ *
+ * @test
+ * @run
+ */
+
+print(JSON.stringify(JSON.parse('{"3": 1, "5": "a"}')));
+print(JSON.stringify(JSON.parse('{"5": 1, "3": "a"}')));
+print(JSON.stringify(JSON.parse('{"0": 1, "4294967294": "a"}')));
+print(JSON.stringify(JSON.parse('{"4294967294": 1, "0": "a"}')));
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8068872.js.EXPECTED	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,4 @@
+{"3":1,"5":"a"}
+{"3":"a","5":1}
+{"0":1,"4294967294":"a"}
+{"0":"a","4294967294":1}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8072596.js	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,69 @@
+/*
+ * 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.
+ * 
+ * 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.
+ */
+
+/**
+ * JDK-8072596: Arrays.asList results in ClassCastException with a JS array
+ *
+ * @test
+ * @run
+ */
+var arr = java.util.Arrays.asList("hello world".split(' '));
+// We split it into a list of two elements: [hello, world]
+Assert.assertTrue(arr instanceof java.util.List);
+Assert.assertEquals(arr.length, 2);
+Assert.assertEquals(arr[0], "hello");
+Assert.assertEquals(arr[1], "world");
+
+var Jdk8072596TestSubject = Java.type("jdk.nashorn.test.models.Jdk8072596TestSubject");
+var testSubject = new Jdk8072596TestSubject({bar: 0});
+testSubject.test1(true, {foo: 1}, {bar: 2});
+testSubject.test2(true, {foo: 1}, {bar: 2}, {baz: 3}, {bing: 4});
+var h = "h";
+var ello = "ello";
+testSubject.test3(true, {foo: 5}, /* ConsString, why not */ h + ello, [6, 7], 8);
+Jdk8072596TestSubject.test4({foo: 9});
+
+// Test wrapping setters arguments and unwrapping getters return values on list.
+var list = new java.util.ArrayList();
+list.add(null);
+var obj0 = {valueOf: function() { return 0; }};
+var obj1 = {foo: 10};
+list[obj0] = obj1;
+testSubject.testListHasWrappedObject(list);
+// NOTE: can't use Assert.assertSame(obj1, list[obj0]), as the arguments would end up being wrapped...
+Assert.assertTrue(obj1 === list[obj0]);
+
+// Test wrapping setters arguments and unwrapping getters return values on array.
+var arr2 = new (Java.type("java.lang.Object[]"))(1);
+var obj2 = {bar: 11};
+arr2[obj0] = obj2;
+testSubject.testArrayHasWrappedObject(arr2);
+Assert.assertTrue(obj2 === arr2[obj0]);
+
+// Test wrapping setters index and arguments and getters index, and unwrapping getters return values on map.
+// Since ScriptObjectMirror.equals() uses underlying ScriptObject identity, using them as map keys works.
+var map = new java.util.HashMap();
+var obj3 = {bar: 12};
+map[obj0] = obj3;
+testSubject.testMapHasWrappedObject(map, obj0);
+Assert.assertTrue(obj3 === map[obj0]);
--- a/nashorn/test/script/basic/NASHORN-623.js.EXPECTED	Wed Feb 18 22:19:47 2015 -0500
+++ b/nashorn/test/script/basic/NASHORN-623.js.EXPECTED	Mon Feb 23 05:01:11 2015 -0800
@@ -1,3 +1,3 @@
-SyntaxError: Invalid JSON: <json>:1:12 Expected number but found ident
+SyntaxError: Invalid JSON: <json>:1:11 Invalid JSON number format
 { "test" : -xxx }
-            ^
+           ^
--- a/nashorn/test/src/jdk/nashorn/api/scripting/ScopeTest.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/nashorn/test/src/jdk/nashorn/api/scripting/ScopeTest.java	Mon Feb 23 05:01:11 2015 -0800
@@ -706,4 +706,74 @@
         }
     }
 
+    // @bug 8071678: NashornScriptEngine returns javax.script.ScriptContext instance
+    // with get/setAttribute methods insonsistent for GLOBAL_SCOPE
+    @Test
+    public void testGlobalScopeSearch() throws Exception {
+        final ScriptEngineManager m = new ScriptEngineManager();
+        final ScriptEngine e = m.getEngineByName("nashorn");
+        final ScriptContext c = e.getContext();
+        c.setAttribute("name1234", "value", ScriptContext.GLOBAL_SCOPE);
+        assertEquals(c.getAttribute("name1234"), "value");
+        assertEquals(c.getAttributesScope("name1234"),
+            ScriptContext.GLOBAL_SCOPE);
+    }
+
+    // @bug 8071594: NashornScriptEngine returns javax.script.ScriptContext instance
+    // which doesn't completely conform to the spec regarding exceptions throwing
+    @Test
+    public void testScriptContext_NPE_IAE() throws Exception {
+        final ScriptEngineManager m = new ScriptEngineManager();
+        final ScriptEngine e = m.getEngineByName("nashorn");
+        final ScriptContext c = e.getContext();
+        try {
+            c.getAttribute("");
+            throw new AssertionError("should have thrown IAE");
+        } catch (IllegalArgumentException iae1) {}
+
+        try {
+            c.getAttribute(null);
+            throw new AssertionError("should have thrown NPE");
+        } catch (NullPointerException npe1) {}
+
+        try {
+            c.getAttribute("", ScriptContext.ENGINE_SCOPE);
+            throw new AssertionError("should have thrown IAE");
+        } catch (IllegalArgumentException iae2) {}
+
+        try {
+            c.getAttribute(null, ScriptContext.ENGINE_SCOPE);
+            throw new AssertionError("should have thrown NPE");
+        } catch (NullPointerException npe2) {}
+
+        try {
+            c.removeAttribute("", ScriptContext.ENGINE_SCOPE);
+            throw new AssertionError("should have thrown IAE");
+        } catch (IllegalArgumentException iae3) {}
+
+        try {
+            c.removeAttribute(null, ScriptContext.ENGINE_SCOPE);
+            throw new AssertionError("should have thrown NPE");
+        } catch (NullPointerException npe3) {}
+
+        try {
+            c.setAttribute("", "value", ScriptContext.ENGINE_SCOPE);
+            throw new AssertionError("should have thrown IAE");
+        } catch (IllegalArgumentException iae4) {}
+
+        try {
+            c.setAttribute(null, "value", ScriptContext.ENGINE_SCOPE);
+            throw new AssertionError("should have thrown NPE");
+        } catch (NullPointerException npe4) {}
+
+        try {
+            c.getAttributesScope("");
+            throw new AssertionError("should have thrown IAE");
+        } catch (IllegalArgumentException iae5) {}
+
+        try {
+            c.getAttributesScope(null);
+            throw new AssertionError("should have thrown NPE");
+        } catch (NullPointerException npe5) {}
+    }
 }
--- a/nashorn/test/src/jdk/nashorn/api/scripting/ScriptEngineTest.java	Wed Feb 18 22:19:47 2015 -0500
+++ b/nashorn/test/src/jdk/nashorn/api/scripting/ScriptEngineTest.java	Mon Feb 23 05:01:11 2015 -0800
@@ -721,6 +721,15 @@
         assertTrue(invoked.get());
     }
 
+    @Test
+    public void testLengthOnArrayLikeObjects() throws Exception {
+        final ScriptEngine e = new ScriptEngineManager().getEngineByName("nashorn");
+        final Object val = e.eval("var arr = { length: 1, 0: 1}; arr.length");
+
+        assertTrue(Number.class.isAssignableFrom(val.getClass()));
+        assertTrue(((Number)val).intValue() == 1);
+    }
+
     // @bug JDK-8068603: NashornScriptEngine.put/get() impls don't conform to NPE, IAE spec assertions
     @Test
     public void illegalBindingsValuesTest() throws Exception {
@@ -843,6 +852,17 @@
         }
     }
 
+    // @bug 8071989: NashornScriptEngine returns javax.script.ScriptContext instance
+    // with insonsistent get/remove methods behavior for undefined attributes
+    @Test
+    public void testScriptContextGetRemoveUndefined() throws Exception {
+        final ScriptEngineManager manager = new ScriptEngineManager();
+        final ScriptEngine e = manager.getEngineByName("nashorn");
+        final ScriptContext ctx = e.getContext();
+        assertNull(ctx.getAttribute("undefinedname", ScriptContext.ENGINE_SCOPE));
+        assertNull(ctx.removeAttribute("undefinedname", ScriptContext.ENGINE_SCOPE));
+    }
+
     private static void checkProperty(final ScriptEngine e, final String name)
         throws ScriptException {
         final String value = System.getProperty(name);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/src/jdk/nashorn/test/models/Jdk8072596TestSubject.java	Mon Feb 23 05:01:11 2015 -0800
@@ -0,0 +1,106 @@
+/*
+ * 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 jdk.nashorn.test.models;
+
+import java.util.List;
+import java.util.Map;
+import jdk.nashorn.api.scripting.ScriptObjectMirror;
+import jdk.nashorn.internal.runtime.ScriptObject;
+import org.testng.Assert;
+
+public class Jdk8072596TestSubject {
+
+    public Jdk8072596TestSubject(final Object x) {
+        Assert.assertTrue(x instanceof ScriptObjectMirror);
+        Assert.assertEquals(((ScriptObjectMirror)x).get("bar"), 0);
+    }
+
+    // Test having to wrap some arguments but not others
+    public void test1(final String x, final Object y, final ScriptObject w) {
+        Assert.assertEquals(x, "true");
+
+        Assert.assertTrue(y instanceof ScriptObjectMirror);
+        Assert.assertEquals(((ScriptObjectMirror)y).get("foo"), 1);
+
+        Assert.assertEquals(w.get("bar"), 2);
+    }
+
+    // Test having to wrap some arguments but not others, and a vararg array
+    public void test2(String x, final Object y, final ScriptObject w, final Object... z) {
+        test1(x, y, w);
+
+        Assert.assertEquals(z.length, 2);
+
+        Assert.assertTrue(z[0] instanceof ScriptObjectMirror);
+        Assert.assertEquals(((ScriptObjectMirror)z[0]).get("baz"), 3);
+
+        Assert.assertTrue(z[1] instanceof ScriptObjectMirror);
+        Assert.assertEquals(((ScriptObjectMirror)z[1]).get("bing"), 4);
+    }
+
+    // Test mixed (wrappable and non-wrappable) elements in a vararg array
+    public void test3(final Object... z) {
+        Assert.assertEquals(z.length, 5);
+
+        Assert.assertEquals(z[0], true);
+
+        Assert.assertTrue(z[1] instanceof ScriptObjectMirror);
+        Assert.assertEquals(((ScriptObjectMirror)z[1]).get("foo"), 5);
+
+        Assert.assertEquals(z[2], "hello");
+
+        Assert.assertTrue(z[3] instanceof ScriptObjectMirror);
+        Assert.assertEquals(((ScriptObjectMirror)z[3]).getSlot(0), 6);
+        Assert.assertEquals(((ScriptObjectMirror)z[3]).getSlot(1), 7);
+
+        Assert.assertEquals(z[4], 8);
+    }
+
+    // test wrapping the first argument of a static method
+    public static void test4(final Object x) {
+        Assert.assertTrue(x instanceof ScriptObjectMirror);
+        Assert.assertEquals(((ScriptObjectMirror)x).get("foo"), 9);
+    }
+
+    public void testListHasWrappedObject(final List<?> l) {
+        Assert.assertEquals(l.size(), 1);
+        Assert.assertTrue(l.get(0) instanceof ScriptObjectMirror);
+        Assert.assertEquals(((ScriptObjectMirror)l.get(0)).get("foo"), 10);
+    }
+
+    public void testArrayHasWrappedObject(final Object[] a) {
+        Assert.assertEquals(a.length, 1);
+        Assert.assertTrue(a[0] instanceof ScriptObjectMirror);
+        Assert.assertEquals(((ScriptObjectMirror)a[0]).get("bar"), 11);
+    }
+
+    public void testMapHasWrappedObject(final Map<?, ?> m, final Object key) {
+        Assert.assertEquals(m.size(), 1);
+        Assert.assertTrue(key instanceof ScriptObjectMirror);
+        Assert.assertTrue(m.get(key) instanceof ScriptObjectMirror);
+        Assert.assertEquals(((ScriptObjectMirror)m.get(key)).get("bar"), 12);
+    }
+}