changeset 7009:9b734892dae6

Merge
author asaha
date Fri, 21 Jun 2013 19:11:42 -0700
parents e6e9f510b6f2 (current diff) 60d52db33828 (diff)
children 434ca5ec5a3b
files .hgtags make/com/sun/servicetag/Makefile make/sun/rmi/rmi/mapfile-vers src/share/classes/com/sun/servicetag/BrowserSupport.java src/share/classes/com/sun/servicetag/Installer.java src/share/classes/com/sun/servicetag/LinuxSystemEnvironment.java src/share/classes/com/sun/servicetag/RegistrationData.java src/share/classes/com/sun/servicetag/RegistrationDocument.java src/share/classes/com/sun/servicetag/Registry.java src/share/classes/com/sun/servicetag/ServiceTag.java src/share/classes/com/sun/servicetag/SolarisServiceTag.java src/share/classes/com/sun/servicetag/SolarisSystemEnvironment.java src/share/classes/com/sun/servicetag/SunConnection.java src/share/classes/com/sun/servicetag/SystemEnvironment.java src/share/classes/com/sun/servicetag/UnauthorizedAccessException.java src/share/classes/com/sun/servicetag/Util.java src/share/classes/com/sun/servicetag/WindowsSystemEnvironment.java src/share/classes/com/sun/servicetag/package.html src/share/classes/com/sun/servicetag/resources/Putback-Notes.txt src/share/classes/com/sun/servicetag/resources/javase_5_swordfish.properties src/share/classes/com/sun/servicetag/resources/javase_6_swordfish.properties src/share/classes/com/sun/servicetag/resources/javase_7_swordfish.properties src/share/classes/com/sun/servicetag/resources/jdk_header.png src/share/classes/com/sun/servicetag/resources/product_registration.xsd src/share/classes/com/sun/servicetag/resources/register.html src/share/classes/com/sun/servicetag/resources/register_ja.html src/share/classes/com/sun/servicetag/resources/register_zh_CN.html src/share/classes/java/beans/MetaData.java src/share/classes/java/beans/ReflectionUtils.java src/share/classes/java/lang/invoke/AdapterMethodHandle.java src/share/classes/java/lang/invoke/CountingMethodHandle.java src/share/classes/java/lang/invoke/FilterGeneric.java src/share/classes/java/lang/invoke/FilterOneArgument.java src/share/classes/java/lang/invoke/FromGeneric.java src/share/classes/java/lang/invoke/SpreadGeneric.java src/share/classes/java/lang/invoke/ToGeneric.java src/share/classes/javax/swing/JTable.java src/share/classes/sun/swing/SwingUtilities2.java src/share/classes/sun/tools/jconsole/resources/JConsoleResources.java src/share/classes/sun/tools/jconsole/resources/JConsoleResources_ja.java src/share/classes/sun/tools/jconsole/resources/JConsoleResources_zh_CN.java src/share/lib/security/java.security src/share/native/sun/rmi/server/MarshalInputStream.c test/com/sun/jndi/ldap/LdapsReadTimeoutTest.java test/com/sun/jndi/ldap/ReadTimeoutTest.java test/com/sun/servicetag/DeleteServiceTag.java test/com/sun/servicetag/DuplicateNotFound.java test/com/sun/servicetag/FindServiceTags.java test/com/sun/servicetag/InstanceUrnCheck.java test/com/sun/servicetag/InvalidRegistrationData.java test/com/sun/servicetag/InvalidServiceTag.java test/com/sun/servicetag/JavaServiceTagTest.java test/com/sun/servicetag/JavaServiceTagTest1.java test/com/sun/servicetag/NewRegistrationData.java test/com/sun/servicetag/SvcTagClient.java test/com/sun/servicetag/SystemRegistryTest.java test/com/sun/servicetag/TestLoadFromXML.java test/com/sun/servicetag/UpdateServiceTagTest.java test/com/sun/servicetag/Util.java test/com/sun/servicetag/ValidRegistrationData.java test/com/sun/servicetag/environ.properties test/com/sun/servicetag/missing-environ-field.xml test/com/sun/servicetag/newer-registry-version.xml test/com/sun/servicetag/registration.xml test/com/sun/servicetag/servicetag1.properties test/com/sun/servicetag/servicetag2.properties test/com/sun/servicetag/servicetag3.properties test/com/sun/servicetag/servicetag4.properties test/com/sun/servicetag/servicetag5.properties test/java/awt/Focus/OverrideRedirectWindowActivationTest/OverrideRedirectWindowActivationTest.java test/java/awt/Mouse/EnterExitEvents/DragWindowTest.java test/java/io/File/isDirectory/Applet.html test/java/io/Serializable/accessConstants/AccessConstants.java test/sun/net/www/messageheader/0 test/sun/net/www/messageheader/1 test/sun/net/www/messageheader/2 test/sun/net/www/messageheader/3 test/sun/net/www/messageheader/4 test/sun/net/www/messageheader/5 test/sun/net/www/messageheader/6 test/sun/net/www/messageheader/HTest.java test/sun/nio/cs/OLD/TestX11CS.java test/sun/security/ssl/com/sun/net/ssl/internal/ssl/InputRecord/InterruptedIO.java test/sun/tools/jconsole/ImmutableResourceTest.java test/sun/tools/jconsole/ImmutableResourceTest.sh
diffstat 1006 files changed, 42098 insertions(+), 31021 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Wed Jun 19 21:51:50 2013 -0700
+++ b/.hgtags	Fri Jun 21 19:11:42 2013 -0700
@@ -240,6 +240,30 @@
 cbbb166b38eb15f5d5c68e913ee18f6f352b7af0 jdk7u13-b10
 28700a56b69d80e70aecf230ab7f9ad4bb5acf23 jdk7u13-b30
 8eb180a284b0911b2645d5cbdff5be499a75d6b2 jdk7u13-b20
+df945ef30444adf08f3ef14b0c49c8bda6dda587 jdk7u8-b01
+dd1e513c05b8b8c8402e9ecf9c0d5bdbebb1a089 jdk7u8-b02
+355cf1937d0824b54ac38ee5a5496197647840f9 jdk7u8-b03
+d099fc840e6c0f07e7b6f52d11fae98ae217bc9a jdk7u8-b04
+1c3a91a1dabdcd7e4407f9e7be08718339eafaad jdk7u8-b05
+147401296df6355464007cfb16f76dfe4d6b9fa6 jdk7u10-b06
+fd190f90dc174c89f1bc447aab800f4eb99edda5 jdk7u10-b07
+cd32baf1524847463bab29b83b9fe33740a37313 jdk7u10-b08
+a5b1c01d1929f6b3e9d49e70db3d0263e11c9ab4 jdk7u10-b09
+448626eae40d303a2627a0b3613a98d32d4419f1 jdk7u12-b01
+c49b6f0315799a9deadf8f4661c67ed2dd1bfcfb jdk7u12-b02
+c4f6412aa2dee96cb209b37a0c6ebb4bea482d2c jdk7u12-b03
+0d25ad745892a146e8e4e1fb7caeeee7739b7019 jdk7u12-b04
+fdd0d43ba0f9c3f58959e2de7d1958f771d84565 jdk7u12-b05
+b5449e3dcf1f317002840dc5c2093be47c60fe8c jdk7u12-b06
+cb81ee79a72d84f99b8e7d73b5ae73124b661fe7 jdk7u12-b07
+b5e180ef18a0c823675bcd32edfbf2f5122d9722 jdk7u12-b08
+2e7fe0208e9c928f2f539fecb6dc8a1401ecba9e jdk7u12-b09
+e012aace90500a88f51ce83fcd27791f5dbf493f jdk7u14-b10
+9eb82fb221f3b34a5df97e7db3c949fdb0b6fee0 jdk7u14-b11
+ee3ab2ed2371dd72ad5a75ebb6b6b69071e29390 jdk7u14-b12
+7c0d4bfd9d2c183ebf8566013af5111927b472f6 jdk7u14-b13
+3982fc37bc256b07a710f25215e5525cfbefe2ed jdk7u14-b14
+2eb3ac105b7fe7609a20c9986ecbccab71f1609f jdk7u14-b15
 835448d525a10bb826f4f7ebe272fc410bdb0f5d jdk7u15-b01
 0443fe2d8023111b52f4c8db32e038f4a5a9f373 jdk7u15-b02
 70b0f967c0649c501fb14a27bb06daeccbff823a jdk7u15-b30
@@ -281,4 +305,20 @@
 e1768e2070c938ec97325ad48b0d281e3031a29c jdk7u25-b15
 0d68732acbd4b6669512b1d2be496a9e391795a9 jdk7u25-b30
 173b399abd8aa2e4fdc0066c977719670d180125 jdk7u25-b16
+555ea0c4e9567294d37793777d521902d43f1a39 jdk7u14-b16
+950fa827c2ec8a3a1ceba755994ae59016daa621 jdk7u14-b17
+e7ba683c15009b166127c3437fe9fbaf4eee6efe jdk7u14-b18
+eb4807b899c84c92959b66f888f8cc8b028c7665 jdk7u14-b19
+eb4807b899c84c92959b66f888f8cc8b028c7665 jdk7u14-b19
+a249c45148c51dc53250c5d0c3d506ec5f9b88ab jdk7u14-b19
+bb8764ec11c2c4ca318bcf6aabdabd29c70b2cd1 jdk7u14-b20
+0a00f10abb2df203f13a723be158fb759e54b19b jdk7u14-b21
+d4bf5c15837c47d179c71f6df8716ad9bef53ef9 jdk7u14-b22
+a76a886dc057582bf332e60a023d8f8a35526217 jdk7u40-b23
+8e3d618505d33572c7b087f47e60818269f71475 jdk7u40-b24
+889f9b9f79b4ec9ea52754a1ad134ed92d4f9672 jdk7u40-b25
+ac03c48f1d82e0c8c1d5d72b8953be8aef558d87 jdk7u40-b26
+6ce66ba864780251fc44fff65358ef24f68ea51a jdk7u40-b27
+2043900095890e676f5ed0f959f470e2138c2a9a jdk7u40-b28
+d3186a0676dbc7ab80e00fa67f952b67933d5a35 jdk7u40-b29
 55f01444cf58c8004df9a9634c1bd7ff87caa370 jdk7u25-b32
--- a/make/altclasses/Makefile	Wed Jun 19 21:51:50 2013 -0700
+++ b/make/altclasses/Makefile	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+# 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
@@ -42,6 +42,7 @@
 ALTRT_JAR_FILE = $(LIBDIR)/alt-rt.jar
 ALTRT_JAR_SOURCE_FILE = $(TEMPDIR)/alt-rt.jarsrclist
 ALTRT_JAR_SOURCES = $(wildcard $(ALTCLASSES_SRCDIR)/java/*/*.java)
+ALTRT_JAR_SOURCES += $(wildcard $(ALTCLASSES_SRCDIR)/sun/misc/*.java)
 
 # Use a special file suffix for the file that holds the source list
 
--- a/make/com/oracle/jfr/Makefile	Wed Jun 19 21:51:50 2013 -0700
+++ b/make/com/oracle/jfr/Makefile	Fri Jun 21 19:11:42 2013 -0700
@@ -42,6 +42,11 @@
 
 AUTO_FILES_JAVA_DIRS = com/oracle/jrockit/jfr oracle/jrockit/jfr
 
+JFC_XSD = oracle/jrockit/jfr/settings/jfc.xsd
+JFC_XSD_SRC = $(CLOSED_SHARE_SRC)/classes/$(JFC_XSD)
+JFC_XSD_FILE = $(CLASSDESTDIR)/$(JFC_XSD)
+
+
 # Find C source files
 #
 vpath %.c $(CLOSED_SHARE_SRC)/native/oracle/jfr
@@ -59,15 +64,18 @@
 	$(RM) -r $(CLASSDESTDIR)/com/oracle/jrockit/jfr
 	$(RM) -r $(CLASSDESTDIR)/oracle/jrockit/jfr
 
-
-# Copy pre-shipped .jfs files
+# Copy pre-shipped .jfc files
 JFR_LIBDIR = $(LIBDIR)/jfr
-JFR_SRCDIR = $(CLOSED_SHARE_SRC)/lib/jfr
+JFC_SRCDIR = $(CLOSED_SHARE_SRC)/classes/oracle/jrockit/jfr/settings
 
-$(JFR_LIBDIR)/%.jfs: $(JFR_SRCDIR)/%.jfs
+$(JFR_LIBDIR)/%.jfc: $(JFC_SRCDIR)/%.jfc
 	$(install-file)
 
-JFS_FILES := $(subst $(JFR_SRCDIR),$(JFR_LIBDIR),$(wildcard $(JFR_SRCDIR)/*.jfs))
+JFC_FILES := $(subst $(JFC_SRCDIR),$(JFR_LIBDIR),$(wildcard $(JFC_SRCDIR)/*.jfc))
+
+-include ${JDK_TOPDIR}/make/closed/common/jfr.gmk
 
-all build : $(JFS_FILES)
+$(JFC_XSD_FILE) : $(JFC_XSD_SRC)
+	$(install-file)
 
+all build: $(JFC_FILES) $(JFC_XSD_FILE)
--- a/make/com/sun/Makefile	Wed Jun 19 21:51:50 2013 -0700
+++ b/make/com/sun/Makefile	Fri Jun 21 19:11:42 2013 -0700
@@ -45,7 +45,7 @@
 SUBDIRS_desktop    = image
 SUBDIRS_enterprise = crypto/provider jndi \
                      org rowset net/httpserver
-SUBDIRS_misc       = $(SCRIPT_SUBDIR) tracing servicetag nio demo
+SUBDIRS_misc       = $(SCRIPT_SUBDIR) tracing nio demo
 
 # Omit mirror since it's built with the apt tool.
 SUBDIRS_tools      = tools
--- a/make/com/sun/java/pack/Makefile	Wed Jun 19 21:51:50 2013 -0700
+++ b/make/com/sun/java/pack/Makefile	Fri Jun 21 19:11:42 2013 -0700
@@ -75,8 +75,8 @@
   OTHER_CXXFLAGS += $(ZINCLUDE)
   LDDFLAGS += $(ZIPOBJS)
  else
-  LDDFLAGS += -lz
-  OTHER_CXXFLAGS += -DSYSTEM_ZLIB
+  LDDFLAGS += $(ZLIB_LIBS)
+  OTHER_CXXFLAGS += $(ZLIB_CFLAGS) -DSYSTEM_ZLIB
  endif
 else
   OTHER_CXXFLAGS += -DNO_ZLIB -DUNPACK_JNI
--- a/make/com/sun/security/Makefile	Wed Jun 19 21:51:50 2013 -0700
+++ b/make/com/sun/security/Makefile	Fri Jun 21 19:11:42 2013 -0700
@@ -31,7 +31,7 @@
 include $(BUILDDIR)/common/Defs.gmk
 
 SUBDIRS = auth
-SUBDIRS_misc = jgss sasl auth/module
+SUBDIRS_misc = jgss sasl auth/module ntlm
 include $(BUILDDIR)/common/Subdirs.gmk
 
 all build clean clobber::
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/com/sun/security/ntlm/Makefile	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,39 @@
+#
+# 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.  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.
+#
+
+BUILDDIR = ../../../..
+PACKAGE = com.sun.security.ntlm
+PRODUCT = sun
+include $(BUILDDIR)/common/Defs.gmk
+
+#
+# Files
+#
+AUTO_FILES_JAVA_DIRS = com/sun/security/ntlm
+
+#
+# Rules
+#
+include $(BUILDDIR)/common/Classes.gmk
--- a/make/com/sun/servicetag/Makefile	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +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.
-
-BUILDDIR = ../../..
-PACKAGE = com.sun.servicetag
-PRODUCT = sun
-include $(BUILDDIR)/common/Defs.gmk
-
-#
-# Files to compile
-#
-AUTO_FILES_JAVA_DIRS = com/sun/servicetag
-
-#
-# Rules
-#
-include $(BUILDDIR)/common/Classes.gmk
-
-SERVICETAG_LIBDIR = $(LIBDIR)/servicetag
-SERVICETAG_RESOURCES_DIR = $(CLASSDESTDIR)/com/sun/servicetag/resources
-FILES_copy = $(SERVICETAG_RESOURCES_DIR)/product_registration.xsd \
-             $(SERVICETAG_RESOURCES_DIR)/register.html \
-             $(SERVICETAG_RESOURCES_DIR)/register_ja.html \
-             $(SERVICETAG_RESOURCES_DIR)/register_zh_CN.html \
-             $(SERVICETAG_LIBDIR)/jdk_header.png
-
-# Add all properties files to the FILES_copy list
-SWORDFISH_properties := $(shell \
-       $(CD) $(SHARE_SRC)/classes/com/sun/servicetag/resources; \
-       $(FIND) . -name 'javase_*_swordfish.properties' -print ; \
-    )
-FILES_copy += $(shell \
-   for f in $(SWORDFISH_properties) ; do \
-       echo $(SERVICETAG_RESOURCES_DIR)/$$f ; \
-   done \
-)
-
-
-#
-#OTHER_JAVACFLAGS += -Xlint:unchecked
-
-build: install-servicetag-lib copy-files
-
-copy-files: $(FILES_copy)
-
-$(CLASSBINDIR)/%: $(SHARE_SRC)/classes/%
-	$(install-file)
-
-$(SERVICETAG_LIBDIR)/jdk_header.png: $(SHARE_SRC)/classes/com/sun/servicetag/resources/jdk_header.png
-	$(install-file)
-	$(call chmod-file, 444)
-
-install-servicetag-lib:
-	@$(RM) -rf $(SERVICETAG_LIBDIR)
-	$(MKDIR) $(SERVICETAG_LIBDIR)
-
-clean clobber::
-	@$(RM) $(FILES_copy)
-
-.PHONY: copy-files
--- a/make/common/Defs-linux.gmk	Wed Jun 19 21:51:50 2013 -0700
+++ b/make/common/Defs-linux.gmk	Fri Jun 21 19:11:42 2013 -0700
@@ -112,21 +112,18 @@
 # since objcopy is optional, we set ZIP_DEBUGINFO_FILES later
 
 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
-  # Default OBJCOPY comes from GNU Binutils on Linux:
-  DEF_OBJCOPY=/usr/bin/objcopy
-  ifdef CROSS_COMPILE_ARCH
-    # don't try to generate .debuginfo files when cross compiling
-    _JUNK_ := $(shell \
-      echo >&2 "INFO: cross compiling for ARCH $(CROSS_COMPILE_ARCH)," \
-        "skipping .debuginfo generation.")
-    OBJCOPY=
+  ifndef CROSS_COMPILE_ARCH
+    # Default OBJCOPY comes from GNU Binutils on Linux:
+    DEF_OBJCOPY=/usr/bin/objcopy
   else
-    OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY))
-    ifneq ($(ALT_OBJCOPY),)
-      _JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)")
-      # disable .debuginfo support by setting ALT_OBJCOPY to a non-existent path
-      OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY))
-    endif
+    # Assume objcopy is part of the cross-compilation toolkit
+    DEF_OBJCOPY=$(COMPILER_PATH)/objcopy
+  endif
+  OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY))
+  ifneq ($(ALT_OBJCOPY),)
+    _JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)")
+    # disable .debuginfo support by setting ALT_OBJCOPY to a non-existent path
+    OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY))
   endif
 
   # Setting ENABLE_FULL_DEBUG_SYMBOLS=1 (and OBJCOPY) above enables the
@@ -138,7 +135,7 @@
 
   ifeq ($(OBJCOPY),)
     _JUNK_ := $(shell \
-      echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files.")
+      echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files. You may need to set ALT_OBJCOPY.")
     ENABLE_FULL_DEBUG_SYMBOLS=0
   else
     _JUNK_ := $(shell \
--- a/make/common/Defs-windows.gmk	Wed Jun 19 21:51:50 2013 -0700
+++ b/make/common/Defs-windows.gmk	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 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
@@ -433,40 +433,3 @@
             -d "JDK_COPYRIGHT=$(JDK_RC_COPYRIGHT)" \
             -d "JDK_NAME=$(JDK_RC_NAME)" \
             -d "JDK_FVER=$(JDK_RC_FVER)"
-
-# Enable 7-Zip LZMA file (de)compression for Java Kernel if it is available
-ifeq ($(ARCH_DATA_MODEL), 32)
-  ifneq ($(KERNEL), off)
-    # This is a hack to use until  7-Zip (and UPX) bundles can be put
-    # under /java/devtools.
-    ifndef DEPLOY_TOPDIR
-      DEPLOY_TOPDIR=$(JDK_TOPDIR)/../deploy
-    endif
-    # Uncomment this block to cause build failure if above assumption false
-    #DCHK = $(shell if [ ! -d $(DEPLOY_TOPDIR) ] ; then \
-    #  $(ECHO) deploy_not_a_peer_of_j2se ; \
-    #fi )
-    #ifeq ($(DCHK), deploy_not_a_peer_of_j2se)
-    #  If a build failure points to control coming here it means
-    #  it means deploy is not in the same directory
-    #  as j2se. Java Kernel can't tolerate that for the time being.
-    #endif
-    EC_TMP = $(shell if [ -d $(DEPLOY_TOPDIR)/make/lzma ] ; then \
-      $(ECHO) true ; \
-    else \
-      $(ECHO) false ; \
-    fi )
-    ifeq ($(EC_TMP), true)
-      EXTRA_COMP_INSTALL_PATH = lib\\\\deploy\\\\lzma.dll
-      # Crazy but true: deploy/make/plugin/jinstall/Makefile.jkernel does
-      # not include deploy/make/common/Defs-windows.gmk, either directly
-      # or indirectly. But it does include this file, so redundantly declare
-      # these variables that are in deploy/make/common/Defs-windows.gmk for
-      # the sake of the Java Kernel part of the deploy build. Whew!
-      EXTRA_COMP_LIB_NAME = lzma.dll
-      EXTRA_COMP_PATH = $(OUTPUTDIR)/tmp/deploy/lzma/win32/obj
-      EXTRA_COMP_CMD_PATH = $(EXTRA_COMP_PATH)/lzma.exe
-      EXTRA_COMP_LIB_PATH = $(EXTRA_COMP_PATH)/$(EXTRA_COMP_LIB_NAME)
-    endif
-  endif
-endif
--- a/make/common/Defs.gmk	Wed Jun 19 21:51:50 2013 -0700
+++ b/make/common/Defs.gmk	Fri Jun 21 19:11:42 2013 -0700
@@ -431,7 +431,12 @@
 # namely jni.h, jvm.h, and jni_utils.h, plus their platform-specific
 # relatives.
 #
-VPATH0.h =   $(PLATFORM_SRC)/javavm/export$(CLASSPATH_SEPARATOR)$(SHARE_SRC)/javavm/export
+ifeq ($(PLATFORM), macosx)
+  VPATH0.h =   $(PLATFORM_SRC_MACOS)/javavm/export$(CLASSPATH_SEPARATOR)$(SHARE_SRC)/javavm/export
+else
+  VPATH0.h =   $(PLATFORM_SRC)/javavm/export$(CLASSPATH_SEPARATOR)$(SHARE_SRC)/javavm/export
+endif
+
 ifdef OPENJDK
   VPATH.h = $(VPATH0.h)
 else
--- a/make/common/Demo.gmk	Wed Jun 19 21:51:50 2013 -0700
+++ b/make/common/Demo.gmk	Fri Jun 21 19:11:42 2013 -0700
@@ -158,6 +158,8 @@
     #       bit between them.
     LINK.demo   = $(LINK.c)
     LDLIBS.demo = $(EXTRA_LIBS) $(LFLAGS_$(COMPILER_VERSION))
+    DEMO_VERSION_INFO = $(OBJDIR)/$(LIBRARY).res
+    LDLIBS.demo += $(DEMO_VERSION_INFO)
   else
     ifneq ($(DEMO_NEEDS_CPP),)
       LINK.demo   = $(LINK.cpp)
@@ -288,6 +290,13 @@
 	$(install-file)
 endif
 
+ifeq ($(PLATFORM),windows)
+# JDK name required here
+RC_FLAGS += /D "JDK_FNAME=$(LIBRARY).dll" \
+            /D "JDK_INTERNAL_NAME=$(LIBRARY)" \
+            /D "JDK_FTYPE=0x2L"
+endif
+
 # Native library building
 ifdef DEMO_LIBRARY
 
@@ -308,6 +317,9 @@
   # Actual creation of the native shared library (C++ and C are different)
 $(DEMO_LIBRARY): $(DEMO_FULL_OBJECTS)
 	@$(prep-target)
+  ifeq ($(PLATFORM),windows)
+	$(RC) $(RC_FLAGS) $(CC_OBJECT_OUTPUT_FLAG)$(DEMO_VERSION_INFO) $(VERSIONINFO_RESOURCE)
+  endif
 	$(LINK.demo) $(SHARED_LIBRARY_FLAG) $(CC_PROGRAM_OUTPUT_FLAG)$@ \
 	    $(DEMO_FULL_OBJECTS) $(LDLIBS.demo)
 	@$(call binary_file_verification,$@)
--- a/make/common/Program.gmk	Wed Jun 19 21:51:50 2013 -0700
+++ b/make/common/Program.gmk	Fri Jun 21 19:11:42 2013 -0700
@@ -91,7 +91,7 @@
   LDFLAGS += $(OUTPUTDIR)/tmp/java/jli/$(OBJDIRNAME)/static/libjli.a
 
   ifeq ($(SYSTEM_ZLIB),true)
-    OTHER_LDLIBS += -lz
+    OTHER_LDLIBS += $(ZLIB_LIBS)
   endif # SYSTEM_ZLIB
 endif # PLATFORM
 
--- a/make/common/Release.gmk	Wed Jun 19 21:51:50 2013 -0700
+++ b/make/common/Release.gmk	Fri Jun 21 19:11:42 2013 -0700
@@ -59,8 +59,7 @@
 # This is an interim solution until the ct.sym is replaced
 # with a new module system (being discussed for JDK 8).
 #
-EXPORTED_PRIVATE_PKGS = com.sun.servicetag \
-                        com.oracle.net \
+EXPORTED_PRIVATE_PKGS = com.oracle.net \
                         com.oracle.nio \
                         com.oracle.util
 
@@ -158,7 +157,6 @@
         jstack.1           \
         jstat.1            \
         jstatd.1           \
-        jvisualvm.1        \
 	native2ascii.1     \
 	rmic.1             \
         schemagen.1        \
@@ -167,6 +165,10 @@
         wsimport.1         \
         xjc.1
 
+ifndef OPENJDK
+  JDK_MAN_PAGES += jvisualvm.1
+endif
+
 ifeq ($(PLATFORM), solaris)
   MANBASEDIRS=$(JDK_TOPDIR)/src/solaris/doc $(IMPORTDOCDIR)
   MAN1SUBDIR=sun/man/man1
@@ -1226,6 +1228,10 @@
 $(PRINTF) '%s="%s"\n' $1 $2 >> $@
 endef
 
+define echo-java-info
+$(CAT) $1
+endef
+
 # Values to emit
 MINIMUM_OS_NAME    := $(REQUIRED_OS_NAME)
 MINIMUM_OS_VERSION := $(REQUIRED_OS_VERSION)
@@ -1242,6 +1248,7 @@
 	$(call info-file-item, "OS_VERSION",   "$(MINIMUM_OS_VERSION)")
 	$(call info-file-item, "OS_ARCH",      "$(MINIMUM_OS_ARCH)")
 	$(call info-file-item, "SOURCE",       "$(ALL_SOURCE_TIPS)")
+	$(call echo-java-info, $@)
 
 # Create release file to identify this image
 identify-image-jdk:: $(JDK_INFO_FILE)
@@ -1253,6 +1260,7 @@
 	$(call info-file-item, "OS_VERSION",   "$(MINIMUM_OS_VERSION)")
 	$(call info-file-item, "OS_ARCH",      "$(MINIMUM_OS_ARCH)")
 	$(call info-file-item, "SOURCE",       "$(ALL_SOURCE_TIPS)")
+	$(call echo-java-info, $@)
 
 # Create release file to identify this image
 identify-image-jre:: $(JRE_INFO_FILE)
@@ -1350,8 +1358,8 @@
 	@$(java-vm-cleanup)
 
 # Clean up names in the messages printed out
-CAT_FILTER = $(SED) -e "s@$(JDK_IMAGE_DIR)@JDK_IMAGE@g" \
-	            -e "s@$(JRE_IMAGE_DIR)@JRE_IMAGE@g"
+CAT_FILTER = $(SED) -e "s|$(JDK_IMAGE_DIR)|JDK_IMAGE|g" \
+	            -e "s|$(JRE_IMAGE_DIR)|JRE_IMAGE|g"
 
 # Report on the jre image comparison
 compare-image-jre: $(TEMP_PREV_JRE_COMPARISON)
@@ -1419,3 +1427,4 @@
 # Force rule
 FRC:
 
+-include $(JDK_TOPDIR)/make/closed/common/release.gmk
--- a/make/common/shared/Defs-java.gmk	Wed Jun 19 21:51:50 2013 -0700
+++ b/make/common/shared/Defs-java.gmk	Fri Jun 21 19:11:42 2013 -0700
@@ -156,7 +156,7 @@
 
 # Needed for javadoc to ensure it builds documentation
 # against the newly built classes
-JAVADOCFLAGS += -bootclasspath $(CLASSBINDIR)
+JAVADOCFLAGS += -bootclasspath "$(CLASSBINDIR)$(JCE_PATH)"
 
 # Needed for JAVADOC and BOOT_JAVACFLAGS
 NO_PROPRIETARY_API_WARNINGS = -XDignore.symbol.file=true
--- a/make/common/shared/Defs-linux.gmk	Wed Jun 19 21:51:50 2013 -0700
+++ b/make/common/shared/Defs-linux.gmk	Fri Jun 21 19:11:42 2013 -0700
@@ -129,6 +129,11 @@
 BUILD_HEADLESS = true
 LIBM=-lm
 
+# Set ZLIB_LIBS if not already set
+ifeq ("$(ZLIB_LIBS)", "")
+  ZLIB_LIBS=-lz
+endif
+
 # GCC29_COMPILER_PATH: is the path to where the gcc 2.9 compiler is installed
 #  NOTE: Must end with / so that it could be empty, allowing PATH usage.
 ifdef ALT_GCC29_COMPILER_PATH
--- a/make/common/shared/Defs-macosx.gmk	Wed Jun 19 21:51:50 2013 -0700
+++ b/make/common/shared/Defs-macosx.gmk	Fri Jun 21 19:11:42 2013 -0700
@@ -143,6 +143,11 @@
   _CUPS_HEADERS_PATH=$(PACKAGE_PATH)/include
 endif
 
+# Set ZLIB_LIBS if not already set
+ifeq ("$(ZLIB_LIBS)", "")
+  ZLIB_LIBS=-lz
+endif
+
 # Import JDK images allow for partial builds, components not built are
 #    imported (or copied from) these import areas when needed.
 
--- a/make/common/shared/Defs-solaris.gmk	Wed Jun 19 21:51:50 2013 -0700
+++ b/make/common/shared/Defs-solaris.gmk	Fri Jun 21 19:11:42 2013 -0700
@@ -140,6 +140,11 @@
 
 _CUPS_HEADERS_PATH=/opt/sfw/cups/include
 
+# Set ZLIB_LIBS if not already set
+ifeq ("$(ZLIB_LIBS)", "")
+  ZLIB_LIBS=-lz
+endif
+
 # Import JDK images allow for partial builds, components not built are
 #    imported (or copied from) these import areas when needed.
 
--- a/make/docs/Makefile	Wed Jun 19 21:51:50 2013 -0700
+++ b/make/docs/Makefile	Fri Jun 21 19:11:42 2013 -0700
@@ -47,11 +47,11 @@
 
 # Url to devdocs page
 #   Was: http://java.sun.com/javase/6/webnotes/devdocs-vs-specs.html
-DEV_DOCS_URL-5 = http://java.sun.com/j2se/1.5.0/docs/index.html
-DEV_DOCS_URL-6 = http://download.oracle.com/javase/6/docs/index.html
-DEV_DOCS_URL-7 = http://download.oracle.com/javase/7/docs/index.html
+DEV_DOCS_URL-5 = http://docs.oracle.com/javase/1.5.0/docs/index.html
+DEV_DOCS_URL-6 = http://docs.oracle.com/javase/6/docs/index.html
+DEV_DOCS_URL-7 = http://docs.oracle.com/javase/7/docs/index.html
 DEV_DOCS_URL = $(DEV_DOCS_URL-$(JDK_MINOR_VERSION))
-DOCS_BASE_URL = http://download.oracle.com/javase/7/docs
+DOCS_BASE_URL = http://docs.oracle.com/javase/7/docs
 
 # Url to Java Language Spec
 #JLS3_URL = http://java.sun.com/docs/books/jls/
--- a/make/java/java/mapfile-vers	Wed Jun 19 21:51:50 2013 -0700
+++ b/make/java/java/mapfile-vers	Fri Jun 21 19:11:42 2013 -0700
@@ -79,7 +79,7 @@
 		Java_java_io_FileInputStream_close0;
 		Java_java_io_FileInputStream_initIDs;
 		Java_java_io_FileInputStream_open;
-		Java_java_io_FileInputStream_read;
+		Java_java_io_FileInputStream_read0;
 		Java_java_io_FileInputStream_readBytes;
 		Java_java_io_FileInputStream_skip;
 		Java_java_io_FileOutputStream_close0;
@@ -90,7 +90,6 @@
 		Java_java_io_FileSystem_getFileSystem;
 		Java_java_io_ObjectInputStream_bytesToDoubles;
 		Java_java_io_ObjectInputStream_bytesToFloats;
-		Java_java_io_ObjectInputStream_latestUserDefinedLoader;
 		Java_java_io_ObjectOutputStream_doublesToBytes;
 		Java_java_io_ObjectOutputStream_floatsToBytes;
 		Java_java_io_ObjectStreamClass_hasStaticInitializer;
@@ -100,12 +99,12 @@
 		Java_java_io_RandomAccessFile_initIDs;
 		Java_java_io_RandomAccessFile_length;
 		Java_java_io_RandomAccessFile_open;
-		Java_java_io_RandomAccessFile_read;
-		Java_java_io_RandomAccessFile_readBytes;
+		Java_java_io_RandomAccessFile_read0;
+		Java_java_io_RandomAccessFile_readBytes0;
 		Java_java_io_RandomAccessFile_seek;
 		Java_java_io_RandomAccessFile_setLength;
-		Java_java_io_RandomAccessFile_write;
-		Java_java_io_RandomAccessFile_writeBytes;
+		Java_java_io_RandomAccessFile_write0;
+		Java_java_io_RandomAccessFile_writeBytes0;
 		Java_java_io_UnixFileSystem_canonicalize0;
 		Java_java_io_UnixFileSystem_checkAccess;
 		Java_java_io_UnixFileSystem_createDirectory;
@@ -273,6 +272,7 @@
                 Java_sun_misc_Version_getJvmVersionInfo;
                 Java_sun_misc_Version_getJvmSpecialVersion;
                 Java_sun_misc_VM_getThreadStateValues;
+		Java_sun_misc_VM_latestUserDefinedLoader;
                 Java_sun_misc_VM_initialize;
 		Java_sun_misc_VMSupport_initAgentProperties;
 
--- a/make/java/jli/Makefile	Wed Jun 19 21:51:50 2013 -0700
+++ b/make/java/jli/Makefile	Fri Jun 21 19:11:42 2013 -0700
@@ -46,6 +46,8 @@
 
 ifneq ($(SYSTEM_ZLIB),true)
   ZIP_SRC = $(SHARE_SRC)/native/java/util/zip/zlib-$(ZLIB_VERSION)
+else # SYSTEM_ZLIB
+  OTHER_CFLAGS += $(ZLIB_CFLAGS)
 endif #SYSTEM_ZLIB
 LAUNCHER_SHARE_SRC = $(SHARE_SRC)/bin
 
@@ -162,7 +164,7 @@
 ifneq ($(SYSTEM_ZLIB),true)
   OTHER_INCLUDES += -I$(ZIP_SRC)
 else # !SYSTEM_ZLIB
-  LDLIBS += -lz
+  LDLIBS += $(ZLIB_LIBS)
 endif # SYSTEM_ZLIB
 
 #
--- a/make/java/nio/Makefile	Wed Jun 19 21:51:50 2013 -0700
+++ b/make/java/nio/Makefile	Fri Jun 21 19:11:42 2013 -0700
@@ -54,6 +54,9 @@
 	sun/nio/ch/DevPollArrayWrapper.java \
 	sun/nio/ch/DevPollSelectorImpl.java \
         sun/nio/ch/DevPollSelectorProvider.java \
+	sun/nio/ch/EventPortSelectorImpl.java \
+	sun/nio/ch/EventPortSelectorProvider.java \
+	sun/nio/ch/EventPortWrapper.java \
 	sun/nio/ch/InheritedChannel.java \
         sun/nio/ch/PollSelectorProvider.java \
         sun/nio/ch/PollSelectorImpl.java \
@@ -274,11 +277,13 @@
 	sun/nio/ch/UnixAsynchronousServerSocketChannelImpl.java \
 	sun/nio/ch/UnixAsynchronousSocketChannelImpl.java \
 	\
-	sun/nio/fs/GnomeFileTypeDetector.java \
 	sun/nio/fs/BsdFileStore.java \
 	sun/nio/fs/BsdFileSystem.java \
 	sun/nio/fs/BsdFileSystemProvider.java \
 	sun/nio/fs/BsdNativeDispatcher.java \
+	sun/nio/fs/MacOSXFileSystemProvider.java \
+	sun/nio/fs/MacOSXFileSystem.java \
+	sun/nio/fs/MacOSXNativeDispatcher.java \
 	sun/nio/fs/PollingWatchService.java \
 	sun/nio/fs/UnixChannelFactory.java \
 	sun/nio/fs/UnixCopyFile.java \
@@ -306,8 +311,8 @@
 	UnixAsynchronousServerSocketChannelImpl.c \
 	UnixAsynchronousSocketChannelImpl.c \
 	\
-	GnomeFileTypeDetector.c \
 	BsdNativeDispatcher.c \
+	MacOSXNativeDispatcher.c \
 	UnixCopyFile.c \
 	UnixNativeDispatcher.c \
 	\
@@ -322,7 +327,6 @@
 	sun/nio/ch/UnixAsynchronousServerSocketChannelImpl.java \
 	sun/nio/ch/UnixAsynchronousSocketChannelImpl.java \
 	\
-	sun/nio/fs/GnomeFileTypeDetector.java \
 	sun/nio/fs/BsdNativeDispatcher.java \
 	sun/nio/fs/UnixCopyFile.java \
 	sun/nio/fs/UnixNativeDispatcher.java
@@ -382,7 +386,7 @@
 OTHER_LDLIBS += -L$(LIBDIR)/$(LIBARCH) -ljava -lnet -lpthread $(LIBDL)
 endif
 ifeq ($(PLATFORM), macosx)
-OTHER_LDLIBS += -L$(LIBDIR) -ljava -lnet -pthread
+OTHER_LDLIBS += -L$(LIBDIR) -ljava -lnet -pthread -framework CoreFoundation
 endif
 ifeq ($(PLATFORM), solaris)
 OTHER_LDLIBS += $(JVMLIB) $(LIBSOCKET) -lposix4 $(LIBDL) -lsendfile \
--- a/make/java/nio/mapfile-bsd	Wed Jun 19 21:51:50 2013 -0700
+++ b/make/java/nio/mapfile-bsd	Fri Jun 21 19:11:42 2013 -0700
@@ -122,10 +122,6 @@
 		Java_sun_nio_fs_BsdNativeDispatcher_getfsstat;
 		Java_sun_nio_fs_BsdNativeDispatcher_fsstatEntry;
 		Java_sun_nio_fs_BsdNativeDispatcher_endfsstat;
-		Java_sun_nio_fs_GnomeFileTypeDetector_initializeGio;
-		Java_sun_nio_fs_GnomeFileTypeDetector_probeUsingGio;
-		Java_sun_nio_fs_GnomeFileTypeDetector_initializeGnomeVfs;
-		Java_sun_nio_fs_GnomeFileTypeDetector_probeUsingGnomeVfs;
 		Java_sun_nio_fs_UnixNativeDispatcher_init;
 		Java_sun_nio_fs_UnixNativeDispatcher_getcwd;
 		Java_sun_nio_fs_UnixNativeDispatcher_strerror;
@@ -171,7 +167,6 @@
 		Java_sun_nio_fs_UnixNativeDispatcher_getgrgid;
 		Java_sun_nio_fs_UnixNativeDispatcher_getpwnam0;
 		Java_sun_nio_fs_UnixNativeDispatcher_getgrnam0;
-		Java_sun_nio_fs_UnixNativeDispatcher_getextmntent;
 		Java_sun_nio_fs_UnixCopyFile_transfer;
 		handleSocketError;
 
--- a/make/java/nio/mapfile-linux	Wed Jun 19 21:51:50 2013 -0700
+++ b/make/java/nio/mapfile-linux	Fri Jun 21 19:11:42 2013 -0700
@@ -39,7 +39,6 @@
                 Java_sun_nio_ch_EPollArrayWrapper_epollCreate;
                 Java_sun_nio_ch_EPollArrayWrapper_epollCtl;
                 Java_sun_nio_ch_EPollArrayWrapper_epollWait;
-		Java_sun_nio_ch_EPollArrayWrapper_fdLimit;
 		Java_sun_nio_ch_EPollArrayWrapper_init;
 		Java_sun_nio_ch_EPollArrayWrapper_interrupt;
 		Java_sun_nio_ch_EPollArrayWrapper_offsetofData;
@@ -87,6 +86,7 @@
                 Java_sun_nio_ch_IOUtil_configureBlocking;
                 Java_sun_nio_ch_IOUtil_drain;
                 Java_sun_nio_ch_IOUtil_fdVal;
+		Java_sun_nio_ch_IOUtil_fdLimit;
                 Java_sun_nio_ch_IOUtil_initIDs;
 		Java_sun_nio_ch_IOUtil_iovMax;
                 Java_sun_nio_ch_IOUtil_makePipe;
@@ -144,6 +144,7 @@
 		Java_sun_nio_fs_LinuxNativeDispatcher_fsetxattr0;
 		Java_sun_nio_fs_LinuxNativeDispatcher_fremovexattr0;
 		Java_sun_nio_fs_LinuxNativeDispatcher_setmntent0;
+                Java_sun_nio_fs_LinuxNativeDispatcher_getmntent;
 		Java_sun_nio_fs_LinuxNativeDispatcher_endmntent;
 		Java_sun_nio_fs_UnixNativeDispatcher_init;
 		Java_sun_nio_fs_UnixNativeDispatcher_getcwd;
@@ -190,7 +191,6 @@
 		Java_sun_nio_fs_UnixNativeDispatcher_getgrgid;
 		Java_sun_nio_fs_UnixNativeDispatcher_getpwnam0;
 		Java_sun_nio_fs_UnixNativeDispatcher_getgrnam0;
-		Java_sun_nio_fs_UnixNativeDispatcher_getextmntent;
 		Java_sun_nio_fs_UnixCopyFile_transfer;
 		handleSocketError;
 
--- a/make/java/nio/mapfile-solaris	Wed Jun 19 21:51:50 2013 -0700
+++ b/make/java/nio/mapfile-solaris	Fri Jun 21 19:11:42 2013 -0700
@@ -36,7 +36,6 @@
                 Java_sun_nio_ch_DatagramDispatcher_readv0;
                 Java_sun_nio_ch_DatagramDispatcher_write0;
                 Java_sun_nio_ch_DatagramDispatcher_writev0;
-                Java_sun_nio_ch_DevPollArrayWrapper_fdLimit;
                 Java_sun_nio_ch_DevPollArrayWrapper_init;
                 Java_sun_nio_ch_DevPollArrayWrapper_interrupt;
                 Java_sun_nio_ch_DevPollArrayWrapper_poll0;
@@ -74,6 +73,7 @@
 		Java_sun_nio_ch_InheritedChannel_soType0;
                 Java_sun_nio_ch_IOUtil_configureBlocking;
                 Java_sun_nio_ch_IOUtil_drain;
+		Java_sun_nio_ch_IOUtil_fdLimit;
                 Java_sun_nio_ch_IOUtil_fdVal;
                 Java_sun_nio_ch_IOUtil_initIDs;
 		Java_sun_nio_ch_IOUtil_iovMax;
@@ -114,13 +114,13 @@
 		Java_sun_nio_ch_UnixAsynchronousServerSocketChannelImpl_accept0;
 		Java_sun_nio_ch_UnixAsynchronousServerSocketChannelImpl_initIDs;
 		Java_sun_nio_ch_UnixAsynchronousSocketChannelImpl_checkConnect;
-		Java_sun_nio_ch_SolarisEventPort_init;
-		Java_sun_nio_ch_SolarisEventPort_portCreate;
-		Java_sun_nio_ch_SolarisEventPort_portClose;
-		Java_sun_nio_ch_SolarisEventPort_portAssociate;
-		Java_sun_nio_ch_SolarisEventPort_portGet;
-		Java_sun_nio_ch_SolarisEventPort_portGetn;
-		Java_sun_nio_ch_SolarisEventPort_portSend;
+		Java_sun_nio_ch_SolarisEventPort_port_1create;
+		Java_sun_nio_ch_SolarisEventPort_port_1close;
+		Java_sun_nio_ch_SolarisEventPort_port_1associate;
+		Java_sun_nio_ch_SolarisEventPort_port_1dissociate;
+		Java_sun_nio_ch_SolarisEventPort_port_1get;
+		Java_sun_nio_ch_SolarisEventPort_port_1getn;
+		Java_sun_nio_ch_SolarisEventPort_port_1send;
 		Java_sun_nio_fs_GnomeFileTypeDetector_initializeGio;
 		Java_sun_nio_fs_GnomeFileTypeDetector_probeUsingGio;
 		Java_sun_nio_fs_GnomeFileTypeDetector_initializeGnomeVfs;
@@ -170,10 +170,10 @@
 		Java_sun_nio_fs_UnixNativeDispatcher_getgrgid;
 		Java_sun_nio_fs_UnixNativeDispatcher_getpwnam0;
 		Java_sun_nio_fs_UnixNativeDispatcher_getgrnam0;
-		Java_sun_nio_fs_UnixNativeDispatcher_getextmntent;
 		Java_sun_nio_fs_UnixCopyFile_transfer;
 		Java_sun_nio_fs_SolarisNativeDispatcher_init;
 		Java_sun_nio_fs_SolarisNativeDispatcher_facl;
+		Java_sun_nio_fs_SolarisNativeDispatcher_getextmntent;
 		Java_sun_nio_fs_SolarisWatchService_init;
 		Java_sun_nio_fs_SolarisWatchService_portCreate;
 		Java_sun_nio_fs_SolarisWatchService_portAssociate;
--- a/make/java/security/Makefile	Wed Jun 19 21:51:50 2013 -0700
+++ b/make/java/security/Makefile	Fri Jun 21 19:11:42 2013 -0700
@@ -37,7 +37,8 @@
 # Directories
 #
 
-PROPS_SRC   = $(TOPDIR)/src/share/lib/security/java.security
+# The default security properties file is for linux
+PROPS_SRC   = $(TOPDIR)/src/share/lib/security/java.security-linux
 
 ifeq ($(PLATFORM), solaris)
 PROPS_SRC   = $(TOPDIR)/src/share/lib/security/java.security-solaris
--- a/make/java/zip/Makefile	Wed Jun 19 21:51:50 2013 -0700
+++ b/make/java/zip/Makefile	Fri Jun 21 19:11:42 2013 -0700
@@ -56,6 +56,10 @@
   endif
 endif
 
+ifeq ($(SYSTEM_ZLIB),true)
+  OTHER_CFLAGS += $(ZLIB_CFLAGS)
+endif
+
 #
 # Library to compile.
 #
@@ -90,7 +94,7 @@
 # Link to JVM library for JVM_Zip* functions
 #
 ifeq ($(SYSTEM_ZLIB),true)
-OTHER_LDLIBS = -lz
+OTHER_LDLIBS = $(ZLIB_LIBS)
 else
 OTHER_LDLIBS = $(JVMLIB)
 endif
--- a/make/java/zip/mapfile-vers	Wed Jun 19 21:51:50 2013 -0700
+++ b/make/java/zip/mapfile-vers	Fri Jun 21 19:11:42 2013 -0700
@@ -36,16 +36,12 @@
 		Java_java_util_zip_Deflater_deflateBytes;
 		Java_java_util_zip_Deflater_end;
 		Java_java_util_zip_Deflater_getAdler;
-		Java_java_util_zip_Deflater_getBytesRead;
-		Java_java_util_zip_Deflater_getBytesWritten;
 		Java_java_util_zip_Deflater_init;
 		Java_java_util_zip_Deflater_initIDs;
 		Java_java_util_zip_Deflater_reset;
 		Java_java_util_zip_Deflater_setDictionary;
 		Java_java_util_zip_Inflater_end;
 		Java_java_util_zip_Inflater_getAdler;
-		Java_java_util_zip_Inflater_getBytesRead;
-		Java_java_util_zip_Inflater_getBytesWritten;
 		Java_java_util_zip_Inflater_inflateBytes;
 		Java_java_util_zip_Inflater_init;
 		Java_java_util_zip_Inflater_initIDs;
--- a/make/javax/crypto/Makefile	Wed Jun 19 21:51:50 2013 -0700
+++ b/make/javax/crypto/Makefile	Fri Jun 21 19:11:42 2013 -0700
@@ -156,7 +156,12 @@
 #
 
 ifdef OPENJDK
-all: build-jar install-jar build-policy install-limited
+ifdef UNLIMITED_CRYPTO
+POLICY = install-unlimited
+else
+POLICY = install-limited
+endif
+all: build-jar install-jar build-policy $(POLICY)
 else  # OPENJDK
 ifeq ($(strip $(FILES_java)),)
 all:
--- a/make/jdk_generic_profile.sh	Wed Jun 19 21:51:50 2013 -0700
+++ b/make/jdk_generic_profile.sh	Fri Jun 21 19:11:42 2013 -0700
@@ -378,3 +378,22 @@
     export LLVM_LIBS
   fi
 fi
+
+# Export variables for system zlib
+# ZLIB_CFLAGS and ZLIB_LIBS tell the compiler how to compile and
+# link against zlib
+pkgconfig=$(which pkg-config 2>/dev/null)
+if [ -x "${pkgconfig}" ] ; then
+  if [ "${ZLIB_CFLAGS}" = "" ] ; then
+    ZLIB_CFLAGS=$("${pkgconfig}" --cflags zlib)
+  fi
+  if [ "${ZLIB_LIBS}" = "" ] ; then
+    ZLIB_LIBS=$("${pkgconfig}" --libs zlib)
+  fi
+fi
+if [ "${ZLIB_LIBS}" = "" ] ; then
+    ZLIB_LIBS="-lz"
+fi
+export ZLIB_CFLAGS
+export ZLIB_LIBS
+
--- a/make/jprt.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/make/jprt.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 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
@@ -77,20 +77,17 @@
     ${jprt.my.test.target.set:TESTNAME=jdk_util},		\
     ${jprt.my.test.target.set:TESTNAME=jdk_io},			\
     ${jprt.my.test.target.set:TESTNAME=jdk_net},		\
-    ${jprt.my.test.target.set:TESTNAME=jdk_nio1},		\
-    ${jprt.my.test.target.set:TESTNAME=jdk_nio2},		\
-    ${jprt.my.test.target.set:TESTNAME=jdk_nio3},		\
+    ${jprt.my.test.target.set:TESTNAME=jdk_nio},		\
     ${jprt.my.test.target.set:TESTNAME=jdk_security1},		\
     ${jprt.my.test.target.set:TESTNAME=jdk_security2},		\
     ${jprt.my.test.target.set:TESTNAME=jdk_security3},		\
     ${jprt.my.test.target.set:TESTNAME=jdk_rmi},		\
-    ${jprt.my.test.target.set:TESTNAME=jdk_management1},	\
-    ${jprt.my.test.target.set:TESTNAME=jdk_management2},	\
+    ${jprt.my.test.target.set:TESTNAME=jdk_management},		\
+    ${jprt.my.test.target.set:TESTNAME=jdk_jmx},		\
     ${jprt.my.test.target.set:TESTNAME=jdk_text},		\
-    ${jprt.my.test.target.set:TESTNAME=jdk_tools1},		\
-    ${jprt.my.test.target.set:TESTNAME=jdk_tools2},		\
+    ${jprt.my.test.target.set:TESTNAME=jdk_tools},		\
     ${jprt.my.test.target.set:TESTNAME=jdk_jfr},		\
-    ${jprt.my.test.target.set:TESTNAME=jdk_misc}
+    ${jprt.my.test.target.set:TESTNAME=jdk_other}
 
 # All vm test targets (testset=all)
 jprt.vm.all.test.targets=                                       \
@@ -105,6 +102,7 @@
     ${jprt.my.test.target.set:TESTNAME=jdk_beans1},		\
     ${jprt.my.test.target.set:TESTNAME=jdk_beans2},             \
     ${jprt.my.test.target.set:TESTNAME=jdk_beans3},             \
+    ${jprt.my.test.target.set:TESTNAME=jdk_jdi},                \
     ${jprt.my.test.target.set:TESTNAME=jdk_sound},              \
     ${jprt.my.test.target.set:TESTNAME=jdk_swing}
 
--- a/make/netbeans/jconsole/build.xml	Wed Jun 19 21:51:50 2013 -0700
+++ b/make/netbeans/jconsole/build.xml	Fri Jun 21 19:11:42 2013 -0700
@@ -50,6 +50,7 @@
             <fileset dir="${classes.dir}">
                 <include name="sun/tools/jconsole/**/*.class"/>
                 <include name="com/sun/tools/jconsole/**/*.class"/>
+                <include name="sun/tools/jconsole/resources/*.properties"/>
                 <include name="sun/tools/jconsole/resources/*.gif"/>
                 <include name="sun/tools/jconsole/resources/*.png"/>
             </fileset>
--- a/make/sun/javazic/tzdata/VERSION	Wed Jun 19 21:51:50 2013 -0700
+++ b/make/sun/javazic/tzdata/VERSION	Fri Jun 21 19:11:42 2013 -0700
@@ -21,4 +21,4 @@
 # or visit www.oracle.com if you need additional information or have any
 # questions.
 #
-tzdata2013b
+tzdata2013c
--- a/make/sun/javazic/tzdata/antarctica	Wed Jun 19 21:51:50 2013 -0700
+++ b/make/sun/javazic/tzdata/antarctica	Fri Jun 21 19:11:42 2013 -0700
@@ -76,34 +76,6 @@
 Rule	ChileAQ	2012	max	-	Apr	Sun>=23	3:00u	0	-
 Rule	ChileAQ	2012	max	-	Sep	Sun>=2	4:00u	1:00	S
 
-# These rules are stolen from the `australasia' file.
-Rule	AusAQ	1917	only	-	Jan	 1	0:01	1:00	-
-Rule	AusAQ	1917	only	-	Mar	25	2:00	0	-
-Rule	AusAQ	1942	only	-	Jan	 1	2:00	1:00	-
-Rule	AusAQ	1942	only	-	Mar	29	2:00	0	-
-Rule	AusAQ	1942	only	-	Sep	27	2:00	1:00	-
-Rule	AusAQ	1943	1944	-	Mar	lastSun	2:00	0	-
-Rule	AusAQ	1943	only	-	Oct	 3	2:00	1:00	-
-Rule	ATAQ	1967	only	-	Oct	Sun>=1	2:00s	1:00	-
-Rule	ATAQ	1968	only	-	Mar	lastSun	2:00s	0	-
-Rule	ATAQ	1968	1985	-	Oct	lastSun	2:00s	1:00	-
-Rule	ATAQ	1969	1971	-	Mar	Sun>=8	2:00s	0	-
-Rule	ATAQ	1972	only	-	Feb	lastSun	2:00s	0	-
-Rule	ATAQ	1973	1981	-	Mar	Sun>=1	2:00s	0	-
-Rule	ATAQ	1982	1983	-	Mar	lastSun	2:00s	0	-
-Rule	ATAQ	1984	1986	-	Mar	Sun>=1	2:00s	0	-
-Rule	ATAQ	1986	only	-	Oct	Sun>=15	2:00s	1:00	-
-Rule	ATAQ	1987	1990	-	Mar	Sun>=15	2:00s	0	-
-Rule	ATAQ	1987	only	-	Oct	Sun>=22	2:00s	1:00	-
-Rule	ATAQ	1988	1990	-	Oct	lastSun	2:00s	1:00	-
-Rule	ATAQ	1991	1999	-	Oct	Sun>=1	2:00s	1:00	-
-Rule	ATAQ	1991	2005	-	Mar	lastSun	2:00s	0	-
-Rule	ATAQ	2000	only	-	Aug	lastSun	2:00s	1:00	-
-Rule	ATAQ	2001	max	-	Oct	Sun>=1	2:00s	1:00	-
-Rule	ATAQ	2006	only	-	Apr	Sun>=1	2:00s	0	-
-Rule	ATAQ	2007	only	-	Mar	lastSun	2:00s	0	-
-Rule	ATAQ	2008	max	-	Apr	Sun>=1	2:00s	0	-
-
 # Argentina - year-round bases
 # Belgrano II, Confin Coast, -770227-0343737, since 1972-02-05
 # Esperanza, San Martin Land, -6323-05659, since 1952-12-17
@@ -145,10 +117,7 @@
 # </a>
 
 # From Steffen Thorsen (2010-03-10):
-# We got these changes from the Australian Antarctic Division:
-# - Macquarie Island will stay on UTC+11 for winter and therefore not
-# switch back from daylight savings time when other parts of Australia do
-# on 4 April.
+# We got these changes from the Australian Antarctic Division: ...
 #
 # - Casey station reverted to its normal time of UTC+8 on 5 March 2010.
 # The change to UTC+11 is being considered as a regular summer thing but
@@ -159,9 +128,6 @@
 #
 # - Mawson station stays on UTC+5.
 #
-# In addition to the Rule changes for Casey/Davis, it means that Macquarie
-# will no longer be like Hobart and will have to have its own Zone created.
-#
 # Background:
 # <a href="http://www.timeanddate.com/news/time/antartica-time-changes-2010.html">
 # http://www.timeanddate.com/news/time/antartica-time-changes-2010.html
@@ -188,12 +154,6 @@
 			6:00	-	MAWT	2009 Oct 18 2:00
 						# Mawson Time
 			5:00	-	MAWT
-Zone Antarctica/Macquarie 0	-	zzz	1911
-			10:00	-	EST	1916 Oct 1 2:00
-			10:00	1:00	EST	1917 Feb
-			10:00	AusAQ	EST	1967
-			10:00	ATAQ	EST	2010 Apr 4 3:00
-			11:00	-	MIST	# Macquarie Island Time
 # References:
 # <a href="http://www.antdiv.gov.au/aad/exop/sfo/casey/casey_aws.html">
 # Casey Weather (1998-02-26)
--- a/make/sun/javazic/tzdata/asia	Wed Jun 19 21:51:50 2013 -0700
+++ b/make/sun/javazic/tzdata/asia	Fri Jun 21 19:11:42 2013 -0700
@@ -2314,11 +2314,20 @@
 # http://www.timeanddate.com/news/time/gaza-west-bank-dst-2012.html
 # </a>
 
-# From Arthur David Olson (2012-03-27):
-# The timeanddate article for 2012 says that "the end date has not yet been
-# announced" and that "Last year, both...paused daylight saving time during...
-# Ramadan. It is not yet known [for] 2012."
-# For now, assume both switch back on the last Friday in September. XXX
+# From Steffen Thorsen (2013-03-26):
+# The following news sources tells that Palestine will "start daylight saving
+# time from midnight on Friday, March 29, 2013" (translated).
+# [These are in Arabic and are for Gaza and for Ramallah, respectively.]
+# http://www.samanews.com/index.php?act=Show&id=154120
+# http://safa.ps/details/news/99844/%D8%B1%D8%A7%D9%85-%D8%A7%D9%84%D9%84%D9%87-%D8%A8%D8%AF%D8%A1-%D8%A7%D9%84%D8%AA%D9%88%D9%82%D9%8A%D8%AA-%D8%A7%D9%84%D8%B5%D9%8A%D9%81%D9%8A-29-%D8%A7%D9%84%D8%AC%D8%A7%D8%B1%D9%8A.html
+
+# From Paul Eggert (2013-04-15):
+# For future dates, guess the last Thursday in March at 24:00 through
+# the first Friday on or after September 21 at 01:00.  This is consistent with
+# the predictions in today's editions of the following URLs,
+# which are for Gaza and Hebron respectively:
+# http://www.timeanddate.com/worldclock/timezone.html?n=702
+# http://www.timeanddate.com/worldclock/timezone.html?n=2364
 
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule EgyptAsia	1957	only	-	May	10	0:00	1:00	S
@@ -2332,19 +2341,20 @@
 Rule Palestine	1999	2003	-	Oct	Fri>=15	0:00	0	-
 Rule Palestine	2004	only	-	Oct	 1	1:00	0	-
 Rule Palestine	2005	only	-	Oct	 4	2:00	0	-
-Rule Palestine	2006	2008	-	Apr	 1	0:00	1:00	S
+Rule Palestine	2006	2007	-	Apr	 1	0:00	1:00	S
 Rule Palestine	2006	only	-	Sep	22	0:00	0	-
 Rule Palestine	2007	only	-	Sep	Thu>=8	2:00	0	-
-Rule Palestine	2008	only	-	Aug	lastFri	0:00	0	-
-Rule Palestine	2009	only	-	Mar	lastFri	0:00	1:00	S
-Rule Palestine	2009	only	-	Sep	Fri>=1	2:00	0	-
-Rule Palestine	2010	only	-	Mar	lastSat	0:01	1:00	S
+Rule Palestine	2008	2009	-	Mar	lastFri	0:00	1:00	S
+Rule Palestine	2008	only	-	Sep	 1	0:00	0	-
+Rule Palestine	2009	only	-	Sep	Fri>=1	1:00	0	-
+Rule Palestine	2010	only	-	Mar	26	0:00	1:00	S
 Rule Palestine	2010	only	-	Aug	11	0:00	0	-
-
-# From Arthur David Olson (2011-09-20):
-# 2011 transitions per http://www.timeanddate.com as of 2011-09-20.
-# From Paul Eggert (2012-10-12):
-# 2012 transitions per http://www.timeanddate.com as of 2012-10-12.
+Rule Palestine	2011	only	-	Apr	 1	0:01	1:00	S
+Rule Palestine	2011	only	-	Aug	 1	0:00	0	-
+Rule Palestine	2011	only	-	Aug	30	0:00	1:00	S
+Rule Palestine	2011	only	-	Sep	30	0:00	0	-
+Rule Palestine	2012	max	-	Mar	lastThu	24:00	1:00	S
+Rule Palestine	2012	max	-	Sep	Fri>=21	1:00	0	-
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Gaza	2:17:52	-	LMT	1900 Oct
@@ -2352,26 +2362,20 @@
 			2:00 EgyptAsia	EE%sT	1967 Jun  5
 			2:00	Zion	I%sT	1996
 			2:00	Jordan	EE%sT	1999
-			2:00 Palestine	EE%sT	2011 Apr  2 12:01
-			2:00	1:00	EEST	2011 Aug  1
-			2:00	-	EET	2012 Mar 30
-			2:00	1:00	EEST	2012 Sep 21 1:00
-			2:00	-	EET
+			2:00 Palestine	EE%sT	2008 Aug 29 0:00
+			2:00	-	EET	2008 Sep
+			2:00 Palestine	EE%sT	2010
+			2:00	-	EET	2010 Mar 27 0:01
+			2:00 Palestine	EE%sT	2011 Aug  1
+			2:00	-	EET	2012
+			2:00 Palestine	EE%sT
 
 Zone	Asia/Hebron	2:20:23	-	LMT	1900 Oct
 			2:00	Zion	EET	1948 May 15
 			2:00 EgyptAsia	EE%sT	1967 Jun  5
 			2:00	Zion	I%sT	1996
 			2:00	Jordan	EE%sT	1999
-			2:00 Palestine	EE%sT	2008 Aug
-			2:00 	1:00	EEST	2008 Sep
-			2:00 Palestine	EE%sT	2011 Apr  1 12:01
-			2:00	1:00	EEST	2011 Aug  1
-			2:00	-	EET	2011 Aug 30
-			2:00	1:00	EEST	2011 Sep 30 3:00
-			2:00	-	EET	2012 Mar 30
-			2:00	1:00	EEST	2012 Sep 21 1:00
-			2:00	-	EET
+			2:00 Palestine	EE%sT
 
 # Paracel Is
 # no information
--- a/make/sun/javazic/tzdata/australasia	Wed Jun 19 21:51:50 2013 -0700
+++ b/make/sun/javazic/tzdata/australasia	Fri Jun 21 19:11:42 2013 -0700
@@ -241,9 +241,26 @@
 # no times are set
 #
 # Macquarie
-# permanent occupation (scientific station) since 1948;
-# sealing and penguin oil station operated 1888/1917
-# like Australia/Hobart
+# Permanent occupation (scientific station) 1911-1915 and since 25 March 1948;
+# sealing and penguin oil station operated Nov 1899 to Apr 1919.  See the
+# Tasmania Parks & Wildlife Service history of sealing at Macquarie Island
+# <http://www.parks.tas.gov.au/index.aspx?base=1828>
+# <http://www.parks.tas.gov.au/index.aspx?base=1831>.
+# Guess that it was like Australia/Hobart while inhabited before 2010.
+#
+# From Steffen Thorsen (2010-03-10):
+# We got these changes from the Australian Antarctic Division:
+# - Macquarie Island will stay on UTC+11 for winter and therefore not
+# switch back from daylight savings time when other parts of Australia do
+# on 4 April.
+Zone Antarctica/Macquarie 0	-	zzz	1899 Nov
+			10:00	-	EST	1916 Oct 1 2:00
+			10:00	1:00	EST	1917 Feb
+			10:00	Aus	EST	1919 Apr
+			0	-	zzz	1948 Mar 25
+			10:00	Aus	EST	1967
+			10:00	AT	EST	2010 Apr 4 3:00
+			11:00	-	MIST	# Macquarie I Standard Time
 
 # Christmas
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
--- a/make/sun/javazic/tzdata/southamerica	Wed Jun 19 21:51:50 2013 -0700
+++ b/make/sun/javazic/tzdata/southamerica	Fri Jun 21 19:11:42 2013 -0700
@@ -1589,16 +1589,16 @@
 # forward 60 minutes, in all the territory of the Paraguayan Republic.
 # ...
 Rule	Para	2010	max	-	Oct	Sun>=1	0:00	1:00	S
-Rule	Para	2010	max	-	Apr	Sun>=8	0:00	0	-
+Rule	Para	2010	2012	-	Apr	Sun>=8	0:00	0	-
 #
 # From Steffen Thorsen (2013-03-07):
 # Paraguay will end DST on 2013-03-24 00:00....
-# They do not tell if this will be a permanent change or just this year....
 # http://www.ande.gov.py/interna.php?id=1075
 #
-# From Paul Eggert (2013-03-07):
-# For now, assume it's just this year.
-Rule	Para	2013	only	-	Mar	24	0:00	0	-
+# From Carlos Raul Perasso (2013-03-15):
+# The change in Paraguay is now final.  Decree number 10780
+# http://www.presidencia.gov.py/uploads/pdf/presidencia-3b86ff4b691c79d4f5927ca964922ec74772ce857c02ca054a52a37b49afc7fb.pdf
+Rule	Para	2013	max	-	Mar	Sun>=22	0:00	0	-
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone America/Asuncion	-3:50:40 -	LMT	1890
--- a/make/sun/javazic/tzdata/zone.tab	Wed Jun 19 21:51:50 2013 -0700
+++ b/make/sun/javazic/tzdata/zone.tab	Fri Jun 21 19:11:42 2013 -0700
@@ -65,7 +65,6 @@
 AQ	-7824+10654	Antarctica/Vostok	Vostok Station, Lake Vostok
 AQ	-6640+14001	Antarctica/DumontDUrville	Dumont-d'Urville Station, Terre Adelie
 AQ	-690022+0393524	Antarctica/Syowa	Syowa Station, E Ongul I
-AQ	-5430+15857	Antarctica/Macquarie	Macquarie Island Station, Macquarie Island
 AR	-3436-05827	America/Argentina/Buenos_Aires	Buenos Aires (BA, CF)
 AR	-3124-06411	America/Argentina/Cordoba	most locations (CB, CC, CN, ER, FM, MN, SE, SF)
 AR	-2447-06525	America/Argentina/Salta	(SA, LP, NQ, RN)
@@ -81,6 +80,7 @@
 AS	-1416-17042	Pacific/Pago_Pago
 AT	+4813+01620	Europe/Vienna
 AU	-3133+15905	Australia/Lord_Howe	Lord Howe Island
+AU	-5430+15857	Antarctica/Macquarie	Macquarie Island
 AU	-4253+14719	Australia/Hobart	Tasmania - most locations
 AU	-3956+14352	Australia/Currie	Tasmania - King Island
 AU	-3749+14458	Australia/Melbourne	Victoria
--- a/make/sun/jawt/Makefile	Wed Jun 19 21:51:50 2013 -0700
+++ b/make/sun/jawt/Makefile	Fri Jun 21 19:11:42 2013 -0700
@@ -30,6 +30,9 @@
 
 include $(BUILDDIR)/common/Defs.gmk
 
+# default to PLATFORM_SRC to copy export headers from
+PLATFORM_EXPORT_BASE = $(PLATFORM_SRC)
+
 #
 # Files
 #
@@ -37,6 +40,8 @@
 FILES_cpp = jawt.cpp
 else ifeq ($(PLATFORM), macosx) # PLATFORM
 FILES_objc = jawt.m
+# pick up the correct export headers for Mac OS X
+PLATFORM_EXPORT_BASE = $(PLATFORM_SRC_MACOS)
 else # PLATFORM
 FILES_c = jawt.c
 endif # PLATFORM
@@ -160,7 +165,7 @@
 #
 $(INCLUDEDIR)/%.h: $(SHARE_SRC)/javavm/export/%.h
 	$(install-file)
-$(PLATFORM_INCLUDE)/%.h: $(PLATFORM_SRC)/javavm/export/%.h
+$(PLATFORM_INCLUDE)/%.h: $(PLATFORM_EXPORT_BASE)/javavm/export/%.h
 	$(install-file)
 
 
--- a/make/sun/jconsole/FILES.gmk	Wed Jun 19 21:51:50 2013 -0700
+++ b/make/sun/jconsole/FILES.gmk	Fri Jun 21 19:11:42 2013 -0700
@@ -30,17 +30,22 @@
 MANIFEST = sun/tools/jconsole/manifest
 
 PNG_FILES = \
-	sun/tools/jconsole/resources/brandlogo.png \
-	sun/tools/jconsole/resources/collapse-winlf.png \
-	sun/tools/jconsole/resources/connected16.png \
-	sun/tools/jconsole/resources/connected24.png \
-	sun/tools/jconsole/resources/disconnected16.png \
-	sun/tools/jconsole/resources/disconnected24.png \
-	sun/tools/jconsole/resources/expand-winlf.png \
-	sun/tools/jconsole/resources/masthead-left.png \
-	sun/tools/jconsole/resources/masthead-right.png
+  sun/tools/jconsole/resources/brandlogo.png \
+  sun/tools/jconsole/resources/collapse-winlf.png \
+  sun/tools/jconsole/resources/connected16.png \
+  sun/tools/jconsole/resources/connected24.png \
+  sun/tools/jconsole/resources/disconnected16.png \
+  sun/tools/jconsole/resources/disconnected24.png \
+  sun/tools/jconsole/resources/expand-winlf.png \
+  sun/tools/jconsole/resources/masthead-left.png \
+  sun/tools/jconsole/resources/masthead-right.png
 
 GIF_FILES = \
-	sun/tools/jconsole/resources/mbean.gif \
-	sun/tools/jconsole/resources/mbeanserverdelegate.gif \
-	sun/tools/jconsole/resources/xobject.gif
+  sun/tools/jconsole/resources/mbean.gif \
+  sun/tools/jconsole/resources/mbeanserverdelegate.gif \
+  sun/tools/jconsole/resources/xobject.gif
+
+PROP_FILES = \
+  sun/tools/jconsole/resources/messages.properties \
+  sun/tools/jconsole/resources/messages_ja.properties \
+  sun/tools/jconsole/resources/messages_zh_CN.properties
--- a/make/sun/jconsole/Makefile	Wed Jun 19 21:51:50 2013 -0700
+++ b/make/sun/jconsole/Makefile	Fri Jun 21 19:11:42 2013 -0700
@@ -53,21 +53,21 @@
 
 FILES_png = $(PNG_FILES:%.png=$(CLASSBINDIR)/%.png)
 FILES_gif = $(GIF_FILES:%.gif=$(CLASSBINDIR)/%.gif)
-
+FILES_prop = $(PROP_FILES:%.properties=$(CLASSBINDIR)/%.properties)
 build: $(GENSRCDIR)/sun/tools/jconsole/Version.java
 
 #
 # Resources
 #
 LOCALE_SET_DEFINITION = jdk
-RESOURCE_BUNDLES_JAVA = $(PKGDIR)/resources/JConsoleResources.java
+RESOURCE_BUNDLES_UNCOMPILED_PROPERTIES = $(PKGDIR)/resources/messages.properties
 
 #
 # Rules.
 #
 include $(BUILDDIR)/common/Classes.gmk
 
-build: $(FILES_png) $(FILES_gif) $(TEMPDIR)/manifest $(JARFILE)
+build: $(FILES_png) $(FILES_gif) $(FILES_prop) $(TEMPDIR)/manifest $(JARFILE)
 
 $(GENSRCDIR)/sun/tools/jconsole/Version.java: \
                 $(SHARE_SRC)/classes/sun/tools/jconsole/Version.java.template
@@ -85,7 +85,7 @@
 # Extra rule to build jconsole.jar
 #
 
-$(JARFILE): $(LIBDIR) $(FILES_class) $(FILES_png) $(FILES_gif) $(TEMPDIR)/manifest
+$(JARFILE): $(LIBDIR) $(FILES_class) $(FILES_png) $(FILES_gif) $(FILES_prop) $(TEMPDIR)/manifest
 	$(BOOT_JAR_CMD) -cfm $(JARFILE) $(TEMPDIR)/manifest \
                -C $(CLASSBINDIR) sun/tools/jconsole \
                -C $(CLASSBINDIR) com/sun/tools/jconsole \
--- a/make/sun/rmi/cgi/Makefile	Wed Jun 19 21:51:50 2013 -0700
+++ b/make/sun/rmi/cgi/Makefile	Fri Jun 21 19:11:42 2013 -0700
@@ -28,6 +28,8 @@
 #
 
 BUILDDIR = ../../..
+JAVAC_MAX_WARNINGS = true
+JAVAC_WARNINGS_FATAL = true
 # java-rmi.cgi is a JDK tool
 PACKAGE = sun.rmi
 PRODUCT = sun
--- a/make/sun/rmi/registry/Makefile	Wed Jun 19 21:51:50 2013 -0700
+++ b/make/sun/rmi/registry/Makefile	Fri Jun 21 19:11:42 2013 -0700
@@ -28,6 +28,9 @@
 #
 
 BUILDDIR = ../../..
+JAVAC_MAX_WARNINGS = true
+JAVAC_WARNINGS_FATAL = true
+JAVAC_LINT_OPTIONS = -Xlint:all,-deprecation
 PACKAGE = sun.rmi.registry
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/make/sun/rmi/rmi/Makefile	Wed Jun 19 21:51:50 2013 -0700
+++ b/make/sun/rmi/rmi/Makefile	Fri Jun 21 19:11:42 2013 -0700
@@ -28,18 +28,14 @@
 #
 
 BUILDDIR = ../../..
+JAVAC_MAX_WARNINGS = true
+JAVAC_WARNINGS_FATAL = true
+JAVAC_LINT_OPTIONS = -Xlint:all,-deprecation
 PACKAGE = sun.rmi
 PRODUCT = sun
-LIBRARY = rmi
 include $(BUILDDIR)/common/Defs.gmk
 
 #
-# Add use of a mapfile
-#
-FILES_m = mapfile-vers
-include $(BUILDDIR)/common/Mapfile-vers.gmk
-
-#
 # Java files to compile.
 #
 AUTO_FILES_JAVA_DIRS = \
@@ -52,31 +48,9 @@
 	com/sun/rmi
 
 #
-# Native files to compile.
-#
-FILES_c = \
-	sun/rmi/server/MarshalInputStream.c
-
-#
-# Add ambient vpath to pick up files not part of sun.rmi package
-#
-vpath %.c $(SHARE_SRC)/native/sun/rmi/server
-
-#
-# Exported files that require generated .h 
-#
-FILES_export = \
-    sun/rmi/server/MarshalInputStream.java
-
-#
-# Link to JVM for JVM_LatestUserDefinedLoader
-#
-OTHER_LDLIBS = $(JVMLIB)
-
-#
 # Rules
 #
-include $(BUILDDIR)/common/Library.gmk
+include $(BUILDDIR)/common/Rules.gmk
 
 #
 # Full package names of implementations requiring stubs
--- a/make/sun/rmi/rmi/mapfile-vers	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-#
-# Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
-# 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.
-#
-
-# Define library interface.
-
-SUNWprivate_1.1 {
-	global:
-	    Java_sun_rmi_server_MarshalInputStream_latestUserDefinedLoader;
-	local:
-	    *;
-};
--- a/make/sun/rmi/rmid/Makefile	Wed Jun 19 21:51:50 2013 -0700
+++ b/make/sun/rmi/rmid/Makefile	Fri Jun 21 19:11:42 2013 -0700
@@ -29,6 +29,8 @@
 #
 
 BUILDDIR = ../../..
+JAVAC_MAX_WARNINGS = true
+JAVAC_WARNINGS_FATAL = true
 PACKAGE = sun.rmi.activation
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/make/sun/splashscreen/Makefile	Wed Jun 19 21:51:50 2013 -0700
+++ b/make/sun/splashscreen/Makefile	Fri Jun 21 19:11:42 2013 -0700
@@ -126,7 +126,8 @@
 ifneq ($(SYSTEM_ZLIB),true)
   CPPFLAGS += -I$(SHARE_SRC)/native/java/util/zip/zlib-$(ZLIB_VERSION)
 else
-  OTHER_LDLIBS += -lz
+  OTHER_CFLAGS += $(ZLIB_CFLAGS)
+  OTHER_LDLIBS += $(ZLIB_LIBS)
 endif
 
 # Shun the less than portable MMX assembly code in pnggccrd.c,
--- a/make/tools/CharsetMapping/GBK.map	Wed Jun 19 21:51:50 2013 -0700
+++ b/make/tools/CharsetMapping/GBK.map	Fri Jun 21 19:11:42 2013 -0700
@@ -3,6 +3,10 @@
 # (1)sorted
 # (2)added the singlebyte entries
 #
+# (3)updated 0xA140-0xA7A0 mappings to follow GB18030/MS936
+# (4)added euro sign entry A2E3 20AC (instead of 0xA2E3  0xE76C)
+#    this is what gb18030 does.
+#
 0x00	0x0000
 0x01	0x0001
 0x02	0x0002
@@ -6508,12 +6512,12 @@
 0xA2A8	0x2177
 0xA2A9	0x2178
 0xA2AA	0x2179
-0xA2AB	0xE586
-0xA2AC	0xE587
-0xA2AD	0xE588
-0xA2AE	0xE589
-0xA2AF	0xE58A
-0xA2B0	0xE58B
+0xA2AB	0xE766
+0xA2AC	0xE767
+0xA2AD	0xE768
+0xA2AE	0xE769
+0xA2AF	0xE76A
+0xA2B0	0xE76B
 0xA2B1	0x2488
 0xA2B2	0x2489
 0xA2B3	0x248A
@@ -6564,8 +6568,8 @@
 0xA2E0	0x2467
 0xA2E1	0x2468
 0xA2E2	0x2469
-0xA2E3	0xE58C
-0xA2E4	0xE58D
+0xA2E3	0x20AC
+0xA2E4	0xE76D
 0xA2E5	0x3220
 0xA2E6	0x3221
 0xA2E7	0x3222
@@ -6576,8 +6580,8 @@
 0xA2EC	0x3227
 0xA2ED	0x3228
 0xA2EE	0x3229
-0xA2EF	0xE58E
-0xA2F0	0xE58F
+0xA2EF	0xE76E
+0xA2F0	0xE76F
 0xA2F1	0x2160
 0xA2F2	0x2161
 0xA2F3	0x2162
@@ -6590,104 +6594,104 @@
 0xA2FA	0x2169
 0xA2FB	0x216A
 0xA2FC	0x216B
-0xA2FD	0xE590
-0xA2FE	0xE591
-0xA340	0xE592
-0xA341	0xE593
-0xA342	0xE594
-0xA343	0xE595
-0xA344	0xE596
-0xA345	0xE597
-0xA346	0xE598
-0xA347	0xE599
-0xA348	0xE59A
-0xA349	0xE59B
-0xA34A	0xE59C
-0xA34B	0xE59D
-0xA34C	0xE59E
-0xA34D	0xE59F
-0xA34E	0xE5A0
-0xA34F	0xE5A1
-0xA350	0xE5A2
-0xA351	0xE5A3
-0xA352	0xE5A4
-0xA353	0xE5A5
-0xA354	0xE5A6
-0xA355	0xE5A7
-0xA356	0xE5A8
-0xA357	0xE5A9
-0xA358	0xE5AA
-0xA359	0xE5AB
-0xA35A	0xE5AC
-0xA35B	0xE5AD
-0xA35C	0xE5AE
-0xA35D	0xE5AF
-0xA35E	0xE5B0
-0xA35F	0xE5B1
-0xA360	0xE5B2
-0xA361	0xE5B3
-0xA362	0xE5B4
-0xA363	0xE5B5
-0xA364	0xE5B6
-0xA365	0xE5B7
-0xA366	0xE5B8
-0xA367	0xE5B9
-0xA368	0xE5BA
-0xA369	0xE5BB
-0xA36A	0xE5BC
-0xA36B	0xE5BD
-0xA36C	0xE5BE
-0xA36D	0xE5BF
-0xA36E	0xE5C0
-0xA36F	0xE5C1
-0xA370	0xE5C2
-0xA371	0xE5C3
-0xA372	0xE5C4
-0xA373	0xE5C5
-0xA374	0xE5C6
-0xA375	0xE5C7
-0xA376	0xE5C8
-0xA377	0xE5C9
-0xA378	0xE5CA
-0xA379	0xE5CB
-0xA37A	0xE5CC
-0xA37B	0xE5CD
-0xA37C	0xE5CE
-0xA37D	0xE5CF
-0xA37E	0xE5D0
-0xA380	0xE5D1
-0xA381	0xE5D2
-0xA382	0xE5D3
-0xA383	0xE5D4
-0xA384	0xE5D5
-0xA385	0xE5D6
-0xA386	0xE5D7
-0xA387	0xE5D8
-0xA388	0xE5D9
-0xA389	0xE5DA
-0xA38A	0xE5DB
-0xA38B	0xE5DC
-0xA38C	0xE5DD
-0xA38D	0xE5DE
-0xA38E	0xE5DF
-0xA38F	0xE5E0
-0xA390	0xE5E1
-0xA391	0xE5E2
-0xA392	0xE5E3
-0xA393	0xE5E4
-0xA394	0xE5E5
-0xA395	0xE5E6
-0xA396	0xE5E7
-0xA397	0xE5E8
-0xA398	0xE5E9
-0xA399	0xE5EA
-0xA39A	0xE5EB
-0xA39B	0xE5EC
-0xA39C	0xE5ED
-0xA39D	0xE5EE
-0xA39E	0xE5EF
-0xA39F	0xE5F0
-0xA3A0	0xE5F1
+0xA2FD	0xE770
+0xA2FE	0xE771
+0xA340	0xE586
+0xA341	0xE587
+0xA342	0xE588
+0xA343	0xE589
+0xA344	0xE58A
+0xA345	0xE58B
+0xA346	0xE58C
+0xA347	0xE58D
+0xA348	0xE58E
+0xA349	0xE58F
+0xA34A	0xE590
+0xA34B	0xE591
+0xA34C	0xE592
+0xA34D	0xE593
+0xA34E	0xE594
+0xA34F	0xE595
+0xA350	0xE596
+0xA351	0xE597
+0xA352	0xE598
+0xA353	0xE599
+0xA354	0xE59A
+0xA355	0xE59B
+0xA356	0xE59C
+0xA357	0xE59D
+0xA358	0xE59E
+0xA359	0xE59F
+0xA35A	0xE5A0
+0xA35B	0xE5A1
+0xA35C	0xE5A2
+0xA35D	0xE5A3
+0xA35E	0xE5A4
+0xA35F	0xE5A5
+0xA360	0xE5A6
+0xA361	0xE5A7
+0xA362	0xE5A8
+0xA363	0xE5A9
+0xA364	0xE5AA
+0xA365	0xE5AB
+0xA366	0xE5AC
+0xA367	0xE5AD
+0xA368	0xE5AE
+0xA369	0xE5AF
+0xA36A	0xE5B0
+0xA36B	0xE5B1
+0xA36C	0xE5B2
+0xA36D	0xE5B3
+0xA36E	0xE5B4
+0xA36F	0xE5B5
+0xA370	0xE5B6
+0xA371	0xE5B7
+0xA372	0xE5B8
+0xA373	0xE5B9
+0xA374	0xE5BA
+0xA375	0xE5BB
+0xA376	0xE5BC
+0xA377	0xE5BD
+0xA378	0xE5BE
+0xA379	0xE5BF
+0xA37A	0xE5C0
+0xA37B	0xE5C1
+0xA37C	0xE5C2
+0xA37D	0xE5C3
+0xA37E	0xE5C4
+0xA380	0xE5C5
+0xA381	0xE5C6
+0xA382	0xE5C7
+0xA383	0xE5C8
+0xA384	0xE5C9
+0xA385	0xE5CA
+0xA386	0xE5CB
+0xA387	0xE5CC
+0xA388	0xE5CD
+0xA389	0xE5CE
+0xA38A	0xE5CF
+0xA38B	0xE5D0
+0xA38C	0xE5D1
+0xA38D	0xE5D2
+0xA38E	0xE5D3
+0xA38F	0xE5D4
+0xA390	0xE5D5
+0xA391	0xE5D6
+0xA392	0xE5D7
+0xA393	0xE5D8
+0xA394	0xE5D9
+0xA395	0xE5DA
+0xA396	0xE5DB
+0xA397	0xE5DC
+0xA398	0xE5DD
+0xA399	0xE5DE
+0xA39A	0xE5DF
+0xA39B	0xE5E0
+0xA39C	0xE5E1
+0xA39D	0xE5E2
+0xA39E	0xE5E3
+0xA39F	0xE5E4
+0xA3A0	0xE5E5
 0xA3A1	0xFF01
 0xA3A2	0xFF02
 0xA3A3	0xFF03
@@ -6782,102 +6786,102 @@
 0xA3FC	0xFF5C
 0xA3FD	0xFF5D
 0xA3FE	0xFFE3
-0xA440	0xE5F2
-0xA441	0xE5F3
-0xA442	0xE5F4
-0xA443	0xE5F5
-0xA444	0xE5F6
-0xA445	0xE5F7
-0xA446	0xE5F8
-0xA447	0xE5F9
-0xA448	0xE5FA
-0xA449	0xE5FB
-0xA44A	0xE5FC
-0xA44B	0xE5FD
-0xA44C	0xE5FE
-0xA44D	0xE5FF
-0xA44E	0xE600
-0xA44F	0xE601
-0xA450	0xE602
-0xA451	0xE603
-0xA452	0xE604
-0xA453	0xE605
-0xA454	0xE606
-0xA455	0xE607
-0xA456	0xE608
-0xA457	0xE609
-0xA458	0xE60A
-0xA459	0xE60B
-0xA45A	0xE60C
-0xA45B	0xE60D
-0xA45C	0xE60E
-0xA45D	0xE60F
-0xA45E	0xE610
-0xA45F	0xE611
-0xA460	0xE612
-0xA461	0xE613
-0xA462	0xE614
-0xA463	0xE615
-0xA464	0xE616
-0xA465	0xE617
-0xA466	0xE618
-0xA467	0xE619
-0xA468	0xE61A
-0xA469	0xE61B
-0xA46A	0xE61C
-0xA46B	0xE61D
-0xA46C	0xE61E
-0xA46D	0xE61F
-0xA46E	0xE620
-0xA46F	0xE621
-0xA470	0xE622
-0xA471	0xE623
-0xA472	0xE624
-0xA473	0xE625
-0xA474	0xE626
-0xA475	0xE627
-0xA476	0xE628
-0xA477	0xE629
-0xA478	0xE62A
-0xA479	0xE62B
-0xA47A	0xE62C
-0xA47B	0xE62D
-0xA47C	0xE62E
-0xA47D	0xE62F
-0xA47E	0xE630
-0xA480	0xE631
-0xA481	0xE632
-0xA482	0xE633
-0xA483	0xE634
-0xA484	0xE635
-0xA485	0xE636
-0xA486	0xE637
-0xA487	0xE638
-0xA488	0xE639
-0xA489	0xE63A
-0xA48A	0xE63B
-0xA48B	0xE63C
-0xA48C	0xE63D
-0xA48D	0xE63E
-0xA48E	0xE63F
-0xA48F	0xE640
-0xA490	0xE641
-0xA491	0xE642
-0xA492	0xE643
-0xA493	0xE644
-0xA494	0xE645
-0xA495	0xE646
-0xA496	0xE647
-0xA497	0xE648
-0xA498	0xE649
-0xA499	0xE64A
-0xA49A	0xE64B
-0xA49B	0xE64C
-0xA49C	0xE64D
-0xA49D	0xE64E
-0xA49E	0xE64F
-0xA49F	0xE650
-0xA4A0	0xE651
+0xA440	0xE5E6
+0xA441	0xE5E7
+0xA442	0xE5E8
+0xA443	0xE5E9
+0xA444	0xE5EA
+0xA445	0xE5EB
+0xA446	0xE5EC
+0xA447	0xE5ED
+0xA448	0xE5EE
+0xA449	0xE5EF
+0xA44A	0xE5F0
+0xA44B	0xE5F1
+0xA44C	0xE5F2
+0xA44D	0xE5F3
+0xA44E	0xE5F4
+0xA44F	0xE5F5
+0xA450	0xE5F6
+0xA451	0xE5F7
+0xA452	0xE5F8
+0xA453	0xE5F9
+0xA454	0xE5FA
+0xA455	0xE5FB
+0xA456	0xE5FC
+0xA457	0xE5FD
+0xA458	0xE5FE
+0xA459	0xE5FF
+0xA45A	0xE600
+0xA45B	0xE601
+0xA45C	0xE602
+0xA45D	0xE603
+0xA45E	0xE604
+0xA45F	0xE605
+0xA460	0xE606
+0xA461	0xE607
+0xA462	0xE608
+0xA463	0xE609
+0xA464	0xE60A
+0xA465	0xE60B
+0xA466	0xE60C
+0xA467	0xE60D
+0xA468	0xE60E
+0xA469	0xE60F
+0xA46A	0xE610
+0xA46B	0xE611
+0xA46C	0xE612
+0xA46D	0xE613
+0xA46E	0xE614
+0xA46F	0xE615
+0xA470	0xE616
+0xA471	0xE617
+0xA472	0xE618
+0xA473	0xE619
+0xA474	0xE61A
+0xA475	0xE61B
+0xA476	0xE61C
+0xA477	0xE61D
+0xA478	0xE61E
+0xA479	0xE61F
+0xA47A	0xE620
+0xA47B	0xE621
+0xA47C	0xE622
+0xA47D	0xE623
+0xA47E	0xE624
+0xA480	0xE625
+0xA481	0xE626
+0xA482	0xE627
+0xA483	0xE628
+0xA484	0xE629
+0xA485	0xE62A
+0xA486	0xE62B
+0xA487	0xE62C
+0xA488	0xE62D
+0xA489	0xE62E
+0xA48A	0xE62F
+0xA48B	0xE630
+0xA48C	0xE631
+0xA48D	0xE632
+0xA48E	0xE633
+0xA48F	0xE634
+0xA490	0xE635
+0xA491	0xE636
+0xA492	0xE637
+0xA493	0xE638
+0xA494	0xE639
+0xA495	0xE63A
+0xA496	0xE63B
+0xA497	0xE63C
+0xA498	0xE63D
+0xA499	0xE63E
+0xA49A	0xE63F
+0xA49B	0xE640
+0xA49C	0xE641
+0xA49D	0xE642
+0xA49E	0xE643
+0xA49F	0xE644
+0xA4A0	0xE645
 0xA4A1	0x3041
 0xA4A2	0x3042
 0xA4A3	0x3043
@@ -6961,113 +6965,113 @@
 0xA4F1	0x3091
 0xA4F2	0x3092
 0xA4F3	0x3093
-0xA4F4	0xE652
-0xA4F5	0xE653
-0xA4F6	0xE654
-0xA4F7	0xE655
-0xA4F8	0xE656
-0xA4F9	0xE657
-0xA4FA	0xE658
-0xA4FB	0xE659
-0xA4FC	0xE65A
-0xA4FD	0xE65B
-0xA4FE	0xE65C
-0xA540	0xE65D
-0xA541	0xE65E
-0xA542	0xE65F
-0xA543	0xE660
-0xA544	0xE661
-0xA545	0xE662
-0xA546	0xE663
-0xA547	0xE664
-0xA548	0xE665
-0xA549	0xE666
-0xA54A	0xE667
-0xA54B	0xE668
-0xA54C	0xE669
-0xA54D	0xE66A
-0xA54E	0xE66B
-0xA54F	0xE66C
-0xA550	0xE66D
-0xA551	0xE66E
-0xA552	0xE66F
-0xA553	0xE670
-0xA554	0xE671
-0xA555	0xE672
-0xA556	0xE673
-0xA557	0xE674
-0xA558	0xE675
-0xA559	0xE676
-0xA55A	0xE677
-0xA55B	0xE678
-0xA55C	0xE679
-0xA55D	0xE67A
-0xA55E	0xE67B
-0xA55F	0xE67C
-0xA560	0xE67D
-0xA561	0xE67E
-0xA562	0xE67F
-0xA563	0xE680
-0xA564	0xE681
-0xA565	0xE682
-0xA566	0xE683
-0xA567	0xE684
-0xA568	0xE685
-0xA569	0xE686
-0xA56A	0xE687
-0xA56B	0xE688
-0xA56C	0xE689
-0xA56D	0xE68A
-0xA56E	0xE68B
-0xA56F	0xE68C
-0xA570	0xE68D
-0xA571	0xE68E
-0xA572	0xE68F
-0xA573	0xE690
-0xA574	0xE691
-0xA575	0xE692
-0xA576	0xE693
-0xA577	0xE694
-0xA578	0xE695
-0xA579	0xE696
-0xA57A	0xE697
-0xA57B	0xE698
-0xA57C	0xE699
-0xA57D	0xE69A
-0xA57E	0xE69B
-0xA580	0xE69C
-0xA581	0xE69D
-0xA582	0xE69E
-0xA583	0xE69F
-0xA584	0xE6A0
-0xA585	0xE6A1
-0xA586	0xE6A2
-0xA587	0xE6A3
-0xA588	0xE6A4
-0xA589	0xE6A5
-0xA58A	0xE6A6
-0xA58B	0xE6A7
-0xA58C	0xE6A8
-0xA58D	0xE6A9
-0xA58E	0xE6AA
-0xA58F	0xE6AB
-0xA590	0xE6AC
-0xA591	0xE6AD
-0xA592	0xE6AE
-0xA593	0xE6AF
-0xA594	0xE6B0
-0xA595	0xE6B1
-0xA596	0xE6B2
-0xA597	0xE6B3
-0xA598	0xE6B4
-0xA599	0xE6B5
-0xA59A	0xE6B6
-0xA59B	0xE6B7
-0xA59C	0xE6B8
-0xA59D	0xE6B9
-0xA59E	0xE6BA
-0xA59F	0xE6BB
-0xA5A0	0xE6BC
+0xA4F4	0xE772
+0xA4F5	0xE773
+0xA4F6	0xE774
+0xA4F7	0xE775
+0xA4F8	0xE776
+0xA4F9	0xE777
+0xA4FA	0xE778
+0xA4FB	0xE779
+0xA4FC	0xE77A
+0xA4FD	0xE77B
+0xA4FE	0xE77C
+0xA540	0xE646
+0xA541	0xE647
+0xA542	0xE648
+0xA543	0xE649
+0xA544	0xE64A
+0xA545	0xE64B
+0xA546	0xE64C
+0xA547	0xE64D
+0xA548	0xE64E
+0xA549	0xE64F
+0xA54A	0xE650
+0xA54B	0xE651
+0xA54C	0xE652
+0xA54D	0xE653
+0xA54E	0xE654
+0xA54F	0xE655
+0xA550	0xE656
+0xA551	0xE657
+0xA552	0xE658
+0xA553	0xE659
+0xA554	0xE65A
+0xA555	0xE65B
+0xA556	0xE65C
+0xA557	0xE65D
+0xA558	0xE65E
+0xA559	0xE65F
+0xA55A	0xE660
+0xA55B	0xE661
+0xA55C	0xE662
+0xA55D	0xE663
+0xA55E	0xE664
+0xA55F	0xE665
+0xA560	0xE666
+0xA561	0xE667
+0xA562	0xE668
+0xA563	0xE669
+0xA564	0xE66A
+0xA565	0xE66B
+0xA566	0xE66C
+0xA567	0xE66D
+0xA568	0xE66E
+0xA569	0xE66F
+0xA56A	0xE670
+0xA56B	0xE671
+0xA56C	0xE672
+0xA56D	0xE673
+0xA56E	0xE674
+0xA56F	0xE675
+0xA570	0xE676
+0xA571	0xE677
+0xA572	0xE678
+0xA573	0xE679
+0xA574	0xE67A
+0xA575	0xE67B
+0xA576	0xE67C
+0xA577	0xE67D
+0xA578	0xE67E
+0xA579	0xE67F
+0xA57A	0xE680
+0xA57B	0xE681
+0xA57C	0xE682
+0xA57D	0xE683
+0xA57E	0xE684
+0xA580	0xE685
+0xA581	0xE686
+0xA582	0xE687
+0xA583	0xE688
+0xA584	0xE689
+0xA585	0xE68A
+0xA586	0xE68B
+0xA587	0xE68C
+0xA588	0xE68D
+0xA589	0xE68E
+0xA58A	0xE68F
+0xA58B	0xE690
+0xA58C	0xE691
+0xA58D	0xE692
+0xA58E	0xE693
+0xA58F	0xE694
+0xA590	0xE695
+0xA591	0xE696
+0xA592	0xE697
+0xA593	0xE698
+0xA594	0xE699
+0xA595	0xE69A
+0xA596	0xE69B
+0xA597	0xE69C
+0xA598	0xE69D
+0xA599	0xE69E
+0xA59A	0xE69F
+0xA59B	0xE6A0
+0xA59C	0xE6A1
+0xA59D	0xE6A2
+0xA59E	0xE6A3
+0xA59F	0xE6A4
+0xA5A0	0xE6A5
 0xA5A1	0x30A1
 0xA5A2	0x30A2
 0xA5A3	0x30A3
@@ -7154,110 +7158,110 @@
 0xA5F4	0x30F4
 0xA5F5	0x30F5
 0xA5F6	0x30F6
-0xA5F7	0xE6BD
-0xA5F8	0xE6BE
-0xA5F9	0xE6BF
-0xA5FA	0xE6C0
-0xA5FB	0xE6C1
-0xA5FC	0xE6C2
-0xA5FD	0xE6C3
-0xA5FE	0xE6C4
-0xA640	0xE6C5
-0xA641	0xE6C6
-0xA642	0xE6C7
-0xA643	0xE6C8
-0xA644	0xE6C9
-0xA645	0xE6CA
-0xA646	0xE6CB
-0xA647	0xE6CC
-0xA648	0xE6CD
-0xA649	0xE6CE
-0xA64A	0xE6CF
-0xA64B	0xE6D0
-0xA64C	0xE6D1
-0xA64D	0xE6D2
-0xA64E	0xE6D3
-0xA64F	0xE6D4
-0xA650	0xE6D5
-0xA651	0xE6D6
-0xA652	0xE6D7
-0xA653	0xE6D8
-0xA654	0xE6D9
-0xA655	0xE6DA
-0xA656	0xE6DB
-0xA657	0xE6DC
-0xA658	0xE6DD
-0xA659	0xE6DE
-0xA65A	0xE6DF
-0xA65B	0xE6E0
-0xA65C	0xE6E1
-0xA65D	0xE6E2
-0xA65E	0xE6E3
-0xA65F	0xE6E4
-0xA660	0xE6E5
-0xA661	0xE6E6
-0xA662	0xE6E7
-0xA663	0xE6E8
-0xA664	0xE6E9
-0xA665	0xE6EA
-0xA666	0xE6EB
-0xA667	0xE6EC
-0xA668	0xE6ED
-0xA669	0xE6EE
-0xA66A	0xE6EF
-0xA66B	0xE6F0
-0xA66C	0xE6F1
-0xA66D	0xE6F2
-0xA66E	0xE6F3
-0xA66F	0xE6F4
-0xA670	0xE6F5
-0xA671	0xE6F6
-0xA672	0xE6F7
-0xA673	0xE6F8
-0xA674	0xE6F9
-0xA675	0xE6FA
-0xA676	0xE6FB
-0xA677	0xE6FC
-0xA678	0xE6FD
-0xA679	0xE6FE
-0xA67A	0xE6FF
-0xA67B	0xE700
-0xA67C	0xE701
-0xA67D	0xE702
-0xA67E	0xE703
-0xA680	0xE704
-0xA681	0xE705
-0xA682	0xE706
-0xA683	0xE707
-0xA684	0xE708
-0xA685	0xE709
-0xA686	0xE70A
-0xA687	0xE70B
-0xA688	0xE70C
-0xA689	0xE70D
-0xA68A	0xE70E
-0xA68B	0xE70F
-0xA68C	0xE710
-0xA68D	0xE711
-0xA68E	0xE712
-0xA68F	0xE713
-0xA690	0xE714
-0xA691	0xE715
-0xA692	0xE716
-0xA693	0xE717
-0xA694	0xE718
-0xA695	0xE719
-0xA696	0xE71A
-0xA697	0xE71B
-0xA698	0xE71C
-0xA699	0xE71D
-0xA69A	0xE71E
-0xA69B	0xE71F
-0xA69C	0xE720
-0xA69D	0xE721
-0xA69E	0xE722
-0xA69F	0xE723
-0xA6A0	0xE724
+0xA5F7	0xE77D
+0xA5F8	0xE77E
+0xA5F9	0xE77F
+0xA5FA	0xE780
+0xA5FB	0xE781
+0xA5FC	0xE782
+0xA5FD	0xE783
+0xA5FE	0xE784
+0xA640	0xE6A6
+0xA641	0xE6A7
+0xA642	0xE6A8
+0xA643	0xE6A9
+0xA644	0xE6AA
+0xA645	0xE6AB
+0xA646	0xE6AC
+0xA647	0xE6AD
+0xA648	0xE6AE
+0xA649	0xE6AF
+0xA64A	0xE6B0
+0xA64B	0xE6B1
+0xA64C	0xE6B2
+0xA64D	0xE6B3
+0xA64E	0xE6B4
+0xA64F	0xE6B5
+0xA650	0xE6B6
+0xA651	0xE6B7
+0xA652	0xE6B8
+0xA653	0xE6B9
+0xA654	0xE6BA
+0xA655	0xE6BB
+0xA656	0xE6BC
+0xA657	0xE6BD
+0xA658	0xE6BE
+0xA659	0xE6BF
+0xA65A	0xE6C0
+0xA65B	0xE6C1
+0xA65C	0xE6C2
+0xA65D	0xE6C3
+0xA65E	0xE6C4
+0xA65F	0xE6C5
+0xA660	0xE6C6
+0xA661	0xE6C7
+0xA662	0xE6C8
+0xA663	0xE6C9
+0xA664	0xE6CA
+0xA665	0xE6CB
+0xA666	0xE6CC
+0xA667	0xE6CD
+0xA668	0xE6CE
+0xA669	0xE6CF
+0xA66A	0xE6D0
+0xA66B	0xE6D1
+0xA66C	0xE6D2
+0xA66D	0xE6D3
+0xA66E	0xE6D4
+0xA66F	0xE6D5
+0xA670	0xE6D6
+0xA671	0xE6D7
+0xA672	0xE6D8
+0xA673	0xE6D9
+0xA674	0xE6DA
+0xA675	0xE6DB
+0xA676	0xE6DC
+0xA677	0xE6DD
+0xA678	0xE6DE
+0xA679	0xE6DF
+0xA67A	0xE6E0
+0xA67B	0xE6E1
+0xA67C	0xE6E2
+0xA67D	0xE6E3
+0xA67E	0xE6E4
+0xA680	0xE6E5
+0xA681	0xE6E6
+0xA682	0xE6E7
+0xA683	0xE6E8
+0xA684	0xE6E9
+0xA685	0xE6EA
+0xA686	0xE6EB
+0xA687	0xE6EC
+0xA688	0xE6ED
+0xA689	0xE6EE
+0xA68A	0xE6EF
+0xA68B	0xE6F0
+0xA68C	0xE6F1
+0xA68D	0xE6F2
+0xA68E	0xE6F3
+0xA68F	0xE6F4
+0xA690	0xE6F5
+0xA691	0xE6F6
+0xA692	0xE6F7
+0xA693	0xE6F8
+0xA694	0xE6F9
+0xA695	0xE6FA
+0xA696	0xE6FB
+0xA697	0xE6FC
+0xA698	0xE6FD
+0xA699	0xE6FE
+0xA69A	0xE6FF
+0xA69B	0xE700
+0xA69C	0xE701
+0xA69D	0xE702
+0xA69E	0xE703
+0xA69F	0xE704
+0xA6A0	0xE705
 0xA6A1	0x0391
 0xA6A2	0x0392
 0xA6A3	0x0393
@@ -7282,14 +7286,14 @@
 0xA6B6	0x03A7
 0xA6B7	0x03A8
 0xA6B8	0x03A9
-0xA6B9	0xE725
-0xA6BA	0xE726
-0xA6BB	0xE727
-0xA6BC	0xE728
-0xA6BD	0xE729
-0xA6BE	0xE72A
-0xA6BF	0xE72B
-0xA6C0	0xE72C
+0xA6B9	0xE785
+0xA6BA	0xE786
+0xA6BB	0xE787
+0xA6BC	0xE788
+0xA6BD	0xE789
+0xA6BE	0xE78A
+0xA6BF	0xE78B
+0xA6C0	0xE78C
 0xA6C1	0x03B1
 0xA6C2	0x03B2
 0xA6C3	0x03B3
@@ -7314,13 +7318,13 @@
 0xA6D6	0x03C7
 0xA6D7	0x03C8
 0xA6D8	0x03C9
-0xA6D9	0xE72D
-0xA6DA	0xE72E
-0xA6DB	0xE72F
-0xA6DC	0xE730
-0xA6DD	0xE731
-0xA6DE	0xE732
-0xA6DF	0xE733
+0xA6D9	0xE78D
+0xA6DA	0xE78E
+0xA6DB	0xE78F
+0xA6DC	0xE790
+0xA6DD	0xE791
+0xA6DE	0xE792
+0xA6DF	0xE793
 0xA6E0	0xFE35
 0xA6E1	0xFE36
 0xA6E2	0xFE39
@@ -7333,121 +7337,121 @@
 0xA6E9	0xFE42
 0xA6EA	0xFE43
 0xA6EB	0xFE44
-0xA6EC	0xE734
-0xA6ED	0xE735
+0xA6EC	0xE794
+0xA6ED	0xE795
 0xA6EE	0xFE3B
 0xA6EF	0xFE3C
 0xA6F0	0xFE37
 0xA6F1	0xFE38
 0xA6F2	0xFE31
-0xA6F3	0xE736
+0xA6F3	0xE796
 0xA6F4	0xFE33
 0xA6F5	0xFE34
-0xA6F6	0xE737
-0xA6F7	0xE738
-0xA6F8	0xE739
-0xA6F9	0xE73A
-0xA6FA	0xE73B
-0xA6FB	0xE73C
-0xA6FC	0xE73D
-0xA6FD	0xE73E
-0xA6FE	0xE73F
-0xA740	0xE740
-0xA741	0xE741
-0xA742	0xE742
-0xA743	0xE743
-0xA744	0xE744
-0xA745	0xE745
-0xA746	0xE746
-0xA747	0xE747
-0xA748	0xE748
-0xA749	0xE749
-0xA74A	0xE74A
-0xA74B	0xE74B
-0xA74C	0xE74C
-0xA74D	0xE74D
-0xA74E	0xE74E
-0xA74F	0xE74F
-0xA750	0xE750
-0xA751	0xE751
-0xA752	0xE752
-0xA753	0xE753
-0xA754	0xE754
-0xA755	0xE755
-0xA756	0xE756
-0xA757	0xE757
-0xA758	0xE758
-0xA759	0xE759
-0xA75A	0xE75A
-0xA75B	0xE75B
-0xA75C	0xE75C
-0xA75D	0xE75D
-0xA75E	0xE75E
-0xA75F	0xE75F
-0xA760	0xE760
-0xA761	0xE761
-0xA762	0xE762
-0xA763	0xE763
-0xA764	0xE764
-0xA765	0xE765
-0xA766	0xE766
-0xA767	0xE767
-0xA768	0xE768
-0xA769	0xE769
-0xA76A	0xE76A
-0xA76B	0xE76B
-0xA76C	0xE76C
-0xA76D	0xE76D
-0xA76E	0xE76E
-0xA76F	0xE76F
-0xA770	0xE770
-0xA771	0xE771
-0xA772	0xE772
-0xA773	0xE773
-0xA774	0xE774
-0xA775	0xE775
-0xA776	0xE776
-0xA777	0xE777
-0xA778	0xE778
-0xA779	0xE779
-0xA77A	0xE77A
-0xA77B	0xE77B
-0xA77C	0xE77C
-0xA77D	0xE77D
-0xA77E	0xE77E
-0xA780	0xE77F
-0xA781	0xE780
-0xA782	0xE781
-0xA783	0xE782
-0xA784	0xE783
-0xA785	0xE784
-0xA786	0xE785
-0xA787	0xE786
-0xA788	0xE787
-0xA789	0xE788
-0xA78A	0xE789
-0xA78B	0xE78A
-0xA78C	0xE78B
-0xA78D	0xE78C
-0xA78E	0xE78D
-0xA78F	0xE78E
-0xA790	0xE78F
-0xA791	0xE790
-0xA792	0xE791
-0xA793	0xE792
-0xA794	0xE793
-0xA795	0xE794
-0xA796	0xE795
-0xA797	0xE796
-0xA798	0xE797
-0xA799	0xE798
-0xA79A	0xE799
-0xA79B	0xE79A
-0xA79C	0xE79B
-0xA79D	0xE79C
-0xA79E	0xE79D
-0xA79F	0xE79E
-0xA7A0	0xE79F
+0xA6F6	0xE797
+0xA6F7	0xE798
+0xA6F8	0xE799
+0xA6F9	0xE79A
+0xA6FA	0xE79B
+0xA6FB	0xE79C
+0xA6FC	0xE79D
+0xA6FD	0xE79E
+0xA6FE	0xE79F
+0xA740	0xE706
+0xA741	0xE707
+0xA742	0xE708
+0xA743	0xE709
+0xA744	0xE70A
+0xA745	0xE70B
+0xA746	0xE70C
+0xA747	0xE70D
+0xA748	0xE70E
+0xA749	0xE70F
+0xA74A	0xE710
+0xA74B	0xE711
+0xA74C	0xE712
+0xA74D	0xE713
+0xA74E	0xE714
+0xA74F	0xE715
+0xA750	0xE716
+0xA751	0xE717
+0xA752	0xE718
+0xA753	0xE719
+0xA754	0xE71A
+0xA755	0xE71B
+0xA756	0xE71C
+0xA757	0xE71D
+0xA758	0xE71E
+0xA759	0xE71F
+0xA75A	0xE720
+0xA75B	0xE721
+0xA75C	0xE722
+0xA75D	0xE723
+0xA75E	0xE724
+0xA75F	0xE725
+0xA760	0xE726
+0xA761	0xE727
+0xA762	0xE728
+0xA763	0xE729
+0xA764	0xE72A
+0xA765	0xE72B
+0xA766	0xE72C
+0xA767	0xE72D
+0xA768	0xE72E
+0xA769	0xE72F
+0xA76A	0xE730
+0xA76B	0xE731
+0xA76C	0xE732
+0xA76D	0xE733
+0xA76E	0xE734
+0xA76F	0xE735
+0xA770	0xE736
+0xA771	0xE737
+0xA772	0xE738
+0xA773	0xE739
+0xA774	0xE73A
+0xA775	0xE73B
+0xA776	0xE73C
+0xA777	0xE73D
+0xA778	0xE73E
+0xA779	0xE73F
+0xA77A	0xE740
+0xA77B	0xE741
+0xA77C	0xE742
+0xA77D	0xE743
+0xA77E	0xE744
+0xA780	0xE745
+0xA781	0xE746
+0xA782	0xE747
+0xA783	0xE748
+0xA784	0xE749
+0xA785	0xE74A
+0xA786	0xE74B
+0xA787	0xE74C
+0xA788	0xE74D
+0xA789	0xE74E
+0xA78A	0xE74F
+0xA78B	0xE750
+0xA78C	0xE751
+0xA78D	0xE752
+0xA78E	0xE753
+0xA78F	0xE754
+0xA790	0xE755
+0xA791	0xE756
+0xA792	0xE757
+0xA793	0xE758
+0xA794	0xE759
+0xA795	0xE75A
+0xA796	0xE75B
+0xA797	0xE75C
+0xA798	0xE75D
+0xA799	0xE75E
+0xA79A	0xE75F
+0xA79B	0xE760
+0xA79C	0xE761
+0xA79D	0xE762
+0xA79E	0xE763
+0xA79F	0xE764
+0xA7A0	0xE765
 0xA7A1	0x0410
 0xA7A2	0x0411
 0xA7A3	0x0412
--- a/make/tools/CharsetMapping/MS936.map	Wed Jun 19 21:51:50 2013 -0700
+++ b/make/tools/CharsetMapping/MS936.map	Fri Jun 21 19:11:42 2013 -0700
@@ -1,31 +1,8 @@
-# Copy/pasted from MS936.b2c
-#
-# This table comes from MS CP936 table posted on unicode.org webpage
-# with the modifications of 
 #
-# (1)added Euro sign
-#      0x80 - 0x20ac
-# (2)removed DBCS lead byte entries 
-#      0x80 - 0xff  
-# (3)added GBK UDC block (1894)
-#      0xAAA1 - 0xAFFE  U+E000 - U+E233
-#      0xF8A1 - 0xFEFE  U+E234 - U+E4C5
-#      0xA140 - 0xA7A0  U+E4C6 - U+E79F
-# (4)added Microsoft defined "not GBK" EUDC
-#     a:  u+E586 - u+E591
-#     b:  u+E652 - u+E65C 
-#     c:  u+E6BD - u+E6C4
-#     d:  u+E725 - u+E73F
-#     e:  u+E7A0 - u+E864
-# 
-#    Mapping of (3) and (4) comes from Masayuki Fuse at FUSE@jp.ibm.com
+# This table comes from MultiByteToWideChar, the only entry
+# not included is
 #
-#    Format: Three tab-separated columns
-#        Column #1 is the cp936 code (in hex)
-#        Column #2 is the Unicode (in hex as 0xXXXX)
-#        Column #3 is the Unicode name (follows a comment sign, '#')
-#
-#    The entries are in unicode order
+# 0xFF	0xF8F5
 #
 0x00	0x0000
 0x01	0x0001
@@ -6533,12 +6510,12 @@
 0xA2A8	0x2177  #SMALL ROMAN NUMERAL EIGHT
 0xA2A9	0x2178  #SMALL ROMAN NUMERAL NINE
 0xA2AA	0x2179  #SMALL ROMAN NUMERAL TEN
-0xA2AB  0xE586  #PRIVATE USE AREA-E586
-0xA2AC  0xE587  #PRIVATE USE AREA-E587
-0xA2AD  0xE588  #PRIVATE USE AREA-E588
-0xA2AE  0xE589  #PRIVATE USE AREA-E589
-0xA2AF  0xE58A  #PRIVATE USE AREA-E58A
-0xA2B0  0xE58B  #PRIVATE USE AREA-E58B
+0xA2AB  0xE766  #PRIVATE USE AREA-E766
+0xA2AC  0xE767  #PRIVATE USE AREA-E767
+0xA2AD  0xE768  #PRIVATE USE AREA-E768
+0xA2AE  0xE769  #PRIVATE USE AREA-E769
+0xA2AF  0xE76A  #PRIVATE USE AREA-E76A
+0xA2B0  0xE76B  #PRIVATE USE AREA-E76B
 0xA2B1	0x2488  #DIGIT ONE FULL STOP
 0xA2B2	0x2489  #DIGIT TWO FULL STOP
 0xA2B3	0x248A  #DIGIT THREE FULL STOP
@@ -6589,8 +6566,8 @@
 0xA2E0	0x2467  #CIRCLED DIGIT EIGHT
 0xA2E1	0x2468  #CIRCLED DIGIT NINE
 0xA2E2	0x2469  #CIRCLED NUMBER TEN
-0xA2E3  0xE58C  #PRIVATE USE AREA-E58C
-0xA2E4  0xE58D  #PRIVATE USE AREA-E58D
+0xA2E3  0xE76C  #PRIVATE USE AREA-E76C
+0xA2E4  0xE76D  #PRIVATE USE AREA-E76D
 0xA2E5	0x3220  #PARENTHESIZED IDEOGRAPH ONE
 0xA2E6	0x3221  #PARENTHESIZED IDEOGRAPH TWO
 0xA2E7	0x3222  #PARENTHESIZED IDEOGRAPH THREE
@@ -6601,8 +6578,8 @@
 0xA2EC	0x3227  #PARENTHESIZED IDEOGRAPH EIGHT
 0xA2ED	0x3228  #PARENTHESIZED IDEOGRAPH NINE
 0xA2EE	0x3229  #PARENTHESIZED IDEOGRAPH TEN
-0xA2EF  0xE58E  #PRIVATE USE AREA-E58E
-0xA2F0  0xE58F  #PRIVATE USE AREA-E58F
+0xA2EF  0xE76E  #PRIVATE USE AREA-E76E
+0xA2F0  0xE76F  #PRIVATE USE AREA-E76F
 0xA2F1	0x2160  #ROMAN NUMERAL ONE
 0xA2F2	0x2161  #ROMAN NUMERAL TWO
 0xA2F3	0x2162  #ROMAN NUMERAL THREE
@@ -6615,104 +6592,104 @@
 0xA2FA	0x2169  #ROMAN NUMERAL TEN
 0xA2FB	0x216A  #ROMAN NUMERAL ELEVEN
 0xA2FC	0x216B  #ROMAN NUMERAL TWELVE
-0xA2FD  0xE590  #PRIVATE USE AREA-E590
-0xA2FE  0xE591  #PRIVATE USE AREA-E591
-0xA340  0xE592  #PRIVATE USE AREA-E592
-0xA341  0xE593  #PRIVATE USE AREA-E593
-0xA342  0xE594  #PRIVATE USE AREA-E594
-0xA343  0xE595  #PRIVATE USE AREA-E595
-0xA344  0xE596  #PRIVATE USE AREA-E596
-0xA345  0xE597  #PRIVATE USE AREA-E597
-0xA346  0xE598  #PRIVATE USE AREA-E598
-0xA347  0xE599  #PRIVATE USE AREA-E599
-0xA348  0xE59A  #PRIVATE USE AREA-E59A
-0xA349  0xE59B  #PRIVATE USE AREA-E59B
-0xA34A  0xE59C  #PRIVATE USE AREA-E59C
-0xA34B  0xE59D  #PRIVATE USE AREA-E59D
-0xA34C  0xE59E  #PRIVATE USE AREA-E59E
-0xA34D  0xE59F  #PRIVATE USE AREA-E59F
-0xA34E  0xE5A0  #PRIVATE USE AREA-E5A0
-0xA34F  0xE5A1  #PRIVATE USE AREA-E5A1
-0xA350  0xE5A2  #PRIVATE USE AREA-E5A2
-0xA351  0xE5A3  #PRIVATE USE AREA-E5A3
-0xA352  0xE5A4  #PRIVATE USE AREA-E5A4
-0xA353  0xE5A5  #PRIVATE USE AREA-E5A5
-0xA354  0xE5A6  #PRIVATE USE AREA-E5A6
-0xA355  0xE5A7  #PRIVATE USE AREA-E5A7
-0xA356  0xE5A8  #PRIVATE USE AREA-E5A8
-0xA357  0xE5A9  #PRIVATE USE AREA-E5A9
-0xA358  0xE5AA  #PRIVATE USE AREA-E5AA
-0xA359  0xE5AB  #PRIVATE USE AREA-E5AB
-0xA35A  0xE5AC  #PRIVATE USE AREA-E5AC
-0xA35B  0xE5AD  #PRIVATE USE AREA-E5AD
-0xA35C  0xE5AE  #PRIVATE USE AREA-E5AE
-0xA35D  0xE5AF  #PRIVATE USE AREA-E5AF
-0xA35E  0xE5B0  #PRIVATE USE AREA-E5B0
-0xA35F  0xE5B1  #PRIVATE USE AREA-E5B1
-0xA360  0xE5B2  #PRIVATE USE AREA-E5B2
-0xA361  0xE5B3  #PRIVATE USE AREA-E5B3
-0xA362  0xE5B4  #PRIVATE USE AREA-E5B4
-0xA363  0xE5B5  #PRIVATE USE AREA-E5B5
-0xA364  0xE5B6  #PRIVATE USE AREA-E5B6
-0xA365  0xE5B7  #PRIVATE USE AREA-E5B7
-0xA366  0xE5B8  #PRIVATE USE AREA-E5B8
-0xA367  0xE5B9  #PRIVATE USE AREA-E5B9
-0xA368  0xE5BA  #PRIVATE USE AREA-E5BA
-0xA369  0xE5BB  #PRIVATE USE AREA-E5BB
-0xA36A  0xE5BC  #PRIVATE USE AREA-E5BC
-0xA36B  0xE5BD  #PRIVATE USE AREA-E5BD
-0xA36C  0xE5BE  #PRIVATE USE AREA-E5BE
-0xA36D  0xE5BF  #PRIVATE USE AREA-E5BF
-0xA36E  0xE5C0  #PRIVATE USE AREA-E5C0
-0xA36F  0xE5C1  #PRIVATE USE AREA-E5C1
-0xA370  0xE5C2  #PRIVATE USE AREA-E5C2
-0xA371  0xE5C3  #PRIVATE USE AREA-E5C3
-0xA372  0xE5C4  #PRIVATE USE AREA-E5C4
-0xA373  0xE5C5  #PRIVATE USE AREA-E5C5
-0xA374  0xE5C6  #PRIVATE USE AREA-E5C6
-0xA375  0xE5C7  #PRIVATE USE AREA-E5C7
-0xA376  0xE5C8  #PRIVATE USE AREA-E5C8
-0xA377  0xE5C9  #PRIVATE USE AREA-E5C9
-0xA378  0xE5CA  #PRIVATE USE AREA-E5CA
-0xA379  0xE5CB  #PRIVATE USE AREA-E5CB
-0xA37A  0xE5CC  #PRIVATE USE AREA-E5CC
-0xA37B  0xE5CD  #PRIVATE USE AREA-E5CD
-0xA37C  0xE5CE  #PRIVATE USE AREA-E5CE
-0xA37D  0xE5CF  #PRIVATE USE AREA-E5CF
-0xA37E  0xE5D0  #PRIVATE USE AREA-E5D0
-0xA380  0xE5D1  #PRIVATE USE AREA-E5D1
-0xA381  0xE5D2  #PRIVATE USE AREA-E5D2
-0xA382  0xE5D3  #PRIVATE USE AREA-E5D3
-0xA383  0xE5D4  #PRIVATE USE AREA-E5D4
-0xA384  0xE5D5  #PRIVATE USE AREA-E5D5
-0xA385  0xE5D6  #PRIVATE USE AREA-E5D6
-0xA386  0xE5D7  #PRIVATE USE AREA-E5D7
-0xA387  0xE5D8  #PRIVATE USE AREA-E5D8
-0xA388  0xE5D9  #PRIVATE USE AREA-E5D9
-0xA389  0xE5DA  #PRIVATE USE AREA-E5DA
-0xA38A  0xE5DB  #PRIVATE USE AREA-E5DB
-0xA38B  0xE5DC  #PRIVATE USE AREA-E5DC
-0xA38C  0xE5DD  #PRIVATE USE AREA-E5DD
-0xA38D  0xE5DE  #PRIVATE USE AREA-E5DE
-0xA38E  0xE5DF  #PRIVATE USE AREA-E5DF
-0xA38F  0xE5E0  #PRIVATE USE AREA-E5E0
-0xA390  0xE5E1  #PRIVATE USE AREA-E5E1
-0xA391  0xE5E2  #PRIVATE USE AREA-E5E2
-0xA392  0xE5E3  #PRIVATE USE AREA-E5E3
-0xA393  0xE5E4  #PRIVATE USE AREA-E5E4
-0xA394  0xE5E5  #PRIVATE USE AREA-E5E5
-0xA395  0xE5E6  #PRIVATE USE AREA-E5E6
-0xA396  0xE5E7  #PRIVATE USE AREA-E5E7
-0xA397  0xE5E8  #PRIVATE USE AREA-E5E8
-0xA398  0xE5E9  #PRIVATE USE AREA-E5E9
-0xA399  0xE5EA  #PRIVATE USE AREA-E5EA
-0xA39A  0xE5EB  #PRIVATE USE AREA-E5EB
-0xA39B  0xE5EC  #PRIVATE USE AREA-E5EC
-0xA39C  0xE5ED  #PRIVATE USE AREA-E5ED
-0xA39D  0xE5EE  #PRIVATE USE AREA-E5EE
-0xA39E  0xE5EF  #PRIVATE USE AREA-E5EF
-0xA39F  0xE5F0  #PRIVATE USE AREA-E5F0
-0xA3A0  0xE5F1  #PRIVATE USE AREA-E5F1
+0xA2FD  0xE770  #PRIVATE USE AREA-E770
+0xA2FE  0xE771  #PRIVATE USE AREA-E771
+0xA340  0xE586  #PRIVATE USE AREA-E586
+0xA341  0xE587  #PRIVATE USE AREA-E587
+0xA342  0xE588  #PRIVATE USE AREA-E588
+0xA343  0xE589  #PRIVATE USE AREA-E589
+0xA344  0xE58A  #PRIVATE USE AREA-E58A
+0xA345  0xE58B  #PRIVATE USE AREA-E58B
+0xA346  0xE58C  #PRIVATE USE AREA-E58C
+0xA347  0xE58D  #PRIVATE USE AREA-E58D
+0xA348  0xE58E  #PRIVATE USE AREA-E58E
+0xA349  0xE58F  #PRIVATE USE AREA-E58F
+0xA34A  0xE590  #PRIVATE USE AREA-E590
+0xA34B  0xE591  #PRIVATE USE AREA-E591
+0xA34C  0xE592  #PRIVATE USE AREA-E592
+0xA34D  0xE593  #PRIVATE USE AREA-E593
+0xA34E  0xE594  #PRIVATE USE AREA-E594
+0xA34F  0xE595  #PRIVATE USE AREA-E595
+0xA350  0xE596  #PRIVATE USE AREA-E596
+0xA351  0xE597  #PRIVATE USE AREA-E597
+0xA352  0xE598  #PRIVATE USE AREA-E598
+0xA353  0xE599  #PRIVATE USE AREA-E599
+0xA354  0xE59A  #PRIVATE USE AREA-E59A
+0xA355  0xE59B  #PRIVATE USE AREA-E59B
+0xA356  0xE59C  #PRIVATE USE AREA-E59C
+0xA357  0xE59D  #PRIVATE USE AREA-E59D
+0xA358  0xE59E  #PRIVATE USE AREA-E59E
+0xA359  0xE59F  #PRIVATE USE AREA-E59F
+0xA35A  0xE5A0  #PRIVATE USE AREA-E5A0
+0xA35B  0xE5A1  #PRIVATE USE AREA-E5A1
+0xA35C  0xE5A2  #PRIVATE USE AREA-E5A2
+0xA35D  0xE5A3  #PRIVATE USE AREA-E5A3
+0xA35E  0xE5A4  #PRIVATE USE AREA-E5A4
+0xA35F  0xE5A5  #PRIVATE USE AREA-E5A5
+0xA360  0xE5A6  #PRIVATE USE AREA-E5A6
+0xA361  0xE5A7  #PRIVATE USE AREA-E5A7
+0xA362  0xE5A8  #PRIVATE USE AREA-E5A8
+0xA363  0xE5A9  #PRIVATE USE AREA-E5A9
+0xA364  0xE5AA  #PRIVATE USE AREA-E5AA
+0xA365  0xE5AB  #PRIVATE USE AREA-E5AB
+0xA366  0xE5AC  #PRIVATE USE AREA-E5AC
+0xA367  0xE5AD  #PRIVATE USE AREA-E5AD
+0xA368  0xE5AE  #PRIVATE USE AREA-E5AE
+0xA369  0xE5AF  #PRIVATE USE AREA-E5AF
+0xA36A  0xE5B0  #PRIVATE USE AREA-E5B0
+0xA36B  0xE5B1  #PRIVATE USE AREA-E5B1
+0xA36C  0xE5B2  #PRIVATE USE AREA-E5B2
+0xA36D  0xE5B3  #PRIVATE USE AREA-E5B3
+0xA36E  0xE5B4  #PRIVATE USE AREA-E5B4
+0xA36F  0xE5B5  #PRIVATE USE AREA-E5B5
+0xA370  0xE5B6  #PRIVATE USE AREA-E5B6
+0xA371  0xE5B7  #PRIVATE USE AREA-E5B7
+0xA372  0xE5B8  #PRIVATE USE AREA-E5B8
+0xA373  0xE5B9  #PRIVATE USE AREA-E5B9
+0xA374  0xE5BA  #PRIVATE USE AREA-E5BA
+0xA375  0xE5BB  #PRIVATE USE AREA-E5BB
+0xA376  0xE5BC  #PRIVATE USE AREA-E5BC
+0xA377  0xE5BD  #PRIVATE USE AREA-E5BD
+0xA378  0xE5BE  #PRIVATE USE AREA-E5BE
+0xA379  0xE5BF  #PRIVATE USE AREA-E5BF
+0xA37A  0xE5C0  #PRIVATE USE AREA-E5C0
+0xA37B  0xE5C1  #PRIVATE USE AREA-E5C1
+0xA37C  0xE5C2  #PRIVATE USE AREA-E5C2
+0xA37D  0xE5C3  #PRIVATE USE AREA-E5C3
+0xA37E  0xE5C4  #PRIVATE USE AREA-E5C4
+0xA380  0xE5C5  #PRIVATE USE AREA-E5C5
+0xA381  0xE5C6  #PRIVATE USE AREA-E5C6
+0xA382  0xE5C7  #PRIVATE USE AREA-E5C7
+0xA383  0xE5C8  #PRIVATE USE AREA-E5C8
+0xA384  0xE5C9  #PRIVATE USE AREA-E5C9
+0xA385  0xE5CA  #PRIVATE USE AREA-E5CA
+0xA386  0xE5CB  #PRIVATE USE AREA-E5CB
+0xA387  0xE5CC  #PRIVATE USE AREA-E5CC
+0xA388  0xE5CD  #PRIVATE USE AREA-E5CD
+0xA389  0xE5CE  #PRIVATE USE AREA-E5CE
+0xA38A  0xE5CF  #PRIVATE USE AREA-E5CF
+0xA38B  0xE5D0  #PRIVATE USE AREA-E5D0
+0xA38C  0xE5D1  #PRIVATE USE AREA-E5D1
+0xA38D  0xE5D2  #PRIVATE USE AREA-E5D2
+0xA38E  0xE5D3  #PRIVATE USE AREA-E5D3
+0xA38F  0xE5D4  #PRIVATE USE AREA-E5D4
+0xA390  0xE5D5  #PRIVATE USE AREA-E5D5
+0xA391  0xE5D6  #PRIVATE USE AREA-E5D6
+0xA392  0xE5D7  #PRIVATE USE AREA-E5D7
+0xA393  0xE5D8  #PRIVATE USE AREA-E5D8
+0xA394  0xE5D9  #PRIVATE USE AREA-E5D9
+0xA395  0xE5DA  #PRIVATE USE AREA-E5DA
+0xA396  0xE5DB  #PRIVATE USE AREA-E5DB
+0xA397  0xE5DC  #PRIVATE USE AREA-E5DC
+0xA398  0xE5DD  #PRIVATE USE AREA-E5DD
+0xA399  0xE5DE  #PRIVATE USE AREA-E5DE
+0xA39A  0xE5DF  #PRIVATE USE AREA-E5DF
+0xA39B  0xE5E0  #PRIVATE USE AREA-E5E0
+0xA39C  0xE5E1  #PRIVATE USE AREA-E5E1
+0xA39D  0xE5E2  #PRIVATE USE AREA-E5E2
+0xA39E  0xE5E3  #PRIVATE USE AREA-E5E3
+0xA39F  0xE5E4  #PRIVATE USE AREA-E5E4
+0xA3A0  0xE5E5  #PRIVATE USE AREA-E5E5
 0xA3A1	0xFF01  #FULLWIDTH EXCLAMATION MARK
 0xA3A2	0xFF02  #FULLWIDTH QUOTATION MARK
 0xA3A3	0xFF03  #FULLWIDTH NUMBER SIGN
@@ -6807,102 +6784,102 @@
 0xA3FC	0xFF5C  #FULLWIDTH VERTICAL LINE
 0xA3FD	0xFF5D  #FULLWIDTH RIGHT CURLY BRACKET
 0xA3FE	0xFFE3  #FULLWIDTH MACRON
-0xA440  0xE5F2  #PRIVATE USE AREA-E5F2
-0xA441  0xE5F3  #PRIVATE USE AREA-E5F3
-0xA442  0xE5F4  #PRIVATE USE AREA-E5F4
-0xA443  0xE5F5  #PRIVATE USE AREA-E5F5
-0xA444  0xE5F6  #PRIVATE USE AREA-E5F6
-0xA445  0xE5F7  #PRIVATE USE AREA-E5F7
-0xA446  0xE5F8  #PRIVATE USE AREA-E5F8
-0xA447  0xE5F9  #PRIVATE USE AREA-E5F9
-0xA448  0xE5FA  #PRIVATE USE AREA-E5FA
-0xA449  0xE5FB  #PRIVATE USE AREA-E5FB
-0xA44A  0xE5FC  #PRIVATE USE AREA-E5FC
-0xA44B  0xE5FD  #PRIVATE USE AREA-E5FD
-0xA44C  0xE5FE  #PRIVATE USE AREA-E5FE
-0xA44D  0xE5FF  #PRIVATE USE AREA-E5FF
-0xA44E  0xE600  #PRIVATE USE AREA-E600
-0xA44F  0xE601  #PRIVATE USE AREA-E601
-0xA450  0xE602  #PRIVATE USE AREA-E602
-0xA451  0xE603  #PRIVATE USE AREA-E603
-0xA452  0xE604  #PRIVATE USE AREA-E604
-0xA453  0xE605  #PRIVATE USE AREA-E605
-0xA454  0xE606  #PRIVATE USE AREA-E606
-0xA455  0xE607  #PRIVATE USE AREA-E607
-0xA456  0xE608  #PRIVATE USE AREA-E608
-0xA457  0xE609  #PRIVATE USE AREA-E609
-0xA458  0xE60A  #PRIVATE USE AREA-E60A
-0xA459  0xE60B  #PRIVATE USE AREA-E60B
-0xA45A  0xE60C  #PRIVATE USE AREA-E60C
-0xA45B  0xE60D  #PRIVATE USE AREA-E60D
-0xA45C  0xE60E  #PRIVATE USE AREA-E60E
-0xA45D  0xE60F  #PRIVATE USE AREA-E60F
-0xA45E  0xE610  #PRIVATE USE AREA-E610
-0xA45F  0xE611  #PRIVATE USE AREA-E611
-0xA460  0xE612  #PRIVATE USE AREA-E612
-0xA461  0xE613  #PRIVATE USE AREA-E613
-0xA462  0xE614  #PRIVATE USE AREA-E614
-0xA463  0xE615  #PRIVATE USE AREA-E615
-0xA464  0xE616  #PRIVATE USE AREA-E616
-0xA465  0xE617  #PRIVATE USE AREA-E617
-0xA466  0xE618  #PRIVATE USE AREA-E618
-0xA467  0xE619  #PRIVATE USE AREA-E619
-0xA468  0xE61A  #PRIVATE USE AREA-E61A
-0xA469  0xE61B  #PRIVATE USE AREA-E61B
-0xA46A  0xE61C  #PRIVATE USE AREA-E61C
-0xA46B  0xE61D  #PRIVATE USE AREA-E61D
-0xA46C  0xE61E  #PRIVATE USE AREA-E61E
-0xA46D  0xE61F  #PRIVATE USE AREA-E61F
-0xA46E  0xE620  #PRIVATE USE AREA-E620
-0xA46F  0xE621  #PRIVATE USE AREA-E621
-0xA470  0xE622  #PRIVATE USE AREA-E622
-0xA471  0xE623  #PRIVATE USE AREA-E623
-0xA472  0xE624  #PRIVATE USE AREA-E624
-0xA473  0xE625  #PRIVATE USE AREA-E625
-0xA474  0xE626  #PRIVATE USE AREA-E626
-0xA475  0xE627  #PRIVATE USE AREA-E627
-0xA476  0xE628  #PRIVATE USE AREA-E628
-0xA477  0xE629  #PRIVATE USE AREA-E629
-0xA478  0xE62A  #PRIVATE USE AREA-E62A
-0xA479  0xE62B  #PRIVATE USE AREA-E62B
-0xA47A  0xE62C  #PRIVATE USE AREA-E62C
-0xA47B  0xE62D  #PRIVATE USE AREA-E62D
-0xA47C  0xE62E  #PRIVATE USE AREA-E62E
-0xA47D  0xE62F  #PRIVATE USE AREA-E62F
-0xA47E  0xE630  #PRIVATE USE AREA-E630
-0xA480  0xE631  #PRIVATE USE AREA-E631
-0xA481  0xE632  #PRIVATE USE AREA-E632
-0xA482  0xE633  #PRIVATE USE AREA-E633
-0xA483  0xE634  #PRIVATE USE AREA-E634
-0xA484  0xE635  #PRIVATE USE AREA-E635
-0xA485  0xE636  #PRIVATE USE AREA-E636
-0xA486  0xE637  #PRIVATE USE AREA-E637
-0xA487  0xE638  #PRIVATE USE AREA-E638
-0xA488  0xE639  #PRIVATE USE AREA-E639
-0xA489  0xE63A  #PRIVATE USE AREA-E63A
-0xA48A  0xE63B  #PRIVATE USE AREA-E63B
-0xA48B  0xE63C  #PRIVATE USE AREA-E63C
-0xA48C  0xE63D  #PRIVATE USE AREA-E63D
-0xA48D  0xE63E  #PRIVATE USE AREA-E63E
-0xA48E  0xE63F  #PRIVATE USE AREA-E63F
-0xA48F  0xE640  #PRIVATE USE AREA-E640
-0xA490  0xE641  #PRIVATE USE AREA-E641
-0xA491  0xE642  #PRIVATE USE AREA-E642
-0xA492  0xE643  #PRIVATE USE AREA-E643
-0xA493  0xE644  #PRIVATE USE AREA-E644
-0xA494  0xE645  #PRIVATE USE AREA-E645
-0xA495  0xE646  #PRIVATE USE AREA-E646
-0xA496  0xE647  #PRIVATE USE AREA-E647
-0xA497  0xE648  #PRIVATE USE AREA-E648
-0xA498  0xE649  #PRIVATE USE AREA-E649
-0xA499  0xE64A  #PRIVATE USE AREA-E64A
-0xA49A  0xE64B  #PRIVATE USE AREA-E64B
-0xA49B  0xE64C  #PRIVATE USE AREA-E64C
-0xA49C  0xE64D  #PRIVATE USE AREA-E64D
-0xA49D  0xE64E  #PRIVATE USE AREA-E64E
-0xA49E  0xE64F  #PRIVATE USE AREA-E64F
-0xA49F  0xE650  #PRIVATE USE AREA-E650
-0xA4A0  0xE651  #PRIVATE USE AREA-E651
+0xA440  0xE5E6  #PRIVATE USE AREA-E5E6
+0xA441  0xE5E7  #PRIVATE USE AREA-E5E7
+0xA442  0xE5E8  #PRIVATE USE AREA-E5E8
+0xA443  0xE5E9  #PRIVATE USE AREA-E5E9
+0xA444  0xE5EA  #PRIVATE USE AREA-E5EA
+0xA445  0xE5EB  #PRIVATE USE AREA-E5EB
+0xA446  0xE5EC  #PRIVATE USE AREA-E5EC
+0xA447  0xE5ED  #PRIVATE USE AREA-E5ED
+0xA448  0xE5EE  #PRIVATE USE AREA-E5EE
+0xA449  0xE5EF  #PRIVATE USE AREA-E5EF
+0xA44A  0xE5F0  #PRIVATE USE AREA-E5F0
+0xA44B  0xE5F1  #PRIVATE USE AREA-E5F1
+0xA44C  0xE5F2  #PRIVATE USE AREA-E5F2
+0xA44D  0xE5F3  #PRIVATE USE AREA-E5F3
+0xA44E  0xE5F4  #PRIVATE USE AREA-E5F4
+0xA44F  0xE5F5  #PRIVATE USE AREA-E5F5
+0xA450  0xE5F6  #PRIVATE USE AREA-E5F6
+0xA451  0xE5F7  #PRIVATE USE AREA-E5F7
+0xA452  0xE5F8  #PRIVATE USE AREA-E5F8
+0xA453  0xE5F9  #PRIVATE USE AREA-E5F9
+0xA454  0xE5FA  #PRIVATE USE AREA-E5FA
+0xA455  0xE5FB  #PRIVATE USE AREA-E5FB
+0xA456  0xE5FC  #PRIVATE USE AREA-E5FC
+0xA457  0xE5FD  #PRIVATE USE AREA-E5FD
+0xA458  0xE5FE  #PRIVATE USE AREA-E5FE
+0xA459  0xE5FF  #PRIVATE USE AREA-E5FF
+0xA45A  0xE600  #PRIVATE USE AREA-E600
+0xA45B  0xE601  #PRIVATE USE AREA-E601
+0xA45C  0xE602  #PRIVATE USE AREA-E602
+0xA45D  0xE603  #PRIVATE USE AREA-E603
+0xA45E  0xE604  #PRIVATE USE AREA-E604
+0xA45F  0xE605  #PRIVATE USE AREA-E605
+0xA460  0xE606  #PRIVATE USE AREA-E606
+0xA461  0xE607  #PRIVATE USE AREA-E607
+0xA462  0xE608  #PRIVATE USE AREA-E608
+0xA463  0xE609  #PRIVATE USE AREA-E609
+0xA464  0xE60A  #PRIVATE USE AREA-E60A
+0xA465  0xE60B  #PRIVATE USE AREA-E60B
+0xA466  0xE60C  #PRIVATE USE AREA-E60C
+0xA467  0xE60D  #PRIVATE USE AREA-E60D
+0xA468  0xE60E  #PRIVATE USE AREA-E60E
+0xA469  0xE60F  #PRIVATE USE AREA-E60F
+0xA46A  0xE610  #PRIVATE USE AREA-E610
+0xA46B  0xE611  #PRIVATE USE AREA-E611
+0xA46C  0xE612  #PRIVATE USE AREA-E612
+0xA46D  0xE613  #PRIVATE USE AREA-E613
+0xA46E  0xE614  #PRIVATE USE AREA-E614
+0xA46F  0xE615  #PRIVATE USE AREA-E615
+0xA470  0xE616  #PRIVATE USE AREA-E616
+0xA471  0xE617  #PRIVATE USE AREA-E617
+0xA472  0xE618  #PRIVATE USE AREA-E618
+0xA473  0xE619  #PRIVATE USE AREA-E619
+0xA474  0xE61A  #PRIVATE USE AREA-E61A
+0xA475  0xE61B  #PRIVATE USE AREA-E61B
+0xA476  0xE61C  #PRIVATE USE AREA-E61C
+0xA477  0xE61D  #PRIVATE USE AREA-E61D
+0xA478  0xE61E  #PRIVATE USE AREA-E61E
+0xA479  0xE61F  #PRIVATE USE AREA-E61F
+0xA47A  0xE620  #PRIVATE USE AREA-E620
+0xA47B  0xE621  #PRIVATE USE AREA-E621
+0xA47C  0xE622  #PRIVATE USE AREA-E622
+0xA47D  0xE623  #PRIVATE USE AREA-E623
+0xA47E  0xE624  #PRIVATE USE AREA-E624
+0xA480  0xE625  #PRIVATE USE AREA-E625
+0xA481  0xE626  #PRIVATE USE AREA-E626
+0xA482  0xE627  #PRIVATE USE AREA-E627
+0xA483  0xE628  #PRIVATE USE AREA-E628
+0xA484  0xE629  #PRIVATE USE AREA-E629
+0xA485  0xE62A  #PRIVATE USE AREA-E62A
+0xA486  0xE62B  #PRIVATE USE AREA-E62B
+0xA487  0xE62C  #PRIVATE USE AREA-E62C
+0xA488  0xE62D  #PRIVATE USE AREA-E62D
+0xA489  0xE62E  #PRIVATE USE AREA-E62E
+0xA48A  0xE62F  #PRIVATE USE AREA-E62F
+0xA48B  0xE630  #PRIVATE USE AREA-E630
+0xA48C  0xE631  #PRIVATE USE AREA-E631
+0xA48D  0xE632  #PRIVATE USE AREA-E632
+0xA48E  0xE633  #PRIVATE USE AREA-E633
+0xA48F  0xE634  #PRIVATE USE AREA-E634
+0xA490  0xE635  #PRIVATE USE AREA-E635
+0xA491  0xE636  #PRIVATE USE AREA-E636
+0xA492  0xE637  #PRIVATE USE AREA-E637
+0xA493  0xE638  #PRIVATE USE AREA-E638
+0xA494  0xE639  #PRIVATE USE AREA-E639
+0xA495  0xE63A  #PRIVATE USE AREA-E63A
+0xA496  0xE63B  #PRIVATE USE AREA-E63B
+0xA497  0xE63C  #PRIVATE USE AREA-E63C
+0xA498  0xE63D  #PRIVATE USE AREA-E63D
+0xA499  0xE63E  #PRIVATE USE AREA-E63E
+0xA49A  0xE63F  #PRIVATE USE AREA-E63F
+0xA49B  0xE640  #PRIVATE USE AREA-E640
+0xA49C  0xE641  #PRIVATE USE AREA-E641
+0xA49D  0xE642  #PRIVATE USE AREA-E642
+0xA49E  0xE643  #PRIVATE USE AREA-E643
+0xA49F  0xE644  #PRIVATE USE AREA-E644
+0xA4A0  0xE645  #PRIVATE USE AREA-E645
 0xA4A1	0x3041  #HIRAGANA LETTER SMALL A
 0xA4A2	0x3042  #HIRAGANA LETTER A
 0xA4A3	0x3043  #HIRAGANA LETTER SMALL I
@@ -6986,113 +6963,113 @@
 0xA4F1	0x3091  #HIRAGANA LETTER WE
 0xA4F2	0x3092  #HIRAGANA LETTER WO
 0xA4F3	0x3093  #HIRAGANA LETTER N
-0xA4F4  0xE652  #PRIVATE USE AREA-E652
-0xA4F5  0xE653  #PRIVATE USE AREA-E653
-0xA4F6  0xE654  #PRIVATE USE AREA-E654
-0xA4F7  0xE655  #PRIVATE USE AREA-E655
-0xA4F8  0xE656  #PRIVATE USE AREA-E656
-0xA4F9  0xE657  #PRIVATE USE AREA-E657
-0xA4FA  0xE658  #PRIVATE USE AREA-E658
-0xA4FB  0xE659  #PRIVATE USE AREA-E659
-0xA4FC  0xE65A  #PRIVATE USE AREA-E65A
-0xA4FD  0xE65B  #PRIVATE USE AREA-E65B
-0xA4FE  0xE65C  #PRIVATE USE AREA-E65C
-0xA540  0xE65D  #PRIVATE USE AREA-E65D
-0xA541  0xE65E  #PRIVATE USE AREA-E65E
-0xA542  0xE65F  #PRIVATE USE AREA-E65F
-0xA543  0xE660  #PRIVATE USE AREA-E660
-0xA544  0xE661  #PRIVATE USE AREA-E661
-0xA545  0xE662  #PRIVATE USE AREA-E662
-0xA546  0xE663  #PRIVATE USE AREA-E663
-0xA547  0xE664  #PRIVATE USE AREA-E664
-0xA548  0xE665  #PRIVATE USE AREA-E665
-0xA549  0xE666  #PRIVATE USE AREA-E666
-0xA54A  0xE667  #PRIVATE USE AREA-E667
-0xA54B  0xE668  #PRIVATE USE AREA-E668
-0xA54C  0xE669  #PRIVATE USE AREA-E669
-0xA54D  0xE66A  #PRIVATE USE AREA-E66A
-0xA54E  0xE66B  #PRIVATE USE AREA-E66B
-0xA54F  0xE66C  #PRIVATE USE AREA-E66C
-0xA550  0xE66D  #PRIVATE USE AREA-E66D
-0xA551  0xE66E  #PRIVATE USE AREA-E66E
-0xA552  0xE66F  #PRIVATE USE AREA-E66F
-0xA553  0xE670  #PRIVATE USE AREA-E670
-0xA554  0xE671  #PRIVATE USE AREA-E671
-0xA555  0xE672  #PRIVATE USE AREA-E672
-0xA556  0xE673  #PRIVATE USE AREA-E673
-0xA557  0xE674  #PRIVATE USE AREA-E674
-0xA558  0xE675  #PRIVATE USE AREA-E675
-0xA559  0xE676  #PRIVATE USE AREA-E676
-0xA55A  0xE677  #PRIVATE USE AREA-E677
-0xA55B  0xE678  #PRIVATE USE AREA-E678
-0xA55C  0xE679  #PRIVATE USE AREA-E679
-0xA55D  0xE67A  #PRIVATE USE AREA-E67A
-0xA55E  0xE67B  #PRIVATE USE AREA-E67B
-0xA55F  0xE67C  #PRIVATE USE AREA-E67C
-0xA560  0xE67D  #PRIVATE USE AREA-E67D
-0xA561  0xE67E  #PRIVATE USE AREA-E67E
-0xA562  0xE67F  #PRIVATE USE AREA-E67F
-0xA563  0xE680  #PRIVATE USE AREA-E680
-0xA564  0xE681  #PRIVATE USE AREA-E681
-0xA565  0xE682  #PRIVATE USE AREA-E682
-0xA566  0xE683  #PRIVATE USE AREA-E683
-0xA567  0xE684  #PRIVATE USE AREA-E684
-0xA568  0xE685  #PRIVATE USE AREA-E685
-0xA569  0xE686  #PRIVATE USE AREA-E686
-0xA56A  0xE687  #PRIVATE USE AREA-E687
-0xA56B  0xE688  #PRIVATE USE AREA-E688
-0xA56C  0xE689  #PRIVATE USE AREA-E689
-0xA56D  0xE68A  #PRIVATE USE AREA-E68A
-0xA56E  0xE68B  #PRIVATE USE AREA-E68B
-0xA56F  0xE68C  #PRIVATE USE AREA-E68C
-0xA570  0xE68D  #PRIVATE USE AREA-E68D
-0xA571  0xE68E  #PRIVATE USE AREA-E68E
-0xA572  0xE68F  #PRIVATE USE AREA-E68F
-0xA573  0xE690  #PRIVATE USE AREA-E690
-0xA574  0xE691  #PRIVATE USE AREA-E691
-0xA575  0xE692  #PRIVATE USE AREA-E692
-0xA576  0xE693  #PRIVATE USE AREA-E693
-0xA577  0xE694  #PRIVATE USE AREA-E694
-0xA578  0xE695  #PRIVATE USE AREA-E695
-0xA579  0xE696  #PRIVATE USE AREA-E696
-0xA57A  0xE697  #PRIVATE USE AREA-E697
-0xA57B  0xE698  #PRIVATE USE AREA-E698
-0xA57C  0xE699  #PRIVATE USE AREA-E699
-0xA57D  0xE69A  #PRIVATE USE AREA-E69A
-0xA57E  0xE69B  #PRIVATE USE AREA-E69B
-0xA580  0xE69C  #PRIVATE USE AREA-E69C
-0xA581  0xE69D  #PRIVATE USE AREA-E69D
-0xA582  0xE69E  #PRIVATE USE AREA-E69E
-0xA583  0xE69F  #PRIVATE USE AREA-E69F
-0xA584  0xE6A0  #PRIVATE USE AREA-E6A0
-0xA585  0xE6A1  #PRIVATE USE AREA-E6A1
-0xA586  0xE6A2  #PRIVATE USE AREA-E6A2
-0xA587  0xE6A3  #PRIVATE USE AREA-E6A3
-0xA588  0xE6A4  #PRIVATE USE AREA-E6A4
-0xA589  0xE6A5  #PRIVATE USE AREA-E6A5
-0xA58A  0xE6A6  #PRIVATE USE AREA-E6A6
-0xA58B  0xE6A7  #PRIVATE USE AREA-E6A7
-0xA58C  0xE6A8  #PRIVATE USE AREA-E6A8
-0xA58D  0xE6A9  #PRIVATE USE AREA-E6A9
-0xA58E  0xE6AA  #PRIVATE USE AREA-E6AA
-0xA58F  0xE6AB  #PRIVATE USE AREA-E6AB
-0xA590  0xE6AC  #PRIVATE USE AREA-E6AC
-0xA591  0xE6AD  #PRIVATE USE AREA-E6AD
-0xA592  0xE6AE  #PRIVATE USE AREA-E6AE
-0xA593  0xE6AF  #PRIVATE USE AREA-E6AF
-0xA594  0xE6B0  #PRIVATE USE AREA-E6B0
-0xA595  0xE6B1  #PRIVATE USE AREA-E6B1
-0xA596  0xE6B2  #PRIVATE USE AREA-E6B2
-0xA597  0xE6B3  #PRIVATE USE AREA-E6B3
-0xA598  0xE6B4  #PRIVATE USE AREA-E6B4
-0xA599  0xE6B5  #PRIVATE USE AREA-E6B5
-0xA59A  0xE6B6  #PRIVATE USE AREA-E6B6
-0xA59B  0xE6B7  #PRIVATE USE AREA-E6B7
-0xA59C  0xE6B8  #PRIVATE USE AREA-E6B8
-0xA59D  0xE6B9  #PRIVATE USE AREA-E6B9
-0xA59E  0xE6BA  #PRIVATE USE AREA-E6BA
-0xA59F  0xE6BB  #PRIVATE USE AREA-E6BB
-0xA5A0  0xE6BC  #PRIVATE USE AREA-E6BC
+0xA4F4  0xE772  #PRIVATE USE AREA-E772
+0xA4F5  0xE773  #PRIVATE USE AREA-E773
+0xA4F6  0xE774  #PRIVATE USE AREA-E774
+0xA4F7  0xE775  #PRIVATE USE AREA-E775
+0xA4F8  0xE776  #PRIVATE USE AREA-E776
+0xA4F9  0xE777  #PRIVATE USE AREA-E777
+0xA4FA  0xE778  #PRIVATE USE AREA-E778
+0xA4FB  0xE779  #PRIVATE USE AREA-E779
+0xA4FC  0xE77A  #PRIVATE USE AREA-E77A
+0xA4FD  0xE77B  #PRIVATE USE AREA-E77B
+0xA4FE  0xE77C  #PRIVATE USE AREA-E77C
+0xA540  0xE646  #PRIVATE USE AREA-E646
+0xA541  0xE647  #PRIVATE USE AREA-E647
+0xA542  0xE648  #PRIVATE USE AREA-E648
+0xA543  0xE649  #PRIVATE USE AREA-E649
+0xA544  0xE64A  #PRIVATE USE AREA-E64A
+0xA545  0xE64B  #PRIVATE USE AREA-E64B
+0xA546  0xE64C  #PRIVATE USE AREA-E64C
+0xA547  0xE64D  #PRIVATE USE AREA-E64D
+0xA548  0xE64E  #PRIVATE USE AREA-E64E
+0xA549  0xE64F  #PRIVATE USE AREA-E64F
+0xA54A  0xE650  #PRIVATE USE AREA-E650
+0xA54B  0xE651  #PRIVATE USE AREA-E651
+0xA54C  0xE652  #PRIVATE USE AREA-E652
+0xA54D  0xE653  #PRIVATE USE AREA-E653
+0xA54E  0xE654  #PRIVATE USE AREA-E654
+0xA54F  0xE655  #PRIVATE USE AREA-E655
+0xA550  0xE656  #PRIVATE USE AREA-E656
+0xA551  0xE657  #PRIVATE USE AREA-E657
+0xA552  0xE658  #PRIVATE USE AREA-E658
+0xA553  0xE659  #PRIVATE USE AREA-E659
+0xA554  0xE65A  #PRIVATE USE AREA-E65A
+0xA555  0xE65B  #PRIVATE USE AREA-E65B
+0xA556  0xE65C  #PRIVATE USE AREA-E65C
+0xA557  0xE65D  #PRIVATE USE AREA-E65D
+0xA558  0xE65E  #PRIVATE USE AREA-E65E
+0xA559  0xE65F  #PRIVATE USE AREA-E65F
+0xA55A  0xE660  #PRIVATE USE AREA-E660
+0xA55B  0xE661  #PRIVATE USE AREA-E661
+0xA55C  0xE662  #PRIVATE USE AREA-E662
+0xA55D  0xE663  #PRIVATE USE AREA-E663
+0xA55E  0xE664  #PRIVATE USE AREA-E664
+0xA55F  0xE665  #PRIVATE USE AREA-E665
+0xA560  0xE666  #PRIVATE USE AREA-E666
+0xA561  0xE667  #PRIVATE USE AREA-E667
+0xA562  0xE668  #PRIVATE USE AREA-E668
+0xA563  0xE669  #PRIVATE USE AREA-E669
+0xA564  0xE66A  #PRIVATE USE AREA-E66A
+0xA565  0xE66B  #PRIVATE USE AREA-E66B
+0xA566  0xE66C  #PRIVATE USE AREA-E66C
+0xA567  0xE66D  #PRIVATE USE AREA-E66D
+0xA568  0xE66E  #PRIVATE USE AREA-E66E
+0xA569  0xE66F  #PRIVATE USE AREA-E66F
+0xA56A  0xE670  #PRIVATE USE AREA-E670
+0xA56B  0xE671  #PRIVATE USE AREA-E671
+0xA56C  0xE672  #PRIVATE USE AREA-E672
+0xA56D  0xE673  #PRIVATE USE AREA-E673
+0xA56E  0xE674  #PRIVATE USE AREA-E674
+0xA56F  0xE675  #PRIVATE USE AREA-E675
+0xA570  0xE676  #PRIVATE USE AREA-E676
+0xA571  0xE677  #PRIVATE USE AREA-E677
+0xA572  0xE678  #PRIVATE USE AREA-E678
+0xA573  0xE679  #PRIVATE USE AREA-E679
+0xA574  0xE67A  #PRIVATE USE AREA-E67A
+0xA575  0xE67B  #PRIVATE USE AREA-E67B
+0xA576  0xE67C  #PRIVATE USE AREA-E67C
+0xA577  0xE67D  #PRIVATE USE AREA-E67D
+0xA578  0xE67E  #PRIVATE USE AREA-E67E
+0xA579  0xE67F  #PRIVATE USE AREA-E67F
+0xA57A  0xE680  #PRIVATE USE AREA-E680
+0xA57B  0xE681  #PRIVATE USE AREA-E681
+0xA57C  0xE682  #PRIVATE USE AREA-E682
+0xA57D  0xE683  #PRIVATE USE AREA-E683
+0xA57E  0xE684  #PRIVATE USE AREA-E684
+0xA580  0xE685  #PRIVATE USE AREA-E685
+0xA581  0xE686  #PRIVATE USE AREA-E686
+0xA582  0xE687  #PRIVATE USE AREA-E687
+0xA583  0xE688  #PRIVATE USE AREA-E688
+0xA584  0xE689  #PRIVATE USE AREA-E689
+0xA585  0xE68A  #PRIVATE USE AREA-E68A
+0xA586  0xE68B  #PRIVATE USE AREA-E68B
+0xA587  0xE68C  #PRIVATE USE AREA-E68C
+0xA588  0xE68D  #PRIVATE USE AREA-E68D
+0xA589  0xE68E  #PRIVATE USE AREA-E68E
+0xA58A  0xE68F  #PRIVATE USE AREA-E68F
+0xA58B  0xE690  #PRIVATE USE AREA-E690
+0xA58C  0xE691  #PRIVATE USE AREA-E691
+0xA58D  0xE692  #PRIVATE USE AREA-E692
+0xA58E  0xE693  #PRIVATE USE AREA-E693
+0xA58F  0xE694  #PRIVATE USE AREA-E694
+0xA590  0xE695  #PRIVATE USE AREA-E695
+0xA591  0xE696  #PRIVATE USE AREA-E696
+0xA592  0xE697  #PRIVATE USE AREA-E697
+0xA593  0xE698  #PRIVATE USE AREA-E698
+0xA594  0xE699  #PRIVATE USE AREA-E699
+0xA595  0xE69A  #PRIVATE USE AREA-E69A
+0xA596  0xE69B  #PRIVATE USE AREA-E69B
+0xA597  0xE69C  #PRIVATE USE AREA-E69C
+0xA598  0xE69D  #PRIVATE USE AREA-E69D
+0xA599  0xE69E  #PRIVATE USE AREA-E69E
+0xA59A  0xE69F  #PRIVATE USE AREA-E69F
+0xA59B  0xE6A0  #PRIVATE USE AREA-E6A0
+0xA59C  0xE6A1  #PRIVATE USE AREA-E6A1
+0xA59D  0xE6A2  #PRIVATE USE AREA-E6A2
+0xA59E  0xE6A3  #PRIVATE USE AREA-E6A3
+0xA59F  0xE6A4  #PRIVATE USE AREA-E6A4
+0xA5A0  0xE6A5  #PRIVATE USE AREA-E6A5
 0xA5A1	0x30A1  #KATAKANA LETTER SMALL A
 0xA5A2	0x30A2  #KATAKANA LETTER A
 0xA5A3	0x30A3  #KATAKANA LETTER SMALL I
@@ -7179,110 +7156,110 @@
 0xA5F4	0x30F4  #KATAKANA LETTER VU
 0xA5F5	0x30F5  #KATAKANA LETTER SMALL KA
 0xA5F6	0x30F6  #KATAKANA LETTER SMALL KE
-0xA5F7  0xE6BD  #PRIVATE USE AREA-E6BD
-0xA5F8  0xE6BE  #PRIVATE USE AREA-E6BE
-0xA5F9  0xE6BF  #PRIVATE USE AREA-E6BF
-0xA5FA  0xE6C0  #PRIVATE USE AREA-E6C0
-0xA5FB  0xE6C1  #PRIVATE USE AREA-E6C1
-0xA5FC  0xE6C2  #PRIVATE USE AREA-E6C2
-0xA5FD  0xE6C3  #PRIVATE USE AREA-E6C3
-0xA5FE  0xE6C4  #PRIVATE USE AREA-E6C4
-0xA640  0xE6C5  #PRIVATE USE AREA-E6C5
-0xA641  0xE6C6  #PRIVATE USE AREA-E6C6
-0xA642  0xE6C7  #PRIVATE USE AREA-E6C7
-0xA643  0xE6C8  #PRIVATE USE AREA-E6C8
-0xA644  0xE6C9  #PRIVATE USE AREA-E6C9
-0xA645  0xE6CA  #PRIVATE USE AREA-E6CA
-0xA646  0xE6CB  #PRIVATE USE AREA-E6CB
-0xA647  0xE6CC  #PRIVATE USE AREA-E6CC
-0xA648  0xE6CD  #PRIVATE USE AREA-E6CD
-0xA649  0xE6CE  #PRIVATE USE AREA-E6CE
-0xA64A  0xE6CF  #PRIVATE USE AREA-E6CF
-0xA64B  0xE6D0  #PRIVATE USE AREA-E6D0
-0xA64C  0xE6D1  #PRIVATE USE AREA-E6D1
-0xA64D  0xE6D2  #PRIVATE USE AREA-E6D2
-0xA64E  0xE6D3  #PRIVATE USE AREA-E6D3
-0xA64F  0xE6D4  #PRIVATE USE AREA-E6D4
-0xA650  0xE6D5  #PRIVATE USE AREA-E6D5
-0xA651  0xE6D6  #PRIVATE USE AREA-E6D6
-0xA652  0xE6D7  #PRIVATE USE AREA-E6D7
-0xA653  0xE6D8  #PRIVATE USE AREA-E6D8
-0xA654  0xE6D9  #PRIVATE USE AREA-E6D9
-0xA655  0xE6DA  #PRIVATE USE AREA-E6DA
-0xA656  0xE6DB  #PRIVATE USE AREA-E6DB
-0xA657  0xE6DC  #PRIVATE USE AREA-E6DC
-0xA658  0xE6DD  #PRIVATE USE AREA-E6DD
-0xA659  0xE6DE  #PRIVATE USE AREA-E6DE
-0xA65A  0xE6DF  #PRIVATE USE AREA-E6DF
-0xA65B  0xE6E0  #PRIVATE USE AREA-E6E0
-0xA65C  0xE6E1  #PRIVATE USE AREA-E6E1
-0xA65D  0xE6E2  #PRIVATE USE AREA-E6E2
-0xA65E  0xE6E3  #PRIVATE USE AREA-E6E3
-0xA65F  0xE6E4  #PRIVATE USE AREA-E6E4
-0xA660  0xE6E5  #PRIVATE USE AREA-E6E5
-0xA661  0xE6E6  #PRIVATE USE AREA-E6E6
-0xA662  0xE6E7  #PRIVATE USE AREA-E6E7
-0xA663  0xE6E8  #PRIVATE USE AREA-E6E8
-0xA664  0xE6E9  #PRIVATE USE AREA-E6E9
-0xA665  0xE6EA  #PRIVATE USE AREA-E6EA
-0xA666  0xE6EB  #PRIVATE USE AREA-E6EB
-0xA667  0xE6EC  #PRIVATE USE AREA-E6EC
-0xA668  0xE6ED  #PRIVATE USE AREA-E6ED
-0xA669  0xE6EE  #PRIVATE USE AREA-E6EE
-0xA66A  0xE6EF  #PRIVATE USE AREA-E6EF
-0xA66B  0xE6F0  #PRIVATE USE AREA-E6F0
-0xA66C  0xE6F1  #PRIVATE USE AREA-E6F1
-0xA66D  0xE6F2  #PRIVATE USE AREA-E6F2
-0xA66E  0xE6F3  #PRIVATE USE AREA-E6F3
-0xA66F  0xE6F4  #PRIVATE USE AREA-E6F4
-0xA670  0xE6F5  #PRIVATE USE AREA-E6F5
-0xA671  0xE6F6  #PRIVATE USE AREA-E6F6
-0xA672  0xE6F7  #PRIVATE USE AREA-E6F7
-0xA673  0xE6F8  #PRIVATE USE AREA-E6F8
-0xA674  0xE6F9  #PRIVATE USE AREA-E6F9
-0xA675  0xE6FA  #PRIVATE USE AREA-E6FA
-0xA676  0xE6FB  #PRIVATE USE AREA-E6FB
-0xA677  0xE6FC  #PRIVATE USE AREA-E6FC
-0xA678  0xE6FD  #PRIVATE USE AREA-E6FD
-0xA679  0xE6FE  #PRIVATE USE AREA-E6FE
-0xA67A  0xE6FF  #PRIVATE USE AREA-E6FF
-0xA67B  0xE700  #PRIVATE USE AREA-E700
-0xA67C  0xE701  #PRIVATE USE AREA-E701
-0xA67D  0xE702  #PRIVATE USE AREA-E702
-0xA67E  0xE703  #PRIVATE USE AREA-E703
-0xA680  0xE704  #PRIVATE USE AREA-E704
-0xA681  0xE705  #PRIVATE USE AREA-E705
-0xA682  0xE706  #PRIVATE USE AREA-E706
-0xA683  0xE707  #PRIVATE USE AREA-E707
-0xA684  0xE708  #PRIVATE USE AREA-E708
-0xA685  0xE709  #PRIVATE USE AREA-E709
-0xA686  0xE70A  #PRIVATE USE AREA-E70A
-0xA687  0xE70B  #PRIVATE USE AREA-E70B
-0xA688  0xE70C  #PRIVATE USE AREA-E70C
-0xA689  0xE70D  #PRIVATE USE AREA-E70D
-0xA68A  0xE70E  #PRIVATE USE AREA-E70E
-0xA68B  0xE70F  #PRIVATE USE AREA-E70F
-0xA68C  0xE710  #PRIVATE USE AREA-E710
-0xA68D  0xE711  #PRIVATE USE AREA-E711
-0xA68E  0xE712  #PRIVATE USE AREA-E712
-0xA68F  0xE713  #PRIVATE USE AREA-E713
-0xA690  0xE714  #PRIVATE USE AREA-E714
-0xA691  0xE715  #PRIVATE USE AREA-E715
-0xA692  0xE716  #PRIVATE USE AREA-E716
-0xA693  0xE717  #PRIVATE USE AREA-E717
-0xA694  0xE718  #PRIVATE USE AREA-E718
-0xA695  0xE719  #PRIVATE USE AREA-E719
-0xA696  0xE71A  #PRIVATE USE AREA-E71A
-0xA697  0xE71B  #PRIVATE USE AREA-E71B
-0xA698  0xE71C  #PRIVATE USE AREA-E71C
-0xA699  0xE71D  #PRIVATE USE AREA-E71D
-0xA69A  0xE71E  #PRIVATE USE AREA-E71E
-0xA69B  0xE71F  #PRIVATE USE AREA-E71F
-0xA69C  0xE720  #PRIVATE USE AREA-E720
-0xA69D  0xE721  #PRIVATE USE AREA-E721
-0xA69E  0xE722  #PRIVATE USE AREA-E722
-0xA69F  0xE723  #PRIVATE USE AREA-E723
-0xA6A0  0xE724  #PRIVATE USE AREA-E724
+0xA5F7  0xE77D  #PRIVATE USE AREA-E77D
+0xA5F8  0xE77E  #PRIVATE USE AREA-E77E
+0xA5F9  0xE77F  #PRIVATE USE AREA-E77F
+0xA5FA  0xE780  #PRIVATE USE AREA-E780
+0xA5FB  0xE781  #PRIVATE USE AREA-E781
+0xA5FC  0xE782  #PRIVATE USE AREA-E782
+0xA5FD  0xE783  #PRIVATE USE AREA-E783
+0xA5FE  0xE784  #PRIVATE USE AREA-E784
+0xA640  0xE6A6  #PRIVATE USE AREA-E6A6
+0xA641  0xE6A7  #PRIVATE USE AREA-E6A7
+0xA642  0xE6A8  #PRIVATE USE AREA-E6A8
+0xA643  0xE6A9  #PRIVATE USE AREA-E6A9
+0xA644  0xE6AA  #PRIVATE USE AREA-E6AA
+0xA645  0xE6AB  #PRIVATE USE AREA-E6AB
+0xA646  0xE6AC  #PRIVATE USE AREA-E6AC
+0xA647  0xE6AD  #PRIVATE USE AREA-E6AD
+0xA648  0xE6AE  #PRIVATE USE AREA-E6AE
+0xA649  0xE6AF  #PRIVATE USE AREA-E6AF
+0xA64A  0xE6B0  #PRIVATE USE AREA-E6B0
+0xA64B  0xE6B1  #PRIVATE USE AREA-E6B1
+0xA64C  0xE6B2  #PRIVATE USE AREA-E6B2
+0xA64D  0xE6B3  #PRIVATE USE AREA-E6B3
+0xA64E  0xE6B4  #PRIVATE USE AREA-E6B4
+0xA64F  0xE6B5  #PRIVATE USE AREA-E6B5
+0xA650  0xE6B6  #PRIVATE USE AREA-E6B6
+0xA651  0xE6B7  #PRIVATE USE AREA-E6B7
+0xA652  0xE6B8  #PRIVATE USE AREA-E6B8
+0xA653  0xE6B9  #PRIVATE USE AREA-E6B9
+0xA654  0xE6BA  #PRIVATE USE AREA-E6BA
+0xA655  0xE6BB  #PRIVATE USE AREA-E6BB
+0xA656  0xE6BC  #PRIVATE USE AREA-E6BC
+0xA657  0xE6BD  #PRIVATE USE AREA-E6BD
+0xA658  0xE6BE  #PRIVATE USE AREA-E6BE
+0xA659  0xE6BF  #PRIVATE USE AREA-E6BF
+0xA65A  0xE6C0  #PRIVATE USE AREA-E6C0
+0xA65B  0xE6C1  #PRIVATE USE AREA-E6C1
+0xA65C  0xE6C2  #PRIVATE USE AREA-E6C2
+0xA65D  0xE6C3  #PRIVATE USE AREA-E6C3
+0xA65E  0xE6C4  #PRIVATE USE AREA-E6C4
+0xA65F  0xE6C5  #PRIVATE USE AREA-E6C5
+0xA660  0xE6C6  #PRIVATE USE AREA-E6C6
+0xA661  0xE6C7  #PRIVATE USE AREA-E6C7
+0xA662  0xE6C8  #PRIVATE USE AREA-E6C8
+0xA663  0xE6C9  #PRIVATE USE AREA-E6C9
+0xA664  0xE6CA  #PRIVATE USE AREA-E6CA
+0xA665  0xE6CB  #PRIVATE USE AREA-E6CB
+0xA666  0xE6CC  #PRIVATE USE AREA-E6CC
+0xA667  0xE6CD  #PRIVATE USE AREA-E6CD
+0xA668  0xE6CE  #PRIVATE USE AREA-E6CE
+0xA669  0xE6CF  #PRIVATE USE AREA-E6CF
+0xA66A  0xE6D0  #PRIVATE USE AREA-E6D0
+0xA66B  0xE6D1  #PRIVATE USE AREA-E6D1
+0xA66C  0xE6D2  #PRIVATE USE AREA-E6D2
+0xA66D  0xE6D3  #PRIVATE USE AREA-E6D3
+0xA66E  0xE6D4  #PRIVATE USE AREA-E6D4
+0xA66F  0xE6D5  #PRIVATE USE AREA-E6D5
+0xA670  0xE6D6  #PRIVATE USE AREA-E6D6
+0xA671  0xE6D7  #PRIVATE USE AREA-E6D7
+0xA672  0xE6D8  #PRIVATE USE AREA-E6D8
+0xA673  0xE6D9  #PRIVATE USE AREA-E6D9
+0xA674  0xE6DA  #PRIVATE USE AREA-E6DA
+0xA675  0xE6DB  #PRIVATE USE AREA-E6DB
+0xA676  0xE6DC  #PRIVATE USE AREA-E6DC
+0xA677  0xE6DD  #PRIVATE USE AREA-E6DD
+0xA678  0xE6DE  #PRIVATE USE AREA-E6DE
+0xA679  0xE6DF  #PRIVATE USE AREA-E6DF
+0xA67A  0xE6E0  #PRIVATE USE AREA-E6E0
+0xA67B  0xE6E1  #PRIVATE USE AREA-E6E1
+0xA67C  0xE6E2  #PRIVATE USE AREA-E6E2
+0xA67D  0xE6E3  #PRIVATE USE AREA-E6E3
+0xA67E  0xE6E4  #PRIVATE USE AREA-E6E4
+0xA680  0xE6E5  #PRIVATE USE AREA-E6E5
+0xA681  0xE6E6  #PRIVATE USE AREA-E6E6
+0xA682  0xE6E7  #PRIVATE USE AREA-E6E7
+0xA683  0xE6E8  #PRIVATE USE AREA-E6E8
+0xA684  0xE6E9  #PRIVATE USE AREA-E6E9
+0xA685  0xE6EA  #PRIVATE USE AREA-E6EA
+0xA686  0xE6EB  #PRIVATE USE AREA-E6EB
+0xA687  0xE6EC  #PRIVATE USE AREA-E6EC
+0xA688  0xE6ED  #PRIVATE USE AREA-E6ED
+0xA689  0xE6EE  #PRIVATE USE AREA-E6EE
+0xA68A  0xE6EF  #PRIVATE USE AREA-E6EF
+0xA68B  0xE6F0  #PRIVATE USE AREA-E6F0
+0xA68C  0xE6F1  #PRIVATE USE AREA-E6F1
+0xA68D  0xE6F2  #PRIVATE USE AREA-E6F2
+0xA68E  0xE6F3  #PRIVATE USE AREA-E6F3
+0xA68F  0xE6F4  #PRIVATE USE AREA-E6F4
+0xA690  0xE6F5  #PRIVATE USE AREA-E6F5
+0xA691  0xE6F6  #PRIVATE USE AREA-E6F6
+0xA692  0xE6F7  #PRIVATE USE AREA-E6F7
+0xA693  0xE6F8  #PRIVATE USE AREA-E6F8
+0xA694  0xE6F9  #PRIVATE USE AREA-E6F9
+0xA695  0xE6FA  #PRIVATE USE AREA-E6FA
+0xA696  0xE6FB  #PRIVATE USE AREA-E6FB
+0xA697  0xE6FC  #PRIVATE USE AREA-E6FC
+0xA698  0xE6FD  #PRIVATE USE AREA-E6FD
+0xA699  0xE6FE  #PRIVATE USE AREA-E6FE
+0xA69A  0xE6FF  #PRIVATE USE AREA-E6FF
+0xA69B  0xE700  #PRIVATE USE AREA-E700
+0xA69C  0xE701  #PRIVATE USE AREA-E701
+0xA69D  0xE702  #PRIVATE USE AREA-E702
+0xA69E  0xE703  #PRIVATE USE AREA-E703
+0xA69F  0xE704  #PRIVATE USE AREA-E704
+0xA6A0  0xE705  #PRIVATE USE AREA-E705
 0xA6A1	0x0391  #GREEK CAPITAL LETTER ALPHA
 0xA6A2	0x0392  #GREEK CAPITAL LETTER BETA
 0xA6A3	0x0393  #GREEK CAPITAL LETTER GAMMA
@@ -7307,14 +7284,14 @@
 0xA6B6	0x03A7  #GREEK CAPITAL LETTER CHI
 0xA6B7	0x03A8  #GREEK CAPITAL LETTER PSI
 0xA6B8	0x03A9  #GREEK CAPITAL LETTER OMEGA
-0xA6B9  0xE725  #PRIVATE USE AREA-E725
-0xA6BA  0xE726  #PRIVATE USE AREA-E726
-0xA6BB  0xE727  #PRIVATE USE AREA-E727
-0xA6BC  0xE728  #PRIVATE USE AREA-E728
-0xA6BD  0xE729  #PRIVATE USE AREA-E729
-0xA6BE  0xE72A  #PRIVATE USE AREA-E72A
-0xA6BF  0xE72B  #PRIVATE USE AREA-E72B
-0xA6C0  0xE72C  #PRIVATE USE AREA-E72C
+0xA6B9  0xE785  #PRIVATE USE AREA-E785
+0xA6BA  0xE786  #PRIVATE USE AREA-E786
+0xA6BB  0xE787  #PRIVATE USE AREA-E787
+0xA6BC  0xE788  #PRIVATE USE AREA-E788
+0xA6BD  0xE789  #PRIVATE USE AREA-E789
+0xA6BE  0xE78A  #PRIVATE USE AREA-E78A
+0xA6BF  0xE78B  #PRIVATE USE AREA-E78B
+0xA6C0  0xE78C  #PRIVATE USE AREA-E78C
 0xA6C1	0x03B1  #GREEK SMALL LETTER ALPHA
 0xA6C2	0x03B2  #GREEK SMALL LETTER BETA
 0xA6C3	0x03B3  #GREEK SMALL LETTER GAMMA
@@ -7339,13 +7316,13 @@
 0xA6D6	0x03C7  #GREEK SMALL LETTER CHI
 0xA6D7	0x03C8  #GREEK SMALL LETTER PSI
 0xA6D8	0x03C9  #GREEK SMALL LETTER OMEGA
-0xA6D9  0xE72D  #PRIVATE USE AREA-E72D
-0xA6DA  0xE72E  #PRIVATE USE AREA-E72E
-0xA6DB  0xE72F  #PRIVATE USE AREA-E72F
-0xA6DC  0xE730  #PRIVATE USE AREA-E730
-0xA6DD  0xE731  #PRIVATE USE AREA-E731
-0xA6DE  0xE732  #PRIVATE USE AREA-E732
-0xA6DF  0xE733  #PRIVATE USE AREA-E733
+0xA6D9  0xE78D  #PRIVATE USE AREA-E78D
+0xA6DA  0xE78E  #PRIVATE USE AREA-E78E
+0xA6DB  0xE78F  #PRIVATE USE AREA-E78F
+0xA6DC  0xE790  #PRIVATE USE AREA-E790
+0xA6DD  0xE791  #PRIVATE USE AREA-E791
+0xA6DE  0xE792  #PRIVATE USE AREA-E792
+0xA6DF  0xE793  #PRIVATE USE AREA-E793
 0xA6E0	0xFE35  #PRESENTATION FORM FOR VERTICAL LEFT PARENTHESIS
 0xA6E1	0xFE36  #PRESENTATION FORM FOR VERTICAL RIGHT PARENTHESIS
 0xA6E2	0xFE39  #PRESENTATION FORM FOR VERTICAL LEFT TORTOISE SHELL BRACKET
@@ -7358,121 +7335,121 @@
 0xA6E9	0xFE42  #PRESENTATION FORM FOR VERTICAL RIGHT CORNER BRACKET
 0xA6EA	0xFE43  #PRESENTATION FORM FOR VERTICAL LEFT WHITE CORNER BRACKET
 0xA6EB	0xFE44  #PRESENTATION FORM FOR VERTICAL RIGHT WHITE CORNER BRACKET
-0xA6EC  0xE734  #PRIVATE USE AREA-E734
-0xA6ED  0xE735  #PRIVATE USE AREA-E735
+0xA6EC  0xE794  #PRIVATE USE AREA-E794
+0xA6ED  0xE795  #PRIVATE USE AREA-E795
 0xA6EE	0xFE3B  #PRESENTATION FORM FOR VERTICAL LEFT BLACK LENTICULAR BRACKET
 0xA6EF	0xFE3C  #PRESENTATION FORM FOR VERTICAL RIGHT BLACK LENTICULAR BRACKET
 0xA6F0	0xFE37  #PRESENTATION FORM FOR VERTICAL LEFT CURLY BRACKET
 0xA6F1	0xFE38  #PRESENTATION FORM FOR VERTICAL RIGHT CURLY BRACKET
 0xA6F2	0xFE31  #PRESENTATION FORM FOR VERTICAL EM DASH
-0xA6F3  0xE736  #PRIVATE USE AREA-E736
+0xA6F3  0xE796  #PRIVATE USE AREA-E796
 0xA6F4	0xFE33  #PRESENTATION FORM FOR VERTICAL LOW LINE
 0xA6F5	0xFE34  #PRESENTATION FORM FOR VERTICAL WAVY LOW LINE
-0xA6F6  0xE737  #PRIVATE USE AREA-E737
-0xA6F7  0xE738  #PRIVATE USE AREA-E738
-0xA6F8  0xE739  #PRIVATE USE AREA-E739
-0xA6F9  0xE73A  #PRIVATE USE AREA-E73A
-0xA6FA  0xE73B  #PRIVATE USE AREA-E73B
-0xA6FB  0xE73C  #PRIVATE USE AREA-E73C
-0xA6FC  0xE73D  #PRIVATE USE AREA-E73D
-0xA6FD  0xE73E  #PRIVATE USE AREA-E73E
-0xA6FE  0xE73F  #PRIVATE USE AREA-E73F
-0xA740  0xE740  #PRIVATE USE AREA-E740
-0xA741  0xE741  #PRIVATE USE AREA-E741
-0xA742  0xE742  #PRIVATE USE AREA-E742
-0xA743  0xE743  #PRIVATE USE AREA-E743
-0xA744  0xE744  #PRIVATE USE AREA-E744
-0xA745  0xE745  #PRIVATE USE AREA-E745
-0xA746  0xE746  #PRIVATE USE AREA-E746
-0xA747  0xE747  #PRIVATE USE AREA-E747
-0xA748  0xE748  #PRIVATE USE AREA-E748
-0xA749  0xE749  #PRIVATE USE AREA-E749
-0xA74A  0xE74A  #PRIVATE USE AREA-E74A
-0xA74B  0xE74B  #PRIVATE USE AREA-E74B
-0xA74C  0xE74C  #PRIVATE USE AREA-E74C
-0xA74D  0xE74D  #PRIVATE USE AREA-E74D
-0xA74E  0xE74E  #PRIVATE USE AREA-E74E
-0xA74F  0xE74F  #PRIVATE USE AREA-E74F
-0xA750  0xE750  #PRIVATE USE AREA-E750
-0xA751  0xE751  #PRIVATE USE AREA-E751
-0xA752  0xE752  #PRIVATE USE AREA-E752
-0xA753  0xE753  #PRIVATE USE AREA-E753
-0xA754  0xE754  #PRIVATE USE AREA-E754
-0xA755  0xE755  #PRIVATE USE AREA-E755
-0xA756  0xE756  #PRIVATE USE AREA-E756
-0xA757  0xE757  #PRIVATE USE AREA-E757
-0xA758  0xE758  #PRIVATE USE AREA-E758
-0xA759  0xE759  #PRIVATE USE AREA-E759
-0xA75A  0xE75A  #PRIVATE USE AREA-E75A
-0xA75B  0xE75B  #PRIVATE USE AREA-E75B
-0xA75C  0xE75C  #PRIVATE USE AREA-E75C
-0xA75D  0xE75D  #PRIVATE USE AREA-E75D
-0xA75E  0xE75E  #PRIVATE USE AREA-E75E
-0xA75F  0xE75F  #PRIVATE USE AREA-E75F
-0xA760  0xE760  #PRIVATE USE AREA-E760
-0xA761  0xE761  #PRIVATE USE AREA-E761
-0xA762  0xE762  #PRIVATE USE AREA-E762
-0xA763  0xE763  #PRIVATE USE AREA-E763
-0xA764  0xE764  #PRIVATE USE AREA-E764
-0xA765  0xE765  #PRIVATE USE AREA-E765
-0xA766  0xE766  #PRIVATE USE AREA-E766
-0xA767  0xE767  #PRIVATE USE AREA-E767
-0xA768  0xE768  #PRIVATE USE AREA-E768
-0xA769  0xE769  #PRIVATE USE AREA-E769
-0xA76A  0xE76A  #PRIVATE USE AREA-E76A
-0xA76B  0xE76B  #PRIVATE USE AREA-E76B
-0xA76C  0xE76C  #PRIVATE USE AREA-E76C
-0xA76D  0xE76D  #PRIVATE USE AREA-E76D
-0xA76E  0xE76E  #PRIVATE USE AREA-E76E
-0xA76F  0xE76F  #PRIVATE USE AREA-E76F
-0xA770  0xE770  #PRIVATE USE AREA-E770
-0xA771  0xE771  #PRIVATE USE AREA-E771
-0xA772  0xE772  #PRIVATE USE AREA-E772
-0xA773  0xE773  #PRIVATE USE AREA-E773
-0xA774  0xE774  #PRIVATE USE AREA-E774
-0xA775  0xE775  #PRIVATE USE AREA-E775
-0xA776  0xE776  #PRIVATE USE AREA-E776
-0xA777  0xE777  #PRIVATE USE AREA-E777
-0xA778  0xE778  #PRIVATE USE AREA-E778
-0xA779  0xE779  #PRIVATE USE AREA-E779
-0xA77A  0xE77A  #PRIVATE USE AREA-E77A
-0xA77B  0xE77B  #PRIVATE USE AREA-E77B
-0xA77C  0xE77C  #PRIVATE USE AREA-E77C
-0xA77D  0xE77D  #PRIVATE USE AREA-E77D
-0xA77E  0xE77E  #PRIVATE USE AREA-E77E
-0xA780  0xE77F  #PRIVATE USE AREA-E77F
-0xA781  0xE780  #PRIVATE USE AREA-E780
-0xA782  0xE781  #PRIVATE USE AREA-E781
-0xA783  0xE782  #PRIVATE USE AREA-E782
-0xA784  0xE783  #PRIVATE USE AREA-E783
-0xA785  0xE784  #PRIVATE USE AREA-E784
-0xA786  0xE785  #PRIVATE USE AREA-E785
-0xA787  0xE786  #PRIVATE USE AREA-E786
-0xA788  0xE787  #PRIVATE USE AREA-E787
-0xA789  0xE788  #PRIVATE USE AREA-E788
-0xA78A  0xE789  #PRIVATE USE AREA-E789
-0xA78B  0xE78A  #PRIVATE USE AREA-E78A
-0xA78C  0xE78B  #PRIVATE USE AREA-E78B
-0xA78D  0xE78C  #PRIVATE USE AREA-E78C
-0xA78E  0xE78D  #PRIVATE USE AREA-E78D
-0xA78F  0xE78E  #PRIVATE USE AREA-E78E
-0xA790  0xE78F  #PRIVATE USE AREA-E78F
-0xA791  0xE790  #PRIVATE USE AREA-E790
-0xA792  0xE791  #PRIVATE USE AREA-E791
-0xA793  0xE792  #PRIVATE USE AREA-E792
-0xA794  0xE793  #PRIVATE USE AREA-E793
-0xA795  0xE794  #PRIVATE USE AREA-E794
-0xA796  0xE795  #PRIVATE USE AREA-E795
-0xA797  0xE796  #PRIVATE USE AREA-E796
-0xA798  0xE797  #PRIVATE USE AREA-E797
-0xA799  0xE798  #PRIVATE USE AREA-E798
-0xA79A  0xE799  #PRIVATE USE AREA-E799
-0xA79B  0xE79A  #PRIVATE USE AREA-E79A
-0xA79C  0xE79B  #PRIVATE USE AREA-E79B
-0xA79D  0xE79C  #PRIVATE USE AREA-E79C
-0xA79E  0xE79D  #PRIVATE USE AREA-E79D
-0xA79F  0xE79E  #PRIVATE USE AREA-E79E
-0xA7A0  0xE79F  #PRIVATE USE AREA-E79F
+0xA6F6  0xE797  #PRIVATE USE AREA-E797
+0xA6F7  0xE798  #PRIVATE USE AREA-E798
+0xA6F8  0xE799  #PRIVATE USE AREA-E799
+0xA6F9  0xE79A  #PRIVATE USE AREA-E79A
+0xA6FA  0xE79B  #PRIVATE USE AREA-E79B
+0xA6FB  0xE79C  #PRIVATE USE AREA-E79C
+0xA6FC  0xE79D  #PRIVATE USE AREA-E79D
+0xA6FD  0xE79E  #PRIVATE USE AREA-E79E
+0xA6FE  0xE79F  #PRIVATE USE AREA-E79F
+0xA740  0xE706  #PRIVATE USE AREA-E706
+0xA741  0xE707  #PRIVATE USE AREA-E707
+0xA742  0xE708  #PRIVATE USE AREA-E708
+0xA743  0xE709  #PRIVATE USE AREA-E709
+0xA744  0xE70A  #PRIVATE USE AREA-E70A
+0xA745  0xE70B  #PRIVATE USE AREA-E70B
+0xA746  0xE70C  #PRIVATE USE AREA-E70C
+0xA747  0xE70D  #PRIVATE USE AREA-E70D
+0xA748  0xE70E  #PRIVATE USE AREA-E70E
+0xA749  0xE70F  #PRIVATE USE AREA-E70F
+0xA74A  0xE710  #PRIVATE USE AREA-E710
+0xA74B  0xE711  #PRIVATE USE AREA-E711
+0xA74C  0xE712  #PRIVATE USE AREA-E712
+0xA74D  0xE713  #PRIVATE USE AREA-E713
+0xA74E  0xE714  #PRIVATE USE AREA-E714
+0xA74F  0xE715  #PRIVATE USE AREA-E715
+0xA750  0xE716  #PRIVATE USE AREA-E716
+0xA751  0xE717  #PRIVATE USE AREA-E717
+0xA752  0xE718  #PRIVATE USE AREA-E718
+0xA753  0xE719  #PRIVATE USE AREA-E719
+0xA754  0xE71A  #PRIVATE USE AREA-E71A
+0xA755  0xE71B  #PRIVATE USE AREA-E71B
+0xA756  0xE71C  #PRIVATE USE AREA-E71C
+0xA757  0xE71D  #PRIVATE USE AREA-E71D
+0xA758  0xE71E  #PRIVATE USE AREA-E71E
+0xA759  0xE71F  #PRIVATE USE AREA-E71F
+0xA75A  0xE720  #PRIVATE USE AREA-E720
+0xA75B  0xE721  #PRIVATE USE AREA-E721
+0xA75C  0xE722  #PRIVATE USE AREA-E722
+0xA75D  0xE723  #PRIVATE USE AREA-E723
+0xA75E  0xE724  #PRIVATE USE AREA-E724
+0xA75F  0xE725  #PRIVATE USE AREA-E725
+0xA760  0xE726  #PRIVATE USE AREA-E726
+0xA761  0xE727  #PRIVATE USE AREA-E727
+0xA762  0xE728  #PRIVATE USE AREA-E728
+0xA763  0xE729  #PRIVATE USE AREA-E729
+0xA764  0xE72A  #PRIVATE USE AREA-E72A
+0xA765  0xE72B  #PRIVATE USE AREA-E72B
+0xA766  0xE72C  #PRIVATE USE AREA-E72C
+0xA767  0xE72D  #PRIVATE USE AREA-E72D
+0xA768  0xE72E  #PRIVATE USE AREA-E72E
+0xA769  0xE72F  #PRIVATE USE AREA-E72F
+0xA76A  0xE730  #PRIVATE USE AREA-E730
+0xA76B  0xE731  #PRIVATE USE AREA-E731
+0xA76C  0xE732  #PRIVATE USE AREA-E732
+0xA76D  0xE733  #PRIVATE USE AREA-E733
+0xA76E  0xE734  #PRIVATE USE AREA-E734
+0xA76F  0xE735  #PRIVATE USE AREA-E735
+0xA770  0xE736  #PRIVATE USE AREA-E736
+0xA771  0xE737  #PRIVATE USE AREA-E737
+0xA772  0xE738  #PRIVATE USE AREA-E738
+0xA773  0xE739  #PRIVATE USE AREA-E739
+0xA774  0xE73A  #PRIVATE USE AREA-E73A
+0xA775  0xE73B  #PRIVATE USE AREA-E73B
+0xA776  0xE73C  #PRIVATE USE AREA-E73C
+0xA777  0xE73D  #PRIVATE USE AREA-E73D
+0xA778  0xE73E  #PRIVATE USE AREA-E73E
+0xA779  0xE73F  #PRIVATE USE AREA-E73F
+0xA77A  0xE740  #PRIVATE USE AREA-E740
+0xA77B  0xE741  #PRIVATE USE AREA-E741
+0xA77C  0xE742  #PRIVATE USE AREA-E742
+0xA77D  0xE743  #PRIVATE USE AREA-E743
+0xA77E  0xE744  #PRIVATE USE AREA-E744
+0xA780  0xE745  #PRIVATE USE AREA-E745
+0xA781  0xE746  #PRIVATE USE AREA-E746
+0xA782  0xE747  #PRIVATE USE AREA-E747
+0xA783  0xE748  #PRIVATE USE AREA-E748
+0xA784  0xE749  #PRIVATE USE AREA-E749
+0xA785  0xE74A  #PRIVATE USE AREA-E74A
+0xA786  0xE74B  #PRIVATE USE AREA-E74B
+0xA787  0xE74C  #PRIVATE USE AREA-E74C
+0xA788  0xE74D  #PRIVATE USE AREA-E74D
+0xA789  0xE74E  #PRIVATE USE AREA-E74E
+0xA78A  0xE74F  #PRIVATE USE AREA-E74F
+0xA78B  0xE750  #PRIVATE USE AREA-E750
+0xA78C  0xE751  #PRIVATE USE AREA-E751
+0xA78D  0xE752  #PRIVATE USE AREA-E752
+0xA78E  0xE753  #PRIVATE USE AREA-E753
+0xA78F  0xE754  #PRIVATE USE AREA-E754
+0xA790  0xE755  #PRIVATE USE AREA-E755
+0xA791  0xE756  #PRIVATE USE AREA-E756
+0xA792  0xE757  #PRIVATE USE AREA-E757
+0xA793  0xE758  #PRIVATE USE AREA-E758
+0xA794  0xE759  #PRIVATE USE AREA-E759
+0xA795  0xE75A  #PRIVATE USE AREA-E75A
+0xA796  0xE75B  #PRIVATE USE AREA-E75B
+0xA797  0xE75C  #PRIVATE USE AREA-E75C
+0xA798  0xE75D  #PRIVATE USE AREA-E75D
+0xA799  0xE75E  #PRIVATE USE AREA-E75E
+0xA79A  0xE75F  #PRIVATE USE AREA-E75F
+0xA79B  0xE760  #PRIVATE USE AREA-E760
+0xA79C  0xE761  #PRIVATE USE AREA-E761
+0xA79D  0xE762  #PRIVATE USE AREA-E762
+0xA79E  0xE763  #PRIVATE USE AREA-E763
+0xA79F  0xE764  #PRIVATE USE AREA-E764
+0xA7A0  0xE765  #PRIVATE USE AREA-E765
 0xA7A1	0x0410  #CYRILLIC CAPITAL LETTER A
 0xA7A2	0x0411  #CYRILLIC CAPITAL LETTER BE
 0xA7A3	0x0412  #CYRILLIC CAPITAL LETTER VE
--- a/make/tools/src/build/tools/javazic/Rule.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/make/tools/src/build/tools/javazic/Rule.java	Fri Jun 21 19:11:42 2013 -0700
@@ -119,7 +119,7 @@
                                                 r1.getDay(), r1.getTime().getTime());
                     long t2 = Time.getLocalTime(y, r2.getMonth(),
                                                 r2.getDay(), r2.getTime().getTime());
-                    return (int)(t1 - t2);
+                    return (t1 > t2) ? 1 : (t1 < t2) ? -1 : 0;
                 }
                 public boolean equals(Object o) {
                     return this == o;
--- a/src/macosx/bin/java_md_macosx.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/bin/java_md_macosx.c	Fri Jun 21 19:11:42 2013 -0700
@@ -44,7 +44,6 @@
 #include <Cocoa/Cocoa.h>
 #include <objc/objc-runtime.h>
 #include <objc/objc-auto.h>
-#include <dispatch/dispatch.h>
 
 #include <errno.h>
 #include <spawn.h>
@@ -1001,6 +1000,32 @@
     setenv(envVar, "1", 1);
 }
 
+/* This class is made for performSelectorOnMainThread when java main
+ * should be launched on main thread.
+ * We cannot use dispatch_sync here, because it blocks the main dispatch queue
+ * which is used inside Cocoa
+ */
+@interface JavaLaunchHelper : NSObject {
+    int _returnValue;
+}
+- (void) launchJava:(NSValue*)argsValue;
+- (int) getReturnValue;
+@end
+
+@implementation JavaLaunchHelper
+
+- (void) launchJava:(NSValue*)argsValue
+{
+    _returnValue = JavaMain([argsValue pointerValue]);
+}
+
+- (int) getReturnValue
+{
+    return _returnValue;
+}
+
+@end
+
 // MacOSX we may continue in the same thread
 int
 JVMInit(InvocationFunctions* ifn, jlong threadStackSize,
@@ -1010,16 +1035,22 @@
         JLI_TraceLauncher("In same thread\n");
         // need to block this thread against the main thread
         // so signals get caught correctly
-        __block int rslt;
-        dispatch_sync(dispatch_get_main_queue(), ^(void) {
-            JavaMainArgs args;
-            args.argc = argc;
-            args.argv = argv;
-            args.mode = mode;
-            args.what = what;
-            args.ifn  = *ifn;
-            rslt = JavaMain((void*)&args);
-        });
+        JavaMainArgs args;
+        args.argc = argc;
+        args.argv = argv;
+        args.mode = mode;
+        args.what = what;
+        args.ifn  = *ifn;
+        int rslt;
+        NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+        {
+            JavaLaunchHelper* launcher = [[[JavaLaunchHelper alloc] init] autorelease];
+            [launcher performSelectorOnMainThread:@selector(launchJava:)
+                                       withObject:[NSValue valueWithPointer:(void*)&args]
+                                    waitUntilDone:YES];
+            rslt = [launcher getReturnValue];
+        }
+        [pool drain];
         return rslt;
     } else {
         return ContinueInNewThread(ifn, threadStackSize, argc, argv, mode, what, ret);
--- a/src/macosx/classes/com/apple/laf/AquaButtonBorder.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/classes/com/apple/laf/AquaButtonBorder.java	Fri Jun 21 19:11:42 2013 -0700
@@ -83,14 +83,19 @@
         painter.state.set(state);
         painter.state.set((state != State.DISABLED && state != State.INACTIVE) && b.isFocusPainted() && isFocused(b) ? Focused.YES : Focused.NO);
 
+        // Full border size of the component.
+        // g.setColor(new Color(0, 255, 0, 70));
+        // g.drawRect(x, y, width - 1, height - 1);
+
         final Insets subInsets = sizeVariant.insets;
         x += subInsets.left;
         y += subInsets.top;
         width -= (subInsets.left + subInsets.right);
         height -= (subInsets.top + subInsets.bottom);
 
-//        g.setColor(Color.magenta);
-//        g.drawRect(x, y, width - 1, height - 1);
+        // Where the native border should start to paint.
+        // g.setColor(new Color(255, 0, 255, 70));
+        // g.drawRect(x, y, width - 1, height - 1);
 
         doButtonPaint(b, model, g, x, y, width, height);
     }
--- a/src/macosx/classes/com/apple/laf/AquaButtonExtendedTypes.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/classes/com/apple/laf/AquaButtonExtendedTypes.java	Fri Jun 21 19:11:42 2013 -0700
@@ -184,30 +184,30 @@
             new BorderDefinedTypeSpecifier("round", Widget.BUTTON_ROUND, new SizeVariant().alterInsets(2, 0, 0, 0).alterMinSize(28, 28), -3, -3, -3, -3),
             new BorderDefinedTypeSpecifier("texturedRound", Widget.BUTTON_ROUND_INSET, new SizeVariant().alterInsets(0, 0, 0, 0).alterMinSize(26, 26), -2, -2, 0, 0),
 
-            new SegmentedBorderDefinedTypeSpecifier("segmented-first", Widget.BUTTON_SEGMENTED, SegmentPosition.FIRST, new SizeVariant().alterMargins(6, 16, 6, 10).alterInsets(5, 3, 5, 0).alterMinSize(0, 28), 0, -3, 0, -3),
-            new SegmentedBorderDefinedTypeSpecifier("segmented-middle", Widget.BUTTON_SEGMENTED, SegmentPosition.MIDDLE, new SizeVariant().alterMargins(6, 9, 6, 10).alterInsets(5, 0, 5, 0).alterMinSize(0, 28), 0, -3, 0, -3),
-            new SegmentedBorderDefinedTypeSpecifier("segmented-last", Widget.BUTTON_SEGMENTED, SegmentPosition.LAST, new SizeVariant().alterMargins(6, 9, 6, 16).alterInsets(5, 0, 5, 3).alterMinSize(0, 28), 0, -3, 0, -3),
-            new SegmentedBorderDefinedTypeSpecifier("segmented-only", Widget.BUTTON_SEGMENTED, SegmentPosition.ONLY, new SizeVariant().alterMargins(6, 16, 6, 16).alterInsets(5, 3, 5, 3).alterMinSize(34, 28), 0, -3, 0, -3),
+            new SegmentedBorderDefinedTypeSpecifier("segmented-first", Widget.BUTTON_SEGMENTED, SegmentPosition.FIRST, new SizeVariant().alterMargins(6, 16, 6, 10).alterInsets(2, 3, 2, 0).alterMinSize(0, 28), 0, -3, 0, -3),
+            new SegmentedBorderDefinedTypeSpecifier("segmented-middle", Widget.BUTTON_SEGMENTED, SegmentPosition.MIDDLE, new SizeVariant().alterMargins(6, 9, 6, 10).alterInsets(2, 0, 2, 0).alterMinSize(0, 28), 0, -3, 0, -3),
+            new SegmentedBorderDefinedTypeSpecifier("segmented-last", Widget.BUTTON_SEGMENTED, SegmentPosition.LAST, new SizeVariant().alterMargins(6, 9, 6, 16).alterInsets(2, 0, 2, 3).alterMinSize(0, 28), 0, -3, 0, -3),
+            new SegmentedBorderDefinedTypeSpecifier("segmented-only", Widget.BUTTON_SEGMENTED, SegmentPosition.ONLY, new SizeVariant().alterMargins(6, 16, 6, 16).alterInsets(2, 3, 2, 3).alterMinSize(34, 28), 0, -3, 0, -3),
 
-            new SegmentedBorderDefinedTypeSpecifier("segmentedRoundRect-first", Widget.BUTTON_SEGMENTED_INSET, SegmentPosition.FIRST, new SizeVariant().alterMargins(6, 12, 6, 8).alterInsets(5, 2, 5, 0).alterMinSize(0, 28), 0, -3, 0, -3),
-            new SegmentedBorderDefinedTypeSpecifier("segmentedRoundRect-middle", Widget.BUTTON_SEGMENTED_INSET, SegmentPosition.MIDDLE, new SizeVariant().alterMargins(6, 8, 6, 8).alterInsets(5, 0, 5, 0).alterMinSize(0, 28), 0, -3, 0, -3),
-            new SegmentedBorderDefinedTypeSpecifier("segmentedRoundRect-last", Widget.BUTTON_SEGMENTED_INSET, SegmentPosition.LAST, new SizeVariant().alterMargins(6, 8, 6, 12).alterInsets(5, 0, 5, 2).alterMinSize(0, 28), 0, -3, 0, -3),
-            new SegmentedBorderDefinedTypeSpecifier("segmentedRoundRect-only", Widget.BUTTON_SEGMENTED_INSET, SegmentPosition.ONLY, new SizeVariant().alterMargins(6, 12, 6, 12).alterInsets(5, 2, 5, 2).alterMinSize(0, 28), 0, -3, 0, -3),
+            new SegmentedBorderDefinedTypeSpecifier("segmentedRoundRect-first", Widget.BUTTON_SEGMENTED_INSET, SegmentPosition.FIRST, new SizeVariant().alterMargins(6, 12, 6, 8).alterInsets(2, 2, 2, 0).alterMinSize(0, 28), 0, -3, 0, -3),
+            new SegmentedBorderDefinedTypeSpecifier("segmentedRoundRect-middle", Widget.BUTTON_SEGMENTED_INSET, SegmentPosition.MIDDLE, new SizeVariant().alterMargins(6, 8, 6, 8).alterInsets(2, 0, 2, 0).alterMinSize(0, 28), 0, -3, 0, -3),
+            new SegmentedBorderDefinedTypeSpecifier("segmentedRoundRect-last", Widget.BUTTON_SEGMENTED_INSET, SegmentPosition.LAST, new SizeVariant().alterMargins(6, 8, 6, 12).alterInsets(2, 0, 2, 2).alterMinSize(0, 28), 0, -3, 0, -3),
+            new SegmentedBorderDefinedTypeSpecifier("segmentedRoundRect-only", Widget.BUTTON_SEGMENTED_INSET, SegmentPosition.ONLY, new SizeVariant().alterMargins(6, 12, 6, 12).alterInsets(2, 2, 2, 2).alterMinSize(0, 28), 0, -3, 0, -3),
 
-            new SegmentedBorderDefinedTypeSpecifier("segmentedTexturedRounded-first", Widget.BUTTON_SEGMENTED_SCURVE, SegmentPosition.FIRST, new SizeVariant().alterMargins(6, 12, 6, 8).alterInsets(5, 2, 5, 0).alterMinSize(0, 28), 0, -3, 0, -3),
-            new SegmentedBorderDefinedTypeSpecifier("segmentedTexturedRounded-middle", Widget.BUTTON_SEGMENTED_SCURVE, SegmentPosition.MIDDLE, new SizeVariant().alterMargins(6, 8, 6, 8).alterInsets(5, 0, 5, 0).alterMinSize(0, 28), 0, -3, 0, -3),
-            new SegmentedBorderDefinedTypeSpecifier("segmentedTexturedRounded-last", Widget.BUTTON_SEGMENTED_SCURVE, SegmentPosition.LAST, new SizeVariant().alterMargins(6, 8, 6, 12).alterInsets(5, 0, 5, 2).alterMinSize(0, 28), 0, -3, 0, -3),
-            new SegmentedBorderDefinedTypeSpecifier("segmentedTexturedRounded-only", Widget.BUTTON_SEGMENTED_SCURVE, SegmentPosition.ONLY, new SizeVariant().alterMargins(6, 12, 6, 12).alterInsets(5, 2, 5, 2).alterMinSize(0, 28), 0, -3, 0, -3),
+            new SegmentedBorderDefinedTypeSpecifier("segmentedTexturedRounded-first", Widget.BUTTON_SEGMENTED_SCURVE, SegmentPosition.FIRST, new SizeVariant().alterMargins(6, 12, 6, 8).alterInsets(2, 2, 2, 0).alterMinSize(0, 28), 0, -3, 0, -3),
+            new SegmentedBorderDefinedTypeSpecifier("segmentedTexturedRounded-middle", Widget.BUTTON_SEGMENTED_SCURVE, SegmentPosition.MIDDLE, new SizeVariant().alterMargins(6, 8, 6, 8).alterInsets(2, 0, 2, 0).alterMinSize(0, 28), 0, -3, 0, -3),
+            new SegmentedBorderDefinedTypeSpecifier("segmentedTexturedRounded-last", Widget.BUTTON_SEGMENTED_SCURVE, SegmentPosition.LAST, new SizeVariant().alterMargins(6, 8, 6, 12).alterInsets(2, 0, 2, 2).alterMinSize(0, 28), 0, -3, 0, -3),
+            new SegmentedBorderDefinedTypeSpecifier("segmentedTexturedRounded-only", Widget.BUTTON_SEGMENTED_SCURVE, SegmentPosition.ONLY, new SizeVariant().alterMargins(6, 12, 6, 12).alterInsets(2, 2, 2, 2).alterMinSize(0, 28), 0, -3, 0, -3),
 
-            new SegmentedBorderDefinedTypeSpecifier("segmentedTextured-first", Widget.BUTTON_SEGMENTED_TEXTURED, SegmentPosition.FIRST, new SizeVariant().alterMargins(6, 12, 6, 8).alterInsets(6, 3, 6, 0).alterMinSize(0, 28), 0, -3, 0, -3),
-            new SegmentedBorderDefinedTypeSpecifier("segmentedTextured-middle", Widget.BUTTON_SEGMENTED_TEXTURED, SegmentPosition.MIDDLE, new SizeVariant().alterMargins(6, 8, 6, 8).alterInsets(6, 0, 6, 0).alterMinSize(0, 28), 0, -3, 0, -3),
-            new SegmentedBorderDefinedTypeSpecifier("segmentedTextured-last", Widget.BUTTON_SEGMENTED_TEXTURED, SegmentPosition.LAST, new SizeVariant().alterMargins(6, 8, 6, 12).alterInsets(6, 0, 6, 3).alterMinSize(0, 28), 0, -3, 0, -3),
-            new SegmentedBorderDefinedTypeSpecifier("segmentedTextured-only", Widget.BUTTON_SEGMENTED_TEXTURED, SegmentPosition.ONLY, new SizeVariant().alterMargins(6, 12, 6, 12).alterInsets(6, 3, 6, 3).alterMinSize(0, 28), 0, -3, 0, -3),
+            new SegmentedBorderDefinedTypeSpecifier("segmentedTextured-first", Widget.BUTTON_SEGMENTED_TEXTURED, SegmentPosition.FIRST, new SizeVariant().alterMargins(6, 12, 6, 8).alterInsets(2, 3, 2, 0).alterMinSize(0, 28), 0, -3, 0, -3),
+            new SegmentedBorderDefinedTypeSpecifier("segmentedTextured-middle", Widget.BUTTON_SEGMENTED_TEXTURED, SegmentPosition.MIDDLE, new SizeVariant().alterMargins(6, 8, 6, 8).alterInsets(2, 0, 2, 0).alterMinSize(0, 28), 0, -3, 0, -3),
+            new SegmentedBorderDefinedTypeSpecifier("segmentedTextured-last", Widget.BUTTON_SEGMENTED_TEXTURED, SegmentPosition.LAST, new SizeVariant().alterMargins(6, 8, 6, 12).alterInsets(2, 0, 2, 3).alterMinSize(0, 28), 0, -3, 0, -3),
+            new SegmentedBorderDefinedTypeSpecifier("segmentedTextured-only", Widget.BUTTON_SEGMENTED_TEXTURED, SegmentPosition.ONLY, new SizeVariant().alterMargins(6, 12, 6, 12).alterInsets(2, 3, 2, 3).alterMinSize(0, 28), 0, -3, 0, -3),
 
-            new SegmentedBorderDefinedTypeSpecifier("segmentedCapsule-first", Widget.BUTTON_SEGMENTED_TOOLBAR, SegmentPosition.FIRST, new SizeVariant().alterMargins(6, 12, 6, 8).alterInsets(5, 2, 5, 0).alterMinSize(0, 28), 0, 0, 0, 0),
-            new SegmentedBorderDefinedTypeSpecifier("segmentedCapsule-middle", Widget.BUTTON_SEGMENTED_TOOLBAR, SegmentPosition.MIDDLE, new SizeVariant().alterMargins(6, 8, 6, 8).alterInsets(5, 0, 5, 0).alterMinSize(0, 28), 0, 0, 0, 0),
-            new SegmentedBorderDefinedTypeSpecifier("segmentedCapsule-last", Widget.BUTTON_SEGMENTED_TOOLBAR, SegmentPosition.LAST, new SizeVariant().alterMargins(6, 8, 6, 12).alterInsets(5, 0, 5, 2).alterMinSize(0, 28), 0, 0, 0, 0),
-            new SegmentedBorderDefinedTypeSpecifier("segmentedCapsule-only", Widget.BUTTON_SEGMENTED_TOOLBAR, SegmentPosition.ONLY, new SizeVariant().alterMargins(6, 12, 6, 12).alterInsets(5, 2, 5, 2).alterMinSize(34, 28), 0, 0, 0, 0),
+            new SegmentedBorderDefinedTypeSpecifier("segmentedCapsule-first", Widget.BUTTON_SEGMENTED_TOOLBAR, SegmentPosition.FIRST, new SizeVariant().alterMargins(6, 12, 6, 8).alterInsets(2, 2, 2, 0).alterMinSize(0, 28), 0, 0, 0, 0),
+            new SegmentedBorderDefinedTypeSpecifier("segmentedCapsule-middle", Widget.BUTTON_SEGMENTED_TOOLBAR, SegmentPosition.MIDDLE, new SizeVariant().alterMargins(6, 8, 6, 8).alterInsets(2, 0, 2, 0).alterMinSize(0, 28), 0, 0, 0, 0),
+            new SegmentedBorderDefinedTypeSpecifier("segmentedCapsule-last", Widget.BUTTON_SEGMENTED_TOOLBAR, SegmentPosition.LAST, new SizeVariant().alterMargins(6, 8, 6, 12).alterInsets(2, 0, 2, 2).alterMinSize(0, 28), 0, 0, 0, 0),
+            new SegmentedBorderDefinedTypeSpecifier("segmentedCapsule-only", Widget.BUTTON_SEGMENTED_TOOLBAR, SegmentPosition.ONLY, new SizeVariant().alterMargins(6, 12, 6, 12).alterInsets(2, 2, 2, 2).alterMinSize(34, 28), 0, 0, 0, 0),
 
             new BorderDefinedTypeSpecifier("segmentedGradient-first", Widget.BUTTON_BEVEL_INSET, new SizeVariant(18, 18).alterMargins(4, 5, 4, 5).replaceInsets(new Insets(-2,-0,-2,-0))),
             new BorderDefinedTypeSpecifier("segmentedGradient-middle", Widget.BUTTON_BEVEL_INSET, new SizeVariant(18, 18).alterMargins(4, 5, 4, 5).replaceInsets(new Insets(-2,-1,-2,-0))),
--- a/src/macosx/classes/com/apple/laf/AquaComboBoxUI.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/classes/com/apple/laf/AquaComboBoxUI.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -34,7 +34,6 @@
 import javax.swing.event.*;
 import javax.swing.plaf.*;
 import javax.swing.plaf.basic.*;
-import com.apple.laf.ClientPropertyApplicator;
 import com.apple.laf.ClientPropertyApplicator.Property;
 import apple.laf.JRSUIConstants.Size;
 
@@ -142,35 +141,46 @@
         return new AquaComboBoxEditor();
     }
 
-    class AquaComboBoxEditor extends BasicComboBoxEditor implements UIResource, DocumentListener {
-        protected AquaComboBoxEditor() {
+    final class AquaComboBoxEditor extends BasicComboBoxEditor
+            implements UIResource, DocumentListener {
+
+        AquaComboBoxEditor() {
             super();
             editor = new AquaCustomComboTextField();
             editor.addFocusListener(this);
             editor.getDocument().addDocumentListener(this);
         }
 
+        @Override
         public void focusGained(final FocusEvent e) {
-            arrowButton.repaint();
+            if (arrowButton != null) {
+                arrowButton.repaint();
+            }
         }
 
+        @Override
         public void focusLost(final FocusEvent e) {
-            arrowButton.repaint();
+            if (arrowButton != null) {
+                arrowButton.repaint();
+            }
         }
 
+        @Override
         public void changedUpdate(final DocumentEvent e) {
             editorTextChanged();
         }
 
+        @Override
         public void insertUpdate(final DocumentEvent e) {
             editorTextChanged();
         }
 
+        @Override
         public void removeUpdate(final DocumentEvent e) {
             editorTextChanged();
         }
 
-        protected void editorTextChanged() {
+        private void editorTextChanged() {
             if (!popup.isVisible()) return;
 
             final Object text = editor.getText();
--- a/src/macosx/classes/com/apple/laf/AquaPainter.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/classes/com/apple/laf/AquaPainter.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -37,20 +37,19 @@
 import sun.java2d.*;
 import sun.print.*;
 import apple.laf.*;
-import apple.laf.JRSUIConstants.Widget;
 import apple.laf.JRSUIUtils.NineSliceMetricsProvider;
 
 abstract class AquaPainter <T extends JRSUIState> {
     static <T extends JRSUIState> AquaPainter<T> create(final T state) {
-        return new AquaSingleImagePainter<T>(state);
+        return new AquaSingleImagePainter<>(state);
     }
 
     static <T extends JRSUIState> AquaPainter<T> create(final T state, final int minWidth, final int minHeight, final int westCut, final int eastCut, final int northCut, final int southCut) {
-        return AquaPainter.create(state, minWidth, minHeight, westCut, eastCut, northCut, southCut, true);
+        return create(state, minWidth, minHeight, westCut, eastCut, northCut, southCut, true);
     }
 
     static <T extends JRSUIState> AquaPainter<T> create(final T state, final int minWidth, final int minHeight, final int westCut, final int eastCut, final int northCut, final int southCut, final boolean useMiddle) {
-        return AquaPainter.create(state, minWidth, minHeight, westCut, eastCut, northCut, southCut, useMiddle, true, true);
+        return create(state, minWidth, minHeight, westCut, eastCut, northCut, southCut, useMiddle, true, true);
     }
 
     static <T extends JRSUIState> AquaPainter<T> create(final T state, final int minWidth, final int minHeight, final int westCut, final int eastCut, final int northCut, final int southCut, final boolean useMiddle, final boolean stretchHorizontally, final boolean stretchVertically) {
@@ -63,51 +62,54 @@
     }
 
     static <T extends JRSUIState> AquaPainter<T> create(final T state, final NineSliceMetricsProvider metricsProvider) {
-        return new AquaNineSlicingImagePainter<T>(state, metricsProvider);
+        return new AquaNineSlicingImagePainter<>(state, metricsProvider);
     }
 
-    abstract void paint(final Graphics2D g, final T stateToPaint, final Component c);
+    abstract void paint(Graphics2D g, T stateToPaint);
 
     final Rectangle boundsRect = new Rectangle();
     final JRSUIControl control;
     T state;
-    public AquaPainter(final JRSUIControl control, final T state) {
+    AquaPainter(final JRSUIControl control, final T state) {
         this.control = control;
         this.state = state;
     }
 
-    JRSUIControl getControl() {
-        control.set(state = (T)state.derive());
+    final JRSUIControl getControl() {
+        control.set(state = state.derive());
         return control;
     }
 
-    void paint(final Graphics g, final Component c, final int x, final int y, final int w, final int h) {
+    final void paint(final Graphics g, final Component c, final int x,
+                     final int y, final int w, final int h) {
         boundsRect.setBounds(x, y, w, h);
 
-        final T nextState = (T)state.derive();
+        final T nextState = state.derive();
         final Graphics2D g2d = getGraphics2D(g);
-        if (g2d != null) paint(g2d, nextState, c);
+        if (g2d != null) paint(g2d, nextState);
         state = nextState;
     }
 
-    static class AquaNineSlicingImagePainter<T extends JRSUIState> extends AquaPainter<T> {
-        protected final HashMap<T, RecyclableJRSUISlicedImageControl> slicedControlImages;
-        protected final NineSliceMetricsProvider metricsProvider;
+    private static class AquaNineSlicingImagePainter<T extends JRSUIState>
+            extends AquaPainter<T> {
 
-        public AquaNineSlicingImagePainter(final T state) {
+        private final HashMap<T, RecyclableJRSUISlicedImageControl> slicedControlImages;
+        private final NineSliceMetricsProvider metricsProvider;
+
+        AquaNineSlicingImagePainter(final T state) {
             this(state, null);
         }
 
-        public AquaNineSlicingImagePainter(final T state, final NineSliceMetricsProvider metricsProvider) {
+        AquaNineSlicingImagePainter(final T state, final NineSliceMetricsProvider metricsProvider) {
             super(new JRSUIControl(false), state);
             this.metricsProvider = metricsProvider;
-            slicedControlImages = new HashMap<T, RecyclableJRSUISlicedImageControl>();
+            slicedControlImages = new HashMap<>();
         }
 
         @Override
-        void paint(final Graphics2D g, final T stateToPaint, final Component c) {
+        void paint(final Graphics2D g, final T stateToPaint) {
             if (metricsProvider == null) {
-                AquaSingleImagePainter.paintFromSingleCachedImage(g, control, stateToPaint, c, boundsRect);
+                AquaSingleImagePainter.paintFromSingleCachedImage(g, control, stateToPaint, boundsRect);
                 return;
             }
 
@@ -115,7 +117,7 @@
             if (slicesRef == null) {
                 final NineSliceMetrics metrics = metricsProvider.getNineSliceMetricsForState(stateToPaint);
                 if (metrics == null) {
-                    AquaSingleImagePainter.paintFromSingleCachedImage(g, control, stateToPaint, c, boundsRect);
+                    AquaSingleImagePainter.paintFromSingleCachedImage(g, control, stateToPaint, boundsRect);
                     return;
                 }
                 slicesRef = new RecyclableJRSUISlicedImageControl(control, stateToPaint, metrics);
@@ -126,54 +128,57 @@
         }
     }
 
-    static class AquaSingleImagePainter<T extends JRSUIState> extends AquaPainter<T> {
-        public AquaSingleImagePainter(final T state) {
+    private static final class AquaSingleImagePainter<T extends JRSUIState>
+            extends AquaPainter<T> {
+
+        AquaSingleImagePainter(final T state) {
             super(new JRSUIControl(false), state);
         }
 
         @Override
-        void paint(Graphics2D g, T stateToPaint, Component c) {
-            paintFromSingleCachedImage(g, control, stateToPaint, c, boundsRect);
+        void paint(final Graphics2D g, final T stateToPaint) {
+            paintFromSingleCachedImage(g, control, stateToPaint, boundsRect);
         }
 
-        static void paintFromSingleCachedImage(final Graphics2D g, final JRSUIControl control, final JRSUIState controlState, final Component c, final Rectangle boundsRect) {
-            Rectangle clipRect = g.getClipBounds();
-            Rectangle intersection = boundsRect.intersection(clipRect);
-            if (intersection.width <= 0 || intersection.height <= 0) return;
-
-            int imgX1 = intersection.x - boundsRect.x;
-            int imgY1 = intersection.y - boundsRect.y;
-
-            final GraphicsConfiguration config = g.getDeviceConfiguration();
-            final ImageCache cache = ImageCache.getInstance();
-            BufferedImage image = (BufferedImage)cache.getImage(config, boundsRect.width, boundsRect.height, controlState);
-            if (image == null) {
-                image = new BufferedImage(boundsRect.width, boundsRect.height, BufferedImage.TYPE_INT_ARGB_PRE);
-                cache.setImage(image, config, boundsRect.width, boundsRect.height, controlState);
-            } else {
-                g.drawImage(image, intersection.x, intersection.y, intersection.x + intersection.width, intersection.y + intersection.height,
-                        imgX1, imgY1, imgX1 + intersection.width, imgY1 + intersection.height, null);
+        static void paintFromSingleCachedImage(final Graphics2D g,
+                final JRSUIControl control, final JRSUIState controlState,
+                final Rectangle bounds) {
+            if (bounds.width <= 0 || bounds.height <= 0) {
                 return;
             }
 
-            final WritableRaster raster = image.getRaster();
-            final DataBufferInt buffer = (DataBufferInt)raster.getDataBuffer();
+            int scale = 1;
+            if (g instanceof SunGraphics2D) {
+                scale = ((SunGraphics2D) g).surfaceData.getDefaultScale();
+            }
+            final GraphicsConfiguration config = g.getDeviceConfiguration();
+            final ImageCache cache = ImageCache.getInstance();
+            final int imgW = bounds.width * scale;
+            final int imgH = bounds.height * scale;
+            BufferedImage img = (BufferedImage) cache.getImage(config, imgW, imgH, scale, controlState);
+            if (img == null) {
+                img = new BufferedImage(imgW, imgH, BufferedImage.TYPE_INT_ARGB_PRE);
+                cache.setImage(img, config, imgW, imgH, scale, controlState);
+                final WritableRaster raster = img.getRaster();
+                final DataBufferInt buffer = (DataBufferInt) raster.getDataBuffer();
 
-            control.set(controlState);
-            control.paint(SunWritableRaster.stealData(buffer, 0),
-                    image.getWidth(), image.getHeight(), 0, 0, boundsRect.width, boundsRect.height);
-            SunWritableRaster.markDirty(buffer);
+                control.set(controlState);
+                control.paint(SunWritableRaster.stealData(buffer, 0),
+                        imgW, imgH, 0, 0, bounds.width, bounds.height);
+                SunWritableRaster.markDirty(buffer);
+            }
 
-            g.drawImage(image, intersection.x, intersection.y, intersection.x + intersection.width, intersection.y + intersection.height,
-                    imgX1, imgY1, imgX1 + intersection.width, imgY1 + intersection.height, null);
+            g.drawImage(img, bounds.x, bounds.y, bounds.width, bounds.height, null);
         }
     }
 
-    static class RecyclableJRSUISlicedImageControl extends RecyclableSlicedImageControl {
-        final JRSUIControl control;
-        final JRSUIState state;
+    private static class RecyclableJRSUISlicedImageControl
+            extends RecyclableSlicedImageControl {
 
-        public RecyclableJRSUISlicedImageControl(final JRSUIControl control, final JRSUIState state, final NineSliceMetrics metrics) {
+        private final JRSUIControl control;
+        private final JRSUIState state;
+
+        RecyclableJRSUISlicedImageControl(final JRSUIControl control, final JRSUIState state, final NineSliceMetrics metrics) {
             super(metrics);
             this.control = control;
             this.state = state;
@@ -195,17 +200,19 @@
         }
     }
 
-    protected Graphics2D getGraphics2D(final Graphics g) {
+    private Graphics2D getGraphics2D(final Graphics g) {
         try {
             return (SunGraphics2D)g; // doing a blind try is faster than checking instanceof
-        } catch (Exception e) {
+        } catch (Exception ignored) {
             if (g instanceof PeekGraphics) {
                 // if it is a peek just dirty the region
                 g.fillRect(boundsRect.x, boundsRect.y, boundsRect.width, boundsRect.height);
             } else if (g instanceof ProxyGraphics2D) {
                 final ProxyGraphics2D pg = (ProxyGraphics2D)g;
                 final Graphics2D g2d = pg.getDelegate();
-                if (g2d instanceof SunGraphics2D) { return (SunGraphics2D)g2d; }
+                if (g2d instanceof SunGraphics2D) {
+                    return g2d;
+                }
             } else if (g instanceof Graphics2D) {
                 return (Graphics2D) g;
             }
--- a/src/macosx/classes/com/apple/laf/AquaPanelUI.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/classes/com/apple/laf/AquaPanelUI.java	Fri Jun 21 19:11:42 2013 -0700
@@ -32,10 +32,20 @@
 import com.apple.laf.AquaUtils.RecyclableSingleton;
 import com.apple.laf.AquaUtils.RecyclableSingletonFromDefaultConstructor;
 
+import java.awt.Graphics;
+
 public class AquaPanelUI extends BasicPanelUI {
     static RecyclableSingleton<AquaPanelUI> instance = new RecyclableSingletonFromDefaultConstructor<AquaPanelUI>(AquaPanelUI.class);
 
     public static ComponentUI createUI(final JComponent c) {
         return instance.get();
     }
+
+    @Override
+    public final void update(final Graphics g, final JComponent c) {
+        if (c.isOpaque()) {
+            AquaUtils.fillRect(g, c);
+        }
+        paint(g, c);
+    }
 }
--- a/src/macosx/classes/com/apple/laf/AquaRootPaneUI.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/classes/com/apple/laf/AquaRootPaneUI.java	Fri Jun 21 19:11:42 2013 -0700
@@ -319,4 +319,12 @@
             updateComponentTreeUIActivation(element, active);
         }
     }
+
+    @Override
+    public final void update(final Graphics g, final JComponent c) {
+        if (c.isOpaque()) {
+            AquaUtils.fillRect(g, c);
+        }
+        paint(g, c);
+    }
 }
--- a/src/macosx/classes/com/apple/laf/AquaToolBarUI.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/classes/com/apple/laf/AquaToolBarUI.java	Fri Jun 21 19:11:42 2013 -0700
@@ -73,9 +73,7 @@
             g.translate(x, y);
 
             if (c.isOpaque()) {
-                final Color background = c.getBackground();
-                g.setColor(background);
-                g.fillRect(0, 0, w - 1, h - 1);
+                AquaUtils.fillRect(g, c, c.getBackground(), 0, 0, w - 1, h - 1);
             }
 
             final Color oldColor = g.getColor();
@@ -137,4 +135,12 @@
             return true;
         }
     }
+
+    @Override
+    public final void update(final Graphics g, final JComponent c) {
+        if (c.isOpaque()) {
+            AquaUtils.fillRect(g, c);
+        }
+        paint(g, c);
+    }
 }
--- a/src/macosx/classes/com/apple/laf/AquaUtils.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/classes/com/apple/laf/AquaUtils.java	Fri Jun 21 19:11:42 2013 -0700
@@ -28,18 +28,19 @@
 import java.awt.*;
 import java.awt.image.*;
 import java.lang.ref.SoftReference;
-import java.lang.ref.WeakReference;
 import java.lang.reflect.Method;
 import java.security.PrivilegedAction;
 import java.util.*;
 
 import javax.swing.*;
 import javax.swing.border.Border;
+import javax.swing.plaf.UIResource;
 
 import sun.awt.AppContext;
 
 import sun.lwawt.macosx.CImage;
 import sun.lwawt.macosx.CImage.Creator;
+import sun.lwawt.macosx.CPlatformWindow;
 import sun.swing.SwingUtilities2;
 
 import com.apple.laf.AquaImageFactory.SlicedImageControl;
@@ -389,4 +390,51 @@
             return false;
         }
     }
+
+    protected static boolean isWindowTextured(final Component c) {
+        if (!(c instanceof JComponent)) {
+            return false;
+        }
+        final JRootPane pane = ((JComponent) c).getRootPane();
+        if (pane == null) {
+            return false;
+        }
+        Object prop = pane.getClientProperty(
+                CPlatformWindow.WINDOW_BRUSH_METAL_LOOK);
+        if (prop != null) {
+            return Boolean.parseBoolean(prop.toString());
+        }
+        prop = pane.getClientProperty(CPlatformWindow.WINDOW_STYLE);
+        return prop != null && "textured".equals(prop);
+    }
+
+    private static Color resetAlpha(final Color color) {
+        return new Color(color.getRed(), color.getGreen(), color.getBlue(), 0);
+    }
+
+    protected static void fillRect(final Graphics g, final Component c) {
+        fillRect(g, c, c.getBackground(), 0, 0, c.getWidth(), c.getHeight());
+    }
+
+    protected static void fillRect(final Graphics g, final Component c,
+                                   final Color color, final int x, final int y,
+                                   final int w, final int h) {
+        if (!(g instanceof Graphics2D)) {
+            return;
+        }
+        final Graphics2D cg = (Graphics2D) g.create();
+        try {
+            if (color instanceof UIResource && isWindowTextured(c)
+                    && color.equals(SystemColor.window)) {
+                cg.setComposite(AlphaComposite.Src);
+                cg.setColor(resetAlpha(color));
+            } else {
+                cg.setColor(color);
+            }
+            cg.fillRect(x, y, w, h);
+        } finally {
+            cg.dispose();
+        }
+    }
 }
+
--- a/src/macosx/classes/com/apple/laf/ImageCache.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/classes/com/apple/laf/ImageCache.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -30,6 +30,7 @@
 import java.util.*;
 import java.util.concurrent.locks.*;
 
+import apple.laf.JRSUIConstants;
 import apple.laf.JRSUIState;
 import com.apple.laf.AquaUtils.RecyclableSingleton;
 
@@ -38,9 +39,9 @@
  * SoftReferences so they will be dropped by the GC if heap memory gets tight. When our size hits max pixel count least
  * recently requested images are removed first.
  */
-class ImageCache {
+final class ImageCache {
     // Ordered Map keyed by args hash, ordered by most recent accessed entry.
-    private final LinkedHashMap<Integer, PixelCountSoftReference> map = new LinkedHashMap<Integer, PixelCountSoftReference>(16, 0.75f, true);
+    private final LinkedHashMap<Integer, PixelCountSoftReference> map = new LinkedHashMap<>(16, 0.75f, true);
 
     // Maximum number of pixels to cache, this is used if maxCount
     private final int maxPixelCount;
@@ -50,7 +51,7 @@
     // Lock for concurrent access to map
     private final ReadWriteLock lock = new ReentrantReadWriteLock();
     // Reference queue for tracking lost softreferences to images in the cache
-    private final ReferenceQueue<Image> referenceQueue = new ReferenceQueue<Image>();
+    private final ReferenceQueue<Image> referenceQueue = new ReferenceQueue<>();
 
     // Singleton Instance
     private static final RecyclableSingleton<ImageCache> instance = new RecyclableSingleton<ImageCache>() {
@@ -63,11 +64,11 @@
         return instance.get();
     }
 
-    public ImageCache(final int maxPixelCount) {
+    ImageCache(final int maxPixelCount) {
         this.maxPixelCount = maxPixelCount;
     }
 
-    public ImageCache() {
+    ImageCache() {
         this((8 * 1024 * 1024) / 4); // 8Mb of pixels
     }
 
@@ -80,16 +81,23 @@
         }
     }
 
-    public Image getImage(final GraphicsConfiguration config, final int w, final int h, final JRSUIState state) {
+    public Image getImage(final GraphicsConfiguration config, final int w,
+                          final int h, final int scale,
+                          final JRSUIState state) {
+        final int hash = hash(config, w, h, scale, state);
+        final PixelCountSoftReference ref;
         lock.readLock().lock();
         try {
-            final PixelCountSoftReference ref = map.get(hash(config, w, h, state));
-            // check reference has not been lost and the key truly matches, in case of false positive hash match
-            if (ref != null && ref.equals(config, w, h, state)) return ref.get();
-            return null;
+            ref = map.get(hash);
         } finally {
             lock.readLock().unlock();
         }
+        // check reference has not been lost and the key truly matches,
+        // in case of false positive hash match
+        if (ref != null && ref.equals(config, w, h, scale, state)) {
+            return ref.get();
+        }
+        return null;
     }
 
     /**
@@ -99,11 +107,17 @@
      * @param config The graphics configuration, needed if cached image is a Volatile Image. Used as part of cache key
      * @param w      The image width, used as part of cache key
      * @param h      The image height, used as part of cache key
-     * @param args   Other arguments to use as part of the cache key
-     * @return true if the image could be cached or false if the image is too big
+     * @param scale  The image scale factor, used as part of cache key
+     * @return true if the image could be cached, false otherwise.
      */
-    public boolean setImage(final Image image, final GraphicsConfiguration config, final int w, final int h, final JRSUIState state) {
-        final int hash = hash(config, w, h, state);
+    public boolean setImage(final Image image,
+            final GraphicsConfiguration config, final int w, final int h,
+            final int scale, final JRSUIState state) {
+        if (state.is(JRSUIConstants.Animating.YES)) {
+            return false;
+        }
+
+        final int hash = hash(config, w, h, scale, state);
 
         lock.writeLock().lock();
         try {
@@ -141,44 +155,60 @@
                 }
             }
             // finally put new in map
-            map.put(hash, new PixelCountSoftReference(image, referenceQueue, newPixelCount, hash, config, w, h, state));
+            map.put(hash, new PixelCountSoftReference(image, referenceQueue, newPixelCount, hash, config, w, h, scale, state));
             return true;
         } finally {
             lock.writeLock().unlock();
         }
     }
 
-    private int hash(final GraphicsConfiguration config, final int w, final int h, final JRSUIState state) {
-        int hash = (config != null ? config.hashCode() : 0);
+    private static int hash(final GraphicsConfiguration config, final int w,
+                            final int h, final int scale,
+                            final JRSUIState state) {
+        int hash = config != null ? config.hashCode() : 0;
         hash = 31 * hash + w;
         hash = 31 * hash + h;
+        hash = 31 * hash + scale;
         hash = 31 * hash + state.hashCode();
         return hash;
     }
 
-    /** Extended SoftReference that stores the pixel count even after the image is lost */
+    /**
+     * Extended SoftReference that stores the pixel count even after the image
+     * is lost.
+     */
     private static class PixelCountSoftReference extends SoftReference<Image> {
-        private final int pixelCount;
-        private final int hash;
+
+        // default access, because access to these fields shouldn't be emulated
+        // by a synthetic accessor.
+        final int pixelCount;
+        final int hash;
 
         // key parts
         private final GraphicsConfiguration config;
         private final int w;
         private final int h;
+        private final int scale;
         private final JRSUIState state;
 
-        public PixelCountSoftReference(final Image referent, final ReferenceQueue<? super Image> q, final int pixelCount, final int hash, final GraphicsConfiguration config, final int w, final int h, final JRSUIState state) {
+        PixelCountSoftReference(final Image referent,
+                final ReferenceQueue<? super Image> q, final int pixelCount,
+                final int hash, final GraphicsConfiguration config, final int w,
+                final int h, final int scale, final JRSUIState state) {
             super(referent, q);
             this.pixelCount = pixelCount;
             this.hash = hash;
             this.config = config;
             this.w = w;
             this.h = h;
+            this.scale = scale;
             this.state = state;
         }
 
-        public boolean equals(final GraphicsConfiguration config, final int w, final int h, final JRSUIState state) {
-            return config == this.config && w == this.w && h == this.h && state.equals(this.state);
+        boolean equals(final GraphicsConfiguration config, final int w,
+                       final int h, final int scale, final JRSUIState state) {
+            return config == this.config && w == this.w && h == this.h
+                    && scale == this.scale && state.equals(this.state);
         }
     }
 
--- a/src/macosx/classes/java/util/prefs/MacOSXPreferences.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/classes/java/util/prefs/MacOSXPreferences.java	Fri Jun 21 19:11:42 2013 -0700
@@ -25,6 +25,8 @@
 
 package java.util.prefs;
 
+import java.util.Objects;
+
 class MacOSXPreferences extends AbstractPreferences {
     // fixme need security checks?
 
@@ -33,16 +35,16 @@
     private static final String defaultAppName = "com.apple.java.util.prefs";
 
     // true if this node is a child of userRoot or is userRoot
-    private boolean isUser;
+    private final boolean isUser;
 
     // true if this node is userRoot or systemRoot
-    private boolean isRoot;
+    private final boolean isRoot;
 
     // CF's storage location for this node and its keys
-    private MacOSXPreferencesFile file;
+    private final MacOSXPreferencesFile file;
 
     // absolutePath() + "/"
-    private String path;
+    private final String path;
 
     // User root and system root nodes
     private static MacOSXPreferences userRoot = null;
@@ -71,36 +73,40 @@
 
     // Create a new root node. Called by getUserRoot() and getSystemRoot()
     // Synchronization is provided by the caller.
-    private MacOSXPreferences(boolean newIsUser)
-    {
-        super(null, "");
-        isUser = newIsUser;
-        isRoot = true;
-
-        initFields();
+    private MacOSXPreferences(boolean newIsUser) {
+        this(null, "", false, true, newIsUser);
     }
 
 
     // Create a new non-root node with the given parent.
     // Called by childSpi().
-    private MacOSXPreferences(MacOSXPreferences parent, String name)
+    private MacOSXPreferences(MacOSXPreferences parent, String name) {
+        this(parent, name, false, false, false);
+    }
+
+    private MacOSXPreferences(MacOSXPreferences parent, String name,
+                              boolean isNew)
     {
-        super(parent, name);
-        isUser = isUserNode();
-        isRoot = false;
-
-        initFields();
+        this(parent, name, isNew, false, false);
     }
 
-
-    private void initFields()
+    private MacOSXPreferences(MacOSXPreferences parent, String name,
+                              boolean isNew, boolean isRoot, boolean isUser)
     {
+        super(parent, name);
+        this.isRoot = isRoot;
+        if (isRoot)
+            this.isUser = isUser;
+        else
+            this.isUser = isUserNode();
         path = isRoot ? absolutePath() : absolutePath() + "/";
-        file = cfFileForNode(isUser);
-        newNode = file.addNode(path);
+        file = cfFileForNode(this.isUser);
+        if (isNew)
+            newNode = isNew;
+        else
+            newNode = file.addNode(path);
     }
 
-
     // Create and return the MacOSXPreferencesFile for this node.
     // Does not write anything to the file.
     private MacOSXPreferencesFile cfFileForNode(boolean isUser)
@@ -147,6 +153,7 @@
     // AbstractPreferences implementation
     protected void removeSpi(String key)
     {
+        Objects.requireNonNull(key, "Specified key cannot be null");
         file.removeKeyFromNode(path, key);
     }
 
@@ -194,8 +201,8 @@
         // Add to parent's child list here and disallow sync
         // because parent and child might be in different files.
         synchronized(MacOSXPreferencesFile.class) {
-            file.addChildToNode(path, name);
-            return new MacOSXPreferences(this, name);
+            boolean isNew = file.addChildToNode(path, name);
+            return new MacOSXPreferences(this, name, isNew);
         }
     }
 
@@ -206,9 +213,14 @@
         // Flush should *not* check for removal, unlike sync, but should
         // prevent simultaneous removal.
         synchronized(lock) {
-            // fixme! overkill
-            if (!MacOSXPreferencesFile.flushWorld()) {
-                throw new BackingStoreException("Synchronization failed for node '" + path + "'");
+            if (isUser) {
+                if (!MacOSXPreferencesFile.flushUser()) {
+                    throw new BackingStoreException("Synchronization failed for node '" + path + "'");
+                }
+            } else {
+                if (!MacOSXPreferencesFile.flushWorld()) {
+                    throw new BackingStoreException("Synchronization failed for node '" + path + "'");
+                }
             }
         }
     }
--- a/src/macosx/classes/java/util/prefs/MacOSXPreferencesFile.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/classes/java/util/prefs/MacOSXPreferencesFile.java	Fri Jun 21 19:11:42 2013 -0700
@@ -223,7 +223,23 @@
         return ok;
     }
 
-
+    //Flush only current user preferences
+    static synchronized boolean flushUser() {
+        boolean ok = true;
+        if (changedFiles != null  &&  !changedFiles.isEmpty()) {
+            Iterator<MacOSXPreferencesFile> iterator = changedFiles.iterator();
+            while(iterator.hasNext()) {
+                MacOSXPreferencesFile f = iterator.next();
+                if (f.user == cfCurrentUser) {
+                    if (!f.synchronize())
+                        ok = false;
+                    else
+                        iterator.remove();
+                }
+            }
+        }
+        return ok;
+    }
 
     // Write all prefs changes to disk, but do not clear all cached prefs
     // values. Also kills any scheduled flush task.
@@ -348,11 +364,11 @@
         }
     }
 
-    void addChildToNode(String path, String child)
+    boolean addChildToNode(String path, String child)
     {
         synchronized(MacOSXPreferencesFile.class) {
             markChanged();
-            addChildToNode(path, child+"/", appName, user, host);
+            return addChildToNode(path, child+"/", appName, user, host);
         }
     }
 
@@ -421,7 +437,7 @@
         addNode(String path, String name, long user, long host);
     private static final native void
         removeNode(String path, String name, long user, long host);
-    private static final native void
+    private static final native boolean
         addChildToNode(String path, String child,
                        String name, long user, long host);
     private static final native void
--- a/src/macosx/classes/sun/awt/CGraphicsConfig.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/classes/sun/awt/CGraphicsConfig.java	Fri Jun 21 19:11:42 2013 -0700
@@ -50,7 +50,7 @@
 
     @Override
     public Rectangle getBounds() {
-        final Rectangle2D nativeBounds = nativeGetBounds(device.getCoreGraphicsScreen());
+        final Rectangle2D nativeBounds = nativeGetBounds(device.getCGDisplayID());
         return nativeBounds.getBounds(); // does integer rounding
     }
 
--- a/src/macosx/classes/sun/awt/CGraphicsDevice.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/classes/sun/awt/CGraphicsDevice.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -25,20 +25,28 @@
 
 package sun.awt;
 
+import java.awt.AWTPermission;
+import java.awt.DisplayMode;
 import java.awt.GraphicsConfiguration;
 import java.awt.GraphicsDevice;
+import java.awt.Insets;
 import java.awt.Window;
-import java.awt.AWTPermission;
-import java.awt.DisplayMode;
+import java.util.Objects;
 
 import sun.java2d.opengl.CGLGraphicsConfig;
 
-import sun.awt.FullScreenCapable;
+public final class CGraphicsDevice extends GraphicsDevice
+        implements DisplayChangedListener {
 
-public class CGraphicsDevice extends GraphicsDevice {
-
-    // CoreGraphics display ID
-    private final int displayID;
+    /**
+     * CoreGraphics display ID. This identifier can become non-valid at any time
+     * therefore methods, which is using this id should be ready to it.
+     */
+    private volatile int displayID;
+    private volatile Insets screenInsets;
+    private volatile double xResolution;
+    private volatile double yResolution;
+    private volatile int scale;
 
     // Array of all GraphicsConfig instances for this device
     private final GraphicsConfiguration[] configs;
@@ -51,7 +59,7 @@
     // Save/restore DisplayMode for the Full Screen mode
     private DisplayMode originalMode;
 
-    public CGraphicsDevice(int displayID) {
+    public CGraphicsDevice(final int displayID) {
         this.displayID = displayID;
         configs = new GraphicsConfiguration[] {
             CGLGraphicsConfig.getConfig(this, 0)
@@ -59,9 +67,12 @@
     }
 
     /**
+     * Returns CGDirectDisplayID, which is the same id as @"NSScreenNumber" in
+     * NSScreen.
+     *
      * @return CoreGraphics display id.
      */
-    public int getCoreGraphicsScreen() {
+    public int getCGDisplayID() {
         return displayID;
     }
 
@@ -86,7 +97,7 @@
      */
     @Override
     public String getIDstring() {
-        return "Display " + this.displayID;
+        return "Display " + displayID;
     }
 
     /**
@@ -101,20 +112,38 @@
     }
 
     public double getXResolution() {
-        return nativeGetXResolution(displayID);
+        return xResolution;
     }
 
     public double getYResolution() {
-        return nativeGetYResolution(displayID);
+        return yResolution;
+    }
+
+    public Insets getScreenInsets() {
+        return screenInsets;
+    }
+
+    public int getScaleFactor() {
+        return scale;
     }
 
-    public int getScreenResolution() {
-        // TODO: report non-72 value when HiDPI is turned on
-        return 72;
+    public void invalidate(final int defaultDisplayID) {
+        displayID = defaultDisplayID;
     }
 
-    private static native double nativeGetXResolution(int displayID);
-    private static native double nativeGetYResolution(int displayID);
+    @Override
+    public void displayChanged() {
+        xResolution = nativeGetXResolution(displayID);
+        yResolution = nativeGetYResolution(displayID);
+        screenInsets = nativeGetScreenInsets(displayID);
+        scale = (int) nativeGetScaleFactor(displayID);
+        //TODO configs/fullscreenWindow/modes?
+    }
+
+    @Override
+    public void paletteChanged() {
+        // devices do not need to react to this event.
+    }
 
     /**
      * Enters full-screen mode, or returns to windowed mode.
@@ -129,12 +158,12 @@
         boolean fsSupported = isFullScreenSupported();
 
         if (fsSupported && old != null) {
-            // enter windowed mode (and restore original display mode)
-            exitFullScreenExclusive(old);
+            // restore original display mode and enter windowed mode.
             if (originalMode != null) {
                 setDisplayMode(originalMode);
                 originalMode = null;
             }
+            exitFullScreenExclusive(old);
         }
 
         super.setFullScreenWindow(w);
@@ -193,13 +222,20 @@
     }
 
     @Override
-    public void setDisplayMode(DisplayMode dm) {
+    public void setDisplayMode(final DisplayMode dm) {
         if (dm == null) {
             throw new IllegalArgumentException("Attempt to set null as a DisplayMode");
         }
-        nativeSetDisplayMode(displayID, dm.getWidth(), dm.getHeight(), dm.getBitDepth(), dm.getRefreshRate());
-        if (isFullScreenSupported() && getFullScreenWindow() != null) {
-            getFullScreenWindow().setSize(dm.getWidth(), dm.getHeight());
+        if (!Objects.equals(dm, getDisplayMode())) {
+            final Window w = getFullScreenWindow();
+            if (w != null) {
+                exitFullScreenExclusive(w);
+            }
+            nativeSetDisplayMode(displayID, dm.getWidth(), dm.getHeight(),
+                                 dm.getBitDepth(), dm.getRefreshRate());
+            if (isFullScreenSupported() && w != null) {
+                enterFullScreenExclusive(w);
+            }
         }
     }
 
@@ -213,9 +249,17 @@
         return nativeGetDisplayModes(displayID);
     }
 
-    private native void nativeSetDisplayMode(int displayID, int w, int h, int bpp, int refrate);
+    private static native double nativeGetScaleFactor(int displayID);
+
+    private static native void nativeSetDisplayMode(int displayID, int w, int h, int bpp, int refrate);
+
+    private static native DisplayMode nativeGetDisplayMode(int displayID);
 
-    private native DisplayMode nativeGetDisplayMode(int displayID);
+    private static native DisplayMode[] nativeGetDisplayModes(int displayID);
+
+    private static native double nativeGetXResolution(int displayID);
 
-    private native DisplayMode[] nativeGetDisplayModes(int displayID);
+    private static native double nativeGetYResolution(int displayID);
+
+    private static native Insets nativeGetScreenInsets(int displayID);
 }
--- a/src/macosx/classes/sun/awt/CGraphicsEnvironment.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/classes/sun/awt/CGraphicsEnvironment.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -26,19 +26,20 @@
 package sun.awt;
 
 import java.awt.*;
-import java.awt.print.*;
 import java.util.*;
 
 import sun.java2d.*;
 
 /**
- * This is an implementation of a GraphicsEnvironment object for the default local GraphicsEnvironment used by the Java
- * Runtime Environment for Mac OS X GUI environments.
+ * This is an implementation of a GraphicsEnvironment object for the default
+ * local GraphicsEnvironment used by the Java Runtime Environment for Mac OS X
+ * GUI environments.
  *
  * @see GraphicsDevice
  * @see GraphicsConfiguration
  */
-public class CGraphicsEnvironment extends SunGraphicsEnvironment {
+public final class CGraphicsEnvironment extends SunGraphicsEnvironment {
+
     // Global initialization of the Cocoa runtime.
     private static native void initCocoa();
 
@@ -53,7 +54,8 @@
     private static native int getMainDisplayID();
 
     /**
-     * Noop function that just acts as an entry point for someone to force a static initialization of this class.
+     * Noop function that just acts as an entry point for someone to force a
+     * static initialization of this class.
      */
     public static void init() { }
 
@@ -72,8 +74,9 @@
     }
 
     /**
-     * Register the instance with CGDisplayRegisterReconfigurationCallback()
-     * The registration uses a weak global reference -- if our instance is garbage collected, the reference will be dropped.
+     * Register the instance with CGDisplayRegisterReconfigurationCallback().
+     * The registration uses a weak global reference -- if our instance is
+     * garbage collected, the reference will be dropped.
      *
      * @return Return the registration context (a pointer).
      */
@@ -85,7 +88,7 @@
     private native void deregisterDisplayReconfiguration(long context);
 
     /** Available CoreGraphics displays. */
-    private final Map<Integer, CGraphicsDevice> devices = new HashMap<Integer, CGraphicsDevice>();
+    private final Map<Integer, CGraphicsDevice> devices = new HashMap<>(5);
 
     /** Reference to the display reconfiguration callback context. */
     private final long displayReconfigContext;
@@ -112,11 +115,18 @@
     /**
      * Called by the CoreGraphics Display Reconfiguration Callback.
      *
-     * @param displayId
-     *            CoreGraphics displayId
+     * @param displayId CoreGraphics displayId
+     * @param removed   true if displayId was removed, false otherwise.
      */
-    void _displayReconfiguration(long displayId) {
-        displayChanged();
+    void _displayReconfiguration(final int displayId, final boolean removed) {
+        synchronized (this) {
+            if (removed && devices.containsKey(displayId)) {
+                final CGraphicsDevice gd = devices.remove(displayId);
+                gd.invalidate(getMainDisplayID());
+                gd.displayChanged();
+            }
+        }
+        initDevices();
     }
 
     @Override
@@ -129,31 +139,30 @@
     }
 
     /**
-     * (Re)create all CGraphicsDevices
-     *
-     * @return
+     * (Re)create all CGraphicsDevices, reuses a devices if it is possible.
      */
-    private synchronized void initDevices() {
-        devices.clear();
+    private void initDevices() {
+        synchronized (this) {
+            final Map<Integer, CGraphicsDevice> old = new HashMap<>(devices);
+            devices.clear();
 
-        int mainID = getMainDisplayID();
+            int mainID = getMainDisplayID();
 
-        // initialization of the graphics device may change
-        // list of displays on hybrid systems via an activation
-        // of discrete video.
-        // So, we initialize the main display first, and then
-        // retrieve actual list of displays.
-        CGraphicsDevice mainDevice = new CGraphicsDevice(mainID);
+            // initialization of the graphics device may change
+            // list of displays on hybrid systems via an activation
+            // of discrete video.
+            // So, we initialize the main display first, and then
+            // retrieve actual list of displays.
+            if (!old.containsKey(mainID)) {
+                old.put(mainID, new CGraphicsDevice(mainID));
+            }
 
-        final int[] displayIDs = getDisplayIDs();
-
-        for (int displayID : displayIDs) {
-            if (displayID != mainID) {
-                devices.put(displayID, new CGraphicsDevice(displayID));
-            } else {
-                devices.put(mainID, mainDevice);
+            for (final int id : getDisplayIDs()) {
+                devices.put(id, old.containsKey(id) ? old.get(id)
+                                                    : new CGraphicsDevice(id));
             }
         }
+        displayChanged();
     }
 
     @Override
@@ -161,7 +170,7 @@
         final int mainDisplayID = getMainDisplayID();
         CGraphicsDevice d = devices.get(mainDisplayID);
         if (d == null) {
-            // we do not exepct that this may happen, the only responce
+            // we do not expect that this may happen, the only response
             // is to re-initialize the list of devices
             initDevices();
 
--- a/src/macosx/classes/sun/font/CCharToGlyphMapper.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/classes/sun/font/CCharToGlyphMapper.java	Fri Jun 21 19:11:42 2013 -0700
@@ -130,6 +130,15 @@
     }
 
     public synchronized int charToGlyph(int unicode) {
+        if (unicode >= 0x10000) {
+           int[] glyphs = new int[2];
+           char[] surrogates = new char[2];
+           int base = unicode - 0x10000;
+           surrogates[0] = (char)((base >>> 10) + HI_SURROGATE_START);
+           surrogates[1] = (char)((base % 0x400) + LO_SURROGATE_START);
+           charsToGlyphs(2, surrogates, glyphs);
+           return glyphs[0];
+        } else
         return charToGlyph((char)unicode);
     }
 
@@ -138,9 +147,9 @@
     }
 
     public synchronized void charsToGlyphs(int count, int[] unicodes, int[] glyphs) {
-        final char[] unicodeChars = new char[count];
-        for (int i = 0; i < count; i++) unicodeChars[i] = (char)unicodes[i];
-        cache.get(count, unicodeChars, glyphs);
+        for (int i = 0; i < count; i++) {
+            glyphs[i] = charToGlyph(unicodes[i]);
+        };
     }
 
     // This mapper returns either the glyph code, or if the character can be
@@ -166,7 +175,7 @@
             firstLayerCache[1] = 1;
         }
 
-        public int get(final char index) {
+        public synchronized int get(final int index) {
             if (index < FIRST_LAYER_SIZE) {
                 // catch common glyphcodes
                 return firstLayerCache[index];
@@ -179,12 +188,12 @@
             }
 
             if (generalCache == null) return 0;
-            final Integer value = generalCache.get(new Integer(index));
+            final Integer value = generalCache.get(index);
             if (value == null) return 0;
             return value.intValue();
         }
 
-        public void put(final char index, final int value) {
+        public synchronized void put(final int index, final int value) {
             if (index < FIRST_LAYER_SIZE) {
                 // catch common glyphcodes
                 firstLayerCache[index] = value;
@@ -204,7 +213,7 @@
                 generalCache = new HashMap<Integer, Integer>();
             }
 
-            generalCache.put(new Integer(index), new Integer(value));
+            generalCache.put(index, value);
         }
 
         private class SparseBitShiftingTwoLayerArray {
@@ -220,14 +229,14 @@
                 this.secondLayerLength = size >> shift;
             }
 
-            public int get(final char index) {
+            public int get(final int index) {
                 final int firstIndex = index >> shift;
                 final int[] firstLayerRow = cache[firstIndex];
                 if (firstLayerRow == null) return 0;
                 return firstLayerRow[index - (firstIndex * (1 << shift))];
             }
 
-            public void put(final char index, final int value) {
+            public void put(final int index, final int value) {
                 final int firstIndex = index >> shift;
                 int[] firstLayerRow = cache[firstIndex];
                 if (firstLayerRow == null) {
@@ -237,77 +246,81 @@
             }
         }
 
-        public void get(int count, char[] indicies, int[] values){
+        public synchronized void get(int count, char[] indicies, int[] values)
+        {
+            // "missed" is the count of 'char' that are not mapped.
+            // Surrogates count for 2.
+            // unmappedChars is the unique list of these chars.
+            // unmappedCharIndices is the location in the original array
             int missed = 0;
-            for(int i = 0; i < count; i++){
-                char code = indicies[i];
+            char[] unmappedChars = null;
+            int [] unmappedCharIndices = null;
+
+            for (int i = 0; i < count; i++){
+                int code = indicies[i];
+                if (code >= HI_SURROGATE_START &&
+                    code <= HI_SURROGATE_END && i < count - 1)
+                {
+                    char low = indicies[i + 1];
+                    if (low >= LO_SURROGATE_START && low <= LO_SURROGATE_END) {
+                        code = (code - HI_SURROGATE_START) * 0x400 +
+                            low - LO_SURROGATE_START + 0x10000;
+                    }
+                }
 
                 final int value = get(code);
-                if(value != 0){
+                if (value != 0 && value != -1) {
                     values[i] = value;
-                }else{
-                    // zero this element out, because the caller does not
-                    // promise to keep it clean
+                    if (code >= 0x10000) {
+                        values[i+1] = INVISIBLE_GLYPH_ID;
+                        i++;
+                    }
+                } else {
                     values[i] = 0;
+                    put(code, -1);
+                    if (unmappedChars == null) {
+                        // This is likely to be longer than we need,
+                        // but is the simplest and cheapest option.
+                        unmappedChars = new char[indicies.length];
+                        unmappedCharIndices = new int[indicies.length];
+                    }
+                    unmappedChars[missed] = indicies[i];
+                    unmappedCharIndices[missed] = i;
+                    if (code >= 0x10000) { // was a surrogate pair
+                        unmappedChars[++missed] = indicies[++i];
+                    }
                     missed++;
                 }
             }
 
-            if (missed == 0) return; // horray! everything is already cached!
-
-            final char[] filteredCodes = new char[missed]; // all index codes requested (partially filled)
-            final int[] filteredIndicies = new int[missed]; // local indicies into filteredCodes array (totally filled)
-
-            // scan, mark, and store the index codes again to send into native
-            int j = 0;
-            int dupes = 0;
-            for (int i = 0; i < count; i++){
-                if (values[i] != 0L) continue; // already filled
-
-                final char code = indicies[i];
-
-                // we have already promised to fill this code - this is a dupe
-                if (get(code) == -1){
-                    filteredIndicies[j] = -1;
-                    dupes++;
-                    j++;
-                    continue;
-                }
-
-                // this is a code we have not obtained before
-                // mark this one as "promise to get" in the global cache with a -1
-                final int k = j - dupes;
-                filteredCodes[k] = code;
-                put(code, -1);
-                filteredIndicies[j] = k;
-                j++;
+            if (missed == 0) {
+                return;
             }
 
-            final int filteredRunLen = j - dupes;
-            final int[] filteredValues = new int[filteredRunLen];
-
-            // bulk call to fill in the distinct values
-            nativeCharsToGlyphs(fFont.getNativeFontPtr(), filteredRunLen, filteredCodes, filteredValues);
+            final int[] glyphCodes = new int[missed];
 
-            // scan the requested list, and fill in values from our
-            // distinct code list which has been filled from "getDistinct"
-            j = 0;
-            for (int i = 0; i < count; i++){
-                if (values[i] != 0L && values[i] != -1L) continue; // already placed
+            // bulk call to fill in the unmapped code points.
+            nativeCharsToGlyphs(fFont.getNativeFontPtr(),
+                                missed, unmappedChars, glyphCodes);
 
-                final int k = filteredIndicies[j]; // index into filteredImages array
-                final char code = indicies[i];
-                if(k == -1L){
-                    // we should have already filled the cache with this value
-                    values[i] = get(code);
-                }else{
-                    // fill the particular code request, and store in the cache
-                    final int ptr = filteredValues[k];
-                    values[i] = ptr;
-                    put(code, ptr);
+            for (int m = 0; m < missed; m++){
+                int i = unmappedCharIndices[m];
+                int code = unmappedChars[m];
+                if (code >= HI_SURROGATE_START &&
+                    code <= HI_SURROGATE_END && m < missed - 1)
+                {
+                    char low = indicies[m + 1];
+                    if (low >= LO_SURROGATE_START && low <= LO_SURROGATE_END) {
+                        code = (code - HI_SURROGATE_START) * 0x400 +
+                            low - LO_SURROGATE_START + 0x10000;
+                    }
                 }
-
-                j++;
+               values[i] = glyphCodes[m];
+               put(code, values[i]);
+               if (code >= 0x10000) {
+                   m++;
+                   values[i + 1] = INVISIBLE_GLYPH_ID;
+                }
             }
         }
     }
--- a/src/macosx/classes/sun/font/CFontManager.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/classes/sun/font/CFontManager.java	Fri Jun 21 19:11:42 2013 -0700
@@ -37,6 +37,7 @@
 import javax.swing.plaf.FontUIResource;
 
 import sun.awt.FontConfiguration;
+import sun.awt.HeadlessToolkit;
 import sun.lwawt.macosx.*;
 
 public class CFontManager extends SunFontManager {
@@ -342,9 +343,14 @@
     @Override
     public String getFontPath(boolean noType1Fonts) {
         // In the case of the Cocoa toolkit, since we go through NSFont, we dont need to register /Library/Fonts
-        if (Toolkit.getDefaultToolkit() instanceof LWCToolkit) {
+        Toolkit tk = Toolkit.getDefaultToolkit();
+        if (tk instanceof HeadlessToolkit) {
+            tk = ((HeadlessToolkit)tk).getUnderlyingToolkit();
+        }
+        if (tk instanceof LWCToolkit) {
             return "";
         }
+
         // X11 case
         return "/Library/Fonts";
     }
--- a/src/macosx/classes/sun/java2d/opengl/CGLGraphicsConfig.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/classes/sun/java2d/opengl/CGLGraphicsConfig.java	Fri Jun 21 19:11:42 2013 -0700
@@ -85,10 +85,8 @@
     private Object disposerReferent = new Object();
 
     private final int cachedMaxTextureSize;
-
-    public static native int getDefaultPixFmt(int screennum);
     private static native boolean initCGL();
-    private static native long getCGLConfigInfo(int screennum, int visualnum,
+    private static native long getCGLConfigInfo(int displayID, int visualnum,
                                                 int swapInterval);
     private static native int getOGLCapabilities(long configInfo);
     private static native int _getMaxTextureSize();
@@ -147,15 +145,16 @@
             // Java-level context and flush the queue...
             OGLContext.invalidateCurrentContext();
 
-            cfginfo = getCGLConfigInfo(device.getCoreGraphicsScreen(), pixfmt,
+            cfginfo = getCGLConfigInfo(device.getCGDisplayID(), pixfmt,
                                        kOpenGLSwapInterval);
-
-            OGLContext.setScratchSurface(cfginfo);
-            rq.flushAndInvokeNow(new Runnable() {
-                public void run() {
-                    ids[0] = OGLContext.getOGLIdString();
-                }
-            });
+            if (cfginfo != 0L) {
+                OGLContext.setScratchSurface(cfginfo);
+                rq.flushAndInvokeNow(new Runnable() {
+                    public void run() {
+                        ids[0] = OGLContext.getOGLIdString();
+                    }
+                });
+            }
         } finally {
             rq.unlock();
         }
@@ -260,8 +259,8 @@
 
     @Override
     public String toString() {
-        int screen = getDevice().getCoreGraphicsScreen();
-        return ("CGLGraphicsConfig[dev="+screen+",pixfmt="+pixfmt+"]");
+        int displayID = getDevice().getCGDisplayID();
+        return ("CGLGraphicsConfig[dev="+displayID+",pixfmt="+pixfmt+"]");
     }
 
 
@@ -485,8 +484,8 @@
     }
 
     public void addDeviceEventListener(AccelDeviceEventListener l) {
-        int screen = getDevice().getCoreGraphicsScreen();
-        AccelDeviceEventNotifier.addListener(l, screen);
+        int displayID = getDevice().getCGDisplayID();
+        AccelDeviceEventNotifier.addListener(l, displayID);
     }
 
     public void removeDeviceEventListener(AccelDeviceEventListener l) {
@@ -516,29 +515,37 @@
 
     @Override
     public int getMaxTextureWidth() {
-        int width;
+        //Temporary disable this logic and use some magic constrain.
+        /*
+         int width;
 
-        synchronized (totalDisplayBounds) {
-            if (totalDisplayBounds.width == 0) {
-                updateTotalDisplayBounds();
-            }
-            width = totalDisplayBounds.width;
-        }
+         synchronized (totalDisplayBounds) {
+         if (totalDisplayBounds.width == 0) {
+         updateTotalDisplayBounds();
+         }
+         width = totalDisplayBounds.width;
+         }
 
-        return Math.min(width, getMaxTextureSize());
+         return Math.min(width, getMaxTextureSize());
+         */
+        return getMaxTextureSize() / (getDevice().getScaleFactor() * 2);
     }
 
     @Override
     public int getMaxTextureHeight() {
-        int height;
+        //Temporary disable this logic and use some magic constrain.
+        /*
+         int height;
 
-        synchronized (totalDisplayBounds) {
-            if (totalDisplayBounds.height == 0) {
-                updateTotalDisplayBounds();
-            }
-            height = totalDisplayBounds.height;
-        }
+         synchronized (totalDisplayBounds) {
+         if (totalDisplayBounds.height == 0) {
+         updateTotalDisplayBounds();
+         }
+         height = totalDisplayBounds.height;
+         }
 
-        return Math.min(height, getMaxTextureSize());
+         return Math.min(height, getMaxTextureSize());
+         */
+        return getMaxTextureSize() / (getDevice().getScaleFactor() * 2);
     }
 }
--- a/src/macosx/classes/sun/java2d/opengl/CGLLayer.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/classes/sun/java2d/opengl/CGLLayer.java	Fri Jun 21 19:11:42 2013 -0700
@@ -40,11 +40,12 @@
 public class CGLLayer extends CFRetainedResource {
 
     private native long nativeCreateLayer();
-
+    private static native void nativeSetScale(long layerPtr, double scale);
     private static native void validate(long layerPtr, CGLSurfaceData cglsd);
     private static native void blitTexture(long layerPtr);
 
     private LWWindowPeer peer;
+    private int scale = 1;
 
     private SurfaceData surfaceData; // represents intermediate buffer (texture)
 
@@ -68,7 +69,7 @@
     }
 
     public boolean isOpaque() {
-        return peer.isOpaque();
+        return !peer.isTranslucent();
     }
 
     public int getTransparency() {
@@ -89,7 +90,7 @@
         // and blits the buffer to the layer surface (in drawInCGLContext callback)
         CGraphicsConfig gc = (CGraphicsConfig)getGraphicsConfiguration();
         surfaceData = gc.createSurfaceData(this);
-
+        setScale(gc.getDevice().getScaleFactor());
         // the layer holds a reference to the buffer, which in
         // turn has a reference back to this layer
         if (surfaceData instanceof CGLSurfaceData) {
@@ -120,6 +121,13 @@
         super.dispose();
     }
 
+    private void setScale(final int _scale) {
+        if (scale != _scale) {
+            scale = _scale;
+            nativeSetScale(getPointer(), scale);
+        }
+    }
+
     // ----------------------------------------------------------------------
     // NATIVE CALLBACKS
     // ----------------------------------------------------------------------
--- a/src/macosx/classes/sun/java2d/opengl/CGLSurfaceData.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/classes/sun/java2d/opengl/CGLSurfaceData.java	Fri Jun 21 19:11:42 2013 -0700
@@ -30,7 +30,6 @@
 import java.awt.GraphicsDevice;
 import java.awt.GraphicsEnvironment;
 import java.awt.Image;
-import java.awt.Insets;
 import java.awt.Rectangle;
 import java.awt.image.ColorModel;
 
@@ -41,6 +40,9 @@
 
 public abstract class CGLSurfaceData extends OGLSurfaceData {
 
+    protected final int scale;
+    protected final int width;
+    protected final int height;
     protected CPlatformView pView;
     private CGLGraphicsConfig graphicsConfig;
 
@@ -52,10 +54,19 @@
     protected native boolean initPbuffer(long pData, long pConfigInfo,
             boolean isOpaque, int width, int height);
 
+    protected CGLSurfaceData(CGLGraphicsConfig gc, ColorModel cm, int type,
+                             int width, int height) {
+        super(gc, cm, type);
+        // TEXTURE shouldn't be scaled, it is used for managed BufferedImages.
+        scale = type == TEXTURE ? 1 : gc.getDevice().getScaleFactor();
+        this.width = width * scale;
+        this.height = height * scale;
+    }
+
     protected CGLSurfaceData(CPlatformView pView, CGLGraphicsConfig gc,
-                             ColorModel cm, int type)
+                             ColorModel cm, int type,int width, int height)
     {
-        super(gc, cm, type);
+        this(gc, cm, type, width, height);
         this.pView = pView;
         this.graphicsConfig = gc;
 
@@ -70,9 +81,9 @@
     }
 
     protected CGLSurfaceData(CGLLayer layer, CGLGraphicsConfig gc,
-                             ColorModel cm, int type)
+                             ColorModel cm, int type,int width, int height)
     {
-        super(gc, cm, type);
+        this(gc, cm, type, width, height);
         this.graphicsConfig = gc;
 
         long pConfigInfo = gc.getNativeConfigInfo();
@@ -157,13 +168,43 @@
         // Overridden in CGLWindowSurfaceData below
     }
 
+    @Override
+    public int getDefaultScale() {
+        return scale;
+    }
+
+    @Override
+    public boolean copyArea(SunGraphics2D sg2d, int x, int y, int w, int h,
+                            int dx, int dy) {
+        final int state = sg2d.transformState;
+        if (state > SunGraphics2D.TRANSFORM_TRANSLATESCALE
+            || sg2d.compositeState >= SunGraphics2D.COMP_XOR) {
+            return false;
+        }
+        if (state <= SunGraphics2D.TRANSFORM_ANY_TRANSLATE) {
+            x += sg2d.transX;
+            y += sg2d.transY;
+        } else if (state == SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
+            final double[] coords = {x, y, x + w, y + h, x + dx, y + dy};
+            sg2d.transform.transform(coords, 0, coords, 0, 3);
+            x = (int) Math.ceil(coords[0] - 0.5);
+            y = (int) Math.ceil(coords[1] - 0.5);
+            w = ((int) Math.ceil(coords[2] - 0.5)) - x;
+            h = ((int) Math.ceil(coords[3] - 0.5)) - y;
+            dx = ((int) Math.ceil(coords[4] - 0.5)) - x;
+            dy = ((int) Math.ceil(coords[5] - 0.5)) - y;
+        }
+        oglRenderPipe.copyArea(sg2d, x, y, w, h, dx, dy);
+        return true;
+    }
+
     protected native void clearWindow();
 
     public static class CGLWindowSurfaceData extends CGLSurfaceData {
 
         public CGLWindowSurfaceData(CPlatformView pView,
                 CGLGraphicsConfig gc) {
-            super(pView, gc, gc.getColorModel(), WINDOW);
+            super(pView, gc, gc.getColorModel(), WINDOW, 0, 0);
         }
 
         @Override
@@ -217,17 +258,12 @@
     public static class CGLLayerSurfaceData extends CGLSurfaceData {
 
         private CGLLayer layer;
-        private int width, height;
 
         public CGLLayerSurfaceData(CGLLayer layer, CGLGraphicsConfig gc,
                                    int width, int height) {
-            super(layer, gc, gc.getColorModel(), FBOBJECT);
-
-            this.width = width;
-            this.height = height;
+            super(layer, gc, gc.getColorModel(), FBOBJECT, width, height);
             this.layer = layer;
-
-            initSurface(width, height);
+            initSurface(this.width, this.height);
         }
 
         @Override
@@ -296,18 +332,13 @@
 
     public static class CGLOffScreenSurfaceData extends CGLSurfaceData {
         private Image offscreenImage;
-        private int width, height;
 
         public CGLOffScreenSurfaceData(CPlatformView pView,
                                        CGLGraphicsConfig gc, int width, int height, Image image,
                                        ColorModel cm, int type) {
-            super(pView, gc, cm, type);
-
-            this.width = width;
-            this.height = height;
+            super(pView, gc, cm, type, width, height);
             offscreenImage = image;
-
-            initSurface(width, height);
+            initSurface(this.width, this.height);
         }
 
         @Override
--- a/src/macosx/classes/sun/lwawt/LWComponentPeer.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/classes/sun/lwawt/LWComponentPeer.java	Fri Jun 21 19:11:42 2013 -0700
@@ -40,6 +40,7 @@
 import java.awt.peer.ComponentPeer;
 import java.awt.peer.ContainerPeer;
 
+import java.awt.peer.KeyboardFocusManagerPeer;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.lang.reflect.Field;
 import java.security.AccessController;
@@ -282,7 +283,7 @@
      * Note that we call setVisible() at the end of initialization.
      */
     public final void initialize() {
-        platformComponent.initialize(target, this, getPlatformWindow());
+        platformComponent.initialize(getPlatformWindow());
         initializeImpl();
         setVisible(target.isVisible());
     }
@@ -424,8 +425,7 @@
 
     @Override
     public final Graphics getGraphics() {
-        Graphics g = getWindowPeerOrSelf().isOpaque() ? getOnscreenGraphics()
-                                                      : getOffscreenGraphics();
+        final Graphics g = getOnscreenGraphics();
         if (g != null) {
             synchronized (getPeerTreeLock()){
                 applyConstrain(g);
@@ -443,46 +443,13 @@
         final LWWindowPeer wp = getWindowPeerOrSelf();
         return wp.getOnscreenGraphics(getForeground(), getBackground(),
                                       getFont());
-    }
 
-    public final Graphics getOffscreenGraphics() {
-        final LWWindowPeer wp = getWindowPeerOrSelf();
-
-        return wp.getOffscreenGraphics(getForeground(), getBackground(),
-                                       getFont());
     }
 
     private void applyConstrain(final Graphics g) {
         final SunGraphics2D sg2d = (SunGraphics2D) g;
-        final Rectangle constr = localToWindow(getSize());
-        // translate and set rectangle constrain.
-        sg2d.constrain(constr.x, constr.y, constr.width, constr.height);
-        // set region constrain.
-        //sg2d.constrain(getVisibleRegion());
-        SG2DConstraint(sg2d, getVisibleRegion());
-    }
-
-    //TODO Move this method to SG2D?
-    private void SG2DConstraint(final SunGraphics2D sg2d, Region r) {
-        sg2d.constrainX = sg2d.transX;
-        sg2d.constrainY = sg2d.transY;
-
-        Region c = sg2d.constrainClip;
-        if ((sg2d.constrainX | sg2d.constrainY) != 0) {
-            r = r.getTranslatedRegion(sg2d.constrainX, sg2d.constrainY);
-        }
-        if (c == null) {
-            c = r;
-        } else {
-            c = c.getIntersection(r);
-            if (c == sg2d.constrainClip) {
-                // Common case to ignore
-                return;
-            }
-        }
-        sg2d.constrainClip = c;
-        //validateCompClip() forced call.
-        sg2d.setDevClip(r.getLoX(), r.getLoY(), r.getWidth(), r.getHeight());
+        final Rectangle size = localToWindow(getSize());
+        sg2d.constrain(size.x, size.y, size.width, size.height, getVisibleRegion());
     }
 
     public Region getVisibleRegion() {
@@ -710,7 +677,7 @@
         // Obtain the metrics from the offscreen window where this peer is
         // mostly drawn to.
         // TODO: check for "use platform metrics" settings
-        Graphics g = getWindowPeer().getOffscreenGraphics();
+        Graphics g = getWindowPeer().getGraphics();
         try {
             if (g != null) {
                 return g.getFontMetrics(f);
@@ -901,15 +868,15 @@
                             ", focusedWindowChangeAllowed=" + focusedWindowChangeAllowed +
                             ", time= " + time + ", cause=" + cause);
         }
-        if (LWKeyboardFocusManagerPeer.getInstance(getAppContext()).
-                processSynchronousLightweightTransfer(getTarget(), lightweightChild, temporary,
-                        focusedWindowChangeAllowed, time)) {
+        if (LWKeyboardFocusManagerPeer.processSynchronousLightweightTransfer(
+                getTarget(), lightweightChild, temporary,
+                focusedWindowChangeAllowed, time)) {
             return true;
         }
 
-        int result = LWKeyboardFocusManagerPeer.getInstance(getAppContext()).
-                shouldNativelyFocusHeavyweight(getTarget(), lightweightChild, temporary,
-                        focusedWindowChangeAllowed, time, cause);
+        int result = LWKeyboardFocusManagerPeer.shouldNativelyFocusHeavyweight(
+                getTarget(), lightweightChild, temporary,
+                focusedWindowChangeAllowed, time, cause);
         switch (result) {
             case LWKeyboardFocusManagerPeer.SNFH_FAILURE:
                 return false;
@@ -958,14 +925,13 @@
                     return false;
                 }
 
-                LWComponentPeer focusOwnerPeer =
-                    LWKeyboardFocusManagerPeer.getInstance(getAppContext()).
-                        getFocusOwner();
-                Component focusOwner = (focusOwnerPeer != null) ? focusOwnerPeer.getTarget() : null;
+                KeyboardFocusManagerPeer kfmPeer = LWKeyboardFocusManagerPeer.getInstance();
+                Component focusOwner = kfmPeer.getCurrentFocusOwner();
                 return LWKeyboardFocusManagerPeer.deliverFocus(lightweightChild,
                         getTarget(), temporary,
                         focusedWindowChangeAllowed,
                         time, cause, focusOwner);
+
             case LWKeyboardFocusManagerPeer.SNFH_SUCCESS_HANDLED:
                 return true;
         }
@@ -1011,14 +977,33 @@
     @Override
     public final void applyShape(final Region shape) {
         synchronized (getStateLock()) {
-            region = shape;
+            if (region == shape || (region != null && region.equals(shape))) {
+                return;
+            }
+        }
+        applyShapeImpl(shape);
+    }
+
+    void applyShapeImpl(final Region shape) {
+        synchronized (getStateLock()) {
+            if (shape != null) {
+                region = Region.WHOLE_REGION.getIntersection(shape);
+            } else {
+                region = null;
+            }
         }
         repaintParent(getBounds());
     }
 
     protected final Region getRegion() {
         synchronized (getStateLock()) {
-            return region == null ? Region.getInstance(getSize()) : region;
+            return isShaped() ? region : Region.getInstance(getSize());
+        }
+    }
+
+    public boolean isShaped() {
+        synchronized (getStateLock()) {
+            return region != null;
         }
     }
 
@@ -1172,10 +1157,10 @@
     }
 
     protected void sendEventToDelegate(final AWTEvent e) {
+        if (getDelegate() == null || !isShowing() || !isEnabled()) {
+            return;
+        }
         synchronized (getDelegateLock()) {
-            if (getDelegate() == null || !isShowing() || !isEnabled()) {
-                return;
-            }
             AWTEvent delegateEvent = createDelegateEvent(e);
             if (delegateEvent != null) {
                 AWTAccessor.getComponentAccessor()
@@ -1189,7 +1174,12 @@
         }
     }
 
-    protected AWTEvent createDelegateEvent(AWTEvent e) {
+    /**
+     * Changes the target of the AWTEvent from awt component to appropriate
+     * swing delegate.
+     */
+    private AWTEvent createDelegateEvent(final AWTEvent e) {
+        // TODO modifiers should be changed to getModifiers()|getModifiersEx()?
         AWTEvent delegateEvent = null;
         if (e instanceof MouseWheelEvent) {
             MouseWheelEvent me = (MouseWheelEvent) e;
@@ -1251,8 +1241,8 @@
     protected void handleJavaFocusEvent(FocusEvent e) {
         // Note that the peer receives all the FocusEvents from
         // its lightweight children as well
-        LWKeyboardFocusManagerPeer.getInstance(getAppContext()).
-                setFocusOwner(e.getID() == FocusEvent.FOCUS_GAINED ? this : null);
+        KeyboardFocusManagerPeer kfmPeer = LWKeyboardFocusManagerPeer.getInstance();
+        kfmPeer.setCurrentFocusOwner(e.getID() == FocusEvent.FOCUS_GAINED ? getTarget() : null);
     }
 
     /**
@@ -1386,11 +1376,6 @@
         }
     }
 
-    // Just a helper method, thus final
-    protected final void flushOffscreenGraphics() {
-        flushOffscreenGraphics(getSize());
-    }
-
     protected static final void flushOnscreenGraphics(){
         final OGLRenderQueue rq = OGLRenderQueue.getInstance();
         rq.lock();
@@ -1401,36 +1386,6 @@
         }
     }
 
-    /*
-     * Flushes the given rectangle from the back buffer to the screen.
-     */
-    protected void flushOffscreenGraphics(Rectangle r) {
-        flushOffscreenGraphics(r.x, r.y, r.width, r.height);
-    }
-
-    private void flushOffscreenGraphics(int x, int y, int width, int height) {
-        Image bb = getWindowPeerOrSelf().getBackBuffer();
-        if (bb != null) {
-            // g is a screen Graphics from the delegate
-            final Graphics g = getOnscreenGraphics();
-
-            if (g != null && g instanceof Graphics2D) {
-                try {
-                    Graphics2D g2d = (Graphics2D)g;
-                    Point p = localToWindow(new Point(0, 0));
-                    Composite composite = g2d.getComposite();
-                    g2d.setComposite(AlphaComposite.Src);
-                    g.drawImage(bb, x, y, x + width, y + height, p.x + x,
-                            p.y + y, p.x + x + width, p.y + y + height,
-                            null);
-                    g2d.setComposite(composite);
-                } finally {
-                    g.dispose();
-                }
-            }
-        }
-    }
-
     /**
      * Used by ContainerPeer to skip all the paint events during layout.
      *
--- a/src/macosx/classes/sun/lwawt/LWKeyboardFocusManagerPeer.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/classes/sun/lwawt/LWKeyboardFocusManagerPeer.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
@@ -26,76 +26,35 @@
 package sun.lwawt;
 
 import java.awt.Component;
-import java.awt.KeyboardFocusManager;
 import java.awt.Window;
-
-import java.util.Map;
-import java.util.HashMap;
-
-import sun.awt.AWTAccessor;
-import sun.awt.AppContext;
 import sun.awt.KeyboardFocusManagerPeerImpl;
 
 public class LWKeyboardFocusManagerPeer extends KeyboardFocusManagerPeerImpl {
-
-    private Object lock = new Object();
-    private LWWindowPeer focusedWindow;
-    private LWComponentPeer focusOwner;
+    private static final LWKeyboardFocusManagerPeer inst = new LWKeyboardFocusManagerPeer();
 
-    private static Map<KeyboardFocusManager, LWKeyboardFocusManagerPeer> instances =
-        new HashMap<KeyboardFocusManager, LWKeyboardFocusManagerPeer>();
+    private Window focusedWindow;
+    private Component focusOwner;
 
-    public static synchronized LWKeyboardFocusManagerPeer getInstance(AppContext ctx) {
-        return getInstance(AWTAccessor.getKeyboardFocusManagerAccessor().
-                           getCurrentKeyboardFocusManager(ctx));
+    public static LWKeyboardFocusManagerPeer getInstance() {
+        return inst;
     }
 
-    public static synchronized LWKeyboardFocusManagerPeer getInstance(KeyboardFocusManager manager) {
-        LWKeyboardFocusManagerPeer instance = instances.get(manager);
-        if (instance == null) {
-            instance = new LWKeyboardFocusManagerPeer(manager);
-            instances.put(manager, instance);
-        }
-        return instance;
-    }
-
-    public LWKeyboardFocusManagerPeer(KeyboardFocusManager manager) {
-        super(manager);
+    private LWKeyboardFocusManagerPeer() {
     }
 
     @Override
-    public Window getCurrentFocusedWindow() {
-        synchronized (lock) {
-            return (focusedWindow != null) ? (Window)focusedWindow.getTarget() : null;
-        }
-    }
-
-    @Override
-    public Component getCurrentFocusOwner() {
-        synchronized (lock) {
-            return (focusOwner != null) ? focusOwner.getTarget() : null;
-        }
-    }
-
-    @Override
-    public void setCurrentFocusOwner(Component comp) {
-        synchronized (lock) {
-            focusOwner = (comp != null) ? (LWComponentPeer)comp.getPeer() : null;
-        }
-    }
-
-    void setFocusedWindow(LWWindowPeer peer) {
+    public void setCurrentFocusedWindow(Window win) {
         LWWindowPeer from, to;
 
-        synchronized (lock) {
-            if (focusedWindow == peer) {
+        synchronized (this) {
+            if (focusedWindow == win) {
                 return;
             }
 
-            from = focusedWindow;
-            to = peer;
+            from = (LWWindowPeer)LWToolkit.targetToPeer(focusedWindow);
+            to = (LWWindowPeer)LWToolkit.targetToPeer(win);
 
-            focusedWindow = peer;
+            focusedWindow = win;
         }
 
         if (from != null) {
@@ -107,21 +66,24 @@
         }
     }
 
-    LWWindowPeer getFocusedWindow() {
-        synchronized (lock) {
+    @Override
+    public Window getCurrentFocusedWindow() {
+        synchronized (this) {
             return focusedWindow;
         }
     }
 
-    void setFocusOwner(LWComponentPeer peer) {
-        synchronized (lock) {
-            focusOwner = peer;
+    @Override
+    public Component getCurrentFocusOwner() {
+        synchronized (this) {
+            return focusOwner;
         }
     }
 
-    LWComponentPeer getFocusOwner() {
-        synchronized (lock) {
-            return focusOwner;
+    @Override
+    public void setCurrentFocusOwner(Component comp) {
+        synchronized (this) {
+            focusOwner = comp;
         }
     }
 }
--- a/src/macosx/classes/sun/lwawt/LWRepaintArea.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/classes/sun/lwawt/LWRepaintArea.java	Fri Jun 21 19:11:42 2013 -0700
@@ -58,9 +58,6 @@
 
     private static void flushBuffers(final LWComponentPeer peer) {
         if (peer != null) {
-            if (!peer.getWindowPeerOrSelf().isOpaque()) {
-                peer.flushOffscreenGraphics();
-            }
             peer.flushOnscreenGraphics();
         }
     }
--- a/src/macosx/classes/sun/lwawt/LWTextAreaPeer.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/classes/sun/lwawt/LWTextAreaPeer.java	Fri Jun 21 19:11:42 2013 -0700
@@ -129,16 +129,6 @@
     }
 
     @Override
-    public void setText(final String l) {
-        // Please note that we do not want to post an event
-        // if TextArea.setText() replaces an empty text by an empty text,
-        // that is, if component's text remains unchanged.
-        if (!l.isEmpty() || getTextComponent().getDocument().getLength() != 0) {
-            super.setText(l);
-        }
-    }
-
-    @Override
     public void replaceRange(final String text, final int start,
                              final int end) {
         synchronized (getDelegateLock()) {
--- a/src/macosx/classes/sun/lwawt/LWTextComponentPeer.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/classes/sun/lwawt/LWTextComponentPeer.java	Fri Jun 21 19:11:42 2013 -0700
@@ -124,7 +124,7 @@
     }
 
     @Override
-    public void setText(final String l) {
+    public final void setText(final String l) {
         synchronized (getDelegateLock()) {
             // JTextArea.setText() posts two different events (remove & insert).
             // Since we make no differences between text events,
--- a/src/macosx/classes/sun/lwawt/LWToolkit.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/classes/sun/lwawt/LWToolkit.java	Fri Jun 21 19:11:42 2013 -0700
@@ -210,9 +210,9 @@
      * and DialogPeer interfaces.
      */
     private LWWindowPeer createDelegatedPeer(Window target, PlatformComponent platformComponent,
-                                             PlatformWindow platformWindow)
+                                             PlatformWindow platformWindow, LWWindowPeer.PeerType peerType)
     {
-        LWWindowPeer peer = new LWWindowPeer(target, platformComponent, platformWindow);
+        LWWindowPeer peer = new LWWindowPeer(target, platformComponent, platformWindow, peerType);
         targetCreatedPeer(target, peer);
         peer.initialize();
         return peer;
@@ -222,22 +222,29 @@
     public WindowPeer createWindow(Window target) {
         PlatformComponent platformComponent = createPlatformComponent();
         PlatformWindow platformWindow = createPlatformWindow(LWWindowPeer.PeerType.SIMPLEWINDOW);
-        return createDelegatedPeer(target, platformComponent, platformWindow);
+        return createDelegatedPeer(target, platformComponent, platformWindow, LWWindowPeer.PeerType.SIMPLEWINDOW);
     }
 
     @Override
     public FramePeer createFrame(Frame target) {
         PlatformComponent platformComponent = createPlatformComponent();
         PlatformWindow platformWindow = createPlatformWindow(LWWindowPeer.PeerType.FRAME);
-        return createDelegatedPeer(target, platformComponent, platformWindow);
+        return createDelegatedPeer(target, platformComponent, platformWindow, LWWindowPeer.PeerType.FRAME);
     }
 
     public LWWindowPeer createEmbeddedFrame(CEmbeddedFrame target) {
         PlatformComponent platformComponent = createPlatformComponent();
-        PlatformWindow platformWindow = createPlatformWindow(LWWindowPeer.PeerType.EMBEDDEDFRAME);
-        return createDelegatedPeer(target, platformComponent, platformWindow);
+        PlatformWindow platformWindow = createPlatformWindow(LWWindowPeer.PeerType.EMBEDDED_FRAME);
+        return createDelegatedPeer(target, platformComponent, platformWindow, LWWindowPeer.PeerType.EMBEDDED_FRAME);
     }
 
+    public LWWindowPeer createEmbeddedFrame(CViewEmbeddedFrame target) {
+        PlatformComponent platformComponent = createPlatformComponent();
+        PlatformWindow platformWindow = createPlatformWindow(LWWindowPeer.PeerType.VIEW_EMBEDDED_FRAME);
+        return createDelegatedPeer(target, platformComponent, platformWindow, LWWindowPeer.PeerType.VIEW_EMBEDDED_FRAME);
+    }
+
+
     CPrinterDialogPeer createCPrinterDialog(CPrinterDialog target) {
         PlatformComponent platformComponent = createPlatformComponent();
         PlatformWindow platformWindow = createPlatformWindow(LWWindowPeer.PeerType.DIALOG);
@@ -254,7 +261,7 @@
 
         PlatformComponent platformComponent = createPlatformComponent();
         PlatformWindow platformWindow = createPlatformWindow(LWWindowPeer.PeerType.DIALOG);
-        return createDelegatedPeer(target, platformComponent, platformWindow);
+        return createDelegatedPeer(target, platformComponent, platformWindow, LWWindowPeer.PeerType.DIALOG);
     }
 
     @Override
@@ -415,8 +422,8 @@
     }
 
     @Override
-    public KeyboardFocusManagerPeer createKeyboardFocusManagerPeer(KeyboardFocusManager manager) {
-        return LWKeyboardFocusManagerPeer.getInstance(manager);
+    public KeyboardFocusManagerPeer getKeyboardFocusManagerPeer() {
+        return LWKeyboardFocusManagerPeer.getInstance();
     }
 
     @Override
@@ -524,12 +531,6 @@
         postEvent(targetToAppContext(event.getSource()), event);
     }
 
-    // use peer's back buffer to implement non-opaque windows.
-    @Override
-    public boolean needUpdateWindow() {
-        return true;
-    }
-
     @Override
     public void grab(Window w) {
         if (w.getPeer() != null) {
--- a/src/macosx/classes/sun/lwawt/LWWindowPeer.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/classes/sun/lwawt/LWWindowPeer.java	Fri Jun 21 19:11:42 2013 -0700
@@ -37,22 +37,24 @@
 import sun.java2d.*;
 import sun.java2d.loops.Blit;
 import sun.java2d.loops.CompositeType;
+import sun.java2d.pipe.Region;
 import sun.util.logging.PlatformLogger;
 
 public class LWWindowPeer
     extends LWContainerPeer<Window, JComponent>
-    implements WindowPeer, FramePeer, DialogPeer, FullScreenCapable, PlatformEventNotifier
+    implements FramePeer, DialogPeer, FullScreenCapable, DisplayChangedListener, PlatformEventNotifier
 {
     public static enum PeerType {
         SIMPLEWINDOW,
         FRAME,
         DIALOG,
-        EMBEDDEDFRAME
+        EMBEDDED_FRAME,
+        VIEW_EMBEDDED_FRAME
     }
 
     private static final PlatformLogger focusLog = PlatformLogger.getLogger("sun.lwawt.focus.LWWindowPeer");
 
-    private PlatformWindow platformWindow;
+    private final PlatformWindow platformWindow;
 
     // Window bounds reported by the native system (as opposed to
     // regular bounds inherited from LWComponentPeer which are
@@ -109,6 +111,12 @@
 
     private volatile boolean skipNextFocusChange;
 
+    private static final Color nonOpaqueBackground = new Color(0, 0, 0, 0);
+
+    private volatile boolean textured;
+
+    private final PeerType peerType;
+
     private final SecurityWarningWindow warningWindow;
 
     /**
@@ -119,10 +127,11 @@
     private LWWindowPeer blocker;
 
     public LWWindowPeer(Window target, PlatformComponent platformComponent,
-                        PlatformWindow platformWindow)
+                        PlatformWindow platformWindow, PeerType peerType)
     {
         super(target, platformComponent);
         this.platformWindow = platformWindow;
+        this.peerType = peerType;
 
         Window owner = target.getOwner();
         LWWindowPeer ownerPeer = (owner != null) ? (LWWindowPeer)owner.getPeer() : null;
@@ -184,6 +193,11 @@
         updateAlwaysOnTopState();
         updateMinimumSize();
 
+        final Shape shape = getTarget().getShape();
+        if (shape != null) {
+            applyShape(Region.getInstance(shape, null));
+        }
+
         final float opacity = getTarget().getOpacity();
         if (opacity < 1.0f) {
             setOpacity(opacity);
@@ -193,8 +207,9 @@
 
         updateInsets(platformWindow.getInsets());
         if (getSurfaceData() == null) {
-            replaceSurfaceData();
+            replaceSurfaceData(false);
         }
+        activateDisplayListener();
     }
 
     // Just a helper method
@@ -216,6 +231,7 @@
 
     @Override
     protected void disposeImpl() {
+        deactivateDisplayListener();
         SurfaceData oldData = getSurfaceData();
         synchronized (surfaceDataLock){
             surfaceData = null;
@@ -229,7 +245,6 @@
         if (warningWindow != null) {
             warningWindow.dispose();
         }
-
         destroyBuffers();
         platformWindow.dispose();
         super.disposeImpl();
@@ -245,8 +260,7 @@
         // TODO: update graphicsConfig, see 4868278
         platformWindow.setVisible(visible);
         if (isSimpleWindow()) {
-            LWKeyboardFocusManagerPeer manager = LWKeyboardFocusManagerPeer.
-                getInstance(getAppContext());
+            KeyboardFocusManagerPeer kfmPeer = LWKeyboardFocusManagerPeer.getInstance();
 
             if (visible) {
                 if (!getTarget().isAutoRequestFocus()) {
@@ -254,7 +268,7 @@
                 } else {
                     requestWindowFocus(CausedFocusEvent.Cause.ACTIVATION);
                 }
-            } else if (manager.getCurrentFocusedWindow() == getTarget()) {
+            } else if (kfmPeer.getCurrentFocusedWindow() == getTarget()) {
                 // Transfer focus to the owner.
                 LWWindowPeer owner = getOwnerFrameDialog(LWWindowPeer.this);
                 if (owner != null) {
@@ -302,7 +316,7 @@
             // "buffer", that's why numBuffers - 1
             assert numBuffers > 1;
 
-            replaceSurfaceData(numBuffers - 1, caps);
+            replaceSurfaceData(numBuffers - 1, caps, false);
         } catch (InvalidPipeException z) {
             throw new AWTException(z.toString());
         }
@@ -353,6 +367,11 @@
 
     @Override
     public void setBounds(int x, int y, int w, int h, int op) {
+
+        if((op & NO_EMBEDDED_CHECK) == 0 && getPeerType() == PeerType.VIEW_EMBEDDED_FRAME) {
+            return;
+        }
+
         if ((op & SET_CLIENT_SIZE) != 0) {
             // SET_CLIENT_SIZE is only applicable to window peers, so handle it here
             // instead of pulling 'insets' field up to LWComponentPeer
@@ -495,19 +514,44 @@
     public final void setOpaque(final boolean isOpaque) {
         if (this.isOpaque != isOpaque) {
             this.isOpaque = isOpaque;
-            getPlatformWindow().setOpaque(isOpaque);
-            replaceSurfaceData();
-            repaintPeer();
+            updateOpaque();
         }
     }
 
-    public final boolean isOpaque() {
-        return isOpaque;
+    private void updateOpaque() {
+        getPlatformWindow().setOpaque(!isTranslucent());
+        replaceSurfaceData(false);
+        repaintPeer();
     }
 
     @Override
     public void updateWindow() {
-        flushOffscreenGraphics();
+    }
+
+    public final boolean isTextured() {
+        return textured;
+    }
+
+    public final void setTextured(final boolean isTextured) {
+        textured = isTextured;
+    }
+
+    public final boolean isTranslucent() {
+        synchronized (getStateLock()) {
+            /*
+             * Textured window is a special case of translucent window.
+             * The difference is only in nswindow background. So when we set
+             * texture property our peer became fully translucent. It doesn't
+             * fill background, create non opaque backbuffers and layer etc.
+             */
+            return !isOpaque || isShaped() || isTextured();
+        }
+    }
+
+    @Override
+    final void applyShapeImpl(final Region shape) {
+        super.applyShapeImpl(shape);
+        updateOpaque();
     }
 
     @Override
@@ -612,31 +656,25 @@
     }
 
     /**
-     * Called by the delegate when any part of the window should be repainted.
+     * Called by the {@code PlatformWindow} when any part of the window should
+     * be repainted.
      */
     @Override
-    public void notifyExpose(final int x, final int y, final int w, final int h) {
-        // TODO: there's a serious problem with Swing here: it handles
-        // the exposition internally, so SwingPaintEventDispatcher always
-        // return null from createPaintEvent(). However, we flush the
-        // back buffer here unconditionally, so some flickering may appear.
-        // A possible solution is to split postPaintEvent() into two parts,
-        // and override that part which is only called after if
-        // createPaintEvent() returned non-null value and flush the buffer
-        // from the overridden method
-        flushOnscreenGraphics();
-        repaintPeer(new Rectangle(x, y, w, h));
+    public final void notifyExpose(final Rectangle r) {
+        repaintPeer(r);
     }
 
     /**
-     * Called by the delegate when this window is moved/resized by user.
-     * There's no notifyReshape() in LWComponentPeer as the only
-     * components which could be resized by user are top-level windows.
+     * Called by the {@code PlatformWindow} when this window is moved/resized by
+     * user or window insets are changed. There's no notifyReshape() in
+     * LWComponentPeer as the only components which could be resized by user are
+     * top-level windows.
      */
     @Override
     public final void notifyReshape(int x, int y, int w, int h) {
-        boolean moved = false;
-        boolean resized = false;
+        final boolean moved;
+        final boolean resized;
+        final boolean invalid = updateInsets(platformWindow.getInsets());
         synchronized (getStateLock()) {
             moved = (x != sysX) || (y != sysY);
             resized = (w != sysW) || (h != sysH);
@@ -647,25 +685,25 @@
         }
 
         // Check if anything changed
-        if (!moved && !resized) {
+        if (!moved && !resized && !invalid) {
             return;
         }
         // First, update peer's bounds
         setBounds(x, y, w, h, SET_BOUNDS, false, false);
 
         // Second, update the graphics config and surface data
-        checkIfOnNewScreen();
-        if (resized) {
+        final boolean isNewDevice = updateGraphicsDevice();
+        if (resized || isNewDevice) {
             replaceSurfaceData();
-            flushOnscreenGraphics();
         }
 
-        // Third, COMPONENT_MOVED/COMPONENT_RESIZED events
-        if (moved) {
+        // Third, COMPONENT_MOVED/COMPONENT_RESIZED/PAINT events
+        if (moved || invalid) {
             handleMove(x, y, true);
         }
-        if (resized) {
-            handleResize(w, h,true);
+        if (resized || invalid || isNewDevice) {
+            handleResize(w, h, true);
+            repaintPeer();
         }
 
         repositionSecurityWarning();
@@ -676,7 +714,20 @@
                                                getFont());
         if (g != null) {
             try {
-                g.clearRect(0, 0, w, h);
+                if (g instanceof Graphics2D) {
+                    ((Graphics2D) g).setComposite(AlphaComposite.Src);
+                }
+                if (isTranslucent()) {
+                    g.setColor(nonOpaqueBackground);
+                    g.fillRect(0, 0, w, h);
+                }
+                if (!isTextured()) {
+                    if (g instanceof SunGraphics2D) {
+                        ((SunGraphics2D) g).constrain(0, 0, w, h, getRegion());
+                    }
+                    g.setColor(getBackground());
+                    g.fillRect(0, 0, w, h);
+                }
             } finally {
                 g.dispose();
             }
@@ -689,8 +740,9 @@
     }
 
     @Override
-    public void notifyActivation(boolean activation) {
-        changeFocusedWindow(activation);
+    public void notifyActivation(boolean activation, LWWindowPeer opposite) {
+        Window oppositeWindow = (opposite == null)? null : opposite.getTarget();
+        changeFocusedWindow(activation, oppositeWindow);
     }
 
     // MouseDown in non-client area
@@ -735,48 +787,40 @@
                     Point lp = lastMouseEventPeer.windowToLocal(x, y,
                                                                 lastWindowPeer);
                     Component target = lastMouseEventPeer.getTarget();
-                    postMouseEnteredExitedEvent(target, MouseEvent.MOUSE_EXITED,
-                            when, modifiers, lp,
+                    postMouseEnteredExitedEvent(target, id, when, modifiers, lp,
                             screenX, screenY, clickCount, popupTrigger, button);
                 }
-
                 lastMouseEventPeer = null;
             }
         } else {
             if (targetPeer != lastMouseEventPeer) {
-
-                if (id != MouseEvent.MOUSE_DRAGGED || lastMouseEventPeer == null) {
-                    // lastMouseEventPeer may be null if mouse was out of Java windows
-                    if (lastMouseEventPeer != null && lastMouseEventPeer.isEnabled()) {
-                        // Sometimes, MOUSE_EXITED is not sent by delegate (or is sent a bit
-                        // later), in which case lastWindowPeer is another window
-                        if (lastWindowPeer != this) {
-                            Point oldp = lastMouseEventPeer.windowToLocal(x, y, lastWindowPeer);
-                            // Additionally translate from this to lastWindowPeer coordinates
-                            Rectangle lr = lastWindowPeer.getBounds();
-                            oldp.x += r.x - lr.x;
-                            oldp.y += r.y - lr.y;
-                            Component target = lastMouseEventPeer.getTarget();
-                            postMouseEnteredExitedEvent(target, MouseEvent.MOUSE_EXITED,
-                                    when, modifiers, oldp,
-                                    screenX, screenY, clickCount, popupTrigger, button);
-                        } else {
-                            Point oldp = lastMouseEventPeer.windowToLocal(x, y, this);
-                            Component target = lastMouseEventPeer.getTarget();
-                            postMouseEnteredExitedEvent(target, MouseEvent.MOUSE_EXITED,
-                                    when, modifiers, oldp,
-                                    screenX, screenY, clickCount, popupTrigger, button);
-                        }
-                    }
-                    if (targetPeer != null && targetPeer.isEnabled() && id != MouseEvent.MOUSE_ENTERED) {
-                        Point newp = targetPeer.windowToLocal(x, y, curWindowPeer);
-                        Component target = targetPeer.getTarget();
-                        postMouseEnteredExitedEvent(target, MouseEvent.MOUSE_ENTERED,
-                                when, modifiers, newp,
+                // lastMouseEventPeer may be null if mouse was out of Java windows
+                if (lastMouseEventPeer != null && lastMouseEventPeer.isEnabled()) {
+                    // Sometimes, MOUSE_EXITED is not sent by delegate (or is sent a bit
+                    // later), in which case lastWindowPeer is another window
+                    if (lastWindowPeer != this) {
+                        Point oldp = lastMouseEventPeer.windowToLocal(x, y, lastWindowPeer);
+                        // Additionally translate from this to lastWindowPeer coordinates
+                        Rectangle lr = lastWindowPeer.getBounds();
+                        oldp.x += r.x - lr.x;
+                        oldp.y += r.y - lr.y;
+                        Component target = lastMouseEventPeer.getTarget();
+                        postMouseEnteredExitedEvent(target, id, when, modifiers, oldp,
+                                screenX, screenY, clickCount, popupTrigger, button);
+                    } else {
+                        Point oldp = lastMouseEventPeer.windowToLocal(x, y, this);
+                        Component target = lastMouseEventPeer.getTarget();
+                        postMouseEnteredExitedEvent(target, id, when, modifiers, oldp,
                                 screenX, screenY, clickCount, popupTrigger, button);
                     }
                 }
                 lastMouseEventPeer = targetPeer;
+                if (targetPeer != null && targetPeer.isEnabled() && id != MouseEvent.MOUSE_ENTERED) {
+                    Point newp = targetPeer.windowToLocal(x, y, curWindowPeer);
+                    Component target = targetPeer.getTarget();
+                    postMouseEnteredExitedEvent(target, id, when, modifiers, newp,
+                            screenX, screenY, clickCount, popupTrigger, button);
+                }
             }
             // TODO: fill "bdata" member of AWTEvent
 
@@ -845,7 +889,8 @@
                     postMouseEnteredExitedEvent(targetPeer.getTarget(), id,
                             when, modifiers, lp, screenX, screenY,
                             clickCount, popupTrigger, button);
-                }   else {
+
+                } else {
                     MouseEvent event = new MouseEvent(targetPeer.getTarget(), id,
                                                   when, modifiers, lp.x, lp.y,
                                                   screenX, screenY, clickCount,
@@ -914,25 +959,33 @@
     public void notifyKeyEvent(int id, long when, int modifiers,
                                int keyCode, char keyChar, int keyLocation)
     {
-        LWComponentPeer focusOwner =
-            LWKeyboardFocusManagerPeer.getInstance(getAppContext()).
-                getFocusOwner();
+        LWKeyboardFocusManagerPeer kfmPeer = LWKeyboardFocusManagerPeer.getInstance();
+        Component focusOwner = kfmPeer.getCurrentFocusOwner();
 
-        // Null focus owner may receive key event when
-        // application hides the focused window upon ESC press
-        // (AWT transfers/clears the focus owner) and pending ESC release
-        // may come to already hidden window. This check eliminates NPE.
-        if (focusOwner != null) {
-            KeyEvent event =
-                new KeyEvent(focusOwner.getTarget(), id, when, modifiers,
-                             keyCode, keyChar, keyLocation);
-            focusOwner.postEvent(event);
+        if (focusOwner == null) {
+            focusOwner = kfmPeer.getCurrentFocusedWindow();
+            if (focusOwner == null) {
+                focusOwner = this.getTarget();
+            }
         }
+        postEvent(new KeyEvent(focusOwner, id, when, modifiers, keyCode, keyChar, keyLocation));
     }
 
 
     // ---- UTILITY METHODS ---- //
 
+    private void activateDisplayListener() {
+        final GraphicsEnvironment ge =
+                GraphicsEnvironment.getLocalGraphicsEnvironment();
+        ((SunGraphicsEnvironment) ge).addDisplayChangedListener(this);
+    }
+
+    private void deactivateDisplayListener() {
+        final GraphicsEnvironment ge =
+                GraphicsEnvironment.getLocalGraphicsEnvironment();
+        ((SunGraphicsEnvironment) ge).removeDisplayChangedListener(this);
+    }
+
     private void postWindowStateChangedEvent(int newWindowState) {
         if (getTarget() instanceof Frame) {
             AWTAccessor.getFrameAccessor().setExtendedState(
@@ -976,7 +1029,7 @@
             }
             // If window's graphics config is changed from the app code, the
             // config correspond to the same device as before; when the window
-            // is moved by user, graphicsDevice is updated in checkIfOnNewScreen().
+            // is moved by user, graphicsDevice is updated in notifyReshape().
             // In either case, there's nothing to do with screenOn here
             graphicsConfig = gc;
         }
@@ -984,54 +1037,42 @@
         return true;
     }
 
-    private void checkIfOnNewScreen() {
+    /**
+     * Returns true if the GraphicsDevice has been changed, false otherwise.
+     */
+    public boolean updateGraphicsDevice() {
         GraphicsDevice newGraphicsDevice = platformWindow.getGraphicsDevice();
         synchronized (getStateLock()) {
             if (graphicsDevice == newGraphicsDevice) {
-                return;
+                return false;
             }
             graphicsDevice = newGraphicsDevice;
         }
 
-        // TODO: DisplayChangedListener stuff
         final GraphicsConfiguration newGC = newGraphicsDevice.getDefaultConfiguration();
 
-        if (!setGraphicsConfig(newGC)) return;
+        if (!setGraphicsConfig(newGC)) return false;
 
         SunToolkit.executeOnEventHandlerThread(getTarget(), new Runnable() {
             public void run() {
                 AWTAccessor.getComponentAccessor().setGraphicsConfiguration(getTarget(), newGC);
             }
         });
+        return true;
     }
 
-    /**
-     * This method returns a back buffer Graphics to render all the
-     * peers to. After the peer is painted, the back buffer contents
-     * should be flushed to the screen. All the target painting
-     * (Component.paint() method) should be done directly to the screen.
-     */
-    protected final Graphics getOffscreenGraphics(Color fg, Color bg, Font f) {
-        final Image bb = getBackBuffer();
-        if (bb == null) {
-            return null;
-        }
-        if (fg == null) {
-            fg = SystemColor.windowText;
-        }
-        if (bg == null) {
-            bg = SystemColor.window;
-        }
-        if (f == null) {
-            f = DEFAULT_FONT;
-        }
-        final Graphics2D g = (Graphics2D) bb.getGraphics();
-        if (g != null) {
-            g.setColor(fg);
-            g.setBackground(bg);
-            g.setFont(f);
-        }
-        return g;
+    @Override
+    public final void displayChanged() {
+        updateGraphicsDevice();
+        // Replace surface unconditionally, because internal state of the
+        // GraphicsDevice could be changed.
+        replaceSurfaceData();
+        repaintPeer();
+    }
+
+    @Override
+    public final void paletteChanged() {
+        // components do not need to react to this event.
     }
 
     /*
@@ -1044,11 +1085,16 @@
     }
 
     private void replaceSurfaceData() {
-        replaceSurfaceData(backBufferCount, backBufferCaps);
+        replaceSurfaceData(true);
+    }
+
+    private void replaceSurfaceData(boolean blit) {
+        replaceSurfaceData(backBufferCount, backBufferCaps, blit);
     }
 
     private void replaceSurfaceData(int newBackBufferCount,
-                                                 BufferCapabilities newBackBufferCaps) {
+                                    BufferCapabilities newBackBufferCaps,
+                                    boolean blit) {
         synchronized (surfaceDataLock) {
             final SurfaceData oldData = getSurfaceData();
             surfaceData = platformWindow.replaceSurfaceData();
@@ -1061,7 +1107,10 @@
             if (getSurfaceData() != null && oldData != getSurfaceData()) {
                 clearBackground(size.width, size.height);
             }
-            blitSurfaceData(oldData, getSurfaceData());
+
+            if (blit) {
+                blitSurfaceData(oldData, getSurfaceData());
+            }
 
             if (oldData != null && oldData != getSurfaceData()) {
                 // TODO: drop oldData for D3D/WGL pipelines
@@ -1076,11 +1125,18 @@
                 Graphics g = backBuffer.getGraphics();
                 try {
                     Rectangle r = getBounds();
-                    g.setColor(getBackground());
                     if (g instanceof Graphics2D) {
                         ((Graphics2D) g).setComposite(AlphaComposite.Src);
                     }
+                    g.setColor(nonOpaqueBackground);
                     g.fillRect(0, 0, r.width, r.height);
+                    if (g instanceof SunGraphics2D) {
+                       ((SunGraphics2D) g).constrain(0, 0, r.width, r.height, getRegion());
+                    }
+                    if (!isTextured()) {
+                        g.setColor(getBackground());
+                        g.fillRect(0, 0, r.width, r.height);
+                    }
                     if (oldBB != null) {
                         // Draw the old back buffer to the new one
                         g.drawImage(oldBB, 0, 0, null);
@@ -1091,6 +1147,7 @@
                 }
             }
         }
+        flushOnscreenGraphics();
     }
 
     private void blitSurfaceData(final SurfaceData src, final SurfaceData dst) {
@@ -1098,14 +1155,15 @@
         if (src != dst && src != null && dst != null
             && !(dst instanceof NullSurfaceData)
             && !(src instanceof NullSurfaceData)
-            && src.getSurfaceType().equals(dst.getSurfaceType())) {
-            final Rectangle size = getSize();
+            && src.getSurfaceType().equals(dst.getSurfaceType())
+            && src.getDefaultScale() == dst.getDefaultScale()) {
+            final Rectangle size = src.getBounds();
             final Blit blit = Blit.locate(src.getSurfaceType(),
                                           CompositeType.Src,
                                           dst.getSurfaceType());
             if (blit != null) {
-                blit.Blit(src, dst, ((Graphics2D) getGraphics()).getComposite(),
-                          getRegion(), 0, 0, 0, 0, size.width, size.height);
+                blit.Blit(src, dst, AlphaComposite.Src, null, 0, 0, 0, 0,
+                          size.width, size.height);
             }
         }
     }
@@ -1118,27 +1176,21 @@
         return backBufferCaps;
     }
 
-    /*
-     * Request the window insets from the delegate and compares it
-     * with the current one. This method is mostly called by the
-     * delegate, e.g. when the window state is changed and insets
-     * should be recalculated.
-     *
+    /**
+     * Request the window insets from the delegate and compares it with the
+     * current one. This method is mostly called by the delegate, e.g. when the
+     * window state is changed and insets should be recalculated.
+     * <p/>
      * This method may be called on the toolkit thread.
      */
-    public boolean updateInsets(Insets newInsets) {
-        boolean changed = false;
+    public final boolean updateInsets(final Insets newInsets) {
         synchronized (getStateLock()) {
-            changed = (insets.equals(newInsets));
+            if (insets.equals(newInsets)) {
+                return false;
+            }
             insets = newInsets;
         }
-
-        if (changed) {
-            replaceSurfaceData();
-            repaintPeer();
-        }
-
-        return changed;
+        return true;
     }
 
     public static LWWindowPeer getWindowUnderCursor() {
@@ -1170,6 +1222,9 @@
         Window currentActive = KeyboardFocusManager.
             getCurrentKeyboardFocusManager().getActiveWindow();
 
+        Window opposite = LWKeyboardFocusManagerPeer.getInstance().
+            getCurrentFocusedWindow();
+
         // Make the owner active window.
         if (isSimpleWindow()) {
             LWWindowPeer owner = getOwnerFrameDialog(this);
@@ -1196,16 +1251,17 @@
             }
 
             // DKFM will synthesize all the focus/activation events correctly.
-            changeFocusedWindow(true);
+            changeFocusedWindow(true, opposite);
             return true;
 
         // In case the toplevel is active but not focused, change focus directly,
         // as requesting native focus on it will not have effect.
         } else if (getTarget() == currentActive && !getTarget().hasFocus()) {
 
-            changeFocusedWindow(true);
+            changeFocusedWindow(true, opposite);
             return true;
         }
+
         return platformWindow.requestWindowFocus();
     }
 
@@ -1235,7 +1291,7 @@
     /*
      * Changes focused window on java level.
      */
-    private void changeFocusedWindow(boolean becomesFocused) {
+    private void changeFocusedWindow(boolean becomesFocused, Window opposite) {
         if (focusLog.isLoggable(PlatformLogger.FINE)) {
             focusLog.fine((becomesFocused?"gaining":"loosing") + " focus window: " + this);
         }
@@ -1259,11 +1315,6 @@
             }
         }
 
-        LWKeyboardFocusManagerPeer manager = LWKeyboardFocusManagerPeer.
-            getInstance(getAppContext());
-
-        Window oppositeWindow = becomesFocused ? manager.getCurrentFocusedWindow() : null;
-
         // Note, the method is not called:
         // - when the opposite (gaining focus) window is an owned/owner window.
         // - for a simple window in any case.
@@ -1275,10 +1326,11 @@
             grabbingWindow.ungrab();
         }
 
-        manager.setFocusedWindow(becomesFocused ? LWWindowPeer.this : null);
+        KeyboardFocusManagerPeer kfmPeer = LWKeyboardFocusManagerPeer.getInstance();
+        kfmPeer.setCurrentFocusedWindow(becomesFocused ? getTarget() : null);
 
         int eventID = becomesFocused ? WindowEvent.WINDOW_GAINED_FOCUS : WindowEvent.WINDOW_LOST_FOCUS;
-        WindowEvent windowEvent = new WindowEvent(getTarget(), eventID, oppositeWindow);
+        WindowEvent windowEvent = new WindowEvent(getTarget(), eventID, opposite);
 
         // TODO: wrap in SequencedEvent
         postEvent(windowEvent);
@@ -1346,6 +1398,10 @@
         return this == grabbingWindow;
     }
 
+    public PeerType getPeerType() {
+        return peerType;
+    }
+
     public void updateSecurityWarningVisibility() {
         if (warningWindow == null) {
             return;
@@ -1359,7 +1415,7 @@
 
         if (!platformWindow.isFullScreenMode()) {
             if (isVisible()) {
-                if (LWKeyboardFocusManagerPeer.getInstance(getAppContext()).getCurrentFocusedWindow() ==
+                if (LWKeyboardFocusManagerPeer.getInstance().getCurrentFocusedWindow() ==
                         getTarget()) {
                     show = true;
                 }
--- a/src/macosx/classes/sun/lwawt/PlatformComponent.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/classes/sun/lwawt/PlatformComponent.java	Fri Jun 21 19:11:42 2013 -0700
@@ -23,15 +23,38 @@
  * questions.
  */
 
+
 package sun.lwawt;
 
-import java.awt.Component;
-
+/**
+ * Can be used to store information about native resource related to the
+ * lightweight component.
+ */
 public interface PlatformComponent {
 
-    public void initialize(Component target, LWComponentPeer peer, PlatformWindow platformWindow);
+    /**
+     * Initializes platform component.
+     *
+     * @param platformWindow already initialized {@code PlatformWindow}.
+     */
+    void initialize(PlatformWindow platformWindow);
 
-    public void setBounds(int x, int y, int w, int h);
+    /**
+     * Moves and resizes this component. The new location of the top-left corner
+     * is specified by {@code x} and {@code y}, and the new size is specified by
+     * {@code w} and {@code h}. The location is specified relative to the {@code
+     * platformWindow}.
+     *
+     * @param x the X location of the component
+     * @param y the Y location of the component
+     * @param w the width of the component
+     * @param h the height of the component
+     */
+    void setBounds(int x, int y, int w, int h);
 
-    public void dispose();
+    /**
+     * Releases all of the native resources used by this {@code
+     * PlatformComponent}.
+     */
+    void dispose();
 }
--- a/src/macosx/classes/sun/lwawt/PlatformEventNotifier.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/classes/sun/lwawt/PlatformEventNotifier.java	Fri Jun 21 19:11:42 2013 -0700
@@ -32,13 +32,13 @@
 
     void notifyZoom(boolean isZoomed);
 
-    void notifyExpose(final int x, final int y, final int w, final int h);
+    void notifyExpose(Rectangle r);
 
     void notifyReshape(int x, int y, int w, int h);
 
     void notifyUpdateCursor();
 
-    void notifyActivation(boolean activation);
+    void notifyActivation(boolean activation, LWWindowPeer opposite);
 
     // MouseDown in non-client area
     void notifyNCMouseDown();
--- a/src/macosx/classes/sun/lwawt/macosx/CClipboard.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/classes/sun/lwawt/macosx/CClipboard.java	Fri Jun 21 19:11:42 2013 -0700
@@ -110,4 +110,12 @@
 
     public native void declareTypes(long[] formats, SunClipboard newOwner);
     public native void setData(byte[] data, long format);
+
+    /**
+     * Invokes native check whether a change count on the general pasteboard is different
+     * than when we set it. The different count value means the current owner lost
+     * pasteboard ownership and someone else put data on the clipboard.
+     * @since 1.7
+     */
+    public native void checkPasteboard();
 }
--- a/src/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java	Fri Jun 21 19:11:42 2013 -0700
@@ -88,40 +88,25 @@
         DragGestureEvent trigger = getTrigger();
         InputEvent         triggerEvent = trigger.getTriggerEvent();
 
-        Point dragOrigin = trigger.getDragOrigin();
+        Point dragOrigin = new Point(trigger.getDragOrigin());
         int extModifiers = (triggerEvent.getModifiers() | triggerEvent.getModifiersEx());
         long timestamp   = triggerEvent.getWhen();
         int clickCount   = ((triggerEvent instanceof MouseEvent) ? (((MouseEvent) triggerEvent).getClickCount()) : 1);
 
-        // Get drag source component and its peer:
         Component component = trigger.getComponent();
-        Point componentOffset = new Point();
-        ComponentPeer peer = component.getPeer();
-
-        // For a lightweight component traverse up the hierarchy to the first heavyweight
-        // which will be used as the ComponentModel for the native drag source.
-        if (component.isLightweight()) {
-            Point loc = component.getLocation();
-            componentOffset.translate(loc.x, loc.y);
-
-            for (Component parent = component.getParent(); parent != null; parent = parent.getParent()) {
-                if (parent.isLightweight() == false) {
-                    peer = parent.getPeer();
-                    break;
-                }
-
-                loc = parent.getLocation();
-                componentOffset.translate(loc.x, loc.y);
-            }
+        // For a lightweight component traverse up the hierarchy to the root
+        Point loc = component.getLocation();
+        Component rootComponent = component;
+        while (!(rootComponent instanceof Window)) {
+            dragOrigin.translate(loc.x, loc.y);
+            rootComponent = rootComponent.getParent();
+            loc = rootComponent.getLocation();
         }
 
-        // Make sure the drop target is a ComponentModel:
-        if (!(peer instanceof LWComponentPeer))
-            throw new IllegalArgumentException("DragSource's peer must be a ComponentModel.");
-
-        // Get model pointer (CButton.m and such) and its native peer:
-        LWComponentPeer model = (LWComponentPeer) peer;
-        CPlatformWindow platformWindow = (CPlatformWindow) model.getPlatformWindow();
+        //It sure will be LWComponentPeer instance as rootComponent is a Window
+        LWComponentPeer peer = (LWComponentPeer)rootComponent.getPeer();
+        //Get a pointer to a native window
+        CPlatformWindow platformWindow = (CPlatformWindow) peer.getPlatformWindow();
         long nativeWindowPtr = platformWindow.getNSWindowPtr();
 
         // Get drag cursor:
@@ -155,7 +140,7 @@
         try {
             // Create native dragging source:
             final long nativeDragSource = createNativeDragSource(component, peer, nativeWindowPtr, transferable, triggerEvent,
-                (int) (dragOrigin.getX() + componentOffset.x), (int) (dragOrigin.getY() + componentOffset.y), extModifiers,
+                (int) (dragOrigin.getX()), (int) (dragOrigin.getY()), extModifiers,
                 clickCount, timestamp, cursor, fDragCImage, dragImageOffset.x, dragImageOffset.y,
                 getDragSourceContext().getSourceActions(), formats, formatMap);
 
@@ -165,8 +150,8 @@
             setNativeContext(nativeDragSource);
 
             CCursorManager.getInstance().startDrag(
-                    (int) (dragOrigin.getX() + componentOffset.x),
-                    (int) (dragOrigin.getY() + componentOffset.y));
+                    (int) (dragOrigin.getX()),
+                    (int) (dragOrigin.getY()));
         }
 
         catch (Exception e) {
--- a/src/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java	Fri Jun 21 19:11:42 2013 -0700
@@ -38,8 +38,7 @@
 public class CEmbeddedFrame extends EmbeddedFrame {
 
     private CPlatformResponder responder;
-    private static final Object classLock = new Object();
-    private static volatile CEmbeddedFrame focusedWindow;
+    private boolean focused = true;
     private boolean parentWindowActive = true;
 
     public CEmbeddedFrame() {
@@ -101,43 +100,37 @@
         responder.handleKeyEvent(eventType, modifierFlags, charsIgnoringMods, keyCode, needsKeyTyped, isRepeat);
     }
 
+    // REMIND: delete this method once 'deploy' changes for 7156194 is pushed
+    public void handleKeyEvent(int eventType, int modifierFlags, String characters,
+                               String charsIgnoringMods, boolean isRepeat, short keyCode) {
+        handleKeyEvent(eventType, modifierFlags, characters, charsIgnoringMods, isRepeat, keyCode, true);
+    }
+
     public void handleInputEvent(String text) {
         responder.handleInputEvent(text);
     }
 
-    // handleFocusEvent is called when the applet becames focused/unfocused.
-    // This method can be called from different threads.
     public void handleFocusEvent(boolean focused) {
-
-        boolean handleWindowFocusEvent;
-        synchronized (classLock) {
-            // In some cases an applet may not receive the focus lost event
-            // from the parent window (see 8012330)
-            focusedWindow = (focused) ? this
-                    : ((focusedWindow == this) ? null : focusedWindow);
-            handleWindowFocusEvent = parentWindowActive;
+        this.focused = focused;
+        if (focused) {
+            // see bug 8010925
+            // we can't put this to handleWindowFocusEvent because
+            // it won't be invoced if focuse is moved to a html element
+            // on the same page.
+            CClipboard clipboard = (CClipboard) Toolkit.getDefaultToolkit().getSystemClipboard();
+            clipboard.checkPasteboard();
         }
-
-        if (handleWindowFocusEvent) {
-            responder.handleWindowFocusEvent(focused);
+        if (parentWindowActive) {
+            responder.handleWindowFocusEvent(focused, null);
         }
     }
 
-    // handleWindowFocusEvent is called for all applets, when the browser
-    // becames active/inactive. This event should be filtered out for
-    // non-focused applet. This method can be called from different threads.
     public void handleWindowFocusEvent(boolean parentWindowActive) {
-
-        boolean handleWindowFocusEvent;
-        synchronized (classLock) {
-            this.parentWindowActive = parentWindowActive;
-            handleWindowFocusEvent = focusedWindow == this && parentWindowActive;
-        }
-
+        this.parentWindowActive = parentWindowActive;
         // ignore focus "lost" native request as it may mistakenly
         // deactivate active window (see 8001161)
-        if (handleWindowFocusEvent) {
-            responder.handleWindowFocusEvent(parentWindowActive);
+        if (focused && parentWindowActive) {
+            responder.handleWindowFocusEvent(parentWindowActive, null);
         }
     }
 
--- a/src/macosx/classes/sun/lwawt/macosx/CFRetainedResource.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/classes/sun/lwawt/macosx/CFRetainedResource.java	Fri Jun 21 19:11:42 2013 -0700
@@ -33,8 +33,8 @@
 public class CFRetainedResource {
     private static native void nativeCFRelease(final long ptr, final boolean disposeOnAppKitThread);
 
-    final boolean disposeOnAppKitThread;
-    protected long ptr;
+    private final boolean disposeOnAppKitThread;
+    protected volatile long ptr;
 
     /**
      * @param ptr CFRetained native object pointer
--- a/src/macosx/classes/sun/lwawt/macosx/CFileDialog.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/classes/sun/lwawt/macosx/CFileDialog.java	Fri Jun 21 19:11:42 2013 -0700
@@ -30,12 +30,14 @@
 import java.awt.BufferCapabilities.FlipContents;
 import java.awt.event.*;
 import java.awt.image.*;
+import java.security.AccessController;
 import java.util.List;
 import java.io.*;
 
 import sun.awt.CausedFocusEvent.Cause;
 import sun.awt.AWTAccessor;
 import sun.java2d.pipe.Region;
+import sun.security.action.GetBooleanAction;
 
 class CFileDialog implements FileDialogPeer {
 
@@ -53,11 +55,14 @@
                 if (title == null) {
                     title = " ";
                 }
+                Boolean chooseDirectories = AccessController.doPrivileged(
+                        new GetBooleanAction("apple.awt.fileDialogForDirectories"));
 
                 String[] userFileNames = nativeRunFileDialog(title,
                         dialogMode,
                         target.isMultipleMode(),
                         navigateApps,
+                        chooseDirectories,
                         target.getFilenameFilter() != null,
                         target.getDirectory(),
                         target.getFile());
@@ -142,7 +147,8 @@
     }
 
     private native String[] nativeRunFileDialog(String title, int mode,
-            boolean multipleMode, boolean shouldNavigateApps, boolean hasFilenameFilter,
+            boolean multipleMode, boolean shouldNavigateApps,
+            boolean canChooseDirectories, boolean hasFilenameFilter,
             String directory, String file);
 
     @Override
--- a/src/macosx/classes/sun/lwawt/macosx/CMouseInfoPeer.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/classes/sun/lwawt/macosx/CMouseInfoPeer.java	Fri Jun 21 19:11:42 2013 -0700
@@ -26,7 +26,6 @@
 package sun.lwawt.macosx;
 
 import java.awt.Window;
-
 import sun.lwawt.LWMouseInfoPeer;
 import sun.lwawt.LWWindowPeer;
 
@@ -41,10 +40,6 @@
             return false;
         }
 
-        LWWindowPeer peer = (LWWindowPeer)w.getPeer();
-        CPlatformWindow platformWindow = (CPlatformWindow)peer.getPlatformWindow();
-        return nativeIsWindowUnderMouse(platformWindow.getNSWindowPtr());
+        return ((LWWindowPeer)w.getPeer()).getPlatformWindow().isUnderMouse();
     }
-
-    private static native boolean nativeIsWindowUnderMouse(long ptr);
 }
--- a/src/macosx/classes/sun/lwawt/macosx/CPlatformComponent.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/classes/sun/lwawt/macosx/CPlatformComponent.java	Fri Jun 21 19:11:42 2013 -0700
@@ -23,27 +23,24 @@
  * questions.
  */
 
+
 package sun.lwawt.macosx;
 
-import java.awt.Component;
 import java.awt.Insets;
 
 import sun.lwawt.PlatformComponent;
 import sun.lwawt.PlatformWindow;
-import sun.lwawt.LWComponentPeer;
-
-import sun.lwawt.macosx.CFRetainedResource;
-
-public class CPlatformComponent extends CFRetainedResource implements PlatformComponent {
 
-    Component target;
-    LWComponentPeer peer;
-    PlatformWindow platformWindow;
+/**
+ * On OSX {@code CPlatformComponent} stores pointer to the native CAlayer which
+ * can be used from JAWT.
+ */
+final class CPlatformComponent extends CFRetainedResource
+        implements PlatformComponent {
 
-    private native long nativeCreateComponent(long windowLayer);
-    private native long nativeSetBounds(long ptr, int x, int y, int width, int height);
+    private volatile PlatformWindow platformWindow;
 
-    public CPlatformComponent() {
+    CPlatformComponent() {
         super(0, true);
     }
 
@@ -51,27 +48,28 @@
         return ptr;
     }
 
-    public void initialize(Component target, LWComponentPeer peer, PlatformWindow platformWindow) {
-        this.target = target;
-        this.peer = peer;
+    @Override
+    public void initialize(final PlatformWindow platformWindow) {
         this.platformWindow = platformWindow;
-
-        long windowLayerPtr = platformWindow.getLayerPtr();
-        setPtr(nativeCreateComponent(windowLayerPtr));
+        setPtr(nativeCreateComponent(platformWindow.getLayerPtr()));
     }
 
     // TODO: visibility, z-order
 
     @Override
-    public void setBounds(int x, int y, int width, int height) {
+    public void setBounds(final int x, final int y, final int w, final int h) {
         // translates values from the coordinate system of the top-level window
         // to the coordinate system of the content view
-        Insets insets = platformWindow.getPeer().getInsets();
-        nativeSetBounds(getPointer(), x - insets.left, y - insets.top, width, height);
+        final Insets insets = platformWindow.getPeer().getInsets();
+        nativeSetBounds(getPointer(), x - insets.left, y - insets.top, w, h);
     }
 
     @Override
     public void dispose() {
         super.dispose();
     }
+
+    private native long nativeCreateComponent(long windowLayer);
+
+    private native void nativeSetBounds(long ptr, int x, int y, int w, int h);
 }
--- a/src/macosx/classes/sun/lwawt/macosx/CPlatformEmbeddedFrame.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/classes/sun/lwawt/macosx/CPlatformEmbeddedFrame.java	Fri Jun 21 19:11:42 2013 -0700
@@ -117,7 +117,7 @@
         Rectangle r = peer.getBounds();
         Image im = null;
         if (!r.isEmpty()) {
-            int transparency = (peer.isOpaque() ? Transparency.OPAQUE : Transparency.TRANSLUCENT);
+            int transparency = peer.isTranslucent() ? Transparency.TRANSLUCENT : Transparency.OPAQUE;
             im = peer.getGraphicsConfiguration().createCompatibleImage(r.width, r.height, transparency);
         }
         return im;
@@ -208,13 +208,17 @@
     }
 
     @Override
-    public boolean isUnderMouse() {
-        return false;
-    }
-
-    @Override
     public void setWindowState(int windowState) {}
 
     @Override
     public void setModalBlocked(boolean blocked) {}
+
+    /*
+     * The method could not be implemented due to CALayer restrictions.
+     * The exeption enforce clients not to use it.
+     */
+    @Override
+    public boolean isUnderMouse() {
+        throw new RuntimeException("Not implemented");
+    }
 }
--- a/src/macosx/classes/sun/lwawt/macosx/CPlatformResponder.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/classes/sun/lwawt/macosx/CPlatformResponder.java	Fri Jun 21 19:11:42 2013 -0700
@@ -138,7 +138,7 @@
         boolean postsTyped = false;
 
         char testChar = KeyEvent.CHAR_UNDEFINED;
-        char testDeadChar = 0;
+        boolean isDeadChar = (chars!= null && chars.length() == 0);
 
         if (isFlagsChangedEvent) {
             int[] in = new int[] {modifierFlags, keyCode};
@@ -154,14 +154,21 @@
                 testChar = chars.charAt(0);
             }
 
-            int[] in = new int[] {testChar, testDeadChar, modifierFlags, keyCode};
-            int[] out = new int[2]; // [jkeyCode, jkeyLocation]
+            int[] in = new int[] {testChar, isDeadChar ? 1 : 0, modifierFlags, keyCode};
+            int[] out = new int[3]; // [jkeyCode, jkeyLocation, deadChar]
 
             postsTyped = NSEvent.nsToJavaKeyInfo(in, out);
             if (!postsTyped) {
                 testChar = KeyEvent.CHAR_UNDEFINED;
             }
 
+            if(isDeadChar){
+                testChar = (char) out[2];
+                if(testChar == 0){
+                    return;
+                }
+            }
+
             jkeyCode = out[0];
             jkeyLocation = out[1];
             jeventType = isNpapiCallback ? NSEvent.npToJavaEventType(eventType) :
@@ -232,11 +239,15 @@
         }
     }
 
-    void handleWindowFocusEvent(boolean gained) {
-        eventNotifier.notifyActivation(gained);
+    void handleWindowFocusEvent(boolean gained, LWWindowPeer opposite) {
+        eventNotifier.notifyActivation(gained, opposite);
     }
 
-    void handleWindowDidExposeEvent(float x, float y, float w, float h) {
-        eventNotifier.notifyExpose((int)x, (int)y, (int)w, (int)h);
+    void handleWindowDidExposeEvent(final Rectangle r) {
+        eventNotifier.notifyExpose(r);
+    }
+
+    void handleReshapeEvent(int x, int y, int w, int h) {
+        eventNotifier.notifyReshape(x, y, w, h);
     }
 }
--- a/src/macosx/classes/sun/lwawt/macosx/CPlatformView.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/classes/sun/lwawt/macosx/CPlatformView.java	Fri Jun 21 19:11:42 2013 -0700
@@ -27,9 +27,11 @@
 
 import java.awt.*;
 import java.awt.event.*;
+import java.awt.geom.Rectangle2D;
 import java.awt.image.VolatileImage;
 
 import sun.awt.CGraphicsConfig;
+import sun.awt.CGraphicsEnvironment;
 import sun.lwawt.LWWindowPeer;
 import sun.lwawt.macosx.event.NSEvent;
 
@@ -39,6 +41,9 @@
 
 public class CPlatformView extends CFRetainedResource {
     private native long nativeCreateView(int x, int y, int width, int height, long windowLayerPtr);
+    private static native void nativeSetAutoResizable(long awtView, boolean toResize);
+    private static native int nativeGetNSViewDisplayID(long awtView);
+    private static native Rectangle2D nativeGetLocationOnScreen(long awtView);
     private static native boolean nativeIsViewUnderMouse(long ptr);
 
     private LWWindowPeer peer;
@@ -66,10 +71,10 @@
 
     public long getAWTView() {
         return ptr;
-    }
+        }
 
     public boolean isOpaque() {
-        return peer.isOpaque();
+        return !peer.isTranslucent();
     }
 
     /*
@@ -89,29 +94,8 @@
         return peer;
     }
 
-    public void enterFullScreenMode(final long nsWindowPtr) {
+    public void enterFullScreenMode() {
         CWrapper.NSView.enterFullScreenMode(ptr);
-
-        // REMIND: CGLSurfaceData expects top-level's size
-        // and therefore we need to account insets before
-        // recreating the surface data
-        Insets insets = peer.getInsets();
-
-        Rectangle screenBounds;
-        final long screenPtr = CWrapper.NSWindow.screen(nsWindowPtr);
-        try {
-            screenBounds = CWrapper.NSScreen.frame(screenPtr).getBounds();
-        } finally {
-            CWrapper.NSObject.release(screenPtr);
-        }
-
-        // the move/size notification from the underlying system comes
-        // but it contains a bounds smaller than the whole screen
-        // and therefore we need to create the synthetic notifications
-        peer.notifyReshape(screenBounds.x - insets.left,
-                           screenBounds.y - insets.bottom,
-                           screenBounds.width + insets.left + insets.right,
-                           screenBounds.height + insets.top + insets.bottom);
     }
 
     public void exitFullScreenMode() {
@@ -189,14 +173,46 @@
         }
     }
 
+    public void setAutoResizable(boolean toResize) {
+        nativeSetAutoResizable(this.getAWTView(), toResize);
+    }
+
     public boolean isUnderMouse() {
         return nativeIsViewUnderMouse(getAWTView());
     }
 
+    public GraphicsDevice getGraphicsDevice() {
+        GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
+        CGraphicsEnvironment cge = (CGraphicsEnvironment)ge;
+        int displayID = nativeGetNSViewDisplayID(getAWTView());
+        GraphicsDevice gd = cge.getScreenDevice(displayID);
+        if (gd == null) {
+            // this could possibly happen during device removal
+            // use the default screen device in this case
+            gd = ge.getDefaultScreenDevice();
+        }
+        return gd;
+    }
+
+    public Point getLocationOnScreen() {
+        Rectangle r = nativeGetLocationOnScreen(this.getAWTView()).getBounds();
+        return new Point(r.x, r.y);
+    }
+
     // ----------------------------------------------------------------------
     // NATIVE CALLBACKS
     // ----------------------------------------------------------------------
 
+    /*
+     * The callback is called only in the embedded case when the view is
+     * automatically resized by the superview.
+     * In normal mode this method is never called.
+     */
+    private void deliverResize(int x, int y, int w, int h) {
+        responder.handleReshapeEvent(x, y, w, h);
+    }
+
+
     private void deliverMouseEvent(NSEvent event) {
         int x = event.getX();
         int y = getBounds().height - event.getY();
@@ -215,12 +231,12 @@
                                  event.getCharactersIgnoringModifiers(), event.getKeyCode(), true, false);
     }
 
+    /**
+     * Called by the native delegate in layer backed view mode or in the simple
+     * NSView mode. See NSView.drawRect().
+     */
     private void deliverWindowDidExposeEvent() {
         Rectangle r = getBounds();
-        responder.handleWindowDidExposeEvent(0, 0, r.width, r.height);
-    }
-
-    private void deliverWindowDidExposeEvent(float x, float y, float w, float h) {
-        responder.handleWindowDidExposeEvent((int)x, (int)y, (int)w, (int)h);
+        responder.handleWindowDidExposeEvent(new Rectangle(r.width, r.height));
     }
 }
--- a/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Fri Jun 21 19:11:42 2013 -0700
@@ -31,7 +31,9 @@
 import java.awt.event.*;
 import java.awt.peer.WindowPeer;
 import java.beans.*;
+import java.lang.reflect.InvocationTargetException;
 import java.util.List;
+import java.util.Objects;
 
 import javax.swing.*;
 
@@ -39,7 +41,6 @@
 import sun.java2d.SurfaceData;
 import sun.java2d.opengl.CGLSurfaceData;
 import sun.lwawt.*;
-import sun.lwawt.LWWindowPeer.PeerType;
 import sun.util.logging.PlatformLogger;
 
 import com.apple.laf.*;
@@ -59,13 +60,10 @@
     private static native void nativeRevalidateNSWindowShadow(long nsWindowPtr);
     private static native void nativeSetNSWindowMinimizedIcon(long nsWindowPtr, long nsImage);
     private static native void nativeSetNSWindowRepresentedFilename(long nsWindowPtr, String representedFilename);
-    private static native void nativeSetNSWindowSecurityWarningPositioning(long nsWindowPtr, double x, double y, float biasX, float biasY);
     private static native void nativeSetEnabled(long nsWindowPtr, boolean isEnabled);
     private static native void nativeSynthesizeMouseEnteredExitedEvents(long nsWindowPtr);
     private static native void nativeDispose(long nsWindowPtr);
 
-    private static native int nativeGetNSWindowDisplayID_AppKitThread(long nsWindowPtr);
-
     // Loger to report issues happened during execution but that do not affect functionality
     private static final PlatformLogger logger = PlatformLogger.getLogger("sun.lwawt.macosx.CPlatformWindow");
     private static final PlatformLogger focusLogger = PlatformLogger.getLogger("sun.lwawt.macosx.focus.CPlatformWindow");
@@ -117,6 +115,8 @@
 
     static final int RESIZABLE = 1 << 9; // both a style bit and prop bit
     static final int NONACTIVATING = 1 << 24;
+    static final int IS_DIALOG = 1 << 25;
+    static final int IS_MODAL = 1 << 26;
 
     static final int _STYLE_PROP_BITMASK = DECORATED | TEXTURED | UNIFIED | UTILITY | HUD | SHEET | CLOSEABLE | MINIMIZABLE | RESIZABLE;
 
@@ -198,8 +198,9 @@
     // In order to keep it up-to-date we will update them on
     // 1) setting native bounds via nativeSetBounds() call
     // 2) getting notification from the native level via deliverMoveResizeEvent()
-    private Rectangle nativeBounds;
-    private volatile boolean isFullScreenMode = false;
+    private Rectangle nativeBounds = new Rectangle(0, 0, 0, 0);
+    private volatile boolean isFullScreenMode;
+    private boolean isFullScreenAnimationOn;
 
     private Window target;
     private LWWindowPeer peer;
@@ -211,9 +212,8 @@
     private CPlatformResponder responder;
     private volatile boolean zoomed = false; // from native perspective
 
-    public CPlatformWindow(final PeerType peerType) {
+    public CPlatformWindow() {
         super(0, true);
-        assert (peerType == PeerType.SIMPLEWINDOW || peerType == PeerType.DIALOG || peerType == PeerType.FRAME);
     }
 
     /*
@@ -303,7 +303,7 @@
 
         // If the target is a dialog, popup or tooltip we want it to ignore the brushed metal look.
         if (isPopup) {
-            styleBits = SET(styleBits, TEXTURED, true);
+            styleBits = SET(styleBits, TEXTURED, false);
             // Popups in applets don't activate applet's process
             styleBits = SET(styleBits, NONACTIVATING, true);
         }
@@ -377,6 +377,15 @@
             }
         }
 
+        if (isDialog) {
+            styleBits = SET(styleBits, IS_DIALOG, true);
+            if (((Dialog) target).isModal()) {
+                styleBits = SET(styleBits, IS_MODAL, true);
+            }
+        }
+
+        peer.setTextured(IS(TEXTURED, styleBits));
+
         return styleBits;
     }
 
@@ -432,8 +441,10 @@
 
     @Override // PlatformWindow
     public Insets getInsets() {
-        final Insets insets = nativeGetNSWindowInsets(getNSWindowPtr());
-        return insets;
+        if (!isFullScreenMode) {
+            return nativeGetNSWindowInsets(getNSWindowPtr());
+        }
+        return new Insets(0, 0, 0, 0);
     }
 
     @Override // PlatformWindow
@@ -443,16 +454,7 @@
 
     @Override
     public GraphicsDevice getGraphicsDevice() {
-        GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
-        CGraphicsEnvironment cge = (CGraphicsEnvironment)ge;
-        int displayID = nativeGetNSWindowDisplayID_AppKitThread(getNSWindowPtr());
-        GraphicsDevice gd = cge.getScreenDevice(displayID);
-        if (gd == null) {
-            // this could possibly happen during device removal
-            // use the default screen device in this case
-            gd = ge.getDefaultScreenDevice();
-        }
-        return gd;
+        return contentView.getGraphicsDevice();
     }
 
     @Override // PlatformWindow
@@ -743,16 +745,38 @@
     @Override
     public void setOpaque(boolean isOpaque) {
         CWrapper.NSWindow.setOpaque(getNSWindowPtr(), isOpaque);
-        if (!isOpaque) {
+        boolean isTextured = (peer == null)? false : peer.isTextured();
+        if (!isOpaque && !isTextured) {
             long clearColor = CWrapper.NSColor.clearColor();
             CWrapper.NSWindow.setBackgroundColor(getNSWindowPtr(), clearColor);
         }
+
+        //This is a temporary workaround. Looks like after 7124236 will be fixed
+        //the correct place for invalidateShadow() is CGLayer.drawInCGLContext.
+        SwingUtilities.invokeLater(new Runnable() {
+            @Override
+            public void run() {
+                invalidateShadow();
+            }
+        });
     }
 
     @Override
     public void enterFullScreenMode() {
         isFullScreenMode = true;
-        contentView.enterFullScreenMode(getNSWindowPtr());
+        contentView.enterFullScreenMode();
+        // the move/size notification from the underlying system comes
+        // but it contains a bounds smaller than the whole screen
+        // and therefore we need to create the synthetic notifications
+        Rectangle screenBounds;
+        final long screenPtr = CWrapper.NSWindow.screen(getNSWindowPtr());
+        try {
+            screenBounds = CWrapper.NSScreen.frame(screenPtr).getBounds();
+        } finally {
+            CWrapper.NSObject.release(screenPtr);
+        }
+        responder.handleReshapeEvent(screenBounds.x, screenBounds.y, screenBounds.width,
+                           screenBounds.height);
     }
 
     @Override
@@ -821,6 +845,10 @@
     }
 
 
+    public final void invalidateShadow(){
+        nativeRevalidateNSWindowShadow(getNSWindowPtr());
+    }
+
     // ----------------------------------------------------------------------
     //                          UTILITY METHODS
     // ----------------------------------------------------------------------
@@ -880,31 +908,59 @@
         }
     }
 
+    void flushBuffers() {
+        if (isVisible() && !nativeBounds.isEmpty() && !isFullScreenMode) {
+            try {
+                LWCToolkit.invokeAndWait(new Runnable() {
+                    @Override
+                    public void run() {
+                        //Posting an empty to flush the EventQueue without blocking the main thread
+                    }
+                }, target);
+            } catch (InterruptedException | InvocationTargetException e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
     /*************************************************************
      * Callbacks from the AWTWindow and AWTView objc classes.
      *************************************************************/
-    private void deliverWindowFocusEvent(boolean gained){
+    private void deliverWindowFocusEvent(boolean gained, CPlatformWindow opposite){
         // Fix for 7150349: ingore "gained" notifications when the app is inactive.
         if (gained && !((LWCToolkit)Toolkit.getDefaultToolkit()).isApplicationActive()) {
             focusLogger.fine("the app is inactive, so the notification is ignored");
             return;
         }
-        responder.handleWindowFocusEvent(gained);
+
+        LWWindowPeer oppositePeer = (opposite == null)? null : opposite.getPeer();
+        responder.handleWindowFocusEvent(gained, oppositePeer);
     }
 
-    protected void deliverMoveResizeEvent(int x, int y, int width, int height) {
+    protected void deliverMoveResizeEvent(int x, int y, int width, int height,
+                                        boolean byUser) {
         // when the content view enters the full-screen mode, the native
         // move/resize notifications contain a bounds smaller than
         // the whole screen and therefore we ignore the native notifications
         // and the content view itself creates correct synthetic notifications
-        if (isFullScreenMode) return;
+        if (isFullScreenMode) {
+            return;
+        }
 
+        final Rectangle oldB = nativeBounds;
         nativeBounds = new Rectangle(x, y, width, height);
-        if (peer != null) {
+        final GraphicsConfiguration oldGC = contentView.getGraphicsConfiguration();
+
+        if (peer!= null) {
             peer.notifyReshape(x, y, width, height);
         }
-        //TODO validateSurface already called from notifyReshape
-        validateSurface();
+
+        final GraphicsConfiguration newGC = contentView.getGraphicsConfiguration();
+        // System-dependent appearance optimization.
+        if ((byUser && !oldB.getSize().equals(nativeBounds.getSize()))
+            || isFullScreenAnimationOn || !Objects.equals(newGC, oldGC)) {
+            flushBuffers();
+        }
     }
 
     private void deliverWindowClosingEvent() {
@@ -961,6 +1017,10 @@
             return false;
         }
 
+        if (blocker instanceof CPrinterDialogPeer) {
+            return true;
+        }
+
         CPlatformWindow pWindow = (CPlatformWindow)blocker.getPlatformWindow();
 
         pWindow.orderAboveSiblings();
@@ -1012,29 +1072,19 @@
         orderAboveSiblings();
     }
 
-    private void updateDisplay() {
-        EventQueue.invokeLater(new Runnable() {
-            public void run() {
-                validateSurface();
-            }
-        });
+    private void windowWillEnterFullScreen() {
+        isFullScreenAnimationOn = true;
+    }
+
+    private void windowDidEnterFullScreen() {
+        isFullScreenAnimationOn = false;
     }
 
-    private void updateWindowContent() {
-        if (target != null) {
-            ComponentEvent resizeEvent = new ComponentEvent(target, ComponentEvent.COMPONENT_RESIZED);
-            SunToolkit.postEvent(SunToolkit.targetToAppContext(target), resizeEvent);
-        }
+    private void windowWillExitFullScreen() {
+        isFullScreenAnimationOn = true;
     }
 
-    private void windowWillEnterFullScreen() {
-        updateWindowContent();
-    }
-    private void windowDidEnterFullScreen() {
-        updateDisplay();
+    private void windowDidExitFullScreen() {
+        isFullScreenAnimationOn = false;
     }
-    private void windowWillExitFullScreen() {
-        updateWindowContent();
-    }
-    private void windowDidExitFullScreen() {}
 }
--- a/src/macosx/classes/sun/lwawt/macosx/CPrinterDialogPeer.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/classes/sun/lwawt/macosx/CPrinterDialogPeer.java	Fri Jun 21 19:11:42 2013 -0700
@@ -41,7 +41,7 @@
     public CPrinterDialogPeer(CPrinterDialog target, PlatformComponent platformComponent,
                               PlatformWindow platformWindow)
     {
-        super(target, platformComponent, platformWindow);
+        super(target, platformComponent, platformWindow, LWWindowPeer.PeerType.DIALOG);
         //super(target);
         fTarget = target;
         super.initialize();
--- a/src/macosx/classes/sun/lwawt/macosx/CPrinterJob.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/classes/sun/lwawt/macosx/CPrinterJob.java	Fri Jun 21 19:11:42 2013 -0700
@@ -209,7 +209,6 @@
          * the end of the document. Note that firstPage
          * and lastPage are 0 based page indices.
          */
-        int numPages = mDocument.getNumberOfPages();
 
         int firstPage = getFirstPage();
         int lastPage = getLastPage();
@@ -226,38 +225,49 @@
                 userCancelled = false;
             }
 
-            if (EventQueue.isDispatchThread()) {
-                // This is an AWT EventQueue, and this print rendering loop needs to block it.
+            //Add support for PageRange
+            PageRanges pr = (attributes == null) ?  null
+                                                 : (PageRanges)attributes.get(PageRanges.class);
+            int[][] prMembers = (pr == null) ? new int[0][0] : pr.getMembers();
+            int loopi = 0;
+            do {
+                if (EventQueue.isDispatchThread()) {
+                    // This is an AWT EventQueue, and this print rendering loop needs to block it.
 
-                onEventThread = true;
+                    onEventThread = true;
 
-                try {
-                    // Fire off the print rendering loop on the AppKit thread, and don't have
-                    //  it wait and block this thread.
-                    if (printLoop(false, firstPage, lastPage)) {
-                        // Fire off the EventConditional that will what until the condition is met,
-                        //  but will still process AWTEvent's as they occur.
-                        new EventDispatchAccess() {
-                            public boolean evaluate() {
-                                return performingPrinting;
-                            }
-                        }.pumpEventsAndWait();
+                    try {
+                        // Fire off the print rendering loop on the AppKit thread, and don't have
+                        //  it wait and block this thread.
+                        if (printLoop(false, firstPage, lastPage)) {
+                            // Fire off the EventConditional that will what until the condition is met,
+                            //  but will still process AWTEvent's as they occur.
+                            new EventDispatchAccess() {
+                                public boolean evaluate() {
+                                    return performingPrinting;
+                                }
+                            }.pumpEventsAndWait();
+                        }
+                    } catch (Exception e) {
+                        e.printStackTrace();
                     }
-                } catch (Exception e) {
-                    e.printStackTrace();
+                } else {
+                    // Fire off the print rendering loop on the AppKit, and block this thread
+                    //  until it is done.
+                    // But don't actually block... we need to come back here!
+                    onEventThread = false;
+
+                    try {
+                        printLoop(true, firstPage, lastPage);
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
                 }
-            } else {
-                // Fire off the print rendering loop on the AppKit, and block this thread
-                //  until it is done.
-                // But don't actually block... we need to come back here!
-                onEventThread = false;
-
-                try {
-                    printLoop(true, firstPage, lastPage);
-                } catch (Exception e) {
-                    e.printStackTrace();
+                if (++loopi < prMembers.length) {
+                    firstPage = prMembers[loopi][0]-1;
+                    lastPage = prMembers[loopi][1] -1;
                 }
-            }
+              }  while (loopi < prMembers.length);
         } finally {
             synchronized (this) {
                 // NOTE: Native code shouldn't allow exceptions out while
--- a/src/macosx/classes/sun/lwawt/macosx/CRobot.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/classes/sun/lwawt/macosx/CRobot.java	Fri Jun 21 19:11:42 2013 -0700
@@ -65,7 +65,7 @@
         mouseLastX = x;
         mouseLastY = y;
 
-        mouseEvent(fDevice.getCoreGraphicsScreen(), mouseLastX, mouseLastY,
+        mouseEvent(fDevice.getCGDisplayID(), mouseLastX, mouseLastY,
                    mouseButtonsState, true, true);
     }
 
@@ -79,7 +79,7 @@
     public void mousePress(int buttons) {
         mouseButtonsState |= buttons;
 
-        mouseEvent(fDevice.getCoreGraphicsScreen(), mouseLastX, mouseLastY,
+        mouseEvent(fDevice.getCGDisplayID(), mouseLastX, mouseLastY,
                    buttons, true, false);
     }
 
@@ -93,7 +93,7 @@
     public void mouseRelease(int buttons) {
         mouseButtonsState &= ~buttons;
 
-        mouseEvent(fDevice.getCoreGraphicsScreen(), mouseLastX, mouseLastY,
+        mouseEvent(fDevice.getCGDisplayID(), mouseLastX, mouseLastY,
                    buttons, false, false);
     }
 
@@ -163,7 +163,7 @@
     }
 
     private native void initRobot();
-    private native void mouseEvent(int screen, int lastX, int lastY,
+    private native void mouseEvent(int displayID, int lastX, int lastY,
                                    int buttonsState,
                                    boolean isButtonsDownState,
                                    boolean isMouseMove);
--- a/src/macosx/classes/sun/lwawt/macosx/CToolkitThreadBlockedHandler.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/classes/sun/lwawt/macosx/CToolkitThreadBlockedHandler.java	Fri Jun 21 19:11:42 2013 -0700
@@ -25,33 +25,33 @@
 
 package sun.lwawt.macosx;
 
+import sun.awt.Mutex;
 import sun.awt.datatransfer.ToolkitThreadBlockedHandler;
 
-final class CToolkitThreadBlockedHandler implements ToolkitThreadBlockedHandler {
-    private final LWCToolkit toolkit =
-            java.awt.Toolkit.getDefaultToolkit() instanceof LWCToolkit
-                    ? (LWCToolkit)java.awt.Toolkit.getDefaultToolkit()
-                    : null;
+final class CToolkitThreadBlockedHandler extends Mutex implements ToolkitThreadBlockedHandler {
+    private long awtRunLoopMediator = 0;
+    private final boolean processEvents;
 
-    public void lock() {
-    }
-
-    public void unlock() {
-    }
-
-    protected boolean isOwned() {
-       return false;
+    CToolkitThreadBlockedHandler() {
+        super();
+        this.processEvents = true;
     }
 
     public void enter() {
-        // Despite the naming of this method, on MacOS only one
-        // event is read and dispatched before this method returns.
-        // This call is non-blocking and does not wait for an event
-        if (toolkit != null) {
-            toolkit.startNativeNestedEventLoop();
+        if (!isOwned()) {
+            throw new IllegalMonitorStateException();
         }
+        awtRunLoopMediator = LWCToolkit.createAWTRunLoopMediator();
+        unlock();
+        LWCToolkit.doAWTRunLoop(awtRunLoopMediator, processEvents);
+        lock();
     }
 
     public void exit() {
+        if (!isOwned()) {
+            throw new IllegalMonitorStateException();
+        }
+        LWCToolkit.stopAWTRunLoop(awtRunLoopMediator);
+        awtRunLoopMediator = 0;
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/macosx/classes/sun/lwawt/macosx/CViewEmbeddedFrame.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,102 @@
+/*
+ * 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.  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.lwawt.macosx;
+
+import java.awt.AWTKeyStroke;
+import java.awt.Toolkit;
+import java.lang.reflect.InvocationTargetException;
+import sun.awt.EmbeddedFrame;
+import sun.lwawt.LWToolkit;
+import sun.lwawt.LWWindowPeer;
+/*
+ * The CViewEmbeddedFrame class is used in the SWT_AWT bridge.
+ * This is a part of public API and should not be renamed or moved
+ */
+public class CViewEmbeddedFrame extends EmbeddedFrame {
+
+    private final long nsViewPtr;
+
+    private boolean isActive = false;
+
+    public CViewEmbeddedFrame(long nsViewPtr) {
+        this.nsViewPtr = nsViewPtr;
+    }
+
+    @SuppressWarnings("deprecation")
+    @Override
+    public void addNotify() {
+        if (getPeer() == null) {
+            LWToolkit toolkit = (LWToolkit) Toolkit.getDefaultToolkit();
+            setPeer(toolkit.createEmbeddedFrame(this));
+        }
+        super.addNotify();
+    }
+
+    public long getEmbedderHandle() {
+        return nsViewPtr;
+    }
+
+    @Override
+    public void registerAccelerator(AWTKeyStroke awtks) {
+    }
+
+    @Override
+    public void unregisterAccelerator(AWTKeyStroke awtks) {
+    }
+
+    public boolean isParentWindowActive() {
+        return isActive;
+    }
+
+    /*
+     * Synthetic event delivery for focus management
+     */
+    @Override
+    public void synthesizeWindowActivation(boolean activated) {
+        if (isActive != activated) {
+            isActive = activated;
+            ((LWWindowPeer)getPeer()).notifyActivation(activated, null);
+        }
+    }
+
+    /*
+     * Initializes the embedded frame bounds and validates a component.
+     * Designed to be called from the main thread
+     * This method should be called once from the initialization of the SWT_AWT Bridge
+     */
+    @SuppressWarnings("deprecation")
+    public void validateWithBounds(final int x, final int y, final int width, final int height) {
+        try {
+            LWCToolkit.invokeAndWait(new Runnable() {
+                @Override
+                public void run() {
+                    ((LWWindowPeer) getPeer()).setBoundsPrivate(0, 0, width, height);
+                    validate();
+                    setVisible(true);
+                }
+            }, null);
+        } catch (InterruptedException | InvocationTargetException ex) {}
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/macosx/classes/sun/lwawt/macosx/CViewPlatformEmbeddedFrame.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,225 @@
+/*
+ * 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.  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.lwawt.macosx;
+
+import java.awt.BufferCapabilities.FlipContents;
+import java.awt.Font;
+import java.awt.FontMetrics;
+import java.awt.Graphics;
+import java.awt.GraphicsDevice;
+import java.awt.Image;
+import java.awt.Insets;
+import java.awt.MenuBar;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.Transparency;
+import java.awt.Window;
+import sun.awt.CausedFocusEvent.Cause;
+import sun.java2d.SurfaceData;
+import sun.lwawt.LWWindowPeer;
+import sun.lwawt.PlatformWindow;
+
+public class CViewPlatformEmbeddedFrame implements PlatformWindow {
+
+    private CPlatformView view;
+    private LWWindowPeer peer;
+    private CViewEmbeddedFrame target;
+    private CPlatformResponder responder;
+
+    @Override // PlatformWindow
+    public void initialize(Window target, final LWWindowPeer peer, PlatformWindow owner) {
+        this.peer = peer;
+        this.target = (CViewEmbeddedFrame) target;
+        responder = new CPlatformResponder(peer, false);
+
+        view = new CPlatformView();
+        view.initialize(peer, responder);
+
+        CWrapper.NSView.addSubview(this.target.getEmbedderHandle(), view.getAWTView());
+        view.setAutoResizable(true);
+    }
+
+    public long getNSViewPtr() {
+        return view.getAWTView();
+    }
+
+    @Override
+    public long getLayerPtr() {
+        return view.getWindowLayerPtr();
+    }
+
+    @Override
+    public LWWindowPeer getPeer() {
+        return peer;
+    }
+
+    @Override
+    public void dispose() {
+        CWrapper.NSView.removeFromSuperview(view.getAWTView());
+        view.dispose();
+    }
+
+    @Override
+    public void setVisible(boolean visible) {
+        CWrapper.NSView.setHidden(view.getAWTView(), !visible);
+    }
+
+    @Override
+    public void setTitle(String title) {
+    }
+
+    @Override
+    public void setBounds(int x, int y, int w, int h) {
+        view.setBounds(x, y, w, h);
+        peer.notifyReshape(x, y, w, h);
+    }
+
+    @Override
+    public GraphicsDevice getGraphicsDevice() {
+        return view.getGraphicsDevice();
+    }
+
+    @Override
+    public Point getLocationOnScreen() {
+        return view.getLocationOnScreen();
+    }
+
+    @Override
+    public Insets getInsets() {
+        return new Insets(0, 0, 0, 0);
+    }
+
+    @Override
+    public FontMetrics getFontMetrics(Font f) {
+        throw new RuntimeException("Not implemented");
+    }
+
+    @Override
+    public SurfaceData getScreenSurface() {
+        return view.getSurfaceData();
+    }
+
+    @Override
+    public SurfaceData replaceSurfaceData() {
+        return view.replaceSurfaceData();
+    }
+
+    @Override
+    public void setModalBlocked(boolean blocked) {
+    }
+
+    @Override
+    public void toFront() {
+    }
+
+    @Override
+    public void toBack() {
+    }
+
+    @Override
+    public void setMenuBar(MenuBar mb) {
+    }
+
+    @Override
+    public void setAlwaysOnTop(boolean value) {
+    }
+
+    @Override
+    public void updateFocusableWindowState() {
+    }
+
+    @Override
+    public boolean rejectFocusRequest(Cause cause) {
+        return false;
+    }
+
+    @Override
+    public boolean requestWindowFocus() {
+        return true;
+    }
+
+    @Override
+    public boolean isActive() {
+        return target.isParentWindowActive();
+    }
+
+    @Override
+    public void setResizable(boolean resizable) {
+    }
+
+    @Override
+    public void setSizeConstraints(int minW, int minH, int maxW, int maxH) {
+    }
+
+    @Override
+    public Graphics transformGraphics(Graphics g) {
+        return g;
+    }
+
+    @Override
+    public void updateIconImages() {
+    }
+
+    @Override
+    public void setOpacity(float opacity) {
+    }
+
+    @Override
+    public void setOpaque(boolean isOpaque) {
+    }
+
+    @Override
+    public void enterFullScreenMode() {
+    }
+
+    @Override
+    public void exitFullScreenMode() {
+    }
+
+    @Override
+    public boolean isFullScreenMode() {
+        return false;
+    }
+
+    @Override
+    public void setWindowState(int windowState) {
+    }
+
+    @Override
+    public boolean isUnderMouse() {
+        return view.isUnderMouse();
+    }
+
+    @Override
+    public Image createBackBuffer() {
+        return view.createBackBuffer();
+    }
+
+    @Override
+    public void flip(int x1, int y1, int x2, int y2, FlipContents flipAction) {
+        throw new RuntimeException("Not implemented");
+    }
+}
--- a/src/macosx/classes/sun/lwawt/macosx/CWarningWindow.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/classes/sun/lwawt/macosx/CWarningWindow.java	Fri Jun 21 19:11:42 2013 -0700
@@ -31,7 +31,6 @@
 import sun.java2d.SunGraphics2D;
 import sun.java2d.SurfaceData;
 import sun.java2d.opengl.CGLLayer;
-import sun.java2d.opengl.OGLRenderQueue;
 import sun.lwawt.LWWindowPeer;
 import sun.lwawt.PlatformEventNotifier;
 import sun.lwawt.SecurityWarningWindow;
@@ -94,7 +93,7 @@
     }
 
     public CWarningWindow(final Window _ownerWindow, final LWWindowPeer _ownerPeer) {
-        super(LWWindowPeer.PeerType.SIMPLEWINDOW);
+        super();
 
         this.ownerPeer = new WeakReference<LWWindowPeer>(_ownerPeer);
         this.ownerWindow = _ownerWindow;
@@ -167,7 +166,7 @@
     }
 
     @Override
-    public void notifyExpose(int x, int y, int w, int h) {
+    public void notifyExpose(final Rectangle r) {
         repaint();
     }
 
@@ -180,7 +179,7 @@
     }
 
     @Override
-    public void notifyActivation(boolean activation) {
+    public void notifyActivation(boolean activation, LWWindowPeer opposite) {
     }
 
     @Override
@@ -275,7 +274,8 @@
         return styleBits;
     }
 
-    protected void deliverMoveResizeEvent(int x, int y, int width, int height) {
+    protected void deliverMoveResizeEvent(int x, int y, int width, int height,
+                                          boolean byUser) {
 
         boolean isResize;
         synchronized (lock) {
@@ -285,10 +285,9 @@
 
         if (isResize) {
             replaceSurface();
-            flushOnscreenGraphics();
         }
 
-        super.deliverMoveResizeEvent(x, y, width, height);
+        super.deliverMoveResizeEvent(x, y, width, height, byUser);
     }
 
     protected CPlatformResponder createPlatformResponder() {
@@ -380,16 +379,6 @@
         }
     }
 
-    private static final void flushOnscreenGraphics(){
-        final OGLRenderQueue rq = OGLRenderQueue.getInstance();
-        rq.lock();
-        try {
-            rq.flushNow();
-        } finally {
-            rq.unlock();
-        }
-    }
-
     private void replaceSurface() {
         SurfaceData oldData = contentView.getSurfaceData();
 
--- a/src/macosx/classes/sun/lwawt/macosx/CWrapper.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/classes/sun/lwawt/macosx/CWrapper.java	Fri Jun 21 19:11:42 2013 -0700
@@ -87,6 +87,7 @@
         public static native void exitFullScreenMode(long view);
 
         public static native void setToolTip(long view, String msg);
+        public static native void setHidden(long view, boolean hidden);
     }
 
     public static final class NSObject {
--- a/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java	Fri Jun 21 19:11:42 2013 -0700
@@ -54,7 +54,7 @@
 /**
  * Mac OS X Cocoa-based AWT Toolkit.
  */
-public class LWCToolkit extends LWToolkit {
+public final class LWCToolkit extends LWToolkit {
     // While it is possible to enumerate all mouse devices
     // and query them for the number of buttons, the code
     // that does it is rather complex. Instead, we opt for
@@ -64,17 +64,6 @@
 
     private static native void initIDs();
 
-    // On Mac OS we don't need to actually start the new event loop since there is
-    // a mechanic that allows us to just reschedule the next event in a native event loop
-    // for immediate execution and because this method is being called repeatedly we just
-    // executing one such event every time we call this method
-    static native void startNativeNestedEventLoop();
-
-    // Since we don't start an additional event loop this method is a no-op
-    // and shouldn't be called, left only for the better understanding of the concept on
-    // other OS'es
-    static native void stopNativeNestedEventLoop();
-
     private static CInputMethodDescriptor sInputMethodDescriptor;
 
     static {
@@ -160,12 +149,19 @@
            });
     }
 
+    public static LWCToolkit getLWCToolkit() {
+        return (LWCToolkit)Toolkit.getDefaultToolkit();
+    }
+
     @Override
     protected PlatformWindow createPlatformWindow(PeerType peerType) {
-        if (peerType == PeerType.EMBEDDEDFRAME) {
+        if (peerType == PeerType.EMBEDDED_FRAME) {
             return new CPlatformEmbeddedFrame();
+        } else if (peerType == PeerType.VIEW_EMBEDDED_FRAME) {
+            return new CViewPlatformEmbeddedFrame();
         } else {
-            return new CPlatformWindow(peerType);
+            assert (peerType == PeerType.SIMPLEWINDOW || peerType == PeerType.DIALOG || peerType == PeerType.FRAME);
+            return new CPlatformWindow();
         }
     }
 
@@ -293,7 +289,6 @@
         return new CMouseInfoPeer();
     }
 
-
     @Override
     protected int getScreenHeight() {
         return GraphicsEnvironment.getLocalGraphicsEnvironment()
@@ -348,28 +343,14 @@
 
     @Override
     public int getScreenResolution() throws HeadlessException {
-        return ((CGraphicsDevice) GraphicsEnvironment
-                .getLocalGraphicsEnvironment().getDefaultScreenDevice()).getScreenResolution();
+        return (int) ((CGraphicsDevice) GraphicsEnvironment
+                .getLocalGraphicsEnvironment().getDefaultScreenDevice())
+                .getXResolution();
     }
 
     @Override
     public Insets getScreenInsets(final GraphicsConfiguration gc) {
-        final CGraphicsConfig cgc = (CGraphicsConfig) gc;
-        final int displayId = cgc.getDevice().getCoreGraphicsScreen();
-        Rectangle fullScreen, workArea;
-        final long screen = CWrapper.NSScreen.screenByDisplayId(displayId);
-        try {
-            fullScreen = CWrapper.NSScreen.frame(screen).getBounds();
-            workArea = CWrapper.NSScreen.visibleFrame(screen).getBounds();
-        } finally {
-            CWrapper.NSObject.release(screen);
-        }
-        // Convert between Cocoa's coordinate system and Java.
-        int bottom = workArea.y - fullScreen.y;
-        int top = fullScreen.height - workArea.height - bottom;
-        int left = workArea.x - fullScreen.x;
-        int right = fullScreen.width - workArea.width - left;
-        return  new Insets(top, left, bottom, right);
+        return ((CGraphicsConfig) gc).getDevice().getScreenInsets();
     }
 
     @Override
@@ -422,7 +403,6 @@
         return BUTTONS;
     }
 
-
     @Override
     public boolean isTraySupported() {
         return true;
@@ -504,14 +484,6 @@
         synchronized(ret) { return ret[0]; }
     }
 
-    // Kicks an event over to the appropriate eventqueue and waits for it to finish
-    // To avoid deadlocking, we manually run the NSRunLoop while waiting
-    // Any selector invoked using ThreadUtilities performOnMainThread will be processed in doAWTRunLoop
-    // The CInvocationEvent will call LWCToolkit.stopAWTRunLoop() when finished, which will stop our manual runloop
-    public static void invokeAndWait(Runnable event, Component component) throws InterruptedException, InvocationTargetException {
-        invokeAndWait(event, component, true);
-    }
-
     public static <T> T invokeAndWait(final Callable<T> callable, Component component) throws Exception {
         final CallableWrapper<T> wrapper = new CallableWrapper<T>(callable);
         invokeAndWait(wrapper, component);
@@ -541,10 +513,27 @@
         }
     }
 
-    public static void invokeAndWait(Runnable event, Component component, boolean detectDeadlocks) throws InterruptedException, InvocationTargetException {
-        long mediator = createAWTRunLoopMediator();
+    // Kicks an event over to the appropriate eventqueue and waits for it to finish
+    // To avoid deadlocking, we manually run the NSRunLoop while waiting
+    // Any selector invoked using ThreadUtilities performOnMainThread will be processed in doAWTRunLoop
+    // The InvocationEvent will call LWCToolkit.stopAWTRunLoop() when finished, which will stop our manual runloop
+    // Does not dispatch native events while in the loop
+    public static void invokeAndWait(Runnable event, Component component) throws InterruptedException, InvocationTargetException {
+        final long mediator = createAWTRunLoopMediator();
 
-        InvocationEvent invocationEvent = new CPeerEvent(event, mediator);
+        InvocationEvent invocationEvent =
+                new InvocationEvent(component != null ? component : Toolkit.getDefaultToolkit(), event) {
+                    @Override
+                    public void dispatch() {
+                        try {
+                            super.dispatch();
+                        } finally {
+                            if (mediator != 0) {
+                                stopAWTRunLoop(mediator);
+                            }
+                        }
+                    }
+                };
 
         if (component != null) {
             AppContext appContext = SunToolkit.targetToAppContext(component);
@@ -557,7 +546,7 @@
             ((LWCToolkit)Toolkit.getDefaultToolkit()).getSystemEventQueueForInvokeAndWait().postEvent(invocationEvent);
         }
 
-        doAWTRunLoop(mediator, true, detectDeadlocks);
+        doAWTRunLoop(mediator, false);
 
         Throwable eventException = invocationEvent.getException();
         if (eventException != null) {
@@ -569,7 +558,8 @@
     }
 
     public static void invokeLater(Runnable event, Component component) throws InvocationTargetException {
-        final InvocationEvent invocationEvent = new CPeerEvent(event, 0);
+        final InvocationEvent invocationEvent =
+                new InvocationEvent(component != null ? component : Toolkit.getDefaultToolkit(), event);
 
         if (component != null) {
             final AppContext appContext = SunToolkit.targetToAppContext(component);
@@ -674,31 +664,6 @@
         return false;
     }
 
-    // Extends PeerEvent because we want to pass long an ObjC mediator object and because we want these events to be posted early
-    // Typically, rather than relying on the notifier to call notifyAll(), we use the mediator to stop the runloop
-    public static class CPeerEvent extends PeerEvent {
-        private long _mediator = 0;
-
-        public CPeerEvent(Runnable runnable, long mediator) {
-            super(Toolkit.getDefaultToolkit(), runnable, null, true, 0);
-            _mediator = mediator;
-        }
-
-        public void dispatch() {
-            try {
-                super.dispatch();
-            } finally {
-                if (_mediator != 0) {
-                    LWCToolkit.stopAWTRunLoop(_mediator);
-                }
-            }
-        }
-    }
-
-    // Call through to native methods
-    public static void doAWTRunLoop(long mediator, boolean awtMode) { doAWTRunLoop(mediator, awtMode, true); }
-    public static void doAWTRunLoop(long mediator) { doAWTRunLoop(mediator, true); }
-
     private static Boolean sunAwtDisableCALayers = null;
 
     /**
@@ -723,12 +688,20 @@
      * Native methods section
      ************************/
 
-    // These are public because they are accessed from WebKitPluginObject in JavaDeploy
-    // Basic usage:
-    // createAWTRunLoopMediator. Start client code on another thread. doAWTRunLoop. When client code is finished, stopAWTRunLoop.
-    public static native long createAWTRunLoopMediator();
-    public static native void doAWTRunLoop(long mediator, boolean awtMode, boolean detectDeadlocks);
-    public static native void stopAWTRunLoop(long mediator);
+    static native long createAWTRunLoopMediator();
+    /**
+     * Method to run a nested run-loop. The nested loop is spinned in the javaRunLoop mode, so selectors sent
+     * by [JNFRunLoop performOnMainThreadWaiting] are processed.
+     * @param mediator a native pointer to the mediator object created by createAWTRunLoopMediator
+     * @param processEvents if true - dispatches event while in the nested loop. Used in DnD.
+     *                      Additional attention is needed when using this feature as we short-circuit normal event
+     *                      processing which could break Appkit.
+     *                      (One known example is when the window is resized with the mouse)
+     *
+     *                      if false - all events come after exit form the nested loop
+     */
+    static native void doAWTRunLoop(long mediator, boolean processEvents);
+    static native void stopAWTRunLoop(long mediator);
 
     private native boolean nativeSyncQueue(long timeout);
 
@@ -757,6 +730,11 @@
     }
 
     @Override
+    public boolean isWindowShapingSupported() {
+        return true;
+    }
+
+    @Override
     public boolean isWindowTranslucencySupported() {
         return true;
     }
@@ -766,6 +744,10 @@
         return true;
     }
 
+    public boolean isSwingBackbufferTranslucencySupported() {
+        return true;
+    }
+
     @Override
     public boolean enableInputMethodsForTextComponent() {
         return true;
--- a/src/macosx/classes/sun/nio/ch/KQueueArrayWrapper.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/classes/sun/nio/ch/KQueueArrayWrapper.java	Fri Jun 21 19:11:42 2013 -0700
@@ -34,7 +34,8 @@
 import sun.misc.*;
 import java.io.IOException;
 import java.io.FileDescriptor;
-
+import java.util.Iterator;
+import java.util.LinkedList;
 
 /*
  * struct kevent {           // 32-bit    64-bit
@@ -99,6 +100,18 @@
         kq = init();
     }
 
+    // Used to update file description registrations
+    private static class Update {
+        SelChImpl channel;
+        int events;
+        Update(SelChImpl channel, int events) {
+            this.channel = channel;
+            this.events = events;
+        }
+    }
+
+    private LinkedList<Update> updateList = new LinkedList<Update>();
+
     void initInterrupt(int fd0, int fd1) {
         outgoingInterruptFD = fd1;
         incomingInterruptFD = fd0;
@@ -136,14 +149,41 @@
         }
     }
 
-    void setInterest(int fd, int events) {
-        register0(kq, fd, events & POLLIN, events & POLLOUT);
+    void setInterest(SelChImpl channel, int events) {
+        synchronized (updateList) {
+            // update existing registration
+            updateList.add(new Update(channel, events));
+        }
     }
 
-    void release(int fd) {
-        register0(kq, fd, 0, 0);
+    void release(SelChImpl channel) {
+        synchronized (updateList) {
+            // flush any pending updates
+            for (Iterator<Update> it = updateList.iterator(); it.hasNext();) {
+                if (it.next().channel == channel) {
+                    it.remove();
+                }
+            }
+
+            // remove
+            register0(kq, channel.getFDVal(), 0, 0);
+        }
     }
 
+    void updateRegistrations() {
+        synchronized (updateList) {
+            Update u = null;
+            while ((u = updateList.poll()) != null) {
+                SelChImpl ch = u.channel;
+                if (!ch.isOpen())
+                    continue;
+
+                register0(kq, ch.getFDVal(), u.events & POLLIN, u.events & POLLOUT);
+            }
+        }
+    }
+
+
     void close() throws IOException {
         if (keventArray != null) {
             keventArray.free();
@@ -156,6 +196,7 @@
     }
 
     int poll(long timeout) {
+        updateRegistrations();
         int updated = kevent0(kq, keventArrayAddress, NUM_KEVENTS, timeout);
         return updated;
     }
@@ -172,4 +213,3 @@
                                long timeout);
     private static native void interrupt(int fd);
 }
-
--- a/src/macosx/classes/sun/nio/ch/KQueueSelectorImpl.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/classes/sun/nio/ch/KQueueSelectorImpl.java	Fri Jun 21 19:11:42 2013 -0700
@@ -184,7 +184,6 @@
             FileDispatcherImpl.closeIntFD(fd0);
             FileDispatcherImpl.closeIntFD(fd1);
             if (kqueueWrapper != null) {
-                kqueueWrapper.release(fd0);
                 kqueueWrapper.close();
                 kqueueWrapper = null;
                 selectedKeys = null;
@@ -220,7 +219,7 @@
     protected void implDereg(SelectionKeyImpl ski) throws IOException {
         int fd = ski.channel.getFDVal();
         fdMap.remove(Integer.valueOf(fd));
-        kqueueWrapper.release(fd);
+        kqueueWrapper.release(ski.channel);
         totalChannels--;
         keys.remove(ski);
         selectedKeys.remove(ski);
@@ -234,8 +233,7 @@
     public void putEventOps(SelectionKeyImpl ski, int ops) {
         if (closed)
             throw new ClosedSelectorException();
-        int fd = IOUtil.fdVal(ski.channel.getFD());
-        kqueueWrapper.setInterest(fd, ops);
+        kqueueWrapper.setInterest(ski.channel, ops);
     }
 
 
@@ -254,4 +252,3 @@
         Util.load();
     }
 }
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/macosx/javavm/export/jawt_md.h	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,110 @@
+/*
+ * Copyright (c) 1999, 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.
+ */
+
+#ifndef _JAVASOFT_JAWT_MD_H_
+#define _JAVASOFT_JAWT_MD_H_
+
+/*
+ * To use jawt_X11DrawingSurfaceInfo you must define XAWT before including this header
+ * file. You must also have the X11 headers installed on your system.
+ */
+#ifdef XAWT
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <X11/Intrinsic.h>
+#endif // XAWT
+
+#include "jawt.h"
+
+#ifdef __OBJC__
+#import <QuartzCore/CALayer.h>
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Mac OS X specific declarations for AWT native interface.
+ * See notes in jawt.h for an example of use.
+ */
+
+/*
+ * When calling JAWT_GetAWT with a JAWT version less than 1.7, you must pass this
+ * flag or you will not be able to get a valid drawing surface and JAWT_GetAWT will
+ * return false. This is to maintain compatibility with applications that used the
+ * interface with Java 6 which had multiple rendering models. This flag is not necessary
+ * when JAWT version 1.7 or greater is used as this is the only supported rendering mode.
+ *
+ * Example:
+ *   JAWT awt;
+ *   awt.version = JAWT_VERSION_1_4 | JAWT_MACOSX_USE_CALAYER;
+ *   jboolean success = JAWT_GetAWT(env, &awt);
+ */
+#define JAWT_MACOSX_USE_CALAYER 0x80000000
+
+/*
+ * When the native Cocoa toolkit is in use, the pointer stored in
+ * JAWT_DrawingSurfaceInfo->platformInfo points to a NSObject that conforms to the
+ * JAWT_SurfaceLayers protocol. Setting the layer property of this object will cause the
+ * specified layer to be overlaid on the Components rectangle. If the window the
+ * Component belongs to has a CALayer attached to it, this layer will be accessible via
+ * the windowLayer property.
+ */
+#ifdef __OBJC__
+@protocol JAWT_SurfaceLayers
+@property (readwrite, retain) CALayer *layer;
+@property (readonly) CALayer *windowLayer;
+@end
+#endif
+
+#ifdef XAWT
+/*
+ * X11-specific declarations for AWT native interface.
+ * See notes in jawt.h for an example of use.
+ *
+ * WARNING: This interface is deprecated and will be removed in a future release.
+ */
+typedef struct jawt_X11DrawingSurfaceInfo {
+    Drawable drawable;
+    Display* display;
+    VisualID visualID;
+    Colormap colormapID;
+    int depth;
+    /*
+     * Since 1.4
+     * Returns a pixel value from a set of RGB values.
+     * This is useful for paletted color (256 color) modes.
+     */
+    int (JNICALL *GetAWTColor)(JAWT_DrawingSurface* ds,
+        int r, int g, int b);
+} JAWT_X11DrawingSurfaceInfo;
+#endif // XAWT
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !_JAVASOFT_JAWT_MD_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/macosx/javavm/export/jni_md.h	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,41 @@
+/*
+ * 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.
+ */
+
+#ifndef _JAVASOFT_JNI_MD_H_
+#define _JAVASOFT_JNI_MD_H_
+
+#define JNIEXPORT
+#define JNIIMPORT
+#define JNICALL
+
+typedef int jint;
+#ifdef _LP64 /* 64-bit */
+typedef long jlong;
+#else
+typedef long long jlong;
+#endif
+typedef signed char jbyte;
+
+#endif /* !_JAVASOFT_JNI_MD_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/macosx/javavm/export/jvm_md.h	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 1997, 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 _JAVASOFT_JVM_MD_H_
+#define _JAVASOFT_JVM_MD_H_
+
+/*
+ * This file is currently collecting Mac OS X specific dregs for the
+ * JNI conversion, which should be sorted out later.
+ */
+
+#include <dirent.h>             /* For DIR */
+#include <sys/param.h>          /* For MAXPATHLEN */
+#include <unistd.h>             /* For F_OK, R_OK, W_OK */
+#include <stddef.h>             /* For ptrdiff_t */
+#include <stdint.h>             /* For uintptr_t */
+
+#define JNI_ONLOAD_SYMBOLS   {"JNI_OnLoad"}
+#define JNI_ONUNLOAD_SYMBOLS {"JNI_OnUnload"}
+
+#define JNI_LIB_PREFIX "lib"
+#define JNI_LIB_SUFFIX ".dylib"
+#define VERSIONED_JNI_LIB_NAME(NAME, VERSION) JNI_LIB_PREFIX NAME "." VERSION JNI_LIB_SUFFIX
+#define JNI_LIB_NAME(NAME) JNI_LIB_PREFIX NAME JNI_LIB_SUFFIX
+
+#define JVM_MAXPATHLEN MAXPATHLEN
+
+#define JVM_R_OK    R_OK
+#define JVM_W_OK    W_OK
+#define JVM_X_OK    X_OK
+#define JVM_F_OK    F_OK
+
+/*
+ * File I/O
+ */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <sys/signal.h>
+
+/* O Flags */
+
+#define JVM_O_RDONLY     O_RDONLY
+#define JVM_O_WRONLY     O_WRONLY
+#define JVM_O_RDWR       O_RDWR
+#define JVM_O_O_APPEND   O_APPEND
+#define JVM_O_EXCL       O_EXCL
+#define JVM_O_CREAT      O_CREAT
+#define JVM_O_DELETE     0x10000
+
+/* Signals */
+
+#define JVM_SIGINT     SIGINT
+#define JVM_SIGTERM    SIGTERM
+
+
+#endif /* !_JAVASOFT_JVM_MD_H_ */
--- a/src/macosx/native/com/apple/laf/JRSUIController.m	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/native/com/apple/laf/JRSUIController.m	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -199,6 +199,7 @@
     CGColorSpaceRef colorspace = CGColorSpaceCreateDeviceRGB();
     CGContextRef cgRef = CGBitmapContextCreate(rawPixelData, imgW, imgH, 8, imgW * 4, colorspace, kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host);
     CGColorSpaceRelease(colorspace);
+    CGContextScaleCTM(cgRef, imgW/w , imgH/h);
 
     jint status = doPaintCGContext(cgRef, controlPtr, oldProperties, newProperties, x, y, w, h);
     CGContextRelease(cgRef);
--- a/src/macosx/native/java/util/MacOSXPreferencesFile.m	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/native/java/util/MacOSXPreferencesFile.m	Fri Jun 21 19:11:42 2013 -0700
@@ -641,7 +641,7 @@
 
 
 // child must end with '/'
-JNIEXPORT void JNICALL
+JNIEXPORT Boolean JNICALL
 Java_java_util_prefs_MacOSXPreferencesFile_addChildToNode
 (JNIEnv *env, jobject klass, jobject jpath, jobject jchild,
  jobject jname, jlong juser, jlong jhost)
@@ -656,6 +656,7 @@
     CFDictionaryRef node;
     CFStringRef topKey;
     CFMutableDictionaryRef topValue;
+    Boolean beforeAdd = false;
 
     if (!path  ||  !child  ||  !name) goto badparams;
 
@@ -665,9 +666,12 @@
     // copyMutableNode creates the node if necessary
     parent = copyMutableNode(path, name, user, host, &topKey, &topValue);
     throwIfNull(parent, "copyMutableNode failed");
-
+    beforeAdd = CFDictionaryContainsKey(parent, child);
     CFDictionaryAddValue(parent, child, node);
-
+    if (!beforeAdd)
+        beforeAdd = CFDictionaryContainsKey(parent, child);
+    else
+        beforeAdd = false;
     CFPreferencesSetValue(topKey, topValue, name, user, host);
 
     CFRelease(parent);
@@ -680,6 +684,7 @@
     if (path) CFRelease(path);
     if (child) CFRelease(child);
     if (name) CFRelease(name);
+    return beforeAdd;
 }
 
 
--- a/src/macosx/native/sun/awt/AWTEvent.h	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/native/sun/awt/AWTEvent.h	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -35,5 +35,6 @@
 jint GetJavaMouseModifiers(NSInteger button, NSUInteger modifierFlags);
 jint NsKeyModifiersToJavaModifiers(NSUInteger nsFlags, BOOL isExtMods);
 NSUInteger JavaModifiersToNsKeyModifiers(jint javaModifiers, BOOL isExtMods);
+unichar NsCharToJavaChar(unichar nsChar, NSUInteger modifiers);
 
 #endif /* __AWTEVENT_H */
--- a/src/macosx/native/sun/awt/AWTEvent.m	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/native/sun/awt/AWTEvent.m	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -26,6 +26,7 @@
 #import <JavaNativeFoundation/JavaNativeFoundation.h>
 #import <JavaRuntimeSupport/JavaRuntimeSupport.h>
 #import <sys/time.h>
+#include <Carbon/Carbon.h>
 
 #import "LWCToolkit.h"
 #import "ThreadUtilities.h"
@@ -340,8 +341,7 @@
     {0, 0, 0}
 };
 
-static unichar
-NsCharToJavaChar(unichar nsChar, NSUInteger modifiers)
+unichar NsCharToJavaChar(unichar nsChar, NSUInteger modifiers)
 {
     const struct _char *cur;
     // Mask off just the keyboard modifiers from the event modifier mask.
@@ -378,26 +378,68 @@
     return nsChar;
 }
 
+static unichar NsGetDeadKeyChar(unsigned short keyCode)
+{
+    TISInputSourceRef currentKeyboard = TISCopyCurrentKeyboardInputSource();
+    CFDataRef uchr = (CFDataRef)TISGetInputSourceProperty(currentKeyboard, kTISPropertyUnicodeKeyLayoutData);
+    if (uchr == nil) { return; }
+    const UCKeyboardLayout *keyboardLayout = (const UCKeyboardLayout*)CFDataGetBytePtr(uchr);
+    // Carbon modifiers should be used instead of NSEvent modifiers
+    UInt32 modifierKeyState = (GetCurrentEventKeyModifiers() >> 8) & 0xFF;
+
+    if (keyboardLayout) {
+        UInt32 deadKeyState = 0;
+        UniCharCount maxStringLength = 255;
+        UniCharCount actualStringLength = 0;
+        UniChar unicodeString[maxStringLength];
+
+        // get the deadKeyState
+        OSStatus status = UCKeyTranslate(keyboardLayout,
+                                         keyCode, kUCKeyActionDown, modifierKeyState,
+                                         LMGetKbdType(), kUCKeyTranslateNoDeadKeysBit,
+                                         &deadKeyState,
+                                         maxStringLength,
+                                         &actualStringLength, unicodeString);
+
+        if (status == noErr && deadKeyState != 0) {
+            // Press SPACE to get the dead key char
+            status = UCKeyTranslate(keyboardLayout,
+                                    kVK_Space, kUCKeyActionDown, 0,
+                                    LMGetKbdType(), 0,
+                                    &deadKeyState,
+                                    maxStringLength,
+                                    &actualStringLength, unicodeString);
+
+            if (status == noErr && actualStringLength > 0) {
+                return unicodeString[0];
+            }
+        }
+    }
+    return 0;
+}
+
 /*
  * This is the function that uses the table above to take incoming
  * NSEvent keyCodes and translate to the Java virtual key code.
  */
 static void
-NsCharToJavaVirtualKeyCode(unichar ch, unichar deadChar,
+NsCharToJavaVirtualKeyCode(unichar ch, BOOL isDeadChar,
                            NSUInteger flags, unsigned short key,
-                           jint *keyCode, jint *keyLocation, BOOL *postsTyped)
+                           jint *keyCode, jint *keyLocation, BOOL *postsTyped, unichar *deadChar)
 {
     static size_t size = sizeof(keyTable) / sizeof(struct _key);
     NSInteger offset;
 
-    if (deadChar) {
+    if (isDeadChar) {
+        unichar testDeadChar = NsGetDeadKeyChar(key);
         const struct CharToVKEntry *map;
         for (map = charToDeadVKTable; map->c != 0; ++map) {
-            if (deadChar == map->c) {
+            if (testDeadChar == map->c) {
                 *keyCode = map->javaKey;
                 *postsTyped = NO;
                 // TODO: use UNKNOWN here?
                 *keyLocation = java_awt_event_KeyEvent_KEY_LOCATION_UNKNOWN;
+                *deadChar = testDeadChar;
                 return;
             }
         }
@@ -521,18 +563,18 @@
     const struct _nsKeyToJavaModifier* cur;
 
     for (cur = nsKeyToJavaModifierTable; cur->nsMask != 0; ++cur) {
-        jint mask = isExtMods? cur->javaExtMask : cur->javaMask; 
+        jint mask = isExtMods? cur->javaExtMask : cur->javaMask;
         if ((mask & javaModifiers) != 0) {
             nsFlags |= cur->nsMask;
         }
     }
 
     // special case
-    jint mask = isExtMods? java_awt_event_InputEvent_ALT_GRAPH_DOWN_MASK : 
+    jint mask = isExtMods? java_awt_event_InputEvent_ALT_GRAPH_DOWN_MASK :
                            java_awt_event_InputEvent_ALT_GRAPH_MASK;
 
     if ((mask & javaModifiers) != 0) {
-        nsFlags |= NSAlternateKeyMask;      
+        nsFlags |= NSAlternateKeyMask;
     }
 
     return nsFlags;
@@ -691,14 +733,10 @@
         }
 
         javaModifiers = NsKeyModifiersToJavaModifiers([event modifierFlags], TRUE);
-        if (javaModifiers == 0) {
-      // TODO: dead key chars
-//            testDeadChar = GetDeadKeyCharacter(event);
-        }
 
-        NsCharToJavaVirtualKeyCode(testChar, testDeadChar,
+        NsCharToJavaVirtualKeyCode(testChar, NO,
                                    [event modifierFlags], [event keyCode],
-                                   &javaKeyCode, &javaKeyLocation, &postsTyped);
+                                   &javaKeyCode, &javaKeyLocation, &postsTyped, &testDeadChar);
         if( !postsTyped ) {
             testChar = java_awt_event_KeyEvent_CHAR_UNDEFINED;
         }
@@ -823,18 +861,14 @@
     unichar testChar, testDeadChar = 0;
     jint javaModifiers = NsKeyModifiersToJavaModifiers([nsEvent modifierFlags], TRUE);
 
-    if (javaModifiers == 0) {
-        testDeadChar = [nsEvent deadKeyCharacter];
-    }
-
     NSString *theChars = [nsEvent characters];
     unsigned i, stringLength = [theChars length];
 
     for (i = 0; i < stringLength; i++) {
         testChar = [theChars characterAtIndex:i];
-        NsCharToJavaVirtualKeyCode(testChar, testDeadChar,
+        NsCharToJavaVirtualKeyCode(testChar, NO,
                                    [nsEvent modifierFlags], [nsEvent keyCode],
-                                   &javaKeyCode, &javaKeyLocation, &postsTyped);
+                                   &javaKeyCode, &javaKeyLocation, &postsTyped, &testDeadChar);
 
         if (postsTyped) {
             // Some keys may generate a KEY_TYPED, but we can't determine
@@ -1042,23 +1076,25 @@
 
     // in  = [testChar, testDeadChar, modifierFlags, keyCode]
     jchar testChar = (jchar)data[0];
-    jchar testDeadChar = (jchar)data[1];
+    BOOL isDeadChar = (data[1] != 0);
     jint modifierFlags = data[2];
     jshort keyCode = (jshort)data[3];
 
     jint jkeyCode = java_awt_event_KeyEvent_VK_UNDEFINED;
     jint jkeyLocation = java_awt_event_KeyEvent_KEY_LOCATION_UNKNOWN;
+    jchar testDeadChar = 0;
 
-    NsCharToJavaVirtualKeyCode((unichar)testChar, (unichar)testDeadChar,
+    NsCharToJavaVirtualKeyCode((unichar)testChar, isDeadChar,
                                (NSUInteger)modifierFlags, (unsigned short)keyCode,
-                               &jkeyCode, &jkeyLocation, &postsTyped);
+                               &jkeyCode, &jkeyLocation, &postsTyped, &testDeadChar);
 
-    // out = [jkeyCode, jkeyLocation];
+    // out = [jkeyCode, jkeyLocation, deadKeyChar];
     (*env)->SetIntArrayRegion(env, outData, 0, 1, &jkeyCode);
     (*env)->SetIntArrayRegion(env, outData, 1, 1, &jkeyLocation);
-    
+    (*env)->SetIntArrayRegion(env, outData, 2, 1, (jint *)&testDeadChar);
+
     (*env)->ReleaseIntArrayElements(env, inData, data, 0);
-    
+
 JNF_COCOA_EXIT(env);
 
     return postsTyped;
@@ -1098,7 +1134,7 @@
     (*env)->SetIntArrayRegion(env, outData, 2, 1, &jkeyType);
 
     (*env)->ReleaseIntArrayElements(env, inData, data, 0);
-    
+
 JNF_COCOA_EXIT(env);
 }
 
@@ -1112,12 +1148,12 @@
 (JNIEnv *env, jclass cls, char nsChar, jint modifierFlags)
 {
     jchar javaChar = 0;
-    
+
 JNF_COCOA_ENTER(env);
-    
+
     javaChar = NsCharToJavaChar(nsChar, modifierFlags);
 
 JNF_COCOA_EXIT(env);
-    
+
     return javaChar;
 }
--- a/src/macosx/native/sun/awt/AWTSurfaceLayers.h	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/native/sun/awt/AWTSurfaceLayers.h	Fri Jun 21 19:11:42 2013 -0700
@@ -23,8 +23,7 @@
  * questions.
  */
 
-// REMIND: import <jawt_md.h>
-#import <JavaVM/jawt_md.h>
+#import <jawt_md.h>
 
 /*
  * The CALayer-based rendering model returns an object conforming
--- a/src/macosx/native/sun/awt/AWTSurfaceLayers.m	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/native/sun/awt/AWTSurfaceLayers.m	Fri Jun 21 19:11:42 2013 -0700
@@ -78,11 +78,10 @@
 
     // translates values to the coordinate system of the "root" layer
     CGFloat newY = windowLayer.bounds.size.height - rect.origin.y - rect.size.height;
+    CGRect newRect = CGRectMake(rect.origin.x, newY, rect.size.width, rect.size.height);
 
-    // REMIND: why do we need to inverse position?
-    CGRect newRect = CGRectMake(-rect.origin.x, -newY, rect.size.width, rect.size.height);
+    layer.frame = newRect;
 
-    layer.bounds = newRect;
     [AWTSurfaceLayers repaintLayersRecursively:layer];
 }
 
@@ -100,17 +99,15 @@
   __block AWTSurfaceLayers *surfaceLayers = nil;
 
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
-  [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
-      AWT_ASSERT_APPKIT_THREAD;
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
 
-      CALayer *windowLayer = jlong_to_ptr(windowLayerPtr);
-      surfaceLayers = [[AWTSurfaceLayers alloc] initWithWindowLayer: windowLayer];
-      CFRetain(surfaceLayers);
-      [surfaceLayers release];
+        CALayer *windowLayer = jlong_to_ptr(windowLayerPtr);
+        surfaceLayers = [[AWTSurfaceLayers alloc] initWithWindowLayer: windowLayer];
+        CFRetain(surfaceLayers);
+        [surfaceLayers release];
     }];
-
+    
 JNF_COCOA_EXIT(env);
 
   return ptr_to_jlong(surfaceLayers);
@@ -127,12 +124,12 @@
 JNF_COCOA_ENTER(env);
 
   AWTSurfaceLayers *surfaceLayers = OBJC(surfaceLayersPtr);
-  [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
-      AWT_ASSERT_APPKIT_THREAD;
+    
+  [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
 
       CGRect rect = CGRectMake(x, y, width, height);
       [surfaceLayers setBounds: rect];
-    }];
+  }];
 
 JNF_COCOA_EXIT(env);
 }
--- a/src/macosx/native/sun/awt/AWTView.m	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/native/sun/awt/AWTView.m	Fri Jun 21 19:11:42 2013 -0700
@@ -85,11 +85,14 @@
 
     if (windowLayer != nil) {
         self.cglLayer = windowLayer;
+        //Layer hosting view
+        [self setLayer: cglLayer];
         [self setWantsLayer: YES];
-        [self.layer addSublayer: (CALayer *)cglLayer];
-        [self setLayerContentsRedrawPolicy: NSViewLayerContentsRedrawDuringViewResize];
-        [self setLayerContentsPlacement: NSViewLayerContentsPlacementTopLeft];
-        [self setAutoresizingMask: NSViewHeightSizable | NSViewWidthSizable];
+        //Layer backed view
+        //[self.layer addSublayer: (CALayer *)cglLayer];
+        //[self setLayerContentsRedrawPolicy: NSViewLayerContentsRedrawDuringViewResize];
+        //[self setLayerContentsPlacement: NSViewLayerContentsPlacementTopLeft];
+        //[self setAutoresizingMask: NSViewHeightSizable | NSViewWidthSizable];
 
 #ifdef REMOTELAYER
         CGLLayer *parentLayer = (CGLLayer*)self.cglLayer;
@@ -170,6 +173,11 @@
  * Automatically triggered functions.
  */
 
+- (void)resizeWithOldSuperviewSize:(NSSize)oldBoundsSize {
+    [super resizeWithOldSuperviewSize: oldBoundsSize];
+    [self deliverResize: [self frame]];
+}
+
 /*
  * MouseEvents support
  */
@@ -217,7 +225,7 @@
 
 - (void) mouseMoved: (NSEvent *)event {
     // TODO: better way to redirect move events to the "under" view
-
+    
     NSPoint eventLocation = [event locationInWindow];
     NSPoint localPoint = [self convertPoint: eventLocation fromView: nil];
 
@@ -278,7 +286,10 @@
         return;
     }
 
-    if (![self hasMarkedText] && fKeyEventsNeeded) {
+    NSString *eventCharacters = [event characters];
+    BOOL isDeadKey = (eventCharacters != nil && [eventCharacters length] == 0);
+
+    if ((![self hasMarkedText] && fKeyEventsNeeded) || isDeadKey) {
         [self deliverJavaKeyEventHelper: event];
     }
 
@@ -430,6 +441,18 @@
     }
 }
 
+-(void) deliverResize: (NSRect) rect {
+    jint x = (jint) rect.origin.x;
+    jint y = (jint) rect.origin.y;
+    jint w = (jint) rect.size.width;
+    jint h = (jint) rect.size.height;
+    JNIEnv *env = [ThreadUtilities getJNIEnv];
+    static JNF_CLASS_CACHE(jc_PlatformView, "sun/lwawt/macosx/CPlatformView");
+    static JNF_MEMBER_CACHE(jm_deliverResize, jc_PlatformView, "deliverResize", "(IIII)V");
+    JNFCallVoidMethod(env, m_cPlatformView, jm_deliverResize, x,y,w,h);
+}
+
+
 - (void) drawRect:(NSRect)dirtyRect {
 AWT_ASSERT_APPKIT_THREAD;
 
@@ -643,7 +666,7 @@
 
 - (void) setDropTarget:(CDropTarget *)target {
     self._dropTarget = target;
-    [ThreadUtilities performOnMainThread:@selector(controlModelControlValid) onObject:self._dropTarget withObject:nil waitUntilDone:YES awtMode:YES];
+    [ThreadUtilities performOnMainThread:@selector(controlModelControlValid) on:self._dropTarget withObject:nil waitUntilDone:YES];
 }
 
 /********************************  BEGIN NSDraggingSource Interface  ********************************/
@@ -1190,7 +1213,7 @@
     fprintf(stderr, "AWTView InputMethod Selector Called : [abandonInput]\n");
 #endif // IM_DEBUG
 
-    [ThreadUtilities performOnMainThread:@selector(markedTextAbandoned:) onObject:[NSInputManager currentInputManager] withObject:self waitUntilDone:YES awtMode:YES];
+    [ThreadUtilities performOnMainThread:@selector(markedTextAbandoned:) on:[NSInputManager currentInputManager] withObject:self waitUntilDone:YES];
     [self unmarkText];
 }
 
@@ -1213,13 +1236,11 @@
     __block AWTView *newView = nil;
 
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
     NSRect rect = NSMakeRect(originX, originY, width, height);
     jobject cPlatformView = (*env)->NewGlobalRef(env, obj);
 
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
 
         CALayer *windowLayer = jlong_to_ptr(windowLayerPtr);
         AWTView *view = [[AWTView alloc] initWithRect:rect
@@ -1227,7 +1248,6 @@
                                          windowLayer:windowLayer];
         CFRetain(view);
         [view release]; // GC
-
         newView = view;
     }];
 
@@ -1238,6 +1258,96 @@
 
 /*
  * Class:     sun_lwawt_macosx_CPlatformView
+ * Method:    nativeSetAutoResizable
+ * Signature: (JZ)V;
+ */
+
+JNIEXPORT void JNICALL
+Java_sun_lwawt_macosx_CPlatformView_nativeSetAutoResizable
+(JNIEnv *env, jclass cls, jlong viewPtr, jboolean toResize)
+{
+JNF_COCOA_ENTER(env);
+    
+    NSView *view = (NSView *)jlong_to_ptr(viewPtr);    
+
+   [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
+
+       if (toResize) {
+           [view setAutoresizingMask: NSViewHeightSizable | NSViewWidthSizable];
+       } else {
+           [view setAutoresizingMask: NSViewMinYMargin | NSViewMaxXMargin];
+       }
+       
+       if ([view superview] != nil) {
+           [[view superview] setAutoresizesSubviews:(BOOL)toResize];
+       }
+       
+    }];
+JNF_COCOA_EXIT(env);
+}
+
+/*
+ * Class:     sun_lwawt_macosx_CPlatformView
+ * Method:    nativeGetNSViewDisplayID
+ * Signature: (J)I;
+ */
+
+JNIEXPORT jint JNICALL
+Java_sun_lwawt_macosx_CPlatformView_nativeGetNSViewDisplayID
+(JNIEnv *env, jclass cls, jlong viewPtr)
+{
+    __block jint ret; //CGDirectDisplayID
+    
+JNF_COCOA_ENTER(env);
+    
+    NSView *view = (NSView *)jlong_to_ptr(viewPtr);    
+    NSWindow *window = [view window];
+    
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
+
+            ret = (jint)[[AWTWindow getNSWindowDisplayID_AppKitThread: window] intValue];
+    }];
+    
+JNF_COCOA_EXIT(env);
+    
+    return ret;
+}
+
+/*
+ * Class:     sun_lwawt_macosx_CPlatformView
+ * Method:    nativeGetLocationOnScreen
+ * Signature: (J)Ljava/awt/Rectangle;
+ */
+
+JNIEXPORT jobject JNICALL
+Java_sun_lwawt_macosx_CPlatformView_nativeGetLocationOnScreen
+(JNIEnv *env, jclass cls, jlong viewPtr)
+{
+    jobject jRect = NULL;
+    
+JNF_COCOA_ENTER(env);
+    
+    __block NSRect rect = NSZeroRect;
+    
+    NSView *view = (NSView *)jlong_to_ptr(viewPtr);    
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
+
+        NSRect viewBounds = [view bounds];
+        NSRect frameInWindow = [view convertRect:viewBounds toView:nil];
+        rect = [[view window] convertRectToScreen:frameInWindow];
+        NSRect screenRect = [[NSScreen mainScreen] frame];
+        //Convert coordinates to top-left corner origin
+        rect.origin.y = screenRect.size.height - rect.origin.y - viewBounds.size.height;
+    }];
+    jRect = NSToJavaRect(env, rect);
+    
+JNF_COCOA_EXIT(env);
+    
+    return jRect;
+}
+
+/*
+ * Class:     sun_lwawt_macosx_CPlatformView
  * Method:    nativeIsViewUnderMouse
  * Signature: (J)Z;
  */
@@ -1246,18 +1356,19 @@
 (JNIEnv *env, jclass clazz, jlong viewPtr)
 {
     __block jboolean underMouse = JNI_FALSE;
-
+    
 JNF_COCOA_ENTER(env);
-
+    
     NSView *nsView = OBJC(viewPtr);
-   [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+   [ThreadUtilities performOnMainThreadWaiting:YES block:^(){       
        NSPoint ptWindowCoords = [[nsView window] mouseLocationOutsideOfEventStream];
        NSPoint ptViewCoords = [nsView convertPoint:ptWindowCoords fromView:nil];
        underMouse = [nsView hitTest:ptViewCoords] != nil;
     }];
-
+    
 JNF_COCOA_EXIT(env);
-
+    
     return underMouse;
 }
 
+
--- a/src/macosx/native/sun/awt/AWTWindow.h	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/native/sun/awt/AWTWindow.h	Fri Jun 21 19:11:42 2013 -0700
@@ -72,6 +72,9 @@
 - (BOOL) worksWhenModal;
 - (void)sendEvent:(NSEvent *)event;
 
++ (void) setLastKeyWindow:(AWTWindow *)window;
++ (AWTWindow *) lastKeyWindow;
+
 @end
 
 @interface AWTWindow_Normal : NSWindow
--- a/src/macosx/native/sun/awt/AWTWindow.m	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/native/sun/awt/AWTWindow.m	Fri Jun 21 19:11:42 2013 -0700
@@ -70,6 +70,14 @@
 }
 @end
 
+// Cocoa windowDidBecomeKey/windowDidResignKey notifications
+// doesn't provide information about "opposite" window, so we
+// have to do a bit of tracking. This variable points to a window
+// which had been the key window just before a new key window
+// was set. It would be nil if the new key window isn't an AWT
+// window or the app currently has no key window.
+static AWTWindow* lastKeyWindow = nil;
+
 // --------------------------------------------------------------
 // NSWindow/NSPanel descendants implementation
 #define AWT_NS_WINDOW_IMPLEMENTATION                            \
@@ -198,8 +206,8 @@
         [self.nsWindow setDocumentEdited:IS(bits, DOCUMENT_MODIFIED)];
     }
 
-    if ([self.nsWindow respondsToSelector:@selector(toggleFullScreen:)]) {
-        if (IS(mask, FULLSCREENABLE)) {
+    if (IS(mask, FULLSCREENABLE) && [self.nsWindow respondsToSelector:@selector(toggleFullScreen:)]) {
+        if (IS(bits, FULLSCREENABLE)) {
             [self.nsWindow setCollectionBehavior:(1 << 7) /*NSWindowCollectionBehaviorFullScreenPrimary*/];
         } else {
             [self.nsWindow setCollectionBehavior:NSWindowCollectionBehaviorDefault];
@@ -298,6 +306,10 @@
     return self;
 }
 
++ (BOOL) isAWTWindow:(NSWindow *)window {
+    return [window isKindOfClass: [AWTWindow_Panel class]] || [window isKindOfClass: [AWTWindow_Normal class]];
+}
+
 // checks that this window is under the mouse cursor and this point is not overlapped by others windows
 - (BOOL) isTopmostWindowUnderMouse {
 
@@ -358,6 +370,13 @@
     [[self.nsWindow contentView] deliverJavaMouseEvent: mouseEvent];
 }
 
++ (NSNumber *) getNSWindowDisplayID_AppKitThread:(NSWindow *)window {
+    AWT_ASSERT_APPKIT_THREAD;
+    NSScreen *screen = [window screen];
+    NSDictionary *deviceDescription = [screen deviceDescription];
+    return [deviceDescription objectForKey:@"NSScreenNumber"];
+}
+
 - (void) dealloc {
 AWT_ASSERT_APPKIT_THREAD;
 
@@ -475,12 +494,13 @@
 
     NSRect frame = ConvertNSScreenRect(env, [self.nsWindow frame]);
 
-    static JNF_MEMBER_CACHE(jm_deliverMoveResizeEvent, jc_CPlatformWindow, "deliverMoveResizeEvent", "(IIII)V");
+    static JNF_MEMBER_CACHE(jm_deliverMoveResizeEvent, jc_CPlatformWindow, "deliverMoveResizeEvent", "(IIIIZ)V");
     JNFCallVoidMethod(env, platformWindow, jm_deliverMoveResizeEvent,
                       (jint)frame.origin.x,
                       (jint)frame.origin.y,
                       (jint)frame.size.width,
-                      (jint)frame.size.height);
+                      (jint)frame.size.height,
+                      (jboolean)[self.nsWindow inLiveResize]);
     (*env)->DeleteLocalRef(env, platformWindow);
 }
 
@@ -543,15 +563,17 @@
     [self _deliverIconify:JNI_FALSE];
 }
 
-- (void) _deliverWindowFocusEvent:(BOOL)focused {
+- (void) _deliverWindowFocusEvent:(BOOL)focused oppositeWindow:(AWTWindow *)opposite {
 //AWT_ASSERT_APPKIT_THREAD;
-
     JNIEnv *env = [ThreadUtilities getJNIEnvUncached];
     jobject platformWindow = [self.javaPlatformWindow jObjectWithEnv:env];
     if (platformWindow != NULL) {
-        static JNF_MEMBER_CACHE(jm_deliverWindowFocusEvent, jc_CPlatformWindow, "deliverWindowFocusEvent", "(Z)V");
-        JNFCallVoidMethod(env, platformWindow, jm_deliverWindowFocusEvent, (jboolean)focused);
+        jobject oppositeWindow = [opposite.javaPlatformWindow jObjectWithEnv:env];
+
+        static JNF_MEMBER_CACHE(jm_deliverWindowFocusEvent, jc_CPlatformWindow, "deliverWindowFocusEvent", "(ZLsun/lwawt/macosx/CPlatformWindow;)V");
+        JNFCallVoidMethod(env, platformWindow, jm_deliverWindowFocusEvent, (jboolean)focused, oppositeWindow);
         (*env)->DeleteLocalRef(env, platformWindow);
+        (*env)->DeleteLocalRef(env, oppositeWindow);
     }
 }
 
@@ -559,8 +581,15 @@
 - (void) windowDidBecomeKey: (NSNotification *) notification {
 AWT_ASSERT_APPKIT_THREAD;
     [AWTToolkit eventCountPlusPlus];
-    [CMenuBar activate:self.javaMenuBar modallyDisabled:NO];
-    [self _deliverWindowFocusEvent:YES];
+    AWTWindow *opposite = [AWTWindow lastKeyWindow];
+    if (!IS(self.styleBits, IS_DIALOG)) {
+        [CMenuBar activate:self.javaMenuBar modallyDisabled:NO];
+    } else if ((opposite != NULL) && IS(self.styleBits, IS_MODAL)) {
+        [CMenuBar activate:opposite->javaMenuBar modallyDisabled:YES];
+    }
+    [AWTWindow setLastKeyWindow:nil];
+
+    [self _deliverWindowFocusEvent:YES oppositeWindow: opposite];
 }
 
 - (void) windowDidResignKey: (NSNotification *) notification {
@@ -568,7 +597,18 @@
 AWT_ASSERT_APPKIT_THREAD;
     [AWTToolkit eventCountPlusPlus];
     [self.javaMenuBar deactivate];
-    [self _deliverWindowFocusEvent:NO];
+
+    // the new key window
+    NSWindow *keyWindow = [NSApp keyWindow];
+    AWTWindow *opposite = nil;
+    if ([AWTWindow isAWTWindow: keyWindow]) {
+        opposite = (AWTWindow *)[keyWindow delegate];
+        [AWTWindow setLastKeyWindow: self];
+    } else {
+        [AWTWindow setLastKeyWindow: nil];
+    }
+
+    [self _deliverWindowFocusEvent:NO oppositeWindow: opposite];
 }
 
 - (void) windowDidBecomeMain: (NSNotification *) notification {
@@ -727,6 +767,17 @@
     }
 }
 
++ (void) setLastKeyWindow:(AWTWindow *)window {
+    [window retain];
+    [lastKeyWindow release];
+    lastKeyWindow = window;
+}
+
++ (AWTWindow *) lastKeyWindow {
+    return lastKeyWindow;
+}
+
+
 @end // AWTWindow
 
 
@@ -741,14 +792,12 @@
     __block AWTWindow *window = nil;
 
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
     JNFWeakJObjectWrapper *platformWindow = [JNFWeakJObjectWrapper wrapperWithJObject:obj withEnv:env];
     NSView *contentView = OBJC(contentViewPtr);
     NSRect frameRect = NSMakeRect(x, y, w, h);
 
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
 
         window = [[AWTWindow alloc] initWithPlatformWindow:platformWindow
                                                   styleBits:styleBits
@@ -773,11 +822,9 @@
 (JNIEnv *env, jclass clazz, jlong windowPtr, jint mask, jint bits)
 {
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
     NSWindow *nsWindow = OBJC(windowPtr);
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
 
         AWTWindow *window = (AWTWindow*)[nsWindow delegate];
 
@@ -810,21 +857,19 @@
 (JNIEnv *env, jclass clazz, jlong windowPtr, jlong menuBarPtr)
 {
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
     NSWindow *nsWindow = OBJC(windowPtr);
     CMenuBar *menuBar = OBJC(menuBarPtr);
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
 
         AWTWindow *window = (AWTWindow*)[nsWindow delegate];
 
         if ([nsWindow isKeyWindow]) [window.javaMenuBar deactivate];
         window.javaMenuBar = menuBar;
 
-        // if ([self isKeyWindow]) {
-        [CMenuBar activate:window.javaMenuBar modallyDisabled:NO];
-        // }
+        if ([nsWindow isKeyWindow]) {
+            [CMenuBar activate:window.javaMenuBar modallyDisabled:NO];
+        }
     }];
 
 JNF_COCOA_EXIT(env);
@@ -841,14 +886,12 @@
     jobject ret = NULL;
 
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
     NSWindow *nsWindow = OBJC(windowPtr);
     __block NSRect contentRect = NSZeroRect;
     __block NSRect frame = NSZeroRect;
 
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
 
         frame = [nsWindow frame];
         contentRect = [NSWindow contentRectForFrameRect:frame styleMask:[nsWindow styleMask]];
@@ -881,8 +924,7 @@
 
     // TODO: not sure we need displayIfNeeded message in our view
     NSWindow *nsWindow = OBJC(windowPtr);
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
 
         AWTWindow *window = (AWTWindow*)[nsWindow delegate];
 
@@ -915,7 +957,6 @@
 (JNIEnv *env, jclass clazz, jlong windowPtr, jdouble minW, jdouble minH, jdouble maxW, jdouble maxH)
 {
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
     if (minW < 1) minW = 1;
     if (minH < 1) minH = 1;
@@ -923,8 +964,7 @@
     if (maxH < 1) maxH = 1;
 
     NSWindow *nsWindow = OBJC(windowPtr);
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
 
         AWTWindow *window = (AWTWindow*)[nsWindow delegate];
 
@@ -951,12 +991,9 @@
 (JNIEnv *env, jclass clazz, jlong windowPtr)
 {
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
     NSWindow *nsWindow = OBJC(windowPtr);
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
-
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [nsWindow orderBack:nil];
     }];
 
@@ -972,11 +1009,9 @@
 (JNIEnv *env, jclass clazz, jlong windowPtr)
 {
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
     NSWindow *nsWindow = OBJC(windowPtr);
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
 
         if (![nsWindow isKeyWindow]) {
             [nsWindow makeKeyAndOrderFront:nsWindow];
@@ -997,7 +1032,6 @@
 (JNIEnv *env, jclass clazz, jlong windowPtr, jstring jtitle)
 {
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
     NSWindow *nsWindow = OBJC(windowPtr);
     [nsWindow performSelectorOnMainThread:@selector(setTitle:)
@@ -1016,12 +1050,9 @@
 (JNIEnv *env, jclass clazz, jlong windowPtr)
 {
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
     NSWindow *nsWindow = OBJC(windowPtr);
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
-
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [nsWindow invalidateShadow];
     }];
 
@@ -1059,13 +1090,10 @@
 (JNIEnv *env, jclass clazz, jlong windowPtr, jlong nsImagePtr)
 {
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
     NSWindow *nsWindow = OBJC(windowPtr);
     NSImage *image = OBJC(nsImagePtr);
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
-
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [nsWindow setMiniwindowImage:image];
     }];
 
@@ -1081,13 +1109,10 @@
 (JNIEnv *env, jclass clazz, jlong windowPtr, jstring filename)
 {
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
     NSWindow *nsWindow = OBJC(windowPtr);
     NSURL *url = (filename == NULL) ? nil : [NSURL fileURLWithPath:JNFNormalizedNSStringForPath(env, filename)];
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
-
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [nsWindow setRepresentedURL:url];
     }];
 
@@ -1096,22 +1121,6 @@
 
 /*
  * Class:     sun_lwawt_macosx_CPlatformWindow
- * Method:    nativeSetNSWindowSecurityWarningPositioning
- * Signature: (JDDFF)V
- */
-JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSetNSWindowSecurityWarningPositioning
-(JNIEnv *env, jclass clazz, jlong windowPtr, jdouble x, jdouble y, jfloat biasX, jfloat biasY)
-{
-JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
-
-    [JNFException raise:env as:kRuntimeException reason:"unimplemented"];
-
-JNF_COCOA_EXIT(env);
-}
-
-/*
- * Class:     sun_lwawt_macosx_CPlatformWindow
  * Method:    nativeSynthesizeMouseEnteredExitedEvents
  * Signature: (J)V
  */
@@ -1119,11 +1128,9 @@
 (JNIEnv *env, jclass clazz, jlong windowPtr)
 {
     JNF_COCOA_ENTER(env);
-    AWT_ASSERT_NOT_APPKIT_THREAD;
 
     NSWindow *nsWindow = OBJC(windowPtr);
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         AWTWindow *window = (AWTWindow*)[nsWindow delegate];
 
         [window synthesizeMouseEnteredExitedEvents];
@@ -1134,31 +1141,6 @@
 
 /*
  * Class:     sun_lwawt_macosx_CPlatformWindow
- * Method:    nativeGetDisplayID_AppKitThread
- * Signature: (J)I
- */
-JNIEXPORT jint JNICALL
-Java_sun_lwawt_macosx_CPlatformWindow_nativeGetNSWindowDisplayID_1AppKitThread
-(JNIEnv *env, jclass clazz, jlong windowPtr)
-{
-    jint ret; // CGDirectDisplayID
-
-JNF_COCOA_ENTER(env);
-AWT_ASSERT_APPKIT_THREAD;
-
-    NSWindow *window = OBJC(windowPtr);
-    NSScreen *screen = [window screen];
-    NSDictionary *deviceDescription = [screen deviceDescription];
-    NSNumber *displayID = [deviceDescription objectForKey:@"NSScreenNumber"];
-    ret = (jint)[displayID intValue];
-
-JNF_COCOA_EXIT(env);
-
-    return ret;
-}
-
-/*
- * Class:     sun_lwawt_macosx_CPlatformWindow
  * Method:    _toggleFullScreenMode
  * Signature: (J)V
  */
@@ -1171,41 +1153,20 @@
     SEL toggleFullScreenSelector = @selector(toggleFullScreen:);
     if (![nsWindow respondsToSelector:toggleFullScreenSelector]) return;
 
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [nsWindow performSelector:toggleFullScreenSelector withObject:nil];
     }];
 
 JNF_COCOA_EXIT(env);
 }
 
-JNIEXPORT jboolean JNICALL Java_sun_lwawt_macosx_CMouseInfoPeer_nativeIsWindowUnderMouse
-(JNIEnv *env, jclass clazz, jlong windowPtr)
-{
-    __block jboolean underMouse = JNI_FALSE;
-
-JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
-
-    NSWindow *nsWindow = OBJC(windowPtr);
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^() {
-        AWT_ASSERT_APPKIT_THREAD;
-
-        NSPoint pt = [nsWindow mouseLocationOutsideOfEventStream];
-        underMouse = [[nsWindow contentView] hitTest:pt] != nil;
-    }];
-
-JNF_COCOA_EXIT(env);
-
-    return underMouse;
-}
-
 JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSetEnabled
 (JNIEnv *env, jclass clazz, jlong windowPtr, jboolean isEnabled)
 {
 JNF_COCOA_ENTER(env);
 
     NSWindow *nsWindow = OBJC(windowPtr);
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         AWTWindow *window = (AWTWindow*)[nsWindow delegate];
 
         [window setEnabled: isEnabled];
@@ -1220,9 +1181,13 @@
 JNF_COCOA_ENTER(env);
 
     NSWindow *nsWindow = OBJC(windowPtr);
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         AWTWindow *window = (AWTWindow*)[nsWindow delegate];
 
+        if ([AWTWindow lastKeyWindow] == window) {
+            [AWTWindow setLastKeyWindow: nil];
+        }
+
         // AWTWindow holds a reference to the NSWindow in its nsWindow
         // property. Unsetting the delegate allows it to be deallocated
         // which releases the reference. This, in turn, allows the window
--- a/src/macosx/native/sun/awt/ApplicationDelegate.m	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/native/sun/awt/ApplicationDelegate.m	Fri Jun 21 19:11:42 2013 -0700
@@ -515,10 +515,9 @@
 JNIEXPORT void JNICALL Java_com_apple_eawt_Application_nativeInitializeApplicationDelegate
 (JNIEnv *env, jclass clz)
 {
-AWT_ASSERT_NOT_APPKIT_THREAD;
 JNF_COCOA_ENTER(env);
     // Force initialization to happen on AppKit thread!
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [ApplicationDelegate sharedDelegate];
     }];
 JNF_COCOA_EXIT(env);
@@ -532,10 +531,9 @@
 JNIEXPORT void JNICALL Java_com_apple_eawt__1AppEventHandler_nativeOpenCocoaAboutWindow
 (JNIEnv *env, jclass clz)
 {
-AWT_ASSERT_NOT_APPKIT_THREAD;
 JNF_COCOA_ENTER(env);
 
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [NSApp orderFrontStandardAboutPanel:nil];
     }];
 
@@ -550,10 +548,9 @@
 JNIEXPORT void JNICALL Java_com_apple_eawt__1AppEventHandler_nativeReplyToAppShouldTerminate
 (JNIEnv *env, jclass clz, jboolean doTerminate)
 {
-AWT_ASSERT_NOT_APPKIT_THREAD;
 JNF_COCOA_ENTER(env);
 
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [NSApp replyToApplicationShouldTerminate:doTerminate];
     }];
 
@@ -568,13 +565,11 @@
 JNIEXPORT void JNICALL Java_com_apple_eawt__1AppEventHandler_nativeRegisterForNotification
 (JNIEnv *env, jclass clz, jint notificationType)
 {
-AWT_ASSERT_NOT_APPKIT_THREAD;
 JNF_COCOA_ENTER(env);
     [ThreadUtilities performOnMainThread:@selector(_registerForNotification:)
-                                onObject:[ApplicationDelegate class]
+                                      on:[ApplicationDelegate class]
                               withObject:[NSNumber numberWithInt:notificationType]
-                           waitUntilDone:NO
-                                 awtMode:NO]; // AWT_THREADING Safe (non-blocking)
+                           waitUntilDone:NO]; // AWT_THREADING Safe (non-blocking)
 JNF_COCOA_EXIT(env);
 }
 
@@ -586,13 +581,10 @@
 JNIEXPORT void JNICALL Java_com_apple_eawt__1AppDockIconHandler_nativeSetDockMenu
 (JNIEnv *env, jclass clz, jlong nsMenuPtr)
 {
-AWT_ASSERT_NOT_APPKIT_THREAD;
 JNF_COCOA_ENTER(env);
 
     NSMenu *menu = (NSMenu *)jlong_to_ptr(nsMenuPtr);
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
-
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         [ApplicationDelegate sharedDelegate].fDockMenu = menu;
     }];
 
@@ -607,14 +599,13 @@
 JNIEXPORT void JNICALL Java_com_apple_eawt__1AppDockIconHandler_nativeSetDockIconImage
 (JNIEnv *env, jclass clz, jlong nsImagePtr)
 {
-AWT_ASSERT_NOT_APPKIT_THREAD;
 JNF_COCOA_ENTER(env);
 
     NSImage *_image = (NSImage *)jlong_to_ptr(nsImagePtr);
-    [JNFRunLoop performOnMainThread:@selector(_setDockIconImage:)
-                                 on:[ApplicationDelegate class]
-                         withObject:_image
-                      waitUntilDone:NO];
+    [ThreadUtilities performOnMainThread:@selector(_setDockIconImage:)
+                                      on:[ApplicationDelegate class]
+                              withObject:_image
+                           waitUntilDone:NO];
 
 JNF_COCOA_EXIT(env);
 }
@@ -629,12 +620,9 @@
 {
     __block NSImage *image = nil;
 
-AWT_ASSERT_NOT_APPKIT_THREAD;
 JNF_COCOA_ENTER(env);
 
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
-
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         image = [ApplicationDelegate _dockIconImage];
         CFRetain(image);
     }];
@@ -652,13 +640,10 @@
 JNIEXPORT void JNICALL Java_com_apple_eawt__1AppDockIconHandler_nativeSetDockIconBadge
 (JNIEnv *env, jclass clz, jstring badge)
 {
-AWT_ASSERT_NOT_APPKIT_THREAD;
 JNF_COCOA_ENTER(env);
 
     NSString *badgeString = JNFJavaToNSString(env, badge);
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
-
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         NSDockTile *dockTile = [NSApp dockTile];
         [dockTile setBadgeLabel:badgeString];
         [dockTile display];
@@ -675,12 +660,9 @@
 JNIEXPORT void JNICALL Java_com_apple_eawt__1AppMiscHandlers_nativeRequestActivation
 (JNIEnv *env, jclass clz, jboolean allWindows)
 {
-AWT_ASSERT_NOT_APPKIT_THREAD;
 JNF_COCOA_ENTER(env);
 
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
-
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         NSApplicationActivationOptions options = allWindows ? NSApplicationActivateAllWindows : 0;
         options |= NSApplicationActivateIgnoringOtherApps; // without this, nothing happens!
         [[NSRunningApplication currentApplication] activateWithOptions:options];
@@ -697,12 +679,9 @@
 JNIEXPORT void JNICALL Java_com_apple_eawt__1AppMiscHandlers_nativeRequestUserAttention
 (JNIEnv *env, jclass clz, jboolean critical)
 {
-AWT_ASSERT_NOT_APPKIT_THREAD;
 JNF_COCOA_ENTER(env);
 
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
-
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [NSApp requestUserAttention:critical ? NSCriticalRequest : NSInformationalRequest];
     }];
 
@@ -717,13 +696,12 @@
 JNIEXPORT void JNICALL Java_com_apple_eawt__1AppMiscHandlers_nativeOpenHelpViewer
 (JNIEnv *env, jclass clz)
 {
-AWT_ASSERT_NOT_APPKIT_THREAD;
 JNF_COCOA_ENTER(env);
 
-    [JNFRunLoop performOnMainThread:@selector(showHelp:)
-                                 on:NSApp
-                         withObject:nil
-                      waitUntilDone:NO];
+    [ThreadUtilities performOnMainThread:@selector(showHelp:)
+                                      on:NSApp
+                              withObject:nil
+                           waitUntilDone:NO];
 
 JNF_COCOA_EXIT(env);
 }
@@ -736,7 +714,6 @@
 JNIEXPORT void JNICALL Java_com_apple_eawt__1AppMiscHandlers_nativeEnableSuddenTermination
 (JNIEnv *env, jclass clz)
 {
-AWT_ASSERT_NOT_APPKIT_THREAD;
 JNF_COCOA_ENTER(env);
 
     [[NSProcessInfo processInfo] enableSuddenTermination]; // Foundation thread-safe
@@ -752,7 +729,6 @@
 JNIEXPORT void JNICALL Java_com_apple_eawt__1AppMiscHandlers_nativeDisableSuddenTermination
 (JNIEnv *env, jclass clz)
 {
-AWT_ASSERT_NOT_APPKIT_THREAD;
 JNF_COCOA_ENTER(env);
 
     [[NSProcessInfo processInfo] disableSuddenTermination]; // Foundation thread-safe
@@ -768,12 +744,9 @@
 JNIEXPORT void JNICALL Java_com_apple_eawt__1AppMenuBarHandler_nativeSetMenuState
 (JNIEnv *env, jclass clz, jint menuID, jboolean visible, jboolean enabled)
 {
-AWT_ASSERT_NOT_APPKIT_THREAD;
 JNF_COCOA_ENTER(env);
 
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
-
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         ApplicationDelegate *delegate = [ApplicationDelegate sharedDelegate];
         switch (menuID) {
             case com_apple_eawt__AppMenuBarHandler_MENU_ABOUT:
@@ -796,12 +769,10 @@
 JNIEXPORT void JNICALL Java_com_apple_eawt__1AppMenuBarHandler_nativeSetDefaultMenuBar
 (JNIEnv *env, jclass clz, jlong cMenuBarPtr)
 {
-AWT_ASSERT_NOT_APPKIT_THREAD;
 JNF_COCOA_ENTER(env);
 
     CMenuBar *menu = (CMenuBar *)jlong_to_ptr(cMenuBarPtr);
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [ApplicationDelegate sharedDelegate].fDefaultMenuBar = menu;
     }];
 
--- a/src/macosx/native/sun/awt/CClipboard.m	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/native/sun/awt/CClipboard.m	Fri Jun 21 19:11:42 2013 -0700
@@ -109,7 +109,6 @@
 }
 
 - (void) javaDeclareTypes:(NSArray *)inTypes withOwner:(jobject)inClipboard jniEnv:(JNIEnv *)inEnv {
-    AWT_ASSERT_NOT_APPKIT_THREAD;
 
     //NSLog(@"CClipboard javaDeclareTypes %@ withOwner", inTypes);
 
@@ -121,7 +120,7 @@
             fClipboardOwner = JNFNewGlobalRef(inEnv, inClipboard);
         }
     }
-    [ThreadUtilities performOnMainThread:@selector(_nativeDeclareTypes:) onObject:self withObject:inTypes waitUntilDone:YES awtMode:YES];
+    [ThreadUtilities performOnMainThread:@selector(_nativeDeclareTypes:) on:self withObject:inTypes waitUntilDone:YES];
 }
 
 - (void) _nativeDeclareTypes:(NSArray *)inTypes {
@@ -134,10 +133,9 @@
 
 
 - (NSArray *) javaGetTypes {
-    AWT_ASSERT_NOT_APPKIT_THREAD;
 
     NSMutableArray *args = [NSMutableArray arrayWithCapacity:1];
-    [ThreadUtilities performOnMainThread:@selector(_nativeGetTypes:) onObject:self withObject:args waitUntilDone:YES awtMode:YES];
+    [ThreadUtilities performOnMainThread:@selector(_nativeGetTypes:) on:self withObject:args waitUntilDone:YES];
 
     //NSLog(@"CClipboard getTypes returns %@", [args lastObject]);
     return [args lastObject];
@@ -152,10 +150,9 @@
 }
 
 - (void) javaSetData:(NSData *)inData forType:(NSString *) inFormat {
-    AWT_ASSERT_NOT_APPKIT_THREAD;
 
     CClipboardUpdate *newUpdate = [[CClipboardUpdate alloc] initWithData:inData withFormat:inFormat];
-    [ThreadUtilities performOnMainThread:@selector(_nativeSetData:) onObject:self withObject:newUpdate waitUntilDone:YES awtMode:YES];
+    [ThreadUtilities performOnMainThread:@selector(_nativeSetData:) on:self withObject:newUpdate waitUntilDone:YES];
     [newUpdate release];
 
     //NSLog(@"CClipboard javaSetData forType %@", inFormat);
@@ -171,10 +168,9 @@
 }
 
 - (NSData *) javaGetDataForType:(NSString *) inFormat {
-    AWT_ASSERT_NOT_APPKIT_THREAD;
 
     NSMutableArray *args = [NSMutableArray arrayWithObject:inFormat];
-    [ThreadUtilities performOnMainThread:@selector(_nativeGetDataForType:) onObject:self withObject:args waitUntilDone:YES awtMode:YES];
+    [ThreadUtilities performOnMainThread:@selector(_nativeGetDataForType:) on:self withObject:args waitUntilDone:YES];
 
     //NSLog(@"CClipboard javaGetDataForType %@ returns an NSData", inFormat);
     return [args lastObject];
@@ -193,18 +189,18 @@
 
 - (void) checkPasteboard:(id)application {
     AWT_ASSERT_APPKIT_THREAD;
-
+    
     //NSLog(@"CClipboard checkPasteboard oldCount %d newCount %d newTypes %@", fChangeCount, [[NSPasteboard generalPasteboard] changeCount], [[NSPasteboard generalPasteboard] types]);
-
+    
     // This is called via NSApplicationDidBecomeActiveNotification.
-
+    
     // If the change count on the general pasteboard is different than when we set it
     // someone else put data on the clipboard.  That means the current owner lost ownership.
     NSInteger newChangeCount = [[NSPasteboard generalPasteboard] changeCount];
-
+    
     if (fChangeCount != newChangeCount) {
         fChangeCount = newChangeCount;
-
+        
         [self pasteboardChangedOwner:[NSPasteboard generalPasteboard]];
     }
 }
@@ -375,4 +371,21 @@
     return returnValue;
 }
 
+/*
+ * Class:     sun_lwawt_macosx_CClipboard
+ * Method:    checkPasteboard
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CClipboard_checkPasteboard
+(JNIEnv *env, jobject inObject )
+{
+    JNF_COCOA_ENTER(env);
 
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
+        [[CClipboard sharedClipboard] checkPasteboard:nil];
+    }];
+        
+    JNF_COCOA_EXIT(env);
+}
+
+
--- a/src/macosx/native/sun/awt/CCursorManager.m	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/native/sun/awt/CCursorManager.m	Fri Jun 21 19:11:42 2013 -0700
@@ -74,7 +74,6 @@
 (JNIEnv *env, jclass class, jint type, jstring name)
 {
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
     NSString *cursorName = JNFJavaToNSString(env, name);
     SEL cursorSelector = (type == sun_lwawt_macosx_CCursorManager_NAMED_CURSOR) ? lookupCursorSelectorForName(cursorName) : lookupCursorSelectorForType(type);
@@ -87,9 +86,7 @@
         [JNFException raise:env as:kNoSuchMethodException reason:"missing NSCursor selector"];
     }
 
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
-
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         setCursorOnAppKitThread([[NSCursor class] performSelector:cursorSelector]);
     }];
 
@@ -101,12 +98,9 @@
 (JNIEnv *env, jclass class, jlong imgPtr, jdouble x, jdouble y)
 {
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
     NSImage *image = (NSImage *)jlong_to_ptr(imgPtr);
 
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
-
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         NSCursor *cursor = [[NSCursor alloc] initWithImage:image
                                                    hotSpot:(NSPoint){ x, y }];
         setCursorOnAppKitThread(cursor);
@@ -123,14 +117,13 @@
     jobject jpt = NULL;
 
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
     __block NSPoint pt = NSZeroPoint;
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
-
-        pt = ConvertNSScreenPoint(env, [NSEvent mouseLocation]);
+    
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
+            pt = ConvertNSScreenPoint(env, [NSEvent mouseLocation]);
     }];
+    
     jpt = NSToJavaPoint(env, pt);
 
 JNF_COCOA_EXIT(env);
@@ -143,13 +136,11 @@
 Java_sun_lwawt_macosx_CCursorManager_nativeSetAllowsCursorSetInBackground
 (JNIEnv *env, jclass class, jboolean allows)
 {
-
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
     SEL allowsSetInBackground_SEL = @selector(javaSetAllowsCursorSetInBackground:);
     if ([[NSCursor class] respondsToSelector:allowsSetInBackground_SEL]) {
-        [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+        [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
             NSMethodSignature *allowsSetInBackground_sig =
                 [[NSCursor class] methodSignatureForSelector:allowsSetInBackground_SEL];
             NSInvocation *invocation =
--- a/src/macosx/native/sun/awt/CDesktopPeer.m	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/native/sun/awt/CDesktopPeer.m	Fri Jun 21 19:11:42 2013 -0700
@@ -36,8 +36,6 @@
 JNIEXPORT jint JNICALL Java_sun_lwawt_macosx_CDesktopPeer__1lsOpenURI
 (JNIEnv *env, jclass clz, jstring uri)
 {
-    // AWT_ASSERT_ANY_THREAD
-
     OSStatus status = noErr;
 JNF_COCOA_ENTER(env);
 
@@ -63,8 +61,6 @@
 JNIEXPORT jint JNICALL Java_sun_lwawt_macosx_CDesktopPeer__1lsOpenFile
 (JNIEnv *env, jclass clz, jstring jpath, jboolean print)
 {
-    // AWT_ASSERT_ANY_THREAD
-
     OSStatus status = noErr;
 JNF_COCOA_ENTER(env);
 
--- a/src/macosx/native/sun/awt/CDragSource.m	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/native/sun/awt/CDragSource.m	Fri Jun 21 19:11:42 2013 -0700
@@ -443,9 +443,9 @@
     NSGraphicsContext* graphicsContext = [NSGraphicsContext graphicsContextWithWindow:window];
 
     // Convert mouse coordinates to NS:
-    NSPoint location = NSMakePoint(fDragPos.x, fDragPos.y);
-    NSPoint eventLocation = [fView convertPoint:location toView:nil];
-
+    NSPoint eventLocation = [fView convertPoint:NSMakePoint(fDragPos.x, fDragPos.y) toView:nil];
+    eventLocation.y = [[fView window] frame].size.height - eventLocation.y;
+    
     // Convert fTriggerEventTimeStamp to NS - AWTEvent.h defines UTC(nsEvent) as ((jlong)[event timestamp] * 1000):
     NSTimeInterval timeStamp = fTriggerEventTimeStamp / 1000;
 
@@ -497,12 +497,9 @@
     NSImage* dragImage = fDragImage;
 
     // Get drag origin and offset:
-    NSPoint dragOrigin;
-    dragOrigin.x = fDragPos.x;
-    dragOrigin.y = fDragPos.y;
-    dragOrigin = [view convertPoint:[dragEvent locationInWindow] fromView:nil];
+    NSPoint dragOrigin = [dragEvent locationInWindow];
     dragOrigin.x += fDragImageOffset.x;
-    dragOrigin.y += [dragImage size].height + fDragImageOffset.y;
+    dragOrigin.y -= fDragImageOffset.y + [dragImage size].height;
 
     // Drag offset values don't seem to matter:
     NSSize dragOffset = NSMakeSize(0, 0);
@@ -516,7 +513,6 @@
     DLog5(@"  - drag image: %f, %f (%f x %f)", fDragImageOffset.x, fDragImageOffset.y, [dragImage size].width, [dragImage size].height);
     DLog3(@"  - event point (window) %f, %f", [dragEvent locationInWindow].x, [dragEvent locationInWindow].y);
     DLog3(@"  - drag point (view) %f, %f", dragOrigin.x, dragOrigin.y);
-
     // Set up the fDragKeyModifier, so we know if the operation has changed
     // Set up the fDragMouseModifier, so we can |= it later (since CoreDrag doesn't tell us mouse states during a drag)
     fDragKeyModifiers = [DnDUtilities extractJavaExtKeyModifiersFromJavaExtModifiers:fModifiers];
--- a/src/macosx/native/sun/awt/CDragSourceContextPeer.m	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/native/sun/awt/CDragSourceContextPeer.m	Fri Jun 21 19:11:42 2013 -0700
@@ -46,7 +46,7 @@
     __block CDragSource* dragSource = nil;
 
 JNF_COCOA_ENTER(env);
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         dragSource = [[CDragSource alloc] init:jthis component:jcomponent peer:jpeer control:controlObj
             transferable:jtransferable triggerEvent:jtrigger dragPosX:jdragposx
             dragPosY:jdragposy modifiers:jextmodifiers clickCount:jclickcount timeStamp:jtimestamp
@@ -103,7 +103,7 @@
 JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CDragSourceContextPeer_setNativeCursor
   (JNIEnv *env, jobject jthis, jlong nativeDragSourceVal, jobject jcursor, jint jcursortype)
 {
-    AWT_ASSERT_NOT_APPKIT_THREAD;
+   //AWT_ASSERT_NOT_APPKIT_THREAD;
 
 //JNF_COCOA_ENTER(env);
 //    jobject gCursor = JNFNewGlobalRef(env, jcursor);
--- a/src/macosx/native/sun/awt/CDropTarget.m	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/native/sun/awt/CDropTarget.m	Fri Jun 21 19:11:42 2013 -0700
@@ -390,8 +390,7 @@
 
     // Release dragging data if any when Java's AWT event thread is all finished.
     // Make sure dragging data is released on the native event thread.
-    [ThreadUtilities performOnMainThread:@selector(safeReleaseDraggingData:) onObject:self
-                              withObject:draggingSequenceNumberID waitUntilDone:NO awtMode:NO];
+    [ThreadUtilities performOnMainThread:@selector(safeReleaseDraggingData:) on:self withObject:draggingSequenceNumberID waitUntilDone:NO];
 }
 
 - (jint)currentJavaActions {
--- a/src/macosx/native/sun/awt/CFileDialog.h	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/native/sun/awt/CFileDialog.h	Fri Jun 21 19:11:42 2013 -0700
@@ -52,6 +52,9 @@
     // Should we navigate into apps?
     BOOL fNavigateApps;
 
+    // Can the dialog choose directories ?
+    BOOL fChooseDirectories;
+
     // Contains the absolute paths of the selected files as URLs
     NSArray *fURLs;
 }
@@ -65,6 +68,7 @@
                  mode:(jint)inMode
          multipleMode:(BOOL)inMultipleMode
        shouldNavigate:(BOOL)inNavigateApps
+ canChooseDirectories:(BOOL)inChooseDirectories
               withEnv:(JNIEnv*)env;
 
 // Invoked from the main thread
--- a/src/macosx/native/sun/awt/CFileDialog.m	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/native/sun/awt/CFileDialog.m	Fri Jun 21 19:11:42 2013 -0700
@@ -43,6 +43,7 @@
                 mode:(jint)inMode
         multipleMode:(BOOL)inMultipleMode
       shouldNavigate:(BOOL)inNavigateApps
+canChooseDirectories:(BOOL)inChooseDirectories
              withEnv:(JNIEnv*)env;
 {
     if (self == [super init]) {
@@ -57,6 +58,7 @@
         fMode = inMode;
         fMultipleMode = inMultipleMode;
         fNavigateApps = inNavigateApps;
+        fChooseDirectories = inChooseDirectories;
         fPanelResult = NSCancelButton;
     }
 
@@ -109,7 +111,7 @@
             NSOpenPanel *openPanel = (NSOpenPanel *)thePanel;
             [openPanel setAllowsMultipleSelection:fMultipleMode];
             [openPanel setCanChooseFiles:YES];
-            [openPanel setCanChooseDirectories:NO];
+            [openPanel setCanChooseDirectories:fChooseDirectories];
             [openPanel setCanCreateDirectories:YES];
         }
 
@@ -182,7 +184,8 @@
 JNIEXPORT jobjectArray JNICALL
 Java_sun_lwawt_macosx_CFileDialog_nativeRunFileDialog
 (JNIEnv *env, jobject peer, jstring title, jint mode, jboolean multipleMode,
- jboolean navigateApps, jboolean hasFilter, jstring directory, jstring file)
+ jboolean navigateApps, jboolean chooseDirectories, jboolean hasFilter,
+ jstring directory, jstring file)
 {
     jobjectArray returnValue = NULL;
 
@@ -200,6 +203,7 @@
                                                                  mode:mode
                                                          multipleMode:multipleMode
                                                        shouldNavigate:navigateApps
+                                                 canChooseDirectories:chooseDirectories
                                                               withEnv:env];
 
     [JNFRunLoop performOnMainThread:@selector(safeSaveOrLoad)
--- a/src/macosx/native/sun/awt/CGraphicsDevice.m	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/native/sun/awt/CGraphicsDevice.m	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -23,7 +23,8 @@
  * questions.
  */
 
-#include "LWCToolkit.h"
+#import "LWCToolkit.h"
+#import "ThreadUtilities.h"
 
 /*
  * Convert the mode string to the more convinient bits per pixel value
@@ -148,6 +149,47 @@
 
 /*
  * Class:     sun_awt_CGraphicsDevice
+ * Method:    nativeGetScreenInsets
+ * Signature: (I)D
+ */
+JNIEXPORT jobject JNICALL
+Java_sun_awt_CGraphicsDevice_nativeGetScreenInsets
+  (JNIEnv *env, jclass class, jint displayID)
+{
+    jobject ret = NULL;
+    __block NSRect frame = NSZeroRect;
+    __block NSRect visibleFrame = NSZeroRect;
+JNF_COCOA_ENTER(env);
+    
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
+        NSArray *screens = [NSScreen screens];
+        for (NSScreen *screen in screens) {
+            NSDictionary *screenInfo = [screen deviceDescription];
+            NSNumber *screenID = [screenInfo objectForKey:@"NSScreenNumber"];
+            if ([screenID pointerValue] == displayID){
+                frame = [screen frame];
+                visibleFrame = [screen visibleFrame];
+                break;
+            }
+        }
+    }];
+    // Convert between Cocoa's coordinate system and Java.
+    jint bottom = visibleFrame.origin.y - frame.origin.y;
+    jint top = frame.size.height - visibleFrame.size.height - bottom;
+    jint left = visibleFrame.origin.x - frame.origin.x;
+    jint right = frame.size.width - visibleFrame.size.width - left;
+    
+    static JNF_CLASS_CACHE(jc_Insets, "java/awt/Insets");
+    static JNF_CTOR_CACHE(jc_Insets_ctor, jc_Insets, "(IIII)V");
+    ret = JNFNewObject(env, jc_Insets_ctor, top, left, bottom, right);
+
+JNF_COCOA_EXIT(env);
+
+    return ret;
+}
+
+/*
+ * Class:     sun_awt_CGraphicsDevice
  * Method:    nativeSetDisplayMode
  * Signature: (IIIII)V
  */
@@ -234,3 +276,34 @@
 
     return jreturnArray;
 }
+
+/*
+ * Class:     sun_awt_CGraphicsDevice
+ * Method:    nativeGetScaleFactor
+ * Signature: (I)D
+ */
+JNIEXPORT jdouble JNICALL
+Java_sun_awt_CGraphicsDevice_nativeGetScaleFactor
+(JNIEnv *env, jclass class, jint displayID)
+{
+    __block jdouble ret = 1.0f;
+
+JNF_COCOA_ENTER(env);
+
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
+        NSArray *screens = [NSScreen screens];
+        for (NSScreen *screen in screens) {
+            NSDictionary *screenInfo = [screen deviceDescription];
+            NSNumber *screenID = [screenInfo objectForKey:@"NSScreenNumber"];
+            if ([screenID pointerValue] == displayID){
+                if ([screen respondsToSelector:@selector(backingScaleFactor)]) {
+                    ret = [screen backingScaleFactor];
+                }
+                break;
+            }
+        }
+    }];
+
+JNF_COCOA_EXIT(env);
+    return ret;
+}
--- a/src/macosx/native/sun/awt/CGraphicsEnv.m	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/native/sun/awt/CGraphicsEnv.m	Fri Jun 21 19:11:42 2013 -0700
@@ -124,10 +124,11 @@
 
         jobject graphicsEnv = [wrapper jObjectWithEnv:env];
         if (graphicsEnv == NULL) return; // ref already GC'd
-
         static JNF_CLASS_CACHE(jc_CGraphicsEnvironment, "sun/awt/CGraphicsEnvironment");
-        static JNF_MEMBER_CACHE(jm_displayReconfiguration, jc_CGraphicsEnvironment, "_displayReconfiguration", "(J)V");
-        JNFCallVoidMethod(env, graphicsEnv, jm_displayReconfiguration);
+        static JNF_MEMBER_CACHE(jm_displayReconfiguration, jc_CGraphicsEnvironment, "_displayReconfiguration", "(IZ)V");
+        JNFCallVoidMethod(env, graphicsEnv, jm_displayReconfiguration,
+                            (jint) display, 
+                            (jboolean) flags & kCGDisplayRemoveFlag);
     });
 }
 
--- a/src/macosx/native/sun/awt/CImage.m	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/native/sun/awt/CImage.m	Fri Jun 21 19:11:42 2013 -0700
@@ -81,7 +81,6 @@
     jlong result = 0L;
 
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_ANY_THREAD;
 
     NSBitmapImageRep* imageRep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL
                                                                          pixelsWide:width
@@ -131,7 +130,6 @@
     NSImage *image = nil;
 
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_ANY_THREAD;
 
     IconRef iconRef;
     if (noErr == GetIconRef(kOnSystemDisk, kSystemIconsCreator, selector, &iconRef)) {
@@ -156,7 +154,6 @@
     NSImage *image = nil;
 
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_ANY_THREAD;
 
     NSString *path = JNFNormalizedNSStringForPath(env, file);
     image = [[NSImage alloc] initByReferencingFile:path];
@@ -178,10 +175,9 @@
     __block NSImage *image = nil;
 
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_ANY_THREAD;
 
     NSString *path = JNFNormalizedNSStringForPath(env, file);
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         image = [[NSWorkspace sharedWorkspace] iconForFile:path];
         [image setScalesWhenResized:TRUE];
         if (image) CFRetain(image); // GC
@@ -203,7 +199,6 @@
     NSImage *image = nil;
 
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_ANY_THREAD;
 
     image = [NSImage imageNamed:JNFJavaToNSString(env, name)];
     if (image) CFRetain(image); // GC
@@ -222,7 +217,6 @@
 (JNIEnv *env, jclass klass, jlong nsImgPtr, jintArray buffer, jint w, jint h)
 {
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_ANY_THREAD;
 
     NSImage *img = (NSImage *)jlong_to_ptr(nsImgPtr);
     jint *dst = (*env)->GetPrimitiveArrayCritical(env, buffer, NULL);
@@ -245,7 +239,6 @@
     jobject size = NULL;
 
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_ANY_THREAD;
 
     size = NSToJavaSize(env, [(NSImage *)jlong_to_ptr(nsImgPtr) size]);
 
--- a/src/macosx/native/sun/awt/CInputMethod.m	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/native/sun/awt/CInputMethod.m	Fri Jun 21 19:11:42 2013 -0700
@@ -153,7 +153,7 @@
     __block NSString *keyboardInfo = NULL;
 JNF_COCOA_ENTER(env);
 
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         keyboardInfo = [inputMethodController performSelector:@selector(currentInputMethodName)];
         [keyboardInfo retain];
     }];
@@ -177,7 +177,7 @@
 JNF_COCOA_ENTER(env);
     AWTView *view = (AWTView *)jlong_to_ptr(nativePeer);
     JNFJObjectWrapper *inputMethodWrapper = [[JNFJObjectWrapper alloc] initWithJObject:inputMethod withEnv:env];
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [CInputMethod _nativeNotifyPeerWithView:view inputMethod:inputMethodWrapper];
     }];
 
@@ -196,7 +196,7 @@
 JNF_COCOA_ENTER(env);
    AWTView *view = (AWTView *)jlong_to_ptr(nativePeer);
 
-   [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
+   [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [CInputMethod _nativeEndComposition:view];
     }];
 
@@ -216,7 +216,7 @@
     __block NSString *isoAbbreviation;
 JNF_COCOA_ENTER(env);
 
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         isoAbbreviation = (NSString *) [inputMethodController performSelector:@selector(currentInputMethodLocale)];
         [isoAbbreviation retain];
     }];
@@ -259,7 +259,7 @@
     NSString *localeStr = JNFJavaToNSString(env, locale);
     [localeStr retain];
 
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         [CInputMethod setKeyboardLayout:localeStr];
     }];
 
@@ -293,7 +293,7 @@
     __block NSArray *selectableArray = nil;
 JNF_COCOA_ENTER(env);
 
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         selectableArray = (NSArray *)[inputMethodController performSelector:@selector(availableInputMethodLocales)];
         [selectableArray retain];
     }];
--- a/src/macosx/native/sun/awt/CMenu.m	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/native/sun/awt/CMenu.m	Fri Jun 21 19:11:42 2013 -0700
@@ -55,13 +55,11 @@
 //- (void)finalize { [super finalize]; }
 
 - (void)addJavaSubmenu:(CMenu *)submenu {
-AWT_ASSERT_NOT_APPKIT_THREAD;
-    [ThreadUtilities performOnMainThread:@selector(addNativeItem_OnAppKitThread:) onObject:self withObject:submenu waitUntilDone:YES awtMode:YES];
+    [ThreadUtilities performOnMainThread:@selector(addNativeItem_OnAppKitThread:) on:self withObject:submenu waitUntilDone:YES];
 }
 
 - (void)addJavaMenuItem:(CMenuItem *)theMenuItem {
-AWT_ASSERT_NOT_APPKIT_THREAD;
-    [ThreadUtilities performOnMainThread:@selector(addNativeItem_OnAppKitThread:) onObject:self withObject:theMenuItem waitUntilDone:YES awtMode:YES];
+    [ThreadUtilities performOnMainThread:@selector(addNativeItem_OnAppKitThread:) on:self withObject:theMenuItem waitUntilDone:YES];
 }
 
 - (void)addNativeItem_OnAppKitThread:(CMenuItem *)itemModified {
@@ -70,10 +68,9 @@
 }
 
 - (void)setJavaMenuTitle:(NSString *)title {
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
     if (title) {
-        [ThreadUtilities performOnMainThread:@selector(setNativeMenuTitle_OnAppKitThread:) onObject:self withObject:title waitUntilDone:YES awtMode:YES];
+        [ThreadUtilities performOnMainThread:@selector(setNativeMenuTitle_OnAppKitThread:) on:self withObject:title waitUntilDone:YES];
     }
 }
 
@@ -95,9 +92,8 @@
 }
 
 - (void)deleteJavaItem:(jint)index {
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
-    [ThreadUtilities performOnMainThread:@selector(deleteNativeJavaItem_OnAppKitThread:) onObject:self withObject:[NSNumber numberWithInt:index] waitUntilDone:YES awtMode:YES];
+    [ThreadUtilities performOnMainThread:@selector(deleteNativeJavaItem_OnAppKitThread:) on:self withObject:[NSNumber numberWithInt:index] waitUntilDone:YES];
 }
 
 - (void)deleteNativeJavaItem_OnAppKitThread:(NSNumber *)number {
@@ -143,7 +139,7 @@
     // We use an array here only to be able to get a return value
     NSMutableArray *args = [[NSMutableArray alloc] initWithObjects:[NSValue valueWithBytes:&cPeerObjGlobal objCType:@encode(jobject)], nil];
 
-    [ThreadUtilities performOnMainThread:@selector(_create_OnAppKitThread:) onObject:[CMenu alloc] withObject:args waitUntilDone:YES awtMode:YES];
+    [ThreadUtilities performOnMainThread:@selector(_create_OnAppKitThread:) on:[CMenu alloc] withObject:args waitUntilDone:YES];
 
     aCMenu = (CMenu *)[args objectAtIndex: 0];
 
--- a/src/macosx/native/sun/awt/CMenuBar.m	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/native/sun/awt/CMenuBar.m	Fri Jun 21 19:11:42 2013 -0700
@@ -197,7 +197,7 @@
 
     if (self == sActiveMenuBar) {
         NSArray *args = [[NSArray alloc] initWithObjects:theMenu, [NSNumber numberWithInt:-1], nil];
-        [ThreadUtilities performOnMainThread:@selector(nativeAddMenuAtIndex_OnAppKitThread:) onObject:self withObject:args waitUntilDone:YES awtMode:YES];
+        [ThreadUtilities performOnMainThread:@selector(nativeAddMenuAtIndex_OnAppKitThread:) on:self withObject:args waitUntilDone:YES];
         [args release];
     }
 }
@@ -216,7 +216,7 @@
 
     if (self == sActiveMenuBar) {
         NSArray *args = [[NSArray alloc] initWithObjects:theMenu, [NSNumber numberWithInt:index], nil];
-        [ThreadUtilities performOnMainThread:@selector(nativeAddMenuAtIndex_OnAppKitThread:) onObject:self withObject:args waitUntilDone:YES awtMode:YES];
+        [ThreadUtilities performOnMainThread:@selector(nativeAddMenuAtIndex_OnAppKitThread:) on:self withObject:args waitUntilDone:YES];
         [args release];
     }
 }
@@ -286,7 +286,7 @@
 
 - (void) javaDeleteMenu: (jint)index {
     if (self == sActiveMenuBar) {
-        [ThreadUtilities performOnMainThread:@selector(nativeDeleteMenu_OnAppKitThread:) onObject:self withObject:[NSNumber numberWithInt:index] waitUntilDone:YES awtMode:YES];
+        [ThreadUtilities performOnMainThread:@selector(nativeDeleteMenu_OnAppKitThread:) on:self withObject:[NSNumber numberWithInt:index] waitUntilDone:YES];
     }
 
     @synchronized(self) {
@@ -388,7 +388,7 @@
     // We use an array here only to be able to get a return value
     NSMutableArray *args = [[NSMutableArray alloc] initWithObjects:[NSValue valueWithBytes:&cPeerObjGlobal objCType:@encode(jobject)], nil];
 
-    [ThreadUtilities performOnMainThread:@selector(_create_OnAppKitThread:) onObject:[CMenuBar alloc] withObject:args waitUntilDone:YES awtMode:YES];
+    [ThreadUtilities performOnMainThread:@selector(_create_OnAppKitThread:) on:[CMenuBar alloc] withObject:args waitUntilDone:YES];
 
     aCMenuBar = (CMenuBar *)[args objectAtIndex: 0];
 
--- a/src/macosx/native/sun/awt/CMenuComponent.h	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/native/sun/awt/CMenuComponent.h	Fri Jun 21 19:11:42 2013 -0700
@@ -24,7 +24,7 @@
  */
 
 #import <AppKit/AppKit.h>
-#import <JavaVM/jni.h>
+#import <jni.h>
 
 @interface CMenuComponent : NSObject {
 
--- a/src/macosx/native/sun/awt/CMenuComponent.m	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/native/sun/awt/CMenuComponent.m	Fri Jun 21 19:11:42 2013 -0700
@@ -80,10 +80,10 @@
 {
 JNF_COCOA_ENTER(env);
 
-    [JNFRunLoop performOnMainThread:@selector(disposer)
-                                 on:((id)jlong_to_ptr(menuItemObj))
-                         withObject:nil
-                      waitUntilDone:NO];
+    [ThreadUtilities performOnMainThread:@selector(disposer)
+                                      on:((id)jlong_to_ptr(menuItemObj))
+                              withObject:nil
+                           waitUntilDone:NO];
 
 JNF_COCOA_EXIT(env);
 }
--- a/src/macosx/native/sun/awt/CMenuItem.m	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/native/sun/awt/CMenuItem.m	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -71,12 +71,21 @@
 JNF_COCOA_ENTER(env);
 
     // If we are called as a result of user pressing a shorcut, do nothing,
-    // because AWTView has already sent corresponding key event to the Java 
+    // because AWTView has already sent corresponding key event to the Java
     // layer from performKeyEquivalent
     NSEvent *currEvent = [[NSApplication sharedApplication] currentEvent];
     if ([currEvent type] == NSKeyDown) {
         NSString *menuKey = [sender keyEquivalent];
         NSString *eventKey = [currEvent charactersIgnoringModifiers];
+
+        // Apple uses characters from private Unicode range for some of the
+        // keys, so we need to do the same translation here that we do
+        // for the regular key down events
+        if ([eventKey length] == 1) {
+            unichar ch =  NsCharToJavaChar([eventKey characterAtIndex:0], 0);
+            eventKey = [NSString stringWithCharacters: &ch length: 1];
+        }
+
         if ([menuKey isEqualToString:eventKey]) {
             return;
         }
@@ -104,7 +113,6 @@
 }
 
 - (void) setJavaLabel:(NSString *)theLabel shortcut:(NSString *)theKeyEquivalent modifierMask:(jint)modifiers {
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
     NSUInteger modifierMask = 0;
 
@@ -126,9 +134,7 @@
         modifierMask = JavaModifiersToNsKeyModifiers(modifiers, NO);
     }
 
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
-
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         [fMenuItem setKeyEquivalent:theKeyEquivalent];
         [fMenuItem setKeyEquivalentModifierMask:modifierMask];
         [fMenuItem setTitle:theLabel];
@@ -136,32 +142,23 @@
 }
 
 - (void) setJavaImage:(NSImage *)theImage {
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
-
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [fMenuItem setImage:theImage];
     }];
 }
 
 - (void) setJavaToolTipText:(NSString *)theText {
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
-
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [fMenuItem setToolTip:theText];
     }];
 }
 
 
 - (void)setJavaEnabled:(BOOL) enabled {
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
-
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         @synchronized(self) {
             fIsEnabled = enabled;
 
@@ -174,7 +171,6 @@
 }
 
 - (BOOL)isEnabled {
-    // AWT_ASSERT_ANY_THREAD;
 
     BOOL enabled = NO;
     @synchronized(self) {
@@ -185,11 +181,8 @@
 
 
 - (void)setJavaState:(BOOL)newState {
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
-AWT_ASSERT_APPKIT_THREAD;
-
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [fMenuItem setState:(newState ? NSOnState : NSOffState)];
     }];
 }
@@ -402,7 +395,7 @@
         args = [[NSMutableArray alloc] initWithObjects:[NSValue valueWithBytes:&cPeerObjGlobal objCType:@encode(jobject)], [NSNumber numberWithBool:NO],  nil];
     }
 
-    [ThreadUtilities performOnMainThread:@selector(_createMenuItem_OnAppKitThread:) onObject:[CMenuItem alloc] withObject:args waitUntilDone:YES awtMode:YES];
+    [ThreadUtilities performOnMainThread:@selector(_createMenuItem_OnAppKitThread:) on:[CMenuItem alloc] withObject:args waitUntilDone:YES];
 
     aCMenuItem = (CMenuItem *)[args objectAtIndex: 0];
 
--- a/src/macosx/native/sun/awt/CPopupMenu.m	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/native/sun/awt/CPopupMenu.m	Fri Jun 21 19:11:42 2013 -0700
@@ -64,7 +64,7 @@
 
     jobject cPeerObjGlobal = JNFNewGlobalRef(env, peer);
 
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         aCPopupMenu = [[CPopupMenu alloc] initWithPeer:cPeerObjGlobal];
         CFRetain(aCPopupMenu);
         [aCPopupMenu release];
@@ -82,7 +82,7 @@
 
     CPopupMenu* cPopupMenu = (CPopupMenu*)jlong_to_ptr(menuPtr);
 
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         NSPoint loc = ConvertNSScreenPoint(env, NSMakePoint(x, y));
 
         [[cPopupMenu menu] popUpMenuPositioningItem: nil
--- a/src/macosx/native/sun/awt/CRobot.m	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/native/sun/awt/CRobot.m	Fri Jun 21 19:11:42 2013 -0700
@@ -136,7 +136,7 @@
 JNIEXPORT void JNICALL
 Java_sun_lwawt_macosx_CRobot_mouseEvent
 (JNIEnv *env, jobject peer,
- jint screenIndex, jint mouseLastX, jint mouseLastY, jint buttonsState,
+ jint displayID, jint mouseLastX, jint mouseLastY, jint buttonsState,
  jboolean isButtonsDownState, jboolean isMouseMove)
 {
     JNF_COCOA_ENTER(env);
@@ -150,8 +150,6 @@
 
     CGError err = kCGErrorSuccess;
 
-    CGDirectDisplayID displayID =
-    FindCGDirectDisplayIDForScreenIndex(screenIndex);
     CGRect globalDeviceBounds = CGDisplayBounds(displayID);
 
     // Set unknown mouse location, if needed.
--- a/src/macosx/native/sun/awt/CTextPipe.m	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/native/sun/awt/CTextPipe.m	Fri Jun 21 19:11:42 2013 -0700
@@ -138,8 +138,13 @@
     // get our baseline transform and font
     CGContextRef cgRef = qsdo->cgRef;
     CGAffineTransform ctmText = CGContextGetTextMatrix(cgRef);
-    //CGFontRef cgFont = CGContextGetFont(cgRef);
+
+    BOOL saved = false;
 
+    /* Save and restore of graphics context is done before the iteration.  
+       This seems to work using our test case (see bug ID 7158350) so we are restoring it at
+       the end of the for loop.  If we find out that save/restore outside the loop
+       doesn't work on all cases then we will move the Save/Restore inside the loop.*/
     CGContextSaveGState(cgRef);
     CGAffineTransform invTx = CGAffineTransformInvert(strike->fTx);
 
@@ -168,10 +173,19 @@
                 CFRelease(fallback);
 
                 if (cgFallback) {
+                    if (!saved) {
+                        CGContextSaveGState(cgRef);
+                        saved = true;
+                    }
                     CGContextSetFont(cgRef, cgFallback);
                     CFRelease(cgFallback);
                 }
             }
+        } else {
+            if (saved) {
+                CGContextRestoreGState(cgRef);
+                saved = false;
+            }
         }
 
         // if we have per-glyph transformations
@@ -206,13 +220,9 @@
         pt.x += advances[i].width;
         pt.y += advances[i].height;
 
-        // reset the font on the context after striking a unicode with CoreText
-        if (uniChar != 0)
-        {
-           // CGContextSetFont(cgRef, cgFont);
-            CGContextSaveGState(cgRef);
-        }
     }
+    // reset the font on the context after striking a unicode with CoreText
+    CGContextRestoreGState(cgRef);
 }
 
 // Using the Quartz Surface Data context, draw a hot-substituted character run
@@ -235,9 +245,22 @@
     CGContextSetTextMatrix(cgRef, CGAffineTransformIdentity); // resets the damage from CoreText
 
     NSString *string = [NSString stringWithCharacters:chars length:length];
+    /*
+       The calls below were used previously but for unknown reason did not 
+       render using the right font (see bug 7183516) when attribString is not 
+       initialized with font dictionary attributes.  It seems that "options" 
+       in CTTypesetterCreateWithAttributedStringAndOptions which contains the 
+       font dictionary is ignored.
+
     NSAttributedString *attribString = [[NSAttributedString alloc] initWithString:string];
 
     CTTypesetterRef typeSetterRef = CTTypesetterCreateWithAttributedStringAndOptions((CFAttributedStringRef) attribString, (CFDictionaryRef) ctsDictionaryFor(nsFont, JRSFontStyleUsesFractionalMetrics(strike->fStyle)));
+    */
+    NSAttributedString *attribString = [[NSAttributedString alloc]
+        initWithString:string
+        attributes:ctsDictionaryFor(nsFont, JRSFontStyleUsesFractionalMetrics(strike->fStyle))];
+    
+    CTTypesetterRef typeSetterRef = CTTypesetterCreateWithAttributedString((CFAttributedStringRef) attribString);
 
     CFRange range = {0, length};
     CTLineRef lineRef = CTTypesetterCreateLine(typeSetterRef, range);
--- a/src/macosx/native/sun/awt/CTrayIcon.m	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/native/sun/awt/CTrayIcon.m	Fri Jun 21 19:11:42 2013 -0700
@@ -303,10 +303,9 @@
     __block AWTTrayIcon *trayIcon = nil;
 
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
     jobject thePeer = JNFNewGlobalRef(env, peer);
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         trayIcon = [[AWTTrayIcon alloc] initWithPeer:thePeer];
     }];
 
@@ -334,11 +333,10 @@
 JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CTrayIcon_nativeSetToolTip
 (JNIEnv *env, jobject self, jlong model, jstring jtooltip) {
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
     AWTTrayIcon *icon = jlong_to_ptr(model);
     NSString *tooltip = JNFJavaToNSString(env, jtooltip);
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [icon setTooltip:tooltip];
     }];
 
@@ -353,10 +351,9 @@
 JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CTrayIcon_setNativeImage
 (JNIEnv *env, jobject self, jlong model, jlong imagePtr, jboolean autosize) {
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
     AWTTrayIcon *icon = jlong_to_ptr(model);
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         [icon setImage:jlong_to_ptr(imagePtr) sizing:autosize];
     }];
 
@@ -369,13 +366,10 @@
     jobject jpt = NULL;
 
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
     __block NSPoint pt = NSZeroPoint;
     AWTTrayIcon *icon = jlong_to_ptr(model);
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
-
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         NSPoint loc = [icon getLocationOnScreen];
         pt = ConvertNSScreenPoint(env, loc);
     }];
--- a/src/macosx/native/sun/awt/CWrapper.m	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/native/sun/awt/CWrapper.m	Fri Jun 21 19:11:42 2013 -0700
@@ -46,7 +46,7 @@
 JNF_COCOA_ENTER(env);
 
     id obj = (id)jlong_to_ptr(objectPtr);
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         CFRelease(obj);
     }];
 
@@ -66,10 +66,10 @@
 JNF_COCOA_ENTER(env);
 
     NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
-    [JNFRunLoop performOnMainThread:@selector(makeKeyAndOrderFront:)
-                                 on:window
-                         withObject:nil
-                      waitUntilDone:NO];
+    [ThreadUtilities performOnMainThread:@selector(makeKeyAndOrderFront:)
+                                      on:window
+                              withObject:nil
+                           waitUntilDone:NO];
 
 JNF_COCOA_EXIT(env);
 }
@@ -86,10 +86,10 @@
 JNF_COCOA_ENTER(env);
 
     NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
-    [JNFRunLoop performOnMainThread:@selector(makeKeyWindow)
-		                 on:window
-		         withObject:nil
-		      waitUntilDone:NO];
+    [ThreadUtilities performOnMainThread:@selector(makeKeyWindow)
+                                      on:window
+                              withObject:nil
+                           waitUntilDone:NO];
 
 JNF_COCOA_EXIT(env);
 }
@@ -106,10 +106,10 @@
 JNF_COCOA_ENTER(env);
 
     NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
-    [JNFRunLoop performOnMainThread:@selector(makeMainWindow)
-                                 on:window
-                         withObject:nil
-                      waitUntilDone:NO];
+    [ThreadUtilities performOnMainThread:@selector(makeMainWindow)
+                                      on:window
+                              withObject:nil
+                           waitUntilDone:NO];
 
 JNF_COCOA_EXIT(env);
 }
@@ -128,7 +128,7 @@
 JNF_COCOA_ENTER(env);
 
     NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         canBecomeMainWindow = [window canBecomeMainWindow];
     }];
 
@@ -151,7 +151,7 @@
 JNF_COCOA_ENTER(env);
 
     NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         isKeyWindow = [window isKeyWindow];
     }];
 
@@ -172,10 +172,10 @@
 JNF_COCOA_ENTER(env);
 
     NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
-    [JNFRunLoop performOnMainThread:@selector(orderFront:)
-                                 on:window
-                         withObject:window
-                      waitUntilDone:NO];
+    [ThreadUtilities performOnMainThread:@selector(orderFront:)
+                                      on:window
+                              withObject:window
+                           waitUntilDone:NO];
 
 JNF_COCOA_EXIT(env);
 }
@@ -192,10 +192,10 @@
 JNF_COCOA_ENTER(env);
 
     NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
-    [JNFRunLoop performOnMainThread:@selector(orderOut:)
-                                 on:window
-                         withObject:window
-                      waitUntilDone:NO];
+    [ThreadUtilities performOnMainThread:@selector(orderOut:)
+                                      on:window
+                              withObject:window
+                           waitUntilDone:NO];
 
 JNF_COCOA_EXIT(env);
 }
@@ -212,10 +212,10 @@
 JNF_COCOA_ENTER(env);
 
     NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
-    [JNFRunLoop performOnMainThread:@selector(orderFrontRegardless)
-                                 on:window
-                         withObject:nil
-                      waitUntilDone:NO];
+    [ThreadUtilities performOnMainThread:@selector(orderFrontRegardless)
+                                      on:window
+                              withObject:nil
+                           waitUntilDone:NO];
 
 JNF_COCOA_EXIT(env);
 }
@@ -233,7 +233,7 @@
 
     NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
     NSWindow *relativeTo = (NSWindow *)jlong_to_ptr(relativeToPtr);
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [window orderWindow:(NSWindowOrderingMode)order relativeTo:[relativeTo windowNumber]];
     }];
 
@@ -267,7 +267,7 @@
         initLevels();
 
         NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
-        [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
+        [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
             [window setLevel: LEVELS[level]];
         }];
     } else {
@@ -290,7 +290,7 @@
 
     NSWindow *parent = (NSWindow *)jlong_to_ptr(parentPtr);
     NSWindow *child = (NSWindow *)jlong_to_ptr(childPtr);
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [parent addChildWindow:child ordered:order];
     }];
 
@@ -310,10 +310,10 @@
 
     AWTWindow *parent = (AWTWindow *)jlong_to_ptr(parentPtr);
     AWTWindow *child = (AWTWindow *)jlong_to_ptr(childPtr);
-    [JNFRunLoop performOnMainThread:@selector(removeChildWindow:)
-                                 on:parent
-                         withObject:child
-                      waitUntilDone:NO];
+    [ThreadUtilities performOnMainThread:@selector(removeChildWindow:)
+                                      on:parent
+                              withObject:child
+                           waitUntilDone:NO];
 
 JNF_COCOA_EXIT(env);
 }
@@ -331,7 +331,7 @@
 
     AWTWindow *window = (AWTWindow *)jlong_to_ptr(windowPtr);
     NSRect frame = NSMakeRect(x, y, w, h);
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [window setFrame:frame display:display];
     }];
 
@@ -350,7 +350,7 @@
 JNF_COCOA_ENTER(env);
 
     AWTWindow *window = (AWTWindow *)jlong_to_ptr(windowPtr);
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [window setAlphaValue:(CGFloat)alpha];
     }];
 
@@ -369,7 +369,7 @@
 JNF_COCOA_ENTER(env);
 
     AWTWindow *window = (AWTWindow *)jlong_to_ptr(windowPtr);
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [window setOpaque:(BOOL)opaque];
     }];
 
@@ -389,7 +389,7 @@
 
     AWTWindow *window = (AWTWindow *)jlong_to_ptr(windowPtr);
     NSColor *color = (NSColor *)jlong_to_ptr(colorPtr);
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [window setBackgroundColor:color];
     }];
 
@@ -410,7 +410,7 @@
 JNF_COCOA_ENTER(env);
 
     AWTWindow *window = (AWTWindow *)jlong_to_ptr(windowPtr);
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         const NSScreen *screen = [window screen];
         CFRetain(screen); // GC
         screenPtr = ptr_to_jlong(screen);
@@ -432,10 +432,10 @@
 JNF_COCOA_ENTER(env);
 
     NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
-    [JNFRunLoop performOnMainThread:@selector(miniaturize:)
-                                 on:window
-                         withObject:nil
-                      waitUntilDone:NO];
+    [ThreadUtilities performOnMainThread:@selector(miniaturize:)
+                                      on:window
+                              withObject:nil
+                           waitUntilDone:NO];
 
 JNF_COCOA_EXIT(env);
 }
@@ -452,10 +452,10 @@
 JNF_COCOA_ENTER(env);
 
     NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
-    [JNFRunLoop performOnMainThread:@selector(deminiaturize:)
-                                 on:window
-                         withObject:nil
-                      waitUntilDone:NO];
+    [ThreadUtilities performOnMainThread:@selector(deminiaturize:)
+                                      on:window
+                              withObject:nil
+                           waitUntilDone:NO];
 
 JNF_COCOA_EXIT(env);
 }
@@ -472,10 +472,10 @@
 JNF_COCOA_ENTER(env);
 
     NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
-    [JNFRunLoop performOnMainThread:@selector(zoom:)
-                                 on:window
-                         withObject:nil
-                      waitUntilDone:NO];
+    [ThreadUtilities performOnMainThread:@selector(zoom:)
+                                      on:window
+                              withObject:nil
+                           waitUntilDone:NO];
 
 JNF_COCOA_EXIT(env);
 }
@@ -493,10 +493,10 @@
 
     NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
     NSResponder *responder = (NSResponder *)jlong_to_ptr(responderPtr);
-    [JNFRunLoop performOnMainThread:@selector(makeFirstResponder:)
-                                 on:window
-                         withObject:responder
-                      waitUntilDone:NO];
+    [ThreadUtilities performOnMainThread:@selector(makeFirstResponder:)
+                                      on:window
+                              withObject:responder
+                           waitUntilDone:NO];
 
 JNF_COCOA_EXIT(env);
 }
@@ -514,7 +514,7 @@
 
     NSView *view = (NSView *)jlong_to_ptr(viewPtr);
     NSView *subview = (NSView *)jlong_to_ptr(subviewPtr);
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         [view addSubview:subview];
     }];
 
@@ -533,10 +533,10 @@
 JNF_COCOA_ENTER(env);
 
     NSView *view = (NSView *)jlong_to_ptr(viewPtr);
-    [JNFRunLoop performOnMainThread:@selector(removeFromSuperview)
-                                 on:view
-                         withObject:nil
-                      waitUntilDone:NO];
+    [ThreadUtilities performOnMainThread:@selector(removeFromSuperview)
+                                      on:view
+                              withObject:nil
+                           waitUntilDone:NO];
 
 JNF_COCOA_EXIT(env);
 }
@@ -553,7 +553,7 @@
 JNF_COCOA_ENTER(env);
 
     NSView *view = (NSView *)jlong_to_ptr(viewPtr);
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [view setFrame:NSMakeRect(x, y, w, h)];
     }];
 
@@ -576,7 +576,7 @@
     __block NSRect rect = NSZeroRect;
 
     NSView *view = (NSView *)jlong_to_ptr(viewPtr);
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         rect = [view frame];
     }];
 
@@ -599,7 +599,7 @@
 JNF_COCOA_ENTER(env);
 
     NSView *view = (NSView *)jlong_to_ptr(viewPtr);
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         NSScreen *screen = [[view window] screen];
         NSDictionary *opts = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:NO], NSFullScreenModeAllScreens, nil];
         [view enterFullScreenMode:screen withOptions:opts];
@@ -620,7 +620,7 @@
 JNF_COCOA_ENTER(env);
 
     NSView *view = (NSView *)jlong_to_ptr(viewPtr);
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [view exitFullScreenModeWithOptions:nil];
     }];
 
@@ -641,7 +641,7 @@
 JNF_COCOA_ENTER(env);
 
     NSView *view = (NSView *)jlong_to_ptr(viewPtr);
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         windowPtr = ptr_to_jlong([view window]);
     }];
 
@@ -672,6 +672,26 @@
 }
 
 /*
+ * Class:     sun_lwawt_macosx_CWrapper$NSView
+ * Method:    setHidden
+ * Signature: (JZ)V
+ */
+JNIEXPORT void JNICALL
+Java_sun_lwawt_macosx_CWrapper_00024NSView_setHidden
+(JNIEnv *env, jclass cls, jlong viewPtr, jboolean toHide)
+{    
+    JNF_COCOA_ENTER(env);
+    
+    NSView *view = (NSView *)jlong_to_ptr(viewPtr);
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
+        [view setHidden:(BOOL)toHide];
+    }];
+    
+    JNF_COCOA_EXIT(env);
+}
+
+
+/*
  * Class:     sun_lwawt_macosx_CWrapper$NSScreen
  * Method:    frame
  * Signature: (J)Ljava/awt/Rectangle;
@@ -687,7 +707,7 @@
     __block NSRect rect = NSZeroRect;
 
     NSScreen *screen = (NSScreen *)jlong_to_ptr(screenPtr);
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         rect = [screen frame];
     }];
 
@@ -714,7 +734,7 @@
     __block NSRect rect = NSZeroRect;
 
     NSScreen *screen = (NSScreen *)jlong_to_ptr(screenPtr);
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         rect = [screen visibleFrame];
     }];
 
@@ -738,7 +758,7 @@
 
 JNF_COCOA_ENTER(env);
 
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         NSArray *screens = [NSScreen screens];
         for (NSScreen *screen in screens) {
             NSDictionary *screenInfo = [screen deviceDescription];
@@ -769,7 +789,7 @@
 
 JNF_COCOA_ENTER(env);
 
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         clearColorPtr = ptr_to_jlong([NSColor clearColor]);
     }];
 
--- a/src/macosx/native/sun/awt/JavaComponentAccessibility.m	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/native/sun/awt/JavaComponentAccessibility.m	Fri Jun 21 19:11:42 2013 -0700
@@ -1113,18 +1113,10 @@
     JNIEnv *env = [ThreadUtilities getJNIEnv];
     id value = nil;
 
-    // This code frequently gets called indirectly by Java when VoiceOver is active.
-    // Basically, we just have to know when we going to be a bad state, and do something "special".
-    // Note that while NSApplication isn't technically correct, we post a focus changed notification
-    // (which will call this method, but with the correct codepath) shortly afterwards. See +postFocusChanged.
-    if (sInPerformFromJava) {
-        return [NSApplication sharedApplication];
-    } else {
-        jobject focused = JNFCallStaticObjectMethod(env, jm_getFocusOwner, fComponent); // AWT_THREADING Safe (AWTRunLoop)
-        if (focused != NULL) {
-            if (JNFIsInstanceOf(env, focused, &sjc_Accessible)) {
-                value = [JavaComponentAccessibility createWithAccessible:focused withEnv:env withView:fView];
-            }
+    jobject focused = JNFCallStaticObjectMethod(env, jm_getFocusOwner, fComponent); // AWT_THREADING Safe (AWTRunLoop)
+    if (focused != NULL) {
+        if (JNFIsInstanceOf(env, focused, &sjc_Accessible)) {
+            value = [JavaComponentAccessibility createWithAccessible:focused withEnv:env withView:fView];
         }
     }
 
@@ -1147,10 +1139,9 @@
 JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CAccessibility_focusChanged
 (JNIEnv *env, jobject jthis)
 {
-    AWT_ASSERT_NOT_APPKIT_THREAD;
 
 JNF_COCOA_ENTER(env);
-    [ThreadUtilities performOnMainThread:@selector(postFocusChanged:) onObject:[JavaComponentAccessibility class] withObject:nil waitUntilDone:NO awtMode:NO];
+    [ThreadUtilities performOnMainThread:@selector(postFocusChanged:) on:[JavaComponentAccessibility class] withObject:nil waitUntilDone:NO];
 JNF_COCOA_EXIT(env);
 }
 
@@ -1164,9 +1155,8 @@
 JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CAccessible_valueChanged
 (JNIEnv *env, jclass jklass, jlong element)
 {
-    AWT_ASSERT_NOT_APPKIT_THREAD;
 JNF_COCOA_ENTER(env);
-    [ThreadUtilities performOnMainThread:@selector(postValueChanged) onObject:(JavaComponentAccessibility *)jlong_to_ptr(element) withObject:nil waitUntilDone:NO awtMode:NO];
+    [ThreadUtilities performOnMainThread:@selector(postValueChanged) on:(JavaComponentAccessibility *)jlong_to_ptr(element) withObject:nil waitUntilDone:NO];
 JNF_COCOA_EXIT(env);
 }
 
@@ -1178,9 +1168,8 @@
 JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CAccessible_selectionChanged
 (JNIEnv *env, jclass jklass, jlong element)
 {
-    AWT_ASSERT_NOT_APPKIT_THREAD;
 JNF_COCOA_ENTER(env);
-    [ThreadUtilities performOnMainThread:@selector(postSelectionChanged) onObject:(JavaComponentAccessibility *)jlong_to_ptr(element) withObject:nil waitUntilDone:NO awtMode:NO];
+    [ThreadUtilities performOnMainThread:@selector(postSelectionChanged) on:(JavaComponentAccessibility *)jlong_to_ptr(element) withObject:nil waitUntilDone:NO];
 JNF_COCOA_EXIT(env);
 }
 
@@ -1193,9 +1182,8 @@
 JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CAccessible_unregisterFromCocoaAXSystem
 (JNIEnv *env, jclass jklass, jlong element)
 {
-    AWT_ASSERT_NOT_APPKIT_THREAD;
 JNF_COCOA_ENTER(env);
-    [ThreadUtilities performOnMainThread:@selector(unregisterFromCocoaAXSystem) onObject:(JavaComponentAccessibility *)jlong_to_ptr(element) withObject:nil waitUntilDone:NO awtMode:NO];
+    [ThreadUtilities performOnMainThread:@selector(unregisterFromCocoaAXSystem) on:(JavaComponentAccessibility *)jlong_to_ptr(element) withObject:nil waitUntilDone:NO];
 JNF_COCOA_EXIT(env);
 }
 
--- a/src/macosx/native/sun/awt/LWCToolkit.h	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/native/sun/awt/LWCToolkit.h	Fri Jun 21 19:11:42 2013 -0700
@@ -44,8 +44,6 @@
 + (void) eventCountPlusPlus;
 @end
 
-CGDirectDisplayID FindCGDirectDisplayIDForScreenIndex(jint screenIndex);
-
 /*
  * Utility Macros
  */
--- a/src/macosx/native/sun/awt/LWCToolkit.m	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/native/sun/awt/LWCToolkit.m	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -179,40 +179,6 @@
     NSBeep(); // produces both sound and visual flash, if configured in System Preferences
 }
 
-CGDirectDisplayID
-FindCGDirectDisplayIDForScreenIndex(jint screenIndex)
-{
-    // most common case - just one monitor
-    CGDirectDisplayID screenID = CGMainDisplayID();
-
-    CGDisplayCount displayCount = 0;
-    CGGetOnlineDisplayList(0, NULL, &displayCount);
-
-    if ((displayCount > 1) &&
-        (screenIndex >= 0) &&
-        (screenIndex < (jint)displayCount))
-    {
-        if (displayCount < 10) {
-            // stack allocated optimization for less than 10 monitors
-            CGDirectDisplayID onlineDisplays[displayCount];
-            CGGetOnlineDisplayList(displayCount, onlineDisplays, &displayCount);
-            screenID = (CGDirectDisplayID)onlineDisplays[screenIndex];
-        } else {
-            CGDirectDisplayID *onlineDisplays =
-                SAFE_SIZE_ARRAY_ALLOC(malloc,
-                        displayCount, sizeof(CGDirectDisplayID));
-            if (onlineDisplays != NULL) {
-                CGGetOnlineDisplayList(displayCount, onlineDisplays,
-                                       &displayCount);
-                screenID = (CGDirectDisplayID)onlineDisplays[screenIndex];
-                free(onlineDisplays);
-            }
-        }
-    }
-
-    return screenID;
-}
-
 /*
  * Class:     sun_lwawt_macosx_LWCToolkit
  * Method:    initIDs
@@ -335,7 +301,7 @@
  * Signature: (JZZ)V
  */
 JNIEXPORT void JNICALL Java_sun_lwawt_macosx_LWCToolkit_doAWTRunLoop
-(JNIEnv *env, jclass clz, jlong mediator, jboolean awtMode, jboolean detectDeadlocks)
+(JNIEnv *env, jclass clz, jlong mediator, jboolean processEvents)
 {
 AWT_ASSERT_APPKIT_THREAD;
 JNF_COCOA_ENTER(env);
@@ -344,26 +310,25 @@
 
     if (mediatorObject == nil) return;
 
-    if (!sInPerformFromJava || !detectDeadlocks) {
-
-        NSRunLoop *currentRunLoop = [NSRunLoop currentRunLoop];
-        NSDate *distantFuture = [NSDate distantFuture];
-        NSString *mode = (awtMode) ? [JNFRunLoop javaRunLoopMode] : NSDefaultRunLoopMode;
+    // Don't use acceptInputForMode because that doesn't setup autorelease pools properly
+    BOOL isRunning = true;
+    while (![mediatorObject shouldEndRunLoop] && isRunning) {
+        isRunning = [[NSRunLoop currentRunLoop] runMode:[JNFRunLoop javaRunLoopMode]
+                                             beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.010]];
+        if (processEvents) {
+            //We do not spin a runloop here as date is nil, so does not matter which mode to use
+            NSEvent *event;
+            if ((event = [NSApp nextEventMatchingMask:NSAnyEventMask
+                                           untilDate:nil
+                                              inMode:NSDefaultRunLoopMode
+                                             dequeue:YES]) != nil) {
+                [NSApp sendEvent:event];
+            }
 
-        BOOL isRunning = YES;
-        while (isRunning && ![mediatorObject shouldEndRunLoop]) {
-            // Don't use acceptInputForMode because that doesn't setup autorelease pools properly
-            isRunning = [currentRunLoop runMode:mode beforeDate:distantFuture];
         }
-
     }
-#ifndef PRODUCT_BUILD
-    if (sInPerformFromJava) {
-        NSLog(@"Apple AWT: Short-circuiting CToolkit.invokeAndWait trampoline deadlock!!!!!");
-        NSLog(@"\tPlease file a bug report with this message and a reproducible test case.");
-    }
-#endif
 
+   
     CFRelease(mediatorObject);
 
 JNF_COCOA_EXIT(env);
@@ -382,7 +347,7 @@
 
     AWTRunLoopObject* mediatorObject = (AWTRunLoopObject*)jlong_to_ptr(mediator);
 
-    [ThreadUtilities performOnMainThread:@selector(endRunLoop) onObject:mediatorObject withObject:nil waitUntilDone:NO awtMode:YES];
+    [ThreadUtilities performOnMainThread:@selector(endRunLoop) on:mediatorObject withObject:nil waitUntilDone:NO];
 
     CFRelease(mediatorObject);
 
@@ -418,13 +383,9 @@
 
 JNF_COCOA_ENTER(env);
 
-    if ([NSThread isMainThread]) {
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^() {
         active = (jboolean)[NSRunningApplication currentApplication].active;
-    } else {
-        [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^() {
-            active = (jboolean)[NSRunningApplication currentApplication].active;
-        }];
-    }
+    }];
 
 JNF_COCOA_EXIT(env);
 
@@ -470,31 +431,4 @@
 
 }
 
-/*
- * Class:     sun_lwawt_macosx_LWCToolkit
- * Method:    startNativeNestedEventLoop
- * Signature: ()V
- */
-JNIEXPORT void JNICALL Java_sun_lwawt_macosx_LWCToolkit_startNativeNestedEventLoop
-(JNIEnv *env, jclass cls)
-{
-    // Simply get the next event in native loop and pass it to execution
-    // We'll be called repeatedly so there's no need to block here
-    NSRunLoop *theRL = [NSRunLoop currentRunLoop];
-    NSApplication * app = [NSApplication sharedApplication];
-    NSEvent * event = [app nextEventMatchingMask: 0xFFFFFFFF untilDate:nil inMode:NSDefaultRunLoopMode dequeue:YES];
-    if (event != nil) {
-        [app sendEvent: event];
-    }
-}
 
-/*
- * Class:     sun_lwawt_macosx_LWCToolkit
- * Method:    stopNativeNestedEventLoop
- * Signature: ()V
- */
-JNIEXPORT void JNICALL Java_sun_lwawt_macosx_LWCToolkit_stopNativeNestedEventLoop
-(JNIEnv *env, jclass cls)
-{
-//    At this moment it seems that this method should be no-op
-}
--- a/src/macosx/native/sun/awt/awt.m	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/native/sun/awt/awt.m	Fri Jun 21 19:11:42 2013 -0700
@@ -42,6 +42,15 @@
 // The symbol is defined in libosxapp.dylib (ThreadUtilities.m)
 extern JavaVM *jvm;
 
+// Indicates if AWT is running embedded (in SWT, FX, elsewhere)
+static BOOL isEmbedded = NO;
+
+// Indicates that the app has been started with -XstartOnFirstThread
+// (directly or via WebStart settings), and AWT should not run its
+// own event loop in this mode. Even if a loop isn't running yet,
+// we expect an embedder (e.g. SWT) to start it some time later.
+static BOOL forceEmbeddedMode = NO;
+
 static bool ShouldPrintVerboseDebugging() {
     static int debug = -1;
     if (debug == -1) {
@@ -63,63 +72,63 @@
 static CFRunLoopObserverRef busyObserver = NULL;
 static CFRunLoopObserverRef notBusyObserver = NULL;
 
-static void setUpAWTAppKit(BOOL swt_mode, BOOL headless) {
-AWT_ASSERT_APPKIT_THREAD;
+static void setUpAWTAppKit()
+{
     BOOL verbose = ShouldPrintVerboseDebugging();
     if (verbose) AWT_DEBUG_LOG(@"setting up busy observers");
 
-    JNIEnv *env = [ThreadUtilities getJNIEnv];
-
-    if (!headless) {
-        // Add CFRunLoopObservers to call into AWT so that AWT knows that the
-        //  AWT thread (which is the AppKit main thread) is alive. This way AWT
-        //  will not automatically shutdown.
-        busyObserver = CFRunLoopObserverCreate(
-                NULL,                        // CFAllocator
-                kCFRunLoopAfterWaiting,      // CFOptionFlags
-                true,                        // repeats
-                NSIntegerMax,                // order
-                &BusyObserver,               // CFRunLoopObserverCallBack
-                NULL);                       // CFRunLoopObserverContext
+    // Add CFRunLoopObservers to call into AWT so that AWT knows that the
+    //  AWT thread (which is the AppKit main thread) is alive. This way AWT
+    //  will not automatically shutdown.
+    busyObserver = CFRunLoopObserverCreate(
+            NULL,                        // CFAllocator
+            kCFRunLoopAfterWaiting,      // CFOptionFlags
+            true,                        // repeats
+            NSIntegerMax,                // order
+            &BusyObserver,               // CFRunLoopObserverCallBack
+            NULL);                       // CFRunLoopObserverContext
 
-        notBusyObserver = CFRunLoopObserverCreate(
-                NULL,                        // CFAllocator
-                kCFRunLoopBeforeWaiting,     // CFOptionFlags
-                true,                        // repeats
-                NSIntegerMin,                // order
-                &NotBusyObserver,            // CFRunLoopObserverCallBack
-                NULL);                       // CFRunLoopObserverContext
+    notBusyObserver = CFRunLoopObserverCreate(
+            NULL,                        // CFAllocator
+            kCFRunLoopBeforeWaiting,     // CFOptionFlags
+            true,                        // repeats
+            NSIntegerMin,                // order
+            &NotBusyObserver,            // CFRunLoopObserverCallBack
+            NULL);                       // CFRunLoopObserverContext
 
-        CFRunLoopRef runLoop = [[NSRunLoop currentRunLoop] getCFRunLoop];
-        CFRunLoopAddObserver(runLoop, busyObserver, kCFRunLoopDefaultMode);
-        CFRunLoopAddObserver(runLoop, notBusyObserver, kCFRunLoopDefaultMode);
+    CFRunLoopRef runLoop = [[NSRunLoop currentRunLoop] getCFRunLoop];
+    CFRunLoopAddObserver(runLoop, busyObserver, kCFRunLoopDefaultMode);
+    CFRunLoopAddObserver(runLoop, notBusyObserver, kCFRunLoopDefaultMode);
+
+    CFRelease(busyObserver);
+    CFRelease(notBusyObserver);
 
-        CFRelease(busyObserver);
-        CFRelease(notBusyObserver);
+    setBusy(YES);
+}
 
-        setBusy(YES);
-    }
+static void setUpAppKitThreadName()
+{
+    BOOL verbose = ShouldPrintVerboseDebugging();
+    JNIEnv *env = [ThreadUtilities getJNIEnv];
 
     // Set the java name of the AppKit main thread appropriately.
     jclass threadClass = NULL;
     jstring name = NULL;
     jobject curThread = NULL;
 
-    if (!swt_mode) {
-        threadClass = (*env)->FindClass(env, "java/lang/Thread");
-        if (threadClass == NULL || (*env)->ExceptionCheck(env)) goto cleanup;
-        jmethodID currentThreadID = (*env)->GetStaticMethodID(env, threadClass, "currentThread", "()Ljava/lang/Thread;");
-        if (currentThreadID == NULL || (*env)->ExceptionCheck(env)) goto cleanup;
-        jmethodID setName = (*env)->GetMethodID(env, threadClass, "setName", "(Ljava/lang/String;)V");
-        if (setName == NULL || (*env)->ExceptionCheck(env)) goto cleanup;
+    threadClass = (*env)->FindClass(env, "java/lang/Thread");
+    if (threadClass == NULL || (*env)->ExceptionCheck(env)) goto cleanup;
+    jmethodID currentThreadID = (*env)->GetStaticMethodID(env, threadClass, "currentThread", "()Ljava/lang/Thread;");
+    if (currentThreadID == NULL || (*env)->ExceptionCheck(env)) goto cleanup;
+    jmethodID setName = (*env)->GetMethodID(env, threadClass, "setName", "(Ljava/lang/String;)V");
+    if (setName == NULL || (*env)->ExceptionCheck(env)) goto cleanup;
 
-        curThread = (*env)->CallStaticObjectMethod(env, threadClass, currentThreadID); // AWT_THREADING Safe (known object)
-        if (curThread == NULL || (*env)->ExceptionCheck(env)) goto cleanup;
-        name = (*env)->NewStringUTF(env, "AWT-AppKit");
-        if (name == NULL || (*env)->ExceptionCheck(env)) goto cleanup;
-        (*env)->CallVoidMethod(env, curThread, setName, name); // AWT_THREADING Safe (known object)
-        if ((*env)->ExceptionCheck(env)) goto cleanup;
-    }
+    curThread = (*env)->CallStaticObjectMethod(env, threadClass, currentThreadID); // AWT_THREADING Safe (known object)
+    if (curThread == NULL || (*env)->ExceptionCheck(env)) goto cleanup;
+    name = (*env)->NewStringUTF(env, "AWT-AppKit");
+    if (name == NULL || (*env)->ExceptionCheck(env)) goto cleanup;
+    (*env)->CallVoidMethod(env, curThread, setName, name); // AWT_THREADING Safe (known object)
+    if ((*env)->ExceptionCheck(env)) goto cleanup;
 
 cleanup:
     if (threadClass != NULL) {
@@ -136,14 +145,10 @@
         (*env)->ExceptionClear(env);
     }
 
-    // Add the exception handler of last resort
-    NSSetUncaughtExceptionHandler(AWT_NSUncaughtExceptionHandler);
-
     if (verbose) AWT_DEBUG_LOG(@"finished setting thread name");
 }
 
 
-
 // Returns true if java believes it is running headless
 BOOL isHeadless(JNIEnv *env) {
     // Just access the property directly, instead of using GraphicsEnvironment.isHeadless.
@@ -202,7 +207,7 @@
 
 // This is an empty Obj-C object just so that -peformSelectorOnMainThread can be used.
 @interface AWTStarter : NSObject { }
-+ (void)start:(BOOL)headless swtMode:(BOOL)swtMode swtModeForWebStart:(BOOL)swtModeForWebStart;
++ (void)start:(BOOL)headless;
 - (void)starter:(NSArray*)args;
 + (void)appKitIsRunning:(id)arg;
 @end
@@ -244,7 +249,7 @@
     if (verbose) AWT_DEBUG_LOG(@"finished messaging AppKit started");
 }
 
-+ (void)start:(BOOL)headless swtMode:(BOOL)swtMode swtModeForWebStart:(BOOL)swtModeForWebStart
++ (void)start:(BOOL)headless
 {
     BOOL verbose = ShouldPrintVerboseDebugging();
 
@@ -260,7 +265,7 @@
     BOOL onMainThread = (pthread_main_np() != 0);
 
     if (verbose) {
-        NSString *msg = [NSString stringWithFormat:@"+[AWTStarter start headless:%d swtMode:%d swtModeForWebStart:%d] { onMainThread:%d }", headless, swtMode, swtModeForWebStart, onMainThread];
+        NSString *msg = [NSString stringWithFormat:@"+[AWTStarter start headless:%d] { onMainThread:%d }", headless, onMainThread];
         AWT_DEBUG_LOG(msg);
     }
 
@@ -282,9 +287,7 @@
 
     NSArray * args = [NSArray arrayWithObjects:
                       [NSNumber numberWithBool: onMainThread],
-                      [NSNumber numberWithBool: swtMode],
                       [NSNumber numberWithBool: headless],
-                      [NSNumber numberWithBool: swtModeForWebStart],
                       [NSNumber numberWithBool: verbose],
                       nil];
 
@@ -313,14 +316,9 @@
         // Don't set the delegate until the NSApplication has been created and
         // its finishLaunching has initialized it.
         //  ApplicationDelegate is the support code for com.apple.eawt.
-        void (^setDelegateBlock)() = ^(){
+        [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
             OSXAPP_SetApplicationDelegate([ApplicationDelegate sharedDelegate]);
-        };
-        if (onMainThread) {
-            setDelegateBlock();
-        } else {
-            [JNFRunLoop performOnMainThreadWaiting:YES withBlock:setDelegateBlock];
-        }
+        }];        
     }
 }
 
@@ -328,25 +326,29 @@
     NSAutoreleasePool *pool = [NSAutoreleasePool new];
 
     BOOL onMainThread = [[args objectAtIndex:0] boolValue];
-    BOOL swtMode = [[args objectAtIndex:1] boolValue];
-    BOOL headless = [[args objectAtIndex:2] boolValue];
-    BOOL swtModeForWebStart = [[args objectAtIndex:3] boolValue];
-    BOOL verbose = [[args objectAtIndex:4] boolValue];
+    BOOL headless = [[args objectAtIndex:1] boolValue];
+    BOOL verbose = [[args objectAtIndex:2] boolValue];
 
     BOOL wasOnMainThread = onMainThread;
 
-    setUpAWTAppKit(swtMode, headless);
+    // Add the exception handler of last resort
+    NSSetUncaughtExceptionHandler(AWT_NSUncaughtExceptionHandler);
 
     // Headless mode trumps either ordinary AWT or SWT-in-AWT mode.  Declare us a daemon and return.
     if (headless) {
-        BOOL didBecomeDaemon = [AWTStarter markAppAsDaemon];
+        if (!forceEmbeddedMode) {
+            setUpAppKitThreadName();
+        }
+        [AWTStarter markAppAsDaemon];
         return;
     }
 
-    if (swtMode || swtModeForWebStart) {
+    if (forceEmbeddedMode) {
         if (verbose) NSLog(@"in SWT or SWT/WebStart mode");
 
-        // The SWT should call NSApplicationLoad, but they don't know a priori that they will be using the AWT, so they don't.
+        // Init a default NSApplication instance instead of the NSApplicationAWT.
+        // Note that [NSApp isRunning] will return YES after that, though
+        // this behavior isn't specified anywhere. We rely on that.
         NSApplicationLoad();
     }
 
@@ -355,6 +357,13 @@
     //  and -[NSApplication isRunning] returns YES, AWT is embedded inside another
     //  AppKit Application.
     NSApplication *app = [NSApplicationAWT sharedApplication];
+    isEmbedded = ![NSApp isKindOfClass:[NSApplicationAWT class]];
+
+    if (!isEmbedded) {
+        // Install run loop observers and set the AppKit Java thread name
+        setUpAWTAppKit();
+        setUpAppKitThreadName();
+    }
 
     // AWT gets to this point BEFORE NSApplicationDidFinishLaunchingNotification is sent.
     if (![app isRunning]) {
@@ -364,16 +373,11 @@
         [NSApplicationAWT runAWTLoopWithApp: app];
     } else {
         // We're either embedded, or showing a splash screen
-        if (![NSApp isKindOfClass:[NSApplicationAWT class]]) {
+        if (isEmbedded) {
             if (verbose) AWT_DEBUG_LOG(@"running embedded");
 
-            // Since we're embedded, no need to be swamping the runloop with the observers.
-            CFRunLoopRef runLoop = [[NSRunLoop currentRunLoop] getCFRunLoop];
-            CFRunLoopRemoveObserver(runLoop, busyObserver, kCFRunLoopDefaultMode);
-            CFRunLoopRemoveObserver(runLoop, notBusyObserver, kCFRunLoopDefaultMode);
-
-            busyObserver = NULL;
-            notBusyObserver = NULL;
+            // We don't track if the runloop is busy, so set it free to let AWT finish when it needs
+            setBusy(NO);
         } else {
             if (verbose) AWT_DEBUG_LOG(@"running after showing a splash screen");
         }
@@ -411,49 +415,28 @@
         return JNI_VERSION_1_4;
     }
 
-    // The following is true when AWT is attempting to connect to the window server
-    // when it isn't set up properly to do so.
-    // BOOL AWTLoadFailure = YES;    For now we are skipping this check so i'm commenting out this variable as unused
 JNF_COCOA_ENTER(env);
 
-    // If -XstartOnFirstThread was used at invocation time, an environment variable will be set.
-    // (See java_md.c for the matching setenv call.) When that happens, we assume the SWT will be in use.
-    BOOL swt_compatible_mode = NO;
-
+    // Launcher sets this env variable if -XstartOnFirstThread is specified
     char envVar[80];
     snprintf(envVar, sizeof(envVar), "JAVA_STARTED_ON_FIRST_THREAD_%d", getpid());
     if (getenv(envVar) != NULL) {
-        swt_compatible_mode = YES;
+        forceEmbeddedMode = YES;
         unsetenv(envVar);
     }
 
-    BOOL swt_in_webstart = isSWTInWebStart(env);
-    BOOL headless = isHeadless(env);
+    if (isSWTInWebStart(env)) {
+        forceEmbeddedMode = YES;
+    }
 
-    // Make sure we're on the right thread.  If not, we still need the JNIEnv to throw an exception.
-    if (pthread_main_np() != 0 && !swt_compatible_mode && !headless) {
-        AWT_DEBUG_LOG(@"Apple AWT Java VM was loaded on first thread -- can't start AWT.");
-        [JNFException raise:env as:kInternalError reason:"Can't start the AWT because Java was started on the first thread.  Make sure StartOnFirstThread is "
-         "not specified in your application's Info.plist or on the command line"];
-        return JNI_VERSION_1_4;
-    }
+    BOOL headless = isHeadless(env);
 
     // We need to let Foundation know that this is a multithreaded application, if it isn't already.
     if (![NSThread isMultiThreaded]) {
         [NSThread detachNewThreadSelector:nil toTarget:nil withObject:nil];
     }
 
-//    if (swt_compatible_mode || headless || [AWTStarter isConnectedToWindowServer] || [AWTStarter isRemoteSession]) {
-// No need in this check - we will try to launch AWTStarter anyways - to be able to run GUI application remotely
-//        AWTLoadFailure = NO;
-
-    [AWTStarter start:headless swtMode:swt_compatible_mode swtModeForWebStart:swt_in_webstart];
-
-//    }
-
-/*    if (AWTLoadFailure) { // We will not reach this code anyways
-        [JNFException raise:env as:kInternalError reason:"Can't connect to window server - not enough permissions."];
-    } */
+    [AWTStarter start:headless];
 
 JNF_COCOA_EXIT(env);
 
--- a/src/macosx/native/sun/awt/jawt.m	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/native/sun/awt/jawt.m	Fri Jun 21 19:11:42 2013 -0700
@@ -24,9 +24,7 @@
  */
 
 #import <jawt.h>
-
-// REMIND: import <jawt_md.h>
-#import <JavaVM/jawt_md.h>
+#import <jawt_md.h>
 
 #import "awt_DrawingSurface.h"
 
--- a/src/macosx/native/sun/font/CoreTextSupport.h	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/native/sun/font/CoreTextSupport.h	Fri Jun 21 19:11:42 2013 -0700
@@ -24,7 +24,7 @@
  */
 
 #import <Cocoa/Cocoa.h>
-#import <JavaVM/jni.h>
+#import <jni.h>
 #import <JavaRuntimeSupport/JavaRuntimeSupport.h>
 
 #include "AWTFont.h"
--- a/src/macosx/native/sun/java2d/opengl/CGLGraphicsConfig.m	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/native/sun/java2d/opengl/CGLGraphicsConfig.m	Fri Jun 21 19:11:42 2013 -0700
@@ -190,12 +190,12 @@
 JNIEXPORT jlong JNICALL
 Java_sun_java2d_opengl_CGLGraphicsConfig_getCGLConfigInfo
     (JNIEnv *env, jclass cglgc,
-     jint screennum, jint pixfmt, jint swapInterval)
+     jint displayID, jint pixfmt, jint swapInterval)
 {
   jlong ret = 0L;
   JNF_COCOA_ENTER(env);
   NSMutableArray * retArray = [NSMutableArray arrayWithCapacity:3];
-  [retArray addObject: [NSNumber numberWithInt: (int)screennum]];
+  [retArray addObject: [NSNumber numberWithInt: (int)displayID]];
   [retArray addObject: [NSNumber numberWithInt: (int)pixfmt]];
   [retArray addObject: [NSNumber numberWithInt: (int)swapInterval]];
   if ([NSThread isMainThread]) {
@@ -215,7 +215,7 @@
 + (void) _getCGLConfigInfo: (NSMutableArray *)argValue {
     AWT_ASSERT_APPKIT_THREAD;
 
-    jint screennum = (jint)[(NSNumber *)[argValue objectAtIndex: 0] intValue];
+    jint displayID = (jint)[(NSNumber *)[argValue objectAtIndex: 0] intValue];
     jint pixfmt = (jint)[(NSNumber *)[argValue objectAtIndex: 1] intValue];
     jint swapInterval = (jint)[(NSNumber *)[argValue objectAtIndex: 2] intValue];
     JNIEnv *env = [ThreadUtilities getJNIEnvUncached];
@@ -228,16 +228,11 @@
     CGOpenGLDisplayMask glMask = (CGOpenGLDisplayMask)pixfmt;
     if (sharedContext == NULL) {
         if (glMask == 0) {
-            CGDirectDisplayID id =
-                FindCGDirectDisplayIDForScreenIndex(screennum);
-            glMask = CGDisplayIDToOpenGLDisplayMask(id);
+            glMask = CGDisplayIDToOpenGLDisplayMask(displayID);
         }
 
         NSOpenGLPixelFormatAttribute attrs[] = {
             NSOpenGLPFAClosestPolicy,
-            NSOpenGLPFANoRecovery,
-            NSOpenGLPFAAccelerated,
-            NSOpenGLPFAFullScreen,
             NSOpenGLPFAWindow,
             NSOpenGLPFAPixelBuffer,
             NSOpenGLPFADoubleBuffer,
@@ -410,7 +405,7 @@
         return;
     }
     memset(cglinfo, 0, sizeof(CGLGraphicsConfigInfo));
-    cglinfo->screen = screennum;
+    cglinfo->screen = displayID;
     cglinfo->pixfmt = sharedPixelFormat;
     cglinfo->context = oglc;
 
@@ -420,17 +415,6 @@
 }
 @end //GraphicsConfigUtil
 
-
-JNIEXPORT jint JNICALL
-Java_sun_java2d_opengl_CGLGraphicsConfig_getDefaultPixFmt
-    (JNIEnv *env, jclass cglgc, jint screennum)
-{
-    J2dTraceLn(J2D_TRACE_INFO, "CGLGraphicsConfig_getDefaultPixFmt");
-
-    CGDirectDisplayID id = FindCGDirectDisplayIDForScreenIndex(screennum);
-    return (jint)CGDisplayIDToOpenGLDisplayMask(id);
-}
-
 JNIEXPORT jint JNICALL
 Java_sun_java2d_opengl_CGLGraphicsConfig_getOGLCapabilities
     (JNIEnv *env, jclass cglgc, jlong configInfo)
--- a/src/macosx/native/sun/java2d/opengl/CGLLayer.m	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/native/sun/java2d/opengl/CGLLayer.m	Fri Jun 21 19:11:42 2013 -0700
@@ -57,9 +57,23 @@
 
     // NOTE: async=YES means that the layer is re-cached periodically
     self.asynchronous = FALSE;
-    self.autoresizingMask = kCALayerWidthSizable | kCALayerHeightSizable;
     self.contentsGravity = kCAGravityTopLeft;
-    self.needsDisplayOnBoundsChange = YES;
+    //Layer backed view
+    //self.needsDisplayOnBoundsChange = YES;
+    //self.autoresizingMask = kCALayerWidthSizable | kCALayerHeightSizable;
+
+    //Disable CALayer's default animation
+    NSMutableDictionary * actions = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
+                                    [NSNull null], @"bounds",
+                                    [NSNull null], @"contents",
+                                    [NSNull null], @"contentsScale",
+                                    [NSNull null], @"onOrderIn",
+                                    [NSNull null], @"onOrderOut",
+                                    [NSNull null], @"sublayers",
+                                    nil];
+    self.actions = actions;
+    [actions release];
+
     textureID = 0; // texture will be created by rendering pipe
     target = 0;
 
@@ -109,6 +123,10 @@
     glDisable(target);
 }
 
+-(BOOL)canDrawInCGLContext:(CGLContextObj)glContext pixelFormat:(CGLPixelFormatObj)pixelFormat forLayerTime:(CFTimeInterval)timeInterval displayTime:(const CVTimeStamp *)timeStamp{
+    return textureID == 0 ? NO : YES;
+}
+
 -(void)drawInCGLContext:(CGLContextObj)glContext pixelFormat:(CGLPixelFormatObj)pixelFormat forLayerTime:(CFTimeInterval)timeInterval displayTime:(const CVTimeStamp *)timeStamp
 {
     AWT_ASSERT_APPKIT_THREAD;
@@ -116,8 +134,12 @@
     // Set the current context to the one given to us.
     CGLSetCurrentContext(glContext);
 
+    // Should clear the whole CALayer, because it can be larger than our texture.
+    glClearColor(0.0, 0.0, 0.0, 0.0);
+    glClear(GL_COLOR_BUFFER_BIT);
+
     glViewport(0, 0, textureWidth, textureHeight);
-
+    
     JNIEnv *env = [ThreadUtilities getJNIEnv];
     static JNF_CLASS_CACHE(jc_JavaLayer, "sun/java2d/opengl/CGLLayer");
     static JNF_MEMBER_CACHE(jm_drawInCGLContext, jc_JavaLayer, "drawInCGLContext", "()V");
@@ -146,16 +168,15 @@
     __block CGLLayer *layer = nil;
 
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
     JNFJObjectWrapper *javaLayer = [JNFJObjectWrapper wrapperWithJObject:obj withEnv:env];
 
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
-
-        layer = [[CGLLayer alloc] initWithJavaLayer: javaLayer];
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
+            AWT_ASSERT_APPKIT_THREAD;
+        
+            layer = [[CGLLayer alloc] initWithJavaLayer: javaLayer];
     }];
-
+    
 JNF_COCOA_EXIT(env);
 
     return ptr_to_jlong(layer);
@@ -164,7 +185,7 @@
 // Must be called under the RQ lock.
 JNIEXPORT void JNICALL
 Java_sun_java2d_opengl_CGLLayer_validate
-(JNIEnv *env, jobject obj, jlong layerPtr, jobject surfaceData)
+(JNIEnv *env, jclass cls, jlong layerPtr, jobject surfaceData)
 {
     CGLLayer *layer = OBJC(layerPtr);
 
@@ -182,9 +203,25 @@
 // Must be called on the AppKit thread and under the RQ lock.
 JNIEXPORT void JNICALL
 Java_sun_java2d_opengl_CGLLayer_blitTexture
-(JNIEnv *env, jobject obj, jlong layerPtr)
+(JNIEnv *env, jclass cls, jlong layerPtr)
 {
     CGLLayer *layer = jlong_to_ptr(layerPtr);
 
     [layer blitTexture];
 }
+
+JNIEXPORT void JNICALL
+Java_sun_java2d_opengl_CGLLayer_nativeSetScale
+(JNIEnv *env, jclass cls, jlong layerPtr, jdouble scale)
+{
+    JNF_COCOA_ENTER(env);
+    CGLLayer *layer = jlong_to_ptr(layerPtr);
+    // We always call all setXX methods asynchronously, exception is only in 
+    // this method where we need to change native texture size and layer's scale
+    // in one call on appkit, otherwise we'll get window's contents blinking, 
+    // during screen-2-screen moving.
+    [ThreadUtilities performOnMainThreadWaiting:[NSThread isMainThread] block:^(){
+        layer.contentsScale = scale;
+    }];
+    JNF_COCOA_EXIT(env);
+}
--- a/src/macosx/native/sun/osxapp/QueuingApplicationDelegate.m	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/native/sun/osxapp/QueuingApplicationDelegate.m	Fri Jun 21 19:11:42 2013 -0700
@@ -110,8 +110,14 @@
 
 - (void)_handleOpenURLEvent:(NSAppleEventDescriptor *)openURLEvent withReplyEvent:(NSAppleEventDescriptor *)replyEvent
 {
+    // Make an explicit copy of the passed events as they may be invalidated by the time they're processed
+    NSAppleEventDescriptor *openURLEventCopy = [openURLEvent copy];
+    NSAppleEventDescriptor *replyEventCopy = [replyEvent copy];
+
     [self.queue addObject:[^(){
-        [self.realDelegate _handleOpenURLEvent:openURLEvent withReplyEvent:replyEvent];
+        [self.realDelegate _handleOpenURLEvent:openURLEventCopy withReplyEvent:replyEventCopy];
+        [openURLEventCopy release];
+        [replyEventCopy release];
     } copy]];
 }
 
--- a/src/macosx/native/sun/osxapp/ThreadUtilities.h	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/native/sun/osxapp/ThreadUtilities.h	Fri Jun 21 19:11:42 2013 -0700
@@ -98,8 +98,6 @@
     }                                          \
 } while (0)
 
-#define AWT_ASSERT_ANY_THREAD
-
 #endif /* AWT_THREAD_ASSERTS_MESSAGES */
 
 #ifdef AWT_THREAD_ASSERTS_WAIT
@@ -114,32 +112,25 @@
     while (pthread_main_np() != 0) {} \
 } while (0)
 
-#define AWT_ASSERT_ANY_THREAD
-
 #endif /* AWT_THREAD_ASSERTS_WAIT */
 
 #else /* AWT_THREAD_ASSERTS */
 
 #define AWT_ASSERT_APPKIT_THREAD     do {} while (0)
 #define AWT_ASSERT_NOT_APPKIT_THREAD do {} while (0)
-#define AWT_ASSERT_ANY_THREAD
 
 #endif /* AWT_THREAD_ASSERTS */
 // --------------------------------------------------------------------------
 
-// This tracks if we are current inside of a performOnMainThread that is both waiting and in the AWTRunLoopMode
-extern BOOL sInPerformFromJava;
-
-// This is an empty Obj-C object just so that -performSelectorOnMainThread
-// can be used, and to use the Obj-C +initialize feature.
 __attribute__((visibility("default")))
-@interface ThreadUtilities : NSObject { }
+@interface ThreadUtilities { }
 
 + (JNIEnv*)getJNIEnv;
 + (JNIEnv*)getJNIEnvUncached;
 
-+ (void)performOnMainThread:(SEL)aSelector onObject:(id)target withObject:(id)arg waitUntilDone:(BOOL)wait awtMode:(BOOL)inAWT;
-
+//Wrappers for the corresponding JNFRunLoop methods with a check for main thread
++ (void)performOnMainThreadWaiting:(BOOL)wait block:(void (^)())block;
++ (void)performOnMainThread:(SEL)aSelector on:(id)target withObject:(id)arg waitUntilDone:(BOOL)wait;
 @end
 
 void OSXAPP_SetJavaVM(JavaVM *vm);
--- a/src/macosx/native/sun/osxapp/ThreadUtilities.m	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/macosx/native/sun/osxapp/ThreadUtilities.m	Fri Jun 21 19:11:42 2013 -0700
@@ -34,166 +34,6 @@
 JavaVM *jvm = NULL;
 static JNIEnv *appKitEnv = NULL;
 
-static NSArray *sPerformModes = nil;
-static NSArray *sAWTPerformModes = nil;
-
-static BOOL sCocoaComponentCompatibility = NO;
-static NSTimeInterval sCocoaComponentCompatibilityTimeout = 0.5;
-static BOOL sLoggingEnabled = YES;
-
-#ifdef AWT_THREAD_ASSERTS_ENV_ASSERT
-int sAWTThreadAsserts = 0;
-#endif /* AWT_THREAD_ASSERTS_ENV_ASSERT */
-
-
-// This is for backward compatibility for those people using CocoaComponent
-// Since we've flipped the AWT threading model for Tiger (10.4), all the rules
-// for CocoaComponent are wrong.
-// So for existing CocoaComponent users, we can't be synchronous.
-// Making things totally asynchronous breaks a _lot_, so we try to be
-// synchronous and time out after a little bit.
-#define NOT_READY 0
-#define READY 1
-#define IN_PROGRESS 2
-
-BOOL sInPerformFromJava = NO;
-NSUInteger sPerformCount = 0;
-
-// This class is used so that performSelectorOnMainThread can be
-// controlled a little more easily by us.  It has 2 roles.
-// The first is to set/unset a flag (sInPerformFromJava) that code can
-// check to see if we are in a synchronous perform initiated by a java thread.
-// The second is to implement the CocoaComponent backward compatibility mode.
-@interface CPerformer : NSObject {
-    id fTarget;
-    SEL fSelector;
-    id fArg;
-    BOOL fWait;
-}
-
-- (id) initWithTarget:(id)target selector:(SEL)selector arg:(id)arg wait:(BOOL)wait;
-- (void) perform;
-- (void) performCompatible;
-- (void) _performCompatible:(NSConditionLock *)resultLock;
-@end
-
-
-@implementation CPerformer
-
-- (id) initWithTarget:(id)target selector:(SEL)selector arg:(id)arg {
-    return [self initWithTarget:target selector:selector arg:arg wait:YES];
-}
-
-- (id) initWithTarget:(id)target selector:(SEL)selector arg:(id)arg wait:(BOOL)wait {
-    self = [super init];
-    if (self != nil) {
-        fTarget = [target retain];
-        fSelector = selector;
-        fArg = [arg retain];
-        // Only set sInPerformFromJava if this is a synchronous perform
-        fWait = wait;
-    }
-    return self;
-}
-
-- (void) dealloc {
-    [fTarget release];
-    [fArg release];
-    [super dealloc];
-}
-//- (void)finalize { [super finalize]; }
-
-- (void) perform {
-    AWT_ASSERT_APPKIT_THREAD;
-
-    // If this is the first time we're going from java thread -> appkit thread,
-    // set sInPerformFromJava for the duration of the invocation
-    BOOL nestedPerform = sInPerformFromJava;
-    if (fWait) {
-        sInPerformFromJava = YES;
-    }
-
-    sPerformCount++;
-
-    // Actually do the work (cheat to avoid a method call)
-    @try {
-        objc_msgSend(fTarget, fSelector, fArg);
-        //[fTarget performSelector:fSelector withObject:fArg];
-    } @catch (NSException *e) {
-        NSLog(@"*** CPerformer: ignoring exception '%@' raised during perform of selector '%@' on target '%@' with args '%@'", e, NSStringFromSelector(fSelector), fTarget, fArg);
-    } @finally {
-        // If we actually set sInPerformFromJava, unset it now
-        if (!nestedPerform && fWait) {
-            sInPerformFromJava = NO;
-        }
-    }
-}
-
-- (void) performCompatible {
-    // We check if we are on the AppKit thread because frequently, apps
-    // using CocoaComponent are doing things on the wrong thread!
-    if (pthread_main_np()) {
-        [fTarget performSelector:fSelector withObject:fArg];
-    } else {
-        // Setup the lock
-        NSConditionLock *resultLock =
-            [[NSConditionLock alloc] initWithCondition:NOT_READY];
-
-        // Make sure that if we return early, nothing gets released out
-        // from under us
-        [resultLock retain];
-        [fTarget retain];
-        [fArg retain];
-        [self retain];
-        // Do an asynchronous perform to the main thread.
-        [self performSelectorOnMainThread:@selector(_performCompatible:)
-              withObject:resultLock waitUntilDone:NO modes:sAWTPerformModes];
-
-        // Wait for a little bit for it to finish
-        [resultLock lockWhenCondition:READY beforeDate:[NSDate dateWithTimeIntervalSinceNow:sCocoaComponentCompatibilityTimeout]];
-
-        // If the _performCompatible is actually in progress,
-        // we should let it finish
-        if ([resultLock condition] == IN_PROGRESS) {
-            [resultLock lockWhenCondition:READY];
-        }
-
-        if ([resultLock condition] == NOT_READY && sLoggingEnabled) {
-            NSLog(@"[Java CocoaComponent compatibility mode]: Operation timed out due to possible deadlock: selector '%@' on target '%@' with args '%@'", NSStringFromSelector(fSelector), fTarget, fArg);
-        }
-
-        [resultLock unlock];
-        [resultLock autorelease];
-    }
-}
-
-- (void) _performCompatible:(NSConditionLock *)resultLock {
-    // notify that the perform is in progress!
-    [resultLock lock];
-    [resultLock unlockWithCondition:IN_PROGRESS];
-
-    sPerformCount++;
-
-    // Actually do the work.
-    @try {
-        [fTarget performSelector:fSelector withObject:fArg];
-    } @catch (NSException *e) {
-        NSLog(@"*** CPerformer: ignoring exception '%@' raised during performCompatible of selector '%@' on target '%@' with args '%@'", e, NSStringFromSelector(fSelector), fTarget, fArg);
-    } @finally {
-        // notify done!
-        [resultLock lock];
-        [resultLock unlockWithCondition:READY];
-
-        // Clean up after ourselves
-        [resultLock autorelease];
-        [fTarget autorelease];
-        [fArg autorelease];
-        [self autorelease];
-    }
-}
-@end
-
-
 @implementation ThreadUtilities
 
 + (JNIEnv*)getJNIEnv {
@@ -210,38 +50,19 @@
     return env;
 }
 
-+ (void)initialize {
-    // Headless: BOTH
-    // Embedded: BOTH
-    // Multiple Calls: NO
-    // Caller: Obj-C class initialization
-    // Thread: ?
-
-    if (sPerformModes == nil) {
-        // Create list of Run Loop modes to perform on
-        // The default performSelector, with no mode argument, runs in Default,
-        // ModalPanel, and EventTracking modes
-        sPerformModes =    [[NSArray alloc] initWithObjects:NSDefaultRunLoopMode, NSModalPanelRunLoopMode, nil];
-        sAWTPerformModes = [[NSArray alloc] initWithObjects:NSDefaultRunLoopMode, NSModalPanelRunLoopMode, NSEventTrackingRunLoopMode, [JNFRunLoop javaRunLoopMode], nil];
-
-#ifdef AWT_THREAD_ASSERTS_ENV_ASSERT
-        sAWTThreadAsserts = (getenv("COCOA_AWT_DISABLE_THREAD_ASSERTS") == NULL);
-#endif /* AWT_THREAD_ASSERTS_ENV_ASSERT */
++ (void)performOnMainThreadWaiting:(BOOL)wait block:(void (^)())block {
+    if ([NSThread isMainThread] && wait == YES) {
+        block(); 
+    } else { 
+        [JNFRunLoop performOnMainThreadWaiting:wait withBlock:block]; 
     }
 }
 
-// These methods can behave slightly differently than the normal
-// performSelector...  In particular, we define a special runloop mode
-// (AWTRunLoopMode) so that we can "block" the main thread against the
-// java event thread without deadlocking. See CToolkit.invokeAndWait.
-+ (void)performOnMainThread:(SEL)aSelector onObject:(id)target withObject:(id)arg waitUntilDone:(BOOL)wait awtMode:(BOOL)inAWT {
-    CPerformer *performer = [[CPerformer alloc] initWithTarget:target selector:aSelector arg:arg wait:wait];
-    if (sCocoaComponentCompatibility && wait && inAWT) {
-        [performer performCompatible];
-        [performer autorelease];
++ (void)performOnMainThread:(SEL)aSelector on:(id)target withObject:(id)arg waitUntilDone:(BOOL)wait {
+    if ([NSThread isMainThread] && wait == YES) {
+        [target performSelector:aSelector withObject:arg];
     } else {
-        [performer performSelectorOnMainThread:@selector(perform) withObject:nil waitUntilDone:wait modes:((inAWT) ? sAWTPerformModes : sPerformModes)]; // AWT_THREADING Safe (cover method)
-        [performer release];
+        [JNFRunLoop performOnMainThread:aSelector on:target withObject:arg waitUntilDone:wait];
     }
 }
 
--- a/src/share/back/debugInit.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/back/debugInit.c	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -37,6 +37,7 @@
 #include "debugLoop.h"
 #include "bag.h"
 #include "invoker.h"
+#include "sys.h"
 
 /* How the options get to OnLoad: */
 #define XDEBUG "-Xdebug"
@@ -201,6 +202,8 @@
     jint              jvmtiCompileTimeMajorVersion;
     jint              jvmtiCompileTimeMinorVersion;
     jint              jvmtiCompileTimeMicroVersion;
+    char              *boot_path = NULL;
+    char              npt_lib[MAXPATHLEN];
 
     /* See if it's already loaded */
     if ( gdata!=NULL && gdata->isLoaded==JNI_TRUE ) {
@@ -227,18 +230,6 @@
     vmInitialized = JNI_FALSE;
     gdata->vmDead = JNI_FALSE;
 
-    /* Npt and Utf function init */
-    NPT_INITIALIZE(&(gdata->npt), NPT_VERSION, NULL);
-    if (gdata->npt == NULL) {
-        ERROR_MESSAGE(("JDWP: unable to initialize NPT library"));
-        return JNI_ERR;
-    }
-    gdata->npt->utf = (gdata->npt->utfInitialize)(NULL);
-    if (gdata->npt->utf == NULL) {
-        ERROR_MESSAGE(("JDWP: UTF function initialization failed"));
-        return JNI_ERR;
-    }
-
     /* Get the JVMTI Env, IMPORTANT: Do this first! For jvmtiAllocate(). */
     error = JVM_FUNC_PTR(vm,GetEnv)
                 (vm, (void **)&(gdata->jvmti), JVMTI_VERSION_1);
@@ -277,6 +268,24 @@
         forceExit(1); /* Kill entire process, no core dump wanted */
     }
 
+    JVMTI_FUNC_PTR(gdata->jvmti, GetSystemProperty)
+        (gdata->jvmti, (const char *)"sun.boot.library.path",
+         &boot_path);
+
+    dbgsysBuildLibName(npt_lib, sizeof(npt_lib), boot_path, NPT_LIBNAME);
+    /* Npt and Utf function init */
+    NPT_INITIALIZE(npt_lib, &(gdata->npt), NPT_VERSION, NULL);
+    jvmtiDeallocate(boot_path);
+    if (gdata->npt == NULL) {
+        ERROR_MESSAGE(("JDWP: unable to initialize NPT library"));
+        return JNI_ERR;
+    }
+    gdata->npt->utf = (gdata->npt->utfInitialize)(NULL);
+    if (gdata->npt->utf == NULL) {
+        ERROR_MESSAGE(("JDWP: UTF function initialization failed"));
+        return JNI_ERR;
+    }
+
     /* Parse input options */
     if (!parseOptions(options)) {
         /* No message necessary, should have been printed out already */
--- a/src/share/back/error_messages.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/back/error_messages.c	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -70,8 +70,13 @@
     len = (int)strlen((char*)utf8buf);
 
     /* Convert to platform encoding (ignore errors, dangerous area) */
-    (void)(gdata->npt->utf8ToPlatform)(gdata->npt->utf,
-           utf8buf, len, pbuf, MAX_MESSAGE_LEN);
+    if (gdata->npt != NULL) {
+        (void)(gdata->npt->utf8ToPlatform)(gdata->npt->utf,
+               utf8buf, len, pbuf, MAX_MESSAGE_LEN);
+    } else {
+        /* May be called before NPT is initialized so don't fault */
+        strncpy(pbuf, (char*)utf8buf, len);
+    }
     (void)fprintf(fp, "%s%s%s", prefix, pbuf, suffix);
 }
 
--- a/src/share/back/transport.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/back/transport.c	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -144,7 +144,9 @@
     /* First, look in sun.boot.library.path. This should find the standard
      *  dt_socket and dt_shmem transport libraries, or any library
      *  that was delivered with the J2SE.
-     *  Note: Java property sun.boot.library.path contains a single directory.
+     *  Note: Since 6819213 fixed, Java property sun.boot.library.path can
+     *  contain multiple paths. Dll_dir is the first entry and
+     *  -Dsun.boot.library.path entries are appended.
      */
     libdir = gdata->property_sun_boot_library_path;
     if (libdir == NULL) {
--- a/src/share/bin/java.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/bin/java.c	Fri Jun 21 19:11:42 2013 -0700
@@ -693,6 +693,13 @@
     char *def;
     const char *orig = s;
     static const char format[] = "-Djava.class.path=%s";
+    /*
+     * usually we should not get a null pointer, but there are cases where
+     * we might just get one, in which case we simply ignore it, and let the
+     * caller deal with it
+     */
+    if (s == NULL)
+        return;
     s = JLI_WildcardExpandClasspath(s);
     def = JLI_MemAlloc(sizeof(format)
                        - 2 /* strlen("%s") */
--- a/src/share/classes/com/sun/beans/TypeResolver.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/beans/TypeResolver.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -45,6 +45,9 @@
  * @author Sergey Malenkov
  */
 public final class TypeResolver {
+
+    private static final WeakCache<Type, Map<Type, Type>> CACHE = new WeakCache<>();
+
     /**
      * Replaces the given {@code type} in an inherited method
      * with the actual type it has in the given {@code inClass}.
@@ -149,12 +152,55 @@
      * @param formal  the type where occurrences of the variables
      *                in {@code actual} will be replaced by the corresponding bound values
      * @return a resolved type
-     *
-     * @see #TypeResolver(Type)
-     * @see #resolve(Type)
      */
     public static Type resolve(Type actual, Type formal) {
-        return getTypeResolver(actual).resolve(formal);
+        if (formal instanceof Class) {
+            return formal;
+        }
+        if (formal instanceof GenericArrayType) {
+            Type comp = ((GenericArrayType) formal).getGenericComponentType();
+            comp = resolve(actual, comp);
+            return (comp instanceof Class)
+                    ? Array.newInstance((Class<?>) comp, 0).getClass()
+                    : GenericArrayTypeImpl.make(comp);
+        }
+        if (formal instanceof ParameterizedType) {
+            ParameterizedType fpt = (ParameterizedType) formal;
+            Type[] actuals = resolve(actual, fpt.getActualTypeArguments());
+            return ParameterizedTypeImpl.make(
+                    (Class<?>) fpt.getRawType(), actuals, fpt.getOwnerType());
+        }
+        if (formal instanceof WildcardType) {
+            WildcardType fwt = (WildcardType) formal;
+            Type[] upper = resolve(actual, fwt.getUpperBounds());
+            Type[] lower = resolve(actual, fwt.getLowerBounds());
+            return new WildcardTypeImpl(upper, lower);
+        }
+        if (formal instanceof TypeVariable) {
+            Map<Type, Type> map;
+            synchronized (CACHE) {
+                map = CACHE.get(actual);
+                if (map == null) {
+                    map = new HashMap<>();
+                    prepare(map, actual);
+                    CACHE.put(actual, map);
+                }
+            }
+            Type result = map.get(formal);
+            if (result == null || result.equals(formal)) {
+                return formal;
+            }
+            result = fixGenericArray(result);
+            // A variable can be bound to another variable that is itself bound
+            // to something.  For example, given:
+            // class Super<T> {...}
+            // class Mid<X> extends Super<T> {...}
+            // class Sub extends Mid<String>
+            // the variable T is bound to X, which is in turn bound to String.
+            // So if we have to resolve T, we need the tail recursion here.
+            return resolve(actual, result);
+        }
+        throw new IllegalArgumentException("Bad Type kind: " + formal.getClass());
     }
 
     /**
@@ -164,12 +210,14 @@
      * @param actual   the type that supplies bindings for type variables
      * @param formals  the array of types to resolve
      * @return an array of resolved types
-     *
-     * @see #TypeResolver(Type)
-     * @see #resolve(Type[])
      */
     public static Type[] resolve(Type actual, Type[] formals) {
-        return getTypeResolver(actual).resolve(formals);
+        int length = formals.length;
+        Type[] actuals = new Type[length];
+        for (int i = 0; i < length; i++) {
+            actuals[i] = resolve(actual, formals[i]);
+        }
+        return actuals;
     }
 
     /**
@@ -228,32 +276,6 @@
         return classes;
     }
 
-    public static TypeResolver getTypeResolver(Type type) {
-        synchronized (CACHE) {
-            TypeResolver resolver = CACHE.get(type);
-            if (resolver == null) {
-                resolver = new TypeResolver(type);
-                CACHE.put(type, resolver);
-            }
-            return resolver;
-        }
-    }
-
-    private static final WeakCache<Type, TypeResolver> CACHE = new WeakCache<>();
-
-    private final Map<TypeVariable<?>, Type> map = new HashMap<>();
-
-    /**
-     * Constructs the type resolver for the given actual type.
-     *
-     * @param actual  the type that supplies bindings for type variables
-     *
-     * @see #prepare(Type)
-     */
-    private TypeResolver(Type actual) {
-        prepare(actual);
-    }
-
     /**
      * Fills the map from type parameters
      * to types as seen by the given {@code type}.
@@ -265,9 +287,10 @@
      * to a {@link ParameterizedType ParameterizedType} with no parameters,
      * or it represents the erasure of a {@link ParameterizedType ParameterizedType}.
      *
+     * @param map   the mappings of all type variables
      * @param type  the next type in the hierarchy
      */
-    private void prepare(Type type) {
+    private static void prepare(Map<Type, Type> map, Type type) {
         Class<?> raw = (Class<?>)((type instanceof Class<?>)
                 ? type
                 : ((ParameterizedType)type).getRawType());
@@ -280,91 +303,25 @@
 
         assert formals.length == actuals.length;
         for (int i = 0; i < formals.length; i++) {
-            this.map.put(formals[i], actuals[i]);
+            map.put(formals[i], actuals[i]);
         }
         Type gSuperclass = raw.getGenericSuperclass();
         if (gSuperclass != null) {
-            prepare(gSuperclass);
+            prepare(map, gSuperclass);
         }
         for (Type gInterface : raw.getGenericInterfaces()) {
-            prepare(gInterface);
+            prepare(map, gInterface);
         }
         // If type is the raw version of a parameterized class, we type-erase
         // all of its type variables, including inherited ones.
         if (type instanceof Class<?> && formals.length > 0) {
-            for (Map.Entry<TypeVariable<?>, Type> entry : this.map.entrySet()) {
+            for (Map.Entry<Type, Type> entry : map.entrySet()) {
                 entry.setValue(erase(entry.getValue()));
             }
         }
     }
 
     /**
-     * Replaces the given {@code formal} type
-     * with the type it stand for in this type resolver.
-     *
-     * @param formal  the array of types to resolve
-     * @return a resolved type
-     */
-    private Type resolve(Type formal) {
-        if (formal instanceof Class) {
-            return formal;
-        }
-        if (formal instanceof GenericArrayType) {
-            Type comp = ((GenericArrayType)formal).getGenericComponentType();
-            comp = resolve(comp);
-            return (comp instanceof Class)
-                    ? Array.newInstance((Class<?>)comp, 0).getClass()
-                    : GenericArrayTypeImpl.make(comp);
-        }
-        if (formal instanceof ParameterizedType) {
-            ParameterizedType fpt = (ParameterizedType)formal;
-            Type[] actuals = resolve(fpt.getActualTypeArguments());
-            return ParameterizedTypeImpl.make(
-                    (Class<?>)fpt.getRawType(), actuals, fpt.getOwnerType());
-        }
-        if (formal instanceof WildcardType) {
-            WildcardType fwt = (WildcardType)formal;
-            Type[] upper = resolve(fwt.getUpperBounds());
-            Type[] lower = resolve(fwt.getLowerBounds());
-            return new WildcardTypeImpl(upper, lower);
-        }
-        if (!(formal instanceof TypeVariable)) {
-            throw new IllegalArgumentException("Bad Type kind: " + formal.getClass());
-        }
-        Type actual = this.map.get((TypeVariable) formal);
-        if (actual == null || actual.equals(formal)) {
-            return formal;
-        }
-        actual = fixGenericArray(actual);
-        return resolve(actual);
-        // A variable can be bound to another variable that is itself bound
-        // to something.  For example, given:
-        // class Super<T> {...}
-        // class Mid<X> extends Super<T> {...}
-        // class Sub extends Mid<String>
-        // the variable T is bound to X, which is in turn bound to String.
-        // So if we have to resolve T, we need the tail recursion here.
-    }
-
-    /**
-     * Replaces all formal types in the given array
-     * with the types they stand for in this type resolver.
-     *
-     * @param formals  the array of types to resolve
-     * @return an array of resolved types
-     *
-     * @see #resolve(Type)
-     */
-    private Type[] resolve(Type[] formals) {
-        int length = formals.length;
-        Type[] actuals = new Type[length];
-        for (int i = 0; i < length; i++) {
-            actuals[i] = resolve(formals[i]);
-        }
-        return actuals;
-    }
-
-    /**
      * Replaces a {@link GenericArrayType GenericArrayType}
      * with plain array class where it is possible.
      * Bug <a href="http://bugs.sun.com/view_bug.do?bug_id=5041784">5041784</a>
--- a/src/share/classes/com/sun/beans/finder/AbstractFinder.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/beans/finder/AbstractFinder.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -24,6 +24,9 @@
  */
 package com.sun.beans.finder;
 
+import java.lang.reflect.Member;
+import java.lang.reflect.Modifier;
+
 import java.util.HashMap;
 import java.util.Map;
 
@@ -37,7 +40,7 @@
  *
  * @author Sergey A. Malenkov
  */
-abstract class AbstractFinder<T> {
+abstract class AbstractFinder<T extends Member> {
     private final Class<?>[] args;
 
     /**
@@ -81,7 +84,9 @@
      * @return {@code true} if the method is valid,
      *         {@code false} otherwise
      */
-    protected abstract boolean isValid(T method);
+    protected boolean isValid(T method) {
+        return Modifier.isPublic(method.getModifiers());
+    }
 
     /**
      * Performs a search in the {@code methods} array.
@@ -120,6 +125,11 @@
                             boolean useNew = isAssignable(oldParams, newParams);
                             boolean useOld = isAssignable(newParams, oldParams);
 
+                            if (useOld && useNew) {
+                                // only if parameters are equal
+                                useNew = !newMethod.isSynthetic();
+                                useOld = !oldMethod.isSynthetic();
+                            }
                             if (useOld == useNew) {
                                 ambiguous = true;
                             } else if (useNew) {
@@ -160,6 +170,11 @@
                         boolean useNew = isAssignable(oldParams, newParams);
                         boolean useOld = isAssignable(newParams, oldParams);
 
+                        if (useOld && useNew) {
+                            // only if parameters are equal
+                            useNew = !newMethod.isSynthetic();
+                            useOld = !oldMethod.isSynthetic();
+                        }
                         if (useOld == useNew) {
                             if (oldParams == map.get(oldMethod)) {
                                 ambiguous = true;
--- a/src/share/classes/com/sun/beans/finder/ConstructorFinder.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/beans/finder/ConstructorFinder.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -113,17 +113,4 @@
     protected boolean isVarArgs(Constructor<?> constructor) {
         return constructor.isVarArgs();
     }
-
-    /**
-     * Checks validness of the constructor.
-     * The valid constructor should be public.
-     *
-     * @param constructor  the object that represents constructor
-     * @return {@code true} if the constructor is valid,
-     *         {@code false} otherwise
-     */
-    @Override
-    protected boolean isValid(Constructor<?> constructor) {
-        return Modifier.isPublic(constructor.getModifiers());
-    }
 }
--- a/src/share/classes/com/sun/beans/finder/MethodFinder.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/beans/finder/MethodFinder.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -169,8 +169,10 @@
                             return findAccessibleMethod(m);
                         }
                         Type[] gpts = m.getGenericParameterTypes();
-                        if (Arrays.equals(params, TypeResolver.erase(TypeResolver.resolve(pt, gpts)))) {
-                            return findAccessibleMethod(m);
+                        if (params.length == gpts.length) {
+                            if (Arrays.equals(params, TypeResolver.erase(TypeResolver.resolve(pt, gpts)))) {
+                                return findAccessibleMethod(m);
+                            }
                         }
                     }
                 }
@@ -231,6 +233,6 @@
      */
     @Override
     protected boolean isValid(Method method) {
-        return !method.isBridge() && Modifier.isPublic(method.getModifiers()) && method.getName().equals(this.name);
+        return super.isValid(method) && method.getName().equals(this.name);
     }
 }
--- a/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java	Fri Jun 21 19:11:42 2013 -0700
@@ -787,7 +787,6 @@
             "List.font", new FontLazyValue(Region.LIST),
             "List.rendererUseUIBorder", Boolean.FALSE,
 
-            "Menu.shortcutKeys", new int[] {KeyEvent.ALT_MASK},
             "Menu.arrowIcon", new GTKStyle.GTKLazyValue(
                               "com.sun.java.swing.plaf.gtk.GTKIconFactory",
                               "getMenuArrowIcon"),
--- a/src/share/classes/com/sun/java/swing/plaf/gtk/GTKPainter.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/gtk/GTKPainter.java	Fri Jun 21 19:11:42 2013 -0700
@@ -926,9 +926,20 @@
                                      int x, int y, int w, int h) {
         // Text is odd in that it uses the TEXT_BACKGROUND vs BACKGROUND.
         JComponent c = context.getComponent();
+        Container container = c.getParent();
+        Container containerParent = null;
         GTKStyle style = (GTKStyle)context.getStyle();
         Region id = context.getRegion();
         int state = context.getComponentState();
+
+        if (c instanceof ListCellRenderer && container != null) {
+            containerParent = container.getParent();
+            if (containerParent instanceof JComboBox
+                    && containerParent.hasFocus()) {
+                state |= SynthConstants.FOCUSED;
+            }
+        }
+
         synchronized (UNIXToolkit.GTK_LOCK) {
             if (ENGINE.paintCachedImage(g, x, y, w, h, id, state)) {
                 return;
@@ -938,9 +949,10 @@
             int focusSize = 0;
             boolean interiorFocus = style.getClassSpecificBoolValue(
                     context, "interior-focus", true);
+
+            focusSize = style.getClassSpecificIntValue(context,
+                    "focus-line-width",1);
             if (!interiorFocus && (state & SynthConstants.FOCUSED) != 0) {
-                focusSize = style.getClassSpecificIntValue(context,
-                        "focus-line-width",1);
                 x += focusSize;
                 y += focusSize;
                 w -= 2 * focusSize;
@@ -961,11 +973,25 @@
                                 h - (2 * yThickness),
                                 ColorType.TEXT_BACKGROUND);
 
-            if (focusSize > 0) {
-                x -= focusSize;
-                y -= focusSize;
-                w += 2 * focusSize;
-                h += 2 * focusSize;
+            if (focusSize > 0 && (state & SynthConstants.FOCUSED) != 0) {
+                if (!interiorFocus) {
+                    x -=  focusSize;
+                    y -=  focusSize;
+                    w +=  2 * focusSize;
+                    h +=  2 * focusSize;
+                } else {
+                    if (containerParent instanceof JComboBox) {
+                        x += (focusSize + 2);
+                        y += (focusSize + 1);
+                        w -= (2 * focusSize + 1);
+                        h -= (2 * focusSize + 2);
+                    } else {
+                        x += focusSize;
+                        y += focusSize;
+                        w -= 2 * focusSize;
+                        h -= 2 * focusSize;
+                    }
+                }
                 ENGINE.paintFocus(g, context, id, gtkState,
                         "entry", x, y, w, h);
             }
--- a/src/share/classes/com/sun/java/swing/plaf/motif/MotifFileChooserUI.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/MotifFileChooserUI.java	Fri Jun 21 19:11:42 2013 -0700
@@ -529,21 +529,25 @@
         Locale l = fc.getLocale();
 
         enterFolderNameLabelText = UIManager.getString("FileChooser.enterFolderNameLabelText",l);
-        enterFolderNameLabelMnemonic = UIManager.getInt("FileChooser.enterFolderNameLabelMnemonic");
+        enterFolderNameLabelMnemonic = getMnemonic("FileChooser.enterFolderNameLabelMnemonic", l);
         enterFileNameLabelText = UIManager.getString("FileChooser.enterFileNameLabelText",l);
-        enterFileNameLabelMnemonic = UIManager.getInt("FileChooser.enterFileNameLabelMnemonic");
+        enterFileNameLabelMnemonic = getMnemonic("FileChooser.enterFileNameLabelMnemonic", l);
 
         filesLabelText = UIManager.getString("FileChooser.filesLabelText",l);
-        filesLabelMnemonic = UIManager.getInt("FileChooser.filesLabelMnemonic");
+        filesLabelMnemonic = getMnemonic("FileChooser.filesLabelMnemonic", l);
 
         foldersLabelText = UIManager.getString("FileChooser.foldersLabelText",l);
-        foldersLabelMnemonic = UIManager.getInt("FileChooser.foldersLabelMnemonic");
+        foldersLabelMnemonic = getMnemonic("FileChooser.foldersLabelMnemonic", l);
 
         pathLabelText = UIManager.getString("FileChooser.pathLabelText",l);
-        pathLabelMnemonic = UIManager.getInt("FileChooser.pathLabelMnemonic");
+        pathLabelMnemonic = getMnemonic("FileChooser.pathLabelMnemonic", l);
 
         filterLabelText = UIManager.getString("FileChooser.filterLabelText",l);
-        filterLabelMnemonic = UIManager.getInt("FileChooser.filterLabelMnemonic");
+        filterLabelMnemonic = getMnemonic("FileChooser.filterLabelMnemonic", l);
+    }
+
+    private Integer getMnemonic(String key, Locale l) {
+        return SwingUtilities2.getUIDefaultsInt(key, l);
     }
 
     protected void installIcons(JFileChooser fc) {
--- a/src/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java	Fri Jun 21 19:11:42 2013 -0700
@@ -630,8 +630,10 @@
             "Menu.menuPopupOffsetY", new Integer(0),
             "Menu.submenuPopupOffsetX", new Integer(-2),
             "Menu.submenuPopupOffsetY", new Integer(3),
-            "Menu.shortcutKeys", new int[] {KeyEvent.ALT_MASK,
-                                            KeyEvent.META_MASK},
+            "Menu.shortcutKeys", new int[]{
+                SwingUtilities2.getSystemMnemonicKeyMask(),
+                KeyEvent.META_MASK
+            },
             "Menu.cancelMode", "hideMenuTree",
 
             "MenuBar.border", menuBarBorder,
@@ -1215,11 +1217,6 @@
             "EditorPane.focusInputMap", multilineInputMap,
 
 
-            "FileChooser.pathLabelMnemonic", new Integer(KeyEvent.VK_P), // 'p'
-            "FileChooser.filterLabelMnemonic", new Integer (KeyEvent.VK_R), // 'r'
-            "FileChooser.foldersLabelMnemonic", new Integer (KeyEvent.VK_L), // 'l'
-            "FileChooser.filesLabelMnemonic", new Integer (KeyEvent.VK_I), // 'i'
-            "FileChooser.enterFileNameLabelMnemonic", new Integer (KeyEvent.VK_N), // 'n'
             "FileChooser.ancestorInputMap",
                new UIDefaults.LazyInputMap(new Object[] {
                      "ESCAPE", "cancelSelection"
--- a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -26,11 +26,11 @@
 FileChooser.openDialogTitle.textAndMnemonic=Open
 FileChooser.updateButton.textAndMnemonic=Update
 FileChooser.helpButton.textAndMnemonic=Help
-FileChooser.pathLabel.textAndMnemonic=Enter path or folder name:
-FileChooser.filterLabel.textAndMnemonic=Filter
-FileChooser.foldersLabel.textAndMnemonic=Folders
-FileChooser.filesLabel.textAndMnemonic=Files
-FileChooser.enterFileNameLabel.textAndMnemonic=Enter file name:
+FileChooser.pathLabel.textAndMnemonic=Enter &path or folder name:
+FileChooser.filterLabel.textAndMnemonic=Filte&r
+FileChooser.foldersLabel.textAndMnemonic=Fo&lders
+FileChooser.filesLabel.textAndMnemonic=F&iles
+FileChooser.enterFileNameLabel.textAndMnemonic=E&nter file name:
 FileChooser.enterFolderNameLabel.textAndMnemonic=Enter folder name:
 
 FileChooser.cancelButtonToolTip.textAndMnemonic=Abort file chooser dialog.
--- a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_de.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_de.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -26,11 +26,11 @@
 FileChooser.openDialogTitle.textAndMnemonic=\u00D6ffnen
 FileChooser.updateButton.textAndMnemonic=Aktualisieren
 FileChooser.helpButton.textAndMnemonic=Hilfe
-FileChooser.pathLabel.textAndMnemonic=Pfad- oder Ordnernamen eingeben:
-FileChooser.filterLabel.textAndMnemonic=Filter
-FileChooser.foldersLabel.textAndMnemonic=Ordner
-FileChooser.filesLabel.textAndMnemonic=Dateien
-FileChooser.enterFileNameLabel.textAndMnemonic=Dateinamen eingeben:
+FileChooser.pathLabel.textAndMnemonic=&Pfad- oder Ordnername eingeben:
+FileChooser.filterLabel.textAndMnemonic=Filte&r
+FileChooser.foldersLabel.textAndMnemonic=Ord&ner
+FileChooser.filesLabel.textAndMnemonic=Date&ien
+FileChooser.enterFileNameLabel.textAndMnemonic=Dateiname ei&ngeben:
 FileChooser.enterFolderNameLabel.textAndMnemonic=Ordnernamen eingeben:
 
 FileChooser.cancelButtonToolTip.textAndMnemonic=Dialogfeld f\u00FCr Dateiauswahl schlie\u00DFen.
--- a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_es.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_es.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -26,11 +26,11 @@
 FileChooser.openDialogTitle.textAndMnemonic=Abrir
 FileChooser.updateButton.textAndMnemonic=Actualizar
 FileChooser.helpButton.textAndMnemonic=Ayuda
-FileChooser.pathLabel.textAndMnemonic=Introducir nombre de la ruta de acceso o carpeta:
-FileChooser.filterLabel.textAndMnemonic=Filtro
-FileChooser.foldersLabel.textAndMnemonic=Carpetas
-FileChooser.filesLabel.textAndMnemonic=Archivos
-FileChooser.enterFileNameLabel.textAndMnemonic=Introducir nombre de archivo:
+FileChooser.pathLabel.textAndMnemonic=Introducir nombre de ruta de acceso o car&peta:
+FileChooser.filterLabel.textAndMnemonic=Filt&ro
+FileChooser.foldersLabel.textAndMnemonic=Carpe&tas
+FileChooser.filesLabel.textAndMnemonic=Arch&ivos
+FileChooser.enterFileNameLabel.textAndMnemonic=I&ntroducir nombre de archivo:
 FileChooser.enterFolderNameLabel.textAndMnemonic=Introducir nombre de carpeta:
 
 FileChooser.cancelButtonToolTip.textAndMnemonic=Abortar cuadro de di\u00E1logo del selector de archivos.
--- a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_fr.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_fr.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -26,11 +26,11 @@
 FileChooser.openDialogTitle.textAndMnemonic=Ouvrir
 FileChooser.updateButton.textAndMnemonic=Mettre \u00E0 jour
 FileChooser.helpButton.textAndMnemonic=Aide
-FileChooser.pathLabel.textAndMnemonic=Entrez le chemin ou le nom du dossier :
-FileChooser.filterLabel.textAndMnemonic=Filtre
-FileChooser.foldersLabel.textAndMnemonic=Dossiers
-FileChooser.filesLabel.textAndMnemonic=Fichiers
-FileChooser.enterFileNameLabel.textAndMnemonic=Entrez le nom du fichier :
+FileChooser.pathLabel.textAndMnemonic=Entrez le c&hemin ou le nom du dossier :
+FileChooser.filterLabel.textAndMnemonic=Filt&re
+FileChooser.foldersLabel.textAndMnemonic=&Dossiers
+FileChooser.filesLabel.textAndMnemonic=F&ichiers
+FileChooser.enterFileNameLabel.textAndMnemonic=E&ntrez le nom du fichier :
 FileChooser.enterFolderNameLabel.textAndMnemonic=Entrez le nom du dossier :
 
 FileChooser.cancelButtonToolTip.textAndMnemonic=Ferme la bo\u00EEte de dialogue du s\u00E9lecteur de fichiers.
--- a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_it.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_it.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -26,11 +26,11 @@
 FileChooser.openDialogTitle.textAndMnemonic=Apri
 FileChooser.updateButton.textAndMnemonic=Aggiorna
 FileChooser.helpButton.textAndMnemonic=?
-FileChooser.pathLabel.textAndMnemonic=Percorso o nome cartella:
-FileChooser.filterLabel.textAndMnemonic=Filtro
-FileChooser.foldersLabel.textAndMnemonic=Cartelle
-FileChooser.filesLabel.textAndMnemonic=File
-FileChooser.enterFileNameLabel.textAndMnemonic=Nome file:
+FileChooser.pathLabel.textAndMnemonic=&Percorso o nome cartella:
+FileChooser.filterLabel.textAndMnemonic=Filt&ro
+FileChooser.foldersLabel.textAndMnemonic=Car&telle
+FileChooser.filesLabel.textAndMnemonic=F&ile
+FileChooser.enterFileNameLabel.textAndMnemonic=Immettere il &nome file: 
 FileChooser.enterFolderNameLabel.textAndMnemonic=Nome cartella:
 
 FileChooser.cancelButtonToolTip.textAndMnemonic=Chiude la finestra di dialogo di selezione file.
--- a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_ja.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_ja.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -26,11 +26,11 @@
 FileChooser.openDialogTitle.textAndMnemonic=\u958B\u304F
 FileChooser.updateButton.textAndMnemonic=\u66F4\u65B0
 FileChooser.helpButton.textAndMnemonic=\u30D8\u30EB\u30D7
-FileChooser.pathLabel.textAndMnemonic=\u30D1\u30B9\u307E\u305F\u306F\u30D5\u30A9\u30EB\u30C0\u540D\u3092\u5165\u529B:
-FileChooser.filterLabel.textAndMnemonic=\u30D5\u30A3\u30EB\u30BF
-FileChooser.foldersLabel.textAndMnemonic=\u30D5\u30A9\u30EB\u30C0
-FileChooser.filesLabel.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB
-FileChooser.enterFileNameLabel.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB\u540D\u3092\u5165\u529B:
+FileChooser.pathLabel.textAndMnemonic=\u30D1\u30B9\u307E\u305F\u306F\u30D5\u30A9\u30EB\u30C0\u540D\u3092\u5165\u529B(&P):
+FileChooser.filterLabel.textAndMnemonic=\u30D5\u30A3\u30EB\u30BF(&R)
+FileChooser.foldersLabel.textAndMnemonic=\u30D5\u30A9\u30EB\u30C0(&L)
+FileChooser.filesLabel.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB(&I)
+FileChooser.enterFileNameLabel.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB\u540D\u3092\u5165\u529B(&N):
 FileChooser.enterFolderNameLabel.textAndMnemonic=\u30D5\u30A9\u30EB\u30C0\u540D\u3092\u5165\u529B:
 
 FileChooser.cancelButtonToolTip.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB\u30FB\u30C1\u30E5\u30FC\u30B6\u30FB\u30C0\u30A4\u30A2\u30ED\u30B0\u3092\u7D42\u4E86\u3057\u307E\u3059\u3002
--- a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_ko.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_ko.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -26,11 +26,11 @@
 FileChooser.openDialogTitle.textAndMnemonic=\uC5F4\uAE30
 FileChooser.updateButton.textAndMnemonic=\uAC31\uC2E0
 FileChooser.helpButton.textAndMnemonic=\uB3C4\uC6C0\uB9D0
-FileChooser.pathLabel.textAndMnemonic=\uACBD\uB85C \uB610\uB294 \uD3F4\uB354 \uC774\uB984 \uC785\uB825:
-FileChooser.filterLabel.textAndMnemonic=\uD544\uD130
-FileChooser.foldersLabel.textAndMnemonic=\uD3F4\uB354
-FileChooser.filesLabel.textAndMnemonic=\uD30C\uC77C
-FileChooser.enterFileNameLabel.textAndMnemonic=\uD30C\uC77C \uC774\uB984 \uC785\uB825:
+FileChooser.pathLabel.textAndMnemonic=\uACBD\uB85C \uB610\uB294 \uD3F4\uB354 \uC774\uB984 \uC785\uB825(&P):
+FileChooser.filterLabel.textAndMnemonic=\uD544\uD130(&R)
+FileChooser.foldersLabel.textAndMnemonic=\uD3F4\uB354(&L)
+FileChooser.filesLabel.textAndMnemonic=\uD30C\uC77C(&I)
+FileChooser.enterFileNameLabel.textAndMnemonic=\uD30C\uC77C \uC774\uB984 \uC785\uB825(&N):
 FileChooser.enterFolderNameLabel.textAndMnemonic=\uD3F4\uB354 \uC774\uB984 \uC785\uB825:
 
 FileChooser.cancelButtonToolTip.textAndMnemonic=\uD30C\uC77C \uC120\uD0DD\uAE30 \uB300\uD654\uC0C1\uC790\uB97C \uC911\uB2E8\uD569\uB2C8\uB2E4.
--- a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_pt_BR.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_pt_BR.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -26,11 +26,11 @@
 FileChooser.openDialogTitle.textAndMnemonic=Abrir
 FileChooser.updateButton.textAndMnemonic=Atualizar
 FileChooser.helpButton.textAndMnemonic=Ajuda
-FileChooser.pathLabel.textAndMnemonic=Informar caminho ou nome da pasta:
-FileChooser.filterLabel.textAndMnemonic=Filtro
-FileChooser.foldersLabel.textAndMnemonic=Pastas
-FileChooser.filesLabel.textAndMnemonic=Arquivos
-FileChooser.enterFileNameLabel.textAndMnemonic=Informar nome do arquivo:
+FileChooser.pathLabel.textAndMnemonic=Informar &caminho ou nome da pasta:
+FileChooser.filterLabel.textAndMnemonic=Filt&ro
+FileChooser.foldersLabel.textAndMnemonic=Pa&stas
+FileChooser.filesLabel.textAndMnemonic=Arqu&ivos
+FileChooser.enterFileNameLabel.textAndMnemonic=I&nforme o nome do arquivo:
 FileChooser.enterFolderNameLabel.textAndMnemonic=Informar nome da pasta:
 
 FileChooser.cancelButtonToolTip.textAndMnemonic=Abortar caixa de di\u00E1logo do seletor de arquivos.
--- a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_sv.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_sv.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -26,11 +26,11 @@
 FileChooser.openDialogTitle.textAndMnemonic=\u00D6ppna
 FileChooser.updateButton.textAndMnemonic=Uppdatera
 FileChooser.helpButton.textAndMnemonic=Hj\u00E4lp
-FileChooser.pathLabel.textAndMnemonic=Ange s\u00F6kv\u00E4g eller mappnamn:
-FileChooser.filterLabel.textAndMnemonic=Filter
-FileChooser.foldersLabel.textAndMnemonic=Mappar
-FileChooser.filesLabel.textAndMnemonic=Filer
-FileChooser.enterFileNameLabel.textAndMnemonic=Ange filnamn:
+FileChooser.pathLabel.textAndMnemonic=Ange &s\u00F6kv\u00E4g eller mappnamn:
+FileChooser.filterLabel.textAndMnemonic=Filte&r
+FileChooser.foldersLabel.textAndMnemonic=Ma&ppar
+FileChooser.filesLabel.textAndMnemonic=F&iler
+FileChooser.enterFileNameLabel.textAndMnemonic=A&nge filnamn:
 FileChooser.enterFolderNameLabel.textAndMnemonic=Ange ett mappnamn:
 
 FileChooser.cancelButtonToolTip.textAndMnemonic=Avbryt dialogrutan Filv\u00E4ljare.
--- a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_zh_CN.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_zh_CN.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -26,11 +26,11 @@
 FileChooser.openDialogTitle.textAndMnemonic=\u6253\u5F00
 FileChooser.updateButton.textAndMnemonic=\u66F4\u65B0
 FileChooser.helpButton.textAndMnemonic=\u5E2E\u52A9
-FileChooser.pathLabel.textAndMnemonic=\u952E\u5165\u8DEF\u5F84\u6216\u6587\u4EF6\u5939\u540D: 
-FileChooser.filterLabel.textAndMnemonic=\u7B5B\u9009\u5668
-FileChooser.foldersLabel.textAndMnemonic=\u6587\u4EF6\u5939
-FileChooser.filesLabel.textAndMnemonic=\u6587\u4EF6
-FileChooser.enterFileNameLabel.textAndMnemonic=\u952E\u5165\u6587\u4EF6\u540D: 
+FileChooser.pathLabel.textAndMnemonic=\u8F93\u5165\u8DEF\u5F84\u6216\u6587\u4EF6\u5939\u540D(&P):
+FileChooser.filterLabel.textAndMnemonic=\u7B5B\u9009\u5668(&R)
+FileChooser.foldersLabel.textAndMnemonic=\u6587\u4EF6\u5939(&L)
+FileChooser.filesLabel.textAndMnemonic=\u6587\u4EF6(&I)
+FileChooser.enterFileNameLabel.textAndMnemonic=\u8F93\u5165\u6587\u4EF6\u540D(&N):
 FileChooser.enterFolderNameLabel.textAndMnemonic=\u8F93\u5165\u6587\u4EF6\u5939\u540D:
 
 FileChooser.cancelButtonToolTip.textAndMnemonic=\u4E2D\u6B62\u6587\u4EF6\u9009\u62E9\u5668\u5BF9\u8BDD\u6846\u3002
--- a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_zh_TW.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_zh_TW.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -26,11 +26,11 @@
 FileChooser.openDialogTitle.textAndMnemonic=\u958B\u555F
 FileChooser.updateButton.textAndMnemonic=\u66F4\u65B0
 FileChooser.helpButton.textAndMnemonic=\u8AAA\u660E
-FileChooser.pathLabel.textAndMnemonic=\u8F38\u5165\u8DEF\u5F91\u6216\u8CC7\u6599\u593E\u540D\u7A31:
-FileChooser.filterLabel.textAndMnemonic=\u7BE9\u9078
-FileChooser.foldersLabel.textAndMnemonic=\u8CC7\u6599\u593E
-FileChooser.filesLabel.textAndMnemonic=\u6A94\u6848
-FileChooser.enterFileNameLabel.textAndMnemonic=\u8F38\u5165\u6A94\u6848\u540D\u7A31:
+FileChooser.pathLabel.textAndMnemonic=\u8F38\u5165\u8DEF\u5F91\u6216\u8CC7\u6599\u593E\u540D\u7A31(&P):
+FileChooser.filterLabel.textAndMnemonic=\u7BE9\u9078(&R)
+FileChooser.foldersLabel.textAndMnemonic=\u8CC7\u6599\u593E(&L)
+FileChooser.filesLabel.textAndMnemonic=\u6A94\u6848(&I)
+FileChooser.enterFileNameLabel.textAndMnemonic=\u8F38\u5165\u6A94\u6848\u540D\u7A31(&N):
 FileChooser.enterFolderNameLabel.textAndMnemonic=\u8F38\u5165\u8CC7\u6599\u593E\u540D\u7A31:
 
 FileChooser.cancelButtonToolTip.textAndMnemonic=\u4E2D\u6B62\u6A94\u6848\u9078\u64C7\u5668\u5C0D\u8A71\u65B9\u584A\u3002
--- a/src/share/classes/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java	Fri Jun 21 19:11:42 2013 -0700
@@ -528,16 +528,16 @@
 
         Locale l = fc.getLocale();
 
-        lookInLabelMnemonic = UIManager.getInt("FileChooser.lookInLabelMnemonic");
+        lookInLabelMnemonic = getMnemonic("FileChooser.lookInLabelMnemonic", l);
         lookInLabelText = UIManager.getString("FileChooser.lookInLabelText",l);
         saveInLabelText = UIManager.getString("FileChooser.saveInLabelText",l);
 
-        fileNameLabelMnemonic = UIManager.getInt("FileChooser.fileNameLabelMnemonic");
+        fileNameLabelMnemonic = getMnemonic("FileChooser.fileNameLabelMnemonic", l);
         fileNameLabelText = UIManager.getString("FileChooser.fileNameLabelText",l);
-        folderNameLabelMnemonic = UIManager.getInt("FileChooser.folderNameLabelMnemonic");
+        folderNameLabelMnemonic = getMnemonic("FileChooser.folderNameLabelMnemonic", l);
         folderNameLabelText = UIManager.getString("FileChooser.folderNameLabelText",l);
 
-        filesOfTypeLabelMnemonic = UIManager.getInt("FileChooser.filesOfTypeLabelMnemonic");
+        filesOfTypeLabelMnemonic = getMnemonic("FileChooser.filesOfTypeLabelMnemonic", l);
         filesOfTypeLabelText = UIManager.getString("FileChooser.filesOfTypeLabelText",l);
 
         upFolderToolTipText =  UIManager.getString("FileChooser.upFolderToolTipText",l);
@@ -550,6 +550,10 @@
         viewMenuButtonAccessibleName = UIManager.getString("FileChooser.viewMenuButtonAccessibleName",l);
     }
 
+    private Integer getMnemonic(String key, Locale l) {
+        return SwingUtilities2.getUIDefaultsInt(key, l);
+    }
+
     protected void installListeners(JFileChooser fc) {
         super.installListeners(fc);
         ActionMap actionMap = getActionMap();
--- a/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java	Fri Jun 21 19:11:42 2013 -0700
@@ -523,6 +523,7 @@
         Object ScrollbarBackgroundColor = new DesktopProperty(
                                                        "win.scrollbar.backgroundColor",
                                                         table.get("scrollbar"));
+        Object buttonFocusColor = new FocusColorProperty();
 
         Object TextBackground         = new XPColorValue(Part.EP_EDIT, null, Prop.FILLCOLOR,
                                                          WindowBackgroundColor);
@@ -629,7 +630,7 @@
             "Button.highlight", ControlHighlightColor,
             "Button.disabledForeground", InactiveTextColor,
             "Button.disabledShadow", ControlHighlightColor,
-            "Button.focus", black,
+            "Button.focus", buttonFocusColor,
             "Button.dashedRectGapX", new XPValue(Integer.valueOf(3), Integer.valueOf(5)),
             "Button.dashedRectGapY", new XPValue(Integer.valueOf(3), Integer.valueOf(4)),
             "Button.dashedRectGapWidth", new XPValue(Integer.valueOf(6), Integer.valueOf(10)),
@@ -655,7 +656,7 @@
             "CheckBox.darkShadow", ControlDarkShadowColor,
             "CheckBox.light", ControlLightColor,
             "CheckBox.highlight", ControlHighlightColor,
-            "CheckBox.focus", black,
+            "CheckBox.focus", buttonFocusColor,
             "CheckBox.focusInputMap",
                new UIDefaults.LazyInputMap(new Object[] {
                             "SPACE", "pressed",
@@ -773,9 +774,6 @@
                                                                "icons/NewFolder.gif"),
             "FileChooser.useSystemExtensionHiding", Boolean.TRUE,
 
-            "FileChooser.lookInLabelMnemonic", Integer.valueOf(KeyEvent.VK_I),
-            "FileChooser.fileNameLabelMnemonic", Integer.valueOf(KeyEvent.VK_N),
-            "FileChooser.filesOfTypeLabelMnemonic", Integer.valueOf(KeyEvent.VK_T),
             "FileChooser.usesSingleFilePane", Boolean.TRUE,
             "FileChooser.noPlacesBar", new DesktopProperty("win.comdlg.noPlacesBar",
                                                            Boolean.FALSE),
@@ -1013,7 +1011,7 @@
             "RadioButton.darkShadow", ControlDarkShadowColor,
             "RadioButton.light", ControlLightColor,
             "RadioButton.highlight", ControlHighlightColor,
-            "RadioButton.focus", black,
+            "RadioButton.focus", buttonFocusColor,
             "RadioButton.focusInputMap",
                new UIDefaults.LazyInputMap(new Object[] {
                           "SPACE", "pressed",
@@ -2620,4 +2618,19 @@
         }
     }
 
+    private static class FocusColorProperty extends DesktopProperty {
+        public FocusColorProperty () {
+            // Fallback value is never used bacause of the configureValue method doesn't return null
+            super("win.3d.backgroundColor", Color.BLACK);
+        }
+
+        @Override
+        protected Object configureValue(Object value) {
+            if (! ((Boolean)Toolkit.getDefaultToolkit().getDesktopProperty("win.highContrast.on")).booleanValue()){
+                return Color.BLACK;
+            }
+            return Color.BLACK.equals(value) ? Color.WHITE : Color.BLACK;
+        }
+    }
+
 }
--- a/src/share/classes/com/sun/java/swing/plaf/windows/WindowsRadioButtonUI.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/WindowsRadioButtonUI.java	Fri Jun 21 19:11:42 2013 -0700
@@ -89,6 +89,11 @@
         }
     }
 
+    protected void uninstallDefaults(AbstractButton b) {
+        super.uninstallDefaults(b);
+        initialized = false;
+    }
+
     protected Color getFocusColor() {
         return focusColor;
     }
--- a/src/share/classes/com/sun/java/swing/plaf/windows/WindowsTreeUI.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/WindowsTreeUI.java	Fri Jun 21 19:11:42 2013 -0700
@@ -93,6 +93,11 @@
                             counter = endRow;
                         }
                     }
+
+                    if (testRect == null) {
+                        return;
+                    }
+
                     tree.scrollRectToVisible(new Rectangle(visRect.x, beginY, 1,
                                                       testRect.y + testRect.height-
                                                       beginY));
--- a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=Look in:
+FileChooser.lookInLabel.textAndMnemonic=Look &in:
 FileChooser.saveInLabel.textAndMnemonic=Save in:
-FileChooser.fileNameLabel.textAndMnemonic=File name:
-FileChooser.folderNameLabel.textAndMnemonic=Folder name:
-FileChooser.filesOfTypeLabel.textAndMnemonic=Files of type:
+FileChooser.fileNameLabel.textAndMnemonic=File &name:
+FileChooser.folderNameLabel.textAndMnemonic=Folder &name:
+FileChooser.filesOfTypeLabel.textAndMnemonic=Files of &type:
 FileChooser.upFolderToolTip.textAndMnemonic=Up One Level
 FileChooser.upFolderAccessibleName=Up
 FileChooser.homeFolderToolTip.textAndMnemonic=Home
--- a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_de.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_de.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=Suchen in:
+FileChooser.lookInLabel.textAndMnemonic=Suchen &in:
 FileChooser.saveInLabel.textAndMnemonic=Speichern in:
-FileChooser.fileNameLabel.textAndMnemonic=Dateiname:
-FileChooser.folderNameLabel.textAndMnemonic=Ordnername:
-FileChooser.filesOfTypeLabel.textAndMnemonic=Dateityp:
+FileChooser.fileNameLabel.textAndMnemonic=&Dateiname:
+FileChooser.folderNameLabel.textAndMnemonic=Ordner&name:
+FileChooser.filesOfTypeLabel.textAndMnemonic=Datei&typ:
 FileChooser.upFolderToolTip.textAndMnemonic=Eine Ebene h\u00F6her
 FileChooser.upFolderAccessibleName=Nach oben
 FileChooser.homeFolderToolTip.textAndMnemonic=Home
--- a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_es.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_es.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=Buscar en:
+FileChooser.lookInLabel.textAndMnemonic=&Buscar en:
 FileChooser.saveInLabel.textAndMnemonic=Guardar en:
-FileChooser.fileNameLabel.textAndMnemonic=Nombre de Archivo:
-FileChooser.folderNameLabel.textAndMnemonic=Nombre de la Carpeta:
-FileChooser.filesOfTypeLabel.textAndMnemonic=Archivos de Tipo:
+FileChooser.fileNameLabel.textAndMnemonic=&Nombre de archivo:
+FileChooser.folderNameLabel.textAndMnemonic=&Nombre de carpeta:
+FileChooser.filesOfTypeLabel.textAndMnemonic=Archivos de &tipo:
 FileChooser.upFolderToolTip.textAndMnemonic=Subir un Nivel
 FileChooser.upFolderAccessibleName=Arriba
 FileChooser.homeFolderToolTip.textAndMnemonic=Inicio
--- a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_fr.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_fr.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=Rechercher dans :
+FileChooser.lookInLabel.textAndMnemonic=Rechercher &dans :
 FileChooser.saveInLabel.textAndMnemonic=Enregistrer dans :
-FileChooser.fileNameLabel.textAndMnemonic=Nom du fichier :
-FileChooser.folderNameLabel.textAndMnemonic=Nom du dossier :
-FileChooser.filesOfTypeLabel.textAndMnemonic=Fichiers de type :
+FileChooser.fileNameLabel.textAndMnemonic=&Nom du fichier :
+FileChooser.folderNameLabel.textAndMnemonic=&Nom du dossier :
+FileChooser.filesOfTypeLabel.textAndMnemonic=&Type de fichier :
 FileChooser.upFolderToolTip.textAndMnemonic=Remonte d'un niveau.
 FileChooser.upFolderAccessibleName=Monter
 FileChooser.homeFolderToolTip.textAndMnemonic=R\u00E9pertoire d'origine
--- a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_it.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_it.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=Cerca in:
+FileChooser.lookInLabel.textAndMnemonic=Cerca &in:
 FileChooser.saveInLabel.textAndMnemonic=Salva in:
-FileChooser.fileNameLabel.textAndMnemonic=Nome file:
-FileChooser.folderNameLabel.textAndMnemonic=Nome della cartella:
-FileChooser.filesOfTypeLabel.textAndMnemonic=Tipo file:
+FileChooser.fileNameLabel.textAndMnemonic=&Nome file:
+FileChooser.folderNameLabel.textAndMnemonic=&Nome cartella:
+FileChooser.filesOfTypeLabel.textAndMnemonic=&Tipo file:
 FileChooser.upFolderToolTip.textAndMnemonic=Cartella superiore
 FileChooser.upFolderAccessibleName=Superiore
 FileChooser.homeFolderToolTip.textAndMnemonic=Home
--- a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_ja.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_ja.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=\u53C2\u7167:
+FileChooser.lookInLabel.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB\u306E\u5834\u6240(&I):
 FileChooser.saveInLabel.textAndMnemonic=\u4FDD\u5B58:
-FileChooser.fileNameLabel.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB\u540D:
-FileChooser.folderNameLabel.textAndMnemonic=\u30D5\u30A9\u30EB\u30C0\u540D:
-FileChooser.filesOfTypeLabel.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB\u306E\u30BF\u30A4\u30D7:
+FileChooser.fileNameLabel.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB\u540D(&N):
+FileChooser.folderNameLabel.textAndMnemonic=\u30D5\u30A9\u30EB\u30C0\u540D(&N):
+FileChooser.filesOfTypeLabel.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB\u306E\u30BF\u30A4\u30D7(&T):
 FileChooser.upFolderToolTip.textAndMnemonic=1\u30EC\u30D9\u30EB\u4E0A\u3078
 FileChooser.upFolderAccessibleName=\u4E0A\u3078
 FileChooser.homeFolderToolTip.textAndMnemonic=\u30DB\u30FC\u30E0
--- a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_ko.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_ko.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=\uAC80\uC0C9 \uC704\uCE58:
+FileChooser.lookInLabel.textAndMnemonic=\uCC3E\uB294 \uC704\uCE58(&I):
 FileChooser.saveInLabel.textAndMnemonic=\uC800\uC7A5 \uC704\uCE58:
-FileChooser.fileNameLabel.textAndMnemonic=\uD30C\uC77C \uC774\uB984:
-FileChooser.folderNameLabel.textAndMnemonic=\uD3F4\uB354 \uC774\uB984:
-FileChooser.filesOfTypeLabel.textAndMnemonic=\uD30C\uC77C \uC720\uD615:
+FileChooser.fileNameLabel.textAndMnemonic=\uD30C\uC77C \uC774\uB984(&N):
+FileChooser.folderNameLabel.textAndMnemonic=\uD3F4\uB354 \uC774\uB984(&N):
+FileChooser.filesOfTypeLabel.textAndMnemonic=\uD30C\uC77C \uC720\uD615(&T):
 FileChooser.upFolderToolTip.textAndMnemonic=\uD55C \uB808\uBCA8 \uC704\uB85C
 FileChooser.upFolderAccessibleName=\uC704\uB85C
 FileChooser.homeFolderToolTip.textAndMnemonic=\uD648
--- a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_pt_BR.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_pt_BR.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=Consultar em:
+FileChooser.lookInLabel.textAndMnemonic=Pesquisar &em:
 FileChooser.saveInLabel.textAndMnemonic=Salvar em:
-FileChooser.fileNameLabel.textAndMnemonic=Nome do arquivo:
-FileChooser.folderNameLabel.textAndMnemonic=Nome da pasta:
-FileChooser.filesOfTypeLabel.textAndMnemonic=Arquivos do tipo:
+FileChooser.fileNameLabel.textAndMnemonic=&Nome do arquivo:
+FileChooser.folderNameLabel.textAndMnemonic=&Nome da pasta:
+FileChooser.filesOfTypeLabel.textAndMnemonic=Arquivos do &tipo:
 FileChooser.upFolderToolTip.textAndMnemonic=Um N\u00EDvel Acima
 FileChooser.upFolderAccessibleName=Acima
 FileChooser.homeFolderToolTip.textAndMnemonic=In\u00EDcio
--- a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_sv.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_sv.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=Leta i:
+FileChooser.lookInLabel.textAndMnemonic=Leta &i:
 FileChooser.saveInLabel.textAndMnemonic=Spara i:
-FileChooser.fileNameLabel.textAndMnemonic=Filnamn:
-FileChooser.folderNameLabel.textAndMnemonic=Mapp:
-FileChooser.filesOfTypeLabel.textAndMnemonic=Filformat:
+FileChooser.fileNameLabel.textAndMnemonic=Fil&namn:
+FileChooser.folderNameLabel.textAndMnemonic=Mapp&namn:
+FileChooser.filesOfTypeLabel.textAndMnemonic=Filer av &typ:
 FileChooser.upFolderToolTip.textAndMnemonic=Upp en niv\u00E5
 FileChooser.upFolderAccessibleName=Upp
 FileChooser.homeFolderToolTip.textAndMnemonic=Hem
--- a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_zh_CN.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_zh_CN.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=\u67E5\u770B: 
+FileChooser.lookInLabel.textAndMnemonic=\u67E5\u627E(&I):
 FileChooser.saveInLabel.textAndMnemonic=\u4FDD\u5B58: 
-FileChooser.fileNameLabel.textAndMnemonic=\u6587\u4EF6\u540D: 
-FileChooser.folderNameLabel.textAndMnemonic=\u6587\u4EF6\u5939\u540D: 
-FileChooser.filesOfTypeLabel.textAndMnemonic=\u6587\u4EF6\u7C7B\u578B: 
+FileChooser.fileNameLabel.textAndMnemonic=\u6587\u4EF6\u540D(&N):
+FileChooser.folderNameLabel.textAndMnemonic=\u6587\u4EF6\u5939\u540D(&N):
+FileChooser.filesOfTypeLabel.textAndMnemonic=\u6587\u4EF6\u7C7B\u578B(&T):
 FileChooser.upFolderToolTip.textAndMnemonic=\u5411\u4E0A\u4E00\u7EA7
 FileChooser.upFolderAccessibleName=\u5411\u4E0A
 FileChooser.homeFolderToolTip.textAndMnemonic=\u4E3B\u76EE\u5F55
@@ -33,11 +33,11 @@
 FileChooser.listViewButtonToolTip.textAndMnemonic=\u5217\u8868
 FileChooser.listViewButtonAccessibleName=\u5217\u8868
 FileChooser.listViewActionLabel.textAndMnemonic=\u5217\u8868
-FileChooser.detailsViewButtonToolTip.textAndMnemonic=\u8BE6\u7EC6\u8D44\u6599
-FileChooser.detailsViewButtonAccessibleName=\u8BE6\u7EC6\u8D44\u6599
+FileChooser.detailsViewButtonToolTip.textAndMnemonic=\u8BE6\u7EC6\u4FE1\u606F
+FileChooser.detailsViewButtonAccessibleName=\u8BE6\u7EC6\u4FE1\u606F
 FileChooser.viewMenuButtonToolTipText = \u67E5\u770B\u83DC\u5355
 FileChooser.viewMenuButtonAccessibleName = \u67E5\u770B\u83DC\u5355
-FileChooser.detailsViewActionLabel.textAndMnemonic=\u8BE6\u7EC6\u8D44\u6599
+FileChooser.detailsViewActionLabel.textAndMnemonic=\u8BE6\u7EC6\u4FE1\u606F
 FileChooser.refreshActionLabel.textAndMnemonic=\u5237\u65B0
 FileChooser.viewMenuLabel.textAndMnemonic=\u89C6\u56FE
 FileChooser.fileNameHeader.textAndMnemonic=\u540D\u79F0
--- a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_zh_TW.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_zh_TW.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=\u67E5\u8A62:
+FileChooser.lookInLabel.textAndMnemonic=\u67E5\u8A62(&I):
 FileChooser.saveInLabel.textAndMnemonic=\u5132\u5B58\u65BC: 
-FileChooser.fileNameLabel.textAndMnemonic=\u6A94\u6848\u540D\u7A31:
-FileChooser.folderNameLabel.textAndMnemonic=\u8CC7\u6599\u593E\u540D\u7A31:
-FileChooser.filesOfTypeLabel.textAndMnemonic=\u6A94\u6848\u985E\u578B:
+FileChooser.fileNameLabel.textAndMnemonic=\u6A94\u6848\u540D\u7A31(&N):
+FileChooser.folderNameLabel.textAndMnemonic=\u8CC7\u6599\u593E\u540D\u7A31(&N):
+FileChooser.filesOfTypeLabel.textAndMnemonic=\u6A94\u6848\u985E\u578B(&T):
 FileChooser.upFolderToolTip.textAndMnemonic=\u5F80\u4E0A\u4E00\u5C64
 FileChooser.upFolderAccessibleName=\u5F80\u4E0A
 FileChooser.homeFolderToolTip.textAndMnemonic=\u4E3B\u76EE\u9304
--- a/src/share/classes/com/sun/jndi/ldap/Connection.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/jndi/ldap/Connection.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -157,7 +157,8 @@
     volatile IOException closureReason = null;
     volatile boolean useable = true;  // is Connection still useable
 
-    private int readTimeout;
+    int readTimeout;
+    int connectTimeout;
 
     // true means v3; false means v2
     // Called in LdapClient.authenticate() (which is synchronized)
@@ -187,6 +188,7 @@
         this.port = port;
         this.parent = parent;
         this.readTimeout = readTimeout;
+        this.connectTimeout = connectTimeout;
 
         if (trace != null) {
             traceFile = trace;
@@ -685,9 +687,11 @@
                         ldr = ldr.next;
                     }
                 }
-                parent.processConnectionClosure();
             }
         }
+        if (nparent) {
+            parent.processConnectionClosure();
+        }
     }
 
 
--- a/src/share/classes/com/sun/jndi/ldap/LdapClient.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/jndi/ldap/LdapClient.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -149,149 +149,155 @@
         String authMechanism, Control[] ctls,  Hashtable env)
         throws NamingException {
 
-        authenticateCalled = true;
+        int readTimeout = conn.readTimeout;
+        conn.readTimeout = conn.connectTimeout;
+        LdapResult res = null;
 
         try {
-            ensureOpen();
-        } catch (IOException e) {
-            NamingException ne = new CommunicationException();
-            ne.setRootCause(e);
-            throw ne;
-        }
+            authenticateCalled = true;
+
+            try {
+                ensureOpen();
+            } catch (IOException e) {
+                NamingException ne = new CommunicationException();
+                ne.setRootCause(e);
+                throw ne;
+            }
+
+            switch (version) {
+            case LDAP_VERSION3_VERSION2:
+            case LDAP_VERSION3:
+                isLdapv3 = true;
+                break;
+            case LDAP_VERSION2:
+                isLdapv3 = false;
+                break;
+            default:
+                throw new CommunicationException("Protocol version " + version +
+                    " not supported");
+            }
+
+            if (authMechanism.equalsIgnoreCase("none") ||
+                authMechanism.equalsIgnoreCase("anonymous")) {
 
-        switch (version) {
-        case LDAP_VERSION3_VERSION2:
-        case LDAP_VERSION3:
-            isLdapv3 = true;
-            break;
-        case LDAP_VERSION2:
-            isLdapv3 = false;
-            break;
-        default:
-            throw new CommunicationException("Protocol version " + version +
-                " not supported");
-        }
-
-        LdapResult res = null;
-
-        if (authMechanism.equalsIgnoreCase("none") ||
-            authMechanism.equalsIgnoreCase("anonymous")) {
-
-            // Perform LDAP bind if we are reauthenticating, using LDAPv2,
-            // supporting failover to LDAPv2, or controls have been supplied.
-            if (!initial ||
-                (version == LDAP_VERSION2) ||
-                (version == LDAP_VERSION3_VERSION2) ||
-                ((ctls != null) && (ctls.length > 0))) {
+                // Perform LDAP bind if we are reauthenticating, using LDAPv2,
+                // supporting failover to LDAPv2, or controls have been supplied.
+                if (!initial ||
+                    (version == LDAP_VERSION2) ||
+                    (version == LDAP_VERSION3_VERSION2) ||
+                    ((ctls != null) && (ctls.length > 0))) {
+                    try {
+                        // anonymous bind; update name/pw for LDAPv2 retry
+                        res = ldapBind(name=null, (byte[])(pw=null), ctls, null,
+                            false);
+                        if (res.status == LdapClient.LDAP_SUCCESS) {
+                            conn.setBound();
+                        }
+                    } catch (IOException e) {
+                        NamingException ne =
+                            new CommunicationException("anonymous bind failed: " +
+                            conn.host + ":" + conn.port);
+                        ne.setRootCause(e);
+                        throw ne;
+                    }
+                } else {
+                    // Skip LDAP bind for LDAPv3 anonymous bind
+                    res = new LdapResult();
+                    res.status = LdapClient.LDAP_SUCCESS;
+                }
+            } else if (authMechanism.equalsIgnoreCase("simple")) {
+                // simple authentication
+                byte[] encodedPw = null;
                 try {
-                    // anonymous bind; update name/pw for LDAPv2 retry
-                    res = ldapBind(name=null, (byte[])(pw=null), ctls, null,
-                        false);
+                    encodedPw = encodePassword(pw, isLdapv3);
+                    res = ldapBind(name, encodedPw, ctls, null, false);
                     if (res.status == LdapClient.LDAP_SUCCESS) {
                         conn.setBound();
                     }
                 } catch (IOException e) {
                     NamingException ne =
-                        new CommunicationException("anonymous bind failed: " +
+                        new CommunicationException("simple bind failed: " +
+                            conn.host + ":" + conn.port);
+                    ne.setRootCause(e);
+                    throw ne;
+                } finally {
+                    // If pw was copied to a new array, clear that array as
+                    // a security precaution.
+                    if (encodedPw != pw && encodedPw != null) {
+                        for (int i = 0; i < encodedPw.length; i++) {
+                            encodedPw[i] = 0;
+                        }
+                    }
+                }
+            } else if (isLdapv3) {
+                // SASL authentication
+                try {
+                    res = LdapSasl.saslBind(this, conn, conn.host, name, pw,
+                        authMechanism, env, ctls);
+                    if (res.status == LdapClient.LDAP_SUCCESS) {
+                        conn.setBound();
+                    }
+                } catch (IOException e) {
+                    NamingException ne =
+                        new CommunicationException("SASL bind failed: " +
                         conn.host + ":" + conn.port);
                     ne.setRootCause(e);
                     throw ne;
                 }
             } else {
-                // Skip LDAP bind for LDAPv3 anonymous bind
-                res = new LdapResult();
-                res.status = LdapClient.LDAP_SUCCESS;
+                throw new AuthenticationNotSupportedException(authMechanism);
             }
-        } else if (authMechanism.equalsIgnoreCase("simple")) {
-            // simple authentication
-            byte[] encodedPw = null;
-            try {
-                encodedPw = encodePassword(pw, isLdapv3);
-                res = ldapBind(name, encodedPw, ctls, null, false);
-                if (res.status == LdapClient.LDAP_SUCCESS) {
-                    conn.setBound();
-                }
-            } catch (IOException e) {
-                NamingException ne =
-                    new CommunicationException("simple bind failed: " +
-                        conn.host + ":" + conn.port);
-                ne.setRootCause(e);
-                throw ne;
-            } finally {
-                // If pw was copied to a new array, clear that array as
-                // a security precaution.
-                if (encodedPw != pw && encodedPw != null) {
-                    for (int i = 0; i < encodedPw.length; i++) {
-                        encodedPw[i] = 0;
+
+            //
+            // re-try login using v2 if failing over
+            //
+            if (initial &&
+                (res.status == LdapClient.LDAP_PROTOCOL_ERROR) &&
+                (version == LdapClient.LDAP_VERSION3_VERSION2) &&
+                (authMechanism.equalsIgnoreCase("none") ||
+                    authMechanism.equalsIgnoreCase("anonymous") ||
+                    authMechanism.equalsIgnoreCase("simple"))) {
+
+                byte[] encodedPw = null;
+                try {
+                    isLdapv3 = false;
+                    encodedPw = encodePassword(pw, false);
+                    res = ldapBind(name, encodedPw, ctls, null, false);
+                    if (res.status == LdapClient.LDAP_SUCCESS) {
+                        conn.setBound();
+                    }
+                } catch (IOException e) {
+                    NamingException ne =
+                        new CommunicationException(authMechanism + ":" +
+                            conn.host +     ":" + conn.port);
+                    ne.setRootCause(e);
+                    throw ne;
+                } finally {
+                    // If pw was copied to a new array, clear that array as
+                    // a security precaution.
+                    if (encodedPw != pw && encodedPw != null) {
+                        for (int i = 0; i < encodedPw.length; i++) {
+                            encodedPw[i] = 0;
+                        }
                     }
                 }
             }
-        } else if (isLdapv3) {
-            // SASL authentication
-            try {
-                res = LdapSasl.saslBind(this, conn, conn.host, name, pw,
-                    authMechanism, env, ctls);
-                if (res.status == LdapClient.LDAP_SUCCESS) {
-                    conn.setBound();
-                }
-            } catch (IOException e) {
-                NamingException ne =
-                    new CommunicationException("SASL bind failed: " +
-                    conn.host + ":" + conn.port);
-                ne.setRootCause(e);
-                throw ne;
+
+            // principal name not found
+            // (map NameNotFoundException to AuthenticationException)
+            // %%% This is a workaround for Netscape servers returning
+            // %%% no such object when the principal name is not found
+            // %%% Note that when this workaround is applied, it does not allow
+            // %%% response controls to be recorded by the calling context
+            if (res.status == LdapClient.LDAP_NO_SUCH_OBJECT) {
+                throw new AuthenticationException(
+                    getErrorMessage(res.status, res.errorMessage));
             }
-        } else {
-            throw new AuthenticationNotSupportedException(authMechanism);
+            conn.setV3(isLdapv3);
+            return res;
+        } finally {
+            conn.readTimeout = readTimeout;
         }
-
-        //
-        // re-try login using v2 if failing over
-        //
-        if (initial &&
-            (res.status == LdapClient.LDAP_PROTOCOL_ERROR) &&
-            (version == LdapClient.LDAP_VERSION3_VERSION2) &&
-            (authMechanism.equalsIgnoreCase("none") ||
-                authMechanism.equalsIgnoreCase("anonymous") ||
-                authMechanism.equalsIgnoreCase("simple"))) {
-
-            byte[] encodedPw = null;
-            try {
-                isLdapv3 = false;
-                encodedPw = encodePassword(pw, false);
-                res = ldapBind(name, encodedPw, ctls, null, false);
-                if (res.status == LdapClient.LDAP_SUCCESS) {
-                    conn.setBound();
-                }
-            } catch (IOException e) {
-                NamingException ne =
-                    new CommunicationException(authMechanism + ":" +
-                        conn.host +     ":" + conn.port);
-                ne.setRootCause(e);
-                throw ne;
-            } finally {
-                // If pw was copied to a new array, clear that array as
-                // a security precaution.
-                if (encodedPw != pw && encodedPw != null) {
-                    for (int i = 0; i < encodedPw.length; i++) {
-                        encodedPw[i] = 0;
-                    }
-                }
-            }
-        }
-
-        // principal name not found
-        // (map NameNotFoundException to AuthenticationException)
-        // %%% This is a workaround for Netscape servers returning
-        // %%% no such object when the principal name is not found
-        // %%% Note that when this workaround is applied, it does not allow
-        // %%% response controls to be recorded by the calling context
-        if (res.status == LdapClient.LDAP_NO_SUCH_OBJECT) {
-            throw new AuthenticationException(
-                getErrorMessage(res.status, res.errorMessage));
-        }
-        conn.setV3(isLdapv3);
-        return res;
     }
 
     /**
@@ -487,14 +493,16 @@
      */
     void processConnectionClosure() {
         // Notify listeners
-        if (unsolicited.size() > 0) {
-            String msg;
-            if (conn != null) {
-                msg = conn.host + ":" + conn.port + " connection closed";
-            } else {
-                msg = "Connection closed";
+        synchronized (unsolicited) {
+            if (unsolicited.size() > 0) {
+                String msg;
+                if (conn != null) {
+                    msg = conn.host + ":" + conn.port + " connection closed";
+                } else {
+                    msg = "Connection closed";
+                }
+                notifyUnsolicited(new CommunicationException(msg));
             }
-            notifyUnsolicited(new CommunicationException(msg));
         }
 
         // Remove from pool
--- a/src/share/classes/com/sun/rmi/rmid/ExecOptionPermission.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/rmi/rmid/ExecOptionPermission.java	Fri Jun 21 19:11:42 2013 -0700
@@ -223,7 +223,7 @@
         implements java.io.Serializable
     {
 
-        private Hashtable permissions;
+        private Hashtable<String, Permission> permissions;
         private boolean all_allowed; // true if "*" is in the collection
         private static final long serialVersionUID = -1242475729790124375L;
 
@@ -231,7 +231,7 @@
          * Create an empty ExecOptionPermissionCollection.
          */
         public ExecOptionPermissionCollection() {
-            permissions = new Hashtable(11);
+            permissions = new Hashtable<>(11);
             all_allowed = false;
         }
 
@@ -291,7 +291,7 @@
 
             String pname = p.getName();
 
-            Permission x = (Permission) permissions.get(pname);
+            Permission x = permissions.get(pname);
 
             if (x != null)
                 // we have a direct hit!
@@ -306,7 +306,7 @@
             while ((last = pname.lastIndexOf(".", offset)) != -1) {
 
                 pname = pname.substring(0, last+1) + "*";
-                x = (Permission) permissions.get(pname);
+                x = permissions.get(pname);
 
                 if (x != null) {
                     return x.implies(permission);
@@ -321,7 +321,7 @@
             while ((last = pname.lastIndexOf("=", offset)) != -1) {
 
                 pname = pname.substring(0, last+1) + "*";
-                x = (Permission) permissions.get(pname);
+                x = permissions.get(pname);
 
                 if (x != null) {
                     return x.implies(permission);
@@ -341,7 +341,7 @@
          * @return an enumeration of all the ExecOptionPermission objects.
          */
 
-        public Enumeration elements()
+        public Enumeration<Permission> elements()
         {
             return permissions.elements();
         }
--- a/src/share/classes/com/sun/rmi/rmid/ExecPermission.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/rmi/rmid/ExecPermission.java	Fri Jun 21 19:11:42 2013 -0700
@@ -227,7 +227,7 @@
         extends PermissionCollection
         implements java.io.Serializable
     {
-        private Vector permissions;
+        private Vector<Permission> permissions;
 
         private static final long serialVersionUID = -3352558508888368273L;
 
@@ -235,7 +235,7 @@
          * Create an empty ExecPermissionCollection.
          */
         public ExecPermissionCollection() {
-            permissions = new Vector();
+            permissions = new Vector<>();
         }
 
         /**
@@ -274,10 +274,10 @@
             if (! (permission instanceof ExecPermission))
                 return false;
 
-            Enumeration e = permissions.elements();
+            Enumeration<Permission> e = permissions.elements();
 
             while (e.hasMoreElements()) {
-                ExecPermission x = (ExecPermission) e.nextElement();
+                ExecPermission x = (ExecPermission)e.nextElement();
                 if (x.implies(permission)) {
                     return true;
                 }
@@ -291,7 +291,7 @@
          *
          * @return an enumeration of all the ExecPermission objects.
          */
-        public Enumeration elements()
+        public Enumeration<Permission> elements()
         {
             return permissions.elements();
         }
--- a/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java	Fri Jun 21 19:11:42 2013 -0700
@@ -454,6 +454,10 @@
         useKeyTab = "true".equalsIgnoreCase((String)options.get("useKeyTab"));
         ticketCacheName = (String)options.get("ticketCache");
         keyTabName = (String)options.get("keyTab");
+        if (keyTabName != null) {
+            keyTabName = sun.security.krb5.internal.ktab.KeyTab.normalize(
+                         keyTabName);
+        }
         princName = (String)options.get("principal");
         refreshKrb5Config =
             "true".equalsIgnoreCase((String)options.get("refreshKrb5Config"));
@@ -1056,12 +1060,17 @@
 
             if (storeKey) {
                 if (encKeys == null) {
-                    if (!privCredSet.contains(ktab)) {
-                        privCredSet.add(ktab);
-                        // Compatibility; also add keys to privCredSet
-                        for (KerberosKey key: ktab.getKeys(kerbClientPrinc)) {
-                            privCredSet.add(new Krb5Util.KeysFromKeyTab(key));
+                    if (ktab != null) {
+                        if (!privCredSet.contains(ktab)) {
+                            privCredSet.add(ktab);
+                            // Compatibility; also add keys to privCredSet
+                            for (KerberosKey key: ktab.getKeys(kerbClientPrinc)) {
+                                privCredSet.add(new Krb5Util.KeysFromKeyTab(key));
+                            }
                         }
+                    } else {
+                        succeeded = false;
+                        throw new LoginException("No key to store");
                     }
                 } else {
                     for (int i = 0; i < kerbKeys.length; i ++) {
--- a/src/share/classes/com/sun/security/ntlm/Client.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/security/ntlm/Client.java	Fri Jun 21 19:11:42 2013 -0700
@@ -138,8 +138,7 @@
             domain = domainFromServer;
         }
         if (domain == null) {
-            throw new NTLMException(NTLMException.NO_DOMAIN_INFO,
-                    "No domain info");
+            domain = "";
         }
 
         int flags = 0x88200 | (inputFlags & 3);
--- a/src/share/classes/com/sun/security/ntlm/NTLM.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/security/ntlm/NTLM.java	Fri Jun 21 19:11:42 2013 -0700
@@ -135,10 +135,10 @@
 
         int readInt(int offset) throws NTLMException {
             try {
-                return internal[offset] & 0xff +
-                        (internal[offset+1] & 0xff << 8) +
-                        (internal[offset+2] & 0xff << 16) +
-                        (internal[offset+3] & 0xff << 24);
+                return (internal[offset] & 0xff) +
+                        ((internal[offset+1] & 0xff) << 8) +
+                        ((internal[offset+2] & 0xff) << 16) +
+                        ((internal[offset+3] & 0xff) << 24);
             } catch (ArrayIndexOutOfBoundsException ex) {
                 throw new NTLMException(NTLMException.PACKET_READ_ERROR,
                         "Input message incorrect size");
@@ -147,8 +147,8 @@
 
         int readShort(int offset) throws NTLMException {
             try {
-                return internal[offset] & 0xff +
-                        (internal[offset+1] & 0xff << 8);
+                return (internal[offset] & 0xff) +
+                        ((internal[offset+1] & 0xff << 8));
             } catch (ArrayIndexOutOfBoundsException ex) {
                 throw new NTLMException(NTLMException.PACKET_READ_ERROR,
                         "Input message incorrect size");
--- a/src/share/classes/com/sun/security/sasl/gsskerb/GssKrb5Base.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/security/sasl/gsskerb/GssKrb5Base.java	Fri Jun 21 19:11:42 2013 -0700
@@ -47,7 +47,6 @@
     }
 
     protected GSSContext secCtx = null;
-    protected MessageProp msgProp;              // QOP and privacy for unwrap
     protected static final int JGSS_QOP = 0;    // unrelated to SASL QOP mask
 
     protected GssKrb5Base(Map props, String className) throws SaslException {
@@ -75,6 +74,7 @@
         }
 
         try {
+            MessageProp msgProp = new MessageProp(JGSS_QOP, privacy);
             byte[] answer = secCtx.unwrap(incoming, start, len, msgProp);
             if (logger.isLoggable(Level.FINEST)) {
                 traceOutput(myClassName, "KRB501:Unwrap", "incoming: ",
@@ -100,6 +100,7 @@
 
         // Generate GSS token
         try {
+            MessageProp msgProp = new MessageProp(JGSS_QOP, privacy);
             byte[] answer = secCtx.wrap(outgoing, start, len, msgProp);
             if (logger.isLoggable(Level.FINEST)) {
                 traceOutput(myClassName, "KRB503:Wrap", "outgoing: ",
--- a/src/share/classes/com/sun/security/sasl/gsskerb/GssKrb5Client.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/security/sasl/gsskerb/GssKrb5Client.java	Fri Jun 21 19:11:42 2013 -0700
@@ -321,7 +321,6 @@
             }
 
             completed = true;  // server authenticated
-            msgProp = new MessageProp(JGSS_QOP, privacy);
 
             return gssOutToken;
         } catch (GSSException e) {
--- a/src/share/classes/com/sun/security/sasl/gsskerb/GssKrb5Server.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/security/sasl/gsskerb/GssKrb5Server.java	Fri Jun 21 19:11:42 2013 -0700
@@ -248,7 +248,6 @@
             } else if ((selectedQop&INTEGRITY_ONLY_PROTECTION) != 0) {
                 integrity = true;
             }
-            msgProp = new MessageProp(JGSS_QOP, privacy);
 
             // 2nd-4th octets specifies maximum buffer size expected by
             // client (in network byte order). This is the server's send
--- a/src/share/classes/com/sun/servicetag/BrowserSupport.java	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,199 +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.servicetag;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.lang.reflect.InvocationTargetException;
-import java.io.IOException;
-import java.net.URI;
-
-/**
- * BrowserSupport class.
- *
- * The implementation of the com.sun.servicetag API needs to be
- * compiled with JDK 5 as well since the consumer of this API
- * may require to support JDK 5 (e.g. NetBeans).
- *
- * The Desktop.browse() method can be backported in this class
- * if needed.  The current implementation only supports JDK 6.
- */
-class BrowserSupport {
-    private static boolean isBrowseSupported = false;
-    private static Method browseMethod = null;
-    private static Object desktop = null;
-    private static volatile Boolean result = false;
-
-
-    private static void initX() {
-        if  (desktop != null) {
-            return;
-        }
-        boolean supported = false;
-        Method browseM = null;
-        Object desktopObj = null;
-        try {
-            // Determine if java.awt.Desktop is supported
-            Class<?> desktopCls = Class.forName("java.awt.Desktop", true, null);
-            Method getDesktopM = desktopCls.getMethod("getDesktop");
-            browseM = desktopCls.getMethod("browse", URI.class);
-
-            Class<?> actionCls = Class.forName("java.awt.Desktop$Action", true, null);
-            final Method isDesktopSupportedMethod = desktopCls.getMethod("isDesktopSupported");
-            Method isSupportedMethod = desktopCls.getMethod("isSupported", actionCls);
-            Field browseField = actionCls.getField("BROWSE");
-            // isDesktopSupported calls getDefaultToolkit which can block
-            // infinitely, see 6636099 for details, to workaround we call
-            // in a  thread and time it out, noting that the issue is specific
-            // to X11, it does not hurt for Windows.
-            Thread xthread = new Thread() {
-                public void run() {
-                    try {
-                        // support only if Desktop.isDesktopSupported() and
-                        // Desktop.isSupported(Desktop.Action.BROWSE) return true.
-                        result = (Boolean) isDesktopSupportedMethod.invoke(null);
-                    } catch (IllegalAccessException e) {
-                        // should never reach here
-                        InternalError x =
-                            new InternalError("Desktop.getDesktop() method not found");
-                        x.initCause(e);
-                    } catch (InvocationTargetException e) {
-                        // browser not supported
-                        if (Util.isVerbose()) {
-                            e.printStackTrace();
-                        }
-                    }
-                }
-            };
-            // set it to daemon, so that the vm will exit.
-            xthread.setDaemon(true);
-            xthread.start();
-            try {
-                xthread.join(5 * 1000);
-            } catch (InterruptedException ie) {
-                // ignore the exception
-            }
-            if (result.booleanValue()) {
-                desktopObj = getDesktopM.invoke(null);
-                result = (Boolean) isSupportedMethod.invoke(desktopObj, browseField.get(null));
-                supported = result.booleanValue();
-            }
-        } catch (ClassNotFoundException e) {
-            // browser not supported
-            if (Util.isVerbose()) {
-                e.printStackTrace();
-            }
-        } catch (NoSuchMethodException e) {
-            // browser not supported
-            if (Util.isVerbose()) {
-                e.printStackTrace();
-            }
-        } catch (NoSuchFieldException e) {
-            // browser not supported
-            if (Util.isVerbose()) {
-                e.printStackTrace();
-            }
-        } catch (IllegalAccessException e) {
-            // should never reach here
-            InternalError x =
-                    new InternalError("Desktop.getDesktop() method not found");
-            x.initCause(e);
-            throw x;
-        } catch (InvocationTargetException e) {
-            // browser not supported
-            if (Util.isVerbose()) {
-                e.printStackTrace();
-            }
-        }
-        isBrowseSupported = supported;
-        browseMethod = browseM;
-        desktop = desktopObj;
-    }
-
-    static boolean isSupported() {
-        initX();
-        return isBrowseSupported;
-    }
-
-    /**
-     * Launches the default browser to display a {@code URI}.
-     * If the default browser is not able to handle the specified
-     * {@code URI}, the application registered for handling
-     * {@code URIs} of the specified type is invoked. The application
-     * is determined from the protocol and path of the {@code URI}, as
-     * defined by the {@code URI} class.
-     * <p>
-     * This method calls the Desktop.getDesktop().browse() method.
-     * <p>
-     * @param uri the URI to be displayed in the user default browser
-     *
-     * @throws NullPointerException if {@code uri} is {@code null}
-     * @throws UnsupportedOperationException if the current platform
-     * does not support the {@link Desktop.Action#BROWSE} action
-     * @throws IOException if the user default browser is not found,
-     * or it fails to be launched, or the default handler application
-     * failed to be launched
-     * @throws IllegalArgumentException if the necessary permissions
-     * are not available and the URI can not be converted to a {@code URL}
-     */
-    static void browse(URI uri) throws IOException {
-        if (uri == null) {
-            throw new NullPointerException("null uri");
-        }
-        if (!isSupported()) {
-            throw new UnsupportedOperationException("Browse operation is not supported");
-        }
-
-        // Call Desktop.browse() method
-        try {
-            if (Util.isVerbose()) {
-                System.out.println("desktop: " + desktop + ":browsing..." + uri);
-            }
-            browseMethod.invoke(desktop, uri);
-        } catch (IllegalAccessException e) {
-            // should never reach here
-            InternalError x =
-                new InternalError("Desktop.getDesktop() method not found");
-            x.initCause(e);
-                throw x;
-        } catch (InvocationTargetException e) {
-            Throwable x = e.getCause();
-            if (x != null) {
-                if (x instanceof UnsupportedOperationException) {
-                    throw (UnsupportedOperationException) x;
-                } else if (x instanceof IllegalArgumentException) {
-                    throw (IllegalArgumentException) x;
-                } else if (x instanceof IOException) {
-                    throw (IOException) x;
-                } else if (x instanceof SecurityException) {
-                    throw (SecurityException) x;
-                } else {
-                    // ignore
-                }
-            }
-        }
-    }
-}
--- a/src/share/classes/com/sun/servicetag/Installer.java	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,972 +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.servicetag;
-
-import java.io.*;
-import java.util.HashSet;
-import java.util.Locale;
-import java.util.Properties;
-import java.util.Set;
-import java.util.List;
-import java.util.ArrayList;
-import static com.sun.servicetag.Util.*;
-
-/**
- * Service Tag Installer for Java SE.
- */
-public class Installer {
-    // System properties for testing
-    private static String SVCTAG_DIR_PATH =
-        "servicetag.dir.path";
-    private static String SVCTAG_ENABLE_REGISTRATION =
-        "servicetag.registration.enabled";
-    private final static String ORACLE = "Oracle";
-    private final static String SUN = "Sun Microsystems";
-    private final static String REGISTRATION_XML = "registration.xml";
-    private final static String SERVICE_TAG_FILE = "servicetag";
-    private final static String REGISTRATION_HTML_NAME = "register";
-
-    private final static Locale[] knownSupportedLocales =
-        new Locale[] { Locale.ENGLISH,
-                       Locale.JAPANESE,
-                       Locale.SIMPLIFIED_CHINESE};
-
-    private final static String javaHome = System.getProperty("java.home");
-    private static File svcTagDir;
-    private static File serviceTagFile;
-    private static File regXmlFile;
-    private static RegistrationData registration;
-    private static boolean supportRegistration;
-    private static String registerHtmlParent;
-    private static Set<Locale> supportedLocales = new HashSet<Locale>();
-    private static Properties swordfishProps = null;
-    private static String[] jreArchs = null;
-    static {
-        String dir = System.getProperty(SVCTAG_DIR_PATH);
-        if (dir == null) {
-            svcTagDir = new File(getJrePath(), "lib" + File.separator + SERVICE_TAG_FILE);
-        } else {
-            svcTagDir = new File(dir);
-        }
-        serviceTagFile = new File(svcTagDir, SERVICE_TAG_FILE);
-        regXmlFile = new File(svcTagDir, REGISTRATION_XML);
-        if (System.getProperty(SVCTAG_ENABLE_REGISTRATION) == null) {
-            supportRegistration = isJdk();
-        } else {
-            supportRegistration = true;
-        }
-    }
-
-    private Installer() {
-    }
-
-    // Implementation of ServiceTag.getJavaServiceTag(String) method
-    static ServiceTag getJavaServiceTag(String source) throws IOException {
-        String vendor = System.getProperty("java.vendor", "");
-        if (!vendor.startsWith(SUN) && !vendor.startsWith(ORACLE)) {
-            // Products bundling this implementation may run on
-            // Mac OS which is not a Sun/Oracle JDK
-            return null;
-        }
-        boolean cleanup = false;
-        try {
-            // Check if we have the swordfish entries for this JRE version
-            if (loadSwordfishEntries() == null) {
-                return null;
-            }
-
-            ServiceTag st = getJavaServiceTag();
-            // Check if the service tag created by this bundle owner
-            if (st != null && st.getSource().equals(source)) {
-                // Install the system service tag if supported
-                // stclient may be installed after the service tag creation
-                if (Registry.isSupported()) {
-                    installSystemServiceTag();
-                }
-                return st;
-            }
-
-            // in case any exception thrown during the cleanup
-            cleanup = true;
-
-            // re-create a new one for this bundle owner
-            // first delete the registration data
-            deleteRegistrationData();
-            cleanup = false;
-
-            // create service tag and generate new register.html pages
-            return createServiceTag(source);
-        } finally {
-            if (cleanup) {
-                if (regXmlFile.exists()) {
-                    regXmlFile.delete();
-                }
-                if (serviceTagFile.exists()) {
-                    serviceTagFile.delete();
-                }
-            }
-        }
-    }
-
-    /**
-     * Returns the Java SE registration data located in
-     * the <JRE>/lib/servicetag/registration.xml by default.
-     *
-     * @throws IllegalArgumentException if the registration data
-     *         is of invalid format.
-     */
-    private static synchronized RegistrationData getRegistrationData()
-            throws IOException {
-        if (registration != null) {
-            return registration;
-        }
-        if (regXmlFile.exists()) {
-            BufferedInputStream in = null;
-            try {
-                in = new BufferedInputStream(new FileInputStream(regXmlFile));
-                registration = RegistrationData.loadFromXML(in);
-            } catch (IllegalArgumentException ex) {
-                System.err.println("Error: Bad registration data \"" +
-                                    regXmlFile + "\":" + ex.getMessage());
-                throw ex;
-            } finally {
-                if (in != null) {
-                    in.close();
-                }
-            }
-        } else {
-            registration = new RegistrationData();
-        }
-        return registration;
-    }
-
-    /**
-     * Write the registration data to the registration.xml file.
-     *
-     * The offline registration page has to be regenerated with
-     * the new registration data.
-     *
-     * @throws java.io.IOException
-     */
-    private static synchronized void writeRegistrationXml()
-            throws IOException {
-        if (!svcTagDir.exists()) {
-            // This check is for NetBeans or other products that
-            // bundles this com.sun.servicetag implementation for
-            // pre-6u5 release.
-            if (!svcTagDir.mkdir()) {
-                throw new IOException("Failed to create directory: " + svcTagDir);
-            }
-        }
-
-        // regenerate the new offline registration page
-        deleteRegistrationHtmlPage();
-        getRegistrationHtmlPage();
-
-        BufferedOutputStream out = null;
-        try {
-            out = new BufferedOutputStream(new FileOutputStream(regXmlFile));
-            getRegistrationData().storeToXML(out);
-        } catch (IllegalArgumentException ex) {
-            System.err.println("Error: Bad registration data \"" +
-                                regXmlFile + "\":" + ex.getMessage());
-            throw ex;
-        } finally {
-            if (out != null) {
-                out.close();
-            }
-        }
-    }
-
-    /**
-     * Returns the instance urn(s) stored in the servicetag file
-     * or empty set if file not exists.
-     */
-    private static Set<String> getInstalledURNs() throws IOException {
-        Set<String> urnSet = new HashSet<String>();
-        if (serviceTagFile.exists()) {
-            BufferedReader in = null;
-            try {
-                in = new BufferedReader(new FileReader(serviceTagFile));
-                String urn;
-                while ((urn = in.readLine()) != null) {
-                    urn = urn.trim();
-                    if (urn.length() > 0) {
-                        urnSet.add(urn);
-                    }
-                }
-            } finally {
-                if (in != null) {
-                    in.close();
-                }
-            }
-        }
-        return urnSet;
-    }
-
-    /**
-     * Return the Java SE service tag(s) if it exists.
-     * Typically only one Java SE service tag but it could have two for
-     * Solaris 32-bit and 64-bit on the same install directory.
-     *
-     * @return the service tag(s) for Java SE
-     */
-    private static ServiceTag[] getJavaServiceTagArray() throws IOException {
-        RegistrationData regData = getRegistrationData();
-        Set<ServiceTag> svcTags = regData.getServiceTags();
-        Set<ServiceTag> result = new HashSet<ServiceTag>();
-
-        Properties props = loadSwordfishEntries();
-        String jdkUrn = props.getProperty("servicetag.jdk.urn");
-        String jreUrn = props.getProperty("servicetag.jre.urn");
-        for (ServiceTag st : svcTags) {
-            if (st.getProductURN().equals(jdkUrn) ||
-                st.getProductURN().equals(jreUrn)) {
-                result.add(st);
-            }
-        }
-        return result.toArray(new ServiceTag[0]);
-    }
-
-    /**
-     * Returns the Java SE service tag for this running platform;
-     * or null if not exist.
-     * This method will return the 64-bit service tag if the JDK
-     * supports both 32-bit and 64-bit if already created.
-     */
-    private static ServiceTag getJavaServiceTag() throws IOException {
-        String definedId = getProductDefinedId();
-        for (ServiceTag st : getJavaServiceTagArray()) {
-            if (st.getProductDefinedInstanceID().equals(definedId)) {
-                return st;
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Create a service tag for Java SE and install in the system
-     * service tag registry if supported.
-     *
-     * A registration data <JRE>/lib/servicetag/registration.xml
-     * will be created to storeToXML the XML entry for Java SE service tag.
-     * If the system supports service tags, this method will install
-     * the Java SE service tag in the system service tag registry and
-     * its <tt>instance_urn</tt> will be stored to <JRE>/lib/servicetag/servicetag.
-     *
-     * If <JRE>/lib/servicetag/registration.xml exists but is not installed
-     * in the system service tag registry (i.e. servicetag doesn't exist),
-     * this method will install it as described above.
-     *
-     * If the system supports service tag, stclient will be used
-     * to create the Java SE service tag.
-     *
-     * A Solaris 32-bit and 64-bit JDK will be installed in the same
-     * directory but the registration.xml will have 2 service tags.
-     * The servicetag file will also contain 2 instance_urns for that case.
-     */
-    private static ServiceTag createServiceTag(String svcTagSource)
-            throws IOException {
-        // determine if a new service tag is needed to be created
-        ServiceTag newSvcTag = null;
-        if (getJavaServiceTag() == null) {
-            newSvcTag = newServiceTag(svcTagSource);
-        }
-
-        // Add the new service tag in the registration data
-        if (newSvcTag != null) {
-            RegistrationData regData = getRegistrationData();
-
-            // Add the service tag to the registration data in JDK/JRE
-            newSvcTag = regData.addServiceTag(newSvcTag);
-
-            // add if there is a service tag for the OS
-            ServiceTag osTag = SolarisServiceTag.getServiceTag();
-            if (osTag != null && regData.getServiceTag(osTag.getInstanceURN()) == null) {
-                regData.addServiceTag(osTag);
-            }
-            // write to the registration.xml
-            writeRegistrationXml();
-        }
-
-        // Install the system service tag if supported
-        if (Registry.isSupported()) {
-            installSystemServiceTag();
-        }
-        return newSvcTag;
-    }
-
-    private static void installSystemServiceTag() throws IOException {
-        // only install the service tag in the registry if
-        // it has permission to write the servicetag file.
-        if ((!serviceTagFile.exists() && !svcTagDir.canWrite()) ||
-                (serviceTagFile.exists() && !serviceTagFile.canWrite())) {
-            return;
-        }
-
-        Set<String> urns = getInstalledURNs();
-        ServiceTag[] javaSvcTags = getJavaServiceTagArray();
-        if (urns.size() < javaSvcTags.length) {
-            for (ServiceTag st : javaSvcTags) {
-                // Add the service tag in the system service tag registry
-                // if not installed
-                String instanceURN = st.getInstanceURN();
-                if (!urns.contains(instanceURN)) {
-                    Registry.getSystemRegistry().addServiceTag(st);
-                }
-            }
-        }
-        writeInstalledUrns();
-    }
-
-    private static ServiceTag newServiceTag(String svcTagSource) throws IOException {
-        // Load the swoRDFish information for the service tag creation
-        Properties props = loadSwordfishEntries();
-
-        // Determine the product URN and name
-        String productURN;
-        String productName;
-
-        if (isJdk()) {
-            // <HOME>/jre exists which implies it's a JDK
-            productURN = props.getProperty("servicetag.jdk.urn");
-            productName = props.getProperty("servicetag.jdk.name");
-        } else {
-            // Otherwise, it's a JRE
-            productURN = props.getProperty("servicetag.jre.urn");
-            productName = props.getProperty("servicetag.jre.name");
-        }
-
-        return ServiceTag.newInstance(ServiceTag.generateInstanceURN(),
-                                      productName,
-                                      System.getProperty("java.version"),
-                                      productURN,
-                                      props.getProperty("servicetag.parent.name"),
-                                      props.getProperty("servicetag.parent.urn"),
-                                      getProductDefinedId(),
-                                      System.getProperty("java.vendor"),
-                                      System.getProperty("os.arch"),
-                                      getZoneName(),
-                                      svcTagSource);
-    }
-
-    /**
-     * Delete the registration data, the offline registration pages and
-     * the service tags in the system service tag registry if installed.
-     *
-     * The registration.xml and servicetag file will be removed.
-     */
-    private static synchronized void deleteRegistrationData()
-            throws IOException {
-        try {
-            // delete the offline registration page
-            deleteRegistrationHtmlPage();
-
-            // Remove the service tag from the system ST registry if exists
-            Set<String> urns = getInstalledURNs();
-            if (urns.size() > 0 && Registry.isSupported()) {
-                for (String u : urns) {
-                    Registry.getSystemRegistry().removeServiceTag(u);
-                }
-            }
-            registration = null;
-        } finally {
-            // Delete the registration.xml and servicetag files if exists
-            if (regXmlFile.exists()) {
-                if (!regXmlFile.delete()) {
-                    throw new IOException("Failed to delete " + regXmlFile);
-                }
-            }
-            if (serviceTagFile.exists()) {
-                if (!serviceTagFile.delete()) {
-                    throw new IOException("Failed to delete " + serviceTagFile);
-                }
-            }
-        }
-    }
-
-    /**
-     * Updates the registration data to contain one single service tag
-     * for the running Java runtime.
-     */
-    private static synchronized void updateRegistrationData(String svcTagSource)
-            throws IOException {
-        RegistrationData regData = getRegistrationData();
-        ServiceTag curSvcTag = newServiceTag(svcTagSource);
-
-        ServiceTag[] javaSvcTags = getJavaServiceTagArray();
-        Set<String> urns = getInstalledURNs();
-        for (ServiceTag st : javaSvcTags) {
-            if (!st.getProductDefinedInstanceID().equals(curSvcTag.getProductDefinedInstanceID())) {
-                String instanceURN = st.getInstanceURN();
-                regData.removeServiceTag(instanceURN);
-
-                // remove it from the system service tag registry if exists
-                if (urns.contains(instanceURN) && Registry.isSupported()) {
-                    Registry.getSystemRegistry().removeServiceTag(instanceURN);
-                }
-            }
-        }
-        writeRegistrationXml();
-        writeInstalledUrns();
-    }
-
-    private static void writeInstalledUrns() throws IOException {
-        // if the Registry is not supported,
-        // remove the servicetag file
-        if (!Registry.isSupported() && serviceTagFile.exists()) {
-            serviceTagFile.delete();
-            return;
-        }
-
-        PrintWriter out = null;
-        try {
-            out = new PrintWriter(serviceTagFile);
-
-            ServiceTag[] javaSvcTags = getJavaServiceTagArray();
-            for (ServiceTag st : javaSvcTags) {
-                // Write the instance_run to the servicetag file
-                String instanceURN = st.getInstanceURN();
-                out.println(instanceURN);
-            }
-        } finally {
-            if (out != null) {
-                out.close();
-            }
-        }
-    }
-
-    /**
-     * Load the values associated with the swoRDFish metadata entries
-     * for Java SE. The swoRDFish metadata entries are different for
-     * different release.
-     *
-     * @param version Version of Java SE
-     */
-    private static synchronized Properties loadSwordfishEntries() throws IOException {
-        if (swordfishProps != null) {
-            return swordfishProps;
-        }
-
-        // The version string for Java SE 6 is 1.6.0
-        // We just need the minor number in the version string
-        int version = Util.getJdkVersion();
-
-        String filename = "/com/sun/servicetag/resources/javase_" +
-                version + "_swordfish.properties";
-        InputStream in = Installer.class.getResourceAsStream(filename);
-        if (in == null) {
-            return null;
-        }
-        swordfishProps = new Properties();
-        try {
-            swordfishProps.load(in);
-        } finally {
-            in.close();
-        }
-        return swordfishProps;
-    }
-
-    /**
-     * Returns the product defined instance ID for Java SE.
-     * It is a list of comma-separated name/value pairs:
-     *    "id=<full-version>  <arch> [<arch>]*"
-     *    "dir=<java.home system property value>"
-     *
-     * where <full-version> is the full version string of the JRE,
-     *       <arch> is the architecture that the runtime supports
-     *       (i.e. "sparc", "sparcv9", "i386", "amd64" (ISA list))
-     *
-     * For Solaris, it can be dual mode that can support both
-     * 32-bit and 64-bit. the "id" will be set to
-     *     "1.6.0_03-b02 sparc sparcv9"
-     *
-     * The "dir" property is included in the service tag to enable
-     * the Service Tag software to determine if a service tag for
-     * Java SE is invalid and perform appropriate service tag
-     * cleanup if necessary.  See RFE# 6574781 Service Tags Enhancement.
-     *
-     */
-    private static String getProductDefinedId() {
-        StringBuilder definedId = new StringBuilder();
-        definedId.append("id=");
-        definedId.append(System.getProperty("java.runtime.version"));
-
-        String[] archs = getJreArchs();
-        for (String name : archs) {
-            definedId.append(" " + name);
-        }
-
-        String location = ",dir=" + javaHome;
-        if ((definedId.length() + location.length()) < 256) {
-            definedId.append(",dir=");
-            definedId.append(javaHome);
-        } else {
-            // if it exceeds the limit, we will not include the location
-            if (isVerbose()) {
-                System.err.println("Warning: Product defined instance ID exceeds the field limit:");
-            }
-        }
-
-        return definedId.toString();
-    }
-
-    /**
-     * Returns the architectures that the runtime supports
-     *  (i.e. "sparc", "sparcv9", "i386", "amd64" (ISA list))
-     * The directory name where libjava.so is located.
-     *
-     * On Windows, returns the "os.arch" system property value.
-     */
-    private synchronized static String[] getJreArchs() {
-        if (jreArchs != null) {
-            return jreArchs;
-        }
-
-        Set<String> archs = new HashSet<String>();
-
-        String os = System.getProperty("os.name");
-        if (os.equals("SunOS") || os.equals("Linux")) {
-            // Traverse the directories under <JRE>/lib.
-            // If <JRE>/lib/<arch>/libjava.so exists, add <arch>
-            // to the product defined ID
-            File dir = new File(getJrePath() + File.separator + "lib");
-            if (dir.isDirectory()) {
-                String[] children = dir.list();
-                for (String name : children) {
-                    File f = new File(dir, name + File.separator + "libjava.so");
-                    if (f.exists()) {
-                        archs.add(name);
-                    }
-                }
-            }
-        } else {
-            // Windows - append the os.arch
-            archs.add(System.getProperty("os.arch"));
-        }
-        jreArchs = archs.toArray(new String[0]);
-        return jreArchs;
-    }
-
-    /**
-     * Return the zonename if zone is supported; otherwise, return
-     * "global".
-     */
-    private static String getZoneName() throws IOException {
-        String zonename = "global";
-
-        String command = "/usr/bin/zonename";
-        File f = new File(command);
-        // com.sun.servicetag package has to be compiled with JDK 5 as well
-        // JDK 5 doesn't support the File.canExecute() method.
-        // Risk not checking isExecute() for the zonename command is very low.
-        if (f.exists()) {
-            ProcessBuilder pb = new ProcessBuilder(command);
-            Process p = pb.start();
-            String output = commandOutput(p);
-            if (p.exitValue() == 0) {
-                zonename = output.trim();
-            }
-
-        }
-        return zonename;
-    }
-
-    private synchronized static String getRegisterHtmlParent() throws IOException {
-        if (registerHtmlParent == null) {
-            File htmlDir;    // register.html is put under the JDK directory
-            if (getJrePath().endsWith(File.separator + "jre")) {
-                htmlDir = new File(getJrePath(), "..");
-            } else {
-                // j2se non-image build
-                htmlDir = new File(getJrePath());
-            }
-
-            // initialize the supported locales
-            initSupportedLocales(htmlDir);
-
-            // Determine the location of the offline registration page
-            String path = System.getProperty(SVCTAG_DIR_PATH);
-            if (path == null) {
-                // Default is <JDK>/register.html
-                registerHtmlParent = htmlDir.getCanonicalPath();
-            } else {
-                File f = new File(path);
-                registerHtmlParent = f.getCanonicalPath();
-                if (!f.isDirectory()) {
-                    throw new InternalError("Path " + path + " set in \"" +
-                            SVCTAG_DIR_PATH + "\" property is not a directory");
-                }
-            }
-        }
-        return registerHtmlParent;
-    }
-
-    /**
-     * Returns the File object of the offline registration page localized
-     * for the default locale in the JDK directory.
-     */
-    static synchronized File getRegistrationHtmlPage() throws IOException {
-        if (!supportRegistration) {
-            // No register.html page generated if JRE
-            return null;
-        }
-
-        String parent = getRegisterHtmlParent();
-
-        // check if the offline registration page is already generated
-        File f = new File(parent, REGISTRATION_HTML_NAME + ".html");
-        if (!f.exists()) {
-            // Generate the localized version of the offline registration Page
-            generateRegisterHtml(parent);
-        }
-
-        String name = REGISTRATION_HTML_NAME;
-        Locale locale = getDefaultLocale();
-        if (!locale.equals(Locale.ENGLISH) && supportedLocales.contains(locale)) {
-            // if the locale is not English and is supported by JDK
-            // set to the appropriate offline registration page;
-            // otherwise,set to register.html.
-            name = REGISTRATION_HTML_NAME + "_" + locale.toString();
-        }
-        File htmlFile = new File(parent, name + ".html");
-        if (isVerbose()) {
-            System.out.print("Offline registration page: " + htmlFile);
-            System.out.println((htmlFile.exists() ?
-                               "" : " not exist. Use register.html"));
-        }
-        if (htmlFile.exists()) {
-            return htmlFile;
-        } else {
-            return new File(parent,
-                            REGISTRATION_HTML_NAME + ".html");
-        }
-    }
-
-    private static Locale getDefaultLocale() {
-        List<Locale> candidateLocales = getCandidateLocales(Locale.getDefault());
-        for (Locale l : candidateLocales) {
-            if (supportedLocales.contains(l)) {
-                return l;
-            }
-        }
-        return Locale.getDefault();
-    }
-
-    private static List<Locale> getCandidateLocales(Locale locale) {
-        String language = locale.getLanguage();
-        String country = locale.getCountry();
-        String variant = locale.getVariant();
-
-        List<Locale> locales = new ArrayList<Locale>(3);
-        if (variant.length() > 0) {
-            locales.add(locale);
-        }
-        if (country.length() > 0) {
-            locales.add((locales.size() == 0) ?
-                        locale : new Locale(language, country, ""));
-        }
-        if (language.length() > 0) {
-            locales.add((locales.size() == 0) ?
-                        locale : new Locale(language, "", ""));
-        }
-        return locales;
-    }
-
-    // Remove the offline registration pages
-    private static void deleteRegistrationHtmlPage() throws IOException {
-        String parent = getRegisterHtmlParent();
-        if (parent == null) {
-            return;
-        }
-
-        for (Locale locale : supportedLocales) {
-            String name = REGISTRATION_HTML_NAME;
-            if (!locale.equals(Locale.ENGLISH)) {
-                name += "_" + locale.toString();
-            }
-            File f = new File(parent, name + ".html");
-            if (f.exists()) {
-                if (!f.delete()) {
-                    throw new IOException("Failed to delete " + f);
-                }
-            }
-        }
-    }
-
-    private static void initSupportedLocales(File jdkDir) {
-        if (supportedLocales.isEmpty()) {
-            // initialize with the known supported locales
-            for (Locale l : knownSupportedLocales) {
-                supportedLocales.add(l);
-            }
-        }
-
-        // Determine unknown supported locales if any
-        // by finding the localized version of README.html
-        // This prepares if a new locale in JDK is supported in
-        // e.g. in the OpenSource world
-        FilenameFilter ff = new FilenameFilter() {
-            public boolean accept(File dir, String name) {
-                String fname = name.toLowerCase();
-                if (fname.startsWith("readme") && fname.endsWith(".html")) {
-                    return true;
-                }
-                return false;
-            }
-        };
-
-        String[] readmes = jdkDir.list(ff);
-        for (String name : readmes) {
-            String basename = name.substring(0, name.length() - ".html".length());
-            String[] ss = basename.split("_");
-            switch (ss.length) {
-                case 1:
-                    // English version
-                    break;
-                case 2:
-                    supportedLocales.add(new Locale(ss[1]));
-                    break;
-                case 3:
-                    supportedLocales.add(new Locale(ss[1], ss[2]));
-                    break;
-                default:
-                    // ignore
-                    break;
-            }
-        }
-        if (isVerbose()) {
-            System.out.println("Supported locales: ");
-            for (Locale l : supportedLocales) {
-                System.out.println(l);
-            }
-        }
-    }
-
-    private static final String JDK_HEADER_PNG_KEY = "@@JDK_HEADER_PNG@@";
-    private static final String JDK_VERSION_KEY = "@@JDK_VERSION@@";
-    private static final String REGISTRATION_URL_KEY = "@@REGISTRATION_URL@@";
-    private static final String REGISTRATION_PAYLOAD_KEY = "@@REGISTRATION_PAYLOAD@@";
-
-    @SuppressWarnings("unchecked")
-    private static void generateRegisterHtml(String parent) throws IOException {
-        int version = Util.getJdkVersion();
-        int update = Util.getUpdateVersion();
-        String jdkVersion = "Version " + version;
-        if (update > 0) {
-            // product name is not translated
-            jdkVersion += " Update " + update;
-        }
-        RegistrationData regData = getRegistrationData();
-        // Make sure it uses the canonical path before getting the URI.
-        File img = new File(svcTagDir.getCanonicalPath(), "jdk_header.png");
-        String headerImageSrc = img.toURI().toString();
-
-        // Format the registration data in one single line
-        StringBuilder payload = new StringBuilder();
-        String xml = regData.toString().replaceAll("\"", "%22");
-        BufferedReader reader = new BufferedReader(new StringReader(xml));
-        try {
-            String line = null;
-            while ((line = reader.readLine()) != null) {
-                payload.append(line.trim());
-            }
-        } finally {
-            reader.close();
-        }
-
-        String resourceFilename = "/com/sun/servicetag/resources/register";
-        for (Locale locale : supportedLocales) {
-            String name = REGISTRATION_HTML_NAME;
-            String resource = resourceFilename;
-            if (!locale.equals(Locale.ENGLISH)) {
-                name += "_" + locale.toString();
-                resource += "_" + locale.toString();
-            }
-            File f = new File(parent, name + ".html");
-            InputStream in = null;
-            BufferedReader br = null;
-            PrintWriter pw = null;
-            String registerURL = SunConnection.
-                getRegistrationURL(regData.getRegistrationURN(),
-                                   locale,
-                                   String.valueOf(version)).toString();
-            try {
-                in = Installer.class.getResourceAsStream(resource + ".html");
-                if (in == null) {
-                    // if the resource file is missing
-                    if (isVerbose()) {
-                        System.out.println("Missing resouce file: " + resource + ".html");
-                    }
-                    continue;
-                }
-                if (isVerbose()) {
-                    System.out.println("Generating " + f + " from " + resource + ".html");
-                }
-
-                try {
-                    br = new BufferedReader(new InputStreamReader(in, "UTF-8"));
-                    pw = new PrintWriter(f, "UTF-8");
-                    String line = null;
-                    while ((line = br.readLine()) != null) {
-                        String output = line;
-                        if (line.contains(JDK_VERSION_KEY)) {
-                            output = line.replace(JDK_VERSION_KEY, jdkVersion);
-                        } else if (line.contains(JDK_HEADER_PNG_KEY)) {
-                            output = line.replace(JDK_HEADER_PNG_KEY, headerImageSrc);
-                        } else if (line.contains(REGISTRATION_URL_KEY)) {
-                            output = line.replace(REGISTRATION_URL_KEY, registerURL);
-                        } else if (line.contains(REGISTRATION_PAYLOAD_KEY)) {
-                            output = line.replace(REGISTRATION_PAYLOAD_KEY, payload.toString());
-                        }
-                        pw.println(output);
-                    }
-                    f.setReadOnly();
-                    pw.flush();
-                } finally {
-                    // It's safe for this finally block to have two close statements
-                    // consecutively as PrintWriter.close doesn't throw IOException.
-                    if (pw != null) {
-                        pw.close();
-                    }
-                    if (br!= null) {
-                        br.close();
-                    }
-                }
-            } finally {
-                if (in != null) {
-                    in.close();
-                }
-            }
-        }
-    }
-
-    private static final int MAX_SOURCE_LEN = 63;
-
-    /**
-     * A utility class to create a service tag for Java SE.
-     * <p>
-     * <b>Usage:</b><br>
-     * <blockquote><tt>
-     * &lt;JAVA_HOME&gt;/bin/java com.sun.servicetag.Installer
-     * </tt></blockquote>
-     * <p>
-     */
-    public static void main(String[] args) {
-        String source = "Manual ";
-        String runtimeName = System.getProperty("java.runtime.name");
-        if (runtimeName.startsWith("OpenJDK")) {
-            source = "OpenJDK ";
-        }
-        source += System.getProperty("java.runtime.version");
-        if (source.length() > MAX_SOURCE_LEN) {
-            source = source.substring(0, MAX_SOURCE_LEN);
-        }
-
-        // Parse the options (arguments starting with "-" )
-        boolean delete = false;
-        boolean update = false;
-        boolean register = false;
-        int count = 0;
-        while (count < args.length) {
-            String arg = args[count];
-            if (arg.trim().length() == 0) {
-                // skip empty arguments
-                count++;
-                continue;
-            }
-
-            if (arg.equals("-source")) {
-                source = args[++count];
-            } else if (arg.equals("-delete")) {
-                delete = true;
-            } else if (arg.equals("-register")) {
-                register = true;
-            } else {
-                usage();
-                return;
-            }
-            count++;
-        }
-        try {
-            if (delete) {
-                deleteRegistrationData();
-            } else {
-                ServiceTag[] javaSvcTags = getJavaServiceTagArray();
-                String[] archs = getJreArchs();
-                if (javaSvcTags.length > archs.length) {
-                    // 64-bit has been uninstalled
-                    // so remove the service tag
-                    updateRegistrationData(source);
-                } else {
-                    // create the service tag
-                    createServiceTag(source);
-                }
-            }
-
-            if (register) {
-                // Registration is only supported by JDK
-                // For testing purpose, override with a "servicetag.enable.registration" property
-
-                RegistrationData regData = getRegistrationData();
-                if (supportRegistration && !regData.getServiceTags().isEmpty()) {
-                    SunConnection.register(regData,
-                                           getDefaultLocale(),
-                                           String.valueOf(Util.getJdkVersion()));
-                }
-            }
-            System.exit(0);
-        } catch (IOException e) {
-            System.err.println("I/O Error: " + e.getMessage());
-            if (isVerbose()) {
-                e.printStackTrace();
-            }
-        } catch (IllegalArgumentException ex) {
-            if (isVerbose()) {
-                ex.printStackTrace();
-            }
-        } catch (Exception e) {
-            System.err.println("Error: " + e.getMessage());
-            if (isVerbose()) {
-                e.printStackTrace();
-            }
-        }
-        System.exit(1);
-    }
-
-    private static void usage() {
-        System.out.println("Usage:");
-        System.out.print("    " + Installer.class.getName());
-        System.out.println(" [-delete|-source <source>|-register]");
-        System.out.println("       to create a service tag for the Java platform");
-        System.out.println("");
-        System.out.println("Internal Options:");
-        System.out.println("    -source: to specify the source of the service tag to be created");
-        System.out.println("    -delete: to delete the service tag ");
-        System.out.println("    -register: to register the JDK");
-        System.out.println("    -help:   to print this help message");
-    }
-}
--- a/src/share/classes/com/sun/servicetag/LinuxSystemEnvironment.java	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,193 +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.servicetag;
-
-// This class is a copy of the com.sun.scn.servicetags.LinuxSystemEnvironment
-// class from the Sun Connection source.
-//
-// The Service Tags team maintains the latest version of the implementation
-// for system environment data collection.  JDK will include a copy of
-// the most recent released version for a JDK release. We rename
-// the package to com.sun.servicetag so that the Sun Connection
-// product always uses the latest version from the com.sun.scn.servicetags
-// package. JDK and users of the com.sun.servicetag API
-// (e.g. NetBeans and SunStudio) will use the version in JDK.
-//
-// So we keep this class in src/share/classes instead of src/<os>/classes.
-
-import java.io.*;
-
-/**
- * Linux implementation of the SystemEnvironment class.
- */
-class LinuxSystemEnvironment extends SystemEnvironment {
-    LinuxSystemEnvironment() {
-        setHostId(getLinuxHostId());
-        setSystemModel(getCommandOutput("/bin/uname", "-i"));
-        setSystemManufacturer(getLinuxSystemManufacturer());
-        setCpuManufacturer(getLinuxCpuManufacturer());
-        setSerialNumber(getLinuxSN());
-    }
-    private String dmiInfo = null;
-
-    private static final int SN  = 1;
-    private static final int SYS = 2;
-    private static final int CPU = 3;
-
-    private String getLinuxHostId() {
-        String output = getCommandOutput("/usr/bin/hostid");
-        // trim off the leading 0x
-        if (output.startsWith("0x")) {
-            output = output.substring(2);
-        }
-        return output;
-    }
-
-    /**
-     * Tries to obtain and return the cpu manufacturer.
-     * @return The cpu manufacturer (an empty string if not found or an error occurred)
-     */
-    private String getLinuxCpuManufacturer() {
-        String tmp = getLinuxPSNInfo(CPU);
-        if (tmp.length() > 0) {
-            return tmp;
-        }
-
-        String contents = getFileContent("/proc/cpuinfo");
-        for (String line : contents.split("\n")) {
-            if (line.contains("vendor_id")) {
-                String[] ss = line.split(":", 2);
-                if (ss.length > 1) {
-                    return ss[1].trim();
-                }
-            }
-        }
-
-        // returns an empty string if it can't be found or an error happened
-        return getLinuxDMIInfo("dmi type 4", "manufacturer");
-    }
-
-
-    /**
-     * Tries to obtain and return the system manufacturer.
-     * @return The system manufacturer (an empty string if not found or an error occurred)
-     */
-    private String getLinuxSystemManufacturer() {
-        String tmp = getLinuxPSNInfo(SYS);
-        if (tmp.length() > 0) {
-            return tmp;
-        }
-
-        // returns an empty string if it can't be found or an error happened
-        return getLinuxDMIInfo("dmi type 1", "manufacturer");
-    }
-
-    /**
-     * Tries to obtain and return the serial number of the system.
-     * @return The serial number (an empty string if not found or an error occurred)
-     */
-    private String getLinuxSN() {
-        String tmp = getLinuxPSNInfo(SN);
-        if (tmp.length() > 0) {
-            return tmp;
-        }
-
-        // returns an empty string if it can't be found or an error happened
-        return getLinuxDMIInfo("dmi type 1", "serial number");
-    }
-
-    private String getLinuxPSNInfo(int target) {
-        // try to read from the psn file if it exists
-        String contents = getFileContent("/var/run/psn");
-        String[] ss = contents.split("\n");
-        if (target <= ss.length) {
-            return ss[target-1];
-        }
-
-        // default case is to return ""
-        return "";
-    }
-
-    // reads from dmidecode with the given type and target
-    // returns an empty string if nothing was found or an error occurred
-    //
-    // Sample output segment:
-    // Handle 0x0001
-    //         DMI type 1, 25 bytes.
-    //         System Information
-    //                 Manufacturer: System manufacturer
-    //                 Product Name: System Product Name
-    //                 Version: System Version
-    //                 Serial Number: System Serial Number
-    //                 UUID: 3091D719-B25B-D911-959D-6D1B12C7686E
-    //                 Wake-up Type: Power Switch
-
-    private synchronized String getLinuxDMIInfo(String dmiType, String target) {
-        // only try to get dmidecode information once, after that, we can
-        // reuse the output
-        if (dmiInfo == null) {
-            Thread dmidecodeThread = new Thread() {
-                public void run() {
-                    dmiInfo = getCommandOutput("/usr/sbin/dmidecode");
-                }
-            };
-            dmidecodeThread.start();
-
-            try {
-                dmidecodeThread.join(2000);
-                if (dmidecodeThread.isAlive()) {
-                    dmidecodeThread.interrupt();
-                    dmiInfo = "";
-                }
-            } catch (InterruptedException ie) {
-                dmidecodeThread.interrupt();
-            }
-        }
-
-        if (dmiInfo.length() == 0) {
-            return "";
-        }
-        boolean dmiFlag = false;
-        for (String s : dmiInfo.split("\n")) {
-            String line = s.toLowerCase();
-            if (dmiFlag) {
-                if (line.contains(target)) {
-                    String key = target + ":";
-                    int indx = line.indexOf(key) + key.length();
-                    if (line.contains(key) && indx < line.length()) {
-                        return line.substring(indx).trim();
-                    }
-                    String[] ss = line.split(":");
-                    return ss[ss.length-1];
-                }
-            } else if (line.contains(dmiType)) {
-                dmiFlag = true;
-            }
-        }
-        return "";
-    }
-
-}
--- a/src/share/classes/com/sun/servicetag/RegistrationData.java	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,475 +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.servicetag;
-
-import java.io.*;
-import java.net.UnknownHostException;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Set;
-
-import static com.sun.servicetag.RegistrationDocument.*;
-
-/**
- * A {@code RegistrationData} object is a container of one or more
- * {@link #getServiceTags service tags} that identify the
- * components for product registration.
- * Each {@code RegistrationData} object has a {@link #getRegistrationURN
- * uniform resource name} (URN) as its identifier.
- * <a name="EnvMap"></a>
- * It also has an <i>environment map</i> with
- * the following elements:
- * <blockquote>
- *       <table border=0>
- *       <tr>
- *          <td><tt>hostname</tt></td>
- *          <td>Hostname of the system</td>
- *          <td>e.g. woody</td>
- *       </tr>
- *       <tr>
- *          <td><tt>hostId</tt></td>
- *          <td>Host ID of the system</td>
- *          <td>e.g. 83abc1ab</td>
- *       </tr>
- *       <tr>
- *          <td><tt>osName</tt></td>
- *          <td>Operating system name</td>
- *          <td> e.g. SunOS</td>
- *       </tr>
- *       <tr>
- *          <td><tt>osVersion</tt></td>
- *          <td>Operating system version</td>
- *          <td> e.g. 5.10</td>
- *       </tr>
- *       <tr>
- *          <td><tt>osArchitecture</tt></td>
- *          <td>Operating system architecture</td>
- *          <td> e.g. sparc</td>
- *       </tr>
- *       <tr>
- *          <td><tt>systemModel</tt></td>
- *          <td>System model</td>
- *          <td> e.g. SUNW,Sun-Fire-V440</td>
- *       </tr>
- *       <tr>
- *          <td><tt>systemManufacturer</tt></td>
- *          <td>System manufacturer</td>
- *          <td> e.g. Oracle Corporation</td>
- *       </tr>
- *       <tr>
- *          <td><tt>cpuManufacturer</tt></td>
- *          <td>CPU manufacturer</td>
- *          <td> e.g. Oracle Corporation</td>
- *       </tr>
- *       <tr>
- *          <td><tt>serialNumber</tt></td>
- *          <td>System serial number</td>
- *          <td> e.g. BEL078932</td>
- *       </tr>
- *       </table>
- *  </blockquote>
- * The <tt>hostname</tt> and <tt>osName</tt> element must have a non-empty value.
- * If an element is not available on a system and their value will be
- * empty.
- * <p>
- * <a name="XMLSchema">
- * <b>Registration XML Schema</b></a>
- * <p>
- * A {@code RegistrationData} object can be {@link #loadFromXML loaded} from
- * and {@link #storeToXML stored} into an XML file in the format described
- * by the
- * <a href="https://sn-tools.central.sun.com/twiki/pub/ServiceTags/RegistrationRelayService/product_registration.xsd">
- * registration data schema</a>.  The registration data schema is defined by the
- * Service Tags Technology.
- * <p>
- * Typically the registration data is constructed at installation time
- * and stored in an XML file for later service tag lookup or registration.
- *
- * <p>
- * <b>Example Usage</b>
- * <p>
- * The examples below show how the {@code RegistrationData} can be
- * used for product registration.
- * Exception handling is not shown in these examples for clarity.
- * <ol>
- * <li>This example shows how the JDK creates a JDK service tag, installs it
- * in the system service tag registry and adds it to the registration data.
- * <br>
- * <blockquote><pre>
- *   // create a service tag object with an instance_urn
- *   ServiceTag st = ServiceTag.newInstance(ServiceTag.generateInstanceURN(),
- *                                          ....);
- *   // Adds to the system service tag registry if supported
- *   if (Registry.isSupported()) {
- *       Registry.getSystemRegistry().addServiceTag(st);
- *   }
- *
- *   // add to the registration data
- *   RegistrationData registration  = new RegistrationData();
- *   registration.addServiceTag(st);
- * </pre></blockquote>
- * </li>
- * <li>At this point, the registration data is ready to
- * send to Sun Connection for registration. This example shows how to register
- * the JDK via the <i>Registration Relay Service</i>.
- * <p>
- * There are several registration services for Sun Connection. For example,
- * the <a href="https://sn-tools.central.sun.com/twiki/bin/view/ServiceTags/RegistrationRelayService">
- * Registration Relay Service</a> is a web application interface that
- * processes the registration data payload sent via HTTP post
- * and hosts the registration user interface for a specified
- * registration URL.  Refer to the
- * Registration Relay Service Specification for details.
- * <p>
- * <blockquote><pre>
- *   // Open the connection to the URL of the registration service
- *   HttpsURLConnection con = (HttpsURLConnection) url.openConnection();
- *   con.setDoInput(true);
- *   con.setDoOutput(true);
- *   con.setUseCaches(false);
- *   con.setAllowUserInteraction(false);
- *   con.setRequestMethod("POST");
- *   con.setRequestProperty("Content-Type", "text/xml;charset=\"utf-8\"");
- *   con.connect();
- *
- *   // send the registration data to the registration service
- *   OutputStream out = con.getOutputStream();
- *   registration.storeToXML(out);
- *   out.close();
- * </pre></blockquote>
- * </li>
- * <li>This example shows how to store the registration data in an XML file.
- *     for later service tag lookup or registration.
- * <br>
- * <blockquote><pre>
- *   BufferedOutputStream out = new BufferedOutputStream(
- *       new FileOutputStream(""&lt;JAVA_HOME&gt;/lib/servicetag/registration.xml"));
- *   registration.storeToXML(out);
- *   out.close();
- * </pre></blockquote>
- * </li>
- * <li>This example shows how to install service tags that are in the
- * registration data in the system service tag registry when determined
- * to be available.  The system service tag registry might not have existed
- * when the registration data was constructed.
- * <br>
- * <blockquote><pre>
- *   if (Registry.isSupported()) {
- *       Set&lt;ServiceTag&gt; svctags = registration.getServiceTags();
- *       for (ServiceTag st : svctags) {
- *           Registry.getSystemRegistry().addServiceTag(st);
- *       }
- *   }
- * </pre></blockquote>
- * </li>
- * </ol>
- *
- * @see <a href="https://sunconnection.sun.com/inventory">Sun Connection Inventory Channel</a>
- */
-public class RegistrationData {
-    private final Map<String, String> environment = initEnvironment();
-    private final Map<String, ServiceTag> svcTagMap =
-        new LinkedHashMap<String, ServiceTag>();
-    private final String urn;
-
-    /**
-     * Creates a {@code RegistrationData} object with a generated
-     * {@link #getRegistrationURN registration URN}.
-     * The following keys in the {@link #getEnvironmentMap environment map}
-     * will be initialized for the configuration of the
-     * running system:
-     * <blockquote>
-     * <tt>hostname</tt>, <tt>osName</tt>,  <tt>osVersion</tt> and
-     * <tt>osArchitecture</tt>
-     * </blockquote>
-     * and the value of other keys may be empty.
-     */
-    public RegistrationData() {
-        this(Util.generateURN());
-        SystemEnvironment sysEnv = SystemEnvironment.getSystemEnvironment();
-        setEnvironment(ST_NODE_HOSTNAME, sysEnv.getHostname());
-        setEnvironment(ST_NODE_HOST_ID, sysEnv.getHostId());
-        setEnvironment(ST_NODE_OS_NAME, sysEnv.getOsName());
-        setEnvironment(ST_NODE_OS_VERSION, sysEnv.getOsVersion());
-        setEnvironment(ST_NODE_OS_ARCH, sysEnv.getOsArchitecture());
-        setEnvironment(ST_NODE_SYSTEM_MODEL, sysEnv.getSystemModel());
-        setEnvironment(ST_NODE_SYSTEM_MANUFACTURER, sysEnv.getSystemManufacturer());
-        setEnvironment(ST_NODE_CPU_MANUFACTURER, sysEnv.getCpuManufacturer());
-        setEnvironment(ST_NODE_SERIAL_NUMBER, sysEnv.getSerialNumber());
-    }
-
-    // package private
-    RegistrationData(String urn) {
-        this.urn = urn;
-    }
-
-    private Map<String, String> initEnvironment() {
-        Map<String, String> map = new LinkedHashMap<String, String>();
-        map.put(ST_NODE_HOSTNAME, "");
-        map.put(ST_NODE_HOST_ID, "");
-        map.put(ST_NODE_OS_NAME, "");
-        map.put(ST_NODE_OS_VERSION, "");
-        map.put(ST_NODE_OS_ARCH, "");
-        map.put(ST_NODE_SYSTEM_MODEL, "");
-        map.put(ST_NODE_SYSTEM_MANUFACTURER, "");
-        map.put(ST_NODE_CPU_MANUFACTURER, "");
-        map.put(ST_NODE_SERIAL_NUMBER, "");
-        return map;
-    }
-
-    /**
-     * Returns the uniform resource name of this registration data
-     * in this format:
-     * <tt>urn:st:&lt;32-char {@link java.util.UUID uuid}&gt;</tt>
-     *
-     * @return the URN of this registration data.
-     */
-    public String getRegistrationURN() {
-        return urn;
-    }
-
-    /**
-     * Returns a map containing the environment information for this
-     * registration data.  See the set of <a href="#EnvMap">keys</a>
-     * in the environment map. Subsequent update to the environment
-     * map via the {@link #setEnvironment setEnvironment} method will not be reflected
-     * in the returned map.
-     *
-     * @return an environment map for this registration data.
-     */
-    public Map<String, String> getEnvironmentMap() {
-        return new LinkedHashMap<String,String>(environment);
-    }
-
-    /**
-     * Sets an element of the specified {@code name} in the environment map
-     * with the given {@code value}.
-     *
-     * @throws IllegalArgumentException if {@code name} is not a valid key
-     * in the environment map, or {@code value} is not valid.
-     */
-    public void setEnvironment(String name, String value) {
-        if (name == null) {
-            throw new NullPointerException("name is null");
-        }
-        if (value == null) {
-            throw new NullPointerException("value is null");
-        }
-        if (environment.containsKey(name)) {
-            if (name.equals(ST_NODE_HOSTNAME) || name.equals(ST_NODE_OS_NAME)) {
-                if (value.length() == 0) {
-                    throw new IllegalArgumentException("\"" +
-                        name + "\" requires non-empty value.");
-                }
-            }
-            environment.put(name, value);
-        } else {
-            throw new IllegalArgumentException("\"" +
-                 name + "\" is not an environment element.");
-        }
-    }
-
-    /**
-     * Returns all service tags in this registration data.
-     *
-     * @return  a {@link Set Set} of the service tags
-     * in this registration data.
-     */
-    public Set<ServiceTag> getServiceTags() {
-        return new HashSet<ServiceTag>(svcTagMap.values());
-    }
-
-    /**
-     * Adds a service tag to this registration data.
-     * If the given service tag has an empty <tt>instance_urn</tt>,
-     * this method will generate a URN and place it in the copy
-     * of the service tag in this registration data.
-     * This method will return the {@code ServiceTag} object
-     * added to this registration data.
-     *
-     * @param st {@code ServiceTag} object to be added.
-     * @return a {@code ServiceTag} object added to this registration data.
-     *
-     * @throws IllegalArgumentException if
-     *   a service tag of the same {@link ServiceTag#getInstanceURN
-     *   <tt>instance_urn</tt>} already exists in the registry.
-     */
-    public synchronized ServiceTag addServiceTag(ServiceTag st) {
-        ServiceTag svcTag = ServiceTag.newInstanceWithUrnTimestamp(st);
-
-        String instanceURN = svcTag.getInstanceURN();
-        if (svcTagMap.containsKey(instanceURN)) {
-            throw new IllegalArgumentException("Instance_urn = " + instanceURN +
-                    " already exists in the registration data.");
-        } else {
-            svcTagMap.put(instanceURN, svcTag);
-        }
-        return svcTag;
-    }
-
-    /**
-     * Returns a service tag of the given <tt>instance_urn</tt> in this registration
-     * data.
-     *
-     * @param instanceURN the <tt>instance_urn</tt> of the service tag
-     * @return the {@code ServiceTag} object of the given  <tt>instance_urn</tt>
-     *         if exists; otherwise return {@code null}.
-     */
-    public synchronized ServiceTag getServiceTag(String instanceURN) {
-        if (instanceURN == null) {
-            throw new NullPointerException("instanceURN is null");
-        }
-        return svcTagMap.get(instanceURN);
-    }
-
-    /**
-     * Removes a service tag of the given <tt>instance_urn</tt> from this
-     * registration data.
-     *
-     * @param instanceURN the <tt>instance_urn</tt> of
-     * the service tag to be removed.
-     *
-     * @return the removed {@code ServiceTag} object;
-     * or {@code null} if the service tag does not exist in this
-     * registration data.
-     */
-    public synchronized ServiceTag removeServiceTag(String instanceURN) {
-        if (instanceURN == null) {
-            throw new NullPointerException("instanceURN is null");
-        }
-
-        ServiceTag svcTag = null;
-        if (svcTagMap.containsKey(instanceURN)) {
-            svcTag = svcTagMap.remove(instanceURN);
-        }
-        return svcTag;
-    }
-
-     /**
-     * Updates the <tt>product_defined_instance_id</tt> in the service tag
-     * of the given <tt>instance_urn</tt> in this registration data.
-     *
-     * @param instanceURN the <tt>instance_urn</tt> of the service tag to be updated.
-     * @param productDefinedInstanceID the value of the
-     * <tt>product_defined_instance_id</tt> to be set.
-     *
-     * @return the updated {@code ServiceTag} object;
-     * or {@code null} if the service tag does not exist in this
-     * registration data.
-     */
-    public synchronized ServiceTag updateServiceTag(String instanceURN,
-                                                    String productDefinedInstanceID) {
-        ServiceTag svcTag = getServiceTag(instanceURN);
-        if (svcTag == null) {
-            return null;
-        }
-
-        svcTag = ServiceTag.newInstanceWithUrnTimestamp(svcTag);
-        // update the product defined instance ID field
-        svcTag.setProductDefinedInstanceID(productDefinedInstanceID);
-        svcTagMap.put(instanceURN, svcTag);
-        return svcTag;
-    }
-
-    /**
-     * Reads the registration data from the XML document on the
-     * specified input stream.  The XML document must be
-     * in the format described by the <a href="#XMLSchema">
-     * registration data schema</a>.
-     * The specified stream is closed after this method returns.
-     *
-     * @param in the input stream from which to read the XML document.
-     * @return a {@code RegistrationData} object read from the input
-     * stream.
-     *
-     * @throws IllegalArgumentException if the input stream
-     * contains an invalid registration data.
-     *
-     * @throws IOException if an error occurred when reading from the input stream.
-     */
-    public static RegistrationData loadFromXML(InputStream in) throws IOException {
-        try {
-            return RegistrationDocument.load(in);
-        } finally {
-            in.close();
-        }
-    }
-
-    /**
-     * Writes the registration data to the specified output stream
-     * in the format described by the <a href="#XMLSchema">
-     * registration data schema</a> with "UTF-8" encoding.
-     * The specified stream remains open after this method returns.
-     *
-     * @param os the output stream on which to write the XML document.
-     *
-     * @throws IOException if an error occurred when writing to the output stream.
-     */
-    public void storeToXML(OutputStream os) throws IOException {
-        RegistrationDocument.store(os, this);
-        os.flush();
-    }
-
-    /**
-     * Returns a newly allocated byte array containing the registration
-     * data in XML format.
-     *
-     * @return a newly allocated byte array containing the registration
-     * data in XML format.
-     */
-    public byte[] toXML() {
-        try {
-            ByteArrayOutputStream out = new ByteArrayOutputStream();
-            storeToXML(out);
-            return out.toByteArray();
-        } catch (IOException e) {
-            // should not reach here
-            return new byte[0];
-        }
-    }
-
-    /**
-     * Returns a string representation of this registration data in XML
-     * format.
-     *
-     * @return a string representation of this registration data in XML
-     *         format.
-     */
-    @Override
-    public String toString() {
-        try {
-            ByteArrayOutputStream out = new ByteArrayOutputStream();
-            storeToXML(out);
-            return out.toString("UTF-8");
-        } catch (IOException e) {
-            // should not reach here
-            return "Error creating the return string.";
-        }
-    }
-}
--- a/src/share/classes/com/sun/servicetag/RegistrationDocument.java	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,368 +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.servicetag;
-
-import java.io.*;
-import java.net.URL;
-import java.util.Collection;
-import java.util.Map;
-import java.util.Set;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.SAXException;
-import org.xml.sax.InputSource;
-
-import javax.xml.XMLConstants;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.validation.Schema;
-import javax.xml.validation.SchemaFactory;
-import javax.xml.validation.Validator;
-
-// For write operation
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-/**
- * XML Support Class for Product Registration.
- */
-class RegistrationDocument {
-
-    private static final String REGISTRATION_DATA_SCHEMA =
-            "/com/sun/servicetag/resources/product_registration.xsd";
-    private static final String REGISTRATION_DATA_VERSION = "1.0";
-    private static final String SERVICE_TAG_VERSION = "1.0";
-    final static String ST_NODE_REGISTRATION_DATA = "registration_data";
-    final static String ST_ATTR_REGISTRATION_VERSION = "version";
-    final static String ST_NODE_ENVIRONMENT = "environment";
-    final static String ST_NODE_HOSTNAME = "hostname";
-    final static String ST_NODE_HOST_ID = "hostId";
-    final static String ST_NODE_OS_NAME = "osName";
-    final static String ST_NODE_OS_VERSION = "osVersion";
-    final static String ST_NODE_OS_ARCH = "osArchitecture";
-    final static String ST_NODE_SYSTEM_MODEL = "systemModel";
-    final static String ST_NODE_SYSTEM_MANUFACTURER = "systemManufacturer";
-    final static String ST_NODE_CPU_MANUFACTURER = "cpuManufacturer";
-    final static String ST_NODE_SERIAL_NUMBER = "serialNumber";
-    final static String ST_NODE_REGISTRY = "registry";
-    final static String ST_ATTR_REGISTRY_URN = "urn";
-    final static String ST_ATTR_REGISTRY_VERSION = "version";
-    final static String ST_NODE_SERVICE_TAG = "service_tag";
-    final static String ST_NODE_INSTANCE_URN = "instance_urn";
-    final static String ST_NODE_PRODUCT_NAME = "product_name";
-    final static String ST_NODE_PRODUCT_VERSION = "product_version";
-    final static String ST_NODE_PRODUCT_URN = "product_urn";
-    final static String ST_NODE_PRODUCT_PARENT_URN = "product_parent_urn";
-    final static String ST_NODE_PRODUCT_PARENT = "product_parent";
-    final static String ST_NODE_PRODUCT_DEFINED_INST_ID = "product_defined_inst_id";
-    final static String ST_NODE_PRODUCT_VENDOR = "product_vendor";
-    final static String ST_NODE_PLATFORM_ARCH = "platform_arch";
-    final static String ST_NODE_TIMESTAMP = "timestamp";
-    final static String ST_NODE_CONTAINER = "container";
-    final static String ST_NODE_SOURCE = "source";
-    final static String ST_NODE_INSTALLER_UID = "installer_uid";
-
-    static RegistrationData load(InputStream in) throws IOException {
-        Document document = initializeDocument(in);
-
-        // Gets the registration URN
-        Element root = getRegistrationDataRoot(document);
-        Element registryRoot =
-                getSingletonElementFromRoot(root, ST_NODE_REGISTRY);
-        String urn = registryRoot.getAttribute(ST_ATTR_REGISTRY_URN);
-
-        // Construct a new RegistrationData object from the DOM tree
-        // Initialize the environment map and service tags
-        RegistrationData regData = new RegistrationData(urn);
-        addServiceTags(registryRoot, regData);
-
-        Element envRoot = getSingletonElementFromRoot(root, ST_NODE_ENVIRONMENT);
-        buildEnvironmentMap(envRoot, regData);
-        return regData;
-    }
-
-    static void store(OutputStream os, RegistrationData registration)
-            throws IOException {
-        // create a new document with the root node
-        Document document = initializeDocument();
-
-        // create the nodes for the environment map and the service tags
-        // in the registration data
-        addEnvironmentNodes(document,
-                            registration.getEnvironmentMap());
-        addServiceTagRegistry(document,
-                              registration.getRegistrationURN(),
-                              registration.getServiceTags());
-        transform(document, os);
-    }
-
-    // initialize a document from an input stream
-    private static Document initializeDocument(InputStream in) throws IOException {
-        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-        try {
-            // XML schema for validation
-            SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
-            URL xsdUrl = RegistrationDocument.class.getResource(REGISTRATION_DATA_SCHEMA);
-            Schema schema = sf.newSchema(xsdUrl);
-            Validator validator = schema.newValidator();
-
-            DocumentBuilder builder = factory.newDocumentBuilder();
-            Document doc = builder.parse(new InputSource(in));
-            validator.validate(new DOMSource(doc));
-            return doc;
-        } catch (SAXException sxe) {
-            IllegalArgumentException e = new IllegalArgumentException("Error generated in parsing");
-            e.initCause(sxe);
-            throw e;
-        } catch (ParserConfigurationException pce) {
-            // Parser with specific options can't be built
-            // should not reach here
-            InternalError x = new InternalError("Error in creating the new document");
-            x.initCause(pce);
-            throw x;
-        }
-    }
-
-    // initialize a new document for the registration data
-    private static Document initializeDocument() throws IOException {
-        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-        try {
-            DocumentBuilder builder = factory.newDocumentBuilder();
-            Document doc = builder.newDocument();
-
-            // initialize the document with the registration_data root
-            Element root = doc.createElement(ST_NODE_REGISTRATION_DATA);
-            doc.appendChild(root);
-            root.setAttribute(ST_ATTR_REGISTRATION_VERSION, REGISTRATION_DATA_VERSION);
-
-            return doc;
-        } catch (ParserConfigurationException pce) {
-            // Parser with specified options can't be built
-            // should not reach here
-            InternalError x = new InternalError("Error in creating the new document");
-            x.initCause(pce);
-            throw x;
-        }
-    }
-
-    // Transform the current DOM tree with the given output stream.
-    private static void transform(Document document, OutputStream os) {
-        try {
-            // Use a Transformer for output
-            TransformerFactory tFactory = TransformerFactory.newInstance();
-            tFactory.setAttribute("indent-number", new Integer(3));
-
-            Transformer transformer = tFactory.newTransformer();
-
-            transformer.setOutputProperty(OutputKeys.INDENT, "yes");
-            transformer.setOutputProperty(OutputKeys.METHOD, "xml");
-            transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
-            transformer.setOutputProperty(OutputKeys.STANDALONE, "yes");
-            transformer.transform(new DOMSource(document),
-                new StreamResult(new BufferedWriter(new OutputStreamWriter(os, "UTF-8"))));
-        } catch (UnsupportedEncodingException ue) {
-            // Should not reach here
-            InternalError x = new InternalError("Error generated during transformation");
-            x.initCause(ue);
-            throw x;
-        } catch (TransformerConfigurationException tce) {
-            // Error generated by the parser
-            // Should not reach here
-            InternalError x = new InternalError("Error in creating the new document");
-            x.initCause(tce);
-            throw x;
-        } catch (TransformerException te) {
-            // Error generated by the transformer
-            InternalError x = new InternalError("Error generated during transformation");
-            x.initCause(te);
-            throw x;
-        }
-    }
-
-    private static void addServiceTagRegistry(Document document,
-                                              String registryURN,
-                                              Set<ServiceTag> svcTags) {
-        // add service tag registry node and its attributes
-        Element reg = document.createElement(ST_NODE_REGISTRY);
-        reg.setAttribute(ST_ATTR_REGISTRY_URN, registryURN);
-        reg.setAttribute(ST_ATTR_REGISTRY_VERSION, SERVICE_TAG_VERSION);
-
-        Element root = getRegistrationDataRoot(document);
-        root.appendChild(reg);
-
-        // adds the elements for the service tags
-        for (ServiceTag st : svcTags) {
-            addServiceTagElement(document, reg, st);
-        }
-    }
-
-    private static void addServiceTagElement(Document document,
-                                             Element registryRoot,
-                                             ServiceTag st) {
-        Element svcTag = document.createElement(ST_NODE_SERVICE_TAG);
-        registryRoot.appendChild(svcTag);
-        addChildElement(document, svcTag,
-                        ST_NODE_INSTANCE_URN, st.getInstanceURN());
-        addChildElement(document, svcTag,
-                        ST_NODE_PRODUCT_NAME, st.getProductName());
-        addChildElement(document, svcTag,
-                        ST_NODE_PRODUCT_VERSION, st.getProductVersion());
-        addChildElement(document, svcTag,
-                        ST_NODE_PRODUCT_URN, st.getProductURN());
-        addChildElement(document, svcTag,
-                        ST_NODE_PRODUCT_PARENT_URN, st.getProductParentURN());
-        addChildElement(document, svcTag,
-                        ST_NODE_PRODUCT_PARENT, st.getProductParent());
-        addChildElement(document, svcTag,
-                        ST_NODE_PRODUCT_DEFINED_INST_ID,
-                        st.getProductDefinedInstanceID());
-        addChildElement(document, svcTag,
-                        ST_NODE_PRODUCT_VENDOR, st.getProductVendor());
-        addChildElement(document, svcTag,
-                        ST_NODE_PLATFORM_ARCH, st.getPlatformArch());
-        addChildElement(document, svcTag,
-                        ST_NODE_TIMESTAMP, Util.formatTimestamp(st.getTimestamp()));
-        addChildElement(document, svcTag,
-                        ST_NODE_CONTAINER, st.getContainer());
-        addChildElement(document, svcTag,
-                        ST_NODE_SOURCE, st.getSource());
-        addChildElement(document, svcTag,
-                        ST_NODE_INSTALLER_UID,
-                        String.valueOf(st.getInstallerUID()));
-    }
-
-    private static void addChildElement(Document document, Element root,
-                                        String element, String text) {
-        Element node = document.createElement(element);
-        node.appendChild(document.createTextNode(text));
-        root.appendChild(node);
-    }
-
-    // Constructs service tags from the document
-    private static void addServiceTags(Element registryRoot,
-                                       RegistrationData registration) {
-        NodeList children = registryRoot.getElementsByTagName(ST_NODE_SERVICE_TAG);
-        int length = (children == null ? 0 : children.getLength());
-        for (int i = 0; i < length; i++) {
-            Element svcTagElement = (Element) children.item(i);
-            ServiceTag st = getServiceTag(svcTagElement);
-            registration.addServiceTag(st);
-        }
-    }
-
-    // build environment map from the document
-    private static void buildEnvironmentMap(Element envRoot,
-                                         RegistrationData registration) {
-        registration.setEnvironment(ST_NODE_HOSTNAME, getTextValue(envRoot, ST_NODE_HOSTNAME));
-        registration.setEnvironment(ST_NODE_HOST_ID, getTextValue(envRoot, ST_NODE_HOST_ID));
-        registration.setEnvironment(ST_NODE_OS_NAME, getTextValue(envRoot, ST_NODE_OS_NAME));
-        registration.setEnvironment(ST_NODE_OS_VERSION, getTextValue(envRoot, ST_NODE_OS_VERSION));
-        registration.setEnvironment(ST_NODE_OS_ARCH, getTextValue(envRoot, ST_NODE_OS_ARCH));
-        registration.setEnvironment(ST_NODE_SYSTEM_MODEL, getTextValue(envRoot, ST_NODE_SYSTEM_MODEL));
-        registration.setEnvironment(ST_NODE_SYSTEM_MANUFACTURER, getTextValue(envRoot, ST_NODE_SYSTEM_MANUFACTURER));
-        registration.setEnvironment(ST_NODE_CPU_MANUFACTURER, getTextValue(envRoot, ST_NODE_CPU_MANUFACTURER));
-        registration.setEnvironment(ST_NODE_SERIAL_NUMBER, getTextValue(envRoot, ST_NODE_SERIAL_NUMBER));
-    }
-
-    // add the nodes representing the environment map in the document
-    private static void addEnvironmentNodes(Document document,
-                                            Map<String, String> envMap) {
-        Element root = getRegistrationDataRoot(document);
-        Element env = document.createElement(ST_NODE_ENVIRONMENT);
-        root.appendChild(env);
-        Set<Map.Entry<String, String>> keys = envMap.entrySet();
-        for (Map.Entry<String, String> entry : keys) {
-            addChildElement(document, env, entry.getKey(), entry.getValue());
-        }
-    }
-
-    private static Element getRegistrationDataRoot(Document doc) {
-        Element root = doc.getDocumentElement();
-        if (!root.getNodeName().equals(ST_NODE_REGISTRATION_DATA)) {
-            throw new IllegalArgumentException("Not a " +
-                    ST_NODE_REGISTRATION_DATA +
-                    " node \"" + root.getNodeName() + "\"");
-        }
-        return root;
-    }
-
-    private static Element getSingletonElementFromRoot(Element root, String name) {
-        NodeList children = root.getElementsByTagName(name);
-        int length = (children == null ? 0 : children.getLength());
-        if (length != 1) {
-            throw new IllegalArgumentException("Invalid number of " + name +
-                    " nodes = " + length);
-        }
-        Element e = (Element) children.item(0);
-        if (!e.getNodeName().equals(name)) {
-            throw new IllegalArgumentException("Not a  " + name +
-                    " node \"" + e.getNodeName() + "\"");
-        }
-        return e;
-    }
-
-    // Constructs one ServiceTag instance from a service tag element root
-    private static ServiceTag getServiceTag(Element svcTagElement) {
-        return new ServiceTag(
-            getTextValue(svcTagElement, ST_NODE_INSTANCE_URN),
-            getTextValue(svcTagElement, ST_NODE_PRODUCT_NAME),
-            getTextValue(svcTagElement, ST_NODE_PRODUCT_VERSION),
-            getTextValue(svcTagElement, ST_NODE_PRODUCT_URN),
-            getTextValue(svcTagElement, ST_NODE_PRODUCT_PARENT),
-            getTextValue(svcTagElement, ST_NODE_PRODUCT_PARENT_URN),
-            getTextValue(svcTagElement, ST_NODE_PRODUCT_DEFINED_INST_ID),
-            getTextValue(svcTagElement, ST_NODE_PRODUCT_VENDOR),
-            getTextValue(svcTagElement, ST_NODE_PLATFORM_ARCH),
-            getTextValue(svcTagElement, ST_NODE_CONTAINER),
-            getTextValue(svcTagElement, ST_NODE_SOURCE),
-            Util.getIntValue(getTextValue(svcTagElement, ST_NODE_INSTALLER_UID)),
-            Util.parseTimestamp(getTextValue(svcTagElement, ST_NODE_TIMESTAMP))
-        );
-    }
-
-    private static String getTextValue(Element e, String tagName) {
-        String value = "";
-        NodeList nl = e.getElementsByTagName(tagName);
-        if (nl != null && nl.getLength() > 0) {
-            Element el = (Element) nl.item(0);
-            Node node = el.getFirstChild();
-            if (node != null) {
-                value = node.getNodeValue();
-            }
-        }
-        return value;
-    }
-}
--- a/src/share/classes/com/sun/servicetag/Registry.java	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,556 +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.  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.servicetag;
-
-import java.io.*;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Properties;
-import java.util.Set;
-
-import static com.sun.servicetag.Util.*;
-import static com.sun.servicetag.RegistrationDocument.*;
-
-/**
- * A service tag registry is a XML-based registry containing
- * the list of {@link ServiceTag service tags} installed in the system.
- * The {@code Registry} class provides interfaces
- * to add, remove, update, and get a service tag from a service tag
- * registry.
- * This {@code Registry} class may not be supported
- * on all systems. The {@link #isSupported} method
- * can be called to determine if it is supported.
- * <p>
- * A registry may implement restrictions to only allow certain users
- * to {@link #updateServiceTag update} and
- * to {@link #removeServiceTag remove} a service tag record. Typically,
- * only the owner of the service tag, the owner of the registry
- * and superuser are authorized to update or remove a service tag in
- * the registry.
- *
- * @see <a href="https://sn-tools.central.sun.com/twiki/bin/view/ServiceTags/ServiceTagDevGuideHelper">
- * Service Tag User Guide</a>
- */
-public class Registry {
-
-    private static final String STCLIENT_SOLARIS = "/usr/bin/stclient";
-    private static final String STCLIENT_LINUX = "/opt/sun/servicetag/bin/stclient";
-    // stclient exit value (see sthelper.h)
-    private static final int ST_ERR_NOT_AUTH = 245;
-    private static final int ST_ERR_REC_NOT_FOUND = 225;
-
-    // The stclient output has to be an exported interface
-    private static final String INSTANCE_URN_DESC = "Product instance URN=";
-    private static boolean initialized = false;
-    private static File stclient = null;
-    private static String stclientPath = null;
-    private static Registry registry = new Registry();
-
-    // System properties for testing
-    private static String SVCTAG_STCLIENT_CMD = "servicetag.stclient.cmd";
-    private static String SVCTAG_STHELPER_SUPPORTED = "servicetag.sthelper.supported";
-
-    private Registry() {
-    }
-
-    private synchronized static String getSTclient() {
-        if (!initialized) {
-            // Initialization to determine the platform's stclient pathname
-            String os = System.getProperty("os.name");
-            if (os.equals("SunOS")) {
-                stclient = new File(STCLIENT_SOLARIS);
-            } else if (os.equals("Linux")) {
-                stclient = new File(STCLIENT_LINUX);
-            } else if (os.startsWith("Windows")) {
-                stclient = getWindowsStClientFile();
-            } else {
-                if (isVerbose()) {
-                    System.out.println("Running on unsupported platform");
-                }
-            }
-            initialized = true;
-        }
-
-        boolean supportsHelperClass = true; // default
-        if (System.getProperty(SVCTAG_STHELPER_SUPPORTED) != null) {
-            // the system property always overrides the default setting
-            supportsHelperClass = Boolean.getBoolean(SVCTAG_STHELPER_SUPPORTED);
-        }
-
-        if (!supportsHelperClass) {
-            // disable system registry
-            return null;
-        }
-
-        // This is only used for testing
-        String path = System.getProperty(SVCTAG_STCLIENT_CMD);
-        if (path != null) {
-            return path;
-        }
-
-        // com.sun.servicetag package has to be compiled with JDK 5 as well
-        // JDK 5 doesn't support the File.canExecute() method.
-        // Risk not checking isExecute() for the stclient command is very low.
-        if (stclientPath == null && stclient != null && stclient.exists()) {
-            stclientPath = stclient.getAbsolutePath();
-        }
-        return stclientPath;
-    }
-
-    /**
-     * Returns the system service tag registry. The {@code Registry} class
-     * may not be supported on some platforms; use the {@link #isSupported}
-     * method to determine if it is supported.
-     *
-     * @return the {@code Registry} object for the system service tag registry.
-     *
-     * @throws UnsupportedOperationException if the {@code Registry} class is
-     * not supported.
-     */
-    public static Registry getSystemRegistry() {
-        if (isSupported()) {
-            return registry;
-        } else {
-            throw new UnsupportedOperationException("Registry class is not supported");
-        }
-    }
-
-    /**
-     * Returns {@code true} if the {@code Registry} class is supported on this system.
-     *
-     * @return {@code true} if the {@code Registry} class is supported;
-     * otherwise, return {@code false}.
-     */
-    public static synchronized boolean isSupported() {
-        return getSTclient() != null;
-    }
-
-    private static List<String> getCommandList() {
-        // Set up the arguments to call stclient
-        List<String> command = new ArrayList<String>();
-        if (System.getProperty(SVCTAG_STCLIENT_CMD) != null) {
-            // This is for jtreg testing use. This will be set to something
-            // like:
-            // $JAVA_HOME/bin/java -cp $TEST_DIR \
-            //    -Dstclient.registry.path=$TEST_DIR/registry.xml \
-            //    SvcTagClient
-            //
-            // On Windows, the JAVA_HOME and TEST_DIR path could contain
-            // space e.g. c:\Program Files\Java\jdk1.6.0_05\bin\java.
-            // The SVCTAG_STCLIENT_CMD must be set with a list of
-            // space-separated parameters.  If a parameter contains spaces,
-            // it must be quoted with '"'.
-
-            String cmd = getSTclient();
-            int len = cmd.length();
-            int i = 0;
-            while (i < len) {
-                char separator = ' ';
-                if (cmd.charAt(i) == '"') {
-                    separator = '"';
-                    i++;
-                }
-                // look for the separator or matched the closing '"'
-                int j;
-                for (j = i+1; j < len; j++) {
-                    if (cmd.charAt(j) == separator) {
-                        break;
-                    }
-                }
-
-                if (i == j-1) {
-                    // add an empty parameter
-                    command.add("\"\"");
-                } else {
-                    // double quotes and space are not included
-                    command.add(cmd.substring(i,j));
-                }
-
-                // skip spaces
-                for (i = j+1; i < len; i++) {
-                    if (!Character.isSpaceChar(cmd.charAt(i))) {
-                        break;
-                    }
-                }
-            }
-            if (isVerbose()) {
-                System.out.println("Command list:");
-                for (String s : command) {
-                    System.out.println(s);
-                }
-            }
-        } else {
-            command.add(getSTclient());
-        }
-        return command;
-    }
-
-    // Returns null if the service tag record not found;
-    // or throw UnauthorizedAccessException or IOException
-    // based on the exitValue.
-    private static ServiceTag checkReturnError(int exitValue,
-                                               String output,
-                                               ServiceTag st) throws IOException {
-        switch (exitValue) {
-            case ST_ERR_REC_NOT_FOUND:
-                return null;
-            case ST_ERR_NOT_AUTH:
-                if (st != null) {
-                    throw new UnauthorizedAccessException(
-                        "Not authorized to access " + st.getInstanceURN() +
-                        " installer_uid=" + st.getInstallerUID());
-                } else  {
-                    throw new UnauthorizedAccessException(
-                        "Not authorized:" + output);
-                }
-            default:
-                throw new IOException("stclient exits with error" +
-                     " (" + exitValue + ")\n" + output);
-        }
-    }
-
-    /**
-     * Adds a service tag to this registry.
-     * If the given service tag has an empty <tt>instance_urn</tt>,
-     * this helper class will generate a URN and place it in the
-     * copy of the service tag in this registry.
-     * This method will return the {@code ServiceTag} representing
-     * the service tag entry to this registry.
-     *
-     * @param st {@code ServiceTag} object
-     * @return a {@code ServiceTag} object representing the service tag
-     *         entry to this registry.
-     *
-     * @throws IllegalArgumentException if a service tag of the same
-     * <tt>instance_urn</tt> already exists in this registry.
-     *
-     * @throws java.io.IOException if an I/O error occurs in this operation.
-     */
-    public ServiceTag addServiceTag(ServiceTag st) throws IOException {
-        List<String> command = getCommandList();
-        command.add("-a");
-        if (st.getInstanceURN().length() > 0) {
-            ServiceTag sysSvcTag = getServiceTag(st.getInstanceURN());
-            if (sysSvcTag != null) {
-                throw new IllegalArgumentException("Instance_urn = " +
-                    st.getInstanceURN() + " already exists");
-            }
-            command.add("-i");
-            command.add(st.getInstanceURN());
-        }
-        command.add("-p");
-        command.add(st.getProductName());
-        command.add("-e");
-        command.add(st.getProductVersion());
-        command.add("-t");
-        command.add(st.getProductURN());
-        if (st.getProductParentURN().length() > 0) {
-            command.add("-F");
-            command.add(st.getProductParentURN());
-        }
-        command.add("-P");
-        command.add(st.getProductParent());
-        if (st.getProductDefinedInstanceID().length() > 0) {
-            command.add("-I");
-            command.add(st.getProductDefinedInstanceID());
-        }
-        command.add("-m");
-        command.add(st.getProductVendor());
-        command.add("-A");
-        command.add(st.getPlatformArch());
-        command.add("-z");
-        command.add(st.getContainer());
-        command.add("-S");
-        command.add(st.getSource());
-
-        BufferedReader in = null;
-        try {
-            ProcessBuilder pb = new ProcessBuilder(command);
-            Process p = pb.start();
-            String output = commandOutput(p);
-            if (isVerbose()) {
-                System.out.println("Output from stclient -a command:");
-                System.out.println(output);
-            }
-            String urn = "";
-            if (p.exitValue() == 0) {
-                // Obtain the instance urn from the stclient output
-                in = new BufferedReader(new StringReader(output));
-                String line = null;
-                while ((line = in.readLine()) != null) {
-                    line = line.trim();
-                    if (line.startsWith(INSTANCE_URN_DESC)) {
-                        urn = line.substring(INSTANCE_URN_DESC.length());
-                        break;
-                    }
-                }
-                if (urn.length() == 0) {
-                    throw new IOException("Error in creating service tag:\n" +
-                        output);
-                }
-                return getServiceTag(urn);
-            } else {
-                return checkReturnError(p.exitValue(), output, st);
-            }
-        } finally {
-            if (in != null) {
-                in.close();
-            }
-        }
-    }
-
-    /**
-     * Removes a service tag of the given <tt>instance_urn</tt> from this
-     * registry.
-     *
-     * @param instanceURN the <tt>instance_urn</tt> of the service tag
-     *        to be removed.
-     *
-     * @return the {@code ServiceTag} object removed from this registry;
-     * or {@code null} if the service tag does not exist in this registry.
-     *
-     * @throws UnauthorizedAccessException if the user is not authorized to
-     * remove the service tag of the given <tt>instance_urn</tt>
-     * from this registry.
-     *
-     * @throws java.io.IOException if an I/O error occurs in this operation.
-     */
-    public ServiceTag removeServiceTag(String instanceURN) throws IOException {
-        ServiceTag st = getServiceTag(instanceURN);
-        if (st == null) {
-            return null;
-        }
-
-        List<String> command = getCommandList();
-        command.add("-d");
-        command.add("-i");
-        command.add(instanceURN);
-
-        ProcessBuilder pb = new ProcessBuilder(command);
-        Process p = pb.start();
-        String output = commandOutput(p);
-        if (isVerbose()) {
-            System.out.println("Output from stclient -d command:");
-            System.out.println(output);
-        }
-        if (p.exitValue() == 0) {
-            return st;
-        } else {
-            return checkReturnError(p.exitValue(), output, st);
-        }
-    }
-
-    /**
-     * Updates the <tt>product_defined_instance_id</tt> in the service tag
-     * of the specified <tt>instance_urn</tt> in this registry.
-     *
-     * @param instanceURN the <tt>instance_urn</tt> of the service tag to be updated.
-     * @param productDefinedInstanceID the value of the
-     * <tt>product_defined_instance_id</tt> to be set.
-     *
-     * @return the updated {@code ServiceTag} object;
-     * or {@code null} if the service tag does not exist in this
-     * registry.
-     *
-     * @throws UnauthorizedAccessException if the user is not authorized to
-     * update the service tag from this registry.
-     *
-     * @throws IOException if an I/O error occurs in this operation.
-     */
-    public ServiceTag updateServiceTag(String instanceURN,
-                                       String productDefinedInstanceID)
-            throws IOException {
-        ServiceTag svcTag = getServiceTag(instanceURN);
-        if (svcTag == null) {
-            return null;
-        }
-
-        List<String> command = getCommandList();
-        command.add("-u");
-        command.add("-i");
-        command.add(instanceURN);
-        command.add("-I");
-        if (productDefinedInstanceID.length() > 0) {
-            command.add(productDefinedInstanceID);
-        } else {
-            command.add("\"\"");
-        }
-
-        ProcessBuilder pb = new ProcessBuilder(command);
-        Process p = pb.start();
-        String output = commandOutput(p);
-        if (isVerbose()) {
-            System.out.println("Output from stclient -u command:");
-            System.out.println(output);
-        }
-
-        if (p.exitValue() == 0) {
-            return getServiceTag(instanceURN);
-        } else {
-            return checkReturnError(p.exitValue(), output, svcTag);
-        }
-    }
-
-    /**
-     * Returns a {@code ServiceTag} object of the given  <tt>instance_urn</tt>
-     * in this registry.
-     *
-     * @param instanceURN the  <tt>instance_urn</tt> of the service tag
-     * @return a {@code ServiceTag} object of the given <tt>instance_urn</tt>
-     * in this registry; or {@code null} if not found.
-     *
-     * @throws java.io.IOException if an I/O error occurs in this operation.
-     */
-    public ServiceTag getServiceTag(String instanceURN) throws IOException {
-        if (instanceURN == null) {
-            throw new NullPointerException("instanceURN is null");
-        }
-
-        List<String> command = getCommandList();
-        command.add("-g");
-        command.add("-i");
-        command.add(instanceURN);
-
-        ProcessBuilder pb = new ProcessBuilder(command);
-        Process p = pb.start();
-        String output = commandOutput(p);
-        if (isVerbose()) {
-            System.out.println("Output from stclient -g command:");
-            System.out.println(output);
-        }
-        if (p.exitValue() == 0) {
-            return parseServiceTag(output);
-        } else {
-            return checkReturnError(p.exitValue(), output, null);
-        }
-    }
-
-    private ServiceTag parseServiceTag(String output) throws IOException {
-        BufferedReader in = null;
-        try {
-            Properties props = new Properties();
-            // parse the service tag output from stclient
-            in = new BufferedReader(new StringReader(output));
-            String line = null;
-            while ((line = in.readLine()) != null) {
-                if ((line = line.trim()).length() > 0) {
-                    String[] ss = line.trim().split("=", 2);
-                    if (ss.length == 2) {
-                        props.setProperty(ss[0].trim(), ss[1].trim());
-                    } else {
-                        props.setProperty(ss[0].trim(), "");
-                    }
-                }
-            }
-
-            String urn = props.getProperty(ST_NODE_INSTANCE_URN);
-            String productName = props.getProperty(ST_NODE_PRODUCT_NAME);
-            String productVersion = props.getProperty(ST_NODE_PRODUCT_VERSION);
-            String productURN = props.getProperty(ST_NODE_PRODUCT_URN);
-            String productParent = props.getProperty(ST_NODE_PRODUCT_PARENT);
-            String productParentURN = props.getProperty(ST_NODE_PRODUCT_PARENT_URN);
-            String productDefinedInstanceID =
-                props.getProperty(ST_NODE_PRODUCT_DEFINED_INST_ID);
-            String productVendor = props.getProperty(ST_NODE_PRODUCT_VENDOR);
-            String platformArch = props.getProperty(ST_NODE_PLATFORM_ARCH);
-            String container = props.getProperty(ST_NODE_CONTAINER);
-            String source = props.getProperty(ST_NODE_SOURCE);
-            int installerUID =
-                Util.getIntValue(props.getProperty(ST_NODE_INSTALLER_UID));
-            Date timestamp =
-                Util.parseTimestamp(props.getProperty(ST_NODE_TIMESTAMP));
-
-            return new ServiceTag(urn,
-                                  productName,
-                                  productVersion,
-                                  productURN,
-                                  productParent,
-                                  productParentURN,
-                                  productDefinedInstanceID,
-                                  productVendor,
-                                  platformArch,
-                                  container,
-                                  source,
-                                  installerUID,
-                                  timestamp);
-        } finally {
-            if (in != null) {
-                in.close();
-            }
-        }
-
-    }
-
-    /**
-     * Returns the service tags of the specified
-     * <tt>product_urn</tt> in this registry.
-     *
-     * @param productURN the  <tt>product_urn</tt> to look up
-     * @return a {@code Set} of {@code ServiceTag} objects
-     * of the specified <tt>product_urn</tt> in this registry.
-     *
-     * @throws java.io.IOException if an I/O error occurs in this operation.
-     */
-    public Set<ServiceTag> findServiceTags(String productURN) throws IOException {
-        if (productURN == null) {
-            throw new NullPointerException("productURN is null");
-        }
-
-        List<String> command = getCommandList();
-        command.add("-f");
-        command.add("-t");
-        command.add(productURN);
-
-        BufferedReader in = null;
-        try {
-            ProcessBuilder pb = new ProcessBuilder(command);
-            Process p = pb.start();
-            String output = commandOutput(p);
-
-            Set<ServiceTag> instances = new HashSet<ServiceTag>();
-            if (p.exitValue() == 0) {
-                // parse the service tag output from stclient
-                in = new BufferedReader(new StringReader(output));
-                String line = null;
-                while ((line = in.readLine()) != null) {
-                    String s = line.trim();
-                    if (s.startsWith("urn:st:")) {
-                        instances.add(getServiceTag(s));
-                    }
-                }
-            } else {
-                checkReturnError(p.exitValue(), output, null);
-            }
-            return instances;
-        } finally {
-            if (in != null) {
-                in.close();
-            }
-        }
-    }
-}
--- a/src/share/classes/com/sun/servicetag/ServiceTag.java	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,634 +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.servicetag;
-
-import java.util.Date;
-import java.io.IOException;
-import static com.sun.servicetag.RegistrationDocument.*;
-
-/**
- * A service tag is an XML-based data structure that identifies a product or
- * a component on a system. The service tag schema is defined by the
- * Service Tags Technology. The location of the DTD file is platform dependent.
- * On Solaris, see <tt>/usr/share/lib/xml/dtd/servicetag.dtd</tt>.
- * <p>
- * A valid {@code ServiceTag} instance must comply to the service tag schema
- * and contain the following fields:
- * <ul>
- *   <li>{@link #getInstanceURN <tt>instance_urn</tt>}</li>
- *   <li>{@link #getProductName <tt>product_name</tt>}</li>
- *   <li>{@link #getProductVersion <tt>product_version</tt>}</li>
- *   <li>{@link #getProductURN <tt>product_urn</tt>}</li>
- *   <li>{@link #getProductParent <tt>product_parent</tt>}</li>
- *   <li>{@link #getProductParentURN <tt>product_parent_urn</tt>}</li>
- *   <li>{@link #getProductDefinedInstanceID <tt>product_defined_inst_id</tt>}</li>
- *   <li>{@link #getProductVendor <tt>product_vendor</tt>}</li>
- *   <li>{@link #getPlatformArch <tt>platform_arch</tt>}</li>
- *   <li>{@link #getContainer <tt>container</tt>}</li>
- *   <li>{@link #getSource <tt>source</tt>}</li>
- *   <li>{@link #getInstallerUID <tt>installer_uid</tt>}</li>
- *   <li>{@link #getTimestamp <tt>timestamp</tt>}</li>
- * </ul>
- *
- * The <tt>instance_urn</tt> can be specified when a {@code ServiceTag}
- * object is created, or it can be generated when it is added to
- * a {@link RegistrationData} object, or {@link Registry
- * system service tag registry}. The <tt>installer_uid</tt> and
- * <tt>timestamp</tt> are set when a {@code ServiceTag} object
- * is added to a {@link RegistrationData} object, or {@link Registry
- * system service tag registry}.
- *
- * @see <a href="https://sunconnection.sun.com/FAQ/sc_faq.html">Service Tags FAQ</a>
- */
-public class ServiceTag {
-
-    private String instanceURN;
-    private String productName;
-    private String productVersion;
-    private String productURN;
-    private String productParent;
-    private String productParentURN;
-    private String productDefinedInstanceID;
-    private String productVendor;
-    private String platformArch;
-    private String container;
-    private String source;
-    private int installerUID;
-    private Date timestamp;
-
-    // Service Tag Field Lengths (defined in sthelper.h)
-    // Since the constants defined in sthelper.h includes the null-terminated
-    // character, so minus 1 from the sthelper.h defined values.
-    private final int MAX_URN_LEN             = 256 - 1;
-    private final int MAX_PRODUCT_NAME_LEN    = 256 - 1;
-    private final int MAX_PRODUCT_VERSION_LEN = 64 - 1;
-    private final int MAX_PRODUCT_PARENT_LEN  = 256 - 1;
-    private final int MAX_PRODUCT_VENDOR_LEN  = 64 - 1;
-    private final int MAX_PLATFORM_ARCH_LEN   = 64 - 1;
-    private final int MAX_CONTAINER_LEN       = 64 - 1;
-    private final int MAX_SOURCE_LEN          = 64 - 1;
-
-    // private constructors
-    private ServiceTag() {
-    }
-    // package private
-    ServiceTag(String instanceURN,
-               String productName,
-               String productVersion,
-               String productURN,
-               String productParent,
-               String productParentURN,
-               String productDefinedInstanceID,
-               String productVendor,
-               String platformArch,
-               String container,
-               String source,
-               int installerUID,
-               Date timestamp) {
-        setInstanceURN(instanceURN);
-        setProductName(productName);
-        setProductVersion(productVersion);
-        setProductURN(productURN);
-        setProductParentURN(productParentURN);
-        setProductParent(productParent);
-        setProductDefinedInstanceID(productDefinedInstanceID);
-        setProductVendor(productVendor);
-        setPlatformArch(platformArch);
-        setContainer(container);
-        setSource(source);
-        setInstallerUID(installerUID);
-        setTimestamp(timestamp);
-    }
-
-    /**
-     * Creates a service tag object with no <tt>instance_urn</tt>.
-     *
-     * @param productName               the name of the product.
-     * @param productVersion            the version of the product.
-     * @param productURN                the uniform resource name of the product
-     * @param productParent             the name of the product's parent.
-     * @param productParentURN          the uniform resource name of the product's parent.
-     * @param productDefinedInstanceID  the instance identifier.
-     * @param productVendor             the vendor of the product.
-     * @param platformArch              the operating system architecture.
-     * @param container                 the container of the product.
-     * @param source                    the source of the product.
-     *
-     * @throws IllegalArgumentException if any value of the input fields
-     *    does not conform to the service tag XML schema.
-     */
-    public static ServiceTag newInstance(String productName,
-                                         String productVersion,
-                                         String productURN,
-                                         String productParent,
-                                         String productParentURN,
-                                         String productDefinedInstanceID,
-                                         String productVendor,
-                                         String platformArch,
-                                         String container,
-                                         String source) {
-          return new ServiceTag("", /* empty instance_urn */
-                                productName,
-                                productVersion,
-                                productURN,
-                                productParent,
-                                productParentURN,
-                                productDefinedInstanceID,
-                                productVendor,
-                                platformArch,
-                                container,
-                                source,
-                                -1,
-                                null);
-    }
-
-    /**
-     * Creates a service tag object with a specified <tt>instance_urn</tt>.
-     *
-     * @param instanceURN               the uniform resource name of this instance.
-     * @param productName               the name of the product.
-     * @param productVersion            the version of the product.
-     * @param productURN                the uniform resource name of the product
-     * @param productParent             the name of the product's parent.
-     * @param productParentURN          the uniform resource name of the product's parent.
-     * @param productDefinedInstanceID  the instance identifier.
-     * @param productVendor             the vendor of the product.
-     * @param platformArch              the operating system architecture.
-     * @param container                 the container of the product.
-     * @param source                    the source of the product.
-     *
-     * @throws IllegalArgumentException if any value of the input fields
-     *    does not conform to the service tag XML schema.
-     */
-    public static ServiceTag newInstance(String instanceURN,
-                                         String productName,
-                                         String productVersion,
-                                         String productURN,
-                                         String productParent,
-                                         String productParentURN,
-                                         String productDefinedInstanceID,
-                                         String productVendor,
-                                         String platformArch,
-                                         String container,
-                                         String source) {
-          return new ServiceTag(instanceURN,
-                                productName,
-                                productVersion,
-                                productURN,
-                                productParent,
-                                productParentURN,
-                                productDefinedInstanceID,
-                                productVendor,
-                                platformArch,
-                                container,
-                                source,
-                                -1,
-                                null);
-    }
-
-    // Creates a copy of the ServiceTag instance
-    // with instance_urn and timestamp initialized
-    static ServiceTag newInstanceWithUrnTimestamp(ServiceTag st) {
-        String instanceURN =
-            (st.getInstanceURN().length() == 0 ? Util.generateURN() :
-                                                 st.getInstanceURN());
-        ServiceTag svcTag = new ServiceTag(instanceURN,
-                                           st.getProductName(),
-                                           st.getProductVersion(),
-                                           st.getProductURN(),
-                                           st.getProductParent(),
-                                           st.getProductParentURN(),
-                                           st.getProductDefinedInstanceID(),
-                                           st.getProductVendor(),
-                                           st.getPlatformArch(),
-                                           st.getContainer(),
-                                           st.getSource(),
-                                           st.getInstallerUID(),
-                                           new Date());
-        return svcTag;
-    }
-
-    /**
-     * Returns a uniform resource name (URN) in this format:
-     * <blockquote>
-     * "<tt>urn:st:<32-char {@link java.util.UUID uuid}></tt>"
-     * </blockquote>
-     * @return a URN.
-     */
-    public static String generateInstanceURN() {
-        return Util.generateURN();
-    }
-
-    /**
-     * Returns the uniform resource name of this service tag instance.
-     *
-     * @return  the <tt>instance_urn</tt> of this service tag.
-     */
-    public String getInstanceURN() {
-        return instanceURN;
-    }
-
-    /**
-     * Returns the name of the product.
-     *
-     * @return the product name.
-     */
-    public String getProductName() {
-        return productName;
-    }
-
-    /**
-     * Returns the version of the product.
-     *
-     * @return the product version.
-     */
-    public String getProductVersion() {
-        return productVersion;
-    }
-
-    /**
-     * Returns the uniform resource name of the product.
-     *
-     * @return the product URN.
-     */
-    public String getProductURN() {
-        return productURN;
-    }
-
-    /**
-     * Returns the uniform resource name of the product's parent.
-     *
-     * @return the product's parent URN.
-     */
-    public String getProductParentURN() {
-        return productParentURN;
-    }
-
-    /**
-     * Returns the name of the product's parent.
-     *
-     * @return the product's parent name.
-     */
-    public String getProductParent() {
-        return productParent;
-    }
-
-    /**
-     * Returns the identifier defined for this product instance.
-     *
-     * @return  the identifier defined for this product instance.
-     */
-    public String getProductDefinedInstanceID() {
-        return productDefinedInstanceID;
-    }
-
-    /**
-     * Returns the vendor of the product.
-     *
-     * @return the product vendor.
-     */
-    public String getProductVendor() {
-        return productVendor;
-    }
-
-    /**
-     * Returns the platform architecture on which the product
-     * is running on.
-     *
-     * @return the platform architecture on which the product is running on.
-     */
-    public String getPlatformArch() {
-        return platformArch;
-    }
-
-    /**
-     * Returns the timestamp.  This timestamp is set when this service tag
-     * is added to or updated in a {@code RegistrationData} object or
-     * the system service tag registry.
-     * This method may return {@code null}.
-     *
-     * @return timestamp when this service tag
-     * is added to or updated in a {@code RegistrationData} object or
-     * the system service tag registry, or {@code null}.
-     */
-    public Date getTimestamp() {
-        if (timestamp != null) {
-            return (Date) timestamp.clone();
-        } else {
-            return null;
-        }
-    }
-
-
-    /**
-     * Returns the container of the product.
-     *
-     * @return the container of the product.
-     */
-    public String getContainer() {
-        return container;
-    }
-
-    /**
-     * Returns the source of this service tag.
-     *
-     * @return  source of this service tag.
-     */
-    public String getSource() {
-        return source;
-    }
-
-    /**
-     * Returns the UID. The UID is set when this service tag
-     * is added to or updated in the system service tag registry.
-     * This is platform dependent whose default value is {@code -1}.
-     * When this service tag is added to a {@code RegistrationData},
-     * the UID is not set.
-     *
-     * @return the UID of whom this service tag
-     * is added to or updated in the system service tag registry,
-     * or {@code -1}.
-     */
-    public int getInstallerUID() {
-        return installerUID;
-    }
-
-    // The following setter methods are used to validate the
-    // input field when constructing a ServiceTag instance
-
-    private void setInstanceURN(String instanceURN) {
-        if (instanceURN == null) {
-            throw new NullPointerException("Parameter instanceURN cannot be null");
-        }
-        if (instanceURN.length() > MAX_URN_LEN) {
-            throw new IllegalArgumentException("instanceURN \"" + instanceURN +
-                "\" exceeds maximum length " + MAX_URN_LEN);
-        }
-        this.instanceURN = instanceURN;
-    }
-
-    private void setProductName(String productName) {
-        if (productName == null) {
-            throw new NullPointerException("Parameter productName cannot be null");
-        }
-        if (productName.length() == 0) {
-            throw new IllegalArgumentException("product name cannot be empty");
-        }
-        if (productName.length() > MAX_PRODUCT_NAME_LEN) {
-            throw new IllegalArgumentException("productName \"" + productName +
-                "\" exceeds maximum length " + MAX_PRODUCT_NAME_LEN);
-        }
-        this.productName = productName;
-    }
-
-    private void setProductVersion(String productVersion) {
-        if (productVersion == null) {
-            throw new NullPointerException("Parameter productVersion cannot be null");
-        }
-
-        if (productVersion.length() == 0) {
-            throw new IllegalArgumentException("product version cannot be empty");
-        }
-        if (productVersion.length() > MAX_PRODUCT_VERSION_LEN) {
-            throw new IllegalArgumentException("productVersion \"" +
-                productVersion + "\" exceeds maximum length " +
-                MAX_PRODUCT_VERSION_LEN);
-        }
-        this.productVersion = productVersion;
-    }
-
-    private void setProductURN(String productURN) {
-        if (productURN == null) {
-            throw new NullPointerException("Parameter productURN cannot be null");
-        }
-        if (productURN.length() == 0) {
-            throw new IllegalArgumentException("product URN cannot be empty");
-        }
-        if (productURN.length() > MAX_URN_LEN) {
-            throw new IllegalArgumentException("productURN \"" + productURN +
-                "\" exceeds maximum length " + MAX_URN_LEN);
-        }
-        this.productURN = productURN;
-    }
-
-    private void setProductParentURN(String productParentURN) {
-        if (productParentURN == null) {
-            throw new NullPointerException("Parameter productParentURN cannot be null");
-        }
-        // optional field - can be empty
-        if (productParentURN.length() > MAX_URN_LEN) {
-            throw new IllegalArgumentException("productParentURN \"" +
-                productParentURN + "\" exceeds maximum length " +
-                MAX_URN_LEN);
-        }
-        this.productParentURN = productParentURN;
-    }
-
-    private void setProductParent(String productParent) {
-        if (productParent == null) {
-            throw new NullPointerException("Parameter productParent cannot be null");
-        }
-        if (productParent.length() == 0) {
-            throw new IllegalArgumentException("product parent cannot be empty");
-        }
-        if (productParent.length() > MAX_PRODUCT_PARENT_LEN) {
-            throw new IllegalArgumentException("productParent \"" +
-                productParent + "\" exceeds maximum length " +
-                MAX_PRODUCT_PARENT_LEN);
-        }
-        this.productParent = productParent;
-    }
-
-    void setProductDefinedInstanceID(String productDefinedInstanceID) {
-        if (productDefinedInstanceID == null) {
-            throw new NullPointerException("Parameter productDefinedInstanceID cannot be null");
-        }
-        if (productDefinedInstanceID.length() > MAX_URN_LEN) {
-            throw new IllegalArgumentException("productDefinedInstanceID \"" +
-                productDefinedInstanceID + "\" exceeds maximum length " +
-                MAX_URN_LEN);
-        }
-        // optional field - can be empty
-        this.productDefinedInstanceID = productDefinedInstanceID;
-    }
-
-    private void setProductVendor(String productVendor) {
-        if (productVendor == null) {
-            throw new NullPointerException("Parameter productVendor cannot be null");
-        }
-        if (productVendor.length() == 0) {
-            throw new IllegalArgumentException("product vendor cannot be empty");
-        }
-        if (productVendor.length() > MAX_PRODUCT_VENDOR_LEN) {
-            throw new IllegalArgumentException("productVendor \"" +
-                productVendor + "\" exceeds maximum length " +
-                MAX_PRODUCT_VENDOR_LEN);
-        }
-        this.productVendor = productVendor;
-    }
-
-    private void setPlatformArch(String platformArch) {
-        if (platformArch == null) {
-            throw new NullPointerException("Parameter platformArch cannot be null");
-        }
-        if (platformArch.length() == 0) {
-            throw new IllegalArgumentException("platform architecture cannot be empty");
-        }
-        if (platformArch.length() > MAX_PLATFORM_ARCH_LEN) {
-            throw new IllegalArgumentException("platformArch \"" +
-                platformArch + "\" exceeds maximum length " +
-                MAX_PLATFORM_ARCH_LEN);
-        }
-        this.platformArch = platformArch;
-    }
-
-    private void setTimestamp(Date timestamp) {
-        // can be null
-        this.timestamp = timestamp;
-    }
-
-    private void setContainer(String container) {
-        if (container == null) {
-            throw new NullPointerException("Parameter container cannot be null");
-        }
-        if (container.length() == 0) {
-            throw new IllegalArgumentException("container cannot be empty");
-        }
-        if (container.length() > MAX_CONTAINER_LEN) {
-            throw new IllegalArgumentException("container \"" +
-                container + "\" exceeds maximum length " +
-                MAX_CONTAINER_LEN);
-        }
-        this.container = container;
-    }
-
-    private void setSource(String source) {
-        if (source == null) {
-            throw new NullPointerException("Parameter source cannot be null");
-        }
-        if (source.length() == 0) {
-            throw new IllegalArgumentException("source cannot be empty");
-        }
-        if (source.length() > MAX_SOURCE_LEN) {
-            throw new IllegalArgumentException("source \"" + source +
-                "\" exceeds maximum length " + MAX_SOURCE_LEN);
-        }
-        this.source = source;
-    }
-
-    private void setInstallerUID(int installerUID) {
-        this.installerUID = installerUID;
-    }
-
-    /**
-     * Compares this service tag to the specified object.
-     * The result is {@code true} if and only if the argument is
-     * not {@code null} and is a {@code ServiceTag} object whose
-     * <tt>instance_urn</tt> is the same as the
-     * <tt>instance_urn</tt> of this service tag.
-     *
-     * @return {@code true} if this service tag is the same as
-     * the specified object.
-     */
-    @Override
-    public boolean equals(Object obj) {
-        if (obj == null || !(obj instanceof ServiceTag)) {
-            return false;
-        }
-        ServiceTag st = (ServiceTag) obj;
-        if (st == this) {
-            return true;
-        }
-        return st.getInstanceURN().equals(getInstanceURN());
-    }
-
-    /**
-     * Returns the hash code value for this service tag.
-     * @return the hash code value for this service tag.
-     */
-    @Override
-    public int hashCode() {
-        int hash = 7;
-        hash = 19 * hash + (this.instanceURN != null ? this.instanceURN.hashCode() : 0);
-        return hash;
-    }
-
-    /**
-     * Returns the string representation of this service tag.
-     * The format is implementation specific.
-     *
-     * @return the string representation of this service tag.
-     */
-    public String toString() {
-        StringBuilder sb = new StringBuilder();
-        sb.append(ST_NODE_INSTANCE_URN).append("=").append(instanceURN).append("\n");
-        sb.append(ST_NODE_PRODUCT_NAME).append("=").append(productName).append("\n");
-        sb.append(ST_NODE_PRODUCT_VERSION).append("=").append(productVersion).append("\n");
-        sb.append(ST_NODE_PRODUCT_URN).append("=").append(productURN).append("\n");
-        sb.append(ST_NODE_PRODUCT_PARENT_URN).append("=").append(productParentURN).append("\n");
-        sb.append(ST_NODE_PRODUCT_PARENT).append("=").append(productParent).append("\n");
-        sb.append(ST_NODE_PRODUCT_DEFINED_INST_ID).append("=").append(productDefinedInstanceID).append("\n");
-        sb.append(ST_NODE_PRODUCT_VENDOR).append("=").append(productVendor).append("\n");
-        sb.append(ST_NODE_PLATFORM_ARCH).append("=").append(platformArch).append("\n");
-        sb.append(ST_NODE_TIMESTAMP).append("=").append(Util.formatTimestamp(timestamp)).append("\n");
-        sb.append(ST_NODE_CONTAINER).append("=").append(container).append("\n");
-        sb.append(ST_NODE_SOURCE).append("=").append(source).append("\n");
-        sb.append(ST_NODE_INSTALLER_UID).append("=").append(String.valueOf(installerUID)).append("\n");
-        return sb.toString();
-    }
-
-
-    /**
-     * Returns the {@link ServiceTag} instance for the running Java
-     * platform. The {@link ServiceTag#setSource source} field
-     * of the {@code ServiceTag} will be set to the given {@code source}.
-     * This method will return {@code null} if there is no service tag
-     * for the running Java platform.
-     * <p>
-     * This method is designed for Sun software that bundles the JDK
-     * or the JRE to use. It is recommended that the {@code source}
-     * string contains information about the bundling software
-     * such as the name and the version of the software bundle,
-     * for example,
-     * <blockquote>
-     * <tt>NetBeans IDE 6.0 with JDK 6 Update 5 Bundle</tt>
-     * </blockquote>
-     * in a NetBeans/JDK bundle.
-     * <p>
-     * At the first time to call this method the application
-     * is required to have the write permission to the installed
-     * directory of this running JDK or JRE instance.
-     *
-     * @param source the source that bundles the JDK or the JRE.
-     * @return a {@code ServiceTag} object for the Java platform,
-     *         or {@code null} if not supported.
-     * @throws IOException if an error occurs in this operation.
-     */
-    public static ServiceTag getJavaServiceTag(String source) throws IOException {
-        return Installer.getJavaServiceTag(source);
-    }
-
-}
--- a/src/share/classes/com/sun/servicetag/SolarisServiceTag.java	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +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.servicetag;
-
-import java.io.IOException;
-import java.util.Set;
-
-/**
- * Utility class to obtain the service tag for the Solaris Operating System.
- */
-class SolarisServiceTag {
-    private final static String[] SolarisProductURNs = new String[] {
-        "urn:uuid:a7a38948-2bd5-11d6-98ce-9d3ac1c0cfd7", /* Solaris 8 */
-        "urn:uuid:4f82caac-36f3-11d6-866b-85f428ef944e", /* Solaris 9 */
-        "urn:uuid:a19de03b-48bc-11d9-9607-080020a9ed93", /* Solaris 9 sparc */
-        "urn:uuid:4c35c45b-4955-11d9-9607-080020a9ed93", /* Solaris 9 x86 */
-        "urn:uuid:5005588c-36f3-11d6-9cec-fc96f718e113", /* Solaris 10 */
-        "urn:uuid:6df19e63-7ef5-11db-a4bd-080020a9ed93"  /* Solaris 11 */
-    };
-
-    /**
-     * Returns null if not found.
-     *
-     * There is only one service tag for the operating system.
-     */
-    static ServiceTag getServiceTag() throws IOException {
-        if (Registry.isSupported()) {
-            Registry streg = Registry.getSystemRegistry();
-            for (String parentURN : SolarisProductURNs) {
-                Set<ServiceTag> instances = streg.findServiceTags(parentURN);
-                for (ServiceTag st : instances) {
-                    // there should have only one service tag for the OS
-                    return st;
-                }
-            }
-        }
-        return null;
-    }
-}
--- a/src/share/classes/com/sun/servicetag/SolarisSystemEnvironment.java	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,159 +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.servicetag;
-
-// This class is a copy of the com.sun.scn.servicetags.SolarisSystemEnvironment
-// class from the Sun Connection source.
-//
-// The Service Tags team maintains the latest version of the implementation
-// for system environment data collection.  JDK will include a copy of
-// the most recent released version for a JDK release. We rename
-// the package to com.sun.servicetag so that the Sun Connection
-// product always uses the latest version from the com.sun.scn.servicetags
-// package. JDK and users of the com.sun.servicetag API
-// (e.g. NetBeans and SunStudio) will use the version in JDK.
-//
-// So we keep this class in src/share/classes instead of src/<os>/classes.
-
-import java.io.*;
-
-/**
- * Solaris implementation of the SystemEnvironment class.
- */
-class SolarisSystemEnvironment extends SystemEnvironment {
-    private static final String ORACLE = "Oracle Corporation";
-    SolarisSystemEnvironment() {
-        setHostId(getCommandOutput("/usr/bin/hostid"));
-        setSystemModel(getCommandOutput("/usr/bin/uname", "-i"));
-        setSystemManufacturer(getSolarisSystemManufacturer());
-        setCpuManufacturer(getSolarisCpuManufacturer());
-        setSerialNumber(getSolarisSN());
-    }
-
-    /**
-     * Tries to obtain the cpu manufacturer.
-     * @return The cpu manufacturer (an empty string if not found or an error occurred)
-     */
-    private String getSolarisCpuManufacturer() {
-        // not fully accurate, this could be another manufacturer (fujitsu for example)
-        if ("sparc".equalsIgnoreCase(System.getProperty("os.arch"))) {
-            return ORACLE;
-        }
-
-        // if we're here, then we'll try smbios (type 4)
-        return getSmbiosData("4", "Manufacturer: ");
-    }
-
-    /**
-     * Tries to obtain the system manufacturer.
-     * @return The system manufacturer (an empty string if not found or an error occurred)
-     */
-    private String getSolarisSystemManufacturer() {
-        // not fully accurate, this could be another manufacturer (fujitsu for example)
-        if ("sparc".equalsIgnoreCase(System.getProperty("os.arch"))) {
-            return ORACLE;
-        }
-
-        // if we're here, then we'll try smbios (type 1)
-        return getSmbiosData("1", "Manufacturer: ");
-    }
-
-    /**
-     * Tries to obtain the serial number.
-     * @return The serial number (empty string if not found or an error occurred)
-     */
-    private String getSolarisSN() {
-        // try to read from the psn file if it exists
-        String tmp = getFileContent("/var/run/psn");
-        if (tmp.length() > 0) {
-            return tmp.trim();
-        }
-
-        // if we're here, then we'll try sneep
-        String tmpSN = getSneepSN();
-        if (tmpSN.length() > 0) {
-            return tmpSN;
-        }
-
-        // if we're here, then we'll try smbios (type 1)
-        tmpSN = getSmbiosData("1", "Serial Number: ");
-        if (tmpSN.length() > 0) {
-            return tmpSN;
-        }
-
-        // if we're here, then we'll try smbios (type 3)
-        tmpSN = getSmbiosData("3", "Serial Number: ");
-        if (tmpSN.length() > 0) {
-            return tmpSN;
-        }
-
-        // give up and return
-        return "";
-    }
-
-    // Sample smbios output segment:
-    // ID    SIZE TYPE
-    // 1     150  SMB_TYPE_SYSTEM (system information)
-    //
-    //   Manufacturer: Oracle Corporation
-    //   Product: Sun Fire X4600
-    //   Version: To Be Filled By O.E.M.
-    //   Serial Number: 00:14:4F:45:0C:2A
-    private String getSmbiosData(String type, String target) {
-        String output = getCommandOutput("/usr/sbin/smbios", "-t", type);
-        for (String s : output.split("\n")) {
-            if (s.contains(target)) {
-                int indx = s.indexOf(target) + target.length();
-                if (indx < s.length()) {
-                    String tmp = s.substring(indx).trim();
-                    String lowerCaseStr = tmp.toLowerCase();
-                    if (!lowerCaseStr.startsWith("not available")
-                            && !lowerCaseStr.startsWith("to be filled by o.e.m")) {
-                        return tmp;
-                    }
-                }
-            }
-        }
-
-        return "";
-    }
-
-    private String getSneepSN() {
-        String basedir = getCommandOutput("pkgparam","SUNWsneep","BASEDIR");
-        File f = new File(basedir + "/bin/sneep");
-        if (f.exists()) {
-            String sneepSN = getCommandOutput(basedir + "/bin/sneep");
-            if (sneepSN.equalsIgnoreCase("unknown")) {
-                return "";
-            } else {
-                return sneepSN;
-            }
-        } else {
-            return "";
-        }
-    }
-
-}
--- a/src/share/classes/com/sun/servicetag/SunConnection.java	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,305 +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.  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.servicetag;
-
-import java.io.*;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.net.HttpURLConnection;
-import java.net.MalformedURLException;
-import java.io.OutputStreamWriter;
-import java.util.Locale;
-import javax.net.ssl.HttpsURLConnection;
-
-/**
- * Sun Connection Class for Product Registration.
- *
- * Registration Web Application Interface
- * 1) POST the product registry to the output stream of the registration
- *    relay service.
- * 2) Open the webapp URL from a browser with the following parameters:
- *    registry-urn
- *    product=jdk
- *    locale=<default-locale>
- *    version=<version>
- *
- * @see https://sn-tools.central.sun.com/twiki/pub/ServiceTags/RegistrationRelayService/
- *
- */
-class SunConnection {
-
-    private static String JDK_REGISTRATION_URL = "https://hs-ws1.oracle.com/";
-    private static String SANDBOX_TESTING_URL = "https://hs-ws1-tst.oracle.com/";
-    private static String REGISTRATION_WEB_PATH = "RegistrationWeb/register";
-
-    // System properties for testing
-    private static String SVCTAG_REGISTER_TESTING = "servicetag.register.testing";
-    private static String SVCTAG_REGISTRATION_URL = "servicetag.registration.url";
-    private static String SVCTAG_CONNECTION_TIMEOUT = "servicetag.connection.timeout";
-
-    private SunConnection() {
-    }
-
-    /**
-     * Returns a URL for JDK registration interfacing with the Sun Connection
-     * registration relay service in this form:
-     *   <registration-url>/<registry_urn>?product=jdk&locale=<locale>
-     *
-     * The <registration-url> can be overridden by an environment
-     * variable or a system property.
-     *
-     * 1) "servicetag.register.testing" system property to switch to the
-     *    Sun Connection registration sandbox testing.
-     * 2) "servicetag.registration.url" system property to override
-     *    the URL
-     * 3) Default production URL
-     *
-     */
-    static URL getRegistrationURL(String registrationURN, Locale locale, String version) {
-        String url = System.getProperty(SVCTAG_REGISTRATION_URL);
-        if (url == null) {
-            if (System.getProperty(SVCTAG_REGISTER_TESTING) != null) {
-                url = SANDBOX_TESTING_URL;
-            } else {
-                url = JDK_REGISTRATION_URL;
-            }
-        }
-        url += REGISTRATION_WEB_PATH;
-
-        // trim whitespaces
-        url = url.trim();
-        if (url.length() == 0) {
-            throw new InternalError("Empty registration url set");
-        }
-
-        // Add the registry_urn in the URL's query
-        String registerURL = rewriteURL(url, registrationURN, locale, version);
-        try {
-            return new URL(registerURL);
-        } catch (MalformedURLException ex) {
-            // should never reach here
-            InternalError x =
-                new InternalError(ex.getMessage());
-            x.initCause(ex);
-            throw x;
-        }
-    }
-
-    private static String rewriteURL(String url, String registryURN, Locale locale, String version) {
-        StringBuilder sb = new StringBuilder(url.trim());
-        int len = sb.length();
-        if (sb.charAt(len-1) != '/') {
-            sb.append('/');
-        }
-        sb.append(registryURN);
-        sb.append("?");
-        sb.append("product=jdk");
-        sb.append("&");
-        sb.append("locale=").append(locale.toString());
-        sb.append("&");
-        sb.append("version=").append(version);
-        return sb.toString();
-    }
-
-    /**
-     * Registers all products in the given product registry.  If it fails
-     * to post the service tag registry, open the browser with the offline
-     * registration page.
-     *
-     * @param regData registration data to be posted to the Sun Connection
-     *             for registration.
-     * @param locale Locale
-     * @param version JDK version
-     *
-     * @throws IOException if I/O error occurs in this operation
-     */
-    public static void register(RegistrationData regData,
-                                Locale locale,
-                                String version) throws IOException {
-        // Gets the URL for SunConnection registration relay service
-        URL url = getRegistrationURL(regData.getRegistrationURN(),
-                                     locale,
-                                     version);
-
-        // Post the Product Registry to Sun Connection
-        boolean succeed = postRegistrationData(url, regData);
-        if (succeed) {
-            // service tags posted successfully
-            // now prompt for registration
-            openBrowser(url);
-        } else {
-            // open browser with the offline registration page
-            openOfflineRegisterPage();
-        }
-    }
-
-    /**
-     * Opens a browser for JDK product registration.
-     * @param url Registration Webapp URL
-     */
-    private static void openBrowser(URL url) throws IOException {
-        if (!BrowserSupport.isSupported()) {
-            if (Util.isVerbose()) {
-                System.out.println("Browser is not supported");
-            }
-            return;
-        }
-
-        try {
-            BrowserSupport.browse(url.toURI());
-        } catch (URISyntaxException ex) {
-            InternalError x = new InternalError("Error in registering: " + ex.getMessage());
-            x.initCause(ex);
-            throw x;
-        } catch (IllegalArgumentException ex) {
-            if (Util.isVerbose()) {
-                ex.printStackTrace();
-            }
-        } catch (UnsupportedOperationException ex) {
-            // ignore if not supported
-            if (Util.isVerbose()) {
-                ex.printStackTrace();
-            }
-        }
-    }
-
-    /**
-     * POST service tag registry to Sun Connection
-     * @param loc the URL of the webapp to handle the POST request
-     * @param streg the Service Tag registry
-     * @return true if posting succeeds; otherwise, false.
-     */
-    private static boolean postRegistrationData(URL url,
-                                                RegistrationData registration) {
-        try {
-            HttpsURLConnection con = (HttpsURLConnection) url.openConnection();
-            con.setDoInput(true);
-            con.setDoOutput(true);
-            con.setUseCaches(false);
-            con.setAllowUserInteraction(false);
-
-            // default 10 seconds timeout
-            String timeout = System.getProperty(SVCTAG_CONNECTION_TIMEOUT, "10");
-            con.setConnectTimeout(Util.getIntValue(timeout) * 1000);
-
-            if (Util.isVerbose()) {
-                System.out.println("Connecting to post registration data at " + url);
-            }
-
-            con.setRequestMethod("POST");
-            con.setRequestProperty("Content-Type", "text/xml;charset=\"utf-8\"");
-            con.connect();
-
-            OutputStream out = null;
-            try {
-                out = con.getOutputStream();
-                registration.storeToXML(out);
-                out.flush();
-            } finally {
-                if (out != null) {
-                    out.close();
-                }
-            }
-
-            int returnCode = con.getResponseCode();
-            if (Util.isVerbose()) {
-                System.out.println("POST return status = " + returnCode);
-                printReturnData(con, returnCode);
-            }
-            return (returnCode == HttpURLConnection.HTTP_OK);
-        } catch (MalformedURLException me) {
-            // should never reach here
-            InternalError x = new InternalError("Error in registering: " + me.getMessage());
-            x.initCause(me);
-            throw x;
-        } catch (Exception ioe) {
-            // SocketTimeoutException, IOException or UnknownHostException
-            if (Util.isVerbose()) {
-                ioe.printStackTrace();
-            }
-            return false;
-        }
-    }
-
-    /**
-     * Opens the offline registratioin page in the browser.
-     *
-     */
-    private static void openOfflineRegisterPage()
-            throws IOException {
-        if (!BrowserSupport.isSupported()) {
-            if (Util.isVerbose()) {
-                System.out.println("Browser is not supported");
-            }
-            return;
-        }
-
-        File registerPage = Installer.getRegistrationHtmlPage();
-        try {
-            BrowserSupport.browse(registerPage.toURI());
-        } catch (FileNotFoundException ex) {
-            // should never reach here
-            InternalError x =
-                new InternalError("Error in launching " + registerPage + ": " + ex.getMessage());
-            x.initCause(ex);
-            throw x;
-        } catch (IllegalArgumentException ex) {
-            if (Util.isVerbose()) {
-                ex.printStackTrace();
-            }
-        } catch (UnsupportedOperationException ex) {
-            // ignore if not supported
-            if (Util.isVerbose()) {
-                ex.printStackTrace();
-            }
-        }
-    }
-
-    private static void printReturnData(HttpURLConnection con, int returnCode)
-            throws IOException {
-        BufferedReader reader = null;
-        try {
-            if (returnCode < 400) {
-                reader = new BufferedReader(
-                             new InputStreamReader(con.getInputStream()));
-            } else {
-                reader = new BufferedReader(
-                             new InputStreamReader(con.getErrorStream()));
-            }
-            StringBuilder sb = new StringBuilder();
-            String line;
-            while ((line = reader.readLine()) != null) {
-                sb.append(line).append("\n");
-            }
-            System.out.println("Response is : ");
-            System.out.println(sb.toString());
-        } finally {
-            if (reader != null) {
-                reader.close();
-            }
-        }
-    }
-}
--- a/src/share/classes/com/sun/servicetag/SystemEnvironment.java	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,338 +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.servicetag;
-
-// This class is a copy of the com.sun.scn.servicetags.SystemEnvironment
-// class from the Sun Connection source.
-//
-// The Service Tags team maintains the latest version of the implementation
-// for system environment data collection.  JDK will include a copy of
-// the most recent released version for a JDK release. We rename
-// the package to com.sun.servicetag so that the Sun Connection
-// product always uses the latest version from the com.sun.scn.servicetags
-// package. JDK and users of the com.sun.servicetag API
-// (e.g. NetBeans and SunStudio) will use the version in JDK.
-
-import java.io.*;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-
-/**
- * SystemEnvironment class collects the environment data with the
- * best effort from the underlying platform.
- */
-public class SystemEnvironment {
-    private String hostname;
-    private String hostId;
-    private String osName;
-    private String osVersion;
-    private String osArchitecture;
-    private String systemModel;
-    private String systemManufacturer;
-    private String cpuManufacturer;
-    private String serialNumber;
-    private static SystemEnvironment sysEnv = null;
-
-    public static synchronized SystemEnvironment getSystemEnvironment() {
-        if (sysEnv == null) {
-            String os = System.getProperty("os.name");
-            if (os.equals("SunOS")) {
-                sysEnv = new SolarisSystemEnvironment();
-            } else if (os.equals("Linux")) {
-                sysEnv = new LinuxSystemEnvironment();
-            } else if (os.startsWith("Windows")) {
-                sysEnv = new WindowsSystemEnvironment();
-            } else {
-                sysEnv = new SystemEnvironment();
-            }
-        }
-        return sysEnv;
-    }
-
-    // package-private
-    SystemEnvironment() {
-        try {
-            this.hostname = InetAddress.getLocalHost().getHostName();
-        } catch (UnknownHostException ex) {
-            this.hostname = "Unknown host";
-        }
-        this.hostId = "";
-        this.osName = System.getProperty("os.name");
-        this.osVersion = System.getProperty("os.version");
-        this.osArchitecture = System.getProperty("os.arch");
-        this.systemModel = "";
-        this.systemManufacturer = "";
-        this.cpuManufacturer = "";
-        this.serialNumber = "";
-    }
-
-
-    /**
-     * Sets the hostname.
-     * @param hostname The hostname to set.
-     */
-    public void setHostname(String hostname) {
-        this.hostname = hostname;
-    }
-
-    /**
-     * Sets the OS name.
-     * @param osName The osName to set.
-     */
-    public void setOsName(String osName) {
-        this.osName = osName;
-    }
-
-    /**
-     * Sets the OS version.
-     * @param osVersion The osVersion to set.
-     */
-    public void setOsVersion(String osVersion) {
-        this.osVersion = osVersion;
-    }
-
-    /**
-     * Sets the OS architecture.
-     * @param osArchitecture The osArchitecture to set.
-     */
-    public void setOsArchitecture(String osArchitecture) {
-        this.osArchitecture = osArchitecture;
-    }
-
-    /**
-     * Sets the system model.
-     * @param systemModel The systemModel to set.
-     */
-    public void setSystemModel(String systemModel) {
-        this.systemModel = systemModel;
-    }
-
-    /**
-     * Sets the system manufacturer.
-     * @param systemManufacturer The systemManufacturer to set.
-     */
-    public void setSystemManufacturer(String systemManufacturer) {
-        this.systemManufacturer = systemManufacturer;
-    }
-
-    /**
-     * Sets the cpu manufacturer.
-     * @param cpuManufacturer The cpuManufacturer to set.
-     */
-    public void setCpuManufacturer(String cpuManufacturer) {
-        this.cpuManufacturer = cpuManufacturer;
-    }
-
-    /**
-     * Sets the serial number.
-     * @param serialNumber The serialNumber to set.
-     */
-    public void setSerialNumber(String serialNumber) {
-        this.serialNumber = serialNumber;
-    }
-
-    /**
-     * Sets the hostid.  Truncates to a max length of 16 chars.
-     * @param hostId The hostid to set.
-     */
-    public void setHostId(String hostId) {
-        if (hostId == null || hostId.equals("null")) {
-            hostId = "";
-        }
-        if (hostId.length() > 16) {
-            hostId = hostId.substring(0,16);
-        }
-        this.hostId = hostId;
-    }
-
-    /**
-     * Returns the hostname.
-     * @return The hostname.
-     */
-    public String getHostname() {
-        return hostname;
-    }
-
-    /**
-     * Returns the osName.
-     * @return The osName.
-     */
-    public String getOsName() {
-        return osName;
-    }
-
-    /**
-     * Returns the osVersion.
-     * @return The osVersion.
-     */
-    public String getOsVersion() {
-        return osVersion;
-    }
-
-    /**
-     * Returns the osArchitecture.
-     * @return The osArchitecture.
-     */
-    public String getOsArchitecture() {
-        return osArchitecture;
-    }
-
-    /**
-     * Returns the systemModel.
-     * @return The systemModel.
-     */
-    public String getSystemModel() {
-        return systemModel;
-    }
-
-    /**
-     * Returns the systemManufacturer.
-     * @return The systemManufacturer.
-     */
-    public String getSystemManufacturer() {
-        return systemManufacturer;
-    }
-
-    /**
-     * Returns the serialNumber.
-     * @return The serialNumber.
-     */
-    public String getSerialNumber() {
-        return serialNumber;
-    }
-
-    /**
-     * Returns the hostId.
-     * @return The hostId.
-     */
-    public String getHostId() {
-        return hostId;
-    }
-
-    /**
-     * Returns the cpuManufacturer.
-     * @return The cpuManufacturer.
-     */
-    public String getCpuManufacturer() {
-        return cpuManufacturer;
-    }
-
-    protected String getCommandOutput(String... command) {
-        StringBuilder sb = new StringBuilder();
-        BufferedReader br = null;
-        Process p = null;
-        try {
-            ProcessBuilder pb = new ProcessBuilder(command);
-            p = pb.start();
-            p.waitFor();
-
-            if (p.exitValue() == 0) {
-                br = new BufferedReader(new InputStreamReader(p.getInputStream()));
-                String line = null;
-                while ((line = br.readLine()) != null) {
-                    line = line.trim();
-                    if (line.length() > 0) {
-                        if (sb.length() > 0) {
-                            sb.append("\n");
-                        }
-                        sb.append(line);
-                    }
-                }
-            }
-            return sb.toString();
-        } catch (InterruptedException ie) {
-            // in case the command hangs
-            if (p != null) {
-                p.destroy();
-            }
-            return "";
-        } catch (Exception e) {
-            // ignore exception
-            return "";
-        } finally {
-            if (p != null) {
-                try {
-                    p.getErrorStream().close();
-                } catch (IOException e) {
-                    // ignore
-                }
-                try {
-                    p.getInputStream().close();
-                } catch (IOException e) {
-                    // ignore
-                }
-                try {
-                    p.getOutputStream().close();
-                } catch (IOException e) {
-                    // ignore
-                }
-                p = null;
-            }
-            if (br != null) {
-                try {
-                    br.close();
-                } catch (IOException e) {
-                    // ignore
-                }
-            }
-        }
-    }
-
-    protected String getFileContent(String filename) {
-        File f = new File(filename);
-        if (!f.exists()) {
-            return "";
-        }
-
-        StringBuilder sb = new StringBuilder();
-        BufferedReader br = null;
-        try {
-            br = new BufferedReader(new FileReader(f));
-            String line = null;
-            while ((line = br.readLine()) != null) {
-                line = line.trim();
-                if (line.length() > 0) {
-                    if (sb.length() > 0) {
-                        sb.append("\n");
-                    }
-                    sb.append(line);
-                }
-            }
-            return sb.toString();
-        } catch (Exception e) {
-            // ignore exception
-            return "";
-        } finally {
-            if (br != null) {
-                try {
-                    br.close();
-                } catch (IOException e) {
-                    // ignore
-                }
-            }
-        }
-    }
-}
--- a/src/share/classes/com/sun/servicetag/UnauthorizedAccessException.java	Wed Jun 19 21:51:50 2013 -0700
+++ /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.servicetag;
-
-/**
- * Thrown if the user is not authorized to
- * {@link Registry#updateServiceTag update} or
- * {@link Registry#removeServiceTag remove}
- * a service tag from a {@link Registry}.
- */
-public class UnauthorizedAccessException extends RuntimeException {
-
-    /**
-     * Constructs an <code>UnauthorizedAccessException</code> object
-     * without detail message.
-     */
-    public UnauthorizedAccessException() {
-    }
-
-
-    /**
-     * Constructs an <code>UnauthorizedAccessException</code> object
-     * with the specified detail message.
-     *
-     * @param msg the detail message.
-     */
-    public UnauthorizedAccessException(String msg) {
-        super(msg);
-    }
-}
--- a/src/share/classes/com/sun/servicetag/Util.java	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,339 +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.servicetag;
-
-import java.io.*;
-import java.util.Date;
-import java.text.SimpleDateFormat;
-import java.text.ParseException;
-import java.util.TimeZone;
-import java.util.UUID;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-
-// Utility class for com.sun.servicetag package
-class Util {
-    private static boolean verbose = (System.getProperty("servicetag.verbose") != null);
-    private static String jrepath = null;
-    private static final String REGKEY_TAIL =
-        "microsoft\\windows\\currentversion\\app paths\\stclient.exe";
-    private static final String STCLIENT_TAIL =  "sun\\servicetag\\stclient.exe";
-    private static final String WIN32_STCLIENT =
-        "c:\\Program Files (x86)\\" + STCLIENT_TAIL;
-
-    // for debugging and tracing
-    static boolean isVerbose() {
-        return verbose;
-    }
-
-    /**
-     * Gets the pathname of JRE in the running platform
-     * This can be a JDK or JRE.
-     */
-    static synchronized String getJrePath() {
-        if (jrepath == null) {
-            // Determine the JRE path by checking the existence of
-            // <HOME>/jre/lib and <HOME>/lib.
-            String javaHome = System.getProperty("java.home");
-            jrepath = javaHome + File.separator + "jre";
-            File f = new File(jrepath, "lib");
-            if (!f.exists()) {
-                // java.home usually points to the JRE path
-                jrepath = javaHome;
-            }
-        }
-        return jrepath;
-    }
-
-    /**
-     * Tests if the running platform is a JDK.
-     */
-    static boolean isJdk() {
-        // <HOME>/jre exists which implies it's a JDK
-        return getJrePath().endsWith(File.separator + "jre");
-    }
-
-    /**
-     * Generates the URN string of "urn:st" namespace
-     */
-    static String generateURN() {
-        return "urn:st:" + UUID.randomUUID().toString();
-    }
-
-    static int getIntValue(String value) {
-        try {
-            return Integer.parseInt(value);
-        } catch (NumberFormatException e) {
-            throw new IllegalArgumentException("\"" + value + "\"" +
-                " expected to be an integer");
-        }
-    }
-
-    /**
-     * Formats the Date into a timestamp string in YYYY-MM-dd HH:mm:ss GMT.
-     * @param timestamp Date
-     * @return a string representation of the timestamp
-     *         in the YYYY-MM-dd HH:mm:ss GMT format.
-     */
-    static String formatTimestamp(Date timestamp) {
-        if (timestamp == null) {
-            return "[No timestamp]";
-        }
-        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z");
-        df.setTimeZone(TimeZone.getTimeZone("GMT"));
-        return df.format(timestamp);
-    }
-
-    /**
-     * Parses a timestamp string in YYYY-MM-dd HH:mm:ss GMT format.
-     * @param timestamp Timestamp in the YYYY-MM-dd HH:mm:ss GMT format.
-     * @return Date
-     */
-    static Date parseTimestamp(String timestamp) {
-        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z");
-        df.setTimeZone(TimeZone.getTimeZone("GMT"));
-        try {
-            return df.parse(timestamp);
-        } catch (ParseException e) {
-            // should not reach here
-            e.printStackTrace();
-            return new Date();
-        }
-    }
-
-    static String commandOutput(Process p) throws IOException {
-        Reader r = null;
-        Reader err = null;
-        try {
-            r = new InputStreamReader(p.getInputStream());
-            err = new InputStreamReader(p.getErrorStream());
-            String output = commandOutput(r);
-            String errorMsg = commandOutput(err);
-            p.waitFor();
-            return output + errorMsg.trim();
-        } catch (InterruptedException e) {
-            if (isVerbose()) {
-                e.printStackTrace();
-            }
-            return e.getMessage();
-        } finally {
-            try {
-                if (r != null) {
-                    r.close();
-                }
-            } finally {
-                if (err != null) {
-                    err.close();
-                }
-            }
-        }
-    }
-
-    static String commandOutput(Reader r) throws IOException {
-        StringBuilder sb = new StringBuilder();
-        int c;
-        while ((c = r.read()) > 0) {
-            if (c != '\r') {
-                sb.append((char) c);
-            }
-        }
-        return sb.toString();
-    }
-
-    static int getJdkVersion() {
-        parseVersion();
-        return jdkVersion;
-    }
-
-    static int getUpdateVersion() {
-        parseVersion();
-        return jdkUpdate;
-    }
-
-    private static int jdkVersion = 0;
-    private static int jdkUpdate = 0;
-    private static synchronized void parseVersion() {
-        if (jdkVersion > 0) {
-            return;
-        }
-
-        // parse java.runtime.version
-        // valid format of the version string is:
-        // n.n.n[_uu[c]][-<identifer>]-bxx
-        String cs = System.getProperty("java.runtime.version");
-        if (cs.length() >= 5 &&
-            Character.isDigit(cs.charAt(0)) && cs.charAt(1) == '.' &&
-            Character.isDigit(cs.charAt(2)) && cs.charAt(3) == '.' &&
-            Character.isDigit(cs.charAt(4))) {
-            jdkVersion = Character.digit(cs.charAt(2), 10);
-            cs = cs.substring(5, cs.length());
-            if (cs.charAt(0) == '_' && cs.length() >= 3 &&
-                Character.isDigit(cs.charAt(1)) &&
-                Character.isDigit(cs.charAt(2))) {
-                int nextChar = 3;
-                try {
-                    String uu = cs.substring(1, 3);
-                    jdkUpdate = Integer.valueOf(uu).intValue();
-                } catch (NumberFormatException e) {
-                    // not conforming to the naming convention
-                    return;
-                }
-            }
-        } else {
-            throw new InternalError("Invalid java.runtime.version" + cs);
-        }
-    }
-
-    /**
-     * Returns this java string as a null-terminated byte array
-     */
-    private static byte[] stringToByteArray(String str) {
-        return (str + "\u0000").getBytes();
-    }
-
-    /**
-     * Converts a null-terminated byte array to java string
-     */
-    private static String byteArrayToString(byte[] array) {
-        return new String(array, 0, array.length -1);
-    }
-
-    /**
-     * Gets the stclient path using a well known location from
-     * the Windows platform Registry, ensuring the path returned
-     * by the registry is really the one we are looking for,
-     * otherwise it will return null.
-     */
-    private static File getWindowsStClientFile(boolean wow64) {
-        File out = null;
-        String regKey = (wow64 == true)
-            ? "software\\Wow6432Node\\" + REGKEY_TAIL
-            : "software\\" + REGKEY_TAIL;
-        String keyName = "" ; // use the default  key
-        String path = getRegistryKey(regKey, keyName);
-        if (path != null
-                && (new File(path)).exists()
-                && path.toLowerCase().endsWith(STCLIENT_TAIL.toLowerCase())) {
-            out = new File(path);
-        }
-        if (isVerbose()) {
-            System.out.println("stclient=" + out);
-        }
-        return out;
-    }
-
-    /**
-     * Finds a stclient in 32 and 64 bit environments, first by querying
-     * the windows registry, if not then get the well known paths for
-     * 64bit see http://support.microsoft.com/kb/896459
-     */
-
-    static File getWindowsStClientFile() {
-        File stclient = null;
-        if (System.getProperty("os.arch").equals("x86")) {
-            // try to get the default entry
-            stclient = getWindowsStClientFile(false);
-            if (stclient != null) {
-                return stclient;
-            }
-        } else { // we are on 64-bit system
-            // try the wow64 area
-            stclient = getWindowsStClientFile(true);
-            if (stclient != null) {
-                return stclient;
-            }
-            // try the default hard coded path, maybe wow64 registry is missing
-            stclient = new File(WIN32_STCLIENT);
-            if (stclient.canExecute()) {
-                if (isVerbose()) {
-                    System.out.println("stclient(default)=" + stclient);
-                }
-                return stclient;
-            }
-        }
-        if (isVerbose()) {
-            System.out.println("stclient not found");
-        }
-        return null;
-    }
-
-    /**
-     * This uses reflection to access a private java windows registry
-     * interface, any changes to that Class must be appropriately adjusted.
-     * Returns a null if unsuccessful.
-     */
-    private static String getRegistryKey(String regKey, String keyName) {
-        String out = null;
-        try {
-            Class<?> clazz = Class.forName("java.util.prefs.WindowsPreferences");
-
-            // Get the registry methods
-            Method winRegOpenKeyM = clazz.getDeclaredMethod("WindowsRegOpenKey",
-                    int.class, byte[].class, int.class);
-            winRegOpenKeyM.setAccessible(true);
-
-            Method winRegCloseKeyM = clazz.getDeclaredMethod("WindowsRegCloseKey",
-                    int.class);
-            winRegCloseKeyM.setAccessible(true);
-
-            Method winRegQueryValueM = clazz.getDeclaredMethod("WindowsRegQueryValueEx",
-                    int.class, byte[].class);
-            winRegQueryValueM.setAccessible(true);
-
-            // Get all the constants we need
-            int HKLM = getValueFromStaticField("HKEY_LOCAL_MACHINE", clazz);
-            int KEY_READ = getValueFromStaticField("KEY_READ", clazz);
-            int ERROR_CODE = getValueFromStaticField("ERROR_CODE", clazz);
-            int NATIVE_HANDLE = getValueFromStaticField("NATIVE_HANDLE", clazz);
-            int ERROR_SUCCESS = getValueFromStaticField("ERROR_SUCCESS", clazz);
-
-            // Convert keys
-            byte[] reg = stringToByteArray(regKey);
-            byte[] key = stringToByteArray(keyName);
-
-            // Open the registry
-            int[] result = (int[]) winRegOpenKeyM.invoke(null, HKLM, reg, KEY_READ);
-
-            if (result[ERROR_CODE] == ERROR_SUCCESS) {
-                byte[] stvalue = (byte[]) winRegQueryValueM.invoke(null,
-                    result[NATIVE_HANDLE], key);
-                out = byteArrayToString(stvalue);
-                winRegCloseKeyM.invoke(null, result[NATIVE_HANDLE]);
-            }
-        } catch (Exception ex) {
-            if (isVerbose()) {
-                ex.printStackTrace();
-            }
-        }
-        return out;
-    }
-
-    private static int getValueFromStaticField(String fldName, Class<?> klass) throws Exception {
-        Field f = klass.getDeclaredField(fldName);
-        f.setAccessible(true);
-        return f.getInt(null);
-    }
-}
--- a/src/share/classes/com/sun/servicetag/WindowsSystemEnvironment.java	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,150 +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.servicetag;
-
-// This class is a copy of the com.sun.scn.servicetags.WindowsSystemEnvironment
-// class from the Sun Connection source.
-//
-// The Service Tags team maintains the latest version of the implementation
-// for system environment data collection.  JDK will include a copy of
-// the most recent released version for a JDK release. We rename
-// the package to com.sun.servicetag so that the Sun Connection
-// product always uses the latest version from the com.sun.scn.servicetags
-// package. JDK and users of the com.sun.servicetag API
-// (e.g. NetBeans and SunStudio) will use the version in JDK.
-//
-// So we keep this class in src/share/classes instead of src/<os>/classes.
-
-import java.io.*;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Windows implementation of the SystemEnvironment class.
- */
-class WindowsSystemEnvironment extends SystemEnvironment {
-    WindowsSystemEnvironment() {
-        super();
-
-        // run a call to make sure things are initialized
-        // ignore the first call result as the system may
-        // give inconsistent data on the first invocation ever
-        getWmicResult("computersystem", "get", "model");
-
-        setSystemModel(getWmicResult("computersystem", "get", "model"));
-        setSystemManufacturer(getWmicResult("computersystem", "get", "manufacturer"));
-        setSerialNumber(getWmicResult("bios", "get", "serialnumber"));
-
-        String cpuMfr = getWmicResult("cpu", "get", "manufacturer");
-        // this isn't as good an option, but if we couldn't get anything
-        // from wmic, try the processor_identifier
-        if (cpuMfr.length() == 0) {
-            String procId = System.getenv("processor_identifer");
-            if (procId != null) {
-                String[] s = procId.split(",");
-                cpuMfr = s[s.length - 1].trim();
-            }
-        }
-        setCpuManufacturer(cpuMfr);
-
-        // try to remove the temp file that gets created from running wmic cmds
-        try {
-            // look in the current working directory
-            File f = new File("TempWmicBatchFile.bat");
-            if (f.exists()) {
-                f.delete();
-            }
-        } catch (Exception e) {
-            // ignore the exception
-        }
-    }
-
-
-    /**
-     * This method invokes wmic outside of the normal environment
-     * collection routines.
-     *
-     * An initial call to wmic can be costly in terms of time.
-     *
-     * <code>
-     * Details of why the first call is costly can be found at:
-     *
-     * http://support.microsoft.com/kb/290216/en-us
-     *
-     * "When you run the Wmic.exe utility for the first time, the utility
-     * compiles its .mof files into the repository. To save time during
-     * Windows installation, this operation takes place as necessary."
-     * </code>
-     */
-    private String getWmicResult(String alias, String verb, String property) {
-        String res = "";
-        BufferedReader in = null;
-        try {
-            ProcessBuilder pb = new ProcessBuilder("cmd", "/C", "WMIC", alias, verb, property);
-            Process p = pb.start();
-            // need this for executing windows commands (at least
-            // needed for executing wmic command)
-            BufferedWriter bw = null;
-            try {
-                bw = new BufferedWriter(
-                         new OutputStreamWriter(p.getOutputStream()));
-                bw.write(13);
-                bw.flush();
-            } finally {
-                if (bw != null) {
-                    bw.close();
-                }
-            }
-
-            p.waitFor();
-            if (p.exitValue() == 0) {
-                in = new BufferedReader(new InputStreamReader(p.getInputStream()));
-                String line = null;
-                while ((line = in.readLine()) != null) {
-                    line = line.trim();
-                    if (line.length() == 0) {
-                        continue;
-                    }
-                    res = line;
-                }
-                // return the *last* line read
-                return res;
-            }
-
-        } catch (Exception e) {
-            // ignore the exception
-        } finally {
-            if (in != null) {
-                try {
-                    in.close();
-                } catch (IOException e) {
-                    // ignore
-                }
-            }
-        }
-        return res.trim();
-    }
-}
--- a/src/share/classes/com/sun/servicetag/package.html	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-CTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-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.
-
--->
-
-</head>
-<body bgcolor="white">
-
-This package contains classes that allow the creation
-and manipulation of service tags.
-This com.sun.servicetag package is intended for
-<b>Sun internal use</b> only.
-<p>
-<dl>
-<dt><b>Service Tag</b></dt>
-<dd>A service tag is an XML-based data structure that contains identifying
-information about an instance of a product or component on a system.
-</dd>
-</dl>
-<dl>
-<dt><b>Service Tag Registry</b></dt>
-<dd>A service tag registry is a XML-based registry that contains
-the service tags of all the tagged components on a system.  The
-service tag registry is present on systems that have the
-Service Tags software installed.
-</dd>
-</dl>
-<dl>
-<dt><b>Registration Data</b></dt>
-<dd>A registration data is a container of one or more
-service tags that identify the
-components for product registration and will be used to interface
-with the Sun Connection registration services.
-</dd>
-</dl>
-
-This package contains the methods to create service tags, set up the
-registration data for product registration, add service tags to and
-remove them from the system service tag registry.
-<p>
-All methods defined in this package will throw {@code NullPointerException}
-if {@code null} is passed in any input parameter unless it is stated otherwise.
-In addition, they are multi-thread safe.
-</body>
-</html>
-
-
--- a/src/share/classes/com/sun/servicetag/resources/Putback-Notes.txt	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-README for auto-generating of the offline registration page.
-
-1. register.html is defined by the xDesign team.
-
-2. Before putback in the workspace, we need to modify the 
-   register.html to contain the following:
-
-   (a) replace the pathname of the jdk_header.png image to
-       <img src="@@JDK_HEADER_PNG@@" ....>
-
-   (b) replace the product name from:
-           Java Development Kit Version 6 Update 5 (e.g.)
-       to:
-           Java Development Kit @@JDK_VERSION@@ 
-
-   (c) replace the form action for the "Register My JDK" button with:
-
-       <form name="form1" method="post" action="@@REGISTRATION_URL@@" enctype="text/xml">
-
-   (d) Add this input in the form for posting data after 
-       the <form name=....> line:
- 
-       <input type="hidden" name="servicetag_payload" value="@@REGISTRATION_PAYLOAD@@">
-
-3. The jdk_header.png is located under <JRE>/lib/servicetag directory.
--- a/src/share/classes/com/sun/servicetag/resources/javase_5_swordfish.properties	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +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.
-
-servicetag.jdk.urn     = urn:uuid:d5bed446-05f2-42ed-ba0a-153105a52413
-servicetag.jdk.name    = J2SE 5.0 Development Kit
-servicetag.jre.urn     = urn:uuid:5c6686aa-fd05-46a6-ba3e-700e2d5f7043
-servicetag.jre.name    = J2SE 5.0 Runtime Environment
-servicetag.parent.urn  = urn:uuid:f3c20172-557a-11d7-93d0-d6a41ea318df
-servicetag.parent.name = Java 2 Platform, Standard Edition 5.0
--- a/src/share/classes/com/sun/servicetag/resources/javase_6_swordfish.properties	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +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.
-
-servicetag.jdk.urn     = urn:uuid:b58ef9a8-5ae8-11db-a023-080020a9ed93
-servicetag.jdk.name    = Java SE 6 Development Kit
-servicetag.jre.urn     = urn:uuid:92d1de8c-1e59-42c6-a280-1c379526bcbc
-servicetag.jre.name    = Java SE 6 Runtime Environment
-servicetag.parent.urn  = urn:uuid:fdc90b21-018d-4cab-b866-612c7c119ed3
-servicetag.parent.name = Java Platform Standard Edition 6 (Java SE 6)
--- a/src/share/classes/com/sun/servicetag/resources/javase_7_swordfish.properties	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +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.
-
-servicetag.jdk.urn     = JSEZ9-007-ZZZZ
-servicetag.jdk.name    = Java SE 7 Development Kit
-servicetag.jre.urn     = JSERE-007-ZZZZ
-servicetag.jre.name    = Java SE 7 Runtime Environment
-servicetag.parent.urn  = urn:uuid:dc1704fe-264f-11dc-9482-080020a9ed93
-servicetag.parent.name = Java Platform Standard Edition 7 (Java SE 7)
Binary file src/share/classes/com/sun/servicetag/resources/jdk_header.png has changed
--- a/src/share/classes/com/sun/servicetag/resources/product_registration.xsd	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,301 +0,0 @@
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
-
-<xs:element name="registration_data">
-  <xs:complexType>
-    <xs:sequence>
-      <xs:element name="environment"
-                  minOccurs="1"
-                  maxOccurs="1">
-        <xs:complexType>
-          <xs:sequence>
-            <xs:element ref="hostname"
-                        minOccurs='1'
-                        maxOccurs='1'/>
-            <xs:element ref="hostId"
-                        minOccurs='1'
-                        maxOccurs='1'/>
-            <xs:element ref="osName"
-                        minOccurs='1'
-                        maxOccurs='1'/>
-            <xs:element ref="osVersion"
-                        minOccurs='1'
-                        maxOccurs='1'/>
-            <xs:element ref="osArchitecture"
-                        minOccurs='1'
-                        maxOccurs='1'/>
-            <xs:element ref="systemModel"
-                        minOccurs='1'
-                        maxOccurs='1'/>
-            <xs:element ref="systemManufacturer"
-                        minOccurs='1'
-                        maxOccurs='1'/>
-            <xs:element ref="cpuManufacturer"
-                        minOccurs='1'
-                        maxOccurs='1'/>
-            <xs:element ref="serialNumber"
-                        minOccurs='1'
-                        maxOccurs='1'/>
-          </xs:sequence>
-        </xs:complexType>
-      </xs:element>
-      <xs:element name="registry"
-                  minOccurs="1"
-                  maxOccurs="1">
-        <xs:complexType>
-          <xs:sequence>
-            <xs:element name="service_tag"
-                        minOccurs="0"
-                        maxOccurs="1024">
-              <xs:complexType>
-                <xs:sequence>
-                  <xs:element ref="instance_urn"
-                              minOccurs='1'
-                              maxOccurs='1'/>
-                  <xs:element ref="product_name"
-                              minOccurs='1'
-                              maxOccurs='1'/>
-                  <xs:element ref="product_version"
-                              minOccurs='1'
-                              maxOccurs='1'/>
-                  <xs:element ref="product_urn"
-                              minOccurs='1'
-                              maxOccurs='1'/>
-                  <xs:element ref="product_parent_urn"
-                              minOccurs='1'
-                              maxOccurs='1'/>
-                  <xs:element ref="product_parent"
-                              minOccurs='1'
-                              maxOccurs='1'/>
-                  <xs:element ref="product_defined_inst_id"
-                              minOccurs='1'
-                              maxOccurs='1'/>
-                  <xs:element ref="product_vendor"
-                              minOccurs='1'
-                              maxOccurs='1'/>
-                  <xs:element ref="platform_arch"
-                              minOccurs='1'
-                              maxOccurs='1'/>
-                  <xs:element ref="timestamp"
-                              minOccurs='1'
-                              maxOccurs='1'/>
-                  <xs:element ref="container"
-                              minOccurs='1'
-                              maxOccurs='1'/>
-                  <xs:element ref="source"
-                              minOccurs='1'
-                              maxOccurs='1'/>
-                  <xs:element ref="installer_uid"
-                              minOccurs='1'
-                              maxOccurs='1'/>
-                </xs:sequence>
-              </xs:complexType>
-            </xs:element>
-          </xs:sequence>
-          <xs:attribute name="urn"
-                        type="xs:string"
-                        use="required"/>
-          <xs:attribute name="version"
-                        type="xs:string"
-                        use="required"/>
-        </xs:complexType>
-      </xs:element>
-    </xs:sequence>
-    <xs:attribute name="version"
-                  type="xs:string"
-                  use="required"/>
-  </xs:complexType>
-</xs:element>
-
-  <!-- definition of simple elements -->
-  <xs:element name="hostname">
-    <xs:simpleType>
-      <xs:restriction base="xs:string">
-        <xs:minLength value="1"/>
-        <xs:maxLength value="255"/>
-      </xs:restriction>
-    </xs:simpleType>
-   </xs:element>
-
-  <xs:element name="hostId">
-    <xs:simpleType>
-      <xs:restriction base="xs:string">
-        <xs:minLength value="0"/>
-        <xs:maxLength value="16"/>
-      </xs:restriction>
-    </xs:simpleType>
-   </xs:element>
-
-  <xs:element name="osName">
-    <xs:simpleType>
-      <xs:restriction base="xs:string">
-        <xs:minLength value="1"/>
-        <xs:maxLength value="256"/>
-      </xs:restriction>
-    </xs:simpleType>
-   </xs:element>
-
-  <xs:element name="osVersion">
-    <xs:simpleType>
-      <xs:restriction base="xs:string">
-        <xs:minLength value="0"/>
-        <xs:maxLength value="50"/>
-      </xs:restriction>
-    </xs:simpleType>
-   </xs:element>
-
-  <xs:element name="osArchitecture">
-    <xs:simpleType>
-      <xs:restriction base="xs:string">
-        <xs:minLength value="0"/>
-        <xs:maxLength value="256"/>
-      </xs:restriction>
-    </xs:simpleType>
-   </xs:element>
-
-  <xs:element name="systemModel">
-    <xs:simpleType>
-      <xs:restriction base="xs:string">
-        <xs:minLength value="0"/>
-        <xs:maxLength value="50"/>
-      </xs:restriction>
-    </xs:simpleType>
-   </xs:element>
-
-  <xs:element name="systemManufacturer">
-    <xs:simpleType>
-      <xs:restriction base="xs:string">
-        <xs:minLength value="0"/>
-        <xs:maxLength value="50"/>
-      </xs:restriction>
-    </xs:simpleType>
-   </xs:element>
-
-  <xs:element name="cpuManufacturer">
-    <xs:simpleType>
-      <xs:restriction base="xs:string">
-        <xs:minLength value="0"/>
-        <xs:maxLength value="50"/>
-      </xs:restriction>
-    </xs:simpleType>
-   </xs:element>
-
-  <xs:element name="serialNumber">
-    <xs:simpleType>
-      <xs:restriction base="xs:string">
-        <xs:minLength value="0"/>
-        <xs:maxLength value="256"/>
-      </xs:restriction>
-    </xs:simpleType>
-   </xs:element>
-
-  <xs:element name="instance_urn">
-    <xs:simpleType>
-      <xs:restriction base="xs:string">
-        <xs:minLength value="1"/>
-        <xs:maxLength value="255"/>
-      </xs:restriction>
-    </xs:simpleType>
-   </xs:element>
-
-  <xs:element name="product_name">
-    <xs:simpleType>
-      <xs:restriction base="xs:string">
-        <xs:maxLength value="255"/>
-      </xs:restriction>
-    </xs:simpleType>
-  </xs:element>
-
-  <xs:element name="product_version">
-    <xs:simpleType>
-      <xs:restriction base="xs:string">
-        <xs:maxLength value="63"/>
-      </xs:restriction>
-    </xs:simpleType>
-  </xs:element>
-
-  <xs:element name="product_urn">
-    <xs:simpleType>
-      <xs:restriction base="xs:string">
-        <xs:minLength value="1"/>
-        <xs:maxLength value="255"/>
-      </xs:restriction>
-    </xs:simpleType>
-  </xs:element>
-
-  <xs:element name="product_parent_urn">
-    <xs:simpleType>
-      <xs:restriction base="xs:string">
-        <xs:minLength value="0"/>
-        <xs:maxLength value="255"/>
-      </xs:restriction>
-    </xs:simpleType>
-  </xs:element>
-
-  <xs:element name="product_parent">
-    <xs:simpleType>
-      <xs:restriction base="xs:string">
-        <xs:minLength value="1"/>
-        <xs:maxLength value="255"/>
-      </xs:restriction>
-    </xs:simpleType>
-  </xs:element>
-
-  <xs:element name="product_defined_inst_id">
-      <xs:simpleType>
-          <xs:restriction base="xs:string">
-              <xs:minLength value="0"/>
-              <xs:maxLength value="255"/>
-          </xs:restriction>
-      </xs:simpleType>
-  </xs:element>
-
-  <xs:element name="product_vendor">
-    <xs:simpleType>
-      <xs:restriction base="xs:string">
-        <xs:minLength value="1"/>
-        <xs:maxLength value="63"/>
-      </xs:restriction>
-    </xs:simpleType>
-  </xs:element>
-
-  <xs:element name="platform_arch">
-    <xs:simpleType>
-      <xs:restriction base="xs:string">
-        <xs:minLength value="1"/>
-        <xs:maxLength value="63"/>
-      </xs:restriction>
-    </xs:simpleType>
-  </xs:element>
-
-  <xs:element name="timestamp">
-    <xs:simpleType>
-      <xs:restriction base="xs:string">
-        <xs:maxLength value="24"/>
-      </xs:restriction>
-    </xs:simpleType>
-  </xs:element>
-
-  <xs:element name="container">
-    <xs:simpleType>
-      <xs:restriction base="xs:string">
-        <xs:maxLength value="63"/>
-      </xs:restriction>
-    </xs:simpleType>
-  </xs:element>
-
-  <xs:element name="source">
-    <xs:simpleType>
-      <xs:restriction base="xs:string">
-        <xs:maxLength value="63"/>
-      </xs:restriction>
-    </xs:simpleType>
-  </xs:element>
-
-  <xs:element name="installer_uid">
-    <xs:simpleType>
-      <xs:restriction base="xs:integer">
-      </xs:restriction>
-    </xs:simpleType>
-  </xs:element>
-
-</xs:schema>
--- a/src/share/classes/com/sun/servicetag/resources/register.html	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,105 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>Register your JDK</title>
-
-<!--
-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.  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.
--->
-
-<style type="text/css">
-<!--
-.style1 {font-family: Arial, Helvetica, sans-serif}
-.style3 {font-family: Arial, Helvetica, sans-serif; font-size: small; }
-input.buttonblue,input.defbutton{ background: #3F6580;border-right:1px solid #304C60;border-bottom:1px solid #304C60;border-left:1px solid #BACDD9;border-top:1px solid #BACDD9; font-weight:bold; color:#FFFFFF; font-size:.8em; height:1.9em}
-input.buttonblue:hover{color:#fbe249;}
-a:link,a.named:visited{color:#3E6B8A}
-a:hover{text-decoration:underline}
-a{text-decoration:none}
-a:visited,a:visited code{color:#917E9C}
--->
-</style>
-</head>
-
-<body>
-<table width="813" border="0" cellpadding="3" cellspacing="0">
-  <tr>
-    <td width="7" height="78">&nbsp;</td>
-    <td width="794" align="left" valign="top">
-        <img src="@@JDK_HEADER_PNG@@" width="783" height="63"></td>
-  </tr>
-  <tr>
-    <td>&nbsp;</td>
-    <td><p class="style1">Thank you for installing the 
-        <strong> Java Development Kit @@JDK_VERSION@@ </strong>
-        from Oracle Corporation. </p>
-        <p class="style1">Registering your product will give you the following benefits:</p>
-        <ul class="style1">
-          <li> Notification of new versions, patches, and updates</li>
-          <li> Special offers on Oracle developer products, services and training </li>
-          <li> Access to early releases and documentation </li>
-        </ul>
-        <p class="style1">Product registration is FREE, quick and easy!</p>
-        <blockquote>
-          <p class="style1">All you need is an Oracle.com account. If you don't already have one, you will be prompted to create one. </p>
-          <table width="708" border="0" cellspacing="0" cellpadding="3">
-            <tr valign="top">
-              <td width="126" height="35">
-              <form name="form1" method="post" action="@@REGISTRATION_URL@@" enctype="text/xml">
-                <input type="hidden" name="servicetag_payload" value="@@REGISTRATION_PAYLOAD@@">
-                <input type="submit" name="Submit"border="0" class="buttonblue" onmouseover="this.style.color='#fbe249';" onmouseout="this.style.color='#FFF';"  value="Register My JDK">
-              </form></td>
-              <td width="570"><span class="style3">You need to be connected to the Internet to register this Oracle product. </span></td>
-            </tr>
-          </table>
-        </blockquote>
-        </td>
-        </tr>
-    <tr>
-       <td>&nbsp;</td>
-       <td bgcolor="#f1f7df">
-       <p class="style3">Oracle Corporation respects your privacy. 
-    We will use your personal information for communications 
-    and management of your Oracle.com account, the services 
-    and applications you access using your Oracle.com account, 
-    and the products and systems you register with your Oracle.com account.</p>
-                <p class="style3">For more information on the data that will be collected as 
-          part of the registration process and how it will be managed <br>
-          see <a href="http://java.sun.com/javase/registration/JDKRegistrationPrivacy.html">http://java.sun.com/javase/registration/JDKRegistrationPrivacy.html</a>. <br>      
-          <br>
-          For more information on Oracle's Privacy Policy see <a href="http://www.oracle.com/html/privacy.html">http://www.oracle.com/html/privacy.html</a> or contact <a class="moz-txt-link-rfc2396E" href="mailto:privacy_ww@oracle.com">privacy_ww@oracle.com.</a></p></td>
-  </tr>
-  <tr>
-    <td>&nbsp;</td>
-    <td>&nbsp;</td>
-  </tr>
-  <tr>
-    <td>&nbsp;</td>
-    <td>&nbsp;</td>
-  </tr>
-</table>
-</body>
-</html>
--- a/src/share/classes/com/sun/servicetag/resources/register_ja.html	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,91 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.or
-g/TR/html4/loose.dtd">
-<html><head>
-
-
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>JDK 製品登録</title>
-
-<!--
-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.  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.
--->
-
-<style type="text/css">
-<!--
-.style1 {font-family: Arial, Helvetica, sans-serif}
-.style3 {font-family: Arial, Helvetica, sans-serif; font-size: small; }
-input.buttonblue,input.defbutton{ background: #3F6580;border-right:1px solid #304C60;border-bottom:1px solid #304C60;border-left:1px solid #BACDD9;border-top:1px solid #BACDD9; font-weight:bold; color:#FFFFFF; font-size:.8em; height:1.9em}
-input.buttonblue:hover{color:#fbe249;}
-a:link,a.named:visited{color:#3E6B8A}
-a:hover{text-decoration:underline}
-a{text-decoration:none}
-a:visited,a:visited code{color:#917E9C}
--->
-</style></head><body>
-<table border="0" cellpadding="3" cellspacing="0" width="813">
-  <tbody><tr>
-    <td height="78" width="7">&nbsp;</td>
-    <td align="left" valign="top" width="794"><img src="@@JDK_HEADER_PNG@@" height="63" width="783"></td>
-  </tr>
-  <tr>
-    <td>&nbsp;</td>
-
-    <td><p class="style1">Oracle Corporation の<strong> Java Development Kit @@JDK_VERSION@@ </strong>をインストールしていただき、ありがとうございます。 </p>
-        <p class="style1">製品登録をすると、次のような特典を受けることができます。</p>
-        <ul class="style1">
-          <li> 最新のバージョン、パッチ、および更新についての通知</li>
-          <li> Oracle の開発者向け製品、サービス、およびトレーニングの特別販売 </li>
-          <li> アーリーリリースおよびドキュメントへのアクセス </li>
-        </ul>
-        <p class="style1">製品登録は無料であり、迅速で簡単です。</p>
-        <blockquote>
-          <p class="style1">必要になるのは、Oracle.com アカウントだけです。 まだアカウントがない場合は、アカウントの作成が求められます。 </p>
-          <table width="708" border="0" cellspacing="0" cellpadding="3">
-            <tr valign="top">
-              <td width="126" height="35"><form name="form1" method="post" action="@@REGISTRATION_URL@@" enctype="text/xml">
-			  <input type="hidden" name="servicetag_payload" value="@@REGISTRATION_PAYLOAD@@">
-                <input type="submit" name="Submit"border="0" class="buttonblue" onmouseover="this.style.color='#fbe249';" onmouseout="this.style.color='#FFF';"  value="JDK 製品登録">
-              </form></td>
-              <td width="570"><span class="style3">この Oracle 製品を登録するには、インターネットに接続している必要があります。 </span></td>
-            </tr>
-	  </table>
-	</blockquote>
-	</td>
-	</tr>
-   <tr>
-       <td>&nbsp;</td>
-	<td bgcolor="#f1f7df">
-        <p class="style3">Oracle Corporation は、お客様のプライバシーを尊重します。 お客様の個人情報は、お客様の Oracle.com アカウント、お客様が Oracle.com アカウントを使用してアクセスするサービスとアプリケーション、およびお客様が Oracle.com アカウントで登録する製品とシステムの通信と管理に使用します。</p>
-                <p class="style3">登録の際に収集されるデータや、それらがどのように管理されるかについての詳細は、<br><a href="http://java.sun.com/javase/ja/registration/JDKRegistrationPrivacy.html">http://java.sun.com/javase/ja/registration/JDKRegistrationPrivacy.html</a> を参照してください。 <br> <br> Oracle のプライバシーポリシーについての詳細は、<a href="http://www.oracle.com/html/privacy.html">http://www.oracle.com/html/privacy.html</a> を参照するか、<a class="moz-txt-link-rfc2396E" href="mailto:privacy_ww@oracle.com">お問い合わせフォーム</a>からお問い合わせください。</p></td>
-  </tr>
-  <tr>
-    <td>&nbsp;</td>
-    <td>&nbsp;</td>
-  </tr>
-  <tr>
-    <td>&nbsp;</td>
-    <td>&nbsp;</td>
-  </tr>
-</table>
-</body>
-</html>
--- a/src/share/classes/com/sun/servicetag/resources/register_zh_CN.html	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,92 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>注册您的 JDK</title>
-
-<!--
-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.  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.
--->
-
-<style type="text/css">
-<!--
-.style1 {font-family: Arial, Helvetica, sans-serif}
-.style3 {font-family: Arial, Helvetica, sans-serif; font-size: small; }
-input.buttonblue,input.defbutton{ background: #3F6580;border-right:1px solid #304C60;border-bottom:1px solid #304C60;border-left:1px solid #BACDD9;border-top:1px solid #BACDD9; font-weight:bold; color:#FFFFFF; font-size:.8em; height:1.9em}
-input.buttonblue:hover{color:#fbe249;}
-a:link,a.named:visited{color:#3E6B8A}
-a:hover{text-decoration:underline}
-a{text-decoration:none}
-a:visited,a:visited code{color:#917E9C}
--->
-</style></head><body>
-<table border="0" cellpadding="3" cellspacing="0" width="813">
-  <tbody><tr>
-    <td height="78" width="7">&nbsp;</td>
-    <td align="left" valign="top" width="794"><img src="@@JDK_HEADER_PNG@@" height="63" width="783"></td>
-  </tr>
-
-  <tr>
-    <td>&nbsp;</td>
-
-<td><p class="style1">感谢您安装 Oracle Corporation 的 <strong>Java Development Kit @@JDK_VERSION@@</strong>。 </p>
-<p class="style1">注册产品后您将获得如下增值服务:</p>
-        <ul class="style1">
-<li> 获得新版本、修补程序和更新的通知服务</li>
-<li> 获得有关 Oracle 开发者产品、服务和培训的优惠 </li>
-<li> 获得对早期版本和文档的访问权限 </li>
-        </ul>
-<p class="style1">产品注册是免费的,即快速又轻松!</p>
-        <blockquote>
-<p class="style1">您需要具有 Oracle.com 帐户。如果您没有,系统将提示您创建一个。 </p>
-          <table width="708" border="0" cellspacing="0" cellpadding="3">
-            <tr valign="top">
-              <td width="126" height="35"><form name="form1" method="post" action="@@REGISTRATION_URL@@" enctype="text/xml">
-			  <input type="hidden" name="servicetag_payload" value="@@REGISTRATION_PAYLOAD@@">
-<input type="submit" name="Submit"border="0" class="buttonblue" onmouseover="this.style.color='#fbe249';" onmouseout="this.style.color='#FFF';"  value="注册我的 JDK">
-              </form></td>
-<td width="570"><span class="style3">您需要连接到 Internet 来注册此 Oracle 产品。 </span></td>
-            </tr>
-	  </table>
-	</blockquote>
-	</td>
-	</tr>
-    <tr>
-       <td>&nbsp;</td>
-	<td bgcolor="#f1f7df">
-        <p class="style3">Oracle 尊重您的隐私。我们会将您的个人信息用于通信和 Oracle.com 帐户的管理、Oracle.com 帐户访问的服务和应用程序以及用于使用 Oracle.com 帐户注册的产品和系统。</p>
-<p class="style3">有关注册过程中收集的数据以及这些数据的管理方式的更多信息,<br>请访问 <a href="http://java.sun.com/javase/registration/JDKRegistrationPrivacy.html">http://java.sun.com/javase/registration/JDKRegistrationPrivacy.html</a>。<br> <br>有关 Oracle 隐私政策的更多信息,请访问 <a href="http://www.oracle.com/html/privacy.html">http://www.oracle.com/html/privacy.html</a> 或与 <a class="moz-txt-link-rfc2396E" href="mailto:privacy_ww@oracle.com">privacy_ww@oracle.com</a> 联系。</p></td>
-  </tr>
-  <tr>
-    <td>&nbsp;</td>
-    <td>&nbsp;</td>
-  </tr>
-  <tr>
-    <td>&nbsp;</td>
-    <td>&nbsp;</td>
-  </tr>
-</table>
-</body>
-</html>
--- a/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -1,186 +1,189 @@
-# This properties file is used to create a PropertyResourceBundle
-# It contains Locale specific strings used in Swing
-# Currently, the following components need this for support:
-#
-#    ColorChooser
-#    FileChooser
-#    OptionPane
-#
-# When this file is read in, the strings are put into the
-# defaults table.  This is an implementation detail of the current
-# workings of Swing.  DO NOT DEPEND ON THIS.
-# This may change in future versions of Swing as we improve localization
-# support.
-#
-#                        MNEMONIC NOTE:
-# Many of strings in this file are used by widgets that have a
-# mnemonic, for example:
-#   ColorChooser.rgbNameTextAndMnemonic=R&GB
-#
-# Indicates that the tab in the ColorChooser for RGB colors will have
-# the text 'RGB', further the mnemonic character will be 'g' and that
-# a decoration will be provided under the 'G'. This will typically
-# look like:  RGB
-#              -
-#
-# One important thing to remember is that the mnemonic MUST exist in
-# the String, if it does not exist you should add text that makes it
-# exist. This will typically take the form 'XXXX (M)' where M is the
-# character for the mnemonic.
-#
-# @author Steve Wilson
-
-############ FILE CHOOSER STRINGS #############
-FileChooser.fileDescription.textAndMnemonic=Generic File
-FileChooser.directoryDescription.textAndMnemonic=Directory
-FileChooser.newFolderError.textAndMnemonic=Error creating new folder
-FileChooser.newFolderErrorSeparator= :
-FileChooser.newFolderParentDoesntExistTitle.textAndMnemonic=Unable to create folder
-FileChooser.newFolderParentDoesntExist.textAndMnemonic=Unable to create the folder.\n\nThe system cannot find the path specified.
-FileChooser.renameErrorTitle.textAndMnemonic=Error Renaming File or Folder
-FileChooser.renameError.textAndMnemonic=Cannot rename {0}
+# This properties file is used to create a PropertyResourceBundle
+# It contains Locale specific strings used in Swing
+# Currently, the following components need this for support:
+#
+#    ColorChooser
+#    FileChooser
+#    OptionPane
+#
+# When this file is read in, the strings are put into the
+# defaults table.  This is an implementation detail of the current
+# workings of Swing.  DO NOT DEPEND ON THIS.
+# This may change in future versions of Swing as we improve localization
+# support.
+#
+#                        MNEMONIC NOTE:
+# Many of strings in this file are used by widgets that have a
+# mnemonic, for example:
+#   ColorChooser.rgbNameTextAndMnemonic=R&GB
+#
+# Indicates that the tab in the ColorChooser for RGB colors will have
+# the text 'RGB', further the mnemonic character will be 'g' and that
+# a decoration will be provided under the 'G'. This will typically
+# look like:  RGB
+#              -
+#
+# One important thing to remember is that the mnemonic MUST exist in
+# the String, if it does not exist you should add text that makes it
+# exist. This will typically take the form 'XXXX (M)' where M is the
+# character for the mnemonic.
+#
+# @author Steve Wilson
+
+############ FILE CHOOSER STRINGS #############
+FileChooser.fileDescription.textAndMnemonic=Generic File
+FileChooser.directoryDescription.textAndMnemonic=Directory
+FileChooser.newFolderError.textAndMnemonic=Error creating new folder
+FileChooser.newFolderErrorSeparator= :
+FileChooser.newFolderParentDoesntExistTitle.textAndMnemonic=Unable to create folder
+FileChooser.newFolderParentDoesntExist.textAndMnemonic=Unable to create the folder.\n\nThe system cannot find the path specified.
+FileChooser.renameErrorTitle.textAndMnemonic=Error Renaming File or Folder
+FileChooser.renameError.textAndMnemonic=Cannot rename {0}
 FileChooser.renameErrorFileExists.textAndMnemonic=Cannot rename {0}: A file with the name you specified already exists. \
-  Specify a different file name.
-FileChooser.acceptAllFileFilter.textAndMnemonic=All Files
-FileChooser.cancelButton.textAndMnemonic=Cancel
-FileChooser.saveButton.textAndMnemonic=&Save
-FileChooser.openButton.textAndMnemonic=&Open
-FileChooser.saveDialogTitle.textAndMnemonic=Save
-FileChooser.openDialogTitle.textAndMnemonic=Open
-FileChooser.updateButton.textAndMnemonic=&Update
-FileChooser.helpButton.textAndMnemonic=&Help
-FileChooser.directoryOpenButton.textAndMnemonic=&Open
-
-# File Size Units
-FileChooser.fileSizeKiloBytes={0} KB
-FileChooser.fileSizeMegaBytes={0} MB
-FileChooser.fileSizeGigaBytes={0} GB
-
-# These strings are platform dependent not look and feel dependent.
-FileChooser.win32.newFolder=New Folder
-FileChooser.win32.newFolder.subsequent=New Folder ({0})
-FileChooser.other.newFolder=NewFolder
-FileChooser.other.newFolder.subsequent=NewFolder.{0}
-
-
-## file chooser tooltips ###
-FileChooser.cancelButtonToolTip.textAndMnemonic=Abort file chooser dialog
-FileChooser.saveButtonToolTip.textAndMnemonic=Save selected file
-FileChooser.openButtonToolTip.textAndMnemonic=Open selected file
-FileChooser.updateButtonToolTip.textAndMnemonic=Update directory listing
-FileChooser.helpButtonToolTip.textAndMnemonic=FileChooser help
-FileChooser.directoryOpenButtonToolTip.textAndMnemonic=Open selected directory
-
-############ COLOR CHOOSER STRINGS #############
-ColorChooser.preview.textAndMnemonic=Preview
-ColorChooser.ok.textAndMnemonic=OK
-ColorChooser.cancel.textAndMnemonic=Cancel
-ColorChooser.reset.textAndMnemonic=&Reset
-ColorChooser.sample.textAndMnemonic=Sample Text  Sample Text
-ColorChooser.swatches.textAndMnemonic=&Swatches
-ColorChooser.swatchesRecent.textAndMnemonic=Recent:
-ColorChooser.hsv.textAndMnemonic=&HSV
-ColorChooser.hsvHue.textAndMnemonic=Hue
-ColorChooser.hsvSaturation.textAndMnemonic=Saturation
-ColorChooser.hsvValue.textAndMnemonic=Value
-ColorChooser.hsvTransparency.textAndMnemonic=Transparency
-ColorChooser.hsl.textAndMnemonic=HS&L
-ColorChooser.hslHue.textAndMnemonic=Hue
-ColorChooser.hslSaturation.textAndMnemonic=Saturation
-ColorChooser.hslLightness.textAndMnemonic=Lightness
-ColorChooser.hslTransparency.textAndMnemonic=Transparency
-ColorChooser.rgb.textAndMnemonic=R&GB
-ColorChooser.rgbRed.textAndMnemonic=Re&d
-ColorChooser.rgbGreen.textAndMnemonic=Gree&n
-ColorChooser.rgbBlue.textAndMnemonic=&Blue
-ColorChooser.rgbAlpha.textAndMnemonic=Alpha
-ColorChooser.rgbHexCode.textAndMnemonic=&Color Code
-ColorChooser.cmyk.textAndMnemonic=C&MYK
-ColorChooser.cmykCyan.textAndMnemonic=Cyan
-ColorChooser.cmykMagenta.textAndMnemonic=Magenta
-ColorChooser.cmykYellow.textAndMnemonic=Yellow
-ColorChooser.cmykBlack.textAndMnemonic=Black
-ColorChooser.cmykAlpha.textAndMnemonic=Alpha
-
-############ OPTION PANE STRINGS #############
-# We only define mnemonics for YES/NO, but for completeness you can
-# define mnemonics for any of the buttons.
-OptionPane.yesButton.textAndMnemonic=&Yes
-OptionPane.noButton.textAndMnemonic=&No
-OptionPane.okButton.textAndMnemonic=OK
-#OptionPane.okButtonMnemonic=0
-OptionPane.cancelButton.textAndMnemonic=Cancel
-#OptionPane.cancelButtonMnemonic=0
-OptionPane.title.textAndMnemonic=Select an Option
-# Title for the dialog for the showInputDialog methods. Only used if
-# the developer uses one of the variants that doesn't take a title.
-OptionPane.inputDialog.titleAndMnemonic=Input
-# Title for the dialog for the showMessageDialog methods. Only used if
-# the developer uses one of the variants that doesn't take a title.
-OptionPane.messageDialog.titleAndMnemonic=Message
-
-############ Printing Dialog Strings ############
-PrintingDialog.titleProgress.textAndMnemonic=Printing
-PrintingDialog.titleAborting.textAndMnemonic=Printing (Aborting)
-
-PrintingDialog.contentInitial.textAndMnemonic=Printing in progress...
-
-# The following string will be formatted by a MessageFormat
-# and {0} will be replaced by page number being printed
-PrintingDialog.contentProgress.textAndMnemonic=Printed page {0}...
-
-PrintingDialog.contentAborting.textAndMnemonic=Printing aborting...
-
-PrintingDialog.abortButton.textAndMnemonic=&Abort
-PrintingDialog.abortButtonToolTip.textAndMnemonic=Abort Printing
-
-############ Internal Frame Strings ############
-InternalFrame.iconButtonToolTip=Minimize
-InternalFrame.maxButtonToolTip=Maximize
-InternalFrame.restoreButtonToolTip=Restore
-InternalFrame.closeButtonToolTip=Close
-
-############ Internal Frame Title Pane Strings ############
-InternalFrameTitlePane.restoreButton.textAndMnemonic=Restore
-InternalFrameTitlePane.moveButton.textAndMnemonic=Move
-InternalFrameTitlePane.sizeButton.textAndMnemonic=Size
-InternalFrameTitlePane.minimizeButton.textAndMnemonic=Minimize
-InternalFrameTitlePane.maximizeButton.textAndMnemonic=Maximize
-InternalFrameTitlePane.closeButton.textAndMnemonic=Close
-
-############ Text strings #############
-# Used for html forms
-FormView.submitButton.textAndMnemonic=Submit Query
-FormView.resetButton.textAndMnemonic=Reset
-FormView.browseFileButton.textAndMnemonic=Browse...
-
-############ Abstract Document Strings ############
-AbstractDocument.styleChange.textAndMnemonic=style change
-AbstractDocument.addition.textAndMnemonic=addition
-AbstractDocument.deletion.textAndMnemonic=deletion
-AbstractDocument.undo.textAndMnemonic=Undo
-AbstractDocument.redo.textAndMnemonic=Redo
-
-############ Abstract Button Strings ############
-AbstractButton.click.textAndMnemonic=click
-
-############ Abstract Undoable Edit Strings ############
-AbstractUndoableEdit.undo.textAndMnemonic=Undo
-AbstractUndoableEdit.redo.textAndMnemonic=Redo
-
-############ Combo Box Strings ############
-ComboBox.togglePopup.textAndMnemonic=togglePopup
-
-############ Progress Monitor Strings ############
-ProgressMonitor.progress.textAndMnemonic=Progress...
-
-############ Split Pane Strings ############
-SplitPane.leftButton.textAndMnemonic=left button
-SplitPane.rightButton.textAndMnemonic=right button
-# Used for Isindex
-IsindexView.prompt=This is a searchable index.  Enter search keywords:
-
-############ InternalFrameTitlePane Strings ############
-InternalFrameTitlePane.iconifyButtonAccessibleName=Iconify
-InternalFrameTitlePane.maximizeButtonAccessibleName=Maximize
-InternalFrameTitlePane.closeButtonAccessibleName=Close
+  Specify a different file name.
+FileChooser.acceptAllFileFilter.textAndMnemonic=All Files
+FileChooser.cancelButton.textAndMnemonic=Cancel
+FileChooser.saveButton.textAndMnemonic=&Save
+FileChooser.openButton.textAndMnemonic=&Open
+FileChooser.saveDialogTitle.textAndMnemonic=Save
+FileChooser.openDialogTitle.textAndMnemonic=Open
+FileChooser.updateButton.textAndMnemonic=&Update
+FileChooser.helpButton.textAndMnemonic=&Help
+FileChooser.directoryOpenButton.textAndMnemonic=&Open
+
+# File Size Units
+FileChooser.fileSizeKiloBytes={0} KB
+FileChooser.fileSizeMegaBytes={0} MB
+FileChooser.fileSizeGigaBytes={0} GB
+
+# These strings are platform dependent not look and feel dependent.
+FileChooser.win32.newFolder=New Folder
+FileChooser.win32.newFolder.subsequent=New Folder ({0})
+FileChooser.other.newFolder=NewFolder
+FileChooser.other.newFolder.subsequent=NewFolder.{0}
+
+
+## file chooser tooltips ###
+FileChooser.cancelButtonToolTip.textAndMnemonic=Abort file chooser dialog
+FileChooser.saveButtonToolTip.textAndMnemonic=Save selected file
+FileChooser.openButtonToolTip.textAndMnemonic=Open selected file
+FileChooser.updateButtonToolTip.textAndMnemonic=Update directory listing
+FileChooser.helpButtonToolTip.textAndMnemonic=FileChooser help
+FileChooser.directoryOpenButtonToolTip.textAndMnemonic=Open selected directory
+
+FileChooser.filesListAccessibleName=Files List
+FileChooser.filesDetailsAccessibleName=Files Details
+
+############ COLOR CHOOSER STRINGS #############
+ColorChooser.preview.textAndMnemonic=Preview
+ColorChooser.ok.textAndMnemonic=OK
+ColorChooser.cancel.textAndMnemonic=Cancel
+ColorChooser.reset.textAndMnemonic=&Reset
+ColorChooser.sample.textAndMnemonic=Sample Text  Sample Text
+ColorChooser.swatches.textAndMnemonic=&Swatches
+ColorChooser.swatchesRecent.textAndMnemonic=Recent:
+ColorChooser.hsv.textAndMnemonic=&HSV
+ColorChooser.hsvHue.textAndMnemonic=Hue
+ColorChooser.hsvSaturation.textAndMnemonic=Saturation
+ColorChooser.hsvValue.textAndMnemonic=Value
+ColorChooser.hsvTransparency.textAndMnemonic=Transparency
+ColorChooser.hsl.textAndMnemonic=HS&L
+ColorChooser.hslHue.textAndMnemonic=Hue
+ColorChooser.hslSaturation.textAndMnemonic=Saturation
+ColorChooser.hslLightness.textAndMnemonic=Lightness
+ColorChooser.hslTransparency.textAndMnemonic=Transparency
+ColorChooser.rgb.textAndMnemonic=R&GB
+ColorChooser.rgbRed.textAndMnemonic=Re&d
+ColorChooser.rgbGreen.textAndMnemonic=Gree&n
+ColorChooser.rgbBlue.textAndMnemonic=&Blue
+ColorChooser.rgbAlpha.textAndMnemonic=Alpha
+ColorChooser.rgbHexCode.textAndMnemonic=&Color Code
+ColorChooser.cmyk.textAndMnemonic=C&MYK
+ColorChooser.cmykCyan.textAndMnemonic=Cyan
+ColorChooser.cmykMagenta.textAndMnemonic=Magenta
+ColorChooser.cmykYellow.textAndMnemonic=Yellow
+ColorChooser.cmykBlack.textAndMnemonic=Black
+ColorChooser.cmykAlpha.textAndMnemonic=Alpha
+
+############ OPTION PANE STRINGS #############
+# We only define mnemonics for YES/NO, but for completeness you can
+# define mnemonics for any of the buttons.
+OptionPane.yesButton.textAndMnemonic=&Yes
+OptionPane.noButton.textAndMnemonic=&No
+OptionPane.okButton.textAndMnemonic=OK
+#OptionPane.okButtonMnemonic=0
+OptionPane.cancelButton.textAndMnemonic=Cancel
+#OptionPane.cancelButtonMnemonic=0
+OptionPane.title.textAndMnemonic=Select an Option
+# Title for the dialog for the showInputDialog methods. Only used if
+# the developer uses one of the variants that doesn't take a title.
+OptionPane.inputDialog.titleAndMnemonic=Input
+# Title for the dialog for the showMessageDialog methods. Only used if
+# the developer uses one of the variants that doesn't take a title.
+OptionPane.messageDialog.titleAndMnemonic=Message
+
+############ Printing Dialog Strings ############
+PrintingDialog.titleProgress.textAndMnemonic=Printing
+PrintingDialog.titleAborting.textAndMnemonic=Printing (Aborting)
+
+PrintingDialog.contentInitial.textAndMnemonic=Printing in progress...
+
+# The following string will be formatted by a MessageFormat
+# and {0} will be replaced by page number being printed
+PrintingDialog.contentProgress.textAndMnemonic=Printed page {0}...
+
+PrintingDialog.contentAborting.textAndMnemonic=Printing aborting...
+
+PrintingDialog.abortButton.textAndMnemonic=&Abort
+PrintingDialog.abortButtonToolTip.textAndMnemonic=Abort Printing
+
+############ Internal Frame Strings ############
+InternalFrame.iconButtonToolTip=Minimize
+InternalFrame.maxButtonToolTip=Maximize
+InternalFrame.restoreButtonToolTip=Restore
+InternalFrame.closeButtonToolTip=Close
+
+############ Internal Frame Title Pane Strings ############
+InternalFrameTitlePane.restoreButton.textAndMnemonic=Restore
+InternalFrameTitlePane.moveButton.textAndMnemonic=Move
+InternalFrameTitlePane.sizeButton.textAndMnemonic=Size
+InternalFrameTitlePane.minimizeButton.textAndMnemonic=Minimize
+InternalFrameTitlePane.maximizeButton.textAndMnemonic=Maximize
+InternalFrameTitlePane.closeButton.textAndMnemonic=Close
+
+############ Text strings #############
+# Used for html forms
+FormView.submitButton.textAndMnemonic=Submit Query
+FormView.resetButton.textAndMnemonic=Reset
+FormView.browseFileButton.textAndMnemonic=Browse...
+
+############ Abstract Document Strings ############
+AbstractDocument.styleChange.textAndMnemonic=style change
+AbstractDocument.addition.textAndMnemonic=addition
+AbstractDocument.deletion.textAndMnemonic=deletion
+AbstractDocument.undo.textAndMnemonic=Undo
+AbstractDocument.redo.textAndMnemonic=Redo
+
+############ Abstract Button Strings ############
+AbstractButton.click.textAndMnemonic=click
+
+############ Abstract Undoable Edit Strings ############
+AbstractUndoableEdit.undo.textAndMnemonic=Undo
+AbstractUndoableEdit.redo.textAndMnemonic=Redo
+
+############ Combo Box Strings ############
+ComboBox.togglePopup.textAndMnemonic=togglePopup
+
+############ Progress Monitor Strings ############
+ProgressMonitor.progress.textAndMnemonic=Progress...
+
+############ Split Pane Strings ############
+SplitPane.leftButton.textAndMnemonic=left button
+SplitPane.rightButton.textAndMnemonic=right button
+# Used for Isindex
+IsindexView.prompt=This is a searchable index.  Enter search keywords:
+
+############ InternalFrameTitlePane Strings ############
+InternalFrameTitlePane.iconifyButtonAccessibleName=Iconify
+InternalFrameTitlePane.maximizeButtonAccessibleName=Maximize
+InternalFrameTitlePane.closeButtonAccessibleName=Close
--- a/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_de.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_de.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -70,6 +70,9 @@
 FileChooser.helpButtonToolTip.textAndMnemonic=FileChooser-Hilfe
 FileChooser.directoryOpenButtonToolTip.textAndMnemonic=Ausgew\u00E4hltes Verzeichnis \u00F6ffnen
 
+FileChooser.filesListAccessibleName=Dateiliste
+FileChooser.filesDetailsAccessibleName=Dateidetails
+
 ############ COLOR CHOOSER STRINGS #############
 ColorChooser.preview.textAndMnemonic=Vorschau
 ColorChooser.ok.textAndMnemonic=OK
--- a/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_es.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_es.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -70,6 +70,9 @@
 FileChooser.helpButtonToolTip.textAndMnemonic=Ayuda del Selector de Archivos
 FileChooser.directoryOpenButtonToolTip.textAndMnemonic=Abrir directorio seleccionado
 
+FileChooser.filesListAccessibleName=Lista de archivos
+FileChooser.filesDetailsAccessibleName=Detalles de archivos
+
 ############ COLOR CHOOSER STRINGS #############
 ColorChooser.preview.textAndMnemonic=Vista Previa
 ColorChooser.ok.textAndMnemonic=Aceptar
--- a/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_fr.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_fr.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -70,6 +70,9 @@
 FileChooser.helpButtonToolTip.textAndMnemonic=Aide du s\u00E9lecteur de fichiers
 FileChooser.directoryOpenButtonToolTip.textAndMnemonic=Ouvre le r\u00E9pertoire s\u00E9lectionn\u00E9
 
+FileChooser.filesListAccessibleName=Liste des fichiers
+FileChooser.filesDetailsAccessibleName=D\u00E9tails des fichiers
+
 ############ COLOR CHOOSER STRINGS #############
 ColorChooser.preview.textAndMnemonic=Aper\u00E7u
 ColorChooser.ok.textAndMnemonic=OK
--- a/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_it.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_it.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -70,6 +70,9 @@
 FileChooser.helpButtonToolTip.textAndMnemonic=Guida FileChooser
 FileChooser.directoryOpenButtonToolTip.textAndMnemonic=Apre la directory selezionata
 
+FileChooser.filesListAccessibleName=Lista dei file
+FileChooser.filesDetailsAccessibleName=Dettagli file
+
 ############ COLOR CHOOSER STRINGS #############
 ColorChooser.preview.textAndMnemonic=Anteprima
 ColorChooser.ok.textAndMnemonic=OK
--- a/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_ja.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_ja.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -70,6 +70,9 @@
 FileChooser.helpButtonToolTip.textAndMnemonic=FileChooser\u306E\u30D8\u30EB\u30D7\u3067\u3059
 FileChooser.directoryOpenButtonToolTip.textAndMnemonic=\u9078\u629E\u3057\u305F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u958B\u304D\u307E\u3059
 
+FileChooser.filesListAccessibleName=\u30D5\u30A1\u30A4\u30EB\u30FB\u30EA\u30B9\u30C8
+FileChooser.filesDetailsAccessibleName=\u30D5\u30A1\u30A4\u30EB\u306E\u8A73\u7D30
+
 ############ COLOR CHOOSER STRINGS #############
 ColorChooser.preview.textAndMnemonic=\u30D7\u30EC\u30D3\u30E5\u30FC
 ColorChooser.ok.textAndMnemonic=OK
--- a/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_ko.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_ko.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -70,6 +70,9 @@
 FileChooser.helpButtonToolTip.textAndMnemonic=FileChooser \uB3C4\uC6C0\uB9D0
 FileChooser.directoryOpenButtonToolTip.textAndMnemonic=\uC120\uD0DD\uB41C \uB514\uB809\uD1A0\uB9AC \uC5F4\uAE30
 
+FileChooser.filesListAccessibleName=\uD30C\uC77C \uBAA9\uB85D
+FileChooser.filesDetailsAccessibleName=\uD30C\uC77C \uC138\uBD80 \uC815\uBCF4
+
 ############ COLOR CHOOSER STRINGS #############
 ColorChooser.preview.textAndMnemonic=\uBBF8\uB9AC\uBCF4\uAE30
 ColorChooser.ok.textAndMnemonic=\uD655\uC778
--- a/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_pt_BR.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_pt_BR.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -70,6 +70,9 @@
 FileChooser.helpButtonToolTip.textAndMnemonic=Ajuda do FileChooser
 FileChooser.directoryOpenButtonToolTip.textAndMnemonic=Abrir diret\u00F3rio selecionado
 
+FileChooser.filesListAccessibleName=Lista de Arquivos
+FileChooser.filesDetailsAccessibleName=Detalhes do Arquivo
+
 ############ COLOR CHOOSER STRINGS #############
 ColorChooser.preview.textAndMnemonic=Visualizar
 ColorChooser.ok.textAndMnemonic=OK
--- a/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_sv.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_sv.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -70,6 +70,9 @@
 FileChooser.helpButtonToolTip.textAndMnemonic=Hj\u00E4lp - Filv\u00E4ljare
 FileChooser.directoryOpenButtonToolTip.textAndMnemonic=\u00D6ppna vald katalog
 
+FileChooser.filesListAccessibleName=Fillista
+FileChooser.filesDetailsAccessibleName=Fildetaljer
+
 ############ COLOR CHOOSER STRINGS #############
 ColorChooser.preview.textAndMnemonic=Granska
 ColorChooser.ok.textAndMnemonic=OK
--- a/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_zh_CN.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_zh_CN.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -70,6 +70,9 @@
 FileChooser.helpButtonToolTip.textAndMnemonic=FileChooser \u5E2E\u52A9
 FileChooser.directoryOpenButtonToolTip.textAndMnemonic=\u6253\u5F00\u9009\u62E9\u7684\u76EE\u5F55
 
+FileChooser.filesListAccessibleName=\u6587\u4EF6\u5217\u8868
+FileChooser.filesDetailsAccessibleName=\u6587\u4EF6\u8BE6\u7EC6\u4FE1\u606F
+
 ############ COLOR CHOOSER STRINGS #############
 ColorChooser.preview.textAndMnemonic=\u9884\u89C8
 ColorChooser.ok.textAndMnemonic=\u786E\u5B9A
--- a/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_zh_TW.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_zh_TW.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -70,6 +70,9 @@
 FileChooser.helpButtonToolTip.textAndMnemonic=\u300C\u6A94\u6848\u9078\u64C7\u5668\u300D\u8AAA\u660E
 FileChooser.directoryOpenButtonToolTip.textAndMnemonic=\u958B\u555F\u9078\u53D6\u7684\u76EE\u9304
 
+FileChooser.filesListAccessibleName=\u6A94\u6848\u6E05\u55AE
+FileChooser.filesDetailsAccessibleName=\u6A94\u6848\u8A73\u7D30\u8CC7\u8A0A
+
 ############ COLOR CHOOSER STRINGS #############
 ColorChooser.preview.textAndMnemonic=\u9810\u89BD
 ColorChooser.ok.textAndMnemonic=\u78BA\u5B9A
--- a/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=Look In:
+FileChooser.lookInLabel.textAndMnemonic=Look &In:
 FileChooser.saveInLabel.textAndMnemonic=Save In:
-FileChooser.fileNameLabel.textAndMnemonic=File Name:
-FileChooser.folderNameLabel.textAndMnemonic=Folder name:
-FileChooser.filesOfTypeLabel.textAndMnemonic=Files of Type:
+FileChooser.fileNameLabel.textAndMnemonic=File &Name:
+FileChooser.folderNameLabel.textAndMnemonic=Folder &name:
+FileChooser.filesOfTypeLabel.textAndMnemonic=Files of &Type:
 FileChooser.upFolderToolTip.textAndMnemonic=Up One Level
 FileChooser.upFolderAccessibleName=Up
 FileChooser.homeFolderToolTip.textAndMnemonic=Home
--- a/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_de.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_de.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=Suchen in:
+FileChooser.lookInLabel.textAndMnemonic=Suchen &in:
 FileChooser.saveInLabel.textAndMnemonic=Speichern in:
-FileChooser.fileNameLabel.textAndMnemonic=Dateiname:
-FileChooser.folderNameLabel.textAndMnemonic=Ordnername:
-FileChooser.filesOfTypeLabel.textAndMnemonic=Dateityp:
+FileChooser.fileNameLabel.textAndMnemonic=&Dateiname:
+FileChooser.folderNameLabel.textAndMnemonic=Ordner&name:
+FileChooser.filesOfTypeLabel.textAndMnemonic=Datei&typ:
 FileChooser.upFolderToolTip.textAndMnemonic=Eine Ebene h\u00F6her
 FileChooser.upFolderAccessibleName=Nach oben
 FileChooser.homeFolderToolTip.textAndMnemonic=Home
--- a/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_es.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_es.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=Buscar en:
+FileChooser.lookInLabel.textAndMnemonic=&Buscar en:
 FileChooser.saveInLabel.textAndMnemonic=Guardar en:
-FileChooser.fileNameLabel.textAndMnemonic=Nombre de Archivo:
-FileChooser.folderNameLabel.textAndMnemonic=Nombre de la Carpeta:
-FileChooser.filesOfTypeLabel.textAndMnemonic=Archivos de Tipo:
+FileChooser.fileNameLabel.textAndMnemonic=&Nombre de archivo:
+FileChooser.folderNameLabel.textAndMnemonic=&Nombre de carpeta:
+FileChooser.filesOfTypeLabel.textAndMnemonic=Archivos de &tipo:
 FileChooser.upFolderToolTip.textAndMnemonic=Subir un Nivel
 FileChooser.upFolderAccessibleName=Arriba
 FileChooser.homeFolderToolTip.textAndMnemonic=Inicio
--- a/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_fr.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_fr.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=Rechercher dans :
+FileChooser.lookInLabel.textAndMnemonic=Rechercher &dans :
 FileChooser.saveInLabel.textAndMnemonic=Enregistrer dans :
-FileChooser.fileNameLabel.textAndMnemonic=Nom du fichier :
-FileChooser.folderNameLabel.textAndMnemonic=Nom du dossier :
-FileChooser.filesOfTypeLabel.textAndMnemonic=Fichiers de type :
+FileChooser.fileNameLabel.textAndMnemonic=&Nom du fichier :
+FileChooser.folderNameLabel.textAndMnemonic=&Nom du dossier :
+FileChooser.filesOfTypeLabel.textAndMnemonic=&Type de fichier :
 FileChooser.upFolderToolTip.textAndMnemonic=Remonte d'un niveau.
 FileChooser.upFolderAccessibleName=Monter
 FileChooser.homeFolderToolTip.textAndMnemonic=R\u00E9pertoire d'origine
--- a/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_it.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_it.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=Cerca in:
+FileChooser.lookInLabel.textAndMnemonic=Cerca &in:
 FileChooser.saveInLabel.textAndMnemonic=Salva in:
-FileChooser.fileNameLabel.textAndMnemonic=Nome file:
-FileChooser.folderNameLabel.textAndMnemonic=Nome della cartella:
-FileChooser.filesOfTypeLabel.textAndMnemonic=Tipo file:
+FileChooser.fileNameLabel.textAndMnemonic=&Nome file:
+FileChooser.folderNameLabel.textAndMnemonic=&Nome cartella:
+FileChooser.filesOfTypeLabel.textAndMnemonic=&Tipo di file:
 FileChooser.upFolderToolTip.textAndMnemonic=Cartella superiore
 FileChooser.upFolderAccessibleName=Superiore
 FileChooser.homeFolderToolTip.textAndMnemonic=Home
--- a/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_ja.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_ja.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=\u53C2\u7167:
+FileChooser.lookInLabel.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB\u306E\u5834\u6240(&I):
 FileChooser.saveInLabel.textAndMnemonic=\u4FDD\u5B58:
-FileChooser.fileNameLabel.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB\u540D:
-FileChooser.folderNameLabel.textAndMnemonic=\u30D5\u30A9\u30EB\u30C0\u540D:
-FileChooser.filesOfTypeLabel.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB\u306E\u30BF\u30A4\u30D7:
+FileChooser.fileNameLabel.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB\u540D(&N):
+FileChooser.folderNameLabel.textAndMnemonic=\u30D5\u30A9\u30EB\u30C0\u540D(&N):
+FileChooser.filesOfTypeLabel.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB\u306E\u30BF\u30A4\u30D7(&T):
 FileChooser.upFolderToolTip.textAndMnemonic=1\u30EC\u30D9\u30EB\u4E0A\u3078
 FileChooser.upFolderAccessibleName=\u4E0A\u3078
 FileChooser.homeFolderToolTip.textAndMnemonic=\u30DB\u30FC\u30E0
--- a/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_ko.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_ko.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=\uAC80\uC0C9 \uC704\uCE58:
+FileChooser.lookInLabel.textAndMnemonic=\uCC3E\uB294 \uC704\uCE58(&I):
 FileChooser.saveInLabel.textAndMnemonic=\uC800\uC7A5 \uC704\uCE58:
-FileChooser.fileNameLabel.textAndMnemonic=\uD30C\uC77C \uC774\uB984:
-FileChooser.folderNameLabel.textAndMnemonic=\uD3F4\uB354 \uC774\uB984:
-FileChooser.filesOfTypeLabel.textAndMnemonic=\uD30C\uC77C \uC720\uD615:
+FileChooser.fileNameLabel.textAndMnemonic=\uD30C\uC77C \uC774\uB984(&N):
+FileChooser.folderNameLabel.textAndMnemonic=\uD3F4\uB354 \uC774\uB984(&N):
+FileChooser.filesOfTypeLabel.textAndMnemonic=\uD30C\uC77C \uC720\uD615(&T):
 FileChooser.upFolderToolTip.textAndMnemonic=\uD55C \uB808\uBCA8 \uC704\uB85C
 FileChooser.upFolderAccessibleName=\uC704\uB85C
 FileChooser.homeFolderToolTip.textAndMnemonic=\uD648
--- a/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_pt_BR.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_pt_BR.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=Consultar Em:
+FileChooser.lookInLabel.textAndMnemonic=Pesquisar &em:
 FileChooser.saveInLabel.textAndMnemonic=Salvar Em:
-FileChooser.fileNameLabel.textAndMnemonic=Nome do Arquivo:
-FileChooser.folderNameLabel.textAndMnemonic=Nome da pasta:
-FileChooser.filesOfTypeLabel.textAndMnemonic=Arquivos do Tipo:
+FileChooser.fileNameLabel.textAndMnemonic=&Nome do Arquivo:
+FileChooser.folderNameLabel.textAndMnemonic=&Nome da pasta:
+FileChooser.filesOfTypeLabel.textAndMnemonic=Arquivos do &Tipo:
 FileChooser.upFolderToolTip.textAndMnemonic=Um N\u00EDvel Acima
 FileChooser.upFolderAccessibleName=Acima
 FileChooser.homeFolderToolTip.textAndMnemonic=In\u00EDcio
--- a/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_sv.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_sv.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=Leta i:
+FileChooser.lookInLabel.textAndMnemonic=Leta &i:
 FileChooser.saveInLabel.textAndMnemonic=Spara i:
-FileChooser.fileNameLabel.textAndMnemonic=Filnamn:
-FileChooser.folderNameLabel.textAndMnemonic=Mapp:
-FileChooser.filesOfTypeLabel.textAndMnemonic=Filformat:
+FileChooser.fileNameLabel.textAndMnemonic=Fil&namn:
+FileChooser.folderNameLabel.textAndMnemonic=Mapp&namn:
+FileChooser.filesOfTypeLabel.textAndMnemonic=Mapp&namn:
 FileChooser.upFolderToolTip.textAndMnemonic=Upp en niv\u00E5
 FileChooser.upFolderAccessibleName=Upp
 FileChooser.homeFolderToolTip.textAndMnemonic=Hem
--- a/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_zh_CN.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_zh_CN.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=\u67E5\u770B: 
+FileChooser.lookInLabel.textAndMnemonic=\u67E5\u627E(&I):
 FileChooser.saveInLabel.textAndMnemonic=\u4FDD\u5B58: 
-FileChooser.fileNameLabel.textAndMnemonic=\u6587\u4EF6\u540D: 
-FileChooser.folderNameLabel.textAndMnemonic=\u6587\u4EF6\u5939\u540D: 
-FileChooser.filesOfTypeLabel.textAndMnemonic=\u6587\u4EF6\u7C7B\u578B: 
+FileChooser.fileNameLabel.textAndMnemonic=\u6587\u4EF6\u540D(&N):
+FileChooser.folderNameLabel.textAndMnemonic=\u6587\u4EF6\u5939\u540D(&N):
+FileChooser.filesOfTypeLabel.textAndMnemonic=\u6587\u4EF6\u7C7B\u578B(&T):
 FileChooser.upFolderToolTip.textAndMnemonic=\u5411\u4E0A\u4E00\u7EA7
 FileChooser.upFolderAccessibleName=\u5411\u4E0A
 FileChooser.homeFolderToolTip.textAndMnemonic=\u4E3B\u76EE\u5F55
@@ -33,9 +33,9 @@
 FileChooser.listViewButtonToolTip.textAndMnemonic=\u5217\u8868
 FileChooser.listViewButtonAccessibleName=\u5217\u8868
 FileChooser.listViewActionLabel.textAndMnemonic=\u5217\u8868
-FileChooser.detailsViewButtonToolTip.textAndMnemonic=\u8BE6\u7EC6\u8D44\u6599
-FileChooser.detailsViewButtonAccessibleName=\u8BE6\u7EC6\u8D44\u6599
-FileChooser.detailsViewActionLabel.textAndMnemonic=\u8BE6\u7EC6\u8D44\u6599
+FileChooser.detailsViewButtonToolTip.textAndMnemonic=\u8BE6\u7EC6\u4FE1\u606F
+FileChooser.detailsViewButtonAccessibleName=\u8BE6\u7EC6\u4FE1\u606F
+FileChooser.detailsViewActionLabel.textAndMnemonic=\u8BE6\u7EC6\u4FE1\u606F
 FileChooser.refreshActionLabel.textAndMnemonic=\u5237\u65B0
 FileChooser.viewMenuLabel.textAndMnemonic=\u89C6\u56FE
 FileChooser.fileNameHeader.textAndMnemonic=\u540D\u79F0
--- a/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_zh_TW.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_zh_TW.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=\u67E5\u8A62:
+FileChooser.lookInLabel.textAndMnemonic=\u67E5\u8A62(&I):
 FileChooser.saveInLabel.textAndMnemonic=\u5132\u5B58\u65BC: 
-FileChooser.fileNameLabel.textAndMnemonic=\u6A94\u6848\u540D\u7A31:
-FileChooser.folderNameLabel.textAndMnemonic=\u8CC7\u6599\u593E\u540D\u7A31:
-FileChooser.filesOfTypeLabel.textAndMnemonic=\u6A94\u6848\u985E\u578B:
+FileChooser.fileNameLabel.textAndMnemonic=\u6A94\u6848\u540D\u7A31(&N):
+FileChooser.folderNameLabel.textAndMnemonic=\u8CC7\u6599\u593E\u540D\u7A31(&N):
+FileChooser.filesOfTypeLabel.textAndMnemonic=\u6A94\u6848\u985E\u578B(&T):
 FileChooser.upFolderToolTip.textAndMnemonic=\u5F80\u4E0A\u4E00\u5C64
 FileChooser.upFolderAccessibleName=\u5F80\u4E0A
 FileChooser.homeFolderToolTip.textAndMnemonic=\u4E3B\u76EE\u9304
--- a/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=Look In:
+FileChooser.lookInLabel.textAndMnemonic=Look &In:
 FileChooser.saveInLabel.textAndMnemonic=Save In:
-FileChooser.fileNameLabel.textAndMnemonic=File Name:
-FileChooser.folderNameLabel.textAndMnemonic=Folder name:
-FileChooser.filesOfTypeLabel.textAndMnemonic=Files of Type:
+FileChooser.fileNameLabel.textAndMnemonic=File &Name:
+FileChooser.folderNameLabel.textAndMnemonic=Folder &Name:
+FileChooser.filesOfTypeLabel.textAndMnemonic=Files of &Type:
 FileChooser.upFolderToolTip.textAndMnemonic=Up One Level
 FileChooser.upFolderAccessibleName=Up
 FileChooser.homeFolderToolTip.textAndMnemonic=Home
--- a/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_de.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_de.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=Suchen in:
+FileChooser.lookInLabel.textAndMnemonic=Suchen &in:
 FileChooser.saveInLabel.textAndMnemonic=Speichern in:
-FileChooser.fileNameLabel.textAndMnemonic=Dateiname:
-FileChooser.folderNameLabel.textAndMnemonic=Ordnername:
-FileChooser.filesOfTypeLabel.textAndMnemonic=Dateityp:
+FileChooser.fileNameLabel.textAndMnemonic=&Dateiname:
+FileChooser.folderNameLabel.textAndMnemonic=&Ordnername:
+FileChooser.filesOfTypeLabel.textAndMnemonic=Datei&typ:
 FileChooser.upFolderToolTip.textAndMnemonic=Eine Ebene h\u00F6her
 FileChooser.upFolderAccessibleName=Nach oben
 FileChooser.homeFolderToolTip.textAndMnemonic=Home
--- a/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_es.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_es.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=Buscar en:
+FileChooser.lookInLabel.textAndMnemonic=&Buscar en:
 FileChooser.saveInLabel.textAndMnemonic=Guardar en:
-FileChooser.fileNameLabel.textAndMnemonic=Nombre de Archivo:
-FileChooser.folderNameLabel.textAndMnemonic=Nombre de la Carpeta:
-FileChooser.filesOfTypeLabel.textAndMnemonic=Archivos de Tipo:
+FileChooser.fileNameLabel.textAndMnemonic=&Nombre de archivo:
+FileChooser.folderNameLabel.textAndMnemonic=&Nombre de carpeta:
+FileChooser.filesOfTypeLabel.textAndMnemonic=Archivos de &tipo:
 FileChooser.upFolderToolTip.textAndMnemonic=Subir un Nivel
 FileChooser.upFolderAccessibleName=Arriba
 FileChooser.homeFolderToolTip.textAndMnemonic=Inicio
--- a/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_fr.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_fr.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=Rechercher dans :
+FileChooser.lookInLabel.textAndMnemonic=Rechercher &dans :
 FileChooser.saveInLabel.textAndMnemonic=Enregistrer dans :
-FileChooser.fileNameLabel.textAndMnemonic=Nom du fichier :
-FileChooser.folderNameLabel.textAndMnemonic=Nom du dossier :
-FileChooser.filesOfTypeLabel.textAndMnemonic=Fichiers de type :
+FileChooser.fileNameLabel.textAndMnemonic=&Nom du fichier :
+FileChooser.folderNameLabel.textAndMnemonic=&Nom du dossier :
+FileChooser.filesOfTypeLabel.textAndMnemonic=&Type de fichier :
 FileChooser.upFolderToolTip.textAndMnemonic=Remonte d'un niveau.
 FileChooser.upFolderAccessibleName=Monter
 FileChooser.homeFolderToolTip.textAndMnemonic=R\u00E9pertoire d'origine
--- a/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_it.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_it.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=Cerca in:
+FileChooser.lookInLabel.textAndMnemonic=Cerca &in:
 FileChooser.saveInLabel.textAndMnemonic=Salva in:
-FileChooser.fileNameLabel.textAndMnemonic=Nome file:
-FileChooser.folderNameLabel.textAndMnemonic=Nome della cartella:
-FileChooser.filesOfTypeLabel.textAndMnemonic=Tipo file:
+FileChooser.fileNameLabel.textAndMnemonic=&Nome file:
+FileChooser.folderNameLabel.textAndMnemonic=&Nome cartella:
+FileChooser.filesOfTypeLabel.textAndMnemonic=&Tipo di file:
 FileChooser.upFolderToolTip.textAndMnemonic=Cartella superiore
 FileChooser.upFolderAccessibleName=Superiore
 FileChooser.homeFolderToolTip.textAndMnemonic=Home
--- a/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_ja.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_ja.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=\u53C2\u7167:
+FileChooser.lookInLabel.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB\u306E\u5834\u6240(&I):
 FileChooser.saveInLabel.textAndMnemonic=\u4FDD\u5B58:
-FileChooser.fileNameLabel.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB\u540D:
-FileChooser.folderNameLabel.textAndMnemonic=\u30D5\u30A9\u30EB\u30C0\u540D:
-FileChooser.filesOfTypeLabel.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB\u306E\u30BF\u30A4\u30D7:
+FileChooser.fileNameLabel.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB\u540D(&N):
+FileChooser.folderNameLabel.textAndMnemonic=\u30D5\u30A9\u30EB\u30C0\u540D(&N):
+FileChooser.filesOfTypeLabel.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB\u306E\u30BF\u30A4\u30D7(&T):
 FileChooser.upFolderToolTip.textAndMnemonic=1\u30EC\u30D9\u30EB\u4E0A\u3078
 FileChooser.upFolderAccessibleName=\u4E0A\u3078
 FileChooser.homeFolderToolTip.textAndMnemonic=\u30DB\u30FC\u30E0
--- a/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_ko.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_ko.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=\uAC80\uC0C9 \uC704\uCE58:
+FileChooser.lookInLabel.textAndMnemonic=\uCC3E\uB294 \uC704\uCE58(&I):
 FileChooser.saveInLabel.textAndMnemonic=\uC800\uC7A5 \uC704\uCE58:
-FileChooser.fileNameLabel.textAndMnemonic=\uD30C\uC77C \uC774\uB984:
-FileChooser.folderNameLabel.textAndMnemonic=\uD3F4\uB354 \uC774\uB984:
-FileChooser.filesOfTypeLabel.textAndMnemonic=\uD30C\uC77C \uC720\uD615:
+FileChooser.fileNameLabel.textAndMnemonic=\uD30C\uC77C \uC774\uB984(&N):
+FileChooser.folderNameLabel.textAndMnemonic=\uD3F4\uB354 \uC774\uB984(&N):
+FileChooser.filesOfTypeLabel.textAndMnemonic=\uD30C\uC77C \uC720\uD615(&T):
 FileChooser.upFolderToolTip.textAndMnemonic=\uD55C \uB808\uBCA8 \uC704\uB85C
 FileChooser.upFolderAccessibleName=\uC704\uB85C
 FileChooser.homeFolderToolTip.textAndMnemonic=\uD648
--- a/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_pt_BR.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_pt_BR.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=Consultar Em:
+FileChooser.lookInLabel.textAndMnemonic=Pesquisar &em:
 FileChooser.saveInLabel.textAndMnemonic=Salvar Em:
-FileChooser.fileNameLabel.textAndMnemonic=Nome do Arquivo:
-FileChooser.folderNameLabel.textAndMnemonic=Nome da pasta:
-FileChooser.filesOfTypeLabel.textAndMnemonic=Arquivos do Tipo:
+FileChooser.fileNameLabel.textAndMnemonic=&Nome do Arquivo:
+FileChooser.folderNameLabel.textAndMnemonic=&Nome da Pasta:
+FileChooser.filesOfTypeLabel.textAndMnemonic=Arquivos do &Tipo:
 FileChooser.upFolderToolTip.textAndMnemonic=Um N\u00EDvel Acima
 FileChooser.upFolderAccessibleName=Acima
 FileChooser.homeFolderToolTip.textAndMnemonic=In\u00EDcio
--- a/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_sv.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_sv.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=Leta i:
+FileChooser.lookInLabel.textAndMnemonic=Leta &i:
 FileChooser.saveInLabel.textAndMnemonic=Spara i:
-FileChooser.fileNameLabel.textAndMnemonic=Filnamn:
-FileChooser.folderNameLabel.textAndMnemonic=Mapp:
-FileChooser.filesOfTypeLabel.textAndMnemonic=Filformat:
+FileChooser.fileNameLabel.textAndMnemonic=Fil&namn:
+FileChooser.folderNameLabel.textAndMnemonic=Mapp&namn:
+FileChooser.filesOfTypeLabel.textAndMnemonic=Filer av &typ:
 FileChooser.upFolderToolTip.textAndMnemonic=Upp en niv\u00E5
 FileChooser.upFolderAccessibleName=Upp
 FileChooser.homeFolderToolTip.textAndMnemonic=Hem
--- a/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_zh_CN.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_zh_CN.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=\u67E5\u770B: 
+FileChooser.lookInLabel.textAndMnemonic=\u67E5\u627E(&I):
 FileChooser.saveInLabel.textAndMnemonic=\u4FDD\u5B58: 
-FileChooser.fileNameLabel.textAndMnemonic=\u6587\u4EF6\u540D: 
-FileChooser.folderNameLabel.textAndMnemonic=\u6587\u4EF6\u5939\u540D: 
-FileChooser.filesOfTypeLabel.textAndMnemonic=\u6587\u4EF6\u7C7B\u578B: 
+FileChooser.fileNameLabel.textAndMnemonic=\u6587\u4EF6\u540D(&N):
+FileChooser.folderNameLabel.textAndMnemonic=\u6587\u4EF6\u5939\u540D(&N):
+FileChooser.filesOfTypeLabel.textAndMnemonic=\u6587\u4EF6\u7C7B\u578B(&T):
 FileChooser.upFolderToolTip.textAndMnemonic=\u5411\u4E0A\u4E00\u7EA7
 FileChooser.upFolderAccessibleName=\u5411\u4E0A
 FileChooser.homeFolderToolTip.textAndMnemonic=\u4E3B\u76EE\u5F55
@@ -33,9 +33,9 @@
 FileChooser.listViewButtonToolTip.textAndMnemonic=\u5217\u8868
 FileChooser.listViewButtonAccessibleName=\u5217\u8868
 FileChooser.listViewActionLabel.textAndMnemonic=\u5217\u8868
-FileChooser.detailsViewButtonToolTip.textAndMnemonic=\u8BE6\u7EC6\u8D44\u6599
-FileChooser.detailsViewButtonAccessibleName=\u8BE6\u7EC6\u8D44\u6599
-FileChooser.detailsViewActionLabel.textAndMnemonic=\u8BE6\u7EC6\u8D44\u6599
+FileChooser.detailsViewButtonToolTip.textAndMnemonic=\u8BE6\u7EC6\u4FE1\u606F
+FileChooser.detailsViewButtonAccessibleName=\u8BE6\u7EC6\u4FE1\u606F
+FileChooser.detailsViewActionLabel.textAndMnemonic=\u8BE6\u7EC6\u4FE1\u606F
 FileChooser.refreshActionLabel.textAndMnemonic=\u5237\u65B0
 FileChooser.viewMenuLabel.textAndMnemonic=\u89C6\u56FE
 FileChooser.fileNameHeader.textAndMnemonic=\u540D\u79F0
--- a/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_zh_TW.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_zh_TW.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=\u67E5\u8A62:
+FileChooser.lookInLabel.textAndMnemonic=\u67E5\u8A62(&I):
 FileChooser.saveInLabel.textAndMnemonic=\u5132\u5B58\u65BC: 
-FileChooser.fileNameLabel.textAndMnemonic=\u6A94\u6848\u540D\u7A31:
-FileChooser.folderNameLabel.textAndMnemonic=\u8CC7\u6599\u593E\u540D\u7A31:
-FileChooser.filesOfTypeLabel.textAndMnemonic=\u6A94\u6848\u985E\u578B:
+FileChooser.fileNameLabel.textAndMnemonic=\u6A94\u6848\u540D\u7A31(&N):
+FileChooser.folderNameLabel.textAndMnemonic=\u8CC7\u6599\u593E\u540D\u7A31(&N):
+FileChooser.filesOfTypeLabel.textAndMnemonic=\u6A94\u6848\u985E\u578B(&T):
 FileChooser.upFolderToolTip.textAndMnemonic=\u5F80\u4E0A\u4E00\u5C64
 FileChooser.upFolderAccessibleName=\u5F80\u4E0A
 FileChooser.homeFolderToolTip.textAndMnemonic=\u4E3B\u76EE\u9304
--- a/src/share/classes/com/sun/tools/example/debug/tty/TTYResources_ja.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/tools/example/debug/tty/TTYResources_ja.java	Fri Jun 21 19:11:42 2013 -0700
@@ -201,7 +201,7 @@
         {"No class named", "\u540D\u524D''{0}''\u306E\u30AF\u30E9\u30B9\u304C\u3042\u308A\u307E\u305B\u3093"},
         {"No class specified.", "\u30AF\u30E9\u30B9\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"},
         {"No classpath specified.", "\u30AF\u30E9\u30B9\u30D1\u30B9\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"},
-        {"No code at line", "{1}\u306E\u884C{0,number,integer}\u306B\u30B3\u30FC\u30C9\u304C\u3042\u308A\u307E\u305B\u3093"},
+        {"No code at line", "\u884C{0,number,integer} ({1}\u5185)\u306B\u30B3\u30FC\u30C9\u304C\u3042\u308A\u307E\u305B\u3093"},
         {"No connect specification.", "\u63A5\u7D9A\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"},
         {"No connector named:", "\u540D\u524D{0}\u306E\u30B3\u30CD\u30AF\u30BF\u304C\u3042\u308A\u307E\u305B\u3093"},
         {"No current thread", "\u73FE\u5728\u306E\u30B9\u30EC\u30C3\u30C9\u304C\u3042\u308A\u307E\u305B\u3093"},
--- a/src/share/classes/com/sun/tools/example/debug/tty/TTYResources_zh_CN.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/com/sun/tools/example/debug/tty/TTYResources_zh_CN.java	Fri Jun 21 19:11:42 2013 -0700
@@ -325,7 +325,7 @@
         {"watch accesses of", "\u76D1\u89C6{0}.{1}\u7684\u8BBF\u95EE"},
         {"watch modification of", "\u76D1\u89C6{0}.{1}\u7684\u4FEE\u6539"},
         {"zz help text",
-             "** \u547D\u4EE4\u5217\u8868 **\nconnectors                -- \u5217\u51FA\u6B64 VM \u4E2D\u53EF\u7528\u7684\u8FDE\u63A5\u5668\u548C\u4F20\u8F93\n\nrun [class [args]]        -- \u5F00\u59CB\u6267\u884C\u5E94\u7528\u7A0B\u5E8F\u7684\u4E3B\u7C7B\n\nthreads [threadgroup]     -- \u5217\u51FA\u7EBF\u7A0B\nthread <thread id>        -- \u8BBE\u7F6E\u9ED8\u8BA4\u7EBF\u7A0B\nsuspend [thread id(s)]    -- \u6302\u8D77\u7EBF\u7A0B (\u9ED8\u8BA4\u503C: all)\nresume [thread id(s)]     -- \u6062\u590D\u7EBF\u7A0B (\u9ED8\u8BA4\u503C: all)\nwhere [<thread id> | all] -- \u8F6C\u50A8\u7EBF\u7A0B\u7684\u5806\u6808\nwherei [<thread id> | all]-- \u8F6C\u50A8\u7EBF\u7A0B\u7684\u5806\u6808, \u4EE5\u53CA pc \u4FE1\u606F\nup [n frames]             -- \u4E0A\u79FB\u7EBF\u7A0B\u7684\u5806\u6808\ndown [n frames]           -- \u4E0B\u79FB\u7EBF\u7A0B\u7684\u5806\u6808\nkill <thread id> <expr>   -- \u7EC8\u6B62\u5177\u6709\u7ED9\u5B9A\u7684\u5F02\u5E38\u9519\u8BEF\u5BF9\u8C61\u7684\u7EBF\u7A0B\ninterrupt <thread id>     -- \u4E2D\u65AD\u7EBF\u7A0B\n\nprint <expr>              -- \u8F93\u51FA\u8868\u8FBE\u5F0F\u7684\u503C\ndump <expr>               -- \u8F93\u51FA\u6240\u6709\u5BF9\u8C61\u4FE1\u606F\neval <expr>               -- \u5BF9\u8868\u8FBE\u5F0F\u6C42\u503C (\u4E0E print \u76F8\u540C)\nset <lvalue> = <expr>     -- \u5411\u5B57\u6BB5/\u53D8\u91CF/\u6570\u7EC4\u5143\u7D20\u5206\u914D\u65B0\u503C\nlocals                    -- \u8F93\u51FA\u5F53\u524D\u5806\u6808\u5E27\u4E2D\u7684\u6240\u6709\u672C\u5730\u53D8\u91CF\n\nclasses                   -- \u5217\u51FA\u5F53\u524D\u5DF2\u77E5\u7684\u7C7B\nclass <class id>          -- \u663E\u793A\u5DF2\u547D\u540D\u7C7B\u7684\u8BE6\u7EC6\u8D44\u6599\nmethods <class id>        -- \u5217\u51FA\u7C7B\u7684\u65B9\u6CD5\nfields <class id>         -- \u5217\u51FA\u7C7B\u7684\u5B57\u6BB5\n\nthreadgroups              -- \u5217\u51FA\u7EBF\u7A0B\u7EC4\nthreadgroup <name>        -- \u8BBE\u7F6E\u5F53\u524D\u7EBF\u7A0B\u7EC4\n\nstop in <class id>.<method>[(argument_type,...)]\n                          -- \u5728\u65B9\u6CD5\u4E2D\u8BBE\u7F6E\u65AD\u70B9\nstop at <class id>:<line> -- \u5728\u884C\u4E2D\u8BBE\u7F6E\u65AD\u70B9\nclear <class id>.<method>[(argument_type,...)]\n                          -- \u6E05\u9664\u65B9\u6CD5\u4E2D\u7684\u65AD\u70B9\nclear <class id>:<line>   -- \u6E05\u9664\u884C\u4E2D\u7684\u65AD\u70B9\nclear                     -- \u5217\u51FA\u65AD\u70B9\ncatch [uncaught|caught|all] <class id>|<class pattern>\n                          -- \u51FA\u73B0\u6307\u5B9A\u7684\u5F02\u5E38\u9519\u8BEF\u65F6\u4E2D\u65AD\nignore [uncaught|caught|all] <class id>|<class pattern>\n                          -- \u5BF9\u4E8E\u6307\u5B9A\u7684\u5F02\u5E38\u9519\u8BEF, \u53D6\u6D88 'catch'\nwatch [access|all] <class id>.<field name>\n                          -- \u76D1\u89C6\u5BF9\u5B57\u6BB5\u7684\u8BBF\u95EE/\u4FEE\u6539\nunwatch [access|all] <class id>.<field name>\n                          -- \u505C\u6B62\u76D1\u89C6\u5BF9\u5B57\u6BB5\u7684\u8BBF\u95EE/\u4FEE\u6539\ntrace [go] methods [thread]\n                          -- \u8DDF\u8E2A\u65B9\u6CD5\u8FDB\u5165\u548C\u9000\u51FA\u3002\n                          -- \u9664\u975E\u6307\u5B9A 'go', \u5426\u5219\u6302\u8D77\u6240\u6709\u7EBF\u7A0B\ntrace [go] method exit | exits [thread]\n                          -- \u8DDF\u8E2A\u5F53\u524D\u65B9\u6CD5\u7684\u9000\u51FA, \u6216\u8005\u6240\u6709\u65B9\u6CD5\u7684\u9000\u51FA\n                          -- \u9664\u975E\u6307\u5B9A 'go', \u5426\u5219\u6302\u8D77\u6240\u6709\u7EBF\u7A0B\nuntrace [methods]         -- \u505C\u6B62\u8DDF\u8E2A\u65B9\u6CD5\u8FDB\u5165\u548C/\u6216\u9000\u51FA\nstep                      -- \u6267\u884C\u5F53\u524D\u884C\nstep up                   -- \u4E00\u76F4\u6267\u884C, \u76F4\u5230\u5F53\u524D\u65B9\u6CD5\u8FD4\u56DE\u5230\u5176\u8C03\u7528\u65B9\nstepi                     -- \u6267\u884C\u5F53\u524D\u6307\u4EE4\nnext                      -- \u6B65\u8FDB\u4E00\u884C (\u6B65\u8FC7\u8C03\u7528)\ncont                      -- \u4ECE\u65AD\u70B9\u5904\u7EE7\u7EED\u6267\u884C\n\nlist [line number|method] -- \u8F93\u51FA\u6E90\u4EE3\u7801\nuse (\u6216 sourcepath) [source file path]\n                          -- \u663E\u793A\u6216\u66F4\u6539\u6E90\u8DEF\u5F84\nexclude [<class pattern>, ... | \"none\"]\n                          -- \u5BF9\u4E8E\u6307\u5B9A\u7684\u7C7B, \u4E0D\u62A5\u544A\u6B65\u9AA4\u6216\u65B9\u6CD5\u4E8B\u4EF6\nclasspath                 -- \u4ECE\u76EE\u6807 VM \u8F93\u51FA\u7C7B\u8DEF\u5F84\u4FE1\u606F\n\nmonitor <command>         -- \u6BCF\u6B21\u7A0B\u5E8F\u505C\u6B62\u65F6\u6267\u884C\u547D\u4EE4\nmonitor                   -- \u5217\u51FA\u76D1\u89C6\u5668\nunmonitor <monitor#>      -- \u5220\u9664\u76D1\u89C6\u5668\nread <filename>           -- \u8BFB\u53D6\u5E76\u6267\u884C\u547D\u4EE4\u6587\u4EF6\n\nlock <expr>               -- \u8F93\u51FA\u5BF9\u8C61\u7684\u9501\u4FE1\u606F\nthreadlocks [thread id]   -- \u8F93\u51FA\u7EBF\u7A0B\u7684\u9501\u4FE1\u606F\n\npop                       -- \u901A\u8FC7\u5F53\u524D\u5E27\u51FA\u6808, \u4E14\u5305\u542B\u5F53\u524D\u5E27\nreenter                   -- \u4E0E pop \u76F8\u540C, \u4F46\u91CD\u65B0\u8FDB\u5165\u5F53\u524D\u5E27\nredefine <class id> <class file name>\n                          -- \u91CD\u65B0\u5B9A\u4E49\u7C7B\u7684\u4EE3\u7801\n\ndisablegc <expr>          -- \u7981\u6B62\u5BF9\u8C61\u7684\u5783\u573E\u6536\u96C6\nenablegc <expr>           -- \u5141\u8BB8\u5BF9\u8C61\u7684\u5783\u573E\u6536\u96C6\n\n!!                        -- \u91CD\u590D\u6267\u884C\u6700\u540E\u4E00\u4E2A\u547D\u4EE4\n<n> <command>             -- \u5C06\u547D\u4EE4\u91CD\u590D\u6267\u884C n \u6B21\n# <command>               -- \u653E\u5F03 (\u65E0\u64CD\u4F5C)\nhelp (\u6216 ?)               -- \u5217\u51FA\u547D\u4EE4\nversion                   -- \u8F93\u51FA\u7248\u672C\u4FE1\u606F\nexit (\u6216 quit)            -- \u9000\u51FA\u8C03\u8BD5\u5668\n\n<class id>: \u5E26\u6709\u7A0B\u5E8F\u5305\u9650\u5B9A\u7B26\u7684\u5B8C\u6574\u7C7B\u540D\n<class pattern>: \u5E26\u6709\u524D\u5BFC\u6216\u5C3E\u968F\u901A\u914D\u7B26 ('*') \u7684\u7C7B\u540D\n<thread id>: 'threads' \u547D\u4EE4\u4E2D\u62A5\u544A\u7684\u7EBF\u7A0B\u7F16\u53F7\n<expr>: Java(TM) \u7F16\u7A0B\u8BED\u8A00\u8868\u8FBE\u5F0F\u3002\n\u652F\u6301\u5927\u591A\u6570\u5E38\u89C1\u8BED\u6CD5\u3002\n\n\u53EF\u4EE5\u5C06\u542F\u52A8\u547D\u4EE4\u7F6E\u4E8E \"jdb.ini\" \u6216 \".jdbrc\" \u4E2D\n\u4F4D\u4E8E user.home \u6216 user.dir \u4E2D"},
+             "** \u547D\u4EE4\u5217\u8868 **\nconnectors                -- \u5217\u51FA\u6B64 VM \u4E2D\u53EF\u7528\u7684\u8FDE\u63A5\u5668\u548C\u4F20\u8F93\n\nrun [class [args]]        -- \u5F00\u59CB\u6267\u884C\u5E94\u7528\u7A0B\u5E8F\u7684\u4E3B\u7C7B\n\nthreads [threadgroup]     -- \u5217\u51FA\u7EBF\u7A0B\nthread <thread id>        -- \u8BBE\u7F6E\u9ED8\u8BA4\u7EBF\u7A0B\nsuspend [thread id(s)]    -- \u6302\u8D77\u7EBF\u7A0B (\u9ED8\u8BA4\u503C: all)\nresume [thread id(s)]     -- \u6062\u590D\u7EBF\u7A0B (\u9ED8\u8BA4\u503C: all)\nwhere [<thread id> | all] -- \u8F6C\u50A8\u7EBF\u7A0B\u7684\u5806\u6808\nwherei [<thread id> | all]-- \u8F6C\u50A8\u7EBF\u7A0B\u7684\u5806\u6808, \u4EE5\u53CA pc \u4FE1\u606F\nup [n frames]             -- \u4E0A\u79FB\u7EBF\u7A0B\u7684\u5806\u6808\ndown [n frames]           -- \u4E0B\u79FB\u7EBF\u7A0B\u7684\u5806\u6808\nkill <thread id> <expr>   -- \u7EC8\u6B62\u5177\u6709\u7ED9\u5B9A\u7684\u5F02\u5E38\u9519\u8BEF\u5BF9\u8C61\u7684\u7EBF\u7A0B\ninterrupt <thread id>     -- \u4E2D\u65AD\u7EBF\u7A0B\n\nprint <expr>              -- \u8F93\u51FA\u8868\u8FBE\u5F0F\u7684\u503C\ndump <expr>               -- \u8F93\u51FA\u6240\u6709\u5BF9\u8C61\u4FE1\u606F\neval <expr>               -- \u5BF9\u8868\u8FBE\u5F0F\u6C42\u503C (\u4E0E print \u76F8\u540C)\nset <lvalue> = <expr>     -- \u5411\u5B57\u6BB5/\u53D8\u91CF/\u6570\u7EC4\u5143\u7D20\u5206\u914D\u65B0\u503C\nlocals                    -- \u8F93\u51FA\u5F53\u524D\u5806\u6808\u5E27\u4E2D\u7684\u6240\u6709\u672C\u5730\u53D8\u91CF\n\nclasses                   -- \u5217\u51FA\u5F53\u524D\u5DF2\u77E5\u7684\u7C7B\nclass <class id>          -- \u663E\u793A\u5DF2\u547D\u540D\u7C7B\u7684\u8BE6\u7EC6\u8D44\u6599\nmethods <class id>        -- \u5217\u51FA\u7C7B\u7684\u65B9\u6CD5\nfields <class id>         -- \u5217\u51FA\u7C7B\u7684\u5B57\u6BB5\n\nthreadgroups              -- \u5217\u51FA\u7EBF\u7A0B\u7EC4\nthreadgroup <name>        -- \u8BBE\u7F6E\u5F53\u524D\u7EBF\u7A0B\u7EC4\n\nstop in <class id>.<method>[(argument_type,...)]\n                          -- \u5728\u65B9\u6CD5\u4E2D\u8BBE\u7F6E\u65AD\u70B9\nstop at <class id>:<line> -- \u5728\u884C\u4E2D\u8BBE\u7F6E\u65AD\u70B9\nclear <class id>.<method>[(argument_type,...)]\n                          -- \u6E05\u9664\u65B9\u6CD5\u4E2D\u7684\u65AD\u70B9\nclear <class id>:<line>   -- \u6E05\u9664\u884C\u4E2D\u7684\u65AD\u70B9\nclear                     -- \u5217\u51FA\u65AD\u70B9\ncatch [uncaught|caught|all] <class id>|<class pattern>\n                          -- \u51FA\u73B0\u6307\u5B9A\u7684\u5F02\u5E38\u9519\u8BEF\u65F6\u4E2D\u65AD\nignore [uncaught|caught|all] <class id>|<class pattern>\n                          -- \u5BF9\u4E8E\u6307\u5B9A\u7684\u5F02\u5E38\u9519\u8BEF, \u53D6\u6D88 'catch'\nwatch [access|all] <class id>.<field name>\n                          -- \u76D1\u89C6\u5BF9\u5B57\u6BB5\u7684\u8BBF\u95EE/\u4FEE\u6539\nunwatch [access|all] <class id>.<field name>\n                          -- \u505C\u6B62\u76D1\u89C6\u5BF9\u5B57\u6BB5\u7684\u8BBF\u95EE/\u4FEE\u6539\ntrace [go] methods [thread]\n                          -- \u8DDF\u8E2A\u65B9\u6CD5\u8FDB\u5165\u548C\u9000\u51FA\u3002\n                          -- \u9664\u975E\u6307\u5B9A 'go', \u5426\u5219\u6302\u8D77\u6240\u6709\u7EBF\u7A0B\ntrace [go] method exit | exits [thread]\n                          -- \u8DDF\u8E2A\u5F53\u524D\u65B9\u6CD5\u7684\u9000\u51FA, \u6216\u8005\u6240\u6709\u65B9\u6CD5\u7684\u9000\u51FA\n                          -- \u9664\u975E\u6307\u5B9A 'go', \u5426\u5219\u6302\u8D77\u6240\u6709\u7EBF\u7A0B\nuntrace [methods]         -- \u505C\u6B62\u8DDF\u8E2A\u65B9\u6CD5\u8FDB\u5165\u548C/\u6216\u9000\u51FA\nstep                      -- \u6267\u884C\u5F53\u524D\u884C\nstep up                   -- \u4E00\u76F4\u6267\u884C, \u76F4\u5230\u5F53\u524D\u65B9\u6CD5\u8FD4\u56DE\u5230\u5176\u8C03\u7528\u65B9\nstepi                     -- \u6267\u884C\u5F53\u524D\u6307\u4EE4\n\u4E0B\u4E00\u6B65                      -- \u6B65\u8FDB\u4E00\u884C (\u6B65\u8FC7\u8C03\u7528)\ncont                      -- \u4ECE\u65AD\u70B9\u5904\u7EE7\u7EED\u6267\u884C\n\nlist [line number|method] -- \u8F93\u51FA\u6E90\u4EE3\u7801\nuse (\u6216 sourcepath) [source file path]\n                          -- \u663E\u793A\u6216\u66F4\u6539\u6E90\u8DEF\u5F84\nexclude [<class pattern>, ... | \"none\"]\n                          -- \u5BF9\u4E8E\u6307\u5B9A\u7684\u7C7B, \u4E0D\u62A5\u544A\u6B65\u9AA4\u6216\u65B9\u6CD5\u4E8B\u4EF6\nclasspath                 -- \u4ECE\u76EE\u6807 VM \u8F93\u51FA\u7C7B\u8DEF\u5F84\u4FE1\u606F\n\nmonitor <command>         -- \u6BCF\u6B21\u7A0B\u5E8F\u505C\u6B62\u65F6\u6267\u884C\u547D\u4EE4\nmonitor                   -- \u5217\u51FA\u76D1\u89C6\u5668\nunmonitor <monitor#>      -- \u5220\u9664\u76D1\u89C6\u5668\nread <filename>           -- \u8BFB\u53D6\u5E76\u6267\u884C\u547D\u4EE4\u6587\u4EF6\n\nlock <expr>               -- \u8F93\u51FA\u5BF9\u8C61\u7684\u9501\u4FE1\u606F\nthreadlocks [thread id]   -- \u8F93\u51FA\u7EBF\u7A0B\u7684\u9501\u4FE1\u606F\n\npop                       -- \u901A\u8FC7\u5F53\u524D\u5E27\u51FA\u6808, \u4E14\u5305\u542B\u5F53\u524D\u5E27\nreenter                   -- \u4E0E pop \u76F8\u540C, \u4F46\u91CD\u65B0\u8FDB\u5165\u5F53\u524D\u5E27\nredefine <class id> <class file name>\n                          -- \u91CD\u65B0\u5B9A\u4E49\u7C7B\u7684\u4EE3\u7801\n\ndisablegc <expr>          -- \u7981\u6B62\u5BF9\u8C61\u7684\u5783\u573E\u6536\u96C6\nenablegc <expr>           -- \u5141\u8BB8\u5BF9\u8C61\u7684\u5783\u573E\u6536\u96C6\n\n!!                        -- \u91CD\u590D\u6267\u884C\u6700\u540E\u4E00\u4E2A\u547D\u4EE4\n<n> <command>             -- \u5C06\u547D\u4EE4\u91CD\u590D\u6267\u884C n \u6B21\n# <command>               -- \u653E\u5F03 (\u65E0\u64CD\u4F5C)\nhelp (\u6216 ?)               -- \u5217\u51FA\u547D\u4EE4\nversion                   -- \u8F93\u51FA\u7248\u672C\u4FE1\u606F\nexit (\u6216 quit)            -- \u9000\u51FA\u8C03\u8BD5\u5668\n\n<class id>: \u5E26\u6709\u7A0B\u5E8F\u5305\u9650\u5B9A\u7B26\u7684\u5B8C\u6574\u7C7B\u540D\n<class pattern>: \u5E26\u6709\u524D\u5BFC\u6216\u5C3E\u968F\u901A\u914D\u7B26 ('*') \u7684\u7C7B\u540D\n<thread id>: 'threads' \u547D\u4EE4\u4E2D\u62A5\u544A\u7684\u7EBF\u7A0B\u7F16\u53F7\n<expr>: Java(TM) \u7F16\u7A0B\u8BED\u8A00\u8868\u8FBE\u5F0F\u3002\n\u652F\u6301\u5927\u591A\u6570\u5E38\u89C1\u8BED\u6CD5\u3002\n\n\u53EF\u4EE5\u5C06\u542F\u52A8\u547D\u4EE4\u7F6E\u4E8E \"jdb.ini\" \u6216 \".jdbrc\" \u4E2D\n\u4F4D\u4E8E user.home \u6216 user.dir \u4E2D"},
         {"zz usage text",
              "\u7528\u6CD5: {0} <options> <class> <arguments>\n\n\u5176\u4E2D, \u9009\u9879\u5305\u62EC:\n    -help             \u8F93\u51FA\u6B64\u6D88\u606F\u5E76\u9000\u51FA\n    -sourcepath <\u7531 \"{1}\" \u5206\u9694\u7684\u76EE\u5F55>\n                      \u8981\u5728\u5176\u4E2D\u67E5\u627E\u6E90\u6587\u4EF6\u7684\u76EE\u5F55\n    -attach <address>\n                      \u4F7F\u7528\u6807\u51C6\u8FDE\u63A5\u5668\u9644\u52A0\u5230\u6307\u5B9A\u5730\u5740\u5904\u6B63\u5728\u8FD0\u884C\u7684 VM\n    -listen <address>\n                      \u7B49\u5F85\u6B63\u5728\u8FD0\u884C\u7684 VM \u4F7F\u7528\u6807\u51C6\u8FDE\u63A5\u5668\u5728\u6307\u5B9A\u5730\u5740\u5904\u8FDE\u63A5\n    -listenany\n                      \u7B49\u5F85\u6B63\u5728\u8FD0\u884C\u7684 VM \u4F7F\u7528\u6807\u51C6\u8FDE\u63A5\u5668\u5728\u4EFB\u4F55\u53EF\u7528\u5730\u5740\u5904\u8FDE\u63A5\n    -launch\n                      \u7ACB\u5373\u542F\u52A8 VM \u800C\u4E0D\u662F\u7B49\u5F85 ''run'' \u547D\u4EE4\n    -listconnectors   \u5217\u51FA\u6B64 VM \u4E2D\u7684\u53EF\u7528\u8FDE\u63A5\u5668\n    -connect <connector-name>:<name1>=<value1>,...\n                      \u4F7F\u7528\u6240\u5217\u53C2\u6570\u503C\u901A\u8FC7\u6307\u5B9A\u7684\u8FDE\u63A5\u5668\u8FDE\u63A5\u5230\u76EE\u6807 VM\n    -dbgtrace [flags] \u8F93\u51FA\u4FE1\u606F\u4F9B\u8C03\u8BD5{0}\n    -tclient          \u5728 HotSpot(TM) \u5BA2\u6237\u673A\u7F16\u8BD1\u5668\u4E2D\u8FD0\u884C\u5E94\u7528\u7A0B\u5E8F\n    -tserver          \u5728 HotSpot(TM) \u670D\u52A1\u5668\u7F16\u8BD1\u5668\u4E2D\u8FD0\u884C\u5E94\u7528\u7A0B\u5E8F\n\n\u8F6C\u53D1\u5230\u88AB\u8C03\u8BD5\u8FDB\u7A0B\u7684\u9009\u9879:\n    -v -verbose[:class|gc|jni]\n                      \u542F\u7528\u8BE6\u7EC6\u6A21\u5F0F\n    -D<name>=<value>  \u8BBE\u7F6E\u7CFB\u7EDF\u5C5E\u6027\n    -classpath <\u7531 \"{1}\" \u5206\u9694\u7684\u76EE\u5F55>\n                      \u5217\u51FA\u8981\u5728\u5176\u4E2D\u67E5\u627E\u7C7B\u7684\u76EE\u5F55\n    -X<option>        \u975E\u6807\u51C6\u76EE\u6807 VM \u9009\u9879\n\n<class> \u662F\u8981\u5F00\u59CB\u8C03\u8BD5\u7684\u7C7B\u7684\u540D\u79F0\n<arguments> \u662F\u4F20\u9012\u5230 <class> \u7684 main() \u65B9\u6CD5\u7684\u53C2\u6570\n\n\u8981\u83B7\u5F97\u547D\u4EE4\u7684\u5E2E\u52A9, \u8BF7\u5728{0}\u63D0\u793A\u4E0B\u952E\u5165 ''help''"},
         // END OF MATERIAL TO LOCALIZE
--- a/src/share/classes/java/awt/Component.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/awt/Component.java	Fri Jun 21 19:11:42 2013 -0700
@@ -150,7 +150,7 @@
  *    import java.awt.event.*;
  *    import java.io.Serializable;
  *
- *    class MyApp java.io.Serializable
+ *    class MyApp implements java.io.Serializable
  *    {
  *         BigObjectThatShouldNotBeSerializedWithAButton bigOne;
  *         Button aButton = new Button();
--- a/src/share/classes/java/awt/KeyboardFocusManager.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/awt/KeyboardFocusManager.java	Fri Jun 21 19:11:42 2013 -0700
@@ -458,7 +458,7 @@
     private void initPeer() {
         Toolkit tk = Toolkit.getDefaultToolkit();
         KeyboardFocusManagerPeerProvider peerProvider = (KeyboardFocusManagerPeerProvider)tk;
-        peer = peerProvider.createKeyboardFocusManagerPeer(this);
+        peer = peerProvider.getKeyboardFocusManagerPeer();
     }
 
     /**
--- a/src/share/classes/java/awt/TextComponent.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/awt/TextComponent.java	Fri Jun 21 19:11:42 2013 -0700
@@ -226,9 +226,14 @@
      * @see         java.awt.TextComponent#getText
      */
     public synchronized void setText(String t) {
+        boolean skipTextEvent = (text == null || text.isEmpty())
+                && (t == null || t.isEmpty());
         text = (t != null) ? t : "";
         TextComponentPeer peer = (TextComponentPeer)this.peer;
-        if (peer != null) {
+        // Please note that we do not want to post an event
+        // if TextArea.setText() or TextField.setText() replaces an empty text
+        // by an empty text, that is, if component's text remains unchanged.
+        if (peer != null && !skipTextEvent) {
             peer.setText(text);
         }
     }
--- a/src/share/classes/java/awt/peer/KeyboardFocusManagerPeer.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/awt/peer/KeyboardFocusManagerPeer.java	Fri Jun 21 19:11:42 2013 -0700
@@ -34,6 +34,14 @@
 public interface KeyboardFocusManagerPeer {
 
     /**
+     * Sets the window that should become the focused window.
+     *
+     * @param win the window that should become the focused window
+     *
+     */
+    void setCurrentFocusedWindow(Window win);
+
+    /**
      * Returns the currently focused window.
      *
      * @return the currently focused window
--- a/src/share/classes/java/beans/IndexedPropertyDescriptor.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/beans/IndexedPropertyDescriptor.java	Fri Jun 21 19:11:42 2013 -0700
@@ -181,20 +181,21 @@
                 // the Indexed readMethod was explicitly set to null.
                 return null;
             }
+            String nextMethodName = Introspector.GET_PREFIX + getBaseName();
             if (indexedReadMethodName == null) {
                 Class type = getIndexedPropertyType0();
                 if (type == boolean.class || type == null) {
                     indexedReadMethodName = Introspector.IS_PREFIX + getBaseName();
                 } else {
-                    indexedReadMethodName = Introspector.GET_PREFIX + getBaseName();
+                    indexedReadMethodName = nextMethodName;
                 }
             }
 
             Class[] args = { int.class };
             indexedReadMethod = Introspector.findMethod(cls, indexedReadMethodName, 1, args);
-            if (indexedReadMethod == null) {
+            if ((indexedReadMethod == null) && !indexedReadMethodName.equals(nextMethodName)) {
                 // no "is" method, so look for a "get" method.
-                indexedReadMethodName = Introspector.GET_PREFIX + getBaseName();
+                indexedReadMethodName = nextMethodName;
                 indexedReadMethod = Introspector.findMethod(cls, indexedReadMethodName, 1, args);
             }
             setIndexedReadMethod0(indexedReadMethod);
--- a/src/share/classes/java/beans/Introspector.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/beans/Introspector.java	Fri Jun 21 19:11:42 2013 -0700
@@ -25,6 +25,7 @@
 
 package java.beans;
 
+import com.sun.beans.TypeResolver;
 import com.sun.beans.WeakCache;
 import com.sun.beans.finder.ClassFinder;
 
@@ -34,6 +35,7 @@
 import java.lang.ref.SoftReference;
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
+import java.lang.reflect.Type;
 
 import java.util.Map;
 import java.util.ArrayList;
@@ -584,7 +586,7 @@
                 if (readI != null) cls = cls && readI.getGenericReturnType() instanceof Class;
                 if (writeI != null) cls = cls && writeI.getGenericParameterTypes()[1] instanceof Class;
                 if (!cls) {
-                    pd = new IndexedPropertyDescriptor((IndexedPropertyDescriptor) pd);
+                    pd = new IndexedPropertyDescriptor(ipd);
                     pd.updateGenericsFor(this.beanClass);
                 }
             }
@@ -950,44 +952,61 @@
                     continue;
                 }
 
-                Class argTypes[] = FeatureDescriptor.getParameterTypes(beanClass, method);
-                Class resultType = FeatureDescriptor.getReturnType(beanClass, method);
-
-                if (name.startsWith(ADD_PREFIX) && argTypes.length == 1 &&
-                    resultType == Void.TYPE &&
-                    Introspector.isSubclass(argTypes[0], eventListenerType)) {
-                    String listenerName = name.substring(3);
-                    if (listenerName.length() > 0 &&
-                        argTypes[0].getName().endsWith(listenerName)) {
-                        if (adds == null) {
-                            adds = new HashMap();
+                if (name.startsWith(ADD_PREFIX)) {
+                    Class<?> returnType = method.getReturnType();
+                    if (returnType == void.class) {
+                        Type[] parameterTypes = method.getGenericParameterTypes();
+                        if (parameterTypes.length == 1) {
+                            Class<?> type = TypeResolver.erase(TypeResolver.resolveInClass(beanClass, parameterTypes[0]));
+                            if (Introspector.isSubclass(type, eventListenerType)) {
+                                String listenerName = name.substring(3);
+                                if (listenerName.length() > 0 &&
+                                    type.getName().endsWith(listenerName)) {
+                                    if (adds == null) {
+                                        adds = new HashMap();
+                                    }
+                                    adds.put(listenerName, method);
+                                }
+                            }
                         }
-                        adds.put(listenerName, method);
                     }
                 }
-                else if (name.startsWith(REMOVE_PREFIX) && argTypes.length == 1 &&
-                         resultType == Void.TYPE &&
-                         Introspector.isSubclass(argTypes[0], eventListenerType)) {
-                    String listenerName = name.substring(6);
-                    if (listenerName.length() > 0 &&
-                        argTypes[0].getName().endsWith(listenerName)) {
-                        if (removes == null) {
-                            removes = new HashMap();
+                else if (name.startsWith(REMOVE_PREFIX)) {
+                    Class<?> returnType = method.getReturnType();
+                    if (returnType == void.class) {
+                        Type[] parameterTypes = method.getGenericParameterTypes();
+                        if (parameterTypes.length == 1) {
+                            Class<?> type = TypeResolver.erase(TypeResolver.resolveInClass(beanClass, parameterTypes[0]));
+                            if (Introspector.isSubclass(type, eventListenerType)) {
+                                String listenerName = name.substring(6);
+                                if (listenerName.length() > 0 &&
+                                    type.getName().endsWith(listenerName)) {
+                                    if (removes == null) {
+                                        removes = new HashMap();
+                                    }
+                                    removes.put(listenerName, method);
+                                }
+                            }
                         }
-                        removes.put(listenerName, method);
                     }
                 }
-                else if (name.startsWith(GET_PREFIX) && argTypes.length == 0 &&
-                         resultType.isArray() &&
-                         Introspector.isSubclass(resultType.getComponentType(),
-                                                 eventListenerType)) {
-                    String listenerName  = name.substring(3, name.length() - 1);
-                    if (listenerName.length() > 0 &&
-                        resultType.getComponentType().getName().endsWith(listenerName)) {
-                        if (gets == null) {
-                            gets = new HashMap();
+                else if (name.startsWith(GET_PREFIX)) {
+                    Class<?>[] parameterTypes = method.getParameterTypes();
+                    if (parameterTypes.length == 0) {
+                        Class<?> returnType = FeatureDescriptor.getReturnType(beanClass, method);
+                        if (returnType.isArray()) {
+                            Class<?> type = returnType.getComponentType();
+                            if (Introspector.isSubclass(type, eventListenerType)) {
+                                String listenerName  = name.substring(3, name.length() - 1);
+                                if (listenerName.length() > 0 &&
+                                    type.getName().endsWith(listenerName)) {
+                                    if (gets == null) {
+                                        gets = new HashMap();
+                                    }
+                                    gets.put(listenerName, method);
+                                }
+                            }
                         }
-                        gets.put(listenerName, method);
                     }
                 }
             }
@@ -1239,11 +1258,11 @@
     private boolean isEventHandler(Method m) {
         // We assume that a method is an event handler if it has a single
         // argument, whose type inherit from java.util.Event.
-        Class argTypes[] = FeatureDescriptor.getParameterTypes(beanClass, m);
+        Type argTypes[] = m.getGenericParameterTypes();
         if (argTypes.length != 1) {
             return false;
         }
-        return isSubclass(argTypes[0], EventObject.class);
+        return isSubclass(TypeResolver.erase(TypeResolver.resolveInClass(beanClass, argTypes[0])), EventObject.class);
     }
 
     /*
@@ -1295,24 +1314,25 @@
                 }
 
                 // make sure method signature matches.
-                Class params[] = FeatureDescriptor.getParameterTypes(start, method);
-                if (method.getName().equals(methodName) &&
-                    params.length == argCount) {
-                    if (args != null) {
-                        boolean different = false;
-                        if (argCount > 0) {
-                            for (int j = 0; j < argCount; j++) {
-                                if (params[j] != args[j]) {
-                                    different = true;
+                if (method.getName().equals(methodName)) {
+                    Type[] params = method.getGenericParameterTypes();
+                    if (params.length == argCount) {
+                        if (args != null) {
+                            boolean different = false;
+                            if (argCount > 0) {
+                                for (int j = 0; j < argCount; j++) {
+                                    if (TypeResolver.erase(TypeResolver.resolveInClass(start, params[j])) != args[j]) {
+                                        different = true;
+                                        continue;
+                                    }
+                                }
+                                if (different) {
                                     continue;
                                 }
                             }
-                            if (different) {
-                                continue;
-                            }
                         }
+                        return method;
                     }
-                    return method;
                 }
             }
         }
--- a/src/share/classes/java/beans/MetaData.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/beans/MetaData.java	Fri Jun 21 19:11:42 2013 -0700
@@ -70,8 +70,9 @@
  * @author Philip Milne
  * @author Steve Langley
  */
+class MetaData {
 
-class NullPersistenceDelegate extends PersistenceDelegate {
+static final class NullPersistenceDelegate extends PersistenceDelegate {
     // Note this will be called by all classes when they reach the
     // top of their superclass chain.
     protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
@@ -88,7 +89,7 @@
  *
  * @author Sergey A. Malenkov
  */
-class EnumPersistenceDelegate extends PersistenceDelegate {
+static final class EnumPersistenceDelegate extends PersistenceDelegate {
     protected boolean mutatesTo(Object oldInstance, Object newInstance) {
         return oldInstance == newInstance;
     }
@@ -99,7 +100,7 @@
     }
 }
 
-class PrimitivePersistenceDelegate extends PersistenceDelegate {
+static final class PrimitivePersistenceDelegate extends PersistenceDelegate {
     protected boolean mutatesTo(Object oldInstance, Object newInstance) {
         return oldInstance.equals(newInstance);
     }
@@ -110,7 +111,7 @@
     }
 }
 
-class ArrayPersistenceDelegate extends PersistenceDelegate {
+static final class ArrayPersistenceDelegate extends PersistenceDelegate {
     protected boolean mutatesTo(Object oldInstance, Object newInstance) {
         return (newInstance != null &&
                 oldInstance.getClass() == newInstance.getClass() && // Also ensures the subtype is correct.
@@ -151,7 +152,7 @@
     }
 }
 
-class ProxyPersistenceDelegate extends PersistenceDelegate {
+static final class ProxyPersistenceDelegate extends PersistenceDelegate {
     protected Expression instantiate(Object oldInstance, Encoder out) {
         Class type = oldInstance.getClass();
         java.lang.reflect.Proxy p = (java.lang.reflect.Proxy)oldInstance;
@@ -186,7 +187,7 @@
 }
 
 // Strings
-class java_lang_String_PersistenceDelegate extends PersistenceDelegate {
+static final class java_lang_String_PersistenceDelegate extends PersistenceDelegate {
     protected Expression instantiate(Object oldInstance, Encoder out) { return null; }
 
     public void writeObject(Object oldInstance, Encoder out) {
@@ -195,7 +196,7 @@
 }
 
 // Classes
-class java_lang_Class_PersistenceDelegate extends PersistenceDelegate {
+static final class java_lang_Class_PersistenceDelegate extends PersistenceDelegate {
     protected boolean mutatesTo(Object oldInstance, Object newInstance) {
         return oldInstance.equals(newInstance);
     }
@@ -229,7 +230,7 @@
 }
 
 // Fields
-class java_lang_reflect_Field_PersistenceDelegate extends PersistenceDelegate {
+static final class java_lang_reflect_Field_PersistenceDelegate extends PersistenceDelegate {
     protected boolean mutatesTo(Object oldInstance, Object newInstance) {
         return oldInstance.equals(newInstance);
     }
@@ -244,7 +245,7 @@
 }
 
 // Methods
-class java_lang_reflect_Method_PersistenceDelegate extends PersistenceDelegate {
+static final class java_lang_reflect_Method_PersistenceDelegate extends PersistenceDelegate {
     protected boolean mutatesTo(Object oldInstance, Object newInstance) {
         return oldInstance.equals(newInstance);
     }
@@ -268,7 +269,7 @@
  *
  * @author Sergey A. Malenkov
  */
-class java_util_Date_PersistenceDelegate extends PersistenceDelegate {
+static class java_util_Date_PersistenceDelegate extends PersistenceDelegate {
     protected boolean mutatesTo(Object oldInstance, Object newInstance) {
         if (!super.mutatesTo(oldInstance, newInstance)) {
             return false;
@@ -291,7 +292,7 @@
  *
  * @author Sergey A. Malenkov
  */
-final class java_sql_Timestamp_PersistenceDelegate extends java_util_Date_PersistenceDelegate {
+static final class java_sql_Timestamp_PersistenceDelegate extends java_util_Date_PersistenceDelegate {
     private static final Method getNanosMethod = getNanosMethod();
 
     private static Method getNanosMethod() {
@@ -355,7 +356,7 @@
  *
  * @author Sergey A. Malenkov
  */
-abstract class java_util_Collections extends PersistenceDelegate {
+private static abstract class java_util_Collections extends PersistenceDelegate {
     protected boolean mutatesTo(Object oldInstance, Object newInstance) {
         if (!super.mutatesTo(oldInstance, newInstance)) {
             return false;
@@ -368,6 +369,10 @@
         return (oldC.size() == newC.size()) && oldC.containsAll(newC);
     }
 
+    protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
+        // do not initialize these custom collections in default way
+    }
+
     static final class EmptyList_PersistenceDelegate extends java_util_Collections {
         protected Expression instantiate(Object oldInstance, Encoder out) {
             return new Expression(oldInstance, Collections.class, "emptyList", null);
@@ -570,7 +575,7 @@
  *
  * @author Sergey A. Malenkov
  */
-class java_util_EnumMap_PersistenceDelegate extends PersistenceDelegate {
+static final class java_util_EnumMap_PersistenceDelegate extends PersistenceDelegate {
     protected boolean mutatesTo(Object oldInstance, Object newInstance) {
         return super.mutatesTo(oldInstance, newInstance) && (getType(oldInstance) == getType(newInstance));
     }
@@ -589,7 +594,7 @@
  *
  * @author Sergey A. Malenkov
  */
-class java_util_EnumSet_PersistenceDelegate extends PersistenceDelegate {
+static final class java_util_EnumSet_PersistenceDelegate extends PersistenceDelegate {
     protected boolean mutatesTo(Object oldInstance, Object newInstance) {
         return super.mutatesTo(oldInstance, newInstance) && (getType(oldInstance) == getType(newInstance));
     }
@@ -604,7 +609,7 @@
 }
 
 // Collection
-class java_util_Collection_PersistenceDelegate extends DefaultPersistenceDelegate {
+static class java_util_Collection_PersistenceDelegate extends DefaultPersistenceDelegate {
     protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
         java.util.Collection oldO = (java.util.Collection)oldInstance;
         java.util.Collection newO = (java.util.Collection)newInstance;
@@ -619,7 +624,7 @@
 }
 
 // List
-class java_util_List_PersistenceDelegate extends DefaultPersistenceDelegate {
+static class java_util_List_PersistenceDelegate extends DefaultPersistenceDelegate {
     protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
         java.util.List oldO = (java.util.List)oldInstance;
         java.util.List newO = (java.util.List)newInstance;
@@ -654,7 +659,7 @@
 
 
 // Map
-class java_util_Map_PersistenceDelegate extends DefaultPersistenceDelegate {
+static class java_util_Map_PersistenceDelegate extends DefaultPersistenceDelegate {
     protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
         // System.out.println("Initializing: " + newInstance);
         java.util.Map oldMap = (java.util.Map)oldInstance;
@@ -692,14 +697,14 @@
     }
 }
 
-class java_util_AbstractCollection_PersistenceDelegate extends java_util_Collection_PersistenceDelegate {}
-class java_util_AbstractList_PersistenceDelegate extends java_util_List_PersistenceDelegate {}
-class java_util_AbstractMap_PersistenceDelegate extends java_util_Map_PersistenceDelegate {}
-class java_util_Hashtable_PersistenceDelegate extends java_util_Map_PersistenceDelegate {}
+static final class java_util_AbstractCollection_PersistenceDelegate extends java_util_Collection_PersistenceDelegate {}
+static final class java_util_AbstractList_PersistenceDelegate extends java_util_List_PersistenceDelegate {}
+static final class java_util_AbstractMap_PersistenceDelegate extends java_util_Map_PersistenceDelegate {}
+static final class java_util_Hashtable_PersistenceDelegate extends java_util_Map_PersistenceDelegate {}
 
 
 // Beans
-class java_beans_beancontext_BeanContextSupport_PersistenceDelegate extends java_util_Collection_PersistenceDelegate {}
+static final class java_beans_beancontext_BeanContextSupport_PersistenceDelegate extends java_util_Collection_PersistenceDelegate {}
 
 // AWT
 
@@ -710,7 +715,7 @@
  *
  * @author Sergey A. Malenkov
  */
-final class java_awt_Insets_PersistenceDelegate extends PersistenceDelegate {
+static final class java_awt_Insets_PersistenceDelegate extends PersistenceDelegate {
     protected boolean mutatesTo(Object oldInstance, Object newInstance) {
         return oldInstance.equals(newInstance);
     }
@@ -734,7 +739,7 @@
  *
  * @author Sergey A. Malenkov
  */
-final class java_awt_Font_PersistenceDelegate extends PersistenceDelegate {
+static final class java_awt_Font_PersistenceDelegate extends PersistenceDelegate {
     protected boolean mutatesTo(Object oldInstance, Object newInstance) {
         return oldInstance.equals(newInstance);
     }
@@ -803,7 +808,7 @@
  *
  * @author Sergey A. Malenkov
  */
-final class java_awt_AWTKeyStroke_PersistenceDelegate extends PersistenceDelegate {
+static final class java_awt_AWTKeyStroke_PersistenceDelegate extends PersistenceDelegate {
     protected boolean mutatesTo(Object oldInstance, Object newInstance) {
         return oldInstance.equals(newInstance);
     }
@@ -844,7 +849,7 @@
     }
 }
 
-class StaticFieldsPersistenceDelegate extends PersistenceDelegate {
+static class StaticFieldsPersistenceDelegate extends PersistenceDelegate {
     protected void installFields(Encoder out, Class<?> cls) {
         if (Modifier.isPublic(cls.getModifiers()) && isPackageAccessible(cls)) {
             Field fields[] = cls.getFields();
@@ -873,13 +878,13 @@
 }
 
 // SystemColor
-class java_awt_SystemColor_PersistenceDelegate extends StaticFieldsPersistenceDelegate {}
+static final class java_awt_SystemColor_PersistenceDelegate extends StaticFieldsPersistenceDelegate {}
 
 // TextAttribute
-class java_awt_font_TextAttribute_PersistenceDelegate extends StaticFieldsPersistenceDelegate {}
+static final class java_awt_font_TextAttribute_PersistenceDelegate extends StaticFieldsPersistenceDelegate {}
 
 // MenuShortcut
-class java_awt_MenuShortcut_PersistenceDelegate extends PersistenceDelegate {
+static final class java_awt_MenuShortcut_PersistenceDelegate extends PersistenceDelegate {
     protected boolean mutatesTo(Object oldInstance, Object newInstance) {
         return oldInstance.equals(newInstance);
     }
@@ -892,7 +897,7 @@
 }
 
 // Component
-class java_awt_Component_PersistenceDelegate extends DefaultPersistenceDelegate {
+static final class java_awt_Component_PersistenceDelegate extends DefaultPersistenceDelegate {
     protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
         super.initialize(type, oldInstance, newInstance, out);
         java.awt.Component c = (java.awt.Component)oldInstance;
@@ -939,7 +944,7 @@
 }
 
 // Container
-class java_awt_Container_PersistenceDelegate extends DefaultPersistenceDelegate {
+static final class java_awt_Container_PersistenceDelegate extends DefaultPersistenceDelegate {
     protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
         super.initialize(type, oldInstance, newInstance, out);
         // Ignore the children of a JScrollPane.
@@ -974,7 +979,7 @@
 }
 
 // Choice
-class java_awt_Choice_PersistenceDelegate extends DefaultPersistenceDelegate {
+static final class java_awt_Choice_PersistenceDelegate extends DefaultPersistenceDelegate {
     protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
         super.initialize(type, oldInstance, newInstance, out);
         java.awt.Choice m = (java.awt.Choice)oldInstance;
@@ -986,7 +991,7 @@
 }
 
 // Menu
-class java_awt_Menu_PersistenceDelegate extends DefaultPersistenceDelegate {
+static final class java_awt_Menu_PersistenceDelegate extends DefaultPersistenceDelegate {
     protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
         super.initialize(type, oldInstance, newInstance, out);
         java.awt.Menu m = (java.awt.Menu)oldInstance;
@@ -998,7 +1003,7 @@
 }
 
 // MenuBar
-class java_awt_MenuBar_PersistenceDelegate extends DefaultPersistenceDelegate {
+static final class java_awt_MenuBar_PersistenceDelegate extends DefaultPersistenceDelegate {
     protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
         super.initialize(type, oldInstance, newInstance, out);
         java.awt.MenuBar m = (java.awt.MenuBar)oldInstance;
@@ -1010,7 +1015,7 @@
 }
 
 // List
-class java_awt_List_PersistenceDelegate extends DefaultPersistenceDelegate {
+static final class java_awt_List_PersistenceDelegate extends DefaultPersistenceDelegate {
     protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
         super.initialize(type, oldInstance, newInstance, out);
         java.awt.List m = (java.awt.List)oldInstance;
@@ -1025,7 +1030,7 @@
 // LayoutManagers
 
 // BorderLayout
-class java_awt_BorderLayout_PersistenceDelegate extends DefaultPersistenceDelegate {
+static final class java_awt_BorderLayout_PersistenceDelegate extends DefaultPersistenceDelegate {
     private static final String[] CONSTRAINTS = {
             BorderLayout.NORTH,
             BorderLayout.SOUTH,
@@ -1056,41 +1061,44 @@
 }
 
 // CardLayout
-class java_awt_CardLayout_PersistenceDelegate extends DefaultPersistenceDelegate {
+static final class java_awt_CardLayout_PersistenceDelegate extends DefaultPersistenceDelegate {
     protected void initialize(Class<?> type, Object oldInstance,
                               Object newInstance, Encoder out) {
         super.initialize(type, oldInstance, newInstance, out);
-        Hashtable tab = (Hashtable)ReflectionUtils.getPrivateField(oldInstance,
-                                                                   java.awt.CardLayout.class,
-                                                                   "tab",
-                                                                   out.getExceptionListener());
-        if (tab != null) {
-            for(Enumeration e = tab.keys(); e.hasMoreElements();) {
-                Object child = e.nextElement();
-                invokeStatement(oldInstance, "addLayoutComponent",
-                                new Object[]{child, (String)tab.get(child)}, out);
+        if (getVector(newInstance).isEmpty()) {
+            for (Object card : getVector(oldInstance)) {
+                Object[] args = {MetaData.getPrivateFieldValue(card, "java.awt.CardLayout$Card.name"),
+                                 MetaData.getPrivateFieldValue(card, "java.awt.CardLayout$Card.comp")};
+                invokeStatement(oldInstance, "addLayoutComponent", args, out);
             }
         }
     }
+    protected boolean mutatesTo(Object oldInstance, Object newInstance) {
+        return super.mutatesTo(oldInstance, newInstance) && getVector(newInstance).isEmpty();
+    }
+    private static Vector<?> getVector(Object instance) {
+        return (Vector<?>) MetaData.getPrivateFieldValue(instance, "java.awt.CardLayout.vector");
+    }
 }
 
 // GridBagLayout
-class java_awt_GridBagLayout_PersistenceDelegate extends DefaultPersistenceDelegate {
+static final class java_awt_GridBagLayout_PersistenceDelegate extends DefaultPersistenceDelegate {
     protected void initialize(Class<?> type, Object oldInstance,
                               Object newInstance, Encoder out) {
         super.initialize(type, oldInstance, newInstance, out);
-        Hashtable comptable = (Hashtable)ReflectionUtils.getPrivateField(oldInstance,
-                                                 java.awt.GridBagLayout.class,
-                                                 "comptable",
-                                                 out.getExceptionListener());
-        if (comptable != null) {
-            for(Enumeration e = comptable.keys(); e.hasMoreElements();) {
-                Object child = e.nextElement();
-                invokeStatement(oldInstance, "addLayoutComponent",
-                                new Object[]{child, comptable.get(child)}, out);
+        if (getHashtable(newInstance).isEmpty()) {
+            for (Map.Entry<?,?> entry : getHashtable(oldInstance).entrySet()) {
+                Object[] args = {entry.getKey(), entry.getValue()};
+                invokeStatement(oldInstance, "addLayoutComponent", args, out);
             }
         }
     }
+    protected boolean mutatesTo(Object oldInstance, Object newInstance) {
+        return super.mutatesTo(oldInstance, newInstance) && getHashtable(newInstance).isEmpty();
+    }
+    private static Hashtable<?,?> getHashtable(Object instance) {
+        return (Hashtable<?,?>) MetaData.getPrivateFieldValue(instance, "java.awt.GridBagLayout.comptable");
+    }
 }
 
 // Swing
@@ -1098,7 +1106,7 @@
 // JFrame (If we do this for Window instead of JFrame, the setVisible call
 // will be issued before we have added all the children to the JFrame and
 // will appear blank).
-class javax_swing_JFrame_PersistenceDelegate extends DefaultPersistenceDelegate {
+static final class javax_swing_JFrame_PersistenceDelegate extends DefaultPersistenceDelegate {
     protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
         super.initialize(type, oldInstance, newInstance, out);
         java.awt.Window oldC = (java.awt.Window)oldInstance;
@@ -1118,7 +1126,7 @@
 // Models
 
 // DefaultListModel
-class javax_swing_DefaultListModel_PersistenceDelegate extends DefaultPersistenceDelegate {
+static final class javax_swing_DefaultListModel_PersistenceDelegate extends DefaultPersistenceDelegate {
     protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
         // Note, the "size" property will be set here.
         super.initialize(type, oldInstance, newInstance, out);
@@ -1132,7 +1140,7 @@
 }
 
 // DefaultComboBoxModel
-class javax_swing_DefaultComboBoxModel_PersistenceDelegate extends DefaultPersistenceDelegate {
+static final class javax_swing_DefaultComboBoxModel_PersistenceDelegate extends DefaultPersistenceDelegate {
     protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
         super.initialize(type, oldInstance, newInstance, out);
         javax.swing.DefaultComboBoxModel m = (javax.swing.DefaultComboBoxModel)oldInstance;
@@ -1144,7 +1152,7 @@
 
 
 // DefaultMutableTreeNode
-class javax_swing_tree_DefaultMutableTreeNode_PersistenceDelegate extends DefaultPersistenceDelegate {
+static final class javax_swing_tree_DefaultMutableTreeNode_PersistenceDelegate extends DefaultPersistenceDelegate {
     protected void initialize(Class<?> type, Object oldInstance, Object
                               newInstance, Encoder out) {
         super.initialize(type, oldInstance, newInstance, out);
@@ -1160,7 +1168,7 @@
 }
 
 // ToolTipManager
-class javax_swing_ToolTipManager_PersistenceDelegate extends PersistenceDelegate {
+static final class javax_swing_ToolTipManager_PersistenceDelegate extends PersistenceDelegate {
     protected Expression instantiate(Object oldInstance, Encoder out) {
         return new Expression(oldInstance, javax.swing.ToolTipManager.class,
                               "sharedInstance", new Object[]{});
@@ -1168,7 +1176,7 @@
 }
 
 // JTabbedPane
-class javax_swing_JTabbedPane_PersistenceDelegate extends DefaultPersistenceDelegate {
+static final class javax_swing_JTabbedPane_PersistenceDelegate extends DefaultPersistenceDelegate {
     protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
         super.initialize(type, oldInstance, newInstance, out);
         javax.swing.JTabbedPane p = (javax.swing.JTabbedPane)oldInstance;
@@ -1183,7 +1191,7 @@
 }
 
 // Box
-class javax_swing_Box_PersistenceDelegate extends DefaultPersistenceDelegate {
+static final class javax_swing_Box_PersistenceDelegate extends DefaultPersistenceDelegate {
     protected boolean mutatesTo(Object oldInstance, Object newInstance) {
         return super.mutatesTo(oldInstance, newInstance) && getAxis(oldInstance).equals(getAxis(newInstance));
     }
@@ -1204,7 +1212,7 @@
 // Container will return all of the sub menu items that
 // need to be added to the menu item.
 // Not so for JMenu apparently.
-class javax_swing_JMenu_PersistenceDelegate extends DefaultPersistenceDelegate {
+static final class javax_swing_JMenu_PersistenceDelegate extends DefaultPersistenceDelegate {
     protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
         super.initialize(type, oldInstance, newInstance, out);
         javax.swing.JMenu m = (javax.swing.JMenu)oldInstance;
@@ -1222,7 +1230,7 @@
  *
  * @author Sergey A. Malenkov
  */
-final class javax_swing_border_MatteBorder_PersistenceDelegate extends PersistenceDelegate {
+static final class javax_swing_border_MatteBorder_PersistenceDelegate extends PersistenceDelegate {
     protected Expression instantiate(Object oldInstance, Encoder out) {
         MatteBorder border = (MatteBorder) oldInstance;
         Insets insets = border.getBorderInsets();
@@ -1242,7 +1250,7 @@
 }
 
 /* XXX - doens't seem to work. Debug later.
-class javax_swing_JMenu_PersistenceDelegate extends DefaultPersistenceDelegate {
+static final class javax_swing_JMenu_PersistenceDelegate extends DefaultPersistenceDelegate {
     protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
         super.initialize(type, oldInstance, newInstance, out);
         javax.swing.JMenu m = (javax.swing.JMenu)oldInstance;
@@ -1264,7 +1272,7 @@
  *
  * @author Sergey A. Malenkov
  */
-final class sun_swing_PrintColorUIResource_PersistenceDelegate extends PersistenceDelegate {
+static final class sun_swing_PrintColorUIResource_PersistenceDelegate extends PersistenceDelegate {
     protected boolean mutatesTo(Object oldInstance, Object newInstance) {
         return oldInstance.equals(newInstance);
     }
@@ -1276,7 +1284,6 @@
     }
 }
 
-class MetaData {
     private static final Map<String,Field> fields = Collections.synchronizedMap(new WeakHashMap<String, Field>());
     private static Hashtable internalPersistenceDelegates = new Hashtable();
 
@@ -1318,7 +1325,7 @@
         if (Enum.class.isAssignableFrom(type)) {
             return enumPersistenceDelegate;
         }
-        if (ReflectionUtils.isPrimitive(type)) {
+        if (null != XMLEncoder.primitiveTypeFor(type)) {
             return primitivePersistenceDelegate;
         }
         // The persistence delegate for arrays is non-trivial; instantiate it lazily.
@@ -1352,7 +1359,7 @@
             internalPersistenceDelegates.put(typeName, defaultPersistenceDelegate);
             try {
                 String name =  type.getName();
-                Class c = Class.forName("java.beans." + name.replace('.', '_')
+                Class c = Class.forName("java.beans.MetaData$" + name.replace('.', '_')
                                         + "_PersistenceDelegate");
                 pd = (PersistenceDelegate)c.newInstance();
                 internalPersistenceDelegates.put(typeName, pd);
--- a/src/share/classes/java/beans/PropertyDescriptor.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/beans/PropertyDescriptor.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -210,12 +210,13 @@
                 // The read method was explicitly set to null.
                 return null;
             }
+            String nextMethodName = Introspector.GET_PREFIX + getBaseName();
             if (readMethodName == null) {
                 Class type = getPropertyType0();
                 if (type == boolean.class || type == null) {
                     readMethodName = Introspector.IS_PREFIX + getBaseName();
                 } else {
-                    readMethodName = Introspector.GET_PREFIX + getBaseName();
+                    readMethodName = nextMethodName;
                 }
             }
 
@@ -225,8 +226,8 @@
             // methods.  If an "is" method exists, this is the official
             // reader method so look for this one first.
             readMethod = Introspector.findMethod(cls, readMethodName, 0);
-            if (readMethod == null) {
-                readMethodName = Introspector.GET_PREFIX + getBaseName();
+            if ((readMethod == null) && !readMethodName.equals(nextMethodName)) {
+                readMethodName = nextMethodName;
                 readMethod = Introspector.findMethod(cls, readMethodName, 0);
             }
             try {
@@ -590,7 +591,7 @@
         Method yw = y.getWriteMethod();
 
         try {
-            if (yw != null && yw.getDeclaringClass() == getClass0()) {
+            if (yw != null) {
                 setWriteMethod(yw);
             } else {
                 setWriteMethod(xw);
@@ -669,7 +670,7 @@
                     throw new IntrospectionException("bad write method arg count: "
                                                      + writeMethod);
                 }
-                if (propertyType != null && propertyType != params[0]) {
+                if (propertyType != null && !params[0].isAssignableFrom(propertyType)) {
                     throw new IntrospectionException("type mismatch between read and write methods");
                 }
                 propertyType = params[0];
--- a/src/share/classes/java/beans/ReflectionUtils.java	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved.
- * 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.beans;
-
-import java.lang.reflect.Field;
-
-/**
- * A utility class for reflectively finding methods, constuctors and fields
- * using reflection.
- */
-class ReflectionUtils {
-
-    public static boolean isPrimitive(Class type) {
-        return primitiveTypeFor(type) != null;
-    }
-
-    public static Class primitiveTypeFor(Class wrapper) {
-        if (wrapper == Boolean.class) return Boolean.TYPE;
-        if (wrapper == Byte.class) return Byte.TYPE;
-        if (wrapper == Character.class) return Character.TYPE;
-        if (wrapper == Short.class) return Short.TYPE;
-        if (wrapper == Integer.class) return Integer.TYPE;
-        if (wrapper == Long.class) return Long.TYPE;
-        if (wrapper == Float.class) return Float.TYPE;
-        if (wrapper == Double.class) return Double.TYPE;
-        if (wrapper == Void.class) return Void.TYPE;
-        return null;
-    }
-
-    /**
-     * Returns the value of a private field.
-     *
-     * @param instance object instance
-     * @param cls class
-     * @param name name of the field
-     * @param el an exception listener to handle exceptions; or null
-     * @return value of the field; null if not found or an error is encountered
-     */
-    public static Object getPrivateField(Object instance, Class cls,
-                                         String name, ExceptionListener el) {
-        try {
-            Field f = cls.getDeclaredField(name);
-            f.setAccessible(true);
-            return f.get(instance);
-        }
-        catch (Exception e) {
-            if (el != null) {
-                el.exceptionThrown(e);
-            }
-        }
-        return null;
-    }
-}
--- a/src/share/classes/java/beans/XMLEncoder.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/beans/XMLEncoder.java	Fri Jun 21 19:11:42 2013 -0700
@@ -487,6 +487,12 @@
         }
         indentation--;
 
+        Statement statement = getMissedStatement();
+        while (statement != null) {
+            outputStatement(statement, this, false);
+            statement = getMissedStatement();
+        }
+
         try {
             out.flush();
         }
@@ -503,6 +509,17 @@
         targetToStatementList.clear();
     }
 
+    Statement getMissedStatement() {
+        for (List<Statement> statements : this.targetToStatementList.values()) {
+            for (int i = 0; i < statements.size(); i++) {
+                if (Statement.class == statements.get(i).getClass()) {
+                    return statements.remove(i);
+                }
+            }
+        }
+        return null;
+    }
+
 
     /**
      * This method calls <code>flush</code>, writes the closing
@@ -597,14 +614,14 @@
                                                 "methodName") + " should not be null");
             }
 
-            if (target instanceof Field && methodName.equals("get")) {
+            if (isArgument && target instanceof Field && methodName.equals("get")) {
                 Field f = (Field)target;
                 writeln("<object class=" + quote(f.getDeclaringClass().getName()) +
                         " field=" + quote(f.getName()) + "/>");
                 return;
             }
 
-            Class primitiveType = ReflectionUtils.primitiveTypeFor(value.getClass());
+            Class primitiveType = primitiveTypeFor(value.getClass());
             if (primitiveType != null && target == value.getClass() &&
                 methodName.equals("new")) {
                 String primitiveTypeName = primitiveType.getName();
@@ -778,4 +795,18 @@
         indentation--;
         writeln("</" + tag + ">");
     }
+
+    @SuppressWarnings("rawtypes")
+    static Class primitiveTypeFor(Class wrapper) {
+        if (wrapper == Boolean.class) return Boolean.TYPE;
+        if (wrapper == Byte.class) return Byte.TYPE;
+        if (wrapper == Character.class) return Character.TYPE;
+        if (wrapper == Short.class) return Short.TYPE;
+        if (wrapper == Integer.class) return Integer.TYPE;
+        if (wrapper == Long.class) return Long.TYPE;
+        if (wrapper == Float.class) return Float.TYPE;
+        if (wrapper == Double.class) return Double.TYPE;
+        if (wrapper == Void.class) return Void.TYPE;
+        return null;
+    }
 }
--- a/src/share/classes/java/io/File.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/io/File.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 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
@@ -156,7 +156,7 @@
     static private FileSystem fs = FileSystem.getFileSystem();
 
     /**
-     * This abstract pathname's normalized pathname string.  A normalized
+     * This abstract pathname's normalized pathname string. A normalized
      * pathname string uses the default name-separator character and does not
      * contain any duplicate or redundant separators.
      *
@@ -165,6 +165,32 @@
     private String path;
 
     /**
+     * Enum type that indicates the status of a file path.
+     */
+    private static enum PathStatus { INVALID, CHECKED };
+
+    /**
+     * The flag indicating whether the file path is invalid.
+     */
+    private transient PathStatus status = null;
+
+    /**
+     * Check if the file has an invalid path. Currently, the inspection of
+     * a file path is very limited, and it only covers Nul character check.
+     * Returning true means the path is definitely invalid/garbage. But
+     * returning false does not guarantee that the path is valid.
+     *
+     * @return true if the file path is invalid.
+     */
+    final boolean isInvalid() {
+        if (status == null) {
+            status = (this.path.indexOf('\u0000') < 0) ? PathStatus.CHECKED
+                                                       : PathStatus.INVALID;
+        }
+        return status == PathStatus.INVALID;
+    }
+
+    /**
      * The length of this abstract pathname's prefix, or zero if it has no
      * prefix.
      */
@@ -586,6 +612,9 @@
      * @see     Path#toRealPath
      */
     public String getCanonicalPath() throws IOException {
+        if (isInvalid()) {
+            throw new IOException("Invalid file path");
+        }
         return fs.canonicalize(fs.resolve(this));
     }
 
@@ -651,6 +680,9 @@
      */
     @Deprecated
     public URL toURL() throws MalformedURLException {
+        if (isInvalid()) {
+            throw new MalformedURLException("Invalid file path");
+        }
         return new URL("file", "", slashify(getAbsolutePath(), isDirectory()));
     }
 
@@ -727,6 +759,9 @@
         if (security != null) {
             security.checkRead(path);
         }
+        if (isInvalid()) {
+            return false;
+        }
         return fs.checkAccess(this, FileSystem.ACCESS_READ);
     }
 
@@ -749,6 +784,9 @@
         if (security != null) {
             security.checkWrite(path);
         }
+        if (isInvalid()) {
+            return false;
+        }
         return fs.checkAccess(this, FileSystem.ACCESS_WRITE);
     }
 
@@ -769,6 +807,9 @@
         if (security != null) {
             security.checkRead(path);
         }
+        if (isInvalid()) {
+            return false;
+        }
         return ((fs.getBooleanAttributes(this) & FileSystem.BA_EXISTS) != 0);
     }
 
@@ -796,6 +837,9 @@
         if (security != null) {
             security.checkRead(path);
         }
+        if (isInvalid()) {
+            return false;
+        }
         return ((fs.getBooleanAttributes(this) & FileSystem.BA_DIRECTORY)
                 != 0);
     }
@@ -826,6 +870,9 @@
         if (security != null) {
             security.checkRead(path);
         }
+        if (isInvalid()) {
+            return false;
+        }
         return ((fs.getBooleanAttributes(this) & FileSystem.BA_REGULAR) != 0);
     }
 
@@ -852,6 +899,9 @@
         if (security != null) {
             security.checkRead(path);
         }
+        if (isInvalid()) {
+            return false;
+        }
         return ((fs.getBooleanAttributes(this) & FileSystem.BA_HIDDEN) != 0);
     }
 
@@ -881,6 +931,9 @@
         if (security != null) {
             security.checkRead(path);
         }
+        if (isInvalid()) {
+            return 0L;
+        }
         return fs.getLastModifiedTime(this);
     }
 
@@ -909,6 +962,9 @@
         if (security != null) {
             security.checkRead(path);
         }
+        if (isInvalid()) {
+            return 0L;
+        }
         return fs.getLength(this);
     }
 
@@ -944,6 +1000,9 @@
     public boolean createNewFile() throws IOException {
         SecurityManager security = System.getSecurityManager();
         if (security != null) security.checkWrite(path);
+        if (isInvalid()) {
+            throw new IOException("Invalid file path");
+        }
         return fs.createFileExclusively(path);
     }
 
@@ -970,6 +1029,9 @@
         if (security != null) {
             security.checkDelete(path);
         }
+        if (isInvalid()) {
+            return false;
+        }
         return fs.delete(this);
     }
 
@@ -1005,6 +1067,9 @@
         if (security != null) {
             security.checkDelete(path);
         }
+        if (isInvalid()) {
+            return;
+        }
         DeleteOnExitHook.add(path);
     }
 
@@ -1045,6 +1110,9 @@
         if (security != null) {
             security.checkRead(path);
         }
+        if (isInvalid()) {
+            return null;
+        }
         return fs.list(this);
     }
 
@@ -1236,6 +1304,9 @@
         if (security != null) {
             security.checkWrite(path);
         }
+        if (isInvalid()) {
+            return false;
+        }
         return fs.createDirectory(this);
     }
 
@@ -1311,6 +1382,12 @@
             security.checkWrite(path);
             security.checkWrite(dest.path);
         }
+        if (dest == null) {
+            throw new NullPointerException();
+        }
+        if (this.isInvalid() || dest.isInvalid()) {
+            return false;
+        }
         return fs.rename(this, dest);
     }
 
@@ -1346,6 +1423,9 @@
         if (security != null) {
             security.checkWrite(path);
         }
+        if (isInvalid()) {
+            return false;
+        }
         return fs.setLastModifiedTime(this, time);
     }
 
@@ -1371,6 +1451,9 @@
         if (security != null) {
             security.checkWrite(path);
         }
+        if (isInvalid()) {
+            return false;
+        }
         return fs.setReadOnly(this);
     }
 
@@ -1409,6 +1492,9 @@
         if (security != null) {
             security.checkWrite(path);
         }
+        if (isInvalid()) {
+            return false;
+        }
         return fs.setPermission(this, FileSystem.ACCESS_WRITE, writable, ownerOnly);
     }
 
@@ -1479,6 +1565,9 @@
         if (security != null) {
             security.checkWrite(path);
         }
+        if (isInvalid()) {
+            return false;
+        }
         return fs.setPermission(this, FileSystem.ACCESS_READ, readable, ownerOnly);
     }
 
@@ -1552,6 +1641,9 @@
         if (security != null) {
             security.checkWrite(path);
         }
+        if (isInvalid()) {
+            return false;
+        }
         return fs.setPermission(this, FileSystem.ACCESS_EXECUTE, executable, ownerOnly);
     }
 
@@ -1606,6 +1698,9 @@
         if (security != null) {
             security.checkExec(path);
         }
+        if (isInvalid()) {
+            return false;
+        }
         return fs.checkAccess(this, FileSystem.ACCESS_EXECUTE);
     }
 
@@ -1682,6 +1777,9 @@
             sm.checkPermission(new RuntimePermission("getFileSystemAttributes"));
             sm.checkRead(path);
         }
+        if (isInvalid()) {
+            return 0L;
+        }
         return fs.getSpace(this, FileSystem.SPACE_TOTAL);
     }
 
@@ -1698,7 +1796,7 @@
      * makes no guarantee that write operations to this file system
      * will succeed.
      *
-     * @return  The number of unallocated bytes on the partition <tt>0L</tt>
+     * @return  The number of unallocated bytes on the partition or <tt>0L</tt>
      *          if the abstract pathname does not name a partition.  This
      *          value will be less than or equal to the total file system size
      *          returned by {@link #getTotalSpace}.
@@ -1717,6 +1815,9 @@
             sm.checkPermission(new RuntimePermission("getFileSystemAttributes"));
             sm.checkRead(path);
         }
+        if (isInvalid()) {
+            return 0L;
+        }
         return fs.getSpace(this, FileSystem.SPACE_FREE);
     }
 
@@ -1755,6 +1856,9 @@
             sm.checkPermission(new RuntimePermission("getFileSystemAttributes"));
             sm.checkRead(path);
         }
+        if (isInvalid()) {
+            return 0L;
+        }
         return fs.getSpace(this, FileSystem.SPACE_USABLE);
     }
 
@@ -1764,22 +1868,28 @@
         private TempDirectory() { }
 
         // temporary directory location
-        private static final File tmpdir = new File(fs.normalize(AccessController
-            .doPrivileged(new GetPropertyAction("java.io.tmpdir"))));
+        private static final File tmpdir = new File(AccessController
+            .doPrivileged(new GetPropertyAction("java.io.tmpdir")));
         static File location() {
             return tmpdir;
         }
 
         // file name generation
         private static final SecureRandom random = new SecureRandom();
-        static File generateFile(String prefix, String suffix, File dir) {
+        static File generateFile(String prefix, String suffix, File dir)
+            throws IOException
+        {
             long n = random.nextLong();
             if (n == Long.MIN_VALUE) {
                 n = 0;      // corner case
             } else {
                 n = Math.abs(n);
             }
-            return new File(dir, prefix + Long.toString(n) + suffix);
+            String name = prefix + Long.toString(n) + suffix;
+            File f = new File(dir, name);
+            if (!name.equals(f.getName()))
+                throw new IOException("Unable to create temporary file");
+            return f;
         }
     }
 
@@ -1861,22 +1971,21 @@
         if (suffix == null)
             suffix = ".tmp";
 
-        File tmpdir = (directory != null) ? directory : TempDirectory.location();
-        SecurityManager sm = System.getSecurityManager();
+        File tmpdir = (directory != null) ? directory
+                                          : TempDirectory.location();
         File f;
-        do {
-            f = TempDirectory.generateFile(prefix, suffix, tmpdir);
-            if (sm != null) {
-                try {
-                    sm.checkWrite(f.getPath());
-                } catch (SecurityException se) {
-                    // don't reveal temporary directory location
-                    if (directory == null)
-                        throw new SecurityException("Unable to create temporary file");
-                    throw se;
-                }
-            }
-        } while (!fs.createFileExclusively(f.getPath()));
+        try {
+            do {
+                f = TempDirectory.generateFile(prefix, suffix, tmpdir);
+            } while (f.exists());
+            if (!f.createNewFile())
+                throw new IOException("Unable to create temporary file");
+        } catch (SecurityException se) {
+            // don't reveal temporary directory location
+            if (directory == null)
+                throw new SecurityException("Unable to create temporary file");
+            throw se;
+        }
         return f;
     }
 
--- a/src/share/classes/java/io/FileInputStream.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/io/FileInputStream.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 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
@@ -27,6 +27,7 @@
 
 import java.nio.channels.FileChannel;
 import sun.nio.ch.FileChannelImpl;
+import sun.misc.IoTrace;
 
 
 /**
@@ -51,6 +52,9 @@
     /* File Descriptor - handle to the open file */
     private final FileDescriptor fd;
 
+    /* The path of the referenced file (null if the stream is created with a file descriptor) */
+    private final String path;
+
     private FileChannel channel = null;
 
     private final Object closeLock = new Object();
@@ -133,8 +137,12 @@
         if (name == null) {
             throw new NullPointerException();
         }
+        if (file.isInvalid()) {
+            throw new FileNotFoundException("Invalid file path");
+        }
         fd = new FileDescriptor();
         fd.incrementAndGetUseCount();
+        this.path = name;
         open(name);
     }
 
@@ -171,6 +179,7 @@
             security.checkRead(fdObj);
         }
         fd = fdObj;
+        path = null;
 
         /*
          * FileDescriptor is being shared by streams.
@@ -194,7 +203,18 @@
      *             file is reached.
      * @exception  IOException  if an I/O error occurs.
      */
-    public native int read() throws IOException;
+    public int read() throws IOException {
+        Object traceContext = IoTrace.fileReadBegin(path);
+        int b = 0;
+        try {
+            b = read0();
+        } finally {
+            IoTrace.fileReadEnd(traceContext, b == -1 ? 0 : 1);
+        }
+        return b;
+    }
+
+    private native int read0() throws IOException;
 
     /**
      * Reads a subarray as a sequence of bytes.
@@ -217,7 +237,14 @@
      * @exception  IOException  if an I/O error occurs.
      */
     public int read(byte b[]) throws IOException {
-        return readBytes(b, 0, b.length);
+        Object traceContext = IoTrace.fileReadBegin(path);
+        int bytesRead = 0;
+        try {
+            bytesRead = readBytes(b, 0, b.length);
+        } finally {
+            IoTrace.fileReadEnd(traceContext, bytesRead == -1 ? 0 : bytesRead);
+        }
+        return bytesRead;
     }
 
     /**
@@ -239,7 +266,14 @@
      * @exception  IOException  if an I/O error occurs.
      */
     public int read(byte b[], int off, int len) throws IOException {
-        return readBytes(b, off, len);
+        Object traceContext = IoTrace.fileReadBegin(path);
+        int bytesRead = 0;
+        try {
+            bytesRead = readBytes(b, off, len);
+        } finally {
+            IoTrace.fileReadEnd(traceContext, bytesRead == -1 ? 0 : bytesRead);
+        }
+        return bytesRead;
     }
 
     /**
@@ -361,7 +395,7 @@
     public FileChannel getChannel() {
         synchronized (this) {
             if (channel == null) {
-                channel = FileChannelImpl.open(fd, true, false, this);
+                channel = FileChannelImpl.open(fd, path, true, false, this);
 
                 /*
                  * Increment fd's use count. Invoking the channel's close()
--- a/src/share/classes/java/io/FileOutputStream.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/io/FileOutputStream.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 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
@@ -27,6 +27,7 @@
 
 import java.nio.channels.FileChannel;
 import sun.nio.ch.FileChannelImpl;
+import sun.misc.IoTrace;
 
 
 /**
@@ -58,6 +59,11 @@
     private final FileDescriptor fd;
 
     /**
+     * The path of the referenced file (null if the stream is created with a file descriptor)
+     */
+    private final String path;
+
+    /**
      * True if the file is opened for append.
      */
     private final boolean append;
@@ -205,9 +211,12 @@
         if (name == null) {
             throw new NullPointerException();
         }
+        if (file.isInvalid()) {
+            throw new FileNotFoundException("Invalid file path");
+        }
         this.fd = new FileDescriptor();
         this.append = append;
-
+        this.path = name;
         fd.incrementAndGetUseCount();
         open(name, append);
     }
@@ -244,6 +253,7 @@
             security.checkWrite(fdObj);
         }
         this.fd = fdObj;
+        this.path = null;
         this.append = false;
 
         /*
@@ -279,7 +289,14 @@
      * @exception  IOException  if an I/O error occurs.
      */
     public void write(int b) throws IOException {
-        write(b, append);
+        Object traceContext = IoTrace.fileWriteBegin(path);
+        int bytesWritten = 0;
+        try {
+            write(b, append);
+            bytesWritten = 1;
+        } finally {
+            IoTrace.fileWriteEnd(traceContext, bytesWritten);
+        }
     }
 
     /**
@@ -302,7 +319,14 @@
      * @exception  IOException  if an I/O error occurs.
      */
     public void write(byte b[]) throws IOException {
-        writeBytes(b, 0, b.length, append);
+        Object traceContext = IoTrace.fileWriteBegin(path);
+        int bytesWritten = 0;
+        try {
+            writeBytes(b, 0, b.length, append);
+            bytesWritten = b.length;
+        } finally {
+            IoTrace.fileWriteEnd(traceContext, bytesWritten);
+        }
     }
 
     /**
@@ -315,7 +339,14 @@
      * @exception  IOException  if an I/O error occurs.
      */
     public void write(byte b[], int off, int len) throws IOException {
-        writeBytes(b, off, len, append);
+        Object traceContext = IoTrace.fileWriteBegin(path);
+        int bytesWritten = 0;
+        try {
+            writeBytes(b, off, len, append);
+            bytesWritten = len;
+        } finally {
+            IoTrace.fileWriteEnd(traceContext, bytesWritten);
+        }
     }
 
     /**
@@ -398,7 +429,7 @@
     public FileChannel getChannel() {
         synchronized (this) {
             if (channel == null) {
-                channel = FileChannelImpl.open(fd, false, true, append, this);
+                channel = FileChannelImpl.open(fd, path, false, true, append, this);
 
                 /*
                  * Increment fd's use count. Invoking the channel's close()
--- a/src/share/classes/java/io/ObjectInputStream.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/io/ObjectInputStream.java	Fri Jun 21 19:11:42 2013 -0700
@@ -2050,8 +2050,9 @@
      * This method should not be removed or its signature changed without
      * corresponding modifications to the above class.
      */
-    // REMIND: change name to something more accurate?
-    private static native ClassLoader latestUserDefinedLoader();
+    private static ClassLoader latestUserDefinedLoader() {
+        return sun.misc.VM.latestUserDefinedLoader();
+    }
 
     /**
      * Default GetField implementation.
--- a/src/share/classes/java/io/RandomAccessFile.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/io/RandomAccessFile.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 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
@@ -27,6 +27,7 @@
 
 import java.nio.channels.FileChannel;
 import sun.nio.ch.FileChannelImpl;
+import sun.misc.IoTrace;
 
 
 /**
@@ -62,6 +63,9 @@
     private FileChannel channel = null;
     private boolean rw;
 
+    /* The path of the referenced file */
+    private final String path;
+
     private Object closeLock = new Object();
     private volatile boolean closed = false;
 
@@ -228,8 +232,12 @@
         if (name == null) {
             throw new NullPointerException();
         }
+        if (file.isInvalid()) {
+            throw new FileNotFoundException("Invalid file path");
+        }
         fd = new FileDescriptor();
         fd.incrementAndGetUseCount();
+        this.path = name;
         open(name, imode);
     }
 
@@ -267,7 +275,7 @@
     public final FileChannel getChannel() {
         synchronized (this) {
             if (channel == null) {
-                channel = FileChannelImpl.open(fd, true, rw, this);
+                channel = FileChannelImpl.open(fd, path, true, rw, this);
 
                 /*
                  * FileDescriptor could be shared by FileInputStream or
@@ -315,7 +323,18 @@
      * @exception  IOException  if an I/O error occurs. Not thrown if
      *                          end-of-file has been reached.
      */
-    public native int read() throws IOException;
+    public int read() throws IOException {
+        Object traceContext = IoTrace.fileReadBegin(path);
+        int b = 0;
+        try {
+            b = read0();
+        } finally {
+            IoTrace.fileReadEnd(traceContext, b == -1 ? 0 : 1);
+        }
+        return b;
+    }
+
+    private native int read0() throws IOException;
 
     /**
      * Reads a sub array as a sequence of bytes.
@@ -324,7 +343,18 @@
      * @param len the number of bytes to read.
      * @exception IOException If an I/O error has occurred.
      */
-    private native int readBytes(byte b[], int off, int len) throws IOException;
+    private int readBytes(byte b[], int off, int len) throws IOException {
+        Object traceContext = IoTrace.fileReadBegin(path);
+        int bytesRead = 0;
+        try {
+            bytesRead = readBytes0(b, off, len);
+        } finally {
+            IoTrace.fileReadEnd(traceContext, bytesRead == -1 ? 0 : bytesRead);
+        }
+        return bytesRead;
+    }
+
+    private native int readBytes0(byte b[], int off, int len) throws IOException;
 
     /**
      * Reads up to <code>len</code> bytes of data from this file into an
@@ -463,17 +493,38 @@
      * @param      b   the <code>byte</code> to be written.
      * @exception  IOException  if an I/O error occurs.
      */
-    public native void write(int b) throws IOException;
+    public void write(int b) throws IOException {
+        Object traceContext = IoTrace.fileWriteBegin(path);
+        int bytesWritten = 0;
+        try {
+            write0(b);
+            bytesWritten = 1;
+        } finally {
+            IoTrace.fileWriteEnd(traceContext, bytesWritten);
+        }
+    }
+
+    private native void write0(int b) throws IOException;
 
     /**
      * Writes a sub array as a sequence of bytes.
      * @param b the data to be written
-
      * @param off the start offset in the data
      * @param len the number of bytes that are written
      * @exception IOException If an I/O error has occurred.
      */
-    private native void writeBytes(byte b[], int off, int len) throws IOException;
+    private void writeBytes(byte b[], int off, int len) throws IOException {
+        Object traceContext = IoTrace.fileWriteBegin(path);
+        int bytesWritten = 0;
+        try {
+            writeBytes0(b, off, len);
+            bytesWritten = len;
+        } finally {
+            IoTrace.fileWriteEnd(traceContext, bytesWritten);
+        }
+    }
+
+    private native void writeBytes0(byte b[], int off, int len) throws IOException;
 
     /**
      * Writes <code>b.length</code> bytes from the specified byte array
--- a/src/share/classes/java/lang/Integer.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/lang/Integer.java	Fri Jun 21 19:11:42 2013 -0700
@@ -607,7 +607,7 @@
                 int i = parseInt(integerCacheHighPropValue);
                 i = Math.max(i, 127);
                 // Maximum array size is Integer.MAX_VALUE
-                h = Math.min(i, Integer.MAX_VALUE - (-low));
+                h = Math.min(i, Integer.MAX_VALUE - (-low) -1);
             }
             high = h;
 
--- a/src/share/classes/java/lang/Throwable.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/lang/Throwable.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 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
@@ -453,9 +453,10 @@
      */
     public synchronized Throwable initCause(Throwable cause) {
         if (this.cause != this)
-            throw new IllegalStateException("Can't overwrite cause");
+            throw new IllegalStateException("Can't overwrite cause with " +
+                                            Objects.toString(cause, "a null"), this);
         if (cause == this)
-            throw new IllegalArgumentException("Self-causation not permitted");
+            throw new IllegalArgumentException("Self-causation not permitted", this);
         this.cause = cause;
         return this;
     }
@@ -1039,7 +1040,7 @@
      */
     public final synchronized void addSuppressed(Throwable exception) {
         if (exception == this)
-            throw new IllegalArgumentException(SELF_SUPPRESSION_MESSAGE);
+            throw new IllegalArgumentException(SELF_SUPPRESSION_MESSAGE, exception);
 
         if (exception == null)
             throw new NullPointerException(NULL_CAUSE_MESSAGE);
--- a/src/share/classes/java/lang/invoke/AdapterMethodHandle.java	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1204 +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.
- */
-
-package java.lang.invoke;
-
-import sun.invoke.util.VerifyType;
-import sun.invoke.util.Wrapper;
-import sun.invoke.util.ValueConversions;
-import java.util.Arrays;
-import java.util.ArrayList;
-import java.util.Collections;
-import static java.lang.invoke.MethodHandleNatives.Constants.*;
-import static java.lang.invoke.MethodHandleStatics.*;
-
-/**
- * This method handle performs simple conversion or checking of a single argument.
- * @author jrose
- */
-class AdapterMethodHandle extends BoundMethodHandle {
-
-    //MethodHandle vmtarget;   // next AMH or BMH in chain or final DMH
-    //Object       argument;   // parameter to the conversion if needed
-    //int          vmargslot;  // which argument slot is affected
-    private final int conversion;  // the type of conversion: RETYPE_ONLY, etc.
-
-    // Constructors in this class *must* be package scoped or private.
-    private AdapterMethodHandle(MethodHandle target, MethodType newType,
-                long conv, Object convArg) {
-        super(newType, convArg, newType.parameterSlotDepth(1+convArgPos(conv)));
-        this.conversion = convCode(conv);
-        // JVM might update VM-specific bits of conversion (ignore)
-        MethodHandleNatives.init(this, target, convArgPos(conv));
-    }
-    AdapterMethodHandle(MethodHandle target, MethodType newType,
-                long conv) {
-        this(target, newType, conv, null);
-    }
-
-    int getConversion() { return conversion; }
-
-    // TO DO:  When adapting another MH with a null conversion, clone
-    // the target and change its type, instead of adding another layer.
-
-    /** Can a JVM-level adapter directly implement the proposed
-     *  argument conversions, as if by fixed-arity MethodHandle.asType?
-     */
-    static boolean canPairwiseConvert(MethodType newType, MethodType oldType, int level) {
-        // same number of args, of course
-        int len = newType.parameterCount();
-        if (len != oldType.parameterCount())
-            return false;
-
-        // Check return type.
-        Class<?> exp = newType.returnType();
-        Class<?> ret = oldType.returnType();
-        if (!VerifyType.isNullConversion(ret, exp)) {
-            if (!convOpSupported(OP_COLLECT_ARGS))
-                return false;
-            if (!canConvertArgument(ret, exp, level))
-                return false;
-        }
-
-        // Check args pairwise.
-        for (int i = 0; i < len; i++) {
-            Class<?> src = newType.parameterType(i); // source type
-            Class<?> dst = oldType.parameterType(i); // destination type
-            if (!canConvertArgument(src, dst, level))
-                return false;
-        }
-
-        return true;
-    }
-
-    /** Can a JVM-level adapter directly implement the proposed
-     *  argument conversion, as if by fixed-arity MethodHandle.asType?
-     */
-    static boolean canConvertArgument(Class<?> src, Class<?> dst, int level) {
-        // ? Retool this logic to use RETYPE_ONLY, CHECK_CAST, etc., as opcodes,
-        // so we don't need to repeat so much decision making.
-        if (VerifyType.isNullConversion(src, dst)) {
-            return true;
-        } else if (convOpSupported(OP_COLLECT_ARGS)) {
-            // If we can build filters, we can convert anything to anything.
-            return true;
-        } else if (src.isPrimitive()) {
-            if (dst.isPrimitive())
-                return canPrimCast(src, dst);
-            else
-                return canBoxArgument(src, dst);
-        } else {
-            if (dst.isPrimitive())
-                return canUnboxArgument(src, dst, level);
-            else
-                return true;  // any two refs can be interconverted
-        }
-    }
-
-    /**
-     * Create a JVM-level adapter method handle to conform the given method
-     * handle to the similar newType, using only pairwise argument conversions.
-     * For each argument, convert incoming argument to the exact type needed.
-     * The argument conversions allowed are casting, boxing and unboxing,
-     * integral widening or narrowing, and floating point widening or narrowing.
-     * @param newType required call type
-     * @param target original method handle
-     * @param level which strength of conversion is allowed
-     * @return an adapter to the original handle with the desired new type,
-     *          or the original target if the types are already identical
-     *          or null if the adaptation cannot be made
-     */
-    static MethodHandle makePairwiseConvert(MethodType newType, MethodHandle target, int level) {
-        MethodType oldType = target.type();
-        if (newType == oldType)  return target;
-
-        if (!canPairwiseConvert(newType, oldType, level))
-            return null;
-        // (after this point, it is an assertion error to fail to convert)
-
-        // Find last non-trivial conversion (if any).
-        int lastConv = newType.parameterCount()-1;
-        while (lastConv >= 0) {
-            Class<?> src = newType.parameterType(lastConv); // source type
-            Class<?> dst = oldType.parameterType(lastConv); // destination type
-            if (isTrivialConversion(src, dst, level)) {
-                --lastConv;
-            } else {
-                break;
-            }
-        }
-
-        Class<?> needReturn = newType.returnType();
-        Class<?> haveReturn = oldType.returnType();
-        boolean retConv = !isTrivialConversion(haveReturn, needReturn, level);
-
-        // Now build a chain of one or more adapters.
-        MethodHandle adapter = target, adapter2;
-        MethodType midType = oldType;
-        for (int i = 0; i <= lastConv; i++) {
-            Class<?> src = newType.parameterType(i); // source type
-            Class<?> dst = midType.parameterType(i); // destination type
-            if (isTrivialConversion(src, dst, level)) {
-                // do nothing: difference is trivial
-                continue;
-            }
-            // Work the current type backward toward the desired caller type:
-            midType = midType.changeParameterType(i, src);
-            if (i == lastConv) {
-                // When doing the last (or only) real conversion,
-                // force all remaining null conversions to happen also.
-                MethodType lastMidType = newType;
-                if (retConv)  lastMidType = lastMidType.changeReturnType(haveReturn);
-                assert(VerifyType.isNullConversion(lastMidType, midType));
-                midType = lastMidType;
-            }
-
-            // Tricky case analysis follows.
-            // It parallels canConvertArgument() above.
-            if (src.isPrimitive()) {
-                if (dst.isPrimitive()) {
-                    adapter2 = makePrimCast(midType, adapter, i, dst);
-                } else {
-                    adapter2 = makeBoxArgument(midType, adapter, i, src);
-                }
-            } else {
-                if (dst.isPrimitive()) {
-                    // Caller has boxed a primitive.  Unbox it for the target.
-                    // The box type must correspond exactly to the primitive type.
-                    // This is simpler than the powerful set of widening
-                    // conversions supported by reflect.Method.invoke.
-                    // Those conversions require a big nest of if/then/else logic,
-                    // which we prefer to make a user responsibility.
-                    adapter2 = makeUnboxArgument(midType, adapter, i, dst, level);
-                } else {
-                    // Simple reference conversion.
-                    // Note:  Do not check for a class hierarchy relation
-                    // between src and dst.  In all cases a 'null' argument
-                    // will pass the cast conversion.
-                    adapter2 = makeCheckCast(midType, adapter, i, dst);
-                }
-            }
-            assert(adapter2 != null) : Arrays.asList(src, dst, midType, adapter, i, target, newType);
-            assert(adapter2.type() == midType);
-            adapter = adapter2;
-        }
-        if (retConv) {
-            adapter2 = makeReturnConversion(adapter, haveReturn, needReturn);
-            assert(adapter2 != null);
-            adapter = adapter2;
-        }
-        if (adapter.type() != newType) {
-            // Only trivial conversions remain.
-            adapter2 = makeRetypeOnly(newType, adapter);
-            assert(adapter2 != null);
-            adapter = adapter2;
-            // Actually, that's because there were no non-trivial ones:
-            assert(lastConv == -1 || retConv);
-        }
-        assert(adapter.type() == newType);
-        return adapter;
-    }
-
-    private static boolean isTrivialConversion(Class<?> src, Class<?> dst, int level) {
-        if (src == dst || dst == void.class)  return true;
-        if (!VerifyType.isNullConversion(src, dst))  return false;
-        if (level > 1)  return true;  // explicitCastArguments
-        boolean sp = src.isPrimitive();
-        boolean dp = dst.isPrimitive();
-        if (sp != dp)  return false;
-        if (sp) {
-            // in addition to being a null conversion, forbid boolean->int etc.
-            return Wrapper.forPrimitiveType(dst)
-                    .isConvertibleFrom(Wrapper.forPrimitiveType(src));
-        } else {
-            return dst.isAssignableFrom(src);
-        }
-    }
-
-    private static MethodHandle makeReturnConversion(MethodHandle target, Class<?> haveReturn, Class<?> needReturn) {
-        MethodHandle adjustReturn;
-        if (haveReturn == void.class) {
-            // synthesize a zero value for the given void
-            Object zero = Wrapper.forBasicType(needReturn).zero();
-            adjustReturn = MethodHandles.constant(needReturn, zero);
-        } else {
-            MethodType needConversion = MethodType.methodType(needReturn, haveReturn);
-            adjustReturn = MethodHandles.identity(needReturn).asType(needConversion);
-        }
-        if (!canCollectArguments(adjustReturn.type(), target.type(), 0, false)) {
-            assert(MethodHandleNatives.workaroundWithoutRicochetFrames());  // this code is deprecated
-            throw new InternalError("NYI");
-        }
-        return makeCollectArguments(adjustReturn, target, 0, false);
-    }
-
-    /**
-     * Create a JVM-level adapter method handle to permute the arguments
-     * of the given method.
-     * @param newType required call type
-     * @param target original method handle
-     * @param argumentMap for each target argument, position of its source in newType
-     * @return an adapter to the original handle with the desired new type,
-     *          or the original target if the types are already identical
-     *          and the permutation is null
-     * @throws IllegalArgumentException if the adaptation cannot be made
-     *          directly by a JVM-level adapter, without help from Java code
-     */
-    static MethodHandle makePermutation(MethodType newType, MethodHandle target,
-                int[] argumentMap) {
-        MethodType oldType = target.type();
-        boolean nullPermutation = true;
-        for (int i = 0; i < argumentMap.length; i++) {
-            int pos = argumentMap[i];
-            if (pos != i)
-                nullPermutation = false;
-            if (pos < 0 || pos >= newType.parameterCount()) {
-                argumentMap = new int[0]; break;
-            }
-        }
-        if (argumentMap.length != oldType.parameterCount())
-            throw newIllegalArgumentException("bad permutation: "+Arrays.toString(argumentMap));
-        if (nullPermutation) {
-            MethodHandle res = makePairwiseConvert(newType, target, 0);
-            // well, that was easy
-            if (res == null)
-                throw newIllegalArgumentException("cannot convert pairwise: "+newType);
-            return res;
-        }
-
-        // Check return type.  (Not much can be done with it.)
-        Class<?> exp = newType.returnType();
-        Class<?> ret = oldType.returnType();
-        if (!VerifyType.isNullConversion(ret, exp))
-            throw newIllegalArgumentException("bad return conversion for "+newType);
-
-        // See if the argument types match up.
-        for (int i = 0; i < argumentMap.length; i++) {
-            int j = argumentMap[i];
-            Class<?> src = newType.parameterType(j);
-            Class<?> dst = oldType.parameterType(i);
-            if (!VerifyType.isNullConversion(src, dst))
-                throw newIllegalArgumentException("bad argument #"+j+" conversion for "+newType);
-        }
-
-        // Now figure out a nice mix of SWAP, ROT, DUP, and DROP adapters.
-        // A workable greedy algorithm is as follows:
-        // Drop unused outgoing arguments (right to left: shallowest first).
-        // Duplicate doubly-used outgoing arguments (left to right: deepest first).
-        // Then the remaining problem is a true argument permutation.
-        // Marshal the outgoing arguments as required from left to right.
-        // That is, find the deepest outgoing stack position that does not yet
-        // have the correct argument value, and correct at least that position
-        // by swapping or rotating in the misplaced value (from a shallower place).
-        // If the misplaced value is followed by one or more consecutive values
-        // (also misplaced)  issue a rotation which brings as many as possible
-        // into position.  Otherwise make progress with either a swap or a
-        // rotation.  Prefer the swap as cheaper, but do not use it if it
-        // breaks a slot pair.  Prefer the rotation over the swap if it would
-        // preserve more consecutive values shallower than the target position.
-        // When more than one rotation will work (because the required value
-        // is already adjacent to the target position), then use a rotation
-        // which moves the old value in the target position adjacent to
-        // one of its consecutive values.  Also, prefer shorter rotation
-        // spans, since they use fewer memory cycles for shuffling.
-
-        throw new UnsupportedOperationException("NYI");
-    }
-
-    private static byte basicType(Class<?> type) {
-        if (type == null)  return T_VOID;
-        switch (Wrapper.forBasicType(type)) {
-            case BOOLEAN:  return T_BOOLEAN;
-            case CHAR:     return T_CHAR;
-            case FLOAT:    return T_FLOAT;
-            case DOUBLE:   return T_DOUBLE;
-            case BYTE:     return T_BYTE;
-            case SHORT:    return T_SHORT;
-            case INT:      return T_INT;
-            case LONG:     return T_LONG;
-            case OBJECT:   return T_OBJECT;
-            case VOID:     return T_VOID;
-        }
-        return 99; // T_ILLEGAL or some such
-    }
-
-    /** Number of stack slots for the given type.
-     *  Two for T_DOUBLE and T_FLOAT, one for the rest.
-     */
-    private static int type2size(int type) {
-        assert(type >= T_BOOLEAN && type <= T_OBJECT);
-        return (type == T_LONG || type == T_DOUBLE) ? 2 : 1;
-    }
-    private static int type2size(Class<?> type) {
-        return type2size(basicType(type));
-    }
-
-    /** The given stackMove is the number of slots pushed.
-     * It might be negative.  Scale it (multiply) by the
-     * VM's notion of how an address changes with a push,
-     * to get the raw SP change for stackMove.
-     * Then shift and mask it into the correct field.
-     */
-    private static long insertStackMove(int stackMove) {
-        // following variable must be long to avoid sign extension after '<<'
-        long spChange = stackMove * MethodHandleNatives.JVM_STACK_MOVE_UNIT;
-        return (spChange & CONV_STACK_MOVE_MASK) << CONV_STACK_MOVE_SHIFT;
-    }
-
-    static int extractStackMove(int convOp) {
-        int spChange = convOp >> CONV_STACK_MOVE_SHIFT;
-        return spChange / MethodHandleNatives.JVM_STACK_MOVE_UNIT;
-    }
-
-    static int extractStackMove(MethodHandle target) {
-        if (target instanceof AdapterMethodHandle) {
-            AdapterMethodHandle amh = (AdapterMethodHandle) target;
-            return extractStackMove(amh.getConversion());
-        } else {
-            return 0;
-        }
-    }
-
-    /** Construct an adapter conversion descriptor for a single-argument conversion. */
-    private static long makeConv(int convOp, int argnum, int src, int dest) {
-        assert(src  == (src  & CONV_TYPE_MASK));
-        assert(dest == (dest & CONV_TYPE_MASK));
-        assert(convOp >= OP_CHECK_CAST && convOp <= OP_PRIM_TO_REF || convOp == OP_COLLECT_ARGS);
-        int stackMove = type2size(dest) - type2size(src);
-        return ((long) argnum << 32 |
-                (long) convOp << CONV_OP_SHIFT |
-                (int)  src    << CONV_SRC_TYPE_SHIFT |
-                (int)  dest   << CONV_DEST_TYPE_SHIFT |
-                insertStackMove(stackMove)
-                );
-    }
-    private static long makeDupConv(int convOp, int argnum, int stackMove) {
-        // simple argument motion, requiring one slot to specify
-        assert(convOp == OP_DUP_ARGS || convOp == OP_DROP_ARGS);
-        byte src = 0, dest = 0;
-        return ((long) argnum << 32 |
-                (long) convOp << CONV_OP_SHIFT |
-                (int)  src    << CONV_SRC_TYPE_SHIFT |
-                (int)  dest   << CONV_DEST_TYPE_SHIFT |
-                insertStackMove(stackMove)
-                );
-    }
-    private static long makeSwapConv(int convOp, int srcArg, byte srcType, int destSlot, byte destType) {
-        // more complex argument motion, requiring two slots to specify
-        assert(convOp == OP_SWAP_ARGS || convOp == OP_ROT_ARGS);
-        return ((long) srcArg << 32 |
-                (long) convOp << CONV_OP_SHIFT |
-                (int)  srcType << CONV_SRC_TYPE_SHIFT |
-                (int)  destType << CONV_DEST_TYPE_SHIFT |
-                (int)  destSlot << CONV_VMINFO_SHIFT
-                );
-    }
-    private static long makeSpreadConv(int convOp, int argnum, int src, int dest, int stackMove) {
-        // spreading or collecting, at a particular slot location
-        assert(convOp == OP_SPREAD_ARGS || convOp == OP_COLLECT_ARGS || convOp == OP_FOLD_ARGS);
-        // src  = spread ? T_OBJECT (for array)  : common type of collected args (else void)
-        // dest = spread ? element type of array : result type of collector (can be void)
-        return ((long) argnum << 32 |
-                (long) convOp << CONV_OP_SHIFT |
-                (int)  src    << CONV_SRC_TYPE_SHIFT |
-                (int)  dest   << CONV_DEST_TYPE_SHIFT |
-                insertStackMove(stackMove)
-                );
-    }
-    static long makeConv(int convOp) {
-        assert(convOp == OP_RETYPE_ONLY || convOp == OP_RETYPE_RAW);
-        return ((long)-1 << 32) | (convOp << CONV_OP_SHIFT);   // stackMove, src, dst all zero
-    }
-    private static int convCode(long conv) {
-        return (int)conv;
-    }
-    private static int convArgPos(long conv) {
-        return (int)(conv >>> 32);
-    }
-    private static boolean convOpSupported(int convOp) {
-        assert(convOp >= 0 && convOp <= CONV_OP_LIMIT);
-        return ((1<<convOp) & MethodHandleNatives.CONV_OP_IMPLEMENTED_MASK) != 0;
-    }
-
-    /** One of OP_RETYPE_ONLY, etc. */
-    int conversionOp() { return (conversion & CONV_OP_MASK) >> CONV_OP_SHIFT; }
-
-    /* Return one plus the position of the first non-trivial difference
-     * between the given types.  This is not a symmetric operation;
-     * we are considering adapting the targetType to adapterType.
-     * Trivial differences are those which could be ignored by the JVM
-     * without subverting the verifier.  Otherwise, adaptable differences
-     * are ones for which we could create an adapter to make the type change.
-     * Return zero if there are no differences (other than trivial ones).
-     * Return 1+N if N is the only adaptable argument difference.
-     * Return the -2-N where N is the first of several adaptable
-     * argument differences.
-     * Return -1 if there there are differences which are not adaptable.
-     */
-    private static int diffTypes(MethodType adapterType,
-                                 MethodType targetType,
-                                 boolean raw) {
-        int diff;
-        diff = diffReturnTypes(adapterType, targetType, raw);
-        if (diff != 0)  return diff;
-        int nargs = adapterType.parameterCount();
-        if (nargs != targetType.parameterCount())
-            return -1;
-        diff = diffParamTypes(adapterType, 0, targetType, 0, nargs, raw);
-        //System.out.println("diff "+adapterType);
-        //System.out.println("  "+diff+" "+targetType);
-        return diff;
-    }
-    private static int diffReturnTypes(MethodType adapterType,
-                                       MethodType targetType,
-                                       boolean raw) {
-        Class<?> src = targetType.returnType();
-        Class<?> dst = adapterType.returnType();
-        if ((!raw
-             ? VerifyType.canPassUnchecked(src, dst)
-             : VerifyType.canPassRaw(src, dst)
-             ) > 0)
-            return 0;  // no significant difference
-        if (raw && !src.isPrimitive() && !dst.isPrimitive())
-            return 0;  // can force a reference return (very carefully!)
-        //if (false)  return 1;  // never adaptable!
-        return -1;  // some significant difference
-    }
-    private static int diffParamTypes(MethodType adapterType, int astart,
-                                      MethodType targetType, int tstart,
-                                      int nargs, boolean raw) {
-        assert(nargs >= 0);
-        int res = 0;
-        for (int i = 0; i < nargs; i++) {
-            Class<?> src  = adapterType.parameterType(astart+i);
-            Class<?> dest = targetType.parameterType(tstart+i);
-            if ((!raw
-                 ? VerifyType.canPassUnchecked(src, dest)
-                 : VerifyType.canPassRaw(src, dest)
-                ) <= 0) {
-                // found a difference; is it the only one so far?
-                if (res != 0)
-                    return -1-res; // return -2-i for prev. i
-                res = 1+i;
-            }
-        }
-        return res;
-    }
-
-    /** Can a retyping adapter (alone) validly convert the target to newType? */
-    static boolean canRetypeOnly(MethodType newType, MethodType targetType) {
-        return canRetype(newType, targetType, false);
-    }
-    /** Can a retyping adapter (alone) convert the target to newType?
-     *  It is allowed to widen subword types and void to int, to make bitwise
-     *  conversions between float/int and double/long, and to perform unchecked
-     *  reference conversions on return.  This last feature requires that the
-     *  caller be trusted, and perform explicit cast conversions on return values.
-     */
-    static boolean canRetypeRaw(MethodType newType, MethodType targetType) {
-        return canRetype(newType, targetType, true);
-    }
-    static boolean canRetype(MethodType newType, MethodType targetType, boolean raw) {
-        if (!convOpSupported(raw ? OP_RETYPE_RAW : OP_RETYPE_ONLY))  return false;
-        int diff = diffTypes(newType, targetType, raw);
-        // %%% This assert is too strong.  Factor diff into VerifyType and reconcile.
-        assert(raw || (diff == 0) == VerifyType.isNullConversion(newType, targetType));
-        return diff == 0;
-    }
-
-    /** Factory method:  Performs no conversions; simply retypes the adapter.
-     *  Allows unchecked argument conversions pairwise, if they are safe.
-     *  Returns null if not possible.
-     */
-    static MethodHandle makeRetypeOnly(MethodType newType, MethodHandle target) {
-        return makeRetype(newType, target, false);
-    }
-    static MethodHandle makeRetypeRaw(MethodType newType, MethodHandle target) {
-        return makeRetype(newType, target, true);
-    }
-    static MethodHandle makeRetype(MethodType newType, MethodHandle target, boolean raw) {
-        MethodType oldType = target.type();
-        if (oldType == newType)  return target;
-        if (!canRetype(newType, oldType, raw))
-            return null;
-        // TO DO:  clone the target guy, whatever he is, with new type.
-        return new AdapterMethodHandle(target, newType, makeConv(raw ? OP_RETYPE_RAW : OP_RETYPE_ONLY));
-    }
-
-    static MethodHandle makeVarargsCollector(MethodHandle target, Class<?> arrayType) {
-        MethodType type = target.type();
-        int last = type.parameterCount() - 1;
-        if (type.parameterType(last) != arrayType)
-            target = target.asType(type.changeParameterType(last, arrayType));
-        target = target.asFixedArity();  // make sure this attribute is turned off
-        return new AsVarargsCollector(target, arrayType);
-    }
-
-    static class AsVarargsCollector extends AdapterMethodHandle {
-        final MethodHandle target;
-        final Class<?> arrayType;
-        MethodHandle cache;
-
-        AsVarargsCollector(MethodHandle target, Class<?> arrayType) {
-            super(target, target.type(), makeConv(OP_RETYPE_ONLY));
-            this.target = target;
-            this.arrayType = arrayType;
-            this.cache = target.asCollector(arrayType, 0);
-        }
-
-        @Override
-        public boolean isVarargsCollector() {
-            return true;
-        }
-
-        @Override
-        public MethodHandle asFixedArity() {
-            return target;
-        }
-
-        @Override
-        public MethodHandle asType(MethodType newType) {
-            MethodType type = this.type();
-            int collectArg = type.parameterCount() - 1;
-            int newArity = newType.parameterCount();
-            if (newArity == collectArg+1 &&
-                type.parameterType(collectArg).isAssignableFrom(newType.parameterType(collectArg))) {
-                // if arity and trailing parameter are compatible, do normal thing
-                return super.asType(newType);
-            }
-            // check cache
-            if (cache.type().parameterCount() == newArity)
-                return cache.asType(newType);
-            // build and cache a collector
-            int arrayLength = newArity - collectArg;
-            MethodHandle collector;
-            try {
-                collector = target.asCollector(arrayType, arrayLength);
-            } catch (IllegalArgumentException ex) {
-                throw new WrongMethodTypeException("cannot build collector");
-            }
-            cache = collector;
-            return collector.asType(newType);
-        }
-    }
-
-    /** Can a checkcast adapter validly convert the target to newType?
-     *  The JVM supports all kind of reference casts, even silly ones.
-     */
-    static boolean canCheckCast(MethodType newType, MethodType targetType,
-                int arg, Class<?> castType) {
-        if (!convOpSupported(OP_CHECK_CAST))  return false;
-        Class<?> src = newType.parameterType(arg);
-        Class<?> dst = targetType.parameterType(arg);
-        if (!canCheckCast(src, castType)
-                || !VerifyType.isNullConversion(castType, dst))
-            return false;
-        int diff = diffTypes(newType, targetType, false);
-        return (diff == arg+1) || (diff == 0);  // arg is sole non-trivial diff
-    }
-    /** Can an primitive conversion adapter validly convert src to dst? */
-    static boolean canCheckCast(Class<?> src, Class<?> dst) {
-        return (!src.isPrimitive() && !dst.isPrimitive());
-    }
-
-    /** Factory method:  Forces a cast at the given argument.
-     *  The castType is the target of the cast, and can be any type
-     *  with a null conversion to the corresponding target parameter.
-     *  Return null if this cannot be done.
-     */
-    static MethodHandle makeCheckCast(MethodType newType, MethodHandle target,
-                int arg, Class<?> castType) {
-        if (!canCheckCast(newType, target.type(), arg, castType))
-            return null;
-        long conv = makeConv(OP_CHECK_CAST, arg, T_OBJECT, T_OBJECT);
-        return new AdapterMethodHandle(target, newType, conv, castType);
-    }
-
-    /** Can an primitive conversion adapter validly convert the target to newType?
-     *  The JVM currently supports all conversions except those between
-     *  floating and integral types.
-     */
-    static boolean canPrimCast(MethodType newType, MethodType targetType,
-                int arg, Class<?> convType) {
-        if (!convOpSupported(OP_PRIM_TO_PRIM))  return false;
-        Class<?> src = newType.parameterType(arg);
-        Class<?> dst = targetType.parameterType(arg);
-        if (!canPrimCast(src, convType)
-                || !VerifyType.isNullConversion(convType, dst))
-            return false;
-        int diff = diffTypes(newType, targetType, false);
-        return (diff == arg+1);  // arg is sole non-trivial diff
-    }
-    /** Can an primitive conversion adapter validly convert src to dst? */
-    static boolean canPrimCast(Class<?> src, Class<?> dst) {
-        if (src == dst || !src.isPrimitive() || !dst.isPrimitive()) {
-            return false;
-        } else {
-            boolean sflt = Wrapper.forPrimitiveType(src).isFloating();
-            boolean dflt = Wrapper.forPrimitiveType(dst).isFloating();
-            return !(sflt | dflt);  // no float support at present
-        }
-    }
-
-    /** Factory method:  Truncate the given argument with zero or sign extension,
-     *  and/or convert between single and doubleword versions of integer or float.
-     *  The convType is the target of the conversion, and can be any type
-     *  with a null conversion to the corresponding target parameter.
-     *  Return null if this cannot be done.
-     */
-    static MethodHandle makePrimCast(MethodType newType, MethodHandle target,
-                int arg, Class<?> convType) {
-        Class<?> src = newType.parameterType(arg);
-        if (canPrimCast(src, convType))
-            return makePrimCastOnly(newType, target, arg, convType);
-        Class<?> dst = convType;
-        boolean sflt = Wrapper.forPrimitiveType(src).isFloating();
-        boolean dflt = Wrapper.forPrimitiveType(dst).isFloating();
-        if (sflt | dflt) {
-            MethodHandle convMethod;
-            if (sflt)
-                convMethod = ((src == double.class)
-                        ? ValueConversions.convertFromDouble(dst)
-                        : ValueConversions.convertFromFloat(dst));
-            else
-                convMethod = ((dst == double.class)
-                        ? ValueConversions.convertToDouble(src)
-                        : ValueConversions.convertToFloat(src));
-            long conv = makeConv(OP_COLLECT_ARGS, arg, basicType(src), basicType(dst));
-            return new AdapterMethodHandle(target, newType, conv, convMethod);
-        }
-        throw new InternalError("makePrimCast");
-    }
-    static MethodHandle makePrimCastOnly(MethodType newType, MethodHandle target,
-                int arg, Class<?> convType) {
-        MethodType oldType = target.type();
-        if (!canPrimCast(newType, oldType, arg, convType))
-            return null;
-        Class<?> src = newType.parameterType(arg);
-        long conv = makeConv(OP_PRIM_TO_PRIM, arg, basicType(src), basicType(convType));
-        return new AdapterMethodHandle(target, newType, conv);
-    }
-
-    /** Can an unboxing conversion validly convert src to dst?
-     *  The JVM currently supports all kinds of casting and unboxing.
-     *  The convType is the unboxed type; it can be either a primitive or wrapper.
-     */
-    static boolean canUnboxArgument(MethodType newType, MethodType targetType,
-                int arg, Class<?> convType, int level) {
-        if (!convOpSupported(OP_REF_TO_PRIM))  return false;
-        Class<?> src = newType.parameterType(arg);
-        Class<?> dst = targetType.parameterType(arg);
-        Class<?> boxType = Wrapper.asWrapperType(convType);
-        convType = Wrapper.asPrimitiveType(convType);
-        if (!canCheckCast(src, boxType)
-                || boxType == convType
-                || !VerifyType.isNullConversion(convType, dst))
-            return false;
-        int diff = diffTypes(newType, targetType, false);
-        return (diff == arg+1);  // arg is sole non-trivial diff
-    }
-    /** Can an primitive unboxing adapter validly convert src to dst? */
-    static boolean canUnboxArgument(Class<?> src, Class<?> dst, int level) {
-        assert(dst.isPrimitive());
-        // if we have JVM support for boxing, we can also do complex unboxing
-        if (convOpSupported(OP_PRIM_TO_REF))  return true;
-        Wrapper dw = Wrapper.forPrimitiveType(dst);
-        // Level 0 means cast and unbox.  This works on any reference.
-        if (level == 0)  return !src.isPrimitive();
-        assert(level >= 0 && level <= 2);
-        // Levels 1 and 2 allow widening and/or narrowing conversions.
-        // These are not supported directly by the JVM.
-        // But if the input reference is monomorphic, we can do it.
-        return dw.wrapperType() == src;
-    }
-
-    /** Factory method:  Unbox the given argument.
-     *  Return null if this cannot be done.
-     */
-    static MethodHandle makeUnboxArgument(MethodType newType, MethodHandle target,
-                int arg, Class<?> convType, int level) {
-        MethodType oldType = target.type();
-        Class<?> src = newType.parameterType(arg);
-        Class<?> dst = oldType.parameterType(arg);
-        Class<?> boxType = Wrapper.asWrapperType(convType);
-        Class<?> primType = Wrapper.asPrimitiveType(convType);
-        if (!canUnboxArgument(newType, oldType, arg, convType, level))
-            return null;
-        MethodType castDone = newType;
-        if (!VerifyType.isNullConversion(src, boxType)) {
-            // Examples:  Object->int, Number->int, Comparable->int; Byte->int, Character->int
-            if (level != 0) {
-                // must include additional conversions
-                if (src == Object.class || !Wrapper.isWrapperType(src)) {
-                    // src must be examined at runtime, to detect Byte, Character, etc.
-                    MethodHandle unboxMethod = (level == 1
-                                                ? ValueConversions.unbox(dst)
-                                                : ValueConversions.unboxCast(dst));
-                    long conv = makeConv(OP_COLLECT_ARGS, arg, basicType(src), basicType(dst));
-                    return new AdapterMethodHandle(target, newType, conv, unboxMethod);
-                }
-                // Example: Byte->int
-                // Do this by reformulating the problem to Byte->byte.
-                Class<?> srcPrim = Wrapper.forWrapperType(src).primitiveType();
-                MethodType midType = newType.changeParameterType(arg, srcPrim);
-                MethodHandle fixPrim; // makePairwiseConvert(midType, target, 0);
-                if (canPrimCast(midType, oldType, arg, dst))
-                    fixPrim = makePrimCast(midType, target, arg, dst);
-                else
-                    fixPrim = target;
-                return makeUnboxArgument(newType, fixPrim, arg, srcPrim, 0);
-            }
-            castDone = newType.changeParameterType(arg, boxType);
-        }
-        long conv = makeConv(OP_REF_TO_PRIM, arg, T_OBJECT, basicType(primType));
-        MethodHandle adapter = new AdapterMethodHandle(target, castDone, conv, boxType);
-        if (castDone == newType)
-            return adapter;
-        return makeCheckCast(newType, adapter, arg, boxType);
-    }
-
-    /** Can a boxing conversion validly convert src to dst? */
-    static boolean canBoxArgument(MethodType newType, MethodType targetType,
-                int arg, Class<?> convType) {
-        if (!convOpSupported(OP_PRIM_TO_REF))  return false;
-        Class<?> src = newType.parameterType(arg);
-        Class<?> dst = targetType.parameterType(arg);
-        Class<?> boxType = Wrapper.asWrapperType(convType);
-        convType = Wrapper.asPrimitiveType(convType);
-        if (!canCheckCast(boxType, dst)
-                || boxType == convType
-                || !VerifyType.isNullConversion(src, convType))
-            return false;
-        int diff = diffTypes(newType, targetType, false);
-        return (diff == arg+1);  // arg is sole non-trivial diff
-    }
-
-    /** Can an primitive boxing adapter validly convert src to dst? */
-    static boolean canBoxArgument(Class<?> src, Class<?> dst) {
-        if (!convOpSupported(OP_PRIM_TO_REF))  return false;
-        return (src.isPrimitive() && !dst.isPrimitive());
-    }
-
-    /** Factory method:  Box the given argument.
-     *  Return null if this cannot be done.
-     */
-    static MethodHandle makeBoxArgument(MethodType newType, MethodHandle target,
-                int arg, Class<?> convType) {
-        MethodType oldType = target.type();
-        Class<?> src = newType.parameterType(arg);
-        Class<?> dst = oldType.parameterType(arg);
-        Class<?> boxType = Wrapper.asWrapperType(convType);
-        Class<?> primType = Wrapper.asPrimitiveType(convType);
-        if (!canBoxArgument(newType, oldType, arg, convType)) {
-            return null;
-        }
-        if (!VerifyType.isNullConversion(boxType, dst))
-            target = makeCheckCast(oldType.changeParameterType(arg, boxType), target, arg, dst);
-        MethodHandle boxerMethod = ValueConversions.box(Wrapper.forPrimitiveType(primType));
-        long conv = makeConv(OP_PRIM_TO_REF, arg, basicType(primType), T_OBJECT);
-        return new AdapterMethodHandle(target, newType, conv, boxerMethod);
-    }
-
-    /** Can an adapter simply drop arguments to convert the target to newType? */
-    static boolean canDropArguments(MethodType newType, MethodType targetType,
-                int dropArgPos, int dropArgCount) {
-        if (dropArgCount == 0)
-            return canRetypeOnly(newType, targetType);
-        if (!convOpSupported(OP_DROP_ARGS))  return false;
-        if (diffReturnTypes(newType, targetType, false) != 0)
-            return false;
-        int nptypes = newType.parameterCount();
-        // parameter types must be the same up to the drop point
-        if (dropArgPos != 0 && diffParamTypes(newType, 0, targetType, 0, dropArgPos, false) != 0)
-            return false;
-        int afterPos = dropArgPos + dropArgCount;
-        int afterCount = nptypes - afterPos;
-        if (dropArgPos < 0 || dropArgPos >= nptypes ||
-            dropArgCount < 1 || afterPos > nptypes ||
-            targetType.parameterCount() != nptypes - dropArgCount)
-            return false;
-        // parameter types after the drop point must also be the same
-        if (afterCount != 0 && diffParamTypes(newType, afterPos, targetType, dropArgPos, afterCount, false) != 0)
-            return false;
-        return true;
-    }
-
-    /** Factory method:  Drop selected arguments.
-     *  Allow unchecked retyping of remaining arguments, pairwise.
-     *  Return null if this is not possible.
-     */
-    static MethodHandle makeDropArguments(MethodType newType, MethodHandle target,
-                int dropArgPos, int dropArgCount) {
-        if (dropArgCount == 0)
-            return makeRetypeOnly(newType, target);
-        if (!canDropArguments(newType, target.type(), dropArgPos, dropArgCount))
-            return null;
-        // in  arglist: [0: ...keep1 | dpos: drop... | dpos+dcount: keep2... ]
-        // out arglist: [0: ...keep1 |                        dpos: keep2... ]
-        int keep2InPos  = dropArgPos + dropArgCount;
-        int dropSlot    = newType.parameterSlotDepth(keep2InPos);
-        int keep1InSlot = newType.parameterSlotDepth(dropArgPos);
-        int slotCount   = keep1InSlot - dropSlot;
-        assert(slotCount >= dropArgCount);
-        assert(target.type().parameterSlotCount() + slotCount == newType.parameterSlotCount());
-        long conv = makeDupConv(OP_DROP_ARGS, dropArgPos + dropArgCount - 1, -slotCount);
-        return new AdapterMethodHandle(target, newType, conv);
-    }
-
-    /** Can an adapter duplicate an argument to convert the target to newType? */
-    static boolean canDupArguments(MethodType newType, MethodType targetType,
-                int dupArgPos, int dupArgCount) {
-        if (!convOpSupported(OP_DUP_ARGS))  return false;
-        if (diffReturnTypes(newType, targetType, false) != 0)
-            return false;
-        int nptypes = newType.parameterCount();
-        if (dupArgCount < 0 || dupArgPos + dupArgCount > nptypes)
-            return false;
-        if (targetType.parameterCount() != nptypes + dupArgCount)
-            return false;
-        // parameter types must be the same up to the duplicated arguments
-        if (diffParamTypes(newType, 0, targetType, 0, nptypes, false) != 0)
-            return false;
-        // duplicated types must be, well, duplicates
-        if (diffParamTypes(newType, dupArgPos, targetType, nptypes, dupArgCount, false) != 0)
-            return false;
-        return true;
-    }
-
-    /** Factory method:  Duplicate the selected argument.
-     *  Return null if this is not possible.
-     */
-    static MethodHandle makeDupArguments(MethodType newType, MethodHandle target,
-                int dupArgPos, int dupArgCount) {
-        if (!canDupArguments(newType, target.type(), dupArgPos, dupArgCount))
-            return null;
-        if (dupArgCount == 0)
-            return target;
-        // in  arglist: [0: ...keep1 | dpos: dup... | dpos+dcount: keep2... ]
-        // out arglist: [0: ...keep1 | dpos: dup... | dpos+dcount: keep2... | dup... ]
-        int keep2InPos  = dupArgPos + dupArgCount;
-        int dupSlot     = newType.parameterSlotDepth(keep2InPos);
-        int keep1InSlot = newType.parameterSlotDepth(dupArgPos);
-        int slotCount   = keep1InSlot - dupSlot;
-        assert(target.type().parameterSlotCount() - slotCount == newType.parameterSlotCount());
-        long conv = makeDupConv(OP_DUP_ARGS, dupArgPos + dupArgCount - 1, slotCount);
-        return new AdapterMethodHandle(target, newType, conv);
-    }
-
-    /** Can an adapter swap two arguments to convert the target to newType? */
-    static boolean canSwapArguments(MethodType newType, MethodType targetType,
-                int swapArg1, int swapArg2) {
-        if (!convOpSupported(OP_SWAP_ARGS))  return false;
-        if (diffReturnTypes(newType, targetType, false) != 0)
-            return false;
-        if (swapArg1 >= swapArg2)  return false;  // caller resp
-        int nptypes = newType.parameterCount();
-        if (targetType.parameterCount() != nptypes)
-            return false;
-        if (swapArg1 < 0 || swapArg2 >= nptypes)
-            return false;
-        if (diffParamTypes(newType, 0, targetType, 0, swapArg1, false) != 0)
-            return false;
-        if (diffParamTypes(newType, swapArg1, targetType, swapArg2, 1, false) != 0)
-            return false;
-        if (diffParamTypes(newType, swapArg1+1, targetType, swapArg1+1, swapArg2-swapArg1-1, false) != 0)
-            return false;
-        if (diffParamTypes(newType, swapArg2, targetType, swapArg1, 1, false) != 0)
-            return false;
-        if (diffParamTypes(newType, swapArg2+1, targetType, swapArg2+1, nptypes-swapArg2-1, false) != 0)
-            return false;
-        return true;
-    }
-
-    /** Factory method:  Swap the selected arguments.
-     *  Return null if this is not possible.
-     */
-    static MethodHandle makeSwapArguments(MethodType newType, MethodHandle target,
-                int swapArg1, int swapArg2) {
-        if (swapArg1 == swapArg2)
-            return target;
-        if (swapArg1 > swapArg2) { int t = swapArg1; swapArg1 = swapArg2; swapArg2 = t; }
-        if (type2size(newType.parameterType(swapArg1)) !=
-            type2size(newType.parameterType(swapArg2))) {
-            // turn a swap into a pair of rotates:
-            // [x a b c y] rot2(-1,argc=5) => [a b c y x] rot1(+1,argc=4) => target[y a b c x]
-            int argc = swapArg2 - swapArg1 + 1;
-            final int ROT = 1;
-            ArrayList<Class<?>> rot1Params = new ArrayList<Class<?>>(target.type().parameterList());
-            Collections.rotate(rot1Params.subList(swapArg1, swapArg1 + argc), -ROT);
-            MethodType rot1Type = MethodType.methodType(target.type().returnType(), rot1Params);
-            MethodHandle rot1 = makeRotateArguments(rot1Type, target, swapArg1, argc, +ROT);
-            assert(rot1 != null);
-            if (argc == 2)  return rot1;
-            MethodHandle rot2 = makeRotateArguments(newType, rot1, swapArg1, argc-1, -ROT);
-            assert(rot2 != null);
-            return rot2;
-        }
-        if (!canSwapArguments(newType, target.type(), swapArg1, swapArg2))
-            return null;
-        Class<?> type1 = newType.parameterType(swapArg1);
-        Class<?> type2 = newType.parameterType(swapArg2);
-        // in  arglist: [0: ...keep1 | pos1: a1 | pos1+1: keep2... | pos2: a2 | pos2+1: keep3... ]
-        // out arglist: [0: ...keep1 | pos1: a2 | pos1+1: keep2... | pos2: a1 | pos2+1: keep3... ]
-        int swapSlot2  = newType.parameterSlotDepth(swapArg2 + 1);
-        long conv = makeSwapConv(OP_SWAP_ARGS, swapArg1, basicType(type1), swapSlot2, basicType(type2));
-        return new AdapterMethodHandle(target, newType, conv);
-    }
-
-    static int positiveRotation(int argCount, int rotateBy) {
-        assert(argCount > 0);
-        if (rotateBy >= 0) {
-            if (rotateBy < argCount)
-                return rotateBy;
-            return rotateBy % argCount;
-        } else if (rotateBy >= -argCount) {
-            return rotateBy + argCount;
-        } else {
-            return (-1-((-1-rotateBy) % argCount)) + argCount;
-        }
-    }
-
-    final static int MAX_ARG_ROTATION = 1;
-
-    /** Can an adapter rotate arguments to convert the target to newType? */
-    static boolean canRotateArguments(MethodType newType, MethodType targetType,
-                int firstArg, int argCount, int rotateBy) {
-        if (!convOpSupported(OP_ROT_ARGS))  return false;
-        rotateBy = positiveRotation(argCount, rotateBy);
-        if (rotateBy == 0)  return false;  // no rotation
-        if (rotateBy > MAX_ARG_ROTATION && rotateBy < argCount - MAX_ARG_ROTATION)
-            return false;  // too many argument positions
-        // Rotate incoming args right N to the out args, N in 1..(argCouunt-1).
-        if (diffReturnTypes(newType, targetType, false) != 0)
-            return false;
-        int nptypes = newType.parameterCount();
-        if (targetType.parameterCount() != nptypes)
-            return false;
-        if (firstArg < 0 || firstArg >= nptypes)  return false;
-        int argLimit = firstArg + argCount;
-        if (argLimit > nptypes)  return false;
-        if (diffParamTypes(newType, 0, targetType, 0, firstArg, false) != 0)
-            return false;
-        int newChunk1 = argCount - rotateBy, newChunk2 = rotateBy;
-        // swap new chunk1 with target chunk2
-        if (diffParamTypes(newType, firstArg, targetType, argLimit-newChunk1, newChunk1, false) != 0)
-            return false;
-        // swap new chunk2 with target chunk1
-        if (diffParamTypes(newType, firstArg+newChunk1, targetType, firstArg, newChunk2, false) != 0)
-            return false;
-        return true;
-    }
-
-    /** Factory method:  Rotate the selected argument range.
-     *  Return null if this is not possible.
-     */
-    static MethodHandle makeRotateArguments(MethodType newType, MethodHandle target,
-                int firstArg, int argCount, int rotateBy) {
-        rotateBy = positiveRotation(argCount, rotateBy);
-        if (!canRotateArguments(newType, target.type(), firstArg, argCount, rotateBy))
-            return null;
-        // Decide whether it should be done as a right or left rotation,
-        // on the JVM stack.  Return the number of stack slots to rotate by,
-        // positive if right, negative if left.
-        int limit = firstArg + argCount;
-        int depth0 = newType.parameterSlotDepth(firstArg);
-        int depth1 = newType.parameterSlotDepth(limit-rotateBy);
-        int depth2 = newType.parameterSlotDepth(limit);
-        int chunk1Slots = depth0 - depth1; assert(chunk1Slots > 0);
-        int chunk2Slots = depth1 - depth2; assert(chunk2Slots > 0);
-        // From here on out, it assumes a single-argument shift.
-        assert(MAX_ARG_ROTATION == 1);
-        int srcArg, dstArg;
-        int dstSlot;
-        int moveChunk;
-        if (rotateBy == 1) {
-            // Rotate right/down N (rotateBy = +N, N small, c2 small):
-            // in  arglist: [0: ...keep1 | arg1: c1...  | limit-N: c2 | limit: keep2... ]
-            // out arglist: [0: ...keep1 | arg1: c2 | arg1+N: c1...   | limit: keep2... ]
-            srcArg = limit-1;
-            dstArg = firstArg;
-            //dstSlot = depth0 - chunk2Slots;  //chunk2Slots is not relevant
-            dstSlot = depth0 + MethodHandleNatives.OP_ROT_ARGS_DOWN_LIMIT_BIAS;
-            moveChunk = chunk2Slots;
-        } else {
-            // Rotate left/up N (rotateBy = -N, N small, c1 small):
-            // in  arglist: [0: ...keep1 | arg1: c1 | arg1+N: c2...   | limit: keep2... ]
-            // out arglist: [0: ...keep1 | arg1: c2 ... | limit-N: c1 | limit: keep2... ]
-            srcArg = firstArg;
-            dstArg = limit-1;
-            dstSlot = depth2;
-            moveChunk = chunk1Slots;
-        }
-        byte srcType = basicType(newType.parameterType(srcArg));
-        byte dstType = basicType(newType.parameterType(dstArg));
-        assert(moveChunk == type2size(srcType));
-        long conv = makeSwapConv(OP_ROT_ARGS, srcArg, srcType, dstSlot, dstType);
-        return new AdapterMethodHandle(target, newType, conv);
-    }
-
-    /** Can an adapter spread an argument to convert the target to newType? */
-    static boolean canSpreadArguments(MethodType newType, MethodType targetType,
-                Class<?> spreadArgType, int spreadArgPos, int spreadArgCount) {
-        if (!convOpSupported(OP_SPREAD_ARGS))  return false;
-        if (diffReturnTypes(newType, targetType, false) != 0)
-            return false;
-        int nptypes = newType.parameterCount();
-        // parameter types must be the same up to the spread point
-        if (spreadArgPos != 0 && diffParamTypes(newType, 0, targetType, 0, spreadArgPos, false) != 0)
-            return false;
-        int afterPos = spreadArgPos + spreadArgCount;
-        int afterCount = nptypes - (spreadArgPos + 1);
-        if (spreadArgPos < 0 || spreadArgPos >= nptypes ||
-            spreadArgCount < 0 ||
-            targetType.parameterCount() != afterPos + afterCount)
-            return false;
-        // parameter types after the spread point must also be the same
-        if (afterCount != 0 && diffParamTypes(newType, spreadArgPos+1, targetType, afterPos, afterCount, false) != 0)
-            return false;
-        // match the array element type to the spread arg types
-        Class<?> rawSpreadArgType = newType.parameterType(spreadArgPos);
-        if (rawSpreadArgType != spreadArgType && !canCheckCast(rawSpreadArgType, spreadArgType))
-            return false;
-        for (int i = 0; i < spreadArgCount; i++) {
-            Class<?> src = VerifyType.spreadArgElementType(spreadArgType, i);
-            Class<?> dst = targetType.parameterType(spreadArgPos + i);
-            if (src == null || !canConvertArgument(src, dst, 1))
-                return false;
-        }
-        return true;
-    }
-
-
-    /** Factory method:  Spread selected argument. */
-    static MethodHandle makeSpreadArguments(MethodType newType, MethodHandle target,
-                Class<?> spreadArgType, int spreadArgPos, int spreadArgCount) {
-        // FIXME: Get rid of newType; derive new arguments from structure of spreadArgType
-        MethodType targetType = target.type();
-        assert(canSpreadArguments(newType, targetType, spreadArgType, spreadArgPos, spreadArgCount))
-            : "[newType, targetType, spreadArgType, spreadArgPos, spreadArgCount] = "
-              + Arrays.asList(newType, targetType, spreadArgType, spreadArgPos, spreadArgCount);
-        // dest is not significant; remove?
-        int dest = T_VOID;
-        for (int i = 0; i < spreadArgCount; i++) {
-            Class<?> arg = VerifyType.spreadArgElementType(spreadArgType, i);
-            if (arg == null)  arg = Object.class;
-            int dest2 = basicType(arg);
-            if      (dest == T_VOID)  dest = dest2;
-            else if (dest != dest2)   dest = T_VOID;
-            if (dest == T_VOID)  break;
-            targetType = targetType.changeParameterType(spreadArgPos + i, arg);
-        }
-        target = target.asType(targetType);
-        int arrayArgSize = 1;  // always a reference
-        // in  arglist: [0: ...keep1 | spos: spreadArg | spos+1:      keep2... ]
-        // out arglist: [0: ...keep1 | spos: spread... | spos+scount: keep2... ]
-        int keep2OutPos  = spreadArgPos + spreadArgCount;
-        int keep1OutSlot = targetType.parameterSlotDepth(spreadArgPos);   // leading edge of |spread...|
-        int spreadSlot   = targetType.parameterSlotDepth(keep2OutPos);    // trailing edge of |spread...|
-        assert(spreadSlot == newType.parameterSlotDepth(spreadArgPos+arrayArgSize));
-        int slotCount    = keep1OutSlot - spreadSlot;                     // slots in |spread...|
-        assert(slotCount >= spreadArgCount);
-        int stackMove = - arrayArgSize + slotCount;  // pop array, push N slots
-        long conv = makeSpreadConv(OP_SPREAD_ARGS, spreadArgPos, T_OBJECT, dest, stackMove);
-        MethodHandle res = new AdapterMethodHandle(target, newType, conv, spreadArgType);
-        assert(res.type().parameterType(spreadArgPos) == spreadArgType);
-        return res;
-    }
-
-    /** Can an adapter collect a series of arguments, replacing them by zero or one results? */
-    static boolean canCollectArguments(MethodType targetType,
-                MethodType collectorType, int collectArgPos, boolean retainOriginalArgs) {
-        if (!convOpSupported(retainOriginalArgs ? OP_FOLD_ARGS : OP_COLLECT_ARGS))  return false;
-        int collectArgCount = collectorType.parameterCount();
-        Class<?> rtype = collectorType.returnType();
-        assert(rtype == void.class || targetType.parameterType(collectArgPos) == rtype)
-                // [(Object)Object[], (Object[])Object[], 0, 1]
-                : Arrays.asList(targetType, collectorType, collectArgPos, collectArgCount)
-                ;
-        return true;
-    }
-
-    /** Factory method:  Collect or filter selected argument(s). */
-    static MethodHandle makeCollectArguments(MethodHandle target,
-                MethodHandle collector, int collectArgPos, boolean retainOriginalArgs) {
-        assert(canCollectArguments(target.type(), collector.type(), collectArgPos, retainOriginalArgs));
-        MethodType targetType = target.type();
-        MethodType collectorType = collector.type();
-        int collectArgCount = collectorType.parameterCount();
-        Class<?> collectValType = collectorType.returnType();
-        int collectValCount = (collectValType == void.class ? 0 : 1);
-        int collectValSlots = collectorType.returnSlotCount();
-        MethodType newType = targetType
-                .dropParameterTypes(collectArgPos, collectArgPos+collectValCount);
-        if (!retainOriginalArgs) {
-            newType = newType
-                .insertParameterTypes(collectArgPos, collectorType.parameterList());
-        } else {
-            // parameter types at the fold point must be the same
-            assert(diffParamTypes(newType, collectArgPos, targetType, collectValCount, collectArgCount, false) == 0)
-                : Arrays.asList(target, collector, collectArgPos, retainOriginalArgs);
-        }
-        // in  arglist: [0: ...keep1 | cpos: collect...  | cpos+cacount: keep2... ]
-        // out arglist: [0: ...keep1 | cpos: collectVal? | cpos+cvcount: keep2... ]
-        // out(retain): [0: ...keep1 | cpos: cV? coll... | cpos+cvc+cac: keep2... ]
-        int keep2InPos   = collectArgPos + collectArgCount;
-        int keep1InSlot  = newType.parameterSlotDepth(collectArgPos);  // leading edge of |collect...|
-        int collectSlot  = newType.parameterSlotDepth(keep2InPos);     // trailing edge of |collect...|
-        int slotCount    = keep1InSlot - collectSlot;                  // slots in |collect...|
-        assert(slotCount >= collectArgCount);
-        assert(collectSlot == targetType.parameterSlotDepth(
-                collectArgPos + collectValCount + (retainOriginalArgs ? collectArgCount : 0) ));
-        int dest = basicType(collectValType);
-        int src = T_VOID;
-        // src is not significant; remove?
-        for (int i = 0; i < collectArgCount; i++) {
-            int src2 = basicType(collectorType.parameterType(i));
-            if      (src == T_VOID)  src = src2;
-            else if (src != src2)    src = T_VOID;
-            if (src == T_VOID)  break;
-        }
-        int stackMove = collectValSlots;  // push 0..2 results
-        if (!retainOriginalArgs)  stackMove -= slotCount; // pop N arguments
-        int lastCollectArg = keep2InPos-1;
-        long conv = makeSpreadConv(retainOriginalArgs ? OP_FOLD_ARGS : OP_COLLECT_ARGS,
-                                   lastCollectArg, src, dest, stackMove);
-        MethodHandle res = new AdapterMethodHandle(target, newType, conv, collector);
-        assert(res.type().parameterList().subList(collectArgPos, collectArgPos+collectArgCount)
-                .equals(collector.type().parameterList()));
-        return res;
-    }
-
-    @Override
-    String debugString() {
-        return getNameString(nonAdapter((MethodHandle)vmtarget), this);
-    }
-
-    private static MethodHandle nonAdapter(MethodHandle mh) {
-        while (mh instanceof AdapterMethodHandle) {
-            mh = (MethodHandle) mh.vmtarget;
-        }
-        return mh;
-    }
-}
--- a/src/share/classes/java/lang/invoke/BoundMethodHandle.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/lang/invoke/BoundMethodHandle.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -25,164 +25,833 @@
 
 package java.lang.invoke;
 
-import sun.invoke.util.VerifyType;
+import static com.sun.xml.internal.ws.org.objectweb.asm.Opcodes.*;
+import static java.lang.invoke.LambdaForm.basicTypes;
+import static java.lang.invoke.MethodHandleNatives.Constants.REF_invokeStatic;
+import static java.lang.invoke.MethodHandleStatics.*;
+
+import java.lang.invoke.LambdaForm.Name;
+import java.lang.invoke.LambdaForm.NamedFunction;
+import java.lang.invoke.MethodHandles.Lookup;
+import java.lang.reflect.Field;
+import java.util.Arrays;
+import java.util.HashMap;
+
+import sun.invoke.util.ValueConversions;
 import sun.invoke.util.Wrapper;
-import static java.lang.invoke.MethodHandleStatics.*;
+
+import com.sun.xml.internal.ws.org.objectweb.asm.ClassWriter;
+import com.sun.xml.internal.ws.org.objectweb.asm.MethodVisitor;
+import com.sun.xml.internal.ws.org.objectweb.asm.Type;
 
 /**
  * The flavor of method handle which emulates an invoke instruction
  * on a predetermined argument.  The JVM dispatches to the correct method
  * when the handle is created, not when it is invoked.
- * @author jrose
+ *
+ * All bound arguments are encapsulated in dedicated species.
  */
-class BoundMethodHandle extends MethodHandle {
-    //MethodHandle vmtarget;           // next BMH or final DMH or methodOop
-    private final Object argument;     // argument to insert
-    private final int    vmargslot;    // position at which it is inserted
-
-    // Constructors in this class *must* be package scoped or private.
+/* non-public */ abstract class BoundMethodHandle extends MethodHandle {
 
-    /** Bind a direct MH to its receiver (or first ref. argument).
-     *  The JVM will pre-dispatch the MH if it is not already static.
-     */
-    /*non-public*/ BoundMethodHandle(DirectMethodHandle mh, Object argument) {
-        super(mh.type().dropParameterTypes(0, 1));
-        // check the type now, once for all:
-        this.argument = checkReferenceArgument(argument, mh, 0);
-        this.vmargslot = this.type().parameterSlotCount();
-        initTarget(mh, 0);
+    /* non-public */ BoundMethodHandle(MethodType type, LambdaForm form) {
+        super(type, form);
     }
 
-    /** Insert an argument into an arbitrary method handle.
-     *  If argnum is zero, inserts the first argument, etc.
-     *  The argument type must be a reference.
-     */
-    /*non-public*/ BoundMethodHandle(MethodHandle mh, Object argument, int argnum) {
-        this(mh.type().dropParameterTypes(argnum, argnum+1),
-             mh, argument, argnum);
+    //
+    // BMH API and internals
+    //
+
+    static MethodHandle bindSingle(MethodType type, LambdaForm form, char xtype, Object x) {
+        // for some type signatures, there exist pre-defined concrete BMH classes
+        try {
+            switch (xtype) {
+            case 'L':
+                if (true)  return bindSingle(type, form, x);  // Use known fast path.
+                return (BoundMethodHandle) SpeciesData.EMPTY.extendWithType('L').constructor[0].invokeBasic(type, form, x);
+            case 'I':
+                return (BoundMethodHandle) SpeciesData.EMPTY.extendWithType('I').constructor[0].invokeBasic(type, form, ValueConversions.widenSubword(x));
+            case 'J':
+                return (BoundMethodHandle) SpeciesData.EMPTY.extendWithType('J').constructor[0].invokeBasic(type, form, (long) x);
+            case 'F':
+                return (BoundMethodHandle) SpeciesData.EMPTY.extendWithType('F').constructor[0].invokeBasic(type, form, (float) x);
+            case 'D':
+                return (BoundMethodHandle) SpeciesData.EMPTY.extendWithType('D').constructor[0].invokeBasic(type, form, (double) x);
+            default : throw new InternalError("unexpected xtype: " + xtype);
+            }
+        } catch (Throwable t) {
+            throw newInternalError(t);
+        }
     }
 
-    /** Insert an argument into an arbitrary method handle.
-     *  If argnum is zero, inserts the first argument, etc.
-     */
-    /*non-public*/ BoundMethodHandle(MethodType type, MethodHandle mh, Object argument, int argnum) {
-        super(type);
-        if (mh.type().parameterType(argnum).isPrimitive())
-            this.argument = bindPrimitiveArgument(argument, mh, argnum);
-        else {
-            this.argument = checkReferenceArgument(argument, mh, argnum);
-        }
-        this.vmargslot = type.parameterSlotDepth(argnum);
-        initTarget(mh, argnum);
-    }
-
-    private void initTarget(MethodHandle mh, int argnum) {
-        //this.vmtarget = mh;  // maybe updated by JVM
-        MethodHandleNatives.init(this, mh, argnum);
-    }
-
-    /** For the AdapterMethodHandle subclass.
-     */
-    /*non-public*/ BoundMethodHandle(MethodType type, Object argument, int vmargslot) {
-        super(type);
-        this.argument = argument;
-        this.vmargslot = vmargslot;
-        assert(this instanceof AdapterMethodHandle);
+    static MethodHandle bindSingle(MethodType type, LambdaForm form, Object x) {
+            return new Species_L(type, form, x);
     }
 
-    /** Initialize the current object as a self-bound method handle, binding it
-     *  as the first argument of the method handle {@code entryPoint}.
-     *  The invocation type of the resulting method handle will be the
-     *  same as {@code entryPoint},  except that the first argument
-     *  type will be dropped.
-     */
-    /*non-public*/ BoundMethodHandle(MethodHandle entryPoint) {
-        super(entryPoint.type().dropParameterTypes(0, 1));
-        this.argument = this; // kludge; get rid of
-        this.vmargslot = this.type().parameterSlotDepth(0);
-        initTarget(entryPoint, 0);
+    MethodHandle cloneExtend(MethodType type, LambdaForm form, char xtype, Object x) {
+        try {
+            switch (xtype) {
+            case 'L': return cloneExtendL(type, form, x);
+            case 'I': return cloneExtendI(type, form, ValueConversions.widenSubword(x));
+            case 'J': return cloneExtendJ(type, form, (long) x);
+            case 'F': return cloneExtendF(type, form, (float) x);
+            case 'D': return cloneExtendD(type, form, (double) x);
+            }
+        } catch (Throwable t) {
+            throw newInternalError(t);
+        }
+        throw new InternalError("unexpected type: " + xtype);
+    }
+
+    @Override
+    MethodHandle bindArgument(int pos, char basicType, Object value) {
+        MethodType type = type().dropParameterTypes(pos, pos+1);
+        LambdaForm form = internalForm().bind(1+pos, speciesData());
+        return cloneExtend(type, form, basicType, value);
     }
 
-    /** Make sure the given {@code argument} can be used as {@code argnum}-th
-     *  parameter of the given method handle {@code mh}, which must be a reference.
-     *  <p>
-     *  If this fails, throw a suitable {@code WrongMethodTypeException},
-     *  which will prevent the creation of an illegally typed bound
-     *  method handle.
-     */
-    final static Object checkReferenceArgument(Object argument, MethodHandle mh, int argnum) {
-        Class<?> ptype = mh.type().parameterType(argnum);
-        if (ptype.isPrimitive()) {
-            // fail
-        } else if (argument == null) {
-            return null;
-        } else if (VerifyType.isNullReferenceConversion(argument.getClass(), ptype)) {
-            return argument;
-        }
-        throw badBoundArgumentException(argument, mh, argnum);
+    @Override
+    MethodHandle dropArguments(MethodType srcType, int pos, int drops) {
+        LambdaForm form = internalForm().addArguments(pos, srcType.parameterList().subList(pos, pos+drops));
+        try {
+             return clone(srcType, form);
+         } catch (Throwable t) {
+             throw newInternalError(t);
+         }
     }
 
-    /** Make sure the given {@code argument} can be used as {@code argnum}-th
-     *  parameter of the given method handle {@code mh}, which must be a primitive.
-     *  <p>
-     *  If this fails, throw a suitable {@code WrongMethodTypeException},
-     *  which will prevent the creation of an illegally typed bound
-     *  method handle.
-     */
-    final static Object bindPrimitiveArgument(Object argument, MethodHandle mh, int argnum) {
-        Class<?> ptype = mh.type().parameterType(argnum);
-        Wrapper  wrap = Wrapper.forPrimitiveType(ptype);
-        Object   zero  = wrap.zero();
-        if (zero == null) {
-            // fail
-        } else if (argument == null) {
-            if (ptype != int.class && wrap.isSubwordOrInt())
-                return Integer.valueOf(0);
-            else
-                return zero;
-        } else if (VerifyType.isNullReferenceConversion(argument.getClass(), zero.getClass())) {
-            if (ptype != int.class && wrap.isSubwordOrInt())
-                return Wrapper.INT.wrap(argument);
-            else
-                return argument;
-        }
-        throw badBoundArgumentException(argument, mh, argnum);
+    @Override
+    MethodHandle permuteArguments(MethodType newType, int[] reorder) {
+        try {
+             return clone(newType, form.permuteArguments(1, reorder, basicTypes(newType.parameterList())));
+         } catch (Throwable t) {
+             throw newInternalError(t);
+         }
     }
 
-    final static RuntimeException badBoundArgumentException(Object argument, MethodHandle mh, int argnum) {
-        String atype = (argument == null) ? "null" : argument.getClass().toString();
-        return new ClassCastException("cannot bind "+atype+" argument to parameter #"+argnum+" of "+mh.type());
+    static final String EXTENSION_TYPES = "LIJFD";
+    static final byte INDEX_L = 0, INDEX_I = 1, INDEX_J = 2, INDEX_F = 3, INDEX_D = 4;
+    static byte extensionIndex(char type) {
+        int i = EXTENSION_TYPES.indexOf(type);
+        if (i < 0)  throw new InternalError();
+        return (byte) i;
+    }
+
+    /**
+     * Return the {@link SpeciesData} instance representing this BMH species. All subclasses must provide a
+     * static field containing this value, and they must accordingly implement this method.
+     */
+    protected abstract SpeciesData speciesData();
+
+    @Override
+    final Object internalProperties() {
+        return "/BMH="+internalValues();
     }
 
     @Override
-    String debugString() {
-        return addTypeString(baseName(), this);
+    final Object internalValues() {
+        Object[] boundValues = new Object[speciesData().fieldCount()];
+        for (int i = 0; i < boundValues.length; ++i) {
+            boundValues[i] = arg(i);
+        }
+        return Arrays.asList(boundValues);
+    }
+
+    public final Object arg(int i) {
+        try {
+            switch (speciesData().fieldType(i)) {
+            case 'L': return argL(i);
+            case 'I': return argI(i);
+            case 'F': return argF(i);
+            case 'D': return argD(i);
+            case 'J': return argJ(i);
+            }
+        } catch (Throwable ex) {
+            throw newInternalError(ex);
+        }
+        throw new InternalError("unexpected type: " + speciesData().types+"."+i);
+    }
+    public final Object argL(int i) throws Throwable { return          speciesData().getters[i].invokeBasic(this); }
+    public final int    argI(int i) throws Throwable { return (int)    speciesData().getters[i].invokeBasic(this); }
+    public final float  argF(int i) throws Throwable { return (float)  speciesData().getters[i].invokeBasic(this); }
+    public final double argD(int i) throws Throwable { return (double) speciesData().getters[i].invokeBasic(this); }
+    public final long   argJ(int i) throws Throwable { return (long)   speciesData().getters[i].invokeBasic(this); }
+
+    //
+    // cloning API
+    //
+
+    public abstract BoundMethodHandle clone(MethodType mt, LambdaForm lf) throws Throwable;
+    public abstract BoundMethodHandle cloneExtendL(MethodType mt, LambdaForm lf, Object narg) throws Throwable;
+    public abstract BoundMethodHandle cloneExtendI(MethodType mt, LambdaForm lf, int    narg) throws Throwable;
+    public abstract BoundMethodHandle cloneExtendJ(MethodType mt, LambdaForm lf, long   narg) throws Throwable;
+    public abstract BoundMethodHandle cloneExtendF(MethodType mt, LambdaForm lf, float  narg) throws Throwable;
+    public abstract BoundMethodHandle cloneExtendD(MethodType mt, LambdaForm lf, double narg) throws Throwable;
+
+    // The following is a grossly irregular hack:
+    @Override MethodHandle reinvokerTarget() {
+        try {
+            return (MethodHandle) argL(0);
+        } catch (Throwable ex) {
+            throw newInternalError(ex);
+        }
+    }
+
+    //
+    // concrete BMH classes required to close bootstrap loops
+    //
+
+    private  // make it private to force users to access the enclosing class first
+    static final class Species_L extends BoundMethodHandle {
+        final Object argL0;
+        public Species_L(MethodType mt, LambdaForm lf, Object argL0) {
+            super(mt, lf);
+            this.argL0 = argL0;
+        }
+        // The following is a grossly irregular hack:
+        @Override MethodHandle reinvokerTarget() { return (MethodHandle) argL0; }
+        @Override
+        public SpeciesData speciesData() {
+            return SPECIES_DATA;
+        }
+        public static final SpeciesData SPECIES_DATA = SpeciesData.getForClass("L", Species_L.class);
+        @Override
+        public final BoundMethodHandle clone(MethodType mt, LambdaForm lf) throws Throwable {
+            return new Species_L(mt, lf, argL0);
+        }
+        @Override
+        public final BoundMethodHandle cloneExtendL(MethodType mt, LambdaForm lf, Object narg) throws Throwable {
+            return (BoundMethodHandle) SPECIES_DATA.extendWithIndex(INDEX_L).constructor[0].invokeBasic(mt, lf, argL0, narg);
+        }
+        @Override
+        public final BoundMethodHandle cloneExtendI(MethodType mt, LambdaForm lf, int narg) throws Throwable {
+            return (BoundMethodHandle) SPECIES_DATA.extendWithIndex(INDEX_I).constructor[0].invokeBasic(mt, lf, argL0, narg);
+        }
+        @Override
+        public final BoundMethodHandle cloneExtendJ(MethodType mt, LambdaForm lf, long narg) throws Throwable {
+            return (BoundMethodHandle) SPECIES_DATA.extendWithIndex(INDEX_J).constructor[0].invokeBasic(mt, lf, argL0, narg);
+        }
+        @Override
+        public final BoundMethodHandle cloneExtendF(MethodType mt, LambdaForm lf, float narg) throws Throwable {
+            return (BoundMethodHandle) SPECIES_DATA.extendWithIndex(INDEX_F).constructor[0].invokeBasic(mt, lf, argL0, narg);
+        }
+        @Override
+        public final BoundMethodHandle cloneExtendD(MethodType mt, LambdaForm lf, double narg) throws Throwable {
+            return (BoundMethodHandle) SPECIES_DATA.extendWithIndex(INDEX_D).constructor[0].invokeBasic(mt, lf, argL0, narg);
+        }
+    }
+
+/*
+    static final class Species_LL extends BoundMethodHandle {
+        final Object argL0;
+        final Object argL1;
+        public Species_LL(MethodType mt, LambdaForm lf, Object argL0, Object argL1) {
+            super(mt, lf);
+            this.argL0 = argL0;
+            this.argL1 = argL1;
+        }
+        @Override
+        public SpeciesData speciesData() {
+            return SPECIES_DATA;
+        }
+        public static final SpeciesData SPECIES_DATA = SpeciesData.getForClass("LL", Species_LL.class);
+        @Override
+        public final BoundMethodHandle clone(MethodType mt, LambdaForm lf) throws Throwable {
+            return new Species_LL(mt, lf, argL0, argL1);
+        }
+        @Override
+        public final BoundMethodHandle cloneExtendL(MethodType mt, LambdaForm lf, Object narg) throws Throwable {
+            return (BoundMethodHandle) SPECIES_DATA.extendWithIndex(INDEX_L).constructor[0].invokeBasic(mt, lf, argL0, argL1, narg);
+        }
+        @Override
+        public final BoundMethodHandle cloneExtendI(MethodType mt, LambdaForm lf, int narg) throws Throwable {
+            return (BoundMethodHandle) SPECIES_DATA.extendWithIndex(INDEX_I).constructor[0].invokeBasic(mt, lf, argL0, argL1, narg);
+        }
+        @Override
+        public final BoundMethodHandle cloneExtendJ(MethodType mt, LambdaForm lf, long narg) throws Throwable {
+            return (BoundMethodHandle) SPECIES_DATA.extendWithIndex(INDEX_J).constructor[0].invokeBasic(mt, lf, argL0, argL1, narg);
+        }
+        @Override
+        public final BoundMethodHandle cloneExtendF(MethodType mt, LambdaForm lf, float narg) throws Throwable {
+            return (BoundMethodHandle) SPECIES_DATA.extendWithIndex(INDEX_F).constructor[0].invokeBasic(mt, lf, argL0, argL1, narg);
+        }
+        @Override
+        public final BoundMethodHandle cloneExtendD(MethodType mt, LambdaForm lf, double narg) throws Throwable {
+            return (BoundMethodHandle) SPECIES_DATA.extendWithIndex(INDEX_D).constructor[0].invokeBasic(mt, lf, argL0, argL1, narg);
+        }
+    }
+
+    static final class Species_JL extends BoundMethodHandle {
+        final long argJ0;
+        final Object argL1;
+        public Species_JL(MethodType mt, LambdaForm lf, long argJ0, Object argL1) {
+            super(mt, lf);
+            this.argJ0 = argJ0;
+            this.argL1 = argL1;
+        }
+        @Override
+        public SpeciesData speciesData() {
+            return SPECIES_DATA;
+        }
+        public static final SpeciesData SPECIES_DATA = SpeciesData.getForClass("JL", Species_JL.class);
+        @Override public final long   argJ0() { return argJ0; }
+        @Override public final Object argL1() { return argL1; }
+        @Override
+        public final BoundMethodHandle clone(MethodType mt, LambdaForm lf) throws Throwable {
+            return new Species_JL(mt, lf, argJ0, argL1);
+        }
+        @Override
+        public final BoundMethodHandle cloneExtendL(MethodType mt, LambdaForm lf, Object narg) throws Throwable {
+            return (BoundMethodHandle) SPECIES_DATA.extendWithIndex(INDEX_L).constructor[0].invokeBasic(mt, lf, argJ0, argL1, narg);
+        }
+        @Override
+        public final BoundMethodHandle cloneExtendI(MethodType mt, LambdaForm lf, int narg) throws Throwable {
+            return (BoundMethodHandle) SPECIES_DATA.extendWithIndex(INDEX_I).constructor[0].invokeBasic(mt, lf, argJ0, argL1, narg);
+        }
+        @Override
+        public final BoundMethodHandle cloneExtendJ(MethodType mt, LambdaForm lf, long narg) throws Throwable {
+            return (BoundMethodHandle) SPECIES_DATA.extendWithIndex(INDEX_J).constructor[0].invokeBasic(mt, lf, argJ0, argL1, narg);
+        }
+        @Override
+        public final BoundMethodHandle cloneExtendF(MethodType mt, LambdaForm lf, float narg) throws Throwable {
+            return (BoundMethodHandle) SPECIES_DATA.extendWithIndex(INDEX_F).constructor[0].invokeBasic(mt, lf, argJ0, argL1, narg);
+        }
+        @Override
+        public final BoundMethodHandle cloneExtendD(MethodType mt, LambdaForm lf, double narg) throws Throwable {
+            return (BoundMethodHandle) SPECIES_DATA.extendWithIndex(INDEX_D).constructor[0].invokeBasic(mt, lf, argJ0, argL1, narg);
+        }
+    }
+*/
+
+    //
+    // BMH species meta-data
+    //
+
+    /**
+     * Meta-data wrapper for concrete BMH classes.
+     */
+    static class SpeciesData {
+        final String                             types;
+        final Class<? extends BoundMethodHandle> clazz;
+        // Bootstrapping requires circular relations MH -> BMH -> SpeciesData -> MH
+        // Therefore, we need a non-final link in the chain.  Use array elements.
+        final MethodHandle[]                     constructor;
+        final MethodHandle[]                     getters;
+        final SpeciesData[]                      extensions;
+
+        public int fieldCount() {
+            return types.length();
+        }
+        public char fieldType(int i) {
+            return types.charAt(i);
+        }
+
+        public String toString() {
+            return "SpeciesData["+(isPlaceholder() ? "<placeholder>" : clazz.getSimpleName())+":"+types+"]";
+        }
+
+        /**
+         * Return a {@link LambdaForm.Name} containing a {@link LambdaForm.NamedFunction} that
+         * represents a MH bound to a generic invoker, which in turn forwards to the corresponding
+         * getter.
+         */
+        Name getterName(Name mhName, int i) {
+            MethodHandle mh = getters[i];
+            assert(mh != null) : this+"."+i;
+            return new Name(mh, mhName);
+        }
+
+        static final SpeciesData EMPTY = new SpeciesData("", BoundMethodHandle.class);
+
+        private SpeciesData(String types, Class<? extends BoundMethodHandle> clazz) {
+            this.types = types;
+            this.clazz = clazz;
+            if (!INIT_DONE) {
+                this.constructor = new MethodHandle[1];
+                this.getters = new MethodHandle[types.length()];
+            } else {
+                this.constructor = Factory.makeCtors(clazz, types, null);
+                this.getters = Factory.makeGetters(clazz, types, null);
+            }
+            this.extensions = new SpeciesData[EXTENSION_TYPES.length()];
+        }
+
+        private void initForBootstrap() {
+            assert(!INIT_DONE);
+            if (constructor[0] == null) {
+                Factory.makeCtors(clazz, types, this.constructor);
+                Factory.makeGetters(clazz, types, this.getters);
+            }
+        }
+
+        private SpeciesData(String types) {
+            // Placeholder only.
+            this.types = types;
+            this.clazz = null;
+            this.constructor = null;
+            this.getters = null;
+            this.extensions = null;
+        }
+        private boolean isPlaceholder() { return clazz == null; }
+
+        private static final HashMap<String, SpeciesData> CACHE = new HashMap<>();
+        private static final boolean INIT_DONE;  // set after <clinit> finishes...
+
+        SpeciesData extendWithType(char type) {
+            int i = extensionIndex(type);
+            SpeciesData d = extensions[i];
+            if (d != null)  return d;
+            extensions[i] = d = get(types+type);
+            return d;
+        }
+
+        SpeciesData extendWithIndex(byte index) {
+            SpeciesData d = extensions[index];
+            if (d != null)  return d;
+            extensions[index] = d = get(types+EXTENSION_TYPES.charAt(index));
+            return d;
+        }
+
+        private static SpeciesData get(String types) {
+            // Acquire cache lock for query.
+            SpeciesData d = lookupCache(types);
+            if (!d.isPlaceholder())
+                return d;
+            synchronized (d) {
+                // Use synch. on the placeholder to prevent multiple instantiation of one species.
+                // Creating this class forces a recursive call to getForClass.
+                if (lookupCache(types).isPlaceholder())
+                    Factory.generateConcreteBMHClass(types);
+            }
+            // Reacquire cache lock.
+            d = lookupCache(types);
+            // Class loading must have upgraded the cache.
+            assert(d != null && !d.isPlaceholder());
+            return d;
+        }
+        static SpeciesData getForClass(String types, Class<? extends BoundMethodHandle> clazz) {
+            // clazz is a new class which is initializing its SPECIES_DATA field
+            return updateCache(types, new SpeciesData(types, clazz));
+        }
+        private static synchronized SpeciesData lookupCache(String types) {
+            SpeciesData d = CACHE.get(types);
+            if (d != null)  return d;
+            d = new SpeciesData(types);
+            assert(d.isPlaceholder());
+            CACHE.put(types, d);
+            return d;
+        }
+        private static synchronized SpeciesData updateCache(String types, SpeciesData d) {
+            SpeciesData d2;
+            assert((d2 = CACHE.get(types)) == null || d2.isPlaceholder());
+            assert(!d.isPlaceholder());
+            CACHE.put(types, d);
+            return d;
+        }
+
+        static {
+            // pre-fill the BMH speciesdata cache with BMH's inner classes
+            final Class<BoundMethodHandle> rootCls = BoundMethodHandle.class;
+            SpeciesData d0 = BoundMethodHandle.SPECIES_DATA;  // trigger class init
+            assert(d0 == null || d0 == lookupCache("")) : d0;
+            try {
+                for (Class<?> c : rootCls.getDeclaredClasses()) {
+                    if (rootCls.isAssignableFrom(c)) {
+                        final Class<? extends BoundMethodHandle> cbmh = c.asSubclass(BoundMethodHandle.class);
+                        SpeciesData d = Factory.speciesDataFromConcreteBMHClass(cbmh);
+                        assert(d != null) : cbmh.getName();
+                        assert(d.clazz == cbmh);
+                        assert(d == lookupCache(d.types));
+                    }
+                }
+            } catch (Throwable e) {
+                throw newInternalError(e);
+            }
+
+            for (SpeciesData d : CACHE.values()) {
+                d.initForBootstrap();
+            }
+            // Note:  Do not simplify this, because INIT_DONE must not be
+            // a compile-time constant during bootstrapping.
+            INIT_DONE = Boolean.TRUE;
+        }
+    }
+
+    static SpeciesData getSpeciesData(String types) {
+        return SpeciesData.get(types);
     }
 
-    /** Component of toString() before the type string. */
-    protected String baseName() {
-        MethodHandle mh = this;
-        while (mh instanceof BoundMethodHandle) {
-            Object info = MethodHandleNatives.getTargetInfo(mh);
-            if (info instanceof MethodHandle) {
-                mh = (MethodHandle) info;
-            } else {
-                String name = null;
-                if (info instanceof MemberName)
-                    name = ((MemberName)info).getName();
-                if (name != null)
-                    return name;
-                else
-                    return noParens(super.toString()); // "invoke", probably
+    /**
+     * Generation of concrete BMH classes.
+     *
+     * A concrete BMH species is fit for binding a number of values adhering to a
+     * given type pattern. Reference types are erased.
+     *
+     * BMH species are cached by type pattern.
+     *
+     * A BMH species has a number of fields with the concrete (possibly erased) types of
+     * bound values. Setters are provided as an API in BMH. Getters are exposed as MHs,
+     * which can be included as names in lambda forms.
+     */
+    static class Factory {
+
+        static final String JLO_SIG  = "Ljava/lang/Object;";
+        static final String JLS_SIG  = "Ljava/lang/String;";
+        static final String JLC_SIG  = "Ljava/lang/Class;";
+        static final String MH       = "java/lang/invoke/MethodHandle";
+        static final String MH_SIG   = "L"+MH+";";
+        static final String BMH      = "java/lang/invoke/BoundMethodHandle";
+        static final String BMH_SIG  = "L"+BMH+";";
+        static final String SPECIES_DATA     = "java/lang/invoke/BoundMethodHandle$SpeciesData";
+        static final String SPECIES_DATA_SIG = "L"+SPECIES_DATA+";";
+
+        static final String SPECIES_PREFIX_NAME = "Species_";
+        static final String SPECIES_PREFIX_PATH = BMH + "$" + SPECIES_PREFIX_NAME;
+
+        static final String BMHSPECIES_DATA_EWI_SIG = "(B)" + SPECIES_DATA_SIG;
+        static final String BMHSPECIES_DATA_GFC_SIG = "(" + JLS_SIG + JLC_SIG + ")" + SPECIES_DATA_SIG;
+        static final String MYSPECIES_DATA_SIG = "()" + SPECIES_DATA_SIG;
+        static final String VOID_SIG   = "()V";
+
+        static final String SIG_INCIPIT = "(Ljava/lang/invoke/MethodType;Ljava/lang/invoke/LambdaForm;";
+
+        static final Class<?>[] TYPES = new Class<?>[] { Object.class, int.class, long.class, float.class, double.class };
+
+        static final String[] E_THROWABLE = new String[] { "java/lang/Throwable" };
+
+        /**
+         * Generate a concrete subclass of BMH for a given combination of bound types.
+         *
+         * A concrete BMH species adheres to the following schema:
+         *
+         * <pre>
+         * class Species_<<types>> extends BoundMethodHandle {
+         *     <<fields>>
+         *     final SpeciesData speciesData() { return SpeciesData.get("<<types>>"); }
+         * }
+         * </pre>
+         *
+         * The {@code <<types>>} signature is precisely the string that is passed to this
+         * method.
+         *
+         * The {@code <<fields>>} section consists of one field definition per character in
+         * the type signature, adhering to the naming schema described in the definition of
+         * {@link #makeFieldName()}.
+         *
+         * For example, a concrete BMH species for two reference and one integral bound values
+         * would have the following shape:
+         *
+         * <pre>
+         * class BoundMethodHandle { ... private static
+         * final class Species_LLI extends BoundMethodHandle {
+         *     final Object argL0;
+         *     final Object argL1;
+         *     final int argI2;
+         *     public Species_LLI(MethodType mt, LambdaForm lf, Object argL0, Object argL1, int argI2) {
+         *         super(mt, lf);
+         *         this.argL0 = argL0;
+         *         this.argL1 = argL1;
+         *         this.argI2 = argI2;
+         *     }
+         *     public final SpeciesData speciesData() { return SPECIES_DATA; }
+         *     public static final SpeciesData SPECIES_DATA = SpeciesData.getForClass("LLI", Species_LLI.class);
+         *     public final BoundMethodHandle clone(MethodType mt, LambdaForm lf) {
+         *         return SPECIES_DATA.constructor[0].invokeBasic(mt, lf, argL0, argL1, argI2);
+         *     }
+         *     public final BoundMethodHandle cloneExtendL(MethodType mt, LambdaForm lf, Object narg) {
+         *         return SPECIES_DATA.extendWithIndex(INDEX_L).constructor[0].invokeBasic(mt, lf, argL0, argL1, argI2, narg);
+         *     }
+         *     public final BoundMethodHandle cloneExtendI(MethodType mt, LambdaForm lf, int narg) {
+         *         return SPECIES_DATA.extendWithIndex(INDEX_I).constructor[0].invokeBasic(mt, lf, argL0, argL1, argI2, narg);
+         *     }
+         *     public final BoundMethodHandle cloneExtendJ(MethodType mt, LambdaForm lf, long narg) {
+         *         return SPECIES_DATA.extendWithIndex(INDEX_J).constructor[0].invokeBasic(mt, lf, argL0, argL1, argI2, narg);
+         *     }
+         *     public final BoundMethodHandle cloneExtendF(MethodType mt, LambdaForm lf, float narg) {
+         *         return SPECIES_DATA.extendWithIndex(INDEX_F).constructor[0].invokeBasic(mt, lf, argL0, argL1, argI2, narg);
+         *     }
+         *     public final BoundMethodHandle cloneExtendD(MethodType mt, LambdaForm lf, double narg) {
+         *         return SPECIES_DATA.extendWithIndex(INDEX_D).constructor[0].invokeBasic(mt, lf, argL0, argL1, argI2, narg);
+         *     }
+         * }
+         * </pre>
+         *
+         * @param types the type signature, wherein reference types are erased to 'L'
+         * @return the generated concrete BMH class
+         */
+        static Class<? extends BoundMethodHandle> generateConcreteBMHClass(String types) {
+            final ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS + ClassWriter.COMPUTE_FRAMES);
+
+            final String className  = SPECIES_PREFIX_PATH + types;
+            final String sourceFile = SPECIES_PREFIX_NAME + types;
+            cw.visit(V1_6, ACC_PUBLIC + ACC_FINAL + ACC_SUPER, className, null, BMH, null);
+            cw.visitSource(sourceFile, null);
+
+            // emit static types and SPECIES_DATA fields
+            cw.visitField(ACC_PUBLIC + ACC_STATIC, "SPECIES_DATA", SPECIES_DATA_SIG, null, null).visitEnd();
+
+            // emit bound argument fields
+            for (int i = 0; i < types.length(); ++i) {
+                final char t = types.charAt(i);
+                final String fieldName = makeFieldName(types, i);
+                final String fieldDesc = t == 'L' ? JLO_SIG : String.valueOf(t);
+                cw.visitField(ACC_FINAL, fieldName, fieldDesc, null, null).visitEnd();
+            }
+
+            MethodVisitor mv;
+
+            // emit constructor
+            mv = cw.visitMethod(ACC_PUBLIC, "<init>", makeSignature(types, true), null, null);
+            mv.visitCode();
+            mv.visitVarInsn(ALOAD, 0);
+            mv.visitVarInsn(ALOAD, 1);
+            mv.visitVarInsn(ALOAD, 2);
+
+            mv.visitMethodInsn(INVOKESPECIAL, BMH, "<init>", makeSignature("", true));
+
+            for (int i = 0, j = 0; i < types.length(); ++i, ++j) {
+                // i counts the arguments, j counts corresponding argument slots
+                char t = types.charAt(i);
+                mv.visitVarInsn(ALOAD, 0);
+                mv.visitVarInsn(typeLoadOp(t), j + 3); // parameters start at 3
+                mv.visitFieldInsn(PUTFIELD, className, makeFieldName(types, i), typeSig(t));
+                if (t == 'J' || t == 'D') {
+                    ++j; // adjust argument register access
+                }
             }
-            assert(mh != this);
+
+            mv.visitInsn(RETURN);
+            mv.visitMaxs(0, 0);
+            mv.visitEnd();
+
+            // emit implementation of reinvokerTarget()
+            mv = cw.visitMethod(ACC_PUBLIC + ACC_FINAL, "reinvokerTarget", "()" + MH_SIG, null, null);
+            mv.visitCode();
+            mv.visitVarInsn(ALOAD, 0);
+            mv.visitFieldInsn(GETFIELD, className, "argL0", JLO_SIG);
+            mv.visitTypeInsn(CHECKCAST, MH);
+            mv.visitInsn(ARETURN);
+            mv.visitMaxs(0, 0);
+            mv.visitEnd();
+
+            // emit implementation of speciesData()
+            mv = cw.visitMethod(ACC_PUBLIC + ACC_FINAL, "speciesData", MYSPECIES_DATA_SIG, null, null);
+            mv.visitCode();
+            mv.visitFieldInsn(GETSTATIC, className, "SPECIES_DATA", SPECIES_DATA_SIG);
+            mv.visitInsn(ARETURN);
+            mv.visitMaxs(0, 0);
+            mv.visitEnd();
+
+            // emit clone()
+            mv = cw.visitMethod(ACC_PUBLIC + ACC_FINAL, "clone", makeSignature("", false), null, E_THROWABLE);
+            mv.visitCode();
+            // return speciesData().constructor[0].invokeBasic(mt, lf, argL0, ...)
+            // obtain constructor
+            mv.visitVarInsn(ALOAD, 0);
+            mv.visitFieldInsn(GETSTATIC, className, "SPECIES_DATA", SPECIES_DATA_SIG);
+            mv.visitFieldInsn(GETFIELD, SPECIES_DATA, "constructor", "[" + MH_SIG);
+            mv.visitInsn(ICONST_0);
+            mv.visitInsn(AALOAD);
+            // load mt, lf
+            mv.visitVarInsn(ALOAD, 1);
+            mv.visitVarInsn(ALOAD, 2);
+            // put fields on the stack
+            emitPushFields(types, className, mv);
+            // finally, invoke the constructor and return
+            mv.visitMethodInsn(INVOKEVIRTUAL, MH, "invokeBasic", makeSignature(types, false));
+            mv.visitInsn(ARETURN);
+            mv.visitMaxs(0, 0);
+            mv.visitEnd();
+
+            // for each type, emit cloneExtendT()
+            for (Class<?> c : TYPES) {
+                char t = Wrapper.basicTypeChar(c);
+                mv = cw.visitMethod(ACC_PUBLIC + ACC_FINAL, "cloneExtend" + t, makeSignature(String.valueOf(t), false), null, E_THROWABLE);
+                mv.visitCode();
+                // return SPECIES_DATA.extendWithIndex(extensionIndex(t)).constructor[0].invokeBasic(mt, lf, argL0, ..., narg)
+                // obtain constructor
+                mv.visitFieldInsn(GETSTATIC, className, "SPECIES_DATA", SPECIES_DATA_SIG);
+                int iconstInsn = ICONST_0 + extensionIndex(t);
+                assert(iconstInsn <= ICONST_5);
+                mv.visitInsn(iconstInsn);
+                mv.visitMethodInsn(INVOKEVIRTUAL, SPECIES_DATA, "extendWithIndex", BMHSPECIES_DATA_EWI_SIG);
+                mv.visitFieldInsn(GETFIELD, SPECIES_DATA, "constructor", "[" + MH_SIG);
+                mv.visitInsn(ICONST_0);
+                mv.visitInsn(AALOAD);
+                // load mt, lf
+                mv.visitVarInsn(ALOAD, 1);
+                mv.visitVarInsn(ALOAD, 2);
+                // put fields on the stack
+                emitPushFields(types, className, mv);
+                // put narg on stack
+                mv.visitVarInsn(typeLoadOp(t), 3);
+                // finally, invoke the constructor and return
+                mv.visitMethodInsn(INVOKEVIRTUAL, MH, "invokeBasic", makeSignature(types + t, false));
+                mv.visitInsn(ARETURN);
+                mv.visitMaxs(0, 0);
+                mv.visitEnd();
+            }
+
+            // emit class initializer
+            mv = cw.visitMethod(ACC_PUBLIC | ACC_STATIC, "<clinit>", VOID_SIG, null, null);
+            mv.visitCode();
+            mv.visitLdcInsn(types);
+            mv.visitLdcInsn(Type.getObjectType(className));
+            mv.visitMethodInsn(INVOKESTATIC, SPECIES_DATA, "getForClass", BMHSPECIES_DATA_GFC_SIG);
+            mv.visitFieldInsn(PUTSTATIC, className, "SPECIES_DATA", SPECIES_DATA_SIG);
+            mv.visitInsn(RETURN);
+            mv.visitMaxs(0, 0);
+            mv.visitEnd();
+
+            cw.visitEnd();
+
+            // load class
+            final byte[] classFile = cw.toByteArray();
+            InvokerBytecodeGenerator.maybeDump(className, classFile);
+            Class<? extends BoundMethodHandle> bmhClass =
+                //UNSAFE.defineAnonymousClass(BoundMethodHandle.class, classFile, null).asSubclass(BoundMethodHandle.class);
+                UNSAFE.defineClass(className, classFile, 0, classFile.length).asSubclass(BoundMethodHandle.class);
+            UNSAFE.ensureClassInitialized(bmhClass);
+
+            return bmhClass;
+        }
+
+        private static int typeLoadOp(char t) {
+            switch (t) {
+            case 'L': return ALOAD;
+            case 'I': return ILOAD;
+            case 'J': return LLOAD;
+            case 'F': return FLOAD;
+            case 'D': return DLOAD;
+            default : throw new InternalError("unrecognized type " + t);
+            }
         }
-        return noParens(mh.toString());
+
+        private static void emitPushFields(String types, String className, MethodVisitor mv) {
+            for (int i = 0; i < types.length(); ++i) {
+                char tc = types.charAt(i);
+                mv.visitVarInsn(ALOAD, 0);
+                mv.visitFieldInsn(GETFIELD, className, makeFieldName(types, i), typeSig(tc));
+            }
+        }
+
+        static String typeSig(char t) {
+            return t == 'L' ? JLO_SIG : String.valueOf(t);
+        }
+
+        //
+        // Getter MH generation.
+        //
+
+        private static MethodHandle makeGetter(Class<?> cbmhClass, String types, int index) {
+            String fieldName = makeFieldName(types, index);
+            Class<?> fieldType = Wrapper.forBasicType(types.charAt(index)).primitiveType();
+            try {
+                return LOOKUP.findGetter(cbmhClass, fieldName, fieldType);
+            } catch (NoSuchFieldException | IllegalAccessException e) {
+                throw newInternalError(e);
+            }
+        }
+
+        static MethodHandle[] makeGetters(Class<?> cbmhClass, String types, MethodHandle[] mhs) {
+            if (mhs == null)  mhs = new MethodHandle[types.length()];
+            for (int i = 0; i < mhs.length; ++i) {
+                mhs[i] = makeGetter(cbmhClass, types, i);
+                assert(mhs[i].internalMemberName().getDeclaringClass() == cbmhClass);
+            }
+            return mhs;
+        }
+
+        static MethodHandle[] makeCtors(Class<? extends BoundMethodHandle> cbmh, String types, MethodHandle mhs[]) {
+            if (mhs == null)  mhs = new MethodHandle[1];
+            mhs[0] = makeCbmhCtor(cbmh, types);
+            return mhs;
+        }
+
+        //
+        // Auxiliary methods.
+        //
+
+        static SpeciesData speciesDataFromConcreteBMHClass(Class<? extends BoundMethodHandle> cbmh) {
+            try {
+                Field F_SPECIES_DATA = cbmh.getDeclaredField("SPECIES_DATA");
+                return (SpeciesData) F_SPECIES_DATA.get(null);
+            } catch (ReflectiveOperationException ex) {
+                throw newInternalError(ex);
+            }
+        }
+
+        /**
+         * Field names in concrete BMHs adhere to this pattern:
+         * arg + type + index
+         * where type is a single character (L, I, J, F, D).
+         */
+        private static String makeFieldName(String types, int index) {
+            assert index >= 0 && index < types.length();
+            return "arg" + types.charAt(index) + index;
+        }
+
+        private static String makeSignature(String types, boolean ctor) {
+            StringBuilder buf = new StringBuilder(SIG_INCIPIT);
+            for (char c : types.toCharArray()) {
+                buf.append(typeSig(c));
+            }
+            return buf.append(')').append(ctor ? "V" : BMH_SIG).toString();
+        }
+
+        static MethodHandle makeCbmhCtor(Class<? extends BoundMethodHandle> cbmh, String types) {
+            try {
+                return linkConstructor(LOOKUP.findConstructor(cbmh, MethodType.fromMethodDescriptorString(makeSignature(types, true), null)));
+            } catch (NoSuchMethodException | IllegalAccessException | IllegalArgumentException | TypeNotPresentException e) {
+                throw newInternalError(e);
+            }
+        }
+
+        /**
+         * Wrap a constructor call in a {@link LambdaForm}.
+         *
+         * If constructors ({@code <init>} methods) are called in LFs, problems might arise if the LFs
+         * are turned into bytecode, because the call to the allocator is routed through an MH, and the
+         * verifier cannot find a {@code NEW} instruction preceding the {@code INVOKESPECIAL} to
+         * {@code <init>}. To avoid this, we add an indirection by invoking {@code <init>} through
+         * {@link MethodHandle#linkToSpecial}.
+         *
+         * The last {@link LambdaForm#Name Name} in the argument's form is expected to be the {@code void}
+         * result of the {@code <init>} invocation. This entry is replaced.
+         */
+        private static MethodHandle linkConstructor(MethodHandle cmh) {
+            final LambdaForm lf = cmh.form;
+            final int initNameIndex = lf.names.length - 1;
+            final Name initName = lf.names[initNameIndex];
+            final MemberName ctorMN = initName.function.member;
+            final MethodType ctorMT = ctorMN.getInvocationType();
+
+            // obtain function member (call target)
+            // linker method type replaces initial parameter (BMH species) with BMH to avoid naming a species (anonymous class!)
+            final MethodType linkerMT = ctorMT.changeParameterType(0, BoundMethodHandle.class).appendParameterTypes(MemberName.class);
+            MemberName linkerMN = new MemberName(MethodHandle.class, "linkToSpecial", linkerMT, REF_invokeStatic);
+            try {
+                linkerMN = MemberName.getFactory().resolveOrFail(REF_invokeStatic, linkerMN, null, NoSuchMethodException.class);
+                assert(linkerMN.isStatic());
+            } catch (ReflectiveOperationException ex) {
+                throw newInternalError(ex);
+            }
+            // extend arguments array
+            Object[] newArgs = Arrays.copyOf(initName.arguments, initName.arguments.length + 1);
+            newArgs[newArgs.length - 1] = ctorMN;
+            // replace function
+            final NamedFunction nf = new NamedFunction(linkerMN);
+            final Name linkedCtor = new Name(nf, newArgs);
+            linkedCtor.initIndex(initNameIndex);
+            lf.names[initNameIndex] = linkedCtor;
+            return cmh;
+        }
+
     }
 
-    private static String noParens(String str) {
-        int paren = str.indexOf('(');
-        if (paren >= 0) str = str.substring(0, paren);
-        return str;
-    }
+    private static final Lookup LOOKUP = Lookup.IMPL_LOOKUP;
+
+    /**
+     * All subclasses must provide such a value describing their type signature.
+     */
+    static final SpeciesData SPECIES_DATA = SpeciesData.EMPTY;
 }
--- a/src/share/classes/java/lang/invoke/CallSite.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/lang/invoke/CallSite.java	Fri Jun 21 19:11:42 2013 -0700
@@ -26,7 +26,6 @@
 package java.lang.invoke;
 
 import sun.invoke.empty.Empty;
-import sun.misc.Unsafe;
 import static java.lang.invoke.MethodHandleStatics.*;
 import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
 
@@ -87,13 +86,9 @@
 public class CallSite {
     static { MethodHandleImpl.initStatics(); }
 
-    // Fields used only by the JVM.  Do not use or change.
-    private MemberName vmmethod; // supplied by the JVM (ref. to calling method)
-    private int        vmindex;  // supplied by the JVM (BCI within calling method)
-
     // The actual payload of this call site:
     /*package-private*/
-    MethodHandle target;
+    MethodHandle target;    // Note: This field is known to the JVM.  Do not change.
 
     /**
      * Make a blank call site object with the given method type.
@@ -152,24 +147,6 @@
         return target.type();
     }
 
-    /** Called from JVM (or low-level Java code) after the BSM returns the newly created CallSite.
-     *  The parameters are JVM-specific.
-     */
-    void initializeFromJVM(String name,
-                           MethodType type,
-                           MemberName callerMethod,
-                           int        callerBCI) {
-        if (this.vmmethod != null) {
-            // FIXME
-            throw new BootstrapMethodError("call site has already been linked to an invokedynamic instruction");
-        }
-        if (!this.type().equals(type)) {
-            throw wrongTargetType(target, type);
-        }
-        this.vmindex  = callerBCI;
-        this.vmmethod = callerMethod;
-    }
-
     /**
      * Returns the target method of the call site, according to the
      * behavior defined by this call site's specific class.
@@ -234,7 +211,7 @@
     public abstract MethodHandle dynamicInvoker();
 
     /*non-public*/ MethodHandle makeDynamicInvoker() {
-        MethodHandle getTarget = MethodHandleImpl.bindReceiver(GET_TARGET, this);
+        MethodHandle getTarget = GET_TARGET.bindReceiver(this);
         MethodHandle invoker = MethodHandles.exactInvoker(this.type());
         return MethodHandles.foldArguments(invoker, getTarget);
     }
@@ -244,8 +221,8 @@
         try {
             GET_TARGET = IMPL_LOOKUP.
                 findVirtual(CallSite.class, "getTarget", MethodType.methodType(MethodHandle.class));
-        } catch (ReflectiveOperationException ignore) {
-            throw new InternalError();
+        } catch (ReflectiveOperationException e) {
+            throw newInternalError(e);
         }
     }
 
@@ -256,12 +233,10 @@
     }
 
     // unsafe stuff:
-    private static final Unsafe unsafe = Unsafe.getUnsafe();
     private static final long TARGET_OFFSET;
-
     static {
         try {
-            TARGET_OFFSET = unsafe.objectFieldOffset(CallSite.class.getDeclaredField("target"));
+            TARGET_OFFSET = UNSAFE.objectFieldOffset(CallSite.class.getDeclaredField("target"));
         } catch (Exception ex) { throw new Error(ex); }
     }
 
@@ -271,7 +246,7 @@
     }
     /*package-private*/
     MethodHandle getTargetVolatile() {
-        return (MethodHandle) unsafe.getObjectVolatile(this, TARGET_OFFSET);
+        return (MethodHandle) UNSAFE.getObjectVolatile(this, TARGET_OFFSET);
     }
     /*package-private*/
     void setTargetVolatile(MethodHandle newTarget) {
@@ -285,8 +260,7 @@
                              // Extra arguments for BSM, if any:
                              Object info,
                              // Caller information:
-                             MemberName callerMethod, int callerBCI) {
-        Class<?> callerClass = callerMethod.getDeclaringClass();
+                             Class<?> callerClass) {
         Object caller = IMPL_LOOKUP.in(callerClass);
         CallSite site;
         try {
--- a/src/share/classes/java/lang/invoke/CountingMethodHandle.java	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 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 java.lang.invoke;
-
-import static java.lang.invoke.MethodHandleNatives.Constants.*;
-
-/**
- * This method handle is used to optionally provide a count of how
- * many times it was invoked.
- *
- * @author never
- */
-class CountingMethodHandle extends AdapterMethodHandle {
-    private int vmcount;
-
-    private CountingMethodHandle(MethodHandle target) {
-        super(target, target.type(), AdapterMethodHandle.makeConv(OP_RETYPE_ONLY));
-    }
-
-    /** Wrap the incoming MethodHandle in a CountingMethodHandle if they are enabled */
-    static MethodHandle wrap(MethodHandle mh) {
-        if (MethodHandleNatives.COUNT_GWT) {
-            return new CountingMethodHandle(mh);
-        }
-        return mh;
-    }
-}
--- a/src/share/classes/java/lang/invoke/DirectMethodHandle.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/lang/invoke/DirectMethodHandle.java	Fri Jun 21 19:11:42 2013 -0700
@@ -25,38 +25,646 @@
 
 package java.lang.invoke;
 
+import sun.misc.Unsafe;
+import java.lang.reflect.Method;
+import java.util.Arrays;
+import sun.invoke.util.VerifyAccess;
 import static java.lang.invoke.MethodHandleNatives.Constants.*;
+import static java.lang.invoke.LambdaForm.*;
+import static java.lang.invoke.MethodTypeForm.*;
+import static java.lang.invoke.MethodHandleStatics.*;
+import java.lang.ref.WeakReference;
+import java.lang.reflect.Field;
+import sun.invoke.util.ValueConversions;
+import sun.invoke.util.VerifyType;
+import sun.invoke.util.Wrapper;
 
 /**
- * The flavor of method handle which emulates invokespecial or invokestatic.
+ * The flavor of method handle which implements a constant reference
+ * to a class member.
  * @author jrose
  */
 class DirectMethodHandle extends MethodHandle {
-    //inherited oop    vmtarget;    // methodOop or virtual class/interface oop
-    private final int  vmindex;     // method index within class or interface
-    { vmindex = VM_INDEX_UNINITIALIZED; }  // JVM may change this
+    final MemberName member;
 
-    // Constructors in this class *must* be package scoped or private.
-    DirectMethodHandle(MethodType mtype, MemberName m, boolean doDispatch, Class<?> lookupClass) {
-        super(mtype);
-
-        assert(m.isMethod() || !doDispatch && m.isConstructor());
-        if (!m.isResolved())
+    // Constructors and factory methods in this class *must* be package scoped or private.
+    private DirectMethodHandle(MethodType mtype, LambdaForm form, MemberName member) {
+        super(mtype, form);
+        if (!member.isResolved())
             throw new InternalError();
 
-        if (m.getDeclaringClass().isInterface() && !m.isAbstract()) {
-            // Check for corner case: invokeinterface of Object method.
-            MemberName m2 = new MemberName(Object.class, m.getName(), m.getMethodType(), m.getModifiers());
-            m2 = MemberName.getFactory().resolveOrNull(m2, false, null);
-            if (m2 != null && m2.isPublic()) {
-                m = m2;
+        if (member.getDeclaringClass().isInterface() && !member.isAbstract()) {
+           // Check for corner case: invokeinterface of Object method
+            MemberName m = new MemberName(Object.class, member.getName(), member.getMethodType(), member.getReferenceKind());
+            m = MemberName.getFactory().resolveOrNull(m.getReferenceKind(), m, null);
+            if (m != null && m.isPublic()) {
+                member = m;
             }
         }
 
-        MethodHandleNatives.init(this, (Object) m, doDispatch, lookupClass);
+        this.member = member;
+    }
+
+    // Factory methods:
+
+    static DirectMethodHandle make(Class<?> receiver, MemberName member) {
+        MethodType mtype = member.getMethodOrFieldType();
+        if (!member.isStatic()) {
+            if (!member.getDeclaringClass().isAssignableFrom(receiver) || member.isConstructor())
+                throw new InternalError(member.toString());
+            mtype = mtype.insertParameterTypes(0, receiver);
+        }
+        if (!member.isField()) {
+            LambdaForm lform = preparedLambdaForm(member);
+            return new DirectMethodHandle(mtype, lform, member);
+        } else {
+            LambdaForm lform = preparedFieldLambdaForm(member);
+            if (member.isStatic()) {
+                long offset = MethodHandleNatives.staticFieldOffset(member);
+                Object base = MethodHandleNatives.staticFieldBase(member);
+                return new StaticAccessor(mtype, lform, member, base, offset);
+            } else {
+                long offset = MethodHandleNatives.objectFieldOffset(member);
+                assert(offset == (int)offset);
+                return new Accessor(mtype, lform, member, (int)offset);
+            }
+        }
+    }
+    static DirectMethodHandle make(MemberName member) {
+        if (member.isConstructor())
+            return makeAllocator(member);
+        return make(member.getDeclaringClass(), member);
+    }
+    static DirectMethodHandle make(Method method) {
+        return make(method.getDeclaringClass(), new MemberName(method));
+    }
+    static DirectMethodHandle make(Field field) {
+        return make(field.getDeclaringClass(), new MemberName(field));
+    }
+    private static DirectMethodHandle makeAllocator(MemberName ctor) {
+        assert(ctor.isConstructor() && ctor.getName().equals("<init>"));
+        Class<?> instanceClass = ctor.getDeclaringClass();
+        ctor = ctor.asConstructor();
+        assert(ctor.isConstructor() && ctor.getReferenceKind() == REF_newInvokeSpecial) : ctor;
+        MethodType mtype = ctor.getMethodType().changeReturnType(instanceClass);
+        LambdaForm lform = preparedLambdaForm(ctor);
+        MemberName init = ctor.asSpecial();
+        assert(init.getMethodType().returnType() == void.class);
+        return new Constructor(mtype, lform, ctor, init, instanceClass);
+    }
+
+    @Override
+    MethodHandle copyWith(MethodType mt, LambdaForm lf) {
+        return new DirectMethodHandle(mt, lf, member);
+    }
+
+    @Override
+    String internalProperties() {
+        return "/DMH="+member.toString();
+    }
+
+    //// Implementation methods.
+    @Override
+    @ForceInline
+    MemberName internalMemberName() {
+        return member;
+    }
+
+    @Override
+    MethodHandle bindArgument(int pos, char basicType, Object value) {
+        // If the member needs dispatching, do so.
+        if (pos == 0 && basicType == 'L') {
+            DirectMethodHandle concrete = maybeRebind(value);
+            if (concrete != null)
+                return concrete.bindReceiver(value);
+        }
+        return super.bindArgument(pos, basicType, value);
+    }
+
+    @Override
+    MethodHandle bindReceiver(Object receiver) {
+        // If the member needs dispatching, do so.
+        DirectMethodHandle concrete = maybeRebind(receiver);
+        if (concrete != null)
+            return concrete.bindReceiver(receiver);
+        return super.bindReceiver(receiver);
+    }
+
+    private static final MemberName.Factory IMPL_NAMES = MemberName.getFactory();
+
+    private DirectMethodHandle maybeRebind(Object receiver) {
+        if (receiver != null) {
+            switch (member.getReferenceKind()) {
+            case REF_invokeInterface:
+            case REF_invokeVirtual:
+                // Pre-dispatch the member.
+                Class<?> concreteClass = receiver.getClass();
+                MemberName concrete = new MemberName(concreteClass, member.getName(), member.getMethodType(), REF_invokeSpecial);
+                concrete = IMPL_NAMES.resolveOrNull(REF_invokeSpecial, concrete, concreteClass);
+                if (concrete != null)
+                    return new DirectMethodHandle(type(), preparedLambdaForm(concrete), concrete);
+                break;
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Create a LF which can invoke the given method.
+     * Cache and share this structure among all methods with
+     * the same basicType and refKind.
+     */
+    private static LambdaForm preparedLambdaForm(MemberName m) {
+        assert(m.isInvocable()) : m;  // call preparedFieldLambdaForm instead
+        MethodType mtype = m.getInvocationType().basicType();
+        assert(!m.isMethodHandleInvoke() || "invokeBasic".equals(m.getName())) : m;
+        int which;
+        switch (m.getReferenceKind()) {
+        case REF_invokeVirtual:    which = LF_INVVIRTUAL;    break;
+        case REF_invokeStatic:     which = LF_INVSTATIC;     break;
+        case REF_invokeSpecial:    which = LF_INVSPECIAL;    break;
+        case REF_invokeInterface:  which = LF_INVINTERFACE;  break;
+        case REF_newInvokeSpecial: which = LF_NEWINVSPECIAL; break;
+        default:  throw new InternalError(m.toString());
+        }
+        if (which == LF_INVSTATIC && shouldBeInitialized(m)) {
+            // precompute the barrier-free version:
+            preparedLambdaForm(mtype, which);
+            which = LF_INVSTATIC_INIT;
+        }
+        LambdaForm lform = preparedLambdaForm(mtype, which);
+        maybeCompile(lform, m);
+        assert(lform.methodType().dropParameterTypes(0, 1)
+                .equals(m.getInvocationType().basicType()))
+                : Arrays.asList(m, m.getInvocationType().basicType(), lform, lform.methodType());
+        return lform;
+    }
+
+    private static LambdaForm preparedLambdaForm(MethodType mtype, int which) {
+        LambdaForm lform = mtype.form().cachedLambdaForm(which);
+        if (lform != null)  return lform;
+        lform = makePreparedLambdaForm(mtype, which);
+        return mtype.form().setCachedLambdaForm(which, lform);
+    }
+
+    private static LambdaForm makePreparedLambdaForm(MethodType mtype, int which) {
+        boolean needsInit = (which == LF_INVSTATIC_INIT);
+        boolean doesAlloc = (which == LF_NEWINVSPECIAL);
+        String linkerName, lambdaName;
+        switch (which) {
+        case LF_INVVIRTUAL:    linkerName = "linkToVirtual";    lambdaName = "DMH.invokeVirtual";    break;
+        case LF_INVSTATIC:     linkerName = "linkToStatic";     lambdaName = "DMH.invokeStatic";     break;
+        case LF_INVSTATIC_INIT:linkerName = "linkToStatic";     lambdaName = "DMH.invokeStaticInit"; break;
+        case LF_INVSPECIAL:    linkerName = "linkToSpecial";    lambdaName = "DMH.invokeSpecial";    break;
+        case LF_INVINTERFACE:  linkerName = "linkToInterface";  lambdaName = "DMH.invokeInterface";  break;
+        case LF_NEWINVSPECIAL: linkerName = "linkToSpecial";    lambdaName = "DMH.newInvokeSpecial"; break;
+        default:  throw new InternalError("which="+which);
+        }
+        MethodType mtypeWithArg = mtype.appendParameterTypes(MemberName.class);
+        if (doesAlloc)
+            mtypeWithArg = mtypeWithArg
+                    .insertParameterTypes(0, Object.class)  // insert newly allocated obj
+                    .changeReturnType(void.class);          // <init> returns void
+        MemberName linker = new MemberName(MethodHandle.class, linkerName, mtypeWithArg, REF_invokeStatic);
+        try {
+            linker = IMPL_NAMES.resolveOrFail(REF_invokeStatic, linker, null, NoSuchMethodException.class);
+        } catch (ReflectiveOperationException ex) {
+            throw newInternalError(ex);
+        }
+        final int DMH_THIS    = 0;
+        final int ARG_BASE    = 1;
+        final int ARG_LIMIT   = ARG_BASE + mtype.parameterCount();
+        int nameCursor = ARG_LIMIT;
+        final int NEW_OBJ     = (doesAlloc ? nameCursor++ : -1);
+        final int GET_MEMBER  = nameCursor++;
+        final int LINKER_CALL = nameCursor++;
+        Name[] names = arguments(nameCursor - ARG_LIMIT, mtype.invokerType());
+        assert(names.length == nameCursor);
+        if (doesAlloc) {
+            // names = { argx,y,z,... new C, init method }
+            names[NEW_OBJ] = new Name(NF_allocateInstance, names[DMH_THIS]);
+            names[GET_MEMBER] = new Name(NF_constructorMethod, names[DMH_THIS]);
+        } else if (needsInit) {
+            names[GET_MEMBER] = new Name(NF_internalMemberNameEnsureInit, names[DMH_THIS]);
+        } else {
+            names[GET_MEMBER] = new Name(NF_internalMemberName, names[DMH_THIS]);
+        }
+        Object[] outArgs = Arrays.copyOfRange(names, ARG_BASE, GET_MEMBER+1, Object[].class);
+        assert(outArgs[outArgs.length-1] == names[GET_MEMBER]);  // look, shifted args!
+        int result = LambdaForm.LAST_RESULT;
+        if (doesAlloc) {
+            assert(outArgs[outArgs.length-2] == names[NEW_OBJ]);  // got to move this one
+            System.arraycopy(outArgs, 0, outArgs, 1, outArgs.length-2);
+            outArgs[0] = names[NEW_OBJ];
+            result = NEW_OBJ;
+        }
+        names[LINKER_CALL] = new Name(linker, outArgs);
+        lambdaName += "_" + LambdaForm.basicTypeSignature(mtype);
+        LambdaForm lform = new LambdaForm(lambdaName, ARG_LIMIT, names, result);
+        // This is a tricky bit of code.  Don't send it through the LF interpreter.
+        lform.compileToBytecode();
+        return lform;
+    }
+
+    private static void maybeCompile(LambdaForm lform, MemberName m) {
+        if (VerifyAccess.isSamePackage(m.getDeclaringClass(), MethodHandle.class))
+            // Help along bootstrapping...
+            lform.compileToBytecode();
+    }
+
+    /** Static wrapper for DirectMethodHandle.internalMemberName. */
+    @ForceInline
+    /*non-public*/ static Object internalMemberName(Object mh) {
+        return ((DirectMethodHandle)mh).member;
+    }
+
+    /** Static wrapper for DirectMethodHandle.internalMemberName.
+     * This one also forces initialization.
+     */
+    /*non-public*/ static Object internalMemberNameEnsureInit(Object mh) {
+        DirectMethodHandle dmh = (DirectMethodHandle)mh;
+        dmh.ensureInitialized();
+        return dmh.member;
+    }
+
+    /*non-public*/ static
+    boolean shouldBeInitialized(MemberName member) {
+        switch (member.getReferenceKind()) {
+        case REF_invokeStatic:
+        case REF_getStatic:
+        case REF_putStatic:
+        case REF_newInvokeSpecial:
+            break;
+        default:
+            // No need to initialize the class on this kind of member.
+            return false;
+        }
+        Class<?> cls = member.getDeclaringClass();
+        if (cls == ValueConversions.class ||
+            cls == MethodHandleImpl.class ||
+            cls == Invokers.class) {
+            // These guys have lots of <clinit> DMH creation but we know
+            // the MHs will not be used until the system is booted.
+            return false;
+        }
+        if (VerifyAccess.isSamePackage(MethodHandle.class, cls) ||
+            VerifyAccess.isSamePackage(ValueConversions.class, cls)) {
+            // It is a system class.  It is probably in the process of
+            // being initialized, but we will help it along just to be safe.
+            if (UNSAFE.shouldBeInitialized(cls)) {
+                UNSAFE.ensureClassInitialized(cls);
+            }
+            return false;
+        }
+        return UNSAFE.shouldBeInitialized(cls);
+    }
+
+    private static class EnsureInitialized extends ClassValue<WeakReference<Thread>> {
+        @Override
+        protected WeakReference<Thread> computeValue(Class<?> type) {
+            UNSAFE.ensureClassInitialized(type);
+            if (UNSAFE.shouldBeInitialized(type))
+                // If the previous call didn't block, this can happen.
+                // We are executing inside <clinit>.
+                return new WeakReference<>(Thread.currentThread());
+            return null;
+        }
+        static final EnsureInitialized INSTANCE = new EnsureInitialized();
+    }
+
+    private void ensureInitialized() {
+        if (checkInitialized(member)) {
+            // The coast is clear.  Delete the <clinit> barrier.
+            if (member.isField())
+                updateForm(preparedFieldLambdaForm(member));
+            else
+                updateForm(preparedLambdaForm(member));
+        }
+    }
+    private static boolean checkInitialized(MemberName member) {
+        Class<?> defc = member.getDeclaringClass();
+        WeakReference<Thread> ref = EnsureInitialized.INSTANCE.get(defc);
+        if (ref == null) {
+            return true;  // the final state
+        }
+        Thread clinitThread = ref.get();
+        // Somebody may still be running defc.<clinit>.
+        if (clinitThread == Thread.currentThread()) {
+            // If anybody is running defc.<clinit>, it is this thread.
+            if (UNSAFE.shouldBeInitialized(defc))
+                // Yes, we are running it; keep the barrier for now.
+                return false;
+        } else {
+            // We are in a random thread.  Block.
+            UNSAFE.ensureClassInitialized(defc);
+        }
+        assert(!UNSAFE.shouldBeInitialized(defc));
+        // put it into the final state
+        EnsureInitialized.INSTANCE.remove(defc);
+        return true;
     }
 
-    boolean isValid() {
-        return (vmindex != VM_INDEX_UNINITIALIZED);
+    /*non-public*/ static void ensureInitialized(Object mh) {
+        ((DirectMethodHandle)mh).ensureInitialized();
+    }
+
+    /** This subclass handles constructor references. */
+    static class Constructor extends DirectMethodHandle {
+        final MemberName initMethod;
+        final Class<?>   instanceClass;
+
+        private Constructor(MethodType mtype, LambdaForm form, MemberName constructor,
+                            MemberName initMethod, Class<?> instanceClass) {
+            super(mtype, form, constructor);
+            this.initMethod = initMethod;
+            this.instanceClass = instanceClass;
+            assert(initMethod.isResolved());
+        }
+    }
+
+    /*non-public*/ static Object constructorMethod(Object mh) {
+        Constructor dmh = (Constructor)mh;
+        return dmh.initMethod;
+    }
+
+    /*non-public*/ static Object allocateInstance(Object mh) throws InstantiationException {
+        Constructor dmh = (Constructor)mh;
+        return UNSAFE.allocateInstance(dmh.instanceClass);
+    }
+
+    /** This subclass handles non-static field references. */
+    static class Accessor extends DirectMethodHandle {
+        final Class<?> fieldType;
+        final int      fieldOffset;
+        private Accessor(MethodType mtype, LambdaForm form, MemberName member,
+                         int fieldOffset) {
+            super(mtype, form, member);
+            this.fieldType   = member.getFieldType();
+            this.fieldOffset = fieldOffset;
+        }
+
+        @Override Object checkCast(Object obj) {
+            return fieldType.cast(obj);
+        }
+    }
+
+    @ForceInline
+    /*non-public*/ static long fieldOffset(Object accessorObj) {
+        // Note: We return a long because that is what Unsafe.getObject likes.
+        // We store a plain int because it is more compact.
+        return ((Accessor)accessorObj).fieldOffset;
+    }
+
+    @ForceInline
+    /*non-public*/ static Object checkBase(Object obj) {
+        // Note that the object's class has already been verified,
+        // since the parameter type of the Accessor method handle
+        // is either member.getDeclaringClass or a subclass.
+        // This was verified in DirectMethodHandle.make.
+        // Therefore, the only remaining check is for null.
+        // Since this check is *not* guaranteed by Unsafe.getInt
+        // and its siblings, we need to make an explicit one here.
+        obj.getClass();  // maybe throw NPE
+        return obj;
+    }
+
+    /** This subclass handles static field references. */
+    static class StaticAccessor extends DirectMethodHandle {
+        final private Class<?> fieldType;
+        final private Object   staticBase;
+        final private long     staticOffset;
+
+        private StaticAccessor(MethodType mtype, LambdaForm form, MemberName member,
+                               Object staticBase, long staticOffset) {
+            super(mtype, form, member);
+            this.fieldType    = member.getFieldType();
+            this.staticBase   = staticBase;
+            this.staticOffset = staticOffset;
+        }
+
+        @Override Object checkCast(Object obj) {
+            return fieldType.cast(obj);
+        }
+    }
+
+    @ForceInline
+    /*non-public*/ static Object nullCheck(Object obj) {
+        obj.getClass();
+        return obj;
+    }
+
+    @ForceInline
+    /*non-public*/ static Object staticBase(Object accessorObj) {
+        return ((StaticAccessor)accessorObj).staticBase;
+    }
+
+    @ForceInline
+    /*non-public*/ static long staticOffset(Object accessorObj) {
+        return ((StaticAccessor)accessorObj).staticOffset;
+    }
+
+    @ForceInline
+    /*non-public*/ static Object checkCast(Object mh, Object obj) {
+        return ((DirectMethodHandle) mh).checkCast(obj);
+    }
+
+    Object checkCast(Object obj) {
+        return member.getReturnType().cast(obj);
+    }
+
+    // Caching machinery for field accessors:
+    private static byte
+            AF_GETFIELD        = 0,
+            AF_PUTFIELD        = 1,
+            AF_GETSTATIC       = 2,
+            AF_PUTSTATIC       = 3,
+            AF_GETSTATIC_INIT  = 4,
+            AF_PUTSTATIC_INIT  = 5,
+            AF_LIMIT           = 6;
+    // Enumerate the different field kinds using Wrapper,
+    // with an extra case added for checked references.
+    private static int
+            FT_LAST_WRAPPER    = Wrapper.values().length-1,
+            FT_UNCHECKED_REF   = Wrapper.OBJECT.ordinal(),
+            FT_CHECKED_REF     = FT_LAST_WRAPPER+1,
+            FT_LIMIT           = FT_LAST_WRAPPER+2;
+    private static int afIndex(byte formOp, boolean isVolatile, int ftypeKind) {
+        return ((formOp * FT_LIMIT * 2)
+                + (isVolatile ? FT_LIMIT : 0)
+                + ftypeKind);
+    }
+    private static final LambdaForm[] ACCESSOR_FORMS
+            = new LambdaForm[afIndex(AF_LIMIT, false, 0)];
+    private static int ftypeKind(Class<?> ftype) {
+        if (ftype.isPrimitive())
+            return Wrapper.forPrimitiveType(ftype).ordinal();
+        else if (VerifyType.isNullReferenceConversion(Object.class, ftype))
+            return FT_UNCHECKED_REF;
+        else
+            return FT_CHECKED_REF;
+    }
+
+    /**
+     * Create a LF which can access the given field.
+     * Cache and share this structure among all fields with
+     * the same basicType and refKind.
+     */
+    private static LambdaForm preparedFieldLambdaForm(MemberName m) {
+        Class<?> ftype = m.getFieldType();
+        boolean isVolatile = m.isVolatile();
+        byte formOp;
+        switch (m.getReferenceKind()) {
+        case REF_getField:      formOp = AF_GETFIELD;    break;
+        case REF_putField:      formOp = AF_PUTFIELD;    break;
+        case REF_getStatic:     formOp = AF_GETSTATIC;   break;
+        case REF_putStatic:     formOp = AF_PUTSTATIC;   break;
+        default:  throw new InternalError(m.toString());
+        }
+        if (shouldBeInitialized(m)) {
+            // precompute the barrier-free version:
+            preparedFieldLambdaForm(formOp, isVolatile, ftype);
+            assert((AF_GETSTATIC_INIT - AF_GETSTATIC) ==
+                   (AF_PUTSTATIC_INIT - AF_PUTSTATIC));
+            formOp += (AF_GETSTATIC_INIT - AF_GETSTATIC);
+        }
+        LambdaForm lform = preparedFieldLambdaForm(formOp, isVolatile, ftype);
+        maybeCompile(lform, m);
+        assert(lform.methodType().dropParameterTypes(0, 1)
+                .equals(m.getInvocationType().basicType()))
+                : Arrays.asList(m, m.getInvocationType().basicType(), lform, lform.methodType());
+        return lform;
+    }
+    private static LambdaForm preparedFieldLambdaForm(byte formOp, boolean isVolatile, Class<?> ftype) {
+        int afIndex = afIndex(formOp, isVolatile, ftypeKind(ftype));
+        LambdaForm lform = ACCESSOR_FORMS[afIndex];
+        if (lform != null)  return lform;
+        lform = makePreparedFieldLambdaForm(formOp, isVolatile, ftypeKind(ftype));
+        ACCESSOR_FORMS[afIndex] = lform;  // don't bother with a CAS
+        return lform;
+    }
+
+    private static LambdaForm makePreparedFieldLambdaForm(byte formOp, boolean isVolatile, int ftypeKind) {
+        boolean isGetter  = (formOp & 1) == (AF_GETFIELD & 1);
+        boolean isStatic  = (formOp >= AF_GETSTATIC);
+        boolean needsInit = (formOp >= AF_GETSTATIC_INIT);
+        boolean needsCast = (ftypeKind == FT_CHECKED_REF);
+        Wrapper fw = (needsCast ? Wrapper.OBJECT : Wrapper.values()[ftypeKind]);
+        Class<?> ft = fw.primitiveType();
+        assert(ftypeKind(needsCast ? String.class : ft) == ftypeKind);
+        String tname  = fw.primitiveSimpleName();
+        String ctname = Character.toUpperCase(tname.charAt(0)) + tname.substring(1);
+        if (isVolatile)  ctname += "Volatile";
+        String getOrPut = (isGetter ? "get" : "put");
+        String linkerName = (getOrPut + ctname);  // getObject, putIntVolatile, etc.
+        MethodType linkerType;
+        if (isGetter)
+            linkerType = MethodType.methodType(ft, Object.class, long.class);
+        else
+            linkerType = MethodType.methodType(void.class, Object.class, long.class, ft);
+        MemberName linker = new MemberName(Unsafe.class, linkerName, linkerType, REF_invokeVirtual);
+        try {
+            linker = IMPL_NAMES.resolveOrFail(REF_invokeVirtual, linker, null, NoSuchMethodException.class);
+        } catch (ReflectiveOperationException ex) {
+            throw newInternalError(ex);
+        }
+
+        // What is the external type of the lambda form?
+        MethodType mtype;
+        if (isGetter)
+            mtype = MethodType.methodType(ft);
+        else
+            mtype = MethodType.methodType(void.class, ft);
+        mtype = mtype.basicType();  // erase short to int, etc.
+        if (!isStatic)
+            mtype = mtype.insertParameterTypes(0, Object.class);
+        final int DMH_THIS  = 0;
+        final int ARG_BASE  = 1;
+        final int ARG_LIMIT = ARG_BASE + mtype.parameterCount();
+        // if this is for non-static access, the base pointer is stored at this index:
+        final int OBJ_BASE  = isStatic ? -1 : ARG_BASE;
+        // if this is for write access, the value to be written is stored at this index:
+        final int SET_VALUE  = isGetter ? -1 : ARG_LIMIT - 1;
+        int nameCursor = ARG_LIMIT;
+        final int F_HOLDER  = (isStatic ? nameCursor++ : -1);  // static base if any
+        final int F_OFFSET  = nameCursor++;  // Either static offset or field offset.
+        final int OBJ_CHECK = (OBJ_BASE >= 0 ? nameCursor++ : -1);
+        final int INIT_BAR  = (needsInit ? nameCursor++ : -1);
+        final int PRE_CAST  = (needsCast && !isGetter ? nameCursor++ : -1);
+        final int LINKER_CALL = nameCursor++;
+        final int POST_CAST = (needsCast && isGetter ? nameCursor++ : -1);
+        final int RESULT    = nameCursor-1;  // either the call or the cast
+        Name[] names = arguments(nameCursor - ARG_LIMIT, mtype.invokerType());
+        if (needsInit)
+            names[INIT_BAR] = new Name(NF_ensureInitialized, names[DMH_THIS]);
+        if (needsCast && !isGetter)
+            names[PRE_CAST] = new Name(NF_checkCast, names[DMH_THIS], names[SET_VALUE]);
+        Object[] outArgs = new Object[1 + linkerType.parameterCount()];
+        assert(outArgs.length == (isGetter ? 3 : 4));
+        outArgs[0] = UNSAFE;
+        if (isStatic) {
+            outArgs[1] = names[F_HOLDER]  = new Name(NF_staticBase, names[DMH_THIS]);
+            outArgs[2] = names[F_OFFSET]  = new Name(NF_staticOffset, names[DMH_THIS]);
+        } else {
+            outArgs[1] = names[OBJ_CHECK] = new Name(NF_checkBase, names[OBJ_BASE]);
+            outArgs[2] = names[F_OFFSET]  = new Name(NF_fieldOffset, names[DMH_THIS]);
+        }
+        if (!isGetter) {
+            outArgs[3] = (needsCast ? names[PRE_CAST] : names[SET_VALUE]);
+        }
+        for (Object a : outArgs)  assert(a != null);
+        names[LINKER_CALL] = new Name(linker, outArgs);
+        if (needsCast && isGetter)
+            names[POST_CAST] = new Name(NF_checkCast, names[DMH_THIS], names[LINKER_CALL]);
+        for (Name n : names)  assert(n != null);
+        String fieldOrStatic = (isStatic ? "Static" : "Field");
+        String lambdaName = (linkerName + fieldOrStatic);  // significant only for debugging
+        if (needsCast)  lambdaName += "Cast";
+        if (needsInit)  lambdaName += "Init";
+        return new LambdaForm(lambdaName, ARG_LIMIT, names, RESULT);
+    }
+
+    private static final NamedFunction
+            NF_internalMemberName,
+            NF_internalMemberNameEnsureInit,
+            NF_ensureInitialized,
+            NF_fieldOffset,
+            NF_checkBase,
+            NF_staticBase,
+            NF_staticOffset,
+            NF_checkCast,
+            NF_allocateInstance,
+            NF_constructorMethod;
+    static {
+        try {
+            NamedFunction nfs[] = {
+                NF_internalMemberName = new NamedFunction(DirectMethodHandle.class
+                    .getDeclaredMethod("internalMemberName", Object.class)),
+                NF_internalMemberNameEnsureInit = new NamedFunction(DirectMethodHandle.class
+                    .getDeclaredMethod("internalMemberNameEnsureInit", Object.class)),
+                NF_ensureInitialized = new NamedFunction(DirectMethodHandle.class
+                    .getDeclaredMethod("ensureInitialized", Object.class)),
+                NF_fieldOffset = new NamedFunction(DirectMethodHandle.class
+                    .getDeclaredMethod("fieldOffset", Object.class)),
+                NF_checkBase = new NamedFunction(DirectMethodHandle.class
+                    .getDeclaredMethod("checkBase", Object.class)),
+                NF_staticBase = new NamedFunction(DirectMethodHandle.class
+                    .getDeclaredMethod("staticBase", Object.class)),
+                NF_staticOffset = new NamedFunction(DirectMethodHandle.class
+                    .getDeclaredMethod("staticOffset", Object.class)),
+                NF_checkCast = new NamedFunction(DirectMethodHandle.class
+                    .getDeclaredMethod("checkCast", Object.class, Object.class)),
+                NF_allocateInstance = new NamedFunction(DirectMethodHandle.class
+                    .getDeclaredMethod("allocateInstance", Object.class)),
+                NF_constructorMethod = new NamedFunction(DirectMethodHandle.class
+                    .getDeclaredMethod("constructorMethod", Object.class))
+            };
+            for (NamedFunction nf : nfs) {
+                // Each nf must be statically invocable or we get tied up in our bootstraps.
+                assert(InvokerBytecodeGenerator.isStaticallyInvocable(nf.member)) : nf;
+                nf.resolve();
+            }
+        } catch (ReflectiveOperationException ex) {
+            throw newInternalError(ex);
+        }
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/java/lang/invoke/DontInline.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,37 @@
+/*
+ * 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.  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.invoke;
+
+import java.lang.annotation.*;
+
+/**
+ * Internal marker for some methods in the JSR 292 implementation.
+ */
+/*non-public*/
+@Target({ElementType.METHOD, ElementType.CONSTRUCTOR})
+@Retention(RetentionPolicy.RUNTIME)
+@interface DontInline {
+}
--- a/src/share/classes/java/lang/invoke/FilterGeneric.java	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4500 +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.
- */
-
-package java.lang.invoke;
-
-import java.lang.reflect.*;
-import static java.lang.invoke.MethodHandleStatics.*;
-import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
-
-/**
- * These adapters apply arbitrary conversions to arguments
- * on the way to a ultimate target.
- * For simplicity, these are all generically typed.
- * @author jrose
- */
-class FilterGeneric {
-    // type for the incoming call (will be generic)
-    private final MethodType entryType;
-    // prototype adapters (clone and customize for each new target & conversion!)
-    private final Adapter[] adapters;
-
-    /** Compute and cache information common to all filtering adapters
-     *  with the given generic type
-     */
-    FilterGeneric(MethodType entryType) {
-        this.entryType = entryType;
-        int tableSize = Kind.LIMIT.invokerIndex(1 + entryType.parameterCount());
-        this.adapters = new Adapter[tableSize];
-    }
-
-    Adapter getAdapter(Kind kind, int pos) {
-        int index = kind.invokerIndex(pos);
-        Adapter ad = adapters[index];
-        if (ad != null)  return ad;
-        ad = findAdapter(entryType, kind, pos);
-        if (ad == null)
-            ad = buildAdapterFromBytecodes(entryType, kind, pos);
-        adapters[index] = ad;
-        return ad;
-    }
-
-    static {
-        assert(MethodHandleNatives.workaroundWithoutRicochetFrames());  // this class is deprecated
-    }
-
-    Adapter makeInstance(Kind kind, int pos, MethodHandle filter, MethodHandle target) {
-        Adapter ad = getAdapter(kind, pos);
-        return ad.makeInstance(ad.prototypeEntryPoint(), filter, target);
-    }
-
-    /** Build an adapter of the given generic type, which invokes filter
-     *  on the selected incoming argument before passing it to the target.
-     * @param pos the argument to filter
-     * @param filter the function to call on the argument
-     * @param target the target to call with the modified argument list
-     * @return an adapter method handle
-     */
-    public static MethodHandle makeArgumentFilter(int pos, MethodHandle filter, MethodHandle target) {
-        return make(Kind.value, pos, filter, target);
-    }
-
-    /** Build an adapter of the given generic type, which invokes a combiner
-     *  on a selected group of leading arguments.
-     *  The result of the combiner is prepended before all those arguments.
-     * @param combiner the function to call on the selected leading arguments
-     * @param target the target to call with the modified argument list
-     * @return an adapter method handle
-     */
-    public static MethodHandle makeArgumentFolder(MethodHandle combiner, MethodHandle target) {
-        int num = combiner.type().parameterCount();
-        return make(Kind.fold, num, combiner, target);
-    }
-
-    /** Build an adapter of the given generic type, which invokes a filter
-     *  on the incoming arguments, reified as a group.
-     *  The argument may be modified (by side effects in the filter).
-     *  The arguments, possibly modified, are passed on to the target.
-     * @param filter the function to call on the arguments
-     * @param target the target to call with the possibly-modified argument list
-     * @return an adapter method handle
-     */
-    public static MethodHandle makeFlyby(MethodHandle filter, MethodHandle target) {
-        return make(Kind.flyby, 0, filter, target);
-    }
-
-    /** Build an adapter of the given generic type, which invokes a collector
-     *  on the selected incoming argument and all following arguments.
-     *  The result of the collector replaces all those arguments.
-     * @param collector the function to call on the selected trailing arguments
-     * @param target the target to call with the modified argument list
-     * @return an adapter method handle
-     */
-    public static MethodHandle makeArgumentCollector(MethodHandle collector, MethodHandle target) {
-        int pos = target.type().parameterCount() - 1;
-        return make(Kind.collect, pos, collector, target);
-    }
-
-    static MethodHandle make(Kind kind, int pos, MethodHandle filter, MethodHandle target) {
-        FilterGeneric fgen = of(kind, pos, filter.type(), target.type());
-        return fgen.makeInstance(kind, pos, filter, target);
-    }
-
-    /** Return the adapter information for this target and filter type. */
-    static FilterGeneric of(Kind kind, int pos, MethodType filterType, MethodType targetType) {
-        MethodType entryType = entryType(kind, pos, filterType, targetType);
-        if (entryType.generic() != entryType)
-            throw newIllegalArgumentException("must be generic: "+entryType);
-        MethodTypeForm form = entryType.form();
-        FilterGeneric filterGen = form.filterGeneric;
-        if (filterGen == null)
-            form.filterGeneric = filterGen = new FilterGeneric(entryType);
-        return filterGen;
-    }
-
-    public String toString() {
-        return "FilterGeneric/"+entryType;
-    }
-
-    static MethodType targetType(MethodType entryType, Kind kind, int pos, MethodType filterType) {
-        MethodType type = entryType;
-        switch (kind) {
-            case value:
-            case flyby:
-                break;  // no change
-            case fold:
-                type = type.insertParameterTypes(0, filterType.returnType());
-                break;
-            case collect:
-                type = type.dropParameterTypes(pos, type.parameterCount());
-                type = type.insertParameterTypes(pos, filterType.returnType());
-                break;
-            default:
-                throw new InternalError();
-        }
-        return type;
-    }
-
-    static MethodType entryType(Kind kind, int pos, MethodType filterType, MethodType targetType) {
-        MethodType type = targetType;
-        switch (kind) {
-            case value:
-            case flyby:
-                break;  // no change
-            case fold:
-                type = type.dropParameterTypes(0, 1);
-                break;
-            case collect:
-                type = type.dropParameterTypes(pos, pos+1);
-                type = type.insertParameterTypes(pos, filterType.parameterList());
-                break;
-            default:
-                throw new InternalError();
-        }
-        return type;
-    }
-
-    /* Create an adapter that handles spreading calls for the given type. */
-    static Adapter findAdapter(MethodType entryType, Kind kind, int pos) {
-        int argc = entryType.parameterCount();
-        String cname0 = "F"+argc;
-        String cname1 = "F"+argc+kind.key;
-        String[] cnames = { cname0, cname1 };
-        String iname = kind.invokerName(pos);
-        // e.g., F5; invoke_C3
-        for (String cname : cnames) {
-            Class<? extends Adapter> acls = Adapter.findSubClass(cname);
-            if (acls == null)  continue;
-            // see if it has the required invoke method
-            MethodHandle entryPoint = null;
-            try {
-                entryPoint = IMPL_LOOKUP.findSpecial(acls, iname, entryType, acls);
-            } catch (ReflectiveOperationException ex) {
-            }
-            if (entryPoint == null)  continue;
-            Constructor<? extends Adapter> ctor = null;
-            try {
-                ctor = acls.getDeclaredConstructor(MethodHandle.class);
-            } catch (NoSuchMethodException ex) {
-            } catch (SecurityException ex) {
-            }
-            if (ctor == null)  continue;
-            try {
-                // Produce an instance configured as a prototype.
-                return ctor.newInstance(entryPoint);
-            } catch (IllegalArgumentException ex) {
-            } catch (InvocationTargetException wex) {
-                Throwable ex = wex.getTargetException();
-                if (ex instanceof Error)  throw (Error)ex;
-                if (ex instanceof RuntimeException)  throw (RuntimeException)ex;
-            } catch (InstantiationException ex) {
-            } catch (IllegalAccessException ex) {
-            }
-        }
-        return null;
-    }
-
-    static Adapter buildAdapterFromBytecodes(MethodType entryType, Kind kind, int pos) {
-        throw new UnsupportedOperationException("NYI");
-    }
-
-    /**
-     * This adapter takes some untyped arguments, and returns an untyped result.
-     * Internally, it applies the invoker to the target, which causes the
-     * objects to be unboxed; the result is a raw type in L/I/J/F/D.
-     * This result is passed to convert, which is responsible for
-     * converting the raw result into a boxed object.
-     * The invoker is kept separate from the target because it can be
-     * generated once per type erasure family, and reused across adapters.
-     */
-    static abstract class Adapter extends BoundMethodHandle {
-        protected final MethodHandle filter; // transforms one or more arguments
-        protected final MethodHandle target; // ultimate target
-
-        @Override
-        String debugString() {
-            return addTypeString(target, this);
-        }
-
-        protected boolean isPrototype() { return target == null; }
-        protected Adapter(MethodHandle entryPoint) {
-            this(entryPoint, entryPoint, null);
-            assert(isPrototype());
-        }
-        protected MethodHandle prototypeEntryPoint() {
-            if (!isPrototype())  throw new InternalError();
-            return filter;
-        }
-
-        protected Adapter(MethodHandle entryPoint,
-                          MethodHandle filter, MethodHandle target) {
-            super(entryPoint);
-            this.filter = filter;
-            this.target = target;
-        }
-
-        /** Make a copy of self, with new fields. */
-        protected abstract Adapter makeInstance(MethodHandle entryPoint,
-                MethodHandle filter, MethodHandle target);
-        // { return new ThisType(entryPoint, filter, target); }
-
-        static private final String CLASS_PREFIX; // "java.lang.invoke.FilterGeneric$"
-        static {
-            String aname = Adapter.class.getName();
-            String sname = Adapter.class.getSimpleName();
-            if (!aname.endsWith(sname))  throw new InternalError();
-            CLASS_PREFIX = aname.substring(0, aname.length() - sname.length());
-        }
-        /** Find a sibing class of Adapter. */
-        static Class<? extends Adapter> findSubClass(String name) {
-            String cname = Adapter.CLASS_PREFIX + name;
-            try {
-                return Class.forName(cname).asSubclass(Adapter.class);
-            } catch (ClassNotFoundException ex) {
-                return null;
-            } catch (ClassCastException ex) {
-                return null;
-            }
-        }
-    }
-
-    static enum Kind {
-        value('V'),      // filter and replace Nth argument value
-        fold('F'),       // fold first N arguments, prepend result
-        collect('C'),    // collect last N arguments, replace with result
-        flyby('Y'),      // reify entire argument list, filter, pass to target
-        LIMIT('?');
-        static final int COUNT = LIMIT.ordinal();
-
-        final char key;
-        Kind(char key) { this.key = key; }
-        String invokerName(int pos) { return "invoke_"+key+""+pos; }
-        int invokerIndex(int pos) { return pos * COUNT + ordinal(); }
-    }
-
-    /* generated classes follow this pattern:
-    static class F1X extends Adapter {
-        protected F1X(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
-        protected F1X(MethodHandle e, MethodHandle f, MethodHandle t)
-                        { super(e, f, t); }
-        protected F1X makeInstance(MethodHandle e, MethodHandle f, MethodHandle t)
-                        { return new F1X(e, f, t); }
-        protected Object invoke_V0(Object a0) { return target.invokeExact(filter.invokeExact(a0)); }
-        protected Object invoke_F0(Object a0) { return target.invokeExact(filter.invokeExact(), a0); }
-        protected Object invoke_F1(Object a0) { return target.invokeExact(filter.invokeExact(a0), a0); }
-        protected Object invoke_C0(Object a0) { return target.invokeExact(filter.invokeExact(a0)); }
-        protected Object invoke_C1(Object a0) { return target.invokeExact(a0, filter.invokeExact()); }
-        protected Object invoke_Y0(Object a0) { Object[] av = { a0 };
-                       filter.invokeExact(av); return target.invokeExact(av[0]); }
-    }
-    static class F2X extends Adapter {
-        protected F2X(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
-        protected F2X(MethodHandle e, MethodHandle f, MethodHandle t)
-                        { super(e, f, t); }
-        protected F2X makeInstance(MethodHandle e, MethodHandle f, MethodHandle t)
-                        { return new F2X(e, f, t); }
-        protected Object invoke_V0(Object a0, Object a1) { return target.invokeExact(filter.invokeExact(a0), a1); }
-        protected Object invoke_V1(Object a0, Object a1) { return target.invokeExact(a0, filter.invokeExact(a1)); }
-        protected Object invoke_F0(Object a0, Object a1) { return target.invokeExact(filter.invokeExact(), a0, a1); }
-        protected Object invoke_F1(Object a0, Object a1) { return target.invokeExact(filter.invokeExact(a0), a0, a1); }
-        protected Object invoke_F2(Object a0, Object a1) { return target.invokeExact(filter.invokeExact(a0, a1), a0, a1); }
-        protected Object invoke_C0(Object a0, Object a1) { return target.invokeExact(filter.invokeExact(a0, a1)); }
-        protected Object invoke_C1(Object a0, Object a1) { return target.invokeExact(a0, filter.invokeExact(a1)); }
-        protected Object invoke_C2(Object a0, Object a1) { return target.invokeExact(a0, a1, filter.invokeExact()); }
-        protected Object invoke_Y0(Object a0, Object a1) { Object[] av = { a0, a1 };
-                       filter.invokeExact(av); return target.invokeExact(av[0], av[1]); }
-    }
-    // */
-
-    // This one is written by hand:
-    static class F0 extends Adapter {
-        protected F0(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
-        protected F0(MethodHandle e, MethodHandle f, MethodHandle t) {
-            super(e, f, t); }
-        protected F0 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
-            return new F0(e, f, t); }
-        protected Object invoke_F0() throws Throwable {
-            return target.invokeExact(filter.invokeExact()); }
-        protected Object invoke_C0() throws Throwable {
-            return target.invokeExact(filter.invokeExact()); }
-        static final Object[] NO_ARGS = { };
-        protected Object invoke_Y0() throws Throwable {
-            filter.invokeExact(NO_ARGS); // make the flyby
-            return target.invokeExact(); }
-    }
-
-/*
-  : SHELL; n=FilterGeneric; cp -p $n.java $n.java-; sed < $n.java- > $n.java+ -e '/{{*{{/,/}}*}}/w /tmp/genclasses.java' -e '/}}*}}/q'; (cd /tmp; javac -d . genclasses.java; java -ea -cp . genclasses | sed 's| *[/]/ *$||') >> $n.java+; echo '}' >> $n.java+; mv $n.java+ $n.java; mv $n.java- $n.java~
-//{{{
-import java.util.*;
-class genclasses {
-    static String[][] TEMPLATES = { {
-        "@for@ N=1..20",
-        "    //@each-cat@",
-        "    static class @cat@ extends Adapter {",
-        "        protected @cat@(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype",
-        "        protected @cat@(MethodHandle e, MethodHandle f, MethodHandle t) {",
-        "            super(e, f, t); }",
-        "        protected @cat@ makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {",
-        "            return new @cat@(e, f, t); }",
-        "        //@each-P@",
-        "        protected Object invoke_V@P@(@Tvav@) throws Throwable {",
-        "            return target.invokeExact(@a0_@@Psp@filter.invokeExact(a@P@)@_aN@); }",
-        "        //@end-P@",
-        "        //@each-P@",
-        "        protected Object invoke_F@P@(@Tvav@) throws Throwable {",
-        "            return target.invokeExact(filter.invokeExact(@a0@),",
-        "                                 @av@); }",
-        "        //@end-P@",
-        "        protected Object invoke_F@N@(@Tvav@) throws Throwable {",
-        "            return target.invokeExact(filter.invokeExact(@av@),",
-        "                                 @av@); }",
-        "        //@each-P@",
-        "        protected Object invoke_C@P@(@Tvav@) throws Throwable {",
-        "            return target.invokeExact(@a0_@filter.invokeExact(a@P@@_aN@)); }",
-        "        //@end-P@",
-        "        protected Object invoke_C@N@(@Tvav@) throws Throwable {",
-        "            return target.invokeExact(@av@, filter.invokeExact()); }",
-        "        protected Object invoke_Y0(@Tvav@) throws Throwable {",
-        "            Object[] av = { @av@ };",
-        "            filter.invokeExact(av); // make the flyby",
-        "            return target.invokeExact(@av[i]@); }",
-        "    }",
-    } };
-    static final String NEWLINE_INDENT = " //\n                                 ";
-    enum VAR {
-        cat, N, P, Tvav, av, a0, a0_, _aN, Psp, av_i_;
-        public final String pattern = "@"+toString().replace('_','.')+"@";
-        public String binding = toString();
-        static void makeBindings(boolean topLevel, int inargs, int pos) {
-            assert(-1 <= pos && pos < inargs);
-            VAR.cat.binding = "F"+inargs;
-            VAR.N.binding = String.valueOf(inargs); // incoming arg count
-            VAR.P.binding = String.valueOf(pos);  // selected arg position
-            String[] av = new String[inargs];
-            String[] Tvav = new String[inargs];
-            String[] av_i_ = new String[inargs];
-            for (int i = 0; i < inargs; i++) {
-                av[i] = arg(i);
-                av_i_[i] = "av["+i+"]";
-                String spc = "";
-                if (i > 0 && i % 4 == 0) spc = NEWLINE_INDENT+(pos>9?" ":"")+"  ";
-                Tvav[i] = spc+param("Object", av[i]);
-            }
-            VAR.av.binding = comma(av);
-            VAR.av_i_.binding = comma(av_i_);
-            VAR.Tvav.binding = comma(Tvav);
-            if (pos >= 0) {
-                VAR.Psp.binding = (pos > 0 && pos % 10 == 0) ? NEWLINE_INDENT : "";
-                String[] a0 = new String[pos];
-                String[] aN = new String[inargs - (pos+1)];
-                for (int i = 0; i < pos; i++) {
-                    String spc = "";
-                    if (i > 0 && i % 10 == 0) spc = NEWLINE_INDENT;
-                    a0[i] = spc+av[i];
-                }
-                VAR.a0.binding = comma(a0);
-                VAR.a0_.binding = comma(a0, ", ");
-                for (int i = pos+1; i < inargs; i++) {
-                    String spc = "";
-                    if (i > 0 && i % 10 == 0) spc = NEWLINE_INDENT;
-                    aN[i - (pos+1)] = spc+av[i];
-                }
-                VAR._aN.binding = comma(", ", aN);
-            }
-        }
-        static String arg(int i) { return "a"+i; }
-        static String param(String t, String a) { return t+" "+a; }
-        static String comma(String[] v) { return comma(v, ""); }
-        static String comma(String[] v, String sep) { return comma("", v, sep); }
-        static String comma(String sep, String[] v) { return comma(sep, v, ""); }
-        static String comma(String sep1, String[] v, String sep2) {
-            if (v.length == 0)  return "";
-            String res = v[0];
-            for (int i = 1; i < v.length; i++)  res += ", "+v[i];
-            return sep1 + res + sep2;
-        }
-        static String transform(String string) {
-            for (VAR var : values())
-                string = string.replaceAll(var.pattern, var.binding);
-            return string;
-        }
-    }
-    static String[] stringsIn(String[] strings, int beg, int end) {
-        return Arrays.copyOfRange(strings, beg, Math.min(end, strings.length));
-    }
-    static String[] stringsBefore(String[] strings, int pos) {
-        return stringsIn(strings, 0, pos);
-    }
-    static String[] stringsAfter(String[] strings, int pos) {
-        return stringsIn(strings, pos, strings.length);
-    }
-    static int indexAfter(String[] strings, int pos, String tag) {
-        return Math.min(indexBefore(strings, pos, tag) + 1, strings.length);
-    }
-    static int indexBefore(String[] strings, int pos, String tag) {
-        for (int i = pos, end = strings.length; ; i++) {
-            if (i == end || strings[i].endsWith(tag))  return i;
-        }
-    }
-    static int MIN_ARITY, MAX_ARITY;
-    public static void main(String... av) {
-        for (String[] template : TEMPLATES) {
-            int forLinesLimit = indexBefore(template, 0, "@each-cat@");
-            String[] forLines = stringsBefore(template, forLinesLimit);
-            template = stringsAfter(template, forLinesLimit);
-            for (String forLine : forLines)
-                expandTemplate(forLine, template);
-        }
-    }
-    static void expandTemplate(String forLine, String[] template) {
-        String[] params = forLine.split("[^0-9]+");
-        if (params[0].length() == 0)  params = stringsAfter(params, 1);
-        System.out.println("//params="+Arrays.asList(params));
-        int pcur = 0;
-        MIN_ARITY = Integer.valueOf(params[pcur++]);
-        MAX_ARITY = Integer.valueOf(params[pcur++]);
-        if (pcur != params.length)  throw new RuntimeException("bad extra param: "+forLine);
-        for (int inargs = MIN_ARITY; inargs <= MAX_ARITY; inargs++) {
-            expandTemplate(template, true, inargs, -1);
-        }
-    }
-    static void expandTemplate(String[] template, boolean topLevel, int inargs, int pos) {
-        VAR.makeBindings(topLevel, inargs, pos);
-        for (int i = 0; i < template.length; i++) {
-            String line = template[i];
-            if (line.endsWith("@each-cat@")) {
-                // ignore
-            } else if (line.endsWith("@each-P@")) {
-                int blockEnd = indexAfter(template, i, "@end-P@");
-                String[] block = stringsIn(template, i+1, blockEnd-1);
-                for (int pos1 = Math.max(0,pos); pos1 < inargs; pos1++)
-                    expandTemplate(block, false, inargs, pos1);
-                VAR.makeBindings(topLevel, inargs, pos);
-                i = blockEnd-1; continue;
-            } else {
-                System.out.println(VAR.transform(line));
-            }
-        }
-    }
-}
-//}}} */
-//params=[1, 20]
-    static class F1 extends Adapter {
-        protected F1(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
-        protected F1(MethodHandle e, MethodHandle f, MethodHandle t) {
-            super(e, f, t); }
-        protected F1 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
-            return new F1(e, f, t); }
-        protected Object invoke_V0(Object a0) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0)); }
-        protected Object invoke_F0(Object a0) throws Throwable {
-            return target.invokeExact(filter.invokeExact(),
-                                 a0); }
-        protected Object invoke_F1(Object a0) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0),
-                                 a0); }
-        protected Object invoke_C0(Object a0) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0)); }
-        protected Object invoke_C1(Object a0) throws Throwable {
-            return target.invokeExact(a0, filter.invokeExact()); }
-        protected Object invoke_Y0(Object a0) throws Throwable {
-            Object[] av = { a0 };
-            filter.invokeExact(av); // make the flyby
-            return target.invokeExact(av[0]); }
-    }
-    static class F2 extends Adapter {
-        protected F2(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
-        protected F2(MethodHandle e, MethodHandle f, MethodHandle t) {
-            super(e, f, t); }
-        protected F2 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
-            return new F2(e, f, t); }
-        protected Object invoke_V0(Object a0, Object a1) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0), a1); }
-        protected Object invoke_V1(Object a0, Object a1) throws Throwable {
-            return target.invokeExact(a0, filter.invokeExact(a1)); }
-        protected Object invoke_F0(Object a0, Object a1) throws Throwable {
-            return target.invokeExact(filter.invokeExact(),
-                                 a0, a1); }
-        protected Object invoke_F1(Object a0, Object a1) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0),
-                                 a0, a1); }
-        protected Object invoke_F2(Object a0, Object a1) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1),
-                                 a0, a1); }
-        protected Object invoke_C0(Object a0, Object a1) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1)); }
-        protected Object invoke_C1(Object a0, Object a1) throws Throwable {
-            return target.invokeExact(a0, filter.invokeExact(a1)); }
-        protected Object invoke_C2(Object a0, Object a1) throws Throwable {
-            return target.invokeExact(a0, a1, filter.invokeExact()); }
-        protected Object invoke_Y0(Object a0, Object a1) throws Throwable {
-            Object[] av = { a0, a1 };
-            filter.invokeExact(av); // make the flyby
-            return target.invokeExact(av[0], av[1]); }
-    }
-    static class F3 extends Adapter {
-        protected F3(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
-        protected F3(MethodHandle e, MethodHandle f, MethodHandle t) {
-            super(e, f, t); }
-        protected F3 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
-            return new F3(e, f, t); }
-        protected Object invoke_V0(Object a0, Object a1, Object a2) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0), a1, a2); }
-        protected Object invoke_V1(Object a0, Object a1, Object a2) throws Throwable {
-            return target.invokeExact(a0, filter.invokeExact(a1), a2); }
-        protected Object invoke_V2(Object a0, Object a1, Object a2) throws Throwable {
-            return target.invokeExact(a0, a1, filter.invokeExact(a2)); }
-        protected Object invoke_F0(Object a0, Object a1, Object a2) throws Throwable {
-            return target.invokeExact(filter.invokeExact(),
-                                 a0, a1, a2); }
-        protected Object invoke_F1(Object a0, Object a1, Object a2) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0),
-                                 a0, a1, a2); }
-        protected Object invoke_F2(Object a0, Object a1, Object a2) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1),
-                                 a0, a1, a2); }
-        protected Object invoke_F3(Object a0, Object a1, Object a2) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2),
-                                 a0, a1, a2); }
-        protected Object invoke_C0(Object a0, Object a1, Object a2) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2)); }
-        protected Object invoke_C1(Object a0, Object a1, Object a2) throws Throwable {
-            return target.invokeExact(a0, filter.invokeExact(a1, a2)); }
-        protected Object invoke_C2(Object a0, Object a1, Object a2) throws Throwable {
-            return target.invokeExact(a0, a1, filter.invokeExact(a2)); }
-        protected Object invoke_C3(Object a0, Object a1, Object a2) throws Throwable {
-            return target.invokeExact(a0, a1, a2, filter.invokeExact()); }
-        protected Object invoke_Y0(Object a0, Object a1, Object a2) throws Throwable {
-            Object[] av = { a0, a1, a2 };
-            filter.invokeExact(av); // make the flyby
-            return target.invokeExact(av[0], av[1], av[2]); }
-    }
-    static class F4 extends Adapter {
-        protected F4(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
-        protected F4(MethodHandle e, MethodHandle f, MethodHandle t) {
-            super(e, f, t); }
-        protected F4 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
-            return new F4(e, f, t); }
-        protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0), a1, a2, a3); }
-        protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3) throws Throwable {
-            return target.invokeExact(a0, filter.invokeExact(a1), a2, a3); }
-        protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3) throws Throwable {
-            return target.invokeExact(a0, a1, filter.invokeExact(a2), a3); }
-        protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3) throws Throwable {
-            return target.invokeExact(a0, a1, a2, filter.invokeExact(a3)); }
-        protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3) throws Throwable {
-            return target.invokeExact(filter.invokeExact(),
-                                 a0, a1, a2, a3); }
-        protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0),
-                                 a0, a1, a2, a3); }
-        protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1),
-                                 a0, a1, a2, a3); }
-        protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2),
-                                 a0, a1, a2, a3); }
-        protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
-                                 a0, a1, a2, a3); }
-        protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3)); }
-        protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3) throws Throwable {
-            return target.invokeExact(a0, filter.invokeExact(a1, a2, a3)); }
-        protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3) throws Throwable {
-            return target.invokeExact(a0, a1, filter.invokeExact(a2, a3)); }
-        protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3) throws Throwable {
-            return target.invokeExact(a0, a1, a2, filter.invokeExact(a3)); }
-        protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, filter.invokeExact()); }
-        protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3) throws Throwable {
-            Object[] av = { a0, a1, a2, a3 };
-            filter.invokeExact(av); // make the flyby
-            return target.invokeExact(av[0], av[1], av[2], av[3]); }
-    }
-    static class F5 extends Adapter {
-        protected F5(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
-        protected F5(MethodHandle e, MethodHandle f, MethodHandle t) {
-            super(e, f, t); }
-        protected F5 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
-            return new F5(e, f, t); }
-        protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0), a1, a2, a3, a4); }
-        protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4) throws Throwable {
-            return target.invokeExact(a0, filter.invokeExact(a1), a2, a3, a4); }
-        protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4) throws Throwable {
-            return target.invokeExact(a0, a1, filter.invokeExact(a2), a3, a4); }
-        protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4) throws Throwable {
-            return target.invokeExact(a0, a1, a2, filter.invokeExact(a3), a4); }
-        protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4)); }
-        protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4) throws Throwable {
-            return target.invokeExact(filter.invokeExact(),
-                                 a0, a1, a2, a3, a4); }
-        protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0),
-                                 a0, a1, a2, a3, a4); }
-        protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1),
-                                 a0, a1, a2, a3, a4); }
-        protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2),
-                                 a0, a1, a2, a3, a4); }
-        protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
-                                 a0, a1, a2, a3, a4); }
-        protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4),
-                                 a0, a1, a2, a3, a4); }
-        protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4)); }
-        protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4) throws Throwable {
-            return target.invokeExact(a0, filter.invokeExact(a1, a2, a3, a4)); }
-        protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4) throws Throwable {
-            return target.invokeExact(a0, a1, filter.invokeExact(a2, a3, a4)); }
-        protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4) throws Throwable {
-            return target.invokeExact(a0, a1, a2, filter.invokeExact(a3, a4)); }
-        protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4)); }
-        protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact()); }
-        protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4) throws Throwable {
-            Object[] av = { a0, a1, a2, a3, a4 };
-            filter.invokeExact(av); // make the flyby
-            return target.invokeExact(av[0], av[1], av[2], av[3], av[4]); }
-    }
-    static class F6 extends Adapter {
-        protected F6(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
-        protected F6(MethodHandle e, MethodHandle f, MethodHandle t) {
-            super(e, f, t); }
-        protected F6 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
-            return new F6(e, f, t); }
-        protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0), a1, a2, a3, a4, a5); }
-        protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5) throws Throwable {
-            return target.invokeExact(a0, filter.invokeExact(a1), a2, a3, a4, a5); }
-        protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5) throws Throwable {
-            return target.invokeExact(a0, a1, filter.invokeExact(a2), a3, a4, a5); }
-        protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5) throws Throwable {
-            return target.invokeExact(a0, a1, a2, filter.invokeExact(a3), a4, a5); }
-        protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4), a5); }
-        protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5)); }
-        protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5) throws Throwable {
-            return target.invokeExact(filter.invokeExact(),
-                                 a0, a1, a2, a3, a4, a5); }
-        protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0),
-                                 a0, a1, a2, a3, a4, a5); }
-        protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1),
-                                 a0, a1, a2, a3, a4, a5); }
-        protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2),
-                                 a0, a1, a2, a3, a4, a5); }
-        protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
-                                 a0, a1, a2, a3, a4, a5); }
-        protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4),
-                                 a0, a1, a2, a3, a4, a5); }
-        protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5),
-                                 a0, a1, a2, a3, a4, a5); }
-        protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5)); }
-        protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5) throws Throwable {
-            return target.invokeExact(a0, filter.invokeExact(a1, a2, a3, a4, a5)); }
-        protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5) throws Throwable {
-            return target.invokeExact(a0, a1, filter.invokeExact(a2, a3, a4, a5)); }
-        protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5) throws Throwable {
-            return target.invokeExact(a0, a1, a2, filter.invokeExact(a3, a4, a5)); }
-        protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4, a5)); }
-        protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5)); }
-        protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact()); }
-        protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5) throws Throwable {
-            Object[] av = { a0, a1, a2, a3, a4, a5 };
-            filter.invokeExact(av); // make the flyby
-            return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5]); }
-    }
-    static class F7 extends Adapter {
-        protected F7(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
-        protected F7(MethodHandle e, MethodHandle f, MethodHandle t) {
-            super(e, f, t); }
-        protected F7 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
-            return new F7(e, f, t); }
-        protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0), a1, a2, a3, a4, a5, a6); }
-        protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6) throws Throwable {
-            return target.invokeExact(a0, filter.invokeExact(a1), a2, a3, a4, a5, a6); }
-        protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6) throws Throwable {
-            return target.invokeExact(a0, a1, filter.invokeExact(a2), a3, a4, a5, a6); }
-        protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6) throws Throwable {
-            return target.invokeExact(a0, a1, a2, filter.invokeExact(a3), a4, a5, a6); }
-        protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4), a5, a6); }
-        protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5), a6); }
-        protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6)); }
-        protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6) throws Throwable {
-            return target.invokeExact(filter.invokeExact(),
-                                 a0, a1, a2, a3, a4, a5, a6); }
-        protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0),
-                                 a0, a1, a2, a3, a4, a5, a6); }
-        protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1),
-                                 a0, a1, a2, a3, a4, a5, a6); }
-        protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2),
-                                 a0, a1, a2, a3, a4, a5, a6); }
-        protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
-                                 a0, a1, a2, a3, a4, a5, a6); }
-        protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4),
-                                 a0, a1, a2, a3, a4, a5, a6); }
-        protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5),
-                                 a0, a1, a2, a3, a4, a5, a6); }
-        protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6),
-                                 a0, a1, a2, a3, a4, a5, a6); }
-        protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6)); }
-        protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6) throws Throwable {
-            return target.invokeExact(a0, filter.invokeExact(a1, a2, a3, a4, a5, a6)); }
-        protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6) throws Throwable {
-            return target.invokeExact(a0, a1, filter.invokeExact(a2, a3, a4, a5, a6)); }
-        protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6) throws Throwable {
-            return target.invokeExact(a0, a1, a2, filter.invokeExact(a3, a4, a5, a6)); }
-        protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4, a5, a6)); }
-        protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5, a6)); }
-        protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6)); }
-        protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact()); }
-        protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6) throws Throwable {
-            Object[] av = { a0, a1, a2, a3, a4, a5, a6 };
-            filter.invokeExact(av); // make the flyby
-            return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6]); }
-    }
-    static class F8 extends Adapter {
-        protected F8(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
-        protected F8(MethodHandle e, MethodHandle f, MethodHandle t) {
-            super(e, f, t); }
-        protected F8 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
-            return new F8(e, f, t); }
-        protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0), a1, a2, a3, a4, a5, a6, a7); }
-        protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7) throws Throwable {
-            return target.invokeExact(a0, filter.invokeExact(a1), a2, a3, a4, a5, a6, a7); }
-        protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7) throws Throwable {
-            return target.invokeExact(a0, a1, filter.invokeExact(a2), a3, a4, a5, a6, a7); }
-        protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7) throws Throwable {
-            return target.invokeExact(a0, a1, a2, filter.invokeExact(a3), a4, a5, a6, a7); }
-        protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4), a5, a6, a7); }
-        protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5), a6, a7); }
-        protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6), a7); }
-        protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7)); }
-        protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7) throws Throwable {
-            return target.invokeExact(filter.invokeExact(),
-                                 a0, a1, a2, a3, a4, a5, a6, a7); }
-        protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0),
-                                 a0, a1, a2, a3, a4, a5, a6, a7); }
-        protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1),
-                                 a0, a1, a2, a3, a4, a5, a6, a7); }
-        protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2),
-                                 a0, a1, a2, a3, a4, a5, a6, a7); }
-        protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
-                                 a0, a1, a2, a3, a4, a5, a6, a7); }
-        protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4),
-                                 a0, a1, a2, a3, a4, a5, a6, a7); }
-        protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5),
-                                 a0, a1, a2, a3, a4, a5, a6, a7); }
-        protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6),
-                                 a0, a1, a2, a3, a4, a5, a6, a7); }
-        protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7),
-                                 a0, a1, a2, a3, a4, a5, a6, a7); }
-        protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7)); }
-        protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7) throws Throwable {
-            return target.invokeExact(a0, filter.invokeExact(a1, a2, a3, a4, a5, a6, a7)); }
-        protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7) throws Throwable {
-            return target.invokeExact(a0, a1, filter.invokeExact(a2, a3, a4, a5, a6, a7)); }
-        protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7) throws Throwable {
-            return target.invokeExact(a0, a1, a2, filter.invokeExact(a3, a4, a5, a6, a7)); }
-        protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4, a5, a6, a7)); }
-        protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5, a6, a7)); }
-        protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6, a7)); }
-        protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7)); }
-        protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact()); }
-        protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7) throws Throwable {
-            Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7 };
-            filter.invokeExact(av); // make the flyby
-            return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7]); }
-    }
-    static class F9 extends Adapter {
-        protected F9(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
-        protected F9(MethodHandle e, MethodHandle f, MethodHandle t) {
-            super(e, f, t); }
-        protected F9 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
-            return new F9(e, f, t); }
-        protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0), a1, a2, a3, a4, a5, a6, a7, a8); }
-        protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8) throws Throwable {
-            return target.invokeExact(a0, filter.invokeExact(a1), a2, a3, a4, a5, a6, a7, a8); }
-        protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8) throws Throwable {
-            return target.invokeExact(a0, a1, filter.invokeExact(a2), a3, a4, a5, a6, a7, a8); }
-        protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8) throws Throwable {
-            return target.invokeExact(a0, a1, a2, filter.invokeExact(a3), a4, a5, a6, a7, a8); }
-        protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4), a5, a6, a7, a8); }
-        protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5), a6, a7, a8); }
-        protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6), a7, a8); }
-        protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7), a8); }
-        protected Object invoke_V8(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8)); }
-        protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8) throws Throwable {
-            return target.invokeExact(filter.invokeExact(),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8); }
-        protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8); }
-        protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8); }
-        protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8); }
-        protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8); }
-        protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8); }
-        protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8); }
-        protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8); }
-        protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8); }
-        protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8); }
-        protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
-        protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8) throws Throwable {
-            return target.invokeExact(a0, filter.invokeExact(a1, a2, a3, a4, a5, a6, a7, a8)); }
-        protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8) throws Throwable {
-            return target.invokeExact(a0, a1, filter.invokeExact(a2, a3, a4, a5, a6, a7, a8)); }
-        protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8) throws Throwable {
-            return target.invokeExact(a0, a1, a2, filter.invokeExact(a3, a4, a5, a6, a7, a8)); }
-        protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4, a5, a6, a7, a8)); }
-        protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5, a6, a7, a8)); }
-        protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6, a7, a8)); }
-        protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7, a8)); }
-        protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8)); }
-        protected Object invoke_C9(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact()); }
-        protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8) throws Throwable {
-            Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8 };
-            filter.invokeExact(av); // make the flyby
-            return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8]); }
-    }
-    static class F10 extends Adapter {
-        protected F10(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
-        protected F10(MethodHandle e, MethodHandle f, MethodHandle t) {
-            super(e, f, t); }
-        protected F10 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
-            return new F10(e, f, t); }
-        protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9); }
-        protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9) throws Throwable {
-            return target.invokeExact(a0, filter.invokeExact(a1), a2, a3, a4, a5, a6, a7, a8, a9); }
-        protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9) throws Throwable {
-            return target.invokeExact(a0, a1, filter.invokeExact(a2), a3, a4, a5, a6, a7, a8, a9); }
-        protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9) throws Throwable {
-            return target.invokeExact(a0, a1, a2, filter.invokeExact(a3), a4, a5, a6, a7, a8, a9); }
-        protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4), a5, a6, a7, a8, a9); }
-        protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5), a6, a7, a8, a9); }
-        protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6), a7, a8, a9); }
-        protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7), a8, a9); }
-        protected Object invoke_V8(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8), a9); }
-        protected Object invoke_V9(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9)); }
-        protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9) throws Throwable {
-            return target.invokeExact(filter.invokeExact(),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
-        protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
-        protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
-        protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
-        protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
-        protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
-        protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
-        protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
-        protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
-        protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
-        protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
-        protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
-        protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9) throws Throwable {
-            return target.invokeExact(a0, filter.invokeExact(a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
-        protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9) throws Throwable {
-            return target.invokeExact(a0, a1, filter.invokeExact(a2, a3, a4, a5, a6, a7, a8, a9)); }
-        protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9) throws Throwable {
-            return target.invokeExact(a0, a1, a2, filter.invokeExact(a3, a4, a5, a6, a7, a8, a9)); }
-        protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4, a5, a6, a7, a8, a9)); }
-        protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5, a6, a7, a8, a9)); }
-        protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6, a7, a8, a9)); }
-        protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7, a8, a9)); }
-        protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8, a9)); }
-        protected Object invoke_C9(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9)); }
-        protected Object invoke_C10(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invokeExact()); }
-        protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9) throws Throwable {
-            Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9 };
-            filter.invokeExact(av); // make the flyby
-            return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9]); }
-    }
-    static class F11 extends Adapter {
-        protected F11(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
-        protected F11(MethodHandle e, MethodHandle f, MethodHandle t) {
-            super(e, f, t); }
-        protected F11 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
-            return new F11(e, f, t); }
-        protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10); }
-        protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10) throws Throwable {
-            return target.invokeExact(a0, filter.invokeExact(a1), a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10); }
-        protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10) throws Throwable {
-            return target.invokeExact(a0, a1, filter.invokeExact(a2), a3, a4, a5, a6, a7, a8, a9,
-                                 a10); }
-        protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10) throws Throwable {
-            return target.invokeExact(a0, a1, a2, filter.invokeExact(a3), a4, a5, a6, a7, a8, a9,
-                                 a10); }
-        protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4), a5, a6, a7, a8, a9,
-                                 a10); }
-        protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5), a6, a7, a8, a9,
-                                 a10); }
-        protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6), a7, a8, a9,
-                                 a10); }
-        protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7), a8, a9,
-                                 a10); }
-        protected Object invoke_V8(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8), a9,
-                                 a10); }
-        protected Object invoke_V9(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9),
-                                 a10); }
-        protected Object invoke_V10(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 filter.invokeExact(a10)); }
-        protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10) throws Throwable {
-            return target.invokeExact(filter.invokeExact(),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); }
-        protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); }
-        protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); }
-        protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); }
-        protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); }
-        protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); }
-        protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); }
-        protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); }
-        protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); }
-        protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); }
-        protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); }
-        protected Object invoke_F11(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); }
-        protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10)); }
-        protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10) throws Throwable {
-            return target.invokeExact(a0, filter.invokeExact(a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10)); }
-        protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10) throws Throwable {
-            return target.invokeExact(a0, a1, filter.invokeExact(a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10)); }
-        protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10) throws Throwable {
-            return target.invokeExact(a0, a1, a2, filter.invokeExact(a3, a4, a5, a6, a7, a8, a9,
-                                 a10)); }
-        protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4, a5, a6, a7, a8, a9,
-                                 a10)); }
-        protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5, a6, a7, a8, a9,
-                                 a10)); }
-        protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6, a7, a8, a9,
-                                 a10)); }
-        protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7, a8, a9,
-                                 a10)); }
-        protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8, a9,
-                                 a10)); }
-        protected Object invoke_C9(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9,
-                                 a10)); }
-        protected Object invoke_C10(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invokeExact(a10)); }
-        protected Object invoke_C11(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, filter.invokeExact()); }
-        protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10) throws Throwable {
-            Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10 };
-            filter.invokeExact(av); // make the flyby
-            return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9], av[10]); }
-    }
-    static class F12 extends Adapter {
-        protected F12(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
-        protected F12(MethodHandle e, MethodHandle f, MethodHandle t) {
-            super(e, f, t); }
-        protected F12 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
-            return new F12(e, f, t); }
-        protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11); }
-        protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11) throws Throwable {
-            return target.invokeExact(a0, filter.invokeExact(a1), a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11); }
-        protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11) throws Throwable {
-            return target.invokeExact(a0, a1, filter.invokeExact(a2), a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11); }
-        protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11) throws Throwable {
-            return target.invokeExact(a0, a1, a2, filter.invokeExact(a3), a4, a5, a6, a7, a8, a9,
-                                 a10, a11); }
-        protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4), a5, a6, a7, a8, a9,
-                                 a10, a11); }
-        protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5), a6, a7, a8, a9,
-                                 a10, a11); }
-        protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6), a7, a8, a9,
-                                 a10, a11); }
-        protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7), a8, a9,
-                                 a10, a11); }
-        protected Object invoke_V8(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8), a9,
-                                 a10, a11); }
-        protected Object invoke_V9(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9),
-                                 a10, a11); }
-        protected Object invoke_V10(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 filter.invokeExact(a10), a11); }
-        protected Object invoke_V11(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, filter.invokeExact(a11)); }
-        protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11) throws Throwable {
-            return target.invokeExact(filter.invokeExact(),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); }
-        protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); }
-        protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); }
-        protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); }
-        protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); }
-        protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); }
-        protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); }
-        protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); }
-        protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); }
-        protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); }
-        protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); }
-        protected Object invoke_F11(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); }
-        protected Object invoke_F12(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); }
-        protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11)); }
-        protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11) throws Throwable {
-            return target.invokeExact(a0, filter.invokeExact(a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11)); }
-        protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11) throws Throwable {
-            return target.invokeExact(a0, a1, filter.invokeExact(a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11)); }
-        protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11) throws Throwable {
-            return target.invokeExact(a0, a1, a2, filter.invokeExact(a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11)); }
-        protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4, a5, a6, a7, a8, a9,
-                                 a10, a11)); }
-        protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5, a6, a7, a8, a9,
-                                 a10, a11)); }
-        protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6, a7, a8, a9,
-                                 a10, a11)); }
-        protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7, a8, a9,
-                                 a10, a11)); }
-        protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8, a9,
-                                 a10, a11)); }
-        protected Object invoke_C9(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9,
-                                 a10, a11)); }
-        protected Object invoke_C10(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invokeExact(a10, a11)); }
-        protected Object invoke_C11(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, filter.invokeExact(a11)); }
-        protected Object invoke_C12(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, filter.invokeExact()); }
-        protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11) throws Throwable {
-            Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11 };
-            filter.invokeExact(av); // make the flyby
-            return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9], av[10], av[11]); }
-    }
-    static class F13 extends Adapter {
-        protected F13(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
-        protected F13(MethodHandle e, MethodHandle f, MethodHandle t) {
-            super(e, f, t); }
-        protected F13 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
-            return new F13(e, f, t); }
-        protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12); }
-        protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12) throws Throwable {
-            return target.invokeExact(a0, filter.invokeExact(a1), a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12); }
-        protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12) throws Throwable {
-            return target.invokeExact(a0, a1, filter.invokeExact(a2), a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12); }
-        protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12) throws Throwable {
-            return target.invokeExact(a0, a1, a2, filter.invokeExact(a3), a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12); }
-        protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4), a5, a6, a7, a8, a9,
-                                 a10, a11, a12); }
-        protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5), a6, a7, a8, a9,
-                                 a10, a11, a12); }
-        protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6), a7, a8, a9,
-                                 a10, a11, a12); }
-        protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7), a8, a9,
-                                 a10, a11, a12); }
-        protected Object invoke_V8(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8), a9,
-                                 a10, a11, a12); }
-        protected Object invoke_V9(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9),
-                                 a10, a11, a12); }
-        protected Object invoke_V10(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 filter.invokeExact(a10), a11, a12); }
-        protected Object invoke_V11(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, filter.invokeExact(a11), a12); }
-        protected Object invoke_V12(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, filter.invokeExact(a12)); }
-        protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12) throws Throwable {
-            return target.invokeExact(filter.invokeExact(),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); }
-        protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); }
-        protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); }
-        protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); }
-        protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); }
-        protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); }
-        protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); }
-        protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); }
-        protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); }
-        protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); }
-        protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); }
-        protected Object invoke_F11(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); }
-        protected Object invoke_F12(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); }
-        protected Object invoke_F13(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); }
-        protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12)); }
-        protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12) throws Throwable {
-            return target.invokeExact(a0, filter.invokeExact(a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12)); }
-        protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12) throws Throwable {
-            return target.invokeExact(a0, a1, filter.invokeExact(a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12)); }
-        protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12) throws Throwable {
-            return target.invokeExact(a0, a1, a2, filter.invokeExact(a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12)); }
-        protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12)); }
-        protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5, a6, a7, a8, a9,
-                                 a10, a11, a12)); }
-        protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6, a7, a8, a9,
-                                 a10, a11, a12)); }
-        protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7, a8, a9,
-                                 a10, a11, a12)); }
-        protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8, a9,
-                                 a10, a11, a12)); }
-        protected Object invoke_C9(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9,
-                                 a10, a11, a12)); }
-        protected Object invoke_C10(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invokeExact(a10, a11, a12)); }
-        protected Object invoke_C11(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, filter.invokeExact(a11, a12)); }
-        protected Object invoke_C12(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, filter.invokeExact(a12)); }
-        protected Object invoke_C13(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, filter.invokeExact()); }
-        protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12) throws Throwable {
-            Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12 };
-            filter.invokeExact(av); // make the flyby
-            return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9], av[10], av[11], av[12]); }
-    }
-    static class F14 extends Adapter {
-        protected F14(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
-        protected F14(MethodHandle e, MethodHandle f, MethodHandle t) {
-            super(e, f, t); }
-        protected F14 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
-            return new F14(e, f, t); }
-        protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13); }
-        protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13) throws Throwable {
-            return target.invokeExact(a0, filter.invokeExact(a1), a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13); }
-        protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13) throws Throwable {
-            return target.invokeExact(a0, a1, filter.invokeExact(a2), a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13); }
-        protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13) throws Throwable {
-            return target.invokeExact(a0, a1, a2, filter.invokeExact(a3), a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13); }
-        protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4), a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13); }
-        protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5), a6, a7, a8, a9,
-                                 a10, a11, a12, a13); }
-        protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6), a7, a8, a9,
-                                 a10, a11, a12, a13); }
-        protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7), a8, a9,
-                                 a10, a11, a12, a13); }
-        protected Object invoke_V8(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8), a9,
-                                 a10, a11, a12, a13); }
-        protected Object invoke_V9(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9),
-                                 a10, a11, a12, a13); }
-        protected Object invoke_V10(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 filter.invokeExact(a10), a11, a12, a13); }
-        protected Object invoke_V11(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, filter.invokeExact(a11), a12, a13); }
-        protected Object invoke_V12(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, filter.invokeExact(a12), a13); }
-        protected Object invoke_V13(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, filter.invokeExact(a13)); }
-        protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13) throws Throwable {
-            return target.invokeExact(filter.invokeExact(),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); }
-        protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); }
-        protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); }
-        protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); }
-        protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); }
-        protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); }
-        protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); }
-        protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); }
-        protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); }
-        protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); }
-        protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); }
-        protected Object invoke_F11(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); }
-        protected Object invoke_F12(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); }
-        protected Object invoke_F13(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); }
-        protected Object invoke_F14(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); }
-        protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13)); }
-        protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13) throws Throwable {
-            return target.invokeExact(a0, filter.invokeExact(a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13)); }
-        protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13) throws Throwable {
-            return target.invokeExact(a0, a1, filter.invokeExact(a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13)); }
-        protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13) throws Throwable {
-            return target.invokeExact(a0, a1, a2, filter.invokeExact(a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13)); }
-        protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13)); }
-        protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13)); }
-        protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6, a7, a8, a9,
-                                 a10, a11, a12, a13)); }
-        protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7, a8, a9,
-                                 a10, a11, a12, a13)); }
-        protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8, a9,
-                                 a10, a11, a12, a13)); }
-        protected Object invoke_C9(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9,
-                                 a10, a11, a12, a13)); }
-        protected Object invoke_C10(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invokeExact(a10, a11, a12, a13)); }
-        protected Object invoke_C11(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, filter.invokeExact(a11, a12, a13)); }
-        protected Object invoke_C12(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, filter.invokeExact(a12, a13)); }
-        protected Object invoke_C13(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, filter.invokeExact(a13)); }
-        protected Object invoke_C14(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, filter.invokeExact()); }
-        protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13) throws Throwable {
-            Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13 };
-            filter.invokeExact(av); // make the flyby
-            return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9], av[10], av[11], av[12], av[13]); }
-    }
-    static class F15 extends Adapter {
-        protected F15(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
-        protected F15(MethodHandle e, MethodHandle f, MethodHandle t) {
-            super(e, f, t); }
-        protected F15 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
-            return new F15(e, f, t); }
-        protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14); }
-        protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14) throws Throwable {
-            return target.invokeExact(a0, filter.invokeExact(a1), a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14); }
-        protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14) throws Throwable {
-            return target.invokeExact(a0, a1, filter.invokeExact(a2), a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14); }
-        protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14) throws Throwable {
-            return target.invokeExact(a0, a1, a2, filter.invokeExact(a3), a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14); }
-        protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4), a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14); }
-        protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5), a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14); }
-        protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6), a7, a8, a9,
-                                 a10, a11, a12, a13, a14); }
-        protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7), a8, a9,
-                                 a10, a11, a12, a13, a14); }
-        protected Object invoke_V8(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8), a9,
-                                 a10, a11, a12, a13, a14); }
-        protected Object invoke_V9(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9),
-                                 a10, a11, a12, a13, a14); }
-        protected Object invoke_V10(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 filter.invokeExact(a10), a11, a12, a13, a14); }
-        protected Object invoke_V11(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, filter.invokeExact(a11), a12, a13, a14); }
-        protected Object invoke_V12(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, filter.invokeExact(a12), a13, a14); }
-        protected Object invoke_V13(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, filter.invokeExact(a13), a14); }
-        protected Object invoke_V14(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, filter.invokeExact(a14)); }
-        protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14) throws Throwable {
-            return target.invokeExact(filter.invokeExact(),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); }
-        protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); }
-        protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); }
-        protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); }
-        protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); }
-        protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); }
-        protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); }
-        protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); }
-        protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); }
-        protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); }
-        protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); }
-        protected Object invoke_F11(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); }
-        protected Object invoke_F12(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); }
-        protected Object invoke_F13(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); }
-        protected Object invoke_F14(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); }
-        protected Object invoke_F15(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); }
-        protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14)); }
-        protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14) throws Throwable {
-            return target.invokeExact(a0, filter.invokeExact(a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14)); }
-        protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14) throws Throwable {
-            return target.invokeExact(a0, a1, filter.invokeExact(a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14)); }
-        protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14) throws Throwable {
-            return target.invokeExact(a0, a1, a2, filter.invokeExact(a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14)); }
-        protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14)); }
-        protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14)); }
-        protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14)); }
-        protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7, a8, a9,
-                                 a10, a11, a12, a13, a14)); }
-        protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8, a9,
-                                 a10, a11, a12, a13, a14)); }
-        protected Object invoke_C9(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9,
-                                 a10, a11, a12, a13, a14)); }
-        protected Object invoke_C10(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invokeExact(a10, a11, a12, a13, a14)); }
-        protected Object invoke_C11(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, filter.invokeExact(a11, a12, a13, a14)); }
-        protected Object invoke_C12(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, filter.invokeExact(a12, a13, a14)); }
-        protected Object invoke_C13(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, filter.invokeExact(a13, a14)); }
-        protected Object invoke_C14(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, filter.invokeExact(a14)); }
-        protected Object invoke_C15(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, filter.invokeExact()); }
-        protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14) throws Throwable {
-            Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14 };
-            filter.invokeExact(av); // make the flyby
-            return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9], av[10], av[11], av[12], av[13], av[14]); }
-    }
-    static class F16 extends Adapter {
-        protected F16(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
-        protected F16(MethodHandle e, MethodHandle f, MethodHandle t) {
-            super(e, f, t); }
-        protected F16 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
-            return new F16(e, f, t); }
-        protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15); }
-        protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(a0, filter.invokeExact(a1), a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15); }
-        protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(a0, a1, filter.invokeExact(a2), a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15); }
-        protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(a0, a1, a2, filter.invokeExact(a3), a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15); }
-        protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4), a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15); }
-        protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5), a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15); }
-        protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6), a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15); }
-        protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7), a8, a9,
-                                 a10, a11, a12, a13, a14, a15); }
-        protected Object invoke_V8(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8), a9,
-                                 a10, a11, a12, a13, a14, a15); }
-        protected Object invoke_V9(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9),
-                                 a10, a11, a12, a13, a14, a15); }
-        protected Object invoke_V10(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 filter.invokeExact(a10), a11, a12, a13, a14, a15); }
-        protected Object invoke_V11(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, filter.invokeExact(a11), a12, a13, a14, a15); }
-        protected Object invoke_V12(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, filter.invokeExact(a12), a13, a14, a15); }
-        protected Object invoke_V13(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, filter.invokeExact(a13), a14, a15); }
-        protected Object invoke_V14(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, filter.invokeExact(a14), a15); }
-        protected Object invoke_V15(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, filter.invokeExact(a15)); }
-        protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(filter.invokeExact(),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
-        protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
-        protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
-        protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
-        protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
-        protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
-        protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
-        protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
-        protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
-        protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
-        protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
-        protected Object invoke_F11(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
-        protected Object invoke_F12(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
-        protected Object invoke_F13(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
-        protected Object invoke_F14(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
-        protected Object invoke_F15(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
-        protected Object invoke_F16(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
-        protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15)); }
-        protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(a0, filter.invokeExact(a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15)); }
-        protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(a0, a1, filter.invokeExact(a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15)); }
-        protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(a0, a1, a2, filter.invokeExact(a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15)); }
-        protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15)); }
-        protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15)); }
-        protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15)); }
-        protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15)); }
-        protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8, a9,
-                                 a10, a11, a12, a13, a14, a15)); }
-        protected Object invoke_C9(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9,
-                                 a10, a11, a12, a13, a14, a15)); }
-        protected Object invoke_C10(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invokeExact(a10, a11, a12, a13, a14, a15)); }
-        protected Object invoke_C11(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, filter.invokeExact(a11, a12, a13, a14, a15)); }
-        protected Object invoke_C12(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, filter.invokeExact(a12, a13, a14, a15)); }
-        protected Object invoke_C13(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, filter.invokeExact(a13, a14, a15)); }
-        protected Object invoke_C14(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, filter.invokeExact(a14, a15)); }
-        protected Object invoke_C15(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, filter.invokeExact(a15)); }
-        protected Object invoke_C16(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, filter.invokeExact()); }
-        protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15) throws Throwable {
-            Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15 };
-            filter.invokeExact(av); // make the flyby
-            return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9], av[10], av[11], av[12], av[13], av[14], av[15]); }
-    }
-    static class F17 extends Adapter {
-        protected F17(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
-        protected F17(MethodHandle e, MethodHandle f, MethodHandle t) {
-            super(e, f, t); }
-        protected F17 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
-            return new F17(e, f, t); }
-        protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16); }
-        protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16) throws Throwable {
-            return target.invokeExact(a0, filter.invokeExact(a1), a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16); }
-        protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16) throws Throwable {
-            return target.invokeExact(a0, a1, filter.invokeExact(a2), a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16); }
-        protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16) throws Throwable {
-            return target.invokeExact(a0, a1, a2, filter.invokeExact(a3), a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16); }
-        protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4), a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16); }
-        protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5), a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16); }
-        protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6), a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16); }
-        protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7), a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16); }
-        protected Object invoke_V8(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8), a9,
-                                 a10, a11, a12, a13, a14, a15, a16); }
-        protected Object invoke_V9(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9),
-                                 a10, a11, a12, a13, a14, a15, a16); }
-        protected Object invoke_V10(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 filter.invokeExact(a10), a11, a12, a13, a14, a15, a16); }
-        protected Object invoke_V11(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, filter.invokeExact(a11), a12, a13, a14, a15, a16); }
-        protected Object invoke_V12(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, filter.invokeExact(a12), a13, a14, a15, a16); }
-        protected Object invoke_V13(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, filter.invokeExact(a13), a14, a15, a16); }
-        protected Object invoke_V14(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, filter.invokeExact(a14), a15, a16); }
-        protected Object invoke_V15(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, filter.invokeExact(a15), a16); }
-        protected Object invoke_V16(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, filter.invokeExact(a16)); }
-        protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16) throws Throwable {
-            return target.invokeExact(filter.invokeExact(),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
-        protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
-        protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
-        protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
-        protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
-        protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
-        protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
-        protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
-        protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
-        protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
-        protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
-        protected Object invoke_F11(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
-        protected Object invoke_F12(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
-        protected Object invoke_F13(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
-        protected Object invoke_F14(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
-        protected Object invoke_F15(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
-        protected Object invoke_F16(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
-        protected Object invoke_F17(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
-        protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16)); }
-        protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16) throws Throwable {
-            return target.invokeExact(a0, filter.invokeExact(a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16)); }
-        protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16) throws Throwable {
-            return target.invokeExact(a0, a1, filter.invokeExact(a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16)); }
-        protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16) throws Throwable {
-            return target.invokeExact(a0, a1, a2, filter.invokeExact(a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16)); }
-        protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16)); }
-        protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16)); }
-        protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16)); }
-        protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16)); }
-        protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16)); }
-        protected Object invoke_C9(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9,
-                                 a10, a11, a12, a13, a14, a15, a16)); }
-        protected Object invoke_C10(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invokeExact(a10, a11, a12, a13, a14, a15, a16)); }
-        protected Object invoke_C11(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, filter.invokeExact(a11, a12, a13, a14, a15, a16)); }
-        protected Object invoke_C12(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, filter.invokeExact(a12, a13, a14, a15, a16)); }
-        protected Object invoke_C13(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, filter.invokeExact(a13, a14, a15, a16)); }
-        protected Object invoke_C14(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, filter.invokeExact(a14, a15, a16)); }
-        protected Object invoke_C15(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, filter.invokeExact(a15, a16)); }
-        protected Object invoke_C16(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, filter.invokeExact(a16)); }
-        protected Object invoke_C17(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, filter.invokeExact()); }
-        protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16) throws Throwable {
-            Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16 };
-            filter.invokeExact(av); // make the flyby
-            return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9], av[10], av[11], av[12], av[13], av[14], av[15], av[16]); }
-    }
-    static class F18 extends Adapter {
-        protected F18(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
-        protected F18(MethodHandle e, MethodHandle f, MethodHandle t) {
-            super(e, f, t); }
-        protected F18 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
-            return new F18(e, f, t); }
-        protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17); }
-        protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17) throws Throwable {
-            return target.invokeExact(a0, filter.invokeExact(a1), a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17); }
-        protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17) throws Throwable {
-            return target.invokeExact(a0, a1, filter.invokeExact(a2), a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17); }
-        protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17) throws Throwable {
-            return target.invokeExact(a0, a1, a2, filter.invokeExact(a3), a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17); }
-        protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4), a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17); }
-        protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5), a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17); }
-        protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6), a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17); }
-        protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7), a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17); }
-        protected Object invoke_V8(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8), a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17); }
-        protected Object invoke_V9(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9),
-                                 a10, a11, a12, a13, a14, a15, a16, a17); }
-        protected Object invoke_V10(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 filter.invokeExact(a10), a11, a12, a13, a14, a15, a16, a17); }
-        protected Object invoke_V11(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, filter.invokeExact(a11), a12, a13, a14, a15, a16, a17); }
-        protected Object invoke_V12(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, filter.invokeExact(a12), a13, a14, a15, a16, a17); }
-        protected Object invoke_V13(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, filter.invokeExact(a13), a14, a15, a16, a17); }
-        protected Object invoke_V14(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, filter.invokeExact(a14), a15, a16, a17); }
-        protected Object invoke_V15(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, filter.invokeExact(a15), a16, a17); }
-        protected Object invoke_V16(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, filter.invokeExact(a16), a17); }
-        protected Object invoke_V17(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, filter.invokeExact(a17)); }
-        protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17) throws Throwable {
-            return target.invokeExact(filter.invokeExact(),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
-        protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
-        protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
-        protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
-        protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
-        protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
-        protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
-        protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
-        protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
-        protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
-        protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
-        protected Object invoke_F11(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
-        protected Object invoke_F12(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
-        protected Object invoke_F13(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
-        protected Object invoke_F14(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
-        protected Object invoke_F15(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
-        protected Object invoke_F16(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
-        protected Object invoke_F17(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
-        protected Object invoke_F18(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
-        protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17)); }
-        protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17) throws Throwable {
-            return target.invokeExact(a0, filter.invokeExact(a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17)); }
-        protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17) throws Throwable {
-            return target.invokeExact(a0, a1, filter.invokeExact(a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17)); }
-        protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17) throws Throwable {
-            return target.invokeExact(a0, a1, a2, filter.invokeExact(a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17)); }
-        protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17)); }
-        protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17)); }
-        protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17)); }
-        protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17)); }
-        protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17)); }
-        protected Object invoke_C9(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17)); }
-        protected Object invoke_C10(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invokeExact(a10, a11, a12, a13, a14, a15, a16, a17)); }
-        protected Object invoke_C11(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, filter.invokeExact(a11, a12, a13, a14, a15, a16, a17)); }
-        protected Object invoke_C12(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, filter.invokeExact(a12, a13, a14, a15, a16, a17)); }
-        protected Object invoke_C13(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, filter.invokeExact(a13, a14, a15, a16, a17)); }
-        protected Object invoke_C14(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, filter.invokeExact(a14, a15, a16, a17)); }
-        protected Object invoke_C15(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, filter.invokeExact(a15, a16, a17)); }
-        protected Object invoke_C16(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, filter.invokeExact(a16, a17)); }
-        protected Object invoke_C17(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, filter.invokeExact(a17)); }
-        protected Object invoke_C18(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, filter.invokeExact()); }
-        protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17) throws Throwable {
-            Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17 };
-            filter.invokeExact(av); // make the flyby
-            return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9], av[10], av[11], av[12], av[13], av[14], av[15], av[16], av[17]); }
-    }
-    static class F19 extends Adapter {
-        protected F19(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
-        protected F19(MethodHandle e, MethodHandle f, MethodHandle t) {
-            super(e, f, t); }
-        protected F19 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
-            return new F19(e, f, t); }
-        protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, a18); }
-        protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(a0, filter.invokeExact(a1), a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, a18); }
-        protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(a0, a1, filter.invokeExact(a2), a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, a18); }
-        protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(a0, a1, a2, filter.invokeExact(a3), a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, a18); }
-        protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4), a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, a18); }
-        protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5), a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, a18); }
-        protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6), a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, a18); }
-        protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7), a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, a18); }
-        protected Object invoke_V8(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8), a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, a18); }
-        protected Object invoke_V9(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9),
-                                 a10, a11, a12, a13, a14, a15, a16, a17, a18); }
-        protected Object invoke_V10(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 filter.invokeExact(a10), a11, a12, a13, a14, a15, a16, a17, a18); }
-        protected Object invoke_V11(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, filter.invokeExact(a11), a12, a13, a14, a15, a16, a17, a18); }
-        protected Object invoke_V12(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, filter.invokeExact(a12), a13, a14, a15, a16, a17, a18); }
-        protected Object invoke_V13(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, filter.invokeExact(a13), a14, a15, a16, a17, a18); }
-        protected Object invoke_V14(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, filter.invokeExact(a14), a15, a16, a17, a18); }
-        protected Object invoke_V15(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, filter.invokeExact(a15), a16, a17, a18); }
-        protected Object invoke_V16(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, filter.invokeExact(a16), a17, a18); }
-        protected Object invoke_V17(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, filter.invokeExact(a17), a18); }
-        protected Object invoke_V18(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, filter.invokeExact(a18)); }
-        protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(filter.invokeExact(),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
-        protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
-        protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
-        protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
-        protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
-        protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
-        protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
-        protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
-        protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
-        protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
-        protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
-        protected Object invoke_F11(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
-        protected Object invoke_F12(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
-        protected Object invoke_F13(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
-        protected Object invoke_F14(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
-        protected Object invoke_F15(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
-        protected Object invoke_F16(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
-        protected Object invoke_F17(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
-        protected Object invoke_F18(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
-        protected Object invoke_F19(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
-        protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, a18)); }
-        protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(a0, filter.invokeExact(a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, a18)); }
-        protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(a0, a1, filter.invokeExact(a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, a18)); }
-        protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(a0, a1, a2, filter.invokeExact(a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, a18)); }
-        protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, a18)); }
-        protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, a18)); }
-        protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, a18)); }
-        protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, a18)); }
-        protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, a18)); }
-        protected Object invoke_C9(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, a18)); }
-        protected Object invoke_C10(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invokeExact(a10, a11, a12, a13, a14, a15, a16, a17, a18)); }
-        protected Object invoke_C11(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, filter.invokeExact(a11, a12, a13, a14, a15, a16, a17, a18)); }
-        protected Object invoke_C12(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, filter.invokeExact(a12, a13, a14, a15, a16, a17, a18)); }
-        protected Object invoke_C13(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, filter.invokeExact(a13, a14, a15, a16, a17, a18)); }
-        protected Object invoke_C14(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, filter.invokeExact(a14, a15, a16, a17, a18)); }
-        protected Object invoke_C15(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, filter.invokeExact(a15, a16, a17, a18)); }
-        protected Object invoke_C16(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, filter.invokeExact(a16, a17, a18)); }
-        protected Object invoke_C17(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, filter.invokeExact(a17, a18)); }
-        protected Object invoke_C18(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, filter.invokeExact(a18)); }
-        protected Object invoke_C19(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, filter.invokeExact()); }
-        protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18) throws Throwable {
-            Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18 };
-            filter.invokeExact(av); // make the flyby
-            return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9], av[10], av[11], av[12], av[13], av[14], av[15], av[16], av[17], av[18]); }
-    }
-    static class F20 extends Adapter {
-        protected F20(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
-        protected F20(MethodHandle e, MethodHandle f, MethodHandle t) {
-            super(e, f, t); }
-        protected F20 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
-            return new F20(e, f, t); }
-        protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
-        protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(a0, filter.invokeExact(a1), a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
-        protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(a0, a1, filter.invokeExact(a2), a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
-        protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(a0, a1, a2, filter.invokeExact(a3), a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
-        protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4), a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
-        protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5), a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
-        protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6), a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
-        protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7), a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
-        protected Object invoke_V8(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8), a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
-        protected Object invoke_V9(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9),
-                                 a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
-        protected Object invoke_V10(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 filter.invokeExact(a10), a11, a12, a13, a14, a15, a16, a17, a18, a19); }
-        protected Object invoke_V11(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, filter.invokeExact(a11), a12, a13, a14, a15, a16, a17, a18, a19); }
-        protected Object invoke_V12(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, filter.invokeExact(a12), a13, a14, a15, a16, a17, a18, a19); }
-        protected Object invoke_V13(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, filter.invokeExact(a13), a14, a15, a16, a17, a18, a19); }
-        protected Object invoke_V14(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, filter.invokeExact(a14), a15, a16, a17, a18, a19); }
-        protected Object invoke_V15(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, filter.invokeExact(a15), a16, a17, a18, a19); }
-        protected Object invoke_V16(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, filter.invokeExact(a16), a17, a18, a19); }
-        protected Object invoke_V17(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, filter.invokeExact(a17), a18, a19); }
-        protected Object invoke_V18(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, filter.invokeExact(a18), a19); }
-        protected Object invoke_V19(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, a18, filter.invokeExact(a19)); }
-        protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(filter.invokeExact(),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
-        protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
-        protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
-        protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
-        protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
-        protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
-        protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
-        protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
-        protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
-        protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
-        protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
-        protected Object invoke_F11(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
-        protected Object invoke_F12(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
-        protected Object invoke_F13(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
-        protected Object invoke_F14(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
-        protected Object invoke_F15(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
-        protected Object invoke_F16(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
-        protected Object invoke_F17(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
-        protected Object invoke_F18(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
-        protected Object invoke_F19(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, a18),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
-        protected Object invoke_F20(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19),
-                                 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
-        protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, a18, a19)); }
-        protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(a0, filter.invokeExact(a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, a18, a19)); }
-        protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(a0, a1, filter.invokeExact(a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, a18, a19)); }
-        protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(a0, a1, a2, filter.invokeExact(a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, a18, a19)); }
-        protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, a18, a19)); }
-        protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, a18, a19)); }
-        protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, a18, a19)); }
-        protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, a18, a19)); }
-        protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, a18, a19)); }
-        protected Object invoke_C9(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, a18, a19)); }
-        protected Object invoke_C10(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invokeExact(a10, a11, a12, a13, a14, a15, a16, a17, a18, a19)); }
-        protected Object invoke_C11(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, filter.invokeExact(a11, a12, a13, a14, a15, a16, a17, a18, a19)); }
-        protected Object invoke_C12(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, filter.invokeExact(a12, a13, a14, a15, a16, a17, a18, a19)); }
-        protected Object invoke_C13(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, filter.invokeExact(a13, a14, a15, a16, a17, a18, a19)); }
-        protected Object invoke_C14(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, filter.invokeExact(a14, a15, a16, a17, a18, a19)); }
-        protected Object invoke_C15(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, filter.invokeExact(a15, a16, a17, a18, a19)); }
-        protected Object invoke_C16(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, filter.invokeExact(a16, a17, a18, a19)); }
-        protected Object invoke_C17(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, filter.invokeExact(a17, a18, a19)); }
-        protected Object invoke_C18(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, filter.invokeExact(a18, a19)); }
-        protected Object invoke_C19(Object a0, Object a1, Object a2, Object a3,
-                                    Object a4, Object a5, Object a6, Object a7,
-                                    Object a8, Object a9, Object a10, Object a11,
-                                    Object a12, Object a13, Object a14, Object a15,
-                                    Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, a18, filter.invokeExact(a19)); }
-        protected Object invoke_C20(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, filter.invokeExact()); }
-        protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3,
-                                   Object a4, Object a5, Object a6, Object a7,
-                                   Object a8, Object a9, Object a10, Object a11,
-                                   Object a12, Object a13, Object a14, Object a15,
-                                   Object a16, Object a17, Object a18, Object a19) throws Throwable {
-            Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19 };
-            filter.invokeExact(av); // make the flyby
-            return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9], av[10], av[11], av[12], av[13], av[14], av[15], av[16], av[17], av[18], av[19]); }
-    }
-}
--- a/src/share/classes/java/lang/invoke/FilterOneArgument.java	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +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.
- */
-
-package java.lang.invoke;
-
-import static java.lang.invoke.MethodHandleStatics.*;
-import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
-
-/**
- * Unary function composition, useful for many small plumbing jobs.
- * The invoke method takes a single reference argument, and returns a reference
- * Internally, it first calls the {@code filter} method on the argument,
- * Making up the difference between the raw method type and the
- * final method type is the responsibility of a JVM-level adapter.
- * @author jrose
- */
-class FilterOneArgument extends BoundMethodHandle {
-    protected final MethodHandle filter;  // Object -> Object
-    protected final MethodHandle target;  // Object -> Object
-
-    @Override
-    String debugString() {
-        return target.toString();
-    }
-
-    protected Object invoke(Object argument) throws Throwable {
-        Object filteredArgument = filter.invokeExact(argument);
-        return target.invokeExact(filteredArgument);
-    }
-
-    private static final MethodHandle INVOKE;
-    static {
-        try {
-            INVOKE =
-                IMPL_LOOKUP.findVirtual(FilterOneArgument.class, "invoke",
-                                        MethodType.genericMethodType(1));
-        } catch (ReflectiveOperationException ex) {
-            throw uncaughtException(ex);
-        }
-    }
-
-    protected FilterOneArgument(MethodHandle filter, MethodHandle target) {
-        super(INVOKE);
-        this.filter = filter;
-        this.target = target;
-    }
-
-    static {
-        assert(MethodHandleNatives.workaroundWithoutRicochetFrames());  // this class is deprecated
-    }
-
-    public static MethodHandle make(MethodHandle filter, MethodHandle target) {
-        if (filter == null)  return target;
-        if (target == null)  return filter;
-        return new FilterOneArgument(filter, target);
-    }
-
-//    MethodHandle make(MethodHandle filter1, MethodHandle filter2, MethodHandle target) {
-//        MethodHandle filter = make(filter1, filter2);
-//        return make(filter, target);
-//    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/java/lang/invoke/ForceInline.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,37 @@
+/*
+ * 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.  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.invoke;
+
+import java.lang.annotation.*;
+
+/**
+ * Internal marker for some methods in the JSR 292 implementation.
+ */
+/*non-public*/
+@Target({ElementType.METHOD, ElementType.CONSTRUCTOR})
+@Retention(RetentionPolicy.RUNTIME)
+@interface ForceInline {
+}
--- a/src/share/classes/java/lang/invoke/FromGeneric.java	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,633 +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.
- */
-
-package java.lang.invoke;
-
-import sun.invoke.util.ValueConversions;
-import sun.invoke.util.Wrapper;
-import java.lang.reflect.*;
-import static java.lang.invoke.MethodHandleStatics.*;
-import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
-
-/**
- * Adapters which mediate between incoming calls which are generic
- * and outgoing calls which are not.  Any call can be represented generically
- * boxing up its arguments, and (on return) unboxing the return value.
- * <p>
- * A call is "generic" (in MethodHandle terms) if its MethodType features
- * only Object arguments.  A non-generic call therefore features
- * primitives and/or reference types other than Object.
- * An adapter has types for its incoming and outgoing calls.
- * The incoming call type is simply determined by the adapter's type
- * (the MethodType it presents to callers).  The outgoing call type
- * is determined by the adapter's target (a MethodHandle that the adapter
- * either binds internally or else takes as a leading argument).
- * (To stretch the term, adapter-like method handles may have multiple
- * targets or be polymorphic across multiple call types.)
- * @author jrose
- */
-class FromGeneric {
-    // type for the outgoing call (may have primitives, etc.)
-    private final MethodType targetType;
-    // type of the outgoing call internal to the adapter
-    private final MethodType internalType;
-    // prototype adapter (clone and customize for each new target!)
-    private final Adapter adapter;
-    // entry point for adapter (Adapter mh, a...) => ...
-    private final MethodHandle entryPoint;
-    // unboxing invoker of type (MH, Object**N) => raw return value
-    // it makes up the difference of internalType => targetType
-    private final MethodHandle unboxingInvoker;
-    // conversion which boxes a the target's raw return value
-    private final MethodHandle returnConversion;
-
-    /** Compute and cache information common to all unboxing adapters
-     *  that can call out to targets of the erasure-family of the given erased type.
-     */
-    private FromGeneric(MethodType targetType) {
-        this.targetType = targetType;
-        MethodType internalType0;
-        // the target invoker will generally need casts on reference arguments
-        Adapter ad = findAdapter(internalType0 = targetType.erase());
-        if (ad != null) {
-            // Immediate hit to exactly the adapter we want,
-            // with no monkeying around with primitive types.
-            this.internalType = internalType0;
-            this.adapter = ad;
-            this.entryPoint = ad.prototypeEntryPoint();
-            this.returnConversion = computeReturnConversion(targetType, internalType0);
-            this.unboxingInvoker = computeUnboxingInvoker(targetType, internalType0);
-            return;
-        }
-
-        // outgoing primitive arguments will be wrapped; unwrap them
-        MethodType primsAsObj = targetType.form().primArgsAsBoxes();
-        MethodType objArgsRawRet = primsAsObj.form().primsAsInts();
-        if (objArgsRawRet != targetType)
-            ad = findAdapter(internalType0 = objArgsRawRet);
-        if (ad == null) {
-            ad = buildAdapterFromBytecodes(internalType0 = targetType);
-        }
-        this.internalType = internalType0;
-        this.adapter = ad;
-        MethodType tepType = targetType.insertParameterTypes(0, adapter.getClass());
-        this.entryPoint = ad.prototypeEntryPoint();
-        this.returnConversion = computeReturnConversion(targetType, internalType0);
-        this.unboxingInvoker = computeUnboxingInvoker(targetType, internalType0);
-    }
-
-    static {
-        assert(MethodHandleNatives.workaroundWithoutRicochetFrames());  // this class is deprecated
-    }
-
-    /**
-     * The typed target will be called according to targetType.
-     * The adapter code will in fact see the raw result from internalType,
-     * and must box it into an object.  Produce a converter for this.
-     */
-    private static MethodHandle computeReturnConversion(
-            MethodType targetType, MethodType internalType) {
-        Class<?> tret = targetType.returnType();
-        Class<?> iret = internalType.returnType();
-        Wrapper wrap = Wrapper.forBasicType(tret);
-        if (!iret.isPrimitive()) {
-            assert(iret == Object.class);
-            return ValueConversions.identity();
-        } else if (wrap.primitiveType() == iret) {
-            return ValueConversions.box(wrap);
-        } else {
-            assert(tret == double.class ? iret == long.class : iret == int.class);
-            return ValueConversions.boxRaw(wrap);
-        }
-    }
-
-    /**
-     * The typed target will need an exact invocation point; provide it here.
-     * The adapter will possibly need to make a slightly different call,
-     * so adapt the invoker.  This way, the logic for making up the
-     * difference between what the adapter can call and what the target
-     * needs can be cached once per type.
-     */
-    private static MethodHandle computeUnboxingInvoker(
-            MethodType targetType, MethodType internalType) {
-        // All the adapters we have here have reference-untyped internal calls.
-        assert(internalType == internalType.erase());
-        MethodHandle invoker = targetType.invokers().exactInvoker();
-        // cast all narrow reference types, unbox all primitive arguments:
-        MethodType fixArgsType = internalType.changeReturnType(targetType.returnType());
-        MethodHandle fixArgs = MethodHandleImpl.convertArguments(
-                                 invoker, Invokers.invokerType(fixArgsType),
-                                 invoker.type(), 0);
-        if (fixArgs == null)
-            throw new InternalError("bad fixArgs");
-        // reinterpret the calling sequence as raw:
-        MethodHandle retyper = AdapterMethodHandle.makeRetypeRaw(
-                                        Invokers.invokerType(internalType), fixArgs);
-        if (retyper == null)
-            throw new InternalError("bad retyper");
-        return retyper;
-    }
-
-    Adapter makeInstance(MethodHandle typedTarget) {
-        MethodType type = typedTarget.type();
-        if (type == targetType) {
-            return adapter.makeInstance(entryPoint, unboxingInvoker, returnConversion, typedTarget);
-        }
-        // my erased-type is not exactly the same as the desired type
-        assert(type.erase() == targetType);  // else we are busted
-        MethodHandle invoker = computeUnboxingInvoker(type, internalType);
-        return adapter.makeInstance(entryPoint, invoker, returnConversion, typedTarget);
-    }
-
-    /** Build an adapter of the given generic type, which invokes typedTarget
-     *  on the incoming arguments, after unboxing as necessary.
-     *  The return value is boxed if necessary.
-     * @param typedTarget the target
-     * @return an adapter method handle
-     */
-    public static MethodHandle make(MethodHandle typedTarget) {
-        MethodType type = typedTarget.type();
-        if (type == type.generic())  return typedTarget;
-        return FromGeneric.of(type).makeInstance(typedTarget);
-    }
-
-    /** Return the adapter information for this type's erasure. */
-    static FromGeneric of(MethodType type) {
-        MethodTypeForm form = type.form();
-        FromGeneric fromGen = form.fromGeneric;
-        if (fromGen == null)
-            form.fromGeneric = fromGen = new FromGeneric(form.erasedType());
-        return fromGen;
-    }
-
-    public String toString() {
-        return "FromGeneric"+targetType;
-    }
-
-    /* Create an adapter that handles spreading calls for the given type. */
-    static Adapter findAdapter(MethodType internalType) {
-        MethodType entryType = internalType.generic();
-        MethodTypeForm form = internalType.form();
-        Class<?> rtype = internalType.returnType();
-        int argc = form.parameterCount();
-        int lac = form.longPrimitiveParameterCount();
-        int iac = form.primitiveParameterCount() - lac;
-        String intsAndLongs = (iac > 0 ? "I"+iac : "")+(lac > 0 ? "J"+lac : "");
-        String rawReturn = String.valueOf(Wrapper.forPrimitiveType(rtype).basicTypeChar());
-        String cname0 = rawReturn + argc;
-        String cname1 = "A"       + argc;
-        String[] cnames = { cname0+intsAndLongs, cname0, cname1+intsAndLongs, cname1 };
-        String iname = "invoke_"+cname0+intsAndLongs;
-        // e.g., D5I2, D5, L5I2, L5; invoke_D5
-        for (String cname : cnames) {
-            Class<? extends Adapter> acls = Adapter.findSubClass(cname);
-            if (acls == null)  continue;
-            // see if it has the required invoke method
-            MethodHandle entryPoint = null;
-            try {
-                entryPoint = IMPL_LOOKUP.findSpecial(acls, iname, entryType, acls);
-            } catch (ReflectiveOperationException ex) {
-            }
-            if (entryPoint == null)  continue;
-            Constructor<? extends Adapter> ctor = null;
-            try {
-                ctor = acls.getDeclaredConstructor(MethodHandle.class);
-            } catch (NoSuchMethodException ex) {
-            } catch (SecurityException ex) {
-            }
-            if (ctor == null)  continue;
-            try {
-                // Produce an instance configured as a prototype.
-                return ctor.newInstance(entryPoint);
-            } catch (IllegalArgumentException ex) {
-            } catch (InvocationTargetException wex) {
-                Throwable ex = wex.getTargetException();
-                if (ex instanceof Error)  throw (Error)ex;
-                if (ex instanceof RuntimeException)  throw (RuntimeException)ex;
-            } catch (InstantiationException ex) {
-            } catch (IllegalAccessException ex) {
-            }
-        }
-        return null;
-    }
-
-    static Adapter buildAdapterFromBytecodes(MethodType internalType) {
-        throw new UnsupportedOperationException("NYI "+internalType);
-    }
-
-    /**
-     * This adapter takes some untyped arguments, and returns an untyped result.
-     * Internally, it applies the invoker to the target, which causes the
-     * objects to be unboxed; the result is a raw type in L/I/J/F/D.
-     * This result is passed to convert, which is responsible for
-     * converting the raw result into a boxed object.
-     * The invoker is kept separate from the target because it can be
-     * generated once per type erasure family, and reused across adapters.
-     */
-    static abstract class Adapter extends BoundMethodHandle {
-        /*
-         * class X<<R,int N>> extends Adapter {
-         *   (MH, Object**N)=>raw(R) invoker;
-         *   (any**N)=>R target;
-         *   raw(R)=>Object convert;
-         *   Object invoke(Object**N a) = convert(invoker(target, a...))
-         * }
-         */
-        protected final MethodHandle invoker;  // (MH, Object**N) => raw(R)
-        protected final MethodHandle convert;  // raw(R) => Object
-        protected final MethodHandle target;   // (any**N) => R
-
-        @Override
-        String debugString() {
-            return addTypeString(target, this);
-        }
-
-        protected boolean isPrototype() { return target == null; }
-        protected Adapter(MethodHandle entryPoint) {
-            this(entryPoint, null, entryPoint, null);
-            assert(isPrototype());
-        }
-        protected MethodHandle prototypeEntryPoint() {
-            if (!isPrototype())  throw new InternalError();
-            return convert;
-        }
-
-        protected Adapter(MethodHandle entryPoint,
-                          MethodHandle invoker, MethodHandle convert, MethodHandle target) {
-            super(entryPoint);
-            this.invoker = invoker;
-            this.convert = convert;
-            this.target  = target;
-        }
-
-        /** Make a copy of self, with new fields. */
-        protected abstract Adapter makeInstance(MethodHandle entryPoint,
-                MethodHandle invoker, MethodHandle convert, MethodHandle target);
-        // { return new ThisType(entryPoint, convert, target); }
-
-        /// Conversions on the value returned from the target.
-        protected Object convert_L(Object result) throws Throwable { return convert.invokeExact(result); }
-        protected Object convert_I(int    result) throws Throwable { return convert.invokeExact(result); }
-        protected Object convert_J(long   result) throws Throwable { return convert.invokeExact(result); }
-        protected Object convert_F(float  result) throws Throwable { return convert.invokeExact(result); }
-        protected Object convert_D(double result) throws Throwable { return convert.invokeExact(result); }
-
-        static private final String CLASS_PREFIX; // "java.lang.invoke.FromGeneric$"
-        static {
-            String aname = Adapter.class.getName();
-            String sname = Adapter.class.getSimpleName();
-            if (!aname.endsWith(sname))  throw new InternalError();
-            CLASS_PREFIX = aname.substring(0, aname.length() - sname.length());
-        }
-        /** Find a sibing class of Adapter. */
-        static Class<? extends Adapter> findSubClass(String name) {
-            String cname = Adapter.CLASS_PREFIX + name;
-            try {
-                return Class.forName(cname).asSubclass(Adapter.class);
-            } catch (ClassNotFoundException ex) {
-                return null;
-            } catch (ClassCastException ex) {
-                return null;
-            }
-        }
-    }
-
-    /* generated classes follow this pattern:
-    static class xA2 extends Adapter {
-        protected xA2(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
-        protected xA2(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
-                        { super(e, i, c, t); }
-        protected xA2 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
-                        { return new xA2(e, i, c, t); }
-        protected Object invoke_L2(Object a0, Object a1) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0, a1)); }
-        protected Object invoke_I2(Object a0, Object a1) throws Throwable { return convert_I((int)   invoker.invokeExact(target, a0, a1)); }
-        protected Object invoke_J2(Object a0, Object a1) throws Throwable { return convert_J((long)  invoker.invokeExact(target, a0, a1)); }
-        protected Object invoke_F2(Object a0, Object a1) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0, a1)); }
-        protected Object invoke_D2(Object a0, Object a1) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0, a1)); }
-    }
-    // */
-
-/*
-: SHELL; n=FromGeneric; cp -p $n.java $n.java-; sed < $n.java- > $n.java+ -e '/{{*{{/,/}}*}}/w /tmp/genclasses.java' -e '/}}*}}/q'; (cd /tmp; javac -d . genclasses.java; java -cp . genclasses) >> $n.java+; echo '}' >> $n.java+; mv $n.java+ $n.java; mv $n.java- $n.java~
-//{{{
-import java.util.*;
-class genclasses {
-    static String[] TYPES = { "Object",    "int   ",    "long  ",    "float ",    "double" };
-    static String[] WRAPS = { "         ", "(Integer)", "(Long)   ", "(Float)  ", "(Double) " };
-    static String[] TCHARS = { "L",     "I",      "J",      "F",      "D",     "A" };
-    static String[][] TEMPLATES = { {
-        "@for@ arity=0..10  rcat<=4 nrefs<=99 nints=0   nlongs=0",
-        "    //@each-cat@",
-        "    static class @cat@ extends Adapter {",
-        "        protected @cat@(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype",
-        "        protected @cat@(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)",
-        "                        { super(e, i, c, t); }",
-        "        protected @cat@ makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)",
-        "                        { return new @cat@(e, i, c, t); }",
-        "        //@each-R@",
-        "        protected Object invoke_@catN@(@Tvav@) throws Throwable { return convert_@Rc@((@R@)@W@invoker.invokeExact(target@av@)); }",
-        "        //@end-R@",
-        "    }",
-    } };
-    static final String NEWLINE_INDENT = "\n                ";
-    enum VAR {
-        cat, catN, R, Rc, W, av, Tvav, Ovav;
-        public final String pattern = "@"+toString().replace('_','.')+"@";
-        public String binding;
-        static void makeBindings(boolean topLevel, int rcat, int nrefs, int nints, int nlongs) {
-            int nargs = nrefs + nints + nlongs;
-            if (topLevel)
-                VAR.cat.binding = catstr(ALL_RETURN_TYPES ? TYPES.length : rcat, nrefs, nints, nlongs);
-            VAR.catN.binding = catstr(rcat, nrefs, nints, nlongs);
-            VAR.R.binding = TYPES[rcat];
-            VAR.Rc.binding = TCHARS[rcat];
-            VAR.W.binding = WRAPS[rcat];
-            String[] Tv = new String[nargs];
-            String[] av = new String[nargs];
-            String[] Tvav = new String[nargs];
-            String[] Ovav = new String[nargs];
-            for (int i = 0; i < nargs; i++) {
-                int tcat = (i < nrefs) ? 0 : (i < nrefs + nints) ? 1 : 2;
-                Tv[i] = TYPES[tcat];
-                av[i] = arg(i);
-                Tvav[i] = param(Tv[i], av[i]);
-                Ovav[i] = param("Object", av[i]);
-            }
-            VAR.av.binding = comma(", ", av);
-            VAR.Tvav.binding = comma(Tvav);
-            VAR.Ovav.binding = comma(Ovav);
-        }
-        static String arg(int i) { return "a"+i; }
-        static String param(String t, String a) { return t+" "+a; }
-        static String comma(String[] v) { return comma("", v); }
-        static String comma(String sep, String[] v) {
-            if (v.length == 0)  return "";
-            String res = sep+v[0];
-            for (int i = 1; i < v.length; i++)  res += ", "+v[i];
-            return res;
-        }
-        static String transform(String string) {
-            for (VAR var : values())
-                string = string.replaceAll(var.pattern, var.binding);
-            return string;
-        }
-    }
-    static String[] stringsIn(String[] strings, int beg, int end) {
-        return Arrays.copyOfRange(strings, beg, Math.min(end, strings.length));
-    }
-    static String[] stringsBefore(String[] strings, int pos) {
-        return stringsIn(strings, 0, pos);
-    }
-    static String[] stringsAfter(String[] strings, int pos) {
-        return stringsIn(strings, pos, strings.length);
-    }
-    static int indexAfter(String[] strings, int pos, String tag) {
-        return Math.min(indexBefore(strings, pos, tag) + 1, strings.length);
-    }
-    static int indexBefore(String[] strings, int pos, String tag) {
-        for (int i = pos, end = strings.length; ; i++) {
-            if (i == end || strings[i].endsWith(tag))  return i;
-        }
-    }
-    static int MIN_ARITY, MAX_ARITY, MAX_RCAT, MAX_REFS, MAX_INTS, MAX_LONGS;
-    static boolean ALL_ARG_TYPES, ALL_RETURN_TYPES;
-    static HashSet<String> done = new HashSet<String>();
-    public static void main(String... av) {
-        for (String[] template : TEMPLATES) {
-            int forLinesLimit = indexBefore(template, 0, "@each-cat@");
-            String[] forLines = stringsBefore(template, forLinesLimit);
-            template = stringsAfter(template, forLinesLimit);
-            for (String forLine : forLines)
-                expandTemplate(forLine, template);
-        }
-    }
-    static void expandTemplate(String forLine, String[] template) {
-        String[] params = forLine.split("[^0-9]+");
-        if (params[0].length() == 0)  params = stringsAfter(params, 1);
-        System.out.println("//params="+Arrays.asList(params));
-        int pcur = 0;
-        MIN_ARITY = Integer.valueOf(params[pcur++]);
-        MAX_ARITY = Integer.valueOf(params[pcur++]);
-        MAX_RCAT  = Integer.valueOf(params[pcur++]);
-        MAX_REFS  = Integer.valueOf(params[pcur++]);
-        MAX_INTS  = Integer.valueOf(params[pcur++]);
-        MAX_LONGS = Integer.valueOf(params[pcur++]);
-        if (pcur != params.length)  throw new RuntimeException("bad extra param: "+forLine);
-        if (MAX_RCAT >= TYPES.length)  MAX_RCAT = TYPES.length - 1;
-        ALL_ARG_TYPES = (indexBefore(template, 0, "@each-Tv@") < template.length);
-        ALL_RETURN_TYPES = (indexBefore(template, 0, "@each-R@") < template.length);
-        for (int nargs = MIN_ARITY; nargs <= MAX_ARITY; nargs++) {
-            for (int rcat = 0; rcat <= MAX_RCAT; rcat++) {
-                expandTemplate(template, true, rcat, nargs, 0, 0);
-                if (ALL_ARG_TYPES)  break;
-                expandTemplateForPrims(template, true, rcat, nargs, 1, 1);
-                if (ALL_RETURN_TYPES)  break;
-            }
-        }
-    }
-    static String catstr(int rcat, int nrefs, int nints, int nlongs) {
-        int nargs = nrefs + nints + nlongs;
-        String cat = TCHARS[rcat] + nargs;
-        if (!ALL_ARG_TYPES)  cat += (nints==0?"":"I"+nints)+(nlongs==0?"":"J"+nlongs);
-        return cat;
-    }
-    static void expandTemplateForPrims(String[] template, boolean topLevel, int rcat, int nargs, int minints, int minlongs) {
-        for (int isLong = 0; isLong <= 1; isLong++) {
-            for (int nprims = 1; nprims <= nargs; nprims++) {
-                int nrefs = nargs - nprims;
-                int nints = ((1-isLong) * nprims);
-                int nlongs = (isLong * nprims);
-                expandTemplate(template, topLevel, rcat, nrefs, nints, nlongs);
-            }
-        }
-    }
-    static void expandTemplate(String[] template, boolean topLevel,
-                               int rcat, int nrefs, int nints, int nlongs) {
-        int nargs = nrefs + nints + nlongs;
-        if (nrefs > MAX_REFS || nints > MAX_INTS || nlongs > MAX_LONGS)  return;
-        VAR.makeBindings(topLevel, rcat, nrefs, nints, nlongs);
-        if (topLevel && !done.add(VAR.cat.binding)) {
-            System.out.println("    //repeat "+VAR.cat.binding);
-            return;
-        }
-        for (int i = 0; i < template.length; i++) {
-            String line = template[i];
-            if (line.endsWith("@each-cat@")) {
-                // ignore
-            } else if (line.endsWith("@each-R@")) {
-                int blockEnd = indexAfter(template, i, "@end-R@");
-                String[] block = stringsIn(template, i+1, blockEnd-1);
-                for (int rcat1 = rcat; rcat1 <= MAX_RCAT; rcat1++)
-                    expandTemplate(block, false, rcat1, nrefs, nints, nlongs);
-                VAR.makeBindings(topLevel, rcat, nrefs, nints, nlongs);
-                i = blockEnd-1; continue;
-            } else if (line.endsWith("@each-Tv@")) {
-                int blockEnd = indexAfter(template, i, "@end-Tv@");
-                String[] block = stringsIn(template, i+1, blockEnd-1);
-                expandTemplate(block, false, rcat, nrefs, nints, nlongs);
-                expandTemplateForPrims(block, false, rcat, nargs, nints+1, nlongs+1);
-                VAR.makeBindings(topLevel, rcat, nrefs, nints, nlongs);
-                i = blockEnd-1; continue;
-            } else {
-                System.out.println(VAR.transform(line));
-            }
-        }
-    }
-}
-//}}} */
-//params=[0, 10, 4, 99, 0, 0]
-    static class A0 extends Adapter {
-        protected A0(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
-        protected A0(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
-                        { super(e, i, c, t); }
-        protected A0 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
-                        { return new A0(e, i, c, t); }
-        protected Object invoke_L0() throws Throwable { return convert_L((Object)invoker.invokeExact(target)); }
-        protected Object invoke_I0() throws Throwable { return convert_I((int)   invoker.invokeExact(target)); }
-        protected Object invoke_J0() throws Throwable { return convert_J((long)  invoker.invokeExact(target)); }
-        protected Object invoke_F0() throws Throwable { return convert_F((float) invoker.invokeExact(target)); }
-        protected Object invoke_D0() throws Throwable { return convert_D((double)invoker.invokeExact(target)); }
-    }
-    static class A1 extends Adapter {
-        protected A1(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
-        protected A1(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
-                        { super(e, i, c, t); }
-        protected A1 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
-                        { return new A1(e, i, c, t); }
-        protected Object invoke_L1(Object a0) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0)); }
-        protected Object invoke_I1(Object a0) throws Throwable { return convert_I((int)   invoker.invokeExact(target, a0)); }
-        protected Object invoke_J1(Object a0) throws Throwable { return convert_J((long)  invoker.invokeExact(target, a0)); }
-        protected Object invoke_F1(Object a0) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0)); }
-        protected Object invoke_D1(Object a0) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0)); }
-    }
-    static class A2 extends Adapter {
-        protected A2(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
-        protected A2(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
-                        { super(e, i, c, t); }
-        protected A2 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
-                        { return new A2(e, i, c, t); }
-        protected Object invoke_L2(Object a0, Object a1) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0, a1)); }
-        protected Object invoke_I2(Object a0, Object a1) throws Throwable { return convert_I((int)   invoker.invokeExact(target, a0, a1)); }
-        protected Object invoke_J2(Object a0, Object a1) throws Throwable { return convert_J((long)  invoker.invokeExact(target, a0, a1)); }
-        protected Object invoke_F2(Object a0, Object a1) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0, a1)); }
-        protected Object invoke_D2(Object a0, Object a1) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0, a1)); }
-    }
-    static class A3 extends Adapter {
-        protected A3(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
-        protected A3(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
-                        { super(e, i, c, t); }
-        protected A3 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
-                        { return new A3(e, i, c, t); }
-        protected Object invoke_L3(Object a0, Object a1, Object a2) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0, a1, a2)); }
-        protected Object invoke_I3(Object a0, Object a1, Object a2) throws Throwable { return convert_I((int)   invoker.invokeExact(target, a0, a1, a2)); }
-        protected Object invoke_J3(Object a0, Object a1, Object a2) throws Throwable { return convert_J((long)  invoker.invokeExact(target, a0, a1, a2)); }
-        protected Object invoke_F3(Object a0, Object a1, Object a2) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0, a1, a2)); }
-        protected Object invoke_D3(Object a0, Object a1, Object a2) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0, a1, a2)); }
-    }
-    static class A4 extends Adapter {
-        protected A4(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
-        protected A4(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
-                        { super(e, i, c, t); }
-        protected A4 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
-                        { return new A4(e, i, c, t); }
-        protected Object invoke_L4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0, a1, a2, a3)); }
-        protected Object invoke_I4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return convert_I((int)   invoker.invokeExact(target, a0, a1, a2, a3)); }
-        protected Object invoke_J4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return convert_J((long)  invoker.invokeExact(target, a0, a1, a2, a3)); }
-        protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0, a1, a2, a3)); }
-        protected Object invoke_D4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0, a1, a2, a3)); }
-    }
-    static class A5 extends Adapter {
-        protected A5(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
-        protected A5(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
-                        { super(e, i, c, t); }
-        protected A5 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
-                        { return new A5(e, i, c, t); }
-        protected Object invoke_L5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0, a1, a2, a3, a4)); }
-        protected Object invoke_I5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return convert_I((int)   invoker.invokeExact(target, a0, a1, a2, a3, a4)); }
-        protected Object invoke_J5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return convert_J((long)  invoker.invokeExact(target, a0, a1, a2, a3, a4)); }
-        protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0, a1, a2, a3, a4)); }
-        protected Object invoke_D5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0, a1, a2, a3, a4)); }
-    }
-    static class A6 extends Adapter {
-        protected A6(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
-        protected A6(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
-                        { super(e, i, c, t); }
-        protected A6 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
-                        { return new A6(e, i, c, t); }
-        protected Object invoke_L6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5)); }
-        protected Object invoke_I6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return convert_I((int)   invoker.invokeExact(target, a0, a1, a2, a3, a4, a5)); }
-        protected Object invoke_J6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return convert_J((long)  invoker.invokeExact(target, a0, a1, a2, a3, a4, a5)); }
-        protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5)); }
-        protected Object invoke_D6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5)); }
-    }
-    static class A7 extends Adapter {
-        protected A7(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
-        protected A7(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
-                        { super(e, i, c, t); }
-        protected A7 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
-                        { return new A7(e, i, c, t); }
-        protected Object invoke_L7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6)); }
-        protected Object invoke_I7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return convert_I((int)   invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6)); }
-        protected Object invoke_J7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return convert_J((long)  invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6)); }
-        protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6)); }
-        protected Object invoke_D7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6)); }
-    }
-    static class A8 extends Adapter {
-        protected A8(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
-        protected A8(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
-                        { super(e, i, c, t); }
-        protected A8 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
-                        { return new A8(e, i, c, t); }
-        protected Object invoke_L8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7)); }
-        protected Object invoke_I8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return convert_I((int)   invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7)); }
-        protected Object invoke_J8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return convert_J((long)  invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7)); }
-        protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7)); }
-        protected Object invoke_D8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7)); }
-    }
-    static class A9 extends Adapter {
-        protected A9(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
-        protected A9(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
-                        { super(e, i, c, t); }
-        protected A9 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
-                        { return new A9(e, i, c, t); }
-        protected Object invoke_L9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
-        protected Object invoke_I9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return convert_I((int)   invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
-        protected Object invoke_J9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return convert_J((long)  invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
-        protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
-        protected Object invoke_D9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
-    }
-    static class A10 extends Adapter {
-        protected A10(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
-        protected A10(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
-                        { super(e, i, c, t); }
-        protected A10 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
-                        { return new A10(e, i, c, t); }
-        protected Object invoke_L10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
-        protected Object invoke_I10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return convert_I((int)   invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
-        protected Object invoke_J10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return convert_J((long)  invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
-        protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
-        protected Object invoke_D10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,1078 @@
+/*
+ * 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.  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.invoke;
+
+import sun.invoke.util.VerifyAccess;
+import java.lang.invoke.LambdaForm.Name;
+import java.lang.invoke.MethodHandles.Lookup;
+
+import sun.invoke.util.Wrapper;
+
+import java.io.*;
+import java.util.*;
+
+import com.sun.xml.internal.ws.org.objectweb.asm.*;
+
+import java.lang.reflect.*;
+import static java.lang.invoke.MethodHandleStatics.*;
+import static java.lang.invoke.MethodHandleNatives.Constants.*;
+import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
+import sun.invoke.util.ValueConversions;
+import sun.invoke.util.VerifyType;
+
+/**
+ * Code generation backend for LambdaForm.
+ * <p>
+ * @author John Rose, JSR 292 EG
+ */
+class InvokerBytecodeGenerator {
+    /** Define class names for convenience. */
+    private static final String MH      = "java/lang/invoke/MethodHandle";
+    private static final String BMH     = "java/lang/invoke/BoundMethodHandle";
+    private static final String LF      = "java/lang/invoke/LambdaForm";
+    private static final String LFN     = "java/lang/invoke/LambdaForm$Name";
+    private static final String CLS     = "java/lang/Class";
+    private static final String OBJ     = "java/lang/Object";
+    private static final String OBJARY  = "[Ljava/lang/Object;";
+
+    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 + ";";
+
+    /** Name of its super class*/
+    private static final String superName = LF;
+
+    /** Name of new class */
+    private final String className;
+
+    /** Name of the source file (for stack trace printing). */
+    private final String sourceFile;
+
+    private final LambdaForm lambdaForm;
+    private final String     invokerName;
+    private final MethodType invokerType;
+    private final int[] localsMap;
+
+    /** ASM bytecode generation. */
+    private ClassWriter cw;
+    private MethodVisitor mv;
+
+    private static final MemberName.Factory MEMBERNAME_FACTORY = MemberName.getFactory();
+    private static final Class<?> HOST_CLASS = LambdaForm.class;
+
+    private InvokerBytecodeGenerator(LambdaForm lambdaForm, int localsMapSize,
+                                     String className, String invokerName, MethodType invokerType) {
+        if (invokerName.contains(".")) {
+            int p = invokerName.indexOf(".");
+            className = invokerName.substring(0, p);
+            invokerName = invokerName.substring(p+1);
+        }
+        if (DUMP_CLASS_FILES) {
+            className = makeDumpableClassName(className);
+        }
+        this.className  = superName + "$" + className;
+        this.sourceFile = "LambdaForm$" + className;
+        this.lambdaForm = lambdaForm;
+        this.invokerName = invokerName;
+        this.invokerType = invokerType;
+        this.localsMap = new int[localsMapSize];
+    }
+
+    private InvokerBytecodeGenerator(String className, String invokerName, MethodType invokerType) {
+        this(null, invokerType.parameterCount(),
+             className, invokerName, invokerType);
+        // Create an array to map name indexes to locals indexes.
+        for (int i = 0; i < localsMap.length; i++) {
+            localsMap[i] = invokerType.parameterSlotCount() - invokerType.parameterSlotDepth(i);
+        }
+    }
+
+    private InvokerBytecodeGenerator(String className, LambdaForm form, MethodType invokerType) {
+        this(form, form.names.length,
+             className, form.debugName, invokerType);
+        // Create an array to map name indexes to locals indexes.
+        Name[] names = form.names;
+        for (int i = 0, index = 0; i < localsMap.length; i++) {
+            localsMap[i] = index;
+            index += Wrapper.forBasicType(names[i].type).stackSlots();
+        }
+    }
+
+
+    /** instance counters for dumped classes */
+    private final static HashMap<String,Integer> DUMP_CLASS_FILES_COUNTERS;
+    /** debugging flag for saving generated class files */
+    private final static File DUMP_CLASS_FILES_DIR;
+
+    static {
+        if (DUMP_CLASS_FILES) {
+            DUMP_CLASS_FILES_COUNTERS = new HashMap<>();
+            try {
+                File dumpDir = new File("DUMP_CLASS_FILES");
+                if (!dumpDir.exists()) {
+                    dumpDir.mkdirs();
+                }
+                DUMP_CLASS_FILES_DIR = dumpDir;
+                System.out.println("Dumping class files to "+DUMP_CLASS_FILES_DIR+"/...");
+            } catch (Exception e) {
+                throw newInternalError(e);
+            }
+        } else {
+            DUMP_CLASS_FILES_COUNTERS = null;
+            DUMP_CLASS_FILES_DIR = null;
+        }
+    }
+
+    static void maybeDump(final String className, final byte[] classFile) {
+        if (DUMP_CLASS_FILES) {
+            System.out.println("dump: " + className);
+            java.security.AccessController.doPrivileged(
+            new java.security.PrivilegedAction<Void>() {
+                public Void run() {
+                    try {
+                        String dumpName = className;
+                        //dumpName = dumpName.replace('/', '-');
+                        File dumpFile = new File(DUMP_CLASS_FILES_DIR, dumpName+".class");
+                        dumpFile.getParentFile().mkdirs();
+                        FileOutputStream file = new FileOutputStream(dumpFile);
+                        file.write(classFile);
+                        file.close();
+                        return null;
+                    } catch (IOException ex) {
+                        throw newInternalError(ex);
+                    }
+                }
+            });
+        }
+
+    }
+
+    private static String makeDumpableClassName(String className) {
+        Integer ctr;
+        synchronized (DUMP_CLASS_FILES_COUNTERS) {
+            ctr = DUMP_CLASS_FILES_COUNTERS.get(className);
+            if (ctr == null)  ctr = 0;
+            DUMP_CLASS_FILES_COUNTERS.put(className, ctr+1);
+        }
+        String sfx = ctr.toString();
+        while (sfx.length() < 3)
+            sfx = "0"+sfx;
+        className += sfx;
+        return className;
+    }
+
+    class CpPatch {
+        final int index;
+        final String placeholder;
+        final Object value;
+        CpPatch(int index, String placeholder, Object value) {
+            this.index = index;
+            this.placeholder = placeholder;
+            this.value = value;
+        }
+        public String toString() {
+            return "CpPatch/index="+index+",placeholder="+placeholder+",value="+value;
+        }
+    }
+
+    Map<Object, CpPatch> cpPatches = new HashMap<>();
+
+    int cph = 0;  // for counting constant placeholders
+
+    String constantPlaceholder(Object arg) {
+        String cpPlaceholder = "CONSTANT_PLACEHOLDER_" + cph++;
+        if (DUMP_CLASS_FILES) cpPlaceholder += " <<" + arg.toString() + ">>";  // debugging aid
+        if (cpPatches.containsKey(cpPlaceholder)) {
+            throw new InternalError("observed CP placeholder twice: " + cpPlaceholder);
+        }
+        // insert placeholder in CP and remember the patch
+        int index = cw.newConst((Object) cpPlaceholder);  // TODO check if aready in the constant pool
+        cpPatches.put(cpPlaceholder, new CpPatch(index, cpPlaceholder, arg));
+        return cpPlaceholder;
+    }
+
+    Object[] cpPatches(byte[] classFile) {
+        int size = getConstantPoolSize(classFile);
+        Object[] res = new Object[size];
+        for (CpPatch p : cpPatches.values()) {
+            if (p.index >= size)
+                throw new InternalError("in cpool["+size+"]: "+p+"\n"+Arrays.toString(Arrays.copyOf(classFile, 20)));
+            res[p.index] = p.value;
+        }
+        return res;
+    }
+
+    /**
+     * Extract the number of constant pool entries from a given class file.
+     *
+     * @param classFile the bytes of the class file in question.
+     * @return the number of entries in the constant pool.
+     */
+    private static int getConstantPoolSize(byte[] classFile) {
+        // The first few bytes:
+        // u4 magic;
+        // u2 minor_version;
+        // u2 major_version;
+        // u2 constant_pool_count;
+        return ((classFile[8] & 0xFF) << 8) | (classFile[9] & 0xFF);
+    }
+
+    /**
+     * Extract the MemberName of a newly-defined method.
+     *
+     * @param classFile
+     * @return
+     */
+    private MemberName loadMethod(byte[] classFile) {
+        Class<?> invokerClass = loadAndInitializeInvokerClass(classFile, cpPatches(classFile));
+        return resolveInvokerMember(invokerClass, invokerName, invokerType);
+    }
+
+    /**
+     * Define a given class as anonymous class in the runtime system.
+     *
+     * @param classBytes
+     * @param patches
+     * @return
+     */
+    private static Class<?> loadAndInitializeInvokerClass(byte[] classBytes, Object[] patches) {
+        Class<?> invokerClass = UNSAFE.defineAnonymousClass(HOST_CLASS, classBytes, patches);
+        UNSAFE.ensureClassInitialized(invokerClass);  // Make sure the class is initialized; VM might complain.
+        return invokerClass;
+    }
+
+    /**
+     * TODO
+     *
+     * @param invokerClass
+     * @param name
+     * @param type
+     * @return
+     */
+    private static MemberName resolveInvokerMember(Class<?> invokerClass, String name, MethodType type) {
+        MemberName member = new MemberName(invokerClass, name, type, REF_invokeStatic);
+        //System.out.println("resolveInvokerMember => "+member);
+        //for (Method m : invokerClass.getDeclaredMethods())  System.out.println("  "+m);
+        try {
+            member = MEMBERNAME_FACTORY.resolveOrFail(REF_invokeStatic, member, HOST_CLASS, ReflectiveOperationException.class);
+        } catch (ReflectiveOperationException e) {
+            throw newInternalError(e);
+        }
+        //System.out.println("resolveInvokerMember => "+member);
+        return member;
+    }
+
+    /**
+     * Set up class file generation.
+     */
+    private void classFilePrologue() {
+        cw = new ClassWriter(ClassWriter.COMPUTE_MAXS + ClassWriter.COMPUTE_FRAMES);
+        cw.visit(Opcodes.V1_6, Opcodes.ACC_PUBLIC + Opcodes.ACC_FINAL + Opcodes.ACC_SUPER, className, null, superName, null);
+        cw.visitSource(sourceFile, null);
+
+        String invokerDesc = invokerType.toMethodDescriptorString();
+        mv = cw.visitMethod(Opcodes.ACC_STATIC, invokerName, invokerDesc, null, null);
+    }
+
+    /**
+     * Tear down class file generation.
+     */
+    private void classFileEpilogue() {
+        mv.visitMaxs(0, 0);
+        mv.visitEnd();
+    }
+
+    /*
+     * Low-level emit helpers.
+     */
+    private void emitConst(Object con) {
+        if (con == null) {
+            mv.visitInsn(Opcodes.ACONST_NULL);
+            return;
+        }
+        if (con instanceof Integer) {
+            emitIconstInsn((int) con);
+            return;
+        }
+        if (con instanceof Long) {
+            long x = (long) con;
+            if (x == (short) x) {
+                emitIconstInsn((int) x);
+                mv.visitInsn(Opcodes.I2L);
+                return;
+            }
+        }
+        if (con instanceof Float) {
+            float x = (float) con;
+            if (x == (short) x) {
+                emitIconstInsn((int) x);
+                mv.visitInsn(Opcodes.I2F);
+                return;
+            }
+        }
+        if (con instanceof Double) {
+            double x = (double) con;
+            if (x == (short) x) {
+                emitIconstInsn((int) x);
+                mv.visitInsn(Opcodes.I2D);
+                return;
+            }
+        }
+        if (con instanceof Boolean) {
+            emitIconstInsn((boolean) con ? 1 : 0);
+            return;
+        }
+        // fall through:
+        mv.visitLdcInsn(con);
+    }
+
+    private void emitIconstInsn(int i) {
+        int opcode;
+        switch (i) {
+        case 0:  opcode = Opcodes.ICONST_0;  break;
+        case 1:  opcode = Opcodes.ICONST_1;  break;
+        case 2:  opcode = Opcodes.ICONST_2;  break;
+        case 3:  opcode = Opcodes.ICONST_3;  break;
+        case 4:  opcode = Opcodes.ICONST_4;  break;
+        case 5:  opcode = Opcodes.ICONST_5;  break;
+        default:
+            if (i == (byte) i) {
+                mv.visitIntInsn(Opcodes.BIPUSH, i & 0xFF);
+            } else if (i == (short) i) {
+                mv.visitIntInsn(Opcodes.SIPUSH, (char) i);
+            } else {
+                mv.visitLdcInsn(i);
+            }
+            return;
+        }
+        mv.visitInsn(opcode);
+    }
+
+    /*
+     * NOTE: These load/store methods use the localsMap to find the correct index!
+     */
+    private void emitLoadInsn(char type, int index) {
+        int opcode;
+        switch (type) {
+        case 'I':  opcode = Opcodes.ILOAD;  break;
+        case 'J':  opcode = Opcodes.LLOAD;  break;
+        case 'F':  opcode = Opcodes.FLOAD;  break;
+        case 'D':  opcode = Opcodes.DLOAD;  break;
+        case 'L':  opcode = Opcodes.ALOAD;  break;
+        default:
+            throw new InternalError("unknown type: " + type);
+        }
+        mv.visitVarInsn(opcode, localsMap[index]);
+    }
+    private void emitAloadInsn(int index) {
+        emitLoadInsn('L', index);
+    }
+
+    private void emitStoreInsn(char type, int index) {
+        int opcode;
+        switch (type) {
+        case 'I':  opcode = Opcodes.ISTORE;  break;
+        case 'J':  opcode = Opcodes.LSTORE;  break;
+        case 'F':  opcode = Opcodes.FSTORE;  break;
+        case 'D':  opcode = Opcodes.DSTORE;  break;
+        case 'L':  opcode = Opcodes.ASTORE;  break;
+        default:
+            throw new InternalError("unknown type: " + type);
+        }
+        mv.visitVarInsn(opcode, localsMap[index]);
+    }
+    private void emitAstoreInsn(int index) {
+        emitStoreInsn('L', index);
+    }
+
+    /**
+     * Emit a boxing call.
+     *
+     * @param type primitive type class to box.
+     */
+    private void emitBoxing(Class<?> type) {
+        Wrapper wrapper = Wrapper.forPrimitiveType(type);
+        String owner = "java/lang/" + wrapper.wrapperType().getSimpleName();
+        String name  = "valueOf";
+        String desc  = "(" + wrapper.basicTypeChar() + ")L" + owner + ";";
+        mv.visitMethodInsn(Opcodes.INVOKESTATIC, owner, name, desc);
+    }
+
+    /**
+     * Emit an unboxing call (plus preceding checkcast).
+     *
+     * @param type wrapper type class to unbox.
+     */
+    private void emitUnboxing(Class<?> type) {
+        Wrapper wrapper = Wrapper.forWrapperType(type);
+        String owner = "java/lang/" + wrapper.wrapperType().getSimpleName();
+        String name  = wrapper.primitiveSimpleName() + "Value";
+        String desc  = "()" + wrapper.basicTypeChar();
+        mv.visitTypeInsn(Opcodes.CHECKCAST, owner);
+        mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, owner, name, desc);
+    }
+
+    /**
+     * Emit an implicit conversion.
+     *
+     * @param ptype type of value present on stack
+     * @param pclass type of value required on stack
+     */
+    private void emitImplicitConversion(char ptype, Class<?> pclass) {
+        switch (ptype) {
+        case 'L':
+            if (VerifyType.isNullConversion(Object.class, pclass))
+                return;
+            if (isStaticallyNameable(pclass)) {
+                mv.visitTypeInsn(Opcodes.CHECKCAST, getInternalName(pclass));
+            } else {
+                mv.visitLdcInsn(constantPlaceholder(pclass));
+                mv.visitTypeInsn(Opcodes.CHECKCAST, CLS);
+                mv.visitInsn(Opcodes.SWAP);
+                mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, CLS, "cast", LL_SIG);
+                if (pclass.isArray())
+                    mv.visitTypeInsn(Opcodes.CHECKCAST, OBJARY);
+            }
+            return;
+        case 'I':
+            if (!VerifyType.isNullConversion(int.class, pclass))
+                emitPrimCast(ptype, Wrapper.basicTypeChar(pclass));
+            return;
+        case 'J':
+            assert(pclass == long.class);
+            return;
+        case 'F':
+            assert(pclass == float.class);
+            return;
+        case 'D':
+            assert(pclass == double.class);
+            return;
+        }
+        throw new InternalError("bad implicit conversion: tc="+ptype+": "+pclass);
+    }
+
+    /**
+     * Emits an actual return instruction conforming to the given return type.
+     */
+    private void emitReturnInsn(Class<?> type) {
+        int opcode;
+        switch (Wrapper.basicTypeChar(type)) {
+        case 'I':  opcode = Opcodes.IRETURN;  break;
+        case 'J':  opcode = Opcodes.LRETURN;  break;
+        case 'F':  opcode = Opcodes.FRETURN;  break;
+        case 'D':  opcode = Opcodes.DRETURN;  break;
+        case 'L':  opcode = Opcodes.ARETURN;  break;
+        case 'V':  opcode = Opcodes.RETURN;   break;
+        default:
+            throw new InternalError("unknown return type: " + type);
+        }
+        mv.visitInsn(opcode);
+    }
+
+    private static String getInternalName(Class<?> c) {
+        assert(VerifyAccess.isTypeVisible(c, Object.class));
+        return c.getName().replace('.', '/');
+    }
+
+    /**
+     * Generate customized bytecode for a given LambdaForm.
+     *
+     * @param form
+     * @param invokerType
+     * @return
+     */
+    static MemberName generateCustomizedCode(LambdaForm form, MethodType invokerType) {
+        InvokerBytecodeGenerator g = new InvokerBytecodeGenerator("MH", form, invokerType);
+        return g.loadMethod(g.generateCustomizedCodeBytes());
+    }
+
+    /**
+     * Generate an invoker method for the passed {@link LambdaForm}.
+     */
+    private byte[] generateCustomizedCodeBytes() {
+        classFilePrologue();
+
+        // Suppress this method in backtraces displayed to the user.
+        mv.visitAnnotation("Ljava/lang/invoke/LambdaForm$Hidden;", true);
+
+        // Mark this method as a compiled LambdaForm
+        mv.visitAnnotation("Ljava/lang/invoke/LambdaForm$Compiled;", true);
+
+        // Force inlining of this invoker method.
+        mv.visitAnnotation("Ljava/lang/invoke/ForceInline;", true);
+
+        // iterate over the form's names, generating bytecode instructions for each
+        // start iterating at the first name following the arguments
+        for (int i = lambdaForm.arity; i < lambdaForm.names.length; i++) {
+            Name name = lambdaForm.names[i];
+            MemberName member = name.function.member();
+
+            if (isSelectAlternative(member)) {
+                // selectAlternative idiom
+                // FIXME: make sure this idiom is really present!
+                emitSelectAlternative(name, lambdaForm.names[i + 1]);
+                i++;  // skip MH.invokeBasic of the selectAlternative result
+            } else if (isStaticallyInvocable(member)) {
+                emitStaticInvoke(member, name);
+            } else {
+                emitInvoke(name);
+            }
+
+            // store the result from evaluating to the target name in a local if required
+            // (if this is the last value, i.e., the one that is going to be returned,
+            // avoid store/load/return and just return)
+            if (i == lambdaForm.names.length - 1 && i == lambdaForm.result) {
+                // return value - do nothing
+            } else if (name.type != 'V') {
+                // non-void: actually assign
+                emitStoreInsn(name.type, name.index());
+            }
+        }
+
+        // return statement
+        emitReturn();
+
+        classFileEpilogue();
+        bogusMethod(lambdaForm);
+
+        final byte[] classFile = cw.toByteArray();
+        maybeDump(className, classFile);
+        return classFile;
+    }
+
+    /**
+     * Emit an invoke for the given name.
+     *
+     * @param name
+     */
+    void emitInvoke(Name name) {
+        if (true) {
+            // push receiver
+            MethodHandle target = name.function.resolvedHandle;
+            assert(target != null) : name.exprString();
+            mv.visitLdcInsn(constantPlaceholder(target));
+            mv.visitTypeInsn(Opcodes.CHECKCAST, MH);
+        } else {
+            // load receiver
+            emitAloadInsn(0);
+            mv.visitTypeInsn(Opcodes.CHECKCAST, MH);
+            mv.visitFieldInsn(Opcodes.GETFIELD, MH, "form", LF_SIG);
+            mv.visitFieldInsn(Opcodes.GETFIELD, LF, "names", LFN_SIG);
+            // TODO more to come
+        }
+
+        // push arguments
+        for (int i = 0; i < name.arguments.length; i++) {
+            emitPushArgument(name, i);
+        }
+
+        // invocation
+        MethodType type = name.function.methodType();
+        mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, MH, "invokeBasic", type.basicType().toMethodDescriptorString());
+    }
+
+    static private Class<?>[] STATICALLY_INVOCABLE_PACKAGES = {
+        // Sample classes from each package we are willing to bind to statically:
+        java.lang.Object.class,
+        java.util.Arrays.class,
+        sun.misc.Unsafe.class
+        //MethodHandle.class already covered
+    };
+
+    static boolean isStaticallyInvocable(MemberName member) {
+        if (member == null)  return false;
+        if (member.isConstructor())  return false;
+        Class<?> cls = member.getDeclaringClass();
+        if (cls.isArray() || cls.isPrimitive())
+            return false;  // FIXME
+        if (cls.isAnonymousClass() || cls.isLocalClass())
+            return false;  // inner class of some sort
+        if (cls.getClassLoader() != MethodHandle.class.getClassLoader())
+            return false;  // not on BCP
+        if (!member.isPrivate() && VerifyAccess.isSamePackage(MethodHandle.class, cls))
+            return true;   // in java.lang.invoke package
+        if (member.isPublic() && isStaticallyNameable(cls))
+            return true;
+        return false;
+    }
+
+    static boolean isStaticallyNameable(Class<?> cls) {
+        while (cls.isArray())
+            cls = cls.getComponentType();
+        if (cls.isPrimitive())
+            return true;  // int[].class, for example
+        if (cls.getClassLoader() != Object.class.getClassLoader())
+            return false;
+        if (VerifyAccess.isSamePackage(MethodHandle.class, cls))
+            return true;
+        if (!Modifier.isPublic(cls.getModifiers()))
+            return false;
+        for (Class<?> pkgcls : STATICALLY_INVOCABLE_PACKAGES) {
+            if (VerifyAccess.isSamePackage(pkgcls, cls))
+                return true;
+        }
+        return false;
+    }
+
+    /**
+     * Emit an invoke for the given name, using the MemberName directly.
+     *
+     * @param name
+     */
+    void emitStaticInvoke(MemberName member, Name name) {
+        assert(member.equals(name.function.member()));
+        String cname = getInternalName(member.getDeclaringClass());
+        String mname = member.getName();
+        String mtype;
+        byte refKind = member.getReferenceKind();
+        if (refKind == REF_invokeSpecial) {
+            // in order to pass the verifier, we need to convert this to invokevirtual in all cases
+            assert(member.canBeStaticallyBound()) : member;
+            refKind = REF_invokeVirtual;
+        }
+
+        // push arguments
+        for (int i = 0; i < name.arguments.length; i++) {
+            emitPushArgument(name, i);
+        }
+
+        // invocation
+        if (member.isMethod()) {
+            mtype = member.getMethodType().toMethodDescriptorString();
+            mv.visitMethodInsn(refKindOpcode(refKind), cname, mname, mtype);
+        } else {
+            mtype = MethodType.toFieldDescriptorString(member.getFieldType());
+            mv.visitFieldInsn(refKindOpcode(refKind), cname, mname, mtype);
+        }
+    }
+    int refKindOpcode(byte refKind) {
+        switch (refKind) {
+        case REF_invokeVirtual:      return Opcodes.INVOKEVIRTUAL;
+        case REF_invokeStatic:       return Opcodes.INVOKESTATIC;
+        case REF_invokeSpecial:      return Opcodes.INVOKESPECIAL;
+        case REF_invokeInterface:    return Opcodes.INVOKEINTERFACE;
+        case REF_getField:           return Opcodes.GETFIELD;
+        case REF_putField:           return Opcodes.PUTFIELD;
+        case REF_getStatic:          return Opcodes.GETSTATIC;
+        case REF_putStatic:          return Opcodes.PUTSTATIC;
+        }
+        throw new InternalError("refKind="+refKind);
+    }
+
+    /**
+     * Check if MemberName is a call to MethodHandleImpl.selectAlternative.
+     *
+     * @param member
+     * @return true if member is a call to MethodHandleImpl.selectAlternative
+     */
+    private boolean isSelectAlternative(MemberName member) {
+        return member != null &&
+               member.getDeclaringClass() == MethodHandleImpl.class &&
+               member.getName().equals("selectAlternative");
+    }
+
+    /**
+     * Emit bytecode for the selectAlternative idiom.
+     *
+     * The pattern looks like (Cf. MethodHandleImpl.makeGuardWithTest):
+     *
+     *   Lambda(a0:L,a1:I)=>{
+     *     t2:I=foo.test(a1:I);
+     *     t3:L=MethodHandleImpl.selectAlternative(t2:I,(MethodHandle(int)int),(MethodHandle(int)int));
+     *     t4:I=MethodHandle.invokeBasic(t3:L,a1:I);t4:I}
+     *
+     * @param selectAlternativeName
+     * @param invokeBasicName
+     */
+    private void emitSelectAlternative(Name selectAlternativeName, Name invokeBasicName) {
+        MethodType type = selectAlternativeName.function.methodType();
+
+        Name receiver = (Name) invokeBasicName.arguments[0];
+
+        Label L_fallback = new Label();
+        Label L_done     = new Label();
+
+        // load test result
+        emitPushArgument(selectAlternativeName, 0);
+        mv.visitInsn(Opcodes.ICONST_1);
+
+        // if_icmpne L_fallback
+        mv.visitJumpInsn(Opcodes.IF_ICMPNE, L_fallback);
+
+        // invoke selectAlternativeName.arguments[1]
+        MethodHandle target = (MethodHandle) selectAlternativeName.arguments[1];
+        emitPushArgument(selectAlternativeName, 1);  // get 2nd argument of selectAlternative
+        emitAstoreInsn(receiver.index());  // store the MH in the receiver slot
+        emitInvoke(invokeBasicName);
+
+        // goto L_done
+        mv.visitJumpInsn(Opcodes.GOTO, L_done);
+
+        // L_fallback:
+        mv.visitLabel(L_fallback);
+
+        // invoke selectAlternativeName.arguments[2]
+        MethodHandle fallback = (MethodHandle) selectAlternativeName.arguments[2];
+        emitPushArgument(selectAlternativeName, 2);  // get 3rd argument of selectAlternative
+        emitAstoreInsn(receiver.index());  // store the MH in the receiver slot
+        emitInvoke(invokeBasicName);
+
+        // L_done:
+        mv.visitLabel(L_done);
+    }
+
+    /**
+     *
+     * @param name
+     * @param paramIndex
+     */
+    private void emitPushArgument(Name name, int paramIndex) {
+        Object arg = name.arguments[paramIndex];
+        char ptype = name.function.parameterType(paramIndex);
+        MethodType mtype = name.function.methodType();
+        if (arg instanceof Name) {
+            Name n = (Name) arg;
+            emitLoadInsn(n.type, n.index());
+            emitImplicitConversion(n.type, mtype.parameterType(paramIndex));
+        } else if ((arg == null || arg instanceof String) && ptype == 'L') {
+            emitConst(arg);
+        } else {
+            if (Wrapper.isWrapperType(arg.getClass()) && ptype != 'L') {
+                emitConst(arg);
+            } else {
+                mv.visitLdcInsn(constantPlaceholder(arg));
+                emitImplicitConversion('L', mtype.parameterType(paramIndex));
+            }
+        }
+    }
+
+    /**
+     * Emits a return statement from a LF invoker. If required, the result type is cast to the correct return type.
+     */
+    private void emitReturn() {
+        // return statement
+        if (lambdaForm.result == -1) {
+            // void
+            mv.visitInsn(Opcodes.RETURN);
+        } else {
+            LambdaForm.Name rn = lambdaForm.names[lambdaForm.result];
+            char rtype = Wrapper.basicTypeChar(invokerType.returnType());
+
+            // put return value on the stack if it is not already there
+            if (lambdaForm.result != lambdaForm.names.length - 1) {
+                emitLoadInsn(rn.type, lambdaForm.result);
+            }
+
+            // potentially generate cast
+            // rtype is the return type of the invoker - generated code must conform to this
+            // rn.type is the type of the result Name in the LF
+            if (rtype != rn.type) {
+                // need cast
+                if (rtype == 'L') {
+                    // possibly cast the primitive to the correct type for boxing
+                    char boxedType = Wrapper.forWrapperType(invokerType.returnType()).basicTypeChar();
+                    if (boxedType != rn.type) {
+                        emitPrimCast(rn.type, boxedType);
+                    }
+                    // cast primitive to reference ("boxing")
+                    emitBoxing(invokerType.returnType());
+                } else {
+                    // to-primitive cast
+                    if (rn.type != 'L') {
+                        // prim-to-prim cast
+                        emitPrimCast(rn.type, rtype);
+                    } else {
+                        // ref-to-prim cast ("unboxing")
+                        throw new InternalError("no ref-to-prim (unboxing) casts supported right now");
+                    }
+                }
+            }
+
+            // generate actual return statement
+            emitReturnInsn(invokerType.returnType());
+        }
+    }
+
+    /**
+     * Emit a type conversion bytecode casting from "from" to "to".
+     */
+    private void emitPrimCast(char from, char to) {
+        // Here's how.
+        // -   indicates forbidden
+        // <-> indicates implicit
+        //      to ----> boolean  byte     short    char     int      long     float    double
+        // from boolean    <->        -        -        -        -        -        -        -
+        //      byte        -       <->       i2s      i2c      <->      i2l      i2f      i2d
+        //      short       -       i2b       <->      i2c      <->      i2l      i2f      i2d
+        //      char        -       i2b       i2s      <->      <->      i2l      i2f      i2d
+        //      int         -       i2b       i2s      i2c      <->      i2l      i2f      i2d
+        //      long        -     l2i,i2b   l2i,i2s  l2i,i2c    l2i      <->      l2f      l2d
+        //      float       -     f2i,i2b   f2i,i2s  f2i,i2c    f2i      f2l      <->      f2d
+        //      double      -     d2i,i2b   d2i,i2s  d2i,i2c    d2i      d2l      d2f      <->
+        if (from == to) {
+            // no cast required, should be dead code anyway
+            return;
+        }
+        Wrapper wfrom = Wrapper.forBasicType(from);
+        Wrapper wto   = Wrapper.forBasicType(to);
+        if (wfrom.isSubwordOrInt()) {
+            // cast from {byte,short,char,int} to anything
+            emitI2X(to);
+        } else {
+            // cast from {long,float,double} to anything
+            if (wto.isSubwordOrInt()) {
+                // cast to {byte,short,char,int}
+                emitX2I(from);
+                if (wto.bitWidth() < 32) {
+                    // targets other than int require another conversion
+                    emitI2X(to);
+                }
+            } else {
+                // cast to {long,float,double} - this is verbose
+                boolean error = false;
+                switch (from) {
+                case 'J':
+                         if (to == 'F') { mv.visitInsn(Opcodes.L2F); }
+                    else if (to == 'D') { mv.visitInsn(Opcodes.L2D); }
+                    else error = true;
+                    break;
+                case 'F':
+                         if (to == 'J') { mv.visitInsn(Opcodes.F2L); }
+                    else if (to == 'D') { mv.visitInsn(Opcodes.F2D); }
+                    else error = true;
+                    break;
+                case 'D':
+                         if (to == 'J') { mv.visitInsn(Opcodes.D2L); }
+                    else if (to == 'F') { mv.visitInsn(Opcodes.D2F); }
+                    else error = true;
+                    break;
+                default:
+                    error = true;
+                    break;
+                }
+                if (error) {
+                    throw new IllegalStateException("unhandled prim cast: " + from + "2" + to);
+                }
+            }
+        }
+    }
+
+    private void emitI2X(char type) {
+        switch (type) {
+        case 'B':  mv.visitInsn(Opcodes.I2B);  break;
+        case 'S':  mv.visitInsn(Opcodes.I2S);  break;
+        case 'C':  mv.visitInsn(Opcodes.I2C);  break;
+        case 'I':  /* naught */                break;
+        case 'J':  mv.visitInsn(Opcodes.I2L);  break;
+        case 'F':  mv.visitInsn(Opcodes.I2F);  break;
+        case 'D':  mv.visitInsn(Opcodes.I2D);  break;
+        case 'Z':
+            // For compatibility with ValueConversions and explicitCastArguments:
+            mv.visitInsn(Opcodes.ICONST_1);
+            mv.visitInsn(Opcodes.IAND);
+            break;
+        default:   throw new InternalError("unknown type: " + type);
+        }
+    }
+
+    private void emitX2I(char type) {
+        switch (type) {
+        case 'J':  mv.visitInsn(Opcodes.L2I);  break;
+        case 'F':  mv.visitInsn(Opcodes.F2I);  break;
+        case 'D':  mv.visitInsn(Opcodes.D2I);  break;
+        default:   throw new InternalError("unknown type: " + type);
+        }
+    }
+
+    private static String basicTypeCharSignature(String prefix, MethodType type) {
+        StringBuilder buf = new StringBuilder(prefix);
+        for (Class<?> ptype : type.parameterList())
+            buf.append(Wrapper.forBasicType(ptype).basicTypeChar());
+        buf.append('_').append(Wrapper.forBasicType(type.returnType()).basicTypeChar());
+        return buf.toString();
+    }
+
+    /**
+     * Generate bytecode for a LambdaForm.vmentry which calls interpretWithArguments.
+     *
+     * @param sig
+     * @return
+     */
+    static MemberName generateLambdaFormInterpreterEntryPoint(String sig) {
+        assert(LambdaForm.isValidSignature(sig));
+        //System.out.println("generateExactInvoker "+sig);
+        // compute method type
+        // first parameter and return type
+        char tret = LambdaForm.signatureReturn(sig);
+        MethodType type = MethodType.methodType(LambdaForm.typeClass(tret), MethodHandle.class);
+        // other parameter types
+        int arity = LambdaForm.signatureArity(sig);
+        for (int i = 1; i < arity; i++) {
+            type = type.appendParameterTypes(LambdaForm.typeClass(sig.charAt(i)));
+        }
+        InvokerBytecodeGenerator g = new InvokerBytecodeGenerator("LFI", "interpret_"+tret, type);
+        return g.loadMethod(g.generateLambdaFormInterpreterEntryPointBytes());
+    }
+
+    private byte[] generateLambdaFormInterpreterEntryPointBytes() {
+        classFilePrologue();
+
+        // Suppress this method in backtraces displayed to the user.
+        mv.visitAnnotation("Ljava/lang/invoke/LambdaForm$Hidden;", true);
+
+        // Don't inline the interpreter entry.
+        mv.visitAnnotation("Ljava/lang/invoke/DontInline;", true);
+
+        // create parameter array
+        emitIconstInsn(invokerType.parameterCount());
+        mv.visitTypeInsn(Opcodes.ANEWARRAY, "java/lang/Object");
+
+        // fill parameter array
+        for (int i = 0; i < invokerType.parameterCount(); i++) {
+            Class<?> ptype = invokerType.parameterType(i);
+            mv.visitInsn(Opcodes.DUP);
+            emitIconstInsn(i);
+            emitLoadInsn(Wrapper.basicTypeChar(ptype), i);
+            // box if primitive type
+            if (ptype.isPrimitive()) {
+                emitBoxing(ptype);
+            }
+            mv.visitInsn(Opcodes.AASTORE);
+        }
+        // invoke
+        emitAloadInsn(0);
+        mv.visitFieldInsn(Opcodes.GETFIELD, MH, "form", "Ljava/lang/invoke/LambdaForm;");
+        mv.visitInsn(Opcodes.SWAP);  // swap form and array; avoid local variable
+        mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, LF, "interpretWithArguments", "([Ljava/lang/Object;)Ljava/lang/Object;");
+
+        // maybe unbox
+        Class<?> rtype = invokerType.returnType();
+        if (rtype.isPrimitive() && rtype != void.class) {
+            emitUnboxing(Wrapper.asWrapperType(rtype));
+        }
+
+        // return statement
+        emitReturnInsn(rtype);
+
+        classFileEpilogue();
+        bogusMethod(invokerType);
+
+        final byte[] classFile = cw.toByteArray();
+        maybeDump(className, classFile);
+        return classFile;
+    }
+
+    /**
+     * Generate bytecode for a NamedFunction invoker.
+     *
+     * @param srcType
+     * @param dstType
+     * @return
+     */
+    static MemberName generateNamedFunctionInvoker(MethodTypeForm typeForm) {
+        MethodType invokerType = LambdaForm.NamedFunction.INVOKER_METHOD_TYPE;
+        String invokerName = basicTypeCharSignature("invoke_", typeForm.erasedType());
+        InvokerBytecodeGenerator g = new InvokerBytecodeGenerator("NFI", invokerName, invokerType);
+        return g.loadMethod(g.generateNamedFunctionInvokerImpl(typeForm));
+    }
+
+    static int nfi = 0;
+
+    private byte[] generateNamedFunctionInvokerImpl(MethodTypeForm typeForm) {
+        MethodType dstType = typeForm.erasedType();
+        classFilePrologue();
+
+        // Suppress this method in backtraces displayed to the user.
+        mv.visitAnnotation("Ljava/lang/invoke/LambdaForm$Hidden;", true);
+
+        // Force inlining of this invoker method.
+        mv.visitAnnotation("Ljava/lang/invoke/ForceInline;", true);
+
+        // Load receiver
+        emitAloadInsn(0);
+
+        // Load arguments from array
+        for (int i = 0; i < dstType.parameterCount(); i++) {
+            emitAloadInsn(1);
+            emitIconstInsn(i);
+            mv.visitInsn(Opcodes.AALOAD);
+
+            // Maybe unbox
+            Class<?> dptype = dstType.parameterType(i);
+            if (dptype.isPrimitive()) {
+                Class<?> sptype = dstType.basicType().wrap().parameterType(i);
+                Wrapper dstWrapper = Wrapper.forBasicType(dptype);
+                Wrapper srcWrapper = dstWrapper.isSubwordOrInt() ? Wrapper.INT : dstWrapper;  // narrow subword from int
+                emitUnboxing(srcWrapper.wrapperType());
+                emitPrimCast(srcWrapper.basicTypeChar(), dstWrapper.basicTypeChar());
+            }
+        }
+
+        // Invoke
+        String targetDesc = dstType.basicType().toMethodDescriptorString();
+        mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, MH, "invokeBasic", targetDesc);
+
+        // Box primitive types
+        Class<?> rtype = dstType.returnType();
+        if (rtype != void.class && rtype.isPrimitive()) {
+            Wrapper srcWrapper = Wrapper.forBasicType(rtype);
+            Wrapper dstWrapper = srcWrapper.isSubwordOrInt() ? Wrapper.INT : srcWrapper;  // widen subword to int
+            // boolean casts not allowed
+            emitPrimCast(srcWrapper.basicTypeChar(), dstWrapper.basicTypeChar());
+            emitBoxing(dstWrapper.primitiveType());
+        }
+
+        // If the return type is void we return a null reference.
+        if (rtype == void.class) {
+            mv.visitInsn(Opcodes.ACONST_NULL);
+        }
+        emitReturnInsn(Object.class);  // NOTE: NamedFunction invokers always return a reference value.
+
+        classFileEpilogue();
+        bogusMethod(dstType);
+
+        final byte[] classFile = cw.toByteArray();
+        maybeDump(className, classFile);
+        return classFile;
+    }
+
+    /**
+     * Emit a bogus method that just loads some string constants. This is to get the constants into the constant pool
+     * for debugging purposes.
+     */
+    private void bogusMethod(Object... os) {
+        if (DUMP_CLASS_FILES) {
+            mv = cw.visitMethod(Opcodes.ACC_STATIC, "dummy", "()V", null, null);
+            for (Object o : os) {
+                mv.visitLdcInsn(o.toString());
+                mv.visitInsn(Opcodes.POP);
+            }
+            mv.visitInsn(Opcodes.RETURN);
+            mv.visitMaxs(0, 0);
+            mv.visitEnd();
+        }
+    }
+}
--- a/src/share/classes/java/lang/invoke/Invokers.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/lang/invoke/Invokers.java	Fri Jun 21 19:11:42 2013 -0700
@@ -25,8 +25,12 @@
 
 package java.lang.invoke;
 
+import java.util.Arrays;
 import sun.invoke.empty.Empty;
+import static java.lang.invoke.MethodHandleStatics.*;
+import static java.lang.invoke.MethodHandleNatives.Constants.*;
 import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
+import static java.lang.invoke.LambdaForm.*;
 
 /**
  * Construction and caching of often-used invokers.
@@ -36,11 +40,15 @@
     // exact type (sans leading taget MH) for the outgoing call
     private final MethodType targetType;
 
+    // FIXME: Get rid of the invokers that are not useful.
+
     // exact invoker for the outgoing call
     private /*lazy*/ MethodHandle exactInvoker;
 
     // erased (partially untyped but with primitives) invoker for the outgoing call
+    // FIXME: get rid of
     private /*lazy*/ MethodHandle erasedInvoker;
+    // FIXME: get rid of
     /*lazy*/ MethodHandle erasedInvokerWithDrops;  // for InvokeGeneric
 
     // general invoker for the outgoing call
@@ -63,14 +71,23 @@
         this.spreadInvokers = new MethodHandle[targetType.parameterCount()+1];
     }
 
-    /*non-public*/ static MethodType invokerType(MethodType targetType) {
-        return targetType.insertParameterTypes(0, MethodHandle.class);
-    }
-
     /*non-public*/ MethodHandle exactInvoker() {
         MethodHandle invoker = exactInvoker;
         if (invoker != null)  return invoker;
-        invoker = lookupInvoker("invokeExact");
+        MethodType mtype = targetType;
+        MethodType invokerType = mtype.invokerType();
+        LambdaForm lform;
+        final int MTYPE_ARG_APPENDED = 1;  // argument count for appended mtype value
+        if (mtype.parameterSlotCount() <= MethodType.MAX_MH_INVOKER_ARITY - MTYPE_ARG_APPENDED) {
+            lform = invokeForm(mtype, false, MethodTypeForm.LF_EX_INVOKER);
+            invoker = BoundMethodHandle.bindSingle(invokerType, lform, mtype);
+        } else {
+            // At maximum arity, we cannot afford an extra mtype argument,
+            // so build a fully customized (non-cached) invoker form.
+            lform = invokeForm(mtype, true, MethodTypeForm.LF_EX_INVOKER);
+            invoker = SimpleMethodHandle.make(invokerType, lform);
+        }
+        assert(checkInvoker(invoker));
         exactInvoker = invoker;
         return invoker;
     }
@@ -78,29 +95,61 @@
     /*non-public*/ MethodHandle generalInvoker() {
         MethodHandle invoker = generalInvoker;
         if (invoker != null)  return invoker;
-        invoker = lookupInvoker("invoke");
+        MethodType mtype = targetType;
+        MethodType invokerType = mtype.invokerType();
+        LambdaForm lform;
+        final int MTYPE_ARG_APPENDED = 1;  // argument count for appended mtype value
+        assert(GENERIC_INVOKER_SLOP >= MTYPE_ARG_APPENDED);
+        if (mtype.parameterSlotCount() <= MethodType.MAX_MH_INVOKER_ARITY - GENERIC_INVOKER_SLOP) {
+            prepareForGenericCall(mtype);
+            lform = invokeForm(mtype, false, MethodTypeForm.LF_GEN_INVOKER);
+            invoker = BoundMethodHandle.bindSingle(invokerType, lform, mtype);
+        } else {
+            // At maximum arity, we cannot afford an extra mtype argument,
+            // so build a fully customized (non-cached) invoker form.
+            lform = invokeForm(mtype, true, MethodTypeForm.LF_GEN_INVOKER);
+            invoker = SimpleMethodHandle.make(invokerType, lform);
+        }
+        assert(checkInvoker(invoker));
         generalInvoker = invoker;
         return invoker;
     }
 
-    private MethodHandle lookupInvoker(String name) {
-        MethodHandle invoker;
-        try {
-            invoker = IMPL_LOOKUP.findVirtual(MethodHandle.class, name, targetType);
-        } catch (ReflectiveOperationException ex) {
-            throw new InternalError("JVM cannot find invoker for "+targetType);
-        }
-        assert(invokerType(targetType) == invoker.type());
-        assert(!invoker.isVarargsCollector());
+    /*non-public*/ MethodHandle makeBasicInvoker() {
+        MethodHandle invoker = DirectMethodHandle.make(invokeBasicMethod(targetType));
+        assert(targetType == targetType.basicType());
+        // Note:  This is not cached here.  It is cached by the calling MethodTypeForm.
+        assert(checkInvoker(invoker));
         return invoker;
     }
 
+    static MemberName invokeBasicMethod(MethodType type) {
+        type = type.basicType();
+        String name = "invokeBasic";
+        try {
+            //Lookup.findVirtual(MethodHandle.class, name, type);
+            return IMPL_LOOKUP.resolveOrFail(REF_invokeVirtual, MethodHandle.class, name, type);
+        } catch (ReflectiveOperationException ex) {
+            throw newInternalError("JVM cannot find invoker for "+type, ex);
+        }
+    }
+
+    private boolean checkInvoker(MethodHandle invoker) {
+        assert(targetType.invokerType().equals(invoker.type()))
+                : java.util.Arrays.asList(targetType, targetType.invokerType(), invoker);
+        assert(invoker.internalMemberName() == null ||
+               invoker.internalMemberName().getMethodType().equals(targetType));
+        assert(!invoker.isVarargsCollector());
+        return true;
+    }
+
+    // FIXME: get rid of
     /*non-public*/ MethodHandle erasedInvoker() {
         MethodHandle xinvoker = exactInvoker();
         MethodHandle invoker = erasedInvoker;
         if (invoker != null)  return invoker;
         MethodType erasedType = targetType.erase();
-        invoker = xinvoker.asType(invokerType(erasedType));
+        invoker = xinvoker.asType(erasedType.invokerType());
         erasedInvoker = invoker;
         return invoker;
     }
@@ -108,9 +157,31 @@
     /*non-public*/ MethodHandle spreadInvoker(int leadingArgCount) {
         MethodHandle vaInvoker = spreadInvokers[leadingArgCount];
         if (vaInvoker != null)  return vaInvoker;
-        MethodHandle gInvoker = generalInvoker();
         int spreadArgCount = targetType.parameterCount() - leadingArgCount;
-        vaInvoker = gInvoker.asSpreader(Object[].class, spreadArgCount);
+        MethodType spreadInvokerType = targetType
+            .replaceParameterTypes(leadingArgCount, targetType.parameterCount(), Object[].class);
+        if (targetType.parameterSlotCount() <= MethodType.MAX_MH_INVOKER_ARITY) {
+            // Factor sinvoker.invoke(mh, a) into ginvoker.asSpreader().invoke(mh, a)
+            // where ginvoker.invoke(mh, a*) => mh.invoke(a*).
+            MethodHandle genInvoker = generalInvoker();
+            vaInvoker = genInvoker.asSpreader(Object[].class, spreadArgCount);
+        } else {
+            // Cannot build a general invoker here of type ginvoker.invoke(mh, a*[254]).
+            // Instead, factor sinvoker.invoke(mh, a) into ainvoker.invoke(filter(mh), a)
+            // where filter(mh) == mh.asSpreader(Object[], spreadArgCount)
+            MethodHandle arrayInvoker = MethodHandles.exactInvoker(spreadInvokerType);
+            MethodHandle makeSpreader;
+            try {
+                makeSpreader = IMPL_LOOKUP
+                    .findVirtual(MethodHandle.class, "asSpreader",
+                        MethodType.methodType(MethodHandle.class, Class.class, int.class));
+            } catch (ReflectiveOperationException ex) {
+                throw newInternalError(ex);
+            }
+            makeSpreader = MethodHandles.insertArguments(makeSpreader, 1, Object[].class, spreadArgCount);
+            vaInvoker = MethodHandles.filterArgument(arrayInvoker, 0, makeSpreader);
+        }
+        assert(vaInvoker.type().equals(spreadInvokerType.invokerType()));
         spreadInvokers[leadingArgCount] = vaInvoker;
         return vaInvoker;
     }
@@ -118,7 +189,7 @@
     /*non-public*/ MethodHandle varargsInvoker() {
         MethodHandle vaInvoker = varargsInvoker;
         if (vaInvoker != null)  return vaInvoker;
-        vaInvoker = spreadInvoker(0).asType(invokerType(MethodType.genericMethodType(0, true)));
+        vaInvoker = spreadInvoker(0).asType(MethodType.genericMethodType(0, true).invokerType());
         varargsInvoker = vaInvoker;
         return vaInvoker;
     }
@@ -137,16 +208,18 @@
             uninitializedCallSite = invoker;
             return invoker;
         }
-        if (THROW_UCS == null) {
+        invoker = THROW_UCS;
+        if (invoker == null) {
             try {
-                THROW_UCS = IMPL_LOOKUP
+                THROW_UCS = invoker = IMPL_LOOKUP
                     .findStatic(CallSite.class, "uninitializedCallSite",
                                 MethodType.methodType(Empty.class));
             } catch (ReflectiveOperationException ex) {
-                throw new RuntimeException(ex);
+                throw newInternalError(ex);
             }
         }
-        invoker = AdapterMethodHandle.makeRetypeRaw(targetType, THROW_UCS);
+        invoker = MethodHandles.explicitCastArguments(invoker, MethodType.methodType(targetType.returnType()));
+        invoker = invoker.dropArguments(targetType, 0, targetType.parameterCount());
         assert(invoker.type().equals(targetType));
         uninitializedCallSite = invoker;
         return invoker;
@@ -155,4 +228,236 @@
     public String toString() {
         return "Invokers"+targetType;
     }
+
+    static MemberName exactInvokerMethod(MethodType mtype, Object[] appendixResult) {
+        LambdaForm lform;
+        final int MTYPE_ARG_APPENDED = 1;  // argument count for appended mtype value
+        if (mtype.parameterSlotCount() <= MethodType.MAX_MH_ARITY - MTYPE_ARG_APPENDED) {
+            lform = invokeForm(mtype, false, MethodTypeForm.LF_EX_LINKER);
+            appendixResult[0] = mtype;
+        } else {
+            lform = invokeForm(mtype, true, MethodTypeForm.LF_EX_LINKER);
+        }
+        return lform.vmentry;
+    }
+
+    static MemberName genericInvokerMethod(MethodType mtype, Object[] appendixResult) {
+        LambdaForm lform;
+        final int MTYPE_ARG_APPENDED = 1;  // argument count for appended mtype value
+        if (mtype.parameterSlotCount() <= MethodType.MAX_MH_ARITY - (MTYPE_ARG_APPENDED + GENERIC_INVOKER_SLOP)) {
+            lform = invokeForm(mtype, false, MethodTypeForm.LF_GEN_LINKER);
+            appendixResult[0] = mtype;
+            prepareForGenericCall(mtype);
+        } else {
+            lform = invokeForm(mtype, true, MethodTypeForm.LF_GEN_LINKER);
+        }
+        return lform.vmentry;
+    }
+
+    private static LambdaForm invokeForm(MethodType mtype, boolean customized, int which) {
+        boolean isCached;
+        if (!customized) {
+            mtype = mtype.basicType();  // normalize Z to I, String to Object, etc.
+            isCached = true;
+        } else {
+            isCached = false;  // maybe cache if mtype == mtype.basicType()
+        }
+        boolean isLinker, isGeneric;
+        String debugName;
+        switch (which) {
+        case MethodTypeForm.LF_EX_LINKER:   isLinker = true;  isGeneric = false; debugName = "invokeExact_MT"; break;
+        case MethodTypeForm.LF_EX_INVOKER:  isLinker = false; isGeneric = false; debugName = "exactInvoker"; break;
+        case MethodTypeForm.LF_GEN_LINKER:  isLinker = true;  isGeneric = true;  debugName = "invoke_MT"; break;
+        case MethodTypeForm.LF_GEN_INVOKER: isLinker = false; isGeneric = true;  debugName = "invoker"; break;
+        default: throw new InternalError();
+        }
+        LambdaForm lform;
+        if (isCached) {
+            lform = mtype.form().cachedLambdaForm(which);
+            if (lform != null)  return lform;
+        }
+        // exactInvokerForm (Object,Object)Object
+        //   link with java.lang.invoke.MethodHandle.invokeBasic(MethodHandle,Object,Object)Object/invokeSpecial
+        final int THIS_MH      = 0;
+        final int CALL_MH      = THIS_MH + (isLinker ? 0 : 1);
+        final int ARG_BASE     = CALL_MH + 1;
+        final int OUTARG_LIMIT = ARG_BASE + mtype.parameterCount();
+        final int INARG_LIMIT  = OUTARG_LIMIT + (isLinker && !customized ? 1 : 0);
+        int nameCursor = OUTARG_LIMIT;
+        final int MTYPE_ARG    = customized ? -1 : nameCursor++;  // might be last in-argument
+        final int CHECK_TYPE   = nameCursor++;
+        final int LINKER_CALL  = nameCursor++;
+        MethodType invokerFormType = mtype.invokerType();
+        if (isLinker) {
+            if (!customized)
+                invokerFormType = invokerFormType.appendParameterTypes(MemberName.class);
+        } else {
+            invokerFormType = invokerFormType.invokerType();
+        }
+        Name[] names = arguments(nameCursor - INARG_LIMIT, invokerFormType);
+        assert(names.length == nameCursor)
+                : Arrays.asList(mtype, customized, which, nameCursor, names.length);
+        if (MTYPE_ARG >= INARG_LIMIT) {
+            assert(names[MTYPE_ARG] == null);
+            names[MTYPE_ARG] = BoundMethodHandle.getSpeciesData("L").getterName(names[THIS_MH], 0);
+            // else if isLinker, then MTYPE is passed in from the caller (e.g., the JVM)
+        }
+
+        // Make the final call.  If isGeneric, then prepend the result of type checking.
+        MethodType outCallType;
+        Object[] outArgs;
+        Object mtypeArg = (customized ? mtype : names[MTYPE_ARG]);
+        if (!isGeneric) {
+            names[CHECK_TYPE] = new Name(NF_checkExactType, names[CALL_MH], mtypeArg);
+            // mh.invokeExact(a*):R => checkExactType(mh, TYPEOF(a*:R)); mh.invokeBasic(a*)
+            outArgs = Arrays.copyOfRange(names, CALL_MH, OUTARG_LIMIT, Object[].class);
+            outCallType = mtype;
+        } else if (customized) {
+            names[CHECK_TYPE] = new Name(NF_asType, names[CALL_MH], mtypeArg);
+            // mh.invokeGeneric(a*):R =>
+            //  let mt=TYPEOF(a*:R), tmh=asType(mh, mt);
+            //    tmh.invokeBasic(a*)
+            outArgs = Arrays.copyOfRange(names, CALL_MH, OUTARG_LIMIT, Object[].class);
+            outCallType = mtype;
+        } else {
+            names[CHECK_TYPE] = new Name(NF_checkGenericType, names[CALL_MH], mtypeArg);
+            // mh.invokeGeneric(a*):R =>
+            //  let mt=TYPEOF(a*:R), gamh=checkGenericType(mh, mt);
+            //    gamh.invokeBasic(mt, mh, a*)
+            final int PREPEND_GAMH = 0, PREPEND_MT = 1, PREPEND_COUNT = 2;
+            assert(GENERIC_INVOKER_SLOP == PREPEND_COUNT);
+            outArgs = Arrays.copyOfRange(names, CALL_MH, OUTARG_LIMIT + PREPEND_COUNT, Object[].class);
+            // prepend arguments:
+            System.arraycopy(outArgs, 0, outArgs, PREPEND_COUNT, outArgs.length - PREPEND_COUNT);
+            outArgs[PREPEND_GAMH] = names[CHECK_TYPE];
+            outArgs[PREPEND_MT] = mtypeArg;
+            outCallType = mtype.insertParameterTypes(0, MethodType.class, MethodHandle.class);
+        }
+        names[LINKER_CALL] = new Name(invokeBasicMethod(outCallType), outArgs);
+        lform = new LambdaForm(debugName, INARG_LIMIT, names);
+        if (isLinker)
+            lform.compileToBytecode();  // JVM needs a real methodOop
+        if (isCached)
+            lform = mtype.form().setCachedLambdaForm(which, lform);
+        return lform;
+    }
+    private static final int GENERIC_INVOKER_SLOP = 2;  // used elsewhere to avoid arity problems
+
+    /*non-public*/ static
+    WrongMethodTypeException newWrongMethodTypeException(MethodType actual, MethodType expected) {
+        // FIXME: merge with JVM logic for throwing WMTE
+        return new WrongMethodTypeException("expected "+expected+" but found "+actual);
+    }
+
+    /** Static definition of MethodHandle.invokeExact checking code. */
+    /*non-public*/ static
+    @ForceInline
+    void checkExactType(Object mhObj, Object expectedObj) {
+        MethodHandle mh = (MethodHandle) mhObj;
+        MethodType expected = (MethodType) expectedObj;
+        MethodType actual = mh.type();
+        if (actual != expected)
+            throw newWrongMethodTypeException(expected, actual);
+    }
+
+    /** Static definition of MethodHandle.invokeGeneric checking code. */
+    /*non-public*/ static
+    @ForceInline
+    Object checkGenericType(Object mhObj, Object expectedObj) {
+        MethodHandle mh = (MethodHandle) mhObj;
+        MethodType expected = (MethodType) expectedObj;
+        //MethodType actual = mh.type();
+        MethodHandle gamh = expected.form().genericInvoker;
+        if (gamh != null)  return gamh;
+        return prepareForGenericCall(expected);
+    }
+
+    /**
+     * Returns an adapter GA for invoking a MH with type adjustments.
+     * The MethodType of the generic invocation site is prepended to MH
+     * and its arguments as follows:
+     * {@code (R)MH.invoke(A*) => GA.invokeBasic(TYPEOF<A*,R>, MH, A*)}
+     */
+    /*non-public*/ static MethodHandle prepareForGenericCall(MethodType mtype) {
+        // force any needed adapters to be preconstructed
+        MethodTypeForm form = mtype.form();
+        MethodHandle gamh = form.genericInvoker;
+        if (gamh != null)  return gamh;
+        try {
+            // Trigger adapter creation.
+            gamh = InvokeGeneric.generalInvokerOf(form.erasedType);
+            form.genericInvoker = gamh;
+            return gamh;
+        } catch (Exception ex) {
+            throw newInternalError("Exception while resolving inexact invoke", ex);
+        }
+    }
+
+    static MemberName linkToCallSiteMethod(MethodType mtype) {
+        LambdaForm lform = callSiteForm(mtype);
+        return lform.vmentry;
+    }
+
+    private static LambdaForm callSiteForm(MethodType mtype) {
+        mtype = mtype.basicType();  // normalize Z to I, String to Object, etc.
+        LambdaForm lform = mtype.form().cachedLambdaForm(MethodTypeForm.LF_CS_LINKER);
+        if (lform != null)  return lform;
+        // exactInvokerForm (Object,Object)Object
+        //   link with java.lang.invoke.MethodHandle.invokeBasic(MethodHandle,Object,Object)Object/invokeSpecial
+        final int ARG_BASE     = 0;
+        final int OUTARG_LIMIT = ARG_BASE + mtype.parameterCount();
+        final int INARG_LIMIT  = OUTARG_LIMIT + 1;
+        int nameCursor = OUTARG_LIMIT;
+        final int CSITE_ARG    = nameCursor++;  // the last in-argument
+        final int CALL_MH      = nameCursor++;  // result of getTarget
+        final int LINKER_CALL  = nameCursor++;
+        MethodType invokerFormType = mtype.appendParameterTypes(CallSite.class);
+        Name[] names = arguments(nameCursor - INARG_LIMIT, invokerFormType);
+        assert(names.length == nameCursor);
+        assert(names[CSITE_ARG] != null);
+        names[CALL_MH] = new Name(NF_getCallSiteTarget, names[CSITE_ARG]);
+        // (site.)invokedynamic(a*):R => mh = site.getTarget(); mh.invokeBasic(a*)
+        final int PREPEND_MH = 0, PREPEND_COUNT = 1;
+        Object[] outArgs = Arrays.copyOfRange(names, ARG_BASE, OUTARG_LIMIT + PREPEND_COUNT, Object[].class);
+        // prepend MH argument:
+        System.arraycopy(outArgs, 0, outArgs, PREPEND_COUNT, outArgs.length - PREPEND_COUNT);
+        outArgs[PREPEND_MH] = names[CALL_MH];
+        names[LINKER_CALL] = new Name(invokeBasicMethod(mtype), outArgs);
+        lform = new LambdaForm("linkToCallSite", INARG_LIMIT, names);
+        lform.compileToBytecode();  // JVM needs a real methodOop
+        lform = mtype.form().setCachedLambdaForm(MethodTypeForm.LF_CS_LINKER, lform);
+        return lform;
+    }
+
+    /** Static definition of MethodHandle.invokeGeneric checking code. */
+    /*non-public*/ static
+    @ForceInline
+    Object getCallSiteTarget(Object site) {
+        return ((CallSite)site).getTarget();
+    }
+
+    // Local constant functions:
+    private static final NamedFunction NF_checkExactType;
+    private static final NamedFunction NF_checkGenericType;
+    private static final NamedFunction NF_asType;
+    private static final NamedFunction NF_getCallSiteTarget;
+    static {
+        try {
+            NF_checkExactType = new NamedFunction(Invokers.class
+                    .getDeclaredMethod("checkExactType", Object.class, Object.class));
+            NF_checkGenericType = new NamedFunction(Invokers.class
+                    .getDeclaredMethod("checkGenericType", Object.class, Object.class));
+            NF_asType = new NamedFunction(MethodHandle.class
+                    .getDeclaredMethod("asType", MethodType.class));
+            NF_getCallSiteTarget = new NamedFunction(Invokers.class
+                    .getDeclaredMethod("getCallSiteTarget", Object.class));
+            NF_checkExactType.resolve();
+            NF_checkGenericType.resolve();
+            NF_getCallSiteTarget.resolve();
+            // bound
+        } catch (ReflectiveOperationException ex) {
+            throw newInternalError(ex);
+        }
+    }
+
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/java/lang/invoke/LambdaForm.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,1625 @@
+/*
+ * Copyright (c) 2011, 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.invoke;
+
+import java.lang.annotation.*;
+import java.lang.reflect.Method;
+import java.util.Map;
+import java.util.List;
+import java.util.Arrays;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.concurrent.ConcurrentHashMap;
+import sun.invoke.util.Wrapper;
+import static java.lang.invoke.MethodHandleStatics.*;
+import static java.lang.invoke.MethodHandleNatives.Constants.*;
+import java.lang.reflect.Field;
+import java.util.Objects;
+
+/**
+ * The symbolic, non-executable form of a method handle's invocation semantics.
+ * It consists of a series of names.
+ * The first N (N=arity) names are parameters,
+ * while any remaining names are temporary values.
+ * Each temporary specifies the application of a function to some arguments.
+ * The functions are method handles, while the arguments are mixes of
+ * constant values and local names.
+ * The result of the lambda is defined as one of the names, often the last one.
+ * <p>
+ * Here is an approximate grammar:
+ * <pre>
+ * LambdaForm = "(" ArgName* ")=>{" TempName* Result "}"
+ * ArgName = "a" N ":" T
+ * TempName = "t" N ":" T "=" Function "(" Argument* ");"
+ * Function = ConstantValue
+ * Argument = NameRef | ConstantValue
+ * Result = NameRef | "void"
+ * NameRef = "a" N | "t" N
+ * N = (any whole number)
+ * T = "L" | "I" | "J" | "F" | "D" | "V"
+ * </pre>
+ * Names are numbered consecutively from left to right starting at zero.
+ * (The letters are merely a taste of syntax sugar.)
+ * Thus, the first temporary (if any) is always numbered N (where N=arity).
+ * Every occurrence of a name reference in an argument list must refer to
+ * a name previously defined within the same lambda.
+ * A lambda has a void result if and only if its result index is -1.
+ * If a temporary has the type "V", it cannot be the subject of a NameRef,
+ * even though possesses a number.
+ * Note that all reference types are erased to "L", which stands for {@code Object).
+ * All subword types (boolean, byte, short, char) are erased to "I" which is {@code int}.
+ * The other types stand for the usual primitive types.
+ * <p>
+ * Function invocation closely follows the static rules of the Java verifier.
+ * Arguments and return values must exactly match when their "Name" types are
+ * considered.
+ * Conversions are allowed only if they do not change the erased type.
+ * <ul>
+ * <li>L = Object: casts are used freely to convert into and out of reference types
+ * <li>I = int: subword types are forcibly narrowed when passed as arguments (see {@code explicitCastArguments})
+ * <li>J = long: no implicit conversions
+ * <li>F = float: no implicit conversions
+ * <li>D = double: no implicit conversions
+ * <li>V = void: a function result may be void if and only if its Name is of type "V"
+ * </ul>
+ * Although implicit conversions are not allowed, explicit ones can easily be
+ * encoded by using temporary expressions which call type-transformed identity functions.
+ * <p>
+ * Examples:
+ * <pre>
+ * (a0:J)=>{ a0 }
+ *     == identity(long)
+ * (a0:I)=>{ t1:V = System.out#println(a0); void }
+ *     == System.out#println(int)
+ * (a0:L)=>{ t1:V = System.out#println(a0); a0 }
+ *     == identity, with printing side-effect
+ * (a0:L, a1:L)=>{ t2:L = BoundMethodHandle#argument(a0);
+ *                 t3:L = BoundMethodHandle#target(a0);
+ *                 t4:L = MethodHandle#invoke(t3, t2, a1); t4 }
+ *     == general invoker for unary insertArgument combination
+ * (a0:L, a1:L)=>{ t2:L = FilterMethodHandle#filter(a0);
+ *                 t3:L = MethodHandle#invoke(t2, a1);
+ *                 t4:L = FilterMethodHandle#target(a0);
+ *                 t5:L = MethodHandle#invoke(t4, t3); t5 }
+ *     == general invoker for unary filterArgument combination
+ * (a0:L, a1:L)=>{ ...(same as previous example)...
+ *                 t5:L = MethodHandle#invoke(t4, t3, a1); t5 }
+ *     == general invoker for unary/unary foldArgument combination
+ * (a0:L, a1:I)=>{ t2:I = identity(long).asType((int)->long)(a1); t2 }
+ *     == invoker for identity method handle which performs i2l
+ * (a0:L, a1:L)=>{ t2:L = BoundMethodHandle#argument(a0);
+ *                 t3:L = Class#cast(t2,a1); t3 }
+ *     == invoker for identity method handle which performs cast
+ * </pre>
+ * <p>
+ * @author John Rose, JSR 292 EG
+ */
+class LambdaForm {
+    final int arity;
+    final int result;
+    final Name[] names;
+    final String debugName;
+    MemberName vmentry;   // low-level behavior, or null if not yet prepared
+    private boolean isCompiled;
+
+    // Caches for common structural transforms:
+    LambdaForm[] bindCache;
+
+    public static final int VOID_RESULT = -1, LAST_RESULT = -2;
+
+    LambdaForm(String debugName,
+               int arity, Name[] names, int result) {
+        assert(namesOK(arity, names));
+        this.arity = arity;
+        this.result = fixResult(result, names);
+        this.names = names.clone();
+        this.debugName = debugName;
+        normalize();
+    }
+
+    LambdaForm(String debugName,
+               int arity, Name[] names) {
+        this(debugName,
+             arity, names, LAST_RESULT);
+    }
+
+    LambdaForm(String debugName,
+               Name[] formals, Name[] temps, Name result) {
+        this(debugName,
+             formals.length, buildNames(formals, temps, result), LAST_RESULT);
+    }
+
+    private static Name[] buildNames(Name[] formals, Name[] temps, Name result) {
+        int arity = formals.length;
+        int length = arity + temps.length + (result == null ? 0 : 1);
+        Name[] names = Arrays.copyOf(formals, length);
+        System.arraycopy(temps, 0, names, arity, temps.length);
+        if (result != null)
+            names[length - 1] = result;
+        return names;
+    }
+
+    private LambdaForm(String sig) {
+        // 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.
+        assert(isValidSignature(sig));
+        this.arity = signatureArity(sig);
+        this.result = (signatureReturn(sig) == 'V' ? -1 : arity);
+        this.names = buildEmptyNames(arity, sig);
+        this.debugName = "LF.zero";
+        assert(nameRefsAreLegal());
+        assert(isEmpty());
+        assert(sig.equals(basicTypeSignature()));
+    }
+
+    private static Name[] buildEmptyNames(int arity, String basicTypeSignature) {
+        assert(isValidSignature(basicTypeSignature));
+        int resultPos = arity + 1;  // skip '_'
+        if (arity < 0 || basicTypeSignature.length() != resultPos+1)
+            throw new IllegalArgumentException("bad arity for "+basicTypeSignature);
+        int numRes = (basicTypeSignature.charAt(resultPos) == 'V' ? 0 : 1);
+        Name[] names = arguments(numRes, basicTypeSignature.substring(0, arity));
+        for (int i = 0; i < numRes; i++) {
+            names[arity + i] = constantZero(arity + i, basicTypeSignature.charAt(resultPos + i));
+        }
+        return names;
+    }
+
+    private static int fixResult(int result, Name[] names) {
+        if (result >= 0) {
+            if (names[result].type == 'V')
+                return -1;
+        } else if (result == LAST_RESULT) {
+            return names.length - 1;
+        }
+        return result;
+    }
+
+    private static boolean namesOK(int arity, Name[] names) {
+        for (int i = 0; i < names.length; i++) {
+            Name n = names[i];
+            assert(n != null) : "n is null";
+            if (i < arity)
+                assert( n.isParam()) : n + " is not param at " + i;
+            else
+                assert(!n.isParam()) : n + " is param at " + i;
+        }
+        return true;
+    }
+
+    /** Renumber and/or replace params so that they are interned and canonically numbered. */
+    private void normalize() {
+        Name[] oldNames = null;
+        int changesStart = 0;
+        for (int i = 0; i < names.length; i++) {
+            Name n = names[i];
+            if (!n.initIndex(i)) {
+                if (oldNames == null) {
+                    oldNames = names.clone();
+                    changesStart = i;
+                }
+                names[i] = n.cloneWithIndex(i);
+            }
+        }
+        if (oldNames != null) {
+            int startFixing = arity;
+            if (startFixing <= changesStart)
+                startFixing = changesStart+1;
+            for (int i = startFixing; i < names.length; i++) {
+                Name fixed = names[i].replaceNames(oldNames, names, changesStart, i);
+                names[i] = fixed.newIndex(i);
+            }
+        }
+        assert(nameRefsAreLegal());
+        int maxInterned = Math.min(arity, INTERNED_ARGUMENT_LIMIT);
+        boolean needIntern = false;
+        for (int i = 0; i < maxInterned; i++) {
+            Name n = names[i], n2 = internArgument(n);
+            if (n != n2) {
+                names[i] = n2;
+                needIntern = true;
+            }
+        }
+        if (needIntern) {
+            for (int i = arity; i < names.length; i++) {
+                names[i].internArguments();
+            }
+            assert(nameRefsAreLegal());
+        }
+    }
+
+    /**
+     * Check that all embedded Name references are localizable to this lambda,
+     * and are properly ordered after their corresponding definitions.
+     * <p>
+     * Note that a Name can be local to multiple lambdas, as long as
+     * it possesses the same index in each use site.
+     * This allows Name references to be freely reused to construct
+     * fresh lambdas, without confusion.
+     */
+    private boolean nameRefsAreLegal() {
+        assert(arity >= 0 && arity <= names.length);
+        assert(result >= -1 && result < names.length);
+        // Do all names possess an index consistent with their local definition order?
+        for (int i = 0; i < arity; i++) {
+            Name n = names[i];
+            assert(n.index() == i) : Arrays.asList(n.index(), i);
+            assert(n.isParam());
+        }
+        // Also, do all local name references
+        for (int i = arity; i < names.length; i++) {
+            Name n = names[i];
+            assert(n.index() == i);
+            for (Object arg : n.arguments) {
+                if (arg instanceof Name) {
+                    Name n2 = (Name) arg;
+                    int i2 = n2.index;
+                    assert(0 <= i2 && i2 < names.length) : n.debugString() + ": 0 <= i2 && i2 < names.length: 0 <= " + i2 + " < " + names.length;
+                    assert(names[i2] == n2) : Arrays.asList("-1-", i, "-2-", n.debugString(), "-3-", i2, "-4-", n2.debugString(), "-5-", names[i2].debugString(), "-6-", this);
+                    assert(i2 < i);  // ref must come after def!
+                }
+            }
+        }
+        return true;
+    }
+
+    /** Invoke this form on the given arguments. */
+    // final Object invoke(Object... args) throws Throwable {
+    //     // NYI: fit this into the fast path?
+    //     return interpretWithArguments(args);
+    // }
+
+    /** Report the return type. */
+    char returnType() {
+        if (result < 0)  return 'V';
+        Name n = names[result];
+        return n.type;
+    }
+
+    /** Report the N-th argument type. */
+    char parameterType(int n) {
+        assert(n < arity);
+        return names[n].type;
+    }
+
+    /** Report the arity. */
+    int arity() {
+        return arity;
+    }
+
+    /** Return the method type corresponding to my basic type signature. */
+    MethodType methodType() {
+        return signatureType(basicTypeSignature());
+    }
+    /** Return ABC_Z, where the ABC are parameter type characters, and Z is the return type character. */
+    final String basicTypeSignature() {
+        StringBuilder buf = new StringBuilder(arity() + 3);
+        for (int i = 0, a = arity(); i < a; i++)
+            buf.append(parameterType(i));
+        return buf.append('_').append(returnType()).toString();
+    }
+    static int signatureArity(String sig) {
+        assert(isValidSignature(sig));
+        return sig.indexOf('_');
+    }
+    static char signatureReturn(String sig) {
+        return sig.charAt(signatureArity(sig)+1);
+    }
+    static boolean isValidSignature(String sig) {
+        int arity = sig.indexOf('_');
+        if (arity < 0)  return false;  // must be of the form *_*
+        int siglen = sig.length();
+        if (siglen != arity + 2)  return false;  // *_X
+        for (int i = 0; i < siglen; i++) {
+            if (i == arity)  continue;  // skip '_'
+            char c = sig.charAt(i);
+            if (c == 'V')
+                return (i == siglen - 1 && arity == siglen - 2);
+            if (ALL_TYPES.indexOf(c) < 0)  return false; // must be [LIJFD]
+        }
+        return true;  // [LIJFD]*_[LIJFDV]
+    }
+    static Class<?> typeClass(char t) {
+        switch (t) {
+        case 'I': return int.class;
+        case 'J': return long.class;
+        case 'F': return float.class;
+        case 'D': return double.class;
+        case 'L': return Object.class;
+        case 'V': return void.class;
+        default: assert false;
+        }
+        return null;
+    }
+    static MethodType signatureType(String sig) {
+        Class<?>[] ptypes = new Class<?>[signatureArity(sig)];
+        for (int i = 0; i < ptypes.length; i++)
+            ptypes[i] = typeClass(sig.charAt(i));
+        Class<?> rtype = typeClass(signatureReturn(sig));
+        return MethodType.methodType(rtype, ptypes);
+    }
+
+    /*
+     * Code generation issues:
+     *
+     * Compiled LFs should be reusable in general.
+     * The biggest issue is how to decide when to pull a name into
+     * the bytecode, versus loading a reified form from the MH data.
+     *
+     * For example, an asType wrapper may require execution of a cast
+     * after a call to a MH.  The target type of the cast can be placed
+     * as a constant in the LF itself.  This will force the cast type
+     * to be compiled into the bytecodes and native code for the MH.
+     * Or, the target type of the cast can be erased in the LF, and
+     * loaded from the MH data.  (Later on, if the MH as a whole is
+     * inlined, the data will flow into the inlined instance of the LF,
+     * as a constant, and the end result will be an optimal cast.)
+     *
+     * This erasure of cast types can be done with any use of
+     * reference types.  It can also be done with whole method
+     * handles.  Erasing a method handle might leave behind
+     * LF code that executes correctly for any MH of a given
+     * type, and load the required MH from the enclosing MH's data.
+     * Or, the erasure might even erase the expected MT.
+     *
+     * Also, for direct MHs, the MemberName of the target
+     * could be erased, and loaded from the containing direct MH.
+     * As a simple case, a LF for all int-valued non-static
+     * field getters would perform a cast on its input argument
+     * (to non-constant base type derived from the MemberName)
+     * and load an integer value from the input object
+     * (at a non-constant offset also derived from the MemberName).
+     * Such MN-erased LFs would be inlinable back to optimized
+     * code, whenever a constant enclosing DMH is available
+     * to supply a constant MN from its data.
+     *
+     * The main problem here is to keep LFs reasonably generic,
+     * while ensuring that hot spots will inline good instances.
+     * "Reasonably generic" means that we don't end up with
+     * repeated versions of bytecode or machine code that do
+     * not differ in their optimized form.  Repeated versions
+     * of machine would have the undesirable overheads of
+     * (a) redundant compilation work and (b) extra I$ pressure.
+     * To control repeated versions, we need to be ready to
+     * erase details from LFs and move them into MH data,
+     * whevener those details are not relevant to significant
+     * optimization.  "Significant" means optimization of
+     * code that is actually hot.
+     *
+     * Achieving this may require dynamic splitting of MHs, by replacing
+     * a generic LF with a more specialized one, on the same MH,
+     * if (a) the MH is frequently executed and (b) the MH cannot
+     * be inlined into a containing caller, such as an invokedynamic.
+     *
+     * Compiled LFs that are no longer used should be GC-able.
+     * If they contain non-BCP references, they should be properly
+     * interlinked with the class loader(s) that their embedded types
+     * depend on.  This probably means that reusable compiled LFs
+     * will be tabulated (indexed) on relevant class loaders,
+     * or else that the tables that cache them will have weak links.
+     */
+
+    /**
+     * Make this LF directly executable, as part of a MethodHandle.
+     * Invariant:  Every MH which is invoked must prepare its LF
+     * before invocation.
+     * (In principle, the JVM could do this very lazily,
+     * as a sort of pre-invocation linkage step.)
+     */
+    public void prepare() {
+        if (COMPILE_THRESHOLD == 0) {
+            compileToBytecode();
+        }
+        if (this.vmentry != null) {
+            // already prepared (e.g., a primitive DMH invoker form)
+            return;
+        }
+        LambdaForm prep = getPreparedForm(basicTypeSignature());
+        this.vmentry = prep.vmentry;
+        // TO DO: Maybe add invokeGeneric, invokeWithArguments
+    }
+
+    /** Generate optimizable bytecode for this form. */
+    MemberName compileToBytecode() {
+        MethodType invokerType = methodType();
+        assert(vmentry == null || vmentry.getMethodType().basicType().equals(invokerType));
+        if (vmentry != null && isCompiled) {
+            return vmentry;  // already compiled somehow
+        }
+        try {
+            vmentry = InvokerBytecodeGenerator.generateCustomizedCode(this, invokerType);
+            if (TRACE_INTERPRETER)
+                traceInterpreter("compileToBytecode", this);
+            isCompiled = true;
+            return vmentry;
+        } catch (Error | Exception ex) {
+            throw newInternalError(this.toString(), ex);
+        }
+    }
+
+    private static final ConcurrentHashMap<String,LambdaForm> PREPARED_FORMS;
+    static {
+        int   capacity   = 512;    // expect many distinct signatures over time
+        float loadFactor = 0.75f;  // normal default
+        int   writers    = 1;
+        PREPARED_FORMS = new ConcurrentHashMap<>(capacity, loadFactor, writers);
+    }
+
+    private static Map<String,LambdaForm> computeInitialPreparedForms() {
+        // Find all predefined invokers and associate them with canonical empty lambda forms.
+        HashMap<String,LambdaForm> forms = new HashMap<>();
+        for (MemberName m : MemberName.getFactory().getMethods(LambdaForm.class, false, null, null, null)) {
+            if (!m.isStatic() || !m.isPackage())  continue;
+            MethodType mt = m.getMethodType();
+            if (mt.parameterCount() > 0 &&
+                mt.parameterType(0) == MethodHandle.class &&
+                m.getName().startsWith("interpret_")) {
+                String sig = basicTypeSignature(mt);
+                assert(m.getName().equals("interpret" + sig.substring(sig.indexOf('_'))));
+                LambdaForm form = new LambdaForm(sig);
+                form.vmentry = m;
+                mt.form().setCachedLambdaForm(MethodTypeForm.LF_COUNTER, form);
+                // FIXME: get rid of PREPARED_FORMS; use MethodTypeForm cache only
+                forms.put(sig, form);
+            }
+        }
+        //System.out.println("computeInitialPreparedForms => "+forms);
+        return forms;
+    }
+
+    // Set this false to disable use of the interpret_L methods defined in this file.
+    private static final boolean USE_PREDEFINED_INTERPRET_METHODS = true;
+
+    // The following are predefined exact invokers.  The system must build
+    // a separate invoker for each distinct signature.
+    static Object interpret_L(MethodHandle mh) throws Throwable {
+        Object[] av = {mh};
+        String sig = null;
+        assert(argumentTypesMatch(sig = "L_L", av));
+        Object res = mh.form.interpretWithArguments(av);
+        assert(returnTypesMatch(sig, av, res));
+        return res;
+    }
+    static Object interpret_L(MethodHandle mh, Object x1) throws Throwable {
+        Object[] av = {mh, x1};
+        String sig = null;
+        assert(argumentTypesMatch(sig = "LL_L", av));
+        Object res = mh.form.interpretWithArguments(av);
+        assert(returnTypesMatch(sig, av, res));
+        return res;
+    }
+    static Object interpret_L(MethodHandle mh, Object x1, Object x2) throws Throwable {
+        Object[] av = {mh, x1, x2};
+        String sig = null;
+        assert(argumentTypesMatch(sig = "LLL_L", av));
+        Object res = mh.form.interpretWithArguments(av);
+        assert(returnTypesMatch(sig, av, res));
+        return res;
+    }
+    private static LambdaForm getPreparedForm(String sig) {
+        MethodType mtype = signatureType(sig);
+        //LambdaForm prep = PREPARED_FORMS.get(sig);
+        LambdaForm prep =  mtype.form().cachedLambdaForm(MethodTypeForm.LF_INTERPRET);
+        if (prep != null)  return prep;
+        assert(isValidSignature(sig));
+        prep = new LambdaForm(sig);
+        prep.vmentry = InvokerBytecodeGenerator.generateLambdaFormInterpreterEntryPoint(sig);
+        //LambdaForm prep2 = PREPARED_FORMS.putIfAbsent(sig.intern(), prep);
+        return mtype.form().setCachedLambdaForm(MethodTypeForm.LF_INTERPRET, prep);
+    }
+
+    // The next few routines are called only from assert expressions
+    // They verify that the built-in invokers process the correct raw data types.
+    private static boolean argumentTypesMatch(String sig, Object[] av) {
+        int arity = signatureArity(sig);
+        assert(av.length == arity) : "av.length == arity: av.length=" + av.length + ", arity=" + arity;
+        assert(av[0] instanceof MethodHandle) : "av[0] not instace of MethodHandle: " + av[0];
+        MethodHandle mh = (MethodHandle) av[0];
+        MethodType mt = mh.type();
+        assert(mt.parameterCount() == arity-1);
+        for (int i = 0; i < av.length; i++) {
+            Class<?> pt = (i == 0 ? MethodHandle.class : mt.parameterType(i-1));
+            assert(valueMatches(sig.charAt(i), pt, av[i]));
+        }
+        return true;
+    }
+    private static boolean valueMatches(char tc, Class<?> type, Object x) {
+        // The following line is needed because (...)void method handles can use non-void invokers
+        if (type == void.class)  tc = 'V';   // can drop any kind of value
+        assert tc == basicType(type) : tc + " == basicType(" + type + ")=" + basicType(type);
+        switch (tc) {
+        case 'I': assert checkInt(type, x)   : "checkInt(" + type + "," + x +")";   break;
+        case 'J': assert x instanceof Long   : "instanceof Long: " + x;             break;
+        case 'F': assert x instanceof Float  : "instanceof Float: " + x;            break;
+        case 'D': assert x instanceof Double : "instanceof Double: " + x;           break;
+        case 'L': assert checkRef(type, x)   : "checkRef(" + type + "," + x + ")";  break;
+        case 'V': break;  // allow anything here; will be dropped
+        default:  assert(false);
+        }
+        return true;
+    }
+    private static boolean returnTypesMatch(String sig, Object[] av, Object res) {
+        MethodHandle mh = (MethodHandle) av[0];
+        return valueMatches(signatureReturn(sig), mh.type().returnType(), res);
+    }
+    private static boolean checkInt(Class<?> type, Object x) {
+        assert(x instanceof Integer);
+        if (type == int.class)  return true;
+        Wrapper w = Wrapper.forBasicType(type);
+        assert(w.isSubwordOrInt());
+        Object x1 = Wrapper.INT.wrap(w.wrap(x));
+        return x.equals(x1);
+    }
+    private static boolean checkRef(Class<?> type, Object x) {
+        assert(!type.isPrimitive());
+        if (x == null)  return true;
+        if (type.isInterface())  return true;
+        return type.isInstance(x);
+    }
+
+    /** If the invocation count hits the threshold we spin bytecodes and call that subsequently. */
+    private static final int COMPILE_THRESHOLD;
+    static {
+        if (MethodHandleStatics.COMPILE_THRESHOLD != null)
+            COMPILE_THRESHOLD = MethodHandleStatics.COMPILE_THRESHOLD;
+        else
+            COMPILE_THRESHOLD = 30;  // default value
+    }
+    private int invocationCounter = 0;
+
+    @Hidden
+    @DontInline
+    /** Interpretively invoke this form on the given arguments. */
+    Object interpretWithArguments(Object... argumentValues) throws Throwable {
+        if (TRACE_INTERPRETER)
+            return interpretWithArgumentsTracing(argumentValues);
+        checkInvocationCounter();
+        assert(arityCheck(argumentValues));
+        Object[] values = Arrays.copyOf(argumentValues, names.length);
+        for (int i = argumentValues.length; i < values.length; i++) {
+            values[i] = interpretName(names[i], values);
+        }
+        return (result < 0) ? null : values[result];
+    }
+
+    @Hidden
+    @DontInline
+    /** Evaluate a single Name within this form, applying its function to its arguments. */
+    Object interpretName(Name name, Object[] values) throws Throwable {
+        if (TRACE_INTERPRETER)
+            traceInterpreter("| interpretName", name.debugString(), (Object[]) null);
+        Object[] arguments = Arrays.copyOf(name.arguments, name.arguments.length, Object[].class);
+        for (int i = 0; i < arguments.length; i++) {
+            Object a = arguments[i];
+            if (a instanceof Name) {
+                int i2 = ((Name)a).index();
+                assert(names[i2] == a);
+                a = values[i2];
+                arguments[i] = a;
+            }
+        }
+        return name.function.invokeWithArguments(arguments);
+    }
+
+    private void checkInvocationCounter() {
+        if (COMPILE_THRESHOLD != 0 &&
+            invocationCounter < COMPILE_THRESHOLD) {
+            invocationCounter++;  // benign race
+            if (invocationCounter >= COMPILE_THRESHOLD) {
+                // Replace vmentry with a bytecode version of this LF.
+                compileToBytecode();
+            }
+        }
+    }
+    Object interpretWithArgumentsTracing(Object... argumentValues) throws Throwable {
+        traceInterpreter("[ interpretWithArguments", this, argumentValues);
+        if (invocationCounter < COMPILE_THRESHOLD) {
+            int ctr = invocationCounter++;  // benign race
+            traceInterpreter("| invocationCounter", ctr);
+            if (invocationCounter >= COMPILE_THRESHOLD) {
+                compileToBytecode();
+            }
+        }
+        Object rval;
+        try {
+            assert(arityCheck(argumentValues));
+            Object[] values = Arrays.copyOf(argumentValues, names.length);
+            for (int i = argumentValues.length; i < values.length; i++) {
+                values[i] = interpretName(names[i], values);
+            }
+            rval = (result < 0) ? null : values[result];
+        } catch (Throwable ex) {
+            traceInterpreter("] throw =>", ex);
+            throw ex;
+        }
+        traceInterpreter("] return =>", rval);
+        return rval;
+    }
+
+    //** This transform is applied (statically) to every name.function. */
+    /*
+    private static MethodHandle eraseSubwordTypes(MethodHandle mh) {
+        MethodType mt = mh.type();
+        if (mt.hasPrimitives()) {
+            mt = mt.changeReturnType(eraseSubwordType(mt.returnType()));
+            for (int i = 0; i < mt.parameterCount(); i++) {
+                mt = mt.changeParameterType(i, eraseSubwordType(mt.parameterType(i)));
+            }
+            mh = MethodHandles.explicitCastArguments(mh, mt);
+        }
+        return mh;
+    }
+    private static Class<?> eraseSubwordType(Class<?> type) {
+        if (!type.isPrimitive())  return type;
+        if (type == int.class)  return type;
+        Wrapper w = Wrapper.forPrimitiveType(type);
+        if (w.isSubwordOrInt())  return int.class;
+        return type;
+    }
+    */
+
+    static void traceInterpreter(String event, Object obj, Object... args) {
+        if (!TRACE_INTERPRETER)  return;
+        System.out.println("LFI: "+event+" "+(obj != null ? obj : "")+(args != null && args.length != 0 ? Arrays.asList(args) : ""));
+    }
+    static void traceInterpreter(String event, Object obj) {
+        traceInterpreter(event, obj, (Object[])null);
+    }
+    private boolean arityCheck(Object[] argumentValues) {
+        assert(argumentValues.length == arity) : arity+"!="+Arrays.asList(argumentValues)+".length";
+        // also check that the leading (receiver) argument is somehow bound to this LF:
+        assert(argumentValues[0] instanceof MethodHandle) : "not MH: " + argumentValues[0];
+        assert(((MethodHandle)argumentValues[0]).internalForm() == this);
+        // note:  argument #0 could also be an interface wrapper, in the future
+        return true;
+    }
+
+    private boolean isEmpty() {
+        if (result < 0)
+            return (names.length == arity);
+        else if (result == arity && names.length == arity + 1)
+            return names[arity].isConstantZero();
+        else
+            return false;
+    }
+
+    public String toString() {
+        StringBuilder buf = new StringBuilder(debugName+"=Lambda(");
+        for (int i = 0; i < names.length; i++) {
+            if (i == arity)  buf.append(")=>{");
+            Name n = names[i];
+            if (i >= arity)  buf.append("\n    ");
+            buf.append(n);
+            if (i < arity) {
+                if (i+1 < arity)  buf.append(",");
+                continue;
+            }
+            buf.append("=").append(n.exprString());
+            buf.append(";");
+        }
+        buf.append(result < 0 ? "void" : names[result]).append("}");
+        if (TRACE_INTERPRETER) {
+            // Extra verbosity:
+            buf.append(":").append(basicTypeSignature());
+            buf.append("/").append(vmentry);
+        }
+        return buf.toString();
+    }
+
+    /**
+     * Apply immediate binding for a Name in this form indicated by its position relative to the form.
+     * The first parameter to a LambdaForm, a0:L, always represents the form's method handle, so 0 is not
+     * accepted as valid.
+     */
+    LambdaForm bindImmediate(int pos, char basicType, Object value) {
+        // must be an argument, and the types must match
+        assert pos > 0 && pos < arity && names[pos].type == basicType && Name.typesMatch(basicType, value);
+
+        int arity2 = arity - 1;
+        Name[] names2 = new Name[names.length - 1];
+        for (int r = 0, w = 0; r < names.length; ++r, ++w) { // (r)ead from names, (w)rite to names2
+            Name n = names[r];
+            if (n.isParam()) {
+                if (n.index == pos) {
+                    // do not copy over the argument that is to be replaced with a literal,
+                    // but adjust the write index
+                    --w;
+                } else {
+                    names2[w] = new Name(w, n.type);
+                }
+            } else {
+                Object[] arguments2 = new Object[n.arguments.length];
+                for (int i = 0; i < n.arguments.length; ++i) {
+                    Object arg = n.arguments[i];
+                    if (arg instanceof Name) {
+                        int ni = ((Name) arg).index;
+                        if (ni == pos) {
+                            arguments2[i] = value;
+                        } else if (ni < pos) {
+                            // replacement position not yet passed
+                            arguments2[i] = names2[ni];
+                        } else {
+                            // replacement position passed
+                            arguments2[i] = names2[ni - 1];
+                        }
+                    } else {
+                        arguments2[i] = arg;
+                    }
+                }
+                names2[w] = new Name(n.function, arguments2);
+                names2[w].initIndex(w);
+            }
+        }
+
+        int result2 = result == -1 ? -1 : result - 1;
+        return new LambdaForm(debugName, arity2, names2, result2);
+    }
+
+    LambdaForm bind(int namePos, BoundMethodHandle.SpeciesData oldData) {
+        Name name = names[namePos];
+        BoundMethodHandle.SpeciesData newData = oldData.extendWithType(name.type);
+        return bind(name, newData.getterName(names[0], oldData.fieldCount()), oldData, newData);
+    }
+    LambdaForm bind(Name name, Name binding,
+                    BoundMethodHandle.SpeciesData oldData,
+                    BoundMethodHandle.SpeciesData newData) {
+        int pos = name.index;
+        assert(name.isParam());
+        assert(!binding.isParam());
+        assert(name.type == binding.type);
+        assert(0 <= pos && pos < arity && names[pos] == name);
+        assert(binding.function.memberDeclaringClassOrNull() == newData.clazz);
+        assert(oldData.getters.length == newData.getters.length-1);
+        if (bindCache != null) {
+            LambdaForm form = bindCache[pos];
+            if (form != null) {
+                assert(form.contains(binding)) : "form << " + form + " >> does not contain binding << " + binding + " >>";
+                return form;
+            }
+        } else {
+            bindCache = new LambdaForm[arity];
+        }
+        assert(nameRefsAreLegal());
+        int arity2 = arity-1;
+        Name[] names2 = names.clone();
+        names2[pos] = binding;  // we might move this in a moment
+
+        // The newly created LF will run with a different BMH.
+        // Switch over any pre-existing BMH field references to the new BMH class.
+        int firstOldRef = -1;
+        for (int i = 0; i < names2.length; i++) {
+            Name n = names[i];
+            if (n.function != null &&
+                n.function.memberDeclaringClassOrNull() == oldData.clazz) {
+                MethodHandle oldGetter = n.function.resolvedHandle;
+                MethodHandle newGetter = null;
+                for (int j = 0; j < oldData.getters.length; j++) {
+                    if (oldGetter == oldData.getters[j])
+                        newGetter =  newData.getters[j];
+                }
+                if (newGetter != null) {
+                    if (firstOldRef < 0)  firstOldRef = i;
+                    Name n2 = new Name(newGetter, n.arguments);
+                    names2[i] = n2;
+                }
+            }
+        }
+
+        // Walk over the new list of names once, in forward order.
+        // Replace references to 'name' with 'binding'.
+        // Replace data structure references to the old BMH species with the new.
+        // This might cause a ripple effect, but it will settle in one pass.
+        assert(firstOldRef < 0 || firstOldRef > pos);
+        for (int i = pos+1; i < names2.length; i++) {
+            if (i <= arity2)  continue;
+            names2[i] = names2[i].replaceNames(names, names2, pos, i);
+        }
+
+        //  (a0, a1, name=a2, a3, a4)  =>  (a0, a1, a3, a4, binding)
+        int insPos = pos;
+        for (; insPos+1 < names2.length; insPos++) {
+            Name n = names2[insPos+1];
+            if (n.isSiblingBindingBefore(binding)) {
+                names2[insPos] = n;
+            } else {
+                break;
+            }
+        }
+        names2[insPos] = binding;
+
+        // Since we moved some stuff, maybe update the result reference:
+        int result2 = result;
+        if (result2 == pos)
+            result2 = insPos;
+        else if (result2 > pos && result2 <= insPos)
+            result2 -= 1;
+
+        return bindCache[pos] = new LambdaForm(debugName, arity2, names2, result2);
+    }
+
+    boolean contains(Name name) {
+        int pos = name.index();
+        if (pos >= 0) {
+            return pos < names.length && name.equals(names[pos]);
+        }
+        for (int i = arity; i < names.length; i++) {
+            if (name.equals(names[i]))
+                return true;
+        }
+        return false;
+    }
+
+    LambdaForm addArguments(int pos, char... types) {
+        assert(pos <= arity);
+        int length = names.length;
+        int inTypes = types.length;
+        Name[] names2 = Arrays.copyOf(names, length + inTypes);
+        int arity2 = arity + inTypes;
+        int result2 = result;
+        if (result2 >= arity)
+            result2 += inTypes;
+        // names array has MH in slot 0; skip it.
+        int argpos = pos + 1;
+        // Note:  The LF constructor will rename names2[argpos...].
+        // Make space for new arguments (shift temporaries).
+        System.arraycopy(names, argpos, names2, argpos + inTypes, length - argpos);
+        for (int i = 0; i < inTypes; i++) {
+            names2[argpos + i] = new Name(types[i]);
+        }
+        return new LambdaForm(debugName, arity2, names2, result2);
+    }
+
+    LambdaForm addArguments(int pos, List<Class<?>> types) {
+        char[] basicTypes = new char[types.size()];
+        for (int i = 0; i < basicTypes.length; i++)
+            basicTypes[i] = basicType(types.get(i));
+        return addArguments(pos, basicTypes);
+    }
+
+    LambdaForm permuteArguments(int skip, int[] reorder, char[] types) {
+        // Note:  When inArg = reorder[outArg], outArg is fed by a copy of inArg.
+        // The types are the types of the new (incoming) arguments.
+        int length = names.length;
+        int inTypes = types.length;
+        int outArgs = reorder.length;
+        assert(skip+outArgs == arity);
+        assert(permutedTypesMatch(reorder, types, names, skip));
+        int pos = 0;
+        // skip trivial first part of reordering:
+        while (pos < outArgs && reorder[pos] == pos)  pos += 1;
+        Name[] names2 = new Name[length - outArgs + inTypes];
+        System.arraycopy(names, 0, names2, 0, skip+pos);
+        // copy the body:
+        int bodyLength = length - arity;
+        System.arraycopy(names, skip+outArgs, names2, skip+inTypes, bodyLength);
+        int arity2 = names2.length - bodyLength;
+        int result2 = result;
+        if (result2 >= 0) {
+            if (result2 < skip+outArgs) {
+                // return the corresponding inArg
+                result2 = reorder[result2-skip];
+            } else {
+                result2 = result2 - outArgs + inTypes;
+            }
+        }
+        // rework names in the body:
+        for (int j = pos; j < outArgs; j++) {
+            Name n = names[skip+j];
+            int i = reorder[j];
+            // replace names[skip+j] by names2[skip+i]
+            Name n2 = names2[skip+i];
+            if (n2 == null)
+                names2[skip+i] = n2 = new Name(types[i]);
+            else
+                assert(n2.type == types[i]);
+            for (int k = arity2; k < names2.length; k++) {
+                names2[k] = names2[k].replaceName(n, n2);
+            }
+        }
+        // some names are unused, but must be filled in
+        for (int i = skip+pos; i < arity2; i++) {
+            if (names2[i] == null)
+                names2[i] = argument(i, types[i - skip]);
+        }
+        for (int j = arity; j < names.length; j++) {
+            int i = j - arity + arity2;
+            // replace names2[i] by names[j]
+            Name n = names[j];
+            Name n2 = names2[i];
+            if (n != n2) {
+                for (int k = i+1; k < names2.length; k++) {
+                    names2[k] = names2[k].replaceName(n, n2);
+                }
+            }
+        }
+        return new LambdaForm(debugName, arity2, names2, result2);
+    }
+
+    static boolean permutedTypesMatch(int[] reorder, char[] types, Name[] names, int skip) {
+        int inTypes = types.length;
+        int outArgs = reorder.length;
+        for (int i = 0; i < outArgs; i++) {
+            assert(names[skip+i].isParam());
+            assert(names[skip+i].type == types[reorder[i]]);
+        }
+        return true;
+    }
+
+    static class NamedFunction {
+        final MemberName member;
+        MethodHandle resolvedHandle;
+        MethodHandle invoker;
+
+        NamedFunction(MethodHandle resolvedHandle) {
+            this(resolvedHandle.internalMemberName(), resolvedHandle);
+        }
+        NamedFunction(MemberName member, MethodHandle resolvedHandle) {
+            this.member = member;
+            //resolvedHandle = eraseSubwordTypes(resolvedHandle);
+            this.resolvedHandle = resolvedHandle;
+        }
+
+        // The next 3 constructors are used to break circular dependencies on MH.invokeStatic, etc.
+        // Any LambdaForm containing such a member is not interpretable.
+        // This is OK, since all such LFs are prepared with special primitive vmentry points.
+        // And even without the resolvedHandle, the name can still be compiled and optimized.
+        NamedFunction(Method method) {
+            this(new MemberName(method));
+        }
+        NamedFunction(Field field) {
+            this(new MemberName(field));
+        }
+        NamedFunction(MemberName member) {
+            this.member = member;
+            this.resolvedHandle = null;
+        }
+
+        MethodHandle resolvedHandle() {
+            if (resolvedHandle == null)  resolve();
+            return resolvedHandle;
+        }
+
+        void resolve() {
+            resolvedHandle = DirectMethodHandle.make(member);
+        }
+
+        @Override
+        public boolean equals(Object other) {
+            if (this == other) return true;
+            if (other == null) return false;
+            if (!(other instanceof NamedFunction)) return false;
+            NamedFunction that = (NamedFunction) other;
+            return this.member != null && this.member.equals(that.member);
+        }
+
+        @Override
+        public int hashCode() {
+            if (member != null)
+                return member.hashCode();
+            return super.hashCode();
+        }
+
+        // Put the predefined NamedFunction invokers into the table.
+        static void initializeInvokers() {
+            for (MemberName m : MemberName.getFactory().getMethods(NamedFunction.class, false, null, null, null)) {
+                if (!m.isStatic() || !m.isPackage())  continue;
+                MethodType type = m.getMethodType();
+                if (type.equals(INVOKER_METHOD_TYPE) &&
+                    m.getName().startsWith("invoke_")) {
+                    String sig = m.getName().substring("invoke_".length());
+                    int arity = LambdaForm.signatureArity(sig);
+                    MethodType srcType = MethodType.genericMethodType(arity);
+                    if (LambdaForm.signatureReturn(sig) == 'V')
+                        srcType = srcType.changeReturnType(void.class);
+                    MethodTypeForm typeForm = srcType.form();
+                    typeForm.namedFunctionInvoker = DirectMethodHandle.make(m);
+                }
+            }
+        }
+
+        // The following are predefined NamedFunction invokers.  The system must build
+        // a separate invoker for each distinct signature.
+        /** void return type invokers. */
+        @Hidden
+        static Object invoke__V(MethodHandle mh, Object[] a) throws Throwable {
+            assert(a.length == 0);
+            mh.invokeBasic();
+            return null;
+        }
+        @Hidden
+        static Object invoke_L_V(MethodHandle mh, Object[] a) throws Throwable {
+            assert(a.length == 1);
+            mh.invokeBasic(a[0]);
+            return null;
+        }
+        @Hidden
+        static Object invoke_LL_V(MethodHandle mh, Object[] a) throws Throwable {
+            assert(a.length == 2);
+            mh.invokeBasic(a[0], a[1]);
+            return null;
+        }
+        @Hidden
+        static Object invoke_LLL_V(MethodHandle mh, Object[] a) throws Throwable {
+            assert(a.length == 3);
+            mh.invokeBasic(a[0], a[1], a[2]);
+            return null;
+        }
+        @Hidden
+        static Object invoke_LLLL_V(MethodHandle mh, Object[] a) throws Throwable {
+            assert(a.length == 4);
+            mh.invokeBasic(a[0], a[1], a[2], a[3]);
+            return null;
+        }
+        @Hidden
+        static Object invoke_LLLLL_V(MethodHandle mh, Object[] a) throws Throwable {
+            assert(a.length == 5);
+            mh.invokeBasic(a[0], a[1], a[2], a[3], a[4]);
+            return null;
+        }
+        /** Object return type invokers. */
+        @Hidden
+        static Object invoke__L(MethodHandle mh, Object[] a) throws Throwable {
+            assert(a.length == 0);
+            return mh.invokeBasic();
+        }
+        @Hidden
+        static Object invoke_L_L(MethodHandle mh, Object[] a) throws Throwable {
+            assert(a.length == 1);
+            return mh.invokeBasic(a[0]);
+        }
+        @Hidden
+        static Object invoke_LL_L(MethodHandle mh, Object[] a) throws Throwable {
+            assert(a.length == 2);
+            return mh.invokeBasic(a[0], a[1]);
+        }
+        @Hidden
+        static Object invoke_LLL_L(MethodHandle mh, Object[] a) throws Throwable {
+            assert(a.length == 3);
+            return mh.invokeBasic(a[0], a[1], a[2]);
+        }
+        @Hidden
+        static Object invoke_LLLL_L(MethodHandle mh, Object[] a) throws Throwable {
+            assert(a.length == 4);
+            return mh.invokeBasic(a[0], a[1], a[2], a[3]);
+        }
+        @Hidden
+        static Object invoke_LLLLL_L(MethodHandle mh, Object[] a) throws Throwable {
+            assert(a.length == 5);
+            return mh.invokeBasic(a[0], a[1], a[2], a[3], a[4]);
+        }
+
+        static final MethodType INVOKER_METHOD_TYPE =
+            MethodType.methodType(Object.class, MethodHandle.class, Object[].class);
+
+        private static MethodHandle computeInvoker(MethodTypeForm typeForm) {
+            MethodHandle mh = typeForm.namedFunctionInvoker;
+            if (mh != null)  return mh;
+            MemberName invoker = InvokerBytecodeGenerator.generateNamedFunctionInvoker(typeForm);  // this could take a while
+            mh = DirectMethodHandle.make(invoker);
+            MethodHandle mh2 = typeForm.namedFunctionInvoker;
+            if (mh2 != null)  return mh2;  // benign race
+            if (!mh.type().equals(INVOKER_METHOD_TYPE))
+                throw new InternalError(mh.debugString());
+            return typeForm.namedFunctionInvoker = mh;
+        }
+
+        @Hidden
+        Object invokeWithArguments(Object... arguments) throws Throwable {
+            // If we have a cached invoker, call it right away.
+            // NOTE: The invoker always returns a reference value.
+            if (TRACE_INTERPRETER)  return invokeWithArgumentsTracing(arguments);
+            assert(checkArgumentTypes(arguments, methodType()));
+            return invoker().invokeBasic(resolvedHandle(), arguments);
+        }
+
+        @Hidden
+        Object invokeWithArgumentsTracing(Object[] arguments) throws Throwable {
+            Object rval;
+            try {
+                traceInterpreter("[ call", this, arguments);
+                if (invoker == null) {
+                    traceInterpreter("| getInvoker", this);
+                    invoker();
+                }
+                if (resolvedHandle == null) {
+                    traceInterpreter("| resolve", this);
+                    resolvedHandle();
+                }
+                assert(checkArgumentTypes(arguments, methodType()));
+                rval = invoker().invokeBasic(resolvedHandle(), arguments);
+            } catch (Throwable ex) {
+                traceInterpreter("] throw =>", ex);
+                throw ex;
+            }
+            traceInterpreter("] return =>", rval);
+            return rval;
+        }
+
+        private MethodHandle invoker() {
+            if (invoker != null)  return invoker;
+            // Get an invoker and cache it.
+            return invoker = computeInvoker(methodType().form());
+        }
+
+        private static boolean checkArgumentTypes(Object[] arguments, MethodType methodType) {
+            if (true)  return true;  // FIXME
+            MethodType dstType = methodType.form().erasedType();
+            MethodType srcType = dstType.basicType().wrap();
+            Class<?>[] ptypes = new Class<?>[arguments.length];
+            for (int i = 0; i < arguments.length; i++) {
+                Object arg = arguments[i];
+                Class<?> ptype = arg == null ? Object.class : arg.getClass();
+                // If the dest. type is a primitive we keep the
+                // argument type.
+                ptypes[i] = dstType.parameterType(i).isPrimitive() ? ptype : Object.class;
+            }
+            MethodType argType = MethodType.methodType(srcType.returnType(), ptypes).wrap();
+            assert(argType.isConvertibleTo(srcType)) : "wrong argument types: cannot convert " + argType + " to " + srcType;
+            return true;
+        }
+
+        String basicTypeSignature() {
+            //return LambdaForm.basicTypeSignature(resolvedHandle.type());
+            return LambdaForm.basicTypeSignature(methodType());
+        }
+
+        MethodType methodType() {
+            if (resolvedHandle != null)
+                return resolvedHandle.type();
+            else
+                // only for certain internal LFs during bootstrapping
+                return member.getInvocationType();
+        }
+
+        MemberName member() {
+            assert(assertMemberIsConsistent());
+            return member;
+        }
+
+        // Called only from assert.
+        private boolean assertMemberIsConsistent() {
+            if (resolvedHandle instanceof DirectMethodHandle) {
+                MemberName m = resolvedHandle.internalMemberName();
+                assert(m.equals(member));
+            }
+            return true;
+        }
+
+        Class<?> memberDeclaringClassOrNull() {
+            return (member == null) ? null : member.getDeclaringClass();
+        }
+
+        char returnType() {
+            return basicType(methodType().returnType());
+        }
+
+        char parameterType(int n) {
+            return basicType(methodType().parameterType(n));
+        }
+
+        int arity() {
+            //int siglen = member.getMethodType().parameterCount();
+            //if (!member.isStatic())  siglen += 1;
+            //return siglen;
+            return methodType().parameterCount();
+        }
+
+        public String toString() {
+            if (member == null)  return resolvedHandle.toString();
+            return member.getDeclaringClass().getSimpleName()+"."+member.getName();
+        }
+    }
+
+    void resolve() {
+        for (Name n : names) n.resolve();
+    }
+
+    public static char basicType(Class<?> type) {
+        char c = Wrapper.basicTypeChar(type);
+        if ("ZBSC".indexOf(c) >= 0)  c = 'I';
+        assert("LIJFDV".indexOf(c) >= 0);
+        return c;
+    }
+    public static char[] basicTypes(List<Class<?>> types) {
+        char[] btypes = new char[types.size()];
+        for (int i = 0; i < btypes.length; i++) {
+            btypes[i] = basicType(types.get(i));
+        }
+        return btypes;
+    }
+    public static String basicTypeSignature(MethodType type) {
+        char[] sig = new char[type.parameterCount() + 2];
+        int sigp = 0;
+        for (Class<?> pt : type.parameterList()) {
+            sig[sigp++] = basicType(pt);
+        }
+        sig[sigp++] = '_';
+        sig[sigp++] = basicType(type.returnType());
+        assert(sigp == sig.length);
+        return String.valueOf(sig);
+    }
+
+    static final class Name {
+        final char type;
+        private short index;
+        final NamedFunction function;
+        final Object[] arguments;
+
+        private Name(int index, char type, NamedFunction function, Object[] arguments) {
+            this.index = (short)index;
+            this.type = type;
+            this.function = function;
+            this.arguments = arguments;
+            assert(this.index == index);
+        }
+        Name(MethodHandle function, Object... arguments) {
+            this(new NamedFunction(function), arguments);
+        }
+        Name(MemberName function, Object... arguments) {
+            this(new NamedFunction(function), arguments);
+        }
+        Name(NamedFunction function, Object... arguments) {
+            this(-1, function.returnType(), function, arguments = arguments.clone());
+            assert(arguments.length == function.arity()) : "arity mismatch: arguments.length=" + arguments.length + " == function.arity()=" + function.arity() + " in " + debugString();
+            for (int i = 0; i < arguments.length; i++)
+                assert(typesMatch(function.parameterType(i), arguments[i])) : "types don't match: function.parameterType(" + i + ")=" + function.parameterType(i) + ", arguments[" + i + "]=" + arguments[i] + " in " + debugString();
+        }
+        Name(int index, char type) {
+            this(index, type, null, null);
+        }
+        Name(char type) {
+            this(-1, type);
+        }
+
+        char type() { return type; }
+        int index() { return index; }
+        boolean initIndex(int i) {
+            if (index != i) {
+                if (index != -1)  return false;
+                index = (short)i;
+            }
+            return true;
+        }
+
+
+        void resolve() {
+            if (function != null)
+                function.resolve();
+        }
+
+        Name newIndex(int i) {
+            if (initIndex(i))  return this;
+            return cloneWithIndex(i);
+        }
+        Name cloneWithIndex(int i) {
+            Object[] newArguments = (arguments == null) ? null : arguments.clone();
+            return new Name(i, type, function, newArguments);
+        }
+        Name replaceName(Name oldName, Name newName) {  // FIXME: use replaceNames uniformly
+            if (oldName == newName)  return this;
+            @SuppressWarnings("LocalVariableHidesMemberVariable")
+            Object[] arguments = this.arguments;
+            if (arguments == null)  return this;
+            boolean replaced = false;
+            for (int j = 0; j < arguments.length; j++) {
+                if (arguments[j] == oldName) {
+                    if (!replaced) {
+                        replaced = true;
+                        arguments = arguments.clone();
+                    }
+                    arguments[j] = newName;
+                }
+            }
+            if (!replaced)  return this;
+            return new Name(function, arguments);
+        }
+        Name replaceNames(Name[] oldNames, Name[] newNames, int start, int end) {
+            @SuppressWarnings("LocalVariableHidesMemberVariable")
+            Object[] arguments = this.arguments;
+            boolean replaced = false;
+        eachArg:
+            for (int j = 0; j < arguments.length; j++) {
+                if (arguments[j] instanceof Name) {
+                    Name n = (Name) arguments[j];
+                    int check = n.index;
+                    // harmless check to see if the thing is already in newNames:
+                    if (check >= 0 && check < newNames.length && n == newNames[check])
+                        continue eachArg;
+                    // n might not have the correct index: n != oldNames[n.index].
+                    for (int i = start; i < end; i++) {
+                        if (n == oldNames[i]) {
+                            if (n == newNames[i])
+                                continue eachArg;
+                            if (!replaced) {
+                                replaced = true;
+                                arguments = arguments.clone();
+                            }
+                            arguments[j] = newNames[i];
+                            continue eachArg;
+                        }
+                    }
+                }
+            }
+            if (!replaced)  return this;
+            return new Name(function, arguments);
+        }
+        void internArguments() {
+            @SuppressWarnings("LocalVariableHidesMemberVariable")
+            Object[] arguments = this.arguments;
+            for (int j = 0; j < arguments.length; j++) {
+                if (arguments[j] instanceof Name) {
+                    Name n = (Name) arguments[j];
+                    if (n.isParam() && n.index < INTERNED_ARGUMENT_LIMIT)
+                        arguments[j] = internArgument(n);
+                }
+            }
+        }
+        boolean isParam() {
+            return function == null;
+        }
+        boolean isConstantZero() {
+            return !isParam() && arguments.length == 0 && function.equals(constantZero(0, type).function);
+        }
+
+        public String toString() {
+            return (isParam()?"a":"t")+(index >= 0 ? index : System.identityHashCode(this))+":"+type;
+        }
+        public String debugString() {
+            String s = toString();
+            return (function == null) ? s : s + "=" + exprString();
+        }
+        public String exprString() {
+            if (function == null)  return "null";
+            StringBuilder buf = new StringBuilder(function.toString());
+            buf.append("(");
+            String cma = "";
+            for (Object a : arguments) {
+                buf.append(cma); cma = ",";
+                if (a instanceof Name || a instanceof Integer)
+                    buf.append(a);
+                else
+                    buf.append("(").append(a).append(")");
+            }
+            buf.append(")");
+            return buf.toString();
+        }
+
+        private static boolean typesMatch(char parameterType, Object object) {
+            if (object instanceof Name) {
+                return ((Name)object).type == parameterType;
+            }
+            switch (parameterType) {
+                case 'I':  return object instanceof Integer;
+                case 'J':  return object instanceof Long;
+                case 'F':  return object instanceof Float;
+                case 'D':  return object instanceof Double;
+            }
+            assert(parameterType == 'L');
+            return true;
+        }
+
+        /**
+         * Does this Name precede the given binding node in some canonical order?
+         * This predicate is used to order data bindings (via insertion sort)
+         * with some stability.
+         * @param binding
+         * @return
+         */
+        boolean isSiblingBindingBefore(Name binding) {
+            assert(!binding.isParam());
+            if (isParam())  return true;
+            if (function.equals(binding.function) &&
+                arguments.length == binding.arguments.length) {
+                boolean sawInt = false;
+                for (int i = 0; i < arguments.length; i++) {
+                    Object a1 = arguments[i];
+                    Object a2 = binding.arguments[i];
+                    if (!a1.equals(a2)) {
+                        if (a1 instanceof Integer && a2 instanceof Integer) {
+                            if (sawInt)  continue;
+                            sawInt = true;
+                            if ((int)a1 < (int)a2)  continue;  // still might be true
+                        }
+                        return false;
+                    }
+                }
+                return sawInt;
+            }
+            return false;
+        }
+
+        public boolean equals(Name that) {
+            if (this == that)  return true;
+            if (isParam())
+                // each parameter is a unique atom
+                return false;  // this != that
+            return
+                //this.index == that.index &&
+                this.type == that.type &&
+                this.function.equals(that.function) &&
+                Arrays.equals(this.arguments, that.arguments);
+        }
+        @Override
+        public boolean equals(Object x) {
+            return x instanceof Name && equals((Name)x);
+        }
+        @Override
+        public int hashCode() {
+            if (isParam())
+                return index | (type << 8);
+            return function.hashCode() ^ Arrays.hashCode(arguments);
+        }
+    }
+
+    static Name argument(int which, char type) {
+        int tn = ALL_TYPES.indexOf(type);
+        if (tn < 0 || which >= INTERNED_ARGUMENT_LIMIT)
+            return new Name(which, type);
+        return INTERNED_ARGUMENTS[tn][which];
+    }
+    static Name internArgument(Name n) {
+        assert(n.isParam()) : "not param: " + n;
+        assert(n.index < INTERNED_ARGUMENT_LIMIT);
+        return argument(n.index, n.type);
+    }
+    static Name[] arguments(int extra, String types) {
+        int length = types.length();
+        Name[] names = new Name[length + extra];
+        for (int i = 0; i < length; i++)
+            names[i] = argument(i, types.charAt(i));
+        return names;
+    }
+    static Name[] arguments(int extra, char... types) {
+        int length = types.length;
+        Name[] names = new Name[length + extra];
+        for (int i = 0; i < length; i++)
+            names[i] = argument(i, types[i]);
+        return names;
+    }
+    static Name[] arguments(int extra, List<Class<?>> types) {
+        int length = types.size();
+        Name[] names = new Name[length + extra];
+        for (int i = 0; i < length; i++)
+            names[i] = argument(i, basicType(types.get(i)));
+        return names;
+    }
+    static Name[] arguments(int extra, Class<?>... types) {
+        int length = types.length;
+        Name[] names = new Name[length + extra];
+        for (int i = 0; i < length; i++)
+            names[i] = argument(i, basicType(types[i]));
+        return names;
+    }
+    static Name[] arguments(int extra, MethodType types) {
+        int length = types.parameterCount();
+        Name[] names = new Name[length + extra];
+        for (int i = 0; i < length; i++)
+            names[i] = argument(i, basicType(types.parameterType(i)));
+        return names;
+    }
+    static final String ALL_TYPES = "LIJFD";  // omit V, not an argument type
+    static final int INTERNED_ARGUMENT_LIMIT = 10;
+    private static final Name[][] INTERNED_ARGUMENTS
+            = new Name[ALL_TYPES.length()][INTERNED_ARGUMENT_LIMIT];
+    static {
+        for (int tn = 0; tn < ALL_TYPES.length(); tn++) {
+            for (int i = 0; i < INTERNED_ARGUMENTS[tn].length; i++) {
+                char type = ALL_TYPES.charAt(tn);
+                INTERNED_ARGUMENTS[tn][i] = new Name(i, type);
+            }
+        }
+    }
+
+    private static final MemberName.Factory IMPL_NAMES = MemberName.getFactory();
+
+    static Name constantZero(int which, char type) {
+        return CONSTANT_ZERO[ALL_TYPES.indexOf(type)].newIndex(which);
+    }
+    private static final Name[] CONSTANT_ZERO
+            = new Name[ALL_TYPES.length()];
+    static {
+        for (int tn = 0; tn < ALL_TYPES.length(); tn++) {
+            char bt = ALL_TYPES.charAt(tn);
+            Wrapper wrap = Wrapper.forBasicType(bt);
+            MemberName zmem = new MemberName(LambdaForm.class, "zero"+bt, MethodType.methodType(wrap.primitiveType()), REF_invokeStatic);
+            try {
+                zmem = IMPL_NAMES.resolveOrFail(REF_invokeStatic, zmem, null, NoSuchMethodException.class);
+            } catch (IllegalAccessException|NoSuchMethodException ex) {
+                throw newInternalError(ex);
+            }
+            NamedFunction zcon = new NamedFunction(zmem);
+            Name n = new Name(zcon).newIndex(0);
+            assert(n.type == ALL_TYPES.charAt(tn));
+            CONSTANT_ZERO[tn] = n;
+            assert(n.isConstantZero());
+        }
+    }
+
+    // Avoid appealing to ValueConversions at bootstrap time:
+    private static int zeroI() { return 0; }
+    private static long zeroJ() { return 0; }
+    private static float zeroF() { return 0; }
+    private static double zeroD() { return 0; }
+    private static Object zeroL() { return null; }
+
+    // Put this last, so that previous static inits can run before.
+    static {
+        if (USE_PREDEFINED_INTERPRET_METHODS)
+            PREPARED_FORMS.putAll(computeInitialPreparedForms());
+    }
+
+    /**
+     * Internal marker for byte-compiled LambdaForms.
+     */
+    /*non-public*/
+    @Target(ElementType.METHOD)
+    @Retention(RetentionPolicy.RUNTIME)
+    @interface Compiled {
+    }
+
+    /**
+     * Internal marker for LambdaForm interpreter frames.
+     */
+    /*non-public*/
+    @Target(ElementType.METHOD)
+    @Retention(RetentionPolicy.RUNTIME)
+    @interface Hidden {
+    }
+
+
+/*
+    // Smoke-test for the invokers used in this file.
+    static void testMethodHandleLinkers() throws Throwable {
+        MemberName.Factory lookup = MemberName.getFactory();
+        MemberName asList_MN = new MemberName(Arrays.class, "asList",
+                                              MethodType.methodType(List.class, Object[].class),
+                                              REF_invokeStatic);
+        //MethodHandleNatives.resolve(asList_MN, null);
+        asList_MN = lookup.resolveOrFail(asList_MN, REF_invokeStatic, null, NoSuchMethodException.class);
+        System.out.println("about to call "+asList_MN);
+        Object[] abc = { "a", "bc" };
+        List<?> lst = (List<?>) MethodHandle.linkToStatic(abc, asList_MN);
+        System.out.println("lst="+lst);
+        MemberName toString_MN = new MemberName(Object.class.getMethod("toString"));
+        String s1 = (String) MethodHandle.linkToVirtual(lst, toString_MN);
+        toString_MN = new MemberName(Object.class.getMethod("toString"), true);
+        String s2 = (String) MethodHandle.linkToSpecial(lst, toString_MN);
+        System.out.println("[s1,s2,lst]="+Arrays.asList(s1, s2, lst.toString()));
+        MemberName toArray_MN = new MemberName(List.class.getMethod("toArray"));
+        Object[] arr = (Object[]) MethodHandle.linkToInterface(lst, toArray_MN);
+        System.out.println("toArray="+Arrays.toString(arr));
+    }
+    static { try { testMethodHandleLinkers(); } catch (Throwable ex) { throw new RuntimeException(ex); } }
+    // Requires these definitions in MethodHandle:
+    static final native Object linkToStatic(Object x1, MemberName mn) throws Throwable;
+    static final native Object linkToVirtual(Object x1, MemberName mn) throws Throwable;
+    static final native Object linkToSpecial(Object x1, MemberName mn) throws Throwable;
+    static final native Object linkToInterface(Object x1, MemberName mn) throws Throwable;
+ */
+
+    static { NamedFunction.initializeInvokers(); }
+}
--- a/src/share/classes/java/lang/invoke/MemberName.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/lang/invoke/MemberName.java	Fri Jun 21 19:11:42 2013 -0700
@@ -26,6 +26,8 @@
 package java.lang.invoke;
 
 import sun.invoke.util.BytecodeDescriptor;
+import sun.invoke.util.VerifyAccess;
+
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
@@ -38,6 +40,7 @@
 import java.util.List;
 import static java.lang.invoke.MethodHandleNatives.Constants.*;
 import static java.lang.invoke.MethodHandleStatics.*;
+import java.util.Objects;
 
 /**
  * A {@code MemberName} is a compact symbolic datum which fully characterizes
@@ -71,19 +74,14 @@
     private String     name;        // may be null if not yet materialized
     private Object     type;        // may be null if not yet materialized
     private int        flags;       // modifier bits; see reflect.Modifier
-
-    private Object     vmtarget;    // VM-specific target value
-    private int        vmindex;     // method index within class or interface
-
-    { vmindex = VM_INDEX_UNINITIALIZED; }
+    //@Injected JVM_Method* vmtarget;
+    //@Injected int         vmindex;
+    private Object     resolution;  // if null, this guy is resolved
 
     /** Return the declaring class of this member.
      *  In the case of a bare name and type, the declaring class will be null.
      */
     public Class<?> getDeclaringClass() {
-        if (clazz == null && isResolved()) {
-            expandFromVM();
-        }
         return clazz;
     }
 
@@ -105,6 +103,16 @@
         return name;
     }
 
+    public MethodType getMethodOrFieldType() {
+        if (isInvocable())
+            return getMethodType();
+        if (isGetter())
+            return MethodType.methodType(getFieldType());
+        if (isSetter())
+            return MethodType.methodType(void.class, getFieldType());
+        throw new InternalError("not a method or field: "+this);
+    }
+
     /** Return the declared type of this member, which
      *  must be a method or constructor.
      */
@@ -140,9 +148,11 @@
      *  a reference to declaring class.  For static methods, it is the same as the declared type.
      */
     public MethodType getInvocationType() {
-        MethodType itype = getMethodType();
+        MethodType itype = getMethodOrFieldType();
+        if (isConstructor() && getReferenceKind() == REF_newInvokeSpecial)
+            return itype.changeReturnType(clazz);
         if (!isStatic())
-            itype = itype.insertParameterTypes(0, clazz);
+            return itype.insertParameterTypes(0, clazz);
         return itype;
     }
 
@@ -208,9 +218,92 @@
         return (flags & RECOGNIZED_MODIFIERS);
     }
 
-    private void setFlags(int flags) {
-        this.flags = flags;
-        assert(testAnyFlags(ALL_KINDS));
+    /** Return the reference kind of this member, or zero if none.
+     */
+    public byte getReferenceKind() {
+        return (byte) ((flags >>> MN_REFERENCE_KIND_SHIFT) & MN_REFERENCE_KIND_MASK);
+    }
+    private boolean referenceKindIsConsistent() {
+        byte refKind = getReferenceKind();
+        if (refKind == REF_NONE)  return isType();
+        if (isField()) {
+            assert(staticIsConsistent());
+            assert(MethodHandleNatives.refKindIsField(refKind));
+        } else if (isConstructor()) {
+            assert(refKind == REF_newInvokeSpecial || refKind == REF_invokeSpecial);
+        } else if (isMethod()) {
+            assert(staticIsConsistent());
+            assert(MethodHandleNatives.refKindIsMethod(refKind));
+            if (clazz.isInterface())
+                assert(refKind == REF_invokeInterface ||
+                       refKind == REF_invokeVirtual && isObjectPublicMethod());
+        } else {
+            assert(false);
+        }
+        return true;
+    }
+    private boolean isObjectPublicMethod() {
+        if (clazz == Object.class)  return true;
+        MethodType mtype = getMethodType();
+        if (name.equals("toString") && mtype.returnType() == String.class && mtype.parameterCount() == 0)
+            return true;
+        if (name.equals("hashCode") && mtype.returnType() == int.class && mtype.parameterCount() == 0)
+            return true;
+        if (name.equals("equals") && mtype.returnType() == boolean.class && mtype.parameterCount() == 1 && mtype.parameterType(0) == Object.class)
+            return true;
+        return false;
+    }
+    /*non-public*/ boolean referenceKindIsConsistentWith(int originalRefKind) {
+        int refKind = getReferenceKind();
+        if (refKind == originalRefKind)  return true;
+        switch (originalRefKind) {
+        case REF_invokeInterface:
+            // Looking up an interface method, can get (e.g.) Object.hashCode
+            assert(refKind == REF_invokeVirtual ||
+                   refKind == REF_invokeSpecial) : this;
+            return true;
+        case REF_invokeVirtual:
+        case REF_newInvokeSpecial:
+            // Looked up a virtual, can get (e.g.) final String.hashCode.
+            assert(refKind == REF_invokeSpecial) : this;
+            return true;
+        }
+        assert(false) : this;
+        return true;
+    }
+    private boolean staticIsConsistent() {
+        byte refKind = getReferenceKind();
+        return MethodHandleNatives.refKindIsStatic(refKind) == isStatic() || getModifiers() == 0;
+    }
+    private boolean vminfoIsConsistent() {
+        byte refKind = getReferenceKind();
+        assert(isResolved());  // else don't call
+        Object vminfo = MethodHandleNatives.getMemberVMInfo(this);
+        assert(vminfo instanceof Object[]);
+        long vmindex = (Long) ((Object[])vminfo)[0];
+        Object vmtarget = ((Object[])vminfo)[1];
+        if (MethodHandleNatives.refKindIsField(refKind)) {
+            assert(vmindex >= 0) : vmindex + ":" + this;
+            assert(vmtarget instanceof Class);
+        } else {
+            if (MethodHandleNatives.refKindDoesDispatch(refKind))
+                assert(vmindex >= 0) : vmindex + ":" + this;
+            else
+                assert(vmindex < 0) : vmindex;
+            assert(vmtarget instanceof MemberName) : vmtarget + " in " + this;
+        }
+        return true;
+    }
+
+    private MemberName changeReferenceKind(byte refKind, byte oldKind) {
+        assert(getReferenceKind() == oldKind);
+        assert(MethodHandleNatives.refKindIsValid(refKind));
+        flags += (((int)refKind - oldKind) << MN_REFERENCE_KIND_SHIFT);
+//        if (isConstructor() && refKind != REF_newInvokeSpecial)
+//            flags += (IS_METHOD - IS_CONSTRUCTOR);
+//        else if (refKind == REF_newInvokeSpecial && isMethod())
+//            flags += (IS_CONSTRUCTOR - IS_METHOD);
+        return this;
     }
 
     private boolean testFlags(int mask, int value) {
@@ -223,6 +316,17 @@
         return !testFlags(mask, 0);
     }
 
+    /** Utility method to query if this member is a method handle invocation (invoke or invokeExact). */
+    public boolean isMethodHandleInvoke() {
+        final int bits = Modifier.NATIVE | Modifier.FINAL;
+        final int negs = Modifier.STATIC;
+        if (testFlags(bits | negs, bits) &&
+            clazz == MethodHandle.class) {
+            return name.equals("invoke") || name.equals("invokeExact");
+        }
+        return false;
+    }
+
     /** Utility method to query the modifier flags of this member. */
     public boolean isStatic() {
         return Modifier.isStatic(flags);
@@ -243,10 +347,22 @@
     public boolean isFinal() {
         return Modifier.isFinal(flags);
     }
+    /** Utility method to query whether this member or its defining class is final. */
+    public boolean canBeStaticallyBound() {
+        return Modifier.isFinal(flags | clazz.getModifiers());
+    }
+    /** Utility method to query the modifier flags of this member. */
+    public boolean isVolatile() {
+        return Modifier.isVolatile(flags);
+    }
     /** Utility method to query the modifier flags of this member. */
     public boolean isAbstract() {
         return Modifier.isAbstract(flags);
     }
+    /** Utility method to query the modifier flags of this member. */
+    public boolean isNative() {
+        return Modifier.isNative(flags);
+    }
     // let the rest (native, volatile, transient, etc.) be tested via Modifier.isFoo
 
     // unofficial modifier flags, used by HotSpot:
@@ -280,15 +396,12 @@
             IS_FIELD            = MN_IS_FIELD,         // field
             IS_TYPE             = MN_IS_TYPE,          // nested type
             IS_CALLER_SENSITIVE = MN_CALLER_SENSITIVE; // @CallerSensitive annotation
-    static final int  // for MethodHandleNatives.getMembers
-            SEARCH_SUPERCLASSES = MN_SEARCH_SUPERCLASSES,
-            SEARCH_INTERFACES   = MN_SEARCH_INTERFACES;
 
     static final int ALL_ACCESS = Modifier.PUBLIC | Modifier.PRIVATE | Modifier.PROTECTED;
     static final int ALL_KINDS = IS_METHOD | IS_CONSTRUCTOR | IS_FIELD | IS_TYPE;
     static final int IS_INVOCABLE = IS_METHOD | IS_CONSTRUCTOR;
     static final int IS_FIELD_OR_METHOD = IS_METHOD | IS_FIELD;
-    static final int SEARCH_ALL_SUPERS = SEARCH_SUPERCLASSES | SEARCH_INTERFACES;
+    static final int SEARCH_ALL_SUPERS = MN_SEARCH_SUPERCLASSES | MN_SEARCH_INTERFACES;
 
     /** Utility method to query whether this member is a method or constructor. */
     public boolean isInvocable() {
@@ -323,6 +436,12 @@
         return testAllFlags(IS_CALLER_SENSITIVE);
     }
 
+    /** Utility method to query whether this member is accessible from a given lookup class. */
+    public boolean isAccessibleFrom(Class<?> lookupClass) {
+        return VerifyAccess.isMemberAccessible(this.getDeclaringClass(), this.getDeclaringClass(), flags,
+                                               lookupClass, ALL_ACCESS|MethodHandles.Lookup.PACKAGE);
+    }
+
     /** Initialize a query.   It is not resolved. */
     private void init(Class<?> defClass, String name, Object type, int flags) {
         // defining class is allowed to be null (for a naked name/type pair)
@@ -332,8 +451,10 @@
         this.clazz = defClass;
         this.name = name;
         this.type = type;
-        setFlags(flags);
-        assert(!isResolved());
+        this.flags = flags;
+        assert(testAnyFlags(ALL_KINDS));
+        assert(this.resolution == null);  // nobody should have touched this yet
+        //assert(referenceKindIsConsistent());  // do this after resolution
     }
 
     private void expandFromVM() {
@@ -344,39 +465,94 @@
     }
 
     // Capturing information from the Core Reflection API:
-    private static int flagsMods(int flags, int mods) {
+    private static int flagsMods(int flags, int mods, byte refKind) {
         assert((flags & RECOGNIZED_MODIFIERS) == 0);
         assert((mods & ~RECOGNIZED_MODIFIERS) == 0);
-        return flags | mods;
+        assert((refKind & ~MN_REFERENCE_KIND_MASK) == 0);
+        return flags | mods | (refKind << MN_REFERENCE_KIND_SHIFT);
     }
     /** Create a name for the given reflected method.  The resulting name will be in a resolved state. */
     public MemberName(Method m) {
-        Object[] typeInfo = { m.getReturnType(), m.getParameterTypes() };
-        init(m.getDeclaringClass(), m.getName(), typeInfo, flagsMods(IS_METHOD, m.getModifiers()));
+        this(m, false);
+    }
+    @SuppressWarnings("LeakingThisInConstructor")
+    public MemberName(Method m, boolean wantSpecial) {
+        m.getClass();  // NPE check
         // fill in vmtarget, vmindex while we have m in hand:
         MethodHandleNatives.init(this, m);
-        assert(isResolved());
+        assert(isResolved() && this.clazz != null);
+        this.name = m.getName();
+        if (this.type == null)
+            this.type = new Object[] { m.getReturnType(), m.getParameterTypes() };
+        if (wantSpecial) {
+            if (getReferenceKind() == REF_invokeVirtual)
+                changeReferenceKind(REF_invokeSpecial, REF_invokeVirtual);
+        }
+    }
+    public MemberName asSpecial() {
+        switch (getReferenceKind()) {
+        case REF_invokeSpecial:     return this;
+        case REF_invokeVirtual:     return clone().changeReferenceKind(REF_invokeSpecial, REF_invokeVirtual);
+        case REF_newInvokeSpecial:  return clone().changeReferenceKind(REF_invokeSpecial, REF_newInvokeSpecial);
+        }
+        throw new IllegalArgumentException(this.toString());
+    }
+    public MemberName asConstructor() {
+        switch (getReferenceKind()) {
+        case REF_invokeSpecial:     return clone().changeReferenceKind(REF_newInvokeSpecial, REF_invokeSpecial);
+        case REF_newInvokeSpecial:  return this;
+        }
+        throw new IllegalArgumentException(this.toString());
     }
     /** Create a name for the given reflected constructor.  The resulting name will be in a resolved state. */
-    public MemberName(Constructor ctor) {
-        Object[] typeInfo = { void.class, ctor.getParameterTypes() };
-        init(ctor.getDeclaringClass(), CONSTRUCTOR_NAME, typeInfo, flagsMods(IS_CONSTRUCTOR, ctor.getModifiers()));
+    @SuppressWarnings("LeakingThisInConstructor")
+    public MemberName(Constructor<?> ctor) {
+        ctor.getClass();  // NPE check
         // fill in vmtarget, vmindex while we have ctor in hand:
         MethodHandleNatives.init(this, ctor);
-        assert(isResolved());
+        assert(isResolved() && this.clazz != null);
+        this.name = CONSTRUCTOR_NAME;
+        if (this.type == null)
+            this.type = new Object[] { void.class, ctor.getParameterTypes() };
     }
-    /** Create a name for the given reflected field.  The resulting name will be in a resolved state. */
+    /** Create a name for the given reflected field.  The resulting name will be in a resolved state.
+     */
     public MemberName(Field fld) {
-        init(fld.getDeclaringClass(), fld.getName(), fld.getType(), flagsMods(IS_FIELD, fld.getModifiers()));
+        this(fld, false);
+    }
+    @SuppressWarnings("LeakingThisInConstructor")
+    public MemberName(Field fld, boolean makeSetter) {
+        fld.getClass();  // NPE check
         // fill in vmtarget, vmindex while we have fld in hand:
         MethodHandleNatives.init(this, fld);
-        assert(isResolved());
+        assert(isResolved() && this.clazz != null);
+        this.name = fld.getName();
+        this.type = fld.getType();
+        assert((REF_putStatic - REF_getStatic) == (REF_putField - REF_getField));
+        byte refKind = this.getReferenceKind();
+        assert(refKind == (isStatic() ? REF_getStatic : REF_getField));
+        if (makeSetter) {
+            changeReferenceKind((byte)(refKind + (REF_putStatic - REF_getStatic)), refKind);
+        }
+    }
+    public boolean isGetter() {
+        return MethodHandleNatives.refKindIsGetter(getReferenceKind());
+    }
+    public boolean isSetter() {
+        return MethodHandleNatives.refKindIsSetter(getReferenceKind());
+    }
+    public MemberName asSetter() {
+        byte refKind = getReferenceKind();
+        assert(MethodHandleNatives.refKindIsGetter(refKind));
+        assert((REF_putStatic - REF_getStatic) == (REF_putField - REF_getField));
+        byte setterRefKind = (byte)(refKind + (REF_putField - REF_getField));
+        return clone().changeReferenceKind(setterRefKind, refKind);
     }
     /** Create a name for the given class.  The resulting name will be in a resolved state. */
     public MemberName(Class<?> type) {
-        init(type.getDeclaringClass(), type.getSimpleName(), type, flagsMods(IS_TYPE, type.getModifiers()));
-        vmindex = 0;  // isResolved
-        assert(isResolved());
+        init(type.getDeclaringClass(), type.getSimpleName(), type,
+                flagsMods(IS_TYPE, type.getModifiers(), REF_NONE));
+        initResolved(true);
     }
 
     // bare-bones constructor; the JVM will fill it in
@@ -387,45 +563,93 @@
         try {
             return (MemberName) super.clone();
         } catch (CloneNotSupportedException ex) {
-            throw new InternalError();
+            throw newInternalError(ex);
         }
      }
 
-    // %%% define equals/hashcode?
+    /** Get the definition of this member name.
+     *  This may be in a super-class of the declaring class of this member.
+     */
+    public MemberName getDefinition() {
+        if (!isResolved())  throw new IllegalStateException("must be resolved: "+this);
+        if (isType())  return this;
+        MemberName res = this.clone();
+        res.clazz = null;
+        res.type = null;
+        res.name = null;
+        res.resolution = res;
+        res.expandFromVM();
+        assert(res.getName().equals(this.getName()));
+        return res;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(clazz, flags, name, getType());
+    }
+    @Override
+    public boolean equals(Object that) {
+        return (that instanceof MemberName && this.equals((MemberName)that));
+    }
+
+    /** Decide if two member names have exactly the same symbolic content.
+     *  Does not take into account any actual class members, so even if
+     *  two member names resolve to the same actual member, they may
+     *  be distinct references.
+     */
+    public boolean equals(MemberName that) {
+        if (this == that)  return true;
+        if (that == null)  return false;
+        return this.clazz == that.clazz
+                && this.flags == that.flags
+                && Objects.equals(this.name, that.name)
+                && Objects.equals(this.getType(), that.getType());
+    }
 
     // Construction from symbolic parts, for queries:
-    /** Create a field or type name from the given components:  Declaring class, name, type, modifiers.
+    /** Create a field or type name from the given components:  Declaring class, name, type, reference kind.
      *  The declaring class may be supplied as null if this is to be a bare name and type.
      *  The resulting name will in an unresolved state.
      */
-    public MemberName(Class<?> defClass, String name, Class<?> type, int modifiers) {
-        init(defClass, name, type, IS_FIELD | (modifiers & RECOGNIZED_MODIFIERS));
+    public MemberName(Class<?> defClass, String name, Class<?> type, byte refKind) {
+        init(defClass, name, type, flagsMods(IS_FIELD, 0, refKind));
+        initResolved(false);
     }
     /** Create a field or type name from the given components:  Declaring class, name, type.
      *  The declaring class may be supplied as null if this is to be a bare name and type.
      *  The modifier flags default to zero.
      *  The resulting name will in an unresolved state.
      */
-    public MemberName(Class<?> defClass, String name, Class<?> type) {
-        this(defClass, name, type, 0);
+    public MemberName(Class<?> defClass, String name, Class<?> type, Void unused) {
+        this(defClass, name, type, REF_NONE);
+        initResolved(false);
     }
     /** Create a method or constructor name from the given components:  Declaring class, name, type, modifiers.
      *  It will be a constructor if and only if the name is {@code "&lt;init&gt;"}.
      *  The declaring class may be supplied as null if this is to be a bare name and type.
+     *  The last argument is optional, a boolean which requests REF_invokeSpecial.
      *  The resulting name will in an unresolved state.
      */
-    public MemberName(Class<?> defClass, String name, MethodType type, int modifiers) {
-        int flagBit = (name.equals(CONSTRUCTOR_NAME) ? IS_CONSTRUCTOR : IS_METHOD);
-        init(defClass, name, type, flagBit | (modifiers & RECOGNIZED_MODIFIERS));
+    public MemberName(Class<?> defClass, String name, MethodType type, byte refKind) {
+        @SuppressWarnings("LocalVariableHidesMemberVariable")
+        int flags = (name != null && name.equals(CONSTRUCTOR_NAME) ? IS_CONSTRUCTOR : IS_METHOD);
+        init(defClass, name, type, flagsMods(flags, 0, refKind));
+        initResolved(false);
     }
-    /** Create a method or constructor name from the given components:  Declaring class, name, type, modifiers.
-     *  It will be a constructor if and only if the name is {@code "&lt;init&gt;"}.
-     *  The declaring class may be supplied as null if this is to be a bare name and type.
-     *  The modifier flags default to zero.
-     *  The resulting name will in an unresolved state.
+//    /** Create a method or constructor name from the given components:  Declaring class, name, type, modifiers.
+//     *  It will be a constructor if and only if the name is {@code "&lt;init&gt;"}.
+//     *  The declaring class may be supplied as null if this is to be a bare name and type.
+//     *  The modifier flags default to zero.
+//     *  The resulting name will in an unresolved state.
+//     */
+//    public MemberName(Class<?> defClass, String name, MethodType type, Void unused) {
+//        this(defClass, name, type, REF_NONE);
+//    }
+
+    /** Query whether this member name is resolved to a non-static, non-final method.
      */
-    public MemberName(Class<?> defClass, String name, MethodType type) {
-        this(defClass, name, type, 0);
+    public boolean hasReceiverTypeDispatch() {
+        return MethodHandleNatives.refKindDoesDispatch(getReferenceKind());
     }
 
     /** Query whether this member name is resolved.
@@ -434,15 +658,38 @@
      *  (Document?)
      */
     public boolean isResolved() {
-        return (vmindex != VM_INDEX_UNINITIALIZED);
+        return resolution == null;
+    }
+
+    private void initResolved(boolean isResolved) {
+        assert(this.resolution == null);  // not initialized yet!
+        if (!isResolved)
+            this.resolution = this;
+        assert(isResolved() == isResolved);
     }
 
-    /** Query whether this member name is resolved to a non-static, non-final method.
-     */
-    public boolean hasReceiverTypeDispatch() {
-        return (isMethod() && getVMIndex() >= 0);
+    void checkForTypeAlias() {
+        if (isInvocable()) {
+            MethodType type;
+            if (this.type instanceof MethodType)
+                type = (MethodType) this.type;
+            else
+                this.type = type = getMethodType();
+            if (type.erase() == type)  return;
+            if (VerifyAccess.isTypeVisible(type, clazz))  return;
+            throw new LinkageError("bad method type alias: "+type+" not visible from "+clazz);
+        } else {
+            Class<?> type;
+            if (this.type instanceof Class<?>)
+                type = (Class<?>) this.type;
+            else
+                this.type = type = getFieldType();
+            if (VerifyAccess.isTypeVisible(type, clazz))  return;
+            throw new LinkageError("bad field type alias: "+type+" not visible from "+clazz);
+        }
     }
 
+
     /** Produce a string form of this member name.
      *  For types, it is simply the type's own string (as reported by {@code toString}).
      *  For fields, it is {@code "DeclaringClass.name/type"}.
@@ -450,6 +697,7 @@
      *  If the declaring class is null, the prefix {@code "DeclaringClass."} is omitted.
      *  If the member is unresolved, a prefix {@code "*."} is prepended.
      */
+    @SuppressWarnings("LocalVariableHidesMemberVariable")
     @Override
     public String toString() {
         if (isType())
@@ -469,22 +717,12 @@
         } else {
             buf.append(type == null ? "(*)*" : getName(type));
         }
-        /*
-        buf.append('/');
-        // key: Public, private, pRotected, sTatic, Final, sYnchronized,
-        // transient/Varargs, native, (interface), abstract, sTrict, sYnthetic,
-        // (annotation), Enum, (unused)
-        final String FIELD_MOD_CHARS  = "PprTF?vt????Y?E?";
-        final String METHOD_MOD_CHARS = "PprTFybVn?atY???";
-        String modChars = (isInvocable() ? METHOD_MOD_CHARS : FIELD_MOD_CHARS);
-        for (int i = 0; i < modChars.length(); i++) {
-            if ((flags & (1 << i)) != 0) {
-                char mc = modChars.charAt(i);
-                if (mc != '?')
-                    buf.append(mc);
-            }
+        byte refKind = getReferenceKind();
+        if (refKind != REF_NONE) {
+            buf.append('/');
+            buf.append(MethodHandleNatives.refKindName(refKind));
         }
-         */
+        //buf.append("#").append(System.identityHashCode(this));
         return buf.toString();
     }
     private static String getName(Object obj) {
@@ -493,19 +731,6 @@
         return String.valueOf(obj);
     }
 
-    // Queries to the JVM:
-    /** Document? */
-    /*non-public*/ int getVMIndex() {
-        if (!isResolved())
-            throw newIllegalStateException("not resolved", this);
-        return vmindex;
-    }
-//    /*non-public*/ Object getVMTarget() {
-//        if (!isResolved())
-//            throw newIllegalStateException("not resolved", this);
-//        return vmtarget;
-//    }
-
     public IllegalAccessException makeAccessException(String message, Object from) {
         message = message + ": "+ toString();
         if (from != null)  message += ", from " + from;
@@ -523,14 +748,19 @@
     }
     public ReflectiveOperationException makeAccessException() {
         String message = message() + ": "+ toString();
-        if (isResolved())
-            return new IllegalAccessException(message);
+        ReflectiveOperationException ex;
+        if (isResolved() || !(resolution instanceof NoSuchMethodError ||
+                              resolution instanceof NoSuchFieldError))
+            ex = new IllegalAccessException(message);
         else if (isConstructor())
-            return new NoSuchMethodException(message);
+            ex = new NoSuchMethodException(message);
         else if (isMethod())
-            return new NoSuchMethodException(message);
+            ex = new NoSuchMethodException(message);
         else
-            return new NoSuchFieldException(message);
+            ex = new NoSuchFieldException(message);
+        if (resolution instanceof Throwable)
+            ex.initCause((Throwable) resolution);
+        return ex;
     }
 
     /** Actually making a query requires an access check. */
@@ -544,7 +774,7 @@
         private Factory() { } // singleton pattern
         static Factory INSTANCE = new Factory();
 
-        private static int ALLOWED_FLAGS = SEARCH_ALL_SUPERS | ALL_KINDS;
+        private static int ALLOWED_FLAGS = ALL_KINDS;
 
         /// Queries
         List<MemberName> getMembers(Class<?> defc,
@@ -578,14 +808,14 @@
                 // JVM returned to us with an intentional overflow!
                 totalCount += buf.length;
                 int excess = bufCount - buf.length;
-                if (bufs == null)  bufs = new ArrayList<MemberName[]>(1);
+                if (bufs == null)  bufs = new ArrayList<>(1);
                 bufs.add(buf);
                 int len2 = buf.length;
                 len2 = Math.max(len2, excess);
                 len2 = Math.max(len2, totalCount / 4);
                 buf = newMemberBuffer(Math.min(BUF_MAX, len2));
             }
-            ArrayList<MemberName> result = new ArrayList<MemberName>(totalCount);
+            ArrayList<MemberName> result = new ArrayList<>(totalCount);
             if (bufs != null) {
                 for (MemberName[] buf0 : bufs) {
                     Collections.addAll(result, buf0);
@@ -604,43 +834,29 @@
             }
             return result;
         }
-        boolean resolveInPlace(MemberName m, boolean searchSupers, Class<?> lookupClass) {
-            if (m.name == null || m.type == null) {  // find unique non-overloaded name
-                Class<?> defc = m.getDeclaringClass();
-                List<MemberName> choices = null;
-                if (m.isMethod())
-                    choices = getMethods(defc, searchSupers, m.name, (MethodType) m.type, lookupClass);
-                else if (m.isConstructor())
-                    choices = getConstructors(defc, lookupClass);
-                else if (m.isField())
-                    choices = getFields(defc, searchSupers, m.name, (Class<?>) m.type, lookupClass);
-                //System.out.println("resolving "+m+" to "+choices);
-                if (choices == null || choices.size() != 1)
-                    return false;
-                if (m.name == null)  m.name = choices.get(0).name;
-                if (m.type == null)  m.type = choices.get(0).type;
-            }
-            MethodHandleNatives.resolve(m, lookupClass);
-            if (m.isResolved())  return true;
-            int matchFlags = m.flags | (searchSupers ? SEARCH_ALL_SUPERS : 0);
-            String matchSig = m.getSignature();
-            MemberName[] buf = { m };
-            int n = MethodHandleNatives.getMembers(m.getDeclaringClass(),
-                    m.getName(), matchSig, matchFlags, lookupClass, 0, buf);
-            if (n != 1)  return false;
-            return m.isResolved();
-        }
         /** Produce a resolved version of the given member.
          *  Super types are searched (for inherited members) if {@code searchSupers} is true.
          *  Access checking is performed on behalf of the given {@code lookupClass}.
          *  If lookup fails or access is not permitted, null is returned.
          *  Otherwise a fresh copy of the given member is returned, with modifier bits filled in.
          */
-        public MemberName resolveOrNull(MemberName m, boolean searchSupers, Class<?> lookupClass) {
-            MemberName result = m.clone();
-            if (resolveInPlace(result, searchSupers, lookupClass))
-                return result;
-            return null;
+        private MemberName resolve(byte refKind, MemberName ref, Class<?> lookupClass) {
+            MemberName m = ref.clone();  // JVM will side-effect the ref
+            assert(refKind == m.getReferenceKind());
+            try {
+                m = MethodHandleNatives.resolve(m, lookupClass);
+                m.checkForTypeAlias();
+                m.resolution = null;
+            } catch (LinkageError ex) {
+                // JVM reports that the "bytecode behavior" would get an error
+                assert(!m.isResolved());
+                m.resolution = ex;
+                return m;
+            }
+            assert(m.referenceKindIsConsistent());
+            m.initResolved(true);
+            assert(m.vminfoIsConsistent());
+            return m;
         }
         /** Produce a resolved version of the given member.
          *  Super types are searched (for inherited members) if {@code searchSupers} is true.
@@ -650,16 +866,29 @@
          */
         public
         <NoSuchMemberException extends ReflectiveOperationException>
-        MemberName resolveOrFail(MemberName m, boolean searchSupers, Class<?> lookupClass,
+        MemberName resolveOrFail(byte refKind, MemberName m, Class<?> lookupClass,
                                  Class<NoSuchMemberException> nsmClass)
                 throws IllegalAccessException, NoSuchMemberException {
-            MemberName result = resolveOrNull(m, searchSupers, lookupClass);
-            if (result != null)
+            MemberName result = resolve(refKind, m, lookupClass);
+            if (result.isResolved())
                 return result;
-            ReflectiveOperationException ex = m.makeAccessException();
+            ReflectiveOperationException ex = result.makeAccessException();
             if (ex instanceof IllegalAccessException)  throw (IllegalAccessException) ex;
             throw nsmClass.cast(ex);
         }
+        /** Produce a resolved version of the given member.
+         *  Super types are searched (for inherited members) if {@code searchSupers} is true.
+         *  Access checking is performed on behalf of the given {@code lookupClass}.
+         *  If lookup fails or access is not permitted, return null.
+         *  Otherwise a fresh copy of the given member is returned, with modifier bits filled in.
+         */
+        public
+        MemberName resolveOrNull(byte refKind, MemberName m, Class<?> lookupClass) {
+            MemberName result = resolve(refKind, m, lookupClass);
+            if (result.isResolved())
+                return result;
+            return null;
+        }
         /** Return a list of all methods defined by the given class.
          *  Super types are searched (for inherited members) if {@code searchSupers} is true.
          *  Access checking is performed on behalf of the given {@code lookupClass}.
--- a/src/share/classes/java/lang/invoke/MethodHandle.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/lang/invoke/MethodHandle.java	Fri Jun 21 19:11:42 2013 -0700
@@ -26,9 +26,13 @@
 package java.lang.invoke;
 
 
-import java.util.ArrayList;
-import sun.invoke.util.ValueConversions;
+import java.util.*;
+import sun.invoke.util.*;
+import sun.misc.Unsafe;
+
 import static java.lang.invoke.MethodHandleStatics.*;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 /**
  * A method handle is a typed, directly executable reference to an underlying method,
@@ -208,8 +212,8 @@
  * refers directly to an associated {@code CONSTANT_Methodref},
  * {@code CONSTANT_InterfaceMethodref}, or {@code CONSTANT_Fieldref}
  * constant pool entry.
- * (For more details on method handle constants,
- * see the <a href="package-summary.html#mhcon">package summary</a>.)
+ * (For full details on method handle constants,
+ * see sections 4.4.8 and 5.4.3.5 of the Java Virtual Machine Specification.)
  * <p>
  * Method handles produced by lookups or constant loads from methods or
  * constructors with the variable arity modifier bit ({@code 0x0080})
@@ -224,6 +228,19 @@
  * (E.g., if a non-static method handle is obtained via {@code ldc},
  * the type of the receiver is the class named in the constant pool entry.)
  * <p>
+ * Method handle constants are subject to the same link-time access checks
+ * their corresponding bytecode instructions, and the {@code ldc} instruction
+ * will throw corresponding linkage errors if the bytecode behaviors would
+ * throw such errors.
+ * <p>
+ * As a corollary of this, access to protected members is restricted
+ * to receivers only of the accessing class, or one of its subclasses,
+ * and the accessing class must in turn be a subclass (or package sibling)
+ * of the protected member's defining class.
+ * If a method reference refers to a protected non-static method or field
+ * of a class outside the current package, the receiver argument will
+ * be narrowed to the type of the accessing class.
+ * <p>
  * When a method handle to a virtual method is invoked, the method is
  * always looked up in the receiver (that is, the first argument).
  * <p>
@@ -275,7 +292,7 @@
  * generates a single invokevirtual instruction with
  * the symbolic type descriptor indicated in the following comment.
  * In these examples, the helper method {@code assertEquals} is assumed to
- * be a method which calls {@link Objects.equals java.util.Objects#equals}
+ * be a method which calls {@link java.util.Objects#equals(Object,Object) Objects.equals }
  * on its arguments, and asserts that the result is true.
  *
  * <h3>Exceptions</h3>
@@ -390,39 +407,8 @@
  * @author John Rose, JSR 292 EG
  */
 public abstract class MethodHandle {
-    // { JVM internals:
-
-    private byte       vmentry;    // adapter stub or method entry point
-    //private int      vmslots;    // optionally, hoist type.form.vmslots
-    /*non-public*/ Object vmtarget;   // VM-specific, class-specific target value
-
-    // TO DO:  vmtarget should be invisible to Java, since the JVM puts internal
-    // managed pointers into it.  Making it visible exposes it to debuggers,
-    // which can cause errors when they treat the pointer as an Object.
-
-    // These two dummy fields are present to force 'I' and 'J' signatures
-    // into this class's constant pool, so they can be transferred
-    // to vmentry when this class is loaded.
-    static final int  INT_FIELD = 0;
-    static final long LONG_FIELD = 0;
-
-    // vmentry (a void* field) is used *only* by the JVM.
-    // The JVM adjusts its type to int or long depending on system wordsize.
-    // Since it is statically typed as neither int nor long, it is impossible
-    // to use this field from Java bytecode.  (Please don't try to, either.)
-
-    // The vmentry is an assembly-language stub which is jumped to
-    // immediately after the method type is verified.
-    // For a direct MH, this stub loads the vmtarget's entry point
-    // and jumps to it.
-
-    // } End of JVM internals.
-
     static { MethodHandleImpl.initStatics(); }
 
-    // interface MethodHandle<R throws X extends Exception,A...>
-    // { MethodType<R throws X,A...> type(); public R invokeExact(A...) throws X; }
-
     /**
      * Internal marker interface which distinguishes (to the Java compiler)
      * those methods which are <a href="MethodHandle.html#sigpoly">signature polymorphic</a>.
@@ -431,7 +417,9 @@
     @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME)
     @interface PolymorphicSignature { }
 
-    private MethodType type;
+    private final MethodType type;
+    /*private*/ final LambdaForm form;
+    // form is not private so that invokers can easily fetch it
 
     /**
      * Reports the type of this method handle.
@@ -448,9 +436,13 @@
      * the {@code java.lang.invoke} package.
      */
     // @param type type (permanently assigned) of the new method handle
-    /*non-public*/ MethodHandle(MethodType type) {
-        type.getClass();  // elicit NPE
+    /*non-public*/ MethodHandle(MethodType type, LambdaForm form) {
+        type.getClass();  // explicit NPE
+        form.getClass();  // explicit NPE
         this.type = type;
+        this.form = form;
+
+        form.prepare();  // TO DO:  Try to delay this step until just before invocation.
     }
 
     /**
@@ -506,6 +498,46 @@
     public final native @PolymorphicSignature Object invoke(Object... args) throws Throwable;
 
     /**
+     * Private method for trusted invocation of a method handle respecting simplified signatures.
+     * Type mismatches will not throw {@code WrongMethodTypeException}, but could crash the JVM.
+     * <p>
+     * The caller signature is restricted to the following basic types:
+     * Object, int, long, float, double, and void return.
+     * <p>
+     * The caller is responsible for maintaining type correctness by ensuring
+     * that the each outgoing argument value is a member of the range of the corresponding
+     * callee argument type.
+     * (The caller should therefore issue appropriate casts and integer narrowing
+     * operations on outgoing argument values.)
+     * The caller can assume that the incoming result value is part of the range
+     * of the callee's return type.
+     */
+    /*non-public*/ final native @PolymorphicSignature Object invokeBasic(Object... args) throws Throwable;
+
+    /*non-public*/ static native @PolymorphicSignature Object linkToVirtual(Object... args) throws Throwable;
+
+    /**
+     * Private method for trusted invocation of a MemberName of kind {@code REF_invokeStatic}.
+     * The caller signature is restricted to basic types as with {@code invokeBasic}.
+     * The trailing (not leading) argument must be a MemberName.
+     */
+    /*non-public*/ static native @PolymorphicSignature Object linkToStatic(Object... args) throws Throwable;
+
+    /**
+     * Private method for trusted invocation of a MemberName of kind {@code REF_invokeSpecial}.
+     * The caller signature is restricted to basic types as with {@code invokeBasic}.
+     * The trailing (not leading) argument must be a MemberName.
+     */
+    /*non-public*/ static native @PolymorphicSignature Object linkToSpecial(Object... args) throws Throwable;
+
+    /**
+     * Private method for trusted invocation of a MemberName of kind {@code REF_invokeInterface}.
+     * The caller signature is restricted to basic types as with {@code invokeBasic}.
+     * The trailing (not leading) argument must be a MemberName.
+     */
+    /*non-public*/ static native @PolymorphicSignature Object linkToInterface(Object... args) throws Throwable;
+
+    /**
      * Performs a variable arity invocation, passing the arguments in the given array
      * to the method handle, as if via an inexact {@link #invoke invoke} from a call site
      * which mentions only the type {@code Object}, and whose arity is the length
@@ -557,6 +589,7 @@
      */
     public Object invokeWithArguments(Object... arguments) throws Throwable {
         int argc = arguments == null ? 0 : arguments.length;
+        @SuppressWarnings("LocalVariableHidesMemberVariable")
         MethodType type = type();
         if (type.parameterCount() != argc || isVarargsCollector()) {
             // simulate invoke
@@ -690,7 +723,7 @@
         if (!type.isConvertibleTo(newType)) {
             throw new WrongMethodTypeException("cannot convert "+this+" to "+newType);
         }
-        return MethodHandleImpl.convertArguments(this, newType, 1);
+        return convertArguments(newType);
     }
 
     /**
@@ -772,7 +805,8 @@
      */
     public MethodHandle asSpreader(Class<?> arrayType, int arrayLength) {
         asSpreaderChecks(arrayType, arrayLength);
-        return MethodHandleImpl.spreadArguments(this, arrayType, arrayLength);
+        int spreadArgPos = type.parameterCount() - arrayLength;
+        return MethodHandleImpl.makeSpreadArguments(this, arrayType, spreadArgPos, arrayLength);
     }
 
     private void asSpreaderChecks(Class<?> arrayType, int arrayLength) {
@@ -790,7 +824,7 @@
                 }
             }
             if (sawProblem) {
-                ArrayList<Class<?>> ptypes = new ArrayList<Class<?>>(type().parameterList());
+                ArrayList<Class<?>> ptypes = new ArrayList<>(type().parameterList());
                 for (int i = nargs - arrayLength; i < nargs; i++) {
                     ptypes.set(i, arrayElement);
                 }
@@ -885,8 +919,12 @@
      */
     public MethodHandle asCollector(Class<?> arrayType, int arrayLength) {
         asCollectorChecks(arrayType, arrayLength);
+        int collectArgPos = type().parameterCount()-1;
+        MethodHandle target = this;
+        if (arrayType != type().parameterType(collectArgPos))
+            target = convertArguments(type().changeParameterType(collectArgPos, arrayType));
         MethodHandle collector = ValueConversions.varargsArray(arrayType, arrayLength);
-        return MethodHandleImpl.collectArguments(this, type.parameterCount()-1, collector);
+        return MethodHandles.collectArguments(target, collectArgPos, collector);
     }
 
     // private API: return true if last param exactly matches arrayType
@@ -1056,7 +1094,7 @@
         boolean lastMatch = asCollectorChecks(arrayType, 0);
         if (isVarargsCollector() && lastMatch)
             return this;
-        return AdapterMethodHandle.makeVarargsCollector(this, arrayType);
+        return MethodHandleImpl.makeVarargsCollector(this, arrayType);
     }
 
     /**
@@ -1155,14 +1193,13 @@
      */
     public MethodHandle bindTo(Object x) {
         Class<?> ptype;
-        if (type().parameterCount() == 0 ||
-            (ptype = type().parameterType(0)).isPrimitive())
+        @SuppressWarnings("LocalVariableHidesMemberVariable")
+        MethodType type = type();
+        if (type.parameterCount() == 0 ||
+            (ptype = type.parameterType(0)).isPrimitive())
             throw newIllegalArgumentException("no leading reference parameter", x);
-        x = MethodHandles.checkValue(ptype, x);
-        // Cf. MethodHandles.insertArguments for the following logic:
-        MethodHandle bmh = MethodHandleImpl.bindReceiver(this, x);
-        if (bmh != null)  return bmh;
-        return MethodHandleImpl.bindArgument(this, 0, x);
+        x = ptype.cast(x);  // throw CCE if needed
+        return bindReceiver(x);
     }
 
     /**
@@ -1183,11 +1220,184 @@
     @Override
     public String toString() {
         if (DEBUG_METHOD_HANDLE_NAMES)  return debugString();
+        return standardString();
+    }
+    String standardString() {
         return "MethodHandle"+type;
     }
+    String debugString() {
+        return standardString()+"/LF="+internalForm()+internalProperties();
+    }
+
+    //// Implementation methods.
+    //// Sub-classes can override these default implementations.
+    //// All these methods assume arguments are already validated.
+
+    // Other transforms to do:  convert, explicitCast, permute, drop, filter, fold, GWT, catch
+
+    /*non-public*/
+    MethodHandle setVarargs(MemberName member) throws IllegalAccessException {
+        if (!member.isVarargs())  return this;
+        int argc = type().parameterCount();
+        if (argc != 0) {
+            Class<?> arrayType = type().parameterType(argc-1);
+            if (arrayType.isArray()) {
+                return MethodHandleImpl.makeVarargsCollector(this, arrayType);
+            }
+        }
+        throw member.makeAccessException("cannot make variable arity", null);
+    }
+    /*non-public*/
+    MethodHandle viewAsType(MethodType newType) {
+        // No actual conversions, just a new view of the same method.
+        if (!type.isViewableAs(newType))
+            throw new InternalError();
+        return MethodHandleImpl.makePairwiseConvert(this, newType, 0);
+    }
+
+    // Decoding
+
+    /*non-public*/
+    LambdaForm internalForm() {
+        return form;
+    }
+
+    /*non-public*/
+    MemberName internalMemberName() {
+        return null;  // DMH returns DMH.member
+    }
+
+    /*non-public*/
+    Object internalValues() {
+        return null;
+    }
+
+    /*non-public*/
+    Object internalProperties() {
+        // Override to something like "/FOO=bar"
+        return "";
+    }
+
+    //// Method handle implementation methods.
+    //// Sub-classes can override these default implementations.
+    //// All these methods assume arguments are already validated.
+
+    /*non-public*/ MethodHandle convertArguments(MethodType newType) {
+        // Override this if it can be improved.
+        return MethodHandleImpl.makePairwiseConvert(this, newType, 1);
+    }
+
+    /*non-public*/
+    MethodHandle bindArgument(int pos, char basicType, Object value) {
+        // Override this if it can be improved.
+        return rebind().bindArgument(pos, basicType, value);
+    }
+
+    /*non-public*/
+    MethodHandle bindReceiver(Object receiver) {
+        // Override this if it can be improved.
+        return bindArgument(0, 'L', receiver);
+    }
 
     /*non-public*/
-    String debugString() {
-        return getNameString(this);
+    MethodHandle bindImmediate(int pos, char basicType, Object value) {
+        // Bind an immediate value to a position in the arguments.
+        // This means, elide the respective argument,
+        // and replace all references to it in NamedFunction args with the specified value.
+
+        // CURRENT RESTRICTIONS
+        // * only for pos 0 and UNSAFE (position is adjusted in MHImpl to make API usable for others)
+        assert pos == 0 && basicType == 'L' && value instanceof Unsafe;
+        MethodType type2 = type.dropParameterTypes(pos, pos + 1); // adjustment: ignore receiver!
+        LambdaForm form2 = form.bindImmediate(pos + 1, basicType, value); // adjust pos to form-relative pos
+        return copyWith(type2, form2);
+    }
+
+    /*non-public*/
+    MethodHandle copyWith(MethodType mt, LambdaForm lf) {
+        throw new InternalError("copyWith: " + this.getClass());
+    }
+
+    /*non-public*/
+    MethodHandle dropArguments(MethodType srcType, int pos, int drops) {
+        // Override this if it can be improved.
+        return rebind().dropArguments(srcType, pos, drops);
+    }
+
+    /*non-public*/
+    MethodHandle permuteArguments(MethodType newType, int[] reorder) {
+        // Override this if it can be improved.
+        return rebind().permuteArguments(newType, reorder);
+    }
+
+    /*non-public*/
+    MethodHandle rebind() {
+        // Bind 'this' into a new invoker, of the known class BMH.
+        MethodType type2 = type();
+        LambdaForm form2 = reinvokerForm(type2.basicType());
+        // form2 = lambda (bmh, arg*) { thismh = bmh[0]; invokeBasic(thismh, arg*) }
+        return BoundMethodHandle.bindSingle(type2, form2, this);
+    }
+
+    /*non-public*/
+    MethodHandle reinvokerTarget() {
+        throw new InternalError("not a reinvoker MH: "+this.getClass().getName()+": "+this);
+    }
+
+    /** Create a LF which simply reinvokes a target of the given basic type.
+     *  The target MH must override {@link #reinvokerTarget} to provide the target.
+     */
+    static LambdaForm reinvokerForm(MethodType mtype) {
+        mtype = mtype.basicType();
+        LambdaForm reinvoker = mtype.form().cachedLambdaForm(MethodTypeForm.LF_REINVOKE);
+        if (reinvoker != null)  return reinvoker;
+        MethodHandle MH_invokeBasic = MethodHandles.basicInvoker(mtype);
+        final int THIS_BMH    = 0;
+        final int ARG_BASE    = 1;
+        final int ARG_LIMIT   = ARG_BASE + mtype.parameterCount();
+        int nameCursor = ARG_LIMIT;
+        final int NEXT_MH     = nameCursor++;
+        final int REINVOKE    = nameCursor++;
+        LambdaForm.Name[] names = LambdaForm.arguments(nameCursor - ARG_LIMIT, mtype.invokerType());
+        names[NEXT_MH] = new LambdaForm.Name(NF_reinvokerTarget, names[THIS_BMH]);
+        Object[] targetArgs = Arrays.copyOfRange(names, THIS_BMH, ARG_LIMIT, Object[].class);
+        targetArgs[0] = names[NEXT_MH];  // overwrite this MH with next MH
+        names[REINVOKE] = new LambdaForm.Name(MH_invokeBasic, targetArgs);
+        return mtype.form().setCachedLambdaForm(MethodTypeForm.LF_REINVOKE, new LambdaForm("BMH.reinvoke", ARG_LIMIT, names));
+    }
+
+    private static final LambdaForm.NamedFunction NF_reinvokerTarget;
+    static {
+        try {
+            NF_reinvokerTarget = new LambdaForm.NamedFunction(MethodHandle.class
+                .getDeclaredMethod("reinvokerTarget"));
+        } catch (ReflectiveOperationException ex) {
+            throw newInternalError(ex);
+        }
+    }
+
+    /**
+     * Replace the old lambda form of this method handle with a new one.
+     * The new one must be functionally equivalent to the old one.
+     * Threads may continue running the old form indefinitely,
+     * but it is likely that the new one will be preferred for new executions.
+     * Use with discretion.
+     * @param newForm
+     */
+    /*non-public*/
+    void updateForm(LambdaForm newForm) {
+        if (form == newForm)  return;
+        // ISSUE: Should we have a memory fence here?
+        UNSAFE.putObject(this, FORM_OFFSET, newForm);
+        this.form.prepare();  // as in MethodHandle.<init>
+    }
+
+    private static final long FORM_OFFSET;
+    static {
+        try {
+            FORM_OFFSET = UNSAFE.objectFieldOffset(MethodHandle.class.getDeclaredField("form"));
+        } catch (ReflectiveOperationException ex) {
+            throw newInternalError(ex);
+        }
     }
 }
--- a/src/share/classes/java/lang/invoke/MethodHandleImpl.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/lang/invoke/MethodHandleImpl.java	Fri Jun 21 19:11:42 2013 -0700
@@ -29,9 +29,7 @@
 import java.security.PrivilegedAction;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Collections;
 import java.util.HashMap;
-import java.util.List;
 import sun.invoke.empty.Empty;
 import sun.invoke.util.ValueConversions;
 import sun.invoke.util.VerifyType;
@@ -39,6 +37,7 @@
 import sun.misc.Unsafe;
 import sun.reflect.CallerSensitive;
 import sun.reflect.Reflection;
+import static java.lang.invoke.LambdaForm.*;
 import static java.lang.invoke.MethodHandleStatics.*;
 import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
 
@@ -49,992 +48,496 @@
 /*non-public*/ abstract class MethodHandleImpl {
     /// Factory methods to create method handles:
 
-    private static final MemberName.Factory LOOKUP = MemberName.Factory.INSTANCE;
-
     static void initStatics() {
-        // Trigger preceding sequence.
+        // Trigger selected static initializations.
+        MemberName.Factory.INSTANCE.getClass();
     }
 
-    /** Look up a given method.
-     * Callable only from sun.invoke and related packages.
-     * <p>
-     * The resulting method handle type will be of the given type,
-     * with a receiver type {@code rcvc} prepended if the member is not static.
-     * <p>
-     * Access checks are made as of the given lookup class.
-     * In particular, if the method is protected and {@code defc} is in a
-     * different package from the lookup class, then {@code rcvc} must be
-     * the lookup class or a subclass.
-     * @param token Proof that the lookup class has access to this package.
-     * @param member Resolved method or constructor to call.
-     * @param name Name of the desired method.
-     * @param rcvc Receiver type of desired non-static method (else null)
-     * @param doDispatch whether the method handle will test the receiver type
-     * @param lookupClass access-check relative to this class
-     * @return a direct handle to the matching method
-     * @throws IllegalAccessException if the given method cannot be accessed by the lookup class
-     */
-    static
-    MethodHandle findMethod(MemberName method,
-                            boolean doDispatch, Class<?> lookupClass) throws IllegalAccessException {
-        MethodType mtype = method.getMethodType();
-        if (!method.isStatic()) {
-            // adjust the advertised receiver type to be exactly the one requested
-            // (in the case of invokespecial, this will be the calling class)
-            Class<?> recvType = method.getDeclaringClass();
-            mtype = mtype.insertParameterTypes(0, recvType);
+    static MethodHandle makeArrayElementAccessor(Class<?> arrayClass, boolean isSetter) {
+        if (!arrayClass.isArray())
+            throw newIllegalArgumentException("not an array: "+arrayClass);
+        MethodHandle accessor = ArrayAccessor.getAccessor(arrayClass, isSetter);
+        MethodType srcType = accessor.type().erase();
+        MethodType lambdaType = srcType.invokerType();
+        Name[] names = arguments(1, lambdaType);
+        Name[] args  = Arrays.copyOfRange(names, 1, 1 + srcType.parameterCount());
+        names[names.length - 1] = new Name(accessor.asType(srcType), (Object[]) args);
+        LambdaForm form = new LambdaForm("getElement", lambdaType.parameterCount(), names);
+        MethodHandle mh = SimpleMethodHandle.make(srcType, form);
+        if (ArrayAccessor.needCast(arrayClass)) {
+            mh = mh.bindTo(arrayClass);
         }
-        DirectMethodHandle mh = new DirectMethodHandle(mtype, method, doDispatch, lookupClass);
-        if (!mh.isValid())
-            throw method.makeAccessException("no direct method handle", lookupClass);
-        assert(mh.type() == mtype);
-        if (!method.isVarargs())
-            return mh;
-        int argc = mtype.parameterCount();
-        if (argc != 0) {
-            Class<?> arrayType = mtype.parameterType(argc-1);
-            if (arrayType.isArray())
-                return AdapterMethodHandle.makeVarargsCollector(mh, arrayType);
-        }
-        throw method.makeAccessException("cannot make variable arity", null);
-    }
-
-    static
-    MethodHandle makeAllocator(MethodHandle rawConstructor) {
-        MethodType rawConType = rawConstructor.type();
-        Class<?> allocateClass = rawConType.parameterType(0);
-        // Wrap the raw (unsafe) constructor with the allocation of a suitable object.
-        if (AdapterMethodHandle.canCollectArguments(rawConType, MethodType.methodType(allocateClass), 0, true)) {
-            // allocator(arg...)
-            // [fold]=> cookedConstructor(obj=allocate(C), arg...)
-            // [dup,collect]=> identity(obj, void=rawConstructor(obj, arg...))
-            MethodHandle returner = MethodHandles.identity(allocateClass);
-            MethodType ctype = rawConType.insertParameterTypes(0, allocateClass).changeReturnType(allocateClass);
-            MethodHandle  cookedConstructor = AdapterMethodHandle.makeCollectArguments(returner, rawConstructor, 1, false);
-            assert(cookedConstructor.type().equals(ctype));
-            ctype = ctype.dropParameterTypes(0, 1);
-            cookedConstructor = AdapterMethodHandle.makeCollectArguments(cookedConstructor, returner, 0, true);
-            MethodHandle allocator = new AllocateObject(allocateClass);
-            // allocate() => new C(void)
-            assert(allocator.type().equals(MethodType.methodType(allocateClass)));
-            ctype = ctype.dropParameterTypes(0, 1);
-            MethodHandle fold = foldArguments(cookedConstructor, ctype, 0, allocator);
-            return fold;
-        }
-        assert(MethodHandleNatives.workaroundWithoutRicochetFrames());  // this code is deprecated
-        MethodHandle allocator
-            = AllocateObject.make(allocateClass, rawConstructor);
-        assert(allocator.type()
-               .equals(rawConType.dropParameterTypes(0, 1).changeReturnType(rawConType.parameterType(0))));
-        return allocator;
+        mh = mh.asType(ArrayAccessor.correctType(arrayClass, isSetter));
+        return mh;
     }
 
-    static final class AllocateObject<C> extends BoundMethodHandle {
-        private static final Unsafe unsafe = Unsafe.getUnsafe();
+    static final class ArrayAccessor {
+        /// Support for array element access
+        static final HashMap<Class<?>, MethodHandle> GETTER_CACHE = new HashMap<>();  // TODO use it
+        static final HashMap<Class<?>, MethodHandle> SETTER_CACHE = new HashMap<>();  // TODO use it
 
-        private final Class<C> allocateClass;
-        private final MethodHandle rawConstructor;
+        static int     getElementI(int[]     a, int i)            { return              a[i]; }
+        static long    getElementJ(long[]    a, int i)            { return              a[i]; }
+        static float   getElementF(float[]   a, int i)            { return              a[i]; }
+        static double  getElementD(double[]  a, int i)            { return              a[i]; }
+        static boolean getElementZ(boolean[] a, int i)            { return              a[i]; }
+        static byte    getElementB(byte[]    a, int i)            { return              a[i]; }
+        static short   getElementS(short[]   a, int i)            { return              a[i]; }
+        static char    getElementC(char[]    a, int i)            { return              a[i]; }
+        static Object  getElementL(Object[]  a, int i)            { return              a[i]; }
 
-        private AllocateObject(MethodHandle invoker,
-                               Class<C> allocateClass, MethodHandle rawConstructor) {
-            super(invoker);
-            this.allocateClass = allocateClass;
-            this.rawConstructor = rawConstructor;
-            assert(MethodHandleNatives.workaroundWithoutRicochetFrames());  // this code is deprecated
-        }
-        // for allocation only:
-        private AllocateObject(Class<C> allocateClass) {
-            super(ALLOCATE.asType(MethodType.methodType(allocateClass, AllocateObject.class)));
-            this.allocateClass = allocateClass;
-            this.rawConstructor = null;
+        static void    setElementI(int[]     a, int i, int     x) {              a[i] = x; }
+        static void    setElementJ(long[]    a, int i, long    x) {              a[i] = x; }
+        static void    setElementF(float[]   a, int i, float   x) {              a[i] = x; }
+        static void    setElementD(double[]  a, int i, double  x) {              a[i] = x; }
+        static void    setElementZ(boolean[] a, int i, boolean x) {              a[i] = x; }
+        static void    setElementB(byte[]    a, int i, byte    x) {              a[i] = x; }
+        static void    setElementS(short[]   a, int i, short   x) {              a[i] = x; }
+        static void    setElementC(char[]    a, int i, char    x) {              a[i] = x; }
+        static void    setElementL(Object[]  a, int i, Object  x) {              a[i] = x; }
+
+        static Object  getElementL(Class<?> arrayClass, Object[] a, int i)           { arrayClass.cast(a); return a[i]; }
+        static void    setElementL(Class<?> arrayClass, Object[] a, int i, Object x) { arrayClass.cast(a); a[i] = x; }
+
+        // Weakly typed wrappers of Object[] accessors:
+        static Object  getElementL(Object    a, int i)            { return getElementL((Object[])a, i); }
+        static void    setElementL(Object    a, int i, Object  x) {        setElementL((Object[]) a, i, x); }
+        static Object  getElementL(Object   arrayClass, Object a, int i)             { return getElementL((Class<?>) arrayClass, (Object[])a, i); }
+        static void    setElementL(Object   arrayClass, Object a, int i, Object x)   {        setElementL((Class<?>) arrayClass, (Object[])a, i, x); }
+
+        static boolean needCast(Class<?> arrayClass) {
+            Class<?> elemClass = arrayClass.getComponentType();
+            return !elemClass.isPrimitive() && elemClass != Object.class;
         }
-        static MethodHandle make(Class<?> allocateClass, MethodHandle rawConstructor) {
-            assert(MethodHandleNatives.workaroundWithoutRicochetFrames());  // this code is deprecated
-            MethodType rawConType = rawConstructor.type();
-            assert(rawConType.parameterType(0) == allocateClass);
-            MethodType newType = rawConType.dropParameterTypes(0, 1).changeReturnType(allocateClass);
-            int nargs = rawConType.parameterCount() - 1;
-            if (nargs < INVOKES.length) {
-                MethodHandle invoke = INVOKES[nargs];
-                MethodType conType = CON_TYPES[nargs];
-                MethodHandle gcon = convertArguments(rawConstructor, conType, rawConType, 0);
-                if (gcon == null)  return null;
-                MethodHandle galloc = new AllocateObject(invoke, allocateClass, gcon);
-                assert(galloc.type() == newType.generic());
-                return convertArguments(galloc, newType, galloc.type(), 0);
+        static String name(Class<?> arrayClass, boolean isSetter) {
+            Class<?> elemClass = arrayClass.getComponentType();
+            if (elemClass == null)  throw new IllegalArgumentException();
+            return (!isSetter ? "getElement" : "setElement") + Wrapper.basicTypeChar(elemClass);
+        }
+        static final boolean USE_WEAKLY_TYPED_ARRAY_ACCESSORS = false;  // FIXME: decide
+        static MethodType type(Class<?> arrayClass, boolean isSetter) {
+            Class<?> elemClass = arrayClass.getComponentType();
+            Class<?> arrayArgClass = arrayClass;
+            if (!elemClass.isPrimitive()) {
+                arrayArgClass = Object[].class;
+                if (USE_WEAKLY_TYPED_ARRAY_ACCESSORS)
+                    arrayArgClass = Object.class;
+            }
+            if (!needCast(arrayClass)) {
+                return !isSetter ?
+                    MethodType.methodType(elemClass,  arrayArgClass, int.class) :
+                    MethodType.methodType(void.class, arrayArgClass, int.class, elemClass);
             } else {
-                MethodHandle invoke = VARARGS_INVOKE;
-                MethodType conType = CON_TYPES[nargs];
-                MethodHandle gcon = spreadArgumentsFromPos(rawConstructor, conType, 1);
-                if (gcon == null)  return null;
-                MethodHandle galloc = new AllocateObject(invoke, allocateClass, gcon);
-                return collectArguments(galloc, newType, 1, null);
+                Class<?> classArgClass = Class.class;
+                if (USE_WEAKLY_TYPED_ARRAY_ACCESSORS)
+                    classArgClass = Object.class;
+                return !isSetter ?
+                    MethodType.methodType(Object.class, classArgClass, arrayArgClass, int.class) :
+                    MethodType.methodType(void.class,   classArgClass, arrayArgClass, int.class, Object.class);
             }
         }
-        @Override
-        String debugString() {
-            return addTypeString(allocateClass.getSimpleName(), this);
-        }
-        @SuppressWarnings("unchecked")
-        private C allocate() throws InstantiationException {
-            return (C) unsafe.allocateInstance(allocateClass);
-        }
-        private C invoke_V(Object... av) throws Throwable {
-            C obj = allocate();
-            rawConstructor.invokeExact((Object)obj, av);
-            return obj;
-        }
-        private C invoke_L0() throws Throwable {
-            C obj = allocate();
-            rawConstructor.invokeExact((Object)obj);
-            return obj;
-        }
-        private C invoke_L1(Object a0) throws Throwable {
-            C obj = allocate();
-            rawConstructor.invokeExact((Object)obj, a0);
-            return obj;
-        }
-        private C invoke_L2(Object a0, Object a1) throws Throwable {
-            C obj = allocate();
-            rawConstructor.invokeExact((Object)obj, a0, a1);
-            return obj;
-        }
-        private C invoke_L3(Object a0, Object a1, Object a2) throws Throwable {
-            C obj = allocate();
-            rawConstructor.invokeExact((Object)obj, a0, a1, a2);
-            return obj;
-        }
-        private C invoke_L4(Object a0, Object a1, Object a2, Object a3) throws Throwable {
-            C obj = allocate();
-            rawConstructor.invokeExact((Object)obj, a0, a1, a2, a3);
-            return obj;
+        static MethodType correctType(Class<?> arrayClass, boolean isSetter) {
+            Class<?> elemClass = arrayClass.getComponentType();
+            return !isSetter ?
+                    MethodType.methodType(elemClass,  arrayClass, int.class) :
+                    MethodType.methodType(void.class, arrayClass, int.class, elemClass);
         }
-        private C invoke_L5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable {
-            C obj = allocate();
-            rawConstructor.invokeExact((Object)obj, a0, a1, a2, a3, a4);
-            return obj;
-        }
-        private C invoke_L6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable {
-            C obj = allocate();
-            rawConstructor.invokeExact((Object)obj, a0, a1, a2, a3, a4, a5);
-            return obj;
-        }
-        private C invoke_L7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable {
-            C obj = allocate();
-            rawConstructor.invokeExact((Object)obj, a0, a1, a2, a3, a4, a5, a6);
-            return obj;
-        }
-        private C invoke_L8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable {
-            C obj = allocate();
-            rawConstructor.invokeExact((Object)obj, a0, a1, a2, a3, a4, a5, a6, a7);
-            return obj;
-        }
-        static MethodHandle[] makeInvokes() {
-            ArrayList<MethodHandle> invokes = new ArrayList<MethodHandle>();
-            MethodHandles.Lookup lookup = IMPL_LOOKUP;
-            for (;;) {
-                int nargs = invokes.size();
-                String name = "invoke_L"+nargs;
-                MethodHandle invoke = null;
-                try {
-                    invoke = lookup.findVirtual(AllocateObject.class, name, MethodType.genericMethodType(nargs));
-                } catch (ReflectiveOperationException ex) {
-                }
-                if (invoke == null)  break;
-                invokes.add(invoke);
-            }
-            assert(invokes.size() == 9);  // current number of methods
-            return invokes.toArray(new MethodHandle[0]);
-        };
-        static final MethodHandle[] INVOKES = makeInvokes();
-        // For testing use this:
-        //static final MethodHandle[] INVOKES = Arrays.copyOf(makeInvokes(), 2);
-        static final MethodHandle VARARGS_INVOKE;
-        static final MethodHandle ALLOCATE;
-        static {
+        static MethodHandle getAccessor(Class<?> arrayClass, boolean isSetter) {
+            String     name = name(arrayClass, isSetter);
+            MethodType type = type(arrayClass, isSetter);
             try {
-                VARARGS_INVOKE = IMPL_LOOKUP.findVirtual(AllocateObject.class, "invoke_V", MethodType.genericMethodType(0, true));
-                ALLOCATE = IMPL_LOOKUP.findVirtual(AllocateObject.class, "allocate", MethodType.genericMethodType(0));
+                return IMPL_LOOKUP.findStatic(ArrayAccessor.class, name, type);
             } catch (ReflectiveOperationException ex) {
                 throw uncaughtException(ex);
             }
         }
-        // Corresponding generic constructor types:
-        static final MethodType[] CON_TYPES = new MethodType[INVOKES.length];
-        static {
-            for (int i = 0; i < INVOKES.length; i++)
-                CON_TYPES[i] = makeConType(INVOKES[i]);
-        }
-        static final MethodType VARARGS_CON_TYPE = makeConType(VARARGS_INVOKE);
-        static MethodType makeConType(MethodHandle invoke) {
-            MethodType invType = invoke.type();
-            return invType.changeParameterType(0, Object.class).changeReturnType(void.class);
-        }
-    }
-
-    static
-    MethodHandle accessField(MemberName member, boolean isSetter,
-                             Class<?> lookupClass) {
-        // Use sun. misc.Unsafe to dig up the dirt on the field.
-        MethodHandle mh = new FieldAccessor(member, isSetter);
-        return mh;
-    }
-
-    static
-    MethodHandle accessArrayElement(Class<?> arrayClass, boolean isSetter) {
-        if (!arrayClass.isArray())
-            throw newIllegalArgumentException("not an array: "+arrayClass);
-        Class<?> elemClass = arrayClass.getComponentType();
-        MethodHandle[] mhs = FieldAccessor.ARRAY_CACHE.get(elemClass);
-        if (mhs == null) {
-            if (!FieldAccessor.doCache(elemClass))
-                return FieldAccessor.ahandle(arrayClass, isSetter);
-            mhs = new MethodHandle[] {
-                FieldAccessor.ahandle(arrayClass, false),
-                FieldAccessor.ahandle(arrayClass, true)
-            };
-            if (mhs[0].type().parameterType(0) == Class.class) {
-                mhs[0] = mhs[0].bindTo(elemClass);
-                mhs[1] = mhs[1].bindTo(elemClass);
-            }
-            synchronized (FieldAccessor.ARRAY_CACHE) {}  // memory barrier
-            FieldAccessor.ARRAY_CACHE.put(elemClass, mhs);
-        }
-        return mhs[isSetter ? 1 : 0];
     }
 
-    static final class FieldAccessor<C,V> extends BoundMethodHandle {
-        private static final Unsafe unsafe = Unsafe.getUnsafe();
-        final Object base;  // for static refs only
-        final long offset;
-        final String name;
+    /**
+     * Create a JVM-level adapter method handle to conform the given method
+     * handle to the similar newType, using only pairwise argument conversions.
+     * For each argument, convert incoming argument to the exact type needed.
+     * The argument conversions allowed are casting, boxing and unboxing,
+     * integral widening or narrowing, and floating point widening or narrowing.
+     * @param srcType required call type
+     * @param target original method handle
+     * @param level which strength of conversion is allowed
+     * @return an adapter to the original handle with the desired new type,
+     *          or the original target if the types are already identical
+     *          or null if the adaptation cannot be made
+     */
+    static MethodHandle makePairwiseConvert(MethodHandle target, MethodType srcType, int level) {
+        assert(level >= 0 && level <= 2);
+        MethodType dstType = target.type();
+        assert(dstType.parameterCount() == target.type().parameterCount());
+        if (srcType == dstType)
+            return target;
 
-        FieldAccessor(MemberName field, boolean isSetter) {
-            super(fhandle(field.getDeclaringClass(), field.getFieldType(), isSetter, field.isStatic()));
-            this.offset = (long) field.getVMIndex();
-            this.name = field.getName();
-            this.base = staticBase(field);
+        // Calculate extra arguments (temporaries) required in the names array.
+        // FIXME: Use an ArrayList<Name>.  Some arguments require more than one conversion step.
+        final int INARG_COUNT = srcType.parameterCount();
+        int conversions = 0;
+        boolean[] needConv = new boolean[1+INARG_COUNT];
+        for (int i = 0; i <= INARG_COUNT; i++) {
+            Class<?> src = (i == INARG_COUNT) ? dstType.returnType() : srcType.parameterType(i);
+            Class<?> dst = (i == INARG_COUNT) ? srcType.returnType() : dstType.parameterType(i);
+            if (!VerifyType.isNullConversion(src, dst) ||
+                level <= 1 && dst.isInterface() && !dst.isAssignableFrom(src)) {
+                needConv[i] = true;
+                conversions++;
+            }
         }
-        @Override
-        String debugString() { return addTypeString(name, this); }
+        boolean retConv = needConv[INARG_COUNT];
+
+        final int IN_MH         = 0;
+        final int INARG_BASE    = 1;
+        final int INARG_LIMIT   = INARG_BASE + INARG_COUNT;
+        final int NAME_LIMIT    = INARG_LIMIT + conversions + 1;
+        final int RETURN_CONV   = (!retConv ? -1         : NAME_LIMIT - 1);
+        final int OUT_CALL      = (!retConv ? NAME_LIMIT : RETURN_CONV) - 1;
+
+        // Now build a LambdaForm.
+        MethodType lambdaType = srcType.basicType().invokerType();
+        Name[] names = arguments(NAME_LIMIT - INARG_LIMIT, lambdaType);
+
+        // Collect the arguments to the outgoing call, maybe with conversions:
+        final int OUTARG_BASE = 0;  // target MH is Name.function, name Name.arguments[0]
+        Object[] outArgs = new Object[OUTARG_BASE + INARG_COUNT];
 
-        int getFieldI(C obj) { return unsafe.getInt(obj, offset); }
-        void setFieldI(C obj, int x) { unsafe.putInt(obj, offset, x); }
-        long getFieldJ(C obj) { return unsafe.getLong(obj, offset); }
-        void setFieldJ(C obj, long x) { unsafe.putLong(obj, offset, x); }
-        float getFieldF(C obj) { return unsafe.getFloat(obj, offset); }
-        void setFieldF(C obj, float x) { unsafe.putFloat(obj, offset, x); }
-        double getFieldD(C obj) { return unsafe.getDouble(obj, offset); }
-        void setFieldD(C obj, double x) { unsafe.putDouble(obj, offset, x); }
-        boolean getFieldZ(C obj) { return unsafe.getBoolean(obj, offset); }
-        void setFieldZ(C obj, boolean x) { unsafe.putBoolean(obj, offset, x); }
-        byte getFieldB(C obj) { return unsafe.getByte(obj, offset); }
-        void setFieldB(C obj, byte x) { unsafe.putByte(obj, offset, x); }
-        short getFieldS(C obj) { return unsafe.getShort(obj, offset); }
-        void setFieldS(C obj, short x) { unsafe.putShort(obj, offset, x); }
-        char getFieldC(C obj) { return unsafe.getChar(obj, offset); }
-        void setFieldC(C obj, char x) { unsafe.putChar(obj, offset, x); }
-        @SuppressWarnings("unchecked")
-        V getFieldL(C obj) { return (V) unsafe.getObject(obj, offset); }
-        @SuppressWarnings("unchecked")
-        void setFieldL(C obj, V x) { unsafe.putObject(obj, offset, x); }
-        // cast (V) is OK here, since we wrap convertArguments around the MH.
+        int nameCursor = INARG_LIMIT;
+        for (int i = 0; i < INARG_COUNT; i++) {
+            Class<?> src = srcType.parameterType(i);
+            Class<?> dst = dstType.parameterType(i);
+
+            if (!needConv[i]) {
+                // do nothing: difference is trivial
+                outArgs[OUTARG_BASE + i] = names[INARG_BASE + i];
+                continue;
+            }
 
-        static Object staticBase(final MemberName field) {
-            if (!field.isStatic())  return null;
-            return AccessController.doPrivileged(new PrivilegedAction<Object>() {
-                    public Object run() {
-                        try {
-                            Class c = field.getDeclaringClass();
-                            // FIXME:  Should not have to create 'f' to get this value.
-                            java.lang.reflect.Field f = c.getDeclaredField(field.getName());
-                            return unsafe.staticFieldBase(f);
-                        } catch (NoSuchFieldException ee) {
-                            throw uncaughtException(ee);
-                        }
+            // Tricky case analysis follows.
+            MethodHandle fn = null;
+            if (src.isPrimitive()) {
+                if (dst.isPrimitive()) {
+                    fn = ValueConversions.convertPrimitive(src, dst);
+                } else {
+                    Wrapper w = Wrapper.forPrimitiveType(src);
+                    MethodHandle boxMethod = ValueConversions.box(w);
+                    if (dst == w.wrapperType())
+                        fn = boxMethod;
+                    else
+                        fn = boxMethod.asType(MethodType.methodType(dst, src));
+                }
+            } else {
+                if (dst.isPrimitive()) {
+                    // Caller has boxed a primitive.  Unbox it for the target.
+                    Wrapper w = Wrapper.forPrimitiveType(dst);
+                    if (level == 0 || VerifyType.isNullConversion(src, w.wrapperType())) {
+                        fn = ValueConversions.unbox(dst);
+                    } else if (src == Object.class || !Wrapper.isWrapperType(src)) {
+                        // Examples:  Object->int, Number->int, Comparable->int; Byte->int, Character->int
+                        // must include additional conversions
+                        // src must be examined at runtime, to detect Byte, Character, etc.
+                        MethodHandle unboxMethod = (level == 1
+                                                    ? ValueConversions.unbox(dst)
+                                                    : ValueConversions.unboxCast(dst));
+                        fn = unboxMethod;
+                    } else {
+                        // Example: Byte->int
+                        // Do this by reformulating the problem to Byte->byte.
+                        Class<?> srcPrim = Wrapper.forWrapperType(src).primitiveType();
+                        MethodHandle unbox = ValueConversions.unbox(srcPrim);
+                        // Compose the two conversions.  FIXME:  should make two Names for this job
+                        fn = unbox.asType(MethodType.methodType(dst, src));
                     }
-                });
+                } else {
+                    // Simple reference conversion.
+                    // Note:  Do not check for a class hierarchy relation
+                    // between src and dst.  In all cases a 'null' argument
+                    // will pass the cast conversion.
+                    fn = ValueConversions.cast(dst);
+                }
+            }
+            Name conv = new Name(fn, names[INARG_BASE + i]);
+            assert(names[nameCursor] == null);
+            names[nameCursor++] = conv;
+            assert(outArgs[OUTARG_BASE + i] == null);
+            outArgs[OUTARG_BASE + i] = conv;
         }
 
-        int getStaticI() { return unsafe.getInt(base, offset); }
-        void setStaticI(int x) { unsafe.putInt(base, offset, x); }
-        long getStaticJ() { return unsafe.getLong(base, offset); }
-        void setStaticJ(long x) { unsafe.putLong(base, offset, x); }
-        float getStaticF() { return unsafe.getFloat(base, offset); }
-        void setStaticF(float x) { unsafe.putFloat(base, offset, x); }
-        double getStaticD() { return unsafe.getDouble(base, offset); }
-        void setStaticD(double x) { unsafe.putDouble(base, offset, x); }
-        boolean getStaticZ() { return unsafe.getBoolean(base, offset); }
-        void setStaticZ(boolean x) { unsafe.putBoolean(base, offset, x); }
-        byte getStaticB() { return unsafe.getByte(base, offset); }
-        void setStaticB(byte x) { unsafe.putByte(base, offset, x); }
-        short getStaticS() { return unsafe.getShort(base, offset); }
-        void setStaticS(short x) { unsafe.putShort(base, offset, x); }
-        char getStaticC() { return unsafe.getChar(base, offset); }
-        void setStaticC(char x) { unsafe.putChar(base, offset, x); }
-        V getStaticL() { return (V) unsafe.getObject(base, offset); }
-        void setStaticL(V x) { unsafe.putObject(base, offset, x); }
+        // Build argument array for the call.
+        assert(nameCursor == OUT_CALL);
+        names[OUT_CALL] = new Name(target, outArgs);
 
-        static String fname(Class<?> vclass, boolean isSetter, boolean isStatic) {
-            String stem;
-            if (!isStatic)
-                stem = (!isSetter ? "getField" : "setField");
-            else
-                stem = (!isSetter ? "getStatic" : "setStatic");
-            return stem + Wrapper.basicTypeChar(vclass);
+        if (RETURN_CONV < 0) {
+            assert(OUT_CALL == names.length-1);
+        } else {
+            Class<?> needReturn = srcType.returnType();
+            Class<?> haveReturn = dstType.returnType();
+            MethodHandle fn;
+            Object[] arg = { names[OUT_CALL] };
+            if (haveReturn == void.class) {
+                // synthesize a zero value for the given void
+                Object zero = Wrapper.forBasicType(needReturn).zero();
+                fn = MethodHandles.constant(needReturn, zero);
+                arg = new Object[0];  // don't pass names[OUT_CALL] to conversion
+            } else {
+                MethodHandle identity = MethodHandles.identity(needReturn);
+                MethodType needConversion = identity.type().changeParameterType(0, haveReturn);
+                fn = makePairwiseConvert(identity, needConversion, level);
+            }
+            assert(names[RETURN_CONV] == null);
+            names[RETURN_CONV] = new Name(fn, arg);
+            assert(RETURN_CONV == names.length-1);
         }
-        static MethodType ftype(Class<?> cclass, Class<?> vclass, boolean isSetter, boolean isStatic) {
-            MethodType type;
-            if (!isStatic) {
-                if (!isSetter)
-                    return MethodType.methodType(vclass, cclass);
-                else
-                    return MethodType.methodType(void.class, cclass, vclass);
-            } else {
-                if (!isSetter)
-                    return MethodType.methodType(vclass);
-                else
-                    return MethodType.methodType(void.class, vclass);
-            }
+
+        LambdaForm form = new LambdaForm("convert", lambdaType.parameterCount(), names);
+        return SimpleMethodHandle.make(srcType, form);
+    }
+
+    static MethodHandle makeReferenceIdentity(Class<?> refType) {
+        MethodType lambdaType = MethodType.genericMethodType(1).invokerType();
+        Name[] names = arguments(1, lambdaType);
+        names[names.length - 1] = new Name(ValueConversions.identity(), names[1]);
+        LambdaForm form = new LambdaForm("identity", lambdaType.parameterCount(), names);
+        return SimpleMethodHandle.make(MethodType.methodType(refType, refType), form);
+    }
+
+    static MethodHandle makeVarargsCollector(MethodHandle target, Class<?> arrayType) {
+        MethodType type = target.type();
+        int last = type.parameterCount() - 1;
+        if (type.parameterType(last) != arrayType)
+            target = target.asType(type.changeParameterType(last, arrayType));
+        target = target.asFixedArity();  // make sure this attribute is turned off
+        return new AsVarargsCollector(target, target.type(), arrayType);
+    }
+
+    static class AsVarargsCollector extends MethodHandle {
+        private final MethodHandle target;
+        private final Class<?> arrayType;
+        private MethodHandle cache;
+
+        AsVarargsCollector(MethodHandle target, MethodType type, Class<?> arrayType) {
+            super(type, reinvokerForm(type));
+            this.target = target;
+            this.arrayType = arrayType;
+            this.cache = target.asCollector(arrayType, 0);
         }
-        static MethodHandle fhandle(Class<?> cclass, Class<?> vclass, boolean isSetter, boolean isStatic) {
-            String name = FieldAccessor.fname(vclass, isSetter, isStatic);
-            if (cclass.isPrimitive())  throw newIllegalArgumentException("primitive "+cclass);
-            Class<?> ecclass = Object.class;  //erase this type
-            Class<?> evclass = vclass;
-            if (!evclass.isPrimitive())  evclass = Object.class;
-            MethodType type = FieldAccessor.ftype(ecclass, evclass, isSetter, isStatic);
-            MethodHandle mh;
-            try {
-                mh = IMPL_LOOKUP.findVirtual(FieldAccessor.class, name, type);
-            } catch (ReflectiveOperationException ex) {
-                throw uncaughtException(ex);
-            }
-            if (evclass != vclass || (!isStatic && ecclass != cclass)) {
-                MethodType strongType = FieldAccessor.ftype(cclass, vclass, isSetter, isStatic);
-                strongType = strongType.insertParameterTypes(0, FieldAccessor.class);
-                mh = convertArguments(mh, strongType, 0);
-            }
-            return mh;
+
+        @Override MethodHandle reinvokerTarget() { return target; }
+
+        @Override
+        public boolean isVarargsCollector() {
+            return true;
         }
 
-        /// Support for array element access
-        static final HashMap<Class<?>, MethodHandle[]> ARRAY_CACHE =
-                new HashMap<Class<?>, MethodHandle[]>();
-        // FIXME: Cache on the classes themselves, not here.
-        static boolean doCache(Class<?> elemClass) {
-            if (elemClass.isPrimitive())  return true;
-            ClassLoader cl = elemClass.getClassLoader();
-            return cl == null || cl == ClassLoader.getSystemClassLoader();
+        @Override
+        public MethodHandle asFixedArity() {
+            return target;
         }
-        static int getElementI(int[] a, int i) { return a[i]; }
-        static void setElementI(int[] a, int i, int x) { a[i] = x; }
-        static long getElementJ(long[] a, int i) { return a[i]; }
-        static void setElementJ(long[] a, int i, long x) { a[i] = x; }
-        static float getElementF(float[] a, int i) { return a[i]; }
-        static void setElementF(float[] a, int i, float x) { a[i] = x; }
-        static double getElementD(double[] a, int i) { return a[i]; }
-        static void setElementD(double[] a, int i, double x) { a[i] = x; }
-        static boolean getElementZ(boolean[] a, int i) { return a[i]; }
-        static void setElementZ(boolean[] a, int i, boolean x) { a[i] = x; }
-        static byte getElementB(byte[] a, int i) { return a[i]; }
-        static void setElementB(byte[] a, int i, byte x) { a[i] = x; }
-        static short getElementS(short[] a, int i) { return a[i]; }
-        static void setElementS(short[] a, int i, short x) { a[i] = x; }
-        static char getElementC(char[] a, int i) { return a[i]; }
-        static void setElementC(char[] a, int i, char x) { a[i] = x; }
-        static Object getElementL(Object[] a, int i) { return a[i]; }
-        static void setElementL(Object[] a, int i, Object x) { a[i] = x; }
-        static <V> V getElementL(Class<V[]> aclass, V[] a, int i) { return aclass.cast(a)[i]; }
-        static <V> void setElementL(Class<V[]> aclass, V[] a, int i, V x) { aclass.cast(a)[i] = x; }
+
+        @Override
+        public MethodHandle asType(MethodType newType) {
+            MethodType type = this.type();
+            int collectArg = type.parameterCount() - 1;
+            int newArity = newType.parameterCount();
+            if (newArity == collectArg+1 &&
+                type.parameterType(collectArg).isAssignableFrom(newType.parameterType(collectArg))) {
+                // if arity and trailing parameter are compatible, do normal thing
+                return asFixedArity().asType(newType);
+            }
+            // check cache
+            if (cache.type().parameterCount() == newArity)
+                return cache.asType(newType);
+            // build and cache a collector
+            int arrayLength = newArity - collectArg;
+            MethodHandle collector;
+            try {
+                collector = asFixedArity().asCollector(arrayType, arrayLength);
+                assert(collector.type().parameterCount() == newArity) : "newArity="+newArity+" but collector="+collector;
+            } catch (IllegalArgumentException ex) {
+                throw new WrongMethodTypeException("cannot build collector", ex);
+            }
+            cache = collector;
+            return collector.asType(newType);
+        }
 
-        static String aname(Class<?> aclass, boolean isSetter) {
-            Class<?> vclass = aclass.getComponentType();
-            if (vclass == null)  throw new IllegalArgumentException();
-            return (!isSetter ? "getElement" : "setElement") + Wrapper.basicTypeChar(vclass);
+        @Override
+        MethodHandle setVarargs(MemberName member) {
+            if (member.isVarargs())  return this;
+            return asFixedArity();
         }
-        static MethodType atype(Class<?> aclass, boolean isSetter) {
-            Class<?> vclass = aclass.getComponentType();
-            if (!isSetter)
-                return MethodType.methodType(vclass, aclass, int.class);
-            else
-                return MethodType.methodType(void.class, aclass, int.class, vclass);
+
+        @Override
+        MethodHandle viewAsType(MethodType newType) {
+            MethodHandle mh = super.viewAsType(newType);
+            // put back the varargs bit:
+            MethodType type = mh.type();
+            int arity = type.parameterCount();
+            return mh.asVarargsCollector(type.parameterType(arity-1));
+        }
+
+        @Override
+        MemberName internalMemberName() {
+            return asFixedArity().internalMemberName();
         }
-        static MethodHandle ahandle(Class<?> aclass, boolean isSetter) {
-            Class<?> vclass = aclass.getComponentType();
-            String name = FieldAccessor.aname(aclass, isSetter);
-            Class<?> caclass = null;
-            if (!vclass.isPrimitive() && vclass != Object.class) {
-                caclass = aclass;
-                aclass = Object[].class;
-                vclass = Object.class;
-            }
-            MethodType type = FieldAccessor.atype(aclass, isSetter);
-            if (caclass != null)
-                type = type.insertParameterTypes(0, Class.class);
-            MethodHandle mh;
-            try {
-                mh = IMPL_LOOKUP.findStatic(FieldAccessor.class, name, type);
-            } catch (ReflectiveOperationException ex) {
-                throw uncaughtException(ex);
-            }
-            if (caclass != null) {
-                MethodType strongType = FieldAccessor.atype(caclass, isSetter);
-                mh = mh.bindTo(caclass);
-                mh = convertArguments(mh, strongType, 0);
-            }
-            return mh;
+
+
+        @Override
+        MethodHandle bindArgument(int pos, char basicType, Object value) {
+            return asFixedArity().bindArgument(pos, basicType, value);
+        }
+
+        @Override
+        MethodHandle bindReceiver(Object receiver) {
+            return asFixedArity().bindReceiver(receiver);
+        }
+
+        @Override
+        MethodHandle dropArguments(MethodType srcType, int pos, int drops) {
+            return asFixedArity().dropArguments(srcType, pos, drops);
+        }
+
+        @Override
+        MethodHandle permuteArguments(MethodType newType, int[] reorder) {
+            return asFixedArity().permuteArguments(newType, reorder);
         }
     }
 
-    /** Bind a predetermined first argument to the given direct method handle.
-     * Callable only from MethodHandles.
-     * @param token Proof that the caller has access to this package.
-     * @param target Any direct method handle.
-     * @param receiver Receiver (or first static method argument) to pre-bind.
-     * @return a BoundMethodHandle for the given DirectMethodHandle, or null if it does not exist
-     */
-    static
-    MethodHandle bindReceiver(MethodHandle target, Object receiver) {
-        if (receiver == null)  return null;
-        if (target instanceof AdapterMethodHandle &&
-            ((AdapterMethodHandle)target).conversionOp() == MethodHandleNatives.Constants.OP_RETYPE_ONLY
-            ) {
-            Object info = MethodHandleNatives.getTargetInfo(target);
-            if (info instanceof DirectMethodHandle) {
-                DirectMethodHandle dmh = (DirectMethodHandle) info;
-                if (dmh.type().parameterType(0).isAssignableFrom(receiver.getClass())) {
-                    MethodHandle bmh = new BoundMethodHandle(dmh, receiver, 0);
-                    MethodType newType = target.type().dropParameterTypes(0, 1);
-                    return convertArguments(bmh, newType, bmh.type(), 0);
-                }
-            }
+    /** Factory method:  Spread selected argument. */
+    static MethodHandle makeSpreadArguments(MethodHandle target,
+                                            Class<?> spreadArgType, int spreadArgPos, int spreadArgCount) {
+        MethodType targetType = target.type();
+
+        for (int i = 0; i < spreadArgCount; i++) {
+            Class<?> arg = VerifyType.spreadArgElementType(spreadArgType, i);
+            if (arg == null)  arg = Object.class;
+            targetType = targetType.changeParameterType(spreadArgPos + i, arg);
         }
-        if (target instanceof DirectMethodHandle)
-            return new BoundMethodHandle((DirectMethodHandle)target, receiver, 0);
-        return null;   // let caller try something else
-    }
-
-    /** Bind a predetermined argument to the given arbitrary method handle.
-     * Callable only from MethodHandles.
-     * @param token Proof that the caller has access to this package.
-     * @param target Any method handle.
-     * @param receiver Argument (which can be a boxed primitive) to pre-bind.
-     * @return a suitable BoundMethodHandle
-     */
-    static
-    MethodHandle bindArgument(MethodHandle target, int argnum, Object receiver) {
-        return new BoundMethodHandle(target, receiver, argnum);
-    }
+        target = target.asType(targetType);
 
-    static MethodHandle permuteArguments(MethodHandle target,
-                                                MethodType newType,
-                                                MethodType oldType,
-                                                int[] permutationOrNull) {
-        assert(oldType.parameterCount() == target.type().parameterCount());
-        int outargs = oldType.parameterCount(), inargs = newType.parameterCount();
-        if (permutationOrNull.length != outargs)
-            throw newIllegalArgumentException("wrong number of arguments in permutation");
-        // Make the individual outgoing argument types match up first.
-        Class<?>[] callTypeArgs = new Class<?>[outargs];
-        for (int i = 0; i < outargs; i++)
-            callTypeArgs[i] = newType.parameterType(permutationOrNull[i]);
-        MethodType callType = MethodType.methodType(oldType.returnType(), callTypeArgs);
-        target = convertArguments(target, callType, oldType, 0);
-        assert(target != null);
-        oldType = target.type();
-        List<Integer> goal = new ArrayList<Integer>();  // i*TOKEN
-        List<Integer> state = new ArrayList<Integer>(); // i*TOKEN
-        List<Integer> drops = new ArrayList<Integer>(); // not tokens
-        List<Integer> dups = new ArrayList<Integer>();  // not tokens
-        final int TOKEN = 10; // to mark items which are symbolic only
-        // state represents the argument values coming into target
-        for (int i = 0; i < outargs; i++) {
-            state.add(permutationOrNull[i] * TOKEN);
-        }
-        // goal represents the desired state
-        for (int i = 0; i < inargs; i++) {
-            if (state.contains(i * TOKEN)) {
-                goal.add(i * TOKEN);
-            } else {
-                // adapter must initially drop all unused arguments
-                drops.add(i);
-            }
-        }
-        // detect duplications
-        while (state.size() > goal.size()) {
-            for (int i2 = 0; i2 < state.size(); i2++) {
-                int arg1 = state.get(i2);
-                int i1 = state.indexOf(arg1);
-                if (i1 != i2) {
-                    // found duplicate occurrence at i2
-                    int arg2 = (inargs++) * TOKEN;
-                    state.set(i2, arg2);
-                    dups.add(goal.indexOf(arg1));
-                    goal.add(arg2);
+        MethodType srcType = targetType
+                .replaceParameterTypes(spreadArgPos, spreadArgPos + spreadArgCount, spreadArgType);
+        // Now build a LambdaForm.
+        MethodType lambdaType = srcType.invokerType();
+        Name[] names = arguments(spreadArgCount + 2, lambdaType);
+        int nameCursor = lambdaType.parameterCount();
+        int[] indexes = new int[targetType.parameterCount()];
+
+        for (int i = 0, argIndex = 1; i < targetType.parameterCount() + 1; i++, argIndex++) {
+            Class<?> src = lambdaType.parameterType(i);
+            if (i == spreadArgPos) {
+                // Spread the array.
+                MethodHandle aload = MethodHandles.arrayElementGetter(spreadArgType);
+                Name array = names[argIndex];
+                names[nameCursor++] = new Name(NF_checkSpreadArgument, array, spreadArgCount);
+                for (int j = 0; j < spreadArgCount; i++, j++) {
+                    indexes[i] = nameCursor;
+                    names[nameCursor++] = new Name(aload, array, j);
                 }
+            } else if (i < indexes.length) {
+                indexes[i] = argIndex;
             }
         }
-        assert(state.size() == goal.size());
-        int size = goal.size();
-        while (!state.equals(goal)) {
-            // Look for a maximal sequence of adjacent misplaced arguments,
-            // and try to rotate them into place.
-            int bestRotArg = -10 * TOKEN, bestRotLen = 0;
-            int thisRotArg = -10 * TOKEN, thisRotLen = 0;
-            for (int i = 0; i < size; i++) {
-                int arg = state.get(i);
-                // Does this argument match the current run?
-                if (arg == thisRotArg + TOKEN) {
-                    thisRotArg = arg;
-                    thisRotLen += 1;
-                    if (bestRotLen < thisRotLen) {
-                        bestRotLen = thisRotLen;
-                        bestRotArg = thisRotArg;
-                    }
-                } else {
-                    // The old sequence (if any) stops here.
-                    thisRotLen = 0;
-                    thisRotArg = -10 * TOKEN;
-                    // But maybe a new one starts here also.
-                    int wantArg = goal.get(i);
-                    final int MAX_ARG_ROTATION = AdapterMethodHandle.MAX_ARG_ROTATION;
-                    if (arg != wantArg &&
-                        arg >= wantArg - TOKEN * MAX_ARG_ROTATION &&
-                        arg <= wantArg + TOKEN * MAX_ARG_ROTATION) {
-                        thisRotArg = arg;
-                        thisRotLen = 1;
-                    }
-                }
-            }
-            if (bestRotLen >= 2) {
-                // Do a rotation if it can improve argument positioning
-                // by at least 2 arguments.  This is not always optimal,
-                // but it seems to catch common cases.
-                int dstEnd = state.indexOf(bestRotArg);
-                int srcEnd = goal.indexOf(bestRotArg);
-                int rotBy = dstEnd - srcEnd;
-                int dstBeg = dstEnd - (bestRotLen - 1);
-                int srcBeg = srcEnd - (bestRotLen - 1);
-                assert((dstEnd | dstBeg | srcEnd | srcBeg) >= 0); // no negs
-                // Make a span which covers both source and destination.
-                int rotBeg = Math.min(dstBeg, srcBeg);
-                int rotEnd = Math.max(dstEnd, srcEnd);
-                int score = 0;
-                for (int i = rotBeg; i <= rotEnd; i++) {
-                    if ((int)state.get(i) != (int)goal.get(i))
-                        score += 1;
-                }
-                List<Integer> rotSpan = state.subList(rotBeg, rotEnd+1);
-                Collections.rotate(rotSpan, -rotBy);  // reverse direction
-                for (int i = rotBeg; i <= rotEnd; i++) {
-                    if ((int)state.get(i) != (int)goal.get(i))
-                        score -= 1;
-                }
-                if (score >= 2) {
-                    // Improved at least two argument positions.  Do it.
-                    List<Class<?>> ptypes = Arrays.asList(oldType.parameterArray());
-                    Collections.rotate(ptypes.subList(rotBeg, rotEnd+1), -rotBy);
-                    MethodType rotType = MethodType.methodType(oldType.returnType(), ptypes);
-                    MethodHandle nextTarget
-                            = AdapterMethodHandle.makeRotateArguments(rotType, target,
-                                    rotBeg, rotSpan.size(), rotBy);
-                    if (nextTarget != null) {
-                        //System.out.println("Rot: "+rotSpan+" by "+rotBy);
-                        target = nextTarget;
-                        oldType = rotType;
-                        continue;
-                    }
-                }
-                // Else de-rotate, and drop through to the swap-fest.
-                Collections.rotate(rotSpan, rotBy);
-            }
+        assert(nameCursor == names.length-1);  // leave room for the final call
 
-            // Now swap like the wind!
-            List<Class<?>> ptypes = Arrays.asList(oldType.parameterArray());
-            for (int i = 0; i < size; i++) {
-                // What argument do I want here?
-                int arg = goal.get(i);
-                if (arg != state.get(i)) {
-                    // Where is it now?
-                    int j = state.indexOf(arg);
-                    Collections.swap(ptypes, i, j);
-                    MethodType swapType = MethodType.methodType(oldType.returnType(), ptypes);
-                    target = AdapterMethodHandle.makeSwapArguments(swapType, target, i, j);
-                    if (target == null)  throw newIllegalArgumentException("cannot swap");
-                    assert(target.type() == swapType);
-                    oldType = swapType;
-                    Collections.swap(state, i, j);
-                }
-            }
-            // One pass of swapping must finish the job.
-            assert(state.equals(goal));
-        }
-        while (!dups.isEmpty()) {
-            // Grab a contiguous trailing sequence of dups.
-            int grab = dups.size() - 1;
-            int dupArgPos = dups.get(grab), dupArgCount = 1;
-            while (grab - 1 >= 0) {
-                int dup0 = dups.get(grab - 1);
-                if (dup0 != dupArgPos - 1)  break;
-                dupArgPos -= 1;
-                dupArgCount += 1;
-                grab -= 1;
-            }
-            //if (dupArgCount > 1)  System.out.println("Dup: "+dups.subList(grab, dups.size()));
-            dups.subList(grab, dups.size()).clear();
-            // In the new target type drop that many args from the tail:
-            List<Class<?>> ptypes = oldType.parameterList();
-            ptypes = ptypes.subList(0, ptypes.size() - dupArgCount);
-            MethodType dupType = MethodType.methodType(oldType.returnType(), ptypes);
-            target = AdapterMethodHandle.makeDupArguments(dupType, target, dupArgPos, dupArgCount);
-            if (target == null)
-                throw newIllegalArgumentException("cannot dup");
-            oldType = target.type();
+        // Build argument array for the call.
+        Name[] targetArgs = new Name[targetType.parameterCount()];
+        for (int i = 0; i < targetType.parameterCount(); i++) {
+            int idx = indexes[i];
+            targetArgs[i] = names[idx];
         }
-        while (!drops.isEmpty()) {
-            // Grab a contiguous initial sequence of drops.
-            int dropArgPos = drops.get(0), dropArgCount = 1;
-            while (dropArgCount < drops.size()) {
-                int drop1 = drops.get(dropArgCount);
-                if (drop1 != dropArgPos + dropArgCount)  break;
-                dropArgCount += 1;
-            }
-            //if (dropArgCount > 1)  System.out.println("Drop: "+drops.subList(0, dropArgCount));
-            drops.subList(0, dropArgCount).clear();
-            List<Class<?>> dropTypes = newType.parameterList()
-                    .subList(dropArgPos, dropArgPos + dropArgCount);
-            MethodType dropType = oldType.insertParameterTypes(dropArgPos, dropTypes);
-            target = AdapterMethodHandle.makeDropArguments(dropType, target, dropArgPos, dropArgCount);
-            if (target == null)  throw newIllegalArgumentException("cannot drop");
-            oldType = target.type();
-        }
-        target = convertArguments(target, newType, oldType, 0);
-        assert(target != null);
-        return target;
-    }
+        names[names.length - 1] = new Name(target, (Object[]) targetArgs);
 
-    /*non-public*/ static
-    MethodHandle convertArguments(MethodHandle target, MethodType newType, int level) {
-        MethodType oldType = target.type();
-        if (oldType.equals(newType))
-            return target;
-        assert(level > 1 || oldType.isConvertibleTo(newType));
-        MethodHandle retFilter = null;
-        Class<?> oldRT = oldType.returnType();
-        Class<?> newRT = newType.returnType();
-        if (!VerifyType.isNullConversion(oldRT, newRT)) {
-            if (oldRT == void.class) {
-                Wrapper wrap = newRT.isPrimitive() ? Wrapper.forPrimitiveType(newRT) : Wrapper.OBJECT;
-                retFilter = ValueConversions.zeroConstantFunction(wrap);
-            } else {
-                retFilter = MethodHandles.identity(newRT);
-                retFilter = convertArguments(retFilter, retFilter.type().changeParameterType(0, oldRT), level);
-            }
-            newType = newType.changeReturnType(oldRT);
-        }
-        MethodHandle res = null;
-        Exception ex = null;
-        try {
-            res = convertArguments(target, newType, oldType, level);
-        } catch (IllegalArgumentException ex1) {
-            ex = ex1;
-        }
-        if (res == null) {
-            WrongMethodTypeException wmt = new WrongMethodTypeException("cannot convert to "+newType+": "+target);
-            wmt.initCause(ex);
-            throw wmt;
-        }
-        if (retFilter != null)
-            res = MethodHandles.filterReturnValue(res, retFilter);
-        return res;
+        LambdaForm form = new LambdaForm("spread", lambdaType.parameterCount(), names);
+        return SimpleMethodHandle.make(srcType, form);
     }
 
-    static MethodHandle convertArguments(MethodHandle target,
-                                                MethodType newType,
-                                                MethodType oldType,
-                                                int level) {
-        assert(oldType.parameterCount() == target.type().parameterCount());
-        if (newType == oldType)
-            return target;
-        if (oldType.parameterCount() != newType.parameterCount())
-            throw newIllegalArgumentException("mismatched parameter count", oldType, newType);
-        MethodHandle res = AdapterMethodHandle.makePairwiseConvert(newType, target, level);
-        if (res != null)
-            return res;
-        // We can come here in the case of target(int)void => (Object)void,
-        // because the unboxing logic for Object => int is complex.
-        int argc = oldType.parameterCount();
-        assert(MethodHandleNatives.workaroundWithoutRicochetFrames());  // this code is deprecated
-        // The JVM can't do it directly, so fill in the gap with a Java adapter.
-        // TO DO: figure out what to put here from case-by-case experience
-        // Use a heavier method:  Convert all the arguments to Object,
-        // then back to the desired types.  We might have to use Java-based
-        // method handles to do this.
-        MethodType objType = MethodType.genericMethodType(argc);
-        MethodHandle objTarget = AdapterMethodHandle.makePairwiseConvert(objType, target, level);
-        if (objTarget == null)
-            objTarget = FromGeneric.make(target);
-        res = AdapterMethodHandle.makePairwiseConvert(newType, objTarget, level);
-        if (res != null)
-            return res;
-        return ToGeneric.make(newType, objTarget);
-    }
-
-    static MethodHandle spreadArguments(MethodHandle target, Class<?> arrayType, int arrayLength) {
-        MethodType oldType = target.type();
-        int nargs = oldType.parameterCount();
-        int keepPosArgs = nargs - arrayLength;
-        MethodType newType = oldType
-                .dropParameterTypes(keepPosArgs, nargs)
-                .insertParameterTypes(keepPosArgs, arrayType);
-        return spreadArguments(target, newType, keepPosArgs, arrayType, arrayLength);
-    }
-    // called internally only
-    static MethodHandle spreadArgumentsFromPos(MethodHandle target, MethodType newType, int spreadArgPos) {
-        int arrayLength = target.type().parameterCount() - spreadArgPos;
-        return spreadArguments(target, newType, spreadArgPos, Object[].class, arrayLength);
-    }
-    static MethodHandle spreadArguments(MethodHandle target,
-                                               MethodType newType,
-                                               int spreadArgPos,
-                                               Class<?> arrayType,
-                                               int arrayLength) {
-        // TO DO: maybe allow the restarg to be Object and implicitly cast to Object[]
-        MethodType oldType = target.type();
-        // spread the last argument of newType to oldType
-        assert(arrayLength == oldType.parameterCount() - spreadArgPos);
-        assert(newType.parameterType(spreadArgPos) == arrayType);
-        return AdapterMethodHandle.makeSpreadArguments(newType, target, arrayType, spreadArgPos, arrayLength);
+    static void checkSpreadArgument(Object av, int n) {
+        // FIXME: regression test for bug 7141637 erroneously expects an NPE, and other tests may expect IAE
+        // but the actual exception raised by an arity mismatch should be WMTE
+        final boolean RAISE_RANDOM_EXCEPTIONS = true;  // FIXME: delete in JSR 292 M1
+        if (av == null) {
+            if (n == 0)  return;
+            int len;
+            if (RAISE_RANDOM_EXCEPTIONS)
+                len = ((Object[])av).length;  // throw NPE; but delete this after tests are fixed
+        } else if (av instanceof Object[]) {
+            int len = ((Object[])av).length;
+            if (len == n)  return;
+        } else {
+            int len = java.lang.reflect.Array.getLength(av);
+            if (len == n)  return;
+        }
+        // fall through to error:
+        if (RAISE_RANDOM_EXCEPTIONS)
+            throw newIllegalArgumentException("Array is not of length "+n);
+        throw new WrongMethodTypeException("Array is not of length "+n);
     }
 
-    static MethodHandle collectArguments(MethodHandle target,
-                                                int collectArg,
-                                                MethodHandle collector) {
-        MethodType type = target.type();
-        Class<?> collectType = collector.type().returnType();
-        assert(collectType != void.class);  // else use foldArguments
-        if (collectType != type.parameterType(collectArg))
-            target = target.asType(type.changeParameterType(collectArg, collectType));
-        MethodType newType = type
-                .dropParameterTypes(collectArg, collectArg+1)
-                .insertParameterTypes(collectArg, collector.type().parameterArray());
-        return collectArguments(target, newType, collectArg, collector);
-    }
-    static MethodHandle collectArguments(MethodHandle target,
-                                                MethodType newType,
-                                                int collectArg,
-                                                MethodHandle collector) {
-        MethodType oldType = target.type();     // (a...,c)=>r
-        //         newType                      // (a..., b...)=>r
-        MethodType colType = collector.type();  // (b...)=>c
-        //         oldType                      // (a..., b...)=>r
-        assert(newType.parameterCount() == collectArg + colType.parameterCount());
-        assert(oldType.parameterCount() == collectArg + 1);
-        MethodHandle result = null;
-        if (AdapterMethodHandle.canCollectArguments(oldType, colType, collectArg, false)) {
-            result = AdapterMethodHandle.makeCollectArguments(target, collector, collectArg, false);
-        }
-        if (result == null) {
-            assert(MethodHandleNatives.workaroundWithoutRicochetFrames());  // this code is deprecated
-            MethodHandle gtarget = convertArguments(target, oldType.generic(), oldType, 0);
-            MethodHandle gcollector = convertArguments(collector, colType.generic(), colType, 0);
-            if (gtarget == null || gcollector == null)  return null;
-            MethodHandle gresult = FilterGeneric.makeArgumentCollector(gcollector, gtarget);
-            result = convertArguments(gresult, newType, gresult.type(), 0);
+    private static final NamedFunction NF_checkSpreadArgument;
+    static {
+        try {
+            NF_checkSpreadArgument = new NamedFunction(MethodHandleImpl.class
+                    .getDeclaredMethod("checkSpreadArgument", Object.class, int.class));
+            NF_checkSpreadArgument.resolve();
+        } catch (ReflectiveOperationException ex) {
+            throw newInternalError(ex);
         }
-        return result;
-    }
-
-    static MethodHandle filterArgument(MethodHandle target,
-                                       int pos,
-                                       MethodHandle filter) {
-        MethodType ttype = target.type();
-        MethodType ftype = filter.type();
-        assert(ftype.parameterCount() == 1);
-        MethodHandle result = null;
-        if (AdapterMethodHandle.canCollectArguments(ttype, ftype, pos, false)) {
-            result = AdapterMethodHandle.makeCollectArguments(target, filter, pos, false);
-            if (result != null)  return result;
-        }
-        assert(MethodHandleNatives.workaroundWithoutRicochetFrames());  // this code is deprecated
-        MethodType rtype = ttype.changeParameterType(pos, ftype.parameterType(0));
-        MethodType gttype = ttype.generic();
-        if (ttype != gttype) {
-            target = convertArguments(target, gttype, ttype, 0);
-            ttype = gttype;
-        }
-        MethodType gftype = ftype.generic();
-        if (ftype != gftype) {
-            filter = convertArguments(filter, gftype, ftype, 0);
-            ftype = gftype;
-        }
-        if (ftype == ttype) {
-            // simple unary case
-            result = FilterOneArgument.make(filter, target);
-        } else {
-            result = FilterGeneric.makeArgumentFilter(pos, filter, target);
-        }
-        if (result.type() != rtype)
-            result = result.asType(rtype);
-        return result;
     }
 
-    static MethodHandle foldArguments(MethodHandle target,
-                                      MethodType newType,
-                                      int foldPos,
-                                      MethodHandle combiner) {
-        MethodType oldType = target.type();
-        MethodType ctype = combiner.type();
-        if (AdapterMethodHandle.canCollectArguments(oldType, ctype, foldPos, true)) {
-            MethodHandle res = AdapterMethodHandle.makeCollectArguments(target, combiner, foldPos, true);
-            if (res != null)  return res;
-        }
-        assert(MethodHandleNatives.workaroundWithoutRicochetFrames());  // this code is deprecated
-        if (foldPos != 0)  return null;
-        MethodHandle gtarget = convertArguments(target, oldType.generic(), oldType, 0);
-        MethodHandle gcombiner = convertArguments(combiner, ctype.generic(), ctype, 0);
-        if (ctype.returnType() == void.class) {
-            gtarget = dropArguments(gtarget, oldType.generic().insertParameterTypes(foldPos, Object.class), foldPos);
-        }
-        if (gtarget == null || gcombiner == null)  return null;
-        MethodHandle gresult = FilterGeneric.makeArgumentFolder(gcombiner, gtarget);
-        return convertArguments(gresult, newType, gresult.type(), 0);
-    }
-
-    static
-    MethodHandle dropArguments(MethodHandle target,
-                               MethodType newType, int argnum) {
-        int drops = newType.parameterCount() - target.type().parameterCount();
-        MethodHandle res = AdapterMethodHandle.makeDropArguments(newType, target, argnum, drops);
-        if (res != null)
-            return res;
-        throw new UnsupportedOperationException("NYI");
-    }
-
-    private static class GuardWithTest extends BoundMethodHandle {
-        private final MethodHandle test, target, fallback;
-        private GuardWithTest(MethodHandle invoker,
-                              MethodHandle test, MethodHandle target, MethodHandle fallback) {
-            super(invoker);
-            this.test = test;
-            this.target = target;
-            this.fallback = fallback;
-        }
-        static boolean preferRicochetFrame(MethodType type) {
-            return true;  // always use RF if available
-        }
-        static MethodHandle make(MethodHandle test, MethodHandle target, MethodHandle fallback) {
-            MethodType type = target.type();
-            int nargs = type.parameterCount();
-            if (nargs < INVOKES.length) {
-                if (preferRicochetFrame(type))
-                    assert(MethodHandleNatives.workaroundWithoutRicochetFrames());  // this code is deprecated
-                MethodHandle invoke = INVOKES[nargs];
-                MethodType gtype = type.generic();
-                assert(invoke.type().dropParameterTypes(0,1) == gtype);
-                // Note: convertArguments(...2) avoids interface casts present in convertArguments(...0)
-                MethodHandle gtest = convertArguments(test, gtype.changeReturnType(boolean.class), test.type(), 2);
-                MethodHandle gtarget = convertArguments(target, gtype, type, 2);
-                MethodHandle gfallback = convertArguments(fallback, gtype, type, 2);
-                if (gtest == null || gtarget == null || gfallback == null)  return null;
-                MethodHandle gguard = new GuardWithTest(invoke, gtest, gtarget, gfallback);
-                return convertArguments(gguard, type, gtype, 2);
-            } else {
-                assert(MethodHandleNatives.workaroundWithoutRicochetFrames());  // this code is deprecated
-                MethodHandle invoke = VARARGS_INVOKE;
-                MethodType gtype = MethodType.genericMethodType(1);
-                assert(invoke.type().dropParameterTypes(0,1) == gtype);
-                MethodHandle gtest = spreadArgumentsFromPos(test, gtype.changeReturnType(boolean.class), 0);
-                MethodHandle gtarget = spreadArgumentsFromPos(target, gtype, 0);
-                MethodHandle gfallback = spreadArgumentsFromPos(fallback, gtype, 0);
-                MethodHandle gguard = new GuardWithTest(invoke, gtest, gtarget, gfallback);
-                if (gtest == null || gtarget == null || gfallback == null)  return null;
-                return collectArguments(gguard, type, 0, null);
-            }
-        }
-        @Override
-        String debugString() {
-            return addTypeString(target, this);
+    /** Factory method:  Collect or filter selected argument(s). */
+    static MethodHandle makeCollectArguments(MethodHandle target,
+                MethodHandle collector, int collectArgPos, boolean retainOriginalArgs) {
+        MethodType targetType = target.type();          // (a..., c, [b...])=>r
+        MethodType collectorType = collector.type();    // (b...)=>c
+        int collectArgCount = collectorType.parameterCount();
+        Class<?> collectValType = collectorType.returnType();
+        int collectValCount = (collectValType == void.class ? 0 : 1);
+        MethodType srcType = targetType                 // (a..., [b...])=>r
+                .dropParameterTypes(collectArgPos, collectArgPos+collectValCount);
+        if (!retainOriginalArgs) {                      // (a..., b...)=>r
+            srcType = srcType.insertParameterTypes(collectArgPos, collectorType.parameterList());
         }
-        private Object invoke_V(Object... av) throws Throwable {
-            if ((boolean) test.invokeExact(av))
-                return target.invokeExact(av);
-            return fallback.invokeExact(av);
-        }
-        private Object invoke_L0() throws Throwable {
-            if ((boolean) test.invokeExact())
-                return target.invokeExact();
-            return fallback.invokeExact();
-        }
-        private Object invoke_L1(Object a0) throws Throwable {
-            if ((boolean) test.invokeExact(a0))
-                return target.invokeExact(a0);
-            return fallback.invokeExact(a0);
-        }
-        private Object invoke_L2(Object a0, Object a1) throws Throwable {
-            if ((boolean) test.invokeExact(a0, a1))
-                return target.invokeExact(a0, a1);
-            return fallback.invokeExact(a0, a1);
-        }
-        private Object invoke_L3(Object a0, Object a1, Object a2) throws Throwable {
-            if ((boolean) test.invokeExact(a0, a1, a2))
-                return target.invokeExact(a0, a1, a2);
-            return fallback.invokeExact(a0, a1, a2);
-        }
-        private Object invoke_L4(Object a0, Object a1, Object a2, Object a3) throws Throwable {
-            if ((boolean) test.invokeExact(a0, a1, a2, a3))
-                return target.invokeExact(a0, a1, a2, a3);
-            return fallback.invokeExact(a0, a1, a2, a3);
-        }
-        private Object invoke_L5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable {
-            if ((boolean) test.invokeExact(a0, a1, a2, a3, a4))
-                return target.invokeExact(a0, a1, a2, a3, a4);
-            return fallback.invokeExact(a0, a1, a2, a3, a4);
+        // in  arglist: [0: ...keep1 | cpos: collect...  | cpos+cacount: keep2... ]
+        // out arglist: [0: ...keep1 | cpos: collectVal? | cpos+cvcount: keep2... ]
+        // out(retain): [0: ...keep1 | cpos: cV? coll... | cpos+cvc+cac: keep2... ]
+
+        // Now build a LambdaForm.
+        MethodType lambdaType = srcType.invokerType();
+        Name[] names = arguments(2, lambdaType);
+        final int collectNamePos = names.length - 2;
+        final int targetNamePos  = names.length - 1;
+
+        Name[] collectorArgs = Arrays.copyOfRange(names, 1 + collectArgPos, 1 + collectArgPos + collectArgCount);
+        names[collectNamePos] = new Name(collector, (Object[]) collectorArgs);
+
+        // Build argument array for the target.
+        // Incoming LF args to copy are: [ (mh) headArgs collectArgs tailArgs ].
+        // Output argument array is [ headArgs (collectVal)? (collectArgs)? tailArgs ].
+        Name[] targetArgs = new Name[targetType.parameterCount()];
+        int inputArgPos  = 1;  // incoming LF args to copy to target
+        int targetArgPos = 0;  // fill pointer for targetArgs
+        int chunk = collectArgPos;  // |headArgs|
+        System.arraycopy(names, inputArgPos, targetArgs, targetArgPos, chunk);
+        inputArgPos  += chunk;
+        targetArgPos += chunk;
+        if (collectValType != void.class) {
+            targetArgs[targetArgPos++] = names[collectNamePos];
         }
-        private Object invoke_L6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable {
-            if ((boolean) test.invokeExact(a0, a1, a2, a3, a4, a5))
-                return target.invokeExact(a0, a1, a2, a3, a4, a5);
-            return fallback.invokeExact(a0, a1, a2, a3, a4, a5);
-        }
-        private Object invoke_L7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable {
-            if ((boolean) test.invokeExact(a0, a1, a2, a3, a4, a5, a6))
-                return target.invokeExact(a0, a1, a2, a3, a4, a5, a6);
-            return fallback.invokeExact(a0, a1, a2, a3, a4, a5, a6);
-        }
-        private Object invoke_L8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable {
-            if ((boolean) test.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7))
-                return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7);
-            return fallback.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7);
+        chunk = collectArgCount;
+        if (retainOriginalArgs) {
+            System.arraycopy(names, inputArgPos, targetArgs, targetArgPos, chunk);
+            targetArgPos += chunk;   // optionally pass on the collected chunk
         }
-        static MethodHandle[] makeInvokes() {
-            ArrayList<MethodHandle> invokes = new ArrayList<MethodHandle>();
-            MethodHandles.Lookup lookup = IMPL_LOOKUP;
-            for (;;) {
-                int nargs = invokes.size();
-                String name = "invoke_L"+nargs;
-                MethodHandle invoke = null;
-                try {
-                    invoke = lookup.findVirtual(GuardWithTest.class, name, MethodType.genericMethodType(nargs));
-                } catch (ReflectiveOperationException ex) {
-                }
-                if (invoke == null)  break;
-                invokes.add(invoke);
-            }
-            assert(invokes.size() == 9);  // current number of methods
-            return invokes.toArray(new MethodHandle[0]);
-        };
-        static final MethodHandle[] INVOKES = makeInvokes();
-        // For testing use this:
-        //static final MethodHandle[] INVOKES = Arrays.copyOf(makeInvokes(), 2);
-        static final MethodHandle VARARGS_INVOKE;
-        static {
-            try {
-                VARARGS_INVOKE = IMPL_LOOKUP.findVirtual(GuardWithTest.class, "invoke_V", MethodType.genericMethodType(0, true));
-            } catch (ReflectiveOperationException ex) {
-                throw uncaughtException(ex);
-            }
-        }
+        inputArgPos += chunk;
+        chunk = targetArgs.length - targetArgPos;  // all the rest
+        System.arraycopy(names, inputArgPos, targetArgs, targetArgPos, chunk);
+        assert(inputArgPos + chunk == collectNamePos);  // use of rest of input args also
+        names[targetNamePos] = new Name(target, (Object[]) targetArgs);
+
+        LambdaForm form = new LambdaForm("collect", lambdaType.parameterCount(), names);
+        return SimpleMethodHandle.make(srcType, form);
     }
 
     static
@@ -1059,50 +562,42 @@
     MethodHandle makeGuardWithTest(MethodHandle test,
                                    MethodHandle target,
                                    MethodHandle fallback) {
-        // gwt(arg...)
-        // [fold]=> continueAfterTest(z=test(arg...), arg...)
-        // [filter]=> (tf=select(z))(arg...)
-        //    where select(z) = select(z, t, f).bindTo(t, f) => z ? t f
-        // [tailcall]=> tf(arg...)
-        assert(test.type().returnType() == boolean.class);
-        MethodType targetType = target.type();
-        MethodType foldTargetType = targetType.insertParameterTypes(0, boolean.class);
-        if (AdapterMethodHandle.canCollectArguments(foldTargetType, test.type(), 0, true)
-            && GuardWithTest.preferRicochetFrame(targetType)) {
-            // working backwards, as usual:
-            assert(target.type().equals(fallback.type()));
-            MethodHandle tailcall = MethodHandles.exactInvoker(target.type());
-            MethodHandle select = selectAlternative();
-            select = bindArgument(select, 2, CountingMethodHandle.wrap(fallback));
-            select = bindArgument(select, 1, CountingMethodHandle.wrap(target));
-            // select(z: boolean) => (z ? target : fallback)
-            MethodHandle filter = filterArgument(tailcall, 0, select);
-            assert(filter.type().parameterType(0) == boolean.class);
-            MethodHandle fold = foldArguments(filter, filter.type().dropParameterTypes(0, 1), 0, test);
-            return fold;
-        }
-        return GuardWithTest.make(test, target, fallback);
+        MethodType basicType = target.type().basicType();
+        MethodHandle invokeBasic = MethodHandles.basicInvoker(basicType);
+        int arity = basicType.parameterCount();
+        int extraNames = 3;
+        MethodType lambdaType = basicType.invokerType();
+        Name[] names = arguments(extraNames, lambdaType);
+
+        Object[] testArgs   = Arrays.copyOfRange(names, 1, 1 + arity, Object[].class);
+        Object[] targetArgs = Arrays.copyOfRange(names, 0, 1 + arity, Object[].class);
+
+        // call test
+        names[arity + 1] = new Name(test, testArgs);
+
+        // call selectAlternative
+        Object[] selectArgs = { names[arity + 1], target, fallback };
+        names[arity + 2] = new Name(MethodHandleImpl.selectAlternative(), selectArgs);
+        targetArgs[0] = names[arity + 2];
+
+        // call target or fallback
+        names[arity + 3] = new Name(new NamedFunction(invokeBasic), targetArgs);
+
+        LambdaForm form = new LambdaForm("guard", lambdaType.parameterCount(), names);
+        return SimpleMethodHandle.make(target.type(), form);
     }
 
-    private static class GuardWithCatch extends BoundMethodHandle {
+    private static class GuardWithCatch {
         private final MethodHandle target;
         private final Class<? extends Throwable> exType;
         private final MethodHandle catcher;
+        // FIXME: Build the control flow out of foldArguments.
         GuardWithCatch(MethodHandle target, Class<? extends Throwable> exType, MethodHandle catcher) {
-            this(INVOKES[target.type().parameterCount()], target, exType, catcher);
-        }
-        // FIXME: Build the control flow out of foldArguments.
-        GuardWithCatch(MethodHandle invoker,
-                       MethodHandle target, Class<? extends Throwable> exType, MethodHandle catcher) {
-            super(invoker);
             this.target = target;
             this.exType = exType;
             this.catcher = catcher;
         }
-        @Override
-        String debugString() {
-            return addTypeString(target, this);
-        }
+        @LambdaForm.Hidden
         private Object invoke_V(Object... av) throws Throwable {
             try {
                 return target.invokeExact(av);
@@ -1111,6 +606,7 @@
                 return catcher.invokeExact(t, av);
             }
         }
+        @LambdaForm.Hidden
         private Object invoke_L0() throws Throwable {
             try {
                 return target.invokeExact();
@@ -1119,6 +615,7 @@
                 return catcher.invokeExact(t);
             }
         }
+        @LambdaForm.Hidden
         private Object invoke_L1(Object a0) throws Throwable {
             try {
                 return target.invokeExact(a0);
@@ -1127,6 +624,7 @@
                 return catcher.invokeExact(t, a0);
             }
         }
+        @LambdaForm.Hidden
         private Object invoke_L2(Object a0, Object a1) throws Throwable {
             try {
                 return target.invokeExact(a0, a1);
@@ -1135,6 +633,7 @@
                 return catcher.invokeExact(t, a0, a1);
             }
         }
+        @LambdaForm.Hidden
         private Object invoke_L3(Object a0, Object a1, Object a2) throws Throwable {
             try {
                 return target.invokeExact(a0, a1, a2);
@@ -1143,6 +642,7 @@
                 return catcher.invokeExact(t, a0, a1, a2);
             }
         }
+        @LambdaForm.Hidden
         private Object invoke_L4(Object a0, Object a1, Object a2, Object a3) throws Throwable {
             try {
                 return target.invokeExact(a0, a1, a2, a3);
@@ -1151,6 +651,7 @@
                 return catcher.invokeExact(t, a0, a1, a2, a3);
             }
         }
+        @LambdaForm.Hidden
         private Object invoke_L5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable {
             try {
                 return target.invokeExact(a0, a1, a2, a3, a4);
@@ -1159,6 +660,7 @@
                 return catcher.invokeExact(t, a0, a1, a2, a3, a4);
             }
         }
+        @LambdaForm.Hidden
         private Object invoke_L6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable {
             try {
                 return target.invokeExact(a0, a1, a2, a3, a4, a5);
@@ -1167,6 +669,7 @@
                 return catcher.invokeExact(t, a0, a1, a2, a3, a4, a5);
             }
         }
+        @LambdaForm.Hidden
         private Object invoke_L7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable {
             try {
                 return target.invokeExact(a0, a1, a2, a3, a4, a5, a6);
@@ -1175,6 +678,7 @@
                 return catcher.invokeExact(t, a0, a1, a2, a3, a4, a5, a6);
             }
         }
+        @LambdaForm.Hidden
         private Object invoke_L8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable {
             try {
                 return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7);
@@ -1184,7 +688,7 @@
             }
         }
         static MethodHandle[] makeInvokes() {
-            ArrayList<MethodHandle> invokes = new ArrayList<MethodHandle>();
+            ArrayList<MethodHandle> invokes = new ArrayList<>();
             MethodHandles.Lookup lookup = IMPL_LOOKUP;
             for (;;) {
                 int nargs = invokes.size();
@@ -1225,42 +729,62 @@
             MethodType gtype = type.generic();
             MethodType gcatchType = gtype.insertParameterTypes(0, Throwable.class);
             // Note: convertArguments(...2) avoids interface casts present in convertArguments(...0)
-            MethodHandle gtarget = convertArguments(target, gtype, type, 2);
-            MethodHandle gcatcher = convertArguments(catcher, gcatchType, ctype, 2);
-            MethodHandle gguard = new GuardWithCatch(gtarget, exType, gcatcher);
-            if (gtarget == null || gcatcher == null || gguard == null)  return null;
-            return convertArguments(gguard, type, gtype, 2);
+            MethodHandle gtarget = makePairwiseConvert(target, gtype, 2);
+            MethodHandle gcatcher = makePairwiseConvert(catcher, gcatchType, 2);
+            GuardWithCatch gguard = new GuardWithCatch(gtarget, exType, gcatcher);
+            if (gtarget == null || gcatcher == null)  throw new InternalError();
+            MethodHandle ginvoker = GuardWithCatch.INVOKES[nargs].bindReceiver(gguard);
+            return makePairwiseConvert(ginvoker, type, 2);
         } else {
-            MethodType gtype = MethodType.genericMethodType(0, true);
-            MethodType gcatchType = gtype.insertParameterTypes(0, Throwable.class);
-            MethodHandle gtarget = spreadArgumentsFromPos(target, gtype, 0);
+            MethodHandle gtarget = makeSpreadArguments(target, Object[].class, 0, nargs);
             catcher = catcher.asType(ctype.changeParameterType(0, Throwable.class));
-            MethodHandle gcatcher = spreadArgumentsFromPos(catcher, gcatchType, 1);
-            MethodHandle gguard = new GuardWithCatch(GuardWithCatch.VARARGS_INVOKE, gtarget, exType, gcatcher);
-            if (gtarget == null || gcatcher == null || gguard == null)  return null;
-            return collectArguments(gguard, type, 0, ValueConversions.varargsArray(nargs)).asType(type);
+            MethodHandle gcatcher = makeSpreadArguments(catcher, Object[].class, 1, nargs);
+            GuardWithCatch gguard = new GuardWithCatch(gtarget, exType, gcatcher);
+            if (gtarget == null || gcatcher == null)  throw new InternalError();
+            MethodHandle ginvoker = GuardWithCatch.VARARGS_INVOKE.bindReceiver(gguard);
+            return makeCollectArguments(ginvoker, ValueConversions.varargsArray(nargs), 0, false);
         }
     }
 
     static
     MethodHandle throwException(MethodType type) {
-        return AdapterMethodHandle.makeRetypeRaw(type, throwException());
+        assert(Throwable.class.isAssignableFrom(type.parameterType(0)));
+        int arity = type.parameterCount();
+        if (arity > 1) {
+            return throwException(type.dropParameterTypes(1, arity)).dropArguments(type, 1, arity-1);
+        }
+        return makePairwiseConvert(throwException(), type, 2);
     }
 
     static MethodHandle THROW_EXCEPTION;
     static MethodHandle throwException() {
-        if (THROW_EXCEPTION != null)  return THROW_EXCEPTION;
+        MethodHandle mh = THROW_EXCEPTION;
+        if (mh != null)  return mh;
         try {
-            THROW_EXCEPTION
+            mh
             = IMPL_LOOKUP.findStatic(MethodHandleImpl.class, "throwException",
                     MethodType.methodType(Empty.class, Throwable.class));
         } catch (ReflectiveOperationException ex) {
             throw new RuntimeException(ex);
         }
-        return THROW_EXCEPTION;
+        THROW_EXCEPTION = mh;
+        return mh;
     }
     static <T extends Throwable> Empty throwException(T t) throws T { throw t; }
 
+    static MethodHandle FAKE_METHOD_HANDLE_INVOKE;
+    static
+    MethodHandle fakeMethodHandleInvoke(MemberName method) {
+        MethodType type = method.getInvocationType();
+        assert(type.equals(MethodType.methodType(Object.class, Object[].class)));
+        MethodHandle mh = FAKE_METHOD_HANDLE_INVOKE;
+        if (mh != null)  return mh;
+        mh = throwException(type.insertParameterTypes(0, UnsupportedOperationException.class));
+        mh = mh.bindTo(new UnsupportedOperationException("cannot reflectively invoke MethodHandle"));
+        FAKE_METHOD_HANDLE_INVOKE = mh;
+        return mh;
+    }
+
     /**
      * Create an alias for the method handle which, when called,
      * appears to be called from the same class loader and protection domain
@@ -1325,7 +849,7 @@
                 MethodHandle vamh = prepareForInvoker(MH_checkCallerClass);
                 Object ok = bccInvoker.invokeExact(vamh, new Object[]{hostClass, bcc});
             } catch (Throwable ex) {
-                throw new InternalError(ex.toString());
+                throw newInternalError(ex);
             }
             return bccInvoker;
         }
@@ -1341,7 +865,9 @@
             MethodType mt = mh.type();
             int arity = mt.parameterCount();
             MethodHandle vamh = mh.asType(mt.generic());
+            vamh.internalForm().compileToBytecode();  // eliminate LFI stack frames
             vamh = vamh.asSpreader(Object[].class, arity);
+            vamh.internalForm().compileToBytecode();  // eliminate LFI stack frames
             return vamh;
         }
 
@@ -1360,7 +886,7 @@
                                 MethodType.methodType(boolean.class, Class.class, Class.class));
                 assert((boolean) MH_checkCallerClass.invokeExact(THIS_CLASS, THIS_CLASS));
             } catch (Throwable ex) {
-                throw new InternalError(ex.toString());
+                throw newInternalError(ex);
             }
         }
 
@@ -1393,7 +919,7 @@
                             }
                             values[0] = bytes;
                         } catch (java.io.IOException ex) {
-                            throw new InternalError(ex.toString());
+                            throw newInternalError(ex);
                         }
                         return null;
                     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/java/lang/invoke/MethodHandleInfo.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,71 @@
+/*
+ * 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.  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.invoke;
+import java.lang.invoke.MethodHandleNatives.Constants;
+
+//Not yet public: public
+class MethodHandleInfo {
+   public static final int
+       REF_NONE                    = Constants.REF_NONE,
+       REF_getField                = Constants.REF_getField,
+       REF_getStatic               = Constants.REF_getStatic,
+       REF_putField                = Constants.REF_putField,
+       REF_putStatic               = Constants.REF_putStatic,
+       REF_invokeVirtual           = Constants.REF_invokeVirtual,
+       REF_invokeStatic            = Constants.REF_invokeStatic,
+       REF_invokeSpecial           = Constants.REF_invokeSpecial,
+       REF_newInvokeSpecial        = Constants.REF_newInvokeSpecial,
+       REF_invokeInterface         = Constants.REF_invokeInterface;
+
+   private final Class<?> declaringClass;
+   private final String name;
+   private final MethodType methodType;
+   private final int referenceKind;
+
+   public MethodHandleInfo(MethodHandle mh) throws ReflectiveOperationException {
+       MemberName mn = mh.internalMemberName();
+       this.declaringClass = mn.getDeclaringClass();
+       this.name = mn.getName();
+       this.methodType = mn.getMethodType();
+       this.referenceKind = mn.getReferenceKind();
+   }
+
+   public Class<?> getDeclaringClass() {
+       return declaringClass;
+   }
+
+   public String getName() {
+       return name;
+   }
+
+   public MethodType getMethodType() {
+       return methodType;
+   }
+
+   public int getReferenceKind() {
+       return referenceKind;
+   }
+}
--- a/src/share/classes/java/lang/invoke/MethodHandleNatives.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/lang/invoke/MethodHandleNatives.java	Fri Jun 21 19:11:42 2013 -0700
@@ -29,11 +29,12 @@
 import java.lang.reflect.AccessibleObject;
 import java.lang.reflect.Field;
 import static java.lang.invoke.MethodHandleNatives.Constants.*;
+import static java.lang.invoke.MethodHandleStatics.*;
 import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
 
 /**
  * The JVM interface for the method handles package is all here.
- * This is an interface internal and private to an implementation of JSR 292.
+ * This is an interface internal and private to an implemetantion of JSR 292.
  * <em>This class is not part of the JSR 292 standard.</em>
  * @author jrose
  */
@@ -41,56 +42,21 @@
 
     private MethodHandleNatives() { } // static only
 
-    /// MethodName support
+    /// MemberName support
 
     static native void init(MemberName self, Object ref);
     static native void expand(MemberName self);
-    static native void resolve(MemberName self, Class<?> caller);
+    static native MemberName resolve(MemberName self, Class<?> caller) throws LinkageError;
     static native int getMembers(Class<?> defc, String matchName, String matchSig,
             int matchFlags, Class<?> caller, int skip, MemberName[] results);
 
-    /// MethodHandle support
-
-    /** Initialize the method handle to adapt the call. */
-    static native void init(AdapterMethodHandle self, MethodHandle target, int argnum);
-    /** Initialize the method handle to call the correct method, directly. */
-    static native void init(BoundMethodHandle self, Object target, int argnum);
-    /** Initialize the method handle to call as if by an invoke* instruction. */
-    static native void init(DirectMethodHandle self, Object ref, boolean doDispatch, Class<?> caller);
-
-    /** Initialize a method type, once per form. */
-    static native void init(MethodType self);
-
-    /** Fetch the vmtarget field.
-     *  It will be sanitized as necessary to avoid exposing non-Java references.
-     *  This routine is for debugging and reflection.
-     */
-    static native Object getTarget(MethodHandle self, int format);
+    /// Field layout queries parallel to sun.misc.Unsafe:
+    static native long objectFieldOffset(MemberName self);  // e.g., returns vmindex
+    static native long staticFieldOffset(MemberName self);  // e.g., returns vmindex
+    static native Object staticFieldBase(MemberName self);  // e.g., returns clazz
+    static native Object getMemberVMInfo(MemberName self);  // returns {vmindex,vmtarget}
 
-    /** Fetch the name of the handled method, if available.
-     *  This routine is for debugging and reflection.
-     */
-    static MemberName getMethodName(MethodHandle self) {
-        return (MemberName) getTarget(self, ETF_METHOD_NAME);
-    }
-
-    /** Fetch the reflective version of the handled method, if available.
-     */
-    static AccessibleObject getTargetMethod(MethodHandle self) {
-        return (AccessibleObject) getTarget(self, ETF_REFLECT_METHOD);
-    }
-
-    /** Fetch the target of this method handle.
-     *  If it directly targets a method, return a MemberName for the method.
-     *  If it is chained to another method handle, return that handle.
-     */
-    static Object getTargetInfo(MethodHandle self) {
-        return getTarget(self, ETF_HANDLE_OR_METHOD_NAME);
-    }
-
-    static Object[] makeTarget(Class<?> defc, String name, String sig, int mods, Class<?> refc) {
-        return new Object[] { defc, name, sig, mods, refc };
-    }
+    /// MethodHandle support
 
     /** Fetch MH-related JVM parameter.
      *  which=0 retrieves MethodHandlePushLimit
@@ -98,19 +64,6 @@
      */
     static native int getConstant(int which);
 
-    /** Java copy of MethodHandlePushLimit in range 2..255. */
-    static final int JVM_PUSH_LIMIT;
-    /** JVM stack motion (in words) after one slot is pushed, usually -1.
-     */
-    static final int JVM_STACK_MOVE_UNIT;
-
-    /** Which conv-ops are implemented by the JVM? */
-    static final int CONV_OP_IMPLEMENTED_MASK;
-    /** Derived mode flag.  Only false on some old JVM implementations. */
-    static final boolean HAVE_RICOCHET_FRAMES;
-
-    static final int OP_ROT_ARGS_DOWN_LIMIT_BIAS;
-
     static final boolean COUNT_GWT;
 
     /// CallSite support
@@ -122,18 +75,11 @@
     private static native void registerNatives();
     static {
         registerNatives();
-        int k;
-        JVM_PUSH_LIMIT              = getConstant(Constants.GC_JVM_PUSH_LIMIT);
-        JVM_STACK_MOVE_UNIT         = getConstant(Constants.GC_JVM_STACK_MOVE_UNIT);
-        k                           = getConstant(Constants.GC_CONV_OP_IMPLEMENTED_MASK);
-        CONV_OP_IMPLEMENTED_MASK    = (k != 0) ? k : DEFAULT_CONV_OP_IMPLEMENTED_MASK;
-        k                           = getConstant(Constants.GC_OP_ROT_ARGS_DOWN_LIMIT_BIAS);
-        OP_ROT_ARGS_DOWN_LIMIT_BIAS = (k != 0) ? (byte)k : -1;
-        HAVE_RICOCHET_FRAMES        = (CONV_OP_IMPLEMENTED_MASK & (1<<OP_COLLECT_ARGS)) != 0;
         COUNT_GWT                   = getConstant(Constants.GC_COUNT_GWT) != 0;
 
-        //sun.reflect.Reflection.registerMethodsToFilter(MethodHandleImpl.class, "init");
-    }
+        // The JVM calls MethodHandleNatives.<clinit>.  Cascade the <clinit> calls as needed:
+        MethodHandleImpl.initStatics();
+}
 
     // All compile-time constants go here.
     // There is an opportunity to check them against the JVM's idea of them.
@@ -141,16 +87,8 @@
         Constants() { } // static only
         // MethodHandleImpl
         static final int // for getConstant
-                GC_JVM_PUSH_LIMIT = 0,
-                GC_JVM_STACK_MOVE_UNIT = 1,
-                GC_CONV_OP_IMPLEMENTED_MASK = 2,
-                GC_OP_ROT_ARGS_DOWN_LIMIT_BIAS = 3,
-                GC_COUNT_GWT = 4;
-        static final int
-                ETF_HANDLE_OR_METHOD_NAME = 0, // all available data (immediate MH or method)
-                ETF_DIRECT_HANDLE         = 1, // ultimate method handle (will be a DMH, may be self)
-                ETF_METHOD_NAME           = 2, // ultimate method as MemberName
-                ETF_REFLECT_METHOD        = 3; // ultimate method as java.lang.reflect object (sans refClass)
+                GC_COUNT_GWT = 4,
+                GC_LAMBDA_SUPPORT = 5;
 
         // MemberName
         // The JVM uses values of -2 and above for vtable indexes.
@@ -164,65 +102,11 @@
                 MN_IS_FIELD            = 0x00040000, // field
                 MN_IS_TYPE             = 0x00080000, // nested type
                 MN_CALLER_SENSITIVE    = 0x00100000, // @CallerSensitive annotation detected
-                MN_SEARCH_SUPERCLASSES = 0x00100000, // for MHN.getMembers
-                MN_SEARCH_INTERFACES   = 0x00200000, // for MHN.getMembers
-                VM_INDEX_UNINITIALIZED = -99;
-
-        // BoundMethodHandle
-        /** Constants for decoding the vmargslot field, which contains 2 values. */
-        static final int
-            ARG_SLOT_PUSH_SHIFT = 16,
-            ARG_SLOT_MASK = (1<<ARG_SLOT_PUSH_SHIFT)-1;
-
-        // AdapterMethodHandle
-        /** Conversions recognized by the JVM.
-         *  They must align with the constants in java.lang.invoke.AdapterMethodHandle,
-         *  in the JVM file hotspot/src/share/vm/classfile/javaClasses.hpp.
-         */
-        static final int
-            OP_RETYPE_ONLY   = 0x0, // no argument changes; straight retype
-            OP_RETYPE_RAW    = 0x1, // straight retype, trusted (void->int, Object->T)
-            OP_CHECK_CAST    = 0x2, // ref-to-ref conversion; requires a Class argument
-            OP_PRIM_TO_PRIM  = 0x3, // converts from one primitive to another
-            OP_REF_TO_PRIM   = 0x4, // unboxes a wrapper to produce a primitive
-            OP_PRIM_TO_REF   = 0x5, // boxes a primitive into a wrapper
-            OP_SWAP_ARGS     = 0x6, // swap arguments (vminfo is 2nd arg)
-            OP_ROT_ARGS      = 0x7, // rotate arguments (vminfo is displaced arg)
-            OP_DUP_ARGS      = 0x8, // duplicates one or more arguments (at TOS)
-            OP_DROP_ARGS     = 0x9, // remove one or more argument slots
-            OP_COLLECT_ARGS  = 0xA, // combine arguments using an auxiliary function
-            OP_SPREAD_ARGS   = 0xB, // expand in place a varargs array (of known size)
-            OP_FOLD_ARGS     = 0xC, // combine but do not remove arguments; prepend result
-            //OP_UNUSED_13   = 0xD, // unused code, perhaps for reified argument lists
-            CONV_OP_LIMIT    = 0xE; // limit of CONV_OP enumeration
-        /** Shift and mask values for decoding the AMH.conversion field.
-         *  These numbers are shared with the JVM for creating AMHs.
-         */
-        static final int
-            CONV_OP_MASK     = 0xF00, // this nybble contains the conversion op field
-            CONV_TYPE_MASK   = 0x0F,  // fits T_ADDRESS and below
-            CONV_VMINFO_MASK = 0x0FF, // LSB is reserved for JVM use
-            CONV_VMINFO_SHIFT     =  0, // position of bits in CONV_VMINFO_MASK
-            CONV_OP_SHIFT         =  8, // position of bits in CONV_OP_MASK
-            CONV_DEST_TYPE_SHIFT  = 12, // byte 2 has the adapter BasicType (if needed)
-            CONV_SRC_TYPE_SHIFT   = 16, // byte 2 has the source BasicType (if needed)
-            CONV_STACK_MOVE_SHIFT = 20, // high 12 bits give signed SP change
-            CONV_STACK_MOVE_MASK  = (1 << (32 - CONV_STACK_MOVE_SHIFT)) - 1;
-
-        /** Which conv-ops are implemented by the JVM? */
-        static final int DEFAULT_CONV_OP_IMPLEMENTED_MASK =
-                // Value to use if the corresponding JVM query fails.
-                ((1<<OP_RETYPE_ONLY)
-                |(1<<OP_RETYPE_RAW)
-                |(1<<OP_CHECK_CAST)
-                |(1<<OP_PRIM_TO_PRIM)
-                |(1<<OP_REF_TO_PRIM)
-                |(1<<OP_SWAP_ARGS)
-                |(1<<OP_ROT_ARGS)
-                |(1<<OP_DUP_ARGS)
-                |(1<<OP_DROP_ARGS)
-                //|(1<<OP_SPREAD_ARGS)
-                );
+                MN_REFERENCE_KIND_SHIFT = 24, // refKind
+                MN_REFERENCE_KIND_MASK = 0x0F000000 >> MN_REFERENCE_KIND_SHIFT,
+                // The SEARCH_* bits are not for MN.flags but for the matchFlags argument of MHN.getMembers:
+                MN_SEARCH_SUPERCLASSES = 0x00100000,
+                MN_SEARCH_INTERFACES   = 0x00200000;
 
         /**
          * Basic types as encoded in the JVM.  These code values are not
@@ -245,9 +129,54 @@
             T_ILLEGAL  = 99;
 
         /**
+         * Constant pool entry types.
+         */
+        static final byte
+            CONSTANT_Utf8                = 1,
+            CONSTANT_Integer             = 3,
+            CONSTANT_Float               = 4,
+            CONSTANT_Long                = 5,
+            CONSTANT_Double              = 6,
+            CONSTANT_Class               = 7,
+            CONSTANT_String              = 8,
+            CONSTANT_Fieldref            = 9,
+            CONSTANT_Methodref           = 10,
+            CONSTANT_InterfaceMethodref  = 11,
+            CONSTANT_NameAndType         = 12,
+            CONSTANT_MethodHandle        = 15,  // JSR 292
+            CONSTANT_MethodType          = 16,  // JSR 292
+            CONSTANT_InvokeDynamic       = 18,
+            CONSTANT_LIMIT               = 19;   // Limit to tags found in classfiles
+
+        /**
+         * Access modifier flags.
+         */
+        static final char
+            ACC_PUBLIC                 = 0x0001,
+            ACC_PRIVATE                = 0x0002,
+            ACC_PROTECTED              = 0x0004,
+            ACC_STATIC                 = 0x0008,
+            ACC_FINAL                  = 0x0010,
+            ACC_SYNCHRONIZED           = 0x0020,
+            ACC_VOLATILE               = 0x0040,
+            ACC_TRANSIENT              = 0x0080,
+            ACC_NATIVE                 = 0x0100,
+            ACC_INTERFACE              = 0x0200,
+            ACC_ABSTRACT               = 0x0400,
+            ACC_STRICT                 = 0x0800,
+            ACC_SYNTHETIC              = 0x1000,
+            ACC_ANNOTATION             = 0x2000,
+            ACC_ENUM                   = 0x4000,
+            // aliases:
+            ACC_SUPER                  = ACC_SYNCHRONIZED,
+            ACC_BRIDGE                 = ACC_VOLATILE,
+            ACC_VARARGS                = ACC_TRANSIENT;
+
+        /**
          * Constant pool reference-kind codes, as used by CONSTANT_MethodHandle CP entries.
          */
-        static final int
+        static final byte
+            REF_NONE                    = 0,  // null value
             REF_getField                = 1,
             REF_getStatic               = 2,
             REF_putField                = 3,
@@ -256,8 +185,66 @@
             REF_invokeStatic            = 6,
             REF_invokeSpecial           = 7,
             REF_newInvokeSpecial        = 8,
-            REF_invokeInterface         = 9;
+            REF_invokeInterface         = 9,
+            REF_LIMIT                  = 10;
+    }
+
+    static boolean refKindIsValid(int refKind) {
+        return (refKind > REF_NONE && refKind < REF_LIMIT);
+    }
+    static boolean refKindIsField(byte refKind) {
+        assert(refKindIsValid(refKind));
+        return (refKind <= REF_putStatic);
+    }
+    static boolean refKindIsGetter(byte refKind) {
+        assert(refKindIsValid(refKind));
+        return (refKind <= REF_getStatic);
+    }
+    static boolean refKindIsSetter(byte refKind) {
+        return refKindIsField(refKind) && !refKindIsGetter(refKind);
+    }
+    static boolean refKindIsMethod(byte refKind) {
+        return !refKindIsField(refKind) && (refKind != REF_newInvokeSpecial);
+    }
+    static boolean refKindHasReceiver(byte refKind) {
+        assert(refKindIsValid(refKind));
+        return (refKind & 1) != 0;
+    }
+    static boolean refKindIsStatic(byte refKind) {
+        return !refKindHasReceiver(refKind) && (refKind != REF_newInvokeSpecial);
     }
+    static boolean refKindDoesDispatch(byte refKind) {
+        assert(refKindIsValid(refKind));
+        return (refKind == REF_invokeVirtual ||
+                refKind == REF_invokeInterface);
+    }
+    static {
+        final int HR_MASK = ((1 << REF_getField) |
+                             (1 << REF_putField) |
+                             (1 << REF_invokeVirtual) |
+                             (1 << REF_invokeSpecial) |
+                             (1 << REF_invokeInterface)
+                            );
+        for (byte refKind = REF_NONE+1; refKind < REF_LIMIT; refKind++) {
+            assert(refKindHasReceiver(refKind) == (((1<<refKind) & HR_MASK) != 0)) : refKind;
+        }
+    }
+    static String refKindName(byte refKind) {
+        assert(refKindIsValid(refKind));
+        return REFERENCE_KIND_NAME[refKind];
+    }
+    private static String[] REFERENCE_KIND_NAME = {
+            null,
+            "getField",
+            "getStatic",
+            "putField",
+            "putStatic",
+            "invokeVirtual",
+            "invokeStatic",
+            "invokeSpecial",
+            "newInvokeSpecial",
+            "invokeInterface"
+    };
 
     private static native int getNamedCon(int which, Object[] name);
     static boolean verifyConstants() {
@@ -277,16 +264,11 @@
                     continue;
                 }
                 throw new InternalError(err);
-            } catch (Exception ex) {
-                if (ex instanceof NoSuchFieldException) {
-                    String err = (name+": JVM has "+vmval+" which Java does not define");
-                    // ignore exotic ops the JVM cares about; we just wont issue them
-                    if (name.startsWith("OP_") || name.startsWith("GC_")) {
-                        System.err.println("warning: "+err);
-                        continue;
-                    }
-                }
-                throw new InternalError(name+": access failed, got "+ex);
+            } catch (NoSuchFieldException | IllegalAccessException ex) {
+                String err = (name+": JVM has "+vmval+" which Java does not define");
+                // ignore exotic ops the JVM cares about; we just wont issue them
+                //System.err.println("warning: "+err);
+                continue;
             }
         }
         return true;
@@ -301,18 +283,21 @@
     /**
      * The JVM is linking an invokedynamic instruction.  Create a reified call site for it.
      */
-    static CallSite makeDynamicCallSite(MethodHandle bootstrapMethod,
-                                        String name, MethodType type,
-                                        Object info,
-                                        MemberName callerMethod, int callerBCI) {
-        return CallSite.makeSite(bootstrapMethod, name, type, info, callerMethod, callerBCI);
-    }
-
-    /**
-     * Called by the JVM to check the length of a spread array.
-     */
-    static void checkSpreadArgument(Object av, int n) {
-        MethodHandleStatics.checkSpreadArgument(av, n);
+    static MemberName linkCallSite(Object callerObj,
+                                   Object bootstrapMethodObj,
+                                   Object nameObj, Object typeObj,
+                                   Object staticArguments,
+                                   Object[] appendixResult) {
+        MethodHandle bootstrapMethod = (MethodHandle)bootstrapMethodObj;
+        Class<?> caller = (Class<?>)callerObj;
+        String name = nameObj.toString().intern();
+        MethodType type = (MethodType)typeObj;
+        appendixResult[0] = CallSite.makeSite(bootstrapMethod,
+                                              name,
+                                              type,
+                                              staticArguments,
+                                              caller);
+        return Invokers.linkToCallSiteMethod(type);
     }
 
     /**
@@ -323,71 +308,78 @@
     }
 
     /**
-     * The JVM wants to use a MethodType with inexact invoke.  Give the runtime fair warning.
+     * The JVM wants to link a call site that requires a dynamic type check.
+     * Name is a type-checking invoker, invokeExact or invoke.
+     * Return a JVM method (MemberName) to handle the invoking.
+     * The method assumes the following arguments on the stack:
+     * 0: the method handle being invoked
+     * 1-N: the arguments to the method handle invocation
+     * N+1: an implicitly added type argument (the given MethodType)
      */
-    static void notifyGenericMethodType(MethodType type) {
-        type.form().notifyGenericMethodType();
+    static MemberName linkMethod(Class<?> callerClass, int refKind,
+                                 Class<?> defc, String name, Object type,
+                                 Object[] appendixResult) {
+        if (!TRACE_METHOD_LINKAGE)
+            return linkMethodImpl(callerClass, refKind, defc, name, type, appendixResult);
+        return linkMethodTracing(callerClass, refKind, defc, name, type, appendixResult);
+    }
+    static MemberName linkMethodImpl(Class<?> callerClass, int refKind,
+                                     Class<?> defc, String name, Object type,
+                                     Object[] appendixResult) {
+        try {
+            if (defc == MethodHandle.class && refKind == REF_invokeVirtual) {
+                switch (name) {
+                case "invoke":
+                    return Invokers.genericInvokerMethod(fixMethodType(callerClass, type), appendixResult);
+                case "invokeExact":
+                    return Invokers.exactInvokerMethod(fixMethodType(callerClass, type), appendixResult);
+                }
+            }
+        } catch (Throwable ex) {
+            if (ex instanceof LinkageError)
+                throw (LinkageError) ex;
+            else
+                throw new LinkageError(ex.getMessage(), ex);
+        }
+        throw new LinkageError("no such method "+defc.getName()+"."+name+type);
+    }
+    private static MethodType fixMethodType(Class<?> callerClass, Object type) {
+        if (type instanceof MethodType)
+            return (MethodType) type;
+        else
+            return MethodType.fromMethodDescriptorString((String)type, callerClass.getClassLoader());
+    }
+    // Tracing logic:
+    static MemberName linkMethodTracing(Class<?> callerClass, int refKind,
+                                        Class<?> defc, String name, Object type,
+                                        Object[] appendixResult) {
+        System.out.println("linkMethod "+defc.getName()+"."+
+                           name+type+"/"+Integer.toHexString(refKind));
+        try {
+            MemberName res = linkMethodImpl(callerClass, refKind, defc, name, type, appendixResult);
+            System.out.println("linkMethod => "+res+" + "+appendixResult[0]);
+            return res;
+        } catch (Throwable ex) {
+            System.out.println("linkMethod => throw "+ex);
+            throw ex;
+        }
     }
 
-    /**
-     * The JVM wants to raise an exception.  Here's the path.
-     */
-    static void raiseException(int code, Object actual, Object required) {
-        String message = null;
-        switch (code) {
-        case 190: // arraylength
-            try {
-                String reqLength = "";
-                if (required instanceof AdapterMethodHandle) {
-                    int conv = ((AdapterMethodHandle)required).getConversion();
-                    int spChange = AdapterMethodHandle.extractStackMove(conv);
-                    reqLength = " of length "+(spChange+1);
-                }
-                int actualLength = actual == null ? 0 : java.lang.reflect.Array.getLength(actual);
-                message = "required array"+reqLength+", but encountered wrong length "+actualLength;
-                break;
-            } catch (IllegalArgumentException ex) {
-            }
-            required = Object[].class;  // should have been an array
-            code = 192; // checkcast
-            break;
-        case 191: // athrow
-            // JVM is asking us to wrap an exception which happened during resolving
-            if (required == BootstrapMethodError.class) {
-                throw new BootstrapMethodError((Throwable) actual);
-            }
-            break;
-        }
-        // disregard the identity of the actual object, if it is not a class:
-        if (message == null) {
-            if (!(actual instanceof Class) && !(actual instanceof MethodType))
-                actual = actual.getClass();
-           if (actual != null)
-               message = "required "+required+" but encountered "+actual;
-           else
-               message = "required "+required;
-        }
-        switch (code) {
-        case 190: // arraylength
-            throw new ArrayIndexOutOfBoundsException(message);
-        case 50: //_aaload
-            throw new ClassCastException(message);
-        case 192: // checkcast
-            throw new ClassCastException(message);
-        default:
-            throw new InternalError("unexpected code "+code+": "+message);
-        }
-    }
 
     /**
      * The JVM is resolving a CONSTANT_MethodHandle CP entry.  And it wants our help.
      * It will make an up-call to this method.  (Do not change the name or signature.)
+     * The type argument is a Class for field requests and a MethodType for non-fields.
+     * <p>
+     * Recent versions of the JVM may also pass a resolved MemberName for the type.
+     * In that case, the name is ignored and may be null.
      */
     static MethodHandle linkMethodHandleConstant(Class<?> callerClass, int refKind,
                                                  Class<?> defc, String name, Object type) {
         try {
             Lookup lookup = IMPL_LOOKUP.in(callerClass);
-            return lookup.linkMethodHandleConstant(refKind, defc, name, type);
+            assert(refKindIsValid(refKind));
+            return lookup.linkMethodHandleConstant((byte) refKind, defc, name, type);
         } catch (ReflectiveOperationException ex) {
             Error err = new IncompatibleClassChangeError();
             err.initCause(ex);
@@ -396,16 +388,6 @@
     }
 
     /**
-     * This assertion marks code which was written before ricochet frames were implemented.
-     * Such code will go away when the ports catch up.
-     */
-    static boolean workaroundWithoutRicochetFrames() {
-        assert(!HAVE_RICOCHET_FRAMES) : "this code should not be executed if `-XX:+UseRicochetFrames is enabled";
-        return true;
-    }
-
-
-    /**
      * Is this method a caller-sensitive method?
      * I.e., does it call Reflection.getCallerClass or a similer method
      * to ask about the identity of its caller?
@@ -483,7 +465,6 @@
         case "getDrivers":
         case "deregisterDriver":
             return defc == java.sql.DriverManager.class;
-
         case "newUpdater":
             if (defc == java.util.concurrent.atomic.AtomicIntegerFieldUpdater.class)  return true;
             if (defc == java.util.concurrent.atomic.AtomicLongFieldUpdater.class)  return true;
@@ -530,6 +511,7 @@
         return false;
     }
 
+
     private static boolean canBeCalledVirtual(MemberName mem) {
         assert(mem.isInvocable());
         Class<?> defc = mem.getDeclaringClass();
--- a/src/share/classes/java/lang/invoke/MethodHandleProxies.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/lang/invoke/MethodHandleProxies.java	Fri Jun 21 19:11:42 2013 -0700
@@ -182,7 +182,7 @@
                     if (method.getDeclaringClass() == WrapperInstance.class)
                         return getArg(method.getName());
                     if (isObjectMethod(method))
-                        return callObjectMethod(this, method, args);
+                        return callObjectMethod(proxy, method, args);
                     throw new InternalError("bad proxy method: "+method);
                 }
             };
--- a/src/share/classes/java/lang/invoke/MethodHandleStatics.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/lang/invoke/MethodHandleStatics.java	Fri Jun 21 19:11:42 2013 -0700
@@ -27,6 +27,7 @@
 
 import java.security.AccessController;
 import java.security.PrivilegedAction;
+import sun.misc.Unsafe;
 
 /**
  * This class consists exclusively of static names internal to the
@@ -38,16 +39,30 @@
 
     private MethodHandleStatics() { }  // do not instantiate
 
+    static final Unsafe UNSAFE = Unsafe.getUnsafe();
+
     static final boolean DEBUG_METHOD_HANDLE_NAMES;
+    static final boolean DUMP_CLASS_FILES;
+    static final boolean TRACE_INTERPRETER;
+    static final boolean TRACE_METHOD_LINKAGE;
+    static final Integer COMPILE_THRESHOLD;
     static {
-        final Object[] values = { false };
+        final Object[] values = { false, false, false, false, null };
         AccessController.doPrivileged(new PrivilegedAction<Void>() {
                 public Void run() {
                     values[0] = Boolean.getBoolean("java.lang.invoke.MethodHandle.DEBUG_NAMES");
+                    values[1] = Boolean.getBoolean("java.lang.invoke.MethodHandle.DUMP_CLASS_FILES");
+                    values[2] = Boolean.getBoolean("java.lang.invoke.MethodHandle.TRACE_INTERPRETER");
+                    values[3] = Boolean.getBoolean("java.lang.invoke.MethodHandle.TRACE_METHOD_LINKAGE");
+                    values[4] = Integer.getInteger("java.lang.invoke.MethodHandle.COMPILE_THRESHOLD");
                     return null;
                 }
             });
         DEBUG_METHOD_HANDLE_NAMES = (Boolean) values[0];
+        DUMP_CLASS_FILES          = (Boolean) values[1];
+        TRACE_INTERPRETER         = (Boolean) values[2];
+        TRACE_METHOD_LINKAGE      = (Boolean) values[3];
+        COMPILE_THRESHOLD         = (Integer) values[4];
     }
 
     /*non-public*/ static String getNameString(MethodHandle target, MethodType type) {
@@ -55,7 +70,7 @@
             type = target.type();
         MemberName name = null;
         if (target != null)
-            name = MethodHandleNatives.getMethodName(target);
+            name = target.internalMemberName();
         if (name == null)
             return "invoke" + type;
         return name.getName() + type;
@@ -77,21 +92,17 @@
         return str + target.type();
     }
 
-    static void checkSpreadArgument(Object av, int n) {
-        if (av == null) {
-            if (n == 0)  return;
-        } else if (av instanceof Object[]) {
-            int len = ((Object[])av).length;
-            if (len == n)  return;
-        } else {
-            int len = java.lang.reflect.Array.getLength(av);
-            if (len == n)  return;
-        }
-        // fall through to error:
-        throw newIllegalArgumentException("Array is not of length "+n);
+    // handy shared exception makers (they simplify the common case code)
+    /*non-public*/ static InternalError newInternalError(String message, Throwable cause) {
+        InternalError e = new InternalError(message);
+        e.initCause(cause);
+        return e;
     }
-
-    // handy shared exception makers (they simplify the common case code)
+    /*non-public*/ static InternalError newInternalError(Throwable cause) {
+        InternalError e = new InternalError();
+        e.initCause(cause);
+        return e;
+    }
     /*non-public*/ static RuntimeException newIllegalStateException(String message) {
         return new IllegalStateException(message);
     }
@@ -108,9 +119,10 @@
         return new IllegalArgumentException(message(message, obj, obj2));
     }
     /*non-public*/ static Error uncaughtException(Throwable ex) {
-        Error err = new InternalError("uncaught exception");
-        err.initCause(ex);
-        return err;
+        throw newInternalError("uncaught exception", ex);
+    }
+    static Error NYI() {
+        throw new AssertionError("NYI");
     }
     private static String message(String message, Object obj) {
         if (obj != null)  message = message + ": " + obj;
--- a/src/share/classes/java/lang/invoke/MethodHandles.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/lang/invoke/MethodHandles.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -35,7 +35,6 @@
 import sun.reflect.CallerSensitive;
 import sun.reflect.Reflection;
 import sun.reflect.misc.ReflectUtil;
-
 import static java.lang.invoke.MethodHandleStatics.*;
 import static java.lang.invoke.MethodHandleNatives.Constants.*;
 import sun.security.util.SecurityConstants;
@@ -178,6 +177,8 @@
      * Both {@code MT} and the field type {@code FT} are documented as a parameter named {@code type}.
      * The formal parameter {@code this} stands for the self-reference of type {@code C};
      * if it is present, it is always the leading argument to the method handle invocation.
+     * (In the case of some {@code protected} members, {@code this} may be
+     * restricted in type to the lookup class; see below.)
      * The name {@code arg} stands for all the other method handle arguments.
      * In the code examples for the Core Reflection API, the name {@code thisOrNull}
      * stands for a null reference if the accessed method or field is static,
@@ -248,6 +249,18 @@
      * is exactly equivalent to executing the compiled and resolved call to {@code M}.
      * The same point is true of fields and constructors.
      * <p>
+     * If the desired member is {@code protected}, the usual JVM rules apply,
+     * including the requirement that the lookup class must be either be in the
+     * same package as the desired member, or must inherit that member.
+     * (See the Java Virtual Machine Specification, sections 4.9.2, 5.4.3.5, and 6.4.)
+     * In addition, if the desired member is a non-static field or method
+     * in a different package, the resulting method handle may only be applied
+     * to objects of the lookup class or one of its subclasses.
+     * This requirement is enforced by narrowing the type of the leading
+     * {@code this} parameter from {@code C}
+     * (which will necessarily be a superclass of the lookup class)
+     * to the lookup class itself.
+     * <p>
      * In some cases, access between nested classes is obtained by the Java compiler by creating
      * an wrapper method to access a private method of another class
      * in the same top-level declaration.
@@ -410,6 +423,7 @@
          * Also, don't make it private, lest javac interpose
          * an access$N method.
          */
+
         Lookup(Class<?> lookupClass) {
             this(lookupClass, ALL_MODES);
             checkUnprivilegedlookupClass(lookupClass);
@@ -567,21 +581,9 @@
          */
         public
         MethodHandle findStatic(Class<?> refc, String name, MethodType type) throws NoSuchMethodException, IllegalAccessException {
-            MemberName method = resolveOrFail(refc, name, type, true);
+            MemberName method = resolveOrFail(REF_invokeStatic, refc, name, type);
             checkSecurityManager(refc, method);
-            return accessStatic(refc, method, findBoundCallerClass(method));
-        }
-        private
-        MethodHandle accessStatic(Class<?> refc, MemberName method, Class<?> callerClass) throws IllegalAccessException {
-            checkMethod(refc, method, true);
-            MethodHandle mh = MethodHandleImpl.findMethod(method, false, lookupClassOrNull());
-            mh = maybeBindCaller(method, mh, callerClass);
-            return mh;
-        }
-        private
-        MethodHandle resolveStatic(Class<?> refc, String name, MethodType type) throws NoSuchMethodException, IllegalAccessException {
-            MemberName method = resolveOrFail(refc, name, type, true);
-            return accessStatic(refc, method, lookupClass);
+            return getDirectMethod(REF_invokeStatic, refc, method, findBoundCallerClass(method));
         }
 
         /**
@@ -596,6 +598,11 @@
          * (The dispatching action is identical with that performed by an
          * {@code invokevirtual} or {@code invokeinterface} instruction.)
          * <p>
+         * The first argument will be of type {@code refc} if the lookup
+         * class has full privileges to access the member.  Otherwise
+         * the member must be {@code protected} and the first argument
+         * will be restricted in type to the lookup class.
+         * <p>
          * The returned method handle will have
          * {@linkplain MethodHandle#asVarargsCollector variable arity} if and only if
          * the method's variable arity modifier bit ({@code 0x0080}) is set.
@@ -623,19 +630,22 @@
          * @throws NullPointerException if any argument is null
          */
         public MethodHandle findVirtual(Class<?> refc, String name, MethodType type) throws NoSuchMethodException, IllegalAccessException {
-            MemberName method = resolveOrFail(refc, name, type, false);
+            if (refc == MethodHandle.class) {
+                MethodHandle mh = findVirtualForMH(name, type);
+                if (mh != null)  return mh;
+            }
+            byte refKind = (refc.isInterface() ? REF_invokeInterface : REF_invokeVirtual);
+            MemberName method = resolveOrFail(refKind, refc, name, type);
             checkSecurityManager(refc, method);
-            return accessVirtual(refc, method, findBoundCallerClass(method));
+            return getDirectMethod(refKind, refc, method, findBoundCallerClass(method));
         }
-        private MethodHandle resolveVirtual(Class<?> refc, String name, MethodType type) throws NoSuchMethodException, IllegalAccessException {
-            MemberName method = resolveOrFail(refc, name, type, false);
-            return accessVirtual(refc, method, lookupClass);
-        }
-        private MethodHandle accessVirtual(Class<?> refc, MemberName method, Class<?> callerClass) throws IllegalAccessException {
-            checkMethod(refc, method, false);
-            MethodHandle mh = MethodHandleImpl.findMethod(method, true, lookupClassOrNull());
-            mh = maybeBindCaller(method, mh, callerClass);
-            return restrictProtectedReceiver(method, mh);
+        private MethodHandle findVirtualForMH(String name, MethodType type) {
+            // these names require special lookups because of the implicit MethodType argument
+            if ("invoke".equals(name))
+                return invoker(type);
+            if ("invokeExact".equals(name))
+                return exactInvoker(type);
+            return null;
         }
 
         /**
@@ -666,37 +676,9 @@
          */
         public MethodHandle findConstructor(Class<?> refc, MethodType type) throws NoSuchMethodException, IllegalAccessException {
             String name = "<init>";
-            MemberName ctor = resolveOrFail(refc, name, type, false, false, lookupClassOrNull());
+            MemberName ctor = resolveOrFail(REF_newInvokeSpecial, refc, name, type);
             checkSecurityManager(refc, ctor);
-            return accessConstructor(refc, ctor);
-        }
-        private MethodHandle accessConstructor(Class<?> refc, MemberName ctor) throws IllegalAccessException {
-            assert(ctor.isConstructor());
-            checkAccess(refc, ctor, false /* is_setter */);
-            MethodHandle rawMH = MethodHandleImpl.findMethod(ctor, false, lookupClassOrNull());
-            MethodHandle allocMH = MethodHandleImpl.makeAllocator(rawMH);
-            assert(!MethodHandleNatives.isCallerSensitive(ctor));  // maybeBindCaller not relevant here
-            return fixVarargs(allocMH, rawMH);
-        }
-        private MethodHandle resolveConstructor(Class<?> refc, MethodType type) throws NoSuchMethodException, IllegalAccessException {
-            String name = "<init>";
-            MemberName ctor = resolveOrFail(refc, name, type, false, false, lookupClassOrNull());
-            return accessConstructor(refc, ctor);
-        }
-
-        /** Return a version of MH which matches matchMH w.r.t. isVarargsCollector. */
-        private static MethodHandle fixVarargs(MethodHandle mh, MethodHandle matchMH) {
-            boolean va1 = mh.isVarargsCollector();
-            boolean va2 = matchMH.isVarargsCollector();
-            if (va1 == va2) {
-                return mh;
-            } else if (va2) {
-                MethodType type = mh.type();
-                int arity = type.parameterCount();
-                return mh.asVarargsCollector(type.parameterType(arity-1));
-            } else {
-                return mh.asFixedArity();
-            }
+            return getDirectConstructor(refc, ctor);
         }
 
         /**
@@ -736,46 +718,10 @@
         public MethodHandle findSpecial(Class<?> refc, String name, MethodType type,
                                         Class<?> specialCaller) throws NoSuchMethodException, IllegalAccessException {
             checkSpecialCaller(specialCaller);
-            MemberName method = resolveOrFail(refc, name, type, false, false, specialCaller);
+            Lookup specialLookup = this.in(specialCaller);
+            MemberName method = specialLookup.resolveOrFail(REF_invokeSpecial, refc, name, type);
             checkSecurityManager(refc, method);
-            return accessSpecial(refc, method, findBoundCallerClass(method), specialCaller);
-        }
-        private MethodHandle accessSpecial(Class<?> refc, MemberName method,
-                                           Class<?> callerClass,
-                                           Class<?> specialCaller) throws NoSuchMethodException, IllegalAccessException {
-            checkMethod(refc, method, false);
-
-            Class<?> refcAsSuper;
-            if (refc != lookupClass() &&
-                refc != (refcAsSuper = lookupClass().getSuperclass()) &&
-                refc.isAssignableFrom(lookupClass())) {
-                assert(!method.getName().equals("<init>"));  // not this code path
-                // Per JVMS 6.5, desc. of invokespecial instruction:
-                // If the method is in a superclass of the LC,
-                // and if our original search was above LC.super,
-                // repeat the search (symbolic lookup) from LC.super.
-                // FIXME: MemberName.resolve should handle this instead.
-                MemberName m2 = new MemberName(refcAsSuper,
-                                               method.getName(),
-                                               method.getMethodType(),
-                                               REF_invokeSpecial);
-                m2 = IMPL_NAMES.resolveOrNull(m2, true, lookupClassOrNull());
-                if (m2 == null)  throw new InternalError(method.toString());
-                method = m2;
-                refc = refcAsSuper;
-                // redo basic checks
-                checkMethod(refc, method, false);
-            }
-
-            MethodHandle mh = MethodHandleImpl.findMethod(method, false, specialCaller);
-            mh = maybeBindCaller(method, mh, callerClass);
-            return restrictReceiver(method, mh, specialCaller);
-        }
-        private MethodHandle resolveSpecial(Class<?> refc, String name, MethodType type) throws NoSuchMethodException, IllegalAccessException {
-            Class<?> specialCaller = lookupClass();
-            checkSpecialCaller(specialCaller);
-            MemberName method = resolveOrFail(refc, name, type, false, false, specialCaller);
-            return accessSpecial(refc, method, lookupClass, specialCaller);
+            return specialLookup.getDirectMethod(REF_invokeSpecial, refc, method, findBoundCallerClass(method));
         }
 
         /**
@@ -796,13 +742,9 @@
          * @throws NullPointerException if any argument is null
          */
         public MethodHandle findGetter(Class<?> refc, String name, Class<?> type) throws NoSuchFieldException, IllegalAccessException {
-            MemberName field = resolveOrFail(refc, name, type, false);
+            MemberName field = resolveOrFail(REF_getField, refc, name, type);
             checkSecurityManager(refc, field);
-            return makeAccessor(refc, field, false, false, 0);
-        }
-        private MethodHandle resolveGetter(Class<?> refc, String name, Class<?> type) throws NoSuchFieldException, IllegalAccessException {
-            MemberName field = resolveOrFail(refc, name, type, false);
-            return makeAccessor(refc, field, false, false, 0);
+            return getDirectField(REF_getField, refc, field);
         }
 
         /**
@@ -823,13 +765,9 @@
          * @throws NullPointerException if any argument is null
          */
         public MethodHandle findSetter(Class<?> refc, String name, Class<?> type) throws NoSuchFieldException, IllegalAccessException {
-            MemberName field = resolveOrFail(refc, name, type, false);
+            MemberName field = resolveOrFail(REF_putField, refc, name, type);
             checkSecurityManager(refc, field);
-            return makeAccessor(refc, field, false, true, 0);
-        }
-        private MethodHandle resolveSetter(Class<?> refc, String name, Class<?> type) throws NoSuchFieldException, IllegalAccessException {
-            MemberName field = resolveOrFail(refc, name, type, false);
-            return makeAccessor(refc, field, false, true, 0);
+            return getDirectField(REF_putField, refc, field);
         }
 
         /**
@@ -849,13 +787,9 @@
          * @throws NullPointerException if any argument is null
          */
         public MethodHandle findStaticGetter(Class<?> refc, String name, Class<?> type) throws NoSuchFieldException, IllegalAccessException {
-            MemberName field = resolveOrFail(refc, name, type, true);
+            MemberName field = resolveOrFail(REF_getStatic, refc, name, type);
             checkSecurityManager(refc, field);
-            return makeAccessor(refc, field, false, false, 1);
-        }
-        private MethodHandle resolveStaticGetter(Class<?> refc, String name, Class<?> type) throws NoSuchFieldException, IllegalAccessException {
-            MemberName field = resolveOrFail(refc, name, type, true);
-            return makeAccessor(refc, field, false, false, 1);
+            return getDirectField(REF_getStatic, refc, field);
         }
 
         /**
@@ -875,13 +809,9 @@
          * @throws NullPointerException if any argument is null
          */
         public MethodHandle findStaticSetter(Class<?> refc, String name, Class<?> type) throws NoSuchFieldException, IllegalAccessException {
-            MemberName field = resolveOrFail(refc, name, type, true);
+            MemberName field = resolveOrFail(REF_putStatic, refc, name, type);
             checkSecurityManager(refc, field);
-            return makeAccessor(refc, field, false, true, 1);
-        }
-        private MethodHandle resolveStaticSetter(Class<?> refc, String name, Class<?> type) throws NoSuchFieldException, IllegalAccessException {
-            MemberName field = resolveOrFail(refc, name, type, true);
-            return makeAccessor(refc, field, false, true, 1);
+            return getDirectField(REF_putStatic, refc, field);
         }
 
         /**
@@ -932,16 +862,10 @@
          */
         public MethodHandle bind(Object receiver, String name, MethodType type) throws NoSuchMethodException, IllegalAccessException {
             Class<? extends Object> refc = receiver.getClass(); // may get NPE
-            MemberName method = resolveOrFail(refc, name, type, false);
+            MemberName method = resolveOrFail(REF_invokeSpecial, refc, name, type);
             checkSecurityManager(refc, method);
-            checkMethod(refc, method, false);
-            MethodHandle dmh = MethodHandleImpl.findMethod(method, true, lookupClassOrNull());
-            MethodHandle bcmh = maybeBindCaller(method, dmh, findBoundCallerClass(method));
-            if (bcmh != dmh)  return fixVarargs(bcmh.bindTo(receiver), dmh);
-            MethodHandle bmh = MethodHandleImpl.bindReceiver(dmh, receiver);
-            if (bmh == null)
-                throw method.makeAccessException("no access", this);
-            return fixVarargs(bmh, dmh);
+            MethodHandle mh = getDirectMethodNoRestrict(REF_invokeSpecial, refc, method, findBoundCallerClass(method));
+            return mh.bindReceiver(receiver).setVarargs(method);
         }
 
         /**
@@ -967,13 +891,12 @@
          */
         public MethodHandle unreflect(Method m) throws IllegalAccessException {
             MemberName method = new MemberName(m);
+            byte refKind = method.getReferenceKind();
+            if (refKind == REF_invokeSpecial)
+                refKind = REF_invokeVirtual;
             assert(method.isMethod());
-            if (m.isAccessible())
-                return MethodHandleImpl.findMethod(method, true, /*no lookupClass*/ null);
-            checkMethod(method.getDeclaringClass(), method, method.isStatic());
-            MethodHandle mh = MethodHandleImpl.findMethod(method, true, lookupClassOrNull());
-            mh = maybeBindCaller(method, mh, findBoundCallerClass(method));
-            return restrictProtectedReceiver(method, mh);
+            Lookup lookup = m.isAccessible() ? IMPL_LOOKUP : this;
+            return lookup.getDirectMethod(refKind, method.getDeclaringClass(), method, findBoundCallerClass(method));
         }
 
         /**
@@ -999,13 +922,11 @@
          */
         public MethodHandle unreflectSpecial(Method m, Class<?> specialCaller) throws IllegalAccessException {
             checkSpecialCaller(specialCaller);
-            MemberName method = new MemberName(m);
+            Lookup specialLookup = this.in(specialCaller);
+            MemberName method = new MemberName(m, true);
             assert(method.isMethod());
             // ignore m.isAccessible:  this is a new kind of access
-            checkMethod(m.getDeclaringClass(), method, false);
-            MethodHandle mh = MethodHandleImpl.findMethod(method, false, lookupClassOrNull());
-            mh = maybeBindCaller(method, mh, findBoundCallerClass(method));
-            return restrictReceiver(method, mh, specialCaller);
+            return specialLookup.getDirectMethod(REF_invokeSpecial, method.getDeclaringClass(), method, findBoundCallerClass(method));
         }
 
         /**
@@ -1029,19 +950,12 @@
          *                                is set and {@code asVarargsCollector} fails
          * @throws NullPointerException if the argument is null
          */
+        @SuppressWarnings("rawtypes")  // Will be Constructor<?> after JSR 292 MR
         public MethodHandle unreflectConstructor(Constructor c) throws IllegalAccessException {
             MemberName ctor = new MemberName(c);
             assert(ctor.isConstructor());
-            MethodHandle rawCtor;
-            if (c.isAccessible()) {
-                rawCtor = MethodHandleImpl.findMethod(ctor, false, /*no lookupClass*/ null);
-            } else {
-                checkAccess(c.getDeclaringClass(), ctor, false /* is_setter */);
-                rawCtor = MethodHandleImpl.findMethod(ctor, false, lookupClassOrNull());
-            }
-            assert(!MethodHandleNatives.isCallerSensitive(ctor));  // maybeBindCaller not relevant here
-            MethodHandle allocator = MethodHandleImpl.makeAllocator(rawCtor);
-            return fixVarargs(allocator, rawCtor);
+            Lookup lookup = c.isAccessible() ? IMPL_LOOKUP : this;
+            return lookup.getDirectConstructor(ctor.getDeclaringClass(), ctor);
         }
 
         /**
@@ -1059,7 +973,15 @@
          * @throws NullPointerException if the argument is null
          */
         public MethodHandle unreflectGetter(Field f) throws IllegalAccessException {
-            return makeAccessor(f.getDeclaringClass(), new MemberName(f), f.isAccessible(), false, -1);
+            return unreflectField(f, false);
+        }
+        private MethodHandle unreflectField(Field f, boolean isSetter) throws IllegalAccessException {
+            MemberName field = new MemberName(f, isSetter);
+            assert(isSetter
+                    ? MethodHandleNatives.refKindIsSetter(field.getReferenceKind())
+                    : MethodHandleNatives.refKindIsGetter(field.getReferenceKind()));
+            Lookup lookup = f.isAccessible() ? IMPL_LOOKUP : this;
+            return lookup.getDirectField(field.getReferenceKind(), f.getDeclaringClass(), field);
         }
 
         /**
@@ -1077,33 +999,22 @@
          * @throws NullPointerException if the argument is null
          */
         public MethodHandle unreflectSetter(Field f) throws IllegalAccessException {
-            return makeAccessor(f.getDeclaringClass(), new MemberName(f), f.isAccessible(), true, -1);
+            return unreflectField(f, true);
         }
 
         /// Helper methods, all package-private.
 
-        MemberName resolveOrFail(Class<?> refc, String name, Class<?> type, boolean isStatic) throws NoSuchFieldException, IllegalAccessException {
+        MemberName resolveOrFail(byte refKind, Class<?> refc, String name, Class<?> type) throws NoSuchFieldException, IllegalAccessException {
             checkSymbolicClass(refc);  // do this before attempting to resolve
             name.getClass(); type.getClass();  // NPE
-            int mods = (isStatic ? Modifier.STATIC : 0);
-            return IMPL_NAMES.resolveOrFail(new MemberName(refc, name, type, mods), true, lookupClassOrNull(),
+            return IMPL_NAMES.resolveOrFail(refKind, new MemberName(refc, name, type, refKind), lookupClassOrNull(),
                                             NoSuchFieldException.class);
         }
 
-        MemberName resolveOrFail(Class<?> refc, String name, MethodType type, boolean isStatic) throws NoSuchMethodException, IllegalAccessException {
+        MemberName resolveOrFail(byte refKind, Class<?> refc, String name, MethodType type) throws NoSuchMethodException, IllegalAccessException {
             checkSymbolicClass(refc);  // do this before attempting to resolve
             name.getClass(); type.getClass();  // NPE
-            int mods = (isStatic ? Modifier.STATIC : 0);
-            return IMPL_NAMES.resolveOrFail(new MemberName(refc, name, type, mods), true, lookupClassOrNull(),
-                                            NoSuchMethodException.class);
-        }
-
-        MemberName resolveOrFail(Class<?> refc, String name, MethodType type, boolean isStatic,
-                                 boolean searchSupers, Class<?> specialCaller) throws NoSuchMethodException, IllegalAccessException {
-            checkSymbolicClass(refc);  // do this before attempting to resolve
-            name.getClass(); type.getClass();  // NPE
-            int mods = (isStatic ? Modifier.STATIC : 0);
-            return IMPL_NAMES.resolveOrFail(new MemberName(refc, name, type, mods), searchSupers, specialCaller,
+            return IMPL_NAMES.resolveOrFail(refKind, new MemberName(refc, name, type, refKind), lookupClassOrNull(),
                                             NoSuchMethodException.class);
         }
 
@@ -1188,8 +1099,7 @@
                 final int which = Member.DECLARED;
                 final Class<?> clazz = defc;
                 if (!overridden) {
-                    if (!isFullPowerLookup() ||
-                        (lookupClass.getClassLoader() != defc.getClassLoader())) {
+                    if (!isFullPowerLookup()) {
                         smgr.checkPermission(SecurityConstants.CHECK_MEMBER_ACCESS_PERMISSION);
                     }
                 } else {
@@ -1205,7 +1115,8 @@
             }
         }
 
-        void checkMethod(Class<?> refc, MemberName m, boolean wantStatic) throws IllegalAccessException {
+        void checkMethod(byte refKind, Class<?> refc, MemberName m) throws IllegalAccessException {
+            boolean wantStatic = (refKind == REF_invokeStatic);
             String message;
             if (m.isConstructor())
                 message = "expected a method, not a constructor";
@@ -1214,29 +1125,43 @@
             else if (wantStatic != m.isStatic())
                 message = wantStatic ? "expected a static method" : "expected a non-static method";
             else
-                { checkAccess(refc, m, false /* is_setter */); return; }
+                { checkAccess(refKind, refc, m); return; }
             throw m.makeAccessException(message, this);
         }
 
-        void checkAccess(Class<?> refc, MemberName m, boolean isSetter) throws IllegalAccessException {
+        void checkField(byte refKind, Class<?> refc, MemberName m) throws IllegalAccessException {
+            boolean wantStatic = !MethodHandleNatives.refKindHasReceiver(refKind);
+            String message;
+            if (wantStatic != m.isStatic())
+                message = wantStatic ? "expected a static field" : "expected a non-static field";
+            else
+                { checkAccess(refKind, refc, m); return; }
+            throw m.makeAccessException(message, this);
+        }
+
+        void checkAccess(byte refKind, Class<?> refc, MemberName m) throws IllegalAccessException {
+            assert(m.referenceKindIsConsistentWith(refKind) &&
+                   MethodHandleNatives.refKindIsValid(refKind) &&
+                   (MethodHandleNatives.refKindIsField(refKind) == m.isField()));
             int allowedModes = this.allowedModes;
             if (allowedModes == TRUSTED)  return;
             int mods = m.getModifiers();
-            if (m.isField() && Modifier.isFinal(mods) && isSetter) {
-              throw m.makeAccessException("unexpected set of a final field", this);
-            }
+            if (Modifier.isFinal(mods) &&
+                    MethodHandleNatives.refKindIsSetter(refKind))
+                throw m.makeAccessException("unexpected set of a final field", this);
             if (Modifier.isPublic(mods) && Modifier.isPublic(refc.getModifiers()) && allowedModes != 0)
                 return;  // common case
             int requestedModes = fixmods(mods);  // adjust 0 => PACKAGE
-            if ((requestedModes & allowedModes) != 0
-                && VerifyAccess.isMemberAccessible(refc, m.getDeclaringClass(),
-                                                   mods, lookupClass(), allowedModes))
-                return;
-            if (((requestedModes & ~allowedModes) & PROTECTED) != 0
-                && (allowedModes & PACKAGE) != 0
-                && VerifyAccess.isSamePackage(m.getDeclaringClass(), lookupClass()))
+            if ((requestedModes & allowedModes) != 0) {
+                if (VerifyAccess.isMemberAccessible(refc, m.getDeclaringClass(),
+                                                    mods, lookupClass(), allowedModes))
+                    return;
+            } else {
                 // Protected members can also be checked as if they were package-private.
-                return;
+                if ((requestedModes & PROTECTED) != 0 && (allowedModes & PACKAGE) != 0
+                        && VerifyAccess.isSamePackage(m.getDeclaringClass(), lookupClass()))
+                    return;
+            }
             throw m.makeAccessException(accessFailedMessage(refc, m), this);
         }
 
@@ -1265,7 +1190,8 @@
 
         private static final boolean ALLOW_NESTMATE_ACCESS = false;
 
-        void checkSpecialCaller(Class<?> specialCaller) throws IllegalAccessException {
+        private void checkSpecialCaller(Class<?> specialCaller) throws IllegalAccessException {
+            int allowedModes = this.allowedModes;
             if (allowedModes == TRUSTED)  return;
             if ((allowedModes & PRIVATE) == 0
                 || (specialCaller != lookupClass()
@@ -1275,7 +1201,7 @@
                     makeAccessException("no private access for invokespecial", this);
         }
 
-        MethodHandle restrictProtectedReceiver(MemberName method, MethodHandle mh) throws IllegalAccessException {
+        private boolean restrictProtectedReceiver(MemberName method) {
             // The accessing class only has the right to use a protected member
             // on itself or a subclass.  Enforce that restriction, from JVMS 5.4.4, etc.
             if (!method.isProtected() || method.isStatic()
@@ -1284,21 +1210,68 @@
                 || VerifyAccess.isSamePackage(method.getDeclaringClass(), lookupClass())
                 || (ALLOW_NESTMATE_ACCESS &&
                     VerifyAccess.isSamePackageMember(method.getDeclaringClass(), lookupClass())))
-                return mh;
-            else
-                return restrictReceiver(method, mh, lookupClass());
+                return false;
+            return true;
         }
-        MethodHandle restrictReceiver(MemberName method, MethodHandle mh, Class<?> caller) throws IllegalAccessException {
+        private MethodHandle restrictReceiver(MemberName method, MethodHandle mh, Class<?> caller) throws IllegalAccessException {
             assert(!method.isStatic());
-            Class<?> defc = method.getDeclaringClass();  // receiver type of mh is too wide
-            if (defc.isInterface() || !defc.isAssignableFrom(caller)) {
+            // receiver type of mh is too wide; narrow to caller
+            if (!method.getDeclaringClass().isAssignableFrom(caller)) {
                 throw method.makeAccessException("caller class must be a subclass below the method", caller);
             }
             MethodType rawType = mh.type();
             if (rawType.parameterType(0) == caller)  return mh;
             MethodType narrowType = rawType.changeParameterType(0, caller);
-            MethodHandle narrowMH = MethodHandleImpl.convertArguments(mh, narrowType, rawType, 0);
-            return fixVarargs(narrowMH, mh);
+            return mh.viewAsType(narrowType);
+        }
+
+        private MethodHandle getDirectMethod(byte refKind, Class<?> refc, MemberName method, Class<?> callerClass) throws IllegalAccessException {
+            return getDirectMethodCommon(refKind, refc, method,
+                    (refKind == REF_invokeSpecial ||
+                        (MethodHandleNatives.refKindHasReceiver(refKind) &&
+                            restrictProtectedReceiver(method))), callerClass);
+        }
+        private MethodHandle getDirectMethodNoRestrict(byte refKind, Class<?> refc, MemberName method, Class<?> callerClass) throws IllegalAccessException {
+            return getDirectMethodCommon(refKind, refc, method, false, callerClass);
+        }
+        private MethodHandle getDirectMethodCommon(byte refKind, Class<?> refc, MemberName method,
+                                                   boolean doRestrict, Class<?> callerClass) throws IllegalAccessException {
+            checkMethod(refKind, refc, method);
+            if (method.isMethodHandleInvoke())
+                return fakeMethodHandleInvoke(method);
+
+            Class<?> refcAsSuper;
+            if (refKind == REF_invokeSpecial &&
+                refc != lookupClass() &&
+                refc != (refcAsSuper = lookupClass().getSuperclass()) &&
+                refc.isAssignableFrom(lookupClass())) {
+                assert(!method.getName().equals("<init>"));  // not this code path
+                // Per JVMS 6.5, desc. of invokespecial instruction:
+                // If the method is in a superclass of the LC,
+                // and if our original search was above LC.super,
+                // repeat the search (symbolic lookup) from LC.super.
+                // FIXME: MemberName.resolve should handle this instead.
+                MemberName m2 = new MemberName(refcAsSuper,
+                                               method.getName(),
+                                               method.getMethodType(),
+                                               REF_invokeSpecial);
+                m2 = IMPL_NAMES.resolveOrNull(refKind, m2, lookupClassOrNull());
+                if (m2 == null)  throw new InternalError(method.toString());
+                method = m2;
+                refc = refcAsSuper;
+                // redo basic checks
+                checkMethod(refKind, refc, method);
+            }
+
+            MethodHandle mh = DirectMethodHandle.make(refc, method);
+            mh = maybeBindCaller(method, mh, callerClass);
+            mh = mh.setVarargs(method);
+            if (doRestrict)
+                mh = restrictReceiver(method, mh, lookupClass());
+            return mh;
+        }
+        private MethodHandle fakeMethodHandleInvoke(MemberName method) {
+            return throwException(method.getReturnType(), UnsupportedOperationException.class);
         }
         private MethodHandle maybeBindCaller(MemberName method, MethodHandle mh,
                                              Class<?> callerClass)
@@ -1309,39 +1282,48 @@
             if ((allowedModes & PRIVATE) == 0)  // caller must use full-power lookup
                 hostClass = callerClass;  // callerClass came from a security manager style stack walk
             MethodHandle cbmh = MethodHandleImpl.bindCaller(mh, hostClass);
-            cbmh = fixVarargs(cbmh, mh);  // in JDK 7 version, varargs happens earlier and must be repaired
+            // Note: caller will apply varargs after this step happens.
             return cbmh;
         }
-
-        MethodHandle makeAccessor(Class<?> refc, MemberName field,
-                                  boolean trusted, boolean isSetter,
-                                  int checkStatic) throws IllegalAccessException {
-            assert(field.isField());
-            if (checkStatic >= 0 && (checkStatic != 0) != field.isStatic())
-                throw field.makeAccessException((checkStatic != 0)
-                                                ? "expected a static field"
-                                                : "expected a non-static field", this);
-            if (trusted)
-                return MethodHandleImpl.accessField(field, isSetter, /*no lookupClass*/ null);
-            checkAccess(refc, field, isSetter);
-            MethodHandle mh = MethodHandleImpl.accessField(field, isSetter, lookupClassOrNull());
-            return restrictProtectedReceiver(field, mh);
+        private MethodHandle getDirectField(byte refKind, Class<?> refc, MemberName field) throws IllegalAccessException {
+            checkField(refKind, refc, field);
+            MethodHandle mh = DirectMethodHandle.make(refc, field);
+            boolean doRestrict = (MethodHandleNatives.refKindHasReceiver(refKind) &&
+                                    restrictProtectedReceiver(field));
+            if (doRestrict)
+                mh = restrictReceiver(field, mh, lookupClass());
+            return mh;
+        }
+        private MethodHandle getDirectConstructor(Class<?> refc, MemberName ctor) throws IllegalAccessException {
+            assert(ctor.isConstructor());
+            checkAccess(REF_newInvokeSpecial, refc, ctor);
+            assert(!MethodHandleNatives.isCallerSensitive(ctor));  // maybeBindCaller not relevant here
+            return DirectMethodHandle.make(ctor).setVarargs(ctor);
         }
 
         /** Hook called from the JVM (via MethodHandleNatives) to link MH constants:
          */
         /*non-public*/
-        MethodHandle linkMethodHandleConstant(int refKind, Class<?> defc, String name, Object type) throws ReflectiveOperationException {
-            switch (refKind) {
-            case REF_getField:          return resolveGetter(       defc, name, (Class<?>)   type );
-            case REF_getStatic:         return resolveStaticGetter( defc, name, (Class<?>)   type );
-            case REF_putField:          return resolveSetter(       defc, name, (Class<?>)   type );
-            case REF_putStatic:         return resolveStaticSetter( defc, name, (Class<?>)   type );
-            case REF_invokeVirtual:     return resolveVirtual(      defc, name, (MethodType) type );
-            case REF_invokeStatic:      return resolveStatic(       defc, name, (MethodType) type );
-            case REF_invokeSpecial:     return resolveSpecial(      defc, name, (MethodType) type );
-            case REF_newInvokeSpecial:  return resolveConstructor(  defc,       (MethodType) type );
-            case REF_invokeInterface:   return resolveVirtual(      defc, name, (MethodType) type );
+        MethodHandle linkMethodHandleConstant(byte refKind, Class<?> defc, String name, Object type) throws ReflectiveOperationException {
+            MemberName resolved = null;
+            if (type instanceof MemberName) {
+                resolved = (MemberName) type;
+                if (!resolved.isResolved())  throw new InternalError("unresolved MemberName");
+                assert(name == null || name.equals(resolved.getName()));
+            }
+            if (MethodHandleNatives.refKindIsField(refKind)) {
+                MemberName field = (resolved != null) ? resolved
+                        : resolveOrFail(refKind, defc, name, (Class<?>) type);
+                return getDirectField(refKind, defc, field);
+            } else if (MethodHandleNatives.refKindIsMethod(refKind)) {
+                MemberName method = (resolved != null) ? resolved
+                        : resolveOrFail(refKind, defc, name, (MethodType) type);
+                return getDirectMethod(refKind, defc, method, lookupClass);
+            } else if (refKind == REF_newInvokeSpecial) {
+                assert(name == null || name.equals("<init>"));
+                MemberName ctor = (resolved != null) ? resolved
+                        : resolveOrFail(REF_newInvokeSpecial, defc, name, (MethodType) type);
+                return getDirectConstructor(defc, ctor);
             }
             // oops
             throw new ReflectiveOperationException("bad MethodHandle constant #"+refKind+" "+name+" : "+type);
@@ -1360,7 +1342,7 @@
      */
     public static
     MethodHandle arrayElementGetter(Class<?> arrayClass) throws IllegalArgumentException {
-        return MethodHandleImpl.accessArrayElement(arrayClass, false);
+        return MethodHandleImpl.makeArrayElementAccessor(arrayClass, false);
     }
 
     /**
@@ -1374,7 +1356,7 @@
      */
     public static
     MethodHandle arrayElementSetter(Class<?> arrayClass) throws IllegalArgumentException {
-        return MethodHandleImpl.accessArrayElement(arrayClass, true);
+        return MethodHandleImpl.makeArrayElementAccessor(arrayClass, true);
     }
 
     /// method handle invocation (reflective style)
@@ -1501,78 +1483,12 @@
         return type.invokers().generalInvoker();
     }
 
-    /**
-     * Perform value checking, exactly as if for an adapted method handle.
-     * It is assumed that the given value is either null, of type T0,
-     * or (if T0 is primitive) of the wrapper class corresponding to T0.
-     * The following checks and conversions are made:
-     * <ul>
-     * <li>If T0 and T1 are references, then a cast to T1 is applied.
-     *     (The types do not need to be related in any particular way.)
-     * <li>If T0 and T1 are primitives, then a widening or narrowing
-     *     conversion is applied, if one exists.
-     * <li>If T0 is a primitive and T1 a reference, and
-     *     T0 has a wrapper class TW, a boxing conversion to TW is applied,
-     *     possibly followed by a reference conversion.
-     *     T1 must be TW or a supertype.
-     * <li>If T0 is a reference and T1 a primitive, and
-     *     T1 has a wrapper class TW, an unboxing conversion is applied,
-     *     possibly preceded by a reference conversion.
-     *     T0 must be TW or a supertype.
-     * <li>If T1 is void, the return value is discarded
-     * <li>If T0 is void and T1 a reference, a null value is introduced.
-     * <li>If T0 is void and T1 a primitive, a zero value is introduced.
-     * </ul>
-     * If the value is discarded, null will be returned.
-     * @param valueType
-     * @param value
-     * @return the value, converted if necessary
-     * @throws java.lang.ClassCastException if a cast fails
-     */
-    // FIXME: This is used in just one place.  Refactor away.
-    static
-    <T0, T1> T1 checkValue(Class<T0> t0, Class<T1> t1, Object value)
-       throws ClassCastException
-    {
-        if (t0 == t1) {
-            // no conversion needed; just reassert the same type
-            if (t0.isPrimitive())
-                return Wrapper.asPrimitiveType(t1).cast(value);
-            else
-                return Wrapper.OBJECT.convert(value, t1);
-        }
-        boolean prim0 = t0.isPrimitive(), prim1 = t1.isPrimitive();
-        if (!prim0) {
-            // check contract with caller
-            Wrapper.OBJECT.convert(value, t0);
-            if (!prim1) {
-                return Wrapper.OBJECT.convert(value, t1);
-            }
-            // convert reference to primitive by unboxing
-            Wrapper w1 = Wrapper.forPrimitiveType(t1);
-            return w1.convert(value, t1);
-        }
-        // check contract with caller:
-        Wrapper.asWrapperType(t0).cast(value);
-        Wrapper w1 = Wrapper.forPrimitiveType(t1);
-        return w1.convert(value, t1);
+    static /*non-public*/
+    MethodHandle basicInvoker(MethodType type) {
+        return type.form().basicInvoker();
     }
 
-    // FIXME: Delete this.  It is used only for insertArguments & bindTo.
-    // Replace by a more standard check.
-    static
-    Object checkValue(Class<?> T1, Object value)
-       throws ClassCastException
-    {
-        Class<?> T0;
-        if (value == null)
-            T0 = Object.class;
-        else
-            T0 = value.getClass();
-        return checkValue(T0, T1, value);
-    }
-
-    /// method handle modification (creation from other method handles)
+     /// method handle modification (creation from other method handles)
 
     /**
      * Produces a method handle which adapts the type of the
@@ -1620,7 +1536,10 @@
      */
     public static
     MethodHandle explicitCastArguments(MethodHandle target, MethodType newType) {
-        return MethodHandleImpl.convertArguments(target, newType, 2);
+        if (!target.type().isCastableTo(newType)) {
+            throw new WrongMethodTypeException("cannot explicitly cast "+target+" to "+newType);
+        }
+        return MethodHandleImpl.makePairwiseConvert(target, newType, 2);
     }
 
     /**
@@ -1684,11 +1603,8 @@
      */
     public static
     MethodHandle permuteArguments(MethodHandle target, MethodType newType, int... reorder) {
-        MethodType oldType = target.type();
-        checkReorder(reorder, newType, oldType);
-        return MethodHandleImpl.permuteArguments(target,
-                                                 newType, oldType,
-                                                 reorder);
+        checkReorder(reorder, newType, target.type());
+        return target.permuteArguments(newType, reorder);
     }
 
     private static void checkReorder(int[] reorder, MethodType newType, MethodType oldType) {
@@ -1757,8 +1673,7 @@
         else if (type.isPrimitive())
             return ValueConversions.identity(Wrapper.forPrimitiveType(type));
         else
-            return AdapterMethodHandle.makeRetypeRaw(
-                    MethodType.methodType(type, type), ValueConversions.identity());
+            return MethodHandleImpl.makeReferenceIdentity(type);
     }
 
     /**
@@ -1804,18 +1719,26 @@
         MethodHandle result = target;
         for (int i = 0; i < insCount; i++) {
             Object value = values[i];
-            Class<?> valueType = oldType.parameterType(pos+i);
-            value = checkValue(valueType, value);
-            if (pos == 0 && !valueType.isPrimitive()) {
-                // At least for now, make bound method handles a special case.
-                MethodHandle bmh = MethodHandleImpl.bindReceiver(result, value);
-                if (bmh != null) {
-                    result = bmh;
-                    continue;
+            Class<?> ptype = oldType.parameterType(pos+i);
+            if (ptype.isPrimitive()) {
+                char btype = 'I';
+                Wrapper w = Wrapper.forPrimitiveType(ptype);
+                switch (w) {
+                case LONG:    btype = 'J'; break;
+                case FLOAT:   btype = 'F'; break;
+                case DOUBLE:  btype = 'D'; break;
                 }
-                // else fall through to general adapter machinery
+                // perform unboxing and/or primitive conversion
+                value = w.convert(value, ptype);
+                result = result.bindArgument(pos, btype, value);
+                continue;
             }
-            result = MethodHandleImpl.bindArgument(result, pos, value);
+            value = ptype.cast(value);  // throw CCE if needed
+            if (pos == 0) {
+                result = result.bindReceiver(value);
+            } else {
+                result = result.bindArgument(pos, 'L', value);
+            }
         }
         return result;
     }
@@ -1865,16 +1788,17 @@
     public static
     MethodHandle dropArguments(MethodHandle target, int pos, List<Class<?>> valueTypes) {
         MethodType oldType = target.type();  // get NPE
-        if (valueTypes.size() == 0)  return target;
+        int dropped = valueTypes.size();
+        MethodType.checkSlotCount(dropped);
+        if (dropped == 0)  return target;
         int outargs = oldType.parameterCount();
-        int inargs  = outargs + valueTypes.size();
+        int inargs  = outargs + dropped;
         if (pos < 0 || pos >= inargs)
             throw newIllegalArgumentException("no argument type to remove");
-        ArrayList<Class<?>> ptypes =
-                new ArrayList<Class<?>>(oldType.parameterList());
+        ArrayList<Class<?>> ptypes = new ArrayList<>(oldType.parameterList());
         ptypes.addAll(pos, valueTypes);
         MethodType newType = MethodType.methodType(oldType.returnType(), ptypes);
-        return MethodHandleImpl.dropArguments(target, newType, pos);
+        return target.dropArguments(newType, pos, dropped);
     }
 
     /**
@@ -2018,7 +1942,18 @@
         if (filterType.parameterCount() != 1
             || filterType.returnType() != targetType.parameterType(pos))
             throw newIllegalArgumentException("target and filter types do not match", targetType, filterType);
-        return MethodHandleImpl.filterArgument(target, pos, filter);
+        return MethodHandleImpl.makeCollectArguments(target, filter, pos, false);
+    }
+
+    // FIXME: Make this public in M1.
+    /*non-public*/ static
+    MethodHandle collectArguments(MethodHandle target, int pos, MethodHandle collector) {
+        MethodType targetType = target.type();
+        MethodType filterType = collector.type();
+        if (filterType.returnType() != void.class &&
+            filterType.returnType() != targetType.parameterType(pos))
+            throw newIllegalArgumentException("target and filter types do not match", targetType, filterType);
+        return MethodHandleImpl.makeCollectArguments(target, collector, pos, false);
     }
 
     /**
@@ -2090,18 +2025,7 @@
             throw newIllegalArgumentException("target and filter types do not match", target, filter);
         // result = fold( lambda(retval, arg...) { filter(retval) },
         //                lambda(        arg...) { target(arg...) } )
-        MethodType newType = targetType.changeReturnType(filterType.returnType());
-        MethodHandle result = null;
-        if (AdapterMethodHandle.canCollectArguments(filterType, targetType, 0, false)) {
-            result = AdapterMethodHandle.makeCollectArguments(filter, target, 0, false);
-            if (result != null)  return result;
-        }
-        // FIXME: Too many nodes here.
-        assert(MethodHandleNatives.workaroundWithoutRicochetFrames());  // this class is deprecated
-        MethodHandle returner = dropArguments(filter, filterValues, targetType.parameterList());
-        result = foldArguments(returner, target);
-        assert(result.type().equals(newType));
-        return result;
+        return MethodHandleImpl.makeCollectArguments(filter, target, 0, false);
     }
 
     /**
@@ -2199,9 +2123,7 @@
         if (!ok)
             throw misMatchedTypes("target and combiner types", targetType, combinerType);
         MethodType newType = targetType.dropParameterTypes(foldPos, afterInsertPos);
-        MethodHandle res = MethodHandleImpl.foldArguments(target, newType, foldPos, combiner);
-        if (res == null)  throw newIllegalArgumentException("cannot fold from "+newType+" to " +targetType);
-        return res;
+        return MethodHandleImpl.makeCollectArguments(target, combiner, foldPos, true);
     }
 
     /**
@@ -2342,6 +2264,8 @@
      */
     public static
     MethodHandle throwException(Class<?> returnType, Class<? extends Throwable> exType) {
+        if (!Throwable.class.isAssignableFrom(exType))
+            throw new ClassCastException(exType.getName());
         return MethodHandleImpl.throwException(MethodType.methodType(returnType, exType));
     }
 }
--- a/src/share/classes/java/lang/invoke/MethodType.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/lang/invoke/MethodType.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -26,12 +26,14 @@
 package java.lang.invoke;
 
 import sun.invoke.util.Wrapper;
+import java.lang.ref.WeakReference;
+import java.lang.ref.ReferenceQueue;
 import java.util.Arrays;
 import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
 import sun.invoke.util.BytecodeDescriptor;
 import static java.lang.invoke.MethodHandleStatics.*;
+import sun.invoke.util.VerifyType;
 
 /**
  * A method type represents the arguments and return type accepted and
@@ -107,6 +109,38 @@
     /*trusted*/ Class<?> rtype() { return rtype; }
     /*trusted*/ Class<?>[] ptypes() { return ptypes; }
 
+    void setForm(MethodTypeForm f) { form = f; }
+
+    /** This number, mandated by the JVM spec as 255,
+     *  is the maximum number of <em>slots</em>
+     *  that any Java method can receive in its argument list.
+     *  It limits both JVM signatures and method type objects.
+     *  The longest possible invocation will look like
+     *  {@code staticMethod(arg1, arg2, ..., arg255)} or
+     *  {@code x.virtualMethod(arg1, arg2, ..., arg254)}.
+     */
+    /*non-public*/ static final int MAX_JVM_ARITY = 255;  // this is mandated by the JVM spec.
+
+    /** This number is the maximum arity of a method handle, 254.
+     *  It is derived from the absolute JVM-imposed arity by subtracting one,
+     *  which is the slot occupied by the method handle itself at the
+     *  beginning of the argument list used to invoke the method handle.
+     *  The longest possible invocation will look like
+     *  {@code mh.invoke(arg1, arg2, ..., arg254)}.
+     */
+    // Issue:  Should we allow MH.invokeWithArguments to go to the full 255?
+    /*non-public*/ static final int MAX_MH_ARITY = MAX_JVM_ARITY-1;  // deduct one for mh receiver
+
+    /** This number is the maximum arity of a method handle invoker, 253.
+     *  It is derived from the absolute JVM-imposed arity by subtracting two,
+     *  which are the slots occupied by invoke method handle, and the the
+     *  target method handle, which are both at the beginning of the argument
+     *  list used to invoke the target method handle.
+     *  The longest possible invocation will look like
+     *  {@code invokermh.invoke(targetmh, arg1, arg2, ..., arg253)}.
+     */
+    /*non-public*/ static final int MAX_MH_INVOKER_ARITY = MAX_MH_ARITY-1;  // deduct one more for invoker
+
     private static void checkRtype(Class<?> rtype) {
         rtype.equals(rtype);  // null check
     }
@@ -126,8 +160,10 @@
         checkSlotCount(ptypes.length + slots);
         return slots;
     }
-    private static void checkSlotCount(int count) {
-        if ((count & 0xFF) != count)
+    static void checkSlotCount(int count) {
+        assert((MAX_JVM_ARITY & (MAX_JVM_ARITY+1)) == 0);
+        // MAX_JVM_ARITY must be power of 2 minus 1 for following code trick to work:
+        if ((count & MAX_JVM_ARITY) != count)
             throw newIllegalArgumentException("bad parameter count "+count);
     }
     private static IndexOutOfBoundsException newIndexOutOfBoundsException(Object num) {
@@ -135,8 +171,7 @@
         return new IndexOutOfBoundsException(num.toString());
     }
 
-    static final HashMap<MethodType,MethodType> internTable
-            = new HashMap<MethodType, MethodType>();
+    static final WeakInternSet internTable = new WeakInternSet();
 
     static final Class<?>[] NO_PTYPES = {};
 
@@ -238,31 +273,17 @@
             ptypes = NO_PTYPES; trusted = true;
         }
         MethodType mt1 = new MethodType(rtype, ptypes);
-        MethodType mt0;
-        synchronized (internTable) {
-            mt0 = internTable.get(mt1);
-            if (mt0 != null)
-                return mt0;
-        }
+        MethodType mt0 = internTable.get(mt1);
+        if (mt0 != null)
+            return mt0;
         if (!trusted)
             // defensively copy the array passed in by the user
             mt1 = new MethodType(rtype, ptypes.clone());
         // promote the object to the Real Thing, and reprobe
         MethodTypeForm form = MethodTypeForm.findForm(mt1);
         mt1.form = form;
-        if (form.erasedType == mt1) {
-            // This is a principal (erased) type; show it to the JVM.
-            MethodHandleNatives.init(mt1);
-        }
-        synchronized (internTable) {
-            mt0 = internTable.get(mt1);
-            if (mt0 != null)
-                return mt0;
-            internTable.put(mt1, mt1);
-        }
-        return mt1;
+        return internTable.add(mt1);
     }
-
     private static final MethodType[] objectOnlyTypes = new MethodType[20];
 
     /**
@@ -394,6 +415,32 @@
         return insertParameterTypes(parameterCount(), ptypesToInsert);
     }
 
+     /**
+     * Finds or creates a method type with modified parameter types.
+     * Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}.
+     * @param start  the position (zero-based) of the first replaced parameter type(s)
+     * @param end    the position (zero-based) after the last replaced parameter type(s)
+     * @param ptypesToInsert zero or more new parameter types to insert into the parameter list
+     * @return the same type, except with the selected parameter(s) replaced
+     * @throws IndexOutOfBoundsException if {@code start} is negative or greater than {@code parameterCount()}
+     *                                  or if {@code end} is negative or greater than {@code parameterCount()}
+     *                                  or if {@code start} is greater than {@code end}
+     * @throws IllegalArgumentException if any element of {@code ptypesToInsert} is {@code void.class}
+     *                                  or if the resulting method type would have more than 255 parameter slots
+     * @throws NullPointerException if {@code ptypesToInsert} or any of its elements is null
+     */
+    /*non-public*/ MethodType replaceParameterTypes(int start, int end, Class<?>... ptypesToInsert) {
+        if (start == end)
+            return insertParameterTypes(start, ptypesToInsert);
+        int len = ptypes.length;
+        if (!(0 <= start && start <= end && end <= len))
+            throw newIndexOutOfBoundsException("start="+start+" end="+end);
+        int ilen = ptypesToInsert.length;
+        if (ilen == 0)
+            return dropParameterTypes(start, end);
+        return dropParameterTypes(start, end).insertParameterTypes(start, ptypesToInsert);
+    }
+
     /**
      * Finds or creates a method type with some parameter types omitted.
      * Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}.
@@ -474,6 +521,23 @@
     }
 
     /**
+     * Erases all reference types to {@code Object}, and all subword types to {@code int}.
+     * This is the reduced type polymorphism used by private methods
+     * such as {@link MethodHandle#invokeBasic invokeBasic}.
+     * @return a version of the original type with all reference and subword types replaced
+     */
+    /*non-public*/ MethodType basicType() {
+        return form.basicType();
+    }
+
+    /**
+     * @return a version of the original type with MethodHandle prepended as the first argument
+     */
+    /*non-public*/ MethodType invokerType() {
+        return insertParameterTypes(0, MethodHandle.class);
+    }
+
+    /**
      * Converts all types, both reference and primitive, to {@code Object}.
      * Convenience method for {@link #genericMethodType(int) genericMethodType}.
      * The expression {@code type.wrap().erase()} produces the same value
@@ -567,6 +631,11 @@
         return Collections.unmodifiableList(Arrays.asList(ptypes));
     }
 
+    /*non-public*/ Class<?> lastParameterType() {
+        int len = ptypes.length;
+        return len == 0 ? void.class : ptypes[len-1];
+    }
+
     /**
      * Presents the parameter types as an array (a convenience method).
      * Changes to the array will not result in changes to the type.
@@ -636,6 +705,26 @@
 
 
     /*non-public*/
+    boolean isViewableAs(MethodType newType) {
+        if (!VerifyType.isNullConversion(returnType(), newType.returnType()))
+            return false;
+        int argc = parameterCount();
+        if (argc != newType.parameterCount())
+            return false;
+        for (int i = 0; i < argc; i++) {
+            if (!VerifyType.isNullConversion(newType.parameterType(i), parameterType(i)))
+                return false;
+        }
+        return true;
+    }
+    /*non-public*/
+    boolean isCastableTo(MethodType newType) {
+        int argc = parameterCount();
+        if (argc != newType.parameterCount())
+            return false;
+        return true;
+    }
+    /*non-public*/
     boolean isConvertibleTo(MethodType newType) {
         if (!canConvert(returnType(), newType.returnType()))
             return false;
@@ -818,6 +907,10 @@
         return BytecodeDescriptor.unparse(this);
     }
 
+    /*non-public*/ static String toFieldDescriptorString(Class<?> cls) {
+        return BytecodeDescriptor.unparse(cls);
+    }
+
     /// Serialization.
 
     /**
@@ -890,18 +983,17 @@
         // store them into the implementation-specific final fields.
         checkRtype(rtype);
         checkPtypes(ptypes);
-        unsafe.putObject(this, rtypeOffset, rtype);
-        unsafe.putObject(this, ptypesOffset, ptypes);
+        UNSAFE.putObject(this, rtypeOffset, rtype);
+        UNSAFE.putObject(this, ptypesOffset, ptypes);
     }
 
     // Support for resetting final fields while deserializing
-    private static final sun.misc.Unsafe unsafe = sun.misc.Unsafe.getUnsafe();
     private static final long rtypeOffset, ptypesOffset;
     static {
         try {
-            rtypeOffset = unsafe.objectFieldOffset
+            rtypeOffset = UNSAFE.objectFieldOffset
                 (MethodType.class.getDeclaredField("rtype"));
-            ptypesOffset = unsafe.objectFieldOffset
+            ptypesOffset = UNSAFE.objectFieldOffset
                 (MethodType.class.getDeclaredField("ptypes"));
         } catch (Exception ex) {
             throw new Error(ex);
@@ -919,4 +1011,269 @@
         // Verify all operands, and make sure ptypes is unshared:
         return methodType(rtype, ptypes);
     }
+
+    /**
+     * Weak intern set based on implementation of the <tt>HashSet</tt> and
+     * <tt>WeakHashMap</tt>, with <em>weak values</em>.  Note: <tt>null</tt>
+     * values will yield <tt>NullPointerException</tt>
+     * Refer to implementation of WeakInternSet for details.
+     *
+     * @see         java.util.HashMap
+     * @see         java.util.HashSet
+     * @see         java.util.WeakHashMap
+     * @see         java.lang.ref.WeakReference
+     */
+    private static class WeakInternSet {
+        // The default initial capacity -- MUST be a power of two.
+        private static final int DEFAULT_INITIAL_CAPACITY = 16;
+
+        // The maximum capacity, used if a higher value is implicitly specified
+        // by either of the constructors with arguments.
+        // MUST be a power of two <= 1<<30.
+        private static final int MAXIMUM_CAPACITY = 1 << 30;
+
+        // The load factor used when none specified in constructor.
+        private static final float DEFAULT_LOAD_FACTOR = 0.75f;
+
+        // The table, resized as necessary. Length MUST Always be a power of two.
+        private Entry[] table;
+
+        // The number of entries contained in this set.
+        private int size;
+
+        // The next size value at which to resize (capacity * load factor).
+        private int threshold;
+
+        // The load factor for the hash table.
+        private final float loadFactor;
+
+        // Reference queue for cleared WeakEntries
+        private final ReferenceQueue<Object> queue = new ReferenceQueue<>();
+
+        private Entry[] newTable(int n) {
+            return new Entry[n];
+        }
+
+        /**
+         * Constructs a new, empty <tt>WeakInternSet</tt> with the default initial
+         * capacity (16) and load factor (0.75).
+         */
+        WeakInternSet() {
+            this.loadFactor = DEFAULT_LOAD_FACTOR;
+            threshold = DEFAULT_INITIAL_CAPACITY;
+            table = newTable(DEFAULT_INITIAL_CAPACITY);
+        }
+
+        /**
+         * Applies a supplemental hash function to a given hashCode, which
+         * defends against poor quality hash functions.  This is critical
+         * because hashing uses power-of-two length hash tables, that
+         * otherwise encounter collisions for hashCodes that do not differ
+         * in lower bits.
+         * @param h preliminary hash code value
+         * @return supplemental hash code value
+         */
+        private static int hash(int h) {
+            // This function ensures that hashCodes that differ only by
+            // constant multiples at each bit position have a bounded
+            // number of collisions (approximately 8 at default load factor).
+            h ^= (h >>> 20) ^ (h >>> 12);
+            return h ^ (h >>> 7) ^ (h >>> 4);
+        }
+
+        /**
+         * Checks for equality of non-null reference x and possibly-null y.  By
+         * default uses Object.equals.
+         * @param x first object to compare
+         * @param y second object to compare
+         * @return <tt>true</tt> if objects are equal
+         */
+        private static boolean eq(Object x, Object y) {
+            return x == y || x.equals(y);
+        }
+
+        /**
+         * Returns index for hash code h.
+         * @param h      raw hash code
+         * @param length length of table (power of 2)
+         * @return index in table
+         */
+        private static int indexFor(int h, int length) {
+            return h & (length-1);
+        }
+
+        /**
+         * Expunges stale entries from the table.
+         */
+        private void expungeStaleEntries() {
+            for (Object x; (x = queue.poll()) != null; ) {
+                synchronized (queue) {
+                    Entry entry = (Entry) x;
+                    int i = indexFor(entry.hash, table.length);
+                    Entry prev = table[i];
+                    Entry p = prev;
+                    while (p != null) {
+                        Entry next = p.next;
+                        if (p == entry) {
+                            if (prev == entry)
+                                table[i] = next;
+                            else
+                                prev.next = next;
+                            entry.next = null;
+                            size--;
+                            break;
+                        }
+                        prev = p;
+                        p = next;
+                    }
+                }
+            }
+        }
+
+        /**
+         * Returns the table after first expunging stale entries.
+         * @return an expunged hash table
+         */
+        private Entry[] getTable() {
+            expungeStaleEntries();
+            return table;
+        }
+
+        /**
+         * Returns the entry to which the specified value is mapped,
+         * or {@code null} if this set contains no entry for the value.
+         *
+         * <p>More formally, if this set contains an entry for value
+         * {@code entry} to a value {@code value} such that
+         * {@code entry.equals(value)}, then this method returns {@code entry};
+         * otherwise it returns {@code null}.
+         *
+         * @param value value to search for in set
+         * @return interned value if in set, otherwise <tt>null</tt>
+         */
+        synchronized MethodType get(MethodType value) {
+            int h = hash(value.hashCode());
+            Entry[] tab = getTable();
+            int index = indexFor(h, tab.length);
+            Entry e = tab[index];
+            MethodType g;
+            while (e != null) {
+                if (e.hash == h && eq(value, g = e.get()))
+                    return g;
+                e = e.next;
+            }
+            return null;
+        }
+
+        /**
+         * Attempts to add the specified value to the set and returns same value.
+         * If the set previously contained an entry for this value, the old
+         * value is left untouched and returned as the result.
+         *
+         * @param value value to be added
+         * @return the previous entry associated with <tt>value</tt>, or
+         *         <tt>value</tt> if there was no previous entry found
+         */
+        synchronized MethodType add(MethodType value) {
+            int h = hash(value.hashCode());
+            Entry[] tab = getTable();
+            int i = indexFor(h, tab.length);
+            MethodType g;
+            for (Entry e = tab[i]; e != null; e = e.next) {
+                if (h == e.hash && eq(value, g = e.get())) {
+                    return g;
+                }
+            }
+            Entry e = tab[i];
+            tab[i] = new Entry(value, queue, h, e);
+            if (++size >= threshold)
+                resize(tab.length * 2);
+            return value;
+        }
+
+        /**
+         * Rehashes the contents of this set into a new array with a
+         * larger capacity.  This method is called automatically when the
+         * number of keys in this set reaches its threshold.
+         *
+         * If current capacity is MAXIMUM_CAPACITY, this method does not
+         * resize the set, but sets threshold to Integer.MAX_VALUE.
+         * This has the effect of preventing future calls.
+         *
+         * @param newCapacity the new capacity, MUST be a power of two;
+         *        must be greater than current capacity unless current
+         *        capacity is MAXIMUM_CAPACITY (in which case value
+         *        is irrelevant)
+         */
+        private void resize(int newCapacity) {
+            Entry[] oldTable = getTable();
+            int oldCapacity = oldTable.length;
+            if (oldCapacity == MAXIMUM_CAPACITY) {
+                threshold = Integer.MAX_VALUE;
+                return;
+            }
+
+            Entry[] newTable = newTable(newCapacity);
+            transfer(oldTable, newTable);
+            table = newTable;
+
+            /*
+             * If ignoring null elements and processing ref queue caused massive
+             * shrinkage, then restore old table.  This should be rare, but avoids
+             * unbounded expansion of garbage-filled tables.
+             */
+            if (size >= threshold / 2) {
+                threshold = (int)(newCapacity * loadFactor);
+            } else {
+                expungeStaleEntries();
+                transfer(newTable, oldTable);
+                table = oldTable;
+            }
+        }
+
+        /**
+         * Transfers all entries from src to dest tables
+         * @param src  original table
+         * @param dest new table
+         */
+        private void transfer(Entry[] src, Entry[] dest) {
+            for (int j = 0; j < src.length; ++j) {
+                Entry e = src[j];
+                src[j] = null;
+                while (e != null) {
+                    Entry next = e.next;
+                    MethodType key = e.get();
+                    if (key == null) {
+                        e.next = null;  // Help GC
+                        size--;
+                    } else {
+                        int i = indexFor(e.hash, dest.length);
+                        e.next = dest[i];
+                        dest[i] = e;
+                    }
+                    e = next;
+                }
+            }
+        }
+
+        /**
+         * The entries in this hash table extend WeakReference, using its main ref
+         * field as the key.
+         */
+        private static class Entry extends WeakReference<MethodType> {
+            final int hash;
+            Entry next;
+
+            /**
+             * Creates new entry.
+             */
+            Entry(MethodType key,
+                  ReferenceQueue<Object> queue,
+                  int hash, Entry next) {
+                super(key, queue);
+                this.hash  = hash;
+                this.next  = next;
+            }
+        }
+    }
 }
--- a/src/share/classes/java/lang/invoke/MethodTypeForm.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/lang/invoke/MethodTypeForm.java	Fri Jun 21 19:11:42 2013 -0700
@@ -27,6 +27,7 @@
 
 import sun.invoke.util.Wrapper;
 import static java.lang.invoke.MethodHandleStatics.*;
+import static java.lang.invoke.MethodHandleNatives.Constants.*;
 
 /**
  * Shared information for a group of method types, which differ
@@ -41,31 +42,70 @@
  * No more than half of these are likely to be loaded at once.
  * @author John Rose
  */
-class MethodTypeForm {
+final class MethodTypeForm {
     final int[] argToSlotTable, slotToArgTable;
     final long argCounts;               // packed slot & value counts
     final long primCounts;              // packed prim & double counts
     final int vmslots;                  // total number of parameter slots
-    private Object vmlayout;            // vm-specific information for calls
     final MethodType erasedType;        // the canonical erasure
-
-    /*lazy*/ MethodType primsAsBoxes;   // replace prims by wrappers
-    /*lazy*/ MethodType primArgsAsBoxes; // wrap args only; make raw return
-    /*lazy*/ MethodType primsAsInts;    // replace prims by int/long
-    /*lazy*/ MethodType primsAsLongs;   // replace prims by long
-    /*lazy*/ MethodType primsAtEnd;     // reorder primitives to the end
+    final MethodType basicType;         // the canonical erasure, with primitives simplified
 
     // Cached adapter information:
-    /*lazy*/ ToGeneric   toGeneric;     // convert cs. with prims to w/o
-    /*lazy*/ FromGeneric fromGeneric;   // convert cs. w/o prims to with
-    /*lazy*/ SpreadGeneric[] spreadGeneric; // expand one argument to many
-    /*lazy*/ FilterGeneric filterGeneric; // convert argument(s) on the fly
-    /*lazy*/ MethodHandle genericInvoker; // hook for inexact invoke
+    /*lazy*/ MethodHandle genericInvoker; // JVM hook for inexact invoke
+    /*lazy*/ MethodHandle basicInvoker;   // cached instance of MH.invokeBasic
+    /*lazy*/ MethodHandle namedFunctionInvoker; // cached helper for LF.NamedFunction
+
+    // Cached lambda form information, for basic types only:
+    final LambdaForm[] lambdaForms;
+    // Indexes into lambdaForms:
+    static final int
+            LF_INVVIRTUAL     =  0,  // DMH invokeVirtual
+            LF_INVSTATIC      =  1,
+            LF_INVSPECIAL     =  2,
+            LF_NEWINVSPECIAL  =  3,
+            LF_INVINTERFACE   =  4,
+            LF_INVSTATIC_INIT =  5,  // DMH invokeStatic with <clinit> barrier
+            LF_INTERPRET      =  6,  // LF interpreter
+            LF_COUNTER        =  7,  // CMH wrapper
+            LF_REINVOKE       =  8,  // other wrapper
+            LF_EX_LINKER      =  9,  // invokeExact_MT
+            LF_EX_INVOKER     = 10,  // invokeExact MH
+            LF_GEN_LINKER     = 11,
+            LF_GEN_INVOKER    = 12,
+            LF_CS_LINKER      = 13,  // linkToCallSite_CS
+            LF_LIMIT          = 14;
 
     public MethodType erasedType() {
         return erasedType;
     }
 
+    public MethodType basicType() {
+        return basicType;
+    }
+
+    public LambdaForm cachedLambdaForm(int which) {
+        return lambdaForms[which];
+    }
+
+    public LambdaForm setCachedLambdaForm(int which, LambdaForm form) {
+        // Should we perform some sort of CAS, to avoid racy duplication?
+        return lambdaForms[which] = form;
+    }
+
+    public MethodHandle basicInvoker() {
+        assert(erasedType == basicType) : "erasedType: " + erasedType + " != basicType: " + basicType;  // primitives must be flattened also
+        MethodHandle invoker = basicInvoker;
+        if (invoker != null)  return invoker;
+        invoker = basicType.invokers().makeBasicInvoker();
+        basicInvoker = invoker;
+        return invoker;
+    }
+
+    /**
+     * Build an MTF for a given type, which must have all references erased to Object.
+     * This MTF will stand for that type and all un-erased variations.
+     * Eagerly compute some basic properties of the type, common to all variations.
+     */
     protected MethodTypeForm(MethodType erasedType) {
         this.erasedType = erasedType;
 
@@ -79,26 +119,41 @@
 
         // Walk the argument types, looking for primitives.
         int pac = 0, lac = 0, prc = 0, lrc = 0;
-        Class<?> epts[] = ptypes;
+        Class<?>[] epts = ptypes;
+        Class<?>[] bpts = epts;
         for (int i = 0; i < epts.length; i++) {
             Class<?> pt = epts[i];
             if (pt != Object.class) {
-                assert(pt.isPrimitive());
                 ++pac;
-                if (hasTwoArgSlots(pt))  ++lac;
+                Wrapper w = Wrapper.forPrimitiveType(pt);
+                if (w.isDoubleWord())  ++lac;
+                if (w.isSubwordOrInt() && pt != int.class) {
+                    if (bpts == epts)
+                        bpts = bpts.clone();
+                    bpts[i] = int.class;
+                }
             }
         }
         pslotCount += lac;                  // #slots = #args + #longs
         Class<?> rt = erasedType.returnType();
+        Class<?> bt = rt;
         if (rt != Object.class) {
             ++prc;          // even void.class counts as a prim here
-            if (hasTwoArgSlots(rt))  ++lrc;
+            Wrapper w = Wrapper.forPrimitiveType(rt);
+            if (w.isDoubleWord())  ++lrc;
+            if (w.isSubwordOrInt() && rt != int.class)
+                bt = int.class;
             // adjust #slots, #args
             if (rt == void.class)
                 rtypeCount = rslotCount = 0;
             else
                 rslotCount += lrc;
         }
+        if (epts == bpts && bt == rt) {
+            this.basicType = erasedType;
+        } else {
+            this.basicType = MethodType.makeImpl(bt, bpts, true);
+        }
         if (lac != 0) {
             int slot = ptypeCount + lac;
             slotToArgTab = new int[slot+1];
@@ -106,7 +161,8 @@
             argToSlotTab[0] = slot;  // argument "-1" is past end of slots
             for (int i = 0; i < epts.length; i++) {
                 Class<?> pt = epts[i];
-                if (hasTwoArgSlots(pt))  --slot;
+                Wrapper w = Wrapper.forBasicType(pt);
+                if (w.isDoubleWord())  --slot;
                 --slot;
                 slotToArgTab[slot] = i+1; // "+1" see argSlotToParameter note
                 argToSlotTab[1+i]  = slot;
@@ -134,164 +190,13 @@
         // send a few bits down to the JVM:
         this.vmslots = parameterSlotCount();
 
-        // short circuit some no-op canonicalizations:
-        if (!hasPrimitives()) {
-            primsAsBoxes = erasedType;
-            primArgsAsBoxes = erasedType;
-            primsAsInts  = erasedType;
-            primsAsLongs = erasedType;
-            primsAtEnd   = erasedType;
+        if (basicType == erasedType) {
+            lambdaForms = new LambdaForm[LF_LIMIT];
+        } else {
+            lambdaForms = null;  // could be basicType.form().lambdaForms;
         }
     }
 
-    /** Turn all primitive types to corresponding wrapper types.
-     */
-    public MethodType primsAsBoxes() {
-        MethodType ct = primsAsBoxes;
-        if (ct != null)  return ct;
-        MethodType t = erasedType;
-        ct = canonicalize(erasedType, WRAP, WRAP);
-        if (ct == null)  ct = t;  // no prims to box
-        return primsAsBoxes = ct;
-    }
-
-    /** Turn all primitive argument types to corresponding wrapper types.
-     *  Subword and void return types are promoted to int.
-     */
-    public MethodType primArgsAsBoxes() {
-        MethodType ct = primArgsAsBoxes;
-        if (ct != null)  return ct;
-        MethodType t = erasedType;
-        ct = canonicalize(erasedType, RAW_RETURN, WRAP);
-        if (ct == null)  ct = t;  // no prims to box
-        return primArgsAsBoxes = ct;
-    }
-
-    /** Turn all primitive types to either int or long.
-     *  Floating point return types are not changed, because
-     *  they may require special calling sequences.
-     *  A void return value is turned to int.
-     */
-    public MethodType primsAsInts() {
-        MethodType ct = primsAsInts;
-        if (ct != null)  return ct;
-        MethodType t = erasedType;
-        ct = canonicalize(t, RAW_RETURN, INTS);
-        if (ct == null)  ct = t;  // no prims to int-ify
-        return primsAsInts = ct;
-    }
-
-    /** Turn all primitive types to either int or long.
-     *  Floating point return types are not changed, because
-     *  they may require special calling sequences.
-     *  A void return value is turned to int.
-     */
-    public MethodType primsAsLongs() {
-        MethodType ct = primsAsLongs;
-        if (ct != null)  return ct;
-        MethodType t = erasedType;
-        ct = canonicalize(t, RAW_RETURN, LONGS);
-        if (ct == null)  ct = t;  // no prims to int-ify
-        return primsAsLongs = ct;
-    }
-
-    /** Stably sort parameters into 3 buckets: ref, int, long. */
-    public MethodType primsAtEnd() {
-        MethodType ct = primsAtEnd;
-        if (ct != null)  return ct;
-        MethodType t = erasedType;
-
-        int pac = primitiveParameterCount();
-        if (pac == 0)
-            return primsAtEnd = t;
-
-        int argc = parameterCount();
-        int lac = longPrimitiveParameterCount();
-        if (pac == argc && (lac == 0 || lac == argc))
-            return primsAtEnd = t;
-
-        // known to have a mix of 2 or 3 of ref, int, long
-        int[] reorder = primsAtEndOrder(t);
-        ct = reorderParameters(t, reorder, null);
-        //System.out.println("t="+t+" / reorder="+java.util.Arrays.toString(reorder)+" => "+ct);
-        return primsAtEnd = ct;
-    }
-
-    /** Compute a new ordering of parameters so that all references
-     *  are before all ints or longs, and all ints are before all longs.
-     *  For this ordering, doubles count as longs, and all other primitive
-     *  values count as ints.
-     *  As a special case, if the parameters are already in the specified
-     *  order, this method returns a null reference, rather than an array
-     *  specifying a null permutation.
-     *  <p>
-     *  For example, the type {@code (int,boolean,int,Object,String)void}
-     *  produces the order {@code {3,4,0,1,2}}, the type
-     *  {@code (long,int,String)void} produces {@code {2,1,2}}, and
-     *  the type {@code (Object,int)Object} produces {@code null}.
-     */
-    public static int[] primsAtEndOrder(MethodType mt) {
-        MethodTypeForm form = mt.form();
-        if (form.primsAtEnd == form.erasedType)
-            // quick check shows no reordering is necessary
-            return null;
-
-        int argc = form.parameterCount();
-        int[] paramOrder = new int[argc];
-
-        // 3-way bucket sort:
-        int pac = form.primitiveParameterCount();
-        int lac = form.longPrimitiveParameterCount();
-        int rfill = 0, ifill = argc - pac, lfill = argc - lac;
-
-        Class<?>[] ptypes = mt.ptypes();
-        boolean changed = false;
-        for (int i = 0; i < ptypes.length; i++) {
-            Class<?> pt = ptypes[i];
-            int ord;
-            if (!pt.isPrimitive())             ord = rfill++;
-            else if (!hasTwoArgSlots(pt))      ord = ifill++;
-            else                               ord = lfill++;
-            if (ord != i)  changed = true;
-            assert(paramOrder[ord] == 0);
-            paramOrder[ord] = i;
-        }
-        assert(rfill == argc - pac && ifill == argc - lac && lfill == argc);
-        if (!changed) {
-            form.primsAtEnd = form.erasedType;
-            return null;
-        }
-        return paramOrder;
-    }
-
-    /** Put the existing parameters of mt into a new order, given by newParamOrder.
-     *  The third argument is logically appended to mt.parameterArray,
-     *  so that elements of newParamOrder can index either pre-existing or
-     *  new parameter types.
-     */
-    public static MethodType reorderParameters(MethodType mt, int[] newParamOrder, Class<?>[] moreParams) {
-        if (newParamOrder == null)  return mt;  // no-op reordering
-        Class<?>[] ptypes = mt.ptypes();
-        Class<?>[] ntypes = new Class<?>[newParamOrder.length];
-        int maxParam = ptypes.length + (moreParams == null ? 0 : moreParams.length);
-        boolean changed = (ntypes.length != ptypes.length);
-        for (int i = 0; i < newParamOrder.length; i++) {
-            int param = newParamOrder[i];
-            if (param != i)  changed = true;
-            Class<?> nt;
-            if (param < ptypes.length)   nt = ptypes[param];
-            else if (param == maxParam)  nt = mt.returnType();
-            else                         nt = moreParams[param - ptypes.length];
-            ntypes[i] = nt;
-        }
-        if (!changed)  return mt;
-        return MethodType.makeImpl(mt.returnType(), ntypes, true);
-    }
-
-    private static boolean hasTwoArgSlots(Class<?> type) {
-        return type == long.class || type == double.class;
-    }
-
     private static long pack(int a, int b, int c, int d) {
         assert(((a|b|c|d) & ~0xFFFF) == 0);
         long hw = ((a << 16) | b), lw = ((c << 16) | d);
@@ -329,11 +234,11 @@
     public boolean hasPrimitives() {
         return primCounts != 0;
     }
-//    public boolean hasNonVoidPrimitives() {
-//        if (primCounts == 0)  return false;
-//        if (primitiveParameterCount() != 0)  return true;
-//        return (primitiveReturnCount() != 0 && returnCount() != 0);
-//    }
+    public boolean hasNonVoidPrimitives() {
+        if (primCounts == 0)  return false;
+        if (primitiveParameterCount() != 0)  return true;
+        return (primitiveReturnCount() != 0 && returnCount() != 0);
+    }
     public boolean hasLongPrimitives() {
         return (longPrimitiveParameterCount() | longPrimitiveReturnCount()) != 0;
     }
@@ -459,18 +364,6 @@
         return cs;
     }
 
-    /*non-public*/ void notifyGenericMethodType() {
-        if (genericInvoker != null)  return;
-        try {
-            // Trigger adapter creation.
-            genericInvoker = InvokeGeneric.generalInvokerOf(erasedType);
-        } catch (Exception ex) {
-            Error err = new InternalError("Exception while resolving inexact invoke");
-            err.initCause(ex);
-            throw err;
-        }
-    }
-
     @Override
     public String toString() {
         return "Form"+erasedType;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/java/lang/invoke/SimpleMethodHandle.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,70 @@
+/*
+ * 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.
+ */
+
+package java.lang.invoke;
+
+import static java.lang.invoke.LambdaForm.*;
+import static java.lang.invoke.MethodHandleNatives.Constants.*;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * A method handle whose behavior is determined only by its LambdaForm.
+ * @author jrose
+ */
+final class SimpleMethodHandle extends MethodHandle {
+    private SimpleMethodHandle(MethodType type, LambdaForm form) {
+        super(type, form);
+    }
+
+    /*non-public*/ static SimpleMethodHandle make(MethodType type, LambdaForm form) {
+        return new SimpleMethodHandle(type, form);
+    }
+
+    @Override
+    MethodHandle bindArgument(int pos, char basicType, Object value) {
+        MethodType type2 = type().dropParameterTypes(pos, pos+1);
+        LambdaForm form2 = internalForm().bind(1+pos, BoundMethodHandle.SpeciesData.EMPTY);
+        return BoundMethodHandle.bindSingle(type2, form2, basicType, value);
+    }
+
+    @Override
+    MethodHandle dropArguments(MethodType srcType, int pos, int drops) {
+        LambdaForm newForm = internalForm().addArguments(pos, srcType.parameterList().subList(pos, pos+drops));
+        return new SimpleMethodHandle(srcType, newForm);
+    }
+
+    @Override
+    MethodHandle permuteArguments(MethodType newType, int[] reorder) {
+        LambdaForm form2 = internalForm().permuteArguments(1, reorder, basicTypes(newType.parameterList()));
+        return new SimpleMethodHandle(newType, form2);
+    }
+
+    @Override
+    MethodHandle copyWith(MethodType mt, LambdaForm lf) {
+        return new SimpleMethodHandle(mt, lf);
+    }
+
+}
--- a/src/share/classes/java/lang/invoke/SpreadGeneric.java	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,682 +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.
- */
-
-package java.lang.invoke;
-
-import sun.invoke.util.ValueConversions;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import static java.lang.invoke.MethodHandleStatics.*;
-import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
-
-/**
- * Generic spread adapter.
- * Expands a final argument into multiple (zero or more) arguments, keeping the others the same.
- * @author jrose
- */
-class SpreadGeneric {
-    // type for the outgoing call
-    private final MethodType targetType;
-    // number of arguments to spread
-    private final int spreadCount;
-    // prototype adapter (clone and customize for each new target!)
-    private final Adapter adapter;
-    // entry point for adapter (Adapter mh, a...) => ...
-    private final MethodHandle entryPoint;
-
-    /** Compute and cache information common to all spreading adapters
-     *  that accept calls of the given (generic) type.
-     */
-    private SpreadGeneric(MethodType targetType, int spreadCount) {
-        assert(targetType == targetType.generic());
-        this.targetType = targetType;
-        this.spreadCount = spreadCount;
-        // the target invoker will generally need casts on reference arguments
-        MethodHandle[] ep = { null };
-        Adapter ad = findAdapter(this, ep);
-        if (ad != null) {
-            this.adapter = ad;
-            this.entryPoint = ep[0];
-            return;
-        }
-        this.adapter = buildAdapterFromBytecodes(targetType, spreadCount, ep);
-        this.entryPoint = ep[0];
-    }
-
-    static {
-        assert(MethodHandleNatives.workaroundWithoutRicochetFrames());  // this class is deprecated
-    }
-
-    /** From targetType remove the last spreadCount arguments, and instead
-     *  append a simple Object argument.
-     */
-    static MethodType preSpreadType(MethodType targetType, int spreadCount) {
-        @SuppressWarnings("unchecked")
-        ArrayList<Class<?>> params = new ArrayList(targetType.parameterList());
-        int outargs = params.size();
-        params.subList(outargs - spreadCount, outargs).clear();
-        params.add(Object.class);
-        return MethodType.methodType(targetType.returnType(), params);
-    }
-
-    MethodHandle makeInstance(MethodHandle target) {
-        MethodType type = target.type();
-        if (type != targetType) {
-            throw new UnsupportedOperationException("NYI type="+type);
-        }
-        return adapter.makeInstance(this, target);
-    }
-
-    /** Build an adapter of the given generic type, which invokes typedTarget
-     *  on the incoming arguments, after unboxing as necessary.
-     *  The return value is boxed if necessary.
-     * @param genericType  the required type of the result
-     * @param typedTarget the target
-     * @return an adapter method handle
-     */
-    public static MethodHandle make(MethodHandle target, int spreadCount) {
-        MethodType type = target.type();
-        MethodType gtype = type.generic();
-        if (type == gtype) {
-            return SpreadGeneric.of(type, spreadCount).makeInstance(target);
-        } else {
-            MethodHandle gtarget = FromGeneric.make(target);
-            assert(gtarget.type() == gtype);
-            MethodHandle gspread = SpreadGeneric.of(gtype, spreadCount).makeInstance(gtarget);
-            return ToGeneric.make(preSpreadType(type, spreadCount), gspread);
-        }
-    }
-
-    /** Return the adapter information for this type's erasure. */
-    static SpreadGeneric of(MethodType targetType, int spreadCount) {
-        if (targetType != targetType.generic())
-            throw new UnsupportedOperationException("NYI type="+targetType);
-        MethodTypeForm form = targetType.form();
-        int outcount = form.parameterCount();
-        assert(spreadCount <= outcount);
-        SpreadGeneric[] spreadGens = form.spreadGeneric;
-        if (spreadGens == null)
-            form.spreadGeneric = spreadGens = new SpreadGeneric[outcount+1];
-        SpreadGeneric spreadGen = spreadGens[spreadCount];
-        if (spreadGen == null)
-            spreadGens[spreadCount] = spreadGen = new SpreadGeneric(form.erasedType(), spreadCount);
-        return spreadGen;
-    }
-
-    String debugString() {
-        return getClass().getSimpleName()+targetType+"["+spreadCount+"]";
-    }
-
-    // This mini-api is called from an Adapter to manage the spread.
-    /** A check/coercion that happens once before any selections. */
-    protected Object check(Object av, int n) {
-        checkSpreadArgument(av, n);
-        return av;
-    }
-
-    /** The selection operator for spreading; note that it takes Object not Object[]. */
-    protected Object select(Object av, int n) {
-        return ((Object[])av)[n];
-    }
-    /*
-    protected int select_I(Object av, int n) {
-        // maybe return ((int[])select)[n]
-        throw new UnsupportedOperationException("subclass resp.");
-    }
-    protected int select_J(Object av, int n) {
-        // maybe return ((long[])select)[n]
-        throw new UnsupportedOperationException("subclass resp.");
-    }
-    // */
-
-    /* Create an adapter that handles spreading calls for the given type. */
-    static Adapter findAdapter(SpreadGeneric outer, MethodHandle[] ep) {
-        MethodType targetType = outer.targetType;
-        int spreadCount = outer.spreadCount;
-        int outargs = targetType.parameterCount();
-        int inargs = outargs - spreadCount;
-        if (inargs < 0)  return null;
-        MethodType entryType = MethodType.genericMethodType(inargs + 1); // 1 for av
-        String cname1 = "S" + outargs;
-        String[] cnames = { cname1 };
-        String iname = "invoke_S"+spreadCount;
-        // e.g., D5I2, D5, L5I2, L5; invoke_D5
-        for (String cname : cnames) {
-            Class<? extends Adapter> acls = Adapter.findSubClass(cname);
-            if (acls == null)  continue;
-            // see if it has the required invoke method
-            MethodHandle entryPoint = null;
-            try {
-                entryPoint = IMPL_LOOKUP.findSpecial(acls, iname, entryType, acls);
-            } catch (ReflectiveOperationException ex) {
-            }
-            if (entryPoint == null)  continue;
-            Constructor<? extends Adapter> ctor = null;
-            try {
-                ctor = acls.getDeclaredConstructor(SpreadGeneric.class);
-            } catch (NoSuchMethodException ex) {
-            } catch (SecurityException ex) {
-            }
-            if (ctor == null)  continue;
-            try {
-                // Produce an instance configured as a prototype.
-                Adapter ad = ctor.newInstance(outer);
-                ep[0] = entryPoint;
-                return ad;
-            } catch (IllegalArgumentException ex) {
-            } catch (InvocationTargetException wex) {
-                Throwable ex = wex.getTargetException();
-                if (ex instanceof Error)  throw (Error)ex;
-                if (ex instanceof RuntimeException)  throw (RuntimeException)ex;
-            } catch (InstantiationException ex) {
-            } catch (IllegalAccessException ex) {
-            }
-        }
-        return null;
-    }
-
-    static Adapter buildAdapterFromBytecodes(MethodType targetType,
-            int spreadCount, MethodHandle[] ep) {
-        throw new UnsupportedOperationException("NYI");
-    }
-
-    /**
-     * This adapter takes some untyped arguments, and returns an untyped result.
-     * Internally, it applies the invoker to the target, which causes the
-     * objects to be unboxed; the result is a raw type in L/I/J/F/D.
-     * This result is passed to convert, which is responsible for
-     * converting the raw result into a boxed object.
-     * The invoker is kept separate from the target because it can be
-     * generated once per type erasure family, and reused across adapters.
-     */
-    static abstract class Adapter extends BoundMethodHandle {
-        /*
-         * class X<<R,int M,int N>> extends Adapter {
-         *   (Object**N)=>R target;
-         *   static int S = N-M;
-         *   Object invoke(Object**M a, Object v) = target(a..., v[0]...v[S-1]);
-         * }
-         */
-        protected final SpreadGeneric outer;
-        protected final MethodHandle target;   // (any**N) => R
-
-        @Override
-        String debugString() {
-            return addTypeString(target, this);
-        }
-
-        static final MethodHandle NO_ENTRY = ValueConversions.identity();
-
-        protected boolean isPrototype() { return target == null; }
-        protected Adapter(SpreadGeneric outer) {
-            super(NO_ENTRY);
-            this.outer = outer;
-            this.target = null;
-            assert(isPrototype());
-        }
-
-        protected Adapter(SpreadGeneric outer, MethodHandle target) {
-            super(outer.entryPoint);
-            this.outer = outer;
-            this.target = target;
-        }
-
-        /** Make a copy of self, with new fields. */
-        protected abstract Adapter makeInstance(SpreadGeneric outer, MethodHandle target);
-        // { return new ThisType(outer, target); }
-
-        protected Object check(Object av, int n) {
-            return outer.check(av, n);
-        }
-        protected Object select(Object av, int n) {
-            return outer.select(av, n);
-        }
-
-        static private final String CLASS_PREFIX; // "java.lang.invoke.SpreadGeneric$"
-        static {
-            String aname = Adapter.class.getName();
-            String sname = Adapter.class.getSimpleName();
-            if (!aname.endsWith(sname))  throw new InternalError();
-            CLASS_PREFIX = aname.substring(0, aname.length() - sname.length());
-        }
-        /** Find a sibing class of Adapter. */
-        static Class<? extends Adapter> findSubClass(String name) {
-            String cname = Adapter.CLASS_PREFIX + name;
-            try {
-                return Class.forName(cname).asSubclass(Adapter.class);
-            } catch (ClassNotFoundException ex) {
-                return null;
-            } catch (ClassCastException ex) {
-                return null;
-            }
-        }
-    }
-
-    /* generated classes follow this pattern:
-    static class xS2 extends Adapter {
-        protected xS2(SpreadGeneric outer) { super(outer); }  // to build prototype
-        protected xS2(SpreadGeneric outer, MethodHandle t) { super(outer, t); }
-        protected xS2 makeInstance(SpreadGeneric outer, MethodHandle t) { return new xS2(outer, t); }
-        protected Object invoke_S0(Object a0, Object a1, Object av) throws Throwable { av = super.check(av,0);
-             return target.invokeExact(a0, a1)); }
-        protected Object invoke_S1(Object a0, Object av) throws Throwable { av = super.check(av,1);
-             return target.invokeExact(a0,
-                super.select(av,0)); }
-        protected Object invoke_S2(Object a0, Object av) throws Throwable { av = super.check(av,1);
-             return target.invokeExact(
-                super.select(av,0), super.select(av,1)); }
-    }
-    // */
-
-/*
-: SHELL; n=SpreadGeneric; cp -p $n.java $n.java-; sed < $n.java- > $n.java+ -e '/{{*{{/,/}}*}}/w /tmp/genclasses.java' -e '/}}*}}/q'; (cd /tmp; javac -d . genclasses.java; java -cp . genclasses) >> $n.java+; echo '}' >> $n.java+; mv $n.java+ $n.java; mv $n.java- $n.java~
-//{{{
-import java.util.*;
-class genclasses {
-    static String[][] TEMPLATES = { {
-        "@for@ N=0..10",
-        "    //@each-cat@",
-        "    static class @cat@ extends Adapter {",
-        "        protected @cat@(SpreadGeneric outer) { super(outer); }  // to build prototype",
-        "        protected @cat@(SpreadGeneric outer, MethodHandle t) { super(outer, t); }",
-        "        protected @cat@ makeInstance(SpreadGeneric outer, MethodHandle t) { return new @cat@(outer, t); }",
-        "        protected Object invoke_S0(@Tvav,@Object av) throws Throwable { av = super.check(av, 0);",
-        "            return target.invokeExact(@av@); }",
-        "        //@each-S@",
-        "        protected Object invoke_S@S@(@Tvav,@Object av) throws Throwable { av = super.check(av, @S@);",
-        "            return target.invokeExact(@av,@@sv@); }",
-        "        //@end-S@",
-        "    }",
-    } };
-    static final String NEWLINE_INDENT = "\n                ";
-    enum VAR {
-        cat, N, S, av, av_, Tvav_, sv;
-        public final String pattern = "@"+toString().replace('_','.')+"@";
-        public String binding = toString();
-        static void makeBindings(boolean topLevel, int outargs, int spread) {
-            int inargs = outargs - spread;
-            VAR.cat.binding = "S"+outargs;
-            VAR.N.binding = String.valueOf(outargs); // outgoing arg count
-            VAR.S.binding = String.valueOf(spread);  // spread count
-            String[] av = new String[inargs];
-            String[] Tvav = new String[inargs];
-            for (int i = 0; i < inargs; i++) {
-                av[i] = arg(i);
-                Tvav[i] = param("Object", av[i]);
-            }
-            VAR.av.binding = comma(av);
-            VAR.av_.binding = comma(av, ", ");
-            VAR.Tvav_.binding = comma(Tvav, ", ");
-            String[] sv = new String[spread];
-            for (int i = 0; i < spread; i++) {
-                String spc = "";
-                if (i % 4 == 0) spc = NEWLINE_INDENT;
-                sv[i] = spc+"super.select(av,"+i+")";
-            }
-            VAR.sv.binding = comma(sv);
-        }
-        static String arg(int i) { return "a"+i; }
-        static String param(String t, String a) { return t+" "+a; }
-        static String comma(String[] v) { return comma(v, ""); }
-        static String comma(String[] v, String sep) {
-            if (v.length == 0)  return "";
-            String res = v[0];
-            for (int i = 1; i < v.length; i++)  res += ", "+v[i];
-            return res + sep;
-        }
-        static String transform(String string) {
-            for (VAR var : values())
-                string = string.replaceAll(var.pattern, var.binding);
-            return string;
-        }
-    }
-    static String[] stringsIn(String[] strings, int beg, int end) {
-        return Arrays.copyOfRange(strings, beg, Math.min(end, strings.length));
-    }
-    static String[] stringsBefore(String[] strings, int pos) {
-        return stringsIn(strings, 0, pos);
-    }
-    static String[] stringsAfter(String[] strings, int pos) {
-        return stringsIn(strings, pos, strings.length);
-    }
-    static int indexAfter(String[] strings, int pos, String tag) {
-        return Math.min(indexBefore(strings, pos, tag) + 1, strings.length);
-    }
-    static int indexBefore(String[] strings, int pos, String tag) {
-        for (int i = pos, end = strings.length; ; i++) {
-            if (i == end || strings[i].endsWith(tag))  return i;
-        }
-    }
-    static int MIN_ARITY, MAX_ARITY;
-    public static void main(String... av) {
-        for (String[] template : TEMPLATES) {
-            int forLinesLimit = indexBefore(template, 0, "@each-cat@");
-            String[] forLines = stringsBefore(template, forLinesLimit);
-            template = stringsAfter(template, forLinesLimit);
-            for (String forLine : forLines)
-                expandTemplate(forLine, template);
-        }
-    }
-    static void expandTemplate(String forLine, String[] template) {
-        String[] params = forLine.split("[^0-9]+");
-        if (params[0].length() == 0)  params = stringsAfter(params, 1);
-        System.out.println("//params="+Arrays.asList(params));
-        int pcur = 0;
-        MIN_ARITY = Integer.valueOf(params[pcur++]);
-        MAX_ARITY = Integer.valueOf(params[pcur++]);
-        if (pcur != params.length)  throw new RuntimeException("bad extra param: "+forLine);
-        for (int outargs = MIN_ARITY; outargs <= MAX_ARITY; outargs++) {
-            expandTemplate(template, true, outargs, 0);
-        }
-    }
-    static void expandTemplate(String[] template, boolean topLevel, int outargs, int spread) {
-        VAR.makeBindings(topLevel, outargs, spread);
-        for (int i = 0; i < template.length; i++) {
-            String line = template[i];
-            if (line.endsWith("@each-cat@")) {
-                // ignore
-            } else if (line.endsWith("@each-S@")) {
-                int blockEnd = indexAfter(template, i, "@end-S@");
-                String[] block = stringsIn(template, i+1, blockEnd-1);
-                for (int spread1 = spread+1; spread1 <= outargs; spread1++)
-                    expandTemplate(block, false, outargs, spread1);
-                VAR.makeBindings(topLevel, outargs, spread);
-                i = blockEnd-1; continue;
-            } else {
-                System.out.println(VAR.transform(line));
-            }
-        }
-    }
-}
-//}}} */
-//params=[0, 10]
-    static class S0 extends Adapter {
-        protected S0(SpreadGeneric outer) { super(outer); }  // to build prototype
-        protected S0(SpreadGeneric outer, MethodHandle t) { super(outer, t); }
-        protected S0 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S0(outer, t); }
-        protected Object invoke_S0(Object av) throws Throwable { av = super.check(av, 0);
-            return target.invokeExact(); }
-    }
-    static class S1 extends Adapter {
-        protected S1(SpreadGeneric outer) { super(outer); }  // to build prototype
-        protected S1(SpreadGeneric outer, MethodHandle t) { super(outer, t); }
-        protected S1 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S1(outer, t); }
-        protected Object invoke_S0(Object a0, Object av) throws Throwable { av = super.check(av, 0);
-            return target.invokeExact(a0); }
-        protected Object invoke_S1(Object av) throws Throwable { av = super.check(av, 1);
-            return target.invokeExact(
-                super.select(av,0)); }
-    }
-    static class S2 extends Adapter {
-        protected S2(SpreadGeneric outer) { super(outer); }  // to build prototype
-        protected S2(SpreadGeneric outer, MethodHandle t) { super(outer, t); }
-        protected S2 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S2(outer, t); }
-        protected Object invoke_S0(Object a0, Object a1, Object av) throws Throwable { av = super.check(av, 0);
-            return target.invokeExact(a0, a1); }
-        protected Object invoke_S1(Object a0, Object av) throws Throwable { av = super.check(av, 1);
-            return target.invokeExact(a0,
-                super.select(av,0)); }
-        protected Object invoke_S2(Object av) throws Throwable { av = super.check(av, 2);
-            return target.invokeExact(
-                super.select(av,0), super.select(av,1)); }
-    }
-    static class S3 extends Adapter {
-        protected S3(SpreadGeneric outer) { super(outer); }  // to build prototype
-        protected S3(SpreadGeneric outer, MethodHandle t) { super(outer, t); }
-        protected S3 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S3(outer, t); }
-        protected Object invoke_S0(Object a0, Object a1, Object a2, Object av) throws Throwable { av = super.check(av, 0);
-            return target.invokeExact(a0, a1, a2); }
-        protected Object invoke_S1(Object a0, Object a1, Object av) throws Throwable { av = super.check(av, 1);
-            return target.invokeExact(a0, a1,
-                super.select(av,0)); }
-        protected Object invoke_S2(Object a0, Object av) throws Throwable { av = super.check(av, 2);
-            return target.invokeExact(a0,
-                super.select(av,0), super.select(av,1)); }
-        protected Object invoke_S3(Object av) throws Throwable { av = super.check(av, 3);
-            return target.invokeExact(
-                super.select(av,0), super.select(av,1), super.select(av,2)); }
-    }
-    static class S4 extends Adapter {
-        protected S4(SpreadGeneric outer) { super(outer); }  // to build prototype
-        protected S4(SpreadGeneric outer, MethodHandle t) { super(outer, t); }
-        protected S4 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S4(outer, t); }
-        protected Object invoke_S0(Object a0, Object a1, Object a2, Object a3, Object av) throws Throwable { av = super.check(av, 0);
-            return target.invokeExact(a0, a1, a2, a3); }
-        protected Object invoke_S1(Object a0, Object a1, Object a2, Object av) throws Throwable { av = super.check(av, 1);
-            return target.invokeExact(a0, a1, a2,
-                super.select(av,0)); }
-        protected Object invoke_S2(Object a0, Object a1, Object av) throws Throwable { av = super.check(av, 2);
-            return target.invokeExact(a0, a1,
-                super.select(av,0), super.select(av,1)); }
-        protected Object invoke_S3(Object a0, Object av) throws Throwable { av = super.check(av, 3);
-            return target.invokeExact(a0,
-                super.select(av,0), super.select(av,1), super.select(av,2)); }
-        protected Object invoke_S4(Object av) throws Throwable { av = super.check(av, 4);
-            return target.invokeExact(
-                super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3)); }
-    }
-    static class S5 extends Adapter {
-        protected S5(SpreadGeneric outer) { super(outer); }  // to build prototype
-        protected S5(SpreadGeneric outer, MethodHandle t) { super(outer, t); }
-        protected S5 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S5(outer, t); }
-        protected Object invoke_S0(Object a0, Object a1, Object a2, Object a3, Object a4, Object av) throws Throwable { av = super.check(av, 0);
-            return target.invokeExact(a0, a1, a2, a3, a4); }
-        protected Object invoke_S1(Object a0, Object a1, Object a2, Object a3, Object av) throws Throwable { av = super.check(av, 1);
-            return target.invokeExact(a0, a1, a2, a3,
-                super.select(av,0)); }
-        protected Object invoke_S2(Object a0, Object a1, Object a2, Object av) throws Throwable { av = super.check(av, 2);
-            return target.invokeExact(a0, a1, a2,
-                super.select(av,0), super.select(av,1)); }
-        protected Object invoke_S3(Object a0, Object a1, Object av) throws Throwable { av = super.check(av, 3);
-            return target.invokeExact(a0, a1,
-                super.select(av,0), super.select(av,1), super.select(av,2)); }
-        protected Object invoke_S4(Object a0, Object av) throws Throwable { av = super.check(av, 4);
-            return target.invokeExact(a0,
-                super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3)); }
-        protected Object invoke_S5(Object av) throws Throwable { av = super.check(av, 5);
-            return target.invokeExact(
-                super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
-                super.select(av,4)); }
-    }
-    static class S6 extends Adapter {
-        protected S6(SpreadGeneric outer) { super(outer); }  // to build prototype
-        protected S6(SpreadGeneric outer, MethodHandle t) { super(outer, t); }
-        protected S6 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S6(outer, t); }
-        protected Object invoke_S0(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object av) throws Throwable { av = super.check(av, 0);
-            return target.invokeExact(a0, a1, a2, a3, a4, a5); }
-        protected Object invoke_S1(Object a0, Object a1, Object a2, Object a3, Object a4, Object av) throws Throwable { av = super.check(av, 1);
-            return target.invokeExact(a0, a1, a2, a3, a4,
-                super.select(av,0)); }
-        protected Object invoke_S2(Object a0, Object a1, Object a2, Object a3, Object av) throws Throwable { av = super.check(av, 2);
-            return target.invokeExact(a0, a1, a2, a3,
-                super.select(av,0), super.select(av,1)); }
-        protected Object invoke_S3(Object a0, Object a1, Object a2, Object av) throws Throwable { av = super.check(av, 3);
-            return target.invokeExact(a0, a1, a2,
-                super.select(av,0), super.select(av,1), super.select(av,2)); }
-        protected Object invoke_S4(Object a0, Object a1, Object av) throws Throwable { av = super.check(av, 4);
-            return target.invokeExact(a0, a1,
-                super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3)); }
-        protected Object invoke_S5(Object a0, Object av) throws Throwable { av = super.check(av, 5);
-            return target.invokeExact(a0,
-                super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
-                super.select(av,4)); }
-        protected Object invoke_S6(Object av) throws Throwable { av = super.check(av, 6);
-            return target.invokeExact(
-                super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
-                super.select(av,4), super.select(av,5)); }
-    }
-    static class S7 extends Adapter {
-        protected S7(SpreadGeneric outer) { super(outer); }  // to build prototype
-        protected S7(SpreadGeneric outer, MethodHandle t) { super(outer, t); }
-        protected S7 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S7(outer, t); }
-        protected Object invoke_S0(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object av) throws Throwable { av = super.check(av, 0);
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6); }
-        protected Object invoke_S1(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object av) throws Throwable { av = super.check(av, 1);
-            return target.invokeExact(a0, a1, a2, a3, a4, a5,
-                super.select(av,0)); }
-        protected Object invoke_S2(Object a0, Object a1, Object a2, Object a3, Object a4, Object av) throws Throwable { av = super.check(av, 2);
-            return target.invokeExact(a0, a1, a2, a3, a4,
-                super.select(av,0), super.select(av,1)); }
-        protected Object invoke_S3(Object a0, Object a1, Object a2, Object a3, Object av) throws Throwable { av = super.check(av, 3);
-            return target.invokeExact(a0, a1, a2, a3,
-                super.select(av,0), super.select(av,1), super.select(av,2)); }
-        protected Object invoke_S4(Object a0, Object a1, Object a2, Object av) throws Throwable { av = super.check(av, 4);
-            return target.invokeExact(a0, a1, a2,
-                super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3)); }
-        protected Object invoke_S5(Object a0, Object a1, Object av) throws Throwable { av = super.check(av, 5);
-            return target.invokeExact(a0, a1,
-                super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
-                super.select(av,4)); }
-        protected Object invoke_S6(Object a0, Object av) throws Throwable { av = super.check(av, 6);
-            return target.invokeExact(a0,
-                super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
-                super.select(av,4), super.select(av,5)); }
-        protected Object invoke_S7(Object av) throws Throwable { av = super.check(av, 7);
-            return target.invokeExact(
-                super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
-                super.select(av,4), super.select(av,5), super.select(av,6)); }
-    }
-    static class S8 extends Adapter {
-        protected S8(SpreadGeneric outer) { super(outer); }  // to build prototype
-        protected S8(SpreadGeneric outer, MethodHandle t) { super(outer, t); }
-        protected S8 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S8(outer, t); }
-        protected Object invoke_S0(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object av) throws Throwable { av = super.check(av, 0);
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7); }
-        protected Object invoke_S1(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object av) throws Throwable { av = super.check(av, 1);
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6,
-                super.select(av,0)); }
-        protected Object invoke_S2(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object av) throws Throwable { av = super.check(av, 2);
-            return target.invokeExact(a0, a1, a2, a3, a4, a5,
-                super.select(av,0), super.select(av,1)); }
-        protected Object invoke_S3(Object a0, Object a1, Object a2, Object a3, Object a4, Object av) throws Throwable { av = super.check(av, 3);
-            return target.invokeExact(a0, a1, a2, a3, a4,
-                super.select(av,0), super.select(av,1), super.select(av,2)); }
-        protected Object invoke_S4(Object a0, Object a1, Object a2, Object a3, Object av) throws Throwable { av = super.check(av, 4);
-            return target.invokeExact(a0, a1, a2, a3,
-                super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3)); }
-        protected Object invoke_S5(Object a0, Object a1, Object a2, Object av) throws Throwable { av = super.check(av, 5);
-            return target.invokeExact(a0, a1, a2,
-                super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
-                super.select(av,4)); }
-        protected Object invoke_S6(Object a0, Object a1, Object av) throws Throwable { av = super.check(av, 6);
-            return target.invokeExact(a0, a1,
-                super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
-                super.select(av,4), super.select(av,5)); }
-        protected Object invoke_S7(Object a0, Object av) throws Throwable { av = super.check(av, 7);
-            return target.invokeExact(a0,
-                super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
-                super.select(av,4), super.select(av,5), super.select(av,6)); }
-        protected Object invoke_S8(Object av) throws Throwable { av = super.check(av, 8);
-            return target.invokeExact(
-                super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
-                super.select(av,4), super.select(av,5), super.select(av,6), super.select(av,7)); }
-    }
-    static class S9 extends Adapter {
-        protected S9(SpreadGeneric outer) { super(outer); }  // to build prototype
-        protected S9(SpreadGeneric outer, MethodHandle t) { super(outer, t); }
-        protected S9 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S9(outer, t); }
-        protected Object invoke_S0(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object av) throws Throwable { av = super.check(av, 0);
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8); }
-        protected Object invoke_S1(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object av) throws Throwable { av = super.check(av, 1);
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7,
-                super.select(av,0)); }
-        protected Object invoke_S2(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object av) throws Throwable { av = super.check(av, 2);
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6,
-                super.select(av,0), super.select(av,1)); }
-        protected Object invoke_S3(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object av) throws Throwable { av = super.check(av, 3);
-            return target.invokeExact(a0, a1, a2, a3, a4, a5,
-                super.select(av,0), super.select(av,1), super.select(av,2)); }
-        protected Object invoke_S4(Object a0, Object a1, Object a2, Object a3, Object a4, Object av) throws Throwable { av = super.check(av, 4);
-            return target.invokeExact(a0, a1, a2, a3, a4,
-                super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3)); }
-        protected Object invoke_S5(Object a0, Object a1, Object a2, Object a3, Object av) throws Throwable { av = super.check(av, 5);
-            return target.invokeExact(a0, a1, a2, a3,
-                super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
-                super.select(av,4)); }
-        protected Object invoke_S6(Object a0, Object a1, Object a2, Object av) throws Throwable { av = super.check(av, 6);
-            return target.invokeExact(a0, a1, a2,
-                super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
-                super.select(av,4), super.select(av,5)); }
-        protected Object invoke_S7(Object a0, Object a1, Object av) throws Throwable { av = super.check(av, 7);
-            return target.invokeExact(a0, a1,
-                super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
-                super.select(av,4), super.select(av,5), super.select(av,6)); }
-        protected Object invoke_S8(Object a0, Object av) throws Throwable { av = super.check(av, 8);
-            return target.invokeExact(a0,
-                super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
-                super.select(av,4), super.select(av,5), super.select(av,6), super.select(av,7)); }
-        protected Object invoke_S9(Object av) throws Throwable { av = super.check(av, 9);
-            return target.invokeExact(
-                super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
-                super.select(av,4), super.select(av,5), super.select(av,6), super.select(av,7),
-                super.select(av,8)); }
-    }
-    static class S10 extends Adapter {
-        protected S10(SpreadGeneric outer) { super(outer); }  // to build prototype
-        protected S10(SpreadGeneric outer, MethodHandle t) { super(outer, t); }
-        protected S10 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S10(outer, t); }
-        protected Object invoke_S0(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9, Object av) throws Throwable { av = super.check(av, 0);
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
-        protected Object invoke_S1(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object av) throws Throwable { av = super.check(av, 1);
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8,
-                super.select(av,0)); }
-        protected Object invoke_S2(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object av) throws Throwable { av = super.check(av, 2);
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7,
-                super.select(av,0), super.select(av,1)); }
-        protected Object invoke_S3(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object av) throws Throwable { av = super.check(av, 3);
-            return target.invokeExact(a0, a1, a2, a3, a4, a5, a6,
-                super.select(av,0), super.select(av,1), super.select(av,2)); }
-        protected Object invoke_S4(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object av) throws Throwable { av = super.check(av, 4);
-            return target.invokeExact(a0, a1, a2, a3, a4, a5,
-                super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3)); }
-        protected Object invoke_S5(Object a0, Object a1, Object a2, Object a3, Object a4, Object av) throws Throwable { av = super.check(av, 5);
-            return target.invokeExact(a0, a1, a2, a3, a4,
-                super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
-                super.select(av,4)); }
-        protected Object invoke_S6(Object a0, Object a1, Object a2, Object a3, Object av) throws Throwable { av = super.check(av, 6);
-            return target.invokeExact(a0, a1, a2, a3,
-                super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
-                super.select(av,4), super.select(av,5)); }
-        protected Object invoke_S7(Object a0, Object a1, Object a2, Object av) throws Throwable { av = super.check(av, 7);
-            return target.invokeExact(a0, a1, a2,
-                super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
-                super.select(av,4), super.select(av,5), super.select(av,6)); }
-        protected Object invoke_S8(Object a0, Object a1, Object av) throws Throwable { av = super.check(av, 8);
-            return target.invokeExact(a0, a1,
-                super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
-                super.select(av,4), super.select(av,5), super.select(av,6), super.select(av,7)); }
-        protected Object invoke_S9(Object a0, Object av) throws Throwable { av = super.check(av, 9);
-            return target.invokeExact(a0,
-                super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
-                super.select(av,4), super.select(av,5), super.select(av,6), super.select(av,7),
-                super.select(av,8)); }
-        protected Object invoke_S10(Object av) throws Throwable { av = super.check(av, 10);
-            return target.invokeExact(
-                super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
-                super.select(av,4), super.select(av,5), super.select(av,6), super.select(av,7),
-                super.select(av,8), super.select(av,9)); }
-    }
-}
--- a/src/share/classes/java/lang/invoke/ToGeneric.java	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1066 +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.
- */
-
-package java.lang.invoke;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import sun.invoke.util.ValueConversions;
-import sun.invoke.util.Wrapper;
-import static java.lang.invoke.MethodHandleStatics.*;
-import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
-
-/**
- * Adapters which mediate between incoming calls which are not generic
- * and outgoing calls which are.  Any call can be represented generically
- * boxing up its arguments, and (on return) unboxing the return value.
- * <p>
- * A call is "generic" (in MethodHandle terms) if its MethodType features
- * only Object arguments.  A non-generic call therefore features
- * primitives and/or reference types other than Object.
- * An adapter has types for its incoming and outgoing calls.
- * The incoming call type is simply determined by the adapter's type
- * (the MethodType it presents to callers).  The outgoing call type
- * is determined by the adapter's target (a MethodHandle that the adapter
- * either binds internally or else takes as a leading argument).
- * (To stretch the term, adapter-like method handles may have multiple
- * targets or be polymorphic across multiple call types.)
- * @author jrose
- */
-class ToGeneric {
-    // type for the incoming call (may be erased)
-    private final MethodType entryType;
-    // incoming type with primitives moved to the end and turned to int/long
-    private final MethodType rawEntryType;
-    // adapter for the erased type
-    private final Adapter adapter;
-    // entry point for adapter (Adapter mh, a...) => ...
-    private final MethodHandle entryPoint;
-    // permutation of arguments for primsAtEndType
-    private final int[] primsAtEndOrder;
-    // optional final argument list conversions (at least, invokes the target)
-    private final MethodHandle invoker;
-    // conversion which unboxes a primitive return value
-    private final MethodHandle returnConversion;
-
-    /** Compute and cache information common to all generifying (boxing) adapters
-     *  that implement members of the erasure-family of the given erased type.
-     */
-    private ToGeneric(MethodType entryType) {
-        assert(entryType.erase() == entryType); // for now
-        // incoming call will first "forget" all reference types except Object
-        this.entryType = entryType;
-        MethodHandle invoker0 = entryType.generic().invokers().exactInvoker();
-        MethodType rawEntryTypeInit;
-        Adapter ad = findAdapter(rawEntryTypeInit = entryType);
-        if (ad != null) {
-            // Immediate hit to exactly the adapter we want,
-            // with no monkeying around with primitive types.
-            this.returnConversion = computeReturnConversion(entryType, rawEntryTypeInit, false);
-            this.rawEntryType = rawEntryTypeInit;
-            this.adapter = ad;
-            this.entryPoint = ad.prototypeEntryPoint();
-            this.primsAtEndOrder = null;
-            this.invoker = invoker0;
-            return;
-        }
-
-        // next, it will reorder primitives after references
-        MethodType primsAtEnd = entryType.form().primsAtEnd();
-        // at the same time, it will "forget" all primitive types except int/long
-        this.primsAtEndOrder = MethodTypeForm.primsAtEndOrder(entryType);
-        if (primsAtEndOrder != null) {
-            // reordering is required; build on top of a simpler ToGeneric
-            ToGeneric va2 = ToGeneric.of(primsAtEnd);
-            this.adapter = va2.adapter;
-            if (true) throw new UnsupportedOperationException("NYI: primitive parameters must follow references; entryType = "+entryType);
-            this.entryPoint = MethodHandleImpl.permuteArguments(
-                    va2.entryPoint, primsAtEnd, entryType, primsAtEndOrder);
-            // example: for entryType of (int,Object,Object), the reordered
-            // type is (Object,Object,int) and the order is {1,2,0},
-            // and putPAE is (mh,int0,obj1,obj2) => mh.invokeExact(obj1,obj2,int0)
-            return;
-        }
-
-        // after any needed argument reordering, it will reinterpret
-        // primitive arguments according to their "raw" types int/long
-        MethodType intsAtEnd = primsAtEnd.form().primsAsInts();
-        ad = findAdapter(rawEntryTypeInit = intsAtEnd);
-        MethodHandle rawEntryPoint;
-        if (ad != null) {
-            rawEntryPoint = ad.prototypeEntryPoint();
-        } else {
-            // Perhaps the adapter is available only for longs.
-            // If so, we can use it, but there will have to be a little
-            // more stack motion on each call.
-            MethodType longsAtEnd = primsAtEnd.form().primsAsLongs();
-            ad = findAdapter(rawEntryTypeInit = longsAtEnd);
-            if (ad != null) {
-                MethodType eptWithLongs = longsAtEnd.insertParameterTypes(0, ad.getClass());
-                MethodType eptWithInts  =  intsAtEnd.insertParameterTypes(0, ad.getClass());
-                rawEntryPoint = ad.prototypeEntryPoint();
-                MethodType midType = eptWithLongs;  // will change longs to ints
-                for (int i = 0, nargs = midType.parameterCount(); i < nargs; i++) {
-                    if (midType.parameterType(i) != eptWithInts.parameterType(i)) {
-                        assert(midType.parameterType(i) == long.class);
-                        assert(eptWithInts.parameterType(i) == int.class);
-                        MethodType nextType = midType.changeParameterType(i, int.class);
-                        rawEntryPoint = MethodHandleImpl.convertArguments(
-                                rawEntryPoint, nextType, midType, 0);
-                        midType = nextType;
-                    }
-                }
-                assert(midType == eptWithInts);
-            } else {
-                // If there is no statically compiled adapter,
-                // build one by means of dynamic bytecode generation.
-                ad = buildAdapterFromBytecodes(rawEntryTypeInit = intsAtEnd);
-                rawEntryPoint = ad.prototypeEntryPoint();
-            }
-        }
-        MethodType tepType = entryType.insertParameterTypes(0, ad.getClass());
-        this.entryPoint =
-            AdapterMethodHandle.makeRetypeRaw(tepType, rawEntryPoint);
-        if (this.entryPoint == null)
-            throw new UnsupportedOperationException("cannot retype to "+entryType
-                    +" from "+rawEntryPoint.type().dropParameterTypes(0, 1));
-        this.returnConversion = computeReturnConversion(entryType, rawEntryTypeInit, false);
-        this.rawEntryType = rawEntryTypeInit;
-        this.adapter = ad;
-        this.invoker = makeRawArgumentFilter(invoker0, rawEntryTypeInit, entryType);
-    }
-
-    static {
-        assert(MethodHandleNatives.workaroundWithoutRicochetFrames());  // this class is deprecated
-    }
-
-    /** A generic argument list will be created by a call of type 'raw'.
-     *  The values need to be reboxed for to match 'cooked'.
-     *  Do this on the fly.
-     */
-    // TO DO: Use a generic argument converter in a different file
-    static MethodHandle makeRawArgumentFilter(MethodHandle invoker,
-            MethodType raw, MethodType cooked) {
-        MethodHandle filteredInvoker = null;
-        for (int i = 0, nargs = raw.parameterCount(); i < nargs; i++) {
-            Class<?> src = raw.parameterType(i);
-            Class<?> dst = cooked.parameterType(i);
-            if (src == dst)  continue;
-            assert(src.isPrimitive() && dst.isPrimitive());
-            if (filteredInvoker == null) {
-                filteredInvoker =
-                        AdapterMethodHandle.makeCheckCast(
-                            invoker.type().generic(), invoker, 0, MethodHandle.class);
-                if (filteredInvoker == null)  throw new UnsupportedOperationException("NYI");
-            }
-            MethodHandle reboxer = ValueConversions.rebox(dst);
-            filteredInvoker = FilterGeneric.makeArgumentFilter(1+i, reboxer, filteredInvoker);
-            if (filteredInvoker == null)  throw new InternalError();
-        }
-        if (filteredInvoker == null)  return invoker;
-        return AdapterMethodHandle.makeRetypeOnly(invoker.type(), filteredInvoker);
-    }
-
-    /**
-     * Caller will be expecting a result from a call to {@code type},
-     * while the internal adapter entry point is rawEntryType.
-     * Also, the internal target method will be returning a boxed value,
-     * as an untyped object.
-     * <p>
-     * Produce a value converter which will be typed to convert from
-     * {@code Object} to the return value of {@code rawEntryType}, and will
-     * in fact ensure that the value is compatible with the return type of
-     * {@code type}.
-     */
-    private static MethodHandle computeReturnConversion(
-            MethodType type, MethodType rawEntryType, boolean mustCast) {
-        Class<?> tret = type.returnType();
-        Class<?> rret = rawEntryType.returnType();
-        if (mustCast || !tret.isPrimitive()) {
-            assert(!tret.isPrimitive());
-            assert(!rret.isPrimitive());
-            if (rret == Object.class && !mustCast)
-                return null;
-            return ValueConversions.cast(tret);
-        } else if (tret == rret) {
-            return ValueConversions.unbox(tret);
-        } else {
-            assert(rret.isPrimitive());
-            assert(tret == double.class ? rret == long.class : rret == int.class);
-            return ValueConversions.unboxRaw(tret);
-        }
-    }
-
-    Adapter makeInstance(MethodType type, MethodHandle genericTarget) {
-        genericTarget.getClass();  // check for NPE
-        MethodHandle convert = returnConversion;
-        if (primsAtEndOrder != null)
-            // reorder arguments passed to genericTarget, if primsAtEndOrder
-            throw new UnsupportedOperationException("NYI");
-        if (type == entryType) {
-            if (convert == null)  convert = ValueConversions.identity();
-            return adapter.makeInstance(entryPoint, invoker, convert, genericTarget);
-        }
-        // my erased-type is not exactly the same as the desired type
-        assert(type.erase() == entryType);  // else we are busted
-        if (convert == null)
-            convert = computeReturnConversion(type, rawEntryType, true);
-        // retype erased reference arguments (the cast makes it safe to do this)
-        MethodType tepType = type.insertParameterTypes(0, adapter.getClass());
-        MethodHandle typedEntryPoint =
-            AdapterMethodHandle.makeRetypeRaw(tepType, entryPoint);
-        return adapter.makeInstance(typedEntryPoint, invoker, convert, genericTarget);
-    }
-
-    /** Build an adapter of the given type, which invokes genericTarget
-     *  on the incoming arguments, after boxing as necessary.
-     *  The return value is unboxed if necessary.
-     * @param type  the required type of the
-     * @param genericTarget the target, which must accept and return only Object values
-     * @return an adapter method handle
-     */
-    public static MethodHandle make(MethodType type, MethodHandle genericTarget) {
-        MethodType gtype = genericTarget.type();
-        if (type.generic() != gtype)
-            throw newIllegalArgumentException("type must be generic");
-        if (type == gtype)  return genericTarget;
-        return ToGeneric.of(type).makeInstance(type, genericTarget);
-    }
-
-    /** Return the adapter information for this type's erasure. */
-    static ToGeneric of(MethodType type) {
-        MethodTypeForm form = type.form();
-        ToGeneric toGen = form.toGeneric;
-        if (toGen == null)
-            form.toGeneric = toGen = new ToGeneric(form.erasedType());
-        return toGen;
-    }
-
-    String debugString() {
-        return "ToGeneric"+entryType
-                +(primsAtEndOrder!=null?"[reorder]":"");
-    }
-
-    /* Create an adapter for the given incoming call type. */
-    static Adapter findAdapter(MethodType entryPointType) {
-        MethodTypeForm form = entryPointType.form();
-        Class<?> rtype = entryPointType.returnType();
-        int argc = form.parameterCount();
-        int lac = form.longPrimitiveParameterCount();
-        int iac = form.primitiveParameterCount() - lac;
-        String intsAndLongs = (iac > 0 ? "I"+iac : "")+(lac > 0 ? "J"+lac : "");
-        String rawReturn = String.valueOf(Wrapper.forPrimitiveType(rtype).basicTypeChar());
-        String iname0 = "invoke_"+rawReturn;
-        String iname1 = "invoke";
-        String[] inames = { iname0, iname1 };
-        String cname0 = rawReturn + argc;
-        String cname1 = "A"       + argc;
-        String[] cnames = { cname1, cname1+intsAndLongs, cname0, cname0+intsAndLongs };
-        // e.g., D5I2, D5, L5I2, L5
-        for (String cname : cnames) {
-            Class<? extends Adapter> acls = Adapter.findSubClass(cname);
-            if (acls == null)  continue;
-            // see if it has the required invoke method
-            for (String iname : inames) {
-                MethodHandle entryPoint = null;
-                try {
-                    entryPoint = IMPL_LOOKUP.
-                                    findSpecial(acls, iname, entryPointType, acls);
-                } catch (ReflectiveOperationException ex) {
-                }
-                if (entryPoint == null)  continue;
-                Constructor<? extends Adapter> ctor = null;
-                try {
-                    // Prototype builder:
-                    ctor = acls.getDeclaredConstructor(MethodHandle.class);
-                } catch (NoSuchMethodException ex) {
-                } catch (SecurityException ex) {
-                }
-                if (ctor == null)  continue;
-                try {
-                    return ctor.newInstance(entryPoint);
-                } catch (IllegalArgumentException ex) {
-                } catch (InvocationTargetException wex) {
-                    Throwable ex = wex.getTargetException();
-                    if (ex instanceof Error)  throw (Error)ex;
-                    if (ex instanceof RuntimeException)  throw (RuntimeException)ex;
-                } catch (InstantiationException ex) {
-                } catch (IllegalAccessException ex) {
-                }
-            }
-        }
-        return null;
-    }
-
-    static Adapter buildAdapterFromBytecodes(MethodType entryPointType) {
-        throw new UnsupportedOperationException("NYI: "+entryPointType);
-    }
-
-    /**
-     * The invoke method takes some particular but unconstrained spread
-     * of raw argument types, and returns a raw return type (in L/I/J/F/D).
-     * Internally, it converts the incoming arguments uniformly into objects.
-     * This series of objects is then passed to the {@code target} method,
-     * which returns a result object.  This result is finally converted,
-     * via another method handle {@code convert}, which is responsible for
-     * converting the object result into the raw return value.
-     */
-    static abstract class Adapter extends BoundMethodHandle {
-        /*
-         * class X<<R,A...>> extends Adapter {
-         *   Object...=>Object target;
-         *   Object=>R convert;
-         *   R invoke(A... a...) = convert(invoker(target, a...)))
-         * }
-         */
-        protected final MethodHandle invoker;  // (MH, Object...) -> Object
-        protected final MethodHandle target;   // Object... -> Object
-        protected final MethodHandle convert;  // Object -> R
-
-        @Override
-        String debugString() {
-            return target == null ? "prototype:"+convert : addTypeString(target, this);
-        }
-
-        protected boolean isPrototype() { return target == null; }
-        /* Prototype constructor. */
-        protected Adapter(MethodHandle entryPoint) {
-            super(entryPoint);
-            this.invoker = null;
-            this.convert = entryPoint;
-            this.target = null;
-            assert(isPrototype());
-        }
-        protected MethodHandle prototypeEntryPoint() {
-            if (!isPrototype())  throw new InternalError();
-            return convert;
-        }
-
-        protected Adapter(MethodHandle entryPoint, MethodHandle invoker, MethodHandle convert, MethodHandle target) {
-            super(entryPoint);
-            this.invoker = invoker;
-            this.convert = convert;
-            this.target = target;
-        }
-
-        /** Make a copy of self, with new fields. */
-        protected abstract Adapter makeInstance(MethodHandle entryPoint,
-                MethodHandle invoker, MethodHandle convert, MethodHandle target);
-        // { return new ThisType(entryPoint, convert, target); }
-
-        // Code to run when the arguments (<= 4) have all been boxed.
-        protected Object target()               throws Throwable { return invoker.invokeExact(target); }
-        protected Object target(Object a0)      throws Throwable { return invoker.invokeExact(target, a0); }
-        protected Object target(Object a0, Object a1)
-                                                throws Throwable { return invoker.invokeExact(target, a0, a1); }
-        protected Object target(Object a0, Object a1, Object a2)
-                                                throws Throwable { return invoker.invokeExact(target, a0, a1, a2); }
-        protected Object target(Object a0, Object a1, Object a2, Object a3)
-                                                throws Throwable { return invoker.invokeExact(target, a0, a1, a2, a3); }
-        /*
-        protected Object target_0(Object... av) throws Throwable { return invoker.invokeExact(target, av); }
-        protected Object target_1(Object a0, Object... av)
-                                                throws Throwable { return invoker.invokeExact(target, a0, (Object)av); }
-        protected Object target_2(Object a0, Object a1, Object... av)
-                                                throws Throwable { return invoker.invokeExact(target, a0, a1, (Object)av); }
-        protected Object target_3(Object a0, Object a1, Object a2, Object... av)
-                                                throws Throwable { return invoker.invokeExact(target, a0, a1, a2, (Object)av); }
-        protected Object target_4(Object a0, Object a1, Object a2, Object a3, Object... av)
-                                                throws Throwable { return invoker.invokeExact(target, a0, a1, a2, a3, (Object)av); }
-        // */
-        // (For more than 4 arguments, generate the code in the adapter itself.)
-
-        // Code to run when the generic target has finished and produced a value.
-        protected Object return_L(Object res) throws Throwable { return (Object)convert.invokeExact(res); }
-        protected int    return_I(Object res) throws Throwable { return (int)   convert.invokeExact(res); }
-        protected long   return_J(Object res) throws Throwable { return (long)  convert.invokeExact(res); }
-        protected float  return_F(Object res) throws Throwable { return (float) convert.invokeExact(res); }
-        protected double return_D(Object res) throws Throwable { return (double)convert.invokeExact(res); }
-
-        static private final String CLASS_PREFIX; // "java.lang.invoke.ToGeneric$"
-        static {
-            String aname = Adapter.class.getName();
-            String sname = Adapter.class.getSimpleName();
-            if (!aname.endsWith(sname))  throw new InternalError();
-            CLASS_PREFIX = aname.substring(0, aname.length() - sname.length());
-        }
-        /** Find a sibing class of Adapter. */
-        static Class<? extends Adapter> findSubClass(String name) {
-            String cname = Adapter.CLASS_PREFIX + name;
-            try {
-                return Class.forName(cname).asSubclass(Adapter.class);
-            } catch (ClassNotFoundException ex) {
-                return null;
-            } catch (ClassCastException ex) {
-                return null;
-            }
-        }
-    }
-
-    /* generated classes follow this pattern:
-    static class A1 extends Adapter {
-        protected A1(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
-        protected A1(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); }
-        protected A1 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A1(e, i, c, t); }
-        protected Object target(Object a0)   throws Throwable { return invoker.invokeExact(target, a0); }
-        protected Object targetA1(Object a0) throws Throwable { return target(a0); }
-        protected Object targetA1(int    a0) throws Throwable { return target(a0); }
-        protected Object targetA1(long   a0) throws Throwable { return target(a0); }
-        protected Object invoke_L(Object a0) throws Throwable { return return_L(targetA1(a0)); }
-        protected int    invoke_I(Object a0) throws Throwable { return return_I(targetA1(a0)); }
-        protected long   invoke_J(Object a0) throws Throwable { return return_J(targetA1(a0)); }
-        protected float  invoke_F(Object a0) throws Throwable { return return_F(targetA1(a0)); }
-        protected double invoke_D(Object a0) throws Throwable { return return_D(targetA1(a0)); }
-        protected Object invoke_L(int    a0) throws Throwable { return return_L(targetA1(a0)); }
-        protected int    invoke_I(int    a0) throws Throwable { return return_I(targetA1(a0)); }
-        protected long   invoke_J(int    a0) throws Throwable { return return_J(targetA1(a0)); }
-        protected float  invoke_F(int    a0) throws Throwable { return return_F(targetA1(a0)); }
-        protected double invoke_D(int    a0) throws Throwable { return return_D(targetA1(a0)); }
-        protected Object invoke_L(long   a0) throws Throwable { return return_L(targetA1(a0)); }
-        protected int    invoke_I(long   a0) throws Throwable { return return_I(targetA1(a0)); }
-        protected long   invoke_J(long   a0) throws Throwable { return return_J(targetA1(a0)); }
-        protected float  invoke_F(long   a0) throws Throwable { return return_F(targetA1(a0)); }
-        protected double invoke_D(long   a0) throws Throwable { return return_D(targetA1(a0)); }
-    }
-    // */
-
-/*
-: SHELL; n=ToGeneric; cp -p $n.java $n.java-; sed < $n.java- > $n.java+ -e '/{{*{{/,/}}*}}/w /tmp/genclasses.java' -e '/}}*}}/q'; (cd /tmp; javac -d . genclasses.java; java -cp . genclasses) >> $n.java+; echo '}' >> $n.java+; mv $n.java+ $n.java; mv $n.java- $n.java~
-//{{{
-import java.util.*;
-class genclasses {
-    static String[] TYPES = { "Object", "int   ", "long  ", "float ", "double" };
-    static String[] TCHARS = { "L",     "I",      "J",      "F",      "D",     "A" };
-    static String[][] TEMPLATES = { {
-        "@for@ arity=0..3   rcat<=4 nrefs<=99 nints<=99 nlongs<=99",
-        "@for@ arity=4..4   rcat<=4 nrefs<=99 nints<=99 nlongs<=99",
-        "@for@ arity=5..5   rcat<=2 nrefs<=99 nints<=99 nlongs<=99",
-        "@for@ arity=6..10  rcat<=2 nrefs<=99 nints=0   nlongs<=99",
-        "    //@each-cat@",
-        "    static class @cat@ extends Adapter {",
-        "        protected @cat@(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype",
-        "        protected @cat@(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); }",
-        "        protected @cat@ makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new @cat@(e, i, c, t); }",
-        "        protected Object target(@Ovav@)   throws Throwable { return invoker.invokeExact(target@comma@@av@); }",
-        "        //@each-Tv@",
-        "        protected Object target@cat@(@Tvav@) throws Throwable { return target(@av@); }",
-        "        //@end-Tv@",
-        "        //@each-Tv@",
-        "        //@each-R@",
-        "        protected @R@ invoke_@Rc@(@Tvav@) throws Throwable { return return_@Rc@(target@cat@(@av@)); }",
-        "        //@end-R@",
-        "        //@end-Tv@",
-        "    }",
-    } };
-    enum VAR {
-        cat, R, Rc, Tv, av, comma, Tvav, Ovav;
-        public final String pattern = "@"+toString().replace('_','.')+"@";
-        public String binding;
-        static void makeBindings(boolean topLevel, int rcat, int nrefs, int nints, int nlongs) {
-            int nargs = nrefs + nints + nlongs;
-            if (topLevel)
-                VAR.cat.binding = catstr(ALL_RETURN_TYPES ? TYPES.length : rcat, nrefs, nints, nlongs);
-            VAR.R.binding = TYPES[rcat];
-            VAR.Rc.binding = TCHARS[rcat];
-            String[] Tv = new String[nargs];
-            String[] av = new String[nargs];
-            String[] Tvav = new String[nargs];
-            String[] Ovav = new String[nargs];
-            for (int i = 0; i < nargs; i++) {
-                int tcat = (i < nrefs) ? 0 : (i < nrefs + nints) ? 1 : 2;
-                Tv[i] = TYPES[tcat];
-                av[i] = arg(i);
-                Tvav[i] = param(Tv[i], av[i]);
-                Ovav[i] = param("Object", av[i]);
-            }
-            VAR.Tv.binding = comma(Tv);
-            VAR.av.binding = comma(av);
-            VAR.comma.binding = (av.length == 0 ? "" : ", ");
-            VAR.Tvav.binding = comma(Tvav);
-            VAR.Ovav.binding = comma(Ovav);
-        }
-        static String arg(int i) { return "a"+i; }
-        static String param(String t, String a) { return t+" "+a; }
-        static String comma(String[] v) { return comma("", v); }
-        static String comma(String sep, String[] v) {
-            if (v.length == 0)  return "";
-            String res = sep+v[0];
-            for (int i = 1; i < v.length; i++)  res += ", "+v[i];
-            return res;
-        }
-        static String transform(String string) {
-            for (VAR var : values())
-                string = string.replaceAll(var.pattern, var.binding);
-            return string;
-        }
-    }
-    static String[] stringsIn(String[] strings, int beg, int end) {
-        return Arrays.copyOfRange(strings, beg, Math.min(end, strings.length));
-    }
-    static String[] stringsBefore(String[] strings, int pos) {
-        return stringsIn(strings, 0, pos);
-    }
-    static String[] stringsAfter(String[] strings, int pos) {
-        return stringsIn(strings, pos, strings.length);
-    }
-    static int indexAfter(String[] strings, int pos, String tag) {
-        return Math.min(indexBefore(strings, pos, tag) + 1, strings.length);
-    }
-    static int indexBefore(String[] strings, int pos, String tag) {
-        for (int i = pos, end = strings.length; ; i++) {
-            if (i == end || strings[i].endsWith(tag))  return i;
-        }
-    }
-    static int MIN_ARITY, MAX_ARITY, MAX_RCAT, MAX_REFS, MAX_INTS, MAX_LONGS;
-    static boolean ALL_ARG_TYPES, ALL_RETURN_TYPES;
-    static HashSet<String> done = new HashSet<String>();
-    public static void main(String... av) {
-        for (String[] template : TEMPLATES) {
-            int forLinesLimit = indexBefore(template, 0, "@each-cat@");
-            String[] forLines = stringsBefore(template, forLinesLimit);
-            template = stringsAfter(template, forLinesLimit);
-            for (String forLine : forLines)
-                expandTemplate(forLine, template);
-        }
-    }
-    static void expandTemplate(String forLine, String[] template) {
-        String[] params = forLine.split("[^0-9]+");
-        if (params[0].length() == 0)  params = stringsAfter(params, 1);
-        System.out.println("//params="+Arrays.asList(params));
-        int pcur = 0;
-        MIN_ARITY = Integer.valueOf(params[pcur++]);
-        MAX_ARITY = Integer.valueOf(params[pcur++]);
-        MAX_RCAT  = Integer.valueOf(params[pcur++]);
-        MAX_REFS  = Integer.valueOf(params[pcur++]);
-        MAX_INTS  = Integer.valueOf(params[pcur++]);
-        MAX_LONGS = Integer.valueOf(params[pcur++]);
-        if (pcur != params.length)  throw new RuntimeException("bad extra param: "+forLine);
-        if (MAX_RCAT >= TYPES.length)  MAX_RCAT = TYPES.length - 1;
-        ALL_ARG_TYPES = (indexBefore(template, 0, "@each-Tv@") < template.length);
-        ALL_RETURN_TYPES = (indexBefore(template, 0, "@each-R@") < template.length);
-        for (int nargs = MIN_ARITY; nargs <= MAX_ARITY; nargs++) {
-            for (int rcat = 0; rcat <= MAX_RCAT; rcat++) {
-                expandTemplate(template, true, rcat, nargs, 0, 0);
-                if (ALL_ARG_TYPES)  break;
-                expandTemplateForPrims(template, true, rcat, nargs, 1, 1);
-                if (ALL_RETURN_TYPES)  break;
-            }
-        }
-    }
-    static String catstr(int rcat, int nrefs, int nints, int nlongs) {
-        int nargs = nrefs + nints + nlongs;
-        String cat = TCHARS[rcat] + nargs;
-        if (!ALL_ARG_TYPES)  cat += (nints==0?"":"I"+nints)+(nlongs==0?"":"J"+nlongs);
-        return cat;
-    }
-    static void expandTemplateForPrims(String[] template, boolean topLevel, int rcat, int nargs, int minints, int minlongs) {
-        for (int isLong = 0; isLong <= 1; isLong++) {
-            for (int nprims = 1; nprims <= nargs; nprims++) {
-                int nrefs = nargs - nprims;
-                int nints = ((1-isLong) * nprims);
-                int nlongs = (isLong * nprims);
-                expandTemplate(template, topLevel, rcat, nrefs, nints, nlongs);
-            }
-        }
-    }
-    static void expandTemplate(String[] template, boolean topLevel,
-                               int rcat, int nrefs, int nints, int nlongs) {
-        int nargs = nrefs + nints + nlongs;
-        if (nrefs > MAX_REFS || nints > MAX_INTS || nlongs > MAX_LONGS)  return;
-        VAR.makeBindings(topLevel, rcat, nrefs, nints, nlongs);
-        if (topLevel && !done.add(VAR.cat.binding)) {
-            System.out.println("    //repeat "+VAR.cat.binding);
-            return;
-        }
-        for (int i = 0; i < template.length; i++) {
-            String line = template[i];
-            if (line.endsWith("@each-cat@")) {
-                // ignore
-            } else if (line.endsWith("@each-R@")) {
-                int blockEnd = indexAfter(template, i, "@end-R@");
-                String[] block = stringsIn(template, i+1, blockEnd-1);
-                for (int rcat1 = rcat; rcat1 <= MAX_RCAT; rcat1++)
-                    expandTemplate(block, false, rcat1, nrefs, nints, nlongs);
-                VAR.makeBindings(topLevel, rcat, nrefs, nints, nlongs);
-                i = blockEnd-1; continue;
-            } else if (line.endsWith("@each-Tv@")) {
-                int blockEnd = indexAfter(template, i, "@end-Tv@");
-                String[] block = stringsIn(template, i+1, blockEnd-1);
-                expandTemplate(block, false, rcat, nrefs, nints, nlongs);
-                expandTemplateForPrims(block, false, rcat, nargs, nints+1, nlongs+1);
-                VAR.makeBindings(topLevel, rcat, nrefs, nints, nlongs);
-                i = blockEnd-1; continue;
-            } else {
-                System.out.println(VAR.transform(line));
-            }
-        }
-    }
-}
-//}}} */
-//params=[0, 3, 4, 99, 99, 99]
-    static class A0 extends Adapter {
-        protected A0(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
-        protected A0(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); }
-        protected A0 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A0(e, i, c, t); }
-        protected Object target()   throws Throwable { return invoker.invokeExact(target); }
-        protected Object targetA0() throws Throwable { return target(); }
-        protected Object invoke_L() throws Throwable { return return_L(targetA0()); }
-        protected int    invoke_I() throws Throwable { return return_I(targetA0()); }
-        protected long   invoke_J() throws Throwable { return return_J(targetA0()); }
-        protected float  invoke_F() throws Throwable { return return_F(targetA0()); }
-        protected double invoke_D() throws Throwable { return return_D(targetA0()); }
-    }
-    static class A1 extends Adapter {
-        protected A1(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
-        protected A1(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); }
-        protected A1 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A1(e, i, c, t); }
-        protected Object target(Object a0)   throws Throwable { return invoker.invokeExact(target, a0); }
-        protected Object targetA1(Object a0) throws Throwable { return target(a0); }
-        protected Object targetA1(int    a0) throws Throwable { return target(a0); }
-        protected Object targetA1(long   a0) throws Throwable { return target(a0); }
-        protected Object invoke_L(Object a0) throws Throwable { return return_L(targetA1(a0)); }
-        protected int    invoke_I(Object a0) throws Throwable { return return_I(targetA1(a0)); }
-        protected long   invoke_J(Object a0) throws Throwable { return return_J(targetA1(a0)); }
-        protected float  invoke_F(Object a0) throws Throwable { return return_F(targetA1(a0)); }
-        protected double invoke_D(Object a0) throws Throwable { return return_D(targetA1(a0)); }
-        protected Object invoke_L(int    a0) throws Throwable { return return_L(targetA1(a0)); }
-        protected int    invoke_I(int    a0) throws Throwable { return return_I(targetA1(a0)); }
-        protected long   invoke_J(int    a0) throws Throwable { return return_J(targetA1(a0)); }
-        protected float  invoke_F(int    a0) throws Throwable { return return_F(targetA1(a0)); }
-        protected double invoke_D(int    a0) throws Throwable { return return_D(targetA1(a0)); }
-        protected Object invoke_L(long   a0) throws Throwable { return return_L(targetA1(a0)); }
-        protected int    invoke_I(long   a0) throws Throwable { return return_I(targetA1(a0)); }
-        protected long   invoke_J(long   a0) throws Throwable { return return_J(targetA1(a0)); }
-        protected float  invoke_F(long   a0) throws Throwable { return return_F(targetA1(a0)); }
-        protected double invoke_D(long   a0) throws Throwable { return return_D(targetA1(a0)); }
-    }
-    static class A2 extends Adapter {
-        protected A2(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
-        protected A2(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); }
-        protected A2 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A2(e, i, c, t); }
-        protected Object target(Object a0, Object a1)   throws Throwable { return invoker.invokeExact(target, a0, a1); }
-        protected Object targetA2(Object a0, Object a1) throws Throwable { return target(a0, a1); }
-        protected Object targetA2(Object a0, int    a1) throws Throwable { return target(a0, a1); }
-        protected Object targetA2(int    a0, int    a1) throws Throwable { return target(a0, a1); }
-        protected Object targetA2(Object a0, long   a1) throws Throwable { return target(a0, a1); }
-        protected Object targetA2(long   a0, long   a1) throws Throwable { return target(a0, a1); }
-        protected Object invoke_L(Object a0, Object a1) throws Throwable { return return_L(targetA2(a0, a1)); }
-        protected int    invoke_I(Object a0, Object a1) throws Throwable { return return_I(targetA2(a0, a1)); }
-        protected long   invoke_J(Object a0, Object a1) throws Throwable { return return_J(targetA2(a0, a1)); }
-        protected float  invoke_F(Object a0, Object a1) throws Throwable { return return_F(targetA2(a0, a1)); }
-        protected double invoke_D(Object a0, Object a1) throws Throwable { return return_D(targetA2(a0, a1)); }
-        protected Object invoke_L(Object a0, int    a1) throws Throwable { return return_L(targetA2(a0, a1)); }
-        protected int    invoke_I(Object a0, int    a1) throws Throwable { return return_I(targetA2(a0, a1)); }
-        protected long   invoke_J(Object a0, int    a1) throws Throwable { return return_J(targetA2(a0, a1)); }
-        protected float  invoke_F(Object a0, int    a1) throws Throwable { return return_F(targetA2(a0, a1)); }
-        protected double invoke_D(Object a0, int    a1) throws Throwable { return return_D(targetA2(a0, a1)); }
-        protected Object invoke_L(int    a0, int    a1) throws Throwable { return return_L(targetA2(a0, a1)); }
-        protected int    invoke_I(int    a0, int    a1) throws Throwable { return return_I(targetA2(a0, a1)); }
-        protected long   invoke_J(int    a0, int    a1) throws Throwable { return return_J(targetA2(a0, a1)); }
-        protected float  invoke_F(int    a0, int    a1) throws Throwable { return return_F(targetA2(a0, a1)); }
-        protected double invoke_D(int    a0, int    a1) throws Throwable { return return_D(targetA2(a0, a1)); }
-        protected Object invoke_L(Object a0, long   a1) throws Throwable { return return_L(targetA2(a0, a1)); }
-        protected int    invoke_I(Object a0, long   a1) throws Throwable { return return_I(targetA2(a0, a1)); }
-        protected long   invoke_J(Object a0, long   a1) throws Throwable { return return_J(targetA2(a0, a1)); }
-        protected float  invoke_F(Object a0, long   a1) throws Throwable { return return_F(targetA2(a0, a1)); }
-        protected double invoke_D(Object a0, long   a1) throws Throwable { return return_D(targetA2(a0, a1)); }
-        protected Object invoke_L(long   a0, long   a1) throws Throwable { return return_L(targetA2(a0, a1)); }
-        protected int    invoke_I(long   a0, long   a1) throws Throwable { return return_I(targetA2(a0, a1)); }
-        protected long   invoke_J(long   a0, long   a1) throws Throwable { return return_J(targetA2(a0, a1)); }
-        protected float  invoke_F(long   a0, long   a1) throws Throwable { return return_F(targetA2(a0, a1)); }
-        protected double invoke_D(long   a0, long   a1) throws Throwable { return return_D(targetA2(a0, a1)); }
-    }
-    static class A3 extends Adapter {
-        protected A3(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
-        protected A3(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); }
-        protected A3 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A3(e, i, c, t); }
-        protected Object target(Object a0, Object a1, Object a2)   throws Throwable { return invoker.invokeExact(target, a0, a1, a2); }
-        protected Object targetA3(Object a0, Object a1, Object a2) throws Throwable { return target(a0, a1, a2); }
-        protected Object targetA3(Object a0, Object a1, int    a2) throws Throwable { return target(a0, a1, a2); }
-        protected Object targetA3(Object a0, int    a1, int    a2) throws Throwable { return target(a0, a1, a2); }
-        protected Object targetA3(int    a0, int    a1, int    a2) throws Throwable { return target(a0, a1, a2); }
-        protected Object targetA3(Object a0, Object a1, long   a2) throws Throwable { return target(a0, a1, a2); }
-        protected Object targetA3(Object a0, long   a1, long   a2) throws Throwable { return target(a0, a1, a2); }
-        protected Object targetA3(long   a0, long   a1, long   a2) throws Throwable { return target(a0, a1, a2); }
-        protected Object invoke_L(Object a0, Object a1, Object a2) throws Throwable { return return_L(targetA3(a0, a1, a2)); }
-        protected int    invoke_I(Object a0, Object a1, Object a2) throws Throwable { return return_I(targetA3(a0, a1, a2)); }
-        protected long   invoke_J(Object a0, Object a1, Object a2) throws Throwable { return return_J(targetA3(a0, a1, a2)); }
-        protected float  invoke_F(Object a0, Object a1, Object a2) throws Throwable { return return_F(targetA3(a0, a1, a2)); }
-        protected double invoke_D(Object a0, Object a1, Object a2) throws Throwable { return return_D(targetA3(a0, a1, a2)); }
-        protected Object invoke_L(Object a0, Object a1, int    a2) throws Throwable { return return_L(targetA3(a0, a1, a2)); }
-        protected int    invoke_I(Object a0, Object a1, int    a2) throws Throwable { return return_I(targetA3(a0, a1, a2)); }
-        protected long   invoke_J(Object a0, Object a1, int    a2) throws Throwable { return return_J(targetA3(a0, a1, a2)); }
-        protected float  invoke_F(Object a0, Object a1, int    a2) throws Throwable { return return_F(targetA3(a0, a1, a2)); }
-        protected double invoke_D(Object a0, Object a1, int    a2) throws Throwable { return return_D(targetA3(a0, a1, a2)); }
-        protected Object invoke_L(Object a0, int    a1, int    a2) throws Throwable { return return_L(targetA3(a0, a1, a2)); }
-        protected int    invoke_I(Object a0, int    a1, int    a2) throws Throwable { return return_I(targetA3(a0, a1, a2)); }
-        protected long   invoke_J(Object a0, int    a1, int    a2) throws Throwable { return return_J(targetA3(a0, a1, a2)); }
-        protected float  invoke_F(Object a0, int    a1, int    a2) throws Throwable { return return_F(targetA3(a0, a1, a2)); }
-        protected double invoke_D(Object a0, int    a1, int    a2) throws Throwable { return return_D(targetA3(a0, a1, a2)); }
-        protected Object invoke_L(int    a0, int    a1, int    a2) throws Throwable { return return_L(targetA3(a0, a1, a2)); }
-        protected int    invoke_I(int    a0, int    a1, int    a2) throws Throwable { return return_I(targetA3(a0, a1, a2)); }
-        protected long   invoke_J(int    a0, int    a1, int    a2) throws Throwable { return return_J(targetA3(a0, a1, a2)); }
-        protected float  invoke_F(int    a0, int    a1, int    a2) throws Throwable { return return_F(targetA3(a0, a1, a2)); }
-        protected double invoke_D(int    a0, int    a1, int    a2) throws Throwable { return return_D(targetA3(a0, a1, a2)); }
-        protected Object invoke_L(Object a0, Object a1, long   a2) throws Throwable { return return_L(targetA3(a0, a1, a2)); }
-        protected int    invoke_I(Object a0, Object a1, long   a2) throws Throwable { return return_I(targetA3(a0, a1, a2)); }
-        protected long   invoke_J(Object a0, Object a1, long   a2) throws Throwable { return return_J(targetA3(a0, a1, a2)); }
-        protected float  invoke_F(Object a0, Object a1, long   a2) throws Throwable { return return_F(targetA3(a0, a1, a2)); }
-        protected double invoke_D(Object a0, Object a1, long   a2) throws Throwable { return return_D(targetA3(a0, a1, a2)); }
-        protected Object invoke_L(Object a0, long   a1, long   a2) throws Throwable { return return_L(targetA3(a0, a1, a2)); }
-        protected int    invoke_I(Object a0, long   a1, long   a2) throws Throwable { return return_I(targetA3(a0, a1, a2)); }
-        protected long   invoke_J(Object a0, long   a1, long   a2) throws Throwable { return return_J(targetA3(a0, a1, a2)); }
-        protected float  invoke_F(Object a0, long   a1, long   a2) throws Throwable { return return_F(targetA3(a0, a1, a2)); }
-        protected double invoke_D(Object a0, long   a1, long   a2) throws Throwable { return return_D(targetA3(a0, a1, a2)); }
-        protected Object invoke_L(long   a0, long   a1, long   a2) throws Throwable { return return_L(targetA3(a0, a1, a2)); }
-        protected int    invoke_I(long   a0, long   a1, long   a2) throws Throwable { return return_I(targetA3(a0, a1, a2)); }
-        protected long   invoke_J(long   a0, long   a1, long   a2) throws Throwable { return return_J(targetA3(a0, a1, a2)); }
-        protected float  invoke_F(long   a0, long   a1, long   a2) throws Throwable { return return_F(targetA3(a0, a1, a2)); }
-        protected double invoke_D(long   a0, long   a1, long   a2) throws Throwable { return return_D(targetA3(a0, a1, a2)); }
-    }
-//params=[4, 4, 4, 99, 99, 99]
-    static class A4 extends Adapter {
-        protected A4(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
-        protected A4(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); }
-        protected A4 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A4(e, i, c, t); }
-        protected Object target(Object a0, Object a1, Object a2, Object a3)   throws Throwable { return invoker.invokeExact(target, a0, a1, a2, a3); }
-        protected Object targetA4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return target(a0, a1, a2, a3); }
-        protected Object targetA4(Object a0, Object a1, Object a2, int    a3) throws Throwable { return target(a0, a1, a2, a3); }
-        protected Object targetA4(Object a0, Object a1, int    a2, int    a3) throws Throwable { return target(a0, a1, a2, a3); }
-        protected Object targetA4(Object a0, int    a1, int    a2, int    a3) throws Throwable { return target(a0, a1, a2, a3); }
-        protected Object targetA4(int    a0, int    a1, int    a2, int    a3) throws Throwable { return target(a0, a1, a2, a3); }
-        protected Object targetA4(Object a0, Object a1, Object a2, long   a3) throws Throwable { return target(a0, a1, a2, a3); }
-        protected Object targetA4(Object a0, Object a1, long   a2, long   a3) throws Throwable { return target(a0, a1, a2, a3); }
-        protected Object targetA4(Object a0, long   a1, long   a2, long   a3) throws Throwable { return target(a0, a1, a2, a3); }
-        protected Object targetA4(long   a0, long   a1, long   a2, long   a3) throws Throwable { return target(a0, a1, a2, a3); }
-        protected Object invoke_L(Object a0, Object a1, Object a2, Object a3) throws Throwable { return return_L(targetA4(a0, a1, a2, a3)); }
-        protected int    invoke_I(Object a0, Object a1, Object a2, Object a3) throws Throwable { return return_I(targetA4(a0, a1, a2, a3)); }
-        protected long   invoke_J(Object a0, Object a1, Object a2, Object a3) throws Throwable { return return_J(targetA4(a0, a1, a2, a3)); }
-        protected float  invoke_F(Object a0, Object a1, Object a2, Object a3) throws Throwable { return return_F(targetA4(a0, a1, a2, a3)); }
-        protected double invoke_D(Object a0, Object a1, Object a2, Object a3) throws Throwable { return return_D(targetA4(a0, a1, a2, a3)); }
-        protected Object invoke_L(Object a0, Object a1, Object a2, int    a3) throws Throwable { return return_L(targetA4(a0, a1, a2, a3)); }
-        protected int    invoke_I(Object a0, Object a1, Object a2, int    a3) throws Throwable { return return_I(targetA4(a0, a1, a2, a3)); }
-        protected long   invoke_J(Object a0, Object a1, Object a2, int    a3) throws Throwable { return return_J(targetA4(a0, a1, a2, a3)); }
-        protected float  invoke_F(Object a0, Object a1, Object a2, int    a3) throws Throwable { return return_F(targetA4(a0, a1, a2, a3)); }
-        protected double invoke_D(Object a0, Object a1, Object a2, int    a3) throws Throwable { return return_D(targetA4(a0, a1, a2, a3)); }
-        protected Object invoke_L(Object a0, Object a1, int    a2, int    a3) throws Throwable { return return_L(targetA4(a0, a1, a2, a3)); }
-        protected int    invoke_I(Object a0, Object a1, int    a2, int    a3) throws Throwable { return return_I(targetA4(a0, a1, a2, a3)); }
-        protected long   invoke_J(Object a0, Object a1, int    a2, int    a3) throws Throwable { return return_J(targetA4(a0, a1, a2, a3)); }
-        protected float  invoke_F(Object a0, Object a1, int    a2, int    a3) throws Throwable { return return_F(targetA4(a0, a1, a2, a3)); }
-        protected double invoke_D(Object a0, Object a1, int    a2, int    a3) throws Throwable { return return_D(targetA4(a0, a1, a2, a3)); }
-        protected Object invoke_L(Object a0, int    a1, int    a2, int    a3) throws Throwable { return return_L(targetA4(a0, a1, a2, a3)); }
-        protected int    invoke_I(Object a0, int    a1, int    a2, int    a3) throws Throwable { return return_I(targetA4(a0, a1, a2, a3)); }
-        protected long   invoke_J(Object a0, int    a1, int    a2, int    a3) throws Throwable { return return_J(targetA4(a0, a1, a2, a3)); }
-        protected float  invoke_F(Object a0, int    a1, int    a2, int    a3) throws Throwable { return return_F(targetA4(a0, a1, a2, a3)); }
-        protected double invoke_D(Object a0, int    a1, int    a2, int    a3) throws Throwable { return return_D(targetA4(a0, a1, a2, a3)); }
-        protected Object invoke_L(int    a0, int    a1, int    a2, int    a3) throws Throwable { return return_L(targetA4(a0, a1, a2, a3)); }
-        protected int    invoke_I(int    a0, int    a1, int    a2, int    a3) throws Throwable { return return_I(targetA4(a0, a1, a2, a3)); }
-        protected long   invoke_J(int    a0, int    a1, int    a2, int    a3) throws Throwable { return return_J(targetA4(a0, a1, a2, a3)); }
-        protected float  invoke_F(int    a0, int    a1, int    a2, int    a3) throws Throwable { return return_F(targetA4(a0, a1, a2, a3)); }
-        protected double invoke_D(int    a0, int    a1, int    a2, int    a3) throws Throwable { return return_D(targetA4(a0, a1, a2, a3)); }
-        protected Object invoke_L(Object a0, Object a1, Object a2, long   a3) throws Throwable { return return_L(targetA4(a0, a1, a2, a3)); }
-        protected int    invoke_I(Object a0, Object a1, Object a2, long   a3) throws Throwable { return return_I(targetA4(a0, a1, a2, a3)); }
-        protected long   invoke_J(Object a0, Object a1, Object a2, long   a3) throws Throwable { return return_J(targetA4(a0, a1, a2, a3)); }
-        protected float  invoke_F(Object a0, Object a1, Object a2, long   a3) throws Throwable { return return_F(targetA4(a0, a1, a2, a3)); }
-        protected double invoke_D(Object a0, Object a1, Object a2, long   a3) throws Throwable { return return_D(targetA4(a0, a1, a2, a3)); }
-        protected Object invoke_L(Object a0, Object a1, long   a2, long   a3) throws Throwable { return return_L(targetA4(a0, a1, a2, a3)); }
-        protected int    invoke_I(Object a0, Object a1, long   a2, long   a3) throws Throwable { return return_I(targetA4(a0, a1, a2, a3)); }
-        protected long   invoke_J(Object a0, Object a1, long   a2, long   a3) throws Throwable { return return_J(targetA4(a0, a1, a2, a3)); }
-        protected float  invoke_F(Object a0, Object a1, long   a2, long   a3) throws Throwable { return return_F(targetA4(a0, a1, a2, a3)); }
-        protected double invoke_D(Object a0, Object a1, long   a2, long   a3) throws Throwable { return return_D(targetA4(a0, a1, a2, a3)); }
-        protected Object invoke_L(Object a0, long   a1, long   a2, long   a3) throws Throwable { return return_L(targetA4(a0, a1, a2, a3)); }
-        protected int    invoke_I(Object a0, long   a1, long   a2, long   a3) throws Throwable { return return_I(targetA4(a0, a1, a2, a3)); }
-        protected long   invoke_J(Object a0, long   a1, long   a2, long   a3) throws Throwable { return return_J(targetA4(a0, a1, a2, a3)); }
-        protected float  invoke_F(Object a0, long   a1, long   a2, long   a3) throws Throwable { return return_F(targetA4(a0, a1, a2, a3)); }
-        protected double invoke_D(Object a0, long   a1, long   a2, long   a3) throws Throwable { return return_D(targetA4(a0, a1, a2, a3)); }
-        protected Object invoke_L(long   a0, long   a1, long   a2, long   a3) throws Throwable { return return_L(targetA4(a0, a1, a2, a3)); }
-        protected int    invoke_I(long   a0, long   a1, long   a2, long   a3) throws Throwable { return return_I(targetA4(a0, a1, a2, a3)); }
-        protected long   invoke_J(long   a0, long   a1, long   a2, long   a3) throws Throwable { return return_J(targetA4(a0, a1, a2, a3)); }
-        protected float  invoke_F(long   a0, long   a1, long   a2, long   a3) throws Throwable { return return_F(targetA4(a0, a1, a2, a3)); }
-        protected double invoke_D(long   a0, long   a1, long   a2, long   a3) throws Throwable { return return_D(targetA4(a0, a1, a2, a3)); }
-    }
-//params=[5, 5, 2, 99, 99, 99]
-    static class A5 extends Adapter {
-        protected A5(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
-        protected A5(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); }
-        protected A5 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A5(e, i, c, t); }
-        protected Object target(Object a0, Object a1, Object a2, Object a3, Object a4)   throws Throwable { return invoker.invokeExact(target, a0, a1, a2, a3, a4); }
-        protected Object targetA5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return target(a0, a1, a2, a3, a4); }
-        protected Object targetA5(Object a0, Object a1, Object a2, Object a3, int    a4) throws Throwable { return target(a0, a1, a2, a3, a4); }
-        protected Object targetA5(Object a0, Object a1, Object a2, int    a3, int    a4) throws Throwable { return target(a0, a1, a2, a3, a4); }
-        protected Object targetA5(Object a0, Object a1, int    a2, int    a3, int    a4) throws Throwable { return target(a0, a1, a2, a3, a4); }
-        protected Object targetA5(Object a0, int    a1, int    a2, int    a3, int    a4) throws Throwable { return target(a0, a1, a2, a3, a4); }
-        protected Object targetA5(int    a0, int    a1, int    a2, int    a3, int    a4) throws Throwable { return target(a0, a1, a2, a3, a4); }
-        protected Object targetA5(Object a0, Object a1, Object a2, Object a3, long   a4) throws Throwable { return target(a0, a1, a2, a3, a4); }
-        protected Object targetA5(Object a0, Object a1, Object a2, long   a3, long   a4) throws Throwable { return target(a0, a1, a2, a3, a4); }
-        protected Object targetA5(Object a0, Object a1, long   a2, long   a3, long   a4) throws Throwable { return target(a0, a1, a2, a3, a4); }
-        protected Object targetA5(Object a0, long   a1, long   a2, long   a3, long   a4) throws Throwable { return target(a0, a1, a2, a3, a4); }
-        protected Object targetA5(long   a0, long   a1, long   a2, long   a3, long   a4) throws Throwable { return target(a0, a1, a2, a3, a4); }
-        protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return return_L(targetA5(a0, a1, a2, a3, a4)); }
-        protected int    invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return return_I(targetA5(a0, a1, a2, a3, a4)); }
-        protected long   invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return return_J(targetA5(a0, a1, a2, a3, a4)); }
-        protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, int    a4) throws Throwable { return return_L(targetA5(a0, a1, a2, a3, a4)); }
-        protected int    invoke_I(Object a0, Object a1, Object a2, Object a3, int    a4) throws Throwable { return return_I(targetA5(a0, a1, a2, a3, a4)); }
-        protected long   invoke_J(Object a0, Object a1, Object a2, Object a3, int    a4) throws Throwable { return return_J(targetA5(a0, a1, a2, a3, a4)); }
-        protected Object invoke_L(Object a0, Object a1, Object a2, int    a3, int    a4) throws Throwable { return return_L(targetA5(a0, a1, a2, a3, a4)); }
-        protected int    invoke_I(Object a0, Object a1, Object a2, int    a3, int    a4) throws Throwable { return return_I(targetA5(a0, a1, a2, a3, a4)); }
-        protected long   invoke_J(Object a0, Object a1, Object a2, int    a3, int    a4) throws Throwable { return return_J(targetA5(a0, a1, a2, a3, a4)); }
-        protected Object invoke_L(Object a0, Object a1, int    a2, int    a3, int    a4) throws Throwable { return return_L(targetA5(a0, a1, a2, a3, a4)); }
-        protected int    invoke_I(Object a0, Object a1, int    a2, int    a3, int    a4) throws Throwable { return return_I(targetA5(a0, a1, a2, a3, a4)); }
-        protected long   invoke_J(Object a0, Object a1, int    a2, int    a3, int    a4) throws Throwable { return return_J(targetA5(a0, a1, a2, a3, a4)); }
-        protected Object invoke_L(Object a0, int    a1, int    a2, int    a3, int    a4) throws Throwable { return return_L(targetA5(a0, a1, a2, a3, a4)); }
-        protected int    invoke_I(Object a0, int    a1, int    a2, int    a3, int    a4) throws Throwable { return return_I(targetA5(a0, a1, a2, a3, a4)); }
-        protected long   invoke_J(Object a0, int    a1, int    a2, int    a3, int    a4) throws Throwable { return return_J(targetA5(a0, a1, a2, a3, a4)); }
-        protected Object invoke_L(int    a0, int    a1, int    a2, int    a3, int    a4) throws Throwable { return return_L(targetA5(a0, a1, a2, a3, a4)); }
-        protected int    invoke_I(int    a0, int    a1, int    a2, int    a3, int    a4) throws Throwable { return return_I(targetA5(a0, a1, a2, a3, a4)); }
-        protected long   invoke_J(int    a0, int    a1, int    a2, int    a3, int    a4) throws Throwable { return return_J(targetA5(a0, a1, a2, a3, a4)); }
-        protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, long   a4) throws Throwable { return return_L(targetA5(a0, a1, a2, a3, a4)); }
-        protected int    invoke_I(Object a0, Object a1, Object a2, Object a3, long   a4) throws Throwable { return return_I(targetA5(a0, a1, a2, a3, a4)); }
-        protected long   invoke_J(Object a0, Object a1, Object a2, Object a3, long   a4) throws Throwable { return return_J(targetA5(a0, a1, a2, a3, a4)); }
-        protected Object invoke_L(Object a0, Object a1, Object a2, long   a3, long   a4) throws Throwable { return return_L(targetA5(a0, a1, a2, a3, a4)); }
-        protected int    invoke_I(Object a0, Object a1, Object a2, long   a3, long   a4) throws Throwable { return return_I(targetA5(a0, a1, a2, a3, a4)); }
-        protected long   invoke_J(Object a0, Object a1, Object a2, long   a3, long   a4) throws Throwable { return return_J(targetA5(a0, a1, a2, a3, a4)); }
-        protected Object invoke_L(Object a0, Object a1, long   a2, long   a3, long   a4) throws Throwable { return return_L(targetA5(a0, a1, a2, a3, a4)); }
-        protected int    invoke_I(Object a0, Object a1, long   a2, long   a3, long   a4) throws Throwable { return return_I(targetA5(a0, a1, a2, a3, a4)); }
-        protected long   invoke_J(Object a0, Object a1, long   a2, long   a3, long   a4) throws Throwable { return return_J(targetA5(a0, a1, a2, a3, a4)); }
-        protected Object invoke_L(Object a0, long   a1, long   a2, long   a3, long   a4) throws Throwable { return return_L(targetA5(a0, a1, a2, a3, a4)); }
-        protected int    invoke_I(Object a0, long   a1, long   a2, long   a3, long   a4) throws Throwable { return return_I(targetA5(a0, a1, a2, a3, a4)); }
-        protected long   invoke_J(Object a0, long   a1, long   a2, long   a3, long   a4) throws Throwable { return return_J(targetA5(a0, a1, a2, a3, a4)); }
-        protected Object invoke_L(long   a0, long   a1, long   a2, long   a3, long   a4) throws Throwable { return return_L(targetA5(a0, a1, a2, a3, a4)); }
-        protected int    invoke_I(long   a0, long   a1, long   a2, long   a3, long   a4) throws Throwable { return return_I(targetA5(a0, a1, a2, a3, a4)); }
-        protected long   invoke_J(long   a0, long   a1, long   a2, long   a3, long   a4) throws Throwable { return return_J(targetA5(a0, a1, a2, a3, a4)); }
-    }
-//params=[6, 10, 2, 99, 0, 99]
-    static class A6 extends Adapter {
-        protected A6(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
-        protected A6(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); }
-        protected A6 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A6(e, i, c, t); }
-        protected Object target(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5)   throws Throwable { return invoker.invokeExact(target, a0, a1, a2, a3, a4, a5); }
-        protected Object targetA6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return target(a0, a1, a2, a3, a4, a5); }
-        protected Object targetA6(Object a0, Object a1, Object a2, Object a3, Object a4, long   a5) throws Throwable { return target(a0, a1, a2, a3, a4, a5); }
-        protected Object targetA6(Object a0, Object a1, Object a2, Object a3, long   a4, long   a5) throws Throwable { return target(a0, a1, a2, a3, a4, a5); }
-        protected Object targetA6(Object a0, Object a1, Object a2, long   a3, long   a4, long   a5) throws Throwable { return target(a0, a1, a2, a3, a4, a5); }
-        protected Object targetA6(Object a0, Object a1, long   a2, long   a3, long   a4, long   a5) throws Throwable { return target(a0, a1, a2, a3, a4, a5); }
-        protected Object targetA6(Object a0, long   a1, long   a2, long   a3, long   a4, long   a5) throws Throwable { return target(a0, a1, a2, a3, a4, a5); }
-        protected Object targetA6(long   a0, long   a1, long   a2, long   a3, long   a4, long   a5) throws Throwable { return target(a0, a1, a2, a3, a4, a5); }
-        protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return return_L(targetA6(a0, a1, a2, a3, a4, a5)); }
-        protected int    invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return return_I(targetA6(a0, a1, a2, a3, a4, a5)); }
-        protected long   invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return return_J(targetA6(a0, a1, a2, a3, a4, a5)); }
-        protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, long   a5) throws Throwable { return return_L(targetA6(a0, a1, a2, a3, a4, a5)); }
-        protected int    invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, long   a5) throws Throwable { return return_I(targetA6(a0, a1, a2, a3, a4, a5)); }
-        protected long   invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, long   a5) throws Throwable { return return_J(targetA6(a0, a1, a2, a3, a4, a5)); }
-        protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, long   a4, long   a5) throws Throwable { return return_L(targetA6(a0, a1, a2, a3, a4, a5)); }
-        protected int    invoke_I(Object a0, Object a1, Object a2, Object a3, long   a4, long   a5) throws Throwable { return return_I(targetA6(a0, a1, a2, a3, a4, a5)); }
-        protected long   invoke_J(Object a0, Object a1, Object a2, Object a3, long   a4, long   a5) throws Throwable { return return_J(targetA6(a0, a1, a2, a3, a4, a5)); }
-        protected Object invoke_L(Object a0, Object a1, Object a2, long   a3, long   a4, long   a5) throws Throwable { return return_L(targetA6(a0, a1, a2, a3, a4, a5)); }
-        protected int    invoke_I(Object a0, Object a1, Object a2, long   a3, long   a4, long   a5) throws Throwable { return return_I(targetA6(a0, a1, a2, a3, a4, a5)); }
-        protected long   invoke_J(Object a0, Object a1, Object a2, long   a3, long   a4, long   a5) throws Throwable { return return_J(targetA6(a0, a1, a2, a3, a4, a5)); }
-        protected Object invoke_L(Object a0, Object a1, long   a2, long   a3, long   a4, long   a5) throws Throwable { return return_L(targetA6(a0, a1, a2, a3, a4, a5)); }
-        protected int    invoke_I(Object a0, Object a1, long   a2, long   a3, long   a4, long   a5) throws Throwable { return return_I(targetA6(a0, a1, a2, a3, a4, a5)); }
-        protected long   invoke_J(Object a0, Object a1, long   a2, long   a3, long   a4, long   a5) throws Throwable { return return_J(targetA6(a0, a1, a2, a3, a4, a5)); }
-        protected Object invoke_L(Object a0, long   a1, long   a2, long   a3, long   a4, long   a5) throws Throwable { return return_L(targetA6(a0, a1, a2, a3, a4, a5)); }
-        protected int    invoke_I(Object a0, long   a1, long   a2, long   a3, long   a4, long   a5) throws Throwable { return return_I(targetA6(a0, a1, a2, a3, a4, a5)); }
-        protected long   invoke_J(Object a0, long   a1, long   a2, long   a3, long   a4, long   a5) throws Throwable { return return_J(targetA6(a0, a1, a2, a3, a4, a5)); }
-        protected Object invoke_L(long   a0, long   a1, long   a2, long   a3, long   a4, long   a5) throws Throwable { return return_L(targetA6(a0, a1, a2, a3, a4, a5)); }
-        protected int    invoke_I(long   a0, long   a1, long   a2, long   a3, long   a4, long   a5) throws Throwable { return return_I(targetA6(a0, a1, a2, a3, a4, a5)); }
-        protected long   invoke_J(long   a0, long   a1, long   a2, long   a3, long   a4, long   a5) throws Throwable { return return_J(targetA6(a0, a1, a2, a3, a4, a5)); }
-    }
-    static class A7 extends Adapter {
-        protected A7(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
-        protected A7(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); }
-        protected A7 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A7(e, i, c, t); }
-        protected Object target(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6)   throws Throwable { return invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6); }
-        protected Object targetA7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6); }
-        protected Object targetA7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long   a6) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6); }
-        protected Object targetA7(Object a0, Object a1, Object a2, Object a3, Object a4, long   a5, long   a6) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6); }
-        protected Object targetA7(Object a0, Object a1, Object a2, Object a3, long   a4, long   a5, long   a6) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6); }
-        protected Object targetA7(Object a0, Object a1, Object a2, long   a3, long   a4, long   a5, long   a6) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6); }
-        protected Object targetA7(Object a0, Object a1, long   a2, long   a3, long   a4, long   a5, long   a6) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6); }
-        protected Object targetA7(Object a0, long   a1, long   a2, long   a3, long   a4, long   a5, long   a6) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6); }
-        protected Object targetA7(long   a0, long   a1, long   a2, long   a3, long   a4, long   a5, long   a6) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6); }
-        protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return return_L(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
-        protected int    invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return return_I(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
-        protected long   invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return return_J(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
-        protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long   a6) throws Throwable { return return_L(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
-        protected int    invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long   a6) throws Throwable { return return_I(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
-        protected long   invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long   a6) throws Throwable { return return_J(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
-        protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, long   a5, long   a6) throws Throwable { return return_L(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
-        protected int    invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, long   a5, long   a6) throws Throwable { return return_I(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
-        protected long   invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, long   a5, long   a6) throws Throwable { return return_J(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
-        protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, long   a4, long   a5, long   a6) throws Throwable { return return_L(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
-        protected int    invoke_I(Object a0, Object a1, Object a2, Object a3, long   a4, long   a5, long   a6) throws Throwable { return return_I(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
-        protected long   invoke_J(Object a0, Object a1, Object a2, Object a3, long   a4, long   a5, long   a6) throws Throwable { return return_J(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
-        protected Object invoke_L(Object a0, Object a1, Object a2, long   a3, long   a4, long   a5, long   a6) throws Throwable { return return_L(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
-        protected int    invoke_I(Object a0, Object a1, Object a2, long   a3, long   a4, long   a5, long   a6) throws Throwable { return return_I(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
-        protected long   invoke_J(Object a0, Object a1, Object a2, long   a3, long   a4, long   a5, long   a6) throws Throwable { return return_J(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
-        protected Object invoke_L(Object a0, Object a1, long   a2, long   a3, long   a4, long   a5, long   a6) throws Throwable { return return_L(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
-        protected int    invoke_I(Object a0, Object a1, long   a2, long   a3, long   a4, long   a5, long   a6) throws Throwable { return return_I(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
-        protected long   invoke_J(Object a0, Object a1, long   a2, long   a3, long   a4, long   a5, long   a6) throws Throwable { return return_J(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
-        protected Object invoke_L(Object a0, long   a1, long   a2, long   a3, long   a4, long   a5, long   a6) throws Throwable { return return_L(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
-        protected int    invoke_I(Object a0, long   a1, long   a2, long   a3, long   a4, long   a5, long   a6) throws Throwable { return return_I(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
-        protected long   invoke_J(Object a0, long   a1, long   a2, long   a3, long   a4, long   a5, long   a6) throws Throwable { return return_J(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
-        protected Object invoke_L(long   a0, long   a1, long   a2, long   a3, long   a4, long   a5, long   a6) throws Throwable { return return_L(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
-        protected int    invoke_I(long   a0, long   a1, long   a2, long   a3, long   a4, long   a5, long   a6) throws Throwable { return return_I(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
-        protected long   invoke_J(long   a0, long   a1, long   a2, long   a3, long   a4, long   a5, long   a6) throws Throwable { return return_J(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
-    }
-    static class A8 extends Adapter {
-        protected A8(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
-        protected A8(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); }
-        protected A8 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A8(e, i, c, t); }
-        protected Object target(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7)   throws Throwable { return invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7); }
-        protected Object targetA8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7); }
-        protected Object targetA8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long   a7) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7); }
-        protected Object targetA8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long   a6, long   a7) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7); }
-        protected Object targetA8(Object a0, Object a1, Object a2, Object a3, Object a4, long   a5, long   a6, long   a7) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7); }
-        protected Object targetA8(Object a0, Object a1, Object a2, Object a3, long   a4, long   a5, long   a6, long   a7) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7); }
-        protected Object targetA8(Object a0, Object a1, Object a2, long   a3, long   a4, long   a5, long   a6, long   a7) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7); }
-        protected Object targetA8(Object a0, Object a1, long   a2, long   a3, long   a4, long   a5, long   a6, long   a7) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7); }
-        protected Object targetA8(Object a0, long   a1, long   a2, long   a3, long   a4, long   a5, long   a6, long   a7) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7); }
-        protected Object targetA8(long   a0, long   a1, long   a2, long   a3, long   a4, long   a5, long   a6, long   a7) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7); }
-        protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return return_L(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
-        protected int    invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return return_I(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
-        protected long   invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return return_J(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
-        protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long   a7) throws Throwable { return return_L(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
-        protected int    invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long   a7) throws Throwable { return return_I(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
-        protected long   invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long   a7) throws Throwable { return return_J(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
-        protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long   a6, long   a7) throws Throwable { return return_L(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
-        protected int    invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long   a6, long   a7) throws Throwable { return return_I(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
-        protected long   invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long   a6, long   a7) throws Throwable { return return_J(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
-        protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, long   a5, long   a6, long   a7) throws Throwable { return return_L(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
-        protected int    invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, long   a5, long   a6, long   a7) throws Throwable { return return_I(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
-        protected long   invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, long   a5, long   a6, long   a7) throws Throwable { return return_J(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
-        protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, long   a4, long   a5, long   a6, long   a7) throws Throwable { return return_L(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
-        protected int    invoke_I(Object a0, Object a1, Object a2, Object a3, long   a4, long   a5, long   a6, long   a7) throws Throwable { return return_I(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
-        protected long   invoke_J(Object a0, Object a1, Object a2, Object a3, long   a4, long   a5, long   a6, long   a7) throws Throwable { return return_J(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
-        protected Object invoke_L(Object a0, Object a1, Object a2, long   a3, long   a4, long   a5, long   a6, long   a7) throws Throwable { return return_L(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
-        protected int    invoke_I(Object a0, Object a1, Object a2, long   a3, long   a4, long   a5, long   a6, long   a7) throws Throwable { return return_I(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
-        protected long   invoke_J(Object a0, Object a1, Object a2, long   a3, long   a4, long   a5, long   a6, long   a7) throws Throwable { return return_J(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
-        protected Object invoke_L(Object a0, Object a1, long   a2, long   a3, long   a4, long   a5, long   a6, long   a7) throws Throwable { return return_L(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
-        protected int    invoke_I(Object a0, Object a1, long   a2, long   a3, long   a4, long   a5, long   a6, long   a7) throws Throwable { return return_I(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
-        protected long   invoke_J(Object a0, Object a1, long   a2, long   a3, long   a4, long   a5, long   a6, long   a7) throws Throwable { return return_J(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
-        protected Object invoke_L(Object a0, long   a1, long   a2, long   a3, long   a4, long   a5, long   a6, long   a7) throws Throwable { return return_L(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
-        protected int    invoke_I(Object a0, long   a1, long   a2, long   a3, long   a4, long   a5, long   a6, long   a7) throws Throwable { return return_I(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
-        protected long   invoke_J(Object a0, long   a1, long   a2, long   a3, long   a4, long   a5, long   a6, long   a7) throws Throwable { return return_J(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
-        protected Object invoke_L(long   a0, long   a1, long   a2, long   a3, long   a4, long   a5, long   a6, long   a7) throws Throwable { return return_L(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
-        protected int    invoke_I(long   a0, long   a1, long   a2, long   a3, long   a4, long   a5, long   a6, long   a7) throws Throwable { return return_I(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
-        protected long   invoke_J(long   a0, long   a1, long   a2, long   a3, long   a4, long   a5, long   a6, long   a7) throws Throwable { return return_J(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
-    }
-    static class A9 extends Adapter {
-        protected A9(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
-        protected A9(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); }
-        protected A9 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A9(e, i, c, t); }
-        protected Object target(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8)   throws Throwable { return invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8); }
-        protected Object targetA9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8); }
-        protected Object targetA9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, long   a8) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8); }
-        protected Object targetA9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long   a7, long   a8) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8); }
-        protected Object targetA9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long   a6, long   a7, long   a8) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8); }
-        protected Object targetA9(Object a0, Object a1, Object a2, Object a3, Object a4, long   a5, long   a6, long   a7, long   a8) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8); }
-        protected Object targetA9(Object a0, Object a1, Object a2, Object a3, long   a4, long   a5, long   a6, long   a7, long   a8) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8); }
-        protected Object targetA9(Object a0, Object a1, Object a2, long   a3, long   a4, long   a5, long   a6, long   a7, long   a8) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8); }
-        protected Object targetA9(Object a0, Object a1, long   a2, long   a3, long   a4, long   a5, long   a6, long   a7, long   a8) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8); }
-        protected Object targetA9(Object a0, long   a1, long   a2, long   a3, long   a4, long   a5, long   a6, long   a7, long   a8) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8); }
-        protected Object targetA9(long   a0, long   a1, long   a2, long   a3, long   a4, long   a5, long   a6, long   a7, long   a8) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8); }
-        protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return return_L(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
-        protected int    invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return return_I(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
-        protected long   invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return return_J(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
-        protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, long   a8) throws Throwable { return return_L(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
-        protected int    invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, long   a8) throws Throwable { return return_I(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
-        protected long   invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, long   a8) throws Throwable { return return_J(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
-        protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long   a7, long   a8) throws Throwable { return return_L(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
-        protected int    invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long   a7, long   a8) throws Throwable { return return_I(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
-        protected long   invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long   a7, long   a8) throws Throwable { return return_J(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
-        protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long   a6, long   a7, long   a8) throws Throwable { return return_L(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
-        protected int    invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long   a6, long   a7, long   a8) throws Throwable { return return_I(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
-        protected long   invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long   a6, long   a7, long   a8) throws Throwable { return return_J(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
-        protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, long   a5, long   a6, long   a7, long   a8) throws Throwable { return return_L(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
-        protected int    invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, long   a5, long   a6, long   a7, long   a8) throws Throwable { return return_I(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
-        protected long   invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, long   a5, long   a6, long   a7, long   a8) throws Throwable { return return_J(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
-        protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, long   a4, long   a5, long   a6, long   a7, long   a8) throws Throwable { return return_L(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
-        protected int    invoke_I(Object a0, Object a1, Object a2, Object a3, long   a4, long   a5, long   a6, long   a7, long   a8) throws Throwable { return return_I(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
-        protected long   invoke_J(Object a0, Object a1, Object a2, Object a3, long   a4, long   a5, long   a6, long   a7, long   a8) throws Throwable { return return_J(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
-        protected Object invoke_L(Object a0, Object a1, Object a2, long   a3, long   a4, long   a5, long   a6, long   a7, long   a8) throws Throwable { return return_L(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
-        protected int    invoke_I(Object a0, Object a1, Object a2, long   a3, long   a4, long   a5, long   a6, long   a7, long   a8) throws Throwable { return return_I(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
-        protected long   invoke_J(Object a0, Object a1, Object a2, long   a3, long   a4, long   a5, long   a6, long   a7, long   a8) throws Throwable { return return_J(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
-        protected Object invoke_L(Object a0, Object a1, long   a2, long   a3, long   a4, long   a5, long   a6, long   a7, long   a8) throws Throwable { return return_L(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
-        protected int    invoke_I(Object a0, Object a1, long   a2, long   a3, long   a4, long   a5, long   a6, long   a7, long   a8) throws Throwable { return return_I(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
-        protected long   invoke_J(Object a0, Object a1, long   a2, long   a3, long   a4, long   a5, long   a6, long   a7, long   a8) throws Throwable { return return_J(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
-        protected Object invoke_L(Object a0, long   a1, long   a2, long   a3, long   a4, long   a5, long   a6, long   a7, long   a8) throws Throwable { return return_L(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
-        protected int    invoke_I(Object a0, long   a1, long   a2, long   a3, long   a4, long   a5, long   a6, long   a7, long   a8) throws Throwable { return return_I(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
-        protected long   invoke_J(Object a0, long   a1, long   a2, long   a3, long   a4, long   a5, long   a6, long   a7, long   a8) throws Throwable { return return_J(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
-        protected Object invoke_L(long   a0, long   a1, long   a2, long   a3, long   a4, long   a5, long   a6, long   a7, long   a8) throws Throwable { return return_L(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
-        protected int    invoke_I(long   a0, long   a1, long   a2, long   a3, long   a4, long   a5, long   a6, long   a7, long   a8) throws Throwable { return return_I(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
-        protected long   invoke_J(long   a0, long   a1, long   a2, long   a3, long   a4, long   a5, long   a6, long   a7, long   a8) throws Throwable { return return_J(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
-    }
-    static class A10 extends Adapter {
-        protected A10(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
-        protected A10(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); }
-        protected A10 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A10(e, i, c, t); }
-        protected Object target(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9)   throws Throwable { return invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
-        protected Object targetA10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
-        protected Object targetA10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, long   a9) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
-        protected Object targetA10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, long   a8, long   a9) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
-        protected Object targetA10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long   a7, long   a8, long   a9) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
-        protected Object targetA10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long   a6, long   a7, long   a8, long   a9) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
-        protected Object targetA10(Object a0, Object a1, Object a2, Object a3, Object a4, long   a5, long   a6, long   a7, long   a8, long   a9) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
-        protected Object targetA10(Object a0, Object a1, Object a2, Object a3, long   a4, long   a5, long   a6, long   a7, long   a8, long   a9) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
-        protected Object targetA10(Object a0, Object a1, Object a2, long   a3, long   a4, long   a5, long   a6, long   a7, long   a8, long   a9) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
-        protected Object targetA10(Object a0, Object a1, long   a2, long   a3, long   a4, long   a5, long   a6, long   a7, long   a8, long   a9) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
-        protected Object targetA10(Object a0, long   a1, long   a2, long   a3, long   a4, long   a5, long   a6, long   a7, long   a8, long   a9) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
-        protected Object targetA10(long   a0, long   a1, long   a2, long   a3, long   a4, long   a5, long   a6, long   a7, long   a8, long   a9) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
-        protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return return_L(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
-        protected int    invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return return_I(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
-        protected long   invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return return_J(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
-        protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, long   a9) throws Throwable { return return_L(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
-        protected int    invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, long   a9) throws Throwable { return return_I(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
-        protected long   invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, long   a9) throws Throwable { return return_J(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
-        protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, long   a8, long   a9) throws Throwable { return return_L(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
-        protected int    invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, long   a8, long   a9) throws Throwable { return return_I(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
-        protected long   invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, long   a8, long   a9) throws Throwable { return return_J(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
-        protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long   a7, long   a8, long   a9) throws Throwable { return return_L(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
-        protected int    invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long   a7, long   a8, long   a9) throws Throwable { return return_I(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
-        protected long   invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long   a7, long   a8, long   a9) throws Throwable { return return_J(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
-        protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long   a6, long   a7, long   a8, long   a9) throws Throwable { return return_L(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
-        protected int    invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long   a6, long   a7, long   a8, long   a9) throws Throwable { return return_I(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
-        protected long   invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long   a6, long   a7, long   a8, long   a9) throws Throwable { return return_J(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
-        protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, long   a5, long   a6, long   a7, long   a8, long   a9) throws Throwable { return return_L(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
-        protected int    invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, long   a5, long   a6, long   a7, long   a8, long   a9) throws Throwable { return return_I(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
-        protected long   invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, long   a5, long   a6, long   a7, long   a8, long   a9) throws Throwable { return return_J(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
-        protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, long   a4, long   a5, long   a6, long   a7, long   a8, long   a9) throws Throwable { return return_L(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
-        protected int    invoke_I(Object a0, Object a1, Object a2, Object a3, long   a4, long   a5, long   a6, long   a7, long   a8, long   a9) throws Throwable { return return_I(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
-        protected long   invoke_J(Object a0, Object a1, Object a2, Object a3, long   a4, long   a5, long   a6, long   a7, long   a8, long   a9) throws Throwable { return return_J(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
-        protected Object invoke_L(Object a0, Object a1, Object a2, long   a3, long   a4, long   a5, long   a6, long   a7, long   a8, long   a9) throws Throwable { return return_L(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
-        protected int    invoke_I(Object a0, Object a1, Object a2, long   a3, long   a4, long   a5, long   a6, long   a7, long   a8, long   a9) throws Throwable { return return_I(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
-        protected long   invoke_J(Object a0, Object a1, Object a2, long   a3, long   a4, long   a5, long   a6, long   a7, long   a8, long   a9) throws Throwable { return return_J(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
-        protected Object invoke_L(Object a0, Object a1, long   a2, long   a3, long   a4, long   a5, long   a6, long   a7, long   a8, long   a9) throws Throwable { return return_L(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
-        protected int    invoke_I(Object a0, Object a1, long   a2, long   a3, long   a4, long   a5, long   a6, long   a7, long   a8, long   a9) throws Throwable { return return_I(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
-        protected long   invoke_J(Object a0, Object a1, long   a2, long   a3, long   a4, long   a5, long   a6, long   a7, long   a8, long   a9) throws Throwable { return return_J(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
-        protected Object invoke_L(Object a0, long   a1, long   a2, long   a3, long   a4, long   a5, long   a6, long   a7, long   a8, long   a9) throws Throwable { return return_L(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
-        protected int    invoke_I(Object a0, long   a1, long   a2, long   a3, long   a4, long   a5, long   a6, long   a7, long   a8, long   a9) throws Throwable { return return_I(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
-        protected long   invoke_J(Object a0, long   a1, long   a2, long   a3, long   a4, long   a5, long   a6, long   a7, long   a8, long   a9) throws Throwable { return return_J(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
-        protected Object invoke_L(long   a0, long   a1, long   a2, long   a3, long   a4, long   a5, long   a6, long   a7, long   a8, long   a9) throws Throwable { return return_L(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
-        protected int    invoke_I(long   a0, long   a1, long   a2, long   a3, long   a4, long   a5, long   a6, long   a7, long   a8, long   a9) throws Throwable { return return_I(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
-        protected long   invoke_J(long   a0, long   a1, long   a2, long   a3, long   a4, long   a5, long   a6, long   a7, long   a8, long   a9) throws Throwable { return return_J(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
-    }
-}
--- a/src/share/classes/java/lang/invoke/WrongMethodTypeException.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/lang/invoke/WrongMethodTypeException.java	Fri Jun 21 19:11:42 2013 -0700
@@ -59,4 +59,27 @@
     public WrongMethodTypeException(String s) {
         super(s);
     }
+
+    /**
+     * Constructs a {@code WrongMethodTypeException} with the specified
+     * detail message and cause.
+     *
+     * @param s the detail message.
+     * @param cause the cause of the exception, or null.
+     */
+    //FIXME: make this public in MR1
+    /*non-public*/ WrongMethodTypeException(String s, Throwable cause) {
+        super(s, cause);
+    }
+
+    /**
+     * Constructs a {@code WrongMethodTypeException} with the specified
+     * cause.
+     *
+     * @param cause the cause of the exception, or null.
+     */
+    //FIXME: make this public in MR1
+    /*non-public*/ WrongMethodTypeException(Throwable cause) {
+        super(cause);
+    }
 }
--- a/src/share/classes/java/lang/invoke/package-info.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/lang/invoke/package-info.java	Fri Jun 21 19:11:42 2013 -0700
@@ -191,6 +191,13 @@
  * (If a string constant were passed instead, by badly generated code, that cast would then fail,
  * resulting in a {@code BootstrapMethodError}.)
  * <p>
+ * Note that, as a consequence of the above rules, the bootstrap method may accept a primitive
+ * argument, if it can be represented by a constant pool entry.
+ * However, arguments of type {@code boolean}, {@code byte}, {@code short}, or {@code char}
+ * cannot be created for bootstrap methods, since such constants cannot be directly
+ * represented in the constant pool, and the invocation of the bootstrap method will
+ * not perform the necessary narrowing primitive conversions.
+ * <p>
  * Extra bootstrap method arguments are intended to allow language implementors
  * to safely and compactly encode metadata.
  * In principle, the name and extra arguments are redundant,
--- a/src/share/classes/java/net/HttpCookie.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/net/HttpCookie.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -30,6 +30,8 @@
 import java.util.NoSuchElementException;
 import java.text.SimpleDateFormat;
 import java.util.TimeZone;
+import java.util.Calendar;
+import java.util.GregorianCalendar;
 import java.util.Date;
 
 import java.lang.NullPointerException;  // for javadoc
@@ -105,7 +107,10 @@
     private final static String[] COOKIE_DATE_FORMATS = {
         "EEE',' dd-MMM-yyyy HH:mm:ss 'GMT'",
         "EEE',' dd MMM yyyy HH:mm:ss 'GMT'",
-        "EEE MMM dd yyyy HH:mm:ss 'GMT'Z"
+        "EEE MMM dd yyyy HH:mm:ss 'GMT'Z",
+        "EEE',' dd-MMM-yy HH:mm:ss 'GMT'",
+        "EEE',' dd MMM yy HH:mm:ss 'GMT'",
+        "EEE MMM dd yy HH:mm:ss 'GMT'Z"
     };
 
     //
@@ -1125,12 +1130,29 @@
      *                          time and the time specified by dateString
      */
     private long expiryDate2DeltaSeconds(String dateString) {
+        Calendar cal = new GregorianCalendar(GMT);
         for (int i = 0; i < COOKIE_DATE_FORMATS.length; i++) {
-            SimpleDateFormat df = new SimpleDateFormat(COOKIE_DATE_FORMATS[i], Locale.US);
+            SimpleDateFormat df = new SimpleDateFormat(COOKIE_DATE_FORMATS[i],
+                                                       Locale.US);
+            cal.set(1970, 0, 1, 0, 0, 0);
             df.setTimeZone(GMT);
+            df.setLenient(false);
+            df.set2DigitYearStart(cal.getTime());
             try {
-                Date date = df.parse(dateString);
-                return (date.getTime() - whenCreated) / 1000;
+                cal.setTime(df.parse(dateString));
+                if (!COOKIE_DATE_FORMATS[i].contains("yyyy")) {
+                    // 2-digit years following the standard set
+                    // out it rfc 6265
+                    int year = cal.get(Calendar.YEAR);
+                    year %= 100;
+                    if (year < 70) {
+                        year += 2000;
+                    } else {
+                        year += 1900;
+                    }
+                    cal.set(Calendar.YEAR, year);
+                }
+                return (cal.getTimeInMillis() - whenCreated) / 1000;
             } catch (Exception e) {
                 // Ignore, try the next date format
             }
@@ -1139,7 +1161,6 @@
     }
 
 
-
     /*
      * try to guess the cookie version through set-cookie header string
      */
--- a/src/share/classes/java/net/InMemoryCookieStore.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/net/InMemoryCookieStore.java	Fri Jun 21 19:11:42 2013 -0700
@@ -91,8 +91,10 @@
                 if (cookie.getDomain() != null) {
                     addIndex(domainIndex, cookie.getDomain(), cookie);
                 }
-                // add it to uri index, too
-                addIndex(uriIndex, getEffectiveURI(uri), cookie);
+                if (uri != null) {
+                    // add it to uri index, too
+                    addIndex(uriIndex, getEffectiveURI(uri), cookie);
+                }
             }
         } finally {
             lock.unlock();
--- a/src/share/classes/java/net/SocketInputStream.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/net/SocketInputStream.java	Fri Jun 21 19:11:42 2013 -0700
@@ -30,6 +30,7 @@
 import java.io.IOException;
 import java.nio.channels.FileChannel;
 
+import sun.misc.IoTrace;
 import sun.net.ConnectionResetException;
 
 /**
@@ -122,7 +123,7 @@
     }
 
     int read(byte b[], int off, int length, int timeout) throws IOException {
-        int n;
+        int n = 0;
 
         // EOF already encountered
         if (eof) {
@@ -144,6 +145,7 @@
 
         boolean gotReset = false;
 
+        Object traceContext = IoTrace.socketReadBegin();
         // acquire file descriptor and do the read
         FileDescriptor fd = impl.acquireFD();
         try {
@@ -155,6 +157,8 @@
             gotReset = true;
         } finally {
             impl.releaseFD();
+            IoTrace.socketReadEnd(traceContext, impl.address, impl.port,
+                                  timeout, n > 0 ? n : 0);
         }
 
         /*
@@ -162,6 +166,7 @@
          * buffered on the socket
          */
         if (gotReset) {
+            traceContext = IoTrace.socketReadBegin();
             impl.setConnectionResetPending();
             impl.acquireFD();
             try {
@@ -172,6 +177,8 @@
             } catch (ConnectionResetException rstExc) {
             } finally {
                 impl.releaseFD();
+                IoTrace.socketReadEnd(traceContext, impl.address, impl.port,
+                                      timeout, n > 0 ? n : 0);
             }
         }
 
--- a/src/share/classes/java/net/SocketOutputStream.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/net/SocketOutputStream.java	Fri Jun 21 19:11:42 2013 -0700
@@ -30,6 +30,8 @@
 import java.io.IOException;
 import java.nio.channels.FileChannel;
 
+import sun.misc.IoTrace;
+
 /**
  * This stream extends FileOutputStream to implement a
  * SocketOutputStream. Note that this class should <b>NOT</b> be
@@ -104,9 +106,12 @@
             throw new ArrayIndexOutOfBoundsException();
         }
 
+        Object traceContext = IoTrace.socketWriteBegin();
+        int bytesWritten = 0;
         FileDescriptor fd = impl.acquireFD();
         try {
             socketWrite0(fd, b, off, len);
+            bytesWritten = len;
         } catch (SocketException se) {
             if (se instanceof sun.net.ConnectionResetException) {
                 impl.setConnectionResetPending();
@@ -119,6 +124,7 @@
             }
         } finally {
             impl.releaseFD();
+            IoTrace.socketWriteEnd(traceContext, impl.address, impl.port, bytesWritten);
         }
     }
 
--- a/src/share/classes/java/nio/channels/spi/AbstractSelectableChannel.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/nio/channels/spi/AbstractSelectableChannel.java	Fri Jun 21 19:11:42 2013 -0700
@@ -90,27 +90,26 @@
     // -- Utility methods for the key set --
 
     private void addKey(SelectionKey k) {
-        synchronized (keyLock) {
-            int i = 0;
-            if ((keys != null) && (keyCount < keys.length)) {
-                // Find empty element of key array
-                for (i = 0; i < keys.length; i++)
-                    if (keys[i] == null)
-                        break;
-            } else if (keys == null) {
-                keys =  new SelectionKey[3];
-            } else {
-                // Grow key array
-                int n = keys.length * 2;
-                SelectionKey[] ks =  new SelectionKey[n];
-                for (i = 0; i < keys.length; i++)
-                    ks[i] = keys[i];
-                keys = ks;
-                i = keyCount;
-            }
-            keys[i] = k;
-            keyCount++;
+        assert Thread.holdsLock(keyLock);
+        int i = 0;
+        if ((keys != null) && (keyCount < keys.length)) {
+            // Find empty element of key array
+            for (i = 0; i < keys.length; i++)
+                if (keys[i] == null)
+                    break;
+        } else if (keys == null) {
+            keys =  new SelectionKey[3];
+        } else {
+            // Grow key array
+            int n = keys.length * 2;
+            SelectionKey[] ks =  new SelectionKey[n];
+            for (i = 0; i < keys.length; i++)
+                ks[i] = keys[i];
+            keys = ks;
+            i = keyCount;
         }
+        keys[i] = k;
+        keyCount++;
     }
 
     private SelectionKey findKey(Selector sel) {
@@ -190,11 +189,11 @@
                                        Object att)
         throws ClosedChannelException
     {
-        if (!isOpen())
-            throw new ClosedChannelException();
-        if ((ops & ~validOps()) != 0)
-            throw new IllegalArgumentException();
         synchronized (regLock) {
+            if (!isOpen())
+                throw new ClosedChannelException();
+            if ((ops & ~validOps()) != 0)
+                throw new IllegalArgumentException();
             if (blocking)
                 throw new IllegalBlockingModeException();
             SelectionKey k = findKey(sel);
@@ -204,8 +203,12 @@
             }
             if (k == null) {
                 // New registration
-                k = ((AbstractSelector)sel).register(this, ops, att);
-                addKey(k);
+                synchronized (keyLock) {
+                    if (!isOpen())
+                        throw new ClosedChannelException();
+                    k = ((AbstractSelector)sel).register(this, ops, att);
+                    addKey(k);
+                }
             }
             return k;
         }
@@ -275,9 +278,9 @@
     public final SelectableChannel configureBlocking(boolean block)
         throws IOException
     {
-        if (!isOpen())
-            throw new ClosedChannelException();
         synchronized (regLock) {
+            if (!isOpen())
+                throw new ClosedChannelException();
             if (blocking == block)
                 return this;
             if (block && haveValidKeys())
--- a/src/share/classes/java/security/Signature.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/security/Signature.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -658,7 +658,7 @@
         throws SignatureException {
         if (state == VERIFY) {
             if ((signature == null) || (offset < 0) || (length < 0) ||
-                (offset + length > signature.length)) {
+                (length > signature.length - offset)) {
                 throw new IllegalArgumentException("Bad arguments");
             }
 
--- a/src/share/classes/java/text/CalendarBuilder.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/text/CalendarBuilder.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -91,6 +91,15 @@
         return field[index] > UNSET;
     }
 
+    CalendarBuilder clear(int index) {
+        if (index == ISO_DAY_OF_WEEK) {
+            index = DAY_OF_WEEK;
+        }
+        field[index] = UNSET;
+        field[MAX_FIELD + index] = 0;
+        return this;
+    }
+
     Calendar establish(Calendar cal) {
         boolean weekDate = isSet(WEEK_YEAR)
                             && field[WEEK_YEAR] > field[YEAR];
--- a/src/share/classes/java/text/DateFormatSymbols.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/text/DateFormatSymbols.java	Fri Jun 21 19:11:42 2013 -0700
@@ -647,6 +647,8 @@
     private static final ConcurrentMap<Locale, SoftReference<DateFormatSymbols>> cachedInstances
         = new ConcurrentHashMap<Locale, SoftReference<DateFormatSymbols>>(3);
 
+    private transient int lastZoneIndex = 0;
+
     private void initializeData(Locale desiredLocale) {
         locale = desiredLocale;
 
@@ -692,12 +694,24 @@
      * the given time zone ID can't be located in the DateFormatSymbols object.
      * @see java.util.SimpleTimeZone
      */
-    final int getZoneIndex(String ID)
-    {
+    final int getZoneIndex(String ID) {
         String[][] zoneStrings = getZoneStringsWrapper();
-        for (int index=0; index<zoneStrings.length; index++)
-        {
-            if (ID.equals(zoneStrings[index][0])) return index;
+
+        /*
+         * getZoneIndex has been re-written for performance reasons. instead of
+         * traversing the zoneStrings array every time, we cache the last used zone
+         * index
+         */
+        if (lastZoneIndex < zoneStrings.length && ID.equals(zoneStrings[lastZoneIndex][0])) {
+            return lastZoneIndex;
+        }
+
+        /* slow path, search entire list */
+        for (int index = 0; index < zoneStrings.length; index++) {
+            if (ID.equals(zoneStrings[index][0])) {
+                lastZoneIndex = index;
+                return index;
+            }
         }
 
         return -1;
--- a/src/share/classes/java/text/SimpleDateFormat.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/text/SimpleDateFormat.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -1646,7 +1646,7 @@
             // determine the local time. (6645292)
             int dstAmount = (nameIndex >= 3) ? tz.getDSTSavings() : 0;
             if (!(useSameName || (nameIndex >= 3 && dstAmount == 0))) {
-                calb.set(Calendar.DST_OFFSET, dstAmount);
+                calb.clear(Calendar.ZONE_OFFSET).set(Calendar.DST_OFFSET, dstAmount);
             }
             return (start + zoneNames[nameIndex].length());
         }
--- a/src/share/classes/java/util/AbstractCollection.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/util/AbstractCollection.java	Fri Jun 21 19:11:42 2013 -0700
@@ -180,13 +180,21 @@
 
         for (int i = 0; i < r.length; i++) {
             if (! it.hasNext()) { // fewer elements than expected
-                if (a != r)
+                if (a == r) {
+                    r[i] = null; // null-terminate
+                } else if (a.length < i) {
                     return Arrays.copyOf(r, i);
-                r[i] = null; // null-terminate
-                return r;
+                } else {
+                    System.arraycopy(r, 0, a, 0, i);
+                    if (a.length > i) {
+                        a[i] = null;
+                    }
+                }
+                return a;
             }
             r[i] = (T)it.next();
         }
+        // more elements than expected
         return it.hasNext() ? finishToArray(r, it) : r;
     }
 
--- a/src/share/classes/java/util/ArrayList.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/util/ArrayList.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -105,8 +105,20 @@
     private static final long serialVersionUID = 8683452581122892189L;
 
     /**
+     * Default initial capacity.
+     */
+    private static final int DEFAULT_CAPACITY = 10;
+
+    /**
+     * Shared empty array instance used for empty instances.
+     */
+    private static final Object[] EMPTY_ELEMENTDATA = {};
+
+    /**
      * The array buffer into which the elements of the ArrayList are stored.
-     * The capacity of the ArrayList is the length of this array buffer.
+     * The capacity of the ArrayList is the length of this array buffer. Any
+     * empty ArrayList with elementData == EMPTY_ELEMENTDATA will be expanded to
+     * DEFAULT_CAPACITY when the first element is added.
      */
     private transient Object[] elementData;
 
@@ -136,7 +148,8 @@
      * Constructs an empty list with an initial capacity of ten.
      */
     public ArrayList() {
-        this(10);
+        super();
+        this.elementData = EMPTY_ELEMENTDATA;
     }
 
     /**
@@ -162,8 +175,7 @@
      */
     public void trimToSize() {
         modCount++;
-        int oldCapacity = elementData.length;
-        if (size < oldCapacity) {
+        if (size < elementData.length) {
             elementData = Arrays.copyOf(elementData, size);
         }
     }
@@ -176,12 +188,29 @@
      * @param   minCapacity   the desired minimum capacity
      */
     public void ensureCapacity(int minCapacity) {
-        if (minCapacity > 0)
-            ensureCapacityInternal(minCapacity);
+        int minExpand = (elementData != EMPTY_ELEMENTDATA)
+            // any size if real element table
+            ? 0
+            // larger than default for empty table. It's already supposed to be
+            // at default size.
+            : DEFAULT_CAPACITY;
+
+        if (minCapacity > minExpand) {
+            ensureExplicitCapacity(minCapacity);
+        }
     }
 
     private void ensureCapacityInternal(int minCapacity) {
+        if (elementData == EMPTY_ELEMENTDATA) {
+            minCapacity = Math.max(DEFAULT_CAPACITY, minCapacity);
+        }
+
+        ensureExplicitCapacity(minCapacity);
+    }
+
+    private void ensureExplicitCapacity(int minCapacity) {
         modCount++;
+
         // overflow-conscious code
         if (minCapacity - elementData.length > 0)
             grow(minCapacity);
@@ -451,7 +480,7 @@
         if (numMoved > 0)
             System.arraycopy(elementData, index+1, elementData, index,
                              numMoved);
-        elementData[--size] = null; // Let gc do its work
+        elementData[--size] = null; // clear to let GC do its work
 
         return oldValue;
     }
@@ -496,7 +525,7 @@
         if (numMoved > 0)
             System.arraycopy(elementData, index+1, elementData, index,
                              numMoved);
-        elementData[--size] = null; // Let gc do its work
+        elementData[--size] = null; // clear to let GC do its work
     }
 
     /**
@@ -506,7 +535,7 @@
     public void clear() {
         modCount++;
 
-        // Let gc do its work
+        // clear to let GC do its work
         for (int i = 0; i < size; i++)
             elementData[i] = null;
 
@@ -587,10 +616,12 @@
         System.arraycopy(elementData, toIndex, elementData, fromIndex,
                          numMoved);
 
-        // Let gc do its work
+        // clear to let GC do its work
         int newSize = size - (toIndex-fromIndex);
-        while (size != newSize)
-            elementData[--size] = null;
+        for (int i = newSize; i < size; i++) {
+            elementData[i] = null;
+        }
+        size = newSize;
     }
 
     /**
@@ -678,6 +709,7 @@
                 w += size - r;
             }
             if (w != size) {
+                // clear to let GC do its work
                 for (int i = w; i < size; i++)
                     elementData[i] = null;
                 modCount += size - w;
@@ -702,17 +734,17 @@
         int expectedModCount = modCount;
         s.defaultWriteObject();
 
-        // Write out array length
-        s.writeInt(elementData.length);
+        // Write out size as capacity for behavioural compatibility with clone()
+        s.writeInt(size);
 
         // Write out all elements in the proper order.
-        for (int i=0; i<size; i++)
+        for (int i=0; i<size; i++) {
             s.writeObject(elementData[i]);
+        }
 
         if (modCount != expectedModCount) {
             throw new ConcurrentModificationException();
         }
-
     }
 
     /**
@@ -721,16 +753,24 @@
      */
     private void readObject(java.io.ObjectInputStream s)
         throws java.io.IOException, ClassNotFoundException {
+        elementData = EMPTY_ELEMENTDATA;
+
         // Read in size, and any hidden stuff
         s.defaultReadObject();
 
-        // Read in array length and allocate array
-        int arrayLength = s.readInt();
-        Object[] a = elementData = new Object[arrayLength];
+        // Read in capacity
+        s.readInt(); // ignored
+
+        if (size > 0) {
+            // be like clone(), allocate array based upon size not capacity
+            ensureCapacityInternal(size);
 
-        // Read in all elements in the proper order.
-        for (int i=0; i<size; i++)
-            a[i] = s.readObject();
+            Object[] a = elementData;
+            // Read in all elements in the proper order.
+            for (int i=0; i<size; i++) {
+                a[i] = s.readObject();
+            }
+        }
     }
 
     /**
--- a/src/share/classes/java/util/EnumMap.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/util/EnumMap.java	Fri Jun 21 19:11:42 2013 -0700
@@ -729,6 +729,7 @@
             throw new AssertionError();
         }
         result.vals = result.vals.clone();
+        result.entrySet = null;
         return result;
     }
 
--- a/src/share/classes/java/util/HashMap.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/util/HashMap.java	Fri Jun 21 19:11:42 2013 -0700
@@ -129,7 +129,7 @@
     /**
      * The default initial capacity - MUST be a power of two.
      */
-    static final int DEFAULT_INITIAL_CAPACITY = 16;
+    static final int DEFAULT_INITIAL_CAPACITY = 1 << 4; // aka 16
 
     /**
      * The maximum capacity, used if a higher value is implicitly specified
@@ -144,9 +144,14 @@
     static final float DEFAULT_LOAD_FACTOR = 0.75f;
 
     /**
+     * An empty table instance to share when the table is not inflated.
+     */
+    static final Entry<?,?>[] EMPTY_TABLE = {};
+
+    /**
      * The table, resized as necessary. Length MUST Always be a power of two.
      */
-    transient Entry<K,V>[] table;
+    transient Entry<K,V>[] table = (Entry<K,V>[]) EMPTY_TABLE;
 
     /**
      * The number of key-value mappings contained in this map.
@@ -157,6 +162,8 @@
      * The next size value at which to resize (capacity * load factor).
      * @serial
      */
+    // If table == EMPTY_TABLE then this is the initial capacity at which the
+    // table will be created when inflated.
     int threshold;
 
     /**
@@ -192,17 +199,6 @@
      */
     private static class Holder {
 
-            // Unsafe mechanics
-        /**
-         * Unsafe utilities
-         */
-        static final sun.misc.Unsafe UNSAFE;
-
-        /**
-         * Offset of "final" hashSeed field we must set in readObject() method.
-         */
-        static final long HASHSEED_OFFSET;
-
         /**
          * Table capacity above which to switch to use alternative hashing.
          */
@@ -230,29 +226,17 @@
             } catch(IllegalArgumentException failed) {
                 throw new Error("Illegal value for 'jdk.map.althashing.threshold'", failed);
             }
+
             ALTERNATIVE_HASHING_THRESHOLD = threshold;
-
-            try {
-                UNSAFE = sun.misc.Unsafe.getUnsafe();
-                HASHSEED_OFFSET = UNSAFE.objectFieldOffset(
-                    HashMap.class.getDeclaredField("hashSeed"));
-            } catch (NoSuchFieldException | SecurityException e) {
-                throw new Error("Failed to record hashSeed offset", e);
-            }
         }
     }
 
     /**
-     * If {@code true} then perform alternative hashing of String keys to reduce
-     * the incidence of collisions due to weak hash code calculation.
+     * A randomizing value associated with this instance that is applied to
+     * hash code of keys to make hash collisions harder to find. If 0 then
+     * alternative hashing is disabled.
      */
-    transient boolean useAltHashing;
-
-    /**
-     * A randomizing value associated with this instance that is applied to
-     * hash code of keys to make hash collisions harder to find.
-     */
-    transient final int hashSeed = sun.misc.Hashing.randomHashSeed(this);
+    transient int hashSeed = 0;
 
     /**
      * Constructs an empty <tt>HashMap</tt> with the specified initial
@@ -273,16 +257,8 @@
             throw new IllegalArgumentException("Illegal load factor: " +
                                                loadFactor);
 
-        // Find a power of 2 >= initialCapacity
-        int capacity = 1;
-        while (capacity < initialCapacity)
-            capacity <<= 1;
-
         this.loadFactor = loadFactor;
-        threshold = (int)Math.min(capacity * loadFactor, MAXIMUM_CAPACITY + 1);
-        table = new Entry[capacity];
-        useAltHashing = sun.misc.VM.isBooted() &&
-                (capacity >= Holder.ALTERNATIVE_HASHING_THRESHOLD);
+        threshold = initialCapacity;
         init();
     }
 
@@ -317,9 +293,34 @@
     public HashMap(Map<? extends K, ? extends V> m) {
         this(Math.max((int) (m.size() / DEFAULT_LOAD_FACTOR) + 1,
                       DEFAULT_INITIAL_CAPACITY), DEFAULT_LOAD_FACTOR);
+        inflateTable(threshold);
+
         putAllForCreate(m);
     }
 
+    private static int roundUpToPowerOf2(int number) {
+        // assert number >= 0 : "number must be non-negative";
+        int rounded = number >= MAXIMUM_CAPACITY
+                ? MAXIMUM_CAPACITY
+                : (rounded = Integer.highestOneBit(number)) != 0
+                    ? (Integer.bitCount(number) > 1) ? rounded << 1 : rounded
+                    : 1;
+
+        return rounded;
+    }
+
+    /**
+     * Inflates the table.
+     */
+    private void inflateTable(int toSize) {
+        // Find a power of 2 >= toSize
+        int capacity = roundUpToPowerOf2(toSize);
+
+        threshold = (int) Math.min(capacity * loadFactor, MAXIMUM_CAPACITY + 1);
+        table = new Entry[capacity];
+        initHashSeedAsNeeded(capacity);
+    }
+
     // internal utilities
 
     /**
@@ -333,6 +334,23 @@
     }
 
     /**
+     * Initialize the hashing mask value. We defer initialization until we
+     * really need it.
+     */
+    final boolean initHashSeedAsNeeded(int capacity) {
+        boolean currentAltHashing = hashSeed != 0;
+        boolean useAltHashing = sun.misc.VM.isBooted() &&
+                (capacity >= Holder.ALTERNATIVE_HASHING_THRESHOLD);
+        boolean switching = currentAltHashing ^ useAltHashing;
+        if (switching) {
+            hashSeed = useAltHashing
+                ? sun.misc.Hashing.randomHashSeed(this)
+                : 0;
+        }
+        return switching;
+    }
+
+    /**
      * Retrieve object hash code and applies a supplemental hash function to the
      * result hash, which defends against poor quality hash functions.  This is
      * critical because HashMap uses power-of-two length hash tables, that
@@ -340,12 +358,9 @@
      * in lower bits. Note: Null keys always map to hash 0, thus index 0.
      */
     final int hash(Object k) {
-        int h = 0;
-        if (useAltHashing) {
-            if (k instanceof String) {
-                return sun.misc.Hashing.stringHash32((String) k);
-            }
-            h = hashSeed;
+        int h = hashSeed;
+        if (0 != h && k instanceof String) {
+            return sun.misc.Hashing.stringHash32((String) k);
         }
 
         h ^= k.hashCode();
@@ -361,6 +376,7 @@
      * Returns index for hash code h.
      */
     static int indexFor(int h, int length) {
+        // assert Integer.bitCount(length) == 1 : "length must be a non-zero power of 2";
         return h & (length-1);
     }
 
@@ -415,6 +431,9 @@
      * others.
      */
     private V getForNullKey() {
+        if (isEmpty()) {
+            return null;
+        }
         for (Entry<K,V> e = table[0]; e != null; e = e.next) {
             if (e.key == null)
                 return e.value;
@@ -440,6 +459,10 @@
      * for the key.
      */
     final Entry<K,V> getEntry(Object key) {
+        if (isEmpty()) {
+            return null;
+        }
+
         int hash = (key == null) ? 0 : hash(key);
         for (Entry<K,V> e = table[indexFor(hash, table.length)];
              e != null;
@@ -452,7 +475,6 @@
         return null;
     }
 
-
     /**
      * Associates the specified value with the specified key in this map.
      * If the map previously contained a mapping for the key, the old
@@ -466,6 +488,9 @@
      *         previously associated <tt>null</tt> with <tt>key</tt>.)
      */
     public V put(K key, V value) {
+        if (table == EMPTY_TABLE) {
+            inflateTable(threshold);
+        }
         if (key == null)
             return putForNullKey(value);
         int hash = hash(key);
@@ -557,11 +582,7 @@
         }
 
         Entry[] newTable = new Entry[newCapacity];
-        boolean oldAltHashing = useAltHashing;
-        useAltHashing |= sun.misc.VM.isBooted() &&
-                (newCapacity >= Holder.ALTERNATIVE_HASHING_THRESHOLD);
-        boolean rehash = oldAltHashing ^ useAltHashing;
-        transfer(newTable, rehash);
+        transfer(newTable, initHashSeedAsNeeded(newCapacity));
         table = newTable;
         threshold = (int)Math.min(newCapacity * loadFactor, MAXIMUM_CAPACITY + 1);
     }
@@ -598,6 +619,10 @@
         if (numKeysToBeAdded == 0)
             return;
 
+        if (table == EMPTY_TABLE) {
+            inflateTable((int) Math.max(numKeysToBeAdded * loadFactor, threshold));
+        }
+
         /*
          * Expand the map if the map if the number of mappings to be added
          * is greater than or equal to threshold.  This is conservative; the
@@ -642,6 +667,9 @@
      * for this key.
      */
     final Entry<K,V> removeEntryForKey(Object key) {
+        if (isEmpty()) {
+            return null;
+        }
         int hash = (key == null) ? 0 : hash(key);
         int i = indexFor(hash, table.length);
         Entry<K,V> prev = table[i];
@@ -673,7 +701,7 @@
      * for matching.
      */
     final Entry<K,V> removeMapping(Object o) {
-        if (!(o instanceof Map.Entry))
+        if (isEmpty() || !(o instanceof Map.Entry))
             return null;
 
         Map.Entry<K,V> entry = (Map.Entry<K,V>) o;
@@ -708,9 +736,7 @@
      */
     public void clear() {
         modCount++;
-        Entry[] tab = table;
-        for (int i = 0; i < tab.length; i++)
-            tab[i] = null;
+        Arrays.fill(table, null);
         size = 0;
     }
 
@@ -759,7 +785,14 @@
         } catch (CloneNotSupportedException e) {
             // assert false;
         }
-        result.table = new Entry[table.length];
+        if (result.table != EMPTY_TABLE) {
+            result.inflateTable(Math.min(
+                (int) Math.min(
+                    size * Math.min(1 / loadFactor, 4.0f),
+                    // we have limits...
+                    HashMap.MAXIMUM_CAPACITY),
+               table.length));
+        }
         result.entrySet = null;
         result.modCount = 0;
         result.size = 0;
@@ -815,8 +848,7 @@
         }
 
         public final int hashCode() {
-            return (key==null   ? 0 : key.hashCode()) ^
-                   (value==null ? 0 : value.hashCode());
+            return Objects.hashCode(getKey()) ^ Objects.hashCode(getValue());
         }
 
         public final String toString() {
@@ -1081,14 +1113,15 @@
     private void writeObject(java.io.ObjectOutputStream s)
         throws IOException
     {
-        Iterator<Map.Entry<K,V>> i =
-            (size > 0) ? entrySet0().iterator() : null;
-
         // Write out the threshold, loadfactor, and any hidden stuff
         s.defaultWriteObject();
 
         // Write out number of buckets
-        s.writeInt(table.length);
+        if (table==EMPTY_TABLE) {
+            s.writeInt(roundUpToPowerOf2(threshold));
+        } else {
+           s.writeInt(table.length);
+        }
 
         // Write out size (number of Mappings)
         s.writeInt(size);
@@ -1113,16 +1146,16 @@
     {
         // Read in the threshold (ignored), loadfactor, and any hidden stuff
         s.defaultReadObject();
-        if (loadFactor <= 0 || Float.isNaN(loadFactor))
+        if (loadFactor <= 0 || Float.isNaN(loadFactor)) {
             throw new InvalidObjectException("Illegal load factor: " +
                                                loadFactor);
+        }
 
-        // set hashSeed (can only happen after VM boot)
-        Holder.UNSAFE.putIntVolatile(this, Holder.HASHSEED_OFFSET,
-                sun.misc.Hashing.randomHashSeed(this));
+        // set other fields that need values
+        table = (Entry<K,V>[]) EMPTY_TABLE;
 
-        // Read in number of buckets and allocate the bucket array;
-        s.readInt(); // ignored
+        // Read in number of buckets
+        s.readInt(); // ignored.
 
         // Read number of mappings
         int mappings = s.readInt();
@@ -1130,27 +1163,23 @@
             throw new InvalidObjectException("Illegal mappings count: " +
                                                mappings);
 
-        int initialCapacity = (int) Math.min(
-                // capacity chosen by number of mappings
-                // and desired load (if >= 0.25)
-                mappings * Math.min(1 / loadFactor, 4.0f),
-                // we have limits...
-                HashMap.MAXIMUM_CAPACITY);
-        int capacity = 1;
-        // find smallest power of two which holds all mappings
-        while (capacity < initialCapacity) {
-            capacity <<= 1;
+        // capacity chosen by number of mappings and desired load (if >= 0.25)
+        int capacity = (int) Math.min(
+                    mappings * Math.min(1 / loadFactor, 4.0f),
+                    // we have limits...
+                    HashMap.MAXIMUM_CAPACITY);
+
+        // allocate the bucket array;
+        if (mappings > 0) {
+            inflateTable(capacity);
+        } else {
+            threshold = capacity;
         }
 
-        table = new Entry[capacity];
-        threshold = (int) Math.min(capacity * loadFactor, MAXIMUM_CAPACITY + 1);
-        useAltHashing = sun.misc.VM.isBooted() &&
-                (capacity >= Holder.ALTERNATIVE_HASHING_THRESHOLD);
-
         init();  // Give subclass a chance to do its thing.
 
         // Read the keys and values, and put the mappings in the HashMap
-        for (int i=0; i<mappings; i++) {
+        for (int i = 0; i < mappings; i++) {
             K key = (K) s.readObject();
             V value = (V) s.readObject();
             putForCreate(key, value);
--- a/src/share/classes/java/util/Hashtable.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/util/Hashtable.java	Fri Jun 21 19:11:42 2013 -0700
@@ -213,54 +213,30 @@
     }
 
     /**
-     * If {@code true} then perform alternative hashing of String keys to reduce
-     * the incidence of collisions due to weak hash code calculation.
-     */
-    transient boolean useAltHashing;
-
-    // Unsafe mechanics
-    /**
-    * Unsafe utilities
-    */
-    private static final sun.misc.Unsafe UNSAFE;
-
-    /**
-    * Offset of "final" hashSeed field we must set in readObject() method.
-    */
-    private static final long HASHSEED_OFFSET;
-
-     static {
-        try {
-            UNSAFE = sun.misc.Unsafe.getUnsafe();
-            HASHSEED_OFFSET = UNSAFE.objectFieldOffset(
-                Hashtable.class.getDeclaredField("hashSeed"));
-        } catch (NoSuchFieldException | SecurityException e) {
-            throw new Error("Failed to record hashSeed offset", e);
-        }
-     }
-
-    /**
      * A randomizing value associated with this instance that is applied to
      * hash code of keys to make hash collisions harder to find.
      */
-    transient final int hashSeed = sun.misc.Hashing.randomHashSeed(this);
+    transient int hashSeed;
+
+    /**
+     * Initialize the hashing mask value.
+     */
+    final boolean initHashSeedAsNeeded(int capacity) {
+        boolean currentAltHashing = hashSeed != 0;
+        boolean useAltHashing = sun.misc.VM.isBooted() &&
+                (capacity >= Holder.ALTERNATIVE_HASHING_THRESHOLD);
+        boolean switching = currentAltHashing ^ useAltHashing;
+        if (switching) {
+            hashSeed = useAltHashing
+                ? sun.misc.Hashing.randomHashSeed(this)
+                : 0;
+        }
+        return switching;
+    }
 
     private int hash(Object k) {
-        if (useAltHashing) {
-            if (k.getClass() == String.class) {
-                return sun.misc.Hashing.stringHash32((String) k);
-            } else {
-                int h = hashSeed ^ k.hashCode();
-
-                // This function ensures that hashCodes that differ only by
-                // constant multiples at each bit position have a bounded
-                // number of collisions (approximately 8 at default load factor).
-                h ^= (h >>> 20) ^ (h >>> 12);
-                return h ^ (h >>> 7) ^ (h >>> 4);
-             }
-        } else  {
-            return k.hashCode();
-        }
+        // hashSeed will be zero if alternative hashing is disabled.
+        return hashSeed ^ k.hashCode();
     }
 
     /**
@@ -284,8 +260,7 @@
         this.loadFactor = loadFactor;
         table = new Entry[initialCapacity];
         threshold = (int)Math.min(initialCapacity * loadFactor, MAX_ARRAY_SIZE + 1);
-        useAltHashing = sun.misc.VM.isBooted() &&
-                (initialCapacity >= Holder.ALTERNATIVE_HASHING_THRESHOLD);
+        initHashSeedAsNeeded(initialCapacity);
     }
 
     /**
@@ -497,10 +472,7 @@
 
         modCount++;
         threshold = (int)Math.min(newCapacity * loadFactor, MAX_ARRAY_SIZE + 1);
-        boolean currentAltHashing = useAltHashing;
-        useAltHashing = sun.misc.VM.isBooted() &&
-                (newCapacity >= Holder.ALTERNATIVE_HASHING_THRESHOLD);
-        boolean rehash = currentAltHashing ^ useAltHashing;
+        boolean rehash = initHashSeedAsNeeded(newCapacity);
 
         table = newMap;
 
@@ -999,10 +971,6 @@
         // Read in the length, threshold, and loadfactor
         s.defaultReadObject();
 
-        // set hashSeed
-        UNSAFE.putIntVolatile(this, HASHSEED_OFFSET,
-                sun.misc.Hashing.randomHashSeed(this));
-
         // Read the original length of the array and number of elements
         int origlength = s.readInt();
         int elements = s.readInt();
@@ -1017,20 +985,19 @@
         if (origlength > 0 && length > origlength)
             length = origlength;
 
-        Entry<K,V>[] table = new Entry[length];
+        Entry<K,V>[] newTable = new Entry[length];
         threshold = (int) Math.min(length * loadFactor, MAX_ARRAY_SIZE + 1);
         count = 0;
-        useAltHashing = sun.misc.VM.isBooted() &&
-                (length >= Holder.ALTERNATIVE_HASHING_THRESHOLD);
+        initHashSeedAsNeeded(length);
 
         // Read the number of elements and then all the key/value objects
         for (; elements > 0; elements--) {
             K key = (K)s.readObject();
             V value = (V)s.readObject();
             // synch could be eliminated for performance
-            reconstitutionPut(table, key, value);
+            reconstitutionPut(newTable, key, value);
         }
-        this.table = table;
+        this.table = newTable;
     }
 
     /**
@@ -1114,7 +1081,7 @@
         }
 
         public int hashCode() {
-            return hash ^ value.hashCode();
+            return (Objects.hashCode(key) ^ Objects.hashCode(value));
         }
 
         public String toString() {
--- a/src/share/classes/java/util/LocaleISOData.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/util/LocaleISOData.java	Fri Jun 21 19:11:42 2013 -0700
@@ -404,7 +404,7 @@
         + "PG" + "PNG"  // Papua New Guinea
         + "PH" + "PHL"  // Philippines, Republic of the
         + "PK" + "PAK"  // Pakistan, Islamic Republic of
-        + "PL" + "POL"  // Poland, Polish People's Republic
+        + "PL" + "POL"  // Poland, Republic of Poland
         + "PM" + "SPM"  // St. Pierre and Miquelon
         + "PN" + "PCN"  // Pitcairn Island
         + "PR" + "PRI"  // Puerto Rico
--- a/src/share/classes/java/util/TimeZone.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/util/TimeZone.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -162,16 +162,6 @@
     private static final int ONE_HOUR   = 60*ONE_MINUTE;
     private static final int ONE_DAY    = 24*ONE_HOUR;
 
-    /*
-     * Provides access implementation-private methods without using reflection
-     *
-     * Note that javaAWTAccess may be null if sun.awt.AppContext class hasn't
-     * been loaded. If so, it implies that AWTSecurityManager is not our
-     * SecurityManager and we can use a local static variable.
-     * This works around a build time issue.
-     */
-    private static JavaAWTAccess javaAWTAccess;
-
     // Proclaim serialization compatibility with JDK 1.1
     static final long serialVersionUID = 3581463369166924961L;
 
@@ -729,9 +719,15 @@
      * Returns the default TimeZone in an AppContext if any AppContext
      * has ever used. null is returned if any AppContext hasn't been
      * used or if the AppContext doesn't have the default TimeZone.
+     *
+     * Note that javaAWTAccess may be null if sun.awt.AppContext class hasn't
+     * been loaded. If so, it implies that AWTSecurityManager is not our
+     * SecurityManager and we can use a local static variable.
+     * This works around a build time issue.
      */
-    private synchronized static TimeZone getDefaultInAppContext() {
-        javaAWTAccess = SharedSecrets.getJavaAWTAccess();
+    private static TimeZone getDefaultInAppContext() {
+        // JavaAWTAccess provides access implementation-private methods without using reflection.
+        JavaAWTAccess javaAWTAccess = SharedSecrets.getJavaAWTAccess();
         if (javaAWTAccess == null) {
             return mainAppContextDefault;
         } else {
@@ -753,9 +749,15 @@
      * tz. null is handled special: do nothing if any AppContext
      * hasn't been used, remove the default TimeZone in the
      * AppContext otherwise.
+     *
+     * Note that javaAWTAccess may be null if sun.awt.AppContext class hasn't
+     * been loaded. If so, it implies that AWTSecurityManager is not our
+     * SecurityManager and we can use a local static variable.
+     * This works around a build time issue.
      */
-    private synchronized static void setDefaultInAppContext(TimeZone tz) {
-        javaAWTAccess = SharedSecrets.getJavaAWTAccess();
+    private static void setDefaultInAppContext(TimeZone tz) {
+        // JavaAWTAccess provides access implementation-private methods without using reflection.
+        JavaAWTAccess javaAWTAccess = SharedSecrets.getJavaAWTAccess();
         if (javaAWTAccess == null) {
             mainAppContextDefault = tz;
         } else {
@@ -820,7 +822,7 @@
     private static final int    GMT_ID_LENGTH = 3;
 
     // a static TimeZone we can reference if no AppContext is in place
-    private static TimeZone mainAppContextDefault;
+    private static volatile TimeZone mainAppContextDefault;
 
     /**
      * Parses a custom time zone identifier and returns a corresponding zone.
--- a/src/share/classes/java/util/WeakHashMap.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/util/WeakHashMap.java	Fri Jun 21 19:11:42 2013 -0700
@@ -90,7 +90,8 @@
  * from being discarded.  Note that a value object may refer indirectly to its
  * key via the <tt>WeakHashMap</tt> itself; that is, a value object may
  * strongly refer to some other key object whose associated value object, in
- * turn, strongly refers to the key of the first value object.  One way
+ * turn, strongly refers to the key of the first value object.  If the values
+ * in the map do not rely on the map holding strong references to them, one way
  * to deal with this is to wrap values themselves within
  * <tt>WeakReferences</tt> before
  * inserting, as in: <tt>m.put(key, new WeakReference(value))</tt>,
--- a/src/share/classes/java/util/concurrent/FutureTask.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/util/concurrent/FutureTask.java	Fri Jun 21 19:11:42 2013 -0700
@@ -34,51 +34,111 @@
  */
 
 package java.util.concurrent;
-import java.util.concurrent.locks.*;
+import java.util.concurrent.locks.LockSupport;
 
 /**
  * A cancellable asynchronous computation.  This class provides a base
  * implementation of {@link Future}, with methods to start and cancel
  * a computation, query to see if the computation is complete, and
  * retrieve the result of the computation.  The result can only be
- * retrieved when the computation has completed; the <tt>get</tt>
- * method will block if the computation has not yet completed.  Once
+ * retrieved when the computation has completed; the {@code get}
+ * methods will block if the computation has not yet completed.  Once
  * the computation has completed, the computation cannot be restarted
- * or cancelled.
+ * or cancelled (unless the computation is invoked using
+ * {@link #runAndReset}).
  *
- * <p>A <tt>FutureTask</tt> can be used to wrap a {@link Callable} or
- * {@link java.lang.Runnable} object.  Because <tt>FutureTask</tt>
- * implements <tt>Runnable</tt>, a <tt>FutureTask</tt> can be
- * submitted to an {@link Executor} for execution.
+ * <p>A {@code FutureTask} can be used to wrap a {@link Callable} or
+ * {@link Runnable} object.  Because {@code FutureTask} implements
+ * {@code Runnable}, a {@code FutureTask} can be submitted to an
+ * {@link Executor} for execution.
  *
  * <p>In addition to serving as a standalone class, this class provides
- * <tt>protected</tt> functionality that may be useful when creating
+ * {@code protected} functionality that may be useful when creating
  * customized task classes.
  *
  * @since 1.5
  * @author Doug Lea
- * @param <V> The result type returned by this FutureTask's <tt>get</tt> method
+ * @param <V> The result type returned by this FutureTask's {@code get} methods
  */
 public class FutureTask<V> implements RunnableFuture<V> {
-    /** Synchronization control for FutureTask */
-    private final Sync sync;
+    /*
+     * Revision notes: This differs from previous versions of this
+     * class that relied on AbstractQueuedSynchronizer, mainly to
+     * avoid surprising users about retaining interrupt status during
+     * cancellation races. Sync control in the current design relies
+     * on a "state" field updated via CAS to track completion, along
+     * with a simple Treiber stack to hold waiting threads.
+     *
+     * Style note: As usual, we bypass overhead of using
+     * AtomicXFieldUpdaters and instead directly use Unsafe intrinsics.
+     */
 
     /**
-     * Creates a <tt>FutureTask</tt> that will, upon running, execute the
-     * given <tt>Callable</tt>.
+     * The run state of this task, initially NEW.  The run state
+     * transitions to a terminal state only in methods set,
+     * setException, and cancel.  During completion, state may take on
+     * transient values of COMPLETING (while outcome is being set) or
+     * INTERRUPTING (only while interrupting the runner to satisfy a
+     * cancel(true)). Transitions from these intermediate to final
+     * states use cheaper ordered/lazy writes because values are unique
+     * and cannot be further modified.
+     *
+     * Possible state transitions:
+     * NEW -> COMPLETING -> NORMAL
+     * NEW -> COMPLETING -> EXCEPTIONAL
+     * NEW -> CANCELLED
+     * NEW -> INTERRUPTING -> INTERRUPTED
+     */
+    private volatile int state;
+    private static final int NEW          = 0;
+    private static final int COMPLETING   = 1;
+    private static final int NORMAL       = 2;
+    private static final int EXCEPTIONAL  = 3;
+    private static final int CANCELLED    = 4;
+    private static final int INTERRUPTING = 5;
+    private static final int INTERRUPTED  = 6;
+
+    /** The underlying callable; nulled out after running */
+    private Callable<V> callable;
+    /** The result to return or exception to throw from get() */
+    private Object outcome; // non-volatile, protected by state reads/writes
+    /** The thread running the callable; CASed during run() */
+    private volatile Thread runner;
+    /** Treiber stack of waiting threads */
+    private volatile WaitNode waiters;
+
+    /**
+     * Returns result or throws exception for completed task.
+     *
+     * @param s completed state value
+     */
+    @SuppressWarnings("unchecked")
+    private V report(int s) throws ExecutionException {
+        Object x = outcome;
+        if (s == NORMAL)
+            return (V)x;
+        if (s >= CANCELLED)
+            throw new CancellationException();
+        throw new ExecutionException((Throwable)x);
+    }
+
+    /**
+     * Creates a {@code FutureTask} that will, upon running, execute the
+     * given {@code Callable}.
      *
      * @param  callable the callable task
-     * @throws NullPointerException if callable is null
+     * @throws NullPointerException if the callable is null
      */
     public FutureTask(Callable<V> callable) {
         if (callable == null)
             throw new NullPointerException();
-        sync = new Sync(callable);
+        this.callable = callable;
+        this.state = NEW;       // ensure visibility of callable
     }
 
     /**
-     * Creates a <tt>FutureTask</tt> that will, upon running, execute the
-     * given <tt>Runnable</tt>, and arrange that <tt>get</tt> will return the
+     * Creates a {@code FutureTask} that will, upon running, execute the
+     * given {@code Runnable}, and arrange that {@code get} will return the
      * given result on successful completion.
      *
      * @param runnable the runnable task
@@ -86,29 +146,46 @@
      * you don't need a particular result, consider using
      * constructions of the form:
      * {@code Future<?> f = new FutureTask<Void>(runnable, null)}
-     * @throws NullPointerException if runnable is null
+     * @throws NullPointerException if the runnable is null
      */
     public FutureTask(Runnable runnable, V result) {
-        sync = new Sync(Executors.callable(runnable, result));
+        this.callable = Executors.callable(runnable, result);
+        this.state = NEW;       // ensure visibility of callable
     }
 
     public boolean isCancelled() {
-        return sync.innerIsCancelled();
+        return state >= CANCELLED;
     }
 
     public boolean isDone() {
-        return sync.innerIsDone();
+        return state != NEW;
     }
 
     public boolean cancel(boolean mayInterruptIfRunning) {
-        return sync.innerCancel(mayInterruptIfRunning);
+        if (state != NEW)
+            return false;
+        if (mayInterruptIfRunning) {
+            if (!UNSAFE.compareAndSwapInt(this, stateOffset, NEW, INTERRUPTING))
+                return false;
+            Thread t = runner;
+            if (t != null)
+                t.interrupt();
+            UNSAFE.putOrderedInt(this, stateOffset, INTERRUPTED); // final state
+        }
+        else if (!UNSAFE.compareAndSwapInt(this, stateOffset, NEW, CANCELLED))
+            return false;
+        finishCompletion();
+        return true;
     }
 
     /**
      * @throws CancellationException {@inheritDoc}
      */
     public V get() throws InterruptedException, ExecutionException {
-        return sync.innerGet();
+        int s = state;
+        if (s <= COMPLETING)
+            s = awaitDone(false, 0L);
+        return report(s);
     }
 
     /**
@@ -116,12 +193,18 @@
      */
     public V get(long timeout, TimeUnit unit)
         throws InterruptedException, ExecutionException, TimeoutException {
-        return sync.innerGet(unit.toNanos(timeout));
+        if (unit == null)
+            throw new NullPointerException();
+        int s = state;
+        if (s <= COMPLETING &&
+            (s = awaitDone(true, unit.toNanos(timeout))) <= COMPLETING)
+            throw new TimeoutException();
+        return report(s);
     }
 
     /**
      * Protected method invoked when this task transitions to state
-     * <tt>isDone</tt> (whether normally or via cancellation). The
+     * {@code isDone} (whether normally or via cancellation). The
      * default implementation does nothing.  Subclasses may override
      * this method to invoke completion callbacks or perform
      * bookkeeping. Note that you can query status inside the
@@ -131,230 +214,269 @@
     protected void done() { }
 
     /**
-     * Sets the result of this Future to the given value unless
+     * Sets the result of this future to the given value unless
      * this future has already been set or has been cancelled.
-     * This method is invoked internally by the <tt>run</tt> method
+     *
+     * <p>This method is invoked internally by the {@link #run} method
      * upon successful completion of the computation.
+     *
      * @param v the value
      */
     protected void set(V v) {
-        sync.innerSet(v);
+        if (UNSAFE.compareAndSwapInt(this, stateOffset, NEW, COMPLETING)) {
+            outcome = v;
+            UNSAFE.putOrderedInt(this, stateOffset, NORMAL); // final state
+            finishCompletion();
+        }
     }
 
     /**
-     * Causes this future to report an <tt>ExecutionException</tt>
-     * with the given throwable as its cause, unless this Future has
+     * Causes this future to report an {@link ExecutionException}
+     * with the given throwable as its cause, unless this future has
      * already been set or has been cancelled.
-     * This method is invoked internally by the <tt>run</tt> method
+     *
+     * <p>This method is invoked internally by the {@link #run} method
      * upon failure of the computation.
+     *
      * @param t the cause of failure
      */
     protected void setException(Throwable t) {
-        sync.innerSetException(t);
+        if (UNSAFE.compareAndSwapInt(this, stateOffset, NEW, COMPLETING)) {
+            outcome = t;
+            UNSAFE.putOrderedInt(this, stateOffset, EXCEPTIONAL); // final state
+            finishCompletion();
+        }
     }
 
-    // The following (duplicated) doc comment can be removed once
-    //
-    // 6270645: Javadoc comments should be inherited from most derived
-    //          superinterface or superclass
-    // is fixed.
-    /**
-     * Sets this Future to the result of its computation
-     * unless it has been cancelled.
-     */
     public void run() {
-        sync.innerRun();
+        if (state != NEW ||
+            !UNSAFE.compareAndSwapObject(this, runnerOffset,
+                                         null, Thread.currentThread()))
+            return;
+        try {
+            Callable<V> c = callable;
+            if (c != null && state == NEW) {
+                V result;
+                boolean ran;
+                try {
+                    result = c.call();
+                    ran = true;
+                } catch (Throwable ex) {
+                    result = null;
+                    ran = false;
+                    setException(ex);
+                }
+                if (ran)
+                    set(result);
+            }
+        } finally {
+            // runner must be non-null until state is settled to
+            // prevent concurrent calls to run()
+            runner = null;
+            // state must be re-read after nulling runner to prevent
+            // leaked interrupts
+            int s = state;
+            if (s >= INTERRUPTING)
+                handlePossibleCancellationInterrupt(s);
+        }
     }
 
     /**
      * Executes the computation without setting its result, and then
-     * resets this Future to initial state, failing to do so if the
+     * resets this future to initial state, failing to do so if the
      * computation encounters an exception or is cancelled.  This is
      * designed for use with tasks that intrinsically execute more
      * than once.
+     *
      * @return true if successfully run and reset
      */
     protected boolean runAndReset() {
-        return sync.innerRunAndReset();
+        if (state != NEW ||
+            !UNSAFE.compareAndSwapObject(this, runnerOffset,
+                                         null, Thread.currentThread()))
+            return false;
+        boolean ran = false;
+        int s = state;
+        try {
+            Callable<V> c = callable;
+            if (c != null && s == NEW) {
+                try {
+                    c.call(); // don't set result
+                    ran = true;
+                } catch (Throwable ex) {
+                    setException(ex);
+                }
+            }
+        } finally {
+            // runner must be non-null until state is settled to
+            // prevent concurrent calls to run()
+            runner = null;
+            // state must be re-read after nulling runner to prevent
+            // leaked interrupts
+            s = state;
+            if (s >= INTERRUPTING)
+                handlePossibleCancellationInterrupt(s);
+        }
+        return ran && s == NEW;
+    }
+
+    /**
+     * Ensures that any interrupt from a possible cancel(true) is only
+     * delivered to a task while in run or runAndReset.
+     */
+    private void handlePossibleCancellationInterrupt(int s) {
+        // It is possible for our interrupter to stall before getting a
+        // chance to interrupt us.  Let's spin-wait patiently.
+        if (s == INTERRUPTING)
+            while (state == INTERRUPTING)
+                Thread.yield(); // wait out pending interrupt
+
+        // assert state == INTERRUPTED;
+
+        // We want to clear any interrupt we may have received from
+        // cancel(true).  However, it is permissible to use interrupts
+        // as an independent mechanism for a task to communicate with
+        // its caller, and there is no way to clear only the
+        // cancellation interrupt.
+        //
+        // Thread.interrupted();
+    }
+
+    /**
+     * Simple linked list nodes to record waiting threads in a Treiber
+     * stack.  See other classes such as Phaser and SynchronousQueue
+     * for more detailed explanation.
+     */
+    static final class WaitNode {
+        volatile Thread thread;
+        volatile WaitNode next;
+        WaitNode() { thread = Thread.currentThread(); }
     }
 
     /**
-     * Synchronization control for FutureTask. Note that this must be
-     * a non-static inner class in order to invoke the protected
-     * <tt>done</tt> method. For clarity, all inner class support
-     * methods are same as outer, prefixed with "inner".
-     *
-     * Uses AQS sync state to represent run status
+     * Removes and signals all waiting threads, invokes done(), and
+     * nulls out callable.
      */
-    private final class Sync extends AbstractQueuedSynchronizer {
-        private static final long serialVersionUID = -7828117401763700385L;
-
-        /** State value representing that task is ready to run */
-        private static final int READY     = 0;
-        /** State value representing that task is running */
-        private static final int RUNNING   = 1;
-        /** State value representing that task ran */
-        private static final int RAN       = 2;
-        /** State value representing that task was cancelled */
-        private static final int CANCELLED = 4;
-
-        /** The underlying callable */
-        private final Callable<V> callable;
-        /** The result to return from get() */
-        private V result;
-        /** The exception to throw from get() */
-        private Throwable exception;
-
-        /**
-         * The thread running task. When nulled after set/cancel, this
-         * indicates that the results are accessible.  Must be
-         * volatile, to ensure visibility upon completion.
-         */
-        private volatile Thread runner;
-
-        Sync(Callable<V> callable) {
-            this.callable = callable;
-        }
-
-        private boolean ranOrCancelled(int state) {
-            return (state & (RAN | CANCELLED)) != 0;
-        }
-
-        /**
-         * Implements AQS base acquire to succeed if ran or cancelled
-         */
-        protected int tryAcquireShared(int ignore) {
-            return innerIsDone() ? 1 : -1;
-        }
-
-        /**
-         * Implements AQS base release to always signal after setting
-         * final done status by nulling runner thread.
-         */
-        protected boolean tryReleaseShared(int ignore) {
-            runner = null;
-            return true;
-        }
-
-        boolean innerIsCancelled() {
-            return getState() == CANCELLED;
-        }
-
-        boolean innerIsDone() {
-            return ranOrCancelled(getState()) && runner == null;
-        }
-
-        V innerGet() throws InterruptedException, ExecutionException {
-            acquireSharedInterruptibly(0);
-            if (getState() == CANCELLED)
-                throw new CancellationException();
-            if (exception != null)
-                throw new ExecutionException(exception);
-            return result;
-        }
-
-        V innerGet(long nanosTimeout) throws InterruptedException, ExecutionException, TimeoutException {
-            if (!tryAcquireSharedNanos(0, nanosTimeout))
-                throw new TimeoutException();
-            if (getState() == CANCELLED)
-                throw new CancellationException();
-            if (exception != null)
-                throw new ExecutionException(exception);
-            return result;
-        }
-
-        void innerSet(V v) {
-            for (;;) {
-                int s = getState();
-                if (s == RAN)
-                    return;
-                if (s == CANCELLED) {
-                    // aggressively release to set runner to null,
-                    // in case we are racing with a cancel request
-                    // that will try to interrupt runner
-                    releaseShared(0);
-                    return;
+    private void finishCompletion() {
+        // assert state > COMPLETING;
+        for (WaitNode q; (q = waiters) != null;) {
+            if (UNSAFE.compareAndSwapObject(this, waitersOffset, q, null)) {
+                for (;;) {
+                    Thread t = q.thread;
+                    if (t != null) {
+                        q.thread = null;
+                        LockSupport.unpark(t);
+                    }
+                    WaitNode next = q.next;
+                    if (next == null)
+                        break;
+                    q.next = null; // unlink to help gc
+                    q = next;
                 }
-                if (compareAndSetState(s, RAN)) {
-                    result = v;
-                    releaseShared(0);
-                    done();
-                    return;
-                }
+                break;
             }
         }
 
-        void innerSetException(Throwable t) {
-            for (;;) {
-                int s = getState();
-                if (s == RAN)
-                    return;
-                if (s == CANCELLED) {
-                    // aggressively release to set runner to null,
-                    // in case we are racing with a cancel request
-                    // that will try to interrupt runner
-                    releaseShared(0);
-                    return;
-                }
-                if (compareAndSetState(s, RAN)) {
-                    exception = t;
-                    releaseShared(0);
-                    done();
-                    return;
-                }
+        done();
+
+        callable = null;        // to reduce footprint
+    }
+
+    /**
+     * Awaits completion or aborts on interrupt or timeout.
+     *
+     * @param timed true if use timed waits
+     * @param nanos time to wait, if timed
+     * @return state upon completion
+     */
+    private int awaitDone(boolean timed, long nanos)
+        throws InterruptedException {
+        final long deadline = timed ? System.nanoTime() + nanos : 0L;
+        WaitNode q = null;
+        boolean queued = false;
+        for (;;) {
+            if (Thread.interrupted()) {
+                removeWaiter(q);
+                throw new InterruptedException();
             }
-        }
 
-        boolean innerCancel(boolean mayInterruptIfRunning) {
-            for (;;) {
-                int s = getState();
-                if (ranOrCancelled(s))
-                    return false;
-                if (compareAndSetState(s, CANCELLED))
-                    break;
-            }
-            if (mayInterruptIfRunning) {
-                Thread r = runner;
-                if (r != null)
-                    r.interrupt();
+            int s = state;
+            if (s > COMPLETING) {
+                if (q != null)
+                    q.thread = null;
+                return s;
             }
-            releaseShared(0);
-            done();
-            return true;
-        }
-
-        void innerRun() {
-            if (!compareAndSetState(READY, RUNNING))
-                return;
-
-            runner = Thread.currentThread();
-            if (getState() == RUNNING) { // recheck after setting thread
-                V result;
-                try {
-                    result = callable.call();
-                } catch (Throwable ex) {
-                    setException(ex);
-                    return;
+            else if (s == COMPLETING) // cannot time out yet
+                Thread.yield();
+            else if (q == null)
+                q = new WaitNode();
+            else if (!queued)
+                queued = UNSAFE.compareAndSwapObject(this, waitersOffset,
+                                                     q.next = waiters, q);
+            else if (timed) {
+                nanos = deadline - System.nanoTime();
+                if (nanos <= 0L) {
+                    removeWaiter(q);
+                    return state;
                 }
-                set(result);
-            } else {
-                releaseShared(0); // cancel
+                LockSupport.parkNanos(this, nanos);
             }
+            else
+                LockSupport.park(this);
         }
+    }
 
-        boolean innerRunAndReset() {
-            if (!compareAndSetState(READY, RUNNING))
-                return false;
-            try {
-                runner = Thread.currentThread();
-                if (getState() == RUNNING)
-                    callable.call(); // don't set result
-                runner = null;
-                return compareAndSetState(RUNNING, READY);
-            } catch (Throwable ex) {
-                setException(ex);
-                return false;
+    /**
+     * Tries to unlink a timed-out or interrupted wait node to avoid
+     * accumulating garbage.  Internal nodes are simply unspliced
+     * without CAS since it is harmless if they are traversed anyway
+     * by releasers.  To avoid effects of unsplicing from already
+     * removed nodes, the list is retraversed in case of an apparent
+     * race.  This is slow when there are a lot of nodes, but we don't
+     * expect lists to be long enough to outweigh higher-overhead
+     * schemes.
+     */
+    private void removeWaiter(WaitNode node) {
+        if (node != null) {
+            node.thread = null;
+            retry:
+            for (;;) {          // restart on removeWaiter race
+                for (WaitNode pred = null, q = waiters, s; q != null; q = s) {
+                    s = q.next;
+                    if (q.thread != null)
+                        pred = q;
+                    else if (pred != null) {
+                        pred.next = s;
+                        if (pred.thread == null) // check for race
+                            continue retry;
+                    }
+                    else if (!UNSAFE.compareAndSwapObject(this, waitersOffset,
+                                                          q, s))
+                        continue retry;
+                }
+                break;
             }
         }
     }
+
+    // Unsafe mechanics
+    private static final sun.misc.Unsafe UNSAFE;
+    private static final long stateOffset;
+    private static final long runnerOffset;
+    private static final long waitersOffset;
+    static {
+        try {
+            UNSAFE = sun.misc.Unsafe.getUnsafe();
+            Class<?> k = FutureTask.class;
+            stateOffset = UNSAFE.objectFieldOffset
+                (k.getDeclaredField("state"));
+            runnerOffset = UNSAFE.objectFieldOffset
+                (k.getDeclaredField("runner"));
+            waitersOffset = UNSAFE.objectFieldOffset
+                (k.getDeclaredField("waiters"));
+        } catch (Exception e) {
+            throw new Error(e);
+        }
+    }
+
 }
--- a/src/share/classes/java/util/concurrent/PriorityBlockingQueue.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/util/concurrent/PriorityBlockingQueue.java	Fri Jun 21 19:11:42 2013 -0700
@@ -35,7 +35,8 @@
 
 package java.util.concurrent;
 
-import java.util.concurrent.locks.*;
+import java.util.concurrent.locks.Condition;
+import java.util.concurrent.locks.ReentrantLock;
 import java.util.*;
 
 /**
@@ -110,7 +111,7 @@
      * java.util.PriorityQueue operations within a lock, as was done
      * in a previous version of this class. To maintain
      * interoperability, a plain PriorityQueue is still used during
-     * serialization, which maintains compatibility at the espense of
+     * serialization, which maintains compatibility at the expense of
      * transiently doubling overhead.
      */
 
@@ -307,14 +308,13 @@
     /**
      * Mechanics for poll().  Call only while holding lock.
      */
-    private E extract() {
-        E result;
+    private E dequeue() {
         int n = size - 1;
         if (n < 0)
-            result = null;
+            return null;
         else {
             Object[] array = queue;
-            result = (E) array[0];
+            E result = (E) array[0];
             E x = (E) array[n];
             array[n] = null;
             Comparator<? super E> cmp = comparator;
@@ -323,8 +323,8 @@
             else
                 siftDownUsingComparator(0, x, array, n, cmp);
             size = n;
+            return result;
         }
-        return result;
     }
 
     /**
@@ -381,39 +381,43 @@
      */
     private static <T> void siftDownComparable(int k, T x, Object[] array,
                                                int n) {
-        Comparable<? super T> key = (Comparable<? super T>)x;
-        int half = n >>> 1;           // loop while a non-leaf
-        while (k < half) {
-            int child = (k << 1) + 1; // assume left child is least
-            Object c = array[child];
-            int right = child + 1;
-            if (right < n &&
-                ((Comparable<? super T>) c).compareTo((T) array[right]) > 0)
-                c = array[child = right];
-            if (key.compareTo((T) c) <= 0)
-                break;
-            array[k] = c;
-            k = child;
+        if (n > 0) {
+            Comparable<? super T> key = (Comparable<? super T>)x;
+            int half = n >>> 1;           // loop while a non-leaf
+            while (k < half) {
+                int child = (k << 1) + 1; // assume left child is least
+                Object c = array[child];
+                int right = child + 1;
+                if (right < n &&
+                    ((Comparable<? super T>) c).compareTo((T) array[right]) > 0)
+                    c = array[child = right];
+                if (key.compareTo((T) c) <= 0)
+                    break;
+                array[k] = c;
+                k = child;
+            }
+            array[k] = key;
         }
-        array[k] = key;
     }
 
     private static <T> void siftDownUsingComparator(int k, T x, Object[] array,
                                                     int n,
                                                     Comparator<? super T> cmp) {
-        int half = n >>> 1;
-        while (k < half) {
-            int child = (k << 1) + 1;
-            Object c = array[child];
-            int right = child + 1;
-            if (right < n && cmp.compare((T) c, (T) array[right]) > 0)
-                c = array[child = right];
-            if (cmp.compare(x, (T) c) <= 0)
-                break;
-            array[k] = c;
-            k = child;
+        if (n > 0) {
+            int half = n >>> 1;
+            while (k < half) {
+                int child = (k << 1) + 1;
+                Object c = array[child];
+                int right = child + 1;
+                if (right < n && cmp.compare((T) c, (T) array[right]) > 0)
+                    c = array[child = right];
+                if (cmp.compare(x, (T) c) <= 0)
+                    break;
+                array[k] = c;
+                k = child;
+            }
+            array[k] = x;
         }
-        array[k] = x;
     }
 
     /**
@@ -519,13 +523,11 @@
     public E poll() {
         final ReentrantLock lock = this.lock;
         lock.lock();
-        E result;
         try {
-            result = extract();
+            return dequeue();
         } finally {
             lock.unlock();
         }
-        return result;
     }
 
     public E take() throws InterruptedException {
@@ -533,7 +535,7 @@
         lock.lockInterruptibly();
         E result;
         try {
-            while ( (result = extract()) == null)
+            while ( (result = dequeue()) == null)
                 notEmpty.await();
         } finally {
             lock.unlock();
@@ -547,7 +549,7 @@
         lock.lockInterruptibly();
         E result;
         try {
-            while ( (result = extract()) == null && nanos > 0)
+            while ( (result = dequeue()) == null && nanos > 0)
                 nanos = notEmpty.awaitNanos(nanos);
         } finally {
             lock.unlock();
@@ -558,13 +560,11 @@
     public E peek() {
         final ReentrantLock lock = this.lock;
         lock.lock();
-        E result;
         try {
-            result = size > 0 ? (E) queue[0] : null;
+            return (size == 0) ? null : (E) queue[0];
         } finally {
             lock.unlock();
         }
-        return result;
     }
 
     /**
@@ -648,32 +648,28 @@
      * @return {@code true} if this queue changed as a result of the call
      */
     public boolean remove(Object o) {
-        boolean removed = false;
         final ReentrantLock lock = this.lock;
         lock.lock();
         try {
             int i = indexOf(o);
-            if (i != -1) {
-                removeAt(i);
-                removed = true;
-            }
+            if (i == -1)
+                return false;
+            removeAt(i);
+            return true;
         } finally {
             lock.unlock();
         }
-        return removed;
     }
 
-
     /**
      * Identity-based version for use in Itr.remove
      */
-    private void removeEQ(Object o) {
+    void removeEQ(Object o) {
         final ReentrantLock lock = this.lock;
         lock.lock();
         try {
             Object[] array = queue;
-            int n = size;
-            for (int i = 0; i < n; i++) {
+            for (int i = 0, n = size; i < n; i++) {
                 if (o == array[i]) {
                     removeAt(i);
                     break;
@@ -693,15 +689,13 @@
      * @return {@code true} if this queue contains the specified element
      */
     public boolean contains(Object o) {
-        int index;
         final ReentrantLock lock = this.lock;
         lock.lock();
         try {
-            index = indexOf(o);
+            return indexOf(o) != -1;
         } finally {
             lock.unlock();
         }
-        return index != -1;
     }
 
     /**
@@ -727,7 +721,6 @@
         }
     }
 
-
     public String toString() {
         final ReentrantLock lock = this.lock;
         lock.lock();
@@ -738,7 +731,7 @@
             StringBuilder sb = new StringBuilder();
             sb.append('[');
             for (int i = 0; i < n; ++i) {
-                E e = (E)queue[i];
+                Object e = queue[i];
                 sb.append(e == this ? "(this Collection)" : e);
                 if (i != n - 1)
                     sb.append(',').append(' ');
@@ -756,23 +749,7 @@
      * @throws IllegalArgumentException      {@inheritDoc}
      */
     public int drainTo(Collection<? super E> c) {
-        if (c == null)
-            throw new NullPointerException();
-        if (c == this)
-            throw new IllegalArgumentException();
-        final ReentrantLock lock = this.lock;
-        lock.lock();
-        try {
-            int n = 0;
-            E e;
-            while ( (e = extract()) != null) {
-                c.add(e);
-                ++n;
-            }
-            return n;
-        } finally {
-            lock.unlock();
-        }
+        return drainTo(c, Integer.MAX_VALUE);
     }
 
     /**
@@ -791,11 +768,10 @@
         final ReentrantLock lock = this.lock;
         lock.lock();
         try {
-            int n = 0;
-            E e;
-            while (n < maxElements && (e = extract()) != null) {
-                c.add(e);
-                ++n;
+            int n = Math.min(size, maxElements);
+            for (int i = 0; i < n; i++) {
+                c.add((E) queue[0]); // In this order, in case add() throws.
+                dequeue();
             }
             return n;
         } finally {
@@ -843,8 +819,7 @@
      * The following code can be used to dump the queue into a newly
      * allocated array of {@code String}:
      *
-     * <pre>
-     *     String[] y = x.toArray(new String[0]);</pre>
+     *  <pre> {@code String[] y = x.toArray(new String[0]);}</pre>
      *
      * Note that {@code toArray(new Object[0])} is identical in function to
      * {@code toArray()}.
@@ -897,7 +872,7 @@
      */
     final class Itr implements Iterator<E> {
         final Object[] array; // Array of all elements
-        int cursor;           // index of next element to return;
+        int cursor;           // index of next element to return
         int lastRet;          // index of last element, or -1 if no such
 
         Itr(Object[] array) {
@@ -925,17 +900,18 @@
     }
 
     /**
-     * Saves the state to a stream (that is, serializes it).  For
-     * compatibility with previous version of this class,
-     * elements are first copied to a java.util.PriorityQueue,
-     * which is then serialized.
+     * Saves this queue to a stream (that is, serializes it).
+     *
+     * For compatibility with previous version of this class, elements
+     * are first copied to a java.util.PriorityQueue, which is then
+     * serialized.
      */
     private void writeObject(java.io.ObjectOutputStream s)
         throws java.io.IOException {
         lock.lock();
         try {
-            int n = size; // avoid zero capacity argument
-            q = new PriorityQueue<E>(n == 0 ? 1 : n, comparator);
+            // avoid zero capacity argument
+            q = new PriorityQueue<E>(Math.max(size, 1), comparator);
             q.addAll(this);
             s.defaultWriteObject();
         } finally {
@@ -945,10 +921,7 @@
     }
 
     /**
-     * Reconstitutes the {@code PriorityBlockingQueue} instance from a stream
-     * (that is, deserializes it).
-     *
-     * @param s the stream
+     * Reconstitutes this queue from a stream (that is, deserializes it).
      */
     private void readObject(java.io.ObjectInputStream s)
         throws java.io.IOException, ClassNotFoundException {
--- a/src/share/classes/java/util/logging/LoggingProxyImpl.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/util/logging/LoggingProxyImpl.java	Fri Jun 21 19:11:42 2013 -0700
@@ -106,6 +106,11 @@
     }
 
     @Override
+    public int getLevelValue(Object level) {
+        return ((Level) level).intValue();
+    }
+
+    @Override
     public String getProperty(String key) {
         return LogManager.getLogManager().getProperty(key);
     }
--- a/src/share/classes/java/util/zip/Deflater.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/util/zip/Deflater.java	Fri Jun 21 19:11:42 2013 -0700
@@ -79,6 +79,8 @@
     private int level, strategy;
     private boolean setParams;
     private boolean finish, finished;
+    private long bytesRead;
+    private long bytesWritten;
 
     /**
      * Compression method for the deflate algorithm (the only one currently
@@ -423,8 +425,13 @@
         synchronized (zsRef) {
             ensureOpen();
             if (flush == NO_FLUSH || flush == SYNC_FLUSH ||
-                flush == FULL_FLUSH)
-                return deflateBytes(zsRef.address(), b, off, len, flush);
+                flush == FULL_FLUSH) {
+                int thisLen = this.len;
+                int n = deflateBytes(zsRef.address(), b, off, len, flush);
+                bytesWritten += n;
+                bytesRead += (thisLen - this.len);
+                return n;
+            }
             throw new IllegalArgumentException();
         }
     }
@@ -462,7 +469,7 @@
     public long getBytesRead() {
         synchronized (zsRef) {
             ensureOpen();
-            return getBytesRead(zsRef.address());
+            return bytesRead;
         }
     }
 
@@ -488,7 +495,7 @@
     public long getBytesWritten() {
         synchronized (zsRef) {
             ensureOpen();
-            return getBytesWritten(zsRef.address());
+            return bytesWritten;
         }
     }
 
@@ -503,6 +510,7 @@
             finish = false;
             finished = false;
             off = len = 0;
+            bytesRead = bytesWritten = 0;
         }
     }
 
@@ -543,8 +551,6 @@
     private native int deflateBytes(long addr, byte[] b, int off, int len,
                                     int flush);
     private native static int getAdler(long addr);
-    private native static long getBytesRead(long addr);
-    private native static long getBytesWritten(long addr);
     private native static void reset(long addr);
     private native static void end(long addr);
 }
--- a/src/share/classes/java/util/zip/Inflater.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/java/util/zip/Inflater.java	Fri Jun 21 19:11:42 2013 -0700
@@ -78,6 +78,8 @@
     private int off, len;
     private boolean finished;
     private boolean needDict;
+    private long bytesRead;
+    private long bytesWritten;
 
     private static final byte[] defaultBuf = new byte[0];
 
@@ -253,7 +255,11 @@
         }
         synchronized (zsRef) {
             ensureOpen();
-            return inflateBytes(zsRef.address(), b, off, len);
+            int thisLen = this.len;
+            int n = inflateBytes(zsRef.address(), b, off, len);
+            bytesWritten += n;
+            bytesRead += (thisLen - this.len);
+            return n;
         }
     }
 
@@ -307,7 +313,7 @@
     public long getBytesRead() {
         synchronized (zsRef) {
             ensureOpen();
-            return getBytesRead(zsRef.address());
+            return bytesRead;
         }
     }
 
@@ -333,7 +339,7 @@
     public long getBytesWritten() {
         synchronized (zsRef) {
             ensureOpen();
-            return getBytesWritten(zsRef.address());
+            return bytesWritten;
         }
     }
 
@@ -348,6 +354,7 @@
             finished = false;
             needDict = false;
             off = len = 0;
+            bytesRead = bytesWritten = 0;
         }
     }
 
@@ -395,8 +402,6 @@
     private native int inflateBytes(long addr, byte[] b, int off, int len)
             throws DataFormatException;
     private native static int getAdler(long addr);
-    private native static long getBytesRead(long addr);
-    private native static long getBytesWritten(long addr);
     private native static void reset(long addr);
     private native static void end(long addr);
 }
--- a/src/share/classes/javax/swing/DefaultComboBoxModel.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/javax/swing/DefaultComboBoxModel.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2004, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -55,8 +55,7 @@
      * @param items  an array of Object objects
      */
     public DefaultComboBoxModel(final E items[]) {
-        objects = new Vector<E>();
-        objects.ensureCapacity( items.length );
+        objects = new Vector<E>(items.length);
 
         int i,c;
         for ( i=0,c=items.length;i<c;i++ )
--- a/src/share/classes/javax/swing/JColorChooser.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/javax/swing/JColorChooser.java	Fri Jun 21 19:11:42 2013 -0700
@@ -182,6 +182,7 @@
             dialog = new ColorChooserDialog((Dialog)window, title, modal, c, chooserPane,
                                             okListener, cancelListener);
         }
+        dialog.getAccessibleContext().setAccessibleDescription(title);
         return dialog;
     }
 
@@ -647,6 +648,7 @@
         buttonPane.setLayout(new FlowLayout(FlowLayout.CENTER));
         JButton okButton = new JButton(okString);
         getRootPane().setDefaultButton(okButton);
+        okButton.getAccessibleContext().setAccessibleDescription(okString);
         okButton.setActionCommand("OK");
         okButton.addActionListener(new ActionListener() {
             public void actionPerformed(ActionEvent e) {
@@ -659,6 +661,7 @@
         buttonPane.add(okButton);
 
         cancelButton = new JButton(cancelString);
+        cancelButton.getAccessibleContext().setAccessibleDescription(cancelString);
 
         // The following few lines are used to register esc to close the dialog
         Action cancelKeyAction = new AbstractAction() {
@@ -688,6 +691,7 @@
         buttonPane.add(cancelButton);
 
         JButton resetButton = new JButton(resetString);
+        resetButton.getAccessibleContext().setAccessibleDescription(resetString);
         resetButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                reset();
--- a/src/share/classes/javax/swing/JComponent.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/javax/swing/JComponent.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -2636,17 +2636,16 @@
      *    attribute: visualUpdate true
      */
     public void setVisible(boolean aFlag) {
-        if(aFlag != isVisible()) {
+        if (aFlag != isVisible()) {
             super.setVisible(aFlag);
-            Container parent = getParent();
-            if(parent != null) {
-                Rectangle r = getBounds();
-                parent.repaint(r.x,r.y,r.width,r.height);
+            if (aFlag) {
+                Container parent = getParent();
+                if (parent != null) {
+                    Rectangle r = getBounds();
+                    parent.repaint(r.x, r.y, r.width, r.height);
+                }
+                revalidate();
             }
-            // Some (all should) LayoutManagers do not consider components
-            // that are not visible. As such we need to revalidate when the
-            // visible bit changes.
-            revalidate();
         }
     }
 
@@ -3687,7 +3686,6 @@
             super();
         }
 
-        protected ContainerListener accessibleContainerHandler = null;
         protected FocusListener accessibleFocusHandler = null;
 
         /**
@@ -5564,4 +5562,22 @@
         ",preferredSize=" + preferredSizeString;
     }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    @Deprecated
+    public void hide() {
+        boolean showing = isShowing();
+        super.hide();
+        if (showing) {
+            Container parent = getParent();
+            if (parent != null) {
+                Rectangle r = getBounds();
+                parent.repaint(r.x, r.y, r.width, r.height);
+            }
+            revalidate();
+        }
+    }
+
 }
--- a/src/share/classes/javax/swing/JDesktopPane.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/javax/swing/JDesktopPane.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -428,6 +428,15 @@
     }
 
     /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void remove(Component comp) {
+        super.remove(comp);
+        updateFramesCache();
+    }
+
+    /**
      * Selects the next <code>JInternalFrame</code> in this desktop pane.
      *
      * @param forward a boolean indicating which direction to select in;
--- a/src/share/classes/javax/swing/JTable.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/javax/swing/JTable.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -3948,7 +3948,7 @@
                     break;
                 case TableModelEvent.INSERT:
                     modelSelection.insertIndexInterval(change.startModelIndex,
-                                                       change.endModelIndex,
+                                                       change.length,
                                                        true);
                     break;
                 default:
@@ -5461,12 +5461,13 @@
             // they have the option to replace the value with
             // null or use escape to restore the original.
             // For Strings, return "" for backward compatibility.
+
             try {
                 if ("".equals(s)) {
                     if (constructor.getDeclaringClass() == String.class) {
                         value = s;
                     }
-                    super.stopCellEditing();
+                    return super.stopCellEditing();
                 }
 
                 SwingUtilities2.checkAccess(constructor.getModifiers());
@@ -8588,7 +8589,7 @@
              *    <code>null</code> if this object is not on the screen
              */
             public Point getLocationOnScreen() {
-                if (parent != null) {
+                if (parent != null && parent.isShowing()) {
                     Point parentLocation = parent.getLocationOnScreen();
                     Point componentLocation = getLocation();
                     componentLocation.translate(parentLocation.x, parentLocation.y);
@@ -9389,7 +9390,7 @@
              *    <code>null</code> if this object is not on the screen
              */
             public Point getLocationOnScreen() {
-                if (parent != null) {
+                if (parent != null && parent.isShowing()) {
                     Point parentLocation = parent.getLocationOnScreen();
                     Point componentLocation = getLocation();
                     componentLocation.translate(parentLocation.x, parentLocation.y);
--- a/src/share/classes/javax/swing/JToolTip.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/javax/swing/JToolTip.java	Fri Jun 21 19:11:42 2013 -0700
@@ -31,6 +31,7 @@
 import java.io.ObjectOutputStream;
 import java.io.ObjectInputStream;
 import java.io.IOException;
+import java.util.Objects;
 
 
 /**
@@ -127,6 +128,11 @@
         String oldValue = this.tipText;
         this.tipText = tipText;
         firePropertyChange("tiptext", oldValue, tipText);
+
+        if (!Objects.equals(oldValue, tipText)) {
+            revalidate();
+            repaint();
+        }
     }
 
     /**
--- a/src/share/classes/javax/swing/JViewport.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/javax/swing/JViewport.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1586,10 +1586,18 @@
         int bdx = blitToX - blitFromX;
         int bdy = blitToY - blitFromY;
 
+        Composite oldComposite = null;
         // Shift the scrolled region
+        if (g instanceof Graphics2D) {
+            Graphics2D g2d = (Graphics2D) g;
+            oldComposite = g2d.getComposite();
+            g2d.setComposite(AlphaComposite.Src);
+        }
         rm.copyArea(this, g, blitFromX, blitFromY, blitW, blitH, bdx, bdy,
                     false);
-
+        if (oldComposite != null) {
+            ((Graphics2D) g).setComposite(oldComposite);
+        }
         // Paint the newly exposed region.
         int x = view.getX();
         int y = view.getY();
--- a/src/share/classes/javax/swing/KeyboardManager.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/javax/swing/KeyboardManager.java	Fri Jun 21 19:11:42 2013 -0700
@@ -285,10 +285,11 @@
                  while (iter.hasMoreElements()) {
                      JMenuBar mb = (JMenuBar)iter.nextElement();
                      if ( mb.isShowing() && mb.isEnabled() ) { // don't want to give these out
-                         if( !(ks.equals(ksE)) ) {
+                         boolean extended = (ksE != null) && !ksE.equals(ks);
+                         if (extended) {
                              fireBinding(mb, ksE, e, pressed);
                          }
-                         if(ks.equals(ksE) || !e.isConsumed()) {
+                         if (!extended || !e.isConsumed()) {
                              fireBinding(mb, ks, e, pressed);
                          }
                          if (e.isConsumed()) {
--- a/src/share/classes/javax/swing/RepaintManager.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/javax/swing/RepaintManager.java	Fri Jun 21 19:11:42 2013 -0700
@@ -122,6 +122,11 @@
     // Whether or not a VolatileImage should be used for double-buffered painting
     static boolean volatileImageBufferEnabled = true;
     /**
+     * Type of VolatileImage which should be used for double-buffered
+     * painting.
+     */
+    private static final int volatileBufferType;
+    /**
      * Value of the system property awt.nativeDoubleBuffering.
      */
     private static boolean nativeDoubleBuffering;
@@ -210,6 +215,13 @@
             ((SunGraphicsEnvironment)ge).addDisplayChangedListener(
                     new DisplayChangedHandler());
         }
+        Toolkit tk = Toolkit.getDefaultToolkit();
+        if ((tk instanceof SunToolkit)
+                && ((SunToolkit) tk).isSwingBackbufferTranslucencySupported()) {
+            volatileBufferType = Transparency.TRANSLUCENT;
+        } else {
+            volatileBufferType = Transparency.OPAQUE;
+        }
     }
 
     /**
@@ -1015,7 +1027,8 @@
             if (image != null) {
                 image.flush();
             }
-            image = config.createCompatibleVolatileImage(width, height);
+            image = config.createCompatibleVolatileImage(width, height,
+                                                         volatileBufferType);
             volatileMap.put(config, image);
         }
         return image;
@@ -1505,9 +1518,26 @@
                     for(y=clipY, maxy = clipY + clipH; y < maxy ; y += bh) {
                         osg.translate(-x, -y);
                         osg.setClip(x,y,bw,bh);
+                        if (volatileBufferType != Transparency.OPAQUE
+                                && osg instanceof Graphics2D) {
+                            final Graphics2D g2d = (Graphics2D) osg;
+                            final Color oldBg = g2d.getBackground();
+                            g2d.setBackground(c.getBackground());
+                            g2d.clearRect(x, y, bw, bh);
+                            g2d.setBackground(oldBg);
+                        }
                         c.paintToOffscreen(osg, x, y, bw, bh, maxx, maxy);
                         g.setClip(x, y, bw, bh);
-                        g.drawImage(image, x, y, c);
+                        if (volatileBufferType != Transparency.OPAQUE
+                                && g instanceof Graphics2D) {
+                            final Graphics2D g2d = (Graphics2D) g;
+                            final Composite oldComposite = g2d.getComposite();
+                            g2d.setComposite(AlphaComposite.Src);
+                            g2d.drawImage(image, x, y, c);
+                            g2d.setComposite(oldComposite);
+                        } else {
+                            g.drawImage(image, x, y, c);
+                        }
                         osg.translate(x, y);
                     }
                 }
--- a/src/share/classes/javax/swing/SwingUtilities.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/javax/swing/SwingUtilities.java	Fri Jun 21 19:11:42 2013 -0700
@@ -356,7 +356,7 @@
                                       sourceEvent.getYOnScreen(),
                                       sourceEvent.getClickCount(),
                                       sourceEvent.isPopupTrigger(),
-                                      MouseEvent.NOBUTTON );
+                                      sourceEvent.getButton());
         }
         return newEvent;
     }
--- a/src/share/classes/javax/swing/TimerQueue.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/javax/swing/TimerQueue.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -187,6 +187,9 @@
                                 addTimer(delayedTimer);
                             }
                         }
+
+                        // Allow run other threads on systems without kernel threads
+                        timer.getLock().newCondition().awaitNanos(1);
                     } catch (SecurityException ignore) {
                     } finally {
                         timer.getLock().unlock();
--- a/src/share/classes/javax/swing/ToolTipManager.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/javax/swing/ToolTipManager.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -217,6 +217,25 @@
         return exitTimer.getInitialDelay();
     }
 
+    // Returns GraphicsConfiguration instance that toFind belongs to or null
+    // if drawing point is set to a point beyond visible screen area (e.g.
+    // Point(20000, 20000))
+    private GraphicsConfiguration getDrawingGC(Point toFind) {
+        GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
+        GraphicsDevice devices[] = env.getScreenDevices();
+        for (GraphicsDevice device : devices) {
+            GraphicsConfiguration configs[] = device.getConfigurations();
+            for (GraphicsConfiguration config : configs) {
+                Rectangle rect = config.getBounds();
+                if (rect.contains(toFind)) {
+                    return config;
+                }
+            }
+        }
+
+        return null;
+    }
+
     void showTipWindow() {
         if(insideComponent == null || !insideComponent.isShowing())
             return;
@@ -231,9 +250,25 @@
         if (enabled) {
             Dimension size;
             Point screenLocation = insideComponent.getLocationOnScreen();
-            Point location = new Point();
-            GraphicsConfiguration gc;
-            gc = insideComponent.getGraphicsConfiguration();
+            Point location;
+
+            Point toFind;
+            if (preferredLocation != null) {
+                toFind = new Point(screenLocation.x + preferredLocation.x,
+                        screenLocation.y + preferredLocation.y);
+            } else {
+                toFind = mouseEvent.getLocationOnScreen();
+            }
+
+            GraphicsConfiguration gc = getDrawingGC(toFind);
+            if (gc == null) {
+                toFind = mouseEvent.getLocationOnScreen();
+                gc = getDrawingGC(toFind);
+                if (gc == null) {
+                    gc = insideComponent.getGraphicsConfiguration();
+                }
+            }
+
             Rectangle sBounds = gc.getBounds();
             Insets screenInsets = Toolkit.getDefaultToolkit()
                                              .getScreenInsets(gc);
@@ -253,14 +288,13 @@
             size = tip.getPreferredSize();
 
             if(preferredLocation != null) {
-                location.x = screenLocation.x + preferredLocation.x;
-                location.y = screenLocation.y + preferredLocation.y;
+                location = toFind;
         if (!leftToRight) {
             location.x -= size.width;
         }
             } else {
-                location.x = screenLocation.x + mouseEvent.getX();
-                location.y = screenLocation.y + mouseEvent.getY() + 20;
+                location = new Point(screenLocation.x + mouseEvent.getX(),
+                        screenLocation.y + mouseEvent.getY() + 20);
         if (!leftToRight) {
             if(location.x - size.width>=0) {
                 location.x -= size.width;
--- a/src/share/classes/javax/swing/colorchooser/ColorChooserPanel.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/javax/swing/colorchooser/ColorChooserPanel.java	Fri Jun 21 19:11:42 2013 -0700
@@ -135,6 +135,7 @@
         String label = this.model.getText(this, "HexCode"); // NON-NLS: suffix
         boolean visible = label != null;
         this.text.setVisible(visible);
+        this.text.getAccessibleContext().setAccessibleDescription(label);
         this.label.setVisible(visible);
         if (visible) {
             this.label.setText(label);
--- a/src/share/classes/javax/swing/colorchooser/ColorPanel.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/javax/swing/colorchooser/ColorPanel.java	Fri Jun 21 19:11:42 2013 -0700
@@ -37,6 +37,7 @@
 import javax.swing.JPanel;
 import javax.swing.JRadioButton;
 import javax.swing.border.EmptyBorder;
+import javax.swing.JSpinner.DefaultEditor;
 
 final class ColorPanel extends JPanel implements ActionListener {
 
@@ -119,17 +120,26 @@
         int count = this.model.getCount();
         this.spinners[4].setVisible(count > 4);
         for (int i = 0; i < count; i++) {
+            String text = this.model.getLabel(this, i);
             Object object = this.spinners[i].getLabel();
             if (object instanceof JRadioButton) {
                 JRadioButton button = (JRadioButton) object;
-                button.setText(this.model.getLabel(this, i));
+                button.setText(text);
+                button.getAccessibleContext().setAccessibleDescription(text);
             }
             else if (object instanceof JLabel) {
                 JLabel label = (JLabel) object;
-                label.setText(this.model.getLabel(this, i));
+                label.setText(text);
             }
             this.spinners[i].setRange(this.model.getMinimum(i), this.model.getMaximum(i));
             this.spinners[i].setValue(this.values[i]);
+            this.spinners[i].getSlider().getAccessibleContext().setAccessibleName(text);
+            this.spinners[i].getSpinner().getAccessibleContext().setAccessibleName(text);
+            DefaultEditor editor = (DefaultEditor) this.spinners[i].getSpinner().getEditor();
+            editor.getTextField().getAccessibleContext().setAccessibleName(text);
+            this.spinners[i].getSlider().getAccessibleContext().setAccessibleDescription(text);
+            this.spinners[i].getSpinner().getAccessibleContext().setAccessibleDescription(text);
+            editor.getTextField().getAccessibleContext().setAccessibleDescription(text);
         }
     }
 
--- a/src/share/classes/javax/swing/colorchooser/DefaultSwatchChooserPanel.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/javax/swing/colorchooser/DefaultSwatchChooserPanel.java	Fri Jun 21 19:11:42 2013 -0700
@@ -57,6 +57,8 @@
     RecentSwatchPanel recentSwatchPanel;
     MouseListener mainSwatchListener;
     MouseListener recentSwatchListener;
+    private KeyListener mainSwatchKeyListener;
+    private KeyListener recentSwatchKeyListener;
 
     public DefaultSwatchChooserPanel() {
         super();
@@ -151,10 +153,14 @@
         recentSwatchPanel.putClientProperty(AccessibleContext.ACCESSIBLE_NAME_PROPERTY,
                                             recentStr);
 
+        mainSwatchKeyListener = new MainSwatchKeyListener();
         mainSwatchListener = new MainSwatchListener();
         swatchPanel.addMouseListener(mainSwatchListener);
+        swatchPanel.addKeyListener(mainSwatchKeyListener);
         recentSwatchListener = new RecentSwatchListener();
+        recentSwatchKeyListener = new RecentSwatchKeyListener();
         recentSwatchPanel.addMouseListener(recentSwatchListener);
+        recentSwatchPanel.addKeyListener(recentSwatchKeyListener);
 
         JPanel mainHolder = new JPanel(new BorderLayout());
         Border border = new CompoundBorder( new LineBorder(Color.black),
@@ -196,11 +202,17 @@
     public void uninstallChooserPanel(JColorChooser enclosingChooser) {
         super.uninstallChooserPanel(enclosingChooser);
         swatchPanel.removeMouseListener(mainSwatchListener);
+        swatchPanel.removeKeyListener(mainSwatchKeyListener);
         recentSwatchPanel.removeMouseListener(recentSwatchListener);
+        recentSwatchPanel.removeKeyListener(recentSwatchKeyListener);
+
         swatchPanel = null;
         recentSwatchPanel = null;
         mainSwatchListener = null;
+        mainSwatchKeyListener = null;
         recentSwatchListener = null;
+        recentSwatchKeyListener = null;
+
         removeAll();  // strip out all the sub-components
     }
 
@@ -209,11 +221,32 @@
     }
 
 
+    private class RecentSwatchKeyListener extends KeyAdapter {
+        public void keyPressed(KeyEvent e) {
+            if (KeyEvent.VK_SPACE == e.getKeyCode()) {
+                Color color = recentSwatchPanel.getSelectedColor();
+                setSelectedColor(color);
+            }
+        }
+    }
+
+    private class MainSwatchKeyListener extends KeyAdapter {
+        public void keyPressed(KeyEvent e) {
+            if (KeyEvent.VK_SPACE == e.getKeyCode()) {
+                Color color = swatchPanel.getSelectedColor();
+                setSelectedColor(color);
+                recentSwatchPanel.setMostRecentColor(color);
+            }
+        }
+    }
+
     class RecentSwatchListener extends MouseAdapter implements Serializable {
         public void mousePressed(MouseEvent e) {
             if (isEnabled()) {
                 Color color = recentSwatchPanel.getColorForLocation(e.getX(), e.getY());
+                recentSwatchPanel.setSelectedColorFromLocation(e.getX(), e.getY());
                 setSelectedColor(color);
+                recentSwatchPanel.requestFocusInWindow();
             }
         }
     }
@@ -223,7 +256,9 @@
             if (isEnabled()) {
                 Color color = swatchPanel.getColorForLocation(e.getX(), e.getY());
                 setSelectedColor(color);
+                swatchPanel.setSelectedColorFromLocation(e.getX(), e.getY());
                 recentSwatchPanel.setMostRecentColor(color);
+                swatchPanel.requestFocusInWindow();
             }
         }
     }
@@ -239,18 +274,81 @@
     protected Dimension numSwatches;
     protected Dimension gap;
 
+    private int selRow;
+    private int selCol;
+
     public SwatchPanel() {
         initValues();
         initColors();
         setToolTipText(""); // register for events
         setOpaque(true);
         setBackground(Color.white);
-        setRequestFocusEnabled(false);
+        setFocusable(true);
         setInheritsPopupMenu(true);
+
+        addFocusListener(new FocusAdapter() {
+            public void focusGained(FocusEvent e) {
+                repaint();
+            }
+
+            public void focusLost(FocusEvent e) {
+                repaint();
+            }
+        });
+
+        addKeyListener(new KeyAdapter() {
+            public void keyPressed(KeyEvent e) {
+                int typed = e.getKeyCode();
+                switch (typed) {
+                    case KeyEvent.VK_UP:
+                        if (selRow > 0) {
+                            selRow--;
+                            repaint();
+                        }
+                        break;
+                    case KeyEvent.VK_DOWN:
+                        if (selRow < numSwatches.height - 1) {
+                            selRow++;
+                            repaint();
+                        }
+                        break;
+                    case KeyEvent.VK_LEFT:
+                        if (selCol > 0 && SwatchPanel.this.getComponentOrientation().isLeftToRight()) {
+                            selCol--;
+                            repaint();
+                        } else if (selCol < numSwatches.width - 1
+                                && !SwatchPanel.this.getComponentOrientation().isLeftToRight()) {
+                            selCol++;
+                            repaint();
+                        }
+                        break;
+                    case KeyEvent.VK_RIGHT:
+                        if (selCol < numSwatches.width - 1
+                                && SwatchPanel.this.getComponentOrientation().isLeftToRight()) {
+                            selCol++;
+                            repaint();
+                        } else if (selCol > 0 && !SwatchPanel.this.getComponentOrientation().isLeftToRight()) {
+                            selCol--;
+                            repaint();
+                        }
+                        break;
+                    case KeyEvent.VK_HOME:
+                        selCol = 0;
+                        selRow = 0;
+                        repaint();
+                        break;
+                    case KeyEvent.VK_END:
+                        selCol = numSwatches.width - 1;
+                        selRow = numSwatches.height - 1;
+                        repaint();
+                        break;
+                }
+            }
+        });
     }
 
-    public boolean isFocusTraversable() {
-        return false;
+    public Color getSelectedColor() {
+        return getColorForCell(selCol, selRow);
     }
 
     protected void initValues() {
@@ -263,11 +361,10 @@
          for (int row = 0; row < numSwatches.height; row++) {
             int y = row * (swatchSize.height + gap.height);
             for (int column = 0; column < numSwatches.width; column++) {
-
-              g.setColor( getColorForCell(column, row) );
+                Color c = getColorForCell(column, row);
+                g.setColor(c);
                 int x;
-                if ((!this.getComponentOrientation().isLeftToRight()) &&
-                    (this instanceof RecentSwatchPanel)) {
+                if (!this.getComponentOrientation().isLeftToRight()) {
                     x = (numSwatches.width - column - 1) * (swatchSize.width + gap.width);
                 } else {
                     x = column * (swatchSize.width + gap.width);
@@ -276,6 +373,20 @@
                 g.setColor(Color.black);
                 g.drawLine( x+swatchSize.width-1, y, x+swatchSize.width-1, y+swatchSize.height-1);
                 g.drawLine( x, y+swatchSize.height-1, x+swatchSize.width-1, y+swatchSize.height-1);
+
+                if (selRow == row && selCol == column && this.isFocusOwner()) {
+                    Color c2 = new Color(c.getRed() < 125 ? 255 : 0,
+                            c.getGreen() < 125 ? 255 : 0,
+                            c.getBlue() < 125 ? 255 : 0);
+                    g.setColor(c2);
+
+                    g.drawLine(x, y, x + swatchSize.width - 1, y);
+                    g.drawLine(x, y, x, y + swatchSize.height - 1);
+                    g.drawLine(x + swatchSize.width - 1, y, x + swatchSize.width - 1, y + swatchSize.height - 1);
+                    g.drawLine(x, y + swatchSize.height - 1, x + swatchSize.width - 1, y + swatchSize.height - 1);
+                    g.drawLine(x, y, x + swatchSize.width - 1, y + swatchSize.height - 1);
+                    g.drawLine(x, y + swatchSize.height - 1, x + swatchSize.width - 1, y);
+                }
             }
          }
     }
@@ -296,10 +407,19 @@
         return color.getRed()+", "+ color.getGreen() + ", " + color.getBlue();
     }
 
+    public void setSelectedColorFromLocation(int x, int y) {
+        if (!this.getComponentOrientation().isLeftToRight()) {
+            selCol = numSwatches.width - x / (swatchSize.width + gap.width) - 1;
+        } else {
+            selCol = x / (swatchSize.width + gap.width);
+        }
+        selRow = y / (swatchSize.height + gap.height);
+        repaint();
+    }
+
     public Color getColorForLocation( int x, int y ) {
         int column;
-        if ((!this.getComponentOrientation().isLeftToRight()) &&
-            (this instanceof RecentSwatchPanel)) {
+        if (!this.getComponentOrientation().isLeftToRight()) {
             column = numSwatches.width - x / (swatchSize.width + gap.width) - 1;
         } else {
             column = x / (swatchSize.width + gap.width);
--- a/src/share/classes/javax/swing/plaf/basic/BasicColorChooserUI.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/javax/swing/plaf/basic/BasicColorChooserUI.java	Fri Jun 21 19:11:42 2013 -0700
@@ -94,6 +94,7 @@
         tabbedPane = new JTabbedPane();
         tabbedPane.setName("ColorChooser.tabPane");
         tabbedPane.setInheritsPopupMenu(true);
+        tabbedPane.getAccessibleContext().setAccessibleDescription(tabbedPane.getName());
         singlePanel = new JPanel(new CenterLayout());
         singlePanel.setName("ColorChooser.panel");
         singlePanel.setInheritsPopupMenu(true);
--- a/src/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -692,9 +692,9 @@
      */
     protected void installComponents() {
         arrowButton = createArrowButton();
-        comboBox.add( arrowButton );
 
         if (arrowButton != null)  {
+            comboBox.add(arrowButton);
             configureArrowButton();
         }
 
@@ -1120,7 +1120,9 @@
             listBox.setSelectedIndex( si + 1 );
             listBox.ensureIndexIsVisible( si + 1 );
             if ( !isTableCellEditor ) {
-                comboBox.setSelectedIndex(si+1);
+                if (!(UIManager.getBoolean("ComboBox.noActionOnKeyNavigation") && comboBox.isPopupVisible())) {
+                    comboBox.setSelectedIndex(si+1);
+                }
             }
             comboBox.repaint();
         }
@@ -1144,7 +1146,9 @@
             listBox.setSelectedIndex( si - 1 );
             listBox.ensureIndexIsVisible( si - 1 );
             if ( !isTableCellEditor ) {
-                comboBox.setSelectedIndex(si-1);
+                if (!(UIManager.getBoolean("ComboBox.noActionOnKeyNavigation") && comboBox.isPopupVisible())) {
+                    comboBox.setSelectedIndex(si-1);
+                }
             }
             comboBox.repaint();
         }
@@ -1490,7 +1494,13 @@
                      key == HOME || key == END) {
                 int index = getNextIndex(comboBox, key);
                 if (index >= 0 && index < comboBox.getItemCount()) {
-                    comboBox.setSelectedIndex(index);
+                    if (UIManager.getBoolean("ComboBox.noActionOnKeyNavigation") && comboBox.isPopupVisible()) {
+                        ui.listBox.setSelectedIndex(index);
+                        ui.listBox.ensureIndexIsVisible(index);
+                        comboBox.repaint();
+                    } else {
+                        comboBox.setSelectedIndex(index);
+                    }
                 }
             }
             else if (key == DOWN) {
@@ -1558,22 +1568,33 @@
 
             else if (key == ENTER) {
                 if (comboBox.isPopupVisible()) {
-                    // Forces the selection of the list item
-                    boolean isEnterSelectablePopup =
-                            UIManager.getBoolean("ComboBox.isEnterSelectablePopup");
-                    if (!comboBox.isEditable() || isEnterSelectablePopup
-                            || ui.isTableCellEditor) {
+                    // If ComboBox.noActionOnKeyNavigation is set,
+                    // forse selection of list item
+                    if (UIManager.getBoolean("ComboBox.noActionOnKeyNavigation")) {
                         Object listItem = ui.popup.getList().getSelectedValue();
                         if (listItem != null) {
-                            // Use the selected value from popup
-                            // to set the selected item in combo box,
-                            // but ensure before that JComboBox.actionPerformed()
-                            // won't use editor's value to set the selected item
                             comboBox.getEditor().setItem(listItem);
                             comboBox.setSelectedItem(listItem);
                         }
+                        comboBox.setPopupVisible(false);
+                    } else {
+                        // Forces the selection of the list item
+                        boolean isEnterSelectablePopup =
+                                UIManager.getBoolean("ComboBox.isEnterSelectablePopup");
+                        if (!comboBox.isEditable() || isEnterSelectablePopup
+                                || ui.isTableCellEditor) {
+                            Object listItem = ui.popup.getList().getSelectedValue();
+                            if (listItem != null) {
+                                // Use the selected value from popup
+                                // to set the selected item in combo box,
+                                // but ensure before that JComboBox.actionPerformed()
+                                // won't use editor's value to set the selected item
+                                comboBox.getEditor().setItem(listItem);
+                                comboBox.setSelectedItem(listItem);
+                            }
+                        }
+                        comboBox.setPopupVisible(false);
                     }
-                    comboBox.setPopupVisible(false);
                 }
                 else {
                     // Hide combo box if it is a table cell editor
@@ -1604,14 +1625,20 @@
         }
 
         private int getNextIndex(JComboBox comboBox, String key) {
+            int listHeight = comboBox.getMaximumRowCount();
+
+            int selectedIndex = comboBox.getSelectedIndex();
+            if (UIManager.getBoolean("ComboBox.noActionOnKeyNavigation")
+                    && (comboBox.getUI() instanceof BasicComboBoxUI)) {
+                selectedIndex = ((BasicComboBoxUI) comboBox.getUI()).listBox.getSelectedIndex();
+            }
+
             if (key == PAGE_UP) {
-                int listHeight = comboBox.getMaximumRowCount();
-                int index = comboBox.getSelectedIndex() - listHeight;
+                int index = selectedIndex - listHeight;
                 return (index < 0 ? 0: index);
             }
             else if (key == PAGE_DOWN) {
-                int listHeight = comboBox.getMaximumRowCount();
-                int index = comboBox.getSelectedIndex() + listHeight;
+                int index = selectedIndex + listHeight;
                 int max = comboBox.getItemCount();
                 return (index < max ? index: max-1);
             }
--- a/src/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -861,6 +861,7 @@
                          "END", "endPassThrough",
                        "ENTER", "enterPressed"
                  }),
+            "ComboBox.noActionOnKeyNavigation", Boolean.FALSE,
 
             // *** FileChooser
 
@@ -1153,7 +1154,9 @@
             "Menu.menuPopupOffsetY", new Integer(0),
             "Menu.submenuPopupOffsetX", new Integer(0),
             "Menu.submenuPopupOffsetY", new Integer(0),
-            "Menu.shortcutKeys", new int[] {KeyEvent.ALT_MASK},
+            "Menu.shortcutKeys", new int[]{
+                SwingUtilities2.getSystemMnemonicKeyMask()
+            },
             "Menu.crossMenuMnemonic", Boolean.TRUE,
             // Menu.cancelMode affects the cancel menu action behaviour;
             // currently supports:
--- a/src/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java	Fri Jun 21 19:11:42 2013 -0700
@@ -875,6 +875,8 @@
                 int availTextWidth = tabScroller.croppedEdge.getCropline() -
                         (textRect.x - tabRect.x) - tabScroller.croppedEdge.getCroppedSideWidth();
                 clippedTitle = SwingUtilities2.clipStringIfNecessary(null, metrics, title, availTextWidth);
+            } else if (!scrollableTabLayoutEnabled() && isHorizontalTabPlacement()) {
+                clippedTitle = SwingUtilities2.clipStringIfNecessary(null, metrics, title, textRect.width);
             }
 
             paintText(g, tabPlacement, font, metrics,
--- a/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -419,7 +419,7 @@
                     }
                 }
                 else {
-                    if (!(table.getParent().getParent() instanceof
+                    if (!(SwingUtilities.getUnwrappedParent(table).getParent() instanceof
                             JScrollPane)) {
                         return;
                     }
@@ -1431,7 +1431,7 @@
         }
 
         // install the scrollpane border
-        Container parent = table.getParent();  // should be viewport
+        Container parent = SwingUtilities.getUnwrappedParent(table);  // should be viewport
         if (parent != null) {
             parent = parent.getParent();  // should be the scrollpane
             if (parent != null && parent instanceof JScrollPane) {
--- a/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1879,6 +1879,20 @@
                     visRect.x -= i.left;
                     visRect.y -= i.top;
                 }
+                // we should consider a non-visible area above
+                Component component = SwingUtilities.getUnwrappedParent(tree);
+                if (component instanceof JViewport) {
+                    component = component.getParent();
+                    if (component instanceof JScrollPane) {
+                        JScrollPane pane = (JScrollPane) component;
+                        JScrollBar bar = pane.getHorizontalScrollBar();
+                        if ((bar != null) && bar.isVisible()) {
+                            int height = bar.getHeight();
+                            visRect.y -= height;
+                            visRect.height += height;
+                        }
+                    }
+                }
                 preferredSize.width = treeState.getPreferredWidth(visRect);
             }
             else {
@@ -1941,6 +1955,9 @@
                     for(int counter = beginRow + 1; counter <= endRow; counter++) {
                             testRect = getPathBounds(tree,
                                     getPathForRow(tree, counter));
+                        if (testRect == null) {
+                            return;
+                        }
                         if((testRect.y + testRect.height) > maxY)
                                 counter = endRow;
                             }
@@ -2069,7 +2086,7 @@
                 treeState.invalidatePathBounds(oldPath);
                 updateSize();
             }
-            else {
+            else if (editingBounds != null) {
                 editingBounds.x = 0;
                 editingBounds.width = tree.getSize().width;
                 tree.repaint(editingBounds);
@@ -2114,6 +2131,9 @@
                        tree.isPathSelected(path), tree.isExpanded(path),
                        treeModel.isLeaf(path.getLastPathComponent()), row);
                 Rectangle           nodeBounds = getPathBounds(tree, path);
+                if (nodeBounds == null) {
+                    return false;
+                }
 
                 editingRow = row;
 
@@ -2134,6 +2154,9 @@
                     // To make sure x/y are updated correctly, fetch
                     // the bounds again.
                     nodeBounds = getPathBounds(tree, path);
+                    if (nodeBounds == null) {
+                        return false;
+                    }
                 }
                 else
                     editorHasDifferentSize = false;
@@ -3570,7 +3593,7 @@
             if(pressedPath != null) {
                 Rectangle bounds = getPathBounds(tree, pressedPath);
 
-                if(e.getY() >= (bounds.y + bounds.height)) {
+                if (bounds == null || e.getY() >= (bounds.y + bounds.height)) {
                     return;
                 }
 
@@ -3832,6 +3855,10 @@
 
                     // And repaint
                     Rectangle newMinBounds = getPathBounds(tree, minPath);
+                    if (minBounds == null || newMinBounds == null) {
+                        return;
+                    }
+
                     if (indices.length == 1 &&
                             newMinBounds.height == minBounds.height) {
                         tree.repaint(0, minBounds.y, tree.getWidth(),
@@ -4466,31 +4493,32 @@
                     }
                 }
                 Rectangle            newRect = ui.getPathBounds(tree, newPath);
-
-                newRect.x = visRect.x;
-                newRect.width = visRect.width;
-                if(direction == -1) {
-                    newRect.height = visRect.height;
-                }
-                else {
-                    newRect.y -= (visRect.height - newRect.height);
-                    newRect.height = visRect.height;
+                if (newRect != null) {
+                    newRect.x = visRect.x;
+                    newRect.width = visRect.width;
+                    if(direction == -1) {
+                        newRect.height = visRect.height;
+                    }
+                    else {
+                        newRect.y -= (visRect.height - newRect.height);
+                        newRect.height = visRect.height;
+                    }
+
+                    if(addToSelection) {
+                        ui.extendSelection(newPath);
+                    }
+                    else if(changeSelection) {
+                        tree.setSelectionPath(newPath);
+                    }
+                    else {
+                        ui.setLeadSelectionPath(newPath, true);
+                    }
+                    tree.scrollRectToVisible(newRect);
                 }
-
-                if(addToSelection) {
-                    ui.extendSelection(newPath);
-                }
-                else if(changeSelection) {
-                    tree.setSelectionPath(newPath);
-                }
-                else {
-                    ui.setLeadSelectionPath(newPath, true);
-                }
-                tree.scrollRectToVisible(newRect);
             }
         }
 
-        private void home(JTree tree, BasicTreeUI ui, int direction,
+        private void home(JTree tree, final BasicTreeUI ui, int direction,
                           boolean addToSelection, boolean changeSelection) {
 
             // disable moving of lead unless in discontiguous mode
@@ -4500,7 +4528,7 @@
                 changeSelection = true;
             }
 
-            int rowCount = ui.getRowCount(tree);
+            final int rowCount = ui.getRowCount(tree);
 
             if (rowCount > 0) {
                 if(direction == -1) {
@@ -4552,6 +4580,13 @@
                         ui.setLeadSelectionPath(ui.getPathForRow(tree,
                                                           rowCount - 1), true);
                     }
+                    if (ui.isLargeModel()){
+                        SwingUtilities.invokeLater(new Runnable() {
+                            public void run() {
+                                ui.ensureRowsAreVisible(rowCount - 1, rowCount - 1);
+                            }
+                        });
+                    }
                 }
             }
         }
--- a/src/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java	Fri Jun 21 19:11:42 2013 -0700
@@ -461,16 +461,16 @@
 
         Locale l = fc.getLocale();
 
-        lookInLabelMnemonic = UIManager.getInt("FileChooser.lookInLabelMnemonic");
+        lookInLabelMnemonic = getMnemonic("FileChooser.lookInLabelMnemonic", l);
         lookInLabelText = UIManager.getString("FileChooser.lookInLabelText",l);
         saveInLabelText = UIManager.getString("FileChooser.saveInLabelText",l);
 
-        fileNameLabelMnemonic = UIManager.getInt("FileChooser.fileNameLabelMnemonic");
+        fileNameLabelMnemonic = getMnemonic("FileChooser.fileNameLabelMnemonic", l);
         fileNameLabelText = UIManager.getString("FileChooser.fileNameLabelText",l);
-        folderNameLabelMnemonic = UIManager.getInt("FileChooser.folderNameLabelMnemonic");
+        folderNameLabelMnemonic = getMnemonic("FileChooser.folderNameLabelMnemonic", l);
         folderNameLabelText = UIManager.getString("FileChooser.folderNameLabelText",l);
 
-        filesOfTypeLabelMnemonic = UIManager.getInt("FileChooser.filesOfTypeLabelMnemonic");
+        filesOfTypeLabelMnemonic = getMnemonic("FileChooser.filesOfTypeLabelMnemonic", l);
         filesOfTypeLabelText = UIManager.getString("FileChooser.filesOfTypeLabelText",l);
 
         upFolderToolTipText =  UIManager.getString("FileChooser.upFolderToolTipText",l);
@@ -489,6 +489,10 @@
         detailsViewButtonAccessibleName = UIManager.getString("FileChooser.detailsViewButtonAccessibleName",l);
     }
 
+    private Integer getMnemonic(String key, Locale l) {
+        return SwingUtilities2.getUIDefaultsInt(key, l);
+    }
+
     protected void installListeners(JFileChooser fc) {
         super.installListeners(fc);
         ActionMap actionMap = getActionMap();
--- a/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java	Fri Jun 21 19:11:42 2013 -0700
@@ -844,9 +844,6 @@
             "FileChooser.newFolderIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getFileChooserNewFolderIcon"),
             "FileChooser.upFolderIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getFileChooserUpFolderIcon"),
 
-            "FileChooser.lookInLabelMnemonic", new Integer(KeyEvent.VK_I),
-            "FileChooser.fileNameLabelMnemonic", new Integer(KeyEvent.VK_N),
-            "FileChooser.filesOfTypeLabelMnemonic", new Integer(KeyEvent.VK_T),
             "FileChooser.usesSingleFilePane", Boolean.TRUE,
             "FileChooser.ancestorInputMap",
                new UIDefaults.LazyInputMap(new Object[] {
--- a/src/share/classes/javax/swing/plaf/synth/SynthScrollBarUI.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthScrollBarUI.java	Fri Jun 21 19:11:42 2013 -0700
@@ -57,6 +57,7 @@
      */
     @Override
     protected void installDefaults() {
+        super.installDefaults();
         trackHighlight = NO_HIGHLIGHT;
         if (scrollbar.getLayout() == null ||
                      (scrollbar.getLayout() instanceof UIResource)) {
--- a/src/share/classes/javax/swing/text/DefaultCaret.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/javax/swing/text/DefaultCaret.java	Fri Jun 21 19:11:42 2013 -0700
@@ -403,6 +403,10 @@
      * @see MouseListener#mouseClicked
      */
     public void mouseClicked(MouseEvent e) {
+        if (getComponent() == null) {
+            return;
+        }
+
         int nclicks = SwingUtilities2.getAdjustedClickCount(getComponent(), e);
 
         if (! e.isConsumed()) {
@@ -1326,7 +1330,7 @@
         if ( ! SwingUtilities2.canCurrentEventAccessSystemClipboard() ) {
             return;
         }
-        if (this.dot != this.mark && component != null) {
+        if (this.dot != this.mark && component != null && component.hasFocus()) {
             Clipboard clip = getSystemSelection();
             if (clip != null) {
                 String selectedText;
--- a/src/share/classes/javax/swing/text/View.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/javax/swing/text/View.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -1174,6 +1174,7 @@
         // formed by added elements (i.e. they will be updated
         // by initialization.
         index0 = Math.max(index0, 0);
+        index1 = Math.max((getViewCount() - 1), 0);
         for (int i = index0; i <= index1; i++) {
             if (! ((i >= hole0) && (i <= hole1))) {
                 v = getView(i);
--- a/src/share/classes/javax/swing/text/html/FormView.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/javax/swing/text/html/FormView.java	Fri Jun 21 19:11:42 2013 -0700
@@ -159,6 +159,10 @@
             attr.getAttribute(StyleConstants.NameAttribute);
         JComponent c = null;
         Object model = attr.getAttribute(StyleConstants.ModelAttribute);
+
+        // Remove listeners previously registered in shared model
+        // when a new UI component is replaced.  See bug 8008289.
+        removeStaleListenerForModel(model);
         if (t == HTML.Tag.INPUT) {
             c = createInputComponent(attr, model);
         } else if (t == HTML.Tag.SELECT) {
@@ -310,6 +314,63 @@
         return c;
     }
 
+    private void removeStaleListenerForModel(Object model) {
+        if (model instanceof DefaultButtonModel) {
+            // case of JButton whose model is DefaultButtonModel
+            // Need to remove stale ActionListener, ChangeListener and
+            // ItemListener that are instance of AbstractButton$Handler.
+            DefaultButtonModel buttonModel = (DefaultButtonModel) model;
+            String listenerClass = "javax.swing.AbstractButton$Handler";
+            for (ActionListener listener : buttonModel.getActionListeners()) {
+                if (listenerClass.equals(listener.getClass().getName())) {
+                    buttonModel.removeActionListener(listener);
+                }
+            }
+            for (ChangeListener listener : buttonModel.getChangeListeners()) {
+                if (listenerClass.equals(listener.getClass().getName())) {
+                    buttonModel.removeChangeListener(listener);
+                }
+            }
+            for (ItemListener listener : buttonModel.getItemListeners()) {
+                if (listenerClass.equals(listener.getClass().getName())) {
+                    buttonModel.removeItemListener(listener);
+                }
+            }
+        } else if (model instanceof AbstractListModel) {
+            // case of JComboBox and JList
+            // For JList, the stale ListDataListener is instance
+            // BasicListUI$Handler.
+            // For JComboBox, there are 2 stale ListDataListeners, which are
+            // BasicListUI$Handler and BasicComboBoxUI$Handler.
+            AbstractListModel listModel = (AbstractListModel) model;
+            String listenerClass1 =
+                    "javax.swing.plaf.basic.BasicListUI$Handler";
+            String listenerClass2 =
+                    "javax.swing.plaf.basic.BasicComboBoxUI$Handler";
+            for (ListDataListener listener : listModel.getListDataListeners()) {
+                if (listenerClass1.equals(listener.getClass().getName())
+                        || listenerClass2.equals(listener.getClass().getName()))
+                {
+                    listModel.removeListDataListener(listener);
+                }
+            }
+        } else if (model instanceof AbstractDocument) {
+            // case of JPasswordField, JTextField and JTextArea
+            // All have 2 stale DocumentListeners.
+            String listenerClass1 =
+                    "javax.swing.plaf.basic.BasicTextUI$UpdateHandler";
+            String listenerClass2 =
+                    "javax.swing.text.DefaultCaret$Handler";
+            AbstractDocument docModel = (AbstractDocument) model;
+            for (DocumentListener listener : docModel.getDocumentListeners()) {
+                if (listenerClass1.equals(listener.getClass().getName())
+                        || listenerClass2.equals(listener.getClass().getName()))
+                {
+                    docModel.removeDocumentListener(listener);
+                }
+            }
+        }
+    }
 
     /**
      * Determines the maximum span for this view along an
@@ -347,7 +408,7 @@
 
 
     /**
-     * Responsible for processeing the ActionEvent.
+     * Responsible for processing the ActionEvent.
      * If the element associated with the FormView,
      * has a type of "submit", "reset", "text" or "password"
      * then the action is processed.  In the case of a "submit"
--- a/src/share/classes/javax/swing/text/html/parser/Parser.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/javax/swing/text/html/parser/Parser.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -952,7 +952,7 @@
                         ch = readCh();
                         break;
                 }
-                char data[] = {mapNumericReference((char) n)};
+                char data[] = mapNumericReference(n);
                 return data;
             }
             addString('#');
@@ -1021,7 +1021,7 @@
     }
 
     /**
-     * Converts numeric character reference to Unicode character.
+     * Converts numeric character reference to char array.
      *
      * Normally the code in a reference should be always converted
      * to the Unicode character with the same code, but due to
@@ -1030,13 +1030,21 @@
      * to displayable characters with other codes.
      *
      * @param c the code of numeric character reference.
-     * @return the character corresponding to the reference code.
+     * @return a char array corresponding to the reference code.
      */
-    private char mapNumericReference(char c) {
-        if (c < 130 || c > 159) {
-            return c;
+    private char[] mapNumericReference(int c) {
+        char[] data;
+        if (c >= 0xffff) { // outside unicode BMP.
+            try {
+                data = Character.toChars(c);
+            } catch (IllegalArgumentException e) {
+                data = new char[0];
+            }
+        } else {
+            data = new char[1];
+            data[0] = (c < 130 || c > 159) ? (char) c : cp1252Map[c - 130];
         }
-        return cp1252Map[c - 130];
+        return data;
     }
 
     /**
--- a/src/share/classes/sun/applet/resources/MsgAppletViewer_de.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/applet/resources/MsgAppletViewer_de.java	Fri Jun 21 19:11:42 2013 -0700
@@ -109,7 +109,7 @@
             {"appletclassloader.getresourceasstream.verbose", "Ressource {0} als Systemressource gefunden"},
             {"appletpanel.runloader.err", "Objekt oder Codeparameter."},
             {"appletpanel.runloader.exception", "Ausnahme beim Deserialisieren von {0}"},
-            {"appletpanel.destroyed", "Applet endg\u00FCltig gel\u00F6scht."},
+            {"appletpanel.destroyed", "Applet zerst\u00F6rt."},
             {"appletpanel.loaded", "Applet geladen."},
             {"appletpanel.started", "Applet gestartet."},
             {"appletpanel.inited", "Applet initialisiert."},
@@ -127,8 +127,8 @@
             {"appletpanel.notloaded", "Init.: Applet nicht geladen."},
             {"appletpanel.notinited", "Starten: Applet nicht initialisiert."},
             {"appletpanel.notstarted", "Stoppen: Applet nicht gestartet."},
-            {"appletpanel.notstopped", "Endg\u00FCltig l\u00F6schen: Applet nicht gestoppt."},
-            {"appletpanel.notdestroyed", "Verwerfen: Applet nicht endg\u00FCltig gel\u00F6scht."},
+            {"appletpanel.notstopped", "Zerst\u00F6ren: Applet nicht gestoppt."},
+            {"appletpanel.notdestroyed", "Verwerfen: Applet nicht zerst\u00F6rt."},
             {"appletpanel.notdisposed", "Laden: Applet nicht verworfen."},
             {"appletpanel.bail", "Unterbrochen: Zur\u00FCckziehen."},
             {"appletpanel.filenotfound", "Datei nicht gefunden beim Suchen nach: {0}"},
--- a/src/share/classes/sun/awt/HToolkit.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/awt/HToolkit.java	Fri Jun 21 19:11:42 2013 -0700
@@ -44,6 +44,14 @@
 public class HToolkit extends SunToolkit
     implements ComponentFactory {
 
+    private static final KeyboardFocusManagerPeer kfmPeer = new KeyboardFocusManagerPeer() {
+        public void setCurrentFocusedWindow(Window win) {}
+        public Window getCurrentFocusedWindow() { return null; }
+        public void setCurrentFocusOwner(Component comp) {}
+        public Component getCurrentFocusOwner() { return null; }
+        public void clearGlobalFocusOwner(Window activeWindow) {}
+    };
+
     public HToolkit() {
     }
 
@@ -152,15 +160,9 @@
         throw new HeadlessException();
     }
 
-    public KeyboardFocusManagerPeer createKeyboardFocusManagerPeer(KeyboardFocusManager manager) {
+    public KeyboardFocusManagerPeer getKeyboardFocusManagerPeer() {
         // See 6833019.
-        return
-            new KeyboardFocusManagerPeer() {
-                public Window getCurrentFocusedWindow() { return null; }
-                public void setCurrentFocusOwner(Component comp) {}
-                public Component getCurrentFocusOwner() { return null; }
-                public void clearGlobalFocusOwner(Window activeWindow) {}
-            };
+        return kfmPeer;
     }
 
     public TrayIconPeer createTrayIcon(TrayIcon target)
--- a/src/share/classes/sun/awt/HeadlessToolkit.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/awt/HeadlessToolkit.java	Fri Jun 21 19:11:42 2013 -0700
@@ -30,22 +30,25 @@
 import java.awt.dnd.peer.DragSourceContextPeer;
 import java.awt.event.*;
 import java.awt.im.InputMethodHighlight;
-import java.awt.im.spi.InputMethodDescriptor;
 import java.awt.image.*;
 import java.awt.datatransfer.Clipboard;
 import java.awt.peer.*;
 import java.beans.PropertyChangeListener;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
 import java.net.URL;
 import java.util.Map;
 import java.util.Properties;
-import sun.awt.im.InputContext;
-import sun.awt.image.ImageRepresentation;
 
 public class HeadlessToolkit extends Toolkit
     implements ComponentFactory, KeyboardFocusManagerPeerProvider {
 
+    private static final KeyboardFocusManagerPeer kfmPeer = new KeyboardFocusManagerPeer() {
+        public void setCurrentFocusedWindow(Window win) {}
+        public Window getCurrentFocusedWindow() { return null; }
+        public void setCurrentFocusOwner(Component comp) {}
+        public Component getCurrentFocusOwner() { return null; }
+        public void clearGlobalFocusOwner(Window activeWindow) {}
+    };
+
     private Toolkit tk;
     private ComponentFactory componentFactory;
 
@@ -179,15 +182,9 @@
         throw new HeadlessException();
     }
 
-    public KeyboardFocusManagerPeer createKeyboardFocusManagerPeer(KeyboardFocusManager manager) {
+    public KeyboardFocusManagerPeer getKeyboardFocusManagerPeer() {
         // See 6833019.
-        return
-            new KeyboardFocusManagerPeer() {
-                public Window getCurrentFocusedWindow() { return null; }
-                public void setCurrentFocusOwner(Component comp) {}
-                public Component getCurrentFocusOwner() { return null; }
-                public void clearGlobalFocusOwner(Window activeWindow) {}
-            };
+        return kfmPeer;
     }
 
     public TrayIconPeer createTrayIcon(TrayIcon target)
--- a/src/share/classes/sun/awt/KeyboardFocusManagerPeerImpl.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/awt/KeyboardFocusManagerPeerImpl.java	Fri Jun 21 19:11:42 2013 -0700
@@ -53,12 +53,6 @@
     public static final int SNFH_SUCCESS_HANDLED = 1;
     public static final int SNFH_SUCCESS_PROCEED = 2;
 
-    protected KeyboardFocusManager manager;
-
-    public KeyboardFocusManagerPeerImpl(KeyboardFocusManager manager) {
-        this.manager = manager;
-    }
-
     @Override
     public void clearGlobalFocusOwner(Window activeWindow) {
         if (activeWindow != null) {
--- a/src/share/classes/sun/awt/KeyboardFocusManagerPeerProvider.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/awt/KeyboardFocusManagerPeerProvider.java	Fri Jun 21 19:11:42 2013 -0700
@@ -25,20 +25,19 @@
 
 package sun.awt;
 
-import java.awt.KeyboardFocusManager;
 import java.awt.peer.KeyboardFocusManagerPeer;
 
 /**
  * {@link KeyboardFocusManagerPeerProvider} is required to be implemented by
  * the currently used {@link java.awt.Toolkit} instance. In order to initialize
- * {@link java.awt.KeyboardFocusManager}, an instance of {@link KeyboardFocusManagerPeer}
- * is needed. To create that instance, the {@link #createKeyboardFocusManagerPeer}
+ * {@link java.awt.KeyboardFocusManager}, a singleton instance of {@link KeyboardFocusManagerPeer}
+ * is needed. To obtain that instance, the {@link #getKeyboardFocusManagerPeer}
  * method of the current toolkit is called.
  */
 public interface KeyboardFocusManagerPeerProvider {
 
     /**
-     * Creates a KeyboardFocusManagerPeer for the specified KeyboardFocusManager.
+     * Gets a singleton KeyboardFocusManagerPeer instance.
      */
-    KeyboardFocusManagerPeer createKeyboardFocusManagerPeer(KeyboardFocusManager manager);
+    KeyboardFocusManagerPeer getKeyboardFocusManagerPeer();
 }
--- a/src/share/classes/sun/awt/SunToolkit.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/awt/SunToolkit.java	Fri Jun 21 19:11:42 2013 -0700
@@ -202,7 +202,7 @@
     public abstract RobotPeer createRobot(Robot target, GraphicsDevice screen)
         throws AWTException;
 
-    public abstract KeyboardFocusManagerPeer createKeyboardFocusManagerPeer(KeyboardFocusManager manager)
+    public abstract KeyboardFocusManagerPeer getKeyboardFocusManagerPeer()
         throws HeadlessException;
 
     /**
@@ -1901,6 +1901,13 @@
     }
 
     /**
+     * Returns true if swing backbuffer should be translucent.
+     */
+    public boolean isSwingBackbufferTranslucencySupported() {
+        return false;
+    }
+
+    /**
      * Returns whether or not a containing top level window for the passed
      * component is
      * {@link GraphicsDevice.WindowTranslucency#PERPIXEL_TRANSLUCENT PERPIXEL_TRANSLUCENT}.
--- a/src/share/classes/sun/awt/datatransfer/DataTransferer.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/awt/datatransfer/DataTransferer.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1868,7 +1868,7 @@
      */
     public class ReencodingInputStream extends InputStream {
         protected BufferedReader wrapped;
-        protected final char[] in = new char[1];
+        protected final char[] in = new char[2];
         protected byte[] out;
 
         protected CharsetEncoder encoder;
@@ -1921,7 +1921,7 @@
 
             try {
                 encoder = Charset.forName(targetEncoding).newEncoder();
-                out = new byte[(int)(encoder.maxBytesPerChar() + 0.5)];
+                out = new byte[(int)(encoder.maxBytesPerChar() * in.length + 0.5)];
                 inBuf = CharBuffer.wrap(in);
                 outBuf = ByteBuffer.wrap(out);
             } catch (IllegalCharsetNameException e) {
@@ -1945,31 +1945,50 @@
             }
         }
 
+        private int readChar() throws IOException {
+            int c = wrapped.read();
+
+            if (c == -1) { // -1 is EOS
+                eos = true;
+                return -1;
+            }
+
+            // "c == 0" is not quite correct, but good enough on Windows.
+            if (numTerminators > 0 && c == 0) {
+                eos = true;
+                return -1;
+            } else if (eoln != null && matchCharArray(eoln, c)) {
+                c = '\n' & 0xFFFF;
+            }
+
+            return c;
+        }
+
         public int read() throws IOException {
             if (eos) {
                 return -1;
             }
 
             if (index >= limit) {
-                int c = wrapped.read();
-
-                if (c == -1) { // -1 is EOS
-                    eos = true;
+                // deal with supplementary characters
+                int c = readChar();
+                if (c == -1) {
                     return -1;
                 }
 
-                // "c == 0" is not quite correct, but good enough on Windows.
-                if (numTerminators > 0 && c == 0) {
-                    eos = true;
-                    return -1;
-                } else if (eoln != null && matchCharArray(eoln, c)) {
-                    c = '\n' & 0xFFFF;
+                in[0] = (char) c;
+                in[1] = 0;
+                inBuf.limit(1);
+                if (Character.isHighSurrogate((char) c)) {
+                    c = readChar();
+                    if (c != -1) {
+                        in[1] = (char) c;
+                        inBuf.limit(2);
+                    }
                 }
 
-                in[0] = (char)c;
-
                 inBuf.rewind();
-                outBuf.rewind();
+                outBuf.limit(out.length).rewind();
                 encoder.encode(inBuf, outBuf, false);
                 outBuf.flip();
                 limit = outBuf.limit();
--- a/src/share/classes/sun/awt/im/InputContext.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/awt/im/InputContext.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -785,7 +785,7 @@
     public void disableNativeIM() {
         InputMethod inputMethod = getInputMethod();
         if (inputMethod != null && inputMethod instanceof InputMethodAdapter) {
-            ((InputMethodAdapter)inputMethod).disableInputMethod();
+            ((InputMethodAdapter)inputMethod).stopListening();
         }
     }
 
--- a/src/share/classes/sun/awt/im/InputMethodAdapter.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/awt/im/InputMethodAdapter.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -79,7 +79,6 @@
 
     /**
      * Informs the input method adapter not to listen to the native events.
-     * This method is called when a Java input method is active.
      */
     protected void stopListening() {
         // ignore - adapters can override if needed
--- a/src/share/classes/sun/awt/image/SurfaceManager.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/awt/image/SurfaceManager.java	Fri Jun 21 19:11:42 2013 -0700
@@ -31,6 +31,7 @@
 import java.awt.Image;
 import java.awt.ImageCapabilities;
 import java.awt.image.BufferedImage;
+import java.awt.image.VolatileImage;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.Iterator;
 import sun.java2d.SurfaceData;
@@ -287,4 +288,18 @@
             flush(true);
         }
     }
+
+    /**
+     * Returns a scale factor of the image. This is utility method, which
+     * fetches information from the SurfaceData of the image.
+     *
+     * @see SurfaceData#getDefaultScale
+     */
+    public static int getImageScale(final Image img) {
+        if (!(img instanceof VolatileImage)) {
+            return 1;
+        }
+        final SurfaceManager sm = getManager(img);
+        return sm.getPrimarySurfaceData().getDefaultScale();
+    }
 }
--- a/src/share/classes/sun/awt/image/VolatileSurfaceManager.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/awt/image/VolatileSurfaceManager.java	Fri Jun 21 19:11:42 2013 -0700
@@ -333,11 +333,12 @@
             // using a SurfaceData that was created in a different
             // display mode.
             sdBackup = null;
-            sdCurrent = getBackupSurface();
             // Now, invalidate the old hardware-based SurfaceData
+            // Note that getBackupSurface may set sdAccel to null so we have to invalidate it before
             SurfaceData oldData = sdAccel;
             sdAccel = null;
             oldData.invalidate();
+            sdCurrent = getBackupSurface();
         }
         // Update graphicsConfig for the vImg in case it changed due to
         // this display change event
--- a/src/share/classes/sun/font/FileFontStrike.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/font/FileFontStrike.java	Fri Jun 21 19:11:42 2013 -0700
@@ -747,14 +747,9 @@
             return origMinX;
         }
 
-        long pixelData;
-        if (StrikeCache.nativeAddressSize == 4) {
-            pixelData = 0xffffffff &
-                StrikeCache.unsafe.getInt(ptr + StrikeCache.pixelDataOffset);
-        } else {
-            pixelData =
-                StrikeCache.unsafe.getLong(ptr + StrikeCache.pixelDataOffset);
-        }
+        long pixelData =
+            StrikeCache.unsafe.getAddress(ptr + StrikeCache.pixelDataOffset);
+
         if (pixelData == 0L) {
             return origMinX;
         }
--- a/src/share/classes/sun/font/GlyphList.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/font/GlyphList.java	Fri Jun 21 19:11:42 2013 -0700
@@ -361,16 +361,10 @@
                 graybits = new byte[len];
             }
         }
-        long pixelDataAddress;
-        if (StrikeCache.nativeAddressSize == 4) {
-            pixelDataAddress = 0xffffffff &
-                StrikeCache.unsafe.getInt(images[glyphindex] +
+        long pixelDataAddress =
+            StrikeCache.unsafe.getAddress(images[glyphindex] +
                                           StrikeCache.pixelDataOffset);
-        } else {
-            pixelDataAddress =
-            StrikeCache.unsafe.getLong(images[glyphindex] +
-                                       StrikeCache.pixelDataOffset);
-        }
+
         if (pixelDataAddress == 0L) {
             return graybits;
         }
--- a/src/share/classes/sun/invoke/util/ValueConversions.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/invoke/util/ValueConversions.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -44,6 +44,7 @@
     static {
         final Object[] values = { 255 };
         AccessController.doPrivileged(new PrivilegedAction<Void>() {
+                @Override
                 public Void run() {
                     values[0] = Integer.getInteger(THIS_CLASS.getName()+".MAX_ARITY", 255);
                     return null;
@@ -55,9 +56,9 @@
     private static final Lookup IMPL_LOOKUP = MethodHandles.lookup();
 
     private static EnumMap<Wrapper, MethodHandle>[] newWrapperCaches(int n) {
-        @SuppressWarnings("unchecked")
+        @SuppressWarnings("unchecked")  // generic array creation
         EnumMap<Wrapper, MethodHandle>[] caches
-                = (EnumMap<Wrapper, MethodHandle>[]) new EnumMap[n];  // unchecked warning expected here
+                = (EnumMap<Wrapper, MethodHandle>[]) new EnumMap<?,?>[n];
         for (int i = 0; i < n; i++)
             caches[i] = new EnumMap<>(Wrapper.class);
         return caches;
@@ -118,42 +119,15 @@
         return primitiveConversion(Wrapper.DOUBLE, x, cast).doubleValue();
     }
 
-    /// Converting references to "raw" values.
-    /// A raw primitive value is always an int or long.
-
-    static int unboxByteRaw(Object x, boolean cast) {
-        return unboxByte(x, cast);
-    }
-
-    static int unboxShortRaw(Object x, boolean cast) {
-        return unboxShort(x, cast);
-    }
-
-    static int unboxBooleanRaw(Object x, boolean cast) {
-        return unboxBoolean(x, cast) ? 1 : 0;
-    }
-
-    static int unboxCharacterRaw(Object x, boolean cast) {
-        return unboxCharacter(x, cast);
-    }
-
-    static int unboxFloatRaw(Object x, boolean cast) {
-        return Float.floatToIntBits(unboxFloat(x, cast));
-    }
-
-    static long unboxDoubleRaw(Object x, boolean cast) {
-        return Double.doubleToRawLongBits(unboxDouble(x, cast));
-    }
-
-    private static MethodType unboxType(Wrapper wrap, boolean raw) {
-        return MethodType.methodType(rawWrapper(wrap, raw).primitiveType(), Object.class, boolean.class);
+    private static MethodType unboxType(Wrapper wrap) {
+        return MethodType.methodType(wrap.primitiveType(), Object.class, boolean.class);
     }
 
     private static final EnumMap<Wrapper, MethodHandle>[]
-            UNBOX_CONVERSIONS = newWrapperCaches(4);
+            UNBOX_CONVERSIONS = newWrapperCaches(2);
 
-    private static MethodHandle unbox(Wrapper wrap, boolean raw, boolean cast) {
-        EnumMap<Wrapper, MethodHandle> cache = UNBOX_CONVERSIONS[(cast?1:0)+(raw?2:0)];
+    private static MethodHandle unbox(Wrapper wrap, boolean cast) {
+        EnumMap<Wrapper, MethodHandle> cache = UNBOX_CONVERSIONS[(cast?1:0)];
         MethodHandle mh = cache.get(wrap);
         if (mh != null) {
             return mh;
@@ -163,19 +137,15 @@
             case OBJECT:
                 mh = IDENTITY; break;
             case VOID:
-                mh = raw ? ALWAYS_ZERO : IGNORE; break;
-            case INT: case LONG:
-                // these guys don't need separate raw channels
-                if (raw)  mh = unbox(wrap, false, cast);
-                break;
+                mh = IGNORE; break;
         }
         if (mh != null) {
             cache.put(wrap, mh);
             return mh;
         }
         // look up the method
-        String name = "unbox" + wrap.simpleName() + (raw ? "Raw" : "");
-        MethodType type = unboxType(wrap, raw);
+        String name = "unbox" + wrap.wrapperSimpleName();
+        MethodType type = unboxType(wrap);
         try {
             mh = IMPL_LOOKUP.findStatic(THIS_CLASS, name, type);
         } catch (ReflectiveOperationException ex) {
@@ -187,35 +157,33 @@
             return mh;
         }
         throw new IllegalArgumentException("cannot find unbox adapter for " + wrap
-                + (cast ? " (cast)" : "") + (raw ? " (raw)" : ""));
+                + (cast ? " (cast)" : ""));
     }
 
     public static MethodHandle unboxCast(Wrapper type) {
-        return unbox(type, false, true);
-    }
-
-    public static MethodHandle unboxRaw(Wrapper type) {
-        return unbox(type, true, false);
+        return unbox(type, true);
     }
 
     public static MethodHandle unbox(Class<?> type) {
-        return unbox(Wrapper.forPrimitiveType(type), false, false);
+        return unbox(Wrapper.forPrimitiveType(type), false);
     }
 
     public static MethodHandle unboxCast(Class<?> type) {
-        return unbox(Wrapper.forPrimitiveType(type), false, true);
-    }
-
-    public static MethodHandle unboxRaw(Class<?> type) {
-        return unbox(Wrapper.forPrimitiveType(type), true, false);
+        return unbox(Wrapper.forPrimitiveType(type), true);
     }
 
     static private final Integer ZERO_INT = 0, ONE_INT = 1;
 
     /// Primitive conversions
+    /**
+     * Produce a Number which represents the given value {@code x}
+     * according to the primitive type of the given wrapper {@code wrap}.
+     * Caller must invoke intValue, byteValue, longValue (etc.) on the result
+     * to retrieve the desired primitive value.
+     */
     public static Number primitiveConversion(Wrapper wrap, Object x, boolean cast) {
         // Maybe merge this code with Wrapper.convert/cast.
-        Number res = null;
+        Number res;
         if (x == null) {
             if (!cast)  return null;
             return ZERO_INT;
@@ -237,6 +205,27 @@
         return res;
     }
 
+    /**
+     * The JVM verifier allows boolean, byte, short, or char to widen to int.
+     * Support exactly this conversion, from a boxed value type Boolean,
+     * Byte, Short, Character, or Integer.
+     */
+    public static int widenSubword(Object x) {
+        if (x instanceof Integer)
+            return (int) x;
+        else if (x instanceof Boolean)
+            return fromBoolean((boolean) x);
+        else if (x instanceof Character)
+            return (char) x;
+        else if (x instanceof Short)
+            return (short) x;
+        else if (x instanceof Byte)
+            return (byte) x;
+        else
+            // Fail with a ClassCastException.
+            return (int) x;
+    }
+
     /// Converting primitives to references
 
     static Integer boxInteger(int x) {
@@ -271,53 +260,17 @@
         return x;
     }
 
-    /// Converting raw primitives to references
-
-    static Byte boxByteRaw(int x) {
-        return boxByte((byte)x);
-    }
-
-    static Short boxShortRaw(int x) {
-        return boxShort((short)x);
-    }
-
-    static Boolean boxBooleanRaw(int x) {
-        return boxBoolean(x != 0);
-    }
-
-    static Character boxCharacterRaw(int x) {
-        return boxCharacter((char)x);
-    }
-
-    static Float boxFloatRaw(int x) {
-        return boxFloat(Float.intBitsToFloat(x));
-    }
-
-    static Double boxDoubleRaw(long x) {
-        return boxDouble(Double.longBitsToDouble(x));
-    }
-
-    // a raw void value is (arbitrarily) a garbage int
-    static Void boxVoidRaw(int x) {
-        return null;
-    }
-
-    private static MethodType boxType(Wrapper wrap, boolean raw) {
+    private static MethodType boxType(Wrapper wrap) {
         // be exact, since return casts are hard to compose
         Class<?> boxType = wrap.wrapperType();
-        return MethodType.methodType(boxType, rawWrapper(wrap, raw).primitiveType());
-    }
-
-    private static Wrapper rawWrapper(Wrapper wrap, boolean raw) {
-        if (raw)  return wrap.isDoubleWord() ? Wrapper.LONG : Wrapper.INT;
-        return wrap;
+        return MethodType.methodType(boxType, wrap.primitiveType());
     }
 
     private static final EnumMap<Wrapper, MethodHandle>[]
-            BOX_CONVERSIONS = newWrapperCaches(4);
+            BOX_CONVERSIONS = newWrapperCaches(2);
 
-    private static MethodHandle box(Wrapper wrap, boolean exact, boolean raw) {
-        EnumMap<Wrapper, MethodHandle> cache = BOX_CONVERSIONS[(exact?1:0)+(raw?2:0)];
+    private static MethodHandle box(Wrapper wrap, boolean exact) {
+        EnumMap<Wrapper, MethodHandle> cache = BOX_CONVERSIONS[(exact?1:0)];
         MethodHandle mh = cache.get(wrap);
         if (mh != null) {
             return mh;
@@ -327,11 +280,7 @@
             case OBJECT:
                 mh = IDENTITY; break;
             case VOID:
-                if (!raw)  mh = ZERO_OBJECT;
-                break;
-            case INT: case LONG:
-                // these guys don't need separate raw channels
-                if (raw)  mh = box(wrap, exact, false);
+                mh = ZERO_OBJECT;
                 break;
         }
         if (mh != null) {
@@ -339,8 +288,8 @@
             return mh;
         }
         // look up the method
-        String name = "box" + wrap.simpleName() + (raw ? "Raw" : "");
-        MethodType type = boxType(wrap, raw);
+        String name = "box" + wrap.wrapperSimpleName();
+        MethodType type = boxType(wrap);
         if (exact) {
             try {
                 mh = IMPL_LOOKUP.findStatic(THIS_CLASS, name, type);
@@ -348,171 +297,35 @@
                 mh = null;
             }
         } else {
-            mh = box(wrap, !exact, raw).asType(type.erase());
+            mh = box(wrap, !exact).asType(type.erase());
         }
         if (mh != null) {
             cache.put(wrap, mh);
             return mh;
         }
         throw new IllegalArgumentException("cannot find box adapter for "
-                + wrap + (exact ? " (exact)" : "") + (raw ? " (raw)" : ""));
+                + wrap + (exact ? " (exact)" : ""));
     }
 
     public static MethodHandle box(Class<?> type) {
         boolean exact = false;
         // e.g., boxShort(short)Short if exact,
         // e.g., boxShort(short)Object if !exact
-        return box(Wrapper.forPrimitiveType(type), exact, false);
-    }
-
-    public static MethodHandle boxRaw(Class<?> type) {
-        boolean exact = false;
-        // e.g., boxShortRaw(int)Short if exact
-        // e.g., boxShortRaw(int)Object if !exact
-        return box(Wrapper.forPrimitiveType(type), exact, true);
+        return box(Wrapper.forPrimitiveType(type), exact);
     }
 
     public static MethodHandle box(Wrapper type) {
         boolean exact = false;
-        return box(type, exact, false);
-    }
-
-    public static MethodHandle boxRaw(Wrapper type) {
-        boolean exact = false;
-        return box(type, exact, true);
-    }
-
-    /// Kludges for when raw values get accidentally boxed.
-
-    static int unboxRawInteger(Object x) {
-        if (x instanceof Integer)
-            return (int) x;
-        else
-            return (int) unboxLong(x, false);
-    }
-
-    static Integer reboxRawInteger(Object x) {
-        if (x instanceof Integer)
-            return (Integer) x;
-        else
-            return (int) unboxLong(x, false);
-    }
-
-    static Byte reboxRawByte(Object x) {
-        if (x instanceof Byte)  return (Byte) x;
-        return boxByteRaw(unboxRawInteger(x));
-    }
-
-    static Short reboxRawShort(Object x) {
-        if (x instanceof Short)  return (Short) x;
-        return boxShortRaw(unboxRawInteger(x));
-    }
-
-    static Boolean reboxRawBoolean(Object x) {
-        if (x instanceof Boolean)  return (Boolean) x;
-        return boxBooleanRaw(unboxRawInteger(x));
-    }
-
-    static Character reboxRawCharacter(Object x) {
-        if (x instanceof Character)  return (Character) x;
-        return boxCharacterRaw(unboxRawInteger(x));
-    }
-
-    static Float reboxRawFloat(Object x) {
-        if (x instanceof Float)  return (Float) x;
-        return boxFloatRaw(unboxRawInteger(x));
-    }
-
-    static Long reboxRawLong(Object x) {
-        return (Long) x;  //never a rebox
-    }
-
-    static Double reboxRawDouble(Object x) {
-        if (x instanceof Double)  return (Double) x;
-        return boxDoubleRaw(unboxLong(x, true));
-    }
-
-    private static MethodType reboxType(Wrapper wrap) {
-        Class<?> boxType = wrap.wrapperType();
-        return MethodType.methodType(boxType, Object.class);
-    }
-
-    private static final EnumMap<Wrapper, MethodHandle>[]
-            REBOX_CONVERSIONS = newWrapperCaches(1);
-
-    /**
-     * Because we normalize primitive types to reduce the number of signatures,
-     * primitives are sometimes manipulated under an "erased" type,
-     * either int (for types other than long/double) or long (for all types).
-     * When the erased primitive value is then boxed into an Integer or Long,
-     * the final boxed primitive is sometimes required.  This transformation
-     * is called a "rebox".  It takes an Integer or Long and produces some
-     * other boxed value, typed (inexactly) as an Object
-     */
-    public static MethodHandle rebox(Wrapper wrap) {
-        EnumMap<Wrapper, MethodHandle> cache = REBOX_CONVERSIONS[0];
-        MethodHandle mh = cache.get(wrap);
-        if (mh != null) {
-            return mh;
-        }
-        // slow path
-        switch (wrap) {
-            case OBJECT:
-                mh = IDENTITY; break;
-            case VOID:
-                throw new IllegalArgumentException("cannot rebox a void");
-        }
-        if (mh != null) {
-            cache.put(wrap, mh);
-            return mh;
-        }
-        // look up the method
-        String name = "reboxRaw" + wrap.simpleName();
-        MethodType type = reboxType(wrap);
-        try {
-            mh = IMPL_LOOKUP.findStatic(THIS_CLASS, name, type);
-            mh = mh.asType(IDENTITY.type());
-        } catch (ReflectiveOperationException ex) {
-            mh = null;
-        }
-        if (mh != null) {
-            cache.put(wrap, mh);
-            return mh;
-        }
-        throw new IllegalArgumentException("cannot find rebox adapter for " + wrap);
-    }
-
-    public static MethodHandle rebox(Class<?> type) {
-        return rebox(Wrapper.forPrimitiveType(type));
-    }
-
-    /// Width-changing conversions between int and long.
-
-    static long widenInt(int x) {
-        return (long) x;
-    }
-
-    static Long widenBoxedInt(Integer x) {
-        return (long)(int)x;
-    }
-
-    static int narrowLong(long x) {
-        return (int) x;
-    }
-
-    static Integer narrowBoxedLong(Long x) {
-        return (int)(long) x;
+        return box(type, exact);
     }
 
     /// Constant functions
 
     static void ignore(Object x) {
         // no value to return; this is an unbox of null
-        return;
     }
 
     static void empty() {
-        return;
     }
 
     static Object zeroObject() {
@@ -553,7 +366,7 @@
             case OBJECT:
             case INT: case LONG: case FLOAT: case DOUBLE:
                 try {
-                    mh = IMPL_LOOKUP.findStatic(THIS_CLASS, "zero"+wrap.simpleName(), type);
+                    mh = IMPL_LOOKUP.findStatic(THIS_CLASS, "zero"+wrap.wrapperSimpleName(), type);
                 } catch (ReflectiveOperationException ex) {
                     mh = null;
                 }
@@ -564,12 +377,9 @@
             return mh;
         }
 
-        // use the raw method
-        Wrapper rawWrap = wrap.rawPrimitive();
-        if (mh == null && rawWrap != wrap) {
-            mh = MethodHandles.explicitCastArguments(zeroConstantFunction(rawWrap), type);
-        }
-        if (mh != null) {
+        // use zeroInt and cast the result
+        if (wrap.isSubwordOrInt() && wrap != Wrapper.INT) {
+            mh = MethodHandles.explicitCastArguments(zeroConstantFunction(Wrapper.INT), type);
             cache.put(wrap, mh);
             return mh;
         }
@@ -579,24 +389,6 @@
     /// Converting references to references.
 
     /**
-     * Value-killing function.
-     * @param x an arbitrary reference value
-     * @return a null
-     */
-    static Object alwaysNull(Object x) {
-        return null;
-    }
-
-    /**
-     * Value-killing function.
-     * @param x an arbitrary reference value
-     * @return a zero
-     */
-    static int alwaysZero(Object x) {
-        return 0;
-    }
-
-    /**
      * Identity function.
      * @param x an arbitrary reference value
      * @return the same value x
@@ -605,6 +397,10 @@
         return x;
     }
 
+    static <T> T[] identity(T[] x) {
+        return x;
+    }
+
     /**
      * Identity function on ints.
      * @param x an arbitrary int value
@@ -653,37 +449,45 @@
      * @param x an arbitrary reference value
      * @return the same value x
      */
+    @SuppressWarnings("unchecked")
     static <T,U> T castReference(Class<? extends T> t, U x) {
-        return t.cast(x);
+        // inlined Class.cast because we can't ForceInline it
+        if (x != null && !t.isInstance(x))
+            throw newClassCastException(t, x);
+        return (T) x;
     }
 
-    private static final MethodHandle IDENTITY, IDENTITY_I, IDENTITY_J, CAST_REFERENCE, ALWAYS_NULL, ALWAYS_ZERO, ZERO_OBJECT, IGNORE, EMPTY, NEW_ARRAY;
+    private static ClassCastException newClassCastException(Class<?> t, Object obj) {
+        return new ClassCastException("Cannot cast " + obj.getClass().getName() + " to " + t.getName());
+    }
+
+    private static final MethodHandle IDENTITY, CAST_REFERENCE, ZERO_OBJECT, IGNORE, EMPTY,
+            ARRAY_IDENTITY, FILL_NEW_TYPED_ARRAY, FILL_NEW_ARRAY;
     static {
         try {
             MethodType idType = MethodType.genericMethodType(1);
             MethodType castType = idType.insertParameterTypes(0, Class.class);
-            MethodType alwaysZeroType = idType.changeReturnType(int.class);
             MethodType ignoreType = idType.changeReturnType(void.class);
             MethodType zeroObjectType = MethodType.genericMethodType(0);
             IDENTITY = IMPL_LOOKUP.findStatic(THIS_CLASS, "identity", idType);
-            IDENTITY_I = IMPL_LOOKUP.findStatic(THIS_CLASS, "identity", MethodType.methodType(int.class, int.class));
-            IDENTITY_J = IMPL_LOOKUP.findStatic(THIS_CLASS, "identity", MethodType.methodType(long.class, long.class));
             //CAST_REFERENCE = IMPL_LOOKUP.findVirtual(Class.class, "cast", idType);
             CAST_REFERENCE = IMPL_LOOKUP.findStatic(THIS_CLASS, "castReference", castType);
-            ALWAYS_NULL = IMPL_LOOKUP.findStatic(THIS_CLASS, "alwaysNull", idType);
-            ALWAYS_ZERO = IMPL_LOOKUP.findStatic(THIS_CLASS, "alwaysZero", alwaysZeroType);
             ZERO_OBJECT = IMPL_LOOKUP.findStatic(THIS_CLASS, "zeroObject", zeroObjectType);
             IGNORE = IMPL_LOOKUP.findStatic(THIS_CLASS, "ignore", ignoreType);
             EMPTY = IMPL_LOOKUP.findStatic(THIS_CLASS, "empty", ignoreType.dropParameterTypes(0, 1));
-            NEW_ARRAY = IMPL_LOOKUP.findStatic(THIS_CLASS, "newArray", MethodType.methodType(Object[].class, int.class));
+            ARRAY_IDENTITY = IMPL_LOOKUP.findStatic(THIS_CLASS, "identity", MethodType.methodType(Object[].class, Object[].class));
+            FILL_NEW_ARRAY = IMPL_LOOKUP
+                    .findStatic(THIS_CLASS, "fillNewArray",
+                          MethodType.methodType(Object[].class, Integer.class, Object[].class));
+            FILL_NEW_TYPED_ARRAY = IMPL_LOOKUP
+                    .findStatic(THIS_CLASS, "fillNewTypedArray",
+                          MethodType.methodType(Object[].class, Object[].class, Integer.class, Object[].class));
         } catch (NoSuchMethodException | IllegalAccessException ex) {
-            Error err = new InternalError("uncaught exception");
-            err.initCause(ex);
-            throw err;
+            throw newInternalError("uncaught exception", ex);
         }
     }
 
-    // Varargs methods need to be in a separately initialized class, to bootstrapping problems.
+    // Varargs methods need to be in a separately initialized class, to avoid bootstrapping problems.
     static class LazyStatics {
         private static final MethodHandle COPY_AS_REFERENCE_ARRAY, COPY_AS_PRIMITIVE_ARRAY, MAKE_LIST;
         static {
@@ -693,42 +497,74 @@
                 COPY_AS_PRIMITIVE_ARRAY = IMPL_LOOKUP.findStatic(THIS_CLASS, "copyAsPrimitiveArray", MethodType.methodType(Object.class, Wrapper.class, Object[].class));
                 MAKE_LIST = IMPL_LOOKUP.findStatic(THIS_CLASS, "makeList", MethodType.methodType(List.class, Object[].class));
             } catch (ReflectiveOperationException ex) {
-                Error err = new InternalError("uncaught exception");
-                err.initCause(ex);
-                throw err;
+                throw newInternalError("uncaught exception", ex);
             }
         }
     }
 
+    static MethodHandle collectArguments(MethodHandle mh, int pos, MethodHandle collector) {
+        // FIXME: API needs public MHs.collectArguments.
+        // Should be:
+        //   return MethodHandles.collectArguments(mh, 0, collector);
+        // The rest of this code is a workaround for not having that API.
+        if (COLLECT_ARGUMENTS != null) {
+            try {
+                return (MethodHandle)
+                    COLLECT_ARGUMENTS.invokeExact(mh, pos, collector);
+            } catch (Throwable ex) {
+                if (ex instanceof RuntimeException)
+                    throw (RuntimeException) ex;
+                if (ex instanceof Error)
+                    throw (Error) ex;
+                throw new Error(ex.getMessage(), ex);
+            }
+        }
+        // Emulate MHs.collectArguments using fold + drop.
+        // This is slightly inefficient.
+        // More seriously, it can put a MH over the 255-argument limit.
+        mh = MethodHandles.dropArguments(mh, 1, collector.type().parameterList());
+        mh = MethodHandles.foldArguments(mh, collector);
+        return mh;
+    }
+    private static final MethodHandle COLLECT_ARGUMENTS;
+    static {
+        MethodHandle mh = null;
+        try {
+            final java.lang.reflect.Method m = MethodHandles.class
+                .getDeclaredMethod("collectArguments",
+                    MethodHandle.class, int.class, MethodHandle.class);
+            AccessController.doPrivileged(new PrivilegedAction<Void>() {
+                    @Override
+                    public Void run() {
+                        m.setAccessible(true);
+                        return null;
+                    }
+                });
+            mh = IMPL_LOOKUP.unreflect(m);
+        } catch (ReflectiveOperationException ex) {
+            throw newInternalError(ex);
+        }
+        COLLECT_ARGUMENTS = mh;
+    }
+
     private static final EnumMap<Wrapper, MethodHandle>[] WRAPPER_CASTS
-            = newWrapperCaches(2);
+            = newWrapperCaches(1);
 
     /** Return a method that casts its sole argument (an Object) to the given type
-     *  and returns it as the given type (if exact is true), or as plain Object (if erase is true).
+     *  and returns it as the given type.
      */
     public static MethodHandle cast(Class<?> type) {
-        boolean exact = false;
         if (type.isPrimitive())  throw new IllegalArgumentException("cannot cast primitive type "+type);
-        MethodHandle mh = null;
+        MethodHandle mh;
         Wrapper wrap = null;
         EnumMap<Wrapper, MethodHandle> cache = null;
         if (Wrapper.isWrapperType(type)) {
             wrap = Wrapper.forWrapperType(type);
-            cache = WRAPPER_CASTS[exact?1:0];
+            cache = WRAPPER_CASTS[0];
             mh = cache.get(wrap);
             if (mh != null)  return mh;
         }
-        if (VerifyType.isNullReferenceConversion(Object.class, type))
-            mh = IDENTITY;
-        else if (VerifyType.isNullType(type))
-            mh = ALWAYS_NULL;
-        else
-            mh = MethodHandles.insertArguments(CAST_REFERENCE, 0, type);
-        if (exact) {
-            MethodType xmt = MethodType.methodType(type, Object.class);
-            mh = MethodHandles.explicitCastArguments(mh, xmt);
-            //mh = AdapterMethodHandle.makeRetypeRaw(IMPL_TOKEN, xmt, mh);
-        }
+        mh = MethodHandles.insertArguments(CAST_REFERENCE, 0, type);
         if (cache != null)
             cache.put(wrap, mh);
         return mh;
@@ -739,8 +575,10 @@
     }
 
     public static MethodHandle identity(Class<?> type) {
-        // This stuff has been moved into MethodHandles:
-        return MethodHandles.identity(type);
+        if (!type.isPrimitive())
+            // Reference identity has been moved into MethodHandles:
+            return MethodHandles.identity(type);
+        return identity(Wrapper.findPrimitiveType(type));
     }
 
     public static MethodHandle identity(Wrapper wrap) {
@@ -773,95 +611,203 @@
         throw new IllegalArgumentException("cannot find identity for " + wrap);
     }
 
-    /// Float/non-float conversions.
+    /// Primitive conversions.
+    // These are supported directly by the JVM, usually by a single instruction.
+    // In the case of narrowing to a subword, there may be a pair of instructions.
+    // In the case of booleans, there may be a helper routine to manage a 1-bit value.
+    // This is the full 8x8 matrix (minus the diagonal).
 
-    static float doubleToFloat(double x) {
+    // narrow double to all other types:
+    static float doubleToFloat(double x) {  // bytecode: d2f
         return (float) x;
     }
-    static double floatToDouble(float x) {
-        return x;
-    }
-
-    // narrow double to integral type
-    static long doubleToLong(double x) {
+    static long doubleToLong(double x) {  // bytecode: d2l
         return (long) x;
     }
-    static int doubleToInt(double x) {
+    static int doubleToInt(double x) {  // bytecode: d2i
         return (int) x;
     }
-    static short doubleToShort(double x) {
+    static short doubleToShort(double x) {  // bytecodes: d2i, i2s
         return (short) x;
     }
-    static char doubleToChar(double x) {
+    static char doubleToChar(double x) {  // bytecodes: d2i, i2c
         return (char) x;
     }
-    static byte doubleToByte(double x) {
+    static byte doubleToByte(double x) {  // bytecodes: d2i, i2b
         return (byte) x;
     }
     static boolean doubleToBoolean(double x) {
         return toBoolean((byte) x);
     }
 
-    // narrow float to integral type
-    static long floatToLong(float x) {
+    // widen float:
+    static double floatToDouble(float x) {  // bytecode: f2d
+        return x;
+    }
+    // narrow float:
+    static long floatToLong(float x) {  // bytecode: f2l
         return (long) x;
     }
-    static int floatToInt(float x) {
+    static int floatToInt(float x) {  // bytecode: f2i
         return (int) x;
     }
-    static short floatToShort(float x) {
+    static short floatToShort(float x) {  // bytecodes: f2i, i2s
         return (short) x;
     }
-    static char floatToChar(float x) {
+    static char floatToChar(float x) {  // bytecodes: f2i, i2c
         return (char) x;
     }
-    static byte floatToByte(float x) {
+    static byte floatToByte(float x) {  // bytecodes: f2i, i2b
         return (byte) x;
     }
     static boolean floatToBoolean(float x) {
         return toBoolean((byte) x);
     }
 
-    // widen integral type to double
-    static double longToDouble(long x) {
+    // widen long:
+    static double longToDouble(long x) {  // bytecode: l2d
+        return x;
+    }
+    static float longToFloat(long x) {  // bytecode: l2f
+        return x;
+    }
+    // narrow long:
+    static int longToInt(long x) {  // bytecode: l2i
+        return (int) x;
+    }
+    static short longToShort(long x) {  // bytecodes: f2i, i2s
+        return (short) x;
+    }
+    static char longToChar(long x) {  // bytecodes: f2i, i2c
+        return (char) x;
+    }
+    static byte longToByte(long x) {  // bytecodes: f2i, i2b
+        return (byte) x;
+    }
+    static boolean longToBoolean(long x) {
+        return toBoolean((byte) x);
+    }
+
+    // widen int:
+    static double intToDouble(int x) {  // bytecode: i2d
         return x;
     }
-    static double intToDouble(int x) {
+    static float intToFloat(int x) {  // bytecode: i2f
+        return x;
+    }
+    static long intToLong(int x) {  // bytecode: i2l
+        return x;
+    }
+    // narrow int:
+    static short intToShort(int x) {  // bytecode: i2s
+        return (short) x;
+    }
+    static char intToChar(int x) {  // bytecode: i2c
+        return (char) x;
+    }
+    static byte intToByte(int x) {  // bytecode: i2b
+        return (byte) x;
+    }
+    static boolean intToBoolean(int x) {
+        return toBoolean((byte) x);
+    }
+
+    // widen short:
+    static double shortToDouble(short x) {  // bytecode: i2d (implicit 's2i')
+        return x;
+    }
+    static float shortToFloat(short x) {  // bytecode: i2f (implicit 's2i')
+        return x;
+    }
+    static long shortToLong(short x) {  // bytecode: i2l (implicit 's2i')
+        return x;
+    }
+    static int shortToInt(short x) {  // (implicit 's2i')
         return x;
     }
-    static double shortToDouble(short x) {
+    // narrow short:
+    static char shortToChar(short x) {  // bytecode: i2c (implicit 's2i')
+        return (char)x;
+    }
+    static byte shortToByte(short x) {  // bytecode: i2b (implicit 's2i')
+        return (byte)x;
+    }
+    static boolean shortToBoolean(short x) {
+        return toBoolean((byte) x);
+    }
+
+    // widen char:
+    static double charToDouble(char x) {  // bytecode: i2d (implicit 'c2i')
+        return x;
+    }
+    static float charToFloat(char x) {  // bytecode: i2f (implicit 'c2i')
+        return x;
+    }
+    static long charToLong(char x) {  // bytecode: i2l (implicit 'c2i')
+        return x;
+    }
+    static int charToInt(char x) {  // (implicit 'c2i')
         return x;
     }
-    static double charToDouble(char x) {
+    // narrow char:
+    static short charToShort(char x) {  // bytecode: i2s (implicit 'c2i')
+        return (short)x;
+    }
+    static byte charToByte(char x) {  // bytecode: i2b (implicit 'c2i')
+        return (byte)x;
+    }
+    static boolean charToBoolean(char x) {
+        return toBoolean((byte) x);
+    }
+
+    // widen byte:
+    static double byteToDouble(byte x) {  // bytecode: i2d (implicit 'b2i')
+        return x;
+    }
+    static float byteToFloat(byte x) {  // bytecode: i2f (implicit 'b2i')
         return x;
     }
-    static double byteToDouble(byte x) {
+    static long byteToLong(byte x) {  // bytecode: i2l (implicit 'b2i')
+        return x;
+    }
+    static int byteToInt(byte x) {  // (implicit 'b2i')
         return x;
     }
+    static short byteToShort(byte x) {  // bytecode: i2s (implicit 'b2i')
+        return (short)x;
+    }
+    static char byteToChar(byte x) {  // bytecode: i2b (implicit 'b2i')
+        return (char)x;
+    }
+    // narrow byte to boolean:
+    static boolean byteToBoolean(byte x) {
+        return toBoolean(x);
+    }
+
+    // widen boolean to all types:
     static double booleanToDouble(boolean x) {
         return fromBoolean(x);
     }
-
-    // widen integral type to float
-    static float longToFloat(long x) {
-        return x;
-    }
-    static float intToFloat(int x) {
-        return x;
-    }
-    static float shortToFloat(short x) {
-        return x;
-    }
-    static float charToFloat(char x) {
-        return x;
-    }
-    static float byteToFloat(byte x) {
-        return x;
-    }
     static float booleanToFloat(boolean x) {
         return fromBoolean(x);
     }
+    static long booleanToLong(boolean x) {
+        return fromBoolean(x);
+    }
+    static int booleanToInt(boolean x) {
+        return fromBoolean(x);
+    }
+    static short booleanToShort(boolean x) {
+        return fromBoolean(x);
+    }
+    static char booleanToChar(boolean x) {
+        return (char)fromBoolean(x);
+    }
+    static byte booleanToByte(boolean x) {
+        return fromBoolean(x);
+    }
 
+    // helpers to force boolean into the conversion scheme:
     static boolean toBoolean(byte x) {
         // see javadoc for MethodHandles.explicitCastArguments
         return ((x & 1) != 0);
@@ -872,62 +818,48 @@
     }
 
     private static final EnumMap<Wrapper, MethodHandle>[]
-            CONVERT_FLOAT_FUNCTIONS = newWrapperCaches(4);
+            CONVERT_PRIMITIVE_FUNCTIONS = newWrapperCaches(Wrapper.values().length);
 
-    static MethodHandle convertFloatFunction(Wrapper wrap, boolean toFloat, boolean doubleSize) {
-        EnumMap<Wrapper, MethodHandle> cache = CONVERT_FLOAT_FUNCTIONS[(toFloat?1:0)+(doubleSize?2:0)];
-        MethodHandle mh = cache.get(wrap);
+    public static MethodHandle convertPrimitive(Wrapper wsrc, Wrapper wdst) {
+        EnumMap<Wrapper, MethodHandle> cache = CONVERT_PRIMITIVE_FUNCTIONS[wsrc.ordinal()];
+        MethodHandle mh = cache.get(wdst);
         if (mh != null) {
             return mh;
         }
         // slow path
-        Wrapper fwrap = (doubleSize ? Wrapper.DOUBLE : Wrapper.FLOAT);
-        Class<?> fix = wrap.primitiveType();
-        Class<?> flt = (doubleSize ? double.class : float.class);
-        Class<?> src = toFloat ? fix : flt;
-        Class<?> dst = toFloat ? flt : fix;
-        if (src == dst)  return identity(wrap);
-        MethodType type = MethodType.methodType(dst, src);
-        switch (wrap) {
-            case VOID:
-                mh = toFloat ? zeroConstantFunction(fwrap) : MethodHandles.dropArguments(EMPTY, 0, flt);
-                break;
-            case OBJECT:
-                mh = toFloat ? unbox(flt) : box(flt);
-                break;
-            default:
-                try {
-                    mh = IMPL_LOOKUP.findStatic(THIS_CLASS, src.getSimpleName()+"To"+capitalize(dst.getSimpleName()), type);
-                } catch (ReflectiveOperationException ex) {
-                    mh = null;
-                }
-                break;
+        Class<?> src = wsrc.primitiveType();
+        Class<?> dst = wdst.primitiveType();
+        MethodType type = src == void.class ? MethodType.methodType(dst) : MethodType.methodType(dst, src);
+        if (wsrc == wdst) {
+            mh = identity(src);
+        } else if (wsrc == Wrapper.VOID) {
+            mh = zeroConstantFunction(wdst);
+        } else if (wdst == Wrapper.VOID) {
+            mh = MethodHandles.dropArguments(EMPTY, 0, src);  // Defer back to MethodHandles.
+        } else if (wsrc == Wrapper.OBJECT) {
+            mh = unboxCast(dst);
+        } else if (wdst == Wrapper.OBJECT) {
+            mh = box(src);
+        } else {
+            assert(src.isPrimitive() && dst.isPrimitive());
+            try {
+                mh = IMPL_LOOKUP.findStatic(THIS_CLASS, src.getSimpleName()+"To"+capitalize(dst.getSimpleName()), type);
+            } catch (ReflectiveOperationException ex) {
+                mh = null;
+            }
         }
         if (mh != null) {
             assert(mh.type() == type) : mh;
-            cache.put(wrap, mh);
+            cache.put(wdst, mh);
             return mh;
         }
 
-        throw new IllegalArgumentException("cannot find float conversion constant for " +
+        throw new IllegalArgumentException("cannot find primitive conversion function for " +
                                            src.getSimpleName()+" -> "+dst.getSimpleName());
     }
 
-    public static MethodHandle convertFromFloat(Class<?> fixType) {
-        Wrapper wrap = Wrapper.forPrimitiveType(fixType);
-        return convertFloatFunction(wrap, false, false);
-    }
-    public static MethodHandle convertFromDouble(Class<?> fixType) {
-        Wrapper wrap = Wrapper.forPrimitiveType(fixType);
-        return convertFloatFunction(wrap, false, true);
-    }
-    public static MethodHandle convertToFloat(Class<?> fixType) {
-        Wrapper wrap = Wrapper.forPrimitiveType(fixType);
-        return convertFloatFunction(wrap, true, false);
-    }
-    public static MethodHandle convertToDouble(Class<?> fixType) {
-        Wrapper wrap = Wrapper.forPrimitiveType(fixType);
-        return convertFloatFunction(wrap, true, true);
+    public static MethodHandle convertPrimitive(Class<?> src, Class<?> dst) {
+        return convertPrimitive(Wrapper.forPrimitiveType(src), Wrapper.forPrimitiveType(dst));
     }
 
     private static String capitalize(String x) {
@@ -1020,37 +952,47 @@
     }
     private static final MethodHandle[] ARRAYS = makeArrays();
 
-    // mh-fill versions of the above:
-    private static Object[] newArray(int len) { return new Object[len]; }
+    // filling versions of the above:
+    // using Integer len instead of int len and no varargs to avoid bootstrapping problems
+    private static Object[] fillNewArray(Integer len, Object[] /*not ...*/ args) {
+        Object[] a = new Object[len];
+        fillWithArguments(a, 0, args);
+        return a;
+    }
+    private static Object[] fillNewTypedArray(Object[] example, Integer len, Object[] /*not ...*/ args) {
+        Object[] a = Arrays.copyOf(example, len);
+        fillWithArguments(a, 0, args);
+        return a;
+    }
     private static void fillWithArguments(Object[] a, int pos, Object... args) {
         System.arraycopy(args, 0, a, pos, args.length);
     }
     // using Integer pos instead of int pos to avoid bootstrapping problems
-    private static Object[] fillArray(Object[] a, Integer pos, Object a0)
+    private static Object[] fillArray(Integer pos, Object[] a, Object a0)
                 { fillWithArguments(a, pos, a0); return a; }
-    private static Object[] fillArray(Object[] a, Integer pos, Object a0, Object a1)
+    private static Object[] fillArray(Integer pos, Object[] a, Object a0, Object a1)
                 { fillWithArguments(a, pos, a0, a1); return a; }
-    private static Object[] fillArray(Object[] a, Integer pos, Object a0, Object a1, Object a2)
+    private static Object[] fillArray(Integer pos, Object[] a, Object a0, Object a1, Object a2)
                 { fillWithArguments(a, pos, a0, a1, a2); return a; }
-    private static Object[] fillArray(Object[] a, Integer pos, Object a0, Object a1, Object a2, Object a3)
+    private static Object[] fillArray(Integer pos, Object[] a, Object a0, Object a1, Object a2, Object a3)
                 { fillWithArguments(a, pos, a0, a1, a2, a3); return a; }
-    private static Object[] fillArray(Object[] a, Integer pos, Object a0, Object a1, Object a2, Object a3,
+    private static Object[] fillArray(Integer pos, Object[] a, Object a0, Object a1, Object a2, Object a3,
                                   Object a4)
                 { fillWithArguments(a, pos, a0, a1, a2, a3, a4); return a; }
-    private static Object[] fillArray(Object[] a, Integer pos, Object a0, Object a1, Object a2, Object a3,
+    private static Object[] fillArray(Integer pos, Object[] a, Object a0, Object a1, Object a2, Object a3,
                                   Object a4, Object a5)
                 { fillWithArguments(a, pos, a0, a1, a2, a3, a4, a5); return a; }
-    private static Object[] fillArray(Object[] a, Integer pos, Object a0, Object a1, Object a2, Object a3,
+    private static Object[] fillArray(Integer pos, Object[] a, Object a0, Object a1, Object a2, Object a3,
                                   Object a4, Object a5, Object a6)
                 { fillWithArguments(a, pos, a0, a1, a2, a3, a4, a5, a6); return a; }
-    private static Object[] fillArray(Object[] a, Integer pos, Object a0, Object a1, Object a2, Object a3,
+    private static Object[] fillArray(Integer pos, Object[] a, Object a0, Object a1, Object a2, Object a3,
                                   Object a4, Object a5, Object a6, Object a7)
                 { fillWithArguments(a, pos, a0, a1, a2, a3, a4, a5, a6, a7); return a; }
-    private static Object[] fillArray(Object[] a, Integer pos, Object a0, Object a1, Object a2, Object a3,
+    private static Object[] fillArray(Integer pos, Object[] a, Object a0, Object a1, Object a2, Object a3,
                                   Object a4, Object a5, Object a6, Object a7,
                                   Object a8)
                 { fillWithArguments(a, pos, a0, a1, a2, a3, a4, a5, a6, a7, a8); return a; }
-    private static Object[] fillArray(Object[] a, Integer pos, Object a0, Object a1, Object a2, Object a3,
+    private static Object[] fillArray(Integer pos, Object[] a, Object a0, Object a1, Object a2, Object a3,
                                   Object a4, Object a5, Object a6, Object a7,
                                   Object a8, Object a9)
                 { fillWithArguments(a, pos, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); return a; }
@@ -1058,7 +1000,7 @@
         ArrayList<MethodHandle> mhs = new ArrayList<>();
         mhs.add(null);  // there is no empty fill; at least a0 is required
         for (;;) {
-            MethodHandle mh = findCollector("fillArray", mhs.size(), Object[].class, Object[].class, Integer.class);
+            MethodHandle mh = findCollector("fillArray", mhs.size(), Object[].class, Integer.class, Object[].class);
             if (mh == null)  break;
             mhs.add(mh);
         }
@@ -1084,69 +1026,95 @@
         if (mh != null)  return mh;
         mh = findCollector("array", nargs, Object[].class);
         if (mh != null)  return ARRAYS[nargs] = mh;
-        MethodHandle producer = filler(0);  // identity function produces result
-        return ARRAYS[nargs] = buildVarargsArray(producer, nargs);
+        mh = buildVarargsArray(FILL_NEW_ARRAY, ARRAY_IDENTITY, nargs);
+        assert(assertCorrectArity(mh, nargs));
+        return ARRAYS[nargs] = mh;
+    }
+
+    private static boolean assertCorrectArity(MethodHandle mh, int arity) {
+        assert(mh.type().parameterCount() == arity) : "arity != "+arity+": "+mh;
+        return true;
     }
 
-    private static MethodHandle buildVarargsArray(MethodHandle producer, int nargs) {
+    private static MethodHandle buildVarargsArray(MethodHandle newArray, MethodHandle finisher, int nargs) {
         // Build up the result mh as a sequence of fills like this:
-        //   producer(fill(fill(fill(newArray(23),0,x1..x10),10,x11..x20),20,x21..x23))
+        //   finisher(fill(fill(newArrayWA(23,x1..x10),10,x11..x20),20,x21..x23))
         // The various fill(_,10*I,___*[J]) are reusable.
-        MethodHandle filler = filler(nargs);
-        MethodHandle mh = producer;
-        mh = MethodHandles.dropArguments(mh, 1, filler.type().parameterList());
-        mh = MethodHandles.foldArguments(mh, filler);
-        mh = MethodHandles.foldArguments(mh, buildNewArray(nargs));
+        int leftLen = Math.min(nargs, LEFT_ARGS);  // absorb some arguments immediately
+        int rightLen = nargs - leftLen;
+        MethodHandle leftCollector = newArray.bindTo(nargs);
+        leftCollector = leftCollector.asCollector(Object[].class, leftLen);
+        MethodHandle mh = finisher;
+        if (rightLen > 0) {
+            MethodHandle rightFiller = fillToRight(LEFT_ARGS + rightLen);
+            if (mh == ARRAY_IDENTITY)
+                mh = rightFiller;
+            else
+                mh = collectArguments(mh, 0, rightFiller);
+        }
+        if (mh == ARRAY_IDENTITY)
+            mh = leftCollector;
+        else
+            mh = collectArguments(mh, 0, leftCollector);
         return mh;
     }
 
-    private static MethodHandle buildNewArray(int nargs) {
-        return MethodHandles.insertArguments(NEW_ARRAY, 0, (int) nargs);
-    }
-
-    private static final MethodHandle[] FILLERS = new MethodHandle[MAX_ARITY+1];
-    // filler(N).invoke(a, arg0..arg[N-1]) fills a[0]..a[N-1]
-    private static MethodHandle filler(int nargs) {
-        MethodHandle filler = FILLERS[nargs];
+    private static final int LEFT_ARGS = (FILL_ARRAYS.length - 1);
+    private static final MethodHandle[] FILL_ARRAY_TO_RIGHT = new MethodHandle[MAX_ARITY+1];
+    /** fill_array_to_right(N).invoke(a, argL..arg[N-1])
+     *  fills a[L]..a[N-1] with corresponding arguments,
+     *  and then returns a.  The value L is a global constant (LEFT_ARGS).
+     */
+    private static MethodHandle fillToRight(int nargs) {
+        MethodHandle filler = FILL_ARRAY_TO_RIGHT[nargs];
         if (filler != null)  return filler;
-        return FILLERS[nargs] = buildFiller(nargs);
+        filler = buildFiller(nargs);
+        assert(assertCorrectArity(filler, nargs - LEFT_ARGS + 1));
+        return FILL_ARRAY_TO_RIGHT[nargs] = filler;
     }
     private static MethodHandle buildFiller(int nargs) {
-        if (nargs == 0)
-            return MethodHandles.identity(Object[].class);
-        final int CHUNK = (FILL_ARRAYS.length - 1);
+        if (nargs <= LEFT_ARGS)
+            return ARRAY_IDENTITY;  // no args to fill; return the array unchanged
+        // we need room for both mh and a in mh.invoke(a, arg*[nargs])
+        final int CHUNK = LEFT_ARGS;
         int rightLen = nargs % CHUNK;
-        int leftLen = nargs - rightLen;
+        int midLen = nargs - rightLen;
         if (rightLen == 0) {
-            leftLen = nargs - (rightLen = CHUNK);
-            if (FILLERS[leftLen] == null) {
+            midLen = nargs - (rightLen = CHUNK);
+            if (FILL_ARRAY_TO_RIGHT[midLen] == null) {
                 // build some precursors from left to right
-                for (int j = 0; j < leftLen; j += CHUNK)  filler(j);
+                for (int j = LEFT_ARGS % CHUNK; j < midLen; j += CHUNK)
+                    if (j > LEFT_ARGS)  fillToRight(j);
             }
         }
-        MethodHandle leftFill = filler(leftLen);  // recursive fill
-        MethodHandle rightFill = FILL_ARRAYS[rightLen];
-        rightFill = MethodHandles.insertArguments(rightFill, 1, (int) leftLen);  // [leftLen..nargs-1]
+        if (midLen < LEFT_ARGS) rightLen = nargs - (midLen = LEFT_ARGS);
+        assert(rightLen > 0);
+        MethodHandle midFill = fillToRight(midLen);  // recursive fill
+        MethodHandle rightFill = FILL_ARRAYS[rightLen].bindTo(midLen);  // [midLen..nargs-1]
+        assert(midFill.type().parameterCount()   == 1 + midLen - LEFT_ARGS);
+        assert(rightFill.type().parameterCount() == 1 + rightLen);
 
-        // Combine the two fills: right(left(newArray(nargs), x1..x20), x21..x23)
-        MethodHandle mh = filler(0);  // identity function produces result
-        mh = MethodHandles.dropArguments(mh, 1, rightFill.type().parameterList());
-        mh = MethodHandles.foldArguments(mh, rightFill);
-        if (leftLen > 0) {
-            mh = MethodHandles.dropArguments(mh, 1, leftFill.type().parameterList());
-            mh = MethodHandles.foldArguments(mh, leftFill);
-        }
-        return mh;
+        // Combine the two fills:
+        //   right(mid(a, x10..x19), x20..x23)
+        // The final product will look like this:
+        //   right(mid(newArrayLeft(24, x0..x9), x10..x19), x20..x23)
+        if (midLen == LEFT_ARGS)
+            return rightFill;
+        else
+            return collectArguments(rightFill, 0, midFill);
     }
 
     // Type-polymorphic version of varargs maker.
     private static final ClassValue<MethodHandle[]> TYPED_COLLECTORS
         = new ClassValue<MethodHandle[]>() {
+            @Override
             protected MethodHandle[] computeValue(Class<?> type) {
                 return new MethodHandle[256];
             }
     };
 
+    static final int MAX_JVM_ARITY = 255;  // limit imposed by the JVM
+
     /** Return a method handle that takes the indicated number of
      *  typed arguments and returns an array of them.
      *  The type argument is the array type.
@@ -1155,16 +1123,36 @@
         Class<?> elemType = arrayType.getComponentType();
         if (elemType == null)  throw new IllegalArgumentException("not an array: "+arrayType);
         // FIXME: Need more special casing and caching here.
+        if (nargs >= MAX_JVM_ARITY/2 - 1) {
+            int slots = nargs;
+            final int MAX_ARRAY_SLOTS = MAX_JVM_ARITY - 1;  // 1 for receiver MH
+            if (arrayType == double[].class || arrayType == long[].class)
+                slots *= 2;
+            if (slots > MAX_ARRAY_SLOTS)
+                throw new IllegalArgumentException("too many arguments: "+arrayType.getSimpleName()+", length "+nargs);
+        }
         if (elemType == Object.class)
             return varargsArray(nargs);
         // other cases:  primitive arrays, subtypes of Object[]
         MethodHandle cache[] = TYPED_COLLECTORS.get(elemType);
         MethodHandle mh = nargs < cache.length ? cache[nargs] : null;
         if (mh != null)  return mh;
-        MethodHandle producer = buildArrayProducer(arrayType);
-        mh = buildVarargsArray(producer, nargs);
+        if (elemType.isPrimitive()) {
+            MethodHandle builder = FILL_NEW_ARRAY;
+            MethodHandle producer = buildArrayProducer(arrayType);
+            mh = buildVarargsArray(builder, producer, nargs);
+        } else {
+            @SuppressWarnings("unchecked")
+            Class<? extends Object[]> objArrayType = (Class<? extends Object[]>) arrayType;
+            Object[] example = Arrays.copyOf(NO_ARGS_ARRAY, 0, objArrayType);
+            MethodHandle builder = FILL_NEW_TYPED_ARRAY.bindTo(example);
+            MethodHandle producer = ARRAY_IDENTITY;
+            mh = buildVarargsArray(builder, producer, nargs);
+        }
         mh = mh.asType(MethodType.methodType(arrayType, Collections.<Class<?>>nCopies(nargs, elemType)));
-        cache[nargs] = mh;
+        assert(assertCorrectArity(mh, nargs));
+        if (nargs < cache.length)
+            cache[nargs] = mh;
         return mh;
     }
 
@@ -1234,4 +1222,16 @@
     private static MethodHandle buildVarargsList(int nargs) {
         return MethodHandles.filterReturnValue(varargsArray(nargs), LazyStatics.MAKE_LIST);
     }
+
+    // handy shared exception makers (they simplify the common case code)
+    private static InternalError newInternalError(String message, Throwable cause) {
+        InternalError e = new InternalError(message);
+        e.initCause(cause);
+        return e;
+    }
+    private static InternalError newInternalError(Throwable cause) {
+        InternalError e = new InternalError();
+        e.initCause(cause);
+        return e;
+    }
 }
--- a/src/share/classes/sun/invoke/util/VerifyAccess.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/invoke/util/VerifyAccess.java	Fri Jun 21 19:11:42 2013 -0700
@@ -169,6 +169,46 @@
     }
 
     /**
+     * Decide if the given method type, attributed to a member or symbolic
+     * reference of a given reference class, is really visible to that class.
+     * @param type the supposed type of a member or symbolic reference of refc
+     * @param refc
+     */
+    public static boolean isTypeVisible(Class<?> type, Class<?> refc) {
+        if (type == refc)  return true;  // easy check
+        while (type.isArray())  type = type.getComponentType();
+        if (type.isPrimitive() || type == Object.class)  return true;
+        ClassLoader parent = type.getClassLoader();
+        if (parent == null)  return true;
+        ClassLoader child  = refc.getClassLoader();
+        if (child == null)  return false;
+        if (parent == child || loadersAreRelated(parent, child, true))
+            return true;
+        // Do it the hard way:  Look up the type name from the refc loader.
+        try {
+            Class<?> res = child.loadClass(type.getName());
+            return (type == res);
+        } catch (ClassNotFoundException ex) {
+            return false;
+        }
+    }
+
+    /**
+     * Decide if the given method type, attributed to a member or symbolic
+     * reference of a given reference class, is really visible to that class.
+     * @param type the supposed type of a member or symbolic reference of refc
+     * @param refc
+     */
+    public static boolean isTypeVisible(java.lang.invoke.MethodType type, Class<?> refc) {
+        for (int n = -1, max = type.parameterCount(); n < max; n++) {
+            Class<?> ptype = (n < 0 ? type.returnType() : type.parameterType(n));
+            if (!isTypeVisible(ptype, refc))
+                return false;
+        }
+        return true;
+    }
+
+    /**
      * Test if two classes have the same class loader and package qualifier.
      * @param class1
      * @param class2
--- a/src/share/classes/sun/invoke/util/VerifyType.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/invoke/util/VerifyType.java	Fri Jun 21 19:11:42 2013 -0700
@@ -122,8 +122,6 @@
         return isNullConversion(recv.returnType(), call.returnType());
     }
 
-    //TO DO: isRawConversion
-
     /**
      * Determine if the JVM verifier allows a value of type call to be
      * passed to a formal parameter (or return variable) of type recv.
@@ -188,40 +186,6 @@
         return -1;
     }
 
-    public static int canPassRaw(Class<?> src, Class<?> dst) {
-        if (dst.isPrimitive()) {
-            if (dst == void.class)
-                // As above, return anything to a caller expecting void.
-                return 1;
-            if (src == void.class)
-                // Special permission for raw conversions: allow a void
-                // to be captured as a garbage int.
-                // Caller promises that the actual value will be disregarded.
-                return dst == int.class ? 1 : 0;
-            if (isNullType(src))
-                // Special permission for raw conversions: allow a null
-                // to be reinterpreted as anything.  For objects, it is safe,
-                // and for primitives you get a garbage value (probably zero).
-                return 1;
-            if (!src.isPrimitive())
-                return 0;
-            Wrapper sw = Wrapper.forPrimitiveType(src);
-            Wrapper dw = Wrapper.forPrimitiveType(dst);
-            if (sw.stackSlots() == dw.stackSlots())
-                return 1;  // can do a reinterpret-cast on a stacked primitive
-            if (sw.isSubwordOrInt() && dw == Wrapper.VOID)
-                return 1;  // can drop an outgoing int value
-            return 0;
-        } else if (src.isPrimitive()) {
-            return 0;
-        }
-
-        // Both references.
-        if (isNullReferenceConversion(src, dst))
-            return 1;
-        return -1;
-    }
-
     public static boolean isSpreadArgType(Class<?> spreadArg) {
         return spreadArg.isArray();
     }
--- a/src/share/classes/sun/invoke/util/Wrapper.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/invoke/util/Wrapper.java	Fri Jun 21 19:11:42 2013 -0700
@@ -31,7 +31,7 @@
     BYTE(Byte.class, byte.class, 'B', (Byte)(byte)0, new byte[0], Format.signed(8)),
     SHORT(Short.class, short.class, 'S', (Short)(short)0, new short[0], Format.signed(16)),
     CHAR(Character.class, char.class, 'C', (Character)(char)0, new char[0], Format.unsigned(16)),
-    INT(Integer.class, int.class, 'I', (Integer)(int)0, new int[0], Format.signed(32)),
+    INT(Integer.class, int.class, 'I', (Integer)/*(int)*/0, new int[0], Format.signed(32)),
     LONG(Long.class, long.class, 'J', (Long)(long)0, new long[0], Format.signed(64)),
     FLOAT(Float.class, float.class, 'F', (Float)(float)0, new float[0], Format.floating(32)),
     DOUBLE(Double.class, double.class, 'D', (Double)(double)0, new double[0], Format.floating(64)),
@@ -47,7 +47,8 @@
     private final Object   zero;
     private final Object   emptyArray;
     private final int      format;
-    private final String   simpleName;
+    private final String   wrapperSimpleName;
+    private final String   primitiveSimpleName;
 
     private Wrapper(Class<?> wtype, Class<?> ptype, char tchar, Object zero, Object emptyArray, int format) {
         this.wrapperType = wtype;
@@ -56,12 +57,13 @@
         this.zero = zero;
         this.emptyArray = emptyArray;
         this.format = format;
-        this.simpleName = wtype.getSimpleName();
+        this.wrapperSimpleName = wtype.getSimpleName();
+        this.primitiveSimpleName = ptype.getSimpleName();
     }
 
     /** For debugging, give the details of this wrapper. */
     public String detailString() {
-        return simpleName+
+        return wrapperSimpleName+
                 java.util.Arrays.asList(wrapperType, primitiveType,
                 basicTypeChar, zero,
                 "0x"+Integer.toHexString(format));
@@ -418,7 +420,11 @@
 
     /** What is the simple name of the wrapper type?
      */
-    public String simpleName() { return simpleName; }
+    public String wrapperSimpleName() { return wrapperSimpleName; }
+
+    /** What is the simple name of the primitive type?
+     */
+    public String primitiveSimpleName() { return primitiveSimpleName; }
 
 //    /** Wrap a value in the given type, which may be either a primitive or wrapper type.
 //     *  Performs standard primitive conversions, including truncation and float conversions.
@@ -465,20 +471,22 @@
         }
         Class<T> wtype = wrapperType(type);
         if (wtype.isInstance(x)) {
-            @SuppressWarnings("unchecked")
-            T result = (T) x;  // unchecked warning is expected here
-            return result;
+            return wtype.cast(x);
         }
-        Class<?> sourceType = x.getClass();  // throw NPE if x is null
         if (!isCast) {
+            Class<?> sourceType = x.getClass();  // throw NPE if x is null
             Wrapper source = findWrapperType(sourceType);
             if (source == null || !this.isConvertibleFrom(source)) {
                 throw newClassCastException(wtype, sourceType);
             }
+        } else if (x == null) {
+            @SuppressWarnings("unchecked")
+            T z = (T) zero;
+            return z;
         }
         @SuppressWarnings("unchecked")
         T result = (T) wrap(x);  // unchecked warning is expected here
-        assert result.getClass() == wtype;
+        assert (result == null ? Void.class : result.getClass()) == wtype;
         return result;
     }
 
@@ -526,7 +534,7 @@
             case 'S': return Short.valueOf((short) xn.intValue());
             case 'B': return Byte.valueOf((byte) xn.intValue());
             case 'C': return Character.valueOf((char) xn.intValue());
-            case 'Z': return Boolean.valueOf(boolValue(xn.longValue()));
+            case 'Z': return Boolean.valueOf(boolValue(xn.byteValue()));
         }
         throw new InternalError("bad wrapper");
     }
@@ -542,79 +550,18 @@
         switch (basicTypeChar) {
             case 'L': throw newIllegalArgumentException("cannot wrap to object type");
             case 'V': return null;
-            case 'I': return Integer.valueOf((int)x);
+            case 'I': return Integer.valueOf(x);
             case 'J': return Long.valueOf(x);
             case 'F': return Float.valueOf(x);
             case 'D': return Double.valueOf(x);
             case 'S': return Short.valueOf((short) x);
             case 'B': return Byte.valueOf((byte) x);
             case 'C': return Character.valueOf((char) x);
-            case 'Z': return Boolean.valueOf(boolValue(x));
+            case 'Z': return Boolean.valueOf(boolValue((byte) x));
         }
         throw new InternalError("bad wrapper");
     }
 
-    /** Wrap a value (a long or smaller value) in this wrapper's type.
-     * Does not perform floating point conversion.
-     * Produces a {@code Long} for {@code OBJECT}, although the exact type
-     * of the operand is not known.
-     * Returns null for {@code VOID}.
-     */
-    public Object wrapRaw(long x) {
-        switch (basicTypeChar) {
-            case 'F':  return Float.valueOf(Float.intBitsToFloat((int)x));
-            case 'D':  return Double.valueOf(Double.longBitsToDouble(x));
-            case 'L':  // same as 'J':
-            case 'J':  return (Long) x;
-        }
-        // Other wrapping operations are just the same, given that the
-        // operand is already promoted to an int.
-        return wrap((int)x);
-    }
-
-    /** Produce bitwise value which encodes the given wrapped value.
-     * Does not perform floating point conversion.
-     * Returns zero for {@code VOID}.
-     */
-    public long unwrapRaw(Object x) {
-        switch (basicTypeChar) {
-            case 'F':  return Float.floatToRawIntBits((Float) x);
-            case 'D':  return Double.doubleToRawLongBits((Double) x);
-
-            case 'L': throw newIllegalArgumentException("cannot unwrap from sobject type");
-            case 'V': return 0;
-            case 'I': return (int)(Integer) x;
-            case 'J': return (long)(Long) x;
-            case 'S': return (short)(Short) x;
-            case 'B': return (byte)(Byte) x;
-            case 'C': return (char)(Character) x;
-            case 'Z': return (boolean)(Boolean) x ? 1 : 0;
-        }
-        throw new InternalError("bad wrapper");
-    }
-
-    /** Report what primitive type holds this guy's raw value. */
-    public Class<?> rawPrimitiveType() {
-        return rawPrimitive().primitiveType();
-    }
-
-    /** Report, as a wrapper, what primitive type holds this guy's raw value.
-     *  Returns self for INT, LONG, OBJECT; returns LONG for DOUBLE,
-     *  else returns INT.
-     */
-    public Wrapper rawPrimitive() {
-        switch (basicTypeChar) {
-            case 'S': case 'B':
-            case 'C': case 'Z':
-            case 'V':
-            case 'F':
-                return INT;
-            case 'D':
-                return LONG;
-        }
-        return this;
-    }
-
     private static Number numberValue(Object x) {
         if (x instanceof Number)     return (Number)x;
         if (x instanceof Character)  return (int)(Character)x;
@@ -623,7 +570,10 @@
         return (Number)x;
     }
 
-    private static boolean boolValue(long bits) {
+    // Parameter type of boolValue must be byte, because
+    // MethodHandles.explicitCastArguments defines boolean
+    // conversion as first converting to byte.
+    private static boolean boolValue(byte bits) {
         bits &= 1;  // simple 31-bit zero extension
         return (bits != 0);
     }
--- a/src/share/classes/sun/java2d/SunGraphics2D.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/java2d/SunGraphics2D.java	Fri Jun 21 19:11:42 2013 -0700
@@ -65,6 +65,8 @@
 import java.awt.Transparency;
 import java.awt.font.GlyphVector;
 import java.awt.font.TextLayout;
+
+import sun.awt.image.SurfaceManager;
 import sun.font.FontDesignMetrics;
 import sun.font.FontUtilities;
 import sun.java2d.pipe.PixelDrawPipe;
@@ -82,14 +84,12 @@
 import sun.java2d.loops.SurfaceType;
 import sun.java2d.loops.Blit;
 import sun.java2d.loops.MaskFill;
-import sun.font.FontManager;
 import java.awt.font.FontRenderContext;
 import sun.java2d.loops.XORComposite;
 import sun.awt.ConstrainableGraphics;
 import sun.awt.SunHints;
 import java.util.Map;
 import java.util.Iterator;
-import sun.java2d.DestSurfaceProvider;
 import sun.misc.PerformanceLogger;
 
 /**
@@ -203,13 +203,15 @@
 
     public RenderingHints hints;
 
-    public Region constrainClip;                // lightweight bounds
+    public Region constrainClip;        // lightweight bounds in pixels
     public int constrainX;
     public int constrainY;
 
     public Region clipRegion;
     public Shape usrClip;
-    protected Region devClip;           // Actual physical drawable
+    protected Region devClip;           // Actual physical drawable in pixels
+
+    private final int devScale;         // Actual physical scale factor
 
     // cached state for text rendering
     private boolean validFontInfo;
@@ -252,6 +254,12 @@
 
         validateColor();
 
+        devScale = sd.getDefaultScale();
+        if (devScale != 1) {
+            transform.setToScale(devScale, devScale);
+            invalidateTransform();
+        }
+
         font = f;
         if (font == null) {
             font = defaultFont;
@@ -316,6 +324,49 @@
 
     /**
      * Constrain rendering for lightweight objects.
+     */
+    public void constrain(int x, int y, int w, int h, Region region) {
+        if ((x | y) != 0) {
+            translate(x, y);
+        }
+        if (transformState > TRANSFORM_TRANSLATESCALE) {
+            clipRect(0, 0, w, h);
+            return;
+        }
+        // changes parameters according to the current scale and translate.
+        final double scaleX = transform.getScaleX();
+        final double scaleY = transform.getScaleY();
+        x = constrainX = (int) transform.getTranslateX();
+        y = constrainY = (int) transform.getTranslateY();
+        w = Region.dimAdd(x, Region.clipScale(w, scaleX));
+        h = Region.dimAdd(y, Region.clipScale(h, scaleY));
+
+        Region c = constrainClip;
+        if (c == null) {
+            c = Region.getInstanceXYXY(x, y, w, h);
+        } else {
+            c = c.getIntersectionXYXY(x, y, w, h);
+        }
+        if (region != null) {
+            region = region.getScaledRegion(scaleX, scaleY);
+            region = region.getTranslatedRegion(x, y);
+            c = c.getIntersection(region);
+        }
+
+        if (c == constrainClip) {
+            // Common case to ignore
+            return;
+        }
+
+        constrainClip = c;
+        if (!devClip.isInsideQuickCheck(c)) {
+            devClip = devClip.getIntersection(c);
+            validateCompClip();
+        }
+    }
+
+    /**
+     * Constrain rendering for lightweight objects.
      *
      * REMIND: This method will back off to the "workaround"
      * of using translate and clipRect if the Graphics
@@ -326,33 +377,9 @@
      * @exception IllegalStateException If the Graphics
      * to be constrained has a complex transform.
      */
+    @Override
     public void constrain(int x, int y, int w, int h) {
-        if ((x|y) != 0) {
-            translate(x, y);
-        }
-        if (transformState >= TRANSFORM_TRANSLATESCALE) {
-            clipRect(0, 0, w, h);
-            return;
-        }
-        x = constrainX = transX;
-        y = constrainY = transY;
-        w = Region.dimAdd(x, w);
-        h = Region.dimAdd(y, h);
-        Region c = constrainClip;
-        if (c == null) {
-            c = Region.getInstanceXYXY(x, y, w, h);
-        } else {
-            c = c.getIntersectionXYXY(x, y, w, h);
-            if (c == constrainClip) {
-                // Common case to ignore
-                return;
-            }
-        }
-        constrainClip = c;
-        if (!devClip.isInsideQuickCheck(c)) {
-            devClip = devClip.getIntersection(c);
-            validateCompClip();
-        }
+        constrain(x, y, w, h, null);
     }
 
     protected static ValidatePipe invalidpipe = new ValidatePipe();
@@ -1536,11 +1563,13 @@
      * @see TransformChain
      * @see AffineTransform
      */
+    @Override
     public void setTransform(AffineTransform Tx) {
-        if ((constrainX|constrainY) == 0) {
+        if ((constrainX | constrainY) == 0 && devScale == 1) {
             transform.setTransform(Tx);
         } else {
-            transform.setToTranslation(constrainX, constrainY);
+            transform.setTransform(devScale, 0, 0, devScale, constrainX,
+                                   constrainY);
             transform.concatenate(Tx);
         }
         invalidateTransform();
@@ -1598,12 +1627,15 @@
      * @see #transform
      * @see #setTransform
      */
+    @Override
     public AffineTransform getTransform() {
-        if ((constrainX|constrainY) == 0) {
+        if ((constrainX | constrainY) == 0 && devScale == 1) {
             return new AffineTransform(transform);
         }
-        AffineTransform tx =
-            AffineTransform.getTranslateInstance(-constrainX, -constrainY);
+        final double invScale = 1.0 / devScale;
+        AffineTransform tx = new AffineTransform(invScale, 0, 0, invScale,
+                                                 -constrainX * invScale,
+                                                 -constrainY * invScale);
         tx.concatenate(transform);
         return tx;
     }
@@ -2987,6 +3019,37 @@
     }
 // end of text rendering methods
 
+    private static boolean isHiDPIImage(final Image img) {
+        return SurfaceManager.getImageScale(img) != 1;
+    }
+
+    private boolean drawHiDPIImage(Image img, int dx1, int dy1, int dx2,
+                                   int dy2, int sx1, int sy1, int sx2, int sy2,
+                                   Color bgcolor, ImageObserver observer) {
+        final int scale = SurfaceManager.getImageScale(img);
+        sx1 = Region.clipScale(sx1, scale);
+        sx2 = Region.clipScale(sx2, scale);
+        sy1 = Region.clipScale(sy1, scale);
+        sy2 = Region.clipScale(sy2, scale);
+        try {
+            return imagepipe.scaleImage(this, img, dx1, dy1, dx2, dy2, sx1, sy1,
+                                        sx2, sy2, bgcolor, observer);
+        } catch (InvalidPipeException e) {
+            try {
+                revalidateAll();
+                return imagepipe.scaleImage(this, img, dx1, dy1, dx2, dy2, sx1,
+                                            sy1, sx2, sy2, bgcolor, observer);
+            } catch (InvalidPipeException e2) {
+                // Still catching the exception; we are not yet ready to
+                // validate the surfaceData correctly.  Fail for now and
+                // try again next time around.
+                return false;
+            }
+        } finally {
+            surfaceData.markDirty();
+        }
+    }
+
     /**
      * Draws an image scaled to x,y,w,h in nonblocking mode with a
      * callback object.
@@ -3000,8 +3063,9 @@
      * Not part of the advertised API but a useful utility method
      * to call internally.  This is for the case where we are
      * drawing to/from given coordinates using a given width/height,
-     * but we guarantee that the weidth/height of the src and dest
-     * areas are equal (no scale needed).
+     * but we guarantee that the surfaceData's width/height of the src and dest
+     * areas are equal (no scale needed). Note that this method intentionally
+     * ignore scale factor of the source image, and copy it as is.
      */
     public boolean copyImage(Image img, int dx, int dy, int sx, int sy,
                              int width, int height, Color bgcolor,
@@ -3039,7 +3103,15 @@
         if ((width == 0) || (height == 0)) {
             return true;
         }
-        if (width == img.getWidth(null) && height == img.getHeight(null)) {
+
+        final int imgW = img.getWidth(null);
+        final int imgH = img.getHeight(null);
+        if (isHiDPIImage(img)) {
+            return drawHiDPIImage(img, x, y, x + width, y + height, 0, 0, imgW,
+                                  imgH, bg, observer);
+        }
+
+        if (width == imgW && height == imgH) {
             return copyImage(img, x, y, 0, 0, width, height, bg, observer);
         }
 
@@ -3080,6 +3152,13 @@
             return true;
         }
 
+        if (isHiDPIImage(img)) {
+            final int imgW = img.getWidth(null);
+            final int imgH = img.getHeight(null);
+            return drawHiDPIImage(img, x, y, x + imgW, y + imgH, 0, 0, imgW,
+                                  imgH, bg, observer);
+        }
+
         try {
             return imagepipe.copyImage(this, img, x, y, bg, observer);
         } catch (InvalidPipeException e) {
@@ -3128,6 +3207,11 @@
             return true;
         }
 
+        if (isHiDPIImage(img)) {
+            return drawHiDPIImage(img, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2,
+                                  bgcolor, observer);
+        }
+
         if (((sx2 - sx1) == (dx2 - dx1)) &&
             ((sy2 - sy1) == (dy2 - dy1)))
         {
@@ -3206,6 +3290,18 @@
             return drawImage(img, 0, 0, null, observer);
         }
 
+        if (isHiDPIImage(img)) {
+            final int w = img.getWidth(null);
+            final int h = img.getHeight(null);
+            final AffineTransform tx = new AffineTransform(transform);
+            transform(xform);
+            boolean result = drawHiDPIImage(img, 0, 0, w, h, 0, 0, w, h, null,
+                                            observer);
+            transform.setTransform(tx);
+            invalidateTransform();
+            return result;
+        }
+
         try {
             return imagepipe.transformImage(this, img, xform, observer);
         } catch (InvalidPipeException e) {
--- a/src/share/classes/sun/java2d/SurfaceData.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/java2d/SurfaceData.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1057,4 +1057,14 @@
      * responsible for returning the appropriate object.
      */
     public abstract Object getDestination();
+
+    /**
+     * Returns default scale factor of the destination surface. Scale factor
+     * describes the mapping between virtual and physical coordinates of the
+     * SurfaceData. If the scale is 2 then virtual pixel coordinates need to be
+     * doubled for physical pixels.
+     */
+    public int getDefaultScale() {
+        return 1;
+    }
 }
--- a/src/share/classes/sun/java2d/loops/MaskFill.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/java2d/loops/MaskFill.java	Fri Jun 21 19:11:42 2013 -0700
@@ -36,6 +36,7 @@
 import sun.java2d.loops.GraphicsPrimitive;
 import sun.java2d.SunGraphics2D;
 import sun.java2d.SurfaceData;
+import sun.java2d.pipe.Region;
 
 /**
  * MaskFill
@@ -194,10 +195,13 @@
             // REMIND: This is not pretty.  It would be nicer if we
             // passed a "FillData" object to the Pixel loops, instead
             // of a SunGraphics2D parameter...
+            Region clip = sg2d.clipRegion;
+            sg2d.clipRegion = null;
             int pixel = sg2d.pixel;
             sg2d.pixel = tmpData.pixelFor(sg2d.getColor());
             fillop.FillRect(sg2d, tmpData, 0, 0, w, h);
             sg2d.pixel = pixel;
+            sg2d.clipRegion = clip;
 
             maskop.MaskBlit(tmpData, sData, comp, null,
                             0, 0, x, y, w, h,
--- a/src/share/classes/sun/java2d/pipe/BufferedContext.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/java2d/pipe/BufferedContext.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -95,8 +95,7 @@
     private int             validatedRGB;
     private int             validatedFlags;
     private boolean         xformInUse;
-    private int             transX;
-    private int             transY;
+    private AffineTransform transform;
 
     protected BufferedContext(RenderQueue rq) {
         this.rq = rq;
@@ -273,14 +272,11 @@
                 resetTransform();
                 xformInUse = false;
                 txChanged = true;
-            } else if (sg2d != null) {
-                if (transX != sg2d.transX || transY != sg2d.transY) {
-                    txChanged = true;
-                }
+            } else if (sg2d != null && !sg2d.transform.equals(transform)) {
+                txChanged = true;
             }
-            if (sg2d != null) {
-                transX = sg2d.transX;
-                transY = sg2d.transY;
+            if (sg2d != null && txChanged) {
+                transform = new AffineTransform(sg2d.transform);
             }
         } else {
             setTransform(xform);
--- a/src/share/classes/sun/java2d/pipe/DrawImage.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/java2d/pipe/DrawImage.java	Fri Jun 21 19:11:42 2013 -0700
@@ -27,9 +27,7 @@
 
 import java.awt.AlphaComposite;
 import java.awt.Color;
-import java.awt.Graphics2D;
 import java.awt.Image;
-import java.awt.Rectangle;
 import java.awt.Transparency;
 import java.awt.geom.AffineTransform;
 import java.awt.geom.NoninvertibleTransformException;
@@ -38,15 +36,13 @@
 import java.awt.image.BufferedImageOp;
 import java.awt.image.ColorModel;
 import java.awt.image.DataBuffer;
-import java.awt.image.DirectColorModel;
 import java.awt.image.ImageObserver;
 import java.awt.image.IndexColorModel;
 import java.awt.image.Raster;
 import java.awt.image.VolatileImage;
-import java.awt.image.WritableRaster;
-import java.awt.image.ImagingOpException;
 import sun.awt.SunHints;
 import sun.awt.image.ImageRepresentation;
+import sun.awt.image.SurfaceManager;
 import sun.awt.image.ToolkitImage;
 import sun.java2d.InvalidPipeException;
 import sun.java2d.SunGraphics2D;
@@ -323,15 +319,17 @@
     BufferedImage makeBufferedImage(Image img, Color bgColor, int type,
                                     int sx1, int sy1, int sx2, int sy2)
     {
-        BufferedImage bimg = new BufferedImage(sx2-sx1, sy2-sy1, type);
-        Graphics2D g2d = bimg.createGraphics();
+        final int width = sx2 - sx1;
+        final int height = sy2 - sy1;
+        final BufferedImage bimg = new BufferedImage(width, height, type);
+        final SunGraphics2D g2d = (SunGraphics2D) bimg.createGraphics();
         g2d.setComposite(AlphaComposite.Src);
         if (bgColor != null) {
             g2d.setColor(bgColor);
-            g2d.fillRect(0, 0, sx2-sx1, sy2-sy1);
+            g2d.fillRect(0, 0, width, height);
             g2d.setComposite(AlphaComposite.SrcOver);
         }
-        g2d.drawImage(img, -sx1, -sy1, null);
+        g2d.copyImage(img, 0, 0, sx1, sy1, width, height, null, null);
         g2d.dispose();
         return bimg;
     }
@@ -737,8 +735,9 @@
         atfm.scale(m00, m11);
         atfm.translate(srcX-sx1, srcY-sy1);
 
-        int imgW = img.getWidth(null);
-        int imgH = img.getHeight(null);
+        final int scale = SurfaceManager.getImageScale(img);
+        final int imgW = img.getWidth(null) * scale;
+        final int imgH = img.getHeight(null) * scale;
         srcW += srcX;
         srcH += srcY;
         // Make sure we are not out of bounds
--- a/src/share/classes/sun/java2d/pipe/PixelToShapeConverter.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/java2d/pipe/PixelToShapeConverter.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -103,12 +103,12 @@
         GeneralPath gp = new GeneralPath(GeneralPath.WIND_EVEN_ODD);
         if (nPoints > 0) {
             gp.moveTo(xPoints[0], yPoints[0]);
-        }
-        for (int i = 1; i < nPoints; i++) {
-            gp.lineTo(xPoints[i], yPoints[i]);
-        }
-        if (close) {
-            gp.closePath();
+            for (int i = 1; i < nPoints; i++) {
+                gp.lineTo(xPoints[i], yPoints[i]);
+            }
+            if (close) {
+                gp.closePath();
+            }
         }
         return gp;
     }
--- a/src/share/classes/sun/java2d/pipe/Region.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/java2d/pipe/Region.java	Fri Jun 21 19:11:42 2013 -0700
@@ -131,6 +131,28 @@
         return newv;
     }
 
+    /**
+     * Multiply the scale factor {@code sv} and the value {@code v} with
+     * appropriate clipping to the bounds of Integer resolution. If the answer
+     * would be greater than {@code Integer.MAX_VALUE} then {@code
+     * Integer.MAX_VALUE} is returned. If the answer would be less than {@code
+     * Integer.MIN_VALUE} then {@code Integer.MIN_VALUE} is returned. Otherwise
+     * the multiplication is returned.
+     */
+    public static int clipScale(final int v, final double sv) {
+        if (sv == 1.0) {
+            return v;
+        }
+        final double newv = v * sv;
+        if (newv < Integer.MIN_VALUE) {
+            return Integer.MIN_VALUE;
+        }
+        if (newv > Integer.MAX_VALUE) {
+            return Integer.MAX_VALUE;
+        }
+        return (int) Math.round(newv);
+    }
+
     protected Region(int lox, int loy, int hix, int hiy) {
         this.lox = lox;
         this.loy = loy;
@@ -349,6 +371,79 @@
     }
 
     /**
+     * Returns a Region object that represents the same list of rectangles as
+     * the current Region object, scaled by the specified sx, sy factors.
+     */
+    public Region getScaledRegion(final double sx, final double sy) {
+        if (sx == 0 || sy == 0 || this == EMPTY_REGION) {
+            return EMPTY_REGION;
+        }
+        if ((sx == 1.0 && sy == 1.0) || (this == WHOLE_REGION)) {
+            return this;
+        }
+
+        int tlox = clipScale(lox, sx);
+        int tloy = clipScale(loy, sy);
+        int thix = clipScale(hix, sx);
+        int thiy = clipScale(hiy, sy);
+        Region ret = new Region(tlox, tloy, thix, thiy);
+        int bands[] = this.bands;
+        if (bands != null) {
+            int end = endIndex;
+            int newbands[] = new int[end];
+            int i = 0; // index for source bands
+            int j = 0; // index for translated newbands
+            int ncol;
+            while (i < end) {
+                int y1, y2;
+                newbands[j++] = y1   = clipScale(bands[i++], sy);
+                newbands[j++] = y2   = clipScale(bands[i++], sy);
+                newbands[j++] = ncol = bands[i++];
+                int savej = j;
+                if (y1 < y2) {
+                    while (--ncol >= 0) {
+                        int x1 = clipScale(bands[i++], sx);
+                        int x2 = clipScale(bands[i++], sx);
+                        if (x1 < x2) {
+                            newbands[j++] = x1;
+                            newbands[j++] = x2;
+                        }
+                    }
+                } else {
+                    i += ncol * 2;
+                }
+                // Did we get any non-empty bands in this row?
+                if (j > savej) {
+                    newbands[savej-1] = (j - savej) / 2;
+                } else {
+                    j = savej - 3;
+                }
+            }
+            if (j <= 5) {
+                if (j < 5) {
+                    // No rows or bands were generated...
+                    ret.lox = ret.loy = ret.hix = ret.hiy = 0;
+                } else {
+                    // Only generated one single rect in the end...
+                    ret.loy = newbands[0];
+                    ret.hiy = newbands[1];
+                    ret.lox = newbands[3];
+                    ret.hix = newbands[4];
+                }
+                // ret.endIndex and ret.bands were never initialized...
+                // ret.endIndex = 0;
+                // ret.newbands = null;
+            } else {
+                // Generated multiple bands and/or multiple rows...
+                ret.endIndex = j;
+                ret.bands = newbands;
+            }
+        }
+        return ret;
+    }
+
+
+    /**
      * Returns a Region object that represents the same list of
      * rectangles as the current Region object, translated by
      * the specified dx, dy translation factors.
--- a/src/share/classes/sun/launcher/resources/launcher_de.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/launcher/resources/launcher_de.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -24,7 +24,7 @@
 #
 
 # Translators please note do not translate the options themselves
-java.launcher.opt.header  =   Verwendung: {0} [-options] class [args...]\n\           (zur Ausf\u00FChrung einer Klasse)\n   oder  {0} [-options] -jar jarfile [args...]\n\           (zur Ausf\u00FChrung einer JAR-Datei)\nwobei options Folgendes umfasst:\n
+java.launcher.opt.header  =   Verwendung: {0} [-options] class [args...]\n           (zur Ausf\u00FChrung einer Klasse)\n   oder  {0} [-options] -jar jarfile [args...]\n           (zur Ausf\u00FChrung einer JAR-Datei)\nwobei options Folgendes umfasst:\n
 
 java.launcher.opt.datamodel  =\    -d{0}\t  Verwendet ein {0}-Bit-Datenmodell, sofern verf\u00FCgbar\n
 java.launcher.opt.vmselect   =\    {0}\t  zur Auswahl der "{1}" VM\n
@@ -34,18 +34,19 @@
 java.launcher.ergo.message2  =\                  weil die Ausf\u00FChrung auf einem Server-Class-Rechner erfolgt.\n
 
 # Translators please note do not translate the options themselves
-java.launcher.opt.footer     =\    -cp <Class-Suchpfad von Verzeichnissen und .zip-/.jar-Dateien>\n\    -classpath <Class-Suchpfad von Verzeichnissen und .zip-/.jar-Dateien>\n\                  Eine durch {0} getrennte Liste mit Verzeichnissen, .jar-Archiven\n\                  und .zip-Archiven zur Suche nach Klassendateien.\n\    -D<name>=<value>\n\                  Setzt eine Systemeigenschaft\n\    -verbose[:class|gc|jni]\n\                  Aktiviert die Verbose-Ausgabe\n\    -version      Druckt Produktversion und beendet das Programm\n\    -version:<value>\n\                  Erfordert die angegebene Version zur Ausf\u00FChrung\n\    -showversion  Druckt Produktversion und f\u00E4hrt fort\n\    -jre-restrict-search | -no-jre-restrict-search\n\                  Bezieht private JREs des Benutzers in Versionssuche ein bzw. schlie\u00DFt sie aus\n\    -? -help      Druckt diese Hilfemeldung\n\    -X            Druckt Hilfe zu Nicht-Standardoptionen\n\    -ea[:<packagename>...|:<classname>]\n\    -enableassertions[:<packagename>...|:<classname>]\n\                  Aktiviert Assertionen mit angegebener Granularit\u00E4t\n\    -da[:<packagename>...|:<classname>]\n\    -disableassertions[:<packagename>...|:<classname>]\n\                  Deaktiviert Assertionen mit angegebener Granularit\u00E4t\n\    -esa | -enablesystemassertions\n\                  Aktiviert Systemassertionen\n\    -dsa | -disablesystemassertions\n\                  Deaktiviert Systemassertionen\n\    -agentlib:<libname>[=<options>]\n\                  L\u00E4dt native Agent Library <libname>, z.B. -agentlib:hprof\n\                  siehe auch, -agentlib:jdwp=help und -agentlib:hprof=help\n\    -agentpath:<pathname>[=<options>]\n\                  L\u00E4dt native Agent Library nach vollem Pfadnamen\n\    -javaagent:<jarpath>[=<options>]\n\                  L\u00E4dt Java-Programmiersprachen-Agent, siehe java.lang.instrument\n\    -splash:<imagepath>\n\                  Zeigt Startbildschirm mit angegebenem Bild\nWeitere Einzelheiten finden Sie unter http://java.sun.com/javase/reference.
+java.launcher.opt.footer     =\    -cp <Klassensuchpfad von Verzeichnissen und ZIP-/JAR-Dateien>\n    -classpath <Klassensuchpfad von Verzeichnissen und ZIP-/JAR-Dateien>\n                  Eine durch {0} getrennte Liste mit Verzeichnissen, JAR-Archiven\n                  und ZIP-Archiven zur Suche nach Klassendateien.\n    -D<name>=<value>\n                  Legt eine Systemeigenschaft fest\n    -verbose[:class|gc|jni]\n                  Aktiviert die Verbose-Ausgabe\n    -version      Druckt Produktversion und beendet das Programm\n    -version:<value>\n                  Erfordert die angegebene Version zur Ausf\u00FChrung\n    -showversion  Druckt Produktversion und f\u00E4hrt fort\n    -jre-restrict-search | -no-jre-restrict-search\n                  Bezieht private JREs des Benutzers in Versionssuche ein bzw. schlie\u00DFt sie aus\n    -? -help      Druckt diese Hilfemeldung\n    -X            Druckt Hilfe zu Nicht-Standardoptionen\n    -ea[:<packagename>...|:<classname>]\n    -enableassertions[:<packagename>...|:<classname>]\n                  Aktiviert Assertionen mit angegebener Granularit\u00E4t\n    -da[:<packagename>...|:<classname>]\n    -disableassertions[:<packagename>...|:<classname>]\n                  Deaktiviert Assertionen mit angegebener Granularit\u00E4t\n    -esa | -enablesystemassertions\n                  Aktiviert Systemassertionen\n    -dsa | -disablesystemassertions\n                  Deaktiviert Systemassertionen\n    -agentlib:<libname>[=<options>]\n                  L\u00E4dt native Agent Library <libname>, z.B. -agentlib:hprof\n                  siehe auch -agentlib:jdwp=help und -agentlib:hprof=help\n    -agentpath:<pathname>[=<options>]\n                  L\u00E4dt native Agent Library nach vollem Pfadnamen\n    -javaagent:<jarpath>[=<options>]\n                  L\u00E4dt Java-Programmiersprachen-Agent, siehe java.lang.instrument\n    -splash:<imagepath>\n                  Zeigt Startbildschirm mit angegebenem Bild\nWeitere Einzelheiten finden Sie unter http://www.oracle.com/technetwork/java/javase/documentation/index.html
 
 # Translators please note do not translate the options themselves
-java.launcher.X.usage=\    -Xmixed           Ausf\u00FChrung im gemischten Modus (Standard)\n\    -Xint             Nur Ausf\u00FChrung im interpretierten Modus\n\    -Xbootclasspath:<Verzeichnisse und ZIP-/JAR-Dateien durch {0} getrennt>\n\                      Legt Suchpfad f\u00FCr Bootstrap-Klassen und Ressourcen fest\n\    -Xbootclasspath/a:<Verzeichnisse und ZIP-/JAR-Dateien durch {0} getrennt>\n\                      H\u00E4ngt an das Ende des Bootstrap Classpath an\n\    -Xbootclasspath/p:<Verzeichnisse und ZIP-/JAR-Dateien durch {0} getrennt>\n\                      Stellt Bootstrap Classpath voran\n\    -Xdiag            Zeigt zus\u00E4tzliche Diagnosemeldungen an\n\    -Xnoclassgc       Deaktiviert Klassen-Garbage Collection\n\    -Xincgc           Aktiviert inkrementelle Garbage Collection\n\    -Xloggc:<file>    Loggt GC-Status in einer Datei mit Zeitstempeln\n\    -Xbatch           Deaktiviert Hintergrundkompilierung\n\    -Xms<size>        Legt anf\u00E4ngliche Java Heap-Gr\u00F6\u00DFe fest\n\    -Xmx<size>        Legt maximale Java Heap-Gr\u00F6\u00DFe fest\n\    -Xss<size>        Legt Java-Thread-Stack-Gr\u00F6\u00DFe fest\n\    -Xprof            Gibt CPU-Profiling-Daten aus\n\    -Xfuture          Aktiviert strengste Pr\u00FCfungen, antizipiert zuk\u00FCnftigen Standardwert\n\    -Xrs              Reduziert Verwendung von BS-Signalen durch Java/VM (siehe Dokumentation)\n\    -Xcheck:jni       F\u00FChrt zus\u00E4tzliche Pr\u00FCfungen f\u00FCr JNI-Funktionen durch\n\    -Xshare:off       Kein Versuch, gemeinsame Klassendaten zu verwenden\n\    -Xshare:auto      Verwendet gemeinsame Klassendaten, wenn m\u00F6glich (Standard)\n\    -Xshare:on        Erfordert die Verwendung gemeinsamer Klassendaten, sonst verl\u00E4uft der Vorgang nicht erfolgreich.\n\    -XshowSettings    Zeigt alle Einstellungen und f\u00E4hrt fort\n\    -XshowSettings:all\n\                      Zeigt alle Einstellungen und f\u00E4hrt fort\n\    -XshowSettings:vm Zeigt alle VM-bezogenen Einstellungen und f\u00E4hrt fort\n\    -XshowSettings:properties\n\                      Zeigt alle Eigenschaftseinstellungen und f\u00E4hrt fort\n\    -XshowSettings:locale\n\                      Zeigt alle gebietsschemabezogenen Einstellungen und f\u00E4hrt fort\n\nDie -X-Optionen sind keine Standardoptionen und k\u00F6nnen ohne Vorank\u00FCndigung ge\u00E4ndert werden.\n
+java.launcher.X.usage=\    -Xmixed           Ausf\u00FChrung im gemischten Modus (Standard)\n    -Xint             Nur Ausf\u00FChrung im interpretierten Modus\n    -Xbootclasspath:<Verzeichnisse und ZIP-/JAR-Dateien durch {0} getrennt>\n                      Legt Suchpfad f\u00FCr Bootstrap-Klassen und Ressourcen fest\n    -Xbootclasspath/a:<Verzeichnisse und ZIP-/JAR-Dateien durch {0} getrennt>\n                      H\u00E4ngt an das Ende des Bootstrap Classpath an\n    -Xbootclasspath/p:<Verzeichnisse und ZIP-/JAR-Dateien durch {0} getrennt>\n                      Stellt Bootstrap Classpath voran\n    -Xdiag            Zeigt zus\u00E4tzliche Diagnosemeldungen an\n    -Xnoclassgc       Deaktiviert Klassen-Garbage Collection\n    -Xincgc           Aktiviert inkrementelle Garbage Collection\n    -Xloggc:<file>    Loggt GC-Status in einer Datei mit Zeitstempeln\n    -Xbatch           Deaktiviert Hintergrundkompilierung\n    -Xms<size>        Legt anf\u00E4ngliche Java Heap-Gr\u00F6\u00DFe fest\n    -Xmx<size>        Legt maximale Java Heap-Gr\u00F6\u00DFe fest\n    -Xss<size>        Legt Java-Thread-Stack-Gr\u00F6\u00DFe fest\n    -Xprof            Gibt CPU-Profiling-Daten aus\n    -Xfuture          Aktiviert strengste Pr\u00FCfungen, antizipiert zuk\u00FCnftigen Standardwert\n    -Xrs              Reduziert Verwendung von BS-Signalen durch Java/VM (siehe Dokumentation)\n    -Xcheck:jni       F\u00FChrt zus\u00E4tzliche Pr\u00FCfungen f\u00FCr JNI-Funktionen durch\n    -Xshare:off       Kein Versuch, gemeinsame Klassendaten zu verwenden\n    -Xshare:auto      Verwendet gemeinsame Klassendaten, wenn m\u00F6glich (Standard)\n    -Xshare:on        Erfordert die Verwendung gemeinsamer Klassendaten, sonst verl\u00E4uft der Vorgang nicht erfolgreich.\n    -XshowSettings    Zeigt alle Einstellungen und f\u00E4hrt fort\n    -XshowSettings:all\n                      Zeigt alle Einstellungen und f\u00E4hrt fort\n    -XshowSettings:vm Zeigt alle VM-bezogenen Einstellungen und f\u00E4hrt fort\n    -XshowSettings:properties\n                      Zeigt alle Eigenschaftseinstellungen und f\u00E4hrt fort\n    -XshowSettings:locale\n                      Zeigt alle gebietsschemabezogenen Einstellungen und f\u00E4hrt fort\n\nDie -X-Optionen sind keine Standardoptionen und k\u00F6nnen ohne Vorank\u00FCndigung ge\u00E4ndert werden.\n
 
 # Translators please note do not translate the options themselves
-java.launcher.X.macosx.usage=\nDie folgenden Optionen sind f\u00FCr Mac OS X spezifisch:\n\    -XstartOnFirstThread\n\                      f\u00FChrt die main()-Methode f\u00FCr den ersten (AppKit) Thread aus\n\    -Xdock:name=<Anwendungsname>"\n\                      \u00DCberschreibt den in der Uhr angezeigten Standardanwendungsnamen\n\    -Xdock:icon=<Pfad zu Symboldatei>\n\                      \u00DCberschreibt das in der Uhr angezeigte Standardsymbol\n\n
+java.launcher.X.macosx.usage=\nDie folgenden Optionen sind f\u00FCr Mac OS X spezifisch:\n    -XstartOnFirstThread\n                      f\u00FChrt die main()-Methode f\u00FCr den ersten (AppKit) Thread aus\n    -Xdock:name=<Anwendungsname>"\n                      \u00DCberschreibt den in der Uhr angezeigten Standardanwendungsnamen\n    -Xdock:icon=<Pfad zu Symboldatei>\n                      \u00DCberschreibt das in der Uhr angezeigte Standardsymbol\n\n
 
 java.launcher.cls.error1=Fehler: Hauptklasse {0} konnte nicht gefunden oder geladen werden
-java.launcher.cls.error2=Fehler: Hauptmethode ist nicht {0} in Klasse {1}. Definieren Sie die Hauptmethode als:\n\   public static void main(String[] args)
-java.launcher.cls.error3=Fehler: Hauptmethode muss einen Wert vom Typ void in Klasse {0} zur\u00FCckgeben. Definieren Sie \ndie Hauptmethode als:\n\   public static void main(String[] args)
-java.launcher.cls.error4=Fehler: Hauptmethode in Klasse {0} nicht gefunden. Definieren Sie die Hauptmethode als:\n\   public static void main(String[] args)
+java.launcher.cls.error2=Fehler: Hauptmethode ist nicht {0} in Klasse {1}. Definieren Sie die Hauptmethode als:\n   public static void main(String[] args)
+java.launcher.cls.error3=Fehler: Hauptmethode muss einen Wert vom Typ void in Klasse {0} zur\u00FCckgeben. Definieren Sie \ndie Hauptmethode als:\n   public static void main(String[] args)
+java.launcher.cls.error4=Fehler: Hauptmethode in Klasse {0} nicht gefunden. Definieren Sie die Hauptmethode als:\n   public static void main(String[] args)
 java.launcher.jar.error1=Fehler: Beim Versuch, Datei {0} zu \u00F6ffnen, ist ein unerwarteter Fehler aufgetreten
 java.launcher.jar.error2=Manifest in {0} nicht gefunden
 java.launcher.jar.error3=kein Hauptmanifestattribut, in {0}
+java.launcher.init.error=Initialisierungsfehler
--- a/src/share/classes/sun/launcher/resources/launcher_es.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/launcher/resources/launcher_es.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -24,7 +24,7 @@
 #
 
 # Translators please note do not translate the options themselves
-java.launcher.opt.header  =   Sintaxis: {0} [-options] class [args...]\n\           (para ejecutar una clase)\n   o  {0} [-options] -jar jarfile [args...]\n\           (para ejecutar un archivo jar)\ndonde las opciones incluyen:\n
+java.launcher.opt.header  =   Sintaxis: {0} [-options] class [args...]\n           (para ejecutar una clase)\n   o  {0} [-options] -jar jarfile [args...]\n           (para ejecutar un archivo jar)\ndonde las opciones incluyen:\n
 
 java.launcher.opt.datamodel  =\    -d{0}\t  usar un modelo de datos de {0} bits, si est\u00E1 disponible\n
 java.launcher.opt.vmselect   =\    {0}\t  para seleccionar la VM "{1}"\n
@@ -34,18 +34,19 @@
 java.launcher.ergo.message2  =\                  porque la ejecuci\u00F3n se est\u00E1 llevando a cabo en una m\u00E1quina de clase de servidor.\n
 
 # Translators please note do not translate the options themselves
-java.launcher.opt.footer     =\    -cp <ruta de acceso de b\u00FAsqueda de clases de los directorios y los archivos zip/jar>\n\\    -classpath <ruta de acceso de b\u00FAsqueda de clases de los directorios y los archivos zip/jar>\n\\                  Lista separada por {0} de directorios, archivos JAR\n\\                  y archivos ZIP para buscar archivos de clase.\n\\    -D<nombre>=<valor>\n\\                  definir una propiedad del sistema\n\\    -verbose[:class|gc|jni]\n\\                  activar la salida verbose\n\\    -version      imprimir la versi\u00F3n del producto y salir\n\\    -version:<valor>\n\\                  es necesario que se ejecute la versi\u00F3n especificada\n\\    -showversion  imprimir la versi\u00F3n del producto y continuar\n\\    -jre-restrict-search | -no-jre-restrict-search\n\\                  incluir/excluir JRE privados de usuario en la b\u00FAsqueda de versi\u00F3n\n\\    -? -help      imprimir este mensaje de ayuda\n\\    -X            imprimir la ayuda sobre las opciones que no sean est\u00E1ndar\n\\    -ea[:<nombre_paquete>...|:<nombre_clase>]\n\\    -enableassertions[:<nombre_paquete>...|:<nombre_clase>]\n\\                  activar afirmaciones con la granularidad especificada\n\\    -da[:<nombre_paquete>...|:<nombre_clase>]\n\\    -disableassertions[:<nombre_paquete>...|:<nombre_clase>]\n\\                  desactivar afirmaciones con la granularidad especificada\n\\    -esa | -enablesystemassertions\n\\                  activar afirmaciones del sistema\n\\    -dsa | -disablesystemassertions\n\\                  desactivar afirmaciones del sistema\n\\    -agentlib:<nombre_bib>[=<opciones>]\n\\                  cargar la biblioteca de agente nativa <nombre_bib>, como -agentlib:hprof\n\\                  v\u00E9ase tambi\u00E9n -agentlib:jdwp=help y -agentlib:hprof=help\n\\    -agentpath:<nombre_ruta_acceso>[=<opciones>]\n\\                  cargar biblioteca de agente nativa con el nombre de la ruta de acceso completa\n\\    -javaagent:<ruta_acceso_jar>[=<opciones>]\n\\                  cargar agente de lenguaje de programaci\u00F3n Java, v\u00E9ase java.lang.instrument\n\\    -splash:<ruta_acceso_imagen>\n\\                  mostrar una pantalla de presentaci\u00F3n con la imagen especificada\nConsulte http://www.oracle.com/technetwork/java/javase/documentation/index.html para obtener m\u00E1s informaci\u00F3n.
+java.launcher.opt.footer     =\    -cp <ruta de acceso de b\u00FAsqueda de clases de los directorios y los archivos zip/jar>\n\\    -classpath <ruta de acceso de b\u00FAsqueda de clases de los directorios y los archivos zip/jar>\n\\                  Lista separada por {0} de directorios, archivos JAR\n\\                  y archivos ZIP para buscar archivos de clase.\n\\    -D<nombre>=<valor>\n\\                  definir una propiedad del sistema\n\\    -verbose:[class|gc|jni]\n\\                  activar la salida verbose\n\\    -version      imprimir la versi\u00F3n del producto y salir\n\\    -version:<valor>\n\\                  es necesario que se ejecute la versi\u00F3n especificada\n\\    -showversion  imprimir la versi\u00F3n del producto y continuar\n\\    -jre-restrict-search | -no-jre-restrict-search\n\\                  incluir/excluir JRE privados de usuario en la b\u00FAsqueda de versi\u00F3n\n\\    -? -help      imprimir este mensaje de ayuda\n\\    -X            imprimir la ayuda sobre las opciones que no sean est\u00E1ndar\n\\    -ea[:<nombre_paquete>...|:<nombre_clase>]\n\\    -enableassertions[:<nombre_paquete>...|:<nombre_clase>]\n\\                  activar afirmaciones con la granularidad especificada\n\\    -da[:<nombre_paquete>...|:<nombre_clase>]\n\\    -disableassertions[:<nombre_paquete>...|:<nombre_clase>]\n\\                  desactivar afirmaciones con la granularidad especificada\n\\    -esa | -enablesystemassertions\n\\                  activar afirmaciones del sistema\n\\    -dsa | -disablesystemassertions\n\\                  desactivar afirmaciones del sistema\n\\    -agentlib:<nombre_bib>[=<opciones>]\n\\                  cargar la biblioteca de agente nativa <nombre_bib>, como -agentlib:hprof\n\\                  v\u00E9ase tambi\u00E9n -agentlib:jdwp=help y -agentlib:hprof=help\n\\    -agentpath:<nombre_ruta_acceso>[=<opciones>]\n\\                  cargar biblioteca de agente nativa con el nombre de la ruta de acceso completa\n\\    -javaagent:<ruta_acceso_jar>[=<opciones>]\n\\                  cargar agente de lenguaje de programaci\u00F3n Java, v\u00E9ase java.lang.instrument\n\\    -splash:<ruta_acceso_imagen>\n\\                  mostrar una pantalla de presentaci\u00F3n con la imagen especificada\nConsulte http://www.oracle.com/technetwork/java/javase/documentation/index.html para obtener m\u00E1s informaci\u00F3n.
 
 # Translators please note do not translate the options themselves
-java.launcher.X.usage=\    -Xmixed           ejecuci\u00F3n de modo mixto (por defecto)\n\    -Xint             s\u00F3lo ejecuci\u00F3n de modo interpretado\n\    -Xbootclasspath:<directorios y archivos zip/jar separados por {0}>\n\                      definir la ruta de acceso de b\u00FAsqueda para los recursos y clases de inicializaci\u00F3n de datos\n\    -Xbootclasspath/a:<directorios y archivos zip/jar separados por {0}>\n\                      agregar al final de la ruta de acceso de la clase de inicializaci\u00F3n de datos\n\    -Xbootclasspath/p:<directorios y archivos zip/jar separados por {0}>\n\                      anteponer a la ruta de acceso de la clase de inicializaci\u00F3n de datos\n\    -Xdiag            mostrar mensajes de diagn\u00F3stico adicionales\n\    -Xnoclassgc       desactivar la recolecci\u00F3n de basura de clases\n\    -Xincgc           activar la recolecci\u00F3n de basura de clases\n\    -Xloggc:<archivo>    registrar el estado de GC en un archivo con registros de hora\n\    -Xbatch           desactivar compilaci\u00F3n en segundo plano\n\    -Xms<tama\u00F1o>        definir tama\u00F1o de pila Java inicial\n\    -Xmx<tama\u00F1o>        definir tama\u00F1o de pila Java m\u00E1ximo\n\    -Xss<tama\u00F1o>        definir tama\u00F1o de la pila del thread de Java\n\    -Xprof            datos de salida de creaci\u00F3n de perfil de CPU\n\    -Xfuture          activar las comprobaciones m\u00E1s estrictas, anticip\u00E1ndose al futuro valor por defecto\n\    -Xrs              reducir el uso de se\u00F1ales de sistema operativo por parte de Java/VM (consulte la documentaci\u00F3n)\n\    -Xcheck:jni       realizar comprobaciones adicionales para las funciones de JNI\n\    -Xshare:off       no intentar usar datos de clase compartidos\n\    -Xshare:auto      usar datos de clase compartidos si es posible (valor por defecto)\n\    -Xshare:on        es obligatorio el uso de datos de clase compartidos, de lo contrario se emitir\u00E1 un fallo.\n\    -XshowSettings    mostrar todos los valores y continuar\n\    -XshowSettings:all\n\                      mostrar todos los valores y continuar\n\    -XshowSettings:vm mostrar todos los valores de la VM y continuar\n\    -XshowSettings:properties\n\                      mostrar todos los valores de las propiedades y continuar\n\    -XshowSettings:locale\n\                      mostrar todos los valores relacionados con la configuraci\u00F3n regional y continuar\n\nLas opciones -X no son est\u00E1ndar, por lo que podr\u00EDan cambiarse sin previo aviso.\n
+java.launcher.X.usage=\    -Xmixed           ejecuci\u00F3n de modo mixto (por defecto)\n    -Xint             s\u00F3lo ejecuci\u00F3n de modo interpretado\n    -Xbootclasspath:<directorios y archivos zip/jar separados por {0}>\n                      definir la ruta de acceso de b\u00FAsqueda para los recursos y clases de inicializaci\u00F3n de datos\n    -Xbootclasspath/a:<directorios y archivos zip/jar separados por {0}>\n                      agregar al final de la ruta de acceso de la clase de inicializaci\u00F3n de datos\n    -Xbootclasspath/p:<directorios y archivos zip/jar separados por {0}>\n                      anteponer a la ruta de acceso de la clase de inicializaci\u00F3n de datos\n    -Xdiag            mostrar mensajes de diagn\u00F3stico adicionales\n    -Xnoclassgc       desactivar la recolecci\u00F3n de basura de clases\n    -Xincgc           activar la recolecci\u00F3n de basura de clases\n    -Xloggc:<archivo>    registrar el estado de GC en un archivo con registros de hora\n    -Xbatch           desactivar compilaci\u00F3n en segundo plano\n    -Xms<tama\u00F1o>        definir tama\u00F1o de pila Java inicial\n    -Xmx<tama\u00F1o>        definir tama\u00F1o de pila Java m\u00E1ximo\n    -Xss<tama\u00F1o>        definir tama\u00F1o de la pila del thread de Java\n    -Xprof            datos de salida de creaci\u00F3n de perfil de CPU\n    -Xfuture          activar las comprobaciones m\u00E1s estrictas, anticip\u00E1ndose al futuro valor por defecto\n    -Xrs              reducir el uso de se\u00F1ales de sistema operativo por parte de Java/VM (consulte la documentaci\u00F3n)\n    -Xcheck:jni       realizar comprobaciones adicionales para las funciones de JNI\n    -Xshare:off       no intentar usar datos de clase compartidos\n    -Xshare:auto      usar datos de clase compartidos si es posible (valor por defecto)\n    -Xshare:on        es obligatorio el uso de datos de clase compartidos, de lo contrario se emitir\u00E1 un fallo.\n    -XshowSettings    mostrar todos los valores y continuar\n    -XshowSettings:all\n                      mostrar todos los valores y continuar\n    -XshowSettings:vm mostrar todos los valores de la VM y continuar\n    -XshowSettings:properties\n                      mostrar todos los valores de las propiedades y continuar\n    -XshowSettings:locale\n                      mostrar todos los valores relacionados con la configuraci\u00F3n regional y continuar\n\nLas opciones -X no son est\u00E1ndar, por lo que podr\u00EDan cambiarse sin previo aviso.\n
 
 # Translators please note do not translate the options themselves
-java.launcher.X.macosx.usage=\nLas siguientes opciones son espec\u00EDficas para Mac OS X:\n\\    -XstartOnFirstThread\n\\                      ejecuta el m\u00E9todo main() del primer thread (AppKit)\n\\    -Xdock:name=<nombre de aplicaci\u00F3n>"\n\\                      sustituye al nombre por defecto de la aplicaci\u00F3n que se muestra en el Dock\n\\    -Xdock:icon=<ruta de acceso a archivo de icono>\n\\                      sustituye al icono por defecto que se muestra en el Dock\n\n
+java.launcher.X.macosx.usage=\nLas siguientes opciones son espec\u00EDficas para Mac OS X:\n    -XstartOnFirstThread\n                      ejecuta el m\u00E9todo main() del primer thread (AppKit)\n    -Xdock:name=<nombre de aplicaci\u00F3n>"\n                      sustituye al nombre por defecto de la aplicaci\u00F3n que se muestra en el Dock\n    -Xdock:icon=<ruta de acceso a archivo de icono>\n                      sustituye al icono por defecto que se muestra en el Dock\n\n
 
 java.launcher.cls.error1=Error: no se ha encontrado o cargado la clase principal {0}
-java.launcher.cls.error2=Error: el m\u00E9todo principal no es {0} en la clase {1}, defina el m\u00E9todo principal del siguiente modo:\n\   public static void main(String[] args)
-java.launcher.cls.error3=Error: el m\u00E9todo principal debe devolver un valor del tipo void en la clase {0}, \ndefina el m\u00E9todo principal del siguiente modo:\n\   public static void main(String[] args)
-java.launcher.cls.error4=Error: no se ha encontrado el m\u00E9todo principal en la clase {0}, defina el m\u00E9todo principal del siguiente modo:\n\   public static void main(String[] args)
+java.launcher.cls.error2=Error: el m\u00E9todo principal no es {0} en la clase {1}, defina el m\u00E9todo principal del siguiente modo:\n   public static void main(String[] args)
+java.launcher.cls.error3=Error: el m\u00E9todo principal debe devolver un valor del tipo void en la clase {0}, \ndefina el m\u00E9todo principal del siguiente modo:\n   public static void main(String[] args)
+java.launcher.cls.error4=Error: no se ha encontrado el m\u00E9todo principal en la clase {0}, defina el m\u00E9todo principal del siguiente modo:\n   public static void main(String[] args)
 java.launcher.jar.error1=Error: se ha producido un error inesperado al intentar abrir el archivo {0}
 java.launcher.jar.error2=no se ha encontrado el manifiesto en {0}
 java.launcher.jar.error3=no hay ning\u00FAn atributo de manifiesto principal en {0}
+java.launcher.init.error=error de inicializaci\u00F3n
--- a/src/share/classes/sun/launcher/resources/launcher_fr.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/launcher/resources/launcher_fr.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -24,7 +24,7 @@
 #
 
 # Translators please note do not translate the options themselves
-java.launcher.opt.header  =   Syntaxe : {0} [-options] class [args...]\n\           (pour l''ex\u00E9cution d''une classe)\n   ou  {0} [-options] -jar jarfile [args...]\n\           (pour l''ex\u00E9cution d''un fichier JAR)\no\u00F9 les options comprennent :\n
+java.launcher.opt.header  =   Syntaxe : {0} [-options] class [args...]\n           (pour l''ex\u00E9cution d''une classe)\n   ou  {0} [-options] -jar jarfile [args...]\n           (pour l''ex\u00E9cution d''un fichier JAR)\no\u00F9 les options comprennent :\n
 
 java.launcher.opt.datamodel  =\    -d{0}\t  utilisez le mod\u00E8le de donn\u00E9es {0} bits s''il est disponible\n
 java.launcher.opt.vmselect   =\    {0}\t  pour s\u00E9lectionner la machine virtuelle "{1}"\n
@@ -34,18 +34,19 @@
 java.launcher.ergo.message2  =\                  car vous ex\u00E9cutez une machine de classe de serveur.\n
 
 # Translators please note do not translate the options themselves
-java.launcher.opt.footer     =\    -cp <class search path of directories and zip/jar files>\n\    -classpath <class search path of directories and zip/jar files>\n\                  Liste de r\u00E9pertoires, d''archives JAR et\n\                   d''archives ZIP s\u00E9par\u00E9s par des {0}, dans laquelle rechercher les fichiers de classe.\n\    -D<name>=<value>\n\                  d\u00E9finition d''une propri\u00E9t\u00E9 syst\u00E8me\n\    -verbose[:class|gc|jni]\n\                  activation de la sortie en mode verbose\n\    -version      impression de la version du produit et fin de l''op\u00E9ration\n\    -version:<value>\n\                  ex\u00E9cution de la version sp\u00E9cifi\u00E9e obligatoire\n\    -showversion  impression de la version du produit et poursuite de l''op\u00E9ration\n\    -jre-restrict-search | -no-jre-restrict-search\n\                  inclusion/exclusion des environnements JRE priv\u00E9s de l''utilisateur dans la recherche de version\n\    -? -help      impression du message d''aide\n\    -X            impression de l''aide sur les options non standard\n\    -ea[:<packagename>...|:<classname>]\n\    -enableassertions[:<packagename>...|:<classname>]\n\                  activation des assertions avec la granularit\u00E9 sp\u00E9cifi\u00E9e\n\    -da[:<packagename>...|:<classname>]\n\    -disableassertions[:<packagename>...|:<classname>]\n\                  d\u00E9sactivation des assertions avec la granularit\u00E9 sp\u00E9cifi\u00E9e\n\    -esa | -enablesystemassertions\n\                  activation des assertions syst\u00E8me\n\    -dsa | -disablesystemassertions\n\                  d\u00E9sactivation des assertions syst\u00E8me\n\    -agentlib:<libname>[=<options>]\n\                  chargement de la biblioth\u00E8que d''agent natif <libname>, par exemple -agentlib:hprof\n\                  voir \u00E9galement, -agentlib:jdwp=help et -agentlib:hprof=help\n\    -agentpath:<pathname>[=<options>]\n\                  chargement de la biblioth\u00E8que d''agent natif via le chemin d''acc\u00E8s complet\n\    -javaagent:<jarpath>[=<options>]\n\                  chargement de l''agent du langage de programmation Java, voir java.lang.instrument\n\    -splash:<imagepath>\n\                  affichage de l''\u00E9cran d''accueil avec l''image sp\u00E9cifi\u00E9e\nVoir http://www.oracle.com/technetwork/java/javase/documentation/index.html pour plus de d\u00E9tails.
+java.launcher.opt.footer     =\    -cp <class search path of directories and zip/jar files>\n    -classpath <class search path of directories and zip/jar files>\n                  Liste de r\u00E9pertoires, d''archives JAR et\n                   d''archives ZIP s\u00E9par\u00E9s par des {0}, dans laquelle rechercher les fichiers de classe.\n    -D<name>=<value>\n                  d\u00E9finition d''une propri\u00E9t\u00E9 syst\u00E8me\n    -verbose[:class|gc|jni]\n                  activation de la sortie en mode verbose\n    -version      impression de la version du produit et fin de l''op\u00E9ration\n    -version:<value>\n                  ex\u00E9cution de la version sp\u00E9cifi\u00E9e obligatoire\n    -showversion  impression de la version du produit et poursuite de l''op\u00E9ration\n    -jre-restrict-search | -no-jre-restrict-search\n                  inclusion/exclusion des environnements JRE priv\u00E9s de l''utilisateur dans la recherche de version\n    -? -help      impression du message d''aide\n    -X            impression de l''aide sur les options non standard\n    -ea[:<packagename>...|:<classname>]\n    -enableassertions[:<packagename>...|:<classname>]\n                  activation des assertions avec la granularit\u00E9 sp\u00E9cifi\u00E9e\n    -da[:<packagename>...|:<classname>]\n    -disableassertions[:<packagename>...|:<classname>]\n                  d\u00E9sactivation des assertions avec la granularit\u00E9 sp\u00E9cifi\u00E9e\n    -esa | -enablesystemassertions\n                  activation des assertions syst\u00E8me\n    -dsa | -disablesystemassertions\n                  d\u00E9sactivation des assertions syst\u00E8me\n    -agentlib:<libname>[=<options>]\n                  chargement de la biblioth\u00E8que d''agent natif <libname>, par exemple -agentlib:hprof\n                  voir \u00E9galement, -agentlib:jdwp=help et -agentlib:hprof=help\n    -agentpath:<pathname>[=<options>]\n                  chargement de la biblioth\u00E8que d''agent natif via le chemin d''acc\u00E8s complet\n    -javaagent:<jarpath>[=<options>]\n                  chargement de l''agent du langage de programmation Java, voir java.lang.instrument\n    -splash:<imagepath>\n                  affichage de l''\u00E9cran d''accueil avec l''image sp\u00E9cifi\u00E9e\nVoir http://www.oracle.com/technetwork/java/javase/documentation/index.html pour plus de d\u00E9tails.
 
 # Translators please note do not translate the options themselves
-java.launcher.X.usage=\    -Xmixed           ex\u00E9cution en mode mixte (valeur par d\u00E9faut)\n\    -Xint             ex\u00E9cution en mode interpr\u00E9t\u00E9 uniquement\n\    -Xbootclasspath:<directories and zip/jar files separated by {0}>\n\                      d\u00E9finition du chemin de recherche pour les ressources et classes bootstrap\n\    -Xbootclasspath/a:<directories and zip/jar files separated by {0}>\n\                      ajout \u00E0 la fin du chemin de classe bootstrap\n\    -Xbootclasspath/p:<directories and zip/jar files separated by {0}>\n\                      ajout au d\u00E9but du chemin de classe bootstrap\n\    -Xdiag            affichage de messages de diagnostic suppl\u00E9mentaires\n\    -Xnoclassgc       d\u00E9sactivation de l''op\u00E9ration de ramasse-miette (garbage collection) de la classe\n\    -Xincgc           activation de l''op\u00E9ration de ramasse-miette (garbage collection) incr\u00E9mentielle\n\    -Xloggc:<file>    journalisation du statut de l''op\u00E9ration de ramasse-miette (garbage collection) dans un fichier avec horodatages\n\    -Xbatch           d\u00E9sactivation de la compilation en arri\u00E8re-plan\n\    -Xms<size>        d\u00E9finition de la taille initiale des portions de m\u00E9moire Java\n\    -Xmx<size>        d\u00E9finition de la taille maximale des portions de m\u00E9moire Java\n\    -Xss<size>        d\u00E9finition de la taille de pile de thread Java\n\    -Xprof            sortie des donn\u00E9es de profilage de l''unit\u00E9 centrale\n\    -Xfuture          activation des contr\u00F4les les plus stricts en vue d''anticiper la future valeur par d\u00E9faut\n\    -Xrs              r\u00E9duction de l''utilisation des signaux OS par Java/la machine virtuelle (voir documentation)\n\    -Xcheck:jni       ex\u00E9cution de contr\u00F4les suppl\u00E9mentaires pour les fonctions JNI\n\    -Xshare:off       aucune tentative d''utilisation des donn\u00E9es de classe partag\u00E9es\n\    -Xshare:auto      utilisation des donn\u00E9es de classe partag\u00E9es si possible (valeur par d\u00E9faut)\n\    -Xshare:on        utilisation des donn\u00E9es de classe partag\u00E9es obligatoire ou \u00E9chec de l''op\u00E9ration\n\    -XshowSettings    affichage de tous les param\u00E8tres et poursuite de l''op\u00E9ration\n\    -XshowSettings:all\n\                      affichage de tous les param\u00E8tres et poursuite de l''op\u00E9ration\n\    -XshowSettings:vm affichage de tous les param\u00E8tres de machine virtuelle et poursuite de l''op\u00E9ration\n\    -XshowSettings:properties\n\                      affichage de tous les param\u00E8tres de propri\u00E9t\u00E9 et poursuite de l''op\u00E9ration\n\    -XshowSettings:locale\n\                      affichage de tous les param\u00E8tres d''environnement local et poursuite de l''op\u00E9ration\n\nLes options -X ne sont pas des options standard et peuvent faire l''objet de modifications sans pr\u00E9avis.\n
+java.launcher.X.usage=\    -Xmixed           ex\u00E9cution en mode mixte (valeur par d\u00E9faut)\n    -Xint             ex\u00E9cution en mode interpr\u00E9t\u00E9 uniquement\n    -Xbootclasspath:<directories and zip/jar files separated by {0}>\n                      d\u00E9finition du chemin de recherche pour les ressources et classes bootstrap\n    -Xbootclasspath/a:<directories and zip/jar files separated by {0}>\n                      ajout \u00E0 la fin du chemin de classe bootstrap\n    -Xbootclasspath/p:<directories and zip/jar files separated by {0}>\n                      ajout au d\u00E9but du chemin de classe bootstrap\n    -Xdiag            affichage de messages de diagnostic suppl\u00E9mentaires\n    -Xnoclassgc       d\u00E9sactivation de l''op\u00E9ration de ramasse-miette (garbage collection) de la classe\n    -Xincgc           activation de l''op\u00E9ration de ramasse-miette (garbage collection) incr\u00E9mentielle\n    -Xloggc:<file>    journalisation du statut de l''op\u00E9ration de ramasse-miette (garbage collection) dans un fichier avec horodatages\n    -Xbatch           d\u00E9sactivation de la compilation en arri\u00E8re-plan\n    -Xms<size>        d\u00E9finition de la taille initiale des portions de m\u00E9moire Java\n    -Xmx<size>        d\u00E9finition de la taille maximale des portions de m\u00E9moire Java\n    -Xss<size>        d\u00E9finition de la taille de pile de thread Java\n    -Xprof            sortie des donn\u00E9es de profilage de l''unit\u00E9 centrale\n    -Xfuture          activation des contr\u00F4les les plus stricts en vue d''anticiper la future valeur par d\u00E9faut\n    -Xrs              r\u00E9duction de l''utilisation des signaux OS par Java/la machine virtuelle (voir documentation)\n    -Xcheck:jni       ex\u00E9cution de contr\u00F4les suppl\u00E9mentaires pour les fonctions JNI\n    -Xshare:off       aucune tentative d''utilisation des donn\u00E9es de classe partag\u00E9es\n    -Xshare:auto      utilisation des donn\u00E9es de classe partag\u00E9es si possible (valeur par d\u00E9faut)\n    -Xshare:on        utilisation des donn\u00E9es de classe partag\u00E9es obligatoire ou \u00E9chec de l''op\u00E9ration\n    -XshowSettings    affichage de tous les param\u00E8tres et poursuite de l''op\u00E9ration\n    -XshowSettings:all\n                      affichage de tous les param\u00E8tres et poursuite de l''op\u00E9ration\n    -XshowSettings:vm affichage de tous les param\u00E8tres de machine virtuelle et poursuite de l''op\u00E9ration\n    -XshowSettings:properties\n                      affichage de tous les param\u00E8tres de propri\u00E9t\u00E9 et poursuite de l''op\u00E9ration\n    -XshowSettings:locale\n                      affichage de tous les param\u00E8tres d''environnement local et poursuite de l''op\u00E9ration\n\nLes options -X ne sont pas des options standard et peuvent faire l''objet de modifications sans pr\u00E9avis.\n
 
 # Translators please note do not translate the options themselves
-java.launcher.X.macosx.usage=\nLes options suivantes sont propres \u00E0 Mac OS X :\n\    -XstartOnFirstThread\n\                      ex\u00E9cute la m\u00E9thode main() sur le premier thread (AppKit)\n\    -Xdock:name=<application name>"\n\                      remplace le nom d'application par d\u00E9faut affich\u00E9 dans l'ancrage\n\    -Xdock:icon=<path to icon file>\n\                      remplace l'ic\u00F4ne par d\u00E9faut affich\u00E9e dans l'ancrage\n\n
+java.launcher.X.macosx.usage=\nLes options suivantes sont propres \u00E0 Mac OS X :\n    -XstartOnFirstThread\n                      ex\u00E9cute la m\u00E9thode main() sur le premier thread (AppKit)\n    -Xdock:name=<application name>"\n                      remplace le nom d'application par d\u00E9faut affich\u00E9 dans l'ancrage\n    -Xdock:icon=<path to icon file>\n                      remplace l'ic\u00F4ne par d\u00E9faut affich\u00E9e dans l'ancrage\n\n
 
 java.launcher.cls.error1=Erreur : impossible de trouver ou charger la classe principale {0}
-java.launcher.cls.error2=Erreur : la m\u00E9thode principale n''est pas {0} dans la classe {1}, d\u00E9finissez la m\u00E9thode principale comme suit :\n\   public static void main(String[] args)
-java.launcher.cls.error3=Erreur : la m\u00E9thode principale doit renvoyer une valeur de type void dans la classe {0}, \nd\u00E9finissez la m\u00E9thode principale comme suit :\n\   public static void main(String[] args)
-java.launcher.cls.error4=Erreur : la m\u00E9thode principale est introuvable dans la classe {0}, d\u00E9finissez la m\u00E9thode principale comme suit :\n\   public static void main(String[] args)
+java.launcher.cls.error2=Erreur : la m\u00E9thode principale n''est pas {0} dans la classe {1}, d\u00E9finissez la m\u00E9thode principale comme suit :\n   public static void main(String[] args)
+java.launcher.cls.error3=Erreur : la m\u00E9thode principale doit renvoyer une valeur de type void dans la classe {0}, \nd\u00E9finissez la m\u00E9thode principale comme suit :\n   public static void main(String[] args)
+java.launcher.cls.error4=Erreur : la m\u00E9thode principale est introuvable dans la classe {0}, d\u00E9finissez la m\u00E9thode principale comme suit :\n   public static void main(String[] args)
 java.launcher.jar.error1=Erreur : une erreur inattendue est survenue lors de la tentative d''ouverture du fichier {0}
 java.launcher.jar.error2=fichier manifeste introuvable dans {0}
 java.launcher.jar.error3=aucun attribut manifest principal dans {0}
+java.launcher.init.error=erreur d'initialisation
--- a/src/share/classes/sun/launcher/resources/launcher_it.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/launcher/resources/launcher_it.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -24,7 +24,7 @@
 #
 
 # Translators please note do not translate the options themselves
-java.launcher.opt.header  =   Uso: {0} [-opzioni] class [argomenti...]\n\           (per eseguire una classe)\n   oppure  {0} [-opzioni] -jar filejar [argomenti...]\n\           (per eseguire un file jar)\ndove le opzioni sono:\n
+java.launcher.opt.header  =   Uso: {0} [-opzioni] class [argomenti...]\n           (per eseguire una classe)\n   oppure  {0} [-opzioni] -jar filejar [argomenti...]\n           (per eseguire un file jar)\ndove le opzioni sono:\n
 
 java.launcher.opt.datamodel  =\    -d{0}\t  usare un modello di dati {0}-bit se disponibile\n
 java.launcher.opt.vmselect   =\    {0}\t  per selezionare la VM "{1}"\n
@@ -34,18 +34,19 @@
 java.launcher.ergo.message2  =\                  perch\u00E9 si utilizza un computer di classe server.\n
 
 # Translators please note do not translate the options themselves
-java.launcher.opt.footer     =\    -cp <classpath di ricerca di directory e file zip/jar>\n\    -classpath <classpath di ricerca di directory e file zip/jar>\n\                  Una lista separata da {0} di directory, archivi JAR\n\                  e archivi ZIP utilizzata per la ricerca di file di classe.\n\    -D<nome>=<valore>\n\                  imposta una propriet\u00E0 di sistema\n\    -verbose[:class|gc|jni]\n\                  abilita l''output descrittivo\n\    -version      stampa la versione del prodotto ed esce\n\    -version:<valore>\n\                  richiede l''esecuzione della versione specificata\n\    -showversion  stampa la versione del prodotto e continua\n\    -jre-restrict-search | -no-jre-restrict-search\n\                  include/esclude gli ambienti JRE privati dell''utente nella ricerca della versione\n\    -? -help      stampa questo messaggio della Guida\n\    -X            stampa la Guida sulle opzioni non standard\n\    -ea[:<nomepackage>...|:<nomeclasse>]\n\    -enableassertions[:<nomepackage>...|:<nomeclasse>]\n\                  abilita le asserzioni con la granularit\u00E0 specificata\n\    -da[:<nomepackage>...|:<nomeclasse>]\n\    -disableassertions[:<nomepackage>...|:<nomeclasse>]\n\                  disabilita le asserzioni con la granularit\u00E0 specificata\n\    -esa | -enablesystemassertions\n\                  abilita le asserzioni di sistema\n\    -dsa | -disablesystemassertions\n\                  disabilita le asserzioni di sistema\n\    -agentlib:<nomelib>[=<opzioni>]\n\                  carica la libreria agenti nativa <nomelib>, ad esempio -agentlib:hprof\n\                  vedere anche -agentlib:jdwp=help and -agentlib:hprof=help\n\    -agentpath:<nomepercorso>[=<opzioni>]\n\                  carica la libreria agenti nativa con il percorso completo\n\    -javaagent:<percorsojar>[=<opzioni>]\n\                  carica l''agente del linguaggio di programmazione Java. Vedere java.lang.instrument\n\    -splash:<percorsoimmagine>\n\                  mostra la schermata iniziale con l''immagine specificata\nVedere http://www.oracle.com/technetwork/java/javase/documentation/index.html per ulteriori dettagli.
+java.launcher.opt.footer     =\    -cp <classpath di ricerca di directory e file zip/jar>\n\\    -classpath <classpath di ricerca di directory e file zip/jar>\n\\                  Una lista separata da {0} di directory, archivi JAR,\n\\                  e archivi ZIP utilizzata per la ricerca di file di classe.\n\\    -D<nome>=<valore>\n\\                  imposta una propriet\u00E0 di sistema\n\\    -verbose:[class|gc|jni]\n\\                  abilita l''output descrittivo\n\\    -version      stampa la versione del prodotto ed esce\n\\    -version:<valore>\n\\                  richiede l''esecuzione della versione specificata\n\\    -showversion  stampa la versione del prodotto e continua\n\\    -jre-restrict-search | -no-jre-restrict-search\n\\                  include/esclude gli ambienti JRE privati dell''utente nella ricerca della versione\n\\    -? -help      stampa questo messaggio della Guida\n\\    -X            stampa la Guida sulle opzioni non standard\n\\    -ea[:<nomepackage>...|:<nomeclasse>]\n\\    -enableassertions[:<nomepackage>...|:<nomeclasse>]\n\\                  abilita le asserzioni con la granularit\u00E0 specificata\n\\    -da[:<nomepackage>...|:<nomeclasse>]\n\\    -disableassertions[:<nomepackage>...|:<nomeclasse>]\n\\                  disabilita le asserzioni con la granularit\u00E0 specificata\n\\    -esa | -enablesystemassertions\n\\                  abilita le asserzioni di sistema\n\\    -dsa | -disablesystemassertions\n\\                  disabilita le asserzioni di sistema\n\\    -agentlib:<nomelib>[=<opzioni>]\n\\                  carica la libreria agenti nativa <nomelib>, ad esempio -agentlib:hprof\n\\                  vedere anche, -agentlib:jdwp=help and -agentlib:hprof=help\n\\    -agentpath:<nomepercorso>[=<opzioni>]\n\\                  carica la libreria agenti nativa con il percorso completo\n\\    -javaagent:<percorsojar>[=<opzioni>]\n\\                  carica l''agente del linguaggio di programmazione Java. Vedere java.lang.instrument\n\\    -splash:<percorsoimmagine>\n\\                  mostra la schermata iniziale con l''immagine specificata\nPer ulteriori dettagli, vedere http://www.oracle.com/technetwork/java/javase/documentation/index.html.
 
 # Translators please note do not translate the options themselves
-java.launcher.X.usage=\    -Xmixed           esecuzione in modalit\u00E0 mista (impostazione predefinita)\n\    -Xint             esecuzione solo in modalit\u00E0 convertita\n\    -Xbootclasspath:<directory e file zip/jar separati da {0}>\n\                      imposta il percorso di ricerca per le classi e le risorse di bootstrap\n\    -Xbootclasspath/a:<directory e file zip/jar separati da {0}>\n\                      aggiunge alla fine del classpath di bootstrap\n\    -Xbootclasspath/p:<directory e file zip/jar separati da {0}>\n\                      antepone al classpath di bootstrap\n\    -Xdiag            mostra messaggi di diagnostica aggiuntivi\n\    -Xnoclassgc       disabilita la garbage collection della classe\n\    -Xincgc           abilita la garbage collection incrementale\n\    -Xloggc:<file>    registra lo stato GC in un file di log con indicatori orari\n\    -Xbatch           disabilita la compilazione in background\n\    -Xms<dimensione>        imposta la dimensione heap Java iniziale\n\    -Xmx<dimensione>        imposta la dimensione heap Java massima\n\    -Xss<dimensione>        imposta la dimensione dello stack di thread Java\n\    -Xprof            visualizza i dati di profilo della CPU\n\    -Xfuture          abilita i controlli pi\u00F9 limitativi anticipando le impostazioni predefinite future\n\    -Xrs              riduce l''uso di segnali del sistema operativo da Java/VM (vedere la documentazione)\n\    -Xcheck:jni       esegue controlli aggiuntivi per le funzioni JNI\n\    -Xshare:off       non tenta di utilizzare i dati della classe condivisi\n\    -Xshare:auto      utilizza i dati di classe condivisi se possibile (impostazione predefinita)\n\    -Xshare:on        richiede l''uso dei dati di classe condivisi, altrimenti l''esecuzione non riesce.\n\    -XshowSettings    mostra tutte le impostazioni e continua\n\    -XshowSettings:all\n\                      mostra tutte le impostazioni e continua\n\    -XshowSettings:vm mostra tutte le impostazioni correlate alla VM e continua\n\    -XshowSettings:properties\n\                      mostra tutte le impostazioni delle propriet\u00E0 e continua\n\    -XshowSettings:locale\n\                      mostra tutte le impostazioni correlate alle impostazioni nazionali e continua\n\nLe opzioni -X non sono opzioni standard e sono soggette a modifiche senza preavviso.\n
+java.launcher.X.usage=\    -Xmixed           esecuzione in modalit\u00E0 mista (impostazione predefinita)\n    -Xint             esecuzione solo in modalit\u00E0 convertita\n    -Xbootclasspath:<directory e file zip/jar separati da {0}>\n                      imposta il percorso di ricerca per le classi e le risorse di bootstrap\n    -Xbootclasspath/a:<directory e file zip/jar separati da {0}>\n                      aggiunge alla fine del classpath di bootstrap\n    -Xbootclasspath/p:<directory e file zip/jar separati da {0}>\n                      antepone al classpath di bootstrap\n    -Xdiag            mostra messaggi di diagnostica aggiuntivi\n    -Xnoclassgc       disabilita la garbage collection della classe\n    -Xincgc           abilita la garbage collection incrementale\n    -Xloggc:<file>    registra lo stato GC in un file di log con indicatori orari\n    -Xbatch           disabilita la compilazione in background\n    -Xms<dimensione>        imposta la dimensione heap Java iniziale\n    -Xmx<dimensione>        imposta la dimensione heap Java massima\n    -Xss<dimensione>        imposta la dimensione dello stack di thread Java\n    -Xprof            visualizza i dati di profilo della CPU\n    -Xfuture          abilita i controlli pi\u00F9 limitativi anticipando le impostazioni predefinite future\n    -Xrs              riduce l''uso di segnali del sistema operativo da Java/VM (vedere la documentazione)\n    -Xcheck:jni       esegue controlli aggiuntivi per le funzioni JNI\n    -Xshare:off       non tenta di utilizzare i dati della classe condivisi\n    -Xshare:auto      utilizza i dati di classe condivisi se possibile (impostazione predefinita)\n    -Xshare:on        richiede l''uso dei dati di classe condivisi, altrimenti l''esecuzione non riesce.\n    -XshowSettings    mostra tutte le impostazioni e continua\n    -XshowSettings:all\n                      mostra tutte le impostazioni e continua\n    -XshowSettings:vm mostra tutte le impostazioni correlate alla VM e continua\n    -XshowSettings:properties\n                      mostra tutte le impostazioni delle propriet\u00E0 e continua\n    -XshowSettings:locale\n                      mostra tutte le impostazioni correlate alle impostazioni nazionali e continua\n\nLe opzioni -X non sono opzioni standard e sono soggette a modifiche senza preavviso.\n
 
 # Translators please note do not translate the options themselves
-java.launcher.X.macosx.usage=\nLe opzioni riportate di seguito sono specifiche del sistema operativo Mac OS X:\n\    -XstartOnFirstThread\n\                      Esegue il metodo main() sul primo thread (AppKit).\n\    -Xdock:name=<nome applicazione>"\n\                      Sostituisce il nome applicazione predefinito visualizzato nel dock\n\    -Xdock:icon=<percorso file icona>\n\                      Sostituisce l'icona predefinita visualizzata nel dock\n\n
+java.launcher.X.macosx.usage=\nLe opzioni riportate di seguito sono specifiche del sistema operativo Mac OS X:\n    -XstartOnFirstThread\n                      Esegue il metodo main() sul primo thread (AppKit).\n    -Xdock:name=<nome applicazione>"\n                      Sostituisce il nome applicazione predefinito visualizzato nel dock\n    -Xdock:icon=<percorso file icona>\n                      Sostituisce l'icona predefinita visualizzata nel dock\n\n
 
 java.launcher.cls.error1=Errore: impossibile trovare o caricare la classe principale {0}
-java.launcher.cls.error2=Errore: il metodo principale non \u00E8 {0} nella classe {1}. Definire il metodo principale come:\n\   public static void main(String[] args)
-java.launcher.cls.error3=Errore: il metodo principale deve restituire un valore di tipo void nella classe {0}. \nDefinire il metodo principale come:\n\   public static void main(String[] args)
-java.launcher.cls.error4=Errore: il metodo principale non \u00E8 stato trovato nella classe {0}. Definire il metodo principale come:\n\   public static void main(String[] args)
+java.launcher.cls.error2=Errore: il metodo principale non \u00E8 {0} nella classe {1}. Definire il metodo principale come:\n   public static void main(String[] args)
+java.launcher.cls.error3=Errore: il metodo principale deve restituire un valore di tipo void nella classe {0}. \nDefinire il metodo principale come:\n   public static void main(String[] args)
+java.launcher.cls.error4=Errore: il metodo principale non \u00E8 stato trovato nella classe {0}. Definire il metodo principale come:\n   public static void main(String[] args)
 java.launcher.jar.error1=Errore: si \u00E8 verificato un errore imprevisto durante il tentativo di aprire il file {0}
 java.launcher.jar.error2=manifest non trovato in {0}
 java.launcher.jar.error3=nessun attributo manifest principale in {0}
+java.launcher.init.error=errore di inizializzazione
--- a/src/share/classes/sun/launcher/resources/launcher_ja.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/launcher/resources/launcher_ja.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -24,7 +24,7 @@
 #
 
 # Translators please note do not translate the options themselves
-java.launcher.opt.header  =   \u4F7F\u7528\u65B9\u6CD5: {0} [-options] class [args...]\n\           (\u30AF\u30E9\u30B9\u3092\u5B9F\u884C\u3059\u308B\u5834\u5408)\n   \u307E\u305F\u306F  {0} [-options] -jar jarfile [args...]\n\           (jar\u30D5\u30A1\u30A4\u30EB\u3092\u5B9F\u884C\u3059\u308B\u5834\u5408)\noptions\u306B\u306F\u6B21\u306E\u3082\u306E\u304C\u3042\u308A\u307E\u3059\u3002\n
+java.launcher.opt.header  =   \u4F7F\u7528\u65B9\u6CD5: {0} [-options] class [args...]\n           (\u30AF\u30E9\u30B9\u3092\u5B9F\u884C\u3059\u308B\u5834\u5408)\n   \u307E\u305F\u306F  {0} [-options] -jar jarfile [args...]\n           (jar\u30D5\u30A1\u30A4\u30EB\u3092\u5B9F\u884C\u3059\u308B\u5834\u5408)\noptions\u306B\u306F\u6B21\u306E\u3082\u306E\u304C\u3042\u308A\u307E\u3059\u3002\n
 
 java.launcher.opt.datamodel  =\    -d{0}\t  \u4F7F\u7528\u53EF\u80FD\u306A\u5834\u5408\u306F{0}\u30D3\u30C3\u30C8\u306E\u30C7\u30FC\u30BF\u30FB\u30E2\u30C7\u30EB\u3092\u4F7F\u7528\u3059\u308B\n
 java.launcher.opt.vmselect   =\    {0}\t  "{1}" VM\u3092\u9078\u629E\u3059\u308B\u5834\u5408\n
@@ -34,18 +34,19 @@
 java.launcher.ergo.message2  =\                  \u3053\u308C\u306F\u30B5\u30FC\u30D0\u30FC\u30AF\u30E9\u30B9\u306E\u30DE\u30B7\u30F3\u3067\u5B9F\u884C\u3057\u3066\u3044\u308B\u305F\u3081\u3067\u3059\u3002\n
 
 # Translators please note do not translate the options themselves
-java.launcher.opt.footer     =\    -cp <class search path of directories and zip/jar files>\n\    -classpath <class search path of directories and zip/jar files>\n\                  \u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u691C\u7D22\u3059\u308B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3001\n\                  JAR\u30A2\u30FC\u30AB\u30A4\u30D6\u304A\u3088\u3073ZIP\u30A2\u30FC\u30AB\u30A4\u30D6\u306E{0}\u3067\u533A\u5207\u3089\u308C\u305F\u30EA\u30B9\u30C8\u3067\u3059\u3002\n\    -D<name>=<value>\n\                  \u30B7\u30B9\u30C6\u30E0\u30FB\u30D7\u30ED\u30D1\u30C6\u30A3\u3092\u8A2D\u5B9A\u3059\u308B\n\    -verbose[:class|gc|jni]\n\                  \u8A73\u7D30\u306A\u51FA\u529B\u3092\u884C\u3046\n\    -version      \u88FD\u54C1\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u51FA\u529B\u3057\u3066\u7D42\u4E86\u3059\u308B\n\    -version:<value>\n\                  \u6307\u5B9A\u3057\u305F\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u5B9F\u884C\u306B\u5FC5\u9808\u306B\u3059\u308B\n\    -showversion  \u88FD\u54C1\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u51FA\u529B\u3057\u3066\u7D9A\u884C\u3059\u308B\n\    -jre-restrict-search | -no-jre-restrict-search\n\                  \u30E6\u30FC\u30B6\u30FC\u306E\u30D7\u30E9\u30A4\u30D9\u30FC\u30C8JRE\u3092\u30D0\u30FC\u30B8\u30E7\u30F3\u691C\u7D22\u306B\u542B\u3081\u308B/\u9664\u5916\u3059\u308B\n\    -? -help      \u3053\u306E\u30D8\u30EB\u30D7\u30FB\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u51FA\u529B\u3059\u308B\n\    -X            \u975E\u6A19\u6E96\u30AA\u30D7\u30B7\u30E7\u30F3\u306B\u95A2\u3059\u308B\u30D8\u30EB\u30D7\u3092\u51FA\u529B\u3059\u308B\n\    -ea[:<packagename>...|:<classname>]\n\    -enableassertions[:<packagename>...|:<classname>]\n\                  \u6307\u5B9A\u3057\u305F\u7C92\u5EA6\u3067\u30A2\u30B5\u30FC\u30B7\u30E7\u30F3\u3092\u6709\u52B9\u306B\u3059\u308B\n\    -da[:<packagename>...|:<classname>]\n\    -disableassertions[:<packagename>...|:<classname>]\n\                  \u6307\u5B9A\u3057\u305F\u7C92\u5EA6\u3067\u30A2\u30B5\u30FC\u30B7\u30E7\u30F3\u3092\u7121\u52B9\u306B\u3059\u308B\n\    -esa | -enablesystemassertions\n\                  \u30B7\u30B9\u30C6\u30E0\u30FB\u30A2\u30B5\u30FC\u30B7\u30E7\u30F3\u3092\u6709\u52B9\u306B\u3059\u308B\n\    -dsa | -disablesystemassertions\n\                  \u30B7\u30B9\u30C6\u30E0\u30FB\u30A2\u30B5\u30FC\u30B7\u30E7\u30F3\u3092\u7121\u52B9\u306B\u3059\u308B\n\    -agentlib:<libname>[=<options>]\n\                  \u30CD\u30A4\u30C6\u30A3\u30D6\u30FB\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u30FB\u30E9\u30A4\u30D6\u30E9\u30EA<libname>\u3092\u30ED\u30FC\u30C9\u3059\u308B\u3002\u4F8B: -agentlib:hprof\n\                  -agentlib:jdwp=help\u3068-agentlib:hprof=help\u3082\u53C2\u7167\n\    -agentpath:<pathname>[=<options>]\n\                  \u30D5\u30EB\u30D1\u30B9\u540D\u3067\u30CD\u30A4\u30C6\u30A3\u30D6\u30FB\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u30FB\u30E9\u30A4\u30D6\u30E9\u30EA\u3092\u30ED\u30FC\u30C9\u3059\u308B\n\    -javaagent:<jarpath>[=<options>]\n\                  Java\u30D7\u30ED\u30B0\u30E9\u30DF\u30F3\u30B0\u8A00\u8A9E\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u3092\u30ED\u30FC\u30C9\u3059\u308B\u3002java.lang.instrument\u3092\u53C2\u7167\n\    -splash:<imagepath>\n\                  \u6307\u5B9A\u3057\u305F\u30A4\u30E1\u30FC\u30B8\u3067\u30B9\u30D7\u30E9\u30C3\u30B7\u30E5\u753B\u9762\u3092\u8868\u793A\u3059\u308B\n\u8A73\u7D30\u306Fhttp://www.oracle.com/technetwork/java/javase/documentation/index.html\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002
+java.launcher.opt.footer     =\    -cp <class search path of directories and zip/jar files>\n    -classpath <class search path of directories and zip/jar files>\n                  \u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u691C\u7D22\u3059\u308B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3001\n                  JAR\u30A2\u30FC\u30AB\u30A4\u30D6\u304A\u3088\u3073ZIP\u30A2\u30FC\u30AB\u30A4\u30D6\u306E{0}\u3067\u533A\u5207\u3089\u308C\u305F\u30EA\u30B9\u30C8\u3067\u3059\u3002\n    -D<name>=<value>\n                  \u30B7\u30B9\u30C6\u30E0\u30FB\u30D7\u30ED\u30D1\u30C6\u30A3\u3092\u8A2D\u5B9A\u3059\u308B\n    -verbose:[class|gc|jni]\n                  \u8A73\u7D30\u306A\u51FA\u529B\u3092\u884C\u3046\n    -version      \u88FD\u54C1\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u51FA\u529B\u3057\u3066\u7D42\u4E86\u3059\u308B\n    -version:<value>\n                  \u6307\u5B9A\u3057\u305F\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u5B9F\u884C\u306B\u5FC5\u9808\u306B\u3059\u308B\n    -showversion  \u88FD\u54C1\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u51FA\u529B\u3057\u3066\u7D9A\u884C\u3059\u308B\n    -jre-restrict-search | -no-jre-restrict-search\n                  \u30E6\u30FC\u30B6\u30FC\u306E\u30D7\u30E9\u30A4\u30D9\u30FC\u30C8JRE\u3092\u30D0\u30FC\u30B8\u30E7\u30F3\u691C\u7D22\u306B\u542B\u3081\u308B/\u9664\u5916\u3059\u308B\n    -? -help      \u3053\u306E\u30D8\u30EB\u30D7\u30FB\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u51FA\u529B\u3059\u308B\n    -X            \u975E\u6A19\u6E96\u30AA\u30D7\u30B7\u30E7\u30F3\u306B\u95A2\u3059\u308B\u30D8\u30EB\u30D7\u3092\u51FA\u529B\u3059\u308B\n    -ea[:<packagename>...|:<classname>]\n    -enableassertions[:<packagename>...|:<classname>]\n                  \u6307\u5B9A\u3057\u305F\u7C92\u5EA6\u3067\u30A2\u30B5\u30FC\u30B7\u30E7\u30F3\u3092\u6709\u52B9\u306B\u3059\u308B\n    -da[:<packagename>...|:<classname>]\n    -disableassertions[:<packagename>...|:<classname>]\n                  \u6307\u5B9A\u3057\u305F\u7C92\u5EA6\u3067\u30A2\u30B5\u30FC\u30B7\u30E7\u30F3\u3092\u7121\u52B9\u306B\u3059\u308B\n    -esa | -enablesystemassertions\n                  \u30B7\u30B9\u30C6\u30E0\u30FB\u30A2\u30B5\u30FC\u30B7\u30E7\u30F3\u3092\u6709\u52B9\u306B\u3059\u308B\n    -dsa | -disablesystemassertions\n                  \u30B7\u30B9\u30C6\u30E0\u30FB\u30A2\u30B5\u30FC\u30B7\u30E7\u30F3\u3092\u7121\u52B9\u306B\u3059\u308B\n    -agentlib:<libname>[=<options>]\n                  \u30CD\u30A4\u30C6\u30A3\u30D6\u30FB\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u30FB\u30E9\u30A4\u30D6\u30E9\u30EA<libname>\u3092\u30ED\u30FC\u30C9\u3059\u308B\u3002\u4F8B: -agentlib:hprof\n                  -agentlib:jdwp=help\u3068-agentlib:hprof=help\u3082\u53C2\u7167\n    -agentpath:<pathname>[=<options>]\n                  \u30D5\u30EB\u30D1\u30B9\u540D\u3067\u30CD\u30A4\u30C6\u30A3\u30D6\u30FB\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u30FB\u30E9\u30A4\u30D6\u30E9\u30EA\u3092\u30ED\u30FC\u30C9\u3059\u308B\n    -javaagent:<jarpath>[=<options>]\n                  Java\u30D7\u30ED\u30B0\u30E9\u30DF\u30F3\u30B0\u8A00\u8A9E\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u3092\u30ED\u30FC\u30C9\u3059\u308B\u3002java.lang.instrument\u3092\u53C2\u7167\n    -splash:<imagepath>\n                  \u6307\u5B9A\u3057\u305F\u30A4\u30E1\u30FC\u30B8\u3067\u30B9\u30D7\u30E9\u30C3\u30B7\u30E5\u753B\u9762\u3092\u8868\u793A\u3059\u308B\n\u8A73\u7D30\u306Fhttp://www.oracle.com/technetwork/java/javase/documentation/index.html\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002
 
 # Translators please note do not translate the options themselves
-java.launcher.X.usage=\    -Xmixed           \u6DF7\u5408\u30E2\u30FC\u30C9\u306E\u5B9F\u884C(\u30C7\u30D5\u30A9\u30EB\u30C8)\n\    -Xint             \u30A4\u30F3\u30BF\u30D7\u30EA\u30BF\u30FB\u30E2\u30FC\u30C9\u306E\u5B9F\u884C\u306E\u307F\n\    -Xbootclasspath:<directories and zip/jar files separated by {0}>\n\                      \u30D6\u30FC\u30C8\u30B9\u30C8\u30E9\u30C3\u30D7\u306E\u30AF\u30E9\u30B9\u3068\u30EA\u30BD\u30FC\u30B9\u306E\u691C\u7D22\u30D1\u30B9\u3092\u8A2D\u5B9A\u3059\u308B\n\    -Xbootclasspath/a:<directories and zip/jar files separated by {0}>\n\                      \u30D6\u30FC\u30C8\u30B9\u30C8\u30E9\u30C3\u30D7\u30FB\u30AF\u30E9\u30B9\u30FB\u30D1\u30B9\u306E\u6700\u5F8C\u306B\u8FFD\u52A0\u3059\u308B\n\    -Xbootclasspath/p:<directories and zip/jar files separated by {0}>\n\                      \u30D6\u30FC\u30C8\u30B9\u30C8\u30E9\u30C3\u30D7\u30FB\u30AF\u30E9\u30B9\u30FB\u30D1\u30B9\u306E\u524D\u306B\u4ED8\u52A0\u3059\u308B\n\    -Xdiag            \u8FFD\u52A0\u306E\u8A3A\u65AD\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8868\u793A\u3059\u308B\n\    -Xnoclassgc       \u30AF\u30E9\u30B9\u306E\u30AC\u30D9\u30FC\u30B8\u30FB\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3\u3092\u7121\u52B9\u306B\u3059\u308B\n\    -Xincgc           \u5897\u5206\u30AC\u30D9\u30FC\u30B8\u30FB\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3\u3092\u6709\u52B9\u306B\u3059\u308B\n\    -Xloggc:<file>    \u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u304C\u4ED8\u3044\u305F\u30D5\u30A1\u30A4\u30EB\u306BGC\u30B9\u30C6\u30FC\u30BF\u30B9\u306E\u30ED\u30B0\u3092\u8A18\u9332\u3059\u308B\n\    -Xbatch           \u30D0\u30C3\u30AF\u30B0\u30E9\u30A6\u30F3\u30C9\u306E\u30B3\u30F3\u30D1\u30A4\u30EB\u3092\u7121\u52B9\u306B\u3059\u308B\n\    -Xms<size>        Java\u306E\u521D\u671F\u30D2\u30FC\u30D7\u30FB\u30B5\u30A4\u30BA\u3092\u8A2D\u5B9A\u3059\u308B\n\    -Xmx<size>        Java\u306E\u6700\u5C0F\u30D2\u30FC\u30D7\u30FB\u30B5\u30A4\u30BA\u3092\u8A2D\u5B9A\u3059\u308B\n\    -Xss<size>        Java\u306E\u30B9\u30EC\u30C3\u30C9\u30FB\u30B9\u30BF\u30C3\u30AF\u30FB\u30B5\u30A4\u30BA\u3092\u8A2D\u5B9A\u3059\u308B\n\    -Xprof            CPU\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u30FB\u30C7\u30FC\u30BF\u3092\u51FA\u529B\u3059\u308B\n\    -Xfuture          \u5C06\u6765\u306E\u30C7\u30D5\u30A9\u30EB\u30C8\u3092\u898B\u8D8A\u3057\u3066\u3001\u6700\u3082\u53B3\u5BC6\u306A\u30C1\u30A7\u30C3\u30AF\u3092\u6709\u52B9\u306B\u3059\u308B\n\    -Xrs              Java/VM\u306B\u3088\u308BOS\u30B7\u30B0\u30CA\u30EB\u306E\u4F7F\u7528\u3092\u524A\u6E1B\u3059\u308B(\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3092\u53C2\u7167)\n\    -Xcheck:jni       JNI\u95A2\u6570\u306B\u5BFE\u3059\u308B\u8FFD\u52A0\u306E\u30C1\u30A7\u30C3\u30AF\u3092\u5B9F\u884C\u3059\u308B\n\    -Xshare:off       \u5171\u6709\u30AF\u30E9\u30B9\u306E\u30C7\u30FC\u30BF\u3092\u4F7F\u7528\u3057\u3088\u3046\u3068\u3057\u306A\u3044\n\    -Xshare:auto      \u53EF\u80FD\u3067\u3042\u308C\u3070\u5171\u6709\u30AF\u30E9\u30B9\u306E\u30C7\u30FC\u30BF\u3092\u4F7F\u7528\u3059\u308B(\u30C7\u30D5\u30A9\u30EB\u30C8)\n\    -Xshare:on        \u5171\u6709\u30AF\u30E9\u30B9\u30FB\u30C7\u30FC\u30BF\u306E\u4F7F\u7528\u3092\u5FC5\u9808\u306B\u3057\u3001\u3067\u304D\u306A\u3051\u308C\u3070\u5931\u6557\u3059\u308B\u3002\n\    -XshowSettings    \u3059\u3079\u3066\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n\    -XshowSettings:all\n\                      \u3059\u3079\u3066\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n\    -XshowSettings:vm \u3059\u3079\u3066\u306EVM\u95A2\u9023\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n\    -XshowSettings:properties\n\                      \u3059\u3079\u3066\u306E\u30D7\u30ED\u30D1\u30C6\u30A3\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n\    -XshowSettings:locale\n\                      \u3059\u3079\u3066\u306E\u30ED\u30B1\u30FC\u30EB\u95A2\u9023\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n\n-X\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u975E\u6A19\u6E96\u306A\u306E\u3067\u3001\u4E88\u544A\u306A\u304F\u5909\u66F4\u3055\u308C\u308B\u5834\u5408\u304C\u3042\u308A\u307E\u3059\u3002\n
+java.launcher.X.usage=\    -Xmixed           \u6DF7\u5408\u30E2\u30FC\u30C9\u306E\u5B9F\u884C(\u30C7\u30D5\u30A9\u30EB\u30C8)\n    -Xint             \u30A4\u30F3\u30BF\u30D7\u30EA\u30BF\u30FB\u30E2\u30FC\u30C9\u306E\u5B9F\u884C\u306E\u307F\n    -Xbootclasspath:<directories and zip/jar files separated by {0}>\n                      \u30D6\u30FC\u30C8\u30B9\u30C8\u30E9\u30C3\u30D7\u306E\u30AF\u30E9\u30B9\u3068\u30EA\u30BD\u30FC\u30B9\u306E\u691C\u7D22\u30D1\u30B9\u3092\u8A2D\u5B9A\u3059\u308B\n    -Xbootclasspath/a:<directories and zip/jar files separated by {0}>\n                      \u30D6\u30FC\u30C8\u30B9\u30C8\u30E9\u30C3\u30D7\u30FB\u30AF\u30E9\u30B9\u30FB\u30D1\u30B9\u306E\u6700\u5F8C\u306B\u8FFD\u52A0\u3059\u308B\n    -Xbootclasspath/p:<directories and zip/jar files separated by {0}>\n                      \u30D6\u30FC\u30C8\u30B9\u30C8\u30E9\u30C3\u30D7\u30FB\u30AF\u30E9\u30B9\u30FB\u30D1\u30B9\u306E\u524D\u306B\u4ED8\u52A0\u3059\u308B\n    -Xdiag            \u8FFD\u52A0\u306E\u8A3A\u65AD\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8868\u793A\u3059\u308B\n    -Xnoclassgc       \u30AF\u30E9\u30B9\u306E\u30AC\u30D9\u30FC\u30B8\u30FB\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3\u3092\u7121\u52B9\u306B\u3059\u308B\n    -Xincgc           \u5897\u5206\u30AC\u30D9\u30FC\u30B8\u30FB\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3\u3092\u6709\u52B9\u306B\u3059\u308B\n    -Xloggc:<file>    \u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u304C\u4ED8\u3044\u305F\u30D5\u30A1\u30A4\u30EB\u306BGC\u30B9\u30C6\u30FC\u30BF\u30B9\u306E\u30ED\u30B0\u3092\u8A18\u9332\u3059\u308B\n    -Xbatch           \u30D0\u30C3\u30AF\u30B0\u30E9\u30A6\u30F3\u30C9\u306E\u30B3\u30F3\u30D1\u30A4\u30EB\u3092\u7121\u52B9\u306B\u3059\u308B\n    -Xms<size>        Java\u306E\u521D\u671F\u30D2\u30FC\u30D7\u30FB\u30B5\u30A4\u30BA\u3092\u8A2D\u5B9A\u3059\u308B\n    -Xmx<size>        Java\u306E\u6700\u5927\u30D2\u30FC\u30D7\u30FB\u30B5\u30A4\u30BA\u3092\u8A2D\u5B9A\u3059\u308B\n    -Xss<size>        Java\u306E\u30B9\u30EC\u30C3\u30C9\u30FB\u30B9\u30BF\u30C3\u30AF\u30FB\u30B5\u30A4\u30BA\u3092\u8A2D\u5B9A\u3059\u308B\n    -Xprof            CPU\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u30FB\u30C7\u30FC\u30BF\u3092\u51FA\u529B\u3059\u308B\n    -Xfuture          \u5C06\u6765\u306E\u30C7\u30D5\u30A9\u30EB\u30C8\u3092\u898B\u8D8A\u3057\u3066\u3001\u6700\u3082\u53B3\u5BC6\u306A\u30C1\u30A7\u30C3\u30AF\u3092\u6709\u52B9\u306B\u3059\u308B\n    -Xrs              Java/VM\u306B\u3088\u308BOS\u30B7\u30B0\u30CA\u30EB\u306E\u4F7F\u7528\u3092\u524A\u6E1B\u3059\u308B(\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3092\u53C2\u7167)\n    -Xcheck:jni       JNI\u95A2\u6570\u306B\u5BFE\u3059\u308B\u8FFD\u52A0\u306E\u30C1\u30A7\u30C3\u30AF\u3092\u5B9F\u884C\u3059\u308B\n    -Xshare:off       \u5171\u6709\u30AF\u30E9\u30B9\u306E\u30C7\u30FC\u30BF\u3092\u4F7F\u7528\u3057\u3088\u3046\u3068\u3057\u306A\u3044\n    -Xshare:auto      \u53EF\u80FD\u3067\u3042\u308C\u3070\u5171\u6709\u30AF\u30E9\u30B9\u306E\u30C7\u30FC\u30BF\u3092\u4F7F\u7528\u3059\u308B(\u30C7\u30D5\u30A9\u30EB\u30C8)\n    -Xshare:on        \u5171\u6709\u30AF\u30E9\u30B9\u30FB\u30C7\u30FC\u30BF\u306E\u4F7F\u7528\u3092\u5FC5\u9808\u306B\u3057\u3001\u3067\u304D\u306A\u3051\u308C\u3070\u5931\u6557\u3059\u308B\u3002\n    -XshowSettings    \u3059\u3079\u3066\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n    -XshowSettings:all\n                      \u3059\u3079\u3066\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n    -XshowSettings:vm \u3059\u3079\u3066\u306EVM\u95A2\u9023\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n    -XshowSettings:properties\n                      \u3059\u3079\u3066\u306E\u30D7\u30ED\u30D1\u30C6\u30A3\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n    -XshowSettings:locale\n                      \u3059\u3079\u3066\u306E\u30ED\u30B1\u30FC\u30EB\u95A2\u9023\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n\n-X\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u975E\u6A19\u6E96\u306A\u306E\u3067\u3001\u4E88\u544A\u306A\u304F\u5909\u66F4\u3055\u308C\u308B\u5834\u5408\u304C\u3042\u308A\u307E\u3059\u3002\n
 
 # Translators please note do not translate the options themselves
-java.launcher.X.macosx.usage=\n\u6B21\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u306FMac OS X\u56FA\u6709\u3067\u3059\u3002\n\    -XstartOnFirstThread\n\                      main()\u30E1\u30BD\u30C3\u30C9\u3092\u6700\u521D(AppKit)\u306E\u30B9\u30EC\u30C3\u30C9\u3067\u5B9F\u884C\u3059\u308B\n\    -Xdock:name=<application name>"\n\                      Dock\u306B\u8868\u793A\u3055\u308C\u308B\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u540D\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3059\u308B\n\    -Xdock:icon=<path to icon file>\n\                      Dock\u306B\u8868\u793A\u3055\u308C\u308B\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30A2\u30A4\u30B3\u30F3\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3059\u308B\n\n
+java.launcher.X.macosx.usage=\n\u6B21\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u306FMac OS X\u56FA\u6709\u3067\u3059\u3002\n    -XstartOnFirstThread\n                      main()\u30E1\u30BD\u30C3\u30C9\u3092\u6700\u521D(AppKit)\u306E\u30B9\u30EC\u30C3\u30C9\u3067\u5B9F\u884C\u3059\u308B\n    -Xdock:name=<application name>"\n                      Dock\u306B\u8868\u793A\u3055\u308C\u308B\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u540D\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3059\u308B\n    -Xdock:icon=<path to icon file>\n                      Dock\u306B\u8868\u793A\u3055\u308C\u308B\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30A2\u30A4\u30B3\u30F3\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3059\u308B\n\n
 
 java.launcher.cls.error1=\u30A8\u30E9\u30FC: \u30E1\u30A4\u30F3\u30FB\u30AF\u30E9\u30B9{0}\u304C\u898B\u3064\u304B\u3089\u306A\u304B\u3063\u305F\u304B\u30ED\u30FC\u30C9\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F
-java.launcher.cls.error2=\u30A8\u30E9\u30FC: \u30E1\u30A4\u30F3\u30FB\u30E1\u30BD\u30C3\u30C9\u304C\u30AF\u30E9\u30B9{1}\u306E{0}\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002\u6B21\u306E\u3088\u3046\u306B\u30E1\u30A4\u30F3\u30FB\u30E1\u30BD\u30C3\u30C9\u3092\u5B9A\u7FA9\u3057\u3066\u304F\u3060\u3055\u3044\u3002\n\   public static void main(String[] args)
-java.launcher.cls.error3=\u30A8\u30E9\u30FC: \u30E1\u30A4\u30F3\u30FB\u30E1\u30BD\u30C3\u30C9\u306F\u30AF\u30E9\u30B9{0}\u306Evoid\u578B\u306E\u5024\u3092\u8FD4\u3059\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\n\u6B21\u306E\u3088\u3046\u306B\u30E1\u30A4\u30F3\u30FB\u30E1\u30BD\u30C3\u30C9\u3092\u5B9A\u7FA9\u3057\u3066\u304F\u3060\u3055\u3044\u3002\n\   public static void main(String[] args)
-java.launcher.cls.error4=\u30A8\u30E9\u30FC: \u30E1\u30A4\u30F3\u30FB\u30E1\u30BD\u30C3\u30C9\u304C\u30AF\u30E9\u30B9{0}\u3067\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002\u6B21\u306E\u3088\u3046\u306B\u30E1\u30A4\u30F3\u30FB\u30E1\u30BD\u30C3\u30C9\u3092\u5B9A\u7FA9\u3057\u3066\u304F\u3060\u3055\u3044\u3002\n\   public static void main(String[] args)
+java.launcher.cls.error2=\u30A8\u30E9\u30FC: \u30E1\u30A4\u30F3\u30FB\u30E1\u30BD\u30C3\u30C9\u304C\u30AF\u30E9\u30B9{1}\u306E{0}\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002\u6B21\u306E\u3088\u3046\u306B\u30E1\u30A4\u30F3\u30FB\u30E1\u30BD\u30C3\u30C9\u3092\u5B9A\u7FA9\u3057\u3066\u304F\u3060\u3055\u3044\u3002\n   public static void main(String[] args)
+java.launcher.cls.error3=\u30A8\u30E9\u30FC: \u30E1\u30A4\u30F3\u30FB\u30E1\u30BD\u30C3\u30C9\u306F\u30AF\u30E9\u30B9{0}\u306Evoid\u578B\u306E\u5024\u3092\u8FD4\u3059\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\n\u6B21\u306E\u3088\u3046\u306B\u30E1\u30A4\u30F3\u30FB\u30E1\u30BD\u30C3\u30C9\u3092\u5B9A\u7FA9\u3057\u3066\u304F\u3060\u3055\u3044\u3002\n   public static void main(String[] args)
+java.launcher.cls.error4=\u30A8\u30E9\u30FC: \u30E1\u30A4\u30F3\u30FB\u30E1\u30BD\u30C3\u30C9\u304C\u30AF\u30E9\u30B9{0}\u3067\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002\u6B21\u306E\u3088\u3046\u306B\u30E1\u30A4\u30F3\u30FB\u30E1\u30BD\u30C3\u30C9\u3092\u5B9A\u7FA9\u3057\u3066\u304F\u3060\u3055\u3044\u3002\n   public static void main(String[] args)
 java.launcher.jar.error1=\u30A8\u30E9\u30FC: \u30D5\u30A1\u30A4\u30EB{0}\u3092\u958B\u3053\u3046\u3068\u3057\u3066\u3044\u308B\u3068\u304D\u306B\u3001\u4E88\u671F\u3057\u306A\u3044\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F
 java.launcher.jar.error2={0}\u306B\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093
 java.launcher.jar.error3={0}\u306B\u30E1\u30A4\u30F3\u30FB\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u5C5E\u6027\u304C\u3042\u308A\u307E\u305B\u3093
+java.launcher.init.error=\u521D\u671F\u5316\u30A8\u30E9\u30FC
--- a/src/share/classes/sun/launcher/resources/launcher_ko.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/launcher/resources/launcher_ko.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -24,7 +24,7 @@
 #
 
 # Translators please note do not translate the options themselves
-java.launcher.opt.header  =   \uC0AC\uC6A9\uBC95: {0} [-options] class [args...]\n\           (\uD074\uB798\uC2A4 \uC2E4\uD589)\n   \uB610\uB294  {0} [-options] -jar jarfile [args...]\n\           (jar \uD30C\uC77C \uC2E4\uD589)\n\uC5EC\uAE30\uC11C options\uB294 \uB2E4\uC74C\uACFC \uAC19\uC2B5\uB2C8\uB2E4.\n
+java.launcher.opt.header  =   \uC0AC\uC6A9\uBC95: {0} [-options] class [args...]\n           (\uD074\uB798\uC2A4 \uC2E4\uD589)\n   \uB610\uB294  {0} [-options] -jar jarfile [args...]\n           (jar \uD30C\uC77C \uC2E4\uD589)\n\uC5EC\uAE30\uC11C options\uB294 \uB2E4\uC74C\uACFC \uAC19\uC2B5\uB2C8\uB2E4.\n
 
 java.launcher.opt.datamodel  =\    -d{0}\t  \uC0AC\uC6A9 \uAC00\uB2A5\uD55C \uACBD\uC6B0 {0}\uBE44\uD2B8 \uB370\uC774\uD130 \uBAA8\uB378\uC744 \uC0AC\uC6A9\uD569\uB2C8\uB2E4.\n
 java.launcher.opt.vmselect   =\    {0}\t  "{1}" VM\uC744 \uC120\uD0DD\uD569\uB2C8\uB2E4.\n
@@ -34,18 +34,19 @@
 java.launcher.ergo.message2  =\                  \uC11C\uBC84\uAE09 \uC2DC\uC2A4\uD15C\uC5D0\uC11C \uC2E4\uD589 \uC911\uC774\uAE30 \uB54C\uBB38\uC785\uB2C8\uB2E4.\n
 
 # Translators please note do not translate the options themselves
-java.launcher.opt.footer     =\    -cp <class search path of directories and zip/jar files>\n\    -classpath <class search path of directories and zip/jar files>\n\                  \uD074\uB798\uC2A4 \uD30C\uC77C\uC744 \uAC80\uC0C9\uD560 {0}(\uC73C)\uB85C \uAD6C\uBD84\uB41C \uB514\uB809\uD1A0\uB9AC,\n\                  JAR \uC544\uCE74\uC774\uBE0C \uBC0F ZIP \uC544\uCE74\uC774\uBE0C \uBAA9\uB85D\uC785\uB2C8\uB2E4.\n\    -D<name>=<value>\n\                  \uC2DC\uC2A4\uD15C \uC18D\uC131\uC744 \uC124\uC815\uD569\uB2C8\uB2E4.\n\    -verbose[:class|gc|jni]\n\                  \uC0C1\uC138 \uC815\uBCF4 \uCD9C\uB825\uC744 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n\    -version      \uC81C\uD488 \uBC84\uC804\uC744 \uC778\uC1C4\uD55C \uD6C4 \uC885\uB8CC\uD569\uB2C8\uB2E4.\n\    -version:<value>\n\                  \uC2E4\uD589\uD560 \uBC84\uC804\uC744 \uC9C0\uC815\uD574\uC57C \uD569\uB2C8\uB2E4.\n\    -showversion  \uC81C\uD488 \uBC84\uC804\uC744 \uC778\uC1C4\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n\    -jre-restrict-search | -no-jre-restrict-search\n\                  \uBC84\uC804 \uAC80\uC0C9\uC5D0\uC11C \uC0AC\uC6A9\uC790 \uC804\uC6A9 JRE\uB97C \uD3EC\uD568/\uC81C\uC678\uD569\uB2C8\uB2E4.\n\    -? -help      \uC774 \uB3C4\uC6C0\uB9D0 \uBA54\uC2DC\uC9C0\uB97C \uC778\uC1C4\uD569\uB2C8\uB2E4.\n\    -X            \uBE44\uD45C\uC900 \uC635\uC158\uC5D0 \uB300\uD55C \uB3C4\uC6C0\uB9D0\uC744 \uC778\uC1C4\uD569\uB2C8\uB2E4.\n\    -ea[:<packagename>...|:<classname>]\n\    -enableassertions[:<packagename>...|:<classname>]\n\                  \uC138\uBD84\uC131\uC774 \uC9C0\uC815\uB41C \uAC80\uC99D\uC744 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n\    -da[:<packagename>...|:<classname>]\n\    -disableassertions[:<packagename>...|:<classname>]\n\                  \uC138\uBD84\uC131\uC774 \uC9C0\uC815\uB41C \uAC80\uC99D\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n\    -esa | -enablesystemassertions\n\                  \uC2DC\uC2A4\uD15C \uAC80\uC99D\uC744 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n\    -dsa | -disablesystemassertions\n\                  \uC2DC\uC2A4\uD15C \uAC80\uC99D\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n\    -agentlib:<libname>[=<options>]\n\                  <libname> \uACE0\uC720 \uC5D0\uC774\uC804\uD2B8 \uB77C\uC774\uBE0C\uB7EC\uB9AC\uB97C \uB85C\uB4DC\uD569\uB2C8\uB2E4(\uC608: -agentlib:hprof).\n\                  -agentlib:jdwp=help \uBC0F -agentlib:hprof=help\uB3C4 \uCC38\uC870\uD558\uC2ED\uC2DC\uC624.\n\    -agentpath:<pathname>[=<options>]\n\                  \uC804\uCCB4 \uACBD\uB85C\uBA85\uC744 \uC0AC\uC6A9\uD558\uC5EC \uACE0\uC720 \uC5D0\uC774\uC804\uD2B8 \uB77C\uC774\uBE0C\uB7EC\uB9AC\uB97C \uB85C\uB4DC\uD569\uB2C8\uB2E4.\n\    -javaagent:<jarpath>[=<options>]\n\                  Java \uD504\uB85C\uADF8\uB798\uBC0D \uC5B8\uC5B4 \uC5D0\uC774\uC804\uD2B8\uB97C \uB85C\uB4DC\uD569\uB2C8\uB2E4. java.lang.instrument\uB97C \uCC38\uC870\uD558\uC2ED\uC2DC\uC624.\n\    -splash:<imagepath>\n\                  \uC774\uBBF8\uC9C0\uAC00 \uC9C0\uC815\uB41C \uC2A4\uD50C\uB798\uC2DC \uD654\uBA74\uC744 \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n\uC790\uC138\uD55C \uB0B4\uC6A9\uC740 http://www.oracle.com/technetwork/java/javase/documentation/index.html\uC744 \uCC38\uC870\uD558\uC2ED\uC2DC\uC624.
+java.launcher.opt.footer     =\    -cp <class search path of directories and zip/jar files>\n\\    -classpath <class search path of directories and zip/jar files>\n\\                  \uD074\uB798\uC2A4 \uD30C\uC77C\uC744 \uAC80\uC0C9\uD560 {0}(\uC73C)\uB85C \uAD6C\uBD84\uB41C \uB514\uB809\uD1A0\uB9AC,\n\\                  JAR \uC544\uCE74\uC774\uBE0C \uBC0F ZIP \uC544\uCE74\uC774\uBE0C \uBAA9\uB85D\uC785\uB2C8\uB2E4.\n\\    -D<name>=<value>\n\\                  \uC2DC\uC2A4\uD15C \uC18D\uC131\uC744 \uC124\uC815\uD569\uB2C8\uB2E4.\n\\    -verbose:[class|gc|jni]\n\\                  \uC0C1\uC138 \uC815\uBCF4 \uCD9C\uB825\uC744 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n\\    -version      \uC81C\uD488 \uBC84\uC804\uC744 \uC778\uC1C4\uD55C \uD6C4 \uC885\uB8CC\uD569\uB2C8\uB2E4.\n\\    -version:<value>\n\\                  \uC2E4\uD589\uD560 \uBC84\uC804\uC744 \uC9C0\uC815\uD574\uC57C \uD569\uB2C8\uB2E4.\n\\    -showversion  \uC81C\uD488 \uBC84\uC804\uC744 \uC778\uC1C4\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n\\    -jre-restrict-search | -no-jre-restrict-search\n\\                  \uBC84\uC804 \uAC80\uC0C9\uC5D0\uC11C \uC0AC\uC6A9\uC790 \uC804\uC6A9 JRE\uB97C \uD3EC\uD568/\uC81C\uC678\uD569\uB2C8\uB2E4.\n\\    -? -help      \uC774 \uB3C4\uC6C0\uB9D0 \uBA54\uC2DC\uC9C0\uB97C \uC778\uC1C4\uD569\uB2C8\uB2E4.\n\\    -X            \uBE44\uD45C\uC900 \uC635\uC158\uC5D0 \uB300\uD55C \uB3C4\uC6C0\uB9D0\uC744 \uC778\uC1C4\uD569\uB2C8\uB2E4.\n\\    -ea[:<packagename>...|:<classname>]\n\\    -enableassertions[:<packagename>...|:<classname>]\n\\                  \uC138\uBD84\uC131\uC774 \uC9C0\uC815\uB41C \uAC80\uC99D\uC744 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n\\    -da[:<packagename>...|:<classname>]\n\\    -disableassertions[:<packagename>...|:<classname>]\n\\                  \uC138\uBD84\uC131\uC774 \uC9C0\uC815\uB41C \uAC80\uC99D\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n\\    -esa | -enablesystemassertions\n\\                  \uC2DC\uC2A4\uD15C \uAC80\uC99D\uC744 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n\\    -dsa | -disablesystemassertions\n\\                  \uC2DC\uC2A4\uD15C \uAC80\uC99D\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n\\    -agentlib:<libname>[=<options>]\n\\                  <libname> \uACE0\uC720 \uC5D0\uC774\uC804\uD2B8 \uB77C\uC774\uBE0C\uB7EC\uB9AC\uB97C \uB85C\uB4DC\uD569\uB2C8\uB2E4(\uC608: -agentlib:hprof).\n\\                  -agentlib:jdwp=help \uBC0F -agentlib:hprof=help\uB3C4 \uCC38\uC870\uD558\uC2ED\uC2DC\uC624.\n\\    -agentpath:<pathname>[=<options>]\n\\                  \uC804\uCCB4 \uACBD\uB85C\uBA85\uC744 \uC0AC\uC6A9\uD558\uC5EC \uACE0\uC720 \uC5D0\uC774\uC804\uD2B8 \uB77C\uC774\uBE0C\uB7EC\uB9AC\uB97C \uB85C\uB4DC\uD569\uB2C8\uB2E4.\n\\    -javaagent:<jarpath>[=<options>]\n\\                  Java \uD504\uB85C\uADF8\uB798\uBC0D \uC5B8\uC5B4 \uC5D0\uC774\uC804\uD2B8\uB97C \uB85C\uB4DC\uD569\uB2C8\uB2E4. java.lang.instrument\uB97C \uCC38\uC870\uD558\uC2ED\uC2DC\uC624.\n\\    -splash:<imagepath>\n\\                  \uC774\uBBF8\uC9C0\uAC00 \uC9C0\uC815\uB41C \uC2A4\uD50C\uB798\uC2DC \uD654\uBA74\uC744 \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n\uC790\uC138\uD55C \uB0B4\uC6A9\uC740 http://www.oracle.com/technetwork/java/javase/documentation/index.html\uC744 \uCC38\uC870\uD558\uC2ED\uC2DC\uC624.
 
 # Translators please note do not translate the options themselves
-java.launcher.X.usage=\    -Xmixed           \uD63C\uD569 \uBAA8\uB4DC\uB97C \uC2E4\uD589\uD569\uB2C8\uB2E4(\uAE30\uBCF8\uAC12).\n\    -Xint             \uD574\uC11D\uB41C \uBAA8\uB4DC\uB9CC \uC2E4\uD589\uD569\uB2C8\uB2E4.\n\    -Xbootclasspath:<directories and zip/jar files separated by {0}>\n\                      \uBD80\uD2B8\uC2A4\uD2B8\uB7A9 \uD074\uB798\uC2A4 \uBC0F \uB9AC\uC18C\uC2A4\uC5D0 \uB300\uD55C \uAC80\uC0C9 \uACBD\uB85C\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n\    -Xbootclasspath/a:<directories and zip/jar files separated by {0}>\n\                      \uBD80\uD2B8\uC2A4\uD2B8\uB7A9 \uD074\uB798\uC2A4 \uACBD\uB85C \uB05D\uC5D0 \uCD94\uAC00\uD569\uB2C8\uB2E4.\n\    -Xbootclasspath/p:<directories and zip/jar files separated by {0}>\n\                      \uBD80\uD2B8\uC2A4\uD2B8\uB7A9 \uD074\uB798\uC2A4 \uACBD\uB85C \uC55E\uC5D0 \uCD94\uAC00\uD569\uB2C8\uB2E4.\n\    -Xdiag            \uCD94\uAC00 \uC9C4\uB2E8 \uBA54\uC2DC\uC9C0\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n\    -Xnoclassgc       \uD074\uB798\uC2A4\uC758 \uBD88\uD544\uC694\uD55C \uC815\uBCF4 \uBAA8\uC74C\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n\    -Xincgc           \uC99D\uBD84\uC801\uC778 \uBD88\uD544\uC694\uD55C \uC815\uBCF4 \uBAA8\uC74C\uC744 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n\    -Xloggc:<file>    \uC2DC\uAC04 \uAE30\uB85D\uACFC \uD568\uAED8 \uD30C\uC77C\uC5D0 GC \uC0C1\uD0DC\uB97C \uAE30\uB85D\uD569\uB2C8\uB2E4.\n\    -Xbatch           \uBC31\uADF8\uB77C\uC6B4\uB4DC \uCEF4\uD30C\uC77C\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n\    -Xms<size>        \uCD08\uAE30 Java \uD799 \uD06C\uAE30\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n\    -Xmx<size>        \uCD5C\uB300 Java \uD799 \uD06C\uAE30\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n\    -Xss<size>        Java \uC2A4\uB808\uB4DC \uC2A4\uD0DD \uD06C\uAE30\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n\    -Xprof            CPU \uD504\uB85C\uD30C\uC77C \uC791\uC131 \uB370\uC774\uD130\uB97C \uCD9C\uB825\uD569\uB2C8\uB2E4.\n\    -Xfuture          \uBBF8\uB798 \uAE30\uBCF8\uAC12\uC744 \uC608\uCE21\uD558\uC5EC \uAC00\uC7A5 \uC5C4\uACA9\uD55C \uAC80\uC0AC\uB97C \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n\    -Xrs              Java/VM\uC5D0 \uC758\uD55C OS \uC2E0\uD638 \uC0AC\uC6A9\uC744 \uC904\uC785\uB2C8\uB2E4(\uC124\uBA85\uC11C \uCC38\uC870).\n\    -Xcheck:jni       JNI \uD568\uC218\uC5D0 \uB300\uD55C \uCD94\uAC00 \uAC80\uC0AC\uB97C \uC218\uD589\uD569\uB2C8\uB2E4.\n\    -Xshare:off       \uACF5\uC720 \uD074\uB798\uC2A4 \uB370\uC774\uD130 \uC0AC\uC6A9\uC744 \uC2DC\uB3C4\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.\n\    -Xshare:auto      \uAC00\uB2A5\uD55C \uACBD\uC6B0 \uACF5\uC720 \uD074\uB798\uC2A4 \uB370\uC774\uD130\uB97C \uC0AC\uC6A9\uD569\uB2C8\uB2E4(\uAE30\uBCF8\uAC12).\n\    -Xshare:on        \uACF5\uC720 \uD074\uB798\uC2A4 \uB370\uC774\uD130\uB97C \uC0AC\uC6A9\uD574\uC57C \uD569\uB2C8\uB2E4. \uADF8\uB807\uC9C0 \uC54A\uC744 \uACBD\uC6B0 \uC2E4\uD328\uD569\uB2C8\uB2E4.\n\    -XshowSettings    \uBAA8\uB4E0 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n\    -XshowSettings:all\n\                      \uBAA8\uB4E0 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n\    -XshowSettings:vm \uBAA8\uB4E0 VM \uAD00\uB828 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n\    -XshowSettings:properties\n\                      \uBAA8\uB4E0 \uC18D\uC131 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n\    -XshowSettings:locale\n\                      \uBAA8\uB4E0 \uB85C\uCF00\uC77C \uAD00\uB828 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n\n-X \uC635\uC158\uC740 \uBE44\uD45C\uC900 \uC635\uC158\uC774\uBBC0\uB85C \uD1B5\uC9C0 \uC5C6\uC774 \uBCC0\uACBD\uB420 \uC218 \uC788\uC2B5\uB2C8\uB2E4.\n
+java.launcher.X.usage=\    -Xmixed           \uD63C\uD569 \uBAA8\uB4DC\uB97C \uC2E4\uD589\uD569\uB2C8\uB2E4(\uAE30\uBCF8\uAC12).\n    -Xint             \uD574\uC11D\uB41C \uBAA8\uB4DC\uB9CC \uC2E4\uD589\uD569\uB2C8\uB2E4.\n    -Xbootclasspath:<directories and zip/jar files separated by {0}>\n                      \uBD80\uD2B8\uC2A4\uD2B8\uB7A9 \uD074\uB798\uC2A4 \uBC0F \uB9AC\uC18C\uC2A4\uC5D0 \uB300\uD55C \uAC80\uC0C9 \uACBD\uB85C\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n    -Xbootclasspath/a:<directories and zip/jar files separated by {0}>\n                      \uBD80\uD2B8\uC2A4\uD2B8\uB7A9 \uD074\uB798\uC2A4 \uACBD\uB85C \uB05D\uC5D0 \uCD94\uAC00\uD569\uB2C8\uB2E4.\n    -Xbootclasspath/p:<directories and zip/jar files separated by {0}>\n                      \uBD80\uD2B8\uC2A4\uD2B8\uB7A9 \uD074\uB798\uC2A4 \uACBD\uB85C \uC55E\uC5D0 \uCD94\uAC00\uD569\uB2C8\uB2E4.\n    -Xdiag            \uCD94\uAC00 \uC9C4\uB2E8 \uBA54\uC2DC\uC9C0\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n    -Xnoclassgc       \uD074\uB798\uC2A4\uC758 \uBD88\uD544\uC694\uD55C \uC815\uBCF4 \uBAA8\uC74C\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n    -Xincgc           \uC99D\uBD84\uC801\uC778 \uBD88\uD544\uC694\uD55C \uC815\uBCF4 \uBAA8\uC74C\uC744 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n    -Xloggc:<file>    \uC2DC\uAC04 \uAE30\uB85D\uACFC \uD568\uAED8 \uD30C\uC77C\uC5D0 GC \uC0C1\uD0DC\uB97C \uAE30\uB85D\uD569\uB2C8\uB2E4.\n    -Xbatch           \uBC31\uADF8\uB77C\uC6B4\uB4DC \uCEF4\uD30C\uC77C\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n    -Xms<size>        \uCD08\uAE30 Java \uD799 \uD06C\uAE30\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n    -Xmx<size>        \uCD5C\uB300 Java \uD799 \uD06C\uAE30\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n    -Xss<size>        Java \uC2A4\uB808\uB4DC \uC2A4\uD0DD \uD06C\uAE30\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n    -Xprof            CPU \uD504\uB85C\uD30C\uC77C \uC791\uC131 \uB370\uC774\uD130\uB97C \uCD9C\uB825\uD569\uB2C8\uB2E4.\n    -Xfuture          \uBBF8\uB798 \uAE30\uBCF8\uAC12\uC744 \uC608\uCE21\uD558\uC5EC \uAC00\uC7A5 \uC5C4\uACA9\uD55C \uAC80\uC0AC\uB97C \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n    -Xrs              Java/VM\uC5D0 \uC758\uD55C OS \uC2E0\uD638 \uC0AC\uC6A9\uC744 \uC904\uC785\uB2C8\uB2E4(\uC124\uBA85\uC11C \uCC38\uC870).\n    -Xcheck:jni       JNI \uD568\uC218\uC5D0 \uB300\uD55C \uCD94\uAC00 \uAC80\uC0AC\uB97C \uC218\uD589\uD569\uB2C8\uB2E4.\n    -Xshare:off       \uACF5\uC720 \uD074\uB798\uC2A4 \uB370\uC774\uD130 \uC0AC\uC6A9\uC744 \uC2DC\uB3C4\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.\n    -Xshare:auto      \uAC00\uB2A5\uD55C \uACBD\uC6B0 \uACF5\uC720 \uD074\uB798\uC2A4 \uB370\uC774\uD130\uB97C \uC0AC\uC6A9\uD569\uB2C8\uB2E4(\uAE30\uBCF8\uAC12).\n    -Xshare:on        \uACF5\uC720 \uD074\uB798\uC2A4 \uB370\uC774\uD130\uB97C \uC0AC\uC6A9\uD574\uC57C \uD569\uB2C8\uB2E4. \uADF8\uB807\uC9C0 \uC54A\uC744 \uACBD\uC6B0 \uC2E4\uD328\uD569\uB2C8\uB2E4.\n    -XshowSettings    \uBAA8\uB4E0 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n    -XshowSettings:all\n                      \uBAA8\uB4E0 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n    -XshowSettings:vm \uBAA8\uB4E0 VM \uAD00\uB828 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n    -XshowSettings:properties\n                      \uBAA8\uB4E0 \uC18D\uC131 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n    -XshowSettings:locale\n                      \uBAA8\uB4E0 \uB85C\uCF00\uC77C \uAD00\uB828 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n\n-X \uC635\uC158\uC740 \uBE44\uD45C\uC900 \uC635\uC158\uC774\uBBC0\uB85C \uD1B5\uC9C0 \uC5C6\uC774 \uBCC0\uACBD\uB420 \uC218 \uC788\uC2B5\uB2C8\uB2E4.\n
 
 # Translators please note do not translate the options themselves
-java.launcher.X.macosx.usage=\n\uB2E4\uC74C\uC740 Mac OS X\uC5D0 \uD2B9\uC815\uB41C \uC635\uC158\uC785\uB2C8\uB2E4.\n\    -XstartOnFirstThread\n\                      \uCCAB\uBC88\uC9F8 (AppKit) \uC2A4\uB808\uB4DC\uC5D0 main() \uBA54\uC18C\uB4DC\uB97C \uC2E4\uD589\uD569\uB2C8\uB2E4.\n\    -Xdock:name=<application name>"\n\                      \uACE0\uC815\uC73C\uB85C \uD45C\uC2DC\uB41C \uAE30\uBCF8 \uC751\uC6A9 \uD504\uB85C\uADF8\uB7A8 \uC774\uB984\uC744 \uBB34\uD6A8\uD654\uD569\uB2C8\uB2E4.\n\    -Xdock:icon=<path to icon file>\n\                      \uACE0\uC815\uC73C\uB85C \uD45C\uC2DC\uB41C \uAE30\uBCF8 \uC544\uC774\uCF58\uC744 \uBB34\uD6A8\uD654\uD569\uB2C8\uB2E4.\n\n
+java.launcher.X.macosx.usage=\n\uB2E4\uC74C\uC740 Mac OS X\uC5D0 \uD2B9\uC815\uB41C \uC635\uC158\uC785\uB2C8\uB2E4.\n    -XstartOnFirstThread\n                      \uCCAB\uBC88\uC9F8 (AppKit) \uC2A4\uB808\uB4DC\uC5D0 main() \uBA54\uC18C\uB4DC\uB97C \uC2E4\uD589\uD569\uB2C8\uB2E4.\n    -Xdock:name=<application name>"\n                      \uACE0\uC815\uC73C\uB85C \uD45C\uC2DC\uB41C \uAE30\uBCF8 \uC751\uC6A9 \uD504\uB85C\uADF8\uB7A8 \uC774\uB984\uC744 \uBB34\uD6A8\uD654\uD569\uB2C8\uB2E4.\n    -Xdock:icon=<path to icon file>\n                      \uACE0\uC815\uC73C\uB85C \uD45C\uC2DC\uB41C \uAE30\uBCF8 \uC544\uC774\uCF58\uC744 \uBB34\uD6A8\uD654\uD569\uB2C8\uB2E4.\n\n
 
 java.launcher.cls.error1=\uC624\uB958: \uAE30\uBCF8 \uD074\uB798\uC2A4 {0}\uC744(\uB97C) \uCC3E\uAC70\uB098 \uB85C\uB4DC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
-java.launcher.cls.error2=\uC624\uB958: {1} \uD074\uB798\uC2A4\uC5D0\uC11C \uAE30\uBCF8 \uBA54\uC18C\uB4DC\uAC00 {0}\uC774(\uAC00) \uC544\uB2D9\uB2C8\uB2E4. \uB2E4\uC74C \uD615\uC2DD\uC73C\uB85C \uAE30\uBCF8 \uBA54\uC18C\uB4DC\uB97C \uC815\uC758\uD558\uC2ED\uC2DC\uC624.\n\   public static void main(String[] args)
-java.launcher.cls.error3=\uC624\uB958: \uAE30\uBCF8 \uBA54\uC18C\uB4DC\uB294 {0} \uD074\uB798\uC2A4\uC5D0\uC11C void \uC720\uD615\uC758 \uAC12\uC744 \uBC18\uD658\uD574\uC57C \uD569\uB2C8\uB2E4. \n\uB2E4\uC74C \uD615\uC2DD\uC73C\uB85C \uAE30\uBCF8 \uBA54\uC18C\uB4DC\uB97C \uC815\uC758\uD558\uC2ED\uC2DC\uC624.\n\   public static void main(String[] args)
-java.launcher.cls.error4=\uC624\uB958: {0} \uD074\uB798\uC2A4\uC5D0\uC11C \uAE30\uBCF8 \uBA54\uC18C\uB4DC\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uB2E4\uC74C \uD615\uC2DD\uC73C\uB85C \uAE30\uBCF8 \uBA54\uC18C\uB4DC\uB97C \uC815\uC758\uD558\uC2ED\uC2DC\uC624.\n\   public static void main(String[] args)
+java.launcher.cls.error2=\uC624\uB958: {1} \uD074\uB798\uC2A4\uC5D0\uC11C \uAE30\uBCF8 \uBA54\uC18C\uB4DC\uAC00 {0}\uC774(\uAC00) \uC544\uB2D9\uB2C8\uB2E4. \uB2E4\uC74C \uD615\uC2DD\uC73C\uB85C \uAE30\uBCF8 \uBA54\uC18C\uB4DC\uB97C \uC815\uC758\uD558\uC2ED\uC2DC\uC624.\n   public static void main(String[] args)
+java.launcher.cls.error3=\uC624\uB958: \uAE30\uBCF8 \uBA54\uC18C\uB4DC\uB294 {0} \uD074\uB798\uC2A4\uC5D0\uC11C void \uC720\uD615\uC758 \uAC12\uC744 \uBC18\uD658\uD574\uC57C \uD569\uB2C8\uB2E4. \n\uB2E4\uC74C \uD615\uC2DD\uC73C\uB85C \uAE30\uBCF8 \uBA54\uC18C\uB4DC\uB97C \uC815\uC758\uD558\uC2ED\uC2DC\uC624.\n   public static void main(String[] args)
+java.launcher.cls.error4=\uC624\uB958: {0} \uD074\uB798\uC2A4\uC5D0\uC11C \uAE30\uBCF8 \uBA54\uC18C\uB4DC\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uB2E4\uC74C \uD615\uC2DD\uC73C\uB85C \uAE30\uBCF8 \uBA54\uC18C\uB4DC\uB97C \uC815\uC758\uD558\uC2ED\uC2DC\uC624.\n   public static void main(String[] args)
 java.launcher.jar.error1=\uC624\uB958: {0} \uD30C\uC77C\uC744 \uC5F4\uB824\uACE0 \uC2DC\uB3C4\uD558\uB294 \uC911 \uC608\uC0C1\uCE58 \uC54A\uC740 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4.
 java.launcher.jar.error2={0}\uC5D0\uC11C Manifest\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
 java.launcher.jar.error3={0}\uC5D0 \uAE30\uBCF8 Manifest \uC18D\uC131\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.
+java.launcher.init.error=\uCD08\uAE30\uD654 \uC624\uB958
--- a/src/share/classes/sun/launcher/resources/launcher_pt_BR.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/launcher/resources/launcher_pt_BR.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -24,7 +24,7 @@
 #
 
 # Translators please note do not translate the options themselves
-java.launcher.opt.header  =   Uso: {0} [-options] class [args...]\n\           (para executar uma classe)\n   ou  {0} [-options] -jar jarfile [args...]\n\           (para executar um arquivo jar)\nem que as op\u00E7\u00F5es incluem:\n
+java.launcher.opt.header  =   Uso: {0} [-options] class [args...]\n           (para executar uma classe)\n   ou  {0} [-options] -jar jarfile [args...]\n           (para executar um arquivo jar)\nem que as op\u00E7\u00F5es incluem:\n
 
 java.launcher.opt.datamodel  =\    -d{0}\t  usar um modelo de dados de {0} bits, se estiver dispon\u00EDvel\n
 java.launcher.opt.vmselect   =\    {0}\t  para selecionar a VM "{1}"\n
@@ -34,18 +34,19 @@
 java.launcher.ergo.message2  =\                  porque a execu\u00E7\u00E3o est\u00E1 sendo feita em uma m\u00E1quina de classe de servidor.\n
 
 # Translators please note do not translate the options themselves
-java.launcher.opt.footer     =\    -cp <caminho de pesquisa da classe dos diret\u00F3rios e arquivos zip/jar>\n\    -classpath <caminho de pesquisa da classe dos diret\u00F3rios e arquivos zip/jar>\n\                 Uma lista separada por {0} de diret\u00F3rios, archives JAR\n\                  e archives ZIP nos quais ser\u00E3o procurados os arquivos de classe.\n\    -D<nome>=<valor>\n\                  define uma propriedade do sistema\n\    -verbose[:class|gc|jni]\n\                  ativa a sa\u00EDda detalhada\n\    -version      imprime a vers\u00E3o do produto e sai do programa\n\    -version:<valor>\n\                  requer a execu\u00E7\u00E3o da vers\u00E3o especificada\n\    -showversion  imprime a vers\u00E3o do produto e continua\n\    -jre-restrict-search | -no-jre-restrict-search\n\                  inclui/exclui JREs privados do usu\u00E1rio na pesquisa de vers\u00E3o\n\    -? -help      imprime esta mensagem de ajuda\n\    -X            imprime a ajuda sobre op\u00E7\u00F5es n\u00E3o padronizadas\n\    -ea[:<nome do pacote>...|:<nome da classe>]\n\    -enableassertions[:<nome do pacote>...|:<nome da classe>]\n\                  ativa asser\u00E7\u00F5es com granularidade especificada\n\    -da[:<nome do pacote>...|:<nome da classe>]\n\    -disableassertions[:<nome do pacote>...|:<nome da classe>]\n\                  desativa asser\u00E7\u00F5es com granularidade especificada\n\    -esa | -enablesystemassertions\n\                  ativa asser\u00E7\u00F5es do sistema\n\    -dsa | -disablesystemassertions\n\                  desativa asser\u00E7\u00F5es do sistema\n\    -agentlib:<nome da biblioteca>[=<op\u00E7\u00F5est>]\n\                  carrega a biblioteca de agentes nativa <nome da biblioteca>, e.g. -agentlib:hprof\n\                  consulte tamb\u00E9m, -agentlib:jdwp=help and -agentlib:hprof=help\n\    -agentpath:<nome do caminho>[=<op\u00E7\u00F5es>]\n\                  carrega a biblioteca de agentes nativa com base no nome do caminho completo\n\    -javaagent:<caminho do arquivo jar>[=<op\u00E7\u00F5es>]\n\                  carrega o agente da linguagem de programa\u00E7\u00E3o Java; consulte java.lang.instrument\n\    -splash:<caminho da imagem>\n\                  mostra a tela de abertura com a imagem especificada\nConsulte http://www.oracle.com/technetwork/java/javase/documentation/index.html para ver mais detalhes.
+java.launcher.opt.footer     =\    -cp <caminho de pesquisa da classe dos diret\u00F3rios e arquivos zip/jar>\n    -classpath <caminho de pesquisa da classe dos diret\u00F3rios e arquivos zip/jar>\n                  Uma lista separada por {0} de diret\u00F3rios, archives JAR\n                  e archives ZIP nos quais ser\u00E3o procurados os arquivos de classe.\n    -D<nome>=<valor>\n                  define uma propriedade do sistema\n    -verbose[:classe|gc|jni]\n                  ativa a sa\u00EDda detalhada\n    -version      imprime a vers\u00E3o do produto e sai do programa\n    -version:<valor>\n                  requer a execu\u00E7\u00E3o da vers\u00E3o especificada\n    -showversion  imprime a vers\u00E3o do produto e continua\n    -jre-restrict-search | -no-jre-restrict-search\n                  inclui/exclui JREs privados do usu\u00E1rio na pesquisa de vers\u00E3o\n    -? -help      imprime esta mensagem de ajuda\n    -X            imprime a ajuda sobre op\u00E7\u00F5es n\u00E3o padronizadas\n    -ea[:<nome do pacote>...|:<nome da classe>]\n    -enableassertions[:<nome do pacote>...|:<nome da classe>]\n                  ativa asser\u00E7\u00F5es com granularidade especificada\n    -da[:<nome do pacote>...|:<nome da classe>]\n    -disableassertions[:<nome do pacote>...|:<nome da classe>]\n                  desativa asser\u00E7\u00F5es com granularidade especificada\n    -esa | -enablesystemassertions\n                  ativa asser\u00E7\u00F5es do sistema\n    -dsa | -disablesystemassertions\n                  desativa asser\u00E7\u00F5es do sistema\n    -agentlib:<nome da biblioteca>[=<op\u00E7\u00F5es>]\n                  carrega a biblioteca de agentes nativa <nome da biblioteca>, por exemplo: -agentlib:hprof\n                  consulte tamb\u00E9m: -agentlib:jdwp=help e -agentlib:hprof=help\n    -agentpath:<nome do caminho>[=<op\u00E7\u00F5es>]\n                  carrega a biblioteca de agentes nativa com base no nome do caminho completo\n    -javaagent:<caminho do arquivo jar>[=<op\u00E7\u00F5es>]\n                  carrega o agente da linguagem de programa\u00E7\u00E3o Java; consulte java.lang.instrument\n    -splash:<caminho da imagem>\n                  mostra a tela de abertura com a imagem especificada\nConsulte http://www.oracle.com/technetwork/java/javase/documentation/index.html para obter mais detalhes.
 
 # Translators please note do not translate the options themselves
-java.launcher.X.usage=\    -Xmixed           execu\u00E7\u00E3o no modo misto (default)\n\    -Xint             execu\u00E7\u00E3o somente no modo interpretado\n\    -Xbootclasspath:<diret\u00F3rios e arquivos zip/jar separados por {0}>\n\                      define o caminho de pesquisa para classes e recursos de inicializa\u00E7\u00E3o\n\    -Xbootclasspath/a:<diret\u00F3rios e arquivos zip/jar separados por {0}>\n\                      anexa no final do caminho da classe de inicializa\u00E7\u00E3o\n\    -Xbootclasspath/p:<diret\u00F3rios e arquivos zip/jar separados por {0}>\n\                      anexa no in\u00EDcio do caminho da classe de inicializa\u00E7\u00E3o\n\    -Xdiag            mostra mensagens de diagn\u00F3stico adicionais\n\    -Xnoclassgc       desativa a coleta de lixo da classe\n\    -Xincgc           ativa a coleta de lixo incremental\n\    -Xloggc:<arquivo>    registra o status do GC status em um arquivo com marca\u00E7\u00F5es de data e hor\u00E1rio\n\    -Xbatch           desativa a compila\u00E7\u00E3o em segundo plano\n\    -Xms<tamanho>        define o tamanho inicial do heap Java\n\    -Xmx<tamanho>        define o tamanho m\u00E1ximo do heap Java\n\    -Xss<tamanho>        define o tamanho da pilha de threads java\n\    -Xprof            produz dados de perfil da cpu\n\    -Xfuture          ativa verifica\u00E7\u00F5es de n\u00EDvel m\u00E1ximo de exig\u00EAncia, prevendo o valor default futuro\n\    -Xrs              reduz o uso de sinais do SO pelo(a) Java/VM (consulte a documenta\u00E7\u00E3o)\n\    -Xcheck:jni       executa verifica\u00E7\u00F5es adicionais de fun\u00E7\u00F5es da JNI\n\    -Xshare:off       n\u00E3o tenta usar dados da classe compartilhada\n\    -Xshare:auto      se poss\u00EDvel, usa dados da classe compartilhada (default)\n\    -Xshare:on        requer o uso de dados da classe compartilhada, caso contr\u00E1rio haver\u00E1 falha.\n\    -XshowSettings    mostra todas as defini\u00E7\u00F5es e continua\n\    -XshowSettings:all\n\                      mostra todas as defini\u00E7\u00F5es e continua\n\    -XshowSettings:vm mostra todas as defini\u00E7\u00F5es relacionadas \u00E0 vm e continua\n\    -XshowSettings:properties\n\                      mostra todas as defini\u00E7\u00F5es da propriedade e continua\n\    -XshowSettings:locale\n\                      mostra todas as defini\u00E7\u00F5es relativas \u00E0s configura\u00E7\u00F5es regionais e continua\n\nAs -X options n\u00E3o s\u00E3o padronizadas e est\u00E3o sujeitas a altera\u00E7\u00F5es sem aviso.\n
+java.launcher.X.usage=\    -Xmixed           execu\u00E7\u00E3o no modo misto (default)\n    -Xint             execu\u00E7\u00E3o somente no modo interpretado\n    -Xbootclasspath:<diret\u00F3rios e arquivos zip/jar separados por {0}>\n                      define o caminho de pesquisa para classes e recursos de inicializa\u00E7\u00E3o\n    -Xbootclasspath/a:<diret\u00F3rios e arquivos zip/jar separados por {0}>\n                      anexa no final do caminho da classe de inicializa\u00E7\u00E3o\n    -Xbootclasspath/p:<diret\u00F3rios e arquivos zip/jar separados por {0}>\n                      anexa no in\u00EDcio do caminho da classe de inicializa\u00E7\u00E3o\n    -Xdiag            mostra mensagens de diagn\u00F3stico adicionais\n    -Xnoclassgc       desativa a coleta de lixo da classe\n    -Xincgc           ativa a coleta de lixo incremental\n    -Xloggc:<arquivo>    registra o status do GC status em um arquivo com marca\u00E7\u00F5es de data e hor\u00E1rio\n    -Xbatch           desativa a compila\u00E7\u00E3o em segundo plano\n    -Xms<tamanho>        define o tamanho inicial do heap Java\n    -Xmx<tamanho>        define o tamanho m\u00E1ximo do heap Java\n    -Xss<tamanho>        define o tamanho da pilha de threads java\n    -Xprof            produz dados de perfil da cpu\n    -Xfuture          ativa verifica\u00E7\u00F5es de n\u00EDvel m\u00E1ximo de exig\u00EAncia, prevendo o valor default futuro\n    -Xrs              reduz o uso de sinais do SO pelo(a) Java/VM (consulte a documenta\u00E7\u00E3o)\n    -Xcheck:jni       executa verifica\u00E7\u00F5es adicionais de fun\u00E7\u00F5es da JNI\n    -Xshare:off       n\u00E3o tenta usar dados da classe compartilhada\n    -Xshare:auto      se poss\u00EDvel, usa dados da classe compartilhada (default)\n    -Xshare:on        requer o uso de dados da classe compartilhada, caso contr\u00E1rio haver\u00E1 falha.\n    -XshowSettings    mostra todas as defini\u00E7\u00F5es e continua\n    -XshowSettings:all\n                      mostra todas as defini\u00E7\u00F5es e continua\n    -XshowSettings:vm mostra todas as defini\u00E7\u00F5es relacionadas \u00E0 vm e continua\n    -XshowSettings:properties\n                      mostra todas as defini\u00E7\u00F5es da propriedade e continua\n    -XshowSettings:locale\n                      mostra todas as defini\u00E7\u00F5es relativas \u00E0s configura\u00E7\u00F5es regionais e continua\n\nAs -X options n\u00E3o s\u00E3o padronizadas e est\u00E3o sujeitas a altera\u00E7\u00F5es sem aviso.\n
 
 # Translators please note do not translate the options themselves
-java.launcher.X.macosx.usage=\nAs op\u00E7\u00F5es a seguir s\u00E3o espec\u00EDficas para o Mac OS X:\n\    -XstartOnFirstThread\n\                      executa o m\u00E9todo main() no primeiro thread (AppKit)\n\    -Xdock:name=<nome da aplica\u00E7\u00E3o>"\n\                      substitui o nome da aplica\u00E7\u00E3o default exibido no encaixe\n\    -Xdock:icon=<caminho para o arquivo do \u00EDcone>\n\                      substitui o \u00EDcone exibido no encaixe\n\n
+java.launcher.X.macosx.usage=\nAs op\u00E7\u00F5es a seguir s\u00E3o espec\u00EDficas para o Mac OS X:\n    -XstartOnFirstThread\n                      executa o m\u00E9todo main() no primeiro thread (AppKit)\n    -Xdock:name=<nome da aplica\u00E7\u00E3o>"\n                      substitui o nome da aplica\u00E7\u00E3o default exibido no encaixe\n    -Xdock:icon=<caminho para o arquivo do \u00EDcone>\n                      substitui o \u00EDcone exibido no encaixe\n\n
 
 java.launcher.cls.error1=Erro: N\u00E3o foi poss\u00EDvel localizar nem carregar a classe principal {0}
-java.launcher.cls.error2=Erro: O m\u00E9todo principal n\u00E3o \u00E9 {0} na classe {1}; defina o m\u00E9todo principal como:\n\   public static void main(String[] args)
-java.launcher.cls.error3=Erro: O m\u00E9todo principal deve retornar um valor do tipo void na classe {0}; \ndefina o m\u00E9todo principal como:\n\   public static void main(String[] args)
-java.launcher.cls.error4=Erro: O m\u00E9todo principal n\u00E3o foi encontrado na classe {0}; defina o m\u00E9todo principal como:\n\   public static void main(String[] args)
+java.launcher.cls.error2=Erro: O m\u00E9todo principal n\u00E3o \u00E9 {0} na classe {1}; defina o m\u00E9todo principal como:\n   public static void main(String[] args)
+java.launcher.cls.error3=Erro: O m\u00E9todo principal deve retornar um valor do tipo void na classe {0}; \ndefina o m\u00E9todo principal como:\n   public static void main(String[] args)
+java.launcher.cls.error4=Erro: O m\u00E9todo principal n\u00E3o foi encontrado na classe {0}; defina o m\u00E9todo principal como:\n   public static void main(String[] args)
 java.launcher.jar.error1=Erro: ocorreu um erro inesperado ao tentar abrir o arquivo {0}
 java.launcher.jar.error2=manifesto n\u00E3o encontrado em {0}
 java.launcher.jar.error3=nenhum atributo de manifesto principal em {0}
+java.launcher.init.error=erro de inicializa\u00E7\u00E3o
--- a/src/share/classes/sun/launcher/resources/launcher_sv.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/launcher/resources/launcher_sv.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -24,7 +24,7 @@
 #
 
 # Translators please note do not translate the options themselves
-java.launcher.opt.header  =   Syntax: {0} [-alternativ] class [argument...]\n\           (f\u00F6r att k\u00F6ra en klass)\n   eller  {0} [-alternativ] -jar jarfile [argument...]\n\           (f\u00F6r att k\u00F6ra en jar-fil)\nd\u00E4r alternativen omfattar:\n
+java.launcher.opt.header  =   Syntax: {0} [-alternativ] class [argument...]\n           (f\u00F6r att k\u00F6ra en klass)\n   eller  {0} [-alternativ] -jar jarfile [argument...]\n           (f\u00F6r att k\u00F6ra en jar-fil)\nd\u00E4r alternativen omfattar:\n
 
 java.launcher.opt.datamodel  =\    -d{0}\t  anv\u00E4nd en {0}-bitsdatamodell om det finns\n
 java.launcher.opt.vmselect   =\    {0}\t  f\u00F6r att v\u00E4lja "{1}" VM\n
@@ -34,18 +34,19 @@
 java.launcher.ergo.message2  =\                  eftersom du k\u00F6r en serverklassmaskin.\n
 
 # Translators please note do not translate the options themselves
-java.launcher.opt.footer     =\    -cp <klass\u00F6kv\u00E4g f\u00F6r kataloger och zip-/jar-filer>\n\    -classpath <klass\u00F6kv\u00E4g f\u00F6r kataloger och zip-/jar-filer>\n\                  En {0}-separerad lista med kataloger, JAR-arkiv,\n\                  och ZIP-arkiv f\u00F6r s\u00F6kning efter klassfiler.\n\    -D<name>=<value>\n\                  ange en systemegenskap\n\    -verbose[:class|gc|jni]\n\                  aktivera utf\u00F6rliga utdata\n\    -version      skriv ut produktversionen och avsluta\n\    -version:<value>\n\                  beg\u00E4r den specifika versionen som ska k\u00F6ras\n\    -showversion  skriv ut produktversionen och forts\u00E4tt\n\    -jre-restrict-search | -no-jre-restrict-search\n\                  inkludera/exkludera anv\u00E4ndarprivata JRE:er i versions\u00F6kningen\n\    -? -help      skriv ut det h\u00E4r hj\u00E4lpmeddelandet\n\    -X            skriv ut hj\u00E4lp f\u00F6r icke-standardalternativ\n\    -ea[:<packagename>...|:<classname>]\n\    -enableassertions[:<packagename>...|:<classname>]\n\                  aktivera verifiering med angiven detaljgrad\n\    -da[:<packagename>...|:<classname>]\n\    -disableassertions[:<packagename>...|:<classname>]\n\                  avaktivera verifiering med angiven detaljgrad\n\    -esa | -enablesystemassertions\n\                  aktivera systemverifieringar\n\    -dsa | -disablesystemassertions\n\                  avaktivera systemverifieringar\n\    -agentlib:<libname>[=<options>]\n\                  ladda ursprungligt agentbibliotek <libname>, e.g. -agentlib:hprof\n\                  se \u00E4ven -agentlib:jdwp=help och -agentlib:hprof=help\n\    -agentpath:<pathname>[=<options>]\n\                  ladda ursprungligt agentbibliotek med helt s\u00F6kv\u00E4gsnamn\n\    -javaagent:<jarpath>[=<options>]\n\                  ladda Java-programspr\u00E5ksagent, se java.lang.instrument\n\    -splash:<imagepath>\n\                  visa v\u00E4lkomstsk\u00E4rm med angiven bild\nMer information finns p\u00E5 http://www.oracle.com/technetwork/java/javase/documentation/index.html.
+java.launcher.opt.footer     =\    -cp <klass\u00F6kv\u00E4g f\u00F6r kataloger och zip-/jar-filer>\n    -classpath <klass\u00F6kv\u00E4g f\u00F6r kataloger och zip-/jar-filer>\n                  En {0}-separerad lista med kataloger, JAR-arkiv,\n                  och ZIP-arkiv f\u00F6r s\u00F6kning efter klassfiler.\n    -D<name>=<value>\n                  ange en systemegenskap\n    -verbose:[class|gc|jni]\n                  aktivera utf\u00F6rliga utdata\n    -version      skriv ut produktversionen och avsluta\n    -version:<value>\n                  beg\u00E4r den specifika versionen som ska k\u00F6ras\n    -showversion  skriv ut produktversionen och forts\u00E4tt\n    -jre-restrict-search | -no-jre-restrict-search\n                  inkludera/exkludera anv\u00E4ndarprivata JRE:er i versions\u00F6kningen\n    -? -help      skriv ut det h\u00E4r hj\u00E4lpmeddelandet\n    -X            skriv ut hj\u00E4lp f\u00F6r icke-standardalternativ\n    -ea[:<packagename>...|:<classname>]\n    -enableassertions[:<packagename>...|:<classname>]\n                  aktivera verifiering med angiven detaljgrad\n    -da[:<packagename>...|:<classname>]\n    -disableassertions[:<packagename>...|:<classname>]\n                  avaktivera verifiering med angiven detaljgrad\n    -esa | -enablesystemassertions\n                  aktivera systemverifieringar\n    -dsa | -disablesystemassertions\n                  avaktivera systemverifieringar\n    -agentlib:<libname>[=<options>]\n                  ladda ursprungligt agentbibliotek <libname>, e.g. -agentlib:hprof\n                  se \u00E4ven -agentlib:jdwp=help och -agentlib:hprof=help\n    -agentpath:<pathname>[=<options>]\n                  ladda ursprungligt agentbibliotek med helt s\u00F6kv\u00E4gsnamn\n    -javaagent:<jarpath>[=<options>]\n                  ladda Java-programspr\u00E5ksagent, se java.lang.instrument\n    -splash:<imagepath>\n                  visa v\u00E4lkomstsk\u00E4rm med angiven bild\nMer information finns p\u00E5 http://www.oracle.com/technetwork/java/javase/documentation/index.html.
 
 # Translators please note do not translate the options themselves
-java.launcher.X.usage=\    -Xmixed           k\u00F6rning i blandat l\u00E4ge (standard)\n\    -Xint             endast k\u00F6rning i tolkat l\u00E4ge\n\    -Xbootclasspath:<kataloger och zip-/jar-filer avgr\u00E4nsas med {0}>\n\                      ange s\u00F6kv\u00E4g f\u00F6r programladdningsklasser och -resurser\n\    -Xbootclasspath/a:<kataloger och zip-/jar-filer avgr\u00E4nsas med {0}>\n\                      l\u00E4gg till i slutet av programladdningsklassens s\u00F6kv\u00E4g\n\    -Xbootclasspath/p:<kataloger och zip-/jar-filer avgr\u00E4nsas med {0}>\n\                      l\u00E4gg till i b\u00F6rjan av programladdningsklassens s\u00F6kv\u00E4g\n\    -Xdiag            visa ytterligare diagnostiska meddelanden\n\    -Xnoclassgc       avaktivera klassens skr\u00E4pinsamling\n\    -Xincgc           aktivera inkrementell skr\u00E4pinsamling\n\    -Xloggc:<fil>    logga GC-status till en fil med tidsst\u00E4mplar\n\    -Xbatch           avaktivera bakgrundskompilering\n\    -Xms<storlek>        ange ursprunglig storlek f\u00F6r Java-heap\n\    -Xmx<storlek>        ange maximal storlek f\u00F6r Java-heap\n\    -Xss<storlek>        ange storlek f\u00F6r java-tr\u00E5dsstack\n\    -Xprof            utdata f\u00F6r processorprofilering\n\    -Xfuture          aktivera str\u00E4ngaste kontroller, f\u00F6rv\u00E4ntad framtida standard\n\    -Xrs              minska OS-signalanv\u00E4ndning av Java/VM (se dokumentation)\n\    -Xcheck:jni       utf\u00F6r ytterligare kontroller f\u00F6r JNI-funktioner\n\    -Xshare:off       anv\u00E4nd inte delade klassdata\n\    -Xshare:auto      anv\u00E4nd delade klassdata om det g\u00E5r (standard)\n\    -Xshare:on        kr\u00E4v att delade klassdata anv\u00E4nds, annars slutf\u00F6r inte.\n\    -XshowSettings    visa alla inst\u00E4llningar och forts\u00E4tt\n\    -XshowSettings:all\n\                      visa alla inst\u00E4llningar och forts\u00E4tt\n\    -XshowSettings:vm visa alla vm-relaterade inst\u00E4llningar och forts\u00E4tt\n\    -XshowSettings:properties\n\                      visa alla egenskapsinst\u00E4llningar och forts\u00E4tt\n\    -XshowSettings:locale\n\                      visa alla spr\u00E5krelaterade inst\u00E4llningar och forts\u00E4tt\n\n-X-alternativen \u00E4r inte standard och kan \u00E4ndras utan f\u00F6reg\u00E5ende meddelande.\n
+java.launcher.X.usage=\    -Xmixed           k\u00F6rning i blandat l\u00E4ge (standard)\n    -Xint             endast k\u00F6rning i tolkat l\u00E4ge\n    -Xbootclasspath:<kataloger och zip-/jar-filer avgr\u00E4nsas med {0}>\n                      ange s\u00F6kv\u00E4g f\u00F6r programladdningsklasser och -resurser\n    -Xbootclasspath/a:<kataloger och zip-/jar-filer avgr\u00E4nsas med {0}>\n                      l\u00E4gg till i slutet av programladdningsklassens s\u00F6kv\u00E4g\n    -Xbootclasspath/p:<kataloger och zip-/jar-filer avgr\u00E4nsas med {0}>\n                      l\u00E4gg till i b\u00F6rjan av programladdningsklassens s\u00F6kv\u00E4g\n    -Xdiag            visa ytterligare diagnostiska meddelanden\n    -Xnoclassgc       avaktivera klassens skr\u00E4pinsamling\n    -Xincgc           aktivera inkrementell skr\u00E4pinsamling\n    -Xloggc:<fil>    logga GC-status till en fil med tidsst\u00E4mplar\n    -Xbatch           avaktivera bakgrundskompilering\n    -Xms<storlek>        ange ursprunglig storlek f\u00F6r Java-heap\n    -Xmx<storlek>        ange maximal storlek f\u00F6r Java-heap\n    -Xss<storlek>        ange storlek f\u00F6r java-tr\u00E5dsstack\n    -Xprof            utdata f\u00F6r processorprofilering\n    -Xfuture          aktivera str\u00E4ngaste kontroller, f\u00F6rv\u00E4ntad framtida standard\n    -Xrs              minska OS-signalanv\u00E4ndning av Java/VM (se dokumentation)\n    -Xcheck:jni       utf\u00F6r ytterligare kontroller f\u00F6r JNI-funktioner\n    -Xshare:off       anv\u00E4nd inte delade klassdata\n    -Xshare:auto      anv\u00E4nd delade klassdata om det g\u00E5r (standard)\n    -Xshare:on        kr\u00E4v att delade klassdata anv\u00E4nds, annars slutf\u00F6r inte.\n    -XshowSettings    visa alla inst\u00E4llningar och forts\u00E4tt\n    -XshowSettings:all\n                      visa alla inst\u00E4llningar och forts\u00E4tt\n    -XshowSettings:vm visa alla vm-relaterade inst\u00E4llningar och forts\u00E4tt\n    -XshowSettings:properties\n                      visa alla egenskapsinst\u00E4llningar och forts\u00E4tt\n    -XshowSettings:locale\n                      visa alla spr\u00E5krelaterade inst\u00E4llningar och forts\u00E4tt\n\n-X-alternativen \u00E4r inte standard och kan \u00E4ndras utan f\u00F6reg\u00E5ende meddelande.\n
 
 # Translators please note do not translate the options themselves
-java.launcher.X.macosx.usage=\nF\u00F6ljande alternativ \u00E4r specifika f\u00F6r Mac OS X:\n\    -XstartOnFirstThread\n\                      k\u00F6r huvudmetoden() p\u00E5 den f\u00F6rsta (AppKit) tr\u00E5den\n\    -Xdock:name=<application name>"\n\                      \u00E5sidosatt standardapplikationsnamn visas i docka\n\    -Xdock:icon=<path to icon file>\n\                      \u00E5sidosatt standardikon visas i docka\n\n
+java.launcher.X.macosx.usage=\nF\u00F6ljande alternativ \u00E4r specifika f\u00F6r Mac OS X:\n    -XstartOnFirstThread\n                      k\u00F6r huvudmetoden() p\u00E5 den f\u00F6rsta (AppKit) tr\u00E5den\n    -Xdock:name=<application name>"\n                      \u00E5sidosatt standardapplikationsnamn visas i docka\n    -Xdock:icon=<path to icon file>\n                      \u00E5sidosatt standardikon visas i docka\n\n
 
 java.launcher.cls.error1=Fel: Hittar inte eller kan inte ladda huvudklassen {0}
-java.launcher.cls.error2=Fel: Huvudmetoden \u00E4r inte {0} i klassen {1}, definiera huvudmetoden som:\n\   public static void main(String[] args)
-java.launcher.cls.error3=Fel: Huvudmetoden m\u00E5ste returnera ett v\u00E4rde av typen void i klassen {0}, \ndefiniera huvudmetoden som:\n\   public static void main(String[] args)
-java.launcher.cls.error4=Fel: Huvudmetoden finns inte i klassen {0}, definiera huvudmetoden som:\n\   public static void main(String[] args)
+java.launcher.cls.error2=Fel: Huvudmetoden \u00E4r inte {0} i klassen {1}, definiera huvudmetoden som:\n   public static void main(String[] args)
+java.launcher.cls.error3=Fel: Huvudmetoden m\u00E5ste returnera ett v\u00E4rde av typen void i klassen {0}, \ndefiniera huvudmetoden som:\n   public static void main(String[] args)
+java.launcher.cls.error4=Fel: Huvudmetoden finns inte i klassen {0}, definiera huvudmetoden som:\n   public static void main(String[] args)
 java.launcher.jar.error1=Fel: Ett ov\u00E4ntat fel intr\u00E4ffade n\u00E4r filen {0} skulle \u00F6ppnas
 java.launcher.jar.error2=manifest finns inte i {0}
 java.launcher.jar.error3=inget huvudmanifestattribut i {0}
+java.launcher.init.error=initieringsfel
--- a/src/share/classes/sun/launcher/resources/launcher_zh_CN.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/launcher/resources/launcher_zh_CN.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -24,7 +24,7 @@
 #
 
 # Translators please note do not translate the options themselves
-java.launcher.opt.header  =   \u7528\u6CD5: {0} [-options] class [args...]\n\           (\u6267\u884C\u7C7B)\n   \u6216  {0} [-options] -jar jarfile [args...]\n\           (\u6267\u884C jar \u6587\u4EF6)\n\u5176\u4E2D\u9009\u9879\u5305\u62EC:\n
+java.launcher.opt.header  =   \u7528\u6CD5: {0} [-options] class [args...]\n           (\u6267\u884C\u7C7B)\n   \u6216  {0} [-options] -jar jarfile [args...]\n           (\u6267\u884C jar \u6587\u4EF6)\n\u5176\u4E2D\u9009\u9879\u5305\u62EC:\n
 
 java.launcher.opt.datamodel  =\    -d{0}\t  \u4F7F\u7528 {0} \u4F4D\u6570\u636E\u6A21\u578B (\u5982\u679C\u53EF\u7528)\n
 java.launcher.opt.vmselect   =\    {0}\t  \u9009\u62E9 "{1}" VM\n
@@ -34,18 +34,19 @@
 java.launcher.ergo.message2  =\                  \u56E0\u4E3A\u60A8\u662F\u5728\u670D\u52A1\u5668\u7C7B\u8BA1\u7B97\u673A\u4E0A\u8FD0\u884C\u3002\n
 
 # Translators please note do not translate the options themselves
-java.launcher.opt.footer     =\    -cp <\u76EE\u5F55\u548C zip/jar \u6587\u4EF6\u7684\u7C7B\u641C\u7D22\u8DEF\u5F84>\n\    -classpath <\u76EE\u5F55\u548C zip/jar \u6587\u4EF6\u7684\u7C7B\u641C\u7D22\u8DEF\u5F84>\n\                  \u7528 {0} \u5206\u9694\u7684\u76EE\u5F55, JAR \u6863\u6848\n\                  \u548C ZIP \u6863\u6848\u5217\u8868, \u7528\u4E8E\u641C\u7D22\u7C7B\u6587\u4EF6\u3002\n\    -D<name>=<value>\n\                  \u8BBE\u7F6E\u7CFB\u7EDF\u5C5E\u6027\n\    -verbose[:class|gc|jni]\n\                  \u542F\u7528\u8BE6\u7EC6\u8F93\u51FA\n\    -version      \u8F93\u51FA\u4EA7\u54C1\u7248\u672C\u5E76\u9000\u51FA\n\    -version:<value>\n\                  \u9700\u8981\u6307\u5B9A\u7684\u7248\u672C\u624D\u80FD\u8FD0\u884C\n\    -showversion  \u8F93\u51FA\u4EA7\u54C1\u7248\u672C\u5E76\u7EE7\u7EED\n\    -jre-restrict-search | -no-jre-restrict-search\n\                  \u5728\u7248\u672C\u641C\u7D22\u4E2D\u5305\u62EC/\u6392\u9664\u7528\u6237\u4E13\u7528 JRE\n\    -? -help      \u8F93\u51FA\u6B64\u5E2E\u52A9\u6D88\u606F\n\    -X            \u8F93\u51FA\u975E\u6807\u51C6\u9009\u9879\u7684\u5E2E\u52A9\n\    -ea[:<packagename>...|:<classname>]\n\    -enableassertions[:<packagename>...|:<classname>]\n\                  \u6309\u6307\u5B9A\u7684\u7C92\u5EA6\u542F\u7528\u65AD\u8A00\n\    -da[:<packagename>...|:<classname>]\n\    -disableassertions[:<packagename>...|:<classname>]\n\                  \u7981\u7528\u5177\u6709\u6307\u5B9A\u7C92\u5EA6\u7684\u65AD\u8A00\n\    -esa | -enablesystemassertions\n\                  \u542F\u7528\u7CFB\u7EDF\u65AD\u8A00\n\    -dsa | -disablesystemassertions\n\                  \u7981\u7528\u7CFB\u7EDF\u65AD\u8A00\n\    -agentlib:<libname>[=<options>]\n\                  \u52A0\u8F7D\u672C\u673A\u4EE3\u7406\u5E93 <libname>, \u4F8B\u5982 -agentlib:hprof\n\                  \u53E6\u8BF7\u53C2\u9605 -agentlib:jdwp=help \u548C -agentlib:hprof=help\n\    -agentpath:<pathname>[=<options>]\n\                  \u6309\u5B8C\u6574\u8DEF\u5F84\u540D\u52A0\u8F7D\u672C\u673A\u4EE3\u7406\u5E93\n\    -javaagent:<jarpath>[=<options>]\n\                  \u52A0\u8F7D Java \u7F16\u7A0B\u8BED\u8A00\u4EE3\u7406, \u8BF7\u53C2\u9605 java.lang.instrument\n\    -splash:<imagepath>\n\                  \u4F7F\u7528\u6307\u5B9A\u7684\u56FE\u50CF\u663E\u793A\u542F\u52A8\u5C4F\u5E55\n\u6709\u5173\u8BE6\u7EC6\u4FE1\u606F, \u8BF7\u53C2\u9605 http://www.oracle.com/technetwork/java/javase/documentation/index.html\u3002
+java.launcher.opt.footer     =\    -cp <\u76EE\u5F55\u548C zip/jar \u6587\u4EF6\u7684\u7C7B\u641C\u7D22\u8DEF\u5F84>\n\\    -classpath <\u76EE\u5F55\u548C zip/jar \u6587\u4EF6\u7684\u7C7B\u641C\u7D22\u8DEF\u5F84>\n\\                  \u7528 {0} \u5206\u9694\u7684\u76EE\u5F55, JAR \u6863\u6848\n\\                  \u548C ZIP \u6863\u6848\u5217\u8868, \u7528\u4E8E\u641C\u7D22\u7C7B\u6587\u4EF6\u3002\n\\    -D<\u540D\u79F0>=<\u503C>\n\\                  \u8BBE\u7F6E\u7CFB\u7EDF\u5C5E\u6027\n\\    -verbose:[class|gc|jni]\n\\                  \u542F\u7528\u8BE6\u7EC6\u8F93\u51FA\n\\    -version      \u8F93\u51FA\u4EA7\u54C1\u7248\u672C\u5E76\u9000\u51FA\n\\    -version:<\u503C>\n\\                  \u9700\u8981\u6307\u5B9A\u7684\u7248\u672C\u624D\u80FD\u8FD0\u884C\n\\    -showversion  \u8F93\u51FA\u4EA7\u54C1\u7248\u672C\u5E76\u7EE7\u7EED\n\\    -jre-restrict-search | -no-jre-restrict-search\n\\                  \u5728\u7248\u672C\u641C\u7D22\u4E2D\u5305\u62EC/\u6392\u9664\u7528\u6237\u4E13\u7528 JRE\n\\    -? -help      \u8F93\u51FA\u6B64\u5E2E\u52A9\u6D88\u606F\n\\    -X            \u8F93\u51FA\u975E\u6807\u51C6\u9009\u9879\u7684\u5E2E\u52A9\n\\    -ea[:<packagename>...|:<classname>]\n\\    -enableassertions[:<packagename>...|:<classname>]\n\\                  \u6309\u6307\u5B9A\u7684\u7C92\u5EA6\u542F\u7528\u65AD\u8A00\n\\    -da[:<packagename>...|:<classname>]\n\\    -disableassertions[:<packagename>...|:<classname>]\n\\                  \u7981\u7528\u5177\u6709\u6307\u5B9A\u7C92\u5EA6\u7684\u65AD\u8A00\n\\    -esa | -enablesystemassertions\n\\                  \u542F\u7528\u7CFB\u7EDF\u65AD\u8A00\n\\    -dsa | -disablesystemassertions\n\\                  \u7981\u7528\u7CFB\u7EDF\u65AD\u8A00\n\\    -agentlib:<libname>[=<\u9009\u9879>]\n\\                  \u52A0\u8F7D\u672C\u673A\u4EE3\u7406\u5E93 <libname>, \u4F8B\u5982 -agentlib:hprof\n\\                  \u53E6\u8BF7\u53C2\u9605 -agentlib:jdwp=help \u548C -agentlib:hprof=help\n\\    -agentpath:<pathname>[=<\u9009\u9879>]\n\\                  \u6309\u5B8C\u6574\u8DEF\u5F84\u540D\u52A0\u8F7D\u672C\u673A\u4EE3\u7406\u5E93\n\\    -javaagent:<jarpath>[=<\u9009\u9879>]\n\\                  \u52A0\u8F7D Java \u7F16\u7A0B\u8BED\u8A00\u4EE3\u7406, \u8BF7\u53C2\u9605 java.lang.instrument\n\\    -splash:<imagepath>\n\\                  \u4F7F\u7528\u6307\u5B9A\u7684\u56FE\u50CF\u663E\u793A\u542F\u52A8\u5C4F\u5E55\n\u6709\u5173\u8BE6\u7EC6\u4FE1\u606F, \u8BF7\u53C2\u9605 http://www.oracle.com/technetwork/java/javase/documentation/index.html\u3002
 
 # Translators please note do not translate the options themselves
-java.launcher.X.usage=\    -Xmixed           \u6DF7\u5408\u6A21\u5F0F\u6267\u884C (\u9ED8\u8BA4)\n\    -Xint             \u4EC5\u89E3\u91CA\u6A21\u5F0F\u6267\u884C\n\    -Xbootclasspath:<\u7528 {0} \u5206\u9694\u7684\u76EE\u5F55\u548C zip/jar \u6587\u4EF6>\n\                      \u8BBE\u7F6E\u641C\u7D22\u8DEF\u5F84\u4EE5\u5F15\u5BFC\u7C7B\u548C\u8D44\u6E90\n\    -Xbootclasspath/a:<\u7528 {0} \u5206\u9694\u7684\u76EE\u5F55\u548C zip/jar \u6587\u4EF6>\n\                      \u9644\u52A0\u5728\u5F15\u5BFC\u7C7B\u8DEF\u5F84\u672B\u5C3E\n\    -Xbootclasspath/p:<\u7528 {0} \u5206\u9694\u7684\u76EE\u5F55\u548C zip/jar \u6587\u4EF6>\n\                      \u7F6E\u4E8E\u5F15\u5BFC\u7C7B\u8DEF\u5F84\u4E4B\u524D\n\    -Xdiag            \u663E\u793A\u9644\u52A0\u8BCA\u65AD\u6D88\u606F\n\    -Xnoclassgc       \u7981\u7528\u7C7B\u5783\u573E\u6536\u96C6\n\    -Xincgc           \u542F\u7528\u589E\u91CF\u5783\u573E\u6536\u96C6\n\    -Xloggc:<file>    \u5C06 GC \u72B6\u6001\u8BB0\u5F55\u5728\u6587\u4EF6\u4E2D (\u5E26\u65F6\u95F4\u6233)\n\    -Xbatch           \u7981\u7528\u540E\u53F0\u7F16\u8BD1\n\    -Xms<size>        \u8BBE\u7F6E\u521D\u59CB Java \u5806\u5927\u5C0F\n\    -Xmx<size>        \u8BBE\u7F6E\u6700\u5927 Java \u5806\u5927\u5C0F\n\    -Xss<size>        \u8BBE\u7F6E Java \u7EBF\u7A0B\u5806\u6808\u5927\u5C0F\n\    -Xprof            \u8F93\u51FA cpu \u914D\u7F6E\u6587\u4EF6\u6570\u636E\n\    -Xfuture          \u542F\u7528\u6700\u4E25\u683C\u7684\u68C0\u67E5, \u9884\u671F\u5C06\u6765\u7684\u9ED8\u8BA4\u503C\n\    -Xrs              \u51CF\u5C11 Java/VM \u5BF9\u64CD\u4F5C\u7CFB\u7EDF\u4FE1\u53F7\u7684\u4F7F\u7528 (\u8BF7\u53C2\u9605\u6587\u6863)\n\    -Xcheck:jni       \u5BF9 JNI \u51FD\u6570\u6267\u884C\u5176\u4ED6\u68C0\u67E5\n\    -Xshare:off       \u4E0D\u5C1D\u8BD5\u4F7F\u7528\u5171\u4EAB\u7C7B\u6570\u636E\n\    -Xshare:auto      \u5728\u53EF\u80FD\u7684\u60C5\u51B5\u4E0B\u4F7F\u7528\u5171\u4EAB\u7C7B\u6570\u636E (\u9ED8\u8BA4)\n\    -Xshare:on        \u8981\u6C42\u4F7F\u7528\u5171\u4EAB\u7C7B\u6570\u636E, \u5426\u5219\u5C06\u5931\u8D25\u3002\n\    -XshowSettings    \u663E\u793A\u6240\u6709\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n\    -XshowSettings:all\n\                      \u663E\u793A\u6240\u6709\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n\    -XshowSettings:vm \u663E\u793A\u6240\u6709\u4E0E vm \u76F8\u5173\u7684\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n\    -XshowSettings:properties\n\                      \u663E\u793A\u6240\u6709\u5C5E\u6027\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n\    -XshowSettings:locale\n\                      \u663E\u793A\u6240\u6709\u4E0E\u533A\u57DF\u8BBE\u7F6E\u76F8\u5173\u7684\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n\n-X \u9009\u9879\u662F\u975E\u6807\u51C6\u9009\u9879, \u5982\u6709\u66F4\u6539, \u6055\u4E0D\u53E6\u884C\u901A\u77E5\u3002\n
+java.launcher.X.usage=\    -Xmixed           \u6DF7\u5408\u6A21\u5F0F\u6267\u884C (\u9ED8\u8BA4)\n    -Xint             \u4EC5\u89E3\u91CA\u6A21\u5F0F\u6267\u884C\n    -Xbootclasspath:<\u7528 {0} \u5206\u9694\u7684\u76EE\u5F55\u548C zip/jar \u6587\u4EF6>\n                      \u8BBE\u7F6E\u641C\u7D22\u8DEF\u5F84\u4EE5\u5F15\u5BFC\u7C7B\u548C\u8D44\u6E90\n    -Xbootclasspath/a:<\u7528 {0} \u5206\u9694\u7684\u76EE\u5F55\u548C zip/jar \u6587\u4EF6>\n                      \u9644\u52A0\u5728\u5F15\u5BFC\u7C7B\u8DEF\u5F84\u672B\u5C3E\n    -Xbootclasspath/p:<\u7528 {0} \u5206\u9694\u7684\u76EE\u5F55\u548C zip/jar \u6587\u4EF6>\n                      \u7F6E\u4E8E\u5F15\u5BFC\u7C7B\u8DEF\u5F84\u4E4B\u524D\n    -Xdiag            \u663E\u793A\u9644\u52A0\u8BCA\u65AD\u6D88\u606F\n    -Xnoclassgc       \u7981\u7528\u7C7B\u5783\u573E\u6536\u96C6\n    -Xincgc           \u542F\u7528\u589E\u91CF\u5783\u573E\u6536\u96C6\n    -Xloggc:<file>    \u5C06 GC \u72B6\u6001\u8BB0\u5F55\u5728\u6587\u4EF6\u4E2D (\u5E26\u65F6\u95F4\u6233)\n    -Xbatch           \u7981\u7528\u540E\u53F0\u7F16\u8BD1\n    -Xms<size>        \u8BBE\u7F6E\u521D\u59CB Java \u5806\u5927\u5C0F\n    -Xmx<size>        \u8BBE\u7F6E\u6700\u5927 Java \u5806\u5927\u5C0F\n    -Xss<size>        \u8BBE\u7F6E Java \u7EBF\u7A0B\u5806\u6808\u5927\u5C0F\n    -Xprof            \u8F93\u51FA cpu \u914D\u7F6E\u6587\u4EF6\u6570\u636E\n    -Xfuture          \u542F\u7528\u6700\u4E25\u683C\u7684\u68C0\u67E5, \u9884\u671F\u5C06\u6765\u7684\u9ED8\u8BA4\u503C\n    -Xrs              \u51CF\u5C11 Java/VM \u5BF9\u64CD\u4F5C\u7CFB\u7EDF\u4FE1\u53F7\u7684\u4F7F\u7528 (\u8BF7\u53C2\u9605\u6587\u6863)\n    -Xcheck:jni       \u5BF9 JNI \u51FD\u6570\u6267\u884C\u5176\u4ED6\u68C0\u67E5\n    -Xshare:off       \u4E0D\u5C1D\u8BD5\u4F7F\u7528\u5171\u4EAB\u7C7B\u6570\u636E\n    -Xshare:auto      \u5728\u53EF\u80FD\u7684\u60C5\u51B5\u4E0B\u4F7F\u7528\u5171\u4EAB\u7C7B\u6570\u636E (\u9ED8\u8BA4)\n    -Xshare:on        \u8981\u6C42\u4F7F\u7528\u5171\u4EAB\u7C7B\u6570\u636E, \u5426\u5219\u5C06\u5931\u8D25\u3002\n    -XshowSettings    \u663E\u793A\u6240\u6709\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n    -XshowSettings:all\n                      \u663E\u793A\u6240\u6709\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n    -XshowSettings:vm \u663E\u793A\u6240\u6709\u4E0E vm \u76F8\u5173\u7684\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n    -XshowSettings:properties\n                      \u663E\u793A\u6240\u6709\u5C5E\u6027\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n    -XshowSettings:locale\n                      \u663E\u793A\u6240\u6709\u4E0E\u533A\u57DF\u8BBE\u7F6E\u76F8\u5173\u7684\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n\n-X \u9009\u9879\u662F\u975E\u6807\u51C6\u9009\u9879, \u5982\u6709\u66F4\u6539, \u6055\u4E0D\u53E6\u884C\u901A\u77E5\u3002\n
 
 # Translators please note do not translate the options themselves
-java.launcher.X.macosx.usage=\n\u4EE5\u4E0B\u9009\u9879\u4E3A Mac OS X \u7279\u5B9A\u7684\u9009\u9879:\n\    -XstartOnFirstThread\n\                      \u5728\u7B2C\u4E00\u4E2A (AppKit) \u7EBF\u7A0B\u4E0A\u8FD0\u884C main() \u65B9\u6CD5\n\    -Xdock:name=<\u5E94\u7528\u7A0B\u5E8F\u540D\u79F0>"\n\                      \u8986\u76D6\u505C\u9760\u680F\u4E2D\u663E\u793A\u7684\u9ED8\u8BA4\u5E94\u7528\u7A0B\u5E8F\u540D\u79F0\n\    -Xdock:icon=<\u56FE\u6807\u6587\u4EF6\u7684\u8DEF\u5F84>\n\                      \u8986\u76D6\u505C\u9760\u680F\u4E2D\u663E\u793A\u7684\u9ED8\u8BA4\u56FE\u6807\n\n
+java.launcher.X.macosx.usage=\n\u4EE5\u4E0B\u9009\u9879\u4E3A Mac OS X \u7279\u5B9A\u7684\u9009\u9879:\n    -XstartOnFirstThread\n                      \u5728\u7B2C\u4E00\u4E2A (AppKit) \u7EBF\u7A0B\u4E0A\u8FD0\u884C main() \u65B9\u6CD5\n    -Xdock:name=<\u5E94\u7528\u7A0B\u5E8F\u540D\u79F0>"\n                      \u8986\u76D6\u505C\u9760\u680F\u4E2D\u663E\u793A\u7684\u9ED8\u8BA4\u5E94\u7528\u7A0B\u5E8F\u540D\u79F0\n    -Xdock:icon=<\u56FE\u6807\u6587\u4EF6\u7684\u8DEF\u5F84>\n                      \u8986\u76D6\u505C\u9760\u680F\u4E2D\u663E\u793A\u7684\u9ED8\u8BA4\u56FE\u6807\n\n
 
 java.launcher.cls.error1=\u9519\u8BEF: \u627E\u4E0D\u5230\u6216\u65E0\u6CD5\u52A0\u8F7D\u4E3B\u7C7B {0}
-java.launcher.cls.error2=\u9519\u8BEF: \u4E3B\u65B9\u6CD5\u4E0D\u662F\u7C7B {1} \u4E2D\u7684{0}, \u8BF7\u5C06\u4E3B\u65B9\u6CD5\u5B9A\u4E49\u4E3A:\n\   public static void main(String[] args)
-java.launcher.cls.error3=\u9519\u8BEF: \u4E3B\u65B9\u6CD5\u5FC5\u987B\u8FD4\u56DE\u7C7B {0} \u4E2D\u7684\u7A7A\u7C7B\u578B\u503C, \u8BF7\n\u5C06\u4E3B\u65B9\u6CD5\u5B9A\u4E49\u4E3A:\n\   public static void main(String[] args)
-java.launcher.cls.error4=\u9519\u8BEF: \u5728\u7C7B {0} \u4E2D\u627E\u4E0D\u5230\u4E3B\u65B9\u6CD5, \u8BF7\u5C06\u4E3B\u65B9\u6CD5\u5B9A\u4E49\u4E3A:\n\   public static void main(String[] args)
+java.launcher.cls.error2=\u9519\u8BEF: \u4E3B\u65B9\u6CD5\u4E0D\u662F\u7C7B {1} \u4E2D\u7684{0}, \u8BF7\u5C06\u4E3B\u65B9\u6CD5\u5B9A\u4E49\u4E3A:\n   public static void main(String[] args)
+java.launcher.cls.error3=\u9519\u8BEF: \u4E3B\u65B9\u6CD5\u5FC5\u987B\u8FD4\u56DE\u7C7B {0} \u4E2D\u7684\u7A7A\u7C7B\u578B\u503C, \u8BF7\n\u5C06\u4E3B\u65B9\u6CD5\u5B9A\u4E49\u4E3A:\n   public static void main(String[] args)
+java.launcher.cls.error4=\u9519\u8BEF: \u5728\u7C7B {0} \u4E2D\u627E\u4E0D\u5230\u4E3B\u65B9\u6CD5, \u8BF7\u5C06\u4E3B\u65B9\u6CD5\u5B9A\u4E49\u4E3A:\n   public static void main(String[] args)
 java.launcher.jar.error1=\u9519\u8BEF: \u5C1D\u8BD5\u6253\u5F00\u6587\u4EF6{0}\u65F6\u51FA\u73B0\u610F\u5916\u9519\u8BEF
 java.launcher.jar.error2=\u5728{0}\u4E2D\u627E\u4E0D\u5230\u6E05\u5355
 java.launcher.jar.error3={0}\u4E2D\u6CA1\u6709\u4E3B\u6E05\u5355\u5C5E\u6027
+java.launcher.init.error=\u521D\u59CB\u5316\u9519\u8BEF
--- a/src/share/classes/sun/launcher/resources/launcher_zh_TW.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/launcher/resources/launcher_zh_TW.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -24,7 +24,7 @@
 #
 
 # Translators please note do not translate the options themselves
-java.launcher.opt.header  =   \u7528\u6CD5: {0} [-options] class [args...]\n\           (\u57F7\u884C\u985E\u5225)\n   \u6216  {0} [-options] -jar jarfile [args...]\n\           (\u57F7\u884C jar \u6A94\u6848)\n\u9078\u9805\u5305\u62EC:\n
+java.launcher.opt.header  =   \u7528\u6CD5: {0} [-options] class [args...]\n           (\u57F7\u884C\u985E\u5225)\n   \u6216  {0} [-options] -jar jarfile [args...]\n           (\u57F7\u884C jar \u6A94\u6848)\n\u9078\u9805\u5305\u62EC:\n
 
 java.launcher.opt.datamodel  =\    -d{0}\t  \u4F7F\u7528 {0} \u4F4D\u5143\u8CC7\u6599\u6A21\u578B (\u5982\u679C\u6709\u7684\u8A71)\n
 java.launcher.opt.vmselect   =\    {0}\t  \u9078\u53D6 "{1}" VM\n
@@ -34,18 +34,19 @@
 java.launcher.ergo.message2  =\                  \u56E0\u70BA\u60A8\u6B63\u5728\u4F3A\u670D\u5668\u985E\u5225\u6A5F\u5668\u4E0A\u57F7\u884C\u3002\n
 
 # Translators please note do not translate the options themselves
-java.launcher.opt.footer     =\    -cp <class search path of directories and zip/jar files>\n\    -classpath <class search path of directories and zip/jar files>\n\                  \u4F7F\u7528 {0} \u5340\u9694\u7684\u76EE\u9304\u3001JAR \u5B58\u6A94\u4EE5\u53CA\n\                  ZIP \u5B58\u6A94\u6E05\u55AE\uFF0C\u7528\u4EE5\u641C\u5C0B\u985E\u5225\u6A94\u6848\u3002\n\    -D<name>=<value>\n\                  \u8A2D\u5B9A\u7CFB\u7D71\u5C6C\u6027\n\    -verbose[:class|gc|jni]\n\                  \u555F\u7528\u8A73\u7D30\u8CC7\u8A0A\u8F38\u51FA\n\    -version      \u5217\u5370\u7522\u54C1\u7248\u672C\u4E26\u7D50\u675F\n\    -version:<value>\n\                  \u9700\u8981\u6307\u5B9A\u7684\u7248\u672C\u624D\u80FD\u57F7\u884C\n\    -showversion  \u5217\u5370\u7522\u54C1\u7248\u672C\u4E26\u7E7C\u7E8C\n\    -jre-restrict-search | -no-jre-restrict-search\n\                  \u5728\u7248\u672C\u641C\u5C0B\u4E2D\u5305\u62EC/\u6392\u9664\u4F7F\u7528\u8005\u5C08\u7528 JRE\n\    -? -help      \u5217\u5370\u6B64\u8AAA\u660E\u8A0A\u606F\n\    -X            \u5217\u5370\u975E\u6A19\u6E96\u9078\u9805\u7684\u8AAA\u660E\n\    -ea[:<packagename>...|:<classname>]\n\    -enableassertions[:<packagename>...|:<classname>]\n\                  \u555F\u7528\u542B\u6307\u5B9A\u8A73\u7D30\u7A0B\u5EA6\u7684\u5BA3\u544A\n\    -da[:<packagename>...|:<classname>]\n\    -disableassertions[:<packagename>...|:<classname>]\n\                  \u505C\u7528\u542B\u6307\u5B9A\u8A73\u7D30\u7A0B\u5EA6\u7684\u5BA3\u544A\n\    -esa | -enablesystemassertions\n\                  \u555F\u7528\u7CFB\u7D71\u5BA3\u544A\n\    -dsa | -disablesystemassertions\n\                  \u505C\u7528\u7CFB\u7D71\u5BA3\u544A\n\    -agentlib:<libname>[=<options>]\n\                  \u8F09\u5165\u539F\u751F\u4EE3\u7406\u7A0B\u5F0F\u7A0B\u5F0F\u5EAB <libname>\uFF0C\u4F8B\u5982 -agentlib:hprof\n\                  \u53E6\u8ACB\u53C3\u95B1 -agentlib:jdwp=help \u8207 -agentlib:hprof=help\n\    -agentpath:<pathname>[=<options>]\n\                  \u4F7F\u7528\u5B8C\u6574\u8DEF\u5F91\u540D\u7A31\u8F09\u5165\u539F\u751F\u4EE3\u7406\u7A0B\u5F0F\u7A0B\u5F0F\u5EAB\n\    -javaagent:<jarpath>[=<options>]\n\                  \u8F09\u5165 Java \u7A0B\u5F0F\u8A9E\u8A00\u4EE3\u7406\u7A0B\u5F0F\uFF0C\u8ACB\u53C3\u95B1 java.lang.instrument\n\    -splash:<imagepath>\n\                  \u986F\u793A\u6307\u5B9A\u5F71\u50CF\u7684\u8EDF\u9AD4\u8CC7\u8A0A\u756B\u9762\n\u8ACB\u53C3\u95B1 http://www.oracle.com/technetwork/java/javase/documentation/index.html \u66B8\u89E3\u8A73\u7D30\u8CC7\u8A0A\u3002
+java.launcher.opt.footer     =\    -cp <class search path of directories and zip/jar files>\n    -classpath <class search path of directories and zip/jar files>\n                  \u4F7F\u7528 {0} \u5340\u9694\u7684\u76EE\u9304\u3001JAR \u5B58\u6A94\u4EE5\u53CA\n                  ZIP \u5B58\u6A94\u6E05\u55AE\u4F86\u641C\u5C0B\u985E\u5225\u6A94\u6848\u3002\n    -D<name>=<value>\n                  \u8A2D\u5B9A\u7CFB\u7D71\u5C6C\u6027\n    -verbose:[class|gc|jni]\n                  \u555F\u7528\u8A73\u7D30\u8CC7\u8A0A\u8F38\u51FA\n    -version      \u5217\u5370\u7522\u54C1\u7248\u672C\u4E26\u7D50\u675F\n    -version:<value>\n                  \u9700\u8981\u6307\u5B9A\u7684\u7248\u672C\u624D\u80FD\u57F7\u884C\n    -showversion  \u5217\u5370\u7522\u54C1\u7248\u672C\u4E26\u7E7C\u7E8C\n    -jre-restrict-search | -no-jre-restrict-search\n                  \u5728\u7248\u672C\u641C\u5C0B\u4E2D\u5305\u62EC/\u6392\u9664\u4F7F\u7528\u8005\u5C08\u7528 JRE\n    -? -help      \u5217\u5370\u6B64\u8AAA\u660E\u8A0A\u606F\n    -X            \u5217\u5370\u975E\u6A19\u6E96\u9078\u9805\u7684\u8AAA\u660E\n    -ea[:<packagename>...|:<classname>]\n    -enableassertions[:<packagename>...|:<classname>]\n                  \u555F\u7528\u542B\u6307\u5B9A\u8A73\u7D30\u7A0B\u5EA6\u7684\u5BA3\u544A\n    -da[:<packagename>...|:<classname>]\n    -disableassertions[:<packagename>...|:<classname>]\n                  \u505C\u7528\u542B\u6307\u5B9A\u8A73\u7D30\u7A0B\u5EA6\u7684\u5BA3\u544A\n    -esa | -enablesystemassertions\n                  \u555F\u7528\u7CFB\u7D71\u5BA3\u544A\n    -dsa | -disablesystemassertions\n                  \u505C\u7528\u7CFB\u7D71\u5BA3\u544A\n    -agentlib:<libname>[=<options>]\n                  \u8F09\u5165\u539F\u751F\u4EE3\u7406\u7A0B\u5F0F\u7A0B\u5F0F\u5EAB <libname>\uFF0C\u4F8B\u5982 -agentlib:hprof\n                  \u53E6\u8ACB\u53C3\u95B1 -agentlib:jdwp=help \u8207 -agentlib:hprof=help\n    -agentpath:<pathname>[=<options>]\n                  \u4F7F\u7528\u5B8C\u6574\u8DEF\u5F91\u540D\u7A31\u8F09\u5165\u539F\u751F\u4EE3\u7406\u7A0B\u5F0F\u7A0B\u5F0F\u5EAB\n    -javaagent:<jarpath>[=<options>]\n                  \u8F09\u5165 Java \u7A0B\u5F0F\u8A9E\u8A00\u4EE3\u7406\u7A0B\u5F0F\uFF0C\u8ACB\u53C3\u95B1 java.lang.instrument\n    -splash:<imagepath>\n                  \u986F\u793A\u6307\u5B9A\u5F71\u50CF\u7684\u8EDF\u9AD4\u8CC7\u8A0A\u756B\u9762\n\u8ACB\u53C3\u95B1 http://www.oracle.com/technetwork/java/javase/documentation/index.html \u66B8\u89E3\u8A73\u7D30\u8CC7\u8A0A\u3002
 
 # Translators please note do not translate the options themselves
-java.launcher.X.usage=\    -Xmixed           \u6DF7\u5408\u6A21\u5F0F\u57F7\u884C (\u9810\u8A2D)\n\    -Xint             \u50C5\u9650\u89E3\u8B6F\u6A21\u5F0F\u57F7\u884C\n\    -Xbootclasspath:<\u4EE5 {0} \u5206\u9694\u7684\u76EE\u9304\u548C zip/jar \u6A94\u6848>\n\                      \u8A2D\u5B9A\u555F\u52D5\u5B89\u88DD\u985E\u5225\u548C\u8CC7\u6E90\u7684\u641C\u5C0B\u8DEF\u5F91\n\    -Xbootclasspath/a:<\u4EE5 {0} \u5206\u9694\u7684\u76EE\u9304\u548C zip/jar \u6A94\u6848>\n\                      \u9644\u52A0\u5728\u555F\u52D5\u5B89\u88DD\u985E\u5225\u8DEF\u5F91\u7684\u7D50\u5C3E\n\    -Xbootclasspath/p:<\u4EE5 {0} \u5206\u9694\u7684\u76EE\u9304\u548C zip/jar \u6A94\u6848>\n\                      \u9644\u52A0\u5728\u555F\u52D5\u5B89\u88DD\u985E\u5225\u8DEF\u5F91\u7684\u524D\u9762\n\    -Xdiag            \u986F\u793A\u5176\u4ED6\u7684\u8A3A\u65B7\u8A0A\u606F\n\    -Xnoclassgc       \u505C\u7528\u985E\u5225\u8CC7\u6E90\u56DE\u6536\n\    -Xincgc           \u555F\u7528\u6F38\u9032\u8CC7\u6E90\u56DE\u6536\n\    -Xloggc:<file>    \u5229\u7528\u6642\u6233\u5C07 GC \u72C0\u614B\u8A18\u9304\u81F3\u6A94\u6848\u4E2D\n\    -Xbatch           \u505C\u7528\u80CC\u666F\u7DE8\u8B6F\n\    -Xms<size>        \u8A2D\u5B9A\u8D77\u59CB Java \u5806\u96C6\u5927\u5C0F\n\    -Xmx<size>        \u8A2D\u5B9A Java \u5806\u96C6\u5927\u5C0F\u4E0A\u9650\n\    -Xss<size>        \u8A2D\u5B9A Java \u57F7\u884C\u7DD2\u5806\u758A\u5927\u5C0F\n\    -Xprof            \u8F38\u51FA CPU \u5206\u6790\u8CC7\u6599\n\    -Xfuture          \u555F\u7528\u6700\u56B4\u683C\u7684\u6AA2\u67E5\uFF0C\u9810\u5148\u505A\u70BA\u5C07\u4F86\u7684\u9810\u8A2D\n\    -Xrs              \u6E1B\u5C11 Java/VM \u4F7F\u7528\u4F5C\u696D\u7CFB\u7D71\u4FE1\u865F (\u8ACB\u53C3\u95B1\u6587\u4EF6)\n\    -Xcheck:jni       \u57F7\u884C\u5176\u4ED6\u7684 JNI \u51FD\u6578\u6AA2\u67E5\n\    -Xshare:off       \u4E0D\u5617\u8A66\u4F7F\u7528\u5171\u7528\u985E\u5225\u8CC7\u6599\n\    -Xshare:auto      \u5118\u53EF\u80FD\u4F7F\u7528\u5171\u7528\u985E\u5225\u8CC7\u6599 (\u9810\u8A2D)\n\    -Xshare:on        \u9700\u8981\u4F7F\u7528\u5171\u7528\u985E\u5225\u8CC7\u6599\uFF0C\u5426\u5247\u5931\u6557\u3002\n\    -XshowSettings    \u986F\u793A\u6240\u6709\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n\    -XshowSettings:all\n\                      \u986F\u793A\u6240\u6709\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n\    -XshowSettings:vm \u986F\u793A\u6240\u6709 VM \u76F8\u95DC\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n\    -XshowSettings:properties\n\                      \u986F\u793A\u6240\u6709\u5C6C\u6027\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n\    -XshowSettings:locale\n\                      \u986F\u793A\u6240\u6709\u5730\u5340\u8A2D\u5B9A\u76F8\u95DC\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n\n -X \u9078\u9805\u4E0D\u662F\u6A19\u6E96\u9078\u9805\uFF0C\u82E5\u6709\u8B8A\u66F4\u4E0D\u53E6\u884C\u901A\u77E5\u3002\n
+java.launcher.X.usage=\    -Xmixed           \u6DF7\u5408\u6A21\u5F0F\u57F7\u884C (\u9810\u8A2D)\n    -Xint             \u50C5\u9650\u89E3\u8B6F\u6A21\u5F0F\u57F7\u884C\n    -Xbootclasspath:<\u4EE5 {0} \u5206\u9694\u7684\u76EE\u9304\u548C zip/jar \u6A94\u6848>\n                      \u8A2D\u5B9A\u555F\u52D5\u5B89\u88DD\u985E\u5225\u548C\u8CC7\u6E90\u7684\u641C\u5C0B\u8DEF\u5F91\n    -Xbootclasspath/a:<\u4EE5 {0} \u5206\u9694\u7684\u76EE\u9304\u548C zip/jar \u6A94\u6848>\n                      \u9644\u52A0\u5728\u555F\u52D5\u5B89\u88DD\u985E\u5225\u8DEF\u5F91\u7684\u7D50\u5C3E\n    -Xbootclasspath/p:<\u4EE5 {0} \u5206\u9694\u7684\u76EE\u9304\u548C zip/jar \u6A94\u6848>\n                      \u9644\u52A0\u5728\u555F\u52D5\u5B89\u88DD\u985E\u5225\u8DEF\u5F91\u7684\u524D\u9762\n    -Xdiag            \u986F\u793A\u5176\u4ED6\u7684\u8A3A\u65B7\u8A0A\u606F\n    -Xnoclassgc       \u505C\u7528\u985E\u5225\u8CC7\u6E90\u56DE\u6536\n    -Xincgc           \u555F\u7528\u6F38\u9032\u8CC7\u6E90\u56DE\u6536\n    -Xloggc:<file>    \u5229\u7528\u6642\u6233\u5C07 GC \u72C0\u614B\u8A18\u9304\u81F3\u6A94\u6848\u4E2D\n    -Xbatch           \u505C\u7528\u80CC\u666F\u7DE8\u8B6F\n    -Xms<size>        \u8A2D\u5B9A\u8D77\u59CB Java \u5806\u96C6\u5927\u5C0F\n    -Xmx<size>        \u8A2D\u5B9A Java \u5806\u96C6\u5927\u5C0F\u4E0A\u9650\n    -Xss<size>        \u8A2D\u5B9A Java \u57F7\u884C\u7DD2\u5806\u758A\u5927\u5C0F\n    -Xprof            \u8F38\u51FA CPU \u5206\u6790\u8CC7\u6599\n    -Xfuture          \u555F\u7528\u6700\u56B4\u683C\u7684\u6AA2\u67E5\uFF0C\u9810\u5148\u505A\u70BA\u5C07\u4F86\u7684\u9810\u8A2D\n    -Xrs              \u6E1B\u5C11 Java/VM \u4F7F\u7528\u4F5C\u696D\u7CFB\u7D71\u4FE1\u865F (\u8ACB\u53C3\u95B1\u6587\u4EF6)\n    -Xcheck:jni       \u57F7\u884C\u5176\u4ED6\u7684 JNI \u51FD\u6578\u6AA2\u67E5\n    -Xshare:off       \u4E0D\u5617\u8A66\u4F7F\u7528\u5171\u7528\u985E\u5225\u8CC7\u6599\n    -Xshare:auto      \u5118\u53EF\u80FD\u4F7F\u7528\u5171\u7528\u985E\u5225\u8CC7\u6599 (\u9810\u8A2D)\n    -Xshare:on        \u9700\u8981\u4F7F\u7528\u5171\u7528\u985E\u5225\u8CC7\u6599\uFF0C\u5426\u5247\u5931\u6557\u3002\n    -XshowSettings    \u986F\u793A\u6240\u6709\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n    -XshowSettings:all\n                      \u986F\u793A\u6240\u6709\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n    -XshowSettings:vm \u986F\u793A\u6240\u6709 VM \u76F8\u95DC\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n    -XshowSettings:properties\n                      \u986F\u793A\u6240\u6709\u5C6C\u6027\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n    -XshowSettings:locale\n                      \u986F\u793A\u6240\u6709\u5730\u5340\u8A2D\u5B9A\u76F8\u95DC\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n\n -X \u9078\u9805\u4E0D\u662F\u6A19\u6E96\u9078\u9805\uFF0C\u82E5\u6709\u8B8A\u66F4\u4E0D\u53E6\u884C\u901A\u77E5\u3002\n
 
 # Translators please note do not translate the options themselves
-java.launcher.X.macosx.usage=\n\u4E0B\u5217\u662F Mac OS X \u7279\u5B9A\u9078\u9805:\n\    -XstartOnFirstThread\n\                      \u5728\u7B2C\u4E00\u500B (AppKit) \u57F7\u884C\u7DD2\u57F7\u884C main() \u65B9\u6CD5\n\    -Xdock:name=<application name>"\n\                      \u8986\u5BEB\u7D50\u5408\u8AAA\u660E\u756B\u9762\u4E2D\u986F\u793A\u7684\u9810\u8A2D\u61C9\u7528\u7A0B\u5F0F\u540D\u7A31\n\    -Xdock:icon=<path to icon file>\n\                      \u8986\u5BEB\u7D50\u5408\u8AAA\u660E\u756B\u9762\u4E2D\u986F\u793A\u7684\u9810\u8A2D\u5716\u793A\n\n
+java.launcher.X.macosx.usage=\n\u4E0B\u5217\u662F Mac OS X \u7279\u5B9A\u9078\u9805:\n    -XstartOnFirstThread\n                      \u5728\u7B2C\u4E00\u500B (AppKit) \u57F7\u884C\u7DD2\u57F7\u884C main() \u65B9\u6CD5\n    -Xdock:name=<application name>"\n                      \u8986\u5BEB\u7D50\u5408\u8AAA\u660E\u756B\u9762\u4E2D\u986F\u793A\u7684\u9810\u8A2D\u61C9\u7528\u7A0B\u5F0F\u540D\u7A31\n    -Xdock:icon=<path to icon file>\n                      \u8986\u5BEB\u7D50\u5408\u8AAA\u660E\u756B\u9762\u4E2D\u986F\u793A\u7684\u9810\u8A2D\u5716\u793A\n\n
 
 java.launcher.cls.error1=\u932F\u8AA4: \u627E\u4E0D\u5230\u6216\u7121\u6CD5\u8F09\u5165\u4E3B\u8981\u985E\u5225 {0}
-java.launcher.cls.error2=\u932F\u8AA4: \u4E3B\u8981\u65B9\u6CD5\u4E0D\u662F\u985E\u5225 {1} \u4E2D\u7684 {0}\uFF0C\u8ACB\u5B9A\u7FA9\u4E3B\u8981\u65B9\u6CD5\u70BA:\n\   public static void main(String[] args)
-java.launcher.cls.error3=\u932F\u8AA4: \u4E3B\u8981\u65B9\u6CD5\u5FC5\u9808\u50B3\u56DE\u985E\u5225 {0} \u4E2D void \u985E\u578B\u7684\u503C\uFF0C \n\u8ACB\u5B9A\u7FA9\u4E3B\u8981\u65B9\u6CD5\u70BA:\n\   public static void main(String[] args)
-java.launcher.cls.error4=\u932F\u8AA4: \u5728\u985E\u5225 {0} \u4E2D\u627E\u4E0D\u5230\u4E3B\u8981\u65B9\u6CD5\uFF0C\u8ACB\u5B9A\u7FA9\u4E3B\u8981\u65B9\u6CD5\u70BA:\n\   public static void main(String[] args)
+java.launcher.cls.error2=\u932F\u8AA4: \u4E3B\u8981\u65B9\u6CD5\u4E0D\u662F\u985E\u5225 {1} \u4E2D\u7684 {0}\uFF0C\u8ACB\u5B9A\u7FA9\u4E3B\u8981\u65B9\u6CD5\u70BA:\n   public static void main(String[] args)
+java.launcher.cls.error3=\u932F\u8AA4: \u4E3B\u8981\u65B9\u6CD5\u5FC5\u9808\u50B3\u56DE\u985E\u5225 {0} \u4E2D void \u985E\u578B\u7684\u503C\uFF0C \n\u8ACB\u5B9A\u7FA9\u4E3B\u8981\u65B9\u6CD5\u70BA:\n   public static void main(String[] args)
+java.launcher.cls.error4=\u932F\u8AA4: \u5728\u985E\u5225 {0} \u4E2D\u627E\u4E0D\u5230\u4E3B\u8981\u65B9\u6CD5\uFF0C\u8ACB\u5B9A\u7FA9\u4E3B\u8981\u65B9\u6CD5\u70BA:\n   public static void main(String[] args)
 java.launcher.jar.error1=\u932F\u8AA4: \u5617\u8A66\u958B\u555F\u6A94\u6848 {0} \u6642\u767C\u751F\u672A\u9810\u671F\u7684\u932F\u8AA4
 java.launcher.jar.error2=\u5728 {0} \u4E2D\u627E\u4E0D\u5230\u8CC7\u8A0A\u6E05\u55AE
 java.launcher.jar.error3={0} \u4E2D\u6C92\u6709\u4E3B\u8981\u8CC7\u8A0A\u6E05\u55AE\u5C6C\u6027
+java.launcher.init.error=\u521D\u59CB\u5316\u932F\u8AA4
--- a/src/share/classes/sun/management/Agent.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/management/Agent.java	Fri Jun 21 19:11:42 2013 -0700
@@ -32,10 +32,12 @@
 import java.io.IOException;
 import java.io.InputStream;
 
+import java.lang.management.ManagementFactory;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
-import java.lang.management.ManagementFactory;
-
+import java.net.InetAddress;
+import java.net.Socket;
+import java.net.UnknownHostException;
 import java.text.MessageFormat;
 
 import java.util.MissingResourceException;
@@ -43,9 +45,12 @@
 import java.util.ResourceBundle;
 
 import javax.management.remote.JMXConnectorServer;
+import javax.management.remote.JMXServiceURL;
 
 import static sun.management.AgentConfigurationError.*;
 import sun.management.jmxremote.ConnectorBootstrap;
+import sun.management.jdp.JdpController;
+import sun.management.jdp.JdpException;
 import sun.misc.VMSupport;
 
 /**
@@ -67,6 +72,8 @@
         "com.sun.management.jmxremote";
     private static final String JMXREMOTE_PORT =
         "com.sun.management.jmxremote.port";
+    private static final String RMI_PORT =
+        "com.sun.management.jmxremote.rmi.port";
     private static final String ENABLE_THREAD_CONTENTION_MONITORING =
         "com.sun.management.enableThreadContentionMonitoring";
     private static final String LOCAL_CONNECTOR_ADDRESS_PROP =
@@ -75,6 +82,9 @@
     private static final String SNMP_ADAPTOR_BOOTSTRAP_CLASS_NAME =
         "sun.management.snmp.AdaptorBootstrap";
 
+    private static final String JDP_DEFAULT_ADDRESS = "224.0.23.178";
+    private static final int JDP_DEFAULT_PORT = 7095;
+
     // The only active agent allowed
     private static JMXConnectorServer jmxServer = null;
 
@@ -168,7 +178,10 @@
 
         // management properties can be overridden by system properties
         // which take precedence
-        configProps.putAll(System.getProperties());
+        Properties sysProps = System.getProperties();
+        synchronized(sysProps){
+            configProps.putAll(sysProps);
+        }
 
         // if user specifies config file into command line for either
         // jcmd utilities or attach command it overrides properties set in
@@ -198,10 +211,13 @@
         if (jmxremotePort != null) {
             jmxServer = ConnectorBootstrap.
                            startRemoteConnectorServer(jmxremotePort, configProps);
+            startDiscoveryService(configProps);
         }
     }
 
     private static synchronized void stopRemoteManagementAgent() throws Exception {
+
+        JdpController.stopDiscoveryService();
         if (jmxServer != null) {
             ConnectorBootstrap.unexportRegistry();
 
@@ -243,6 +259,7 @@
                 if (jmxremotePort != null) {
                    jmxServer = ConnectorBootstrap.
                                startRemoteConnectorServer(jmxremotePort, props);
+                    startDiscoveryService(props);
                 }
                 startLocalManagementAgent();
              }
@@ -254,6 +271,73 @@
         }
     }
 
+    private static void startDiscoveryService(Properties props)
+            throws IOException {
+        // Start discovery service if requested
+        String discoveryPort = props.getProperty("com.sun.management.jdp.port");
+        String discoveryAddress = props.getProperty("com.sun.management.jdp.address");
+        String discoveryShouldStart = props.getProperty("com.sun.management.jmxremote.autodiscovery");
+
+        // Decide whether we should start autodicovery service.
+        // To start autodiscovery following conditions should be met:
+        // autodiscovery==true OR (autodicovery==null AND jdp.port != NULL)
+
+        boolean shouldStart = false;
+        if (discoveryShouldStart == null){
+            shouldStart = (discoveryPort != null);
+        }
+        else{
+            try{
+               shouldStart = Boolean.parseBoolean(discoveryShouldStart);
+            } catch (NumberFormatException e) {
+                throw new AgentConfigurationError("Couldn't parse autodiscovery argument");
+            }
+        }
+
+        if (shouldStart) {
+            // port and address are required arguments and have no default values
+            InetAddress address;
+            try {
+                address = (discoveryAddress == null) ?
+                        InetAddress.getByName(JDP_DEFAULT_ADDRESS) : InetAddress.getByName(discoveryAddress);
+            } catch (UnknownHostException e) {
+                throw new AgentConfigurationError("Unable to broadcast to requested address", e);
+            }
+
+            int port = JDP_DEFAULT_PORT;
+            if (discoveryPort != null) {
+               try {
+                  port = Integer.parseInt(discoveryPort);
+               } catch (NumberFormatException e) {
+                 throw new AgentConfigurationError("Couldn't parse JDP port argument");
+               }
+            }
+
+            // Rebuilding service URL to broadcast it
+            String jmxremotePort = props.getProperty(JMXREMOTE_PORT);
+            String rmiPort = props.getProperty(RMI_PORT);
+
+            JMXServiceURL url = jmxServer.getAddress();
+            String hostname = url.getHost();
+
+            String jmxUrlStr = (rmiPort != null)
+                    ? String.format(
+                    "service:jmx:rmi://%s:%s/jndi/rmi://%s:%s/jmxrmi",
+                    hostname, rmiPort, hostname, jmxremotePort)
+                    : String.format(
+                    "service:jmx:rmi:///jndi/rmi://%s:%s/jmxrmi", hostname, jmxremotePort);
+
+            String instanceName = System.getProperty("com.sun.management.jdp.name");
+
+            try{
+               JdpController.startDiscoveryService(address, port, instanceName, jmxUrlStr);
+            }
+            catch(JdpException e){
+                throw new AgentConfigurationError("Couldn't start JDP service", e);
+            }
+        }
+    }
+
     public static Properties loadManagementProperties() {
         Properties props = new Properties();
 
@@ -264,7 +348,10 @@
 
         // management properties can be overridden by system properties
         // which take precedence
-        props.putAll(System.getProperties());
+        Properties sysProps = System.getProperties();
+        synchronized(sysProps){
+            props.putAll(sysProps);
+        }
 
         return props;
    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/management/jdp/JdpBroadcaster.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,126 @@
+/*
+ * 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.  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.jdp;
+
+import java.io.IOException;
+import java.net.Inet6Address;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.net.NetworkInterface;
+import java.net.ProtocolFamily;
+import java.net.StandardProtocolFamily;
+import java.net.StandardSocketOptions;
+import java.nio.ByteBuffer;
+import java.nio.channels.DatagramChannel;
+import java.nio.channels.UnsupportedAddressTypeException;
+
+/**
+ * JdpBroadcaster is responsible for sending pre-built JDP packet across a Net
+ *
+ * <p> Multicast group address, port number and ttl have to be chosen on upper
+ * level and passed to broadcaster constructor. Also it's possible to specify
+ * source address to broadcast from. </p>
+ *
+ * <p>JdpBradcaster doesn't perform any validation on a supplied {@code port} and {@code ttl} because
+ * the allowed values depend on an operating system setup</p>
+ *
+ */
+public final class JdpBroadcaster {
+
+    private final InetAddress addr;
+    private final int port;
+    private final DatagramChannel channel;
+
+    /**
+     * Create a new broadcaster
+     *
+     * @param address - multicast group address
+     * @param srcAddress - address of interface we should use to broadcast.
+     * @param port - udp port to use
+     * @param ttl - packet ttl
+     * @throws IOException
+     */
+    public JdpBroadcaster(InetAddress address, InetAddress srcAddress, int port, int ttl)
+            throws IOException, JdpException {
+        this.addr = address;
+        this.port = port;
+
+        ProtocolFamily family = (address instanceof Inet6Address)
+                ? StandardProtocolFamily.INET6 : StandardProtocolFamily.INET;
+
+        channel = DatagramChannel.open(family);
+        channel.setOption(StandardSocketOptions.SO_REUSEADDR, true);
+        channel.setOption(StandardSocketOptions.IP_MULTICAST_TTL, ttl);
+
+        // with srcAddress equal to null, this constructor do exactly the same as
+        // if srcAddress is not passed
+        if (srcAddress != null) {
+            // User requests particular interface to bind to
+            NetworkInterface interf = NetworkInterface.getByInetAddress(srcAddress);
+            try {
+                channel.bind(new InetSocketAddress(srcAddress, 0));
+            } catch (UnsupportedAddressTypeException ex) {
+                throw new JdpException("Unable to bind to source address");
+            }
+            channel.setOption(StandardSocketOptions.IP_MULTICAST_IF, interf);
+        }
+    }
+
+    /**
+     * Create a new broadcaster
+     *
+     * @param address - multicast group address
+     * @param port - udp port to use
+     * @param ttl - packet ttl
+     * @throws IOException
+     */
+    public JdpBroadcaster(InetAddress address, int port, int ttl)
+            throws IOException, JdpException {
+        this(address, null, port, ttl);
+    }
+
+    /**
+     * Broadcast pre-built packet
+     *
+     * @param packet - instance of JdpPacket
+     * @throws IOException
+     */
+    public void sendPacket(JdpPacket packet)
+            throws IOException {
+        byte[] data = packet.getPacketData();
+        // Unlike allocate/put wrap don't need a flip afterward
+        ByteBuffer b = ByteBuffer.wrap(data);
+        channel.send(b, new InetSocketAddress(addr, port));
+    }
+
+    /**
+     * Shutdown broadcaster and close underlying socket channel
+     *
+     * @throws IOException
+     */
+    public void shutdown() throws IOException {
+        channel.close();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/management/jdp/JdpController.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,198 @@
+/*
+ * 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.  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.jdp;
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.util.UUID;
+
+/**
+ * JdpController is responsible to create and manage a broadcast loop
+ *
+ * <p> Other part of code has no access to broadcast loop and have to use
+ * provided static methods
+ * {@link #startDiscoveryService(InetAddress,int,String,String) startDiscoveryService}
+ * and {@link #stopDiscoveryService() stopDiscoveryService}</p>
+ * <p>{@link #startDiscoveryService(InetAddress,int,String,String) startDiscoveryService} could be called multiple
+ * times as it stops the running service if it is necessary. Call to {@link #stopDiscoveryService() stopDiscoveryService}
+ * ignored if service isn't run</p>
+ *
+ *
+ * </p>
+ *
+ * <p> System properties below could be used to control broadcast loop behavior.
+ * Property below have to be set explicitly in command line. It's not possible to
+ * set it in management.config file.  Careless changes of these properties could
+ * lead to security or network issues.
+ * <ul>
+ *     <li>com.sun.management.jdp.ttl         - set ttl for broadcast packet</li>
+ *     <li>com.sun.management.jdp.pause       - set broadcast interval in seconds</li>
+ *     <li>com.sun.management.jdp.source_addr - an address of interface to use for broadcast</li>
+ * </ul>
+  </p>
+ * <p>null parameters values are filtered out on {@link JdpPacketWriter} level and
+ * corresponding keys are not placed to packet.</p>
+ */
+public final class JdpController {
+
+    private static class JDPControllerRunner implements Runnable {
+
+        private final JdpJmxPacket packet;
+        private final JdpBroadcaster bcast;
+        private final int pause;
+        private volatile boolean shutdown = false;
+
+        private JDPControllerRunner(JdpBroadcaster bcast, JdpJmxPacket packet, int pause) {
+            this.bcast = bcast;
+            this.packet = packet;
+            this.pause = pause;
+        }
+
+        @Override
+        public void run() {
+            try {
+                while (!shutdown) {
+                    bcast.sendPacket(packet);
+                    try {
+                        Thread.sleep(this.pause);
+                    } catch (InterruptedException e) {
+                        // pass
+                    }
+                }
+
+            } catch (IOException e) {
+              // pass;
+            }
+
+            // It's not possible to re-use controller,
+            // nevertheless reset shutdown variable
+            try {
+                stop();
+                bcast.shutdown();
+            } catch (IOException ex) {
+                // pass - ignore IOException during shutdown
+            }
+        }
+
+        public void stop() {
+            shutdown = true;
+        }
+    }
+    private static JDPControllerRunner controller = null;
+
+    private JdpController(){
+        // Don't allow to instantiate this class.
+    }
+
+    // Utility to handle optional system properties
+    // Parse an integer from string or return default if provided string is null
+    private static int getInteger(String val, int dflt, String msg) throws JdpException {
+        try {
+            return (val == null) ? dflt : Integer.parseInt(val);
+        } catch (NumberFormatException ex) {
+            throw new JdpException(msg);
+        }
+    }
+
+    // Parse an inet address from string or return default if provided string is null
+    private static InetAddress getInetAddress(String val, InetAddress dflt, String msg) throws JdpException {
+        try {
+            return (val == null) ? dflt : InetAddress.getByName(val);
+        } catch (UnknownHostException ex) {
+            throw new JdpException(msg);
+        }
+    }
+
+    /**
+     * Starts discovery service
+     *
+     * @param address - multicast group address
+     * @param port - udp port to use
+     * @param instanceName - name of running JVM instance
+     * @param url - JMX service url
+     * @throws IOException
+     */
+    public static synchronized void startDiscoveryService(InetAddress address, int port, String instanceName, String url)
+            throws IOException, JdpException {
+
+        // Limit packet to local subnet by default
+        int ttl = getInteger(
+                System.getProperty("com.sun.management.jdp.ttl"), 1,
+                "Invalid jdp packet ttl");
+
+        // Broadcast once a 5 seconds by default
+        int pause = getInteger(
+                System.getProperty("com.sun.management.jdp.pause"), 5,
+                "Invalid jdp pause");
+
+        // Converting seconds to milliseconds
+        pause = pause * 1000;
+
+        // Allow OS to choose broadcast source
+        InetAddress sourceAddress = getInetAddress(
+                System.getProperty("com.sun.management.jdp.source_addr"), null,
+                "Invalid source address provided");
+
+        // Generate session id
+        UUID id = UUID.randomUUID();
+
+        JdpJmxPacket packet = new JdpJmxPacket(id, url);
+
+        // Don't broadcast whole command line for security reason.
+        // Strip everything after first space
+        String javaCommand = System.getProperty("sun.java.command");
+        if (javaCommand != null) {
+            String[] arr = javaCommand.split(" ", 2);
+            packet.setMainClass(arr[0]);
+        }
+
+        // Put optional explicit java instance name to packet, if user doesn't specify
+        // it the key is skipped. PacketWriter is responsible to skip keys having null value.
+        packet.setInstanceName(instanceName);
+
+        JdpBroadcaster bcast = new JdpBroadcaster(address, sourceAddress, port, ttl);
+
+        // Stop discovery service if it's already running
+        stopDiscoveryService();
+
+        controller = new JDPControllerRunner(bcast, packet, pause);
+
+        Thread t = new Thread(controller, "JDP broadcaster");
+        t.setDaemon(true);
+        t.start();
+    }
+
+    /**
+     * Stop running discovery service,
+     * it's safe to attempt to stop not started service
+     */
+    public static synchronized void stopDiscoveryService() {
+        if ( controller != null ){
+             controller.stop();
+             controller = null;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/management/jdp/JdpException.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,42 @@
+/*
+ * 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.  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.jdp;
+
+/**
+ * An Exception thrown if a JDP implementation encounters a problem.
+ */
+public final class JdpException extends Exception {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * Construct a new JDP exception with a meaningful message
+     *
+     * @param msg - message
+     */
+    public JdpException(String msg) {
+        super(msg);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/management/jdp/JdpGenericPacket.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,97 @@
+/*
+ * 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.  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.jdp;
+
+/**
+ * JdpGenericPacket responsible to provide fields
+ * common for all Jdp packets
+ */
+public abstract class JdpGenericPacket implements JdpPacket {
+
+    /**
+     * JDP protocol magic. Magic allows a reader to quickly select
+     * JDP packets from a bunch of broadcast packets addressed to the same port
+     * and broadcast group. Any packet intended to be parsed by JDP client
+     * has to start from this  magic.
+     */
+    private static final int MAGIC = 0xC0FFEE42;
+
+    /**
+     * Current version of protocol. Any implementation of this protocol has to
+     * conform with the packet structure and the flow described in JEP-168
+     */
+    private static final short PROTOCOL_VERSION = 1;
+
+    /**
+     * Default do-nothing constructor
+     */
+    protected  JdpGenericPacket(){
+        // do nothing
+    }
+
+
+    /**
+     * Validate protocol header magic field
+     *
+     * @param magic - value to validate
+     * @throws JdpException
+     */
+    public static void checkMagic(int magic)
+            throws JdpException {
+        if (magic != MAGIC) {
+            throw new JdpException("Invalid JDP magic header: " + magic);
+        }
+    }
+
+    /**
+     * Validate protocol header version field
+     *
+     * @param version - value to validate
+     * @throws JdpException
+     */
+    public static void checkVersion(short version)
+            throws JdpException {
+
+        if (version > PROTOCOL_VERSION) {
+            throw new JdpException("Unsupported protocol version: " + version);
+        }
+    }
+
+    /**
+     *
+     * @return protocol magic
+     */
+    public static int getMagic() {
+        return MAGIC;
+    }
+
+    /**
+     *
+     * @return current protocol version
+     */
+    public static short getVersion() {
+        return PROTOCOL_VERSION;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/management/jdp/JdpJmxPacket.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,198 @@
+/*
+ * 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.  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.jdp;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.UUID;
+
+/**
+ * A packet to broadcasts JMX URL
+ *
+ * Fields:
+ *
+ * <ul>
+ * <li>UUID - broadcast session ID, changed every time when we start/stop
+ * discovery service</li>
+ * <li>JMX_URL - URL to connect to JMX service</li>
+ * <li>MAIN_CLASS - optional name of main class, filled from sun.java.command stripped for
+ * security reason to first space</li>
+ * <li>INSTANCE_NAME - optional custom name of particular instance as provided by customer</li>
+ * </ul>
+ */
+public final class JdpJmxPacket
+       extends JdpGenericPacket
+       implements JdpPacket {
+
+    /**
+     * Session ID
+     */
+    public final static String UUID_KEY = "DISCOVERABLE_SESSION_UUID";
+    /**
+     * Name of main class
+     */
+    public final static String MAIN_CLASS_KEY = "MAIN_CLASS";
+    /**
+     * JMX service URL
+     */
+    public final static String JMX_SERVICE_URL_KEY = "JMX_SERVICE_URL";
+    /**
+     * Name of Java instance
+     */
+    public final static String INSTANCE_NAME_KEY = "INSTANCE_NAME";
+
+    private UUID id;
+    private String mainClass;
+    private String jmxServiceUrl;
+    private String instanceName;
+
+    /**
+     * Create new instance from user provided data. Set mandatory fields
+     *
+     * @param id - java instance id
+     * @param jmxServiceUrl - JMX service url
+     */
+    public JdpJmxPacket(UUID id, String jmxServiceUrl) {
+        this.id = id;
+        this.jmxServiceUrl = jmxServiceUrl;
+    }
+
+    /**
+     * Create new instance from network data Parse packet and set fields.
+     *
+     * @param data - raw packet data as it came from a Net
+     * @throws JdpException
+     */
+    public JdpJmxPacket(byte[] data)
+            throws JdpException {
+        JdpPacketReader reader;
+
+        reader = new JdpPacketReader(data);
+        Map<String, String> p = reader.getDiscoveryDataAsMap();
+
+        String sId = p.get(UUID_KEY);
+        this.id = (sId == null) ? null : UUID.fromString(sId);
+        this.jmxServiceUrl = p.get(JMX_SERVICE_URL_KEY);
+        this.mainClass = p.get(MAIN_CLASS_KEY);
+        this.instanceName = p.get(INSTANCE_NAME_KEY);
+    }
+
+    /**
+     * Set main class field
+     *
+     * @param mainClass - main class of running app
+     */
+    public void setMainClass(String mainClass) {
+        this.mainClass = mainClass;
+    }
+
+    /**
+     * Set instance name field
+     *
+     * @param instanceName - name of instance as provided by customer
+     */
+    public void setInstanceName(String instanceName) {
+        this.instanceName = instanceName;
+    }
+
+    /**
+     * @return id of discovery session
+     */
+    public UUID getId() {
+        return id;
+    }
+
+    /**
+     *
+     * @return main class field
+     */
+    public String getMainClass() {
+        return mainClass;
+    }
+
+    /**
+     *
+     * @return JMX service URL
+     */
+    public String getJmxServiceUrl() {
+        return jmxServiceUrl;
+    }
+
+    /**
+     *
+     * @return instance name
+     */
+    public String getInstanceName() {
+        return instanceName;
+    }
+
+    /**
+     *
+     * @return assembled packet ready to be sent across a Net
+     * @throws IOException
+     */
+    @Override
+    public byte[] getPacketData() throws IOException {
+        // Assemble packet from fields to byte array
+        JdpPacketWriter writer;
+        writer = new JdpPacketWriter();
+        writer.addEntry(UUID_KEY, (id == null) ? null : id.toString());
+        writer.addEntry(MAIN_CLASS_KEY, mainClass);
+        writer.addEntry(JMX_SERVICE_URL_KEY, jmxServiceUrl);
+        writer.addEntry(INSTANCE_NAME_KEY, instanceName);
+        return writer.getPacketBytes();
+    }
+
+    /**
+     *
+     * @return packet hash code
+     */
+    @Override
+    public int hashCode() {
+        int hash = 1;
+        hash = hash * 31 + id.hashCode();
+        hash = hash * 31 + jmxServiceUrl.hashCode();
+        return hash;
+    }
+
+    /**
+     * Compare two packets
+     *
+     * @param o - packet to compare
+     * @return either packet equals or not
+     */
+    @Override
+    public boolean equals(Object o) {
+
+        if (o == null || ! (o instanceof JdpJmxPacket) ){
+            return false;
+        }
+
+        JdpJmxPacket p = (JdpJmxPacket) o;
+        return  Objects.equals(id, p.getId()) && Objects.equals(jmxServiceUrl, p.getJmxServiceUrl());
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/management/jdp/JdpPacket.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,64 @@
+/*
+ * 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.  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.jdp;
+
+import java.io.IOException;
+
+/**
+ * Packet to broadcast
+ *
+ * <p>Each packet have to contain MAGIC and PROTOCOL_VERSION in order to be
+ * recognized as a valid JDP packet.</p>
+ *
+ * <p>Default implementation build packet as a set of UTF-8 encoded Key/Value pairs
+ * are stored as an ordered list of values, and are sent to the server
+ * in that order.</p>
+ *
+ * <p>
+ * Packet structure:
+ *
+ * 4 bytes JDP magic (0xC0FFE42)
+ * 2 bytes JDP protocol version (01)
+ *
+ * 2 bytes size of key
+ * x bytes key (UTF-8 encoded)
+ * 2 bytes size of value
+ * x bytes value (UTF-8 encoded)
+ *
+ * repeat as many times as necessary ...
+ * </p>
+  */
+public interface JdpPacket {
+
+    /**
+     * This method responsible to assemble packet and return a byte array
+     * ready to be sent across a Net.
+     *
+     * @return assembled packet as an array of bytes
+     * @throws IOException
+     */
+    public byte[] getPacketData() throws IOException;
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/management/jdp/JdpPacketReader.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,141 @@
+/*
+ * 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.  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.jdp;
+
+import java.io.ByteArrayInputStream;
+import java.io.DataInputStream;
+import java.io.EOFException;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * JdpPacketReader responsible for reading a packet <p>This class gets a byte
+ * array as it came from a Net, validates it and breaks a part </p>
+ */
+public final class JdpPacketReader {
+
+    private final DataInputStream pkt;
+    private Map<String, String> pmap = null;
+
+    /**
+     * Create packet reader, extract and check magic and version
+     *
+     * @param packet - packet received from a Net
+     * @throws JdpException
+     */
+    public JdpPacketReader(byte[] packet)
+            throws JdpException {
+        ByteArrayInputStream bais = new ByteArrayInputStream(packet);
+        pkt = new DataInputStream(bais);
+
+        try {
+            int magic = pkt.readInt();
+            JdpGenericPacket.checkMagic(magic);
+        } catch (IOException e) {
+            throw new JdpException("Invalid JDP packet received, bad magic");
+        }
+
+        try {
+            short version = pkt.readShort();
+            JdpGenericPacket.checkVersion(version);
+        } catch (IOException e) {
+            throw new JdpException("Invalid JDP packet received, bad protocol version");
+        }
+    }
+
+    /**
+     * Get next entry from packet
+     *
+     * @return the entry
+     * @throws EOFException
+     * @throws JdpException
+     */
+    public String getEntry()
+            throws EOFException, JdpException {
+
+        try {
+            short len = pkt.readShort();
+            // Artificial setting the "len" field to Short.MAX_VALUE may cause a reader to allocate
+            // to much memory. Prevent this possible DOS attack.
+            if (len < 1 && len > pkt.available()) {
+                throw new JdpException("Broken JDP packet. Invalid entry length field.");
+            }
+
+            byte[] b = new byte[len];
+            if (pkt.read(b) != len) {
+                throw new JdpException("Broken JDP packet. Unable to read entry.");
+            }
+            return new String(b, "UTF-8");
+
+        } catch (EOFException e) {
+            throw e;
+        } catch (UnsupportedEncodingException ex) {
+            throw new JdpException("Broken JDP packet. Unable to decode entry.");
+        } catch (IOException e) {
+            throw new JdpException("Broken JDP packet. Unable to read entry.");
+        }
+
+
+    }
+
+    /**
+     * return packet content as a key/value map
+     *
+     * @return map containing packet entries pair of entries treated as
+     * key,value
+     * @throws IOException
+     * @throws JdpException
+     */
+    public Map<String, String> getDiscoveryDataAsMap()
+            throws JdpException {
+        // return cached map if possible
+        if (pmap != null) {
+            return pmap;
+        }
+
+        String key = null, value = null;
+
+        final Map<String, String> tmpMap = new HashMap<>();
+        try {
+            while (true) {
+                key = getEntry();
+                value = getEntry();
+                tmpMap.put(key, value);
+            }
+        } catch (EOFException e) {
+            // EOF reached on reading value, report broken packet
+            // otherwise ignore it.
+            if (value == null) {
+                throw new JdpException("Broken JDP packet. Key without value." + key);
+            }
+        }
+
+        pmap = Collections.unmodifiableMap(tmpMap);
+        return pmap;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/management/jdp/JdpPacketWriter.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,98 @@
+/*
+ * 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.  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.jdp;
+
+import java.io.ByteArrayOutputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+/**
+ * JdpPacketWriter responsible for writing a packet
+ * <p>This class assembles a set of key/value pairs to valid JDP packet,
+ * ready to be sent across a Net</p>
+ */
+public final class JdpPacketWriter {
+
+    private final ByteArrayOutputStream baos;
+    private final DataOutputStream pkt;
+
+    /**
+     * Create a JDP packet, add mandatory magic and version headers
+     *
+     * @throws IOException
+     */
+    public JdpPacketWriter()
+            throws IOException {
+        baos = new ByteArrayOutputStream();
+        pkt = new DataOutputStream(baos);
+
+        pkt.writeInt(JdpGenericPacket.getMagic());
+        pkt.writeShort(JdpGenericPacket.getVersion());
+    }
+
+    /**
+     * Put string entry to packet
+     *
+     * @param entry - string to put (utf-8 encoded)
+     * @throws IOException
+     */
+    public void addEntry(String entry)
+            throws IOException {
+        /* DataOutputStream.writeUTF() do essentially
+         *  the same as:
+         *    pkt.writeShort(entry.getBytes("UTF-8").length);
+         *    pkt.write(entry.getBytes("UTF-8"));
+         */
+        pkt.writeUTF(entry);
+    }
+
+    /**
+     * Put key/value pair to packet
+     *
+     * @param key - key to put (utf-8 encoded)
+     * @param val - value to put (utf-8 encoded)
+     * @throws IOException
+     */
+    public void addEntry(String key, String val)
+            throws IOException {
+        /* Silently skip key if value is null.
+         * We don't need to distinguish between key missing
+         * and key has no value cases
+         */
+        if (val != null) {
+            addEntry(key);
+            addEntry(val);
+        }
+    }
+
+    /**
+     * Return assembled packet as a byte array
+     *
+     * @return packet bytes
+     */
+    public byte[] getPacketBytes() {
+        return baos.toByteArray();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/management/jdp/package-info.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,79 @@
+/*
+ * 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.  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.
+ */
+/**
+ *  Summary
+ *  -------
+ *
+ *  Define a lightweight network protocol for discovering running and
+ *  manageable Java processes within a network subnet.
+ *
+ *
+ * Description
+ * -----------
+ *
+ * The protocol is lightweight multicast based, and works like a beacon,
+ * broadcasting the JMXService URL needed to connect to the external JMX
+ * agent if an application is started with appropriate parameters.
+ *
+ * The payload is structured like this:
+ *
+ *  4 bytes JDP magic (0xC0FFEE42)
+ *  2 bytes JDP protocol version (1)
+ *  2 bytes size of the next entry
+ *      x bytes next entry (UTF-8 encoded)
+ *  2 bytes size of next entry
+ *    ...   Rinse and repeat...
+ *
+ * The payload will be parsed as even entries being keys, odd entries being
+ * values.
+ *
+ * The standard JDP packet contains four entries:
+ *
+ * - `DISCOVERABLE_SESSION_UUID` -- Unique id of the instance; this id changes every time
+ *    the discovery protocol starts and stops
+ *
+ * - `MAIN_CLASS` -- The value of the `sun.java.command` property
+ *
+ * - `JMX_SERVICE_URL` -- The URL to connect to the JMX agent
+ *
+ * - `INSTANCE_NAME` -- The user-provided name of the running instance
+ *
+ * The protocol sends packets to 224.0.23.178:7095 by default.
+ *
+ * The protocol uses system properties to control it's behaviour:
+ * - `com.sun.management.jdp.port` -- override default port
+ *
+ * - `com.sun.management.jdp.address` -- override default address
+ *
+ * - `com.sun.management.jmxremote.autodiscovery` -- whether we should start autodiscovery or
+ * not. Autodiscovery starts if and only if following conditions are met: (autodiscovery is
+ * true OR (autodiscovery is not set AND jdp.port is set))
+ *
+ * - `com.sun.management.jdp.ttl`         -- set ttl for broadcast packet, default is 1
+ * - `com.sun.management.jdp.pause`       -- set broadcast interval in seconds default is 5
+ * - `com.sun.management.jdp.source_addr` -- an address of interface to use for broadcast
+ */
+
+package sun.management.jdp;
--- a/src/share/classes/sun/management/resources/agent_de.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/management/resources/agent_de.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -53,13 +53,13 @@
 agent.err.file.not.found             = Datei wurde nicht gefunden
 agent.err.file.access.not.restricted = Lesezugriff auf Datei muss eingeschr\u00E4nkt werden
 
-agent.err.password.file.notset     = Es wurde keine Kennwortdatei angegeben, obwohl com.sun.management.jmxremote.authenticate auf \"true\" gesetzt ist
+agent.err.password.file.notset     = Es wurde keine Kennwortdatei angegeben, obwohl com.sun.management.jmxremote.authenticate auf "true" gesetzt ist
 agent.err.password.file.not.readable = Kennwortdatei nicht lesbar
 agent.err.password.file.read.failed = Kennwortdatei konnte nicht gelesen werden
 agent.err.password.file.notfound   = Kennwortdatei nicht gefunden
 agent.err.password.file.access.notrestricted = Lesezugriff auf Kennwortdatei muss eingeschr\u00E4nkt werden
 
-agent.err.access.file.notset       = Es wurde keine Zugriffsdatei angegeben, obwohl com.sun.management.jmxremote.authenticate auf \"true\" gesetzt ist
+agent.err.access.file.notset       = Es wurde keine Zugriffsdatei angegeben, obwohl com.sun.management.jmxremote.authenticate auf "true" gesetzt ist
 agent.err.access.file.not.readable = Zugriffsdatei kann nicht gelesen werden
 agent.err.access.file.read.failed  = Zugriffsdatei konnte nicht gelesen werden
 agent.err.access.file.notfound     = Zugriffsdatei nicht gefunden
@@ -70,7 +70,7 @@
 agent.err.invalid.snmp.port        = Ung\u00FCltige Nummer f\u00FCr com.sun.management.snmp.port
 agent.err.invalid.snmp.trap.port   = Ung\u00FCltige Nummer f\u00FCr com.sun.management.snmp.trap
 agent.err.unknown.snmp.interface   = Unbekannte SNMP-Schnittstelle
-agent.err.acl.file.notset          = Es wurde keine SNMP-ACL-Datei angegeben, obwohl com.sun.management.snmp.acl auf \"true\" gesetzt ist
+agent.err.acl.file.notset          = Es wurde keine SNMP-ACL-Datei angegeben, obwohl com.sun.management.snmp.acl auf "true" gesetzt ist
 agent.err.acl.file.notfound        = SNMP-ACL-Datei konnte nicht gefunden werden
 agent.err.acl.file.not.readable    = SNMP-ACL-Datei kann nicht gelesen werden
 agent.err.acl.file.read.failed     = SNMP-ACL-Datei konnte nicht gelesen werden
--- a/src/share/classes/sun/misc/Hashing.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/misc/Hashing.java	Fri Jun 21 19:11:42 2013 -0700
@@ -24,7 +24,7 @@
  */
 package sun.misc;
 
-import java.util.Random;
+import java.util.concurrent.ThreadLocalRandom;
 
 /**
  * Hashing utilities.
@@ -213,18 +213,6 @@
     private static class Holder {
 
         /**
-         * Used for generating per-instance hash seeds.
-         *
-         * We try to improve upon the default seeding.
-         */
-        static final Random SEED_MAKER = new Random(
-                Double.doubleToRawLongBits(Math.random())
-                ^ System.identityHashCode(Hashing.class)
-                ^ System.currentTimeMillis()
-                ^ System.nanoTime()
-                ^ Runtime.getRuntime().freeMemory());
-
-        /**
          * Access to {@code String.hash32()}
          */
         static final JavaLangAccess LANG_ACCESS;
@@ -248,10 +236,17 @@
         return Holder.LANG_ACCESS.getStringHash32(string);
     }
 
+    /**
+     * Return a non-zero 32-bit pseudo random value. The {@code instance} object
+     * may be used as part of the value.
+     *
+     * @param instance an object to use if desired in choosing value.
+     * @return a non-zero 32-bit pseudo random value.
+     */
     public static int randomHashSeed(Object instance) {
         int seed;
         if (sun.misc.VM.isBooted()) {
-            seed = Holder.SEED_MAKER.nextInt();
+            seed = ThreadLocalRandom.current().nextInt();
         } else {
             // lower quality "random" seed value--still better than zero and not
             // not practically reversible.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/misc/IoTrace.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,170 @@
+/*
+ * 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.  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.misc;
+
+import java.net.InetAddress;
+
+/**
+ * Utility class used to identify trace points for I/O calls.
+ * <p>
+ * To use this class, a diagnostic tool must redefine this class with a version
+ * that contains calls to the the diagnostic tool. This implementation will then
+ * receive callbacks when file and socket operations are performed. The reason
+ * for requiring a redefine of the class is to avoid any overhead caused by the
+ * instrumentation.
+ * <p>
+ * The xxBegin() methods return a "context". This can be any Object. This
+ * context will be passed to the corresponding xxEnd() method. This way, an
+ * implementation can correlate the beginning of an operation with the end.
+ * <p>
+ * It is possible for a xxEnd() method to be called with a null handle. This
+ * happens if tracing was started between the call to xxBegin() and xxEnd(), in
+ * which case xxBegin() would not have been called. It is the implementation's
+ * responsibility to not throw an exception in this case.
+ * <p>
+ * Only blocking I/O operations are identified with this facility.
+ * <p>
+ * <b>Warning</b>
+ * <p>
+ * These methods are called from sensitive points in the I/O subsystem. Great
+ * care must be taken to not interfere with ongoing operations or cause
+ * deadlocks. In particular:
+ * <ul>
+ * <li>Implementations must not throw exceptions since this will cause
+ * disruptions to the I/O operations.
+ * <li>Implementations must not do I/O operations since this will lead to an
+ * endless loop.
+ * <li>Since the hooks may be called while holding low-level locks in the I/O
+ * subsystem, implementations must be careful with synchronization or
+ * interaction with other threads to avoid deadlocks in the VM.
+ * </ul>
+ */
+public final class IoTrace {
+    private IoTrace() {
+    }
+
+    /**
+     * Called before data is read from a socket.
+     *
+     * @return a context object
+     */
+    public static Object socketReadBegin() {
+        return null;
+    }
+
+    /**
+     * Called after data is read from the socket.
+     *
+     * @param context
+     *            the context returned by the previous call to socketReadBegin()
+     * @param address
+     *            the remote address the socket is bound to
+     * @param port
+     *            the remote port the socket is bound to
+     * @param timeout
+     *            the SO_TIMEOUT value of the socket (in milliseconds) or 0 if
+     *            there is no timeout set
+     * @param bytesRead
+     *            the number of bytes read from the socket, 0 if there was an
+     *            error reading from the socket
+     */
+    public static void socketReadEnd(Object context, InetAddress address, int port,
+                                     int timeout, long bytesRead) {
+    }
+
+    /**
+     * Called before data is written to a socket.
+     *
+     * @return a context object
+     */
+    public static Object socketWriteBegin() {
+        return null;
+    }
+
+    /**
+     * Called after data is written to a socket.
+     *
+     * @param context
+     *            the context returned by the previous call to
+     *            socketWriteBegin()
+     * @param address
+     *            the remote address the socket is bound to
+     * @param port
+     *            the remote port the socket is bound to
+     * @param bytesWritten
+     *            the number of bytes written to the socket, 0 if there was an
+     *            error writing to the socket
+     */
+    public static void socketWriteEnd(Object context, InetAddress address, int port,
+                                      long bytesWritten) {
+    }
+
+    /**
+     * Called before data is read from a file.
+     *
+     * @param path
+     *            the path of the file
+     * @return a context object
+     */
+    public static Object fileReadBegin(String path) {
+        return null;
+    }
+
+    /**
+     * Called after data is read from a file.
+     *
+     * @param context
+     *            the context returned by the previous call to fileReadBegin()
+     * @param bytesRead
+     *            the number of bytes written to the file, 0 if there was an
+     *            error writing to the file
+     */
+    public static void fileReadEnd(Object context, long bytesRead) {
+    }
+
+    /**
+     * Called before data is written to a file.
+     *
+     * @param path
+     *            the path of the file
+     * @return a context object
+     */
+    public static Object fileWriteBegin(String path) {
+        return null;
+    }
+
+    /**
+     * Called after data is written to a file.
+     *
+     * @param context
+     *            the context returned by the previous call to fileReadBegin()
+     * @param bytesWritten
+     *            the number of bytes written to the file, 0 if there was an
+     *            error writing to the file
+     */
+    public static void fileWriteEnd(Object context, long bytesWritten) {
+    }
+}
--- a/src/share/classes/sun/misc/Unsafe.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/misc/Unsafe.java	Fri Jun 21 19:11:42 2013 -0700
@@ -682,6 +682,14 @@
     public native Object staticFieldBase(Field f);
 
     /**
+     * Detect if the given class may need to be initialized. This is often
+     * needed in conjunction with obtaining the static field base of a
+     * class.
+     * @return false only if a call to {@code ensureClassInitialized} would have no effect
+     */
+    public native boolean shouldBeInitialized(Class<?> c);
+
+    /**
      * Ensure the given class has been initialized. This is often
      * needed in conjunction with obtaining the static field base of a
      * class.
--- a/src/share/classes/sun/misc/VM.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/misc/VM.java	Fri Jun 21 19:11:42 2013 -0700
@@ -371,6 +371,12 @@
     private final static int JVMTI_THREAD_STATE_WAITING_INDEFINITELY = 0x0010;
     private final static int JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT = 0x0020;
 
+    /*
+     * Returns the first non-null class loader up the execution stack,
+     * or null if only code from the null class loader is on the stack.
+     */
+    public static native ClassLoader latestUserDefinedLoader();
+
     static {
         initialize();
     }
--- a/src/share/classes/sun/net/ftp/impl/FtpClient.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/net/ftp/impl/FtpClient.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1314,16 +1314,16 @@
      *         <code>null</code> if the command was unsuccessful.
      * @throws IOException if an error occured during the transmission.
      */
-    public OutputStream putFileStream(String name, boolean unique) throws sun.net.ftp.FtpProtocolException, IOException {
+    public OutputStream putFileStream(String name, boolean unique)
+        throws sun.net.ftp.FtpProtocolException, IOException
+    {
         String cmd = unique ? "STOU " : "STOR ";
         Socket s = openDataConnection(cmd + name);
         if (s == null) {
             return null;
         }
-        if (type == TransferType.BINARY) {
-            return s.getOutputStream();
-        }
-        return new sun.net.TelnetOutputStream(s.getOutputStream(), false);
+        boolean bm = (type == TransferType.BINARY);
+        return new sun.net.TelnetOutputStream(s.getOutputStream(), bm);
     }
 
     /**
--- a/src/share/classes/sun/net/spi/DefaultProxySelector.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/net/spi/DefaultProxySelector.java	Fri Jun 21 19:11:42 2013 -0700
@@ -346,5 +346,5 @@
     }
 
     private native static boolean init();
-    private native Proxy getSystemProxy(String protocol, String host);
+    private synchronized native Proxy getSystemProxy(String protocol, String host);
 }
--- a/src/share/classes/sun/net/www/MessageHeader.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/net/www/MessageHeader.java	Fri Jun 21 19:11:42 2013 -0700
@@ -148,7 +148,7 @@
         for (int i=0; i<nkeys; i++) {
             if (k.equalsIgnoreCase(keys[i])
                     && values[i] != null && values[i].length() > 5
-                    && values[i].substring(0, 5).equalsIgnoreCase("NTLM ")) {
+                    && values[i].regionMatches(true, 0, "NTLM ", 0, 5)) {
                 found = true;
                 break;
             }
--- a/src/share/classes/sun/net/www/http/HttpClient.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/net/www/http/HttpClient.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 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
@@ -36,6 +36,7 @@
 import sun.net.www.ParseUtil;
 import sun.net.www.protocol.http.HttpURLConnection;
 import sun.util.logging.PlatformLogger;
+import static sun.net.www.protocol.http.HttpURLConnection.TunnelState.*;
 
 /**
  * @author Herb Jellinek
@@ -45,7 +46,7 @@
     // whether this httpclient comes from the cache
     protected boolean cachedHttpClient = false;
 
-    private boolean inCache;
+    protected boolean inCache;
 
     // Http requests we send
     MessageHeader requests;
@@ -120,7 +121,14 @@
     public boolean reuse = false;
 
     // Traffic capture tool, if configured. See HttpCapture class for info
-     private HttpCapture capture = null;
+    private HttpCapture capture = null;
+
+    private static final PlatformLogger logger = HttpURLConnection.getHttpLogger();
+    private static void logFinest(String msg) {
+        if (logger.isLoggable(PlatformLogger.FINEST)) {
+            logger.finest(msg);
+        }
+    }
 
     /**
      * A NOP method kept for backwards binary compatibility
@@ -244,16 +252,17 @@
      */
     public static HttpClient New(URL url)
     throws IOException {
-        return HttpClient.New(url, Proxy.NO_PROXY, -1, true);
+        return HttpClient.New(url, Proxy.NO_PROXY, -1, true, null);
     }
 
     public static HttpClient New(URL url, boolean useCache)
         throws IOException {
-        return HttpClient.New(url, Proxy.NO_PROXY, -1, useCache);
+        return HttpClient.New(url, Proxy.NO_PROXY, -1, useCache, null);
     }
 
-    public static HttpClient New(URL url, Proxy p, int to, boolean useCache)
-        throws IOException {
+    public static HttpClient New(URL url, Proxy p, int to, boolean useCache,
+        HttpURLConnection httpuc) throws IOException
+    {
         if (p == null) {
             p = Proxy.NO_PROXY;
         }
@@ -261,6 +270,16 @@
         /* see if one's already around */
         if (useCache) {
             ret = kac.get(url, null);
+            if (ret != null && httpuc != null &&
+                httpuc.streaming() &&
+                httpuc.getRequestMethod() == "POST") {
+                if (!ret.available()) {
+                    ret.inCache = false;
+                    ret.closeServer();
+                    ret = null;
+                }
+            }
+
             if (ret != null) {
                 if ((ret.proxy != null && ret.proxy.equals(p)) ||
                     (ret.proxy == null && p == null)) {
@@ -268,10 +287,9 @@
                         ret.cachedHttpClient = true;
                         assert ret.inCache;
                         ret.inCache = false;
-                        PlatformLogger logger = HttpURLConnection.getHttpLogger();
-                        if (logger.isLoggable(PlatformLogger.FINEST)) {
-                            logger.finest("KeepAlive stream retrieved from the cache, " + ret);
-                        }
+                        if (httpuc != null && ret.needsTunneling())
+                            httpuc.setTunnelState(TUNNELING);
+                        logFinest("KeepAlive stream retrieved from the cache, " + ret);
                     }
                 } else {
                     // We cannot return this connection to the cache as it's
@@ -302,20 +320,25 @@
         return ret;
     }
 
-    public static HttpClient New(URL url, Proxy p, int to) throws IOException {
-        return New(url, p, to, true);
+    public static HttpClient New(URL url, Proxy p, int to,
+        HttpURLConnection httpuc) throws IOException
+    {
+        return New(url, p, to, true, httpuc);
     }
 
     public static HttpClient New(URL url, String proxyHost, int proxyPort,
                                  boolean useCache)
         throws IOException {
-        return New(url, newHttpProxy(proxyHost, proxyPort, "http"), -1, useCache);
+        return New(url, newHttpProxy(proxyHost, proxyPort, "http"),
+            -1, useCache, null);
     }
 
     public static HttpClient New(URL url, String proxyHost, int proxyPort,
-                                 boolean useCache, int to)
+                                 boolean useCache, int to,
+                                 HttpURLConnection httpuc)
         throws IOException {
-        return New(url, newHttpProxy(proxyHost, proxyPort, "http"), to, useCache);
+        return New(url, newHttpProxy(proxyHost, proxyPort, "http"),
+            to, useCache, httpuc);
     }
 
     /* return it to the cache as still usable, if:
@@ -344,6 +367,37 @@
         }
     }
 
+    protected synchronized boolean available() {
+        boolean available = true;
+        int old = -1;
+
+        try {
+            try {
+                old = serverSocket.getSoTimeout();
+                serverSocket.setSoTimeout(1);
+                BufferedInputStream tmpbuf =
+                        new BufferedInputStream(serverSocket.getInputStream());
+                int r = tmpbuf.read();
+                if (r == -1) {
+                    logFinest("HttpClient.available(): " +
+                            "read returned -1: not available");
+                    available = false;
+                }
+            } catch (SocketTimeoutException e) {
+                logFinest("HttpClient.available(): " +
+                        "SocketTimeout: its available");
+            } finally {
+                if (old != -1)
+                    serverSocket.setSoTimeout(old);
+            }
+        } catch (IOException e) {
+            logFinest("HttpClient.available(): " +
+                        "SocketException: not available");
+            available = false;
+        }
+        return available;
+    }
+
     protected synchronized void putInKeepAliveCache() {
         if (inCache) {
             assert false : "Duplicate put to keep alive cache";
@@ -821,10 +875,7 @@
 
             if (isKeepingAlive())   {
                 // Wrap KeepAliveStream if keep alive is enabled.
-                PlatformLogger logger = HttpURLConnection.getHttpLogger();
-                if (logger.isLoggable(PlatformLogger.FINEST)) {
-                    logger.finest("KeepAlive stream used: " + url);
-                }
+                logFinest("KeepAlive stream used: " + url);
                 serverInput = new KeepAliveStream(serverInput, pi, cl, this);
                 failedOnce = false;
             }
--- a/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 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
@@ -349,7 +349,7 @@
     private HttpClient reuseClient = null;
 
     /* Tunnel states */
-    enum TunnelState {
+    public enum TunnelState {
         /* No tunnel */
         NONE,
 
@@ -660,7 +660,7 @@
      */
     protected void setNewClient (URL url, boolean useCache)
         throws IOException {
-        http = HttpClient.New(url, null, -1, useCache, connectTimeout);
+        http = HttpClient.New(url, null, -1, useCache, connectTimeout, this);
         http.setReadTimeout(readTimeout);
     }
 
@@ -701,7 +701,8 @@
                                            String proxyHost, int proxyPort,
                                            boolean useCache)
         throws IOException {
-        http = HttpClient.New (url, proxyHost, proxyPort, useCache, connectTimeout);
+        http = HttpClient.New (url, proxyHost, proxyPort, useCache,
+            connectTimeout, this);
         http.setReadTimeout(readTimeout);
     }
 
@@ -992,14 +993,14 @@
     // subclass HttpsClient will overwrite & return an instance of HttpsClient
     protected HttpClient getNewHttpClient(URL url, Proxy p, int connectTimeout)
         throws IOException {
-        return HttpClient.New(url, p, connectTimeout);
+        return HttpClient.New(url, p, connectTimeout, this);
     }
 
     // subclass HttpsClient will overwrite & return an instance of HttpsClient
     protected HttpClient getNewHttpClient(URL url, Proxy p,
                                           int connectTimeout, boolean useCache)
         throws IOException {
-        return HttpClient.New(url, p, connectTimeout, useCache);
+        return HttpClient.New(url, p, connectTimeout, useCache, this);
     }
 
     private void expect100Continue() throws IOException {
@@ -1142,7 +1143,7 @@
         }
     }
 
-    private boolean streaming () {
+    public boolean streaming () {
         return (fixedContentLength != -1) || (fixedContentLengthLong != -1) ||
                (chunkLength != -1);
     }
@@ -1748,7 +1749,7 @@
      *
      * @param  the state
      */
-    void setTunnelState(TunnelState tunnelState) {
+    public void setTunnelState(TunnelState tunnelState) {
         this.tunnelState = tunnelState;
     }
 
@@ -2631,7 +2632,7 @@
                 multipleCookies = true;
             }
 
-            return retValue.length() == 0 ? null : retValue.toString();
+            return retValue.length() == 0 ? "" : retValue.toString();
         }
 
         return value;
--- a/src/share/classes/sun/net/www/protocol/https/AbstractDelegateHttpsURLConnection.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/net/www/protocol/https/AbstractDelegateHttpsURLConnection.java	Fri Jun 21 19:11:42 2013 -0700
@@ -96,7 +96,7 @@
         http = HttpsClient.New (getSSLSocketFactory(),
                                 url,
                                 getHostnameVerifier(),
-                                useCache);
+                                useCache, this);
         ((HttpsClient)http).afterConnect();
     }
 
@@ -149,7 +149,7 @@
         http = HttpsClient.New (getSSLSocketFactory(),
                                 url,
                                 getHostnameVerifier(),
-                                proxyHost, proxyPort, useCache);
+                                proxyHost, proxyPort, useCache, this);
         connected = true;
     }
 
@@ -189,7 +189,8 @@
     protected HttpClient getNewHttpClient(URL url, Proxy p, int connectTimeout)
         throws IOException {
         return HttpsClient.New(getSSLSocketFactory(), url,
-                               getHostnameVerifier(), p, true, connectTimeout);
+                               getHostnameVerifier(), p, true, connectTimeout,
+                               this);
     }
 
     // will open new connection
@@ -198,7 +199,7 @@
         throws IOException {
         return HttpsClient.New(getSSLSocketFactory(), url,
                                getHostnameVerifier(), p,
-                               useCache, connectTimeout);
+                               useCache, connectTimeout, this);
     }
 
     /**
--- a/src/share/classes/sun/net/www/protocol/https/HttpsClient.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/net/www/protocol/https/HttpsClient.java	Fri Jun 21 19:11:42 2013 -0700
@@ -30,6 +30,7 @@
 import java.io.UnsupportedEncodingException;
 import java.io.PrintStream;
 import java.io.BufferedOutputStream;
+import java.net.InetAddress;
 import java.net.Socket;
 import java.net.SocketException;
 import java.net.URL;
@@ -46,11 +47,15 @@
 
 import javax.net.ssl.*;
 import sun.net.www.http.HttpClient;
+import sun.net.www.protocol.http.HttpURLConnection;
 import sun.security.action.*;
 
 import sun.security.util.HostnameChecker;
 import sun.security.ssl.SSLSocketImpl;
 
+import sun.util.logging.PlatformLogger;
+import static sun.net.www.protocol.http.HttpURLConnection.TunnelState.*;
+
 
 /**
  * This class provides HTTPS client URL support, building on the standard
@@ -274,15 +279,17 @@
     // This code largely ripped off from HttpClient.New, and
     // it uses the same keepalive cache.
 
-    static HttpClient New(SSLSocketFactory sf, URL url, HostnameVerifier hv)
+    static HttpClient New(SSLSocketFactory sf, URL url, HostnameVerifier hv,
+                          HttpURLConnection httpuc)
             throws IOException {
-        return HttpsClient.New(sf, url, hv, true);
+        return HttpsClient.New(sf, url, hv, true, httpuc);
     }
 
     /** See HttpClient for the model for this method. */
     static HttpClient New(SSLSocketFactory sf, URL url,
-            HostnameVerifier hv, boolean useCache) throws IOException {
-        return HttpsClient.New(sf, url, hv, (String)null, -1, useCache);
+            HostnameVerifier hv, boolean useCache,
+            HttpURLConnection httpuc) throws IOException {
+        return HttpsClient.New(sf, url, hv, (String)null, -1, useCache, httpuc);
     }
 
     /**
@@ -290,37 +297,74 @@
      * the specified proxy server.
      */
     static HttpClient New(SSLSocketFactory sf, URL url, HostnameVerifier hv,
-                           String proxyHost, int proxyPort) throws IOException {
-        return HttpsClient.New(sf, url, hv, proxyHost, proxyPort, true);
+                           String proxyHost, int proxyPort,
+                           HttpURLConnection httpuc) throws IOException {
+        return HttpsClient.New(sf, url, hv, proxyHost, proxyPort, true, httpuc);
     }
 
     static HttpClient New(SSLSocketFactory sf, URL url, HostnameVerifier hv,
-                           String proxyHost, int proxyPort, boolean useCache)
+                           String proxyHost, int proxyPort, boolean useCache,
+                           HttpURLConnection httpuc)
         throws IOException {
-        return HttpsClient.New(sf, url, hv, proxyHost, proxyPort, useCache, -1);
+        return HttpsClient.New(sf, url, hv, proxyHost, proxyPort, useCache, -1,
+                               httpuc);
     }
 
     static HttpClient New(SSLSocketFactory sf, URL url, HostnameVerifier hv,
                           String proxyHost, int proxyPort, boolean useCache,
-                          int connectTimeout)
+                          int connectTimeout, HttpURLConnection httpuc)
         throws IOException {
 
         return HttpsClient.New(sf, url, hv,
                                (proxyHost == null? null :
                                 HttpsClient.newHttpProxy(proxyHost, proxyPort)),
-                               useCache, connectTimeout);
+                               useCache, connectTimeout, httpuc);
     }
 
     static HttpClient New(SSLSocketFactory sf, URL url, HostnameVerifier hv,
                           Proxy p, boolean useCache,
-                          int connectTimeout)
-        throws IOException {
+                          int connectTimeout, HttpURLConnection httpuc)
+        throws IOException
+    {
+        if (p == null) {
+            p = Proxy.NO_PROXY;
+        }
         HttpsClient ret = null;
         if (useCache) {
             /* see if one's already around */
             ret = (HttpsClient) kac.get(url, sf);
+            if (ret != null && httpuc != null &&
+                httpuc.streaming() &&
+                httpuc.getRequestMethod() == "POST") {
+                if (!ret.available())
+                    ret = null;
+            }
+
             if (ret != null) {
-                ret.cachedHttpClient = true;
+                if ((ret.proxy != null && ret.proxy.equals(p)) ||
+                    (ret.proxy == null && p == null)) {
+                    synchronized (ret) {
+                        ret.cachedHttpClient = true;
+                        assert ret.inCache;
+                        ret.inCache = false;
+                        if (httpuc != null && ret.needsTunneling())
+                            httpuc.setTunnelState(TUNNELING);
+                        PlatformLogger logger = HttpURLConnection.getHttpLogger();
+                        if (logger.isLoggable(PlatformLogger.FINEST)) {
+                            logger.finest("KeepAlive stream retrieved from the cache, " + ret);
+                        }
+                    }
+                } else {
+                    // We cannot return this connection to the cache as it's
+                    // KeepAliveTimeout will get reset. We simply close the connection.
+                    // This should be fine as it is very rare that a connection
+                    // to the same host will not use the same proxy.
+                    synchronized(ret) {
+                        ret.inCache = false;
+                        ret.closeServer();
+                    }
+                    ret = null;
+                }
             }
         }
         if (ret == null) {
@@ -328,7 +372,11 @@
         } else {
             SecurityManager security = System.getSecurityManager();
             if (security != null) {
-                security.checkConnect(url.getHost(), url.getPort());
+                if (ret.proxy == Proxy.NO_PROXY || ret.proxy == null) {
+                    security.checkConnect(InetAddress.getByName(url.getHost()).getHostAddress(), url.getPort());
+                } else {
+                    security.checkConnect(url.getHost(), url.getPort());
+                }
             }
             ret.url = url;
         }
@@ -607,6 +655,11 @@
 
     @Override
     protected void putInKeepAliveCache() {
+        if (inCache) {
+            assert false : "Duplicate put to keep alive cache";
+            return;
+        }
+        inCache = true;
         kac.put(url, sslSocketFactory, this);
     }
 
--- a/src/share/classes/sun/net/www/protocol/jar/JarURLConnection.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/net/www/protocol/jar/JarURLConnection.java	Fri Jun 21 19:11:42 2013 -0700
@@ -51,7 +51,7 @@
 
     /* the Jar file factory. It handles both retrieval and caching.
      */
-    private static JarFileFactory factory = new JarFileFactory();
+    private static final JarFileFactory factory = JarFileFactory.getInstance();
 
     /* the url for the Jar file */
     private URL jarFileURL;
--- a/src/share/classes/sun/nio/ch/DatagramChannelImpl.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/nio/ch/DatagramChannelImpl.java	Fri Jun 21 19:11:42 2013 -0700
@@ -557,7 +557,7 @@
                     return 0;
                 readerThread = NativeThread.current();
                 do {
-                    n = IOUtil.read(fd, buf, -1, nd, readLock);
+                    n = IOUtil.read(fd, buf, -1, nd);
                 } while ((n == IOStatus.INTERRUPTED) && isOpen());
                 return IOStatus.normalize(n);
             } finally {
@@ -613,7 +613,7 @@
                     return 0;
                 writerThread = NativeThread.current();
                 do {
-                    n = IOUtil.write(fd, buf, -1, nd, writeLock);
+                    n = IOUtil.write(fd, buf, -1, nd);
                 } while ((n == IOStatus.INTERRUPTED) && isOpen());
                 return IOStatus.normalize(n);
             } finally {
@@ -768,7 +768,8 @@
                     if (sm != null)
                         sm.checkConnect(isa.getAddress().getHostAddress(),
                                         isa.getPort());
-                    disconnect0(fd);
+                    boolean isIPv6 = (family == StandardProtocolFamily.INET6);
+                    disconnect0(fd, isIPv6);
                     remoteAddress = null;
                     state = ST_UNCONNECTED;
 
@@ -1103,7 +1104,7 @@
 
     private static native void initIDs();
 
-    private static native void disconnect0(FileDescriptor fd)
+    private static native void disconnect0(FileDescriptor fd, boolean isIPv6)
         throws IOException;
 
     private native int receive0(FileDescriptor fd, long address, int len,
--- a/src/share/classes/sun/nio/ch/FileChannelImpl.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/nio/ch/FileChannelImpl.java	Fri Jun 21 19:11:42 2013 -0700
@@ -34,6 +34,7 @@
 import java.util.List;
 import java.security.AccessController;
 import sun.misc.Cleaner;
+import sun.misc.IoTrace;
 import sun.security.action.GetPropertyAction;
 
 public class FileChannelImpl
@@ -56,13 +57,16 @@
     // Required to prevent finalization of creating stream (immutable)
     private final Object parent;
 
+    // The path of the referenced file (null if the parent stream is created with a file descriptor)
+    private final String path;
+
     // Thread-safe set of IDs of native threads, for signalling
     private final NativeThreadSet threads = new NativeThreadSet(2);
 
     // Lock for operations involving position and size
     private final Object positionLock = new Object();
 
-    private FileChannelImpl(FileDescriptor fd, boolean readable,
+    private FileChannelImpl(FileDescriptor fd, String path, boolean readable,
                             boolean writable, boolean append, Object parent)
     {
         this.fd = fd;
@@ -70,23 +74,24 @@
         this.writable = writable;
         this.append = append;
         this.parent = parent;
+        this.path = path;
         this.nd = new FileDispatcherImpl(append);
     }
 
     // Used by FileInputStream.getChannel() and RandomAccessFile.getChannel()
-    public static FileChannel open(FileDescriptor fd,
+    public static FileChannel open(FileDescriptor fd, String path,
                                    boolean readable, boolean writable,
                                    Object parent)
     {
-        return new FileChannelImpl(fd, readable, writable, false, parent);
+        return new FileChannelImpl(fd, path, readable, writable, false, parent);
     }
 
     // Used by FileOutputStream.getChannel
-    public static FileChannel open(FileDescriptor fd,
+    public static FileChannel open(FileDescriptor fd, String path,
                                    boolean readable, boolean writable,
                                    boolean append, Object parent)
     {
-        return new FileChannelImpl(fd, readable, writable, append, parent);
+        return new FileChannelImpl(fd, path, readable, writable, append, parent);
     }
 
     private void ensureOpen() throws IOException {
@@ -134,17 +139,19 @@
         synchronized (positionLock) {
             int n = 0;
             int ti = -1;
+            Object traceContext = IoTrace.fileReadBegin(path);
             try {
                 begin();
                 ti = threads.add();
                 if (!isOpen())
                     return 0;
                 do {
-                    n = IOUtil.read(fd, dst, -1, nd, positionLock);
+                    n = IOUtil.read(fd, dst, -1, nd);
                 } while ((n == IOStatus.INTERRUPTED) && isOpen());
                 return IOStatus.normalize(n);
             } finally {
                 threads.remove(ti);
+                IoTrace.fileReadEnd(traceContext, n > 0 ? n : 0);
                 end(n > 0);
                 assert IOStatus.check(n);
             }
@@ -162,6 +169,7 @@
         synchronized (positionLock) {
             long n = 0;
             int ti = -1;
+            Object traceContext = IoTrace.fileReadBegin(path);
             try {
                 begin();
                 ti = threads.add();
@@ -173,6 +181,7 @@
                 return IOStatus.normalize(n);
             } finally {
                 threads.remove(ti);
+                IoTrace.fileReadEnd(traceContext, n > 0 ? n : 0);
                 end(n > 0);
                 assert IOStatus.check(n);
             }
@@ -186,18 +195,20 @@
         synchronized (positionLock) {
             int n = 0;
             int ti = -1;
+            Object traceContext = IoTrace.fileWriteBegin(path);
             try {
                 begin();
                 ti = threads.add();
                 if (!isOpen())
                     return 0;
                 do {
-                    n = IOUtil.write(fd, src, -1, nd, positionLock);
+                    n = IOUtil.write(fd, src, -1, nd);
                 } while ((n == IOStatus.INTERRUPTED) && isOpen());
                 return IOStatus.normalize(n);
             } finally {
                 threads.remove(ti);
                 end(n > 0);
+                IoTrace.fileWriteEnd(traceContext, n > 0 ? n : 0);
                 assert IOStatus.check(n);
             }
         }
@@ -214,6 +225,7 @@
         synchronized (positionLock) {
             long n = 0;
             int ti = -1;
+            Object traceContext = IoTrace.fileWriteBegin(path);
             try {
                 begin();
                 ti = threads.add();
@@ -225,6 +237,7 @@
                 return IOStatus.normalize(n);
             } finally {
                 threads.remove(ti);
+                IoTrace.fileWriteEnd(traceContext, n > 0 ? n : 0);
                 end(n > 0);
                 assert IOStatus.check(n);
             }
@@ -663,19 +676,32 @@
         if (!readable)
             throw new NonReadableChannelException();
         ensureOpen();
+        if (nd.needsPositionLock()) {
+            synchronized (positionLock) {
+                return readInternal(dst, position);
+            }
+        } else {
+            return readInternal(dst, position);
+        }
+    }
+
+    private int readInternal(ByteBuffer dst, long position) throws IOException {
+        assert !nd.needsPositionLock() || Thread.holdsLock(positionLock);
         int n = 0;
         int ti = -1;
+        Object traceContext = IoTrace.fileReadBegin(path);
         try {
             begin();
             ti = threads.add();
             if (!isOpen())
                 return -1;
             do {
-                n = IOUtil.read(fd, dst, position, nd, positionLock);
+                n = IOUtil.read(fd, dst, position, nd);
             } while ((n == IOStatus.INTERRUPTED) && isOpen());
             return IOStatus.normalize(n);
         } finally {
             threads.remove(ti);
+            IoTrace.fileReadEnd(traceContext, n > 0 ? n : 0);
             end(n > 0);
             assert IOStatus.check(n);
         }
@@ -689,20 +715,33 @@
         if (!writable)
             throw new NonWritableChannelException();
         ensureOpen();
+        if (nd.needsPositionLock()) {
+            synchronized (positionLock) {
+                return writeInternal(src, position);
+            }
+        } else {
+            return writeInternal(src, position);
+        }
+    }
+
+    private int writeInternal(ByteBuffer src, long position) throws IOException {
+        assert !nd.needsPositionLock() || Thread.holdsLock(positionLock);
         int n = 0;
         int ti = -1;
+        Object traceContext = IoTrace.fileWriteBegin(path);
         try {
             begin();
             ti = threads.add();
             if (!isOpen())
                 return -1;
             do {
-                n = IOUtil.write(fd, src, position, nd, positionLock);
+                n = IOUtil.write(fd, src, position, nd);
             } while ((n == IOStatus.INTERRUPTED) && isOpen());
             return IOStatus.normalize(n);
         } finally {
             threads.remove(ti);
             end(n > 0);
+            IoTrace.fileWriteEnd(traceContext, n > 0 ? n : 0);
             assert IOStatus.check(n);
         }
     }
--- a/src/share/classes/sun/nio/ch/IOUtil.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/nio/ch/IOUtil.java	Fri Jun 21 19:11:42 2013 -0700
@@ -44,11 +44,11 @@
     private IOUtil() { }                // No instantiation
 
     static int write(FileDescriptor fd, ByteBuffer src, long position,
-                     NativeDispatcher nd, Object lock)
+                     NativeDispatcher nd)
         throws IOException
     {
         if (src instanceof DirectBuffer)
-            return writeFromNativeBuffer(fd, src, position, nd, lock);
+            return writeFromNativeBuffer(fd, src, position, nd);
 
         // Substitute a native buffer
         int pos = src.position();
@@ -62,7 +62,7 @@
             // Do not update src until we see how many bytes were written
             src.position(pos);
 
-            int n = writeFromNativeBuffer(fd, bb, position, nd, lock);
+            int n = writeFromNativeBuffer(fd, bb, position, nd);
             if (n > 0) {
                 // now update src
                 src.position(pos + n);
@@ -74,8 +74,7 @@
     }
 
     private static int writeFromNativeBuffer(FileDescriptor fd, ByteBuffer bb,
-                                           long position, NativeDispatcher nd,
-                                             Object lock)
+                                             long position, NativeDispatcher nd)
         throws IOException
     {
         int pos = bb.position();
@@ -89,7 +88,7 @@
         if (position != -1) {
             written = nd.pwrite(fd,
                                 ((DirectBuffer)bb).address() + pos,
-                                rem, position, lock);
+                                rem, position);
         } else {
             written = nd.write(fd, ((DirectBuffer)bb).address() + pos, rem);
         }
@@ -184,18 +183,18 @@
     }
 
     static int read(FileDescriptor fd, ByteBuffer dst, long position,
-                    NativeDispatcher nd, Object lock)
+                    NativeDispatcher nd)
         throws IOException
     {
         if (dst.isReadOnly())
             throw new IllegalArgumentException("Read-only buffer");
         if (dst instanceof DirectBuffer)
-            return readIntoNativeBuffer(fd, dst, position, nd, lock);
+            return readIntoNativeBuffer(fd, dst, position, nd);
 
         // Substitute a native buffer
         ByteBuffer bb = Util.getTemporaryDirectBuffer(dst.remaining());
         try {
-            int n = readIntoNativeBuffer(fd, bb, position, nd, lock);
+            int n = readIntoNativeBuffer(fd, bb, position, nd);
             bb.flip();
             if (n > 0)
                 dst.put(bb);
@@ -206,8 +205,7 @@
     }
 
     private static int readIntoNativeBuffer(FileDescriptor fd, ByteBuffer bb,
-                                            long position, NativeDispatcher nd,
-                                            Object lock)
+                                            long position, NativeDispatcher nd)
         throws IOException
     {
         int pos = bb.position();
@@ -220,7 +218,7 @@
         int n = 0;
         if (position != -1) {
             n = nd.pread(fd, ((DirectBuffer)bb).address() + pos,
-                         rem, position, lock);
+                         rem, position);
         } else {
             n = nd.read(fd, ((DirectBuffer)bb).address() + pos, rem);
         }
@@ -344,6 +342,8 @@
 
     static native int iovMax();
 
+    static native int fdLimit();
+
     static native void initIDs();
 
     static {
--- a/src/share/classes/sun/nio/ch/NativeDispatcher.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/nio/ch/NativeDispatcher.java	Fri Jun 21 19:11:42 2013 -0700
@@ -38,8 +38,16 @@
     abstract int read(FileDescriptor fd, long address, int len)
         throws IOException;
 
-    int pread(FileDescriptor fd, long address, int len,
-                             long position, Object lock) throws IOException
+    /**
+     * Returns {@code true} if pread/pwrite needs to be synchronized with
+     * position sensitive methods.
+     */
+    boolean needsPositionLock() {
+        return false;
+    }
+
+    int pread(FileDescriptor fd, long address, int len, long position)
+        throws IOException
     {
         throw new IOException("Operation Unsupported");
     }
@@ -50,8 +58,8 @@
     abstract int write(FileDescriptor fd, long address, int len)
         throws IOException;
 
-    int pwrite(FileDescriptor fd, long address, int len,
-                             long position, Object lock) throws IOException
+    int pwrite(FileDescriptor fd, long address, int len, long position)
+        throws IOException
     {
         throw new IOException("Operation Unsupported");
     }
--- a/src/share/classes/sun/nio/ch/SimpleAsynchronousFileChannelImpl.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/nio/ch/SimpleAsynchronousFileChannelImpl.java	Fri Jun 21 19:11:42 2013 -0700
@@ -318,7 +318,7 @@
                 try {
                     begin();
                     do {
-                        n = IOUtil.read(fdObj, dst, position, nd, null);
+                        n = IOUtil.read(fdObj, dst, position, nd);
                     } while ((n == IOStatus.INTERRUPTED) && isOpen());
                     if (n < 0 && !isOpen())
                         throw new AsynchronousCloseException();
@@ -372,7 +372,7 @@
                 try {
                     begin();
                     do {
-                        n = IOUtil.write(fdObj, src, position, nd, null);
+                        n = IOUtil.write(fdObj, src, position, nd);
                     } while ((n == IOStatus.INTERRUPTED) && isOpen());
                     if (n < 0 && !isOpen())
                         throw new AsynchronousCloseException();
--- a/src/share/classes/sun/nio/ch/SocketAdaptor.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/nio/ch/SocketAdaptor.java	Fri Jun 21 19:11:42 2013 -0700
@@ -34,6 +34,8 @@
 import java.security.PrivilegedExceptionAction;
 import java.util.*;
 
+import sun.misc.IoTrace;
+
 
 // Make a socket channel look like a socket.
 //
@@ -204,8 +206,9 @@
                 SelectionKey sk = null;
                 Selector sel = null;
                 sc.configureBlocking(false);
+                int n = 0;
+                Object traceContext = IoTrace.socketReadBegin();
                 try {
-                    int n;
                     if ((n = sc.read(bb)) != 0)
                         return n;
                     sel = Util.getTemporarySelector(sc);
@@ -226,6 +229,8 @@
                             throw new SocketTimeoutException();
                     }
                 } finally {
+                    IoTrace.socketReadEnd(traceContext, getInetAddress(),
+                                          getPort(), timeout, n > 0 ? n : 0);
                     if (sk != null)
                         sk.cancel();
                     if (sc.isOpen())
--- a/src/share/classes/sun/nio/ch/SocketChannelImpl.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/nio/ch/SocketChannelImpl.java	Fri Jun 21 19:11:42 2013 -0700
@@ -33,7 +33,7 @@
 import java.nio.channels.spi.*;
 import java.util.*;
 import sun.net.NetHooks;
-
+import sun.misc.IoTrace;
 
 /**
  * An implementation of SocketChannels
@@ -294,6 +294,10 @@
         synchronized (readLock) {
             if (!ensureReadOpen())
                 return -1;
+            Object traceContext = null;
+            if (isBlocking()) {
+                traceContext = IoTrace.socketReadBegin();
+            }
             int n = 0;
             try {
 
@@ -372,7 +376,7 @@
                 // except that the shutdown operation plays the role of
                 // nd.preClose().
                 for (;;) {
-                    n = IOUtil.read(fd, buf, -1, nd, readLock);
+                    n = IOUtil.read(fd, buf, -1, nd);
                     if ((n == IOStatus.INTERRUPTED) && isOpen()) {
                         // The system call was interrupted but the channel
                         // is still open, so retry
@@ -383,6 +387,12 @@
 
             } finally {
                 readerCleanup();        // Clear reader thread
+
+                if (isBlocking()) {
+                    IoTrace.socketReadEnd(traceContext, remoteAddress.getAddress(),
+                                          remoteAddress.getPort(), 0, n > 0 ? n : 0);
+                }
+
                 // The end method, which is defined in our superclass
                 // AbstractInterruptibleChannel, resets the interruption
                 // machinery.  If its argument is true then it returns
@@ -423,6 +433,10 @@
             if (!ensureReadOpen())
                 return -1;
             long n = 0;
+            Object traceContext = null;
+            if (isBlocking()) {
+                traceContext = IoTrace.socketReadBegin();
+            }
             try {
                 begin();
                 synchronized (stateLock) {
@@ -439,6 +453,10 @@
                 }
             } finally {
                 readerCleanup();
+                if (isBlocking()) {
+                    IoTrace.socketReadEnd(traceContext, remoteAddress.getAddress(),
+                                          remoteAddress.getPort(), 0, n > 0 ? n : 0);
+                }
                 end(n > 0 || (n == IOStatus.UNAVAILABLE));
                 synchronized (stateLock) {
                     if ((n <= 0) && (!isInputOpen))
@@ -455,6 +473,9 @@
         synchronized (writeLock) {
             ensureWriteOpen();
             int n = 0;
+            Object traceContext =
+                IoTrace.socketWriteBegin();
+
             try {
                 begin();
                 synchronized (stateLock) {
@@ -463,13 +484,15 @@
                     writerThread = NativeThread.current();
                 }
                 for (;;) {
-                    n = IOUtil.write(fd, buf, -1, nd, writeLock);
+                    n = IOUtil.write(fd, buf, -1, nd);
                     if ((n == IOStatus.INTERRUPTED) && isOpen())
                         continue;
                     return IOStatus.normalize(n);
                 }
             } finally {
                 writerCleanup();
+                IoTrace.socketWriteEnd(traceContext, remoteAddress.getAddress(),
+                                       remoteAddress.getPort(), n > 0 ? n : 0);
                 end(n > 0 || (n == IOStatus.UNAVAILABLE));
                 synchronized (stateLock) {
                     if ((n <= 0) && (!isOutputOpen))
@@ -488,6 +511,8 @@
         synchronized (writeLock) {
             ensureWriteOpen();
             long n = 0;
+            Object traceContext =
+                IoTrace.socketWriteBegin();
             try {
                 begin();
                 synchronized (stateLock) {
@@ -503,6 +528,8 @@
                 }
             } finally {
                 writerCleanup();
+                IoTrace.socketWriteEnd(traceContext, remoteAddress.getAddress(),
+                                       remoteAddress.getPort(), n > 0 ? n : 0);
                 end((n > 0) || (n == IOStatus.UNAVAILABLE));
                 synchronized (stateLock) {
                     if ((n <= 0) && (!isOutputOpen))
--- a/src/share/classes/sun/print/PSPrinterJob.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/print/PSPrinterJob.java	Fri Jun 21 19:11:42 2013 -0700
@@ -68,14 +68,18 @@
 
 import java.io.BufferedInputStream;
 import java.io.BufferedOutputStream;
+import java.io.BufferedReader;
 import java.io.CharConversionException;
 import java.io.File;
 import java.io.InputStream;
+import java.io.InputStreamReader;
 import java.io.IOException;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
 import java.io.OutputStream;
 import java.io.PrintStream;
+import java.io.PrintWriter;
+import java.io.StringWriter;
 
 import java.util.ArrayList;
 import java.util.Enumeration;
@@ -674,15 +678,38 @@
     private class PrinterSpooler implements java.security.PrivilegedAction {
         PrinterException pex;
 
+        private void handleProcessFailure(final Process failedProcess,
+                final String[] execCmd, final int result) throws IOException {
+            try (StringWriter sw = new StringWriter();
+                    PrintWriter pw = new PrintWriter(sw)) {
+                pw.append("error=").append(Integer.toString(result));
+                pw.append(" running:");
+                for (String arg: execCmd) {
+                    pw.append(" '").append(arg).append("'");
+                }
+                try (InputStream is = failedProcess.getErrorStream();
+                        InputStreamReader isr = new InputStreamReader(is);
+                        BufferedReader br = new BufferedReader(isr)) {
+                    while (br.ready()) {
+                        pw.println();
+                        pw.append("\t\t").append(br.readLine());
+                    }
+                } finally {
+                    pw.flush();
+                    throw new IOException(sw.toString());
+                }
+            }
+        }
+
         public Object run() {
+            if (spoolFile == null || !spoolFile.exists()) {
+               pex = new PrinterException("No spool file");
+               return null;
+            }
             try {
                 /**
                  * Spool to the printer.
                  */
-                if (spoolFile == null || !spoolFile.exists()) {
-                   pex = new PrinterException("No spool file");
-                   return null;
-                }
                 String fileName = spoolFile.getAbsolutePath();
                 String execCmd[] = printExecCmd(mDestination, mOptions,
                                mNoJobSheet, getJobNameInt(),
@@ -690,12 +717,16 @@
 
                 Process process = Runtime.getRuntime().exec(execCmd);
                 process.waitFor();
-                spoolFile.delete();
-
+                final int result = process.exitValue();
+                if (0 != result) {
+                    handleProcessFailure(process, execCmd, result);
+                }
             } catch (IOException ex) {
                 pex = new PrinterIOException(ex);
             } catch (InterruptedException ie) {
                 pex = new PrinterException(ie.toString());
+            } finally {
+                spoolFile.delete();
             }
             return null;
         }
--- a/src/share/classes/sun/rmi/log/ReliableLog.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/rmi/log/ReliableLog.java	Fri Jun 21 19:11:42 2013 -0700
@@ -344,10 +344,9 @@
                                return ClassLoader.getSystemClassLoader();
                             }
                         });
-                Class cl = loader.loadClass(logClassName);
-                if (LogFile.class.isAssignableFrom(cl)) {
-                    return cl.getConstructor(String.class, String.class);
-                }
+                Class<? extends LogFile> cl =
+                    loader.loadClass(logClassName).asSubclass(LogFile.class);
+                return cl.getConstructor(String.class, String.class);
             } catch (Exception e) {
                 System.err.println("Exception occurred:");
                 e.printStackTrace();
@@ -595,10 +594,10 @@
         } else {
             name = versionFile;
         }
-        DataOutputStream out =
-            new DataOutputStream(new FileOutputStream(fName(name)));
-        writeInt(out, version);
-        out.close();
+        try (FileOutputStream fos = new FileOutputStream(fName(name));
+             DataOutputStream out = new DataOutputStream(fos)) {
+            writeInt(out, version);
+        }
     }
 
     /**
@@ -629,11 +628,9 @@
      * @exception IOException If an I/O error has occurred.
      */
     private int readVersion(String name) throws IOException {
-        DataInputStream in = new DataInputStream(new FileInputStream(name));
-        try {
+        try (DataInputStream in = new DataInputStream
+                (new FileInputStream(name))) {
             return in.readInt();
-        } finally {
-            in.close();
         }
     }
 
--- a/src/share/classes/sun/rmi/registry/RegistryImpl.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/rmi/registry/RegistryImpl.java	Fri Jun 21 19:11:42 2013 -0700
@@ -77,9 +77,9 @@
     /* indicate compatibility with JDK 1.1.x version of class */
     private static final long serialVersionUID = 4666870661827494597L;
     private Hashtable<String, Remote> bindings
-        = new Hashtable<String, Remote>(101);
+        = new Hashtable<>(101);
     private static Hashtable<InetAddress, InetAddress> allowedAccessCache
-        = new Hashtable<InetAddress, InetAddress>(3);
+        = new Hashtable<>(3);
     private static RegistryImpl registry;
     private static ObjID id = new ObjID(ObjID.REGISTRY_ID);
 
@@ -194,9 +194,9 @@
         synchronized (bindings) {
             int i = bindings.size();
             names = new String[i];
-            Enumeration enum_ = bindings.keys();
+            Enumeration<String> enum_ = bindings.keys();
             while ((--i) >= 0)
-                names[i] = (String)enum_.nextElement();
+                names[i] = enum_.nextElement();
         }
         return names;
     }
--- a/src/share/classes/sun/rmi/rmic/BatchEnvironment.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/rmi/rmic/BatchEnvironment.java	Fri Jun 21 19:11:42 2013 -0700
@@ -160,7 +160,7 @@
     }
 
     /** list of generated source files created in this environment */
-    private Vector generatedFiles = new Vector();
+    private Vector<File> generatedFiles = new Vector<>();
 
     /**
      * Remember a generated source file generated so that it
@@ -177,9 +177,9 @@
      */
     public void deleteGeneratedFiles() {
         synchronized(generatedFiles) {
-            Enumeration enumeration = generatedFiles.elements();
+            Enumeration<File> enumeration = generatedFiles.elements();
             while (enumeration.hasMoreElements()) {
-                File file = (File) enumeration.nextElement();
+                File file = enumeration.nextElement();
                 file.delete();
             }
             generatedFiles.removeAllElements();
--- a/src/share/classes/sun/rmi/rmic/Main.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/rmi/rmic/Main.java	Fri Jun 21 19:11:42 2013 -0700
@@ -73,14 +73,15 @@
     File destDir;
     int flags;
     long tm;
-    Vector classes;
+    Vector<String> classes;
     boolean nowrite;
     boolean nocompile;
     boolean keepGenerated;
     boolean status;
     String[] generatorArgs;
-    Vector generators;
-    Class environmentClass = BatchEnvironment.class;
+    Vector<Generator> generators;
+    Class<? extends BatchEnvironment> environmentClass =
+        BatchEnvironment.class;
     boolean iiopGeneration = false;
 
     /**
@@ -183,7 +184,7 @@
         destDir = null;
         flags = F_WARNINGS;
         tm = System.currentTimeMillis();
-        classes = new Vector();
+        classes = new Vector<>();
         nowrite = false;
         nocompile = false;
         keepGenerated = false;
@@ -191,7 +192,7 @@
         if (generatorArgs == null) {
             return false;
         }
-        generators = new Vector();
+        generators = new Vector<>();
 
         // Pre-process command line for @file arguments
         try {
@@ -411,7 +412,7 @@
 
         // Get the environment required by this generator...
 
-        Class envClass = BatchEnvironment.class;
+        Class<?> envClass = BatchEnvironment.class;
         String env = getString("generator.env." + arg);
         if (env != null) {
             try {
@@ -423,7 +424,7 @@
 
                     // Yes, so switch to the new one...
 
-                    environmentClass = envClass;
+                    environmentClass = envClass.asSubclass(BatchEnvironment.class);
 
                 } else {
 
@@ -495,8 +496,9 @@
         try {
             Class[] ctorArgTypes = {OutputStream.class,ClassPath.class,Main.class};
             Object[] ctorArgs = {out,classPath,this};
-            Constructor constructor = environmentClass.getConstructor(ctorArgTypes);
-            result = (BatchEnvironment) constructor.newInstance(ctorArgs);
+            Constructor<? extends BatchEnvironment> constructor =
+                environmentClass.getConstructor(ctorArgTypes);
+            result =  constructor.newInstance(ctorArgs);
             result.reset();
         }
         catch (Exception e) {
@@ -530,7 +532,7 @@
              */
             for (int i = classes.size()-1; i >= 0; i-- ) {
                 Identifier implClassName =
-                    Identifier.lookup((String)classes.elementAt(i));
+                    Identifier.lookup(classes.elementAt(i));
 
                 /*
                  * Fix bugid 4049354: support using '.' as an inner class
@@ -558,7 +560,7 @@
                 try {
                     ClassDefinition def = decl.getClassDefinition(env);
                     for (int j = 0; j < generators.size(); j++) {
-                        Generator gen = (Generator)generators.elementAt(j);
+                        Generator gen = generators.elementAt(j);
                         gen.generate(env, def, destDir);
                     }
                 } catch (ClassNotFound ex) {
@@ -673,7 +675,7 @@
 
         do {
             done = true;
-            for (Enumeration e = env.getClasses() ; e.hasMoreElements() ; ) {
+            for (Enumeration<?> e = env.getClasses() ; e.hasMoreElements() ; ) {
                 ClassDeclaration c = (ClassDeclaration)e.nextElement();
                 done = compileClass(c,buf,env);
             }
@@ -682,7 +684,9 @@
 
     /*
      * Compile a single class.
+     * Fallthrough is intentional
      */
+    @SuppressWarnings("fallthrough")
     public boolean compileClass (ClassDeclaration c,
                                  ByteArrayOutputStream buf,
                                  BatchEnvironment env)
@@ -879,6 +883,6 @@
         args[1] = (arg1 != null ? arg1.toString() : "null");
         args[2] = (arg2 != null ? arg2.toString() : "null");
 
-        return java.text.MessageFormat.format(format, args);
+        return java.text.MessageFormat.format(format, (Object[]) args);
     }
 }
--- a/src/share/classes/sun/rmi/rmic/RMIGenerator.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/rmi/rmic/RMIGenerator.java	Fri Jun 21 19:11:42 2013 -0700
@@ -61,7 +61,7 @@
  */
 public class RMIGenerator implements RMIConstants, Generator {
 
-    private static final Hashtable versionOptions = new Hashtable();
+    private static final Hashtable<String, Integer> versionOptions = new Hashtable<>();
     static {
         versionOptions.put("-v1.1", new Integer(STUB_VERSION_1_1));
         versionOptions.put("-vcompat", new Integer(STUB_VERSION_FAT));
@@ -96,7 +96,7 @@
                         return false;
                     }
                     explicitVersion = arg;
-                    version = ((Integer) versionOptions.get(arg)).intValue();
+                    version = versionOptions.get(arg);
                     argv[i] = null;
                 }
             }
@@ -519,7 +519,7 @@
          * follows a previous catch of it or of one of its superclasses.
          * The following method invocation takes care of these details.
          */
-        Vector catchList = computeUniqueCatchList(exceptions);
+        Vector<ClassDefinition> catchList = computeUniqueCatchList(exceptions);
 
         /*
          * If we need to catch any particular exceptions (i.e. this method
@@ -615,10 +615,10 @@
          * UnexpectedException, and end the try block.
          */
         if (catchList.size() > 0) {
-            for (Enumeration enumeration = catchList.elements();
+            for (Enumeration<ClassDefinition> enumeration = catchList.elements();
                  enumeration.hasMoreElements();)
             {
-                ClassDefinition def = (ClassDefinition) enumeration.nextElement();
+                ClassDefinition def = enumeration.nextElement();
                 p.pOlnI("} catch (" + def.getName() + " e) {");
                 p.pln("throw e;");
             }
@@ -650,8 +650,8 @@
      * of its superclasses is in the throws clause of the method, indicating
      * that no exceptions need to be caught.
      */
-    private Vector computeUniqueCatchList(ClassDeclaration[] exceptions) {
-        Vector uniqueList = new Vector();       // unique exceptions to catch
+    private Vector<ClassDefinition> computeUniqueCatchList(ClassDeclaration[] exceptions) {
+        Vector<ClassDefinition> uniqueList = new Vector<>();       // unique exceptions to catch
 
         uniqueList.addElement(defRuntimeException);
         uniqueList.addElement(defRemoteException);
@@ -682,8 +682,7 @@
                  * exceptions that need to be caught:
                  */
                 for (int j = 0; j < uniqueList.size();) {
-                    ClassDefinition def =
-                        (ClassDefinition) uniqueList.elementAt(j);
+                    ClassDefinition def = uniqueList.elementAt(j);
                     if (def.superClassOf(env, decl)) {
                         /*
                          * If a superclass of this exception is already on
--- a/src/share/classes/sun/rmi/rmic/newrmic/Main.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/rmi/rmic/newrmic/Main.java	Fri Jun 21 19:11:42 2013 -0700
@@ -455,7 +455,7 @@
         BatchEnvironment env;
         try {
             Constructor<? extends BatchEnvironment> cons =
-                batch.envClass.getConstructor(new Class[] { RootDoc.class });
+                batch.envClass.getConstructor(new Class<?>[] { RootDoc.class });
             env = cons.newInstance(rootDoc);
         } catch (NoSuchMethodException e) {
             throw new AssertionError(e);
--- a/src/share/classes/sun/rmi/rmic/newrmic/Resources.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/rmi/rmic/newrmic/Resources.java	Fri Jun 21 19:11:42 2013 -0700
@@ -69,7 +69,7 @@
             format = "missing resource key: key = \"" + key + "\", " +
                 "arguments = \"{0}\", \"{1}\", \"{2}\"";
         }
-        return MessageFormat.format(format, args);
+        return MessageFormat.format(format, (Object[]) args);
     }
 
     /**
--- a/src/share/classes/sun/rmi/server/ActivatableRef.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/rmi/server/ActivatableRef.java	Fri Jun 21 19:11:42 2013 -0700
@@ -80,7 +80,7 @@
         String className = desc.getClassName();
 
         try {
-            Class cl =
+            Class<?> cl =
                 RMIClassLoader.loadClass(desc.getLocation(), className);
             RemoteRef clientRef = new ActivatableRef(id, null);
             return Util.createProxy(cl, clientRef, false);
@@ -373,8 +373,8 @@
         if (className.equals("")) return;
 
         try {
-            Class refClass = Class.forName(RemoteRef.packagePrefix + "." +
-                                           className);
+            Class<?> refClass = Class.forName(RemoteRef.packagePrefix + "." +
+                                              className);
             ref = (RemoteRef)refClass.newInstance();
             ref.readExternal(in);
         } catch (InstantiationException e) {
--- a/src/share/classes/sun/rmi/server/Activation.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/rmi/server/Activation.java	Fri Jun 21 19:11:42 2013 -0700
@@ -139,7 +139,6 @@
 
     /** indicate compatibility with JDK 1.2 version of class */
     private static final long serialVersionUID = 2921265612698155191L;
-
     private static final byte MAJOR_VERSION = 1;
     private static final byte MINOR_VERSION = 0;
 
@@ -299,6 +298,7 @@
     private static class SystemRegistryImpl extends RegistryImpl {
 
         private static final String NAME = ActivationSystem.class.getName();
+        private static final long serialVersionUID = 4877330021609408794L;
         private final ActivationSystem systemStub;
 
         SystemRegistryImpl(int port,
@@ -805,9 +805,8 @@
         ActivationGroupDesc desc = null;
         ActivationGroupID groupID = null;
         long incarnation = 0;
-        Map<ActivationID,ObjectEntry> objects =
-            new HashMap<ActivationID,ObjectEntry>();
-        Set<ActivationID> restartSet = new HashSet<ActivationID>();
+        Map<ActivationID,ObjectEntry> objects = new HashMap<>();
+        Set<ActivationID> restartSet = new HashSet<>();
 
         transient ActivationInstantiator group = null;
         transient int status = NORMAL;
@@ -1058,6 +1057,11 @@
             }
         }
 
+       /*
+        * Fallthrough from TERMINATE to TERMINATING
+        * is intentional
+        */
+        @SuppressWarnings("fallthrough")
         private void await() {
             while (true) {
                 switch (status) {
@@ -1229,14 +1233,13 @@
                     PipeWriter.plugTogetherPair
                         (child.getInputStream(), System.out,
                          child.getErrorStream(), System.err);
-
-                    MarshalOutputStream out =
-                        new MarshalOutputStream(child.getOutputStream());
-                    out.writeObject(id);
-                    out.writeObject(desc);
-                    out.writeLong(incarnation);
-                    out.flush();
-                    out.close();
+                    try (MarshalOutputStream out =
+                            new MarshalOutputStream(child.getOutputStream())) {
+                        out.writeObject(id);
+                        out.writeObject(desc);
+                        out.writeLong(incarnation);
+                        out.flush();
+                    }
 
 
                 } catch (IOException e) {
@@ -1353,7 +1356,7 @@
         cmdenv = desc.getCommandEnvironment();
 
         // argv is the literal command to exec
-        List<String> argv = new ArrayList<String>();
+        List<String> argv = new ArrayList<>();
 
         // Command name/path
         argv.add((cmdenv != null && cmdenv.getCommandPath() != null)
@@ -1958,7 +1961,7 @@
             }
 
             String log = null;
-            List<String> childArgs = new ArrayList<String>();
+            List<String> childArgs = new ArrayList<>();
 
             /*
              * Parse arguments
@@ -2032,8 +2035,7 @@
                 }
 
                 try {
-                    Class<?> execPolicyClass =
-                        RMIClassLoader.loadClass(execPolicyClassName);
+                    Class<?> execPolicyClass = getRMIClass(execPolicyClassName);
                     execPolicy = execPolicyClass.newInstance();
                     execPolicyMethod =
                         execPolicyClass.getMethod("checkExecCommand",
@@ -2124,6 +2126,10 @@
         }
     }
 
+    @SuppressWarnings("deprecation")
+    private static Class<?> getRMIClass(String execPolicyClassName) throws Exception  {
+        return RMIClassLoader.loadClass(execPolicyClassName);
+    }
     /*
      * Dijkstra semaphore operations to limit the number of subprocesses
      * rmid attempts to make at once.
--- a/src/share/classes/sun/rmi/server/ActivationGroupImpl.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/rmi/server/ActivationGroupImpl.java	Fri Jun 21 19:11:42 2013 -0700
@@ -66,10 +66,10 @@
 
     /** maps persistent IDs to activated remote objects */
     private final Hashtable<ActivationID,ActiveEntry> active =
-        new Hashtable<ActivationID,ActiveEntry>();
+        new Hashtable<>();
     private boolean groupInactive = false;
     private final ActivationGroupID groupID;
-    private final List<ActivationID> lockedIDs = new ArrayList<ActivationID>();
+    private final List<ActivationID> lockedIDs = new ArrayList<>();
 
     /**
      * Creates a default activation group implementation.
@@ -296,14 +296,9 @@
             active.put(id, entry);
             return entry.mobj;
 
-        } catch (NoSuchMethodException e) {
-            /* user forgot to provide activatable constructor? */
-            throw new ActivationException
-                ("Activatable object must provide an activation"+
-                 " constructor", e);
-
-        } catch (NoSuchMethodError e) {
-            /* code recompiled and user forgot to provide
+        } catch (NoSuchMethodException | NoSuchMethodError e) {
+            /* user forgot to provide activatable constructor?
+             * or code recompiled and user forgot to provide
              *  activatable constructor?
              */
             throw new ActivationException
--- a/src/share/classes/sun/rmi/server/LoaderHandler.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/rmi/server/LoaderHandler.java	Fri Jun 21 19:11:42 2013 -0700
@@ -113,11 +113,11 @@
      * garbage collected.
      */
     private static final HashMap<LoaderKey, LoaderEntry> loaderTable
-        = new HashMap<LoaderKey, LoaderEntry>(5);
+        = new HashMap<>(5);
 
     /** reference queue for cleared class loader entries */
     private static final ReferenceQueue<Loader> refQueue
-        = new ReferenceQueue<Loader>();
+        = new ReferenceQueue<>();
 
     /*
      * Disallow anyone from creating one of these.
@@ -150,8 +150,8 @@
      * but first try to resolve the named class through the given
      * "default loader".
      */
-    public static Class loadClass(String codebase, String name,
-                                  ClassLoader defaultLoader)
+    public static Class<?> loadClass(String codebase, String name,
+                                     ClassLoader defaultLoader)
         throws MalformedURLException, ClassNotFoundException
     {
         if (loaderLog.isLoggable(Log.BRIEF)) {
@@ -171,7 +171,7 @@
 
         if (defaultLoader != null) {
             try {
-                Class c = loadClassForName(name, false, defaultLoader);
+                Class<?> c = loadClassForName(name, false, defaultLoader);
                 if (loaderLog.isLoggable(Log.VERBOSE)) {
                     loaderLog.log(Log.VERBOSE,
                         "class \"" + name + "\" found via defaultLoader, " +
@@ -190,7 +190,7 @@
      * a class) that RMI will use to annotate the call stream when
      * marshalling objects of the given class.
      */
-    public static String getClassAnnotation(Class cl) {
+    public static String getClassAnnotation(Class<?> cl) {
         String name = cl.getName();
 
         /*
@@ -262,15 +262,13 @@
 
                     annotation = urlsToPath(urls);
                 }
-            } catch (SecurityException e) {
+            } catch (SecurityException | IOException e) {
                 /*
-                 * If access was denied to the knowledge of the class
-                 * loader's URLs, fall back to the default behavior.
-                 */
-            } catch (IOException e) {
-                /*
-                 * This shouldn't happen, although it is declared to be
-                 * thrown by openConnection() and getPermission().  If it
+                 * SecurityException: If access was denied to the knowledge of
+                 * the class loader's URLs, fall back to the default behavior.
+                 *
+                 * IOException: This shouldn't happen, although it is declared
+                 * to be thrown by openConnection() and getPermission().  If it
                  * does happen, forget about this class loader's URLs and
                  * fall back to the default behavior.
                  */
@@ -359,7 +357,7 @@
      * Load a class from the RMI class loader corresponding to the given
      * codebase URL path in the current execution context.
      */
-    private static Class loadClass(URL[] urls, String name)
+    private static Class<?> loadClass(URL[] urls, String name)
         throws ClassNotFoundException
     {
         ClassLoader parent = getRMIContextClassLoader();
@@ -376,7 +374,7 @@
         SecurityManager sm = System.getSecurityManager();
         if (sm == null) {
             try {
-                Class c = loadClassForName(name, false, parent);
+                Class<?> c = loadClassForName(name, false, parent);
                 if (loaderLog.isLoggable(Log.VERBOSE)) {
                     loaderLog.log(Log.VERBOSE,
                         "class \"" + name + "\" found via " +
@@ -425,7 +423,7 @@
                  * resolved without the security-offending codebase anyway;
                  * if so, return successfully (see bugids 4191926 & 4349670).
                  */
-                Class c = loadClassForName(name, false, parent);
+                Class<?> c = loadClassForName(name, false, parent);
                 if (loaderLog.isLoggable(Log.VERBOSE)) {
                     loaderLog.log(Log.VERBOSE,
                         "class \"" + name + "\" found via " +
@@ -451,7 +449,7 @@
         }
 
         try {
-            Class c = loadClassForName(name, false, loader);
+            Class<?> c = loadClassForName(name, false, loader);
             if (loaderLog.isLoggable(Log.VERBOSE)) {
                 loaderLog.log(Log.VERBOSE,
                     "class \"" + name + "\" " + "found via codebase, " +
@@ -473,8 +471,8 @@
      * implement interface classes named by the given array of
      * interface names.
      */
-    public static Class loadProxyClass(String codebase, String[] interfaces,
-                                       ClassLoader defaultLoader)
+    public static Class<?> loadProxyClass(String codebase, String[] interfaces,
+                                          ClassLoader defaultLoader)
         throws MalformedURLException, ClassNotFoundException
     {
         if (loaderLog.isLoggable(Log.BRIEF)) {
@@ -538,7 +536,7 @@
         SecurityManager sm = System.getSecurityManager();
         if (sm == null) {
             try {
-                Class c = loadProxyClass(interfaces, defaultLoader, parent,
+                Class<?> c = loadProxyClass(interfaces, defaultLoader, parent,
                                          false);
                 if (loaderLog.isLoggable(Log.VERBOSE)) {
                     loaderLog.log(Log.VERBOSE,
@@ -585,8 +583,8 @@
                  * resolved without the security-offending codebase anyway;
                  * if so, return successfully (see bugids 4191926 & 4349670).
                  */
-                Class c = loadProxyClass(interfaces, defaultLoader, parent,
-                                         false);
+                Class<?> c = loadProxyClass(interfaces, defaultLoader, parent,
+                                            false);
                 if (loaderLog.isLoggable(Log.VERBOSE)) {
                     loaderLog.log(Log.VERBOSE,
                         "(access to codebase denied) " +
@@ -609,7 +607,7 @@
         }
 
         try {
-            Class c = loadProxyClass(interfaces, defaultLoader, loader, true);
+            Class<?> c = loadProxyClass(interfaces, defaultLoader, loader, true);
             if (loaderLog.isLoggable(Log.VERBOSE)) {
                 loaderLog.log(Log.VERBOSE,
                               "proxy class defined by " + c.getClassLoader());
@@ -630,14 +628,14 @@
      * class will implement classes which are named in the supplied
      * interfaceNames.
      */
-    private static Class loadProxyClass(String[] interfaceNames,
-                                        ClassLoader defaultLoader,
-                                        ClassLoader codebaseLoader,
-                                        boolean preferCodebase)
+    private static Class<?> loadProxyClass(String[] interfaceNames,
+                                           ClassLoader defaultLoader,
+                                           ClassLoader codebaseLoader,
+                                           boolean preferCodebase)
         throws ClassNotFoundException
     {
         ClassLoader proxyLoader = null;
-        Class[] classObjs = new Class[interfaceNames.length];
+        Class<?>[] classObjs = new Class<?>[interfaceNames.length];
         boolean[] nonpublic = { false };
 
       defaultLoaderCase:
@@ -693,7 +691,7 @@
      * Define a proxy class in the given class loader.  The proxy
      * class will implement the given interfaces Classes.
      */
-    private static Class loadProxyClass(ClassLoader loader, Class[] interfaces)
+    private static Class<?> loadProxyClass(ClassLoader loader, Class[] interfaces)
         throws ClassNotFoundException
     {
         try {
@@ -728,7 +726,7 @@
         ClassLoader nonpublicLoader = null;
 
         for (int i = 0; i < interfaces.length; i++) {
-            Class cl =
+            Class<?> cl =
                 (classObjs[i] = loadClassForName(interfaces[i], false, loader));
 
             if (!Modifier.isPublic(cl.getModifiers())) {
@@ -779,7 +777,7 @@
 
     /** map from weak(key=string) to [URL[], soft(key)] */
     private static final Map<String, Object[]> pathToURLsCache
-        = new WeakHashMap<String, Object[]>(5);
+        = new WeakHashMap<>(5);
 
     /**
      * Convert an array of URL objects into a corresponding string
@@ -1172,9 +1170,9 @@
         private void checkPermissions() {
             SecurityManager sm = System.getSecurityManager();
             if (sm != null) {           // should never be null?
-                Enumeration enum_ = permissions.elements();
+                Enumeration<Permission> enum_ = permissions.elements();
                 while (enum_.hasMoreElements()) {
-                    sm.checkPermission((Permission) enum_.nextElement());
+                    sm.checkPermission(enum_.nextElement());
                 }
             }
         }
--- a/src/share/classes/sun/rmi/server/MarshalInputStream.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/rmi/server/MarshalInputStream.java	Fri Jun 21 19:11:42 2013 -0700
@@ -71,14 +71,14 @@
 
     /** table to hold sun classes to which access is explicitly permitted */
     protected static Map<String, Class<?>> permittedSunClasses
-        = new HashMap<String, Class<?>>(3);
+        = new HashMap<>(3);
 
     /** if true, don't try superclass first in resolveClass() */
     private boolean skipDefaultResolveClass = false;
 
     /** callbacks to make when done() called: maps Object to Runnable */
     private final Map<Object, Runnable> doneCallbacks
-        = new HashMap<Object, Runnable>(3);
+        = new HashMap<>(3);
 
     /**
      * if true, load classes (if not available locally) only from the
@@ -116,14 +116,6 @@
     }
 
     /**
-     * Load the "rmi" native library.
-     */
-    static {
-        java.security.AccessController.doPrivileged(
-            new sun.security.action.LoadLibraryAction("rmi"));
-    }
-
-    /**
      * Create a new MarshalInputStream object.
      */
     public MarshalInputStream(InputStream in)
@@ -182,7 +174,7 @@
      * from which to load the specified class.
      * It will find, load, and return the class.
      */
-    protected Class resolveClass(ObjectStreamClass classDesc)
+    protected Class<?> resolveClass(ObjectStreamClass classDesc)
         throws IOException, ClassNotFoundException
     {
         /*
@@ -244,7 +236,7 @@
      * resolveProxyClass is extended to acquire (if present) the location
      * to determine the class loader to define the proxy class in.
      */
-    protected Class resolveProxyClass(String[] interfaces)
+    protected Class<?> resolveProxyClass(String[] interfaces)
         throws IOException, ClassNotFoundException
     {
         /*
@@ -268,13 +260,15 @@
      * Returns the first non-null class loader up the execution stack, or null
      * if only code from the null class loader is on the stack.
      */
-    private static native ClassLoader latestUserDefinedLoader();
+    private static ClassLoader latestUserDefinedLoader() {
+        return sun.misc.VM.latestUserDefinedLoader();
+    }
 
     /**
      * Fix for 4179055: Need to assist resolving sun stubs; resolve
      * class locally if it is a "permitted" sun class
      */
-    private Class checkSunClass(String className, AccessControlException e)
+    private Class<?> checkSunClass(String className, AccessControlException e)
         throws AccessControlException
     {
         // ensure that we are giving out a stub for the correct reason
--- a/src/share/classes/sun/rmi/server/UnicastRef.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/rmi/server/UnicastRef.java	Fri Jun 21 19:11:42 2013 -0700
@@ -65,6 +65,7 @@
         Log.getLog("sun.rmi.client.call", "RMI",
                    AccessController.doPrivileged(
                        new GetBooleanAction("sun.rmi.client.logCalls")));
+    private static final long serialVersionUID = 8258372400816541186L;
 
     protected LiveRef ref;
 
--- a/src/share/classes/sun/rmi/server/UnicastRef2.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/rmi/server/UnicastRef2.java	Fri Jun 21 19:11:42 2013 -0700
@@ -36,6 +36,7 @@
  * implementation of javax.management.remote.rmi.RMIConnector.
  **/
 public class UnicastRef2 extends UnicastRef {
+    private static final long serialVersionUID = 1829537514995881838L;
 
     /**
      * Create a new (empty) Unicast remote reference.
--- a/src/share/classes/sun/rmi/server/UnicastServerRef.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/rmi/server/UnicastServerRef.java	Fri Jun 21 19:11:42 2013 -0700
@@ -189,7 +189,7 @@
                                boolean permanent)
         throws RemoteException
     {
-        Class implClass = impl.getClass();
+        Class<?> implClass = impl.getClass();
         Remote stub;
 
         try {
@@ -327,7 +327,7 @@
             // marshal return value
             try {
                 ObjectOutput out = call.getResultStream(true);
-                Class rtype = method.getReturnType();
+                Class<?> rtype = method.getReturnType();
                 if (rtype != void.class) {
                     marshalValue(rtype, result, out);
                 }
@@ -537,7 +537,7 @@
         HashToMethod_Maps() {}
 
         protected Map<Long,Method> computeValue(Class<?> remoteClass) {
-            Map<Long,Method> map = new HashMap<Long,Method>();
+            Map<Long,Method> map = new HashMap<>();
             for (Class<?> cl = remoteClass;
                  cl != null;
                  cl = cl.getSuperclass())
--- a/src/share/classes/sun/rmi/server/Util.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/rmi/server/Util.java	Fri Jun 21 19:11:42 2013 -0700
@@ -119,12 +119,12 @@
      * @throws StubNotFoundException if problem locating/creating stub or
      * creating the dynamic proxy instance
      **/
-    public static Remote createProxy(Class implClass,
+    public static Remote createProxy(Class<?> implClass,
                                      RemoteRef clientRef,
                                      boolean forceStubUse)
         throws StubNotFoundException
     {
-        Class remoteClass;
+        Class<?> remoteClass;
 
         try {
             remoteClass = getRemoteClass(implClass);
@@ -162,7 +162,7 @@
      *
      * @param remoteClass the class to obtain remote interfaces from
      */
-    private static boolean stubClassExists(Class remoteClass) {
+    private static boolean stubClassExists(Class<?> remoteClass) {
         if (!withoutStubs.containsKey(remoteClass)) {
             try {
                 Class.forName(remoteClass.getName() + "_Stub",
@@ -182,11 +182,11 @@
      * @throws ClassNotFoundException if no class is found to have a
      * remote interface
      */
-    private static Class getRemoteClass(Class cl)
+    private static Class<?> getRemoteClass(Class<?> cl)
         throws ClassNotFoundException
     {
         while (cl != null) {
-            Class[] interfaces = cl.getInterfaces();
+            Class<?>[] interfaces = cl.getInterfaces();
             for (int i = interfaces.length -1; i >= 0; i--) {
                 if (Remote.class.isAssignableFrom(interfaces[i]))
                     return cl;          // this class implements remote object
@@ -206,8 +206,8 @@
      *          any illegal remote interfaces
      * @throws  NullPointerException if remoteClass is null
      */
-    private static Class[] getRemoteInterfaces(Class remoteClass) {
-        ArrayList<Class<?>> list = new ArrayList<Class<?>>();
+    private static Class<?>[] getRemoteInterfaces(Class<?> remoteClass) {
+        ArrayList<Class<?>> list = new ArrayList<>();
         getRemoteInterfaces(list, remoteClass);
         return list.toArray(new Class<?>[list.size()]);
     }
@@ -220,15 +220,15 @@
      *          any illegal remote interfaces
      * @throws  NullPointerException if the specified class or list is null
      */
-    private static void getRemoteInterfaces(ArrayList<Class<?>> list, Class cl) {
-        Class superclass = cl.getSuperclass();
+    private static void getRemoteInterfaces(ArrayList<Class<?>> list, Class<?> cl) {
+        Class<?> superclass = cl.getSuperclass();
         if (superclass != null) {
             getRemoteInterfaces(list, superclass);
         }
 
-        Class[] interfaces = cl.getInterfaces();
+        Class<?>[] interfaces = cl.getInterfaces();
         for (int i = 0; i < interfaces.length; i++) {
-            Class intf = interfaces[i];
+            Class<?> intf = interfaces[i];
             /*
              * If it is a remote interface (if it extends from
              * java.rmi.Remote) and is not already in the list,
@@ -272,7 +272,7 @@
      * the stub class is initiated from class loader of the specified class
      * (which may be the bootstrap class loader).
      **/
-    private static RemoteStub createStub(Class remoteClass, RemoteRef ref)
+    private static RemoteStub createStub(Class<?> remoteClass, RemoteRef ref)
         throws StubNotFoundException
     {
         String stubname = remoteClass.getName() + "_Stub";
@@ -285,7 +285,7 @@
         try {
             Class<?> stubcl =
                 Class.forName(stubname, false, remoteClass.getClassLoader());
-            Constructor cons = stubcl.getConstructor(stubConsParamTypes);
+            Constructor<?> cons = stubcl.getConstructor(stubConsParamTypes);
             return (RemoteStub) cons.newInstance(new Object[] { ref });
 
         } catch (ClassNotFoundException e) {
@@ -315,7 +315,7 @@
     static Skeleton createSkeleton(Remote object)
         throws SkeletonNotFoundException
     {
-        Class cl;
+        Class<?> cl;
         try {
             cl = getRemoteClass(object.getClass());
         } catch (ClassNotFoundException ex ) {
@@ -327,7 +327,7 @@
         // now try to load the skeleton based ont he name of the class
         String skelname = cl.getName() + "_Skel";
         try {
-            Class skelcl = Class.forName(skelname, false, cl.getClassLoader());
+            Class<?> skelcl = Class.forName(skelname, false, cl.getClassLoader());
 
             return (Skeleton)skelcl.newInstance();
         } catch (ClassNotFoundException ex) {
@@ -391,12 +391,12 @@
     private static String getMethodNameAndDescriptor(Method m) {
         StringBuffer desc = new StringBuffer(m.getName());
         desc.append('(');
-        Class[] paramTypes = m.getParameterTypes();
+        Class<?>[] paramTypes = m.getParameterTypes();
         for (int i = 0; i < paramTypes.length; i++) {
             desc.append(getTypeDescriptor(paramTypes[i]));
         }
         desc.append(')');
-        Class returnType = m.getReturnType();
+        Class<?> returnType = m.getReturnType();
         if (returnType == void.class) { // optimization: handle void here
             desc.append('V');
         } else {
@@ -409,7 +409,7 @@
      * Get the descriptor of a particular type, as appropriate for either
      * a parameter or return type in a method descriptor.
      */
-    private static String getTypeDescriptor(Class type) {
+    private static String getTypeDescriptor(Class<?> type) {
         if (type.isPrimitive()) {
             if (type == int.class) {
                 return "I";
@@ -454,7 +454,7 @@
      * top-level type (and perhaps other enclosing types), the
      * separator will be '$', etc.
      **/
-    public static String getUnqualifiedName(Class c) {
+    public static String getUnqualifiedName(Class<?> c) {
         String binaryName = c.getName();
         return binaryName.substring(binaryName.lastIndexOf('.') + 1);
     }
--- a/src/share/classes/sun/rmi/server/WeakClassHashMap.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/rmi/server/WeakClassHashMap.java	Fri Jun 21 19:11:42 2013 -0700
@@ -46,8 +46,7 @@
  **/
 public abstract class WeakClassHashMap<V> {
 
-    private Map<Class<?>,ValueCell<V>> internalMap =
-        new WeakHashMap<Class<?>,ValueCell<V>>();
+    private Map<Class<?>,ValueCell<V>> internalMap = new WeakHashMap<>();
 
     protected WeakClassHashMap() { }
 
--- a/src/share/classes/sun/rmi/transport/ConnectionInputStream.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/rmi/transport/ConnectionInputStream.java	Fri Jun 21 19:11:42 2013 -0700
@@ -43,7 +43,7 @@
     private boolean dgcAckNeeded = false;
 
     /** Hashtable mapping Endpoints to lists of LiveRefs to register */
-    private Map incomingRefTable = new HashMap(5);
+    private Map<Endpoint, List<LiveRef>> incomingRefTable = new HashMap<>(5);
 
     /** identifier for gc ack*/
     private UID ackID;
@@ -70,10 +70,10 @@
         Endpoint ep = ref.getEndpoint();
 
         // check whether endpoint is already in the hashtable
-        List refList = (List) incomingRefTable.get(ep);
+        List<LiveRef> refList = incomingRefTable.get(ep);
 
         if (refList == null) {
-            refList = new ArrayList();
+            refList = new ArrayList<LiveRef>();
             incomingRefTable.put(ep, refList);
         }
 
@@ -89,13 +89,9 @@
      */
     void registerRefs() throws IOException {
         if (!incomingRefTable.isEmpty()) {
-            Set entrySet = incomingRefTable.entrySet();
-            Iterator iter = entrySet.iterator();
-            while (iter.hasNext()) {
-                Map.Entry entry = (Map.Entry) iter.next();
-                Endpoint ep = (Endpoint) entry.getKey();
-                List refList = (List) entry.getValue();
-                DGCClient.registerRefs(ep, refList);
+            for (Map.Entry<Endpoint, List<LiveRef>> entry :
+                     incomingRefTable.entrySet()) {
+                DGCClient.registerRefs(entry.getKey(), entry.getValue());
             }
         }
     }
--- a/src/share/classes/sun/rmi/transport/DGCAckHandler.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/rmi/transport/DGCAckHandler.java	Fri Jun 21 19:11:42 2013 -0700
@@ -78,7 +78,7 @@
         Collections.synchronizedMap(new HashMap<UID,DGCAckHandler>());
 
     private final UID id;
-    private List<Object> objList = new ArrayList<Object>(); // null if released
+    private List<Object> objList = new ArrayList<>(); // null if released
     private Future<?> task = null;
 
     /**
--- a/src/share/classes/sun/rmi/transport/DGCClient.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/rmi/transport/DGCClient.java	Fri Jun 21 19:11:42 2013 -0700
@@ -125,7 +125,7 @@
      * All of the LiveRefs in the list must be for remote objects at the
      * given endpoint.
      */
-    static void registerRefs(Endpoint ep, List refs) {
+    static void registerRefs(Endpoint ep, List<LiveRef> refs) {
         /*
          * Look up the given endpoint and register the refs with it.
          * The retrieved entry may get removed from the global endpoint
@@ -176,9 +176,9 @@
         private DGC dgc;
 
         /** table of refs held for endpoint: maps LiveRef to RefEntry */
-        private Map refTable = new HashMap(5);
+        private Map<LiveRef, RefEntry> refTable = new HashMap<>(5);
         /** set of RefEntry instances from last (failed) dirty call */
-        private Set invalidRefs = new HashSet(5);
+        private Set<RefEntry> invalidRefs = new HashSet<>(5);
 
         /** true if this entry has been removed from the global table */
         private boolean removed = false;
@@ -200,12 +200,12 @@
         private boolean interruptible = false;
 
         /** reference queue for phantom references */
-        private ReferenceQueue refQueue = new ReferenceQueue();
+        private ReferenceQueue<LiveRef> refQueue = new ReferenceQueue<>();
         /** set of clean calls that need to be made */
-        private Set pendingCleans = new HashSet(5);
+        private Set<CleanRequest> pendingCleans = new HashSet<>(5);
 
         /** global endpoint table: maps Endpoint to EndpointEntry */
-        private static Map endpointTable = new HashMap(5);
+        private static Map<Endpoint,EndpointEntry> endpointTable = new HashMap<>(5);
         /** handle for GC latency request (for future cancellation) */
         private static GC.LatencyRequest gcLatencyRequest = null;
 
@@ -215,7 +215,7 @@
          */
         public static EndpointEntry lookup(Endpoint ep) {
             synchronized (endpointTable) {
-                EndpointEntry entry = (EndpointEntry) endpointTable.get(ep);
+                EndpointEntry entry = endpointTable.get(ep);
                 if (entry == null) {
                     entry = new EndpointEntry(ep);
                     endpointTable.put(ep, entry);
@@ -260,10 +260,10 @@
          *
          * This method must NOT be called while synchronized on this entry.
          */
-        public boolean registerRefs(List refs) {
+        public boolean registerRefs(List<LiveRef> refs) {
             assert !Thread.holdsLock(this);
 
-            Set refsToDirty = null;     // entries for refs needing dirty
+            Set<RefEntry> refsToDirty = null;     // entries for refs needing dirty
             long sequenceNum;           // sequence number for dirty call
 
             synchronized (this) {
@@ -271,18 +271,18 @@
                     return false;
                 }
 
-                Iterator iter = refs.iterator();
+                Iterator<LiveRef> iter = refs.iterator();
                 while (iter.hasNext()) {
-                    LiveRef ref = (LiveRef) iter.next();
+                    LiveRef ref = iter.next();
                     assert ref.getEndpoint().equals(endpoint);
 
-                    RefEntry refEntry = (RefEntry) refTable.get(ref);
+                    RefEntry refEntry = refTable.get(ref);
                     if (refEntry == null) {
                         LiveRef refClone = (LiveRef) ref.clone();
                         refEntry = new RefEntry(refClone);
                         refTable.put(refClone, refEntry);
                         if (refsToDirty == null) {
-                            refsToDirty = new HashSet(5);
+                            refsToDirty = new HashSet<>(5);
                         }
                         refsToDirty.add(refEntry);
                     }
@@ -345,7 +345,7 @@
          *
          * This method must NOT be called while synchronized on this entry.
          */
-        private void makeDirtyCall(Set refEntries, long sequenceNum) {
+        private void makeDirtyCall(Set<RefEntry> refEntries, long sequenceNum) {
             assert !Thread.holdsLock(this);
 
             ObjID[] ids;
@@ -443,9 +443,9 @@
                          * refs, so that clean calls for them in the future
                          * will be strong.
                          */
-                        Iterator iter = refEntries.iterator();
+                        Iterator<RefEntry> iter = refEntries.iterator();
                         while (iter.hasNext()) {
-                            RefEntry refEntry = (RefEntry) iter.next();
+                            RefEntry refEntry = iter.next();
                             refEntry.markDirtyFailed();
                         }
                     }
@@ -497,7 +497,7 @@
                     long timeToWait;
                     RefEntry.PhantomLiveRef phantom = null;
                     boolean needRenewal = false;
-                    Set refsToDirty = null;
+                    Set<RefEntry> refsToDirty = null;
                     long sequenceNum = Long.MIN_VALUE;
 
                     synchronized (EndpointEntry.this) {
@@ -564,7 +564,7 @@
                             needRenewal = true;
                             if (!invalidRefs.isEmpty()) {
                                 refsToDirty = invalidRefs;
-                                invalidRefs = new HashSet(5);
+                                invalidRefs = new HashSet<>(5);
                             }
                             sequenceNum = getNextSequenceNum();
                         }
@@ -594,8 +594,8 @@
         private void processPhantomRefs(RefEntry.PhantomLiveRef phantom) {
             assert Thread.holdsLock(this);
 
-            Set strongCleans = null;
-            Set normalCleans = null;
+            Set<RefEntry> strongCleans = null;
+            Set<RefEntry> normalCleans = null;
 
             do {
                 RefEntry refEntry = phantom.getRefEntry();
@@ -603,12 +603,12 @@
                 if (refEntry.isRefSetEmpty()) {
                     if (refEntry.hasDirtyFailed()) {
                         if (strongCleans == null) {
-                            strongCleans = new HashSet(5);
+                            strongCleans = new HashSet<>(5);
                         }
                         strongCleans.add(refEntry);
                     } else {
                         if (normalCleans == null) {
-                            normalCleans = new HashSet(5);
+                            normalCleans = new HashSet<>(5);
                         }
                         normalCleans.add(refEntry);
                     }
@@ -659,9 +659,9 @@
         private void makeCleanCalls() {
             assert !Thread.holdsLock(this);
 
-            Iterator iter = pendingCleans.iterator();
+            Iterator<CleanRequest> iter = pendingCleans.iterator();
             while (iter.hasNext()) {
-                CleanRequest request = (CleanRequest) iter.next();
+                CleanRequest request = iter.next();
                 try {
                     dgc.clean(request.objIDs, request.sequenceNum, vmid,
                               request.strong);
@@ -683,11 +683,11 @@
          * Create an array of ObjIDs (needed for the DGC remote calls)
          * from the ids in the given set of refs.
          */
-        private static ObjID[] createObjIDArray(Set refEntries) {
+        private static ObjID[] createObjIDArray(Set<RefEntry> refEntries) {
             ObjID[] ids = new ObjID[refEntries.size()];
-            Iterator iter = refEntries.iterator();
+            Iterator<RefEntry> iter = refEntries.iterator();
             for (int i = 0; i < ids.length; i++) {
-                ids[i] = ((RefEntry) iter.next()).getRef().getObjID();
+                ids[i] = iter.next().getRef().getObjID();
             }
             return ids;
         }
@@ -704,7 +704,7 @@
             /** LiveRef value for this entry (not a registered instance) */
             private LiveRef ref;
             /** set of phantom references to registered instances */
-            private Set refSet = new HashSet(5);
+            private Set<PhantomLiveRef> refSet = new HashSet<>(5);
             /** true if a dirty call containing this ref has failed */
             private boolean dirtyFailed = false;
 
@@ -792,7 +792,7 @@
              * used to detect when the LiveRef becomes permanently
              * unreachable in this VM.
              */
-            private class PhantomLiveRef extends PhantomReference {
+            private class PhantomLiveRef extends PhantomReference<LiveRef> {
 
                 public PhantomLiveRef(LiveRef ref) {
                     super(ref, EndpointEntry.this.refQueue);
--- a/src/share/classes/sun/rmi/transport/DGCImpl.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/rmi/transport/DGCImpl.java	Fri Jun 21 19:11:42 2013 -0700
@@ -84,7 +84,7 @@
     /** remote implementation of DGC interface for this VM */
     private static DGCImpl dgc;
     /** table that maps VMID to LeaseInfo */
-    private Map<VMID,LeaseInfo> leaseTable = new HashMap<VMID,LeaseInfo>();
+    private Map<VMID,LeaseInfo> leaseTable = new HashMap<>();
     /** checks for lease expiration */
     private Future<?> checker = null;
 
@@ -236,7 +236,7 @@
         long time = System.currentTimeMillis();
 
         /* List of vmids that need to be removed from the leaseTable */
-        List<LeaseInfo> toUnregister = new ArrayList<LeaseInfo>();
+        List<LeaseInfo> toUnregister = new ArrayList<>();
 
         /* Build a list of leaseInfo objects that need to have
          * targets removed from their notifySet.  Remove expired
@@ -313,7 +313,7 @@
     private static class LeaseInfo {
         VMID vmid;
         long expiration;
-        Set<Target> notifySet = new HashSet<Target>();
+        Set<Target> notifySet = new HashSet<>();
 
         LeaseInfo(VMID vmid, long lease) {
             this.vmid = vmid;
--- a/src/share/classes/sun/rmi/transport/ObjectTable.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/rmi/transport/ObjectTable.java	Fri Jun 21 19:11:42 2013 -0700
@@ -62,9 +62,9 @@
 
     /** tables mapping to Target, keyed from ObjectEndpoint and impl object */
     private static final Map<ObjectEndpoint,Target> objTable =
-        new HashMap<ObjectEndpoint,Target>();
+        new HashMap<>();
     private static final Map<WeakRef,Target> implTable =
-        new HashMap<WeakRef,Target>();
+        new HashMap<>();
 
     /**
      * lock guarding keepAliveCount, reaper, and gcLatencyRequest.
@@ -79,7 +79,7 @@
     private static Thread reaper = null;
 
     /** queue notified when weak refs in the table are cleared */
-    static final ReferenceQueue reapQueue = new ReferenceQueue();
+    static final ReferenceQueue<Object> reapQueue = new ReferenceQueue<>();
 
     /** handle for GC latency request (for future cancellation) */
     private static GC.LatencyRequest gcLatencyRequest = null;
--- a/src/share/classes/sun/rmi/transport/StreamRemoteCall.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/rmi/transport/StreamRemoteCall.java	Fri Jun 21 19:11:42 2013 -0700
@@ -199,6 +199,7 @@
     /**
      * Do whatever it takes to execute the call.
      */
+    @SuppressWarnings("fallthrough")
     public void executeCall() throws Exception {
         byte returnType;
 
@@ -252,6 +253,7 @@
             } else {
                 throw new UnmarshalException("Return type not Exception");
             }
+            // Exception is thrown before fallthrough can occur
         default:
             if (Transport.transportLog.isLoggable(Log.BRIEF)) {
                 Transport.transportLog.log(Log.BRIEF,
--- a/src/share/classes/sun/rmi/transport/Target.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/rmi/transport/Target.java	Fri Jun 21 19:11:42 2013 -0700
@@ -53,9 +53,10 @@
     /** stub for remote object */
     private final Remote stub;
     /** set of clients that hold references to this target */
-    private final Vector refSet = new Vector();
+    private final Vector<VMID> refSet = new Vector<>();
     /** table that maps client endpoints to sequence numbers */
-    private final Hashtable sequenceTable = new Hashtable(5);
+    private final Hashtable<VMID, SequenceEntry> sequenceTable =
+        new Hashtable<>(5);
     /** access control context in which target was created */
     private final AccessControlContext acc;
     /** context class loader in which target was created */
@@ -241,7 +242,7 @@
      */
     synchronized void referenced(long sequenceNum, VMID vmid) {
         // check sequence number for vmid
-        SequenceEntry entry = (SequenceEntry) sequenceTable.get(vmid);
+        SequenceEntry entry = sequenceTable.get(vmid);
         if (entry == null) {
             sequenceTable.put(vmid, new SequenceEntry(sequenceNum));
         } else if (entry.sequenceNum < sequenceNum) {
@@ -280,7 +281,7 @@
     synchronized void unreferenced(long sequenceNum, VMID vmid, boolean strong)
     {
         // check sequence number for vmid
-        SequenceEntry entry = (SequenceEntry) sequenceTable.get(vmid);
+        SequenceEntry entry = sequenceTable.get(vmid);
         if (entry == null || entry.sequenceNum > sequenceNum) {
             // late clean call; ignore
             return;
@@ -366,9 +367,9 @@
              */
             unpinImpl();
             DGCImpl dgc = DGCImpl.getDGCImpl();
-            Enumeration enum_ = refSet.elements();
+            Enumeration<VMID> enum_ = refSet.elements();
             while (enum_.hasMoreElements()) {
-                VMID vmid = (VMID) enum_.nextElement();
+                VMID vmid = enum_.nextElement();
                 dgc.unregisterTarget(vmid, this);
             }
             return true;
--- a/src/share/classes/sun/rmi/transport/Transport.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/rmi/transport/Transport.java	Fri Jun 21 19:11:42 2013 -0700
@@ -62,7 +62,7 @@
         Log.getLog("sun.rmi.transport.misc", "transport", Transport.logLevel);
 
     /** References the current transport when a call is being serviced */
-    private static final ThreadLocal currentTransport = new ThreadLocal();
+    private static final ThreadLocal<Transport> currentTransport = new ThreadLocal<>();
 
     /** ObjID for DGCImpl */
     private static final ObjID dgcID = new ObjID(ObjID.DGC_ID);
@@ -104,7 +104,7 @@
      * returns null.
      **/
     static Transport currentTransport() {
-        return (Transport) currentTransport.get();
+        return currentTransport.get();
     }
 
     /**
--- a/src/share/classes/sun/rmi/transport/WeakRef.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/rmi/transport/WeakRef.java	Fri Jun 21 19:11:42 2013 -0700
@@ -41,7 +41,7 @@
  * @author  Ann Wollrath
  * @author  Peter Jones
  */
-class WeakRef extends WeakReference {
+class WeakRef extends WeakReference<Object> {
 
     /** value of the referent's "identity" hash code */
     private int hashValue;
@@ -60,7 +60,7 @@
     /**
      * Create a new WeakRef to the given object, registered with a queue.
      */
-    public WeakRef(Object obj, ReferenceQueue q) {
+    public WeakRef(Object obj, ReferenceQueue<Object> q) {
         super(obj, q);
         setHashValue(obj);      // cache object's "identity" hash code
     }
--- a/src/share/classes/sun/rmi/transport/proxy/CGIHandler.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/rmi/transport/proxy/CGIHandler.java	Fri Jun 21 19:11:42 2013 -0700
@@ -33,6 +33,7 @@
  * in a client's request.
  */
 class CGIClientException extends Exception {
+    private static final long serialVersionUID = 8147981687059865216L;
 
     public CGIClientException(String s) {
         super(s);
@@ -44,6 +45,8 @@
  */
 class CGIServerException extends Exception {
 
+    private static final long serialVersionUID = 6928425456704527017L;
+
     public CGIServerException(String s) {
         super(s);
     }
@@ -111,9 +114,9 @@
     };
 
     /* construct table mapping command strings to handlers */
-    private static Hashtable commandLookup;
+    private static Hashtable<String, CGICommandHandler> commandLookup;
     static {
-        commandLookup = new Hashtable();
+        commandLookup = new Hashtable<>();
         for (int i = 0; i < commands.length; ++ i)
             commandLookup.put(commands[i].getName(), commands[i]);
     }
@@ -140,7 +143,7 @@
                 param = QueryString.substring(delim + 1);
             }
             CGICommandHandler handler =
-                (CGICommandHandler) commandLookup.get(command);
+                commandLookup.get(command);
             if (handler != null)
                 try {
                     handler.execute(param);
@@ -200,7 +203,7 @@
 
 /**
  * "forward" command: Forward request body to local port on the server,
- * and send reponse back to client.
+ * and send response back to client.
  */
 final class CGIForwardCommand implements CGICommandHandler {
 
@@ -208,6 +211,11 @@
         return "forward";
     }
 
+    @SuppressWarnings("deprecation")
+    private String getLine (DataInputStream socketIn) throws IOException {
+        return socketIn.readLine();
+    }
+
     public void execute(String param) throws CGIClientException, CGIServerException
     {
         if (!CGIHandler.RequestMethod.equals("POST"))
@@ -276,7 +284,7 @@
         int responseContentLength = -1;
         do {
             try {
-                line = socketIn.readLine();
+                line = getLine(socketIn);
             } catch (IOException e) {
                 throw new CGIServerException("error reading from server");
             }
--- a/src/share/classes/sun/rmi/transport/proxy/HttpSendSocket.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/rmi/transport/proxy/HttpSendSocket.java	Fri Jun 21 19:11:42 2013 -0700
@@ -203,7 +203,7 @@
 
                 message += "HttpSendSocket.readNotify: response body: ";
                 try {
-                    DataInputStream din = new DataInputStream(in);
+                    BufferedReader din = new BufferedReader(new InputStreamReader(in));
                     String line;
                     while ((line = din.readLine()) != null)
                         message += line + lineSeparator;
--- a/src/share/classes/sun/rmi/transport/proxy/RMIMasterSocketFactory.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/rmi/transport/proxy/RMIMasterSocketFactory.java	Fri Jun 21 19:11:42 2013 -0700
@@ -74,20 +74,21 @@
             "sun.rmi.transport.proxy.eagerHttpFallback")).booleanValue();
 
     /** table of hosts successfully connected to and the factory used */
-    private Hashtable successTable = new Hashtable();
+    private Hashtable<String, RMISocketFactory> successTable =
+        new Hashtable<>();
 
     /** maximum number of hosts to remember successful connection to */
     private static final int MaxRememberedHosts = 64;
 
     /** list of the hosts in successTable in initial connection order */
-    private Vector hostList = new Vector(MaxRememberedHosts);
+    private Vector<String> hostList = new Vector<>(MaxRememberedHosts);
 
-    /** default factory to initally use for direct socket connection */
+    /** default factory for initial use for direct socket connection */
     protected RMISocketFactory initialFactory = new RMIDirectSocketFactory();
 
     /** ordered list of factories to try as alternate connection
       * mechanisms if a direct socket connections fails */
-    protected Vector altFactoryList;
+    protected Vector<RMISocketFactory> altFactoryList;
 
     /**
      * Create a RMIMasterSocketFactory object.  Establish order of
@@ -95,7 +96,7 @@
      * socket connection fails.
      */
     public RMIMasterSocketFactory() {
-        altFactoryList = new Vector(2);
+        altFactoryList = new Vector<>(2);
         boolean setFactories = false;
 
         try {
@@ -152,7 +153,7 @@
          * If we remember successfully connecting to this host before,
          * use the same factory.
          */
-        factory = (RMISocketFactory) successTable.get(host);
+        factory = successTable.get(host);
         if (factory != null) {
             if (proxyLog.isLoggable(Log.BRIEF)) {
                 proxyLog.log(Log.BRIEF,
@@ -207,9 +208,7 @@
 
             return initialSocket;
 
-        } catch (UnknownHostException e) {
-            initialFailure = e;
-        } catch (NoRouteToHostException e) {
+        } catch (UnknownHostException | NoRouteToHostException e) {
             initialFailure = e;
         } catch (SocketException e) {
             if (eagerHttpFallback) {
@@ -227,22 +226,20 @@
 
                 // Finally, try any alternate connection mechanisms.
                 for (int i = 0; i < altFactoryList.size(); ++ i) {
-                    factory = (RMISocketFactory) altFactoryList.elementAt(i);
-                    try {
-                        if (proxyLog.isLoggable(Log.BRIEF)) {
-                            proxyLog.log(Log.BRIEF,
-                                "trying with factory: " + factory);
-                        }
-
+                    factory = altFactoryList.elementAt(i);
+                    if (proxyLog.isLoggable(Log.BRIEF)) {
+                        proxyLog.log(Log.BRIEF,
+                            "trying with factory: " + factory);
+                    }
+                    try (Socket testSocket =
+                            factory.createSocket(host, port)) {
                         // For HTTP connections, the output (POST request) must
                         // be sent before we verify a successful connection.
                         // So, sacrifice a socket for the sake of testing...
                         // The following sequence should verify a successful
                         // HTTP connection if no IOException is thrown.
-                        Socket testSocket = factory.createSocket(host, port);
                         InputStream in = testSocket.getInputStream();
                         int b = in.read(); // probably -1 for EOF...
-                        testSocket.close();
                     } catch (IOException ex) {
                         if (proxyLog.isLoggable(Log.BRIEF)) {
                             proxyLog.log(Log.BRIEF, "factory failed: ", ex);
@@ -276,9 +273,7 @@
                 }
                 // if connector ever does get socket, it won't be used
                 connector.notUsed();
-            } catch (UnknownHostException e) {
-                initialFailure = e;
-            } catch (NoRouteToHostException e) {
+            } catch (UnknownHostException | NoRouteToHostException e) {
                 initialFailure = e;
             } catch (SocketException e) {
                 if (eagerHttpFallback) {
--- a/src/share/classes/sun/rmi/transport/tcp/ConnectionMultiplexer.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/rmi/transport/tcp/ConnectionMultiplexer.java	Fri Jun 21 19:11:42 2013 -0700
@@ -85,7 +85,7 @@
     private DataOutputStream dataOut;
 
     /** table holding currently open connection IDs and related info */
-    private Hashtable connectionTable = new Hashtable(7);
+    private Hashtable<Integer, MultiplexConnectionInfo> connectionTable = new Hashtable<>(7);
 
     /** number of currently open connections */
     private int numConnections = 0;
@@ -131,7 +131,6 @@
     {
         try {
             int op, id, length;
-            Integer idObj;
             MultiplexConnectionInfo info;
 
             while (true) {
@@ -148,9 +147,7 @@
                         multiplexLog.log(Log.VERBOSE, "operation  OPEN " + id);
                     }
 
-                    idObj = new Integer(id);
-                    info =
-                        (MultiplexConnectionInfo) connectionTable.get(idObj);
+                    info = connectionTable.get(id);
                     if (info != null)
                         throw new IOException(
                             "OPEN: Connection ID already exists");
@@ -158,7 +155,7 @@
                     info.in = new MultiplexInputStream(this, info, 2048);
                     info.out = new MultiplexOutputStream(this, info, 2048);
                     synchronized (connectionTable) {
-                        connectionTable.put(idObj, info);
+                        connectionTable.put(id, info);
                         ++ numConnections;
                     }
                     sun.rmi.transport.Connection conn;
@@ -174,9 +171,7 @@
                         multiplexLog.log(Log.VERBOSE, "operation  CLOSE " + id);
                     }
 
-                    idObj = new Integer(id);
-                    info =
-                        (MultiplexConnectionInfo) connectionTable.get(idObj);
+                    info = connectionTable.get(id);
                     if (info == null)
                         throw new IOException(
                             "CLOSE: Invalid connection ID");
@@ -185,7 +180,7 @@
                     if (!info.closed)
                         sendCloseAck(info);
                     synchronized (connectionTable) {
-                        connectionTable.remove(idObj);
+                        connectionTable.remove(id);
                         -- numConnections;
                     }
                     break;
@@ -199,9 +194,7 @@
                             "operation  CLOSEACK " + id);
                     }
 
-                    idObj = new Integer(id);
-                    info =
-                        (MultiplexConnectionInfo) connectionTable.get(idObj);
+                    info = connectionTable.get(id);
                     if (info == null)
                         throw new IOException(
                             "CLOSEACK: Invalid connection ID");
@@ -211,7 +204,7 @@
                     info.in.disconnect();
                     info.out.disconnect();
                     synchronized (connectionTable) {
-                        connectionTable.remove(idObj);
+                        connectionTable.remove(id);
                         -- numConnections;
                     }
                     break;
@@ -219,9 +212,7 @@
                 // remote endpoint declaring additional bytes receivable
                 case REQUEST:
                     id = dataIn.readUnsignedShort();
-                    idObj = new Integer(id);
-                    info =
-                        (MultiplexConnectionInfo) connectionTable.get(idObj);
+                    info = connectionTable.get(id);
                     if (info == null)
                         throw new IOException(
                             "REQUEST: Invalid connection ID");
@@ -238,9 +229,7 @@
                 // remote endpoint transmitting data packet
                 case TRANSMIT:
                     id = dataIn.readUnsignedShort();
-                    idObj = new Integer(id);
-                    info =
-                        (MultiplexConnectionInfo) connectionTable.get(idObj);
+                    info = connectionTable.get(id);
                     if (info == null)
                         throw new IOException("SEND: Invalid connection ID");
                     length = dataIn.readInt();
@@ -273,7 +262,6 @@
         // If all possible 32768 IDs are used,
         // this method will block searching for a new ID forever.
         int id;
-        Integer idObj;
         do {
             lastID = (++ lastID) & 0x7FFF;
             id = lastID;
@@ -283,8 +271,7 @@
             // two endpoints.
             if (orig)
                 id |= 0x8000;
-            idObj = new Integer(id);
-        } while (connectionTable.get(idObj) != null);
+        } while (connectionTable.get(id) != null);
 
         // create multiplexing streams and bookkeeping information
         MultiplexConnectionInfo info = new MultiplexConnectionInfo(id);
@@ -298,7 +285,7 @@
             if (numConnections >= maxConnections)
                 throw new IOException("Cannot exceed " + maxConnections +
                     " simultaneous multiplexed connections");
-            connectionTable.put(idObj, info);
+            connectionTable.put(id, info);
             ++ numConnections;
         }
 
@@ -331,10 +318,10 @@
                 return;
             alive = false;
 
-            Enumeration enum_ = connectionTable.elements();
+            Enumeration<MultiplexConnectionInfo> enum_ =
+                    connectionTable.elements();
             while (enum_.hasMoreElements()) {
-                MultiplexConnectionInfo info =
-                    (MultiplexConnectionInfo) enum_.nextElement();
+                MultiplexConnectionInfo info = enum_.nextElement();
                 info.in.disconnect();
                 info.out.disconnect();
             }
--- a/src/share/classes/sun/rmi/transport/tcp/TCPChannel.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/rmi/transport/tcp/TCPChannel.java	Fri Jun 21 19:11:42 2013 -0700
@@ -64,7 +64,7 @@
     private final TCPTransport tr;
     /** list of cached connections */
     private final List<TCPConnection> freeList =
-        new ArrayList<TCPConnection>();
+        new ArrayList<>();
     /** frees cached connections that have expired (guarded by freeList) */
     private Future<?> reaper = null;
 
@@ -480,7 +480,7 @@
     private TCPTransport transport;
 
     /** queue of connections to be accepted */
-    private List<Connection> queue = new ArrayList<Connection>();
+    private List<Connection> queue = new ArrayList<>();
 
     /** thread ID counter */
     private static int threadNum = 0;
--- a/src/share/classes/sun/rmi/transport/tcp/TCPEndpoint.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/rmi/transport/tcp/TCPEndpoint.java	Fri Jun 21 19:11:42 2013 -0700
@@ -148,7 +148,7 @@
     // TBD: should this be a weak hash table?
     private static final
         Map<TCPEndpoint,LinkedList<TCPEndpoint>> localEndpoints =
-        new HashMap<TCPEndpoint,LinkedList<TCPEndpoint>>();
+        new HashMap<>();
 
     /**
      * Create an endpoint for a specified host and port.
@@ -623,10 +623,9 @@
             try {
                 TCPEndpoint.shedConnectionCaches();
                 // REMIND: should we retry createSocket?
-            } catch (OutOfMemoryError mem) {
+            } catch (OutOfMemoryError | Exception mem) {
                 // don't quit if out of memory
-            } catch (Exception ex) {
-                // don't quit if shed fails non-catastrophically
+                // or shed fails non-catastrophically
             }
 
             throw new ConnectIOException("Exception creating connection to: " +
--- a/src/share/classes/sun/rmi/transport/tcp/TCPTransport.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/rmi/transport/tcp/TCPTransport.java	Fri Jun 21 19:11:42 2013 -0700
@@ -28,6 +28,7 @@
 import java.lang.ref.SoftReference;
 import java.lang.ref.WeakReference;
 import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.UndeclaredThrowableException;
 import java.io.DataInputStream;
 import java.io.DataOutputStream;
 import java.io.IOException;
@@ -119,7 +120,7 @@
 
     /** client host for the current thread's connection */
     private static final ThreadLocal<ConnectionHandler>
-        threadConnectionHandler = new ThreadLocal<ConnectionHandler>();
+        threadConnectionHandler = new ThreadLocal<>();
 
     /** endpoints for this transport */
     private final LinkedList<TCPEndpoint> epList;
@@ -129,7 +130,7 @@
     private ServerSocket server = null;
     /** table mapping endpoints to channels */
     private final Map<TCPEndpoint,Reference<TCPChannel>> channelTable =
-        new WeakHashMap<TCPEndpoint,Reference<TCPChannel>>();
+        new WeakHashMap<>();
 
     static final RMISocketFactory defaultSocketFactory =
         RMISocketFactory.getDefaultSocketFactory();
@@ -462,8 +463,10 @@
                             return;
                         }
                         // continue loop
+                    } else if (t instanceof Error) {
+                        throw (Error) t;
                     } else {
-                        throw (Error) t;
+                        throw new UndeclaredThrowableException(t);
                     }
                 }
             }
--- a/src/share/classes/sun/security/krb5/Config.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/security/krb5/Config.java	Fri Jun 21 19:11:42 2013 -0700
@@ -116,7 +116,12 @@
 
     private static boolean isMacosLionOrBetter() {
         // split the "10.x.y" version number
-        String osVersion = System.getProperty("os.version");
+        String osname = getProperty("os.name");
+        if (!osname.contains("OS X")) {
+            return false;
+        }
+
+        String osVersion = getProperty("os.version");
         String[] fragments = osVersion.split("\\.");
 
         // sanity check the "10." part of the version
@@ -141,20 +146,14 @@
         /*
          * If either one system property is specified, we throw exception.
          */
-        String tmp =
-            java.security.AccessController.doPrivileged(
-                new sun.security.action.GetPropertyAction
-                    ("java.security.krb5.kdc"));
+        String tmp = getProperty("java.security.krb5.kdc");
         if (tmp != null) {
             // The user can specify a list of kdc hosts separated by ":"
             defaultKDC = tmp.replace(':', ' ');
         } else {
             defaultKDC = null;
         }
-        defaultRealm =
-            java.security.AccessController.doPrivileged(
-                new sun.security.action.GetPropertyAction
-                    ("java.security.krb5.realm"));
+        defaultRealm = getProperty("java.security.krb5.realm");
         if ((defaultKDC == null && defaultRealm != null) ||
             (defaultRealm == null && defaultKDC != null)) {
             throw new KrbException
@@ -166,11 +165,34 @@
         // Always read the Kerberos configuration file
         try {
             Vector<String> configFile;
-            configFile = loadConfigFile();
-            if (configFile == null && isMacosLionOrBetter()) {
-                stanzaTable = SCDynamicStoreConfig.getConfig();
+            String fileName = getJavaFileName();
+            if (fileName != null) {
+                configFile = loadConfigFile(fileName);
+                stanzaTable = parseStanzaTable(configFile);
+                if (DEBUG) {
+                    System.out.println("Loaded from Java config");
+                }
             } else {
-                stanzaTable = parseStanzaTable(configFile);
+                boolean found = false;
+                if (isMacosLionOrBetter()) {
+                    try {
+                        stanzaTable = SCDynamicStoreConfig.getConfig();
+                        if (DEBUG) {
+                            System.out.println("Loaded from SCDynamicStoreConfig");
+                        }
+                        found = true;
+                    } catch (IOException ioe) {
+                        // OK. Will go on with file
+                    }
+                }
+                if (!found) {
+                    fileName = getNativeFileName();
+                    configFile = loadConfigFile(fileName);
+                    stanzaTable = parseStanzaTable(configFile);
+                    if (DEBUG) {
+                        System.out.println("Loaded from native config");
+                    }
+                }
             }
         } catch (IOException ioe) {
             // No krb5.conf, no problem. We'll use DNS or system property etc.
@@ -538,10 +560,13 @@
      * [domain_realm]
      *          blue.sample.com = TEST.SAMPLE.COM
      *          .backup.com     = EXAMPLE.COM
+     *
+     * @params fileName the conf file, cannot be null
+     * @return the content, null if fileName is empty
+     * @throws IOException if there is an I/O or format error
      */
-    private Vector<String> loadConfigFile() throws IOException {
+    private Vector<String> loadConfigFile(final String fileName) throws IOException {
         try {
-            final String fileName = getFileName();
             if (!fileName.equals("")) {
                 BufferedReader br = new BufferedReader(new InputStreamReader(
                 java.security.AccessController.doPrivileged(
@@ -660,97 +685,106 @@
     }
 
     /**
-     * Gets the default configuration file name. This method will never
-     * return null.
+     * Gets the default Java configuration file name.
      *
      * If the system property "java.security.krb5.conf" is defined, we'll
-     * use its value, no matter if the file exists or not. Otherwise,
-     * the file will be searched in a list of possible loations in the
-     * following order:
+     * use its value, no matter if the file exists or not. Otherwise, we
+     * will look at $JAVA_HOME/lib/security directory with "krb5.conf" name,
+     * and return it if the file exists.
      *
-     * 1. at Java home lib\security directory with "krb5.conf" name,
-     * 2. at windows directory with the name of "krb5.ini" for Windows,
-     * /etc/krb5/krb5.conf for Solaris, /etc/krb5.conf otherwise.
+     * The method returns null if it cannot find a Java config file.
+     */
+    private String getJavaFileName() {
+        String name = getProperty("java.security.krb5.conf");
+        if (name == null) {
+            name = getProperty("java.home") + File.separator +
+                                "lib" + File.separator + "security" +
+                                File.separator + "krb5.conf";
+            if (!fileExists(name)) {
+                name = null;
+            }
+        }
+        if (DEBUG) {
+            System.out.println("Java config name: " + name);
+        }
+        return name;
+    }
+
+    /**
+     * Gets the default native configuration file name.
+     *
+     * Depending on the OS type, the method returns the default native
+     * kerberos config file name, which is at windows directory with
+     * the name of "krb5.ini" for Windows, /etc/krb5/krb5.conf for Solaris,
+     * /etc/krb5.conf otherwise. Mac OSX X has a different file name.
      *
      * Note: When the Terminal Service is started in Windows (from 2003),
      * there are two kinds of Windows directories: A system one (say,
      * C:\Windows), and a user-private one (say, C:\Users\Me\Windows).
      * We will first look for krb5.ini in the user-private one. If not
      * found, try the system one instead.
+     *
+     * This method will always return a non-null non-empty file name,
+     * even if that file does not exist.
      */
-    private String getFileName() {
-        String name =
-            java.security.AccessController.doPrivileged(
-                                new sun.security.action.
-                                GetPropertyAction("java.security.krb5.conf"));
-        if (name == null) {
-            name = java.security.AccessController.doPrivileged(
-                        new sun.security.action.
-                        GetPropertyAction("java.home")) + File.separator +
-                                "lib" + File.separator + "security" +
-                                File.separator + "krb5.conf";
-            if (!fileExists(name)) {
-                name = null;
-                String osname =
-                        java.security.AccessController.doPrivileged(
-                        new sun.security.action.GetPropertyAction("os.name"));
-                if (osname.startsWith("Windows")) {
-                    try {
-                        Credentials.ensureLoaded();
-                    } catch (Exception e) {
-                        // ignore exceptions
+    private String getNativeFileName() {
+        String name = null;
+        String osname = getProperty("os.name");
+        if (osname.startsWith("Windows")) {
+            try {
+                Credentials.ensureLoaded();
+            } catch (Exception e) {
+                // ignore exceptions
+            }
+            if (Credentials.alreadyLoaded) {
+                String path = getWindowsDirectory(false);
+                if (path != null) {
+                    if (path.endsWith("\\")) {
+                        path = path + "krb5.ini";
+                    } else {
+                        path = path + "\\krb5.ini";
                     }
-                    if (Credentials.alreadyLoaded) {
-                        String path = getWindowsDirectory(false);
-                        if (path != null) {
-                            if (path.endsWith("\\")) {
-                                path = path + "krb5.ini";
-                            } else {
-                                path = path + "\\krb5.ini";
-                            }
-                            if (fileExists(path)) {
-                                name = path;
-                            }
+                    if (fileExists(path)) {
+                        name = path;
+                    }
+                }
+                if (name == null) {
+                    path = getWindowsDirectory(true);
+                    if (path != null) {
+                        if (path.endsWith("\\")) {
+                            path = path + "krb5.ini";
+                        } else {
+                            path = path + "\\krb5.ini";
                         }
-                        if (name == null) {
-                            path = getWindowsDirectory(true);
-                            if (path != null) {
-                                if (path.endsWith("\\")) {
-                                    path = path + "krb5.ini";
-                                } else {
-                                    path = path + "\\krb5.ini";
-                                }
-                                name = path;
-                            }
-                        }
+                        name = path;
                     }
-                    if (name == null) {
-                        name = "c:\\winnt\\krb5.ini";
-                    }
-                } else if (osname.startsWith("SunOS")) {
-                    name =  "/etc/krb5/krb5.conf";
-                } else if (osname.contains("OS X")) {
-                    if (isMacosLionOrBetter()) return "";
-                    name = findMacosConfigFile();
-                } else {
-                    name =  "/etc/krb5.conf";
                 }
             }
+            if (name == null) {
+                name = "c:\\winnt\\krb5.ini";
+            }
+        } else if (osname.startsWith("SunOS")) {
+            name =  "/etc/krb5/krb5.conf";
+        } else if (osname.contains("OS X")) {
+            name = findMacosConfigFile();
+        } else {
+            name =  "/etc/krb5.conf";
         }
         if (DEBUG) {
-            System.out.println("Config name: " + name);
+            System.out.println("Native config name: " + name);
         }
         return name;
     }
 
-    private String getProperty(String property) {
-        return (String)java.security.AccessController.doPrivileged(new sun.security.action.GetPropertyAction(property));
+    private static String getProperty(String property) {
+        return java.security.AccessController.doPrivileged(
+                new sun.security.action.GetPropertyAction(property));
     }
 
     private String findMacosConfigFile() {
         String userHome = getProperty("user.home");
         final String PREF_FILE = "/Library/Preferences/edu.mit.Kerberos";
-        String userPrefs=userHome + PREF_FILE;
+        String userPrefs = userHome + PREF_FILE;
 
         if (fileExists(userPrefs)) {
             return userPrefs;
@@ -760,11 +794,7 @@
             return PREF_FILE;
         }
 
-        if (fileExists("/etc/krb5.conf")) {
-            return "/etc/krb5.conf";
-        }
-
-        return "";
+        return "/etc/krb5.conf";
     }
 
     private static String trimmed(String s) {
@@ -1284,7 +1314,7 @@
      */
     private String getKDCFromDNS(String realm) throws KrbException {
         // use DNS to locate KDC
-        String kdcs = null;
+        String kdcs = "";
         String[] srvs = null;
         // locate DNS SRV record using UDP
         if (DEBUG) {
@@ -1294,7 +1324,7 @@
         if (srvs == null) {
             // locate DNS SRV record using TCP
             if (DEBUG) {
-                System.out.println("getKDCFromDNS using UDP");
+                System.out.println("getKDCFromDNS using TCP");
             }
             srvs = KrbServiceLocator.getKerberosService(realm, "_tcp");
         }
@@ -1303,14 +1333,15 @@
             throw new KrbException(Krb5.KRB_ERR_GENERIC,
                 "Unable to locate KDC for realm " + realm);
         }
+        if (srvs.length == 0) {
+            return null;
+        }
         for (int i = 0; i < srvs.length; i++) {
-            String value = srvs[i];
-            for (int j = 0; j < srvs[i].length(); j++) {
-                // filter the KDC name
-                if (value.charAt(j) == ':') {
-                    kdcs = (value.substring(0, j)).trim();
-                }
-            }
+            kdcs += srvs[i].trim() + " ";
+        }
+        kdcs = kdcs.trim();
+        if (kdcs.equals("")) {
+            return null;
         }
         return kdcs;
     }
@@ -1334,32 +1365,52 @@
         }
     }
 
+    // Shows the content of the Config object for debug purpose.
+    //
+    // {
+    //      libdefaults = {
+    //          default_realm = R
+    //      }
+    //      realms = {
+    //          R = {
+    //              kdc = [k1,k2]
+    //          }
+    //      }
+    // }
+
     @Override
     public String toString() {
         StringBuffer sb = new StringBuffer();
-        toStringIndented("", stanzaTable, sb);
+        toStringInternal("", stanzaTable, sb);
         return sb.toString();
     }
-    private static void toStringIndented(String prefix, Object obj,
+    private static void toStringInternal(String prefix, Object obj,
             StringBuffer sb) {
         if (obj instanceof String) {
-            sb.append(prefix);
-            sb.append(obj);
-            sb.append('\n');
+            // A string value, just print it
+            sb.append(obj).append('\n');
         } else if (obj instanceof Hashtable) {
-            Hashtable tab = (Hashtable)obj;
+            // A table, start a new sub-section...
+            Hashtable<?, ?> tab = (Hashtable<?, ?>)obj;
+            sb.append("{\n");
             for (Object o: tab.keySet()) {
-                sb.append(prefix);
+                // ...indent, print "key = ", and
+                sb.append(prefix).append("    ").append(o).append(" = ");
+                // ...go recursively into value
+                toStringInternal(prefix + "    ", tab.get(o), sb);
+            }
+            sb.append(prefix).append("}\n");
+        } else if (obj instanceof Vector) {
+            // A vector of strings, print them inside [ and ]
+            Vector<?> v = (Vector<?>)obj;
+            sb.append("[");
+            boolean first = true;
+            for (Object o: v.toArray()) {
+                if (!first) sb.append(",");
                 sb.append(o);
-                sb.append(" = {\n");
-                toStringIndented(prefix + "    ", tab.get(o), sb);
-                sb.append(prefix + "}\n");
+                first = false;
             }
-        } else if (obj instanceof Vector) {
-            Vector v = (Vector)obj;
-            for (Object o: v.toArray()) {
-                toStringIndented(prefix + "    ", o, sb);
-            }
+            sb.append("]\n");
         }
     }
 }
--- a/src/share/classes/sun/security/krb5/Credentials.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/security/krb5/Credentials.java	Fri Jun 21 19:11:42 2013 -0700
@@ -330,12 +330,17 @@
         CredentialsCache ccache =
             CredentialsCache.getInstance(princ, ticketCache);
 
-        if (ccache == null)
+        if (ccache == null) {
             return null;
+        }
 
         sun.security.krb5.internal.ccache.Credentials tgtCred  =
             ccache.getDefaultCreds();
 
+        if (tgtCred == null) {
+            return null;
+        }
+
         if (EType.isSupported(tgtCred.getEType())) {
             return tgtCred.setKrbCreds();
         } else {
@@ -375,19 +380,21 @@
             cache = CredentialsCache.getInstance();
         }
         if (cache != null) {
-            if (DEBUG) {
-                System.out.println(">>> KrbCreds found the default ticket " +
-                                   "granting ticket in credential cache.");
-            }
             sun.security.krb5.internal.ccache.Credentials temp =
                 cache.getDefaultCreds();
-            if (EType.isSupported(temp.getEType())) {
-                result = temp.setKrbCreds();
-            } else {
+            if (temp != null) {
                 if (DEBUG) {
-                    System.out.println(
-                        ">>> unsupported key type found the default TGT: " +
-                        temp.getEType());
+                    System.out.println(">>> KrbCreds found the default ticket"
+                            + " granting ticket in credential cache.");
+                }
+                if (EType.isSupported(temp.getEType())) {
+                    result = temp.setKrbCreds();
+                } else {
+                    if (DEBUG) {
+                        System.out.println(
+                            ">>> unsupported key type found the default TGT: " +
+                            temp.getEType());
+                    }
                 }
             }
         }
--- a/src/share/classes/sun/security/krb5/PrincipalName.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/security/krb5/PrincipalName.java	Fri Jun 21 19:11:42 2013 -0700
@@ -461,7 +461,7 @@
     }
 
     public String[] getNameStrings() {
-        return nameStrings;
+        return nameStrings.clone();
     }
 
     public byte[][] toByteArray() {
--- a/src/share/classes/sun/security/krb5/internal/ccache/FileCredentialsCache.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/security/krb5/internal/ccache/FileCredentialsCache.java	Fri Jun 21 19:11:42 2013 -0700
@@ -356,7 +356,7 @@
      * Returns path name of the credentials cache file.
      * The path name is searched in the following order:
      *
-     * 1. KRB5CCNAME
+     * 1. KRB5CCNAME (bare file name without FILE:)
      * 2. /tmp/krb5cc_<uid> on unix systems
      * 3. <user.home>/krb5cc_<user.name>
      * 4. <user.home>/krb5cc (if can't get <user.name>)
@@ -367,11 +367,19 @@
         String stdCacheNameComponent = "krb5cc";
         String name;
 
+        // The env var can start with TYPE:, we only support FILE: here.
+        // http://docs.oracle.com/cd/E19082-01/819-2252/6n4i8rtr3/index.html
         name = java.security.AccessController.doPrivileged(
                 new java.security.PrivilegedAction<String>() {
             @Override
             public String run() {
-                return System.getenv("KRB5CCNAME");
+                String cache = System.getenv("KRB5CCNAME");
+                if (cache != null &&
+                        (cache.length() >= 5) &&
+                        cache.regionMatches(true, 0, "FILE:", 0, 5)) {
+                    cache = cache.substring(5);
+                }
+                return cache;
             }
         });
         if (name != null) {
--- a/src/share/classes/sun/security/krb5/internal/ktab/KeyTab.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/security/krb5/internal/ktab/KeyTab.java	Fri Jun 21 19:11:42 2013 -0700
@@ -77,7 +77,7 @@
 
     private final String tabName;
     private long lastModified;
-    private int kt_vno;
+    private int kt_vno = KRB5_KT_VNO;
 
     private Vector<KeyTabEntry> entries = new Vector<>();
 
@@ -141,7 +141,7 @@
         if (s == null) {
             return getInstance();
         } else {
-            return getInstance0(parse(s));
+            return getInstance0(normalize(s));
         }
     }
 
@@ -191,7 +191,7 @@
                 if (keytab_names != null) {
                     StringTokenizer st = new StringTokenizer(keytab_names, " ");
                     while (st.hasMoreTokens()) {
-                        kname = parse(st.nextToken());
+                        kname = normalize(st.nextToken());
                         if (new File(kname).exists()) {
                             break;
                         }
@@ -220,11 +220,13 @@
     }
 
     /**
-     * Parses some common keytab name formats
+     * Normalizes some common keytab name formats into the bare file name.
+     * For example, FILE:/etc/krb5.keytab to /etc/krb5.keytab
      * @param name never null
      * @return never null
      */
-    private static String parse(String name) {
+    // This method is used in this class and Krb5LoginModule
+    public static String normalize(String name) {
         String kname;
         if ((name.length() >= 5) &&
             (name.substring(0, 5).equalsIgnoreCase("FILE:"))) {
--- a/src/share/classes/sun/security/pkcs/PKCS7.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/security/pkcs/PKCS7.java	Fri Jun 21 19:11:42 2013 -0700
@@ -133,7 +133,8 @@
             } catch (IOException ioe1) {
                 ParsingException pe = new ParsingException(
                     ioe1.getMessage());
-                pe.initCause(ioe1);
+                pe.initCause(ioe);
+                pe.addSuppressed(ioe1);
                 throw pe;
             }
         }
@@ -281,19 +282,26 @@
 
             len = certVals.length;
             certificates = new X509Certificate[len];
+            int count = 0;
 
             for (int i = 0; i < len; i++) {
                 ByteArrayInputStream bais = null;
                 try {
-                    if (certfac == null)
-                        certificates[i] = new X509CertImpl(certVals[i]);
-                    else {
-                        byte[] encoded = certVals[i].toByteArray();
-                        bais = new ByteArrayInputStream(encoded);
-                        certificates[i] =
-                            (X509Certificate)certfac.generateCertificate(bais);
-                        bais.close();
-                        bais = null;
+                    byte tag = certVals[i].getTag();
+                    // We only parse the normal certificate. Other types of
+                    // CertificateChoices ignored.
+                    if (tag == DerValue.tag_Sequence) {
+                        if (certfac == null) {
+                            certificates[count] = new X509CertImpl(certVals[i]);
+                        } else {
+                            byte[] encoded = certVals[i].toByteArray();
+                            bais = new ByteArrayInputStream(encoded);
+                            certificates[count] =
+                                (X509Certificate)certfac.generateCertificate(bais);
+                            bais.close();
+                            bais = null;
+                        }
+                        count++;
                     }
                 } catch (CertificateException ce) {
                     ParsingException pe = new ParsingException(ce.getMessage());
@@ -308,6 +316,9 @@
                         bais.close();
                 }
             }
+            if (count != len) {
+                certificates = Arrays.copyOf(certificates, count);
+            }
         }
 
         // check if crls (implicit tag) are provided (crls are OPTIONAL)
--- a/src/share/classes/sun/security/pkcs/PKCS9Attribute.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/security/pkcs/PKCS9Attribute.java	Fri Jun 21 19:11:42 2013 -0700
@@ -42,12 +42,14 @@
 
 /**
  * Class supporting any PKCS9 attributes.
- * Supports DER decoding and access to attribute values, but not
- * DER encoding or setting of values.
+ * Supports DER decoding/encoding and access to attribute values.
  *
  * <a name="classTable"><h3>Type/Class Table</h3></a>
  * The following table shows the correspondence between
  * PKCS9 attribute types and value component classes.
+ * For types not listed here, its name is the OID
+ * in string form, its value is a (single-valued)
+ * byte array that is the SET's encoding.
  *
  * <P>
  * <TABLE BORDER CELLPADDING=8 ALIGN=CENTER>
@@ -185,6 +187,8 @@
      */
     static final ObjectIdentifier[] PKCS9_OIDS = new ObjectIdentifier[18];
 
+    private final static Class<?> BYTE_ARRAY_CLASS;
+
     static {   // static initializer for PKCS9_OIDS
         for (int i = 1; i < PKCS9_OIDS.length - 2; i++) {
             PKCS9_OIDS[i] =
@@ -196,6 +200,12 @@
             ObjectIdentifier.newInternal(new int[]{1,2,840,113549,1,9,16,2,12});
         PKCS9_OIDS[PKCS9_OIDS.length - 1] =
             ObjectIdentifier.newInternal(new int[]{1,2,840,113549,1,9,16,2,14});
+
+        try {
+            BYTE_ARRAY_CLASS = Class.forName("[B");
+        } catch (ClassNotFoundException e) {
+            throw new ExceptionInInitializerError(e.toString());
+        }
     }
 
     // first element [0] not used
@@ -331,7 +341,7 @@
             VALUE_CLASSES[2] = str;   // UnstructuredName
             VALUE_CLASSES[3] =        // ContentType
                 Class.forName("sun.security.util.ObjectIdentifier");
-            VALUE_CLASSES[4] = Class.forName("[B"); // MessageDigest (byte[])
+            VALUE_CLASSES[4] = BYTE_ARRAY_CLASS; // MessageDigest (byte[])
             VALUE_CLASSES[5] = Class.forName("java.util.Date"); // SigningTime
             VALUE_CLASSES[6] =        // Countersignature
                 Class.forName("[Lsun.security.pkcs.SignerInfo;");
@@ -347,7 +357,7 @@
                 Class.forName("sun.security.x509.CertificateExtensions");
             VALUE_CLASSES[15] = null;  // not supported yet
             VALUE_CLASSES[16] = null;  // not supported yet
-            VALUE_CLASSES[17] = Class.forName("[B");  // SignatureTimestampToken
+            VALUE_CLASSES[17] = BYTE_ARRAY_CLASS;  // SignatureTimestampToken
         } catch (ClassNotFoundException e) {
             throw new ExceptionInInitializerError(e.toString());
         }
@@ -379,13 +389,20 @@
     };
 
     /**
-     * The OID of this attribute is <code>PKCS9_OIDS[index]</code>.
+     * The OID of this attribute.
+     */
+    private ObjectIdentifier oid;
+
+    /**
+     * The index of the OID of this attribute in <code>PKCS9_OIDS</code>,
+     * or -1 if it's unknown.
      */
     private int index;
 
     /**
      * Value set of this attribute.  Its class is given by
-     * <code>VALUE_CLASSES[index]</code>.
+     * <code>VALUE_CLASSES[index]</code>. The SET itself
+     * as byte[] if unknown.
      */
     private Object value;
 
@@ -400,6 +417,8 @@
      * <a href=#classTable>table</a> gives the class that <code>value</code>
      * must have for a given attribute.
      *
+     * @exception IllegalArgumentException
+     * if the <code>value</code> has the wrong type.
      */
     public PKCS9Attribute(ObjectIdentifier oid, Object value)
     throws IllegalArgumentException {
@@ -419,7 +438,7 @@
      * attributes are accepted; in particular, case does not matter.
      *
      * @exception IllegalArgumentException
-     * if the <code>name</code> is not recognized of the
+     * if the <code>name</code> is not recognized or the
      * <code>value</code> has the wrong type.
      */
     public PKCS9Attribute(String name, Object value)
@@ -437,21 +456,17 @@
     private void init(ObjectIdentifier oid, Object value)
         throws IllegalArgumentException {
 
+        this.oid = oid;
         index = indexOf(oid, PKCS9_OIDS, 1);
-
-        if (index == -1)
-            throw new IllegalArgumentException(
-                       "Unsupported OID " + oid +
-                       " constructing PKCS9Attribute.");
-
-        if (!VALUE_CLASSES[index].isInstance(value))
+        Class<?> clazz = index == -1 ? BYTE_ARRAY_CLASS: VALUE_CLASSES[index];
+        if (!clazz.isInstance(value)) {
                 throw new IllegalArgumentException(
                            "Wrong value class " +
                            " for attribute " + oid +
                            " constructing PKCS9Attribute; was " +
                            value.getClass().toString() + ", should be " +
-                           VALUE_CLASSES[index].toString());
-
+                           clazz.toString());
+        }
         this.value = value;
     }
 
@@ -475,16 +490,19 @@
             throw new IOException("PKCS9Attribute doesn't have two components");
 
         // get the oid
-        ObjectIdentifier oid = val[0].getOID();
+        oid = val[0].getOID();
+        byte[] content = val[1].toByteArray();
+        DerValue[] elems = new DerInputStream(content).getSet(1);
+
         index = indexOf(oid, PKCS9_OIDS, 1);
         if (index == -1) {
             if (debug != null) {
-                debug.println("ignoring unsupported signer attribute: " + oid);
+                debug.println("Unsupported signer attribute: " + oid);
             }
-            throw new ParsingException("Unsupported PKCS9 attribute: " + oid);
+            value = content;
+            return;
         }
 
-        DerValue[] elems = new DerInputStream(val[1].toByteArray()).getSet(1);
         // check single valued have only one value
         if (SINGLE_VALUED[index] && elems.length > 1)
             throwSingleValuedException();
@@ -584,8 +602,11 @@
      */
     public void derEncode(OutputStream out) throws IOException {
         DerOutputStream temp = new DerOutputStream();
-        temp.putOID(getOID());
+        temp.putOID(oid);
         switch (index) {
+        case -1:    // Unknown
+            temp.write((byte[])value);
+            break;
         case 1:     // email address
         case 2:     // unstructured name
             { // open scope
@@ -704,6 +725,14 @@
     }
 
     /**
+     * Returns if the attribute is known. Unknown attributes can be created
+     * from DER encoding with unknown OIDs.
+     */
+    public boolean isKnown() {
+        return index != -1;
+    }
+
+    /**
      * Get the value of this attribute.  If the attribute is
      * single-valued, return just the one value.  If the attribute is
      * multi-valued, return an array containing all the values.
@@ -721,21 +750,23 @@
      * Show whether this attribute is single-valued.
      */
     public boolean isSingleValued() {
-        return SINGLE_VALUED[index];
+        return index == -1 || SINGLE_VALUED[index];
     }
 
     /**
      *  Return the OID of this attribute.
      */
     public ObjectIdentifier getOID() {
-        return PKCS9_OIDS[index];
+        return oid;
     }
 
     /**
      *  Return the name of this attribute.
      */
     public String getName() {
-        return OID_NAME_TABLE.get(PKCS9_OIDS[index]);
+        return index == -1 ?
+                oid.toString() :
+                OID_NAME_TABLE.get(PKCS9_OIDS[index]);
     }
 
     /**
@@ -762,10 +793,14 @@
 
         buf.append("[");
 
-        buf.append(OID_NAME_TABLE.get(PKCS9_OIDS[index]));
+        if (index == -1) {
+            buf.append(oid.toString());
+        } else {
+            buf.append(OID_NAME_TABLE.get(PKCS9_OIDS[index]));
+        }
         buf.append(": ");
 
-        if (SINGLE_VALUED[index]) {
+        if (index == -1 || SINGLE_VALUED[index]) {
             if (value instanceof byte[]) { // special case for octet string
                 HexDumpEncoder hexDump = new HexDumpEncoder();
                 buf.append(hexDump.encodeBuffer((byte[]) value));
@@ -809,20 +844,21 @@
      */
     private void throwSingleValuedException() throws IOException {
         throw new IOException("Single-value attribute " +
-                              getOID() + " (" + getName() + ")" +
+                              oid + " (" + getName() + ")" +
                               " has multiple values.");
     }
 
     /**
      * Throw an exception when the tag on a value encoding is
-     * wrong for the attribute whose value it is.
+     * wrong for the attribute whose value it is. This method
+     * will only be called for known tags.
      */
     private void throwTagException(Byte tag)
     throws IOException {
         Byte[] expectedTags = PKCS9_VALUE_TAGS[index];
         StringBuffer msg = new StringBuffer(100);
         msg.append("Value of attribute ");
-        msg.append(getOID().toString());
+        msg.append(oid.toString());
         msg.append(" (");
         msg.append(getName());
         msg.append(") has wrong tag: ");
--- a/src/share/classes/sun/security/provider/certpath/CrlRevocationChecker.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/security/provider/certpath/CrlRevocationChecker.java	Fri Jun 21 19:11:42 2013 -0700
@@ -38,8 +38,27 @@
 import java.security.InvalidAlgorithmParameterException;
 import java.security.NoSuchAlgorithmException;
 import java.security.PublicKey;
-import java.security.cert.*;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateException;
+import java.security.cert.CertificateRevokedException;
+import java.security.cert.CertPathBuilder;
+import java.security.cert.CertPathBuilderException;
+import java.security.cert.CertPathValidatorException;
 import java.security.cert.CertPathValidatorException.BasicReason;
+import java.security.cert.CertStore;
+import java.security.cert.CollectionCertStoreParameters;
+import java.security.cert.CRLException;
+import java.security.cert.CRLReason;
+import java.security.cert.PKIXBuilderParameters;
+import java.security.cert.PKIXCertPathBuilderResult;
+import java.security.cert.PKIXCertPathChecker;
+import java.security.cert.PKIXParameters;
+import java.security.cert.TrustAnchor;
+import java.security.cert.X509Certificate;
+import java.security.cert.X509CertSelector;
+import java.security.cert.X509CRL;
+import java.security.cert.X509CRLEntry;
+import java.security.cert.X509CRLSelector;
 import java.security.interfaces.DSAPublicKey;
 import javax.security.auth.x500.X500Principal;
 import sun.security.util.Debug;
--- a/src/share/classes/sun/security/provider/certpath/OCSPChecker.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/security/provider/certpath/OCSPChecker.java	Fri Jun 21 19:11:42 2013 -0700
@@ -31,8 +31,19 @@
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.security.Security;
-import java.security.cert.*;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateException;
+import java.security.cert.CertificateRevokedException;
+import java.security.cert.CertPath;
+import java.security.cert.CertPathValidatorException;
 import java.security.cert.CertPathValidatorException.BasicReason;
+import java.security.cert.CertStore;
+import java.security.cert.CertStoreException;
+import java.security.cert.PKIXCertPathChecker;
+import java.security.cert.PKIXParameters;
+import java.security.cert.TrustAnchor;
+import java.security.cert.X509Certificate;
+import java.security.cert.X509CertSelector;
 import java.net.URI;
 import java.net.URISyntaxException;
 import javax.security.auth.x500.X500Principal;
--- a/src/share/classes/sun/security/provider/certpath/OCSPResponse.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/security/provider/certpath/OCSPResponse.java	Fri Jun 21 19:11:42 2013 -0700
@@ -317,7 +317,7 @@
         }
         for (int i = 0; i < singleResponseDer.length; i++) {
             SingleResponse singleResponse
-                = new SingleResponse(singleResponseDer[i]);
+                = new SingleResponse(singleResponseDer[i], dateCheckedAgainst);
             singleResponseMap.put(singleResponse.getCertId(), singleResponse);
         }
 
@@ -465,7 +465,11 @@
 
                     // Check the date validity
                     try {
-                        signerCert.checkValidity();
+                        if (dateCheckedAgainst == null) {
+                            signerCert.checkValidity();
+                        } else {
+                            signerCert.checkValidity(dateCheckedAgainst);
+                        }
                     } catch (GeneralSecurityException e) {
                         if (DEBUG != null) {
                             DEBUG.println("Responder's certificate not within" +
@@ -549,7 +553,7 @@
 
         try {
             Signature respSignature = Signature.getInstance(sigAlgId.getName());
-            respSignature.initVerify(cert);
+            respSignature.initVerify(cert.getPublicKey());
             respSignature.update(responseData);
 
             if (respSignature.verify(signBytes)) {
@@ -595,6 +599,11 @@
         private final Map<String, java.security.cert.Extension> singleExtensions;
 
         private SingleResponse(DerValue der) throws IOException {
+            this(der, null);
+        }
+
+        private SingleResponse(DerValue der, Date dateCheckedAgainst)
+            throws IOException {
             if (der.tag != DerValue.tag_Sequence) {
                 throw new IOException("Bad ASN.1 encoding in SingleResponse");
             }
@@ -692,7 +701,8 @@
                 singleExtensions = Collections.emptyMap();
             }
 
-            long now = System.currentTimeMillis();
+            long now = (dateCheckedAgainst == null) ?
+                System.currentTimeMillis() : dateCheckedAgainst.getTime();
             Date nowPlusSkew = new Date(now + MAX_CLOCK_SKEW);
             Date nowMinusSkew = new Date(now - MAX_CLOCK_SKEW);
             if (DEBUG != null) {
--- a/src/share/classes/sun/security/ssl/HandshakeMessage.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/security/ssl/HandshakeMessage.java	Fri Jun 21 19:11:42 2013 -0700
@@ -134,7 +134,7 @@
      */
     final void write(HandshakeOutStream s) throws IOException {
         int len = messageLength();
-        if (len > (1 << 24)) {
+        if (len >= Record.OVERFLOW_OF_INT24) {
             throw new SSLException("Handshake message too big"
                 + ", type = " + messageType() + ", len = " + len);
         }
--- a/src/share/classes/sun/security/ssl/HandshakeOutStream.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/security/ssl/HandshakeOutStream.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -153,10 +153,12 @@
      */
 
     void putInt8(int i) throws IOException {
+        checkOverflow(i, Record.OVERFLOW_OF_INT08);
         r.write(i);
     }
 
     void putInt16(int i) throws IOException {
+        checkOverflow(i, Record.OVERFLOW_OF_INT16);
         if (r.availableDataBytes() < 2) {
             flush();
         }
@@ -165,6 +167,7 @@
     }
 
     void putInt24(int i) throws IOException {
+        checkOverflow(i, Record.OVERFLOW_OF_INT24);
         if (r.availableDataBytes() < 3) {
             flush();
         }
@@ -191,6 +194,8 @@
         if (b == null) {
             putInt8(0);
             return;
+        } else {
+            checkOverflow(b.length, Record.OVERFLOW_OF_INT08);
         }
         putInt8(b.length);
         write(b, 0, b.length);
@@ -200,6 +205,8 @@
         if (b == null) {
             putInt16(0);
             return;
+        } else {
+            checkOverflow(b.length, Record.OVERFLOW_OF_INT16);
         }
         putInt16(b.length);
         write(b, 0, b.length);
@@ -209,8 +216,19 @@
         if (b == null) {
             putInt24(0);
             return;
+        } else {
+            checkOverflow(b.length, Record.OVERFLOW_OF_INT24);
         }
         putInt24(b.length);
         write(b, 0, b.length);
     }
+
+    private void checkOverflow(int length, int overflow) {
+        if (length >= overflow) {
+            // internal_error alert will be triggered
+            throw new RuntimeException(
+                    "Field length overflow, the field length (" +
+                    length + ") should be less than " + overflow);
+        }
+    }
 }
--- a/src/share/classes/sun/security/ssl/Record.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/security/ssl/Record.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -110,4 +110,10 @@
                                     + maxPadding        // padding
                                     + trailerSize;      // MAC
 
+    /*
+     * The overflow values of integers of 8, 16 and 24 bits.
+     */
+    static final int OVERFLOW_OF_INT08 = (1 << 8);
+    static final int OVERFLOW_OF_INT16 = (1 << 16);
+    static final int OVERFLOW_OF_INT24 = (1 << 24);
 }
--- a/src/share/classes/sun/security/ssl/SSLContextImpl.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/security/ssl/SSLContextImpl.java	Fri Jun 21 19:11:42 2013 -0700
@@ -266,7 +266,7 @@
     }
 
     // Get suported CipherSuiteList.
-    CipherSuiteList getSuportedCipherSuiteList() {
+    CipherSuiteList getSupportedCipherSuiteList() {
         // The maintenance of cipher suites needs to be synchronized.
         synchronized (this) {
             // Clear cache of available ciphersuites.
--- a/src/share/classes/sun/security/ssl/SSLEngineImpl.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/security/ssl/SSLEngineImpl.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1967,7 +1967,7 @@
      * @return an array of cipher suite names
      */
     public String[] getSupportedCipherSuites() {
-        return sslContext.getSuportedCipherSuiteList().toStringArray();
+        return sslContext.getSupportedCipherSuiteList().toStringArray();
     }
 
     /**
--- a/src/share/classes/sun/security/ssl/SSLServerSocketFactoryImpl.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/security/ssl/SSLServerSocketFactoryImpl.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -113,7 +113,7 @@
      * @return an array of cipher suite names
      */
     public String[] getSupportedCipherSuites() {
-        return context.getSuportedCipherSuiteList().toStringArray();
+        return context.getSupportedCipherSuiteList().toStringArray();
     }
 
 }
--- a/src/share/classes/sun/security/ssl/SSLServerSocketImpl.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/security/ssl/SSLServerSocketImpl.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -168,7 +168,7 @@
      * @return an array of cipher suite names
      */
     public String[] getSupportedCipherSuites() {
-        return sslContext.getSuportedCipherSuiteList().toStringArray();
+        return sslContext.getSupportedCipherSuiteList().toStringArray();
     }
 
     /**
--- a/src/share/classes/sun/security/ssl/SSLSocketFactoryImpl.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/security/ssl/SSLSocketFactoryImpl.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -177,6 +177,6 @@
      * certain kinds of certificates to use certain cipher suites.
      */
     public String[] getSupportedCipherSuites() {
-        return context.getSuportedCipherSuiteList().toStringArray();
+        return context.getSupportedCipherSuiteList().toStringArray();
     }
 }
--- a/src/share/classes/sun/security/ssl/SSLSocketImpl.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/security/ssl/SSLSocketImpl.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1560,11 +1560,9 @@
         Throwable cachedThrowable = null;
         try {
             switch (state) {
-            /*
-             * java.net code sometimes closes sockets "early", when
-             * we can't actually do I/O on them.
-             */
             case cs_START:
+                // unconnected socket or handshaking has not been initialized
+                closeSocket(selfInitiated);
                 break;
 
             /*
@@ -2340,7 +2338,7 @@
      * @return an array of cipher suite names
      */
     public String[] getSupportedCipherSuites() {
-        return sslContext.getSuportedCipherSuiteList().toStringArray();
+        return sslContext.getSupportedCipherSuiteList().toStringArray();
     }
 
     /**
--- a/src/share/classes/sun/security/timestamp/TSResponse.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/security/timestamp/TSResponse.java	Fri Jun 21 19:11:42 2013 -0700
@@ -341,7 +341,7 @@
             DerValue[] strings = status.data.getSequence(1);
             statusString = new String[strings.length];
             for (int i = 0; i < strings.length; i++) {
-                statusString[i] = strings[i].data.getUTF8String();
+                statusString[i] = strings[i].getUTF8String();
             }
         }
         // Parse failInfo, if present
--- a/src/share/classes/sun/security/tools/JarSigner.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/security/tools/JarSigner.java	Fri Jun 21 19:11:42 2013 -0700
@@ -66,7 +66,7 @@
  * 0: success
  * 1: any error that the jar cannot be signed or verified, including:
  *      keystore loading error
- *      TSP communciation error
+ *      TSP communication error
  *      jarsigner command line error...
  * otherwise: error codes from -strict
  *
@@ -258,8 +258,7 @@
             if (hasExpiringCert) {
                 exitCode |= 2;
             }
-            if (chainNotValidated) {
-                // hasExpiredCert and notYetValidCert included in this case
+            if (chainNotValidated || hasExpiredCert || notYetValidCert) {
                 exitCode |= 4;
             }
             if (badKeyUsage || badExtendedKeyUsage || badNetscapeCertType) {
@@ -600,7 +599,6 @@
                 if (verbose != null) System.out.println();
                 Enumeration<JarEntry> e = entriesVec.elements();
 
-                long now = System.currentTimeMillis();
                 String tab = rb.getString("6SPACE");
 
                 while (e.hasMoreElements()) {
@@ -648,7 +646,7 @@
                             // signerInfo() must be called even if -verbose
                             // not provided. The method updates various
                             // warning flags.
-                            String si = signerInfo(signer, tab, now);
+                            String si = signerInfo(signer, tab);
                             if (showcerts) {
                                 sb.append(si);
                                 sb.append('\n');
@@ -837,7 +835,7 @@
      * Note: no newline character at the end
      */
     String printCert(String tab, Certificate c, boolean checkValidityPeriod,
-        long now, boolean checkUsage) {
+        Date timestamp, boolean checkUsage) {
 
         StringBuilder certStr = new StringBuilder();
         String space = rb.getString("SPACE");
@@ -862,22 +860,24 @@
             certStr.append("\n").append(tab).append("[");
             Date notAfter = x509Cert.getNotAfter();
             try {
-                x509Cert.checkValidity();
-                // test if cert will expire within six months
-                if (now == 0) {
-                    now = System.currentTimeMillis();
+                boolean printValidity = true;
+                if (timestamp == null) {
+                    x509Cert.checkValidity();
+                    // test if cert will expire within six months
+                    if (notAfter.getTime() < System.currentTimeMillis() + SIX_MONTHS) {
+                        hasExpiringCert = true;
+                        if (expiringTimeForm == null) {
+                            expiringTimeForm = new MessageFormat(
+                                rb.getString("certificate.will.expire.on"));
+                        }
+                        Object[] source = { notAfter };
+                        certStr.append(expiringTimeForm.format(source));
+                        printValidity = false;
+                    }
+                } else {
+                    x509Cert.checkValidity(timestamp);
                 }
-                if (notAfter.getTime() < now + SIX_MONTHS) {
-                    hasExpiringCert = true;
-
-                    if (expiringTimeForm == null) {
-                        expiringTimeForm = new MessageFormat(
-                            rb.getString("certificate.will.expire.on"));
-                    }
-                    Object[] source = { notAfter };
-                    certStr.append(expiringTimeForm.format(source));
-
-                } else {
+                if (printValidity) {
                     if (validityTimeForm == null) {
                         validityTimeForm = new MessageFormat(
                             rb.getString("certificate.is.valid.from"));
@@ -1284,7 +1284,7 @@
                             certUrl);
                     }
                     System.out.println(rb.getString("TSA.certificate.") +
-                        printCert("", tsaCert, false, 0, false));
+                        printCert("", tsaCert, false, null, false));
                 }
                 if (signingMechanism != null) {
                     System.out.println(
@@ -1481,23 +1481,27 @@
     /**
      * Returns a string of singer info, with a newline at the end
      */
-    private String signerInfo(CodeSigner signer, String tab, long now) {
+    private String signerInfo(CodeSigner signer, String tab) {
         if (cacheForSignerInfo.containsKey(signer)) {
             return cacheForSignerInfo.get(signer);
         }
         StringBuffer s = new StringBuffer();
         List<? extends Certificate> certs = signer.getSignerCertPath().getCertificates();
         // display the signature timestamp, if present
-        Timestamp timestamp = signer.getTimestamp();
-        if (timestamp != null) {
-            s.append(printTimestamp(tab, timestamp));
+        Date timestamp;
+        Timestamp ts = signer.getTimestamp();
+        if (ts != null) {
+            s.append(printTimestamp(tab, ts));
             s.append('\n');
+            timestamp = ts.getTimestamp();
+        } else {
+            timestamp = null;
         }
-        // display the certificate(s). The first one is end-enity cert and
+        // display the certificate(s). The first one is end-entity cert and
         // its KeyUsage should be checked.
         boolean first = true;
         for (Certificate c : certs) {
-            s.append(printCert(tab, c, true, now, first));
+            s.append(printCert(tab, c, true, timestamp, first));
             s.append('\n');
             first = false;
         }
@@ -1508,9 +1512,15 @@
             if (debug) {
                 e.printStackTrace();
             }
-            chainNotValidated = true;
-            s.append(tab + rb.getString(".CertPath.not.validated.") +
-                    e.getLocalizedMessage() + "]\n");   // TODO
+            if (e.getCause() != null &&
+                    (e.getCause() instanceof CertificateExpiredException ||
+                     e.getCause() instanceof CertificateNotYetValidException)) {
+                // No more warning, we alreay have hasExpiredCert or notYetValidCert
+            } else {
+                chainNotValidated = true;
+                s.append(tab + rb.getString(".CertPath.not.validated.") +
+                        e.getLocalizedMessage() + "]\n");   // TODO
+            }
         }
         String result = s.toString();
         cacheForSignerInfo.put(signer, result);
@@ -1805,7 +1815,7 @@
 
             // We don't meant to print anything, the next call
             // checks validity and keyUsage etc
-            printCert("", certChain[0], true, 0, true);
+            printCert("", certChain[0], true, null, true);
 
             try {
                 CertPath cp = certificateFactory.generateCertPath(Arrays.asList(certChain));
@@ -1814,7 +1824,13 @@
                 if (debug) {
                     e.printStackTrace();
                 }
-                chainNotValidated = true;
+                if (e.getCause() != null &&
+                        (e.getCause() instanceof CertificateExpiredException ||
+                        e.getCause() instanceof CertificateNotYetValidException)) {
+                    // No more warning, we alreay have hasExpiredCert or notYetValidCert
+                } else {
+                    chainNotValidated = true;
+                }
             }
 
             try {
--- a/src/share/classes/sun/security/tools/JarSignerResources_ja.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/security/tools/JarSignerResources_ja.java	Fri Jun 21 19:11:42 2013 -0700
@@ -136,7 +136,7 @@
         {"jar.verified.", "jar\u304C\u691C\u8A3C\u3055\u308C\u307E\u3057\u305F\u3002"},
         {"jarsigner.", "jarsigner: "},
         {"signature.filename.must.consist.of.the.following.characters.A.Z.0.9.or.",
-                "\u7F72\u540D\u306E\u30D5\u30A1\u30A4\u30EB\u540D\u306B\u4F7F\u7528\u3067\u304D\u308B\u6587\u5B57\u306F\u3001A-Z\u30010-9\u3001_\u3001- \u306E\u307F\u3067\u3059\u3002"},
+                "\u7F72\u540D\u306E\u30D5\u30A1\u30A4\u30EB\u540D\u306F\u6B21\u306E\u6587\u5B57\u3067\u69CB\u6210\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059: A-Z 0-9 _ -"},
         {"unable.to.open.jar.file.", "\u6B21\u306Ejar\u30D5\u30A1\u30A4\u30EB\u3092\u958B\u304F\u3053\u3068\u304C\u3067\u304D\u307E\u305B\u3093: "},
         {"unable.to.create.", "\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093: "},
         {".adding.", "   \u8FFD\u52A0\u4E2D: "},
--- a/src/share/classes/sun/security/tools/KeyTool.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/security/tools/KeyTool.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1547,9 +1547,16 @@
         keypair.generate(keysize);
         PrivateKey privKey = keypair.getPrivateKey();
 
+        CertificateExtensions ext = createV3Extensions(
+                null,
+                null,
+                v3ext,
+                keypair.getPublicKeyAnyway(),
+                null);
+
         X509Certificate[] chain = new X509Certificate[1];
         chain[0] = keypair.getSelfCertificate(
-                x500Name, getStartDate(startDate), validity*24L*60L*60L);
+                x500Name, getStartDate(startDate), validity*24L*60L*60L, ext);
 
         if (verbose) {
             MessageFormat form = new MessageFormat(rb.getString
@@ -1566,9 +1573,6 @@
             keyPass = promptForKeyPass(alias, null, storePass);
         }
         keyStore.setKeyEntry(alias, privKey, keyPass, chain);
-
-        // resign so that -ext are applied.
-        doSelfCert(alias, null, sigAlgName);
     }
 
     /**
--- a/src/share/classes/sun/security/x509/CertAndKeyGen.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/security/x509/CertAndKeyGen.java	Fri Jun 21 19:11:42 2013 -0700
@@ -153,6 +153,13 @@
 
         publicKey = pair.getPublic();
         privateKey = pair.getPrivate();
+
+        // publicKey's format must be X.509 otherwise
+        // the whole CertGen part of this class is broken.
+        if (!"X.509".equalsIgnoreCase(publicKey.getFormat())) {
+            throw new IllegalArgumentException("publicKey's is not X.509, but "
+                    + publicKey.getFormat());
+        }
     }
 
 
@@ -174,6 +181,16 @@
         return (X509Key)publicKey;
     }
 
+    /**
+     * Always returns the public key of the generated key pair. Used
+     * by KeyTool only.
+     *
+     * The publicKey is not necessarily to be an instance of
+     * X509Key in some JCA/JCE providers, for example SunPKCS11.
+     */
+    public PublicKey getPublicKeyAnyway() {
+        return publicKey;
+    }
 
     /**
      * Returns the private key of the generated key pair.
@@ -188,7 +205,6 @@
         return privateKey;
     }
 
-
     /**
      * Returns a self-signed X.509v3 certificate for the public key.
      * The certificate is immediately valid. No extensions.
@@ -213,6 +229,15 @@
     throws CertificateException, InvalidKeyException, SignatureException,
         NoSuchAlgorithmException, NoSuchProviderException
     {
+        return getSelfCertificate(myname, firstDate, validity, null);
+    }
+
+    // Like above, plus a CertificateExtensions argument, which can be null.
+    public X509Certificate getSelfCertificate (X500Name myname, Date firstDate,
+            long validity, CertificateExtensions ext)
+    throws CertificateException, InvalidKeyException, SignatureException,
+        NoSuchAlgorithmException, NoSuchProviderException
+    {
         X509CertImpl    cert;
         Date            lastDate;
 
@@ -236,6 +261,7 @@
             info.set(X509CertInfo.KEY, new CertificateX509Key(publicKey));
             info.set(X509CertInfo.VALIDITY, interval);
             info.set(X509CertInfo.ISSUER, new CertificateIssuerName(myname));
+            if (ext != null) info.set(X509CertInfo.EXTENSIONS, ext);
 
             cert = new X509CertImpl(info);
             cert.sign(privateKey, this.sigAlg);
--- a/src/share/classes/sun/swing/FilePane.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/swing/FilePane.java	Fri Jun 21 19:11:42 2013 -0700
@@ -35,6 +35,7 @@
 import java.util.List;
 import java.util.concurrent.Callable;
 
+import javax.accessibility.AccessibleContext;
 import javax.swing.*;
 import javax.swing.border.*;
 import javax.swing.event.*;
@@ -82,6 +83,9 @@
     private JPanel currentViewPanel;
     private String[] viewTypeActionNames;
 
+    private String filesListAccessibleName = null;
+    private String filesDetailsAccessibleName = null;
+
     private JPopupMenu contextMenu;
     private JMenu viewMenu;
 
@@ -450,6 +454,9 @@
         gigaByteString = UIManager.getString("FileChooser.fileSizeGigaBytes", l);
         fullRowSelection = UIManager.getBoolean("FileView.fullRowSelection");
 
+        filesListAccessibleName = UIManager.getString("FileChooser.filesListAccessibleName", l);
+        filesDetailsAccessibleName = UIManager.getString("FileChooser.filesDetailsAccessibleName", l);
+
         renameErrorTitleText = UIManager.getString("FileChooser.renameErrorTitleText", l);
         renameErrorText = UIManager.getString("FileChooser.renameErrorText", l);
         renameErrorFileExistsText = UIManager.getString("FileChooser.renameErrorFileExistsText", l);
@@ -634,6 +641,9 @@
         if (listViewBorder != null) {
             scrollpane.setBorder(listViewBorder);
         }
+
+        list.putClientProperty(AccessibleContext.ACCESSIBLE_NAME_PROPERTY, filesListAccessibleName);
+
         p.add(scrollpane, BorderLayout.CENTER);
         return p;
     }
@@ -1228,6 +1238,8 @@
 
         detailsTableModel.fireTableStructureChanged();
 
+        detailsTable.putClientProperty(AccessibleContext.ACCESSIBLE_NAME_PROPERTY, filesDetailsAccessibleName);
+
         return p;
     } // createDetailsView
 
--- a/src/share/classes/sun/swing/SwingUtilities2.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/swing/SwingUtilities2.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1881,4 +1881,12 @@
         }
         return -1;
     }
+
+    public static int getSystemMnemonicKeyMask() {
+        Toolkit toolkit = Toolkit.getDefaultToolkit();
+        if (toolkit instanceof SunToolkit) {
+            return ((SunToolkit) toolkit).getFocusAcceleratorKeyMask();
+        }
+        return InputEvent.ALT_MASK;
+    }
 }
--- a/src/share/classes/sun/swing/plaf/synth/SynthFileChooserUI.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/swing/plaf/synth/SynthFileChooserUI.java	Fri Jun 21 19:11:42 2013 -0700
@@ -256,6 +256,7 @@
         if (getFileChooser().getControlButtonsAreShown()) {
             approveButton.setText(getApproveButtonText(getFileChooser()));
             approveButton.setToolTipText(getApproveButtonToolTipText(getFileChooser()));
+            approveButton.setMnemonic(getApproveButtonMnemonic(getFileChooser()));
         }
     }
 
--- a/src/share/classes/sun/text/bidi/BidiBase.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/text/bidi/BidiBase.java	Fri Jun 21 19:11:42 2013 -0700
@@ -3251,10 +3251,9 @@
     {
         verifyValidParaOrLine();
         BidiLine.getRuns(this);
-        if (runCount == 1) {
+        if (run < 0 || run >= runCount) {
             return getParaLevel();
         }
-        verifyIndex(run, 0, runCount);
         getLogicalToVisualRunsMap();
         return runs[logicalToVisualRunsMap[run]].level;
     }
--- a/src/share/classes/sun/text/resources/FormatData_sl.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/text/resources/FormatData_sl.java	Fri Jun 21 19:11:42 2013 -0700
@@ -131,8 +131,8 @@
                     "H:mm:ss z", // long time pattern
                     "H:mm:ss", // medium time pattern
                     "H:mm", // short time pattern
-                    "EEEE, d MMMM yyyy", // full date pattern
-                    "EEEE, d MMMM yyyy", // long date pattern
+                    "EEEE, dd. MMMM y", // full date pattern
+                    "dd. MMMM y", // long date pattern
                     "d.M.yyyy", // medium date pattern
                     "d.M.y", // short date pattern
                     "{1} {0}" // date-time pattern
--- a/src/share/classes/sun/tools/jar/Main.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jar/Main.java	Fri Jun 21 19:11:42 2013 -0700
@@ -839,8 +839,8 @@
 
     void replaceFSC(String files[]) {
         if (files != null) {
-            for (String file : files) {
-                file = file.replace(File.separatorChar, '/');
+            for (int i = 0; i < files.length; i++) {
+                files[i] = files[i].replace(File.separatorChar, '/');
             }
         }
     }
--- a/src/share/classes/sun/tools/jar/resources/jar_de.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jar/resources/jar_de.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -39,9 +39,9 @@
 out.adding={0} wird hinzugef\u00FCgt
 out.deflated=({0} % verkleinert)
 out.stored=(0 % gespeichert)
-out.create=\ \ erstellt: {0}
+out.create=\  erstellt: {0}
 out.extracted=extrahiert: {0}
 out.inflated=\ \\vergr\u00F6\u00DFert: {0}
 out.size=(ein = {0}) (aus = {1})
 
-usage=Verwendung: jar-Dateien {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] ...\nOptionen:\n\ \   -c  Neues Archiv erstellen\n\ \   -t  Inhaltsverzeichnis f\u00FCr Archiv auflisten\n\ \   -x  Genannte (oder alle) Dateien aus Archiv extrahieren\n\ \   -u  Vorhandenes Archiv aktualisieren\n\ \   -v  Verbose-Ausgabe f\u00FCr Standardausgabe generieren\n\ \   -f  Namen der Archivdatei angeben\n\ \   -m  Manifest-Informationen von angegebener Manifest-Datei einschlie\u00DFen\n\ \   -e  Anwendungs-Einstiegspunkt f\u00FCr die \n\ \       in einer ausf\u00FChrbaren JAR-Datei geb\u00FCndelte Standalone-Anwendung angeben\n\ \   -0  Nur speichern (keine ZIP-Komprimierung)\n\ \   -M  Keine Manifest-Datei f\u00FCr die Eintr\u00E4ge erstellen\n\ \   -i  Indexinformationen f\u00FCr angegebenen JAR-Dateien erstellen\n\ \   -C  zum angegebenen Verzeichnis wechseln und folgende Datei einschlie\u00DFen\nFalls eine Datei ein Verzeichnis ist, wird dieses rekursiv verarbeitet.\nDer Name der Manifest-Datei, der Name der Archivdatei und der Name des Einstiegspunkts werden\nin derselben Reihenfolge wie die Kennzeichen "m", "f" und "e" angegeben.\n\nBeispiel 1: Archivieren Sie zwei Klassendateien in ein Archiv mit Namen "classes.jar": \n\ \      jar cvf classes.jar Foo.class Bar.class \nBeispiel 2: Verwenden Sie die vorhandenen Manifest-Datei "mymanifest", und archivieren Sie\n\ \          alle Dateien im Verzeichnis foo/ in "classes.jar": \n\ \      jar cvfm classes.jar mymanifest -C foo/ .\n
+usage=Verwendung: jar-Dateien {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] ...\nOptionen:\n    -c  Neues Archiv erstellen\n    -t  Inhaltsverzeichnis f\u00FCr Archiv auflisten\n    -x  Genannte (oder alle) Dateien aus Archiv extrahieren\n    -u  Vorhandenes Archiv aktualisieren\n    -v  Verbose-Ausgabe f\u00FCr Standardausgabe generieren\n    -f  Namen der Archivdatei angeben\n    -m  Manifest-Informationen von angegebener Manifest-Datei einschlie\u00DFen\n    -e  Anwendungs-Einstiegspunkt f\u00FCr die \n        in einer ausf\u00FChrbaren JAR-Datei geb\u00FCndelte Standalone-Anwendung angeben\n    -0  Nur speichern (keine ZIP-Komprimierung)\n    -M  Keine Manifest-Datei f\u00FCr die Eintr\u00E4ge erstellen\n    -i  Indexinformationen f\u00FCr angegebenen JAR-Dateien erstellen\n    -C  zum angegebenen Verzeichnis wechseln und folgende Datei einschlie\u00DFen\nFalls eine Datei ein Verzeichnis ist, wird dieses rekursiv verarbeitet.\nDer Name der Manifest-Datei, der Name der Archivdatei und der Name des Einstiegspunkts werden\nin derselben Reihenfolge wie die Kennzeichen "m", "f" und "e" angegeben.\n\nBeispiel 1: Archivieren Sie zwei Klassendateien in ein Archiv mit Namen "classes.jar": \n       jar cvf classes.jar Foo.class Bar.class \nBeispiel 2: Verwenden Sie die vorhandenen Manifest-Datei "mymanifest", und archivieren Sie\n           alle Dateien im Verzeichnis foo/ in "classes.jar": \n       jar cvfm classes.jar mymanifest -C foo/ .\n
--- a/src/share/classes/sun/tools/jar/resources/jar_es.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jar/resources/jar_es.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -39,9 +39,9 @@
 out.adding=agregando: {0}
 out.deflated=(desinflado {0}%)
 out.stored=(almacenado 0%)
-out.create=\ \ creado: {0}
+out.create=\  creado: {0}
 out.extracted=extra\u00EDdo: {0}
 out.inflated=\ \\inflado: {0}
 out.size=(entrada = {0}) (salida = {1})
 
-usage=Sintaxis: jar {ctxui}[vfm0Me] [archive-jar] [archive-manifiesto] [punto-entrada] [-C dir] archivos...\nOpciones:\n\ \   -c  crear nuevo archivo\n\ \   -t  crear la tabla de contenido del archivo\n\ \   -x extraer el archive mencionado (o todos) del archivo\n\ \   -u  actualizar archive existente\n\ \   -v  generar salida detallada de los datos de salida est\u00E1ndar\n\ \   -f  especificar nombre de archive de almacenamiento\n\ \   -m  incluir informaci\u00F3n de manifiesto del archive de manifiesto especificado\n\ \   -e  especificar punto de entrada de la aplicaci\u00F3n para la aplicaci\u00F3n aut\u00F3noma \n\ \       que se incluye dentro de un archive jar ejecutable\n\ \   -0  s\u00F3lo almacenar; no utilizar compresi\u00F3n ZIP\n\ \   -M  no crear un archive de manifiesto para las entradas\n\ \   -i  generar informaci\u00F3n de \u00EDndice para los archives jar especificados\n\ \   -C  cambiar al directorio especificado e incluir el archivo siguiente\nSi alg\u00FAn archivo es un directorio, se procesar\u00E1 de forma recurrente.\nEl nombre del archivo de manifiesto, el nombre del archivo de almacenamiento y el nombre del punto de entrada se\nespecifican en el mismo orden que los indicadores 'm', 'f' y 'e'.\n\nEjemplo 1: para archivar archivos de dos clases en un archivo llamado classes.jar: \n\ \      jar cvf classes.jar Foo.class Bar.class \nEjemplo 2: utilice un archivo de manifiesto existente 'mymanifest' y archive todos los\n\ \          archivos del directorio foo/ en 'classes.jar': \n\ \      jar cvfm classes.jar mymanifest -C foo/ .\n
+usage=Sintaxis: jar {ctxui}[vfm0Me] [archive-jar] [archive-manifiesto] [punto-entrada] [-C dir] archivos...\nOpciones:\n    -c  crear nuevo archivo\n    -t  crear la tabla de contenido del archivo\n    -x extraer el archive mencionado (o todos) del archivo\n    -u  actualizar archive existente\n    -v  generar salida detallada de los datos de salida est\u00E1ndar\n    -f  especificar nombre de archive de almacenamiento\n    -m  incluir informaci\u00F3n de manifiesto del archive de manifiesto especificado\n    -e  especificar punto de entrada de la aplicaci\u00F3n para la aplicaci\u00F3n aut\u00F3noma \n        que se incluye dentro de un archive jar ejecutable\n    -0  s\u00F3lo almacenar; no utilizar compresi\u00F3n ZIP\n    -M  no crear un archive de manifiesto para las entradas\n    -i  generar informaci\u00F3n de \u00EDndice para los archives jar especificados\n    -C  cambiar al directorio especificado e incluir el archivo siguiente\nSi alg\u00FAn archivo es un directorio, se procesar\u00E1 de forma recurrente.\nEl nombre del archivo de manifiesto, el nombre del archivo de almacenamiento y el nombre del punto de entrada se\nespecifican en el mismo orden que los indicadores 'm', 'f' y 'e'.\n\nEjemplo 1: para archivar archivos de dos clases en un archivo llamado classes.jar: \n       jar cvf classes.jar Foo.class Bar.class \nEjemplo 2: utilice un archivo de manifiesto existente 'mymanifest' y archive todos los\n           archivos del directorio foo/ en 'classes.jar': \n       jar cvfm classes.jar mymanifest -C foo/ .\n
--- a/src/share/classes/sun/tools/jar/resources/jar_fr.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jar/resources/jar_fr.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -39,9 +39,9 @@
 out.adding=ajout : {0}
 out.deflated=(compression : {0} %)
 out.stored=(stockage : 0 %)
-out.create=\ \ cr\u00E9\u00E9 : {0}
+out.create=\  cr\u00E9\u00E9 : {0}
 out.extracted=extrait : {0}
 out.inflated=\ \\d\u00E9compress\u00E9 : {0}
 out.size=(entr\u00E9e = {0}) (sortie = {1})
 
-usage=Syntaxe : jar {ctxui}[vfm0Me] [fichier-jar] [fichier-manifeste] [point-entr\u00E9e] [-C r\u00E9p] fichiers...\nOptions :\n\ \   -c  cr\u00E9e une archive\n\ \   -t  affiche la table des mati\u00E8res de l'archive\n\ \   -x  extrait les fichiers nomm\u00E9s (ou tous les fichiers) de l'archive\n\ \   -u  met \u00E0 jour l'archive existante\n\ \   -v  g\u00E9n\u00E8re une version d\u00E9taill\u00E9e d'une sortie standard\n\ \   -f  sp\u00E9cifie le nom du fichier archive\n\ \   -m  inclut les informations de manifeste \u00E0 partir du fichier de manifeste sp\u00E9cifi\u00E9\n\ \   -e  sp\u00E9cifie le point d'entr\u00E9e d'une application en mode autonome \n\ \       int\u00E9gr\u00E9e \u00E0 un fichier JAR ex\u00E9cutable\n\ \   -0  stockage uniquement, pas de compression ZIP\n\ \   -M  ne cr\u00E9e pas de fichier manifeste pour les entr\u00E9es\n\ \   -i  g\u00E9n\u00E8re les informations d'index des fichiers JAR sp\u00E9cifi\u00E9s\n\ \   -C  passe au r\u00E9pertoire sp\u00E9cifi\u00E9 et inclut le fichier suivant\nSi l'un des fichiers est un r\u00E9pertoire, celui-ci est trait\u00E9 r\u00E9cursivement.\nLes noms du fichier manifeste, du fichier archive et du point d'entr\u00E9e sont\nsp\u00E9cifi\u00E9s dans le m\u00EAme ordre que celui des indicateurs m, f et e.\n\nExemple 1 : pour archiver deux fichiers de classe dans une archive intitul\u00E9e classes.jar : \n\ \      jar cvf classes.jar Foo.class Bar.class \nExemple 2 : pour utiliser un fichier manifeste existant 'monmanifeste', puis archiver tous les\n\ \          fichiers du r\u00E9pertoire foo/ dans 'classes.jar' : \n\ \      jar cvfm classes.jar monmanifeste -C foo/ .\n
+usage=Syntaxe : jar {ctxui}[vfm0Me] [fichier-jar] [fichier-manifeste] [point-entr\u00E9e] [-C r\u00E9p] fichiers...\nOptions :\n    -c  cr\u00E9e une archive\n    -t  affiche la table des mati\u00E8res de l'archive\n    -x  extrait les fichiers nomm\u00E9s (ou tous les fichiers) de l'archive\n    -u  met \u00E0 jour l'archive existante\n    -v  g\u00E9n\u00E8re une version d\u00E9taill\u00E9e d'une sortie standard\n    -f  sp\u00E9cifie le nom du fichier archive\n    -m  inclut les informations de manifeste \u00E0 partir du fichier de manifeste sp\u00E9cifi\u00E9\n    -e  sp\u00E9cifie le point d'entr\u00E9e d'une application en mode autonome \n        int\u00E9gr\u00E9e \u00E0 un fichier JAR ex\u00E9cutable\n    -0  stockage uniquement, pas de compression ZIP\n    -M  ne cr\u00E9e pas de fichier manifeste pour les entr\u00E9es\n    -i  g\u00E9n\u00E8re les informations d'index des fichiers JAR sp\u00E9cifi\u00E9s\n    -C  passe au r\u00E9pertoire sp\u00E9cifi\u00E9 et inclut le fichier suivant\nSi l'un des fichiers est un r\u00E9pertoire, celui-ci est trait\u00E9 r\u00E9cursivement.\nLes noms du fichier manifeste, du fichier archive et du point d'entr\u00E9e sont\nsp\u00E9cifi\u00E9s dans le m\u00EAme ordre que celui des indicateurs m, f et e.\n\nExemple 1 : pour archiver deux fichiers de classe dans une archive intitul\u00E9e classes.jar : \n       jar cvf classes.jar Foo.class Bar.class \nExemple 2 : pour utiliser un fichier manifeste existant 'monmanifeste', puis archiver tous les\n           fichiers du r\u00E9pertoire foo/ dans 'classes.jar' : \n       jar cvfm classes.jar monmanifeste -C foo/ .\n
--- a/src/share/classes/sun/tools/jar/resources/jar_it.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jar/resources/jar_it.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -39,9 +39,9 @@
 out.adding=aggiunta in corso di: {0}
 out.deflated=(compresso {0}%)
 out.stored=(memorizzato 0%)
-out.create=\ \ \ \ \ creato: {0}
+out.create=\     creato: {0}
 out.extracted=estratto: {0}
 out.inflated=\ \\decompresso: {0}
 out.size=(in = {0}) (out = {1})
 
-usage=Uso: jar {ctxui}[vfm0Me] [file-jar] [file-manifest] [punto di ingresso] [-C dir] file ...\nOpzioni:\n\ \   -c  crea un nuovo archivio\n\ \   -t  visualizza l'indice dell'archivio\n\ \   -x  estrae i file con nome (o tutti i file) dall'archivio\n\ \   -u  aggiorna l'archivio esistente\n\ \   -v  genera output commentato dall'output standard\n\ \   -f  specifica il nome file dell'archivio\n\ \   -m  include informazioni manifest dal file manifest specificato\n\ \   -e  specifica il punto di ingresso per l'applicazione stand-alone \n\ \       inclusa nel file jar eseguibile\n\ \   -0  solo memorizzazione; senza compressione ZIP\n\ \   -M  consente di non creare un file manifest per le voci\n\ \   -i  genera informazioni sull'indice per i file jar specificati\n\ \   -C  imposta la directory specificata e include il file seguente\nSe un file \u00E8 una directory, verr\u00E0 elaborato in modo ricorsivo.\nIl nome del file manifest, del file di archivio e del punto di ingresso devono\nessere specificati nello stesso ordine dei flag 'm', 'f' ed 'e'.\n\nEsempio 1: archiviazione di due file di classe in un archivio con il nome classes.jar: \n\ \      jar cvf classes.jar Foo.class Bar.class \nEsempio 2: utilizzo del file manifest esistente 'mymanifest' e archiviazione di tutti i\n\ \          file della directory foo/ in 'classes.jar': \n\ \      jar cvfm classes.jar mymanifest -C foo/.\n
+usage=Uso: jar {ctxui}[vfm0Me] [file-jar] [file-manifest] [punto di ingresso] [-C dir] file ...\nOpzioni:\n    -c  crea un nuovo archivio\n    -t  visualizza l'indice dell'archivio\n    -x  estrae i file con nome (o tutti i file) dall'archivio\n    -u  aggiorna l'archivio esistente\n    -v  genera output commentato dall'output standard\n    -f  specifica il nome file dell'archivio\n    -m  include informazioni manifest dal file manifest specificato\n    -e  specifica il punto di ingresso per l'applicazione stand-alone \n        inclusa nel file jar eseguibile\n    -0  solo memorizzazione; senza compressione ZIP\n    -M  consente di non creare un file manifest per le voci\n    -i  genera informazioni sull'indice per i file jar specificati\n    -C  imposta la directory specificata e include il file seguente\nSe un file \u00E8 una directory, verr\u00E0 elaborato in modo ricorsivo.\nIl nome del file manifest, del file di archivio e del punto di ingresso devono\nessere specificati nello stesso ordine dei flag 'm', 'f' ed 'e'.\n\nEsempio 1: archiviazione di due file di classe in un archivio con il nome classes.jar: \n       jar cvf classes.jar Foo.class Bar.class \nEsempio 2: utilizzo del file manifest esistente 'mymanifest' e archiviazione di tutti i\n           file della directory foo/ in 'classes.jar': \n       jar cvfm classes.jar mymanifest -C foo/.\n
--- a/src/share/classes/sun/tools/jar/resources/jar_ja.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jar/resources/jar_ja.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -39,9 +39,9 @@
 out.adding={0}\u3092\u8FFD\u52A0\u4E2D\u3067\u3059
 out.deflated=({0}%\u53CE\u7E2E\u3055\u308C\u307E\u3057\u305F)
 out.stored=(0%\u683C\u7D0D\u3055\u308C\u307E\u3057\u305F)
-out.create=\ \ {0}\u304C\u4F5C\u6210\u3055\u308C\u307E\u3057\u305F
+out.create=\  {0}\u304C\u4F5C\u6210\u3055\u308C\u307E\u3057\u305F
 out.extracted={0}\u304C\u62BD\u51FA\u3055\u308C\u307E\u3057\u305F
 out.inflated=\ \\{0}\u304C\u5C55\u958B\u3055\u308C\u307E\u3057\u305F
 out.size=(\u5165={0})(\u51FA={1})
 
-usage=\u4F7F\u7528\u65B9\u6CD5: jar {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] files ...\n\u30AA\u30D7\u30B7\u30E7\u30F3:\n\ \  -c \u30A2\u30FC\u30AB\u30A4\u30D6\u3092\u65B0\u898F\u4F5C\u6210\u3059\u308B\n\ \  -t \u30A2\u30FC\u30AB\u30A4\u30D6\u306E\u5185\u5BB9\u3092\u4E00\u89A7\u8868\u793A\u3059\u308B\n\ \  -x \u6307\u5B9A\u306E(\u307E\u305F\u306F\u3059\u3079\u3066\u306E)\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30FC\u30AB\u30A4\u30D6\u304B\u3089\u62BD\u51FA\u3059\u308B\n\ \  -u \u65E2\u5B58\u30A2\u30FC\u30AB\u30A4\u30D6\u3092\u66F4\u65B0\u3059\u308B\n\ \  -v \u6A19\u6E96\u51FA\u529B\u306B\u8A73\u7D30\u306A\u51FA\u529B\u3092\u751F\u6210\u3059\u308B\n\ \  -f \u30A2\u30FC\u30AB\u30A4\u30D6\u30FB\u30D5\u30A1\u30A4\u30EB\u540D\u3092\u6307\u5B9A\u3059\u308B\n\ \  -m \u6307\u5B9A\u306E\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB\u304B\u3089\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u60C5\u5831\u3092\u53D6\u308A\u8FBC\u3080\n\ \  -e \u5B9F\u884C\u53EF\u80FDjar\u30D5\u30A1\u30A4\u30EB\u306B\u30D0\u30F3\u30C9\u30EB\u3055\u308C\u305F\u30B9\u30BF\u30F3\u30C9\u30A2\u30ED\u30F3\u30FB\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\n\ \     \u30A8\u30F3\u30C8\u30EA\u30FB\u30DD\u30A4\u30F3\u30C8\u3092\u6307\u5B9A\u3059\u308B\n\ \  -0 \u683C\u7D0D\u306E\u307F\u3002ZIP\u5727\u7E2E\u3092\u4F7F\u7528\u3057\u306A\u3044\n\ \  -M \u30A8\u30F3\u30C8\u30EA\u306E\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u4F5C\u6210\u3057\u306A\u3044\n\ \  -i \u6307\u5B9A\u306Ejar\u30D5\u30A1\u30A4\u30EB\u306E\u7D22\u5F15\u60C5\u5831\u3092\u751F\u6210\u3059\u308B\n\ \  -C \u6307\u5B9A\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306B\u5909\u66F4\u3057\u3001\u4EE5\u4E0B\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u53D6\u308A\u8FBC\u3080\n\u30D5\u30A1\u30A4\u30EB\u304C\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u5834\u5408\u306F\u518D\u5E30\u7684\u306B\u51E6\u7406\u3055\u308C\u307E\u3059\u3002\n\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB\u540D\u3001\u30A2\u30FC\u30AB\u30A4\u30D6\u30FB\u30D5\u30A1\u30A4\u30EB\u540D\u304A\u3088\u3073\u30A8\u30F3\u30C8\u30EA\u30FB\u30DD\u30A4\u30F3\u30C8\u540D\u306F\u3001\n\u30D5\u30E9\u30B0'm'\u3001'f'\u3001'e'\u306E\u6307\u5B9A\u3068\u540C\u3058\u9806\u756A\u3067\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\n\n\u4F8B1: 2\u3064\u306E\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30FC\u30AB\u30A4\u30D6classes.jar\u306B\u4FDD\u5B58\u3059\u308B:\n\ \    jar cvf classes.jar Foo.class Bar.class\n\u4F8B2: \u65E2\u5B58\u306E\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB'mymanifest'\u3092\u4F7F\u7528\u3057\u3001foo/\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\n\ \   \u5168\u30D5\u30A1\u30A4\u30EB\u3092'classes.jar'\u306B\u30A2\u30FC\u30AB\u30A4\u30D6\u3059\u308B:\n\ \    jar cvfm classes.jar mymanifest -C foo/ \n
+usage=\u4F7F\u7528\u65B9\u6CD5: jar {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] files ...\n\u30AA\u30D7\u30B7\u30E7\u30F3:\n   -c \u30A2\u30FC\u30AB\u30A4\u30D6\u3092\u65B0\u898F\u4F5C\u6210\u3059\u308B\n   -t \u30A2\u30FC\u30AB\u30A4\u30D6\u306E\u5185\u5BB9\u3092\u4E00\u89A7\u8868\u793A\u3059\u308B\n   -x \u6307\u5B9A\u306E(\u307E\u305F\u306F\u3059\u3079\u3066\u306E)\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30FC\u30AB\u30A4\u30D6\u304B\u3089\u62BD\u51FA\u3059\u308B\n   -u \u65E2\u5B58\u30A2\u30FC\u30AB\u30A4\u30D6\u3092\u66F4\u65B0\u3059\u308B\n   -v \u6A19\u6E96\u51FA\u529B\u306B\u8A73\u7D30\u306A\u51FA\u529B\u3092\u751F\u6210\u3059\u308B\n   -f \u30A2\u30FC\u30AB\u30A4\u30D6\u30FB\u30D5\u30A1\u30A4\u30EB\u540D\u3092\u6307\u5B9A\u3059\u308B\n   -m \u6307\u5B9A\u306E\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB\u304B\u3089\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u60C5\u5831\u3092\u53D6\u308A\u8FBC\u3080\n   -e \u5B9F\u884C\u53EF\u80FDjar\u30D5\u30A1\u30A4\u30EB\u306B\u30D0\u30F3\u30C9\u30EB\u3055\u308C\u305F\u30B9\u30BF\u30F3\u30C9\u30A2\u30ED\u30F3\u30FB\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\n      \u30A8\u30F3\u30C8\u30EA\u30FB\u30DD\u30A4\u30F3\u30C8\u3092\u6307\u5B9A\u3059\u308B\n   -0 \u683C\u7D0D\u306E\u307F\u3002ZIP\u5727\u7E2E\u3092\u4F7F\u7528\u3057\u306A\u3044\n   -M \u30A8\u30F3\u30C8\u30EA\u306E\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u4F5C\u6210\u3057\u306A\u3044\n   -i \u6307\u5B9A\u306Ejar\u30D5\u30A1\u30A4\u30EB\u306E\u7D22\u5F15\u60C5\u5831\u3092\u751F\u6210\u3059\u308B\n   -C \u6307\u5B9A\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306B\u5909\u66F4\u3057\u3001\u4EE5\u4E0B\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u53D6\u308A\u8FBC\u3080\n\u30D5\u30A1\u30A4\u30EB\u304C\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u5834\u5408\u306F\u518D\u5E30\u7684\u306B\u51E6\u7406\u3055\u308C\u307E\u3059\u3002\n\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB\u540D\u3001\u30A2\u30FC\u30AB\u30A4\u30D6\u30FB\u30D5\u30A1\u30A4\u30EB\u540D\u304A\u3088\u3073\u30A8\u30F3\u30C8\u30EA\u30FB\u30DD\u30A4\u30F3\u30C8\u540D\u306F\u3001\n\u30D5\u30E9\u30B0'm'\u3001'f'\u3001'e'\u306E\u6307\u5B9A\u3068\u540C\u3058\u9806\u756A\u3067\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\n\n\u4F8B1: 2\u3064\u306E\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30FC\u30AB\u30A4\u30D6classes.jar\u306B\u4FDD\u5B58\u3059\u308B:\n     jar cvf classes.jar Foo.class Bar.class\n\u4F8B2: \u65E2\u5B58\u306E\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB'mymanifest'\u3092\u4F7F\u7528\u3057\u3001foo/\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\n    \u5168\u30D5\u30A1\u30A4\u30EB\u3092'classes.jar'\u306B\u30A2\u30FC\u30AB\u30A4\u30D6\u3059\u308B:\n     jar cvfm classes.jar mymanifest -C foo/ \n
--- a/src/share/classes/sun/tools/jar/resources/jar_ko.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jar/resources/jar_ko.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -39,9 +39,9 @@
 out.adding=\uCD94\uAC00\uD558\uB294 \uC911: {0}
 out.deflated=({0}%\uB97C \uAC10\uC18C\uD568)
 out.stored=(0%\uB97C \uC800\uC7A5\uD568)
-out.create=\ \ \uC0DD\uC131\uB428: {0}
+out.create=\  \uC0DD\uC131\uB428: {0}
 out.extracted=\uCD94\uCD9C\uB428: {0}
 out.inflated=\ \\\uC99D\uAC00\uB428: {0}
 out.size=(\uC785\uB825 = {0}) (\uCD9C\uB825 = {1})
 
-usage=\uC0AC\uC6A9\uBC95: jar {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] files ...\n\uC635\uC158:\n\ \   -c  \uC0C8 \uC544\uCE74\uC774\uBE0C\uB97C \uC0DD\uC131\uD569\uB2C8\uB2E4.\n\ \   -t  \uC544\uCE74\uC774\uBE0C\uC5D0 \uB300\uD55C \uBAA9\uCC28\uB97C \uB098\uC5F4\uD569\uB2C8\uB2E4.\n\ \   -x  \uBA85\uBA85\uB41C(\uB610\uB294 \uBAA8\uB4E0) \uD30C\uC77C\uC744 \uC544\uCE74\uC774\uBE0C\uC5D0\uC11C \uCD94\uCD9C\uD569\uB2C8\uB2E4.\n\ \   -u  \uAE30\uC874 \uC544\uCE74\uC774\uBE0C\uB97C \uAC31\uC2E0\uD569\uB2C8\uB2E4.\n\ \   -v  \uD45C\uC900 \uCD9C\uB825\uC5D0 \uC0C1\uC138 \uC815\uBCF4 \uCD9C\uB825\uC744 \uC0DD\uC131\uD569\uB2C8\uB2E4.\n\ \   -f  \uC544\uCE74\uC774\uBE0C \uD30C\uC77C \uC774\uB984\uC744 \uC9C0\uC815\uD569\uB2C8\uB2E4.\n\ \   -m  \uC9C0\uC815\uB41C Manifest \uD30C\uC77C\uC758 Manifest \uC815\uBCF4\uB97C \uD3EC\uD568\uD569\uB2C8\uB2E4.\n\ \   -e  jar \uC2E4\uD589 \uD30C\uC77C\uC5D0 \uBC88\uB4E4\uB85C \uC81C\uACF5\uB41C \uB3C5\uB9BD\uD615 \uC751\uC6A9 \uD504\uB85C\uADF8\uB7A8\uC758 \n\ \       \uC751\uC6A9 \uD504\uB85C\uADF8\uB7A8 \uC2DC\uC791 \uC9C0\uC810\uC744 \uC9C0\uC815\uD569\uB2C8\uB2E4.\n\ \   -0  \uC800\uC7A5 \uC804\uC6A9: ZIP \uC555\uCD95\uC744 \uC0AC\uC6A9\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.\n\ \   -M  \uD56D\uBAA9\uC5D0 \uB300\uD574 Manifest \uD30C\uC77C\uC744 \uC0DD\uC131\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.\n\ \   -i  \uC9C0\uC815\uB41C jar \uD30C\uC77C\uC5D0 \uB300\uD55C \uC778\uB371\uC2A4 \uC815\uBCF4\uB97C \uC0DD\uC131\uD569\uB2C8\uB2E4.\n\ \   -C  \uC9C0\uC815\uB41C \uB514\uB809\uD1A0\uB9AC\uB85C \uBCC0\uACBD\uD558\uACE0 \uB2E4\uC74C \uD30C\uC77C\uC744 \uD3EC\uD568\uD569\uB2C8\uB2E4.\n\uD2B9\uC815 \uD30C\uC77C\uC774 \uB514\uB809\uD1A0\uB9AC\uC77C \uACBD\uC6B0 \uC21C\uD658\uC801\uC73C\uB85C \uCC98\uB9AC\uB429\uB2C8\uB2E4.\nManifest \uD30C\uC77C \uC774\uB984, \uC544\uCE74\uC774\uBE0C \uD30C\uC77C \uC774\uB984 \uBC0F \uC2DC\uC791 \uC9C0\uC810 \uC774\uB984\uC740\n'm', 'f' \uBC0F 'e' \uD50C\uB798\uADF8\uC640 \uB3D9\uC77C\uD55C \uC21C\uC11C\uB85C \uC9C0\uC815\uB429\uB2C8\uB2E4.\n\n\uC608 1: classes.jar\uB77C\uB294 \uC544\uCE74\uC774\uBE0C\uC5D0 \uB450 \uD074\uB798\uC2A4 \uD30C\uC77C\uC744 \uC544\uCE74\uC774\uBE0C\uD558\uB294 \uBC29\uBC95: \n\ \      jar cvf classes.jar Foo.class Bar.class \n\uC608 2: \uAE30\uC874 Manifest \uD30C\uC77C 'mymanifest'\uB97C \uC0AC\uC6A9\uD558\uC5EC\n\ \          foo/ \uB514\uB809\uD1A0\uB9AC\uC758 \uBAA8\uB4E0 \uD30C\uC77C\uC744 'classes.jar'\uB85C \uC544\uCE74\uC774\uBE0C\uD558\uB294 \uBC29\uBC95: \n\ \      jar cvfm classes.jar mymanifest -C foo/ .\n
+usage=\uC0AC\uC6A9\uBC95: jar {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] files ...\n\uC635\uC158:\n    -c  \uC0C8 \uC544\uCE74\uC774\uBE0C\uB97C \uC0DD\uC131\uD569\uB2C8\uB2E4.\n    -t  \uC544\uCE74\uC774\uBE0C\uC5D0 \uB300\uD55C \uBAA9\uCC28\uB97C \uB098\uC5F4\uD569\uB2C8\uB2E4.\n    -x  \uBA85\uBA85\uB41C(\uB610\uB294 \uBAA8\uB4E0) \uD30C\uC77C\uC744 \uC544\uCE74\uC774\uBE0C\uC5D0\uC11C \uCD94\uCD9C\uD569\uB2C8\uB2E4.\n    -u  \uAE30\uC874 \uC544\uCE74\uC774\uBE0C\uB97C \uAC31\uC2E0\uD569\uB2C8\uB2E4.\n    -v  \uD45C\uC900 \uCD9C\uB825\uC5D0 \uC0C1\uC138 \uC815\uBCF4 \uCD9C\uB825\uC744 \uC0DD\uC131\uD569\uB2C8\uB2E4.\n    -f  \uC544\uCE74\uC774\uBE0C \uD30C\uC77C \uC774\uB984\uC744 \uC9C0\uC815\uD569\uB2C8\uB2E4.\n    -m  \uC9C0\uC815\uB41C Manifest \uD30C\uC77C\uC758 Manifest \uC815\uBCF4\uB97C \uD3EC\uD568\uD569\uB2C8\uB2E4.\n    -e  jar \uC2E4\uD589 \uD30C\uC77C\uC5D0 \uBC88\uB4E4\uB85C \uC81C\uACF5\uB41C \uB3C5\uB9BD\uD615 \uC751\uC6A9 \uD504\uB85C\uADF8\uB7A8\uC758 \n        \uC751\uC6A9 \uD504\uB85C\uADF8\uB7A8 \uC2DC\uC791 \uC9C0\uC810\uC744 \uC9C0\uC815\uD569\uB2C8\uB2E4.\n    -0  \uC800\uC7A5 \uC804\uC6A9: ZIP \uC555\uCD95\uC744 \uC0AC\uC6A9\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.\n    -M  \uD56D\uBAA9\uC5D0 \uB300\uD574 Manifest \uD30C\uC77C\uC744 \uC0DD\uC131\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.\n    -i  \uC9C0\uC815\uB41C jar \uD30C\uC77C\uC5D0 \uB300\uD55C \uC778\uB371\uC2A4 \uC815\uBCF4\uB97C \uC0DD\uC131\uD569\uB2C8\uB2E4.\n    -C  \uC9C0\uC815\uB41C \uB514\uB809\uD1A0\uB9AC\uB85C \uBCC0\uACBD\uD558\uACE0 \uB2E4\uC74C \uD30C\uC77C\uC744 \uD3EC\uD568\uD569\uB2C8\uB2E4.\n\uD2B9\uC815 \uD30C\uC77C\uC774 \uB514\uB809\uD1A0\uB9AC\uC77C \uACBD\uC6B0 \uC21C\uD658\uC801\uC73C\uB85C \uCC98\uB9AC\uB429\uB2C8\uB2E4.\nManifest \uD30C\uC77C \uC774\uB984, \uC544\uCE74\uC774\uBE0C \uD30C\uC77C \uC774\uB984 \uBC0F \uC2DC\uC791 \uC9C0\uC810 \uC774\uB984\uC740\n'm', 'f' \uBC0F 'e' \uD50C\uB798\uADF8\uC640 \uB3D9\uC77C\uD55C \uC21C\uC11C\uB85C \uC9C0\uC815\uB429\uB2C8\uB2E4.\n\n\uC608 1: classes.jar\uB77C\uB294 \uC544\uCE74\uC774\uBE0C\uC5D0 \uB450 \uD074\uB798\uC2A4 \uD30C\uC77C\uC744 \uC544\uCE74\uC774\uBE0C\uD558\uB294 \uBC29\uBC95: \n       jar cvf classes.jar Foo.class Bar.class \n\uC608 2: \uAE30\uC874 Manifest \uD30C\uC77C 'mymanifest'\uB97C \uC0AC\uC6A9\uD558\uC5EC\n           foo/ \uB514\uB809\uD1A0\uB9AC\uC758 \uBAA8\uB4E0 \uD30C\uC77C\uC744 'classes.jar'\uB85C \uC544\uCE74\uC774\uBE0C\uD558\uB294 \uBC29\uBC95: \n       jar cvfm classes.jar mymanifest -C foo/ .\n
--- a/src/share/classes/sun/tools/jar/resources/jar_pt_BR.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jar/resources/jar_pt_BR.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -39,9 +39,9 @@
 out.adding=adicionando: {0}
 out.deflated=(vazio {0}%)
 out.stored=(armazenado 0%)
-out.create=\ \ criado: {0}
+out.create=\  criado: {0}
 out.extracted=extra\u00EDdo: {0}
 out.inflated=\ \\cheio: {0}
 out.size=(dentro = {0}) (fora= {1})
 
-usage=Uso: arquivos jar {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] ...\nOp\u00E7\u00F5es:\n\ \   -c  cria novo arquivo compactado\n\ \   -t  lista o sum\u00E1rio do arquivo compactado\n\ \   -x  extrai arquivos com o nome (ou todos) do arquivo compactado\n\ \   -u  atualizar o arquivo compactado existente\n\ \   -v  gera sa\u00EDda detalhada na sa\u00EDda padr\u00E3o\n\ \   -f  especifica o nome do arquivo do arquivo compactado\n\ \   -m  inclui as informa\u00E7\u00F5es do manifesto do arquivo de manifesto especificado\n\ \   -e  especifica o ponto de entrada da aplica\u00E7\u00E3o para aplica\u00E7\u00E3o independente \n\ \       empacotando em um arquivo jar execut\u00E1vel\n\ \   -0  armazena somente; n\u00E3o usa compacta\u00E7\u00E3o ZIP\n\ \   -M  n\u00E3o cria um arquivo de manifesto para as entradas\n\ \   -i  gera informa\u00E7\u00F5es de \u00EDndice para os arquivos especificados\n\ \   -C  altera para o diret\u00F3rio e inclui o arquivo seguinte\nSe nenhum arquivo for um diret\u00F3rio, ent\u00E3o ser\u00E1 processado repetidamente.\nO nome do arquivo de manifesto, o nome do arquivo compactado e o nome do ponto de entrada s\u00E3o\nespecificados na mesma ordem dos flags  'm', 'f' e 'e'.\n\nExemplo 1: para arquivar dois arquivos de classe em um arquivo compactado com o nome classes.jar: \n\ \      jar cvf classes.jar Foo.class Bar.class \nExemplo 2: use um arquivo de manifesto existente 'mymanifest' e arquive todos os\n\ \          arquivos no diret\u00F3rio foo/ na 'classes.jar': \n\ \      jar cvfm classes.jar mymanifest -C foo/ .\n
+usage=Uso: arquivos jar {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] ...\nOp\u00E7\u00F5es:\n    -c  cria novo arquivo compactado\n    -t  lista o sum\u00E1rio do arquivo compactado\n    -x  extrai arquivos com o nome (ou todos) do arquivo compactado\n    -u  atualizar o arquivo compactado existente\n    -v  gera sa\u00EDda detalhada na sa\u00EDda padr\u00E3o\n    -f  especifica o nome do arquivo do arquivo compactado\n    -m  inclui as informa\u00E7\u00F5es do manifesto do arquivo de manifesto especificado\n    -e  especifica o ponto de entrada da aplica\u00E7\u00E3o para aplica\u00E7\u00E3o independente \n        empacotando em um arquivo jar execut\u00E1vel\n    -0  armazena somente; n\u00E3o usa compacta\u00E7\u00E3o ZIP\n    -M  n\u00E3o cria um arquivo de manifesto para as entradas\n    -i  gera informa\u00E7\u00F5es de \u00EDndice para os arquivos especificados\n    -C  altera para o diret\u00F3rio e inclui o arquivo seguinte\nSe nenhum arquivo for um diret\u00F3rio, ent\u00E3o ser\u00E1 processado repetidamente.\nO nome do arquivo de manifesto, o nome do arquivo compactado e o nome do ponto de entrada s\u00E3o\nespecificados na mesma ordem dos flags  'm', 'f' e 'e'.\n\nExemplo 1: para arquivar dois arquivos de classe em um arquivo compactado com o nome classes.jar: \n       jar cvf classes.jar Foo.class Bar.class \nExemplo 2: use um arquivo de manifesto existente 'mymanifest' e arquive todos os\n           arquivos no diret\u00F3rio foo/ na 'classes.jar': \n       jar cvfm classes.jar mymanifest -C foo/ .\n
--- a/src/share/classes/sun/tools/jar/resources/jar_sv.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jar/resources/jar_sv.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -39,9 +39,9 @@
 out.adding=l\u00E4gger till: {0}
 out.deflated=({0}% packat)
 out.stored=(0% lagrat)
-out.create=\ \ skapad: {0}
+out.create=\  skapad: {0}
 out.extracted=extraherat: {0}
 out.inflated=\\uppackat: {0}
 out.size=(in = {0}) (ut = {1})
 
-usage=Syntax: jar-filer {ctxui}[vfm0Me] [jar-fil] [manifestfil] [startpunkt] [-C-katalog] ...\nAlternativ:\n\ \   -c  skapa nytt arkiv\n\ \   -t  lista inneh\u00E5llsf\u00F6rteckning f\u00F6r arkiv\n\ \   -x  extrahera namngivna (eller alla) filer fr\u00E5n arkiv\n\ \   -u  uppdatera befintligt arkiv\n\ \   -v  generera utf\u00F6rliga utdata vid standardutmatning\n\ \   -f  ange arkivfilens namn\n\ \   -m  inkludera manifestinformation fr\u00E5n angivet manifest\n\ \   -e  ange programstartpunkt f\u00F6r frist\u00E5ende applikation \n\ \       som medf\u00F6ljer i en jar-programfil\n\ \   -0  endast lagra  (ingen zip-komprimering)\n\ \   -M  skapa inte n\u00E5gon manifestfil f\u00F6r posterna\n\ \   -i  generera indexinformation f\u00F6r de angivna jar-filerna\n\ \   -C  \u00E4ndra till den angivna katalogen och inkludera f\u00F6ljande fil\nOm en fil \u00E4r en katalog bearbetas den rekursivt.\nNamnen p\u00E5 manifestfilen, arkivfilen och startpunkten anges i samma\nordning som m-, f- och e-flaggorna.\n\nExempel 1: S\u00E5 h\u00E4r arkiverar du tv\u00E5 klassfiler i ett arkiv med namnet classes.jar: \n\ \      jar cvf classes.jar Foo.class Bar.class \nExempel 2: Anv\u00E4nd en befintlig manifestfil (mymanifest) och arkivera alla\n\ \          filer fr\u00E5n katalogen foo/ i classes.jar: \n\ \      jar cvfm classes.jar mymanifest -C foo/ .\n
+usage=Syntax: jar-filer {ctxui}[vfm0Me] [jar-fil] [manifestfil] [startpunkt] [-C-katalog] ...\nAlternativ:\n    -c  skapa nytt arkiv\n    -t  lista inneh\u00E5llsf\u00F6rteckning f\u00F6r arkiv\n    -x  extrahera namngivna (eller alla) filer fr\u00E5n arkiv\n    -u  uppdatera befintligt arkiv\n    -v  generera utf\u00F6rliga utdata vid standardutmatning\n    -f  ange arkivfilens namn\n    -m  inkludera manifestinformation fr\u00E5n angivet manifest\n    -e  ange programstartpunkt f\u00F6r frist\u00E5ende applikation \n        som medf\u00F6ljer i en jar-programfil\n    -0  endast lagra  (ingen zip-komprimering)\n    -M  skapa inte n\u00E5gon manifestfil f\u00F6r posterna\n    -i  generera indexinformation f\u00F6r de angivna jar-filerna\n    -C  \u00E4ndra till den angivna katalogen och inkludera f\u00F6ljande fil\nOm en fil \u00E4r en katalog bearbetas den rekursivt.\nNamnen p\u00E5 manifestfilen, arkivfilen och startpunkten anges i samma\nordning som m-, f- och e-flaggorna.\n\nExempel 1: S\u00E5 h\u00E4r arkiverar du tv\u00E5 klassfiler i ett arkiv med namnet classes.jar: \n       jar cvf classes.jar Foo.class Bar.class \nExempel 2: Anv\u00E4nd en befintlig manifestfil (mymanifest) och arkivera alla\n           filer fr\u00E5n katalogen foo/ i classes.jar: \n       jar cvfm classes.jar mymanifest -C foo/ .\n
--- a/src/share/classes/sun/tools/jar/resources/jar_zh_CN.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jar/resources/jar_zh_CN.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -39,9 +39,9 @@
 out.adding=\u6B63\u5728\u6DFB\u52A0: {0}
 out.deflated=(\u538B\u7F29\u4E86 {0}%)
 out.stored=(\u5B58\u50A8\u4E86 0%)
-out.create=\ \ \u5DF2\u521B\u5EFA: {0}
+out.create=\  \u5DF2\u521B\u5EFA: {0}
 out.extracted=\u5DF2\u63D0\u53D6: {0}
-out.inflated=\ \ \u5DF2\u89E3\u538B: {0}
+out.inflated=\  \u5DF2\u89E3\u538B: {0}
 out.size=(\u8F93\u5165 = {0}) (\u8F93\u51FA = {1})
 
-usage=\u7528\u6CD5: jar {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] files ...\n\u9009\u9879\u5305\u62EC: \n\ \   -c  \u521B\u5EFA\u65B0\u7684\u5F52\u6863\u6587\u4EF6\n\ \   -t  \u5217\u51FA\u5F52\u6863\u76EE\u5F55\n\ \   -x  \u4ECE\u6863\u6848\u4E2D\u63D0\u53D6\u6307\u5B9A\u7684 (\u6216\u6240\u6709) \u6587\u4EF6\n\ \   -u  \u66F4\u65B0\u73B0\u6709\u7684\u5F52\u6863\u6587\u4EF6\n\ \   -v  \u5728\u6807\u51C6\u8F93\u51FA\u4E2D\u751F\u6210\u8BE6\u7EC6\u8F93\u51FA\n\ \   -f  \u6307\u5B9A\u5F52\u6863\u6587\u4EF6\u540D\n\ \   -m  \u5305\u542B\u6307\u5B9A\u6E05\u5355\u6587\u4EF6\u4E2D\u7684\u6E05\u5355\u4FE1\u606F\n\ \   -e  \u4E3A\u6346\u7ED1\u5230\u53EF\u6267\u884C jar \u6587\u4EF6\u7684\u72EC\u7ACB\u5E94\u7528\u7A0B\u5E8F\n\ \       \u6307\u5B9A\u5E94\u7528\u7A0B\u5E8F\u5165\u53E3\u70B9\n\ \   -0  \u4EC5\u5B58\u50A8; \u4E0D\u4F7F\u7528\u60C5\u51B5\u4EFB\u4F55 ZIP \u538B\u7F29\n\ \   -M  \u4E0D\u521B\u5EFA\u6761\u76EE\u7684\u6E05\u5355\u6587\u4EF6\n\ \   -i  \u4E3A\u6307\u5B9A\u7684 jar \u6587\u4EF6\u751F\u6210\u7D22\u5F15\u4FE1\u606F\n\ \   -C  \u66F4\u6539\u4E3A\u6307\u5B9A\u7684\u76EE\u5F55\u5E76\u5305\u542B\u5176\u4E2D\u7684\u6587\u4EF6\n\u5982\u679C\u6709\u4EFB\u4F55\u76EE\u5F55\u6587\u4EF6, \u5219\u5BF9\u5176\u8FDB\u884C\u9012\u5F52\u5904\u7406\u3002\n\u6E05\u5355\u6587\u4EF6\u540D, \u5F52\u6863\u6587\u4EF6\u540D\u548C\u5165\u53E3\u70B9\u540D\u79F0\u7684\u6307\u5B9A\u987A\u5E8F\n\u4E0E 'm', 'f' \u548C 'e' \u6807\u8BB0\u7684\u6307\u5B9A\u987A\u5E8F\u76F8\u540C\u3002\n\n\u793A\u4F8B 1: \u5C06\u4E24\u4E2A\u7C7B\u6587\u4EF6\u5F52\u6863\u5230\u4E00\u4E2A\u540D\u4E3A classes.jar \u7684\u5F52\u6863\u6587\u4EF6\u4E2D: \n\ \      jar cvf classes.jar Foo.class Bar.class \n\u793A\u4F8B 2: \u4F7F\u7528\u73B0\u6709\u7684\u6E05\u5355\u6587\u4EF6 'mymanifest' \u5E76\n\ \          \u5C06 foo/ \u76EE\u5F55\u4E2D\u7684\u6240\u6709\u6587\u4EF6\u5F52\u6863\u5230 'classes.jar' \u4E2D: \n\ \      jar cvfm classes.jar mymanifest -C foo/\u3002\n
+usage=\u7528\u6CD5: jar {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] files ...\n\u9009\u9879\u5305\u62EC: \n    -c  \u521B\u5EFA\u65B0\u7684\u5F52\u6863\u6587\u4EF6\n    -t  \u5217\u51FA\u5F52\u6863\u76EE\u5F55\n    -x  \u4ECE\u6863\u6848\u4E2D\u63D0\u53D6\u6307\u5B9A\u7684 (\u6216\u6240\u6709) \u6587\u4EF6\n    -u  \u66F4\u65B0\u73B0\u6709\u7684\u5F52\u6863\u6587\u4EF6\n    -v  \u5728\u6807\u51C6\u8F93\u51FA\u4E2D\u751F\u6210\u8BE6\u7EC6\u8F93\u51FA\n    -f  \u6307\u5B9A\u5F52\u6863\u6587\u4EF6\u540D\n    -m  \u5305\u542B\u6307\u5B9A\u6E05\u5355\u6587\u4EF6\u4E2D\u7684\u6E05\u5355\u4FE1\u606F\n    -e  \u4E3A\u6346\u7ED1\u5230\u53EF\u6267\u884C jar \u6587\u4EF6\u7684\u72EC\u7ACB\u5E94\u7528\u7A0B\u5E8F\n        \u6307\u5B9A\u5E94\u7528\u7A0B\u5E8F\u5165\u53E3\u70B9\n    -0  \u4EC5\u5B58\u50A8; \u4E0D\u4F7F\u7528\u60C5\u51B5\u4EFB\u4F55 ZIP \u538B\u7F29\n    -M  \u4E0D\u521B\u5EFA\u6761\u76EE\u7684\u6E05\u5355\u6587\u4EF6\n    -i  \u4E3A\u6307\u5B9A\u7684 jar \u6587\u4EF6\u751F\u6210\u7D22\u5F15\u4FE1\u606F\n    -C  \u66F4\u6539\u4E3A\u6307\u5B9A\u7684\u76EE\u5F55\u5E76\u5305\u542B\u5176\u4E2D\u7684\u6587\u4EF6\n\u5982\u679C\u6709\u4EFB\u4F55\u76EE\u5F55\u6587\u4EF6, \u5219\u5BF9\u5176\u8FDB\u884C\u9012\u5F52\u5904\u7406\u3002\n\u6E05\u5355\u6587\u4EF6\u540D, \u5F52\u6863\u6587\u4EF6\u540D\u548C\u5165\u53E3\u70B9\u540D\u79F0\u7684\u6307\u5B9A\u987A\u5E8F\n\u4E0E 'm', 'f' \u548C 'e' \u6807\u8BB0\u7684\u6307\u5B9A\u987A\u5E8F\u76F8\u540C\u3002\n\n\u793A\u4F8B 1: \u5C06\u4E24\u4E2A\u7C7B\u6587\u4EF6\u5F52\u6863\u5230\u4E00\u4E2A\u540D\u4E3A classes.jar \u7684\u5F52\u6863\u6587\u4EF6\u4E2D: \n       jar cvf classes.jar Foo.class Bar.class \n\u793A\u4F8B 2: \u4F7F\u7528\u73B0\u6709\u7684\u6E05\u5355\u6587\u4EF6 'mymanifest' \u5E76\n           \u5C06 foo/ \u76EE\u5F55\u4E2D\u7684\u6240\u6709\u6587\u4EF6\u5F52\u6863\u5230 'classes.jar' \u4E2D: \n       jar cvfm classes.jar mymanifest -C foo/\u3002\n
--- a/src/share/classes/sun/tools/jar/resources/jar_zh_TW.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jar/resources/jar_zh_TW.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -39,9 +39,9 @@
 out.adding=\u65B0\u589E: {0}
 out.deflated=(\u58D3\u7E2E {0}%)
 out.stored=(\u5132\u5B58 0%)
-out.create=\ \ \u5EFA\u7ACB: {0}
+out.create=\  \u5EFA\u7ACB: {0}
 out.extracted=\u64F7\u53D6: {0}
 out.inflated=\ \\\u64F4\u5C55: {0}
 out.size=\ (\u8B80={0})(\u5BEB={1})
 
-usage=\u7528\u6CD5: jar {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] \u6A94\u6848 ...\n\u9078\u9805:\n\ \   -c  \u5EFA\u7ACB\u65B0\u7684\u6B78\u6A94\n\ \   -t  \u5217\u51FA\u6B78\u6A94\u7684\u76EE\u9304\n\ \   -x  \u5F9E\u6B78\u6A94\u4E2D\u64F7\u53D6\u5DF2\u547D\u540D\u7684 (\u6216\u6240\u6709) \u6A94\u6848\n\ \   -u  \u66F4\u65B0\u73FE\u6709\u6B78\u6A94\n\ \   -v  \u5728\u6A19\u6E96\u8F38\u51FA\u4E2D\u7522\u751F\u8A73\u7D30\u8F38\u51FA\n\ \   -f  \u6307\u5B9A\u6B78\u6A94\u6A94\u6848\u540D\u7A31\n\ \   -m  \u5305\u542B\u6307\u5B9A\u8CC7\u8A0A\u6E05\u55AE\u4E2D\u7684\u8CC7\u8A0A\u6E05\u55AE\u8CC7\u8A0A\n\ \   -e  \u70BA\u7368\u7ACB\u61C9\u7528\u7A0B\u5F0F\u6307\u5B9A\u61C9\u7528\u7A0B\u5F0F\u9032\u5165\u9EDE\n\ \       \u5DF2\u96A8\u9644\u65BC\u53EF\u57F7\u884C jar \u6A94\u6848\u4E2D\n\ \   -0  \u50C5\u5132\u5B58; \u4E0D\u4F7F\u7528 ZIP \u58D3\u7E2E\u65B9\u5F0F\n\ \   -M  \u4E0D\u70BA\u9805\u76EE\u5EFA\u7ACB\u8CC7\u8A0A\u6E05\u55AE\u6A94\u6848\n\ \   -i  \u70BA\u6307\u5B9A\u7684 jar \u6A94\u6848\u7522\u751F\u7D22\u5F15\u8CC7\u8A0A\n\ \   -C  \u8B8A\u66F4\u81F3\u6307\u5B9A\u76EE\u9304\u4E26\u5305\u542B\u5F8C\u9762\u6240\u5217\u7684\u6A94\u6848\n\u5982\u679C\u6709\u4EFB\u4F55\u6A94\u6848\u662F\u76EE\u9304\uFF0C\u5247\u6703\u5C0D\u5176\u9032\u884C\u905E\u8FF4\u8655\u7406\u3002\n\u6E05\u55AE\u6A94\u6848\u540D\u7A31\u3001\u6B78\u6A94\u6A94\u6848\u540D\u7A31\u548C\u9032\u5165\u9EDE\u540D\u7A31\n\u7684\u6307\u5B9A\u9806\u5E8F\u8207\u6307\u5B9A 'm' \u65D7\u6A19\u3001'f' \u65D7\u6A19\u548C 'e' \u65D7\u6A19\u7684\u9806\u5E8F\u76F8\u540C\u3002\n\n\u7BC4\u4F8B 1: \u5C07\u5169\u500B\u985E\u5225\u6A94\u6848\u6B78\u6A94\u81F3\u540D\u70BA classes.jar \u7684\u6B78\u6A94\u4E2D: \n\ \      jar cvf classes.jar Foo.class Bar.class\n\u7BC4\u4F8B 2: \u4F7F\u7528\u73FE\u6709\u8CC7\u8A0A\u6E05\u55AE\u6A94\u6848 'mymanifest' \u4E26\u5C07\n\ \          foo/ \u76EE\u9304\u4E2D\u7684\u6240\u6709\u6A94\u6848\u6B78\u6A94\u81F3 'classes.jar' \u4E2D: \n\ \      jar cvfm classes.jar mymanifest -C foo/ .\n
+usage=\u7528\u6CD5: jar {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] \u6A94\u6848 ...\n\u9078\u9805:\n    -c  \u5EFA\u7ACB\u65B0\u7684\u6B78\u6A94\n    -t  \u5217\u51FA\u6B78\u6A94\u7684\u76EE\u9304\n    -x  \u5F9E\u6B78\u6A94\u4E2D\u64F7\u53D6\u5DF2\u547D\u540D\u7684 (\u6216\u6240\u6709) \u6A94\u6848\n    -u  \u66F4\u65B0\u73FE\u6709\u6B78\u6A94\n    -v  \u5728\u6A19\u6E96\u8F38\u51FA\u4E2D\u7522\u751F\u8A73\u7D30\u8F38\u51FA\n    -f  \u6307\u5B9A\u6B78\u6A94\u6A94\u6848\u540D\u7A31\n    -m  \u5305\u542B\u6307\u5B9A\u8CC7\u8A0A\u6E05\u55AE\u4E2D\u7684\u8CC7\u8A0A\u6E05\u55AE\u8CC7\u8A0A\n    -e  \u70BA\u7368\u7ACB\u61C9\u7528\u7A0B\u5F0F\u6307\u5B9A\u61C9\u7528\u7A0B\u5F0F\u9032\u5165\u9EDE\n        \u5DF2\u96A8\u9644\u65BC\u53EF\u57F7\u884C jar \u6A94\u6848\u4E2D\n    -0  \u50C5\u5132\u5B58; \u4E0D\u4F7F\u7528 ZIP \u58D3\u7E2E\u65B9\u5F0F\n    -M  \u4E0D\u70BA\u9805\u76EE\u5EFA\u7ACB\u8CC7\u8A0A\u6E05\u55AE\u6A94\u6848\n    -i  \u70BA\u6307\u5B9A\u7684 jar \u6A94\u6848\u7522\u751F\u7D22\u5F15\u8CC7\u8A0A\n    -C  \u8B8A\u66F4\u81F3\u6307\u5B9A\u76EE\u9304\u4E26\u5305\u542B\u5F8C\u9762\u6240\u5217\u7684\u6A94\u6848\n\u5982\u679C\u6709\u4EFB\u4F55\u6A94\u6848\u662F\u76EE\u9304\uFF0C\u5247\u6703\u5C0D\u5176\u9032\u884C\u905E\u8FF4\u8655\u7406\u3002\n\u6E05\u55AE\u6A94\u6848\u540D\u7A31\u3001\u6B78\u6A94\u6A94\u6848\u540D\u7A31\u548C\u9032\u5165\u9EDE\u540D\u7A31\n\u7684\u6307\u5B9A\u9806\u5E8F\u8207\u6307\u5B9A 'm' \u65D7\u6A19\u3001'f' \u65D7\u6A19\u548C 'e' \u65D7\u6A19\u7684\u9806\u5E8F\u76F8\u540C\u3002\n\n\u7BC4\u4F8B 1: \u5C07\u5169\u500B\u985E\u5225\u6A94\u6848\u6B78\u6A94\u81F3\u540D\u70BA classes.jar \u7684\u6B78\u6A94\u4E2D: \n       jar cvf classes.jar Foo.class Bar.class\n\u7BC4\u4F8B 2: \u4F7F\u7528\u73FE\u6709\u8CC7\u8A0A\u6E05\u55AE\u6A94\u6848 'mymanifest' \u4E26\u5C07\n           foo/ \u76EE\u9304\u4E2D\u7684\u6240\u6709\u6A94\u6848\u6B78\u6A94\u81F3 'classes.jar' \u4E2D: \n       jar cvfm classes.jar mymanifest -C foo/ .\n
--- a/src/share/classes/sun/tools/java/ClassPath.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/java/ClassPath.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 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
@@ -141,7 +141,7 @@
         } else {
             StringBuilder sb = new StringBuilder(patharray[0]);
             for (int i = 1; i < patharray.length; i++) {
-                sb.append(File.separator);
+                sb.append(File.pathSeparatorChar);
                 sb.append(patharray[i]);
             }
             this.pathstr = sb.toString();
--- a/src/share/classes/sun/tools/jconsole/AboutDialog.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/AboutDialog.java	Fri Jun 21 19:11:42 2013 -0700
@@ -30,13 +30,13 @@
 import java.beans.PropertyVetoException;
 import java.net.URI;
 
-import javax.accessibility.*;
 import javax.swing.*;
 import javax.swing.border.*;
 import javax.swing.event.*;
 
+import static sun.misc.Version.jdkMinorVersion;
+
 import static java.awt.BorderLayout.*;
-import static sun.tools.jconsole.Resources.*;
 import static sun.tools.jconsole.Utilities.*;
 
 @SuppressWarnings("serial")
@@ -47,7 +47,7 @@
     private static final Color borderColor   = Color.black;
 
     private Icon mastheadIcon =
-        new MastheadIcon(getText("Help.AboutDialog.masthead.title"));
+        new MastheadIcon(Messages.HELP_ABOUT_DIALOG_MASTHEAD_TITLE);
 
     private static AboutDialog aboutDialog;
 
@@ -55,10 +55,9 @@
     private Action closeAction;
 
     public AboutDialog(JConsole jConsole) {
-        super(jConsole, Resources.getText("Help.AboutDialog.title"), false);
+        super(jConsole, Messages.HELP_ABOUT_DIALOG_TITLE, false);
 
-        setAccessibleDescription(this,
-                                 getText("Help.AboutDialog.accessibleDescription"));
+        setAccessibleDescription(this, Messages.HELP_ABOUT_DIALOG_ACCESSIBLE_DESCRIPTION);
         setDefaultCloseOperation(HIDE_ON_CLOSE);
         setResizable(false);
         JComponent cp = (JComponent)getContentPane();
@@ -67,7 +66,7 @@
 
         JLabel mastheadLabel = new JLabel(mastheadIcon);
         setAccessibleName(mastheadLabel,
-                          getText("Help.AboutDialog.masthead.accessibleName"));
+                Messages.HELP_ABOUT_DIALOG_MASTHEAD_ACCESSIBLE_NAME);
 
         JPanel mainPanel = new TPanel(0, 0);
         mainPanel.add(mastheadLabel, NORTH);
@@ -75,7 +74,7 @@
         String jConsoleVersion = Version.getVersion();
         String vmName = System.getProperty("java.vm.name");
         String vmVersion = System.getProperty("java.vm.version");
-        String urlStr = getText("Help.AboutDialog.userGuideLink.url");
+        String urlStr = getOnlineDocUrl();
         if (isBrowseSupported()) {
             urlStr = "<a style='color:#35556b' href=\"" + urlStr + "\">" + urlStr + "</a>";
         }
@@ -86,10 +85,9 @@
         String colorStr = String.format("%06x", textColor.getRGB() & 0xFFFFFF);
         JEditorPane helpLink = new JEditorPane("text/html",
                                 "<html><font color=#"+ colorStr + ">" +
-                        getText("Help.AboutDialog.jConsoleVersion", jConsoleVersion) +
-                "<p>" + getText("Help.AboutDialog.javaVersion", (vmName +", "+ vmVersion)) +
-                "<p>" + getText("Help.AboutDialog.userGuideLink", urlStr) +
-                                                 "</html>");
+                        Resources.format(Messages.HELP_ABOUT_DIALOG_JCONSOLE_VERSION, jConsoleVersion) +
+                "<p>" + Resources.format(Messages.HELP_ABOUT_DIALOG_JAVA_VERSION, (vmName +", "+ vmVersion)) +
+                "<p>" + urlStr + "</html>");
         helpLink.setOpaque(false);
         helpLink.setEditable(false);
         helpLink.setForeground(textColor);
@@ -155,7 +153,7 @@
     }
 
     static void browseUserGuide(JConsole jConsole) {
-        getAboutDialog(jConsole).browse(getText("Help.AboutDialog.userGuideLink.url"));
+        getAboutDialog(jConsole).browse(getOnlineDocUrl());
     }
 
     static boolean isBrowseSupported() {
@@ -176,7 +174,7 @@
     }
 
     private void createActions() {
-        closeAction = new AbstractAction(getText("Close")) {
+        closeAction = new AbstractAction(Messages.CLOSE) {
             public void actionPerformed(ActionEvent ev) {
                 setVisible(false);
                 statusBar.setText("");
@@ -184,6 +182,12 @@
         };
     }
 
+    private static String getOnlineDocUrl() {
+        String version = Integer.toString(jdkMinorVersion());
+        return Resources.format(Messages.HELP_ABOUT_DIALOG_USER_GUIDE_LINK_URL,
+                                version);
+    }
+
     private static class TPanel extends JPanel {
         TPanel(int hgap, int vgap) {
             super(new BorderLayout(hgap, vgap));
--- a/src/share/classes/sun/tools/jconsole/BorderedComponent.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/BorderedComponent.java	Fri Jun 21 19:11:42 2013 -0700
@@ -33,11 +33,10 @@
 import javax.swing.plaf.*;
 import javax.swing.plaf.basic.BasicGraphicsUtils;
 
+
 import static javax.swing.SwingConstants.*;
 
 import static sun.tools.jconsole.JConsole.*;
-import static sun.tools.jconsole.Resources.*;
-import static sun.tools.jconsole.Utilities.*;
 
 @SuppressWarnings("serial")
 public class BorderedComponent extends JPanel implements ActionListener {
@@ -47,8 +46,6 @@
     JComponent comp;
     boolean collapsed = false;
 
-    private JPopupMenu popupMenu;
-
     private Icon collapseIcon;
     private Icon expandIcon;
 
@@ -100,7 +97,7 @@
                 moreOrLessButton.setMargin(new Insets(0, 0, 0, 0));
                 moreOrLessButton.addActionListener(this);
                 String toolTip =
-                    getText("BorderedComponent.moreOrLessButton.toolTip");
+                    Messages.BORDERED_COMPONENT_MORE_OR_LESS_BUTTON_TOOLTIP;
                 moreOrLessButton.setToolTipText(toolTip);
                 borderLabel.add(moreOrLessButton);
                 borderLabel.setSize(borderLabel.getPreferredSize());
@@ -136,7 +133,8 @@
     public void setValueLabel(String str) {
         this.valueLabelStr = str;
         if (label != null) {
-            label.setText(Resources.getText("Current value",valueLabelStr));
+            label.setText(Resources.format(Messages.CURRENT_VALUE,
+                                           valueLabelStr));
         }
     }
 
@@ -151,8 +149,8 @@
             remove(comp);
             if (valueLabelStr != null) {
                 if (label == null) {
-                    label = new JLabel(Resources.getText("Current value",
-                                                         valueLabelStr));
+                    label = new JLabel(Resources.format(Messages.CURRENT_VALUE,
+                                                        valueLabelStr));
                 }
                 add(label);
             }
@@ -439,8 +437,6 @@
          * @param insets the object to be reinitialized
          */
         public Insets getBorderInsets(Component c, Insets insets) {
-            int height = 16;
-
             Border border = getBorder();
             if (border != null) {
                 if (border instanceof AbstractBorder) {
--- a/src/share/classes/sun/tools/jconsole/ClassTab.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/ClassTab.java	Fri Jun 21 19:11:42 2013 -0700
@@ -33,17 +33,11 @@
 
 import javax.swing.*;
 import javax.swing.border.*;
-import javax.swing.event.*;
-import javax.swing.text.*;
 
-import java.util.*;
-import java.util.List;
+
 import java.util.concurrent.*;
 
-import sun.awt.*;
-
 import static sun.tools.jconsole.Formatter.*;
-import static sun.tools.jconsole.Resources.*;
 import static sun.tools.jconsole.Utilities.*;
 
 
@@ -58,13 +52,9 @@
 
     private static final String loadedPlotterKey        = "loaded";
     private static final String totalLoadedPlotterKey   = "totalLoaded";
-    private static final String loadedPlotterName       = Resources.getText("Loaded");
-    private static final String totalLoadedPlotterName  = Resources.getText("Total Loaded");
     private static final Color  loadedPlotterColor      = Plotter.defaultColor;
     private static final Color  totalLoadedPlotterColor = Color.red;
 
-    private static final String infoLabelFormat = "ClassTab.infoLabelFormat";
-
     /*
       Hierarchy of panels and layouts for this tab:
 
@@ -88,7 +78,7 @@
     */
 
     public static String getTabName() {
-        return Resources.getText("Classes");
+        return Messages.CLASSES;
     }
 
     public ClassTab(VMPanel vmPanel) {
@@ -108,40 +98,40 @@
         JPanel controlPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 20, 5));
         topPanel.add(controlPanel, BorderLayout.CENTER);
 
-        verboseCheckBox = new JCheckBox(Resources.getText("Verbose Output"));
+        verboseCheckBox = new JCheckBox(Messages.VERBOSE_OUTPUT);
         verboseCheckBox.addActionListener(this);
-        verboseCheckBox.setToolTipText(getText("Verbose Output.toolTip"));
+        verboseCheckBox.setToolTipText(Messages.VERBOSE_OUTPUT_TOOLTIP);
         JPanel topRightPanel = new JPanel();
         topRightPanel.setBorder(new EmptyBorder(0, 65-8, 0, 70));
         topRightPanel.add(verboseCheckBox);
         topPanel.add(topRightPanel, BorderLayout.AFTER_LINE_ENDS);
 
-        loadedClassesMeter = new PlotterPanel(Resources.getText("Number of Loaded Classes"),
+        loadedClassesMeter = new PlotterPanel(Messages.NUMBER_OF_LOADED_CLASSES,
                                               Plotter.Unit.NONE, false);
         loadedClassesMeter.plotter.createSequence(loadedPlotterKey,
-                                                  loadedPlotterName,
+                                                  Messages.LOADED,
                                                   loadedPlotterColor,
                                                   true);
         loadedClassesMeter.plotter.createSequence(totalLoadedPlotterKey,
-                                                  totalLoadedPlotterName,
+                                                  Messages.TOTAL_LOADED,
                                                   totalLoadedPlotterColor,
                                                   true);
         setAccessibleName(loadedClassesMeter.plotter,
-                          getText("ClassTab.loadedClassesPlotter.accessibleName"));
+                          Messages.CLASS_TAB_LOADED_CLASSES_PLOTTER_ACCESSIBLE_NAME);
         plotterPanel.add(loadedClassesMeter);
 
         timeComboBox = new TimeComboBox(loadedClassesMeter.plotter);
-        controlPanel.add(new LabeledComponent(Resources.getText("Time Range:"),
-                                              getMnemonicInt("Time Range:"),
+        controlPanel.add(new LabeledComponent(Messages.TIME_RANGE_COLON,
+                                              Resources.getMnemonicInt(Messages.TIME_RANGE_COLON),
                                               timeComboBox));
 
         LabeledComponent.layout(plotterPanel);
 
-        bottomPanel.setBorder(new CompoundBorder(new TitledBorder(Resources.getText("Details")),
-                                                  new EmptyBorder(10, 10, 10, 10)));
+        bottomPanel.setBorder(new CompoundBorder(new TitledBorder(Messages.DETAILS),
+                                                 new EmptyBorder(10, 10, 10, 10)));
 
         details = new HTMLPane();
-        setAccessibleName(details, getText("Details"));
+        setAccessibleName(details, Messages.DETAILS);
         JScrollPane scrollPane = new JScrollPane(details);
         scrollPane.setPreferredSize(new Dimension(0, 150));
         bottomPanel.add(scrollPane, BorderLayout.SOUTH);
@@ -226,10 +216,10 @@
 
                 long time = System.currentTimeMillis();
                 String timeStamp = formatDateTime(time);
-                text += newRow(Resources.getText("Time"), timeStamp);
-                text += newRow(Resources.getText("Current classes loaded"), justify(clCount, 5));
-                text += newRow(Resources.getText("Total classes loaded"),   justify(ctCount, 5));
-                text += newRow(Resources.getText("Total classes unloaded"), justify(cuCount, 5));
+                text += newRow(Messages.TIME, timeStamp);
+                text += newRow(Messages.CURRENT_CLASSES_LOADED, justify(clCount, 5));
+                text += newRow(Messages.TOTAL_CLASSES_LOADED,   justify(ctCount, 5));
+                text += newRow(Messages.TOTAL_CLASSES_UNLOADED, justify(cuCount, 5));
 
                 return text;
             }
@@ -246,12 +236,13 @@
 
     private static class ClassOverviewPanel extends OverviewPanel {
         ClassOverviewPanel() {
-            super(getText("Classes"), loadedPlotterKey, loadedPlotterName, null);
+            super(Messages.CLASSES, loadedPlotterKey, Messages.LOADED, null);
         }
 
         private void updateClassInfo(long total, long loaded) {
             long unloaded = (total - loaded);
-            getInfoLabel().setText(getText(infoLabelFormat, loaded, unloaded, total));
+            getInfoLabel().setText(Resources.format(Messages.CLASS_TAB_INFO_LABEL_FORMAT,
+                                   loaded, unloaded, total));
         }
     }
 }
--- a/src/share/classes/sun/tools/jconsole/ConnectDialog.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/ConnectDialog.java	Fri Jun 21 19:11:42 2013 -0700
@@ -29,23 +29,17 @@
 import java.awt.*;
 import java.awt.event.*;
 import java.util.*;
-import java.net.MalformedURLException;
-import java.io.IOException;
 
-import javax.accessibility.*;
 import javax.swing.*;
-import javax.swing.Timer;
 import javax.swing.border.*;
 import javax.swing.event.*;
 import javax.swing.plaf.basic.BasicRadioButtonUI;
 import javax.swing.table.*;
 
-import javax.management.remote.JMXServiceURL;
-import javax.management.remote.JMXConnector;
+
 
 import static java.awt.BorderLayout.*;
 import static javax.swing.ListSelectionModel.*;
-import static sun.tools.jconsole.Resources.*;
 import static sun.tools.jconsole.Utilities.*;
 
 @SuppressWarnings("serial")
@@ -66,7 +60,7 @@
     JPanel radioButtonPanel;
 
     private Icon mastheadIcon =
-        new MastheadIcon(getText("ConnectDialog.masthead.title"));
+        new MastheadIcon(Messages.CONNECT_DIALOG_MASTHEAD_TITLE);
     private Color hintTextColor, disabledTableCellColor;
 
     // The table of managed VM (local process)
@@ -79,11 +73,11 @@
 
 
     public ConnectDialog(JConsole jConsole) {
-        super(jConsole, Resources.getText("ConnectDialog.title"), true);
+        super(jConsole, Messages.CONNECT_DIALOG_TITLE, true);
 
         this.jConsole = jConsole;
         setAccessibleDescription(this,
-                                 getText("ConnectDialog.accessibleDescription"));
+                                 Messages.CONNECT_DIALOG_ACCESSIBLE_DESCRIPTION);
         setDefaultCloseOperation(HIDE_ON_CLOSE);
         setResizable(false);
         Container cp = (JComponent)getContentPane();
@@ -95,7 +89,7 @@
 
         statusBar = new JLabel(" ", JLabel.CENTER);
         setAccessibleName(statusBar,
-                          getText("ConnectDialog.statusBar.accessibleName"));
+                          Messages.CONNECT_DIALOG_STATUS_BAR_ACCESSIBLE_NAME);
 
         Font normalLabelFont = statusBar.getFont();
         Font boldLabelFont = normalLabelFont.deriveFont(Font.BOLD);
@@ -103,7 +97,7 @@
 
         JLabel mastheadLabel = new JLabel(mastheadIcon);
         setAccessibleName(mastheadLabel,
-                          getText("ConnectDialog.masthead.accessibleName"));
+                          Messages.CONNECT_DIALOG_MASTHEAD_ACCESSIBLE_NAME);
 
         cp.add(mastheadLabel, NORTH);
         cp.add(radioButtonPanel, CENTER);
@@ -117,7 +111,7 @@
         remoteTF.addFocusListener(this);
         remoteTF.setPreferredSize(remoteTF.getPreferredSize());
         setAccessibleName(remoteTF,
-                          getText("Remote Process.textField.accessibleName"));
+                          Messages.REMOTE_PROCESS_TEXT_FIELD_ACCESSIBLE_NAME);
 
         //
         // If the VM supports the local attach mechanism (is: Sun
@@ -141,8 +135,8 @@
             TableColumn cmdLineColumn = columnModel.getColumn(COL_NAME);
             cmdLineColumn.setResizable(false);
 
-            localRadioButton = new JRadioButton(getText("Local Process:"));
-            localRadioButton.setMnemonic(getMnemonicInt("Local Process:"));
+            localRadioButton = new JRadioButton(Messages.LOCAL_PROCESS_COLON);
+            localRadioButton.setMnemonic(Resources.getMnemonicInt(Messages.LOCAL_PROCESS_COLON));
             localRadioButton.setFont(boldLabelFont);
             localRadioButton.addItemListener(this);
             radioButtonGroup.add(localRadioButton);
@@ -167,8 +161,8 @@
             localTablePanel.add(localMessageLabel, SOUTH);
         }
 
-        remoteRadioButton = new JRadioButton(getText("Remote Process:"));
-        remoteRadioButton.setMnemonic(getMnemonicInt("Remote Process:"));
+        remoteRadioButton = new JRadioButton(Messages.REMOTE_PROCESS_COLON);
+        remoteRadioButton.setMnemonic(Resources.getMnemonicInt(Messages.REMOTE_PROCESS_COLON));
         remoteRadioButton.setFont(boldLabelFont);
         radioButtonGroup.add(remoteRadioButton);
 
@@ -207,7 +201,7 @@
 
         remoteTFPanel.add(remoteTF, NORTH);
 
-        remoteMessageLabel = new JLabel("<html>" + getText("remoteTF.usage"));
+        remoteMessageLabel = new JLabel("<html>" + Messages.REMOTE_TF_USAGE + "</html>");
         remoteMessageLabel.setFont(smallLabelFont);
         remoteMessageLabel.setForeground(hintTextColor);
         remoteTFPanel.add(remoteMessageLabel, CENTER);
@@ -222,11 +216,10 @@
         userNameTF.getDocument().addDocumentListener(this);
         userNameTF.addFocusListener(this);
         setAccessibleName(userNameTF,
-                          getText("Username.accessibleName"));
-        String labelKey = "Username: ";
+            Messages.USERNAME_ACCESSIBLE_NAME);
         LabeledComponent lc;
-        lc = new LabeledComponent(getText(labelKey),
-                                  getMnemonicInt(labelKey),
+        lc = new LabeledComponent(Messages.USERNAME_COLON_,
+                                  Resources.getMnemonicInt(Messages.USERNAME_COLON_),
                                   userNameTF);
         lc.label.setFont(boldLabelFont);
         userPwdPanel.add(lc);
@@ -238,10 +231,10 @@
         passwordTF.getDocument().addDocumentListener(this);
         passwordTF.addFocusListener(this);
         setAccessibleName(passwordTF,
-                          getText("Password.accessibleName"));
-        labelKey = "Password: ";
-        lc = new LabeledComponent(getText(labelKey),
-                                  getMnemonicInt(labelKey),
+            Messages.PASSWORD_ACCESSIBLE_NAME);
+
+        lc = new LabeledComponent(Messages.PASSWORD_COLON_,
+                                  Resources.getMnemonicInt(Messages.PASSWORD_COLON_),
                                   passwordTF);
         lc.setBorder(new EmptyBorder(0, 12, 0, 0)); // Left padding
         lc.label.setFont(boldLabelFont);
@@ -250,7 +243,7 @@
         remoteTFPanel.add(userPwdPanel, SOUTH);
 
         String connectButtonToolTipText =
-            getText("ConnectDialog.connectButton.toolTip");
+            Messages.CONNECT_DIALOG_CONNECT_BUTTON_TOOLTIP;
         connectButton = new JButton(connectAction);
         connectButton.setToolTipText(connectButtonToolTipText);
 
@@ -288,7 +281,7 @@
             String colorStr =
                 String.format("%06x", hintTextColor.getRGB() & 0xFFFFFF);
             remoteMessageLabel.setText("<html><font color=#" + colorStr + ">" +
-                                       getText("remoteTF.usage"));
+                                       Messages.REMOTE_TF_USAGE);
         }
         if (localMessageLabel != null) {
             localMessageLabel.setForeground(hintTextColor);
@@ -300,9 +293,9 @@
     }
 
     private void createActions() {
-        connectAction = new AbstractAction(getText("Connect")) {
+        connectAction = new AbstractAction(Messages.CONNECT) {
             /* init */ {
-                putValue(Action.MNEMONIC_KEY, getMnemonicInt("Connect"));
+                putValue(Action.MNEMONIC_KEY, Resources.getMnemonicInt(Messages.CONNECT));
             }
 
             public void actionPerformed(ActionEvent ev) {
@@ -321,7 +314,6 @@
                     try {
                         if (txt.startsWith(JConsole.ROOT_URL)) {
                             String url = txt;
-                            String msg = null;
                             jConsole.addUrl(url, userName, password, false);
                             remoteTF.setText(JConsole.ROOT_URL);
                             return;
@@ -361,7 +353,7 @@
             }
         };
 
-        cancelAction = new AbstractAction(getText("Cancel")) {
+        cancelAction = new AbstractAction(Messages.CANCEL) {
             public void actionPerformed(ActionEvent ev) {
                 setVisible(false);
                 statusBar.setText("");
@@ -588,9 +580,9 @@
             LocalVirtualMachine lvm = vmModel.vmAt(row);
             if (!lvm.isManageable()) {
                 if (lvm.isAttachable()) {
-                    labelText = getText("Management Will Be Enabled");
+                    labelText = Messages.MANAGEMENT_WILL_BE_ENABLED;
                 } else {
-                    labelText = getText("Management Not Enabled");
+                    labelText = Messages.MANAGEMENT_NOT_ENABLED;
                 }
             }
         }
@@ -650,8 +642,8 @@
     // Represents the list of managed VMs as a tabular data model.
     private static class ManagedVmTableModel extends AbstractTableModel {
         private static String[] columnNames = {
-            Resources.getText("Column.Name"),
-            Resources.getText("Column.PID"),
+            Messages.COLUMN_NAME,
+            Messages.COLUMN_PID,
         };
 
         private List<LocalVirtualMachine> vmList;
@@ -678,7 +670,7 @@
             }
         }
 
-        public Class getColumnClass(int column) {
+        public Class<?> getColumnClass(int column) {
             switch (column) {
                 case COL_NAME: return String.class;
                 case COL_PID:  return Integer.class;
@@ -706,13 +698,6 @@
         }
     }
 
-
-    // Convenience method
-    private static String getText(String key) {
-        return Resources.getText(key);
-    }
-
-
     // A blank component that takes up as much space as the
     // button part of a JRadioButton.
     private static class Padder extends JPanel {
@@ -721,7 +706,7 @@
         Padder(JRadioButton radioButton) {
             this.radioButton = radioButton;
 
-            setAccessibleName(this, getText("Blank"));
+            setAccessibleName(this, Messages.BLANK);
         }
 
         public Dimension getPreferredSize() {
@@ -758,7 +743,6 @@
             if (g == null) {
                 return null;
             }
-            String clippedText =
                 SwingUtilities.layoutCompoundLabel(button,
                                                    g.getFontMetrics(),
                                                    text,
--- a/src/share/classes/sun/tools/jconsole/CreateMBeanDialog.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/CreateMBeanDialog.java	Fri Jun 21 19:11:42 2013 -0700
@@ -32,23 +32,21 @@
 import java.util.Comparator;
 
 import javax.swing.*;
-import javax.swing.Timer;
 import javax.swing.border.*;
-import javax.swing.event.*;
 
 import javax.management.MBeanServerConnection;
 import javax.management.ObjectName;
 import javax.management.InstanceAlreadyExistsException;
 import javax.management.InstanceNotFoundException;
 
-import static sun.tools.jconsole.Resources.*;
+
 import static sun.tools.jconsole.Utilities.*;
 
 @SuppressWarnings("serial")
 public class CreateMBeanDialog extends InternalDialog
                 implements ActionListener {
     JConsole jConsole;
-    JComboBox connections;
+    JComboBox<ProxyClient> connections;
     JButton createMBeanButton, unregisterMBeanButton, cancelButton;
 
     private static final String HOTSPOT_MBEAN =
@@ -60,7 +58,7 @@
 
         this.jConsole = jConsole;
         setAccessibleDescription(this,
-                                 getText("Hotspot MBeans.dialog.accessibleDescription"));
+                                 Messages.HOTSPOT_MBEANS_DIALOG_ACCESSIBLE_DESCRIPTION);
         Container cp = getContentPane();
         ((JComponent)cp).setBorder(new EmptyBorder(10, 10, 4, 10));
 
@@ -71,12 +69,10 @@
                                                         false,
                                                         true));
         cp.add(centerPanel, BorderLayout.CENTER);
-        connections = new JComboBox();
+        connections = new JComboBox<ProxyClient>();
         updateConnections();
 
-        centerPanel.add(new LabeledComponent(Resources.
-                                             getText("Manage Hotspot MBeans "+
-                                                     "in: "),
+        centerPanel.add(new LabeledComponent(Resources.format(Messages.MANAGE_HOTSPOT_MBEANS_IN_COLON_),
                                              connections));
 
         JPanel bottomPanel = new JPanel(new BorderLayout());
@@ -85,11 +81,11 @@
         JPanel buttonPanel = new JPanel();
         bottomPanel.add(buttonPanel, BorderLayout.NORTH);
         buttonPanel.add(createMBeanButton =
-                        new JButton(Resources.getText("Create")));
+                        new JButton(Messages.CREATE));
         buttonPanel.add(unregisterMBeanButton =
-                        new JButton(Resources.getText("Unregister")));
+                        new JButton(Messages.UNREGISTER));
         buttonPanel.add(cancelButton =
-                        new JButton(Resources.getText("Cancel")));
+                        new JButton(Messages.CANCEL));
 
         statusBar = new JLabel(" ", JLabel.CENTER);
         bottomPanel.add(statusBar, BorderLayout.SOUTH);
@@ -133,7 +129,8 @@
             }
         }
         connections.invalidate();
-        connections.setModel(new DefaultComboBoxModel(data.toArray()));
+        connections.setModel(new DefaultComboBoxModel<ProxyClient>
+            (data.toArray(new ProxyClient[data.size()])));
         connections.validate();
     }
 
@@ -144,7 +141,6 @@
             new Thread("CreateMBeanDialog.actionPerformed") {
                     public void run() {
                         try {
-                            StringBuffer buff = null;
                             Object c = connections.getSelectedItem();
                             if(c == null) return;
                             if(ev.getSource() == createMBeanButton) {
@@ -163,13 +159,9 @@
                             }
                             return;
                         } catch(InstanceAlreadyExistsException e) {
-                            statusBar.setText(Resources.
-                                              getText("Error: MBeans already "
-                                                      + "exist"));
+                            statusBar.setText(Messages.ERROR_COLON_MBEANS_ALREADY_EXIST);
                         } catch(InstanceNotFoundException e) {
-                            statusBar.setText(Resources.
-                                              getText("Error: MBeans do not "
-                                                      + "exist"));
+                            statusBar.setText(Messages.ERROR_COLON_MBEANS_DO_NOT_EXIST);
                         } catch(Exception e) {
                             statusBar.setText(e.toString());
                         }
--- a/src/share/classes/sun/tools/jconsole/Formatter.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/Formatter.java	Fri Jun 21 19:11:42 2013 -0700
@@ -28,7 +28,6 @@
 import java.text.*;
 import java.util.*;
 
-import static sun.tools.jconsole.Resources.*;
 
 class Formatter {
     final static long SECOND = 1000;
@@ -48,7 +47,7 @@
         String str;
         if (t < 1 * MINUTE) {
             String seconds = String.format("%.3f", t / (double)SECOND);
-            str = Resources.getText("DurationSeconds", seconds);
+            str = Resources.format(Messages.DURATION_SECONDS, seconds);
         } else {
             long remaining = t;
             long days = remaining / DAY;
@@ -58,13 +57,13 @@
             long minutes = remaining / MINUTE;
 
             if (t >= 1 * DAY) {
-                str = Resources.getText("DurationDaysHoursMinutes",
-                                        days, hours, minutes);
+                str = Resources.format(Messages.DURATION_DAYS_HOURS_MINUTES,
+                                       days, hours, minutes);
             } else if (t >= 1 * HOUR) {
-                str = Resources.getText("DurationHoursMinutes",
-                                        hours, minutes);
+                str = Resources.format(Messages.DURATION_HOURS_MINUTES,
+                                       hours, minutes);
             } else {
-                str = Resources.getText("DurationMinutes", minutes);
+                str = Resources.format(Messages.DURATION_MINUTES, minutes);
             }
         }
         return str;
@@ -88,8 +87,7 @@
         return dateDF.format(time) + " " + timeWithSecondsDF.format(time);
     }
 
-    static DateFormat getDateTimeFormat(String key) {
-        String dtfStr = getText(key);
+    static DateFormat getDateTimeFormat(String dtfStr) {
         int dateStyle = -1;
         int timeStyle = -1;
 
@@ -153,18 +151,18 @@
         }
         String[] strings = formatLongs(bytes);
         for (int i = 0; i < n; i++) {
-            strings[i] = getText("kbytes", strings[i]);
+            strings[i] = Resources.format(Messages.KBYTES, strings[i]);
         }
         return strings;
     }
 
     static String formatKBytes(long bytes) {
         if (bytes == -1) {
-            return getText("kbytes", "-1");
+            return Resources.format(Messages.KBYTES, "-1");
         }
 
         long kb = bytes / 1024;
-        return getText("kbytes", justify(kb, 10));
+        return Resources.format(Messages.KBYTES, justify(kb, 10));
     }
 
 
@@ -182,13 +180,13 @@
         int exp = (int)Math.log10((double)vMax);
 
         if (exp < 3) {
-            s = Resources.getText("Size Bytes", v);
+            s = Resources.format(Messages.SIZE_BYTES, v);
         } else if (exp < 6) {
-            s = Resources.getText("Size Kb", trimDouble(v / Math.pow(10.0, 3)));
+            s = Resources.format(Messages.SIZE_KB, trimDouble(v / Math.pow(10.0, 3)));
         } else if (exp < 9) {
-            s = Resources.getText("Size Mb", trimDouble(v / Math.pow(10.0, 6)));
+            s = Resources.format(Messages.SIZE_MB, trimDouble(v / Math.pow(10.0, 6)));
         } else {
-            s = Resources.getText("Size Gb", trimDouble(v / Math.pow(10.0, 9)));
+            s = Resources.format(Messages.SIZE_GB, trimDouble(v / Math.pow(10.0, 9)));
         }
         if (html) {
             s = s.replace(" ", "&nbsp;");
--- a/src/share/classes/sun/tools/jconsole/HTMLPane.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/HTMLPane.java	Fri Jun 21 19:11:42 2013 -0700
@@ -25,8 +25,6 @@
 
 package sun.tools.jconsole;
 
-import java.awt.Color;
-
 import javax.swing.*;
 import javax.swing.event.*;
 import javax.swing.text.*;
--- a/src/share/classes/sun/tools/jconsole/InternalDialog.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/InternalDialog.java	Fri Jun 21 19:11:42 2013 -0700
@@ -30,8 +30,8 @@
 
 import javax.swing.*;
 
+
 import static javax.swing.JLayeredPane.*;
-import static sun.tools.jconsole.Resources.*;
 
 /**
  * Used instead of JDialog in a JDesktopPane/JInternalFrame environment.
@@ -73,7 +73,7 @@
         private ImageIcon rightIcon =
             new ImageIcon(InternalDialog.class.getResource("resources/masthead-right.png"));
 
-        private Font font = Font.decode(getText("Masthead.font"));
+        private Font font = Font.decode(Messages.MASTHEAD_FONT);
         private int gap = 10;
         private String title;
 
--- a/src/share/classes/sun/tools/jconsole/JConsole.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/JConsole.java	Fri Jun 21 19:11:42 2013 -0700
@@ -29,7 +29,6 @@
 import java.awt.event.*;
 import java.beans.*;
 import java.io.*;
-import java.lang.reflect.InvocationTargetException;
 import java.net.*;
 import java.util.*;
 import java.util.List;
@@ -38,8 +37,6 @@
 import javax.swing.border.*;
 import javax.swing.event.*;
 import javax.swing.plaf.*;
-import javax.management.remote.JMXServiceURL;
-import javax.management.remote.JMXConnector;
 import javax.security.auth.login.FailedLoginException;
 import javax.net.ssl.SSLHandshakeException;
 
@@ -47,7 +44,6 @@
 
 import sun.net.util.IPAddressUtil;
 
-import static sun.tools.jconsole.Resources.*;
 import static sun.tools.jconsole.Utilities.*;
 
 @SuppressWarnings("serial")
@@ -68,7 +64,7 @@
                 try {
                     UIManager.setLookAndFeel(systemLaF);
                 } catch (Exception e) {
-                    System.err.println(Resources.getText("JConsole: ", e.getMessage()));
+                    System.err.println(Resources.format(Messages.JCONSOLE_COLON_, e.getMessage()));
                 }
             }
         }
@@ -87,7 +83,7 @@
 
 
     private final static String title =
-        Resources.getText("Java Monitoring & Management Console");
+        Messages.JAVA_MONITORING___MANAGEMENT_CONSOLE;
     public final static String ROOT_URL =
         "service:jmx:";
 
@@ -116,7 +112,7 @@
 
         setRootPane(new FixedJRootPane());
         setAccessibleDescription(this,
-                                 getText("JConsole.accessibleDescription"));
+                                 Messages.JCONSOLE_ACCESSIBLE_DESCRIPTION);
         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
 
         menuBar = new JMenuBar();
@@ -124,12 +120,12 @@
 
         // TODO: Use Actions !
 
-        JMenu connectionMenu = new JMenu(getText("Connection"));
-        connectionMenu.setMnemonic(getMnemonicInt("Connection"));
+        JMenu connectionMenu = new JMenu(Messages.CONNECTION);
+        connectionMenu.setMnemonic(Resources.getMnemonicInt(Messages.CONNECTION));
         menuBar.add(connectionMenu);
         if(hotspot) {
-            hotspotMI = new JMenuItem(getText("Hotspot MBeans..."));
-            hotspotMI.setMnemonic(getMnemonicInt("Hotspot MBeans..."));
+            hotspotMI = new JMenuItem(Messages.HOTSPOT_MBEANS_ELLIPSIS);
+            hotspotMI.setMnemonic(Resources.getMnemonicInt(Messages.HOTSPOT_MBEANS_ELLIPSIS));
             hotspotMI.setAccelerator(KeyStroke.
                                      getKeyStroke(KeyEvent.VK_H,
                                                   InputEvent.CTRL_MASK));
@@ -139,8 +135,8 @@
             connectionMenu.addSeparator();
         }
 
-        connectMI = new JMenuItem(Resources.getText("New Connection..."));
-        connectMI.setMnemonic(getMnemonicInt("New Connection..."));
+        connectMI = new JMenuItem(Messages.NEW_CONNECTION_ELLIPSIS);
+        connectMI.setMnemonic(Resources.getMnemonicInt(Messages.NEW_CONNECTION_ELLIPSIS));
         connectMI.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N,
                                                         InputEvent.CTRL_MASK));
         connectMI.addActionListener(this);
@@ -148,27 +144,27 @@
 
         connectionMenu.addSeparator();
 
-        exitMI = new JMenuItem(Resources.getText("Exit"));
-        exitMI.setMnemonic(getMnemonicInt("Exit"));
+        exitMI = new JMenuItem(Messages.EXIT);
+        exitMI.setMnemonic(Resources.getMnemonicInt(Messages.EXIT));
         exitMI.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F4,
                                                      InputEvent.ALT_MASK));
         exitMI.addActionListener(this);
         connectionMenu.add(exitMI);
 
 
-        JMenu helpMenu = new JMenu(getText("HelpMenu.title"));
-        helpMenu.setMnemonic(getMnemonicInt("HelpMenu.title"));
+        JMenu helpMenu = new JMenu(Messages.HELP_MENU_TITLE);
+        helpMenu.setMnemonic(Resources.getMnemonicInt(Messages.HELP_MENU_TITLE));
         menuBar.add(helpMenu);
 
         if (AboutDialog.isBrowseSupported()) {
-            userGuideMI = new JMenuItem(getText("HelpMenu.UserGuide.title"));
-            userGuideMI.setMnemonic(getMnemonicInt("HelpMenu.UserGuide.title"));
+            userGuideMI = new JMenuItem(Messages.HELP_MENU_USER_GUIDE_TITLE);
+            userGuideMI.setMnemonic(Resources.getMnemonicInt(Messages.HELP_MENU_USER_GUIDE_TITLE));
             userGuideMI.addActionListener(this);
             helpMenu.add(userGuideMI);
             helpMenu.addSeparator();
         }
-        aboutMI = new JMenuItem(getText("HelpMenu.About.title"));
-        aboutMI.setMnemonic(getMnemonicInt("HelpMenu.About.title"));
+        aboutMI = new JMenuItem(Messages.HELP_MENU_ABOUT_TITLE);
+        aboutMI.setMnemonic(Resources.getMnemonicInt(Messages.HELP_MENU_ABOUT_TITLE));
         aboutMI.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F1, 0));
         aboutMI.addActionListener(this);
         helpMenu.add(aboutMI);
@@ -191,8 +187,8 @@
             ((BorderLayout)cp.getLayout()).
             getLayoutComponent(BorderLayout.CENTER);
 
-        windowMenu = new WindowMenu(Resources.getText("Window"));
-        windowMenu.setMnemonic(getMnemonicInt("Window"));
+        windowMenu = new WindowMenu(Messages.WINDOW);
+        windowMenu.setMnemonic(Resources.getMnemonicInt(Messages.WINDOW));
         // Add Window menu before Help menu
         menuBar.add(windowMenu, menuBar.getComponentCount() - 1);
 
@@ -219,25 +215,25 @@
         WindowMenu(String text) {
             super(text);
 
-            cascadeMI = new JMenuItem(Resources.getText("Cascade"));
-            cascadeMI.setMnemonic(getMnemonicInt("Cascade"));
+            cascadeMI = new JMenuItem(Messages.CASCADE);
+            cascadeMI.setMnemonic(Resources.getMnemonicInt(Messages.CASCADE));
             cascadeMI.addActionListener(JConsole.this);
             add(cascadeMI);
 
-            tileMI = new JMenuItem(Resources.getText("Tile"));
-            tileMI.setMnemonic(getMnemonicInt("Tile"));
+            tileMI = new JMenuItem(Messages.TILE);
+            tileMI.setMnemonic(Resources.getMnemonicInt(Messages.TILE));
             tileMI.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_T,
                                                          InputEvent.CTRL_MASK));
             tileMI.addActionListener(JConsole.this);
             add(tileMI);
 
-            minimizeAllMI = new JMenuItem(Resources.getText("Minimize All"));
-            minimizeAllMI.setMnemonic(getMnemonicInt("Minimize All"));
+            minimizeAllMI = new JMenuItem(Messages.MINIMIZE_ALL);
+            minimizeAllMI.setMnemonic(Resources.getMnemonicInt(Messages.MINIMIZE_ALL));
             minimizeAllMI.addActionListener(JConsole.this);
             add(minimizeAllMI);
 
-            restoreAllMI = new JMenuItem(Resources.getText("Restore All"));
-            restoreAllMI.setMnemonic(getMnemonicInt("Restore All"));
+            restoreAllMI = new JMenuItem(Messages.RESTORE_ALL);
+            restoreAllMI.setMnemonic(Resources.getMnemonicInt(Messages.RESTORE_ALL));
             restoreAllMI.addActionListener(JConsole.this);
             add(restoreAllMI);
 
@@ -721,7 +717,7 @@
     }
 
     private String errorMessage(Exception ex) {
-       String msg = Resources.getText("Connection failed");
+       String msg = Messages.CONNECTION_FAILED;
        if (ex instanceof IOException || ex instanceof SecurityException) {
            Throwable cause = null;
            Throwable c = ex.getCause();
@@ -732,7 +728,7 @@
            if (cause instanceof ConnectException) {
                return msg + ": " + cause.getMessage();
            } else if (cause instanceof UnknownHostException) {
-               return Resources.getText("Unknown Host", cause.getMessage());
+               return Resources.format(Messages.UNKNOWN_HOST, cause.getMessage());
            } else if (cause instanceof NoRouteToHostException) {
                return msg + ": " + cause.getMessage();
            } else if (cause instanceof FailedLoginException) {
@@ -741,7 +737,7 @@
                return msg + ": "+ cause.getMessage();
            }
         } else if (ex instanceof MalformedURLException) {
-           return Resources.getText("Invalid URL", ex.getMessage());
+           return Resources.format(Messages.INVALID_URL, ex.getMessage());
         }
         return msg + ": " + ex.getMessage();
     }
@@ -770,7 +766,7 @@
 
 
     private static void usage() {
-        System.err.println(Resources.getText("zz usage text", "jconsole"));
+        System.err.println(Resources.format(Messages.ZZ_USAGE_TEXT, "jconsole"));
     }
 
     private static void mainInit(final List<String> urls,
@@ -1003,13 +999,13 @@
                 pluginService = plugins;
             } catch (ServiceConfigurationError e) {
                 // Error occurs during initialization of plugin
-                System.out.println(Resources.getText("Fail to load plugin",
+                System.out.println(Resources.format(Messages.FAIL_TO_LOAD_PLUGIN,
                                    e.getMessage()));
             } catch (MalformedURLException e) {
                 if (JConsole.isDebug()) {
                     e.printStackTrace();
                 }
-                System.out.println(Resources.getText("Invalid plugin path",
+                System.out.println(Resources.format(Messages.INVALID_PLUGIN_PATH,
                                    e.getMessage()));
             }
         }
--- a/src/share/classes/sun/tools/jconsole/LabeledComponent.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/LabeledComponent.java	Fri Jun 21 19:11:42 2013 -0700
@@ -26,7 +26,6 @@
 package sun.tools.jconsole;
 
 import java.awt.*;
-import java.awt.event.*;
 
 import javax.swing.*;
 
--- a/src/share/classes/sun/tools/jconsole/LocalVirtualMachine.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/LocalVirtualMachine.java	Fri Jun 21 19:11:42 2013 -0700
@@ -39,7 +39,6 @@
 // Sun private
 import sun.management.ConnectorAddressLink;
 import sun.jvmstat.monitor.HostIdentifier;
-import sun.jvmstat.monitor.Monitor;
 import sun.jvmstat.monitor.MonitoredHost;
 import sun.jvmstat.monitor.MonitoredVm;
 import sun.jvmstat.monitor.MonitoredVmUtil;
@@ -131,7 +130,7 @@
 
     private static void getMonitoredVMs(Map<Integer, LocalVirtualMachine> map) {
         MonitoredHost host;
-        Set vms;
+        Set<Integer> vms;
         try {
             host = MonitoredHost.getMonitoredHost(new HostIdentifier((String)null));
             vms = host.activeVms();
--- a/src/share/classes/sun/tools/jconsole/MBeansTab.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/MBeansTab.java	Fri Jun 21 19:11:42 2013 -0700
@@ -52,7 +52,7 @@
     private XDataViewer viewer;
 
     public static String getTabName() {
-        return Resources.getText("MBeans");
+        return Messages.MBEANS;
     }
 
     public MBeansTab(final VMPanel vmPanel) {
--- a/src/share/classes/sun/tools/jconsole/MaximizableInternalFrame.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/MaximizableInternalFrame.java	Fri Jun 21 19:11:42 2013 -0700
@@ -222,7 +222,7 @@
     static {
         if (JConsole.IS_WIN) {
             try {
-                Class Part =
+                Class<?> Part =
                     Class.forName("com.sun.java.swing.plaf.windows.TMSchema$Part");
                 if (Part != null) {
                     WP_MINBUTTON        = Part.getField("WP_MINBUTTON").get(null);
--- a/src/share/classes/sun/tools/jconsole/MemoryPoolProxy.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/MemoryPoolProxy.java	Fri Jun 21 19:11:42 2013 -0700
@@ -26,7 +26,6 @@
 package sun.tools.jconsole;
 
 import javax.management.ObjectName;
-import java.lang.management.ManagementFactory;
 import java.lang.management.MemoryPoolMXBean;
 import java.lang.management.MemoryUsage;
 import com.sun.management.GarbageCollectorMXBean;
@@ -34,21 +33,18 @@
 import java.util.HashMap;
 import java.util.Set;
 import java.util.Map;
-import java.util.Map.Entry;
 
 import static java.lang.management.ManagementFactory.*;
 
 public class MemoryPoolProxy {
     private String poolName;
     private ProxyClient client;
-    private ObjectName  objName;
     private MemoryPoolMXBean pool;
     private Map<ObjectName,Long> gcMBeans;
     private GcInfo lastGcInfo;
 
     public MemoryPoolProxy(ProxyClient client, ObjectName poolName) throws java.io.IOException {
         this.client = client;
-        this.objName = objName;
         this.pool = client.getMXBean(poolName, MemoryPoolMXBean.class);
         this.poolName = this.pool.getName();
         this.gcMBeans = new HashMap<ObjectName,Long>();
@@ -73,10 +69,6 @@
         return (gcMBeans.size() != 0);
     }
 
-    public ObjectName getObjectName() {
-        return objName;
-    }
-
     public MemoryPoolStat getStat() throws java.io.IOException {
         long usageThreshold = (pool.isUsageThresholdSupported()
                                   ? pool.getUsageThreshold()
--- a/src/share/classes/sun/tools/jconsole/MemoryPoolStat.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/MemoryPoolStat.java	Fri Jun 21 19:11:42 2013 -0700
@@ -129,6 +129,6 @@
      * null if no GC occurs.
      */
     public MemoryUsage getAfterGcUsage() {
-        return beforeGcUsage;
+        return afterGcUsage;
     }
 }
--- a/src/share/classes/sun/tools/jconsole/MemoryTab.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/MemoryTab.java	Fri Jun 21 19:11:42 2013 -0700
@@ -38,18 +38,14 @@
 import javax.management.openmbean.CompositeData;
 import javax.swing.*;
 import javax.swing.border.*;
-import javax.swing.text.*;
 
-import sun.management.*;
 
 import static sun.tools.jconsole.Formatter.*;
-import static sun.tools.jconsole.OverviewPanel.*;
-import static sun.tools.jconsole.Resources.*;
 import static sun.tools.jconsole.Utilities.*;
 
 @SuppressWarnings("serial")
 class MemoryTab extends Tab implements ActionListener, ItemListener {
-    JComboBox plotterChoice;
+    JComboBox<Plotter> plotterChoice;
     TimeComboBox timeComboBox;
     JButton gcButton;
 
@@ -67,19 +63,11 @@
     private static final String committedKey   = "committed";
     private static final String maxKey         = "max";
     private static final String thresholdKey   = "threshold";
-
-    private static final String usedName        = Resources.getText("Used");
-    private static final String committedName   = Resources.getText("Committed");
-    private static final String maxName         = Resources.getText("Max");
-    private static final String thresholdName   = Resources.getText("Threshold");
-
     private static final Color  usedColor      = Plotter.defaultColor;
     private static final Color  committedColor = null;
     private static final Color  maxColor       = null;
     private static final Color  thresholdColor = Color.red;
 
-    private static final String infoLabelFormat = "MemoryTab.infoLabelFormat";
-
     /*
       Hierarchy of panels and layouts for this tab:
 
@@ -105,7 +93,7 @@
 
 
     public static String getTabName() {
-        return getText("Memory");
+        return Messages.MEMORY;
     }
 
     public MemoryTab(VMPanel vmPanel) {
@@ -125,32 +113,32 @@
         topPanel.add(controlPanel, BorderLayout.CENTER);
 
         // Plotter choice
-        plotterChoice = new JComboBox();
+        plotterChoice = new JComboBox<Plotter>();
         plotterChoice.addItemListener(this);
-        controlPanel.add(new LabeledComponent(getText("Chart:"),
-                                              getMnemonicInt("Chart:"),
+        controlPanel.add(new LabeledComponent(Messages.CHART_COLON,
+                                              Resources.getMnemonicInt(Messages.CHART_COLON),
                                               plotterChoice));
 
         // Range control
         timeComboBox = new TimeComboBox();
-        controlPanel.add(new LabeledComponent(getText("Time Range:"),
-                                              getMnemonicInt("Time Range:"),
+        controlPanel.add(new LabeledComponent(Messages.TIME_RANGE_COLON,
+                                              Resources.getMnemonicInt(Messages.TIME_RANGE_COLON),
                                               timeComboBox));
 
-        gcButton = new JButton(getText("Perform GC"));
-        gcButton.setMnemonic(getMnemonicInt("Perform GC"));
+        gcButton = new JButton(Messages.PERFORM_GC);
+        gcButton.setMnemonic(Resources.getMnemonicInt(Messages.PERFORM_GC));
         gcButton.addActionListener(this);
-        gcButton.setToolTipText(getText("Perform GC.toolTip"));
+        gcButton.setToolTipText(Messages.PERFORM_GC_TOOLTIP);
         JPanel topRightPanel = new JPanel();
         topRightPanel.setBorder(new EmptyBorder(0, 65-8, 0, 70));
         topRightPanel.add(gcButton);
         topPanel.add(topRightPanel, BorderLayout.AFTER_LINE_ENDS);
 
-        bottomPanel.setBorder(new CompoundBorder(new TitledBorder(getText("Details")),
+        bottomPanel.setBorder(new CompoundBorder(new TitledBorder(Messages.DETAILS),
                                                   new EmptyBorder(10, 10, 10, 10)));
 
         details = new HTMLPane();
-        setAccessibleName(details, getText("Details"));
+        setAccessibleName(details, Messages.DETAILS);
         bottomPanel.add(new JScrollPane(details), BorderLayout.CENTER);
 
         poolChart = new PoolChart();
@@ -165,31 +153,31 @@
 
         heapPlotter = new Plotter(Plotter.Unit.BYTES) {
             public String toString() {
-                return Resources.getText("Heap Memory Usage");
+                return Messages.HEAP_MEMORY_USAGE;
             }
         };
         proxyClient.addWeakPropertyChangeListener(heapPlotter);
 
         nonHeapPlotter = new Plotter(Plotter.Unit.BYTES) {
             public String toString() {
-                return Resources.getText("Non-Heap Memory Usage");
+                return Messages.NON_HEAP_MEMORY_USAGE;
             }
         };
 
         setAccessibleName(heapPlotter,
-                          getText("MemoryTab.heapPlotter.accessibleName"));
+                          Messages.MEMORY_TAB_HEAP_PLOTTER_ACCESSIBLE_NAME);
         setAccessibleName(nonHeapPlotter,
-                          getText("MemoryTab.nonHeapPlotter.accessibleName"));
+                          Messages.MEMORY_TAB_NON_HEAP_PLOTTER_ACCESSIBLE_NAME);
 
         proxyClient.addWeakPropertyChangeListener(nonHeapPlotter);
 
-        heapPlotter.createSequence(usedKey,         usedName,      usedColor,      true);
-        heapPlotter.createSequence(committedKey,    committedName, committedColor, false);
-        heapPlotter.createSequence(maxKey,          maxName,       maxColor,       false);
+        heapPlotter.createSequence(usedKey,         Messages.USED,      usedColor,      true);
+        heapPlotter.createSequence(committedKey,    Messages.COMMITTED, committedColor, false);
+        heapPlotter.createSequence(maxKey,          Messages.MAX,       maxColor,       false);
 
-        nonHeapPlotter.createSequence(usedKey,      usedName,      usedColor,      true);
-        nonHeapPlotter.createSequence(committedKey, committedName, committedColor, false);
-        nonHeapPlotter.createSequence(maxKey,       maxName,       maxColor,       false);
+        nonHeapPlotter.createSequence(usedKey,      Messages.USED,      usedColor,      true);
+        nonHeapPlotter.createSequence(committedKey, Messages.COMMITTED, committedColor, false);
+        nonHeapPlotter.createSequence(maxKey,       Messages.MAX,       maxColor,       false);
 
         plotterList.add(heapPlotter);
         plotterList.add(nonHeapPlotter);
@@ -202,8 +190,8 @@
         for (ObjectName objectName : objectNames) {
             String type = objectName.getKeyProperty("type");
             if (type.equals("MemoryPool")) {
-                String name = getText("MemoryPoolLabel",
-                                      objectName.getKeyProperty("name"));
+                String name = Resources.format(Messages.MEMORY_POOL_LABEL,
+                                               objectName.getKeyProperty("name"));
                 // Heap or non-heap?
                 boolean isHeap = false;
                 AttributeList al =
@@ -215,10 +203,10 @@
                 PoolPlotter poolPlotter = new PoolPlotter(objectName, name, isHeap);
                 proxyClient.addWeakPropertyChangeListener(poolPlotter);
 
-                poolPlotter.createSequence(usedKey,      usedName,      usedColor,      true);
-                poolPlotter.createSequence(committedKey, committedName, committedColor, false);
-                poolPlotter.createSequence(maxKey,       maxName,       maxColor,       false);
-                poolPlotter.createSequence(thresholdKey, thresholdName, thresholdColor, false);
+                poolPlotter.createSequence(usedKey,      Messages.USED,      usedColor,      true);
+                poolPlotter.createSequence(committedKey, Messages.COMMITTED, committedColor, false);
+                poolPlotter.createSequence(maxKey,       Messages.MAX,       maxColor,       false);
+                poolPlotter.createSequence(thresholdKey, Messages.THRESHOLD, thresholdColor, false);
                 poolPlotter.setUseDashedTransitions(thresholdKey, true);
 
                 if (isHeap) {
@@ -286,7 +274,6 @@
                 max       = new long[n];
                 threshold = new long[n];
                 timeStamp = System.currentTimeMillis();
-                int poolCount = 0;
 
                 for (int i = 0; i < n; i++) {
                     Plotter plotter = plotterList.get(i);
@@ -400,22 +387,22 @@
         //long time = plotter.getLastTimeStamp();
         long time = System.currentTimeMillis();
         String timeStamp = formatDateTime(time);
-        text += newRow(getText("Time"), timeStamp);
+        text += newRow(Messages.TIME, timeStamp);
 
         long used = plotter.getLastValue(usedKey);
         long committed = plotter.getLastValue(committedKey);
         long max = plotter.getLastValue(maxKey);
         long threshold = plotter.getLastValue(thresholdKey);
 
-        text += newRow(getText("Used"), formatKBytes(used));
+        text += newRow(Messages.USED, formatKBytes(used));
         if (committed > 0L) {
-            text += newRow(getText("Committed"), formatKBytes(committed));
+            text += newRow(Messages.COMMITTED, formatKBytes(committed));
         }
         if (max > 0L) {
-            text += newRow(getText("Max"), formatKBytes(max));
+            text += newRow(Messages.MAX, formatKBytes(max));
         }
         if (threshold > 0L) {
-            text += newRow(getText("Usage Threshold"), formatKBytes(threshold));
+            text += newRow(Messages.USAGE_THRESHOLD, formatKBytes(threshold));
         }
 
         try {
@@ -427,11 +414,11 @@
                 String gcName = garbageCollectorMBean.getName();
                 long gcCount = garbageCollectorMBean.getCollectionCount();
                 long gcTime = garbageCollectorMBean.getCollectionTime();
-                String str = getText("GC time details", justify(formatTime(gcTime), 14),
-                                     gcName,
-                                     String.format("%,d",gcCount));
+                String str = Resources.format(Messages.GC_TIME_DETAILS, justify(formatTime(gcTime), 14),
+                                              gcName,
+                                              String.format("%,d",gcCount));
                 if (!descPrinted) {
-                    text += newRow(getText("GC time"), str);
+                    text += newRow(Messages.GC_TIME, str);
                     descPrinted = true;
                 } else {
                     text += newRow(null, str);
@@ -465,8 +452,8 @@
             this.isHeap     = isHeap;
 
             setAccessibleName(this,
-                              getText("MemoryTab.poolPlotter.accessibleName",
-                                      name));
+                              Resources.format(Messages.MEMORY_TAB_POOL_PLOTTER_ACCESSIBLE_NAME,
+                                               name));
         }
 
 
@@ -627,7 +614,7 @@
             g.setColor(nonHeapColor);
             g.fillRect(nonHeapRect.x + 1, nonHeapRect.y + 1, nonHeapRect.width - 1, nonHeapRect.height - 1);
 
-            String str = getText("Heap");
+            String str = Messages.HEAP;
             int stringWidth = fm.stringWidth(str);
             int x = heapRect.x + (heapRect.width - stringWidth) / 2;
             int y = heapRect.y + heapRect.height - 6;
@@ -639,7 +626,7 @@
             g.setColor(Color.black);
             g.drawString(str, x, y);
 
-            str = getText("Non-Heap");
+            str = Messages.NON_HEAP;
             stringWidth = fm.stringWidth(str);
             x = nonHeapRect.x + (nonHeapRect.width - stringWidth) / 2;
             y = nonHeapRect.y + nonHeapRect.height - 6;
@@ -728,26 +715,26 @@
 
         protected class AccessiblePoolChart extends AccessibleJPanel {
             public String getAccessibleName() {
-                String name = getText("MemoryTab.poolChart.accessibleName");
+                String name = Messages.MEMORY_TAB_POOL_CHART_ACCESSIBLE_NAME;
 
                 String keyValueList = "";
                 for (PoolPlotter poolPlotter : poolPlotters) {
                     String value = (poolPlotter.value * 100 / poolPlotter.max) + "%";
                     // Assume format string ends with newline
                     keyValueList +=
-                        getText("Plotter.accessibleName.keyAndValue",
-                                poolPlotter.toString(), value);
+                        Resources.format(Messages.PLOTTER_ACCESSIBLE_NAME_KEY_AND_VALUE,
+                                         poolPlotter.toString(), value);
                     if (poolPlotter.threshold > 0L) {
                         String threshold =
                             (poolPlotter.threshold * 100 / poolPlotter.max) + "%";
                         if (poolPlotter.value > poolPlotter.threshold) {
                             keyValueList +=
-                                getText("MemoryTab.poolChart.aboveThreshold",
-                                        threshold);
+                               Resources.format(Messages.MEMORY_TAB_POOL_CHART_ABOVE_THRESHOLD,
+                                                threshold);
                         } else {
                             keyValueList +=
-                                getText("MemoryTab.poolChart.belowThreshold",
-                                        threshold);
+                                    Resources.format(Messages.MEMORY_TAB_POOL_CHART_BELOW_THRESHOLD,
+                                                     threshold);
                         }
                     }
                 }
@@ -767,14 +754,14 @@
 
     private static class MemoryOverviewPanel extends OverviewPanel {
         MemoryOverviewPanel() {
-            super(getText("Heap Memory Usage"), usedKey, usedName, Plotter.Unit.BYTES);
+            super(Messages.HEAP_MEMORY_USAGE, usedKey, Messages.USED, Plotter.Unit.BYTES);
         }
 
         private void updateMemoryInfo(long used, long committed, long max) {
-            getInfoLabel().setText(getText(infoLabelFormat,
-                                           formatBytes(used, true),
-                                           formatBytes(committed, true),
-                                           formatBytes(max, true)));
+            getInfoLabel().setText(Resources.format(Messages.MEMORY_TAB_INFO_LABEL_FORMAT,
+                                                    formatBytes(used, true),
+                                                    formatBytes(committed, true),
+                                                    formatBytes(max, true)));
         }
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/tools/jconsole/Messages.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,319 @@
+/*
+ * 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.  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.tools.jconsole;
+
+
+/**
+ * Class that contains localized messages.
+ *
+ */
+final public class Messages {
+    private static final String BUNDLE_NAME = "sun.tools.jconsole.resources.messages";
+
+    static {
+        Resources.initializeMessages(Messages.class, BUNDLE_NAME);
+    }
+    // TODO:
+    // The names of some of the constants below looks strange.
+    // That's because they  were generated programmatically
+    // from the messages. They should be cleaned up,
+    // ___ should be removed etc.
+    public static String ONE_DAY;
+    public static String ONE_HOUR;
+    public static String ONE_MIN;
+    public static String ONE_MONTH;
+    public static String ONE_YEAR;
+    public static String TWO_HOURS;
+    public static String THREE_HOURS;
+    public static String THREE_MONTHS;
+    public static String FIVE_MIN;
+    public static String SIX_HOURS;
+    public static String SIX_MONTHS;
+    public static String SEVEN_DAYS;
+    public static String TEN_MIN;
+    public static String TWELVE_HOURS;
+    public static String THIRTY_MIN;
+    public static String LESS_THAN;
+    public static String A_LOT_LESS_THAN;
+    public static String GREATER_THAN;
+    public static String ACTION_CAPITALIZED;
+    public static String ACTION_INFO_CAPITALIZED;
+    public static String ALL;
+    public static String ARCHITECTURE;
+    public static String ATTRIBUTE;
+    public static String ATTRIBUTE_VALUE;
+    public static String ATTRIBUTE_VALUES;
+    public static String ATTRIBUTES;
+    public static String BLANK;
+    public static String BLOCKED_COUNT_WAITED_COUNT;
+    public static String BOOT_CLASS_PATH;
+    public static String BORDERED_COMPONENT_MORE_OR_LESS_BUTTON_TOOLTIP;
+    public static String CPU_USAGE;
+    public static String CPU_USAGE_FORMAT;
+    public static String CANCEL;
+    public static String CASCADE;
+    public static String CHART_COLON;
+    public static String CLASS_PATH;
+    public static String CLASS_NAME;
+    public static String CLASS_TAB_INFO_LABEL_FORMAT;
+    public static String CLASS_TAB_LOADED_CLASSES_PLOTTER_ACCESSIBLE_NAME;
+    public static String CLASSES;
+    public static String CLOSE;
+    public static String COLUMN_NAME;
+    public static String COLUMN_PID;
+    public static String COMMITTED_MEMORY;
+    public static String COMMITTED_VIRTUAL_MEMORY;
+    public static String COMMITTED;
+    public static String CONNECT;
+    public static String CONNECT_DIALOG_CONNECT_BUTTON_TOOLTIP;
+    public static String CONNECT_DIALOG_ACCESSIBLE_DESCRIPTION;
+    public static String CONNECT_DIALOG_MASTHEAD_ACCESSIBLE_NAME;
+    public static String CONNECT_DIALOG_MASTHEAD_TITLE;
+    public static String CONNECT_DIALOG_STATUS_BAR_ACCESSIBLE_NAME;
+    public static String CONNECT_DIALOG_TITLE;
+    public static String CONNECTED_PUNCTUATION_CLICK_TO_DISCONNECT_;
+    public static String CONNECTION_FAILED;
+    public static String CONNECTION;
+    public static String CONNECTION_NAME;
+    public static String CONNECTION_NAME__DISCONNECTED_;
+    public static String CONSTRUCTOR;
+    public static String CURRENT_CLASSES_LOADED;
+    public static String CURRENT_HEAP_SIZE;
+    public static String CURRENT_VALUE;
+    public static String CREATE;
+    public static String DAEMON_THREADS;
+    public static String DISCONNECTED_PUNCTUATION_CLICK_TO_CONNECT_;
+    public static String DOUBLE_CLICK_TO_EXPAND_FORWARD_SLASH_COLLAPSE;
+    public static String DOUBLE_CLICK_TO_VISUALIZE;
+    public static String DESCRIPTION;
+    public static String DESCRIPTOR;
+    public static String DETAILS;
+    public static String DETECT_DEADLOCK;
+    public static String DETECT_DEADLOCK_TOOLTIP;
+    public static String DIMENSION_IS_NOT_SUPPORTED_COLON;
+    public static String DISCARD_CHART;
+    public static String DURATION_DAYS_HOURS_MINUTES;
+    public static String DURATION_HOURS_MINUTES;
+    public static String DURATION_MINUTES;
+    public static String DURATION_SECONDS;
+    public static String EMPTY_ARRAY;
+    public static String ERROR;
+    public static String ERROR_COLON_MBEANS_ALREADY_EXIST;
+    public static String ERROR_COLON_MBEANS_DO_NOT_EXIST;
+    public static String EVENT;
+    public static String EXIT;
+    public static String FAIL_TO_LOAD_PLUGIN;
+    public static String FILE_CHOOSER_FILE_EXISTS_CANCEL_OPTION;
+    public static String FILE_CHOOSER_FILE_EXISTS_MESSAGE;
+    public static String FILE_CHOOSER_FILE_EXISTS_OK_OPTION;
+    public static String FILE_CHOOSER_FILE_EXISTS_TITLE;
+    public static String FILE_CHOOSER_SAVED_FILE;
+    public static String FILE_CHOOSER_SAVE_FAILED_MESSAGE;
+    public static String FILE_CHOOSER_SAVE_FAILED_TITLE;
+    public static String FREE_PHYSICAL_MEMORY;
+    public static String FREE_SWAP_SPACE;
+    public static String GARBAGE_COLLECTOR;
+    public static String GC_INFO;
+    public static String GC_TIME;
+    public static String GC_TIME_DETAILS;
+    public static String HEAP_MEMORY_USAGE;
+    public static String HEAP;
+    public static String HELP_ABOUT_DIALOG_ACCESSIBLE_DESCRIPTION;
+    public static String HELP_ABOUT_DIALOG_JCONSOLE_VERSION;
+    public static String HELP_ABOUT_DIALOG_JAVA_VERSION;
+    public static String HELP_ABOUT_DIALOG_MASTHEAD_ACCESSIBLE_NAME;
+    public static String HELP_ABOUT_DIALOG_MASTHEAD_TITLE;
+    public static String HELP_ABOUT_DIALOG_TITLE;
+    public static String HELP_ABOUT_DIALOG_USER_GUIDE_LINK;
+    public static String HELP_ABOUT_DIALOG_USER_GUIDE_LINK_URL;
+    public static String HELP_MENU_ABOUT_TITLE;
+    public static String HELP_MENU_USER_GUIDE_TITLE;
+    public static String HELP_MENU_TITLE;
+    public static String HOTSPOT_MBEANS_ELLIPSIS;
+    public static String HOTSPOT_MBEANS_DIALOG_ACCESSIBLE_DESCRIPTION;
+    public static String IMPACT;
+    public static String INFO;
+    public static String INFO_CAPITALIZED;
+    public static String INVALID_PLUGIN_PATH;
+    public static String INVALID_URL;
+    public static String IS;
+    public static String JAVA_MONITORING___MANAGEMENT_CONSOLE;
+    public static String JCONSOLE_COLON_;
+    public static String JCONSOLE_VERSION; // in version template
+    public static String JCONSOLE_ACCESSIBLE_DESCRIPTION;
+    public static String JIT_COMPILER;
+    public static String LIBRARY_PATH;
+    public static String LIVE_THREADS;
+    public static String LOADED;
+    public static String LOCAL_PROCESS_COLON;
+    public static String MASTHEAD_FONT;
+    public static String MANAGEMENT_NOT_ENABLED;
+    public static String MANAGEMENT_WILL_BE_ENABLED;
+    public static String MBEAN_ATTRIBUTE_INFO;
+    public static String MBEAN_INFO;
+    public static String MBEAN_NOTIFICATION_INFO;
+    public static String MBEAN_OPERATION_INFO;
+    public static String MBEANS;
+    public static String MBEANS_TAB_CLEAR_NOTIFICATIONS_BUTTON;
+    public static String MBEANS_TAB_CLEAR_NOTIFICATIONS_BUTTON_TOOLTIP;
+    public static String MBEANS_TAB_COMPOSITE_NAVIGATION_MULTIPLE;
+    public static String MBEANS_TAB_COMPOSITE_NAVIGATION_SINGLE;
+    public static String MBEANS_TAB_REFRESH_ATTRIBUTES_BUTTON;
+    public static String MBEANS_TAB_REFRESH_ATTRIBUTES_BUTTON_TOOLTIP;
+    public static String MBEANS_TAB_SUBSCRIBE_NOTIFICATIONS_BUTTON;
+    public static String MBEANS_TAB_SUBSCRIBE_NOTIFICATIONS_BUTTON_TOOLTIP;
+    public static String MBEANS_TAB_TABULAR_NAVIGATION_MULTIPLE;
+    public static String MBEANS_TAB_TABULAR_NAVIGATION_SINGLE;
+    public static String MBEANS_TAB_UNSUBSCRIBE_NOTIFICATIONS_BUTTON;
+    public static String MBEANS_TAB_UNSUBSCRIBE_NOTIFICATIONS_BUTTON_TOOLTIP;
+    public static String MANAGE_HOTSPOT_MBEANS_IN_COLON_;
+    public static String MAX;
+    public static String MAXIMUM_HEAP_SIZE;
+    public static String MEMORY;
+    public static String MEMORY_POOL_LABEL;
+    public static String MEMORY_TAB_HEAP_PLOTTER_ACCESSIBLE_NAME;
+    public static String MEMORY_TAB_INFO_LABEL_FORMAT;
+    public static String MEMORY_TAB_NON_HEAP_PLOTTER_ACCESSIBLE_NAME;
+    public static String MEMORY_TAB_POOL_CHART_ABOVE_THRESHOLD;
+    public static String MEMORY_TAB_POOL_CHART_ACCESSIBLE_NAME;
+    public static String MEMORY_TAB_POOL_CHART_BELOW_THRESHOLD;
+    public static String MEMORY_TAB_POOL_PLOTTER_ACCESSIBLE_NAME;
+    public static String MESSAGE;
+    public static String METHOD_SUCCESSFULLY_INVOKED;
+    public static String MINIMIZE_ALL;
+    public static String MONITOR_LOCKED;
+    public static String NAME;
+    public static String NAME_STATE;
+    public static String NAME_STATE_LOCK_NAME;
+    public static String NAME_STATE_LOCK_NAME_LOCK_OWNER;
+    public static String NAME_AND_BUILD;// in version template
+    public static String NEW_CONNECTION_ELLIPSIS;
+    public static String NO_DEADLOCK_DETECTED;
+    public static String NON_HEAP_MEMORY_USAGE;
+    public static String NON_HEAP;
+    public static String NOTIFICATION;
+    public static String NOTIFICATION_BUFFER;
+    public static String NOTIFICATIONS;
+    public static String NOTIF_TYPES;
+    public static String NUMBER_OF_THREADS;
+    public static String NUMBER_OF_LOADED_CLASSES;
+    public static String NUMBER_OF_PROCESSORS;
+    public static String OBJECT_NAME;
+    public static String OPERATING_SYSTEM;
+    public static String OPERATION;
+    public static String OPERATION_INVOCATION;
+    public static String OPERATION_RETURN_VALUE;
+    public static String OPERATIONS;
+    public static String OVERVIEW;
+    public static String OVERVIEW_PANEL_PLOTTER_ACCESSIBLE_NAME;
+    public static String PARAMETER;
+    public static String PASSWORD_COLON_;
+    public static String PASSWORD_ACCESSIBLE_NAME;
+    public static String PEAK;
+    public static String PERFORM_GC;
+    public static String PERFORM_GC_TOOLTIP;
+    public static String PLOTTER_ACCESSIBLE_NAME;
+    public static String PLOTTER_ACCESSIBLE_NAME_KEY_AND_VALUE;
+    public static String PLOTTER_ACCESSIBLE_NAME_NO_DATA;
+    public static String PLOTTER_SAVE_AS_MENU_ITEM;
+    public static String PLOTTER_TIME_RANGE_MENU;
+    public static String PROBLEM_ADDING_LISTENER;
+    public static String PROBLEM_DISPLAYING_MBEAN;
+    public static String PROBLEM_INVOKING;
+    public static String PROBLEM_REMOVING_LISTENER;
+    public static String PROBLEM_SETTING_ATTRIBUTE;
+    public static String PROCESS_CPU_TIME;
+    public static String READABLE;
+    public static String RECONNECT;
+    public static String INSECURE;
+    public static String REMOTE_PROCESS_COLON;
+    public static String REMOTE_PROCESS_TEXT_FIELD_ACCESSIBLE_NAME;
+    public static String RESTORE_ALL;
+    public static String RETURN_TYPE;
+    public static String SEQ_NUM;
+    public static String SIZE_BYTES;
+    public static String SIZE_GB;
+    public static String SIZE_KB;
+    public static String SIZE_MB;
+    public static String SOURCE;
+    public static String STACK_TRACE;
+    public static String SUMMARY_TAB_HEADER_DATE_TIME_FORMAT;
+    public static String SUMMARY_TAB_PENDING_FINALIZATION_LABEL;
+    public static String SUMMARY_TAB_PENDING_FINALIZATION_VALUE;
+    public static String SUMMARY_TAB_TAB_NAME;
+    public static String SUMMARY_TAB_VM_VERSION;
+    public static String THREADS;
+    public static String THREAD_TAB_THREAD_INFO_ACCESSIBLE_NAME;
+    public static String THREAD_TAB_THREAD_PLOTTER_ACCESSIBLE_NAME;
+    public static String THRESHOLD;
+    public static String TILE;
+    public static String TIME_RANGE_COLON;
+    public static String TIME;
+    public static String TIME_STAMP;
+    public static String TOTAL_LOADED;
+    public static String TOTAL_CLASSES_LOADED;
+    public static String TOTAL_CLASSES_UNLOADED;
+    public static String TOTAL_COMPILE_TIME;
+    public static String TOTAL_PHYSICAL_MEMORY;
+    public static String TOTAL_THREADS_STARTED;
+    public static String TOTAL_SWAP_SPACE;
+    public static String TYPE;
+    public static String UNAVAILABLE;
+    public static String UNKNOWN_CAPITALIZED;
+    public static String UNKNOWN_HOST;
+    public static String UNREGISTER;
+    public static String UPTIME;
+    public static String USAGE_THRESHOLD;
+    public static String REMOTE_TF_USAGE;
+    public static String USED;
+    public static String USERNAME_COLON_;
+    public static String USERNAME_ACCESSIBLE_NAME;
+    public static String USER_DATA;
+    public static String VIRTUAL_MACHINE;
+    public static String VM_ARGUMENTS;
+    public static String VMINTERNAL_FRAME_ACCESSIBLE_DESCRIPTION;
+    public static String VALUE;
+    public static String VENDOR;
+    public static String VERBOSE_OUTPUT;
+    public static String VERBOSE_OUTPUT_TOOLTIP;
+    public static String VIEW;
+    public static String WINDOW;
+    public static String WINDOWS;
+    public static String WRITABLE;
+    public static String CONNECTION_FAILED1;
+    public static String CONNECTION_FAILED2;
+    public static String CONNECTION_LOST1;
+    public static String CONNECTION_INSECURE1;
+    public static String CONNECTION_INSECURE2;
+    public static String CONNECTING_TO1;
+    public static String CONNECTING_TO2;
+    public static String DEADLOCK_TAB;
+    public static String DEADLOCK_TAB_N;
+    public static String EXPAND;
+    public static String KBYTES;
+    public static String PLOT;
+    public static String VISUALIZE;
+    public static String ZZ_USAGE_TEXT;
+}
--- a/src/share/classes/sun/tools/jconsole/OverviewPanel.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/OverviewPanel.java	Fri Jun 21 19:11:42 2013 -0700
@@ -26,14 +26,12 @@
 package sun.tools.jconsole;
 
 import java.awt.*;
-import java.awt.event.*;
 
 import javax.swing.*;
-import javax.swing.border.*;
+
 
 import static javax.swing.SwingConstants.*;
 import static sun.tools.jconsole.JConsole.*;
-import static sun.tools.jconsole.Resources.*;
 import static sun.tools.jconsole.Utilities.*;
 
 
@@ -68,7 +66,7 @@
             }
             plotter.createSequence(plotterKey, plotterName, PLOTTER_COLOR, true);
             setAccessibleName(plotter,
-                              getText("OverviewPanel.plotter.accessibleName",
+                              Resources.format(Messages.OVERVIEW_PANEL_PLOTTER_ACCESSIBLE_NAME,
                                       title));
             setPlotter(plotter);
         }
--- a/src/share/classes/sun/tools/jconsole/OverviewTab.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/OverviewTab.java	Fri Jun 21 19:11:42 2013 -0700
@@ -26,15 +26,11 @@
 package sun.tools.jconsole;
 
 import java.awt.*;
-import java.lang.reflect.InvocationTargetException;
 import java.util.ArrayList;
 
 import javax.swing.*;
 import javax.swing.border.*;
 
-import static sun.tools.jconsole.JConsole.*;
-import static sun.tools.jconsole.Resources.*;
-
 
 @SuppressWarnings("serial")
 class OverviewTab extends Tab {
@@ -42,7 +38,7 @@
     TimeComboBox timeComboBox;
 
     public static String getTabName() {
-        return getText("Overview");
+        return Messages.OVERVIEW;
     }
 
     public OverviewTab(VMPanel vmPanel) {
@@ -58,8 +54,8 @@
         topPanel.add(controlPanel, BorderLayout.CENTER);
 
         timeComboBox = new TimeComboBox();
-        LabeledComponent lc = new LabeledComponent(Resources.getText("Time Range:"),
-                                                   getMnemonicInt("Time Range:"),
+        LabeledComponent lc = new LabeledComponent(Messages.TIME_RANGE_COLON,
+                                                   Resources.getMnemonicInt(Messages.TIME_RANGE_COLON),
                                                    timeComboBox);
         controlPanel.add(lc);
 
--- a/src/share/classes/sun/tools/jconsole/Plotter.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/Plotter.java	Fri Jun 21 19:11:42 2013 -0700
@@ -38,14 +38,11 @@
 import javax.swing.filechooser.*;
 import javax.swing.filechooser.FileFilter;
 
+
 import com.sun.tools.jconsole.JConsoleContext;
 
-import static com.sun.tools.jconsole.JConsoleContext.ConnectionState.*;
-
 import static sun.tools.jconsole.Formatter.*;
 import static sun.tools.jconsole.ProxyClient.*;
-import static sun.tools.jconsole.Resources.*;
-import static sun.tools.jconsole.Utilities.*;
 
 @SuppressWarnings("serial")
 public class Plotter extends JComponent
@@ -56,22 +53,22 @@
     }
 
     static final String[] rangeNames = {
-        Resources.getText(" 1 min"),
-        Resources.getText(" 5 min"),
-        Resources.getText("10 min"),
-        Resources.getText("30 min"),
-        Resources.getText(" 1 hour"),
-        Resources.getText(" 2 hours"),
-        Resources.getText(" 3 hours"),
-        Resources.getText(" 6 hours"),
-        Resources.getText("12 hours"),
-        Resources.getText(" 1 day"),
-        Resources.getText(" 7 days"),
-        Resources.getText(" 1 month"),
-        Resources.getText(" 3 months"),
-        Resources.getText(" 6 months"),
-        Resources.getText(" 1 year"),
-        Resources.getText("All")
+        Messages.ONE_MIN,
+        Messages.FIVE_MIN,
+        Messages.TEN_MIN,
+        Messages.THIRTY_MIN,
+        Messages.ONE_HOUR,
+        Messages.TWO_HOURS,
+        Messages.THREE_HOURS,
+        Messages.SIX_HOURS,
+        Messages.TWELVE_HOURS,
+        Messages.ONE_DAY,
+        Messages.SEVEN_DAYS,
+        Messages.ONE_MONTH,
+        Messages.THREE_MONTHS,
+        Messages.SIX_MONTHS,
+        Messages.ONE_YEAR,
+        Messages.ALL
     };
 
     static final int[] rangeValues = {
@@ -247,9 +244,9 @@
     @Override
     public JPopupMenu getComponentPopupMenu() {
         if (popupMenu == null) {
-            popupMenu = new JPopupMenu(Resources.getText("Chart:"));
-            timeRangeMenu = new JMenu(Resources.getText("Plotter.timeRangeMenu"));
-            timeRangeMenu.setMnemonic(getMnemonicInt("Plotter.timeRangeMenu"));
+            popupMenu = new JPopupMenu(Messages.CHART_COLON);
+            timeRangeMenu = new JMenu(Messages.PLOTTER_TIME_RANGE_MENU);
+            timeRangeMenu.setMnemonic(Resources.getMnemonicInt(Messages.PLOTTER_TIME_RANGE_MENU));
             popupMenu.add(timeRangeMenu);
             menuRBs = new JRadioButtonMenuItem[rangeNames.length];
             ButtonGroup rbGroup = new ButtonGroup();
@@ -265,8 +262,8 @@
 
             popupMenu.addSeparator();
 
-            saveAsMI = new JMenuItem(getText("Plotter.saveAsMenuItem"));
-            saveAsMI.setMnemonic(getMnemonicInt("Plotter.saveAsMenuItem"));
+            saveAsMI = new JMenuItem(Messages.PLOTTER_SAVE_AS_MENU_ITEM);
+            saveAsMI.setMnemonic(Resources.getMnemonicInt(Messages.PLOTTER_SAVE_AS_MENU_ITEM));
             saveAsMI.addActionListener(this);
             popupMenu.add(saveAsMI);
         }
@@ -318,9 +315,9 @@
 
             out.close();
             JOptionPane.showMessageDialog(this,
-                                          getText("FileChooser.savedFile",
-                                                  file.getAbsolutePath(),
-                                                  file.length()));
+                                          Resources.format(Messages.FILE_CHOOSER_SAVED_FILE,
+                                                           file.getAbsolutePath(),
+                                                           file.length()));
         } catch (IOException ex) {
             String msg = ex.getLocalizedMessage();
             String path = file.getAbsolutePath();
@@ -328,9 +325,10 @@
                 msg = msg.substring(path.length()).trim();
             }
             JOptionPane.showMessageDialog(this,
-                                          getText("FileChooser.saveFailed.message",
-                                                  path, msg),
-                                          getText("FileChooser.saveFailed.title"),
+                                          Resources.format(Messages.FILE_CHOOSER_SAVE_FAILED_MESSAGE,
+                                                           path,
+                                                           msg),
+                                          Messages.FILE_CHOOSER_SAVE_FAILED_TITLE,
                                           JOptionPane.ERROR_MESSAGE);
         }
     }
@@ -1020,13 +1018,13 @@
                 }
 
                 if (file.exists()) {
-                    String okStr = getText("FileChooser.fileExists.okOption");
-                    String cancelStr = getText("FileChooser.fileExists.cancelOption");
+                    String okStr = Messages.FILE_CHOOSER_FILE_EXISTS_OK_OPTION;
+                    String cancelStr = Messages.FILE_CHOOSER_FILE_EXISTS_CANCEL_OPTION;
                     int ret =
                         JOptionPane.showOptionDialog(this,
-                                                     getText("FileChooser.fileExists.message",
-                                                             file.getName()),
-                                                     getText("FileChooser.fileExists.title"),
+                                                     Resources.format(Messages.FILE_CHOOSER_FILE_EXISTS_MESSAGE,
+                                                                      file.getName()),
+                                                     Messages.FILE_CHOOSER_FILE_EXISTS_TITLE,
                                                      JOptionPane.OK_CANCEL_OPTION,
                                                      JOptionPane.WARNING_MESSAGE,
                                                      null,
@@ -1053,7 +1051,7 @@
     protected class AccessiblePlotter extends AccessibleJComponent {
         private static final long serialVersionUID = -3847205410473510922L;
         protected AccessiblePlotter() {
-            setAccessibleName(getText("Plotter.accessibleName"));
+            setAccessibleName(Messages.PLOTTER_ACCESSIBLE_NAME);
         }
 
         @Override
@@ -1067,7 +1065,7 @@
                         String value = "null";
                         if (seq.size > 0) {
                             if (unit == Unit.BYTES) {
-                                value = getText("Size Bytes", seq.value(seq.size - 1));
+                                value = Resources.format(Messages.SIZE_BYTES, seq.value(seq.size - 1));
                             } else {
                                 value =
                                     getFormattedValue(seq.value(seq.size - 1), false) +
@@ -1076,13 +1074,13 @@
                         }
                         // Assume format string ends with newline
                         keyValueList +=
-                            getText("Plotter.accessibleName.keyAndValue",
+                            Resources.format(Messages.PLOTTER_ACCESSIBLE_NAME_KEY_AND_VALUE,
                                     seq.key, value);
                     }
                 }
                 name += "\n" + keyValueList + ".";
             } else {
-                name += "\n" + getText("Plotter.accessibleName.noData");
+                name += "\n" + Messages.PLOTTER_ACCESSIBLE_NAME_NO_DATA;
             }
             return name;
         }
--- a/src/share/classes/sun/tools/jconsole/PlotterPanel.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/PlotterPanel.java	Fri Jun 21 19:11:42 2013 -0700
@@ -25,7 +25,6 @@
 
 package sun.tools.jconsole;
 
-import java.awt.*;
 import java.awt.event.*;
 
 import javax.accessibility.*;
--- a/src/share/classes/sun/tools/jconsole/ProxyClient.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/ProxyClient.java	Fri Jun 21 19:11:42 2013 -0700
@@ -27,7 +27,6 @@
 
 import com.sun.management.HotSpotDiagnosticMXBean;
 import com.sun.tools.jconsole.JConsoleContext;
-import com.sun.tools.jconsole.JConsoleContext.ConnectionState;
 import java.beans.PropertyChangeListener;
 import java.beans.PropertyChangeEvent;
 import java.io.IOException;
@@ -515,7 +514,7 @@
 
     public String toString() {
         if (!isConnected()) {
-            return Resources.getText("ConnectionName (disconnected)", displayName);
+            return Resources.format(Messages.CONNECTION_NAME__DISCONNECTED_, displayName);
         } else {
             return displayName;
         }
@@ -606,10 +605,10 @@
                 assert(false);
             }
         }
-        Set mbeans = server.queryNames(name, null);
+        Set<ObjectName> mbeans = server.queryNames(name, null);
         Map<ObjectName,MBeanInfo> result =
             new HashMap<ObjectName,MBeanInfo>(mbeans.size());
-        Iterator iterator = mbeans.iterator();
+        Iterator<ObjectName> iterator = mbeans.iterator();
         while (iterator.hasNext()) {
             Object object = iterator.next();
             if (object instanceof ObjectName) {
@@ -715,10 +714,10 @@
                 // should not reach here
                 assert(false);
             }
-            Set mbeans = server.queryNames(poolName, null);
+            Set<ObjectName> mbeans = server.queryNames(poolName, null);
             if (mbeans != null) {
                 memoryPoolProxies = new ArrayList<MemoryPoolProxy>();
-                Iterator iterator = mbeans.iterator();
+                Iterator<ObjectName> iterator = mbeans.iterator();
                 while (iterator.hasNext()) {
                     ObjectName objName = (ObjectName) iterator.next();
                     MemoryPoolProxy p = new MemoryPoolProxy(this, objName);
@@ -741,10 +740,10 @@
                 // should not reach here
                 assert(false);
             }
-            Set mbeans = server.queryNames(gcName, null);
+            Set<ObjectName> mbeans = server.queryNames(gcName, null);
             if (mbeans != null) {
                 garbageCollectorMBeans = new ArrayList<GarbageCollectorMXBean>();
-                Iterator iterator = mbeans.iterator();
+                Iterator<ObjectName> iterator = mbeans.iterator();
                 while (iterator.hasNext()) {
                     ObjectName on = (ObjectName) iterator.next();
                     String name = GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE +
--- a/src/share/classes/sun/tools/jconsole/Resources.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/Resources.java	Fri Jun 21 19:11:42 2013 -0700
@@ -25,89 +25,185 @@
 
 package sun.tools.jconsole;
 
+import java.awt.event.KeyEvent;
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
 import java.text.MessageFormat;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
 import java.util.MissingResourceException;
 import java.util.ResourceBundle;
 
-import sun.tools.jconsole.resources.JConsoleResources;
-
 /**
- * Provides resource support for jconsole.
+ * Toolkit that provides resource support for JConsole.
  */
 public final class Resources {
+    private static Map<String, Integer> MNEMONIC_LOOKUP = Collections
+            .synchronizedMap(new HashMap<String, Integer>());
 
-    private static final Object lock = new Object();
-    private static JConsoleResources resources = null;
-    static {
+    private Resources() {
+        throw new AssertionError();
+    }
+
+    /**
+     * Convenience method for {@link MessageFormat#format(String, Object...)}.
+     *
+     * @param pattern the pattern
+     * @param objects the arguments for the pattern
+     *
+     * @return a formatted string
+     */
+    public static String format(String pattern, Object... arguments) {
+            return MessageFormat.format(pattern, arguments);
+    }
+
+    /**
+     * Returns the mnemonic for a message.
+     *
+     * @param message the message
+     *
+     * @return the mnemonic <code>int</code>
+     */
+    public static int getMnemonicInt(String message) {
+        Integer integer = MNEMONIC_LOOKUP.get(message);
+        if (integer != null) {
+            return integer.intValue();
+        }
+        return 0;
+    }
+
+    /**
+     * Initializes all non-final public static fields in the given class with
+     * messages from a {@link ResourceBundle}.
+     *
+     * @param clazz the class containing the fields
+     */
+    public static void initializeMessages(Class<?> clazz, String rbName) {
+        ResourceBundle rb = null;
         try {
-            resources =
-                (JConsoleResources)ResourceBundle.getBundle("sun.tools.jconsole.resources.JConsoleResources");
-        } catch (MissingResourceException e) {
-            // gracefully handle this later
+            rb = ResourceBundle.getBundle(rbName);
+        } catch (MissingResourceException mre) {
+            // fall through, handled later
+        }
+        for (Field field : clazz.getFields()) {
+            if (isWritableField(field)) {
+                String key = field.getName();
+                String message = getMessage(rb, key);
+                int mnemonicInt = findMnemonicInt(message);
+                message = removeMnemonicAmpersand(message);
+                message = replaceWithPlatformLineFeed(message);
+                setFieldValue(field, message);
+                MNEMONIC_LOOKUP.put(message, mnemonicInt);
+            }
         }
     }
 
-    private Resources() { throw new AssertionError(); }
+    private static boolean isWritableField(Field field) {
+        int modifiers = field.getModifiers();
+        return Modifier.isPublic(modifiers) && Modifier.isStatic(modifiers)
+                && !Modifier.isFinal(modifiers);
+    }
 
     /**
-     * Returns the text of the jconsole resource for the specified key
-     * formatted with the specified arguments.
+     * Returns the message corresponding to the key in the bundle or a text
+     * describing it's missing.
      *
+     * @param rb the resource bundle
+     * @param key the key
+     *
+     * @return the message
      */
-    public static String getText(String key, Object... args) {
-        String format = getString(key);
-        if (format == null) {
-            format = "missing resource key: key = \"" + key + "\", " +
-                "arguments = \"{0}\", \"{1}\", \"{2}\"";
+    private static String getMessage(ResourceBundle rb, String key) {
+        if (rb == null) {
+            return "missing resource bundle";
         }
-        return formatMessage(format, args);
+        try {
+            return rb.getString(key);
+        } catch (MissingResourceException mre) {
+            return "missing message for key = \"" + key
+                    + "\" in resource bundle ";
+        }
     }
 
-    static String formatMessage(String format, Object... args) {
-        String ss = null;
-        synchronized (lock) {
-            /*
-             * External synchronization required for safe use of
-             * java.text.MessageFormat:
-             */
-            ss = MessageFormat.format(format, args);
+    private static void setFieldValue(Field field, String value) {
+        try {
+            field.set(null, value);
+        } catch (IllegalArgumentException | IllegalAccessException e) {
+            throw new Error("Unable to access or set message for field " + field.getName());
         }
-        return ss;
+    }
+
+    /**
+     * Returns a {@link String} where all <code>\n</code> in the <text> have
+     * been replaced with the line separator for the platform.
+     *
+     * @param text the to be replaced
+     *
+     * @return the replaced text
+     */
+    private static String replaceWithPlatformLineFeed(String text) {
+        return text.replace("\n", System.getProperty("line.separator"));
     }
 
     /**
-     * Returns the mnemonic keycode int of the jconsole resource for the specified key.
+     * 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
      */
-    public static int getMnemonicInt(String key) {
-        int mnemonic = 0;
-        if (resources != null) {
-            Object obj = resources.getObject(key+".mnemonic");
-            if (obj instanceof Character) {
-                mnemonic = (int)(Character)obj;
-                if (mnemonic >= 'a' && mnemonic <='z') {
-                    mnemonic -= ('a' - 'A');
-                }
-            } else if (obj instanceof Integer) {
-                mnemonic = (Integer)obj;
+    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 mnemonic;
+        return s.toString();
     }
 
     /**
-     * Returns the jconsole resource string for the specified key.
+     * 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 String getString(String key) {
-        if (resources != null) {
-            try {
-                return resources.getString(key);
-            } catch (MissingResourceException e) {
-                return null;
+    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 lookupMnemonicInt(s.substring(i + 1, i + 2));
+                } else {
+                    i++;
+                }
             }
         }
-        return "missing resource bundle: key = \"" + key + "\", " +
-            "arguments = \"{0}\", \"{1}\", \"{2}\"";
+        return 0;
+    }
+
+    /**
+     * Lookups the mnemonic for a key in the {@link KeyEvent} class.
+     *
+     * @param c the character to lookup
+     *
+     * @return the mnemonic as an <code>int</code>, or <code>0</code> if it
+     *         can't be found.
+     */
+    private static int lookupMnemonicInt(String c) {
+        try {
+            return KeyEvent.class.getDeclaredField("VK_" + c.toUpperCase())
+                    .getInt(null);
+        } catch (IllegalArgumentException | IllegalAccessException
+                | NoSuchFieldException | SecurityException e) {
+            // Missing VK is okay
+            return 0;
+        }
     }
 }
--- a/src/share/classes/sun/tools/jconsole/SummaryTab.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/SummaryTab.java	Fri Jun 21 19:11:42 2013 -0700
@@ -29,24 +29,19 @@
 import java.io.*;
 import java.lang.management.*;
 import java.lang.reflect.*;
-import java.net.URL;
 import java.text.*;
 import java.util.*;
 import java.util.concurrent.*;
 
 import javax.swing.*;
-import javax.swing.event.*;
-import javax.swing.text.*;
+
 
 import static sun.tools.jconsole.Formatter.*;
-import static sun.tools.jconsole.Resources.*;
 import static sun.tools.jconsole.Utilities.*;
 
 @SuppressWarnings("serial")
 class SummaryTab extends Tab {
     private static final String cpuUsageKey = "cpu";
-    private static final String cpuUsageName = getText("CPU Usage");
-    private static final String cpuUsageFormat = "CPUUsageFormat";
 
     private static final String newDivider =   "<tr><td colspan=4><font size =-1><hr>";
     private static final String newTable =     "<tr><td colspan=4 align=left><table cellpadding=1>";
@@ -70,7 +65,7 @@
     }
 
     public static String getTabName() {
-        return Resources.getText("SummaryTab.tabName");
+        return Messages.SUMMARY_TAB_TAB_NAME;
     }
 
     public SummaryTab(VMPanel vmPanel) {
@@ -83,7 +78,7 @@
         add(new JScrollPane(info));
 
         headerDateTimeFormat =
-            getDateTimeFormat("SummaryTab.headerDateTimeFormat");
+            Formatter.getDateTimeFormat(Messages.SUMMARY_TAB_HEADER_DATE_TIME_FORMAT);
     }
 
     public SwingWorker<?, ?> newSwingWorker() {
@@ -138,7 +133,7 @@
                proxyClient.getSunOperatingSystemMXBean();
 
             append("<tr><td colspan=4>");
-            append("<center><b>" + getText("SummaryTab.tabName") + "</b></center>");
+            append("<center><b>" + Messages.SUMMARY_TAB_TAB_NAME + "</b></center>");
             String dateTime =
                 headerDateTimeFormat.format(System.currentTimeMillis());
             append("<center>" + dateTime + "</center>");
@@ -147,30 +142,30 @@
 
             {  // VM info
                 append(newLeftTable);
-                append("Connection name", vmPanel.getDisplayName());
-                append("Virtual Machine",
-                       getText("SummaryTab.vmVersion",
-                               rmBean.getVmName(), rmBean.getVmVersion()));
-                append("Vendor", rmBean.getVmVendor());
-                append("Name", rmBean.getName());
+                append(Messages.CONNECTION_NAME, vmPanel.getDisplayName());
+                append(Messages.VIRTUAL_MACHINE,
+                       Resources.format(Messages.SUMMARY_TAB_VM_VERSION,
+                                        rmBean.getVmName(), rmBean.getVmVersion()));
+                append(Messages.VENDOR, rmBean.getVmVendor());
+                append(Messages.NAME, rmBean.getName());
                 append(endTable);
 
                 append(newRightTable);
                 result.upTime = rmBean.getUptime();
-                append("Uptime", formatTime(result.upTime));
+                append(Messages.UPTIME, formatTime(result.upTime));
                 if (sunOSMBean != null) {
                     result.processCpuTime = sunOSMBean.getProcessCpuTime();
-                    append("Process CPU time", formatNanoTime(result.processCpuTime));
+                    append(Messages.PROCESS_CPU_TIME, formatNanoTime(result.processCpuTime));
                 }
 
                 if (cmpMBean != null) {
-                    append("JIT compiler", cmpMBean.getName());
-                    append("Total compile time",
+                    append(Messages.JIT_COMPILER, cmpMBean.getName());
+                    append(Messages.TOTAL_COMPILE_TIME,
                            cmpMBean.isCompilationTimeMonitoringSupported()
                                     ? formatTime(cmpMBean.getTotalCompilationTime())
-                                    : getText("Unavailable"));
+                                    : Messages.UNAVAILABLE);
                 } else {
-                    append("JIT compiler", getText("Unavailable"));
+                    append(Messages.JIT_COMPILER, Messages.UNAVAILABLE);
                 }
                 append(endTable);
             }
@@ -185,10 +180,10 @@
                 long ttCount = tmBean.getTotalStartedThreadCount();
                 String[] strings1 = formatLongs(tlCount, tpCount,
                                                 tdCount, ttCount);
-                append("Live Threads",          strings1[0]);
-                append("Peak",                  strings1[1]);
-                append("Daemon threads",        strings1[2]);
-                append("Total threads started", strings1[3]);
+                append(Messages.LIVE_THREADS, strings1[0]);
+                append(Messages.PEAK, strings1[1]);
+                append(Messages.DAEMON_THREADS, strings1[2]);
+                append(Messages.TOTAL_THREADS_STARTED, strings1[3]);
                 append(endTable);
 
                 append(newRightTable);
@@ -196,9 +191,9 @@
                 long cuCount = clMBean.getUnloadedClassCount();
                 long ctCount = clMBean.getTotalLoadedClassCount();
                 String[] strings2 = formatLongs(clCount, cuCount, ctCount);
-                append("Current classes loaded", strings2[0]);
-                append("Total classes loaded",   strings2[2]);
-                append("Total classes unloaded", strings2[1]);
+                append(Messages.CURRENT_CLASSES_LOADED, strings2[0]);
+                append(Messages.TOTAL_CLASSES_LOADED, strings2[2]);
+                append(Messages.TOTAL_CLASSES_UNLOADED, strings2[1]);
                 append(null, "");
                 append(endTable);
             }
@@ -210,16 +205,16 @@
 
                 append(newLeftTable);
                 String[] strings1 = formatKByteStrings(u.getUsed(), u.getMax());
-                append("Current heap size", strings1[0]);
-                append("Maximum heap size", strings1[1]);
+                append(Messages.CURRENT_HEAP_SIZE, strings1[0]);
+                append(Messages.MAXIMUM_HEAP_SIZE, strings1[1]);
                 append(endTable);
 
                 append(newRightTable);
                 String[] strings2 = formatKByteStrings(u.getCommitted());
-                append("Committed memory",  strings2[0]);
-                append("SummaryTab.pendingFinalization.label",
-                       getText("SummaryTab.pendingFinalization.value",
-                               memoryBean.getObjectPendingFinalizationCount()));
+                append(Messages.COMMITTED_MEMORY,  strings2[0]);
+                append(Messages.SUMMARY_TAB_PENDING_FINALIZATION_LABEL,
+                       Messages.SUMMARY_TAB_PENDING_FINALIZATION_VALUE,
+                       memoryBean.getObjectPendingFinalizationCount());
                 append(endTable);
 
                 append(newTable);
@@ -230,10 +225,10 @@
                     long gcCount = garbageCollectorMBean.getCollectionCount();
                     long gcTime = garbageCollectorMBean.getCollectionTime();
 
-                    append("Garbage collector",
-                           getText("GcInfo", gcName, gcCount,
-                                   (gcTime >= 0) ? formatTime(gcTime)
-                                                 : getText("Unavailable")),
+                    append(Messages.GARBAGE_COLLECTOR,
+                           Resources.format(Messages.GC_INFO, gcName, gcCount,
+                                            (gcTime >= 0) ? formatTime(gcTime)
+                                                 : Messages.UNAVAILABLE),
                            4);
                 }
                 append(endTable);
@@ -247,9 +242,9 @@
                 String osVersion = osMBean.getVersion();
                 String osArch = osMBean.getArch();
                 result.nCPUs = osMBean.getAvailableProcessors();
-                append("Operating System", osName + " " + osVersion);
-                append("Architecture", osArch);
-                append("Number of processors", result.nCPUs+"");
+                append(Messages.OPERATING_SYSTEM, osName + " " + osVersion);
+                append(Messages.ARCHITECTURE, osArch);
+                append(Messages.NUMBER_OF_PROCESSORS, result.nCPUs+"");
 
                 if (pathSeparator == null) {
                     // Must use separator of remote OS, not File.pathSeparator
@@ -268,14 +263,14 @@
                                            sunOSMBean.getTotalSwapSpaceSize(),
                                            sunOSMBean.getFreeSwapSpaceSize());
 
-                    append("Committed virtual memory", kbStrings1[0]);
+                    append(Messages.COMMITTED_VIRTUAL_MEMORY, kbStrings1[0]);
                     append(endTable);
 
                     append(newRightTable);
-                    append("Total physical memory", kbStrings2[0]);
-                    append("Free physical memory",  kbStrings2[1]);
-                    append("Total swap space",      kbStrings2[2]);
-                    append("Free swap space",       kbStrings2[3]);
+                    append(Messages.TOTAL_PHYSICAL_MEMORY, kbStrings2[0]);
+                    append(Messages.FREE_PHYSICAL_MEMORY,  kbStrings2[1]);
+                    append(Messages.TOTAL_SWAP_SPACE,      kbStrings2[2]);
+                    append(Messages.FREE_SWAP_SPACE,       kbStrings2[3]);
                 }
 
                 append(endTable);
@@ -290,13 +285,13 @@
                 for (String arg : inputArguments) {
                     args += arg + " ";
                 }
-                append("VM arguments", args, 4);
-                append("Class path",   rmBean.getClassPath(), 4);
-                append("Library path", rmBean.getLibraryPath(), 4);
-                append("Boot class path",
+                append(Messages.VM_ARGUMENTS, args, 4);
+                append(Messages.CLASS_PATH,   rmBean.getClassPath(), 4);
+                append(Messages.LIBRARY_PATH, rmBean.getLibraryPath(), 4);
+                append(Messages.BOOT_CLASS_PATH,
                        rmBean.isBootClassPathSupported()
                                     ? rmBean.getBootClassPath()
-                                    : getText("Unavailable"),
+                                    : Messages.UNAVAILABLE,
                        4);
                 append(endTable);
             }
@@ -327,7 +322,7 @@
     }
 
     void append(String label, String value) {
-        append(newRow((label != null) ? getText(label) : label, value));
+        append(newRow(label, value));
     }
 
     private void append(String label, String value, int columnPerRow) {
@@ -335,13 +330,7 @@
             value = value.replace(pathSeparator,
                                   "<b></b>" + pathSeparator);
         }
-        append(newRow(getText(label), value, columnPerRow));
-    }
-
-    void append(String label1, String value1,
-                String label2, String value2) {
-        append(newRow(getText(label1), value1,
-                      getText(label2), value2));
+        append(newRow(label, value, columnPerRow));
     }
 
     OverviewPanel[] getOverviewPanels() {
@@ -355,7 +344,7 @@
         private long prevUpTime, prevProcessCpuTime;
 
         CPUOverviewPanel() {
-            super(getText("CPU Usage"), cpuUsageKey, cpuUsageName, Plotter.Unit.PERCENT);
+            super(Messages.CPU_USAGE, cpuUsageKey, Messages.CPU_USAGE, Plotter.Unit.PERCENT);
             getPlotter().setDecimals(CPU_DECIMALS);
         }
 
@@ -373,14 +362,11 @@
 
                 getPlotter().addValues(result.timeStamp,
                                 Math.round(cpuUsage * Math.pow(10.0, CPU_DECIMALS)));
-                getInfoLabel().setText(getText(cpuUsageFormat,
+                getInfoLabel().setText(Resources.format(Messages.CPU_USAGE_FORMAT,
                                                String.format("%."+CPU_DECIMALS+"f", cpuUsage)));
             }
             this.prevUpTime = result.upTime;
             this.prevProcessCpuTime = result.processCpuTime;
         }
     }
-
-
-
 }
--- a/src/share/classes/sun/tools/jconsole/Tab.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/Tab.java	Fri Jun 21 19:11:42 2013 -0700
@@ -26,9 +26,6 @@
 package sun.tools.jconsole;
 
 import java.awt.*;
-import java.awt.event.*;
-import java.beans.*;
-
 import javax.swing.*;
 
 public abstract class Tab extends JPanel {
--- a/src/share/classes/sun/tools/jconsole/ThreadTab.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/ThreadTab.java	Fri Jun 21 19:11:42 2013 -0700
@@ -35,14 +35,11 @@
 import javax.swing.border.*;
 import javax.swing.event.*;
 
+
 import java.util.*;
 import java.util.concurrent.*;
 import java.util.List;
 
-import sun.awt.*;
-
-import static sun.tools.jconsole.OverviewPanel.*;
-import static sun.tools.jconsole.Resources.*;
 import static sun.tools.jconsole.Utilities.*;
 
 
@@ -51,7 +48,7 @@
     PlotterPanel threadMeter;
     TimeComboBox timeComboBox;
     JTabbedPane threadListTabbedPane;
-    DefaultListModel listModel;
+    DefaultListModel<Long> listModel;
     JTextField filterTF;
     JLabel messageLabel;
     JSplitPane threadsSplitPane;
@@ -64,9 +61,6 @@
     private static final String threadCountKey   = "threadCount";
     private static final String peakKey          = "peak";
 
-    private static final String threadCountName   = Resources.getText("Live Threads");
-    private static final String peakName          = Resources.getText("Peak");
-
     private static final Color  threadCountColor = Plotter.defaultColor;
     private static final Color  peakColor        = Color.red;
 
@@ -93,7 +87,7 @@
 
 
     public static String getTabName() {
-        return Resources.getText("Threads");
+        return Messages.THREADS;
     }
 
     public ThreadTab(VMPanel vmPanel) {
@@ -111,28 +105,28 @@
         JPanel controlPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 20, 5));
         topPanel.add(controlPanel, BorderLayout.CENTER);
 
-        threadMeter = new PlotterPanel(Resources.getText("Number of Threads"),
+        threadMeter = new PlotterPanel(Messages.NUMBER_OF_THREADS,
                                        Plotter.Unit.NONE, true);
-        threadMeter.plotter.createSequence(threadCountKey, threadCountName,  threadCountColor, true);
-        threadMeter.plotter.createSequence(peakKey,        peakName,         peakColor,        true);
+        threadMeter.plotter.createSequence(threadCountKey, Messages.LIVE_THREADS,  threadCountColor, true);
+        threadMeter.plotter.createSequence(peakKey,        Messages.PEAK,         peakColor,        true);
         setAccessibleName(threadMeter.plotter,
-                          getText("ThreadTab.threadPlotter.accessibleName"));
+                          Messages.THREAD_TAB_THREAD_PLOTTER_ACCESSIBLE_NAME);
 
         plotterPanel.add(threadMeter);
 
         timeComboBox = new TimeComboBox(threadMeter.plotter);
-        controlPanel.add(new LabeledComponent(Resources.getText("Time Range:"),
-                                              getMnemonicInt("Time Range:"),
+        controlPanel.add(new LabeledComponent(Messages.TIME_RANGE_COLON,
+                                              Resources.getMnemonicInt(Messages.TIME_RANGE_COLON),
                                               timeComboBox));
 
-        listModel = new DefaultListModel();
+        listModel = new DefaultListModel<Long>();
 
         JTextArea textArea = new JTextArea();
         textArea.setBorder(thinEmptyBorder);
         textArea.setEditable(false);
         setAccessibleName(textArea,
-                          getText("ThreadTab.threadInfo.accessibleName"));
-        JList list = new ThreadJList(listModel, textArea);
+                          Messages.THREAD_TAB_THREAD_INFO_ACCESSIBLE_NAME);
+        ThreadJList list = new ThreadJList(listModel, textArea);
 
         Dimension di = new Dimension(super.getPreferredSize());
         di.width = Math.min(di.width, 200);
@@ -165,11 +159,11 @@
                                                  filterTF.getPreferredSize().height));
         firstTabToolPanel.add(separator);
 
-        JButton detectDeadlockButton = new JButton(Resources.getText("Detect Deadlock"));
-        detectDeadlockButton.setMnemonic(getMnemonicInt("Detect Deadlock"));
+        JButton detectDeadlockButton = new JButton(Messages.DETECT_DEADLOCK);
+        detectDeadlockButton.setMnemonic(Resources.getMnemonicInt(Messages.DETECT_DEADLOCK));
         detectDeadlockButton.setActionCommand("detectDeadlock");
         detectDeadlockButton.addActionListener(this);
-        detectDeadlockButton.setToolTipText(getText("Detect Deadlock.toolTip"));
+        detectDeadlockButton.setToolTipText(Messages.DETECT_DEADLOCK_TOOLTIP);
         firstTabToolPanel.add(detectDeadlockButton);
 
         messageLabel = new JLabel();
@@ -177,7 +171,7 @@
 
         firstTabPanel.add(threadsSplitPane, BorderLayout.CENTER);
         firstTabPanel.add(firstTabToolPanel, BorderLayout.SOUTH);
-        threadListTabbedPane.addTab(Resources.getText("Threads"), firstTabPanel);
+        threadListTabbedPane.addTab(Messages.THREADS, firstTabPanel);
 
         plotterPanel.add(threadListTabbedPane);
     }
@@ -356,32 +350,32 @@
                         }
                         if (ti != null) {
                             if (ti.getLockName() == null) {
-                                sb.append(Resources.getText("Name State",
+                                sb.append(Resources.format(Messages.NAME_STATE,
                                               ti.getThreadName(),
                                               ti.getThreadState().toString()));
                             } else if (ti.getLockOwnerName() == null) {
-                                sb.append(Resources.getText("Name State LockName",
+                                sb.append(Resources.format(Messages.NAME_STATE_LOCK_NAME,
                                               ti.getThreadName(),
                                               ti.getThreadState().toString(),
                                               ti.getLockName()));
                             } else {
-                                sb.append(Resources.getText("Name State LockName LockOwner",
+                                sb.append(Resources.format(Messages.NAME_STATE_LOCK_NAME_LOCK_OWNER,
                                               ti.getThreadName(),
                                               ti.getThreadState().toString(),
                                               ti.getLockName(),
                                               ti.getLockOwnerName()));
                             }
-                            sb.append(Resources.getText("BlockedCount WaitedCount",
+                            sb.append(Resources.format(Messages.BLOCKED_COUNT_WAITED_COUNT,
                                               ti.getBlockedCount(),
                                               ti.getWaitedCount()));
-                            sb.append(Resources.getText("Stack trace"));
+                            sb.append(Messages.STACK_TRACE);
                             int index = 0;
                             for (StackTraceElement e : ti.getStackTrace()) {
                                 sb.append(e.toString()+"\n");
                                 if (monitors != null) {
                                     for (MonitorInfo mi : monitors) {
                                         if (mi.getLockedStackDepth() == index) {
-                                            sb.append(Resources.getText("Monitor locked", mi.toString()));
+                                            sb.append(Resources.format(Messages.MONITOR_LOCKED, mi.toString()));
                                         }
                                     }
                                 }
@@ -429,7 +423,7 @@
                                 try {
                                     SwingUtilities.invokeAndWait(new Runnable() {
                                         public void run() {
-                                            String msg = Resources.getText("No deadlock detected");
+                                            String msg = Messages.NO_DEADLOCK_DETECTED;
                                             messageLabel.setText(msg);
                                             threadListTabbedPane.revalidate();
                                         }
@@ -459,13 +453,13 @@
 
                             if (deadlockedThreads != null) {
                                 for (int i = 0; i < deadlockedThreads.length; i++) {
-                                    DefaultListModel listModel = new DefaultListModel();
+                                    DefaultListModel<Long> listModel = new DefaultListModel<Long>();
                                     JTextArea textArea = new JTextArea();
                                     textArea.setBorder(thinEmptyBorder);
                                     textArea.setEditable(false);
                                     setAccessibleName(textArea,
-                                        getText("ThreadTab.threadInfo.accessibleName"));
-                                    JList list = new ThreadJList(listModel, textArea);
+                                                      Messages.THREAD_TAB_THREAD_INFO_ACCESSIBLE_NAME);
+                                    ThreadJList list = new ThreadJList(listModel, textArea);
                                     JScrollPane threadlistSP = new JScrollPane(list);
                                     JScrollPane textAreaSP = new JScrollPane(textArea);
                                     threadlistSP.setBorder(null);
@@ -477,9 +471,9 @@
                                     splitPane.setDividerLocation(threadsSplitPane.getDividerLocation());
                                     String tabName;
                                     if (deadlockedThreads.length > 1) {
-                                        tabName = Resources.getText("deadlockTabN", i+1);
+                                        tabName = Resources.format(Messages.DEADLOCK_TAB_N, i+1);
                                     } else {
-                                        tabName = Resources.getText("deadlockTab");
+                                        tabName = Messages.DEADLOCK_TAB;
                                     }
                                     threadListTabbedPane.addTab(tabName, splitPane);
 
@@ -591,10 +585,10 @@
 
 
 
-    private class ThreadJList extends JList {
+    private class ThreadJList extends JList<Long> {
         private JTextArea textArea;
 
-        ThreadJList(DefaultListModel listModel, JTextArea textArea) {
+        ThreadJList(DefaultListModel<Long> listModel, JTextArea textArea) {
             super(listModel);
 
             this.textArea = textArea;
@@ -603,7 +597,7 @@
 
             addListSelectionListener(ThreadTab.this);
             setCellRenderer(new DefaultListCellRenderer() {
-                public Component getListCellRendererComponent(JList list, Object value, int index,
+                public Component getListCellRendererComponent(JList<?> list, Object value, int index,
                                                               boolean isSelected, boolean cellHasFocus) {
                     super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
 
@@ -691,12 +685,12 @@
 
     private static class ThreadOverviewPanel extends OverviewPanel {
         ThreadOverviewPanel() {
-            super(getText("Threads"), threadCountKey, threadCountName, null);
+            super(Messages.THREADS, threadCountKey,  Messages.LIVE_THREADS, null);
         }
 
         private void updateThreadsInfo(long tlCount, long tpCount, long ttCount, long timeStamp) {
             getPlotter().addValues(timeStamp, tlCount);
-            getInfoLabel().setText(getText(infoLabelFormat, tlCount, tpCount, ttCount));
+            getInfoLabel().setText(Resources.format(infoLabelFormat, tlCount, tpCount, ttCount));
         }
     }
 }
--- a/src/share/classes/sun/tools/jconsole/VMInternalFrame.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/VMInternalFrame.java	Fri Jun 21 19:11:42 2013 -0700
@@ -26,16 +26,9 @@
 package sun.tools.jconsole;
 
 import java.awt.*;
-import java.awt.event.*;
-import java.io.*;
-import java.util.*;
+import javax.swing.*;
 
-import javax.swing.*;
-import javax.swing.Timer;
-import javax.swing.border.*;
-import javax.swing.event.*;
 
-import static sun.tools.jconsole.Resources.*;
 import static sun.tools.jconsole.Utilities.*;
 
 @SuppressWarnings("serial")
@@ -47,7 +40,7 @@
 
         this.vmPanel = vmPanel;
         setAccessibleDescription(this,
-                                 getText("VMInternalFrame.accessibleDescription"));
+                                 Messages.VMINTERNAL_FRAME_ACCESSIBLE_DESCRIPTION);
         getContentPane().add(vmPanel, BorderLayout.CENTER);
         pack();
         vmPanel.updateFrameTitle();
--- a/src/share/classes/sun/tools/jconsole/VMPanel.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/VMPanel.java	Fri Jun 21 19:11:42 2013 -0700
@@ -28,18 +28,16 @@
 import java.awt.*;
 import java.awt.event.*;
 import java.beans.*;
-import java.io.*;
 import java.lang.reflect.*;
 import java.util.*;
 import java.util.List;
 import java.util.Timer;
-
 import javax.swing.*;
 import javax.swing.plaf.*;
 
+
 import com.sun.tools.jconsole.JConsolePlugin;
 import com.sun.tools.jconsole.JConsoleContext;
-import static com.sun.tools.jconsole.JConsoleContext.ConnectionState.*;
 
 import static sun.tools.jconsole.ProxyClient.*;
 
@@ -51,16 +49,14 @@
     private int updateInterval;
     private String hostName;
     private int port;
-    private int vmid;
     private String userName;
     private String password;
     private String url;
     private VMInternalFrame vmIF = null;
-    private static final String windowsLaF =
-            "com.sun.java.swing.plaf.windows.WindowsLookAndFeel";
     private static ArrayList<TabInfo> tabInfos = new ArrayList<TabInfo>();
     private boolean wasConnected = false;
     private boolean shouldUseSSL = true;
+    private boolean userDisconnected = false;
 
     // The everConnected flag keeps track of whether the window can be
     // closed if the user clicks Cancel after a failed connection attempt.
@@ -101,7 +97,6 @@
         this.updateInterval = updateInterval;
         this.hostName = proxyClient.getHostName();
         this.port = proxyClient.getPort();
-        this.vmid = proxyClient.getVmid();
         this.userName = proxyClient.getUserName();
         this.password = proxyClient.getPassword();
         this.url = proxyClient.getUrl();
@@ -132,6 +127,7 @@
                 if (connectedIconBounds != null && (e.getModifiers() & MouseEvent.BUTTON1_MASK) != 0 && connectedIconBounds.contains(e.getPoint())) {
 
                     if (isConnected()) {
+                        userDisconnected = true;
                         disconnect();
                         wasConnected = false;
                     } else {
@@ -187,9 +183,9 @@
     public String getToolTipText(MouseEvent event) {
         if (connectedIconBounds.contains(event.getPoint())) {
             if (isConnected()) {
-                return getText("Connected. Click to disconnect.");
+                return Messages.CONNECTED_PUNCTUATION_CLICK_TO_DISCONNECT_;
             } else {
-                return getText("Disconnected. Click to connect.");
+                return Messages.DISCONNECTED_PUNCTUATION_CLICK_TO_CONNECT_;
             }
         } else {
             return super.getToolTipText(event);
@@ -220,7 +216,7 @@
 
     private Tab instantiate(TabInfo tabInfo) {
         try {
-            Constructor con = tabInfo.tabClass.getConstructor(VMPanel.class);
+            Constructor<?> con = tabInfo.tabClass.getConstructor(VMPanel.class);
             return (Tab) con.newInstance(this);
         } catch (Exception ex) {
             System.err.println(ex);
@@ -355,7 +351,7 @@
     private void onConnecting() {
         time0 = System.currentTimeMillis();
 
-        final JConsole jc = (JConsole) SwingUtilities.getWindowAncestor(this);
+        SwingUtilities.getWindowAncestor(this);
 
         String connectionName = getConnectionName();
         progressBar = new JProgressBar();
@@ -364,9 +360,9 @@
         progressPanel.add(progressBar);
 
         Object[] message = {
-            "<html><h3>" + getText("connectingTo1", connectionName) + "</h3></html>",
+            "<html><h3>" + Resources.format(Messages.CONNECTING_TO1, connectionName) + "</h3></html>",
             progressPanel,
-            "<html><b>" + getText("connectingTo2", connectionName) + "</b></html>"
+            "<html><b>" + Resources.format(Messages.CONNECTING_TO2, connectionName) + "</b></html>"
         };
 
         optionPane =
@@ -374,7 +370,7 @@
                 message,
                 JOptionPane.DEFAULT_OPTION,
                 JOptionPane.INFORMATION_MESSAGE, null,
-                new String[]{getText("Cancel")},
+                new String[]{Messages.CANCEL},
                 0);
 
 
@@ -410,7 +406,7 @@
         if (vmIF != null) {
             String displayName = getDisplayName();
             if (!proxyClient.isConnected()) {
-                displayName = getText("ConnectionName (disconnected)", displayName);
+                displayName = Resources.format(Messages.CONNECTION_NAME__DISCONNECTED_, displayName);
             }
             vmIF.setTitle(displayName);
         }
@@ -459,30 +455,27 @@
     private void vmPanelDied() {
         disconnect();
 
-        final JConsole jc = (JConsole) SwingUtilities.getWindowAncestor(this);
+        if (userDisconnected) {
+            userDisconnected = false;
+            return;
+        }
 
         JOptionPane optionPane;
-
-        final String connectStr = getText("Connect");
-        final String reconnectStr = getText("Reconnect");
-        final String insecureStr = getText("Insecure");
-        final String cancelStr = getText("Cancel");
-
         String msgTitle, msgExplanation, buttonStr;
 
         if (wasConnected) {
             wasConnected = false;
-            msgTitle = getText("connectionLost1");
-            msgExplanation = getText("connectionLost2", getConnectionName());
-            buttonStr = reconnectStr;
+            msgTitle = Messages.CONNECTION_LOST1;
+            msgExplanation = Resources.format(Messages.CONNECTING_TO2, getConnectionName());
+            buttonStr = Messages.RECONNECT;
         } else if (shouldUseSSL) {
-            msgTitle = getText("connectionFailedSSL1");
-            msgExplanation = getText("connectionFailedSSL2", getConnectionName());
-            buttonStr = insecureStr;
+            msgTitle = Messages.CONNECTION_INSECURE1;
+            msgExplanation = Resources.format(Messages.CONNECTION_INSECURE2, getConnectionName());
+            buttonStr = Messages.INSECURE;
         } else {
-            msgTitle = getText("connectionFailed1");
-            msgExplanation = getText("connectionFailed2", getConnectionName());
-            buttonStr = connectStr;
+            msgTitle = Messages.CONNECTION_FAILED1;
+            msgExplanation = Resources.format(Messages.CONNECTION_FAILED2, getConnectionName());
+            buttonStr = Messages.CONNECT;
         }
 
         optionPane =
@@ -491,7 +484,7 @@
                 "<b>" + msgExplanation + "</b>",
                 JOptionPane.DEFAULT_OPTION,
                 JOptionPane.WARNING_MESSAGE, null,
-                new String[]{buttonStr, cancelStr},
+                new String[]{buttonStr, Messages.CANCEL},
                 0);
 
         optionPane.addPropertyChangeListener(new PropertyChangeListener() {
@@ -500,9 +493,9 @@
                 if (event.getPropertyName().equals(JOptionPane.VALUE_PROPERTY)) {
                     Object value = event.getNewValue();
 
-                    if (value == reconnectStr || value == connectStr) {
+                    if (value == Messages.RECONNECT || value == Messages.CONNECT) {
                         connect();
-                    } else if (value == insecureStr) {
+                    } else if (value == Messages.INSECURE) {
                         shouldUseSSL = false;
                         connect();
                     } else if (!everConnected) {
@@ -652,11 +645,6 @@
         }
     }
 
-    // Convenience methods
-    private static String getText(String key, Object... args) {
-        return Resources.getText(key, args);
-    }
-
     private void createPluginTabs() {
         // add plugin tabs if not done
         if (!pluginTabsAdded) {
--- a/src/share/classes/sun/tools/jconsole/VariableGridLayout.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/VariableGridLayout.java	Fri Jun 21 19:11:42 2013 -0700
@@ -26,7 +26,6 @@
 package sun.tools.jconsole;
 
 import java.awt.*;
-import java.util.*;
 
 import javax.swing.*;
 
--- a/src/share/classes/sun/tools/jconsole/Version.java.template	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/Version.java.template	Fri Jun 21 19:11:42 2013 -0700
@@ -26,6 +26,7 @@
 package sun.tools.jconsole;
 
 import java.io.PrintStream;
+import sun.tools.jconsole.Messages;
 
 public class Version {
     private static final String jconsole_version =
@@ -34,19 +35,19 @@
     public static void print(PrintStream ps) {
         printFullVersion(ps);
 
-        ps.println(Resources.getText("Name and Build",
-                                     System.getProperty("java.runtime.name"),
-                                     System.getProperty("java.runtime.version")));
+        ps.println(Resources.format(Messages.NAME_AND_BUILD,
+                                    System.getProperty("java.runtime.name"),
+                                    System.getProperty("java.runtime.version")));
 
-        ps.println(Resources.getText("Name Build and Mode",
-                                     System.getProperty("java.vm.name"),
-                                     System.getProperty("java.vm.version"),
-                                     System.getProperty("java.vm.info")));
+        ps.println(Resources.format(Messages.NAME_AND_BUILD,
+                                    System.getProperty("java.vm.name"),
+                                    System.getProperty("java.vm.version"),
+                                    System.getProperty("java.vm.info")));
 
     }
 
     public static void printFullVersion(PrintStream ps) {
-        ps.println(Resources.getText("JConsole version", jconsole_version));
+        ps.println(Resources.format(Messages.JCONSOLE_VERSION, jconsole_version));
     }
 
     static String getVersion() {
--- a/src/share/classes/sun/tools/jconsole/inspector/OperationEntry.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/inspector/OperationEntry.java	Fri Jun 21 19:11:42 2013 -0700
@@ -25,30 +25,14 @@
 
 package sun.tools.jconsole.inspector;
 
-// java import
 import java.awt.*;
-import java.awt.event.*;
-import java.awt.dnd.*;
-import java.lang.reflect.*;
-import java.io.*;
-//
-
-// swing import
-import javax.swing.border.*;
-import javax.swing.event.*;
 import javax.swing.*;
-//
-
-// jmx import
 import javax.management.*;
-//
-
 
 @SuppressWarnings("serial")
 public class OperationEntry extends JPanel {
     private MBeanOperationInfo operation;
     private JComboBox sigs;
-    private Dimension preferredSize;
     private XTextField inputs[];
 
     public OperationEntry (MBeanOperationInfo operation,
@@ -61,26 +45,10 @@
         setPanel(isCallable, button, xoperations);
     }
 
-    /**
-     * This method chops off the throws exceptions, removes "java.lang".
-     */
-    private String preProcessSignature(String signature) {
-        int index;
-        if ((index=signature.indexOf(" throws"))>0) {
-            signature = signature.substring(0,index);
-        }
-        while ((index = signature.indexOf("java.lang."))>0) {
-            signature = signature.substring(0,index)+
-                signature.substring(index+10,signature.length());
-        }
-        return signature;
-    }
-
-    private void setPanel(boolean isCallable,
+     private void setPanel(boolean isCallable,
                           JButton button,
                           XOperations xoperations) {
         try {
-            String defaultVal;
             MBeanParameterInfo params[] = operation.getSignature();
             add(new JLabel("(",JLabel.CENTER));
             inputs = new XTextField[params.length];
--- a/src/share/classes/sun/tools/jconsole/inspector/TableSorter.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/inspector/TableSorter.java	Fri Jun 21 19:11:42 2013 -0700
@@ -94,7 +94,7 @@
     @SuppressWarnings("unchecked")
     private int compare(Object o1, Object o2) {
         // take care of the case where both o1 & o2 are null. Needed to keep
-        // the method symetric. Without this quickSort gives surprising results.
+        // the method symmetric. Without this quickSort gives surprising results.
         if (o1 == o2)
             return 0;
         if (o1==null)
--- a/src/share/classes/sun/tools/jconsole/inspector/ThreadDialog.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/inspector/ThreadDialog.java	Fri Jun 21 19:11:42 2013 -0700
@@ -28,7 +28,6 @@
 // java import
 import java.awt.*;
 import javax.swing.*;
-import java.io.*;
 //
 
 public class ThreadDialog implements Runnable {
--- a/src/share/classes/sun/tools/jconsole/inspector/Utils.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/inspector/Utils.java	Fri Jun 21 19:11:42 2013 -0700
@@ -284,7 +284,7 @@
      */
     public static Object newStringConstructor(String type, String param)
             throws Exception {
-        Constructor c = Utils.getClass(type).getConstructor(String.class);
+        Constructor<?> c = Utils.getClass(type).getConstructor(String.class);
         try {
             return c.newInstance(param);
         } catch (InvocationTargetException e) {
--- a/src/share/classes/sun/tools/jconsole/inspector/XArrayDataViewer.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/inspector/XArrayDataViewer.java	Fri Jun 21 19:11:42 2013 -0700
@@ -46,9 +46,9 @@
         if (isViewableValue(value)) {
             Object[] arr;
             if (value instanceof Collection) {
-                arr = ((Collection) value).toArray();
+                arr = ((Collection<?>) value).toArray();
             } else if (value instanceof Map) {
-                arr = ((Map) value).entrySet().toArray();
+                arr = ((Map<?,?>) value).entrySet().toArray();
             } else if (value instanceof Object[]) {
                 arr = (Object[]) value;
             } else {
--- a/src/share/classes/sun/tools/jconsole/inspector/XDataViewer.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/inspector/XDataViewer.java	Fri Jun 21 19:11:42 2013 -0700
@@ -34,7 +34,7 @@
 import java.awt.Container;
 
 import sun.tools.jconsole.MBeansTab;
-import sun.tools.jconsole.Resources;
+import sun.tools.jconsole.Messages;
 
 public class XDataViewer {
 
@@ -100,10 +100,10 @@
     public static String getActionLabel(int type) {
         if(type == ARRAY ||
            type == OPEN)
-            return Resources.getText("visualize");
+            return Messages.VISUALIZE;
         if(type == NUMERIC)
-            return Resources.getText("plot");
-        return Resources.getText("expand");
+            return Messages.PLOT;
+        return Messages.EXPAND;
     }
 
     public Component createOperationViewer(Object value,
--- a/src/share/classes/sun/tools/jconsole/inspector/XMBeanAttributes.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/inspector/XMBeanAttributes.java	Fri Jun 21 19:11:42 2013 -0700
@@ -66,9 +66,9 @@
 import javax.swing.table.TableColumnModel;
 import javax.swing.table.TableModel;
 
-import sun.tools.jconsole.Resources;
 import sun.tools.jconsole.MBeansTab;
 import sun.tools.jconsole.JConsole;
+import sun.tools.jconsole.Messages;
 import sun.tools.jconsole.ProxyClient.SnapshotMBeanServerConnection;
 
 /*IMPORTANT :
@@ -84,8 +84,8 @@
             Logger.getLogger(XMBeanAttributes.class.getPackage().getName());
 
     private final static String[] columnNames =
-    {Resources.getText("Name"),
-     Resources.getText("Value")};
+    {Messages.NAME,
+     Messages.VALUE};
 
     private XMBean mbean;
     private MBeanInfo mbeanInfo;
@@ -267,7 +267,7 @@
 
     public boolean isColumnEditable(int column) {
         if (column < getColumnCount()) {
-            return getColumnName(column).equals(Resources.getText("Value"));
+            return getColumnName(column).equals(Messages.VALUE);
         }
         else {
             return false;
@@ -313,7 +313,7 @@
             if (value != null) {
                 tip = value.toString();
                 if(isAttributeViewable(row, VALUE_COLUMN))
-                    tip = Resources.getText("Double click to expand/collapse")+
+                    tip = Messages.DOUBLE_CLICK_TO_EXPAND_FORWARD_SLASH_COLLAPSE+
                         ". " + tip;
             }
 
@@ -589,7 +589,7 @@
                               comp,
                               rowMinHeight);
 
-                    mbeansTab.getDataViewer().registerForMouseEvent(
+                    XDataViewer.registerForMouseEvent(
                             comp, mouseListener);
                 } else
                     return cell;
@@ -724,7 +724,7 @@
                         mbeansTab.getDataViewer().createAttributeViewer(
                             value, mbean, attribute, XMBeanAttributes.this);
                     cell.init(cell.getMinRenderer(), comp, cell.getMinHeight());
-                    mbeansTab.getDataViewer().registerForMouseEvent(comp, mouseListener);
+                    XDataViewer.registerForMouseEvent(comp, mouseListener);
                 }
             } else {
                 cell = new ZoomedCell(value);
@@ -735,7 +735,7 @@
         }
     }
 
-    //will be called in a synchronzed block
+    //will be called in a synchronized block
     protected void addTableData(DefaultTableModel tableModel,
                                 XMBean mbean,
                                 MBeanAttributeInfo[] attributesInfo,
@@ -749,7 +749,7 @@
         for (int i = 0; i < attributesInfo.length; i++) {
             rowData[0] = (attributesInfo[i].getName());
             if (unavailableAttributes.containsKey(rowData[0])) {
-                rowData[1] = Resources.getText("Unavailable");
+                rowData[1] = Messages.UNAVAILABLE;
             } else if (viewableAttributes.containsKey(rowData[0])) {
                 rowData[1] = viewableAttributes.get(rowData[0]);
                 if (!attributesInfo[i].isWritable() ||
@@ -811,7 +811,6 @@
         }
     }
 
-    @SuppressWarnings("serial")
     class ValueCellEditor extends XTextFieldEditor {
         // implements javax.swing.table.TableCellEditor
         @Override
@@ -866,7 +865,6 @@
         }
     }
 
-    @SuppressWarnings("serial")
     class MaximizedCellRenderer extends  DefaultTableCellRenderer {
         Component comp;
         MaximizedCellRenderer(Component comp) {
@@ -1018,7 +1016,7 @@
                             (String)tableValue);// value
                     } catch (Throwable ex) {
                         popupAndLog(ex,"tableChanged",
-                                "Problem setting attribute");
+                                    Messages.PROBLEM_SETTING_ATTRIBUTE);
                     }
                 }
                 final String attributeName = getValueName(e.getFirstRow());
@@ -1042,7 +1040,7 @@
                         }
                         mbean.setAttribute(attribute);
                     } catch (Throwable ex) {
-                        popupAndLog(ex,method,"Problem setting attribute");
+                        popupAndLog(ex,method,Messages.PROBLEM_SETTING_ATTRIBUTE);
                     }
                     return null;
                 }
@@ -1062,7 +1060,7 @@
         }
 
         // Call this outside EDT
-        private void popupAndLog(Throwable ex, String method, String key) {
+        private void popupAndLog(Throwable ex, String method, String title) {
             ex = Utils.getActualException(ex);
             if (JConsole.isDebug()) ex.printStackTrace();
 
@@ -1070,7 +1068,7 @@
                     : ex.toString();
             EventQueue.invokeLater(
                     new ThreadDialog(component, message+"\n",
-                                     Resources.getText(key),
+                                     title,
                                      JOptionPane.ERROR_MESSAGE));
         }
     }
--- a/src/share/classes/sun/tools/jconsole/inspector/XMBeanInfo.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/inspector/XMBeanInfo.java	Fri Jun 21 19:11:42 2013 -0700
@@ -35,7 +35,8 @@
 import javax.swing.border.TitledBorder;
 import javax.swing.event.*;
 import javax.swing.table.*;
-import sun.tools.jconsole.Resources;
+
+import sun.tools.jconsole.Messages;
 
 import static sun.tools.jconsole.Utilities.*;
 
@@ -43,11 +44,11 @@
 public class XMBeanInfo extends JPanel {
 
     private static final Color lightYellow = new Color(255, 255, 128);
-    private final int NAME_COLUMN = 0;
+     private final int NAME_COLUMN = 0;
     private final int VALUE_COLUMN = 1;
     private final String[] columnNames = {
-        Resources.getText("Name"),
-        Resources.getText("Value")
+        Messages.NAME,
+        Messages.VALUE
     };
     private JTable infoTable = new JTable();
     private JTable descTable = new JTable();
@@ -163,7 +164,7 @@
         descTable.setAutoResizeMode(JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS);
         JScrollPane descTableScrollPane = new JScrollPane(descTable);
         descBorderPanel.setBorder(
-                BorderFactory.createTitledBorder(Resources.getText("Descriptor")));
+            BorderFactory.createTitledBorder(Messages.DESCRIPTOR));
         descBorderPanel.add(descTableScrollPane);
         // Add the two tables to the grid
         //
@@ -230,20 +231,20 @@
         emptyInfoTable();
         emptyDescTable();
         ((TitledBorder) infoBorderPanel.getBorder()).setTitle(
-                Resources.getText("MBeanInfo"));
-        String text = Resources.getText("Info") + ":";
+                Messages.MBEAN_INFO);
+        String text = Messages.INFO + ":";
         DefaultTableModel tableModel = (DefaultTableModel) infoTable.getModel();
         Object rowData[] = new Object[2];
         rowData[0] = new TableRowDivider(text);
         rowData[1] = new TableRowDivider("");
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("ObjectName");
+        rowData[0] = Messages.OBJECT_NAME;
         rowData[1] = mbean.getObjectName();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("ClassName");
+        rowData[0] = Messages.CLASS_NAME;
         rowData[1] = mbeanInfo.getClassName();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Description");
+        rowData[0] = Messages.DESCRIPTION;
         rowData[1] = mbeanInfo.getDescription();
         tableModel.addRow(rowData);
         addDescriptor(mbeanInfo.getDescriptor(), text);
@@ -252,13 +253,13 @@
         int i = 0;
         for (MBeanConstructorInfo mbci : mbeanInfo.getConstructors()) {
             addMBeanConstructorInfo(mbci,
-                    Resources.getText("Constructor") + "-" + i + ":");
+                    Messages.CONSTRUCTOR + "-" + i + ":");
             // MBeanParameterInfo
             //
             int j = 0;
             for (MBeanParameterInfo mbpi : mbci.getSignature()) {
                 addMBeanParameterInfo(mbpi,
-                        Resources.getText("Parameter") + "-" + i + "-" + j + ":");
+                        Messages.PARAMETER + "-" + i + "-" + j + ":");
                 j++;
             }
             i++;
@@ -271,29 +272,29 @@
         emptyInfoTable();
         emptyDescTable();
         ((TitledBorder) infoBorderPanel.getBorder()).setTitle(
-                Resources.getText("MBeanAttributeInfo"));
-        String text = Resources.getText("Attribute") + ":";
+                Messages.MBEAN_ATTRIBUTE_INFO);
+        String text = Messages.ATTRIBUTE + ":";
         DefaultTableModel tableModel = (DefaultTableModel) infoTable.getModel();
         Object rowData[] = new Object[2];
         rowData[0] = new TableRowDivider(text);
         rowData[1] = new TableRowDivider("");
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Name");
+        rowData[0] = Messages.NAME;
         rowData[1] = mbai.getName();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Description");
+        rowData[0] = Messages.DESCRIPTION;
         rowData[1] = mbai.getDescription();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Readable");
+        rowData[0] = Messages.READABLE;
         rowData[1] = mbai.isReadable();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Writable");
+        rowData[0] = Messages.WRITABLE;
         rowData[1] = mbai.isWritable();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Is");
+        rowData[0] = Messages.IS;
         rowData[1] = mbai.isIs();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Type");
+        rowData[0] = Messages.TYPE;
         rowData[1] = mbai.getType();
         tableModel.addRow(rowData);
         addDescriptor(mbai.getDescriptor(), text);
@@ -305,36 +306,36 @@
         emptyInfoTable();
         emptyDescTable();
         ((TitledBorder) infoBorderPanel.getBorder()).setTitle(
-                Resources.getText("MBeanOperationInfo"));
-        String text = Resources.getText("Operation") + ":";
+                Messages.MBEAN_OPERATION_INFO);
+        String text = Messages.OPERATION + ":";
         DefaultTableModel tableModel = (DefaultTableModel) infoTable.getModel();
         Object rowData[] = new Object[2];
         rowData[0] = new TableRowDivider(text);
         rowData[1] = new TableRowDivider("");
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Name");
+        rowData[0] = Messages.NAME;
         rowData[1] = mboi.getName();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Description");
+        rowData[0] = Messages.DESCRIPTION;
         rowData[1] = mboi.getDescription();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Impact");
+        rowData[0] = Messages.IMPACT;
         switch (mboi.getImpact()) {
             case MBeanOperationInfo.INFO:
-                rowData[1] = Resources.getText("INFO");
+                rowData[1] = Messages.INFO_CAPITALIZED;
                 break;
             case MBeanOperationInfo.ACTION:
-                rowData[1] = Resources.getText("ACTION");
+                rowData[1] = Messages.ACTION_CAPITALIZED;
                 break;
             case MBeanOperationInfo.ACTION_INFO:
-                rowData[1] = Resources.getText("ACTION_INFO");
+                rowData[1] = Messages.ACTION_INFO_CAPITALIZED;
                 break;
             case MBeanOperationInfo.UNKNOWN:
-                rowData[1] = Resources.getText("UNKNOWN");
+                rowData[1] = Messages.UNKNOWN_CAPITALIZED;
                 break;
         }
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("ReturnType");
+        rowData[0] = Messages.RETURN_TYPE;
         rowData[1] = mboi.getReturnType();
         tableModel.addRow(rowData);
         addDescriptor(mboi.getDescriptor(), text);
@@ -343,7 +344,7 @@
         int i = 0;
         for (MBeanParameterInfo mbpi : mboi.getSignature()) {
             addMBeanParameterInfo(mbpi,
-                    Resources.getText("Parameter") + "-" + i++ + ":");
+                    Messages.PARAMETER + "-" + i++ + ":");
         }
         tableModel.newDataAvailable(new TableModelEvent(tableModel));
     }
@@ -353,20 +354,20 @@
         emptyInfoTable();
         emptyDescTable();
         ((TitledBorder) infoBorderPanel.getBorder()).setTitle(
-                Resources.getText("MBeanNotificationInfo"));
-        String text = Resources.getText("Notification") + ":";
+                Messages.MBEAN_NOTIFICATION_INFO);
+        String text = Messages.NOTIFICATION + ":";
         DefaultTableModel tableModel = (DefaultTableModel) infoTable.getModel();
         Object rowData[] = new Object[2];
         rowData[0] = new TableRowDivider(text);
         rowData[1] = new TableRowDivider("");
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Name");
+        rowData[0] = Messages.NAME;
         rowData[1] = mbni.getName();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Description");
+        rowData[0] = Messages.DESCRIPTION;
         rowData[1] = mbni.getDescription();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("NotifTypes");
+        rowData[0] = Messages.NOTIF_TYPES;
         rowData[1] = Arrays.toString(mbni.getNotifTypes());
         tableModel.addRow(rowData);
         addDescriptor(mbni.getDescriptor(), text);
@@ -380,10 +381,10 @@
         rowData[0] = new TableRowDivider(text);
         rowData[1] = new TableRowDivider("");
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Name");
+        rowData[0] = Messages.NAME;
         rowData[1] = mbci.getName();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Description");
+        rowData[0] = Messages.DESCRIPTION;
         rowData[1] = mbci.getDescription();
         tableModel.addRow(rowData);
         addDescriptor(mbci.getDescriptor(), text);
@@ -397,13 +398,13 @@
         rowData[0] = new TableRowDivider(text);
         rowData[1] = new TableRowDivider("");
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Name");
+        rowData[0] = Messages.NAME;
         rowData[1] = mbpi.getName();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Description");
+        rowData[0] = Messages.DESCRIPTION;
         rowData[1] = mbpi.getDescription();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Type");
+        rowData[0] = Messages.TYPE;
         rowData[1] = mbpi.getType();
         tableModel.addRow(rowData);
         addDescriptor(mbpi.getDescriptor(), text);
--- a/src/share/classes/sun/tools/jconsole/inspector/XMBeanNotifications.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/inspector/XMBeanNotifications.java	Fri Jun 21 19:11:42 2013 -0700
@@ -26,7 +26,6 @@
 package sun.tools.jconsole.inspector;
 
 import javax.swing.*;
-import javax.swing.event.*;
 import javax.swing.table.*;
 import javax.swing.tree.*;
 import java.awt.Font;
@@ -46,19 +45,19 @@
 import javax.management.openmbean.TabularData;
 
 import sun.tools.jconsole.JConsole;
-import sun.tools.jconsole.Resources;
+import sun.tools.jconsole.Messages;
 
 @SuppressWarnings("serial")
 public class XMBeanNotifications extends JTable implements NotificationListener {
 
     private final static String[] columnNames = {
-        Resources.getText("TimeStamp"),
-        Resources.getText("Type"),
-        Resources.getText("UserData"),
-        Resources.getText("SeqNum"),
-        Resources.getText("Message"),
-        Resources.getText("Event"),
-        Resources.getText("Source")
+        Messages.TIME_STAMP,
+        Messages.TYPE,
+        Messages.USER_DATA,
+        Messages.SEQ_NUM,
+        Messages.MESSAGE,
+        Messages.EVENT,
+        Messages.SOURCE
     };
     private HashMap<ObjectName, XMBeanNotificationsListener> listeners =
             new HashMap<ObjectName, XMBeanNotificationsListener>();
@@ -183,7 +182,7 @@
         }
 
         if (cell != null) {
-            toolTip = Resources.getText("Double click to expand/collapse") +
+            toolTip = Messages.DOUBLE_CLICK_TO_EXPAND_FORWARD_SLASH_COLLAPSE+
                     ". " + cell.toString();
         } else {
             Object val =
@@ -599,7 +598,6 @@
 
     class XMBeanNotificationsListener implements NotificationListener {
 
-        private String[] columnNames;
         private XMBean xmbean;
         private DefaultMutableTreeNode node;
         private volatile long received;
@@ -615,7 +613,6 @@
             this.notifications = notifications;
             this.xmbean = xmbean;
             this.node = node;
-            this.columnNames = columnNames;
             register(node);
         }
 
--- a/src/share/classes/sun/tools/jconsole/inspector/XObject.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/inspector/XObject.java	Fri Jun 21 19:11:42 2013 -0700
@@ -28,17 +28,6 @@
 // java import
 import javax.swing.*;
 
-//
-
-// java import
-import java.io.*;
-import java.awt.*;
-import java.awt.dnd.*;
-import java.awt.datatransfer.*;
-import java.net.*;
-//
-
-
 /**
  * This provides a wrapper to the Object class to allow it to be
  displayed/manipulated as a GUI object.
--- a/src/share/classes/sun/tools/jconsole/inspector/XOpenTypeViewer.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/inspector/XOpenTypeViewer.java	Fri Jun 21 19:11:42 2013 -0700
@@ -28,33 +28,21 @@
 import javax.swing.*;
 import javax.swing.event.*;
 import javax.swing.table.*;
-import javax.swing.tree.*;
-import javax.swing.border.*;
 import java.awt.BorderLayout;
-import java.awt.GridLayout;
 import java.awt.FlowLayout;
 import java.awt.Component;
-import java.awt.EventQueue;
 import java.awt.Color;
 import java.awt.Font;
-import java.awt.Rectangle;
 import java.awt.event.*;
-import java.awt.Insets;
 import java.awt.Dimension;
-import java.awt.GridBagConstraints;
-import java.awt.GridBagLayout;
 import java.util.*;
-import java.io.*;
 import java.lang.reflect.Array;
 
-import javax.management.*;
 import javax.management.openmbean.*;
 
-import sun.tools.jconsole.BorderedComponent;
 import sun.tools.jconsole.JConsole;
-import sun.tools.jconsole.LabeledComponent;
+import sun.tools.jconsole.Messages;
 import sun.tools.jconsole.Resources;
-import sun.tools.jconsole.VariableGridLayout;
 
 @SuppressWarnings("serial")
 public class XOpenTypeViewer extends JPanel implements ActionListener {
@@ -65,9 +53,9 @@
     XOpenTypeDataListener listener = new XOpenTypeDataListener();
 
     private static final String compositeNavigationSingle =
-            Resources.getText("MBeansTab.compositeNavigationSingle");
+            Messages.MBEANS_TAB_COMPOSITE_NAVIGATION_SINGLE;
     private static final String tabularNavigationSingle =
-            Resources.getText("MBeansTab.tabularNavigationSingle");
+            Messages.MBEANS_TAB_TABULAR_NAVIGATION_SINGLE;
 
     private static TableCellEditor editor =
             new Utils.ReadOnlyTableCellEditor(new JTextField());
@@ -121,7 +109,6 @@
 
     static abstract class XOpenTypeData extends JTable {
         XOpenTypeData parent;
-        private Color defaultColor;
         protected int col1Width = -1;
         protected int col2Width = -1;
         private boolean init;
@@ -139,7 +126,7 @@
                 Object value = getModel().getValueAt(row, col);
                 if (value != null) {
                     if(isClickableElement(value))
-                        return Resources.getText("Double click to visualize")
+                        return Messages.DOUBLE_CLICK_TO_VISUALIZE
                         + ". " + value.toString();
                     else
                         return value.toString();
@@ -265,7 +252,7 @@
                 Object c1 = o1.get(key);
                 Object c2 = o2.get(key);
                 if (c1 instanceof Comparable && c2 instanceof Comparable) {
-                    int result = ((Comparable) c1).compareTo(c2);
+                    int result = ((Comparable<Object>) c1).compareTo(c2);
                     if (result != 0)
                         return result;
                 }
@@ -358,7 +345,7 @@
 
     static class XCompositeData extends XOpenTypeData {
         protected final String[] columnNames = {
-            Resources.getText("Name"), Resources.getText("Value")
+            Messages.NAME, Messages.VALUE
         };
         CompositeData composite;
 
@@ -398,8 +385,8 @@
 
         private void load(CompositeData data) {
             CompositeType type = data.getCompositeType();
-            Set keys = type.keySet();
-            Iterator it = keys.iterator();
+            Set<String> keys = type.keySet();
+            Iterator<String> it = keys.iterator();
             Object[] rowData = new Object[2];
             while (it.hasNext()) {
                 String key = (String) it.next();
@@ -408,13 +395,13 @@
                 if (val == null) {
                     rowData[1] = "";
                 } else {
-                    OpenType openType = type.getType(key);
+                    OpenType<?> openType = type.getType(key);
                     if (openType instanceof CompositeType) {
                         rowData[1] =
                                 new XCompositeData(this, (CompositeData) val);
                     } else if (openType instanceof ArrayType) {
                         rowData[1] =
-                                new XArrayData(this, (ArrayType) openType, val);
+                                new XArrayData(this, (ArrayType<?>) openType, val);
                     } else if (openType instanceof SimpleType) {
                         rowData[1] = val;
                     } else if (openType instanceof TabularType) {
@@ -453,21 +440,21 @@
 
         private int dimension;
         private int size;
-        private OpenType elemType;
+        private OpenType<?> elemType;
         private Object val;
         private boolean isCompositeType;
         private boolean isTabularType;
         private int currentIndex;
         private CompositeData[] elements;
-        private final String[] arrayColumns = {Resources.getText("Value")};
+        private final String[] arrayColumns = {Messages.VALUE};
         private Font normalFont, boldFont;
 
-        XArrayData(XOpenTypeData parent, ArrayType type, Object val) {
+        XArrayData(XOpenTypeData parent, ArrayType<?> type, Object val) {
             this(parent, type.getDimension(), type.getElementOpenType(), val);
         }
 
         XArrayData(XOpenTypeData parent, int dimension,
-                OpenType elemType, Object val) {
+                OpenType<?> elemType, Object val) {
             super(parent);
             this.dimension = dimension;
             this.elemType = elemType;
@@ -486,10 +473,9 @@
 
         public void viewed(XOpenTypeViewer viewer) throws Exception {
             if (size == 0)
-                throw new Exception(Resources.getText("Empty array"));
+                throw new Exception(Messages.EMPTY_ARRAY);
             if (dimension > 1)
-                throw new Exception(Resources.getText("Dimension is not " +
-                        "supported:") +
+                throw new Exception(Messages.DIMENSION_IS_NOT_SUPPORTED_COLON +
                         dimension);
             super.viewed(viewer);
         }
@@ -565,7 +551,7 @@
 
         public String toString() {
             if (dimension > 1) {
-                return Resources.getText("Dimension is not supported:") +
+                return Messages.DIMENSION_IS_NOT_SUPPORTED_COLON +
                         dimension;
             } else {
                 return elemType.getTypeName() + "[" + size + "]";
@@ -694,7 +680,7 @@
                     tabular.canIncrement() || tabular.canDecrement();
             if (hasMoreThanOneElement) {
                 tabularLabel.setText(
-                        Resources.getText("MBeansTab.tabularNavigationMultiple",
+                        Resources.format(Messages.MBEANS_TAB_TABULAR_NAVIGATION_MULTIPLE,
                         String.format("%d", tabular.getSelectedElementIndex() + 1),
                         String.format("%d", tabular.getElementCount())));
             } else {
@@ -717,7 +703,7 @@
                     array.canIncrement() || array.canDecrement();
             if (hasMoreThanOneElement) {
                 compositeLabel.setText(
-                        Resources.getText("MBeansTab.compositeNavigationMultiple",
+                        Resources.format(Messages.MBEANS_TAB_COMPOSITE_NAVIGATION_MULTIPLE,
                         String.format("%d", array.getSelectedElementIndex() + 1),
                         String.format("%d", array.getElementCount())));
             } else {
@@ -781,8 +767,8 @@
                 JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
 
         JPanel buttons = new JPanel(new FlowLayout(FlowLayout.LEFT));
-        tabularPrev = new JButton(Resources.getText("<"));
-        tabularNext = new JButton(Resources.getText(">"));
+        tabularPrev = new JButton(Messages.LESS_THAN);
+        tabularNext = new JButton(Messages.GREATER_THAN);
         JPanel tabularButtons = new JPanel(new FlowLayout(FlowLayout.LEFT));
         tabularButtons.add(tabularPrev);
         tabularPrev.addActionListener(this);
@@ -793,13 +779,13 @@
         tabularNext.addActionListener(this);
         tabularButtons.setBackground(Color.white);
 
-        prev = new JButton(Resources.getText("<<"));
+        prev = new JButton(Messages.A_LOT_LESS_THAN);
         prev.addActionListener(this);
         buttons.add(prev);
 
-        incr = new JButton(Resources.getText(">"));
+        incr = new JButton(Messages.GREATER_THAN);
         incr.addActionListener(this);
-        decr = new JButton(Resources.getText("<"));
+        decr = new JButton(Messages.LESS_THAN);
         decr.addActionListener(this);
 
         JPanel array = new JPanel();
--- a/src/share/classes/sun/tools/jconsole/inspector/XOperations.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/inspector/XOperations.java	Fri Jun 21 19:11:42 2013 -0700
@@ -26,22 +26,18 @@
 package sun.tools.jconsole.inspector;
 
 import javax.swing.*;
-import javax.swing.event.*;
-import javax.swing.table.*;
-import javax.swing.tree.*;
 import java.awt.BorderLayout;
 import java.awt.GridLayout;
 import java.awt.FlowLayout;
 import java.awt.Component;
 import java.awt.event.*;
 import java.util.*;
-import java.io.*;
 
 import javax.management.*;
 
-import sun.tools.jconsole.Resources;
 import sun.tools.jconsole.MBeansTab;
 import sun.tools.jconsole.JConsole;
+import sun.tools.jconsole.Messages;
 
 public abstract class XOperations extends JPanel implements ActionListener {
 
@@ -185,8 +181,8 @@
                     } else {
                         new ThreadDialog(
                                 button,
-                                Resources.getText("Method successfully invoked"),
-                                Resources.getText("Info"),
+                                Messages.METHOD_SUCCESSFULLY_INVOKED,
+                                Messages.INFO,
                                 JOptionPane.INFORMATION_MESSAGE).run();
                     }
                 } catch (Throwable t) {
@@ -196,9 +192,9 @@
                     }
                     new ThreadDialog(
                             button,
-                            Resources.getText("Problem invoking") + " " +
+                            Messages.PROBLEM_INVOKING + " " +
                             button.getText() + " : " + t.toString(),
-                            Resources.getText("Error"),
+                            Messages.ERROR,
                             JOptionPane.ERROR_MESSAGE).run();
                 }
             }
--- a/src/share/classes/sun/tools/jconsole/inspector/XPlotter.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/inspector/XPlotter.java	Fri Jun 21 19:11:42 2013 -0700
@@ -27,7 +27,6 @@
 
 import sun.tools.jconsole.Plotter;
 import javax.swing.JTable;
-import java.awt.Graphics;
 
 @SuppressWarnings("serial")
 public class XPlotter extends Plotter {
--- a/src/share/classes/sun/tools/jconsole/inspector/XPlottingViewer.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/inspector/XPlottingViewer.java	Fri Jun 21 19:11:42 2013 -0700
@@ -45,10 +45,7 @@
         new HashMap<String, XPlottingViewer>();
      private static HashMap<String, Timer> timerCache =
          new HashMap<String, Timer>();
-    private JPanel bordered;
-    private Number value;
     private MBeansTab tab;
-    private XMBean mbean;
     private String attributeName;
     private String key;
     private JTable table;
@@ -62,7 +59,6 @@
 
         this.tab = tab;
         this.key = key;
-        this.mbean = mbean;
         this.table = table;
         this.attributeName = attributeName;
         Plotter plotter = createPlotter(mbean, attributeName, key, table);
@@ -70,9 +66,9 @@
     }
 
     static void dispose(MBeansTab tab) {
-        Iterator it = plotterCache.keySet().iterator();
+        Iterator<String> it = plotterCache.keySet().iterator();
         while(it.hasNext()) {
-            String key = (String) it.next();
+            String key = it.next();
             if(key.startsWith(String.valueOf(tab.hashCode()))) {
                 it.remove();
             }
@@ -187,7 +183,7 @@
         final GridBagLayout gbl = new GridBagLayout();
         buttonPanel.setLayout(gbl);
         setLayout(new BorderLayout());
-        plotButton = new JButton(Resources.getText("Discard chart"));
+        plotButton = new JButton(Messages.DISCARD_CHART);
         plotButton.addActionListener(this);
         plotButton.setEnabled(true);
 
--- a/src/share/classes/sun/tools/jconsole/inspector/XSheet.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/inspector/XSheet.java	Fri Jun 21 19:11:42 2013 -0700
@@ -57,8 +57,6 @@
 import sun.tools.jconsole.*;
 import sun.tools.jconsole.inspector.XNodeInfo.Type;
 
-import static sun.tools.jconsole.Resources.*;
-
 @SuppressWarnings("serial")
 public class XSheet extends JPanel
         implements ActionListener, NotificationListener {
@@ -106,28 +104,24 @@
         southPanel = new JPanel();
         add(southPanel, BorderLayout.SOUTH);
         // create the refresh button
-        String refreshButtonKey = "MBeansTab.refreshAttributesButton";
-        refreshButton = new JButton(getText(refreshButtonKey));
-        refreshButton.setMnemonic(getMnemonicInt(refreshButtonKey));
-        refreshButton.setToolTipText(getText(refreshButtonKey + ".toolTip"));
+        refreshButton = new JButton(Messages.MBEANS_TAB_REFRESH_ATTRIBUTES_BUTTON);
+        refreshButton.setMnemonic(Resources.getMnemonicInt(Messages.MBEANS_TAB_REFRESH_ATTRIBUTES_BUTTON));
+        refreshButton.setToolTipText(Messages.MBEANS_TAB_REFRESH_ATTRIBUTES_BUTTON_TOOLTIP);
         refreshButton.addActionListener(this);
         // create the clear button
-        String clearButtonKey = "MBeansTab.clearNotificationsButton";
-        clearButton = new JButton(getText(clearButtonKey));
-        clearButton.setMnemonic(getMnemonicInt(clearButtonKey));
-        clearButton.setToolTipText(getText(clearButtonKey + ".toolTip"));
+        clearButton = new JButton(Messages.MBEANS_TAB_CLEAR_NOTIFICATIONS_BUTTON);
+        clearButton.setMnemonic(Resources.getMnemonicInt(Messages.MBEANS_TAB_CLEAR_NOTIFICATIONS_BUTTON));
+        clearButton.setToolTipText(Messages.MBEANS_TAB_CLEAR_NOTIFICATIONS_BUTTON_TOOLTIP);
         clearButton.addActionListener(this);
         // create the subscribe button
-        String subscribeButtonKey = "MBeansTab.subscribeNotificationsButton";
-        subscribeButton = new JButton(getText(subscribeButtonKey));
-        subscribeButton.setMnemonic(getMnemonicInt(subscribeButtonKey));
-        subscribeButton.setToolTipText(getText(subscribeButtonKey + ".toolTip"));
+        subscribeButton = new JButton(Messages.MBEANS_TAB_SUBSCRIBE_NOTIFICATIONS_BUTTON);
+        subscribeButton.setMnemonic(Resources.getMnemonicInt(Messages.MBEANS_TAB_SUBSCRIBE_NOTIFICATIONS_BUTTON));
+        subscribeButton.setToolTipText(Messages.MBEANS_TAB_SUBSCRIBE_NOTIFICATIONS_BUTTON_TOOLTIP);
         subscribeButton.addActionListener(this);
         // create the unsubscribe button
-        String unsubscribeButtonKey = "MBeansTab.unsubscribeNotificationsButton";
-        unsubscribeButton = new JButton(getText(unsubscribeButtonKey));
-        unsubscribeButton.setMnemonic(getMnemonicInt(unsubscribeButtonKey));
-        unsubscribeButton.setToolTipText(getText(unsubscribeButtonKey + ".toolTip"));
+        unsubscribeButton = new JButton(Messages.MBEANS_TAB_UNSUBSCRIBE_NOTIFICATIONS_BUTTON);
+        unsubscribeButton.setMnemonic(Resources.getMnemonicInt(Messages.MBEANS_TAB_UNSUBSCRIBE_NOTIFICATIONS_BUTTON));
+        unsubscribeButton.setToolTipText(Messages.MBEANS_TAB_UNSUBSCRIBE_NOTIFICATIONS_BUTTON_TOOLTIP);
         unsubscribeButton.addActionListener(this);
         // create XMBeanAttributes container
         mbeanAttributes = new XMBeanAttributes(mbeansTab);
@@ -238,7 +232,7 @@
                         t.printStackTrace();
                     }
                     showErrorDialog(t.toString(),
-                            Resources.getText("Problem displaying MBean"));
+                            Messages.PROBLEM_DISPLAYING_MBEAN);
                 }
             }
         };
@@ -279,7 +273,7 @@
                                             new JPanel(new BorderLayout());
                                     attributeBorderPanel.setBorder(
                                             BorderFactory.createTitledBorder(
-                                            Resources.getText("Attribute value")));
+                                            Messages.ATTRIBUTE_VALUE));
                                     JPanel attributeValuePanel =
                                             new JPanel(new BorderLayout());
                                     attributeValuePanel.setBorder(
@@ -314,7 +308,7 @@
                                         t.printStackTrace();
                                     }
                                     showErrorDialog(t.toString(),
-                                            Resources.getText("Problem displaying MBean"));
+                                            Messages.PROBLEM_DISPLAYING_MBEAN);
                                 }
                             }
                         };
@@ -333,7 +327,7 @@
                 JPanel operationPanel = new JPanel(new BorderLayout());
                 JPanel operationBorderPanel = new JPanel(new BorderLayout());
                 operationBorderPanel.setBorder(BorderFactory.createTitledBorder(
-                        Resources.getText("Operation invocation")));
+                        Messages.OPERATION_INVOCATION));
                 operationBorderPanel.add(new JScrollPane(mbeanOperations));
                 operationPanel.add(operationBorderPanel, BorderLayout.NORTH);
                 mbi.addMBeanOperationInfo(mboi);
@@ -389,7 +383,7 @@
                         mainPanel.removeAll();
                         JPanel borderPanel = new JPanel(new BorderLayout());
                         borderPanel.setBorder(BorderFactory.createTitledBorder(
-                                Resources.getText("Attribute values")));
+                                Messages.ATTRIBUTE_VALUES));
                         borderPanel.add(new JScrollPane(mbeanAttributes));
                         mainPanel.add(borderPanel, BorderLayout.CENTER);
                         // add the refresh button to the south panel
@@ -409,7 +403,7 @@
                         t.printStackTrace();
                     }
                     showErrorDialog(t.toString(),
-                            Resources.getText("Problem displaying MBean"));
+                            Messages.PROBLEM_DISPLAYING_MBEAN);
                 }
             }
         };
@@ -442,7 +436,7 @@
                         mainPanel.removeAll();
                         JPanel borderPanel = new JPanel(new BorderLayout());
                         borderPanel.setBorder(BorderFactory.createTitledBorder(
-                                Resources.getText("Operation invocation")));
+                                Messages.OPERATION_INVOCATION));
                         borderPanel.add(new JScrollPane(mbeanOperations));
                         mainPanel.add(borderPanel, BorderLayout.CENTER);
                         southPanel.setVisible(false);
@@ -459,7 +453,7 @@
                         t.printStackTrace();
                     }
                     showErrorDialog(t.toString(),
-                            Resources.getText("Problem displaying MBean"));
+                            Messages.PROBLEM_DISPLAYING_MBEAN);
                 }
             }
         };
@@ -479,7 +473,7 @@
         mainPanel.removeAll();
         JPanel borderPanel = new JPanel(new BorderLayout());
         borderPanel.setBorder(BorderFactory.createTitledBorder(
-                Resources.getText("Notification buffer")));
+                Messages.NOTIFICATION_BUFFER));
         borderPanel.add(new JScrollPane(mbeanNotifications));
         mainPanel.add(borderPanel, BorderLayout.CENTER);
         // add the subscribe/unsubscribe/clear buttons to the south panel
@@ -528,7 +522,7 @@
                         t.printStackTrace();
                     }
                     showErrorDialog(t.getMessage(),
-                            Resources.getText("Problem adding listener"));
+                            Messages.PROBLEM_ADDING_LISTENER);
                 }
             }
         }.execute();
@@ -557,7 +551,7 @@
                         t.printStackTrace();
                     }
                     showErrorDialog(t.getMessage(),
-                            Resources.getText("Problem removing listener"));
+                            Messages.PROBLEM_REMOVING_LISTENER);
                 }
             }
         }.execute();
@@ -586,7 +580,7 @@
     // Call on EDT
     private void updateReceivedNotifications(
             DefaultMutableTreeNode emitter, long received, boolean bold) {
-        String text = Resources.getText("Notifications") + "[" + received + "]";
+        String text = Messages.NOTIFICATIONS + "[" + received + "]";
         DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode) mbeansTab.getTree().getLastSelectedPathComponent();
         if (bold && emitter != selectedNode) {
             text = "<html><b>" + text + "</b></html>";
@@ -600,7 +594,7 @@
     // Call on EDT
     private void clearNotifications() {
         updateNotificationsNodeLabel(currentNode,
-                Resources.getText("Notifications"));
+                Messages.NOTIFICATIONS);
     }
 
     /**
@@ -609,7 +603,7 @@
     // Call on EDT
     private void clearNotifications0() {
         updateNotificationsNodeLabel(currentNode,
-                Resources.getText("Notifications") + "[0]");
+                Messages.NOTIFICATIONS + "[0]");
     }
 
     /**
@@ -712,7 +706,7 @@
             new ThreadDialog(
                     (Component) e.getSource(),
                     message,
-                    Resources.getText("Operation return value"),
+                    Messages.OPERATION_RETURN_VALUE,
                     JOptionPane.INFORMATION_MESSAGE).run();
         } // Got notification
         else if (e.getType().equals(
--- a/src/share/classes/sun/tools/jconsole/inspector/XTable.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/inspector/XTable.java	Fri Jun 21 19:11:42 2013 -0700
@@ -36,7 +36,7 @@
 public abstract class XTable extends JTable {
     static final int NAME_COLUMN = 0;
     static final int VALUE_COLUMN = 1;
-    private Color defaultColor, editableColor, droppableColor, errorColor;
+    private Color defaultColor, editableColor, errorColor;
     private Font normalFont, boldFont;
 
     public XTable () {
@@ -139,7 +139,6 @@
         if (defaultColor == null) {
             defaultColor = tcr.getForeground();
             editableColor = Color.blue;
-            droppableColor = Color.green;
             errorColor = Color.red;
             // this sometimes happens for some reason
             if (defaultColor == null) {
--- a/src/share/classes/sun/tools/jconsole/inspector/XTextField.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/inspector/XTextField.java	Fri Jun 21 19:11:42 2013 -0700
@@ -26,12 +26,7 @@
 package sun.tools.jconsole.inspector;
 
 import java.awt.*;
-import java.awt.dnd.*;
 import java.awt.event.*;
-import java.awt.datatransfer.*;
-import java.io.*;
-import java.util.*;
-import javax.swing.plaf.*;
 import javax.swing.event.*;
 import javax.swing.*;
 
@@ -44,16 +39,8 @@
     implements DocumentListener,
                ActionListener {
 
-    private static final Color selF = Color.red;
-    private static final Color selB = Color.yellow;
-    private Color fore=null, back=null;
-    private HashMap items = null; //used for popup menu selection
     private XObject selectedObject;
-    private XObject currentObject;
-    private Class expectedClass;
-    private Object value;
     protected JTextField textField;
-    private JButton browseObjects;
 
     private static boolean allowNullSelection = false;
 
@@ -81,13 +68,12 @@
     }
 
     public XTextField(Object value,
-                      Class expectedClass,
+                      Class<?> expectedClass,
                       int colWidth,
                       boolean isCallable,
                       JButton button,
                       XOperations operation) {
         super(new BorderLayout());
-        this.expectedClass = expectedClass;
         this.button = button;
         this.operation = operation;
         add(textField = new JTextField(value.toString(),colWidth),
@@ -112,17 +98,13 @@
         return allowNullSelection;
     }
 
-    protected void init(Object value, Class expectedClass) {
-        this.expectedClass = expectedClass;
-        this.value = value;
-        boolean fieldEditable =  Utils.isEditableType(expectedClass.getName());
+    protected void init(Object value, Class<?> expectedClass) {
+         boolean fieldEditable =  Utils.isEditableType(expectedClass.getName());
         clearObject();
         if (value != null) {
-            currentObject = new XObject(value);
             textField.setText(value.toString());
         }
         else {
-            currentObject = XObject.NULL_OBJECT;
             //null String value for the moment
             textField.setText("");
         }
@@ -140,35 +122,12 @@
         }
     }
 
-
-
-
-
-    private synchronized void setObject(XObject object) {
-        clearObject();
-        selectedObject = object;
-        currentObject = object;
-        setSelectedColors();
-        textField.setText(object.getText());
-        textField.getDocument().addDocumentListener(this);
-        paintImmediately(getVisibleRect());
-    }
-
     private synchronized void clearObject() {
         textField.getDocument().removeDocumentListener(this);
         selectedObject = null;
-        currentObject = null;
         setDefaultColors();
     }
 
-    private synchronized void setSelectedColors() {
-        // fore = textField.getForeground();
-        // back = textField.getBackground();
-
-        //textField.setForeground(Color.red);
-        // textField.setBackground(Color.yellow);
-    }
-
     private synchronized void setDefaultColors() {
         //  if (fore != null) textField.setForeground(fore);
         // if (back != null)  textField.setBackground(back);
@@ -194,12 +153,6 @@
         }
     }
 
-    private JPopupMenu buildEditPopupMenu() {
-        JPopupMenu menu = new JPopupMenu();
-        return menu;
-    }
-
-
     // ACTIONLISTENER IMPLEMENTATION
     public void actionPerformed(ActionEvent e) {
         if (e.getSource() instanceof JTextField) {
--- a/src/share/classes/sun/tools/jconsole/inspector/XTree.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/inspector/XTree.java	Fri Jun 21 19:11:42 2013 -0700
@@ -32,7 +32,7 @@
 import javax.swing.tree.*;
 import sun.tools.jconsole.JConsole;
 import sun.tools.jconsole.MBeansTab;
-import sun.tools.jconsole.Resources;
+import sun.tools.jconsole.Messages;
 import sun.tools.jconsole.inspector.XNodeInfo;
 import static sun.tools.jconsole.inspector.XNodeInfo.Type;
 
@@ -182,7 +182,7 @@
      * Returns true if any of the children nodes is a non MBean metadata node.
      */
     private boolean hasNonMetadataNodes(DefaultMutableTreeNode node) {
-        for (Enumeration e = node.children(); e.hasMoreElements();) {
+        for (Enumeration<?> e = node.children(); e.hasMoreElements();) {
             DefaultMutableTreeNode n = (DefaultMutableTreeNode) e.nextElement();
             Object uo = n.getUserObject();
             if (uo instanceof XNodeInfo) {
@@ -205,7 +205,7 @@
      * Returns true if any of the children nodes is an MBean metadata node.
      */
     public boolean hasMetadataNodes(DefaultMutableTreeNode node) {
-        for (Enumeration e = node.children(); e.hasMoreElements();) {
+        for (Enumeration<?> e = node.children(); e.hasMoreElements();) {
             DefaultMutableTreeNode n = (DefaultMutableTreeNode) e.nextElement();
             Object uo = n.getUserObject();
             if (uo instanceof XNodeInfo) {
@@ -251,7 +251,7 @@
         Set<DefaultMutableTreeNode> metadataNodes =
                 new HashSet<DefaultMutableTreeNode>();
         DefaultTreeModel model = (DefaultTreeModel) getModel();
-        for (Enumeration e = node.children(); e.hasMoreElements();) {
+        for (Enumeration<?> e = node.children(); e.hasMoreElements();) {
             DefaultMutableTreeNode n = (DefaultMutableTreeNode) e.nextElement();
             Object uo = n.getUserObject();
             if (uo instanceof XNodeInfo) {
@@ -596,7 +596,7 @@
             if (ai != null && ai.length > 0) {
                 DefaultMutableTreeNode attributes = new DefaultMutableTreeNode();
                 XNodeInfo attributesUO = new XNodeInfo(Type.ATTRIBUTES, mbean,
-                        Resources.getText("Attributes"), null);
+                        Messages.ATTRIBUTES, null);
                 attributes.setUserObject(attributesUO);
                 node.insert(attributes, childIndex++);
                 for (MBeanAttributeInfo mbai : ai) {
@@ -613,7 +613,7 @@
             if (oi != null && oi.length > 0) {
                 DefaultMutableTreeNode operations = new DefaultMutableTreeNode();
                 XNodeInfo operationsUO = new XNodeInfo(Type.OPERATIONS, mbean,
-                        Resources.getText("Operations"), null);
+                        Messages.OPERATIONS, null);
                 operations.setUserObject(operationsUO);
                 node.insert(operations, childIndex++);
                 for (MBeanOperationInfo mboi : oi) {
@@ -646,7 +646,7 @@
             if (isBroadcaster != null && isBroadcaster.booleanValue()) {
                 DefaultMutableTreeNode notifications = new DefaultMutableTreeNode();
                 XNodeInfo notificationsUO = new XNodeInfo(Type.NOTIFICATIONS, mbean,
-                        Resources.getText("Notifications"), null);
+                        Messages.NOTIFICATIONS, null);
                 notifications.setUserObject(notificationsUO);
                 node.insert(notifications, childIndex++);
                 if (ni != null && ni.length > 0) {
--- a/src/share/classes/sun/tools/jconsole/inspector/XTreeRenderer.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/inspector/XTreeRenderer.java	Fri Jun 21 19:11:42 2013 -0700
@@ -30,8 +30,6 @@
 import javax.swing.JTree;
 import javax.swing.tree.DefaultMutableTreeNode;
 import javax.swing.tree.DefaultTreeCellRenderer;
-import sun.tools.jconsole.Resources;
-import sun.tools.jconsole.inspector.XNodeInfo.Type;
 
 @SuppressWarnings("serial")
 public class XTreeRenderer extends DefaultTreeCellRenderer {
--- a/src/share/classes/sun/tools/jconsole/resources/JConsoleResources.java	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,467 +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.tools.jconsole.resources;
-
-import java.util.*;
-
-import static java.awt.event.KeyEvent.*;
-
-/**
- * <p> This class represents the <code>ResourceBundle</code>
- * for the following package(s):
- *
- * <ol>
- * <li> sun.tools.jconsole
- * </ol>
- *
- * <P>
- * Subclasses must override <code>getContents0</code> and provide an array,
- * where each item in the array consists of a <code>String</code> key,
- * and either a <code>String</code> value associated with that key,
- * or if the keys ends with ".mnemonic", an element
- * representing a mnemomic keycode <code>int</code> or <code>char</code>.
- */
-public class JConsoleResources extends ListResourceBundle {
-
-    /**
-     * Returns the contents of this <code>ResourceBundle</code>.
-     *
-     * <p>
-     *
-     * @return the contents of this <code>ResourceBundle</code>.
-     */
-    protected Object[][] getContents0() {
-        Object[][] temp = new Object[][] {
-                // NOTE 1: The value strings in this file containing "{0}" are
-        //         processed by the java.text.MessageFormat class.  Any
-        //         single quotes appearing in these strings need to be
-        //         doubled up.
-        //
-        // NOTE 2: To make working with this file a bit easier, please
-        //         maintain these messages in ASCII sorted order by
-        //         message key.
-        //
-        // LOCALIZE THIS
-        {" 1 day"," 1 day"},
-        {" 1 hour"," 1 hour"},
-        {" 1 min"," 1 min"},
-        {" 1 month"," 1 month"},
-        {" 1 year"," 1 year"},
-        {" 2 hours"," 2 hours"},
-        {" 3 hours"," 3 hours"},
-        {" 3 months"," 3 months"},
-        {" 5 min"," 5 min"},
-        {" 6 hours"," 6 hours"},
-        {" 6 months"," 6 months"},
-        {" 7 days"," 7 days"},
-        {"10 min","10 min"},
-        {"12 hours","12 hours"},
-        {"30 min","30 min"},
-        {"<","<"},
-        {"<<","<<"},
-        {">",">"},
-        {"ACTION","ACTION"},
-        {"ACTION_INFO","ACTION_INFO"},
-        {"All","All"},
-        {"Apply","Apply"},
-        {"Architecture","Architecture"},
-        {"Array, OpenType", "Array, OpenType"},
-        {"Array, OpenType, Numeric value viewer","Array, OpenType, Numeric value viewer"},
-        {"Attribute","Attribute"},
-        {"Attribute value","Attribute value"},
-        {"Attribute values","Attribute values"},
-        {"Attributes","Attributes"},
-        {"Blank", "Blank"},
-        {"BlockedCount WaitedCount",
-             "Total blocked: {0}  Total waited: {1}\n"},
-        {"Boot class path","Boot class path"},
-        {"BorderedComponent.moreOrLessButton.toolTip", "Toggle to show more or less information"},
-        {"CPU Usage","CPU Usage"},
-        {"CPUUsageFormat","CPU Usage: {0}%"},
-        {"Cancel","Cancel"},
-        {"Cascade", "Cascade"},
-        {"Cascade.mnemonic", 'C'},
-        {"Chart:", "Chart:"},
-        {"Chart:.mnemonic", 'C'},
-        {"Class path","Class path"},
-        {"Class","Class"},
-        {"ClassName","ClassName"},
-        {"ClassTab.infoLabelFormat", "<html>Loaded: {0}    Unloaded: {1}    Total: {2}</html>"},
-        {"ClassTab.loadedClassesPlotter.accessibleName", "Chart for Loaded Classes."},
-        {"Classes","Classes"},
-        {"Close","Close"},
-        {"Column.Name", "Name"},
-        {"Column.PID", "PID"},
-        {"Committed memory","Committed memory"},
-        {"Committed virtual memory","Committed virtual memory"},
-        {"Committed", "Committed"},
-        {"Compiler","Compiler"},
-        {"CompositeData","CompositeData"},
-        {"Config","Config"},
-        {"Connect", "Connect"},
-        {"Connect.mnemonic", 'C'},
-        {"Connect...","Connect..."},
-        {"ConnectDialog.connectButton.toolTip", "Connect to Java Virtual Machine"},
-        {"ConnectDialog.accessibleDescription", "Dialog for making a new connection to a local or remote Java Virtual Machine"},
-        {"ConnectDialog.masthead.accessibleName", "Masthead Graphic"},
-        {"ConnectDialog.masthead.title", "New Connection"},
-        {"ConnectDialog.statusBar.accessibleName", "Status Bar"},
-        {"ConnectDialog.title", "JConsole: New Connection"},
-        {"Connected. Click to disconnect.","Connected. Click to disconnect."},
-        {"Connection failed","Connection failed"},
-        {"Connection", "Connection"},
-        {"Connection.mnemonic", 'C'},
-        {"Connection name", "Connection name"},
-        {"ConnectionName (disconnected)","{0} (disconnected)"},
-        {"Constructor","Constructor"},
-        {"Current classes loaded", "Current classes loaded"},
-        {"Current heap size","Current heap size"},
-        {"Current value","Current value: {0}"},
-        {"Create", "Create"},
-        {"Daemon threads","Daemon threads"},
-        {"Disconnected. Click to connect.","Disconnected. Click to connect."},
-        {"Double click to expand/collapse","Double click to expand/collapse"},
-        {"Double click to visualize", "Double click to visualize"},
-        {"Description", "Description"},
-        {"Description: ", "Description: "},
-        {"Descriptor", "Descriptor"},
-        {"Details", "Details"},
-        {"Detect Deadlock", "Detect Deadlock"},
-        {"Detect Deadlock.mnemonic", 'D'},
-        {"Detect Deadlock.toolTip", "Detect deadlocked threads"},
-        {"Dimension is not supported:","Dimension is not supported:"},
-        {"Discard chart", "Discard chart"},
-        {"DurationDaysHoursMinutes","{0,choice,1#{0,number,integer} day |1.0<{0,number,integer} days }" +
-                                    "{1,choice,0<{1,number,integer} hours |1#{1,number,integer} hour |1<{1,number,integer} hours }" +
-                                    "{2,choice,0<{2,number,integer} minutes|1#{2,number,integer} minute|1.0<{2,number,integer} minutes}"},
-
-        {"DurationHoursMinutes","{0,choice,1#{0,number,integer} hour |1<{0,number,integer} hours }" +
-                                "{1,choice,0<{1,number,integer} minutes|1#{1,number,integer} minute|1.0<{1,number,integer} minutes}"},
-
-        {"DurationMinutes","{0,choice,1#{0,number,integer} minute|1.0<{0,number,integer} minutes}"},
-        {"DurationSeconds","{0} seconds"},
-        {"Empty array", "Empty array"},
-        {"Empty opentype viewer", "Empty opentype viewer"},
-        {"Error","Error"},
-        {"Error: MBeans already exist","Error: MBeans already exist"},
-        {"Error: MBeans do not exist","Error: MBeans do not exist"},
-        {"Error:","Error:"},
-        {"Event","Event"},
-        {"Exit", "Exit"},
-        {"Exit.mnemonic", 'x'},
-        {"Fail to load plugin", "Warning: Fail to load plugin: {0}"},
-        {"FileChooser.fileExists.cancelOption", "Cancel"},
-        {"FileChooser.fileExists.message", "<html><center>File already exists:<br>{0}<br>Do you want to replace it?"},
-        {"FileChooser.fileExists.okOption", "Replace"},
-        {"FileChooser.fileExists.title", "File Exists"},
-        {"FileChooser.savedFile", "<html>Saved to file:<br>{0}<br>({1} bytes)"},
-        {"FileChooser.saveFailed.message", "<html><center>Save to file failed:<br>{0}<br>{1}"},
-        {"FileChooser.saveFailed.title", "Save Failed"},
-        {"Free physical memory","Free physical memory"},
-        {"Free swap space","Free swap space"},
-        {"Garbage collector","Garbage collector"},
-        {"GTK","GTK"},
-        {"GcInfo","Name = ''{0}'', Collections = {1,choice,-1#Unavailable|0#{1,number,integer}}, Total time spent = {2}"},
-        {"GC time","GC time"},
-        {"GC time details","{0} on {1} ({2} collections)"},
-        {"Heap Memory Usage","Heap Memory Usage"},
-        {"Heap", "Heap"},
-        {"Help.AboutDialog.accessibleDescription", "Dialog containing information about JConsole and JDK versions"},
-        {"Help.AboutDialog.jConsoleVersion", "JConsole version:<br>{0}"},
-        {"Help.AboutDialog.javaVersion", "Java VM version:<br>{0}"},
-        {"Help.AboutDialog.masthead.accessibleName", "Masthead Graphic"},
-        {"Help.AboutDialog.masthead.title", "About JConsole"},
-        {"Help.AboutDialog.title", "JConsole: About"},
-        {"Help.AboutDialog.userGuideLink", "JConsole User Guide:<br>{0}"},
-        {"Help.AboutDialog.userGuideLink.mnemonic", 'U'},
-        {"Help.AboutDialog.userGuideLink.url", "http://java.sun.com/javase/6/docs/technotes/guides/management/jconsole.html"},
-        {"HelpMenu.About.title", "About JConsole"},
-        {"HelpMenu.About.title.mnemonic", 'A'},
-        {"HelpMenu.UserGuide.title", "Online User Guide"},
-        {"HelpMenu.UserGuide.title.mnemonic", 'U'},
-        {"HelpMenu.title", "Help"},
-        {"HelpMenu.title.mnemonic", 'H'},
-        {"Hotspot MBeans...", "Hotspot MBeans..."},
-        {"Hotspot MBeans....mnemonic", 'H'},
-        {"Hotspot MBeans.dialog.accessibleDescription", "Dialog for managing Hotspot MBeans"},
-        {"Impact","Impact"},
-        {"Info","Info"},
-        {"INFO","INFO"},
-        {"Insecure", "Insecure connection"},
-        {"Invalid plugin path", "Warning: Invalid plugin path: {0}"},
-        {"Invalid URL", "Invalid URL: {0}"},
-        {"Is","Is"},
-        {"Java Monitoring & Management Console", "Java Monitoring & Management Console"},
-        {"JConsole: ","JConsole: {0}"},
-        {"JConsole version","JConsole version \"{0}\""},
-        {"JConsole.accessibleDescription", "Java Monitoring & Management Console"},
-        {"JIT compiler","JIT compiler"},
-        {"Java Virtual Machine","Java Virtual Machine"},
-        {"Java","Java"},
-        {"Library path","Library path"},
-        {"Listeners","Listeners"},
-        {"Live Threads","Live threads"},
-        {"Loaded", "Loaded"},
-        {"Local Process:", "Local Process:"},
-        {"Local Process:.mnemonic", 'L'},
-        {"Look and Feel","Look and Feel"},
-        {"Masthead.font", "Dialog-PLAIN-25"},
-        {"Management Not Enabled","<b>Note</b>: The management agent is not enabled on this process."},
-        {"Management Will Be Enabled","<b>Note</b>: The management agent will be enabled on this process."},
-        {"MBeanAttributeInfo","MBeanAttributeInfo"},
-        {"MBeanInfo","MBeanInfo"},
-        {"MBeanNotificationInfo","MBeanNotificationInfo"},
-        {"MBeanOperationInfo","MBeanOperationInfo"},
-        {"MBeans","MBeans"},
-        {"MBeansTab.clearNotificationsButton", "Clear"},
-        {"MBeansTab.clearNotificationsButton.mnemonic", 'C'},
-        {"MBeansTab.clearNotificationsButton.toolTip", "Clear notifications"},
-        {"MBeansTab.compositeNavigationMultiple", "Composite Navigation {0}/{1}"},
-        {"MBeansTab.compositeNavigationSingle", "Composite Navigation"},
-        {"MBeansTab.refreshAttributesButton", "Refresh"},
-        {"MBeansTab.refreshAttributesButton.mnemonic", 'R'},
-        {"MBeansTab.refreshAttributesButton.toolTip", "Refresh attributes"},
-        {"MBeansTab.subscribeNotificationsButton", "Subscribe"},
-        {"MBeansTab.subscribeNotificationsButton.mnemonic", 'S'},
-        {"MBeansTab.subscribeNotificationsButton.toolTip", "Start listening for notifications"},
-        {"MBeansTab.tabularNavigationMultiple", "Tabular Navigation {0}/{1}"},
-        {"MBeansTab.tabularNavigationSingle", "Tabular Navigation"},
-        {"MBeansTab.unsubscribeNotificationsButton", "Unsubscribe"},
-        {"MBeansTab.unsubscribeNotificationsButton.mnemonic", 'U'},
-        {"MBeansTab.unsubscribeNotificationsButton.toolTip", "Stop listening for notifications"},
-        {"Manage Hotspot MBeans in: ", "Manage Hotspot MBeans in: "},
-        {"Max","Max"},
-        {"Maximum heap size","Maximum heap size"},
-        {"Memory","Memory"},
-        {"MemoryPoolLabel", "Memory Pool \"{0}\""},
-        {"MemoryTab.heapPlotter.accessibleName", "Memory usage chart for heap."},
-        {"MemoryTab.infoLabelFormat", "<html>Used: {0}    Committed: {1}    Max: {2}</html>"},
-        {"MemoryTab.nonHeapPlotter.accessibleName", "Memory usage chart for non heap."},
-        {"MemoryTab.poolChart.aboveThreshold", "which is above the threshold of {0}.\n"},
-        {"MemoryTab.poolChart.accessibleName", "Memory Pool Usage Chart."},
-        {"MemoryTab.poolChart.belowThreshold", "which is below the threshold of {0}.\n"},
-        {"MemoryTab.poolPlotter.accessibleName", "Memory usage chart for {0}."},
-        {"Message","Message"},
-        {"Method successfully invoked", "Method successfully invoked"},
-        {"Minimize All", "Minimize All"},
-        {"Minimize All.mnemonic", 'M'},
-        {"Minus Version", "This is {0} version {1}"},
-        {"Monitor locked",
-             "   - locked {0}\n"},
-        {"Motif","Motif"},
-        {"Name Build and Mode","{0} (build {1}, {2})"},
-        {"Name and Build","{0} (build {1})"},
-        {"Name","Name"},
-        {"Name: ","Name: "},
-        {"Name State",
-             "Name: {0}\n" +
-             "State: {1}\n"},
-        {"Name State LockName",
-             "Name: {0}\n" +
-             "State: {1} on {2}\n"},
-        {"Name State LockName LockOwner",
-             "Name: {0}\n" +
-             "State: {1} on {2} owned by: {3}\n"},
-        {"New Connection...", "New Connection..."},
-        {"New Connection....mnemonic", 'N'},
-        {"New value applied","New value applied"},
-        {"No attribute selected","No attribute selected"},
-        {"No deadlock detected","No deadlock detected"},
-        {"No value selected","No value selected"},
-        {"Non-Heap Memory Usage","Non-Heap Memory Usage"},
-        {"Non-Heap", "Non-Heap"},
-        {"Not Yet Implemented","Not Yet Implemented"},
-        {"Not a valid event broadcaster", "Not a valid event broadcaster"},
-        {"Notification","Notification"},
-        {"Notification buffer","Notification buffer"},
-        {"Notifications","Notifications"},
-        {"NotifTypes", "NotifTypes"},
-        {"Number of Threads","Number of Threads"},
-        {"Number of Loaded Classes","Number of Loaded Classes"},
-        {"Number of processors","Number of processors"},
-        {"ObjectName","ObjectName"},
-        {"Operating System","Operating System"},
-        {"Operation","Operation"},
-        {"Operation invocation","Operation invocation"},
-        {"Operation return value", "Operation return value"},
-        {"Operations","Operations"},
-        {"Overview","Overview"},
-        {"OverviewPanel.plotter.accessibleName", "Chart for {0}."},
-        {"Parameter", "Parameter"},
-        {"Password: ", "Password: "},
-        {"Password: .mnemonic", 'P'},
-        {"Password.accessibleName", "Password"},
-        {"Peak","Peak"},
-        {"Perform GC", "Perform GC"},
-        {"Perform GC.mnemonic", 'G'},
-        {"Perform GC.toolTip", "Request Garbage Collection"},
-        {"Plotter.accessibleName", "Chart"},
-        {"Plotter.accessibleName.keyAndValue", "{0}={1}\n"},
-        {"Plotter.accessibleName.noData", "No data plotted."},
-        {"Plotter.saveAsMenuItem", "Save data as..."},
-        {"Plotter.saveAsMenuItem.mnemonic", 'a'},
-        {"Plotter.timeRangeMenu", "Time Range"},
-        {"Plotter.timeRangeMenu.mnemonic", 'T'},
-        {"Problem adding listener","Problem adding listener"},
-        {"Problem displaying MBean", "Problem displaying MBean"},
-        {"Problem invoking", "Problem invoking"},
-        {"Problem removing listener","Problem removing listener"},
-        {"Problem setting attribute","Problem setting attribute"},
-        {"Process CPU time","Process CPU time"},
-        {"R/W","R/W"},
-        {"Readable","Readable"},
-        {"Received","Received"},
-        {"Reconnect","Reconnect"},
-        {"Remote Process:", "Remote Process:"},
-        {"Remote Process:.mnemonic", 'R'},
-        {"Remote Process.textField.accessibleName", "Remote Process"},
-        {"Remove","Remove"},
-        {"Restore All", "Restore All"},
-        {"Restore All.mnemonic", 'R'},
-        {"Return value", "Return value"},
-        {"ReturnType", "ReturnType"},
-        {"SeqNum","SeqNum"},
-        {"Size Bytes", "{0,number,integer} bytes"},
-        {"Size Gb","{0} Gb"},
-        {"Size Kb","{0} Kb"},
-        {"Size Mb","{0} Mb"},
-        {"Source","Source"},
-        {"Stack trace",
-              "\nStack trace: \n"},
-        {"Success:","Success:"},
-        // Note: SummaryTab.headerDateTimeFormat can be one the following:
-        // 1. A combination of two styles for date and time, using the
-        //    constants from class DateFormat: SHORT, MEDIUM, LONG, FULL.
-        //    Example: "MEDIUM,MEDIUM" or "FULL,SHORT"
-        // 2. An explicit string pattern used for creating an instance
-        //    of the class SimpleDateFormat.
-        //    Example: "yyyy-MM-dd HH:mm:ss" or "M/d/yyyy h:mm:ss a"
-        {"SummaryTab.headerDateTimeFormat", "FULL,FULL"},
-        {"SummaryTab.pendingFinalization.label", "Pending finalization"},
-        {"SummaryTab.pendingFinalization.value", "{0} objects"},
-        {"SummaryTab.tabName", "VM Summary"},
-        {"SummaryTab.vmVersion","{0} version {1}"},
-        {"TabularData are not supported", "TabularData are not supported"},
-        {"Threads","Threads"},
-        {"ThreadTab.infoLabelFormat", "<html>Live: {0}    Peak: {1}    Total: {2}</html>"},
-        {"ThreadTab.threadInfo.accessibleName", "Thread Information"},
-        {"ThreadTab.threadPlotter.accessibleName", "Chart for number of threads."},
-        {"Threshold","Threshold"},
-        {"Tile", "Tile"},
-        {"Tile.mnemonic", 'T'},
-        {"Time Range:", "Time Range:"},
-        {"Time Range:.mnemonic", 'T'},
-        {"Time", "Time"},
-        {"TimeStamp","TimeStamp"},
-        {"Total Loaded", "Total Loaded"},
-        {"Total classes loaded","Total classes loaded"},
-        {"Total classes unloaded","Total classes unloaded"},
-        {"Total compile time","Total compile time"},
-        {"Total physical memory","Total physical memory"},
-        {"Total threads started","Total threads started"},
-        {"Total swap space","Total swap space"},
-        {"Type","Type"},
-        {"Unavailable","Unavailable"},
-        {"UNKNOWN","UNKNOWN"},
-        {"Unknown Host","Unknown Host: {0}"},
-        {"Unregister", "Unregister"},
-        {"Uptime","Uptime"},
-        {"Uptime: ","Uptime: "},
-        {"Usage Threshold","Usage Threshold"},
-        {"remoteTF.usage","<b>Usage</b>: &lt;hostname&gt;:&lt;port&gt; OR service:jmx:&lt;protocol&gt;:&lt;sap&gt;"},
-        {"Used","Used"},
-        {"Username: ", "Username: "},
-        {"Username: .mnemonic", 'U'},
-        {"Username.accessibleName", "User Name"},
-        {"UserData","UserData"},
-        {"Virtual Machine","Virtual Machine"},
-        {"VM arguments","VM arguments"},
-        {"VM","VM"},
-        {"VMInternalFrame.accessibleDescription", "Internal frame for monitoring a Java Virtual Machine"},
-        {"Value","Value"},
-        {"Vendor", "Vendor"},
-        {"Verbose Output","Verbose Output"},
-        {"Verbose Output.toolTip", "Enable verbose output for class loading system"},
-        {"View value", "View value"},
-        {"View","View"},
-        {"Window", "Window"},
-        {"Window.mnemonic", 'W'},
-        {"Windows","Windows"},
-        {"Writable","Writable"},
-        {"You cannot drop a class here", "You cannot drop a class here"},
-        {"collapse", "collapse"},
-        {"connectionFailed1","Connection Failed: Retry?"},
-        {"connectionFailed2","The connection to {0} did not succeed.<br>" +
-                             "Would you like to try again?"},
-        {"connectionFailedSSL1","Secure connection failed. Retry insecurely?"},
-        {"connectionFailedSSL2","The connection to {0} could not be made using SSL.<br>" +
-                             "Would you like to try without SSL?<br>" +
-                             "(Username and password will be sent in plain text.)"},
-        {"connectionLost1","Connection Lost: Reconnect?"},
-        {"connectionLost2","The connection to {0} has been lost " +
-                           "because the remote process has been terminated.<br>" +
-                           "Would you like to reconnect?"},
-        {"connectingTo1","Connecting to {0}"},
-        {"connectingTo2","You are currently being connected to {0}.<br>" +
-                         "This will take a few moments."},
-        {"deadlockAllTab","All"},
-        {"deadlockTab","Deadlock"},
-        {"deadlockTabN","Deadlock {0}"},
-        {"expand", "expand"},
-        {"kbytes","{0} kbytes"},
-        {"operation","operation"},
-        {"plot", "plot"},
-        {"visualize","visualize"},
-        {"zz usage text",
-             "Usage: {0} [ -interval=n ] [ -notile ] [ -pluginpath <path> ] [ -version ] [ connection ... ]\n\n" +
-             "  -interval   Set the update interval to n seconds (default is 4 seconds)\n" +
-             "  -notile     Do not tile windows initially (for two or more connections)\n" +
-             "  -pluginpath Specify the path that jconsole uses to look up the plugins\n" +
-             "  -version    Print program version\n\n" +
-             "  connection = pid || host:port || JMX URL (service:jmx:<protocol>://...)\n" +
-             "  pid         The process id of a target process\n" +
-             "  host        A remote host name or IP address\n" +
-             "  port        The port number for the remote connection\n\n" +
-             "  -J          Specify the input arguments to the Java virtual machine\n" +
-             "              on which jconsole is running"},
-        // END OF MATERIAL TO LOCALIZE
-        };
-
-        String ls = System.getProperty("line.separator");
-        for(int i=0;i<temp.length;i++) {
-            if (temp[i][1] instanceof String){
-            temp[i][1] = temp[i][1].toString().replaceAll("\n",ls);
-            }
-        }
-
-        return temp;
-
-    }
-
-    public synchronized Object[][] getContents() {
-        return getContents0();
-    }
-}
--- a/src/share/classes/sun/tools/jconsole/resources/JConsoleResources_ja.java	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,442 +0,0 @@
-/*
- * Copyright (c) 2004, 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.tools.jconsole.resources;
-
-import java.util.*;
-
-import static java.awt.event.KeyEvent.*;
-
-/**
- * <p> This class represents the <code>ResourceBundle</code>
- * for the following package(s):
- *
- * <ol>
- * <li> sun.tools.jconsole
- * </ol>
- *
- * <P>
- * Subclasses must override <code>getContents0</code> and provide an array,
- * where each item in the array consists of a <code>String</code> key,
- * and either a <code>String</code> value associated with that key,
- * or if the keys ends with ".mnemonic", an element
- * representing a mnemomic keycode <code>int</code> or <code>char</code>.
- */
-public class JConsoleResources_ja extends JConsoleResources {
-
-    /**
-     * Returns the contents of this <code>ResourceBundle</code>.
-     *
-     * <p>
-     *
-     * @return the contents of this <code>ResourceBundle</code>.
-     */
-    protected Object[][] getContents0() {
-        Object[][] temp = new Object[][] {
-                // NOTE 1: The value strings in this file containing "{0}" are
-        //         processed by the java.text.MessageFormat class.  Any
-        //         single quotes appearing in these strings need to be
-        //         doubled up.
-        //
-        // NOTE 2: To make working with this file a bit easier, please
-        //         maintain these messages in ASCII sorted order by
-        //         message key.
-        //
-        // LOCALIZE THIS
-        {" 1 day"," 1\u65E5"},
-        {" 1 hour"," 1\u6642\u9593"},
-        {" 1 min"," 1\u5206"},
-        {" 1 month"," 1\u304B\u6708"},
-        {" 1 year"," 1\u5E74"},
-        {" 2 hours"," 2\u6642\u9593"},
-        {" 3 hours"," 3\u6642\u9593"},
-        {" 3 months"," 3\u304B\u6708"},
-        {" 5 min"," 5\u5206"},
-        {" 6 hours"," 6\u6642\u9593"},
-        {" 6 months"," 6\u304B\u6708"},
-        {" 7 days"," 7\u65E5"},
-        {"10 min","10\u5206"},
-        {"12 hours","12\u6642\u9593"},
-        {"30 min","30\u5206"},
-        {"<","<"},
-        {"<<","<<"},
-        {">",">"},
-        {"ACTION","ACTION"},
-        {"ACTION_INFO","ACTION_INFO"},
-        {"All","\u3059\u3079\u3066"},
-        {"Apply","\u9069\u7528"},
-        {"Architecture","\u30A2\u30FC\u30AD\u30C6\u30AF\u30C1\u30E3"},
-        {"Array, OpenType", "\u914D\u5217\u3001OpenType"},
-        {"Array, OpenType, Numeric value viewer","\u914D\u5217\u3001OpenType\u3001\u6570\u5024\u30D3\u30E5\u30FC\u30A2"},
-        {"Attribute","\u5C5E\u6027"},
-        {"Attribute value","\u5C5E\u6027\u5024"},
-        {"Attribute values","\u5C5E\u6027\u5024"},
-        {"Attributes","\u5C5E\u6027"},
-        {"Blank", "\u30D6\u30E9\u30F3\u30AF"},
-        {"BlockedCount WaitedCount",
-             "\u30D6\u30ED\u30C3\u30AF\u6E08\u5408\u8A08: {0}  \u5F85\u6A5F\u6E08\u5408\u8A08: {1}\n"},
-        {"Boot class path","\u30D6\u30FC\u30C8\u30FB\u30AF\u30E9\u30B9\u30D1\u30B9"},
-        {"BorderedComponent.moreOrLessButton.toolTip", "\u8868\u793A\u3059\u308B\u60C5\u5831\u91CF\u3092\u5897\u6E1B\u3059\u308B\u30C8\u30B0\u30EB"},
-        {"CPU Usage","CPU\u4F7F\u7528\u7387"},
-        {"CPUUsageFormat","CPU\u4F7F\u7528\u7387: {0}%"},
-        {"Cancel","\u53D6\u6D88"},
-        {"Cascade", "\u91CD\u306D\u3066\u8868\u793A(C)"},
-        {"Cascade.mnemonic", 'C'},
-        {"Chart:", "\u30C1\u30E3\u30FC\u30C8(C):"},
-        {"Chart:.mnemonic", 'C'},
-        {"Class path","\u30AF\u30E9\u30B9\u30D1\u30B9"},
-        {"Class","\u30AF\u30E9\u30B9"},
-        {"ClassName","ClassName"},
-        {"ClassTab.infoLabelFormat", "<html>\u30ED\u30FC\u30C9\u6E08: {0}    \u672A\u30ED\u30FC\u30C9: {1}    \u5408\u8A08: {2}</html>"},
-        {"ClassTab.loadedClassesPlotter.accessibleName", "\u30ED\u30FC\u30C9\u6E08\u30AF\u30E9\u30B9\u306E\u30C1\u30E3\u30FC\u30C8\u3002"},
-        {"Classes","\u30AF\u30E9\u30B9"},
-        {"Close","\u9589\u3058\u308B"},
-        {"Column.Name", "\u540D\u524D"},
-        {"Column.PID", "PID"},
-        {"Committed memory","\u30B3\u30DF\u30C3\u30C8\u6E08\u30E1\u30E2\u30EA\u30FC"},
-        {"Committed virtual memory","\u30B3\u30DF\u30C3\u30C8\u6E08\u4EEE\u60F3\u30E1\u30E2\u30EA\u30FC"},
-        {"Committed", "\u30B3\u30DF\u30C3\u30C8\u6E08"},
-        {"Compiler","\u30B3\u30F3\u30D1\u30A4\u30E9"},
-        {"CompositeData","CompositeData"},
-        {"Config","\u69CB\u6210"},
-        {"Connect", "\u63A5\u7D9A(C)"},
-        {"Connect.mnemonic", 'C'},
-        {"Connect...","\u63A5\u7D9A..."},
-        {"ConnectDialog.connectButton.toolTip", "Java\u4EEE\u60F3\u30DE\u30B7\u30F3\u306B\u63A5\u7D9A"},
-        {"ConnectDialog.accessibleDescription", "\u30ED\u30FC\u30AB\u30EB\u307E\u305F\u306F\u30EA\u30E2\u30FC\u30C8\u306EJava\u4EEE\u60F3\u30DE\u30B7\u30F3\u3078\u306E\u65B0\u898F\u63A5\u7D9A\u3092\u884C\u3046\u30C0\u30A4\u30A2\u30ED\u30B0"},
-        {"ConnectDialog.masthead.accessibleName", "\u30DE\u30B9\u30C8\u30D8\u30C3\u30C9\u56F3\u5F62"},
-        {"ConnectDialog.masthead.title", "\u65B0\u898F\u63A5\u7D9A"},
-        {"ConnectDialog.statusBar.accessibleName", "\u30B9\u30C6\u30FC\u30BF\u30B9\u30FB\u30D0\u30FC"},
-        {"ConnectDialog.title", "JConsole: \u65B0\u898F\u63A5\u7D9A"},
-        {"Connected. Click to disconnect.","\u63A5\u7D9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u30AF\u30EA\u30C3\u30AF\u3059\u308B\u3068\u5207\u65AD\u3057\u307E\u3059\u3002"},
-        {"Connection failed","\u63A5\u7D9A\u306B\u5931\u6557\u3057\u307E\u3057\u305F"},
-        {"Connection", "\u63A5\u7D9A(C)"},
-        {"Connection.mnemonic", 'C'},
-        {"Connection name", "\u63A5\u7D9A\u540D"},
-        {"ConnectionName (disconnected)","{0} (\u5207\u65AD\u6E08)"},
-        {"Constructor","\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF"},
-        {"Current classes loaded", "\u30ED\u30FC\u30C9\u6E08\u306E\u73FE\u5728\u306E\u30AF\u30E9\u30B9"},
-        {"Current heap size","\u73FE\u5728\u306E\u30D2\u30FC\u30D7\u30FB\u30B5\u30A4\u30BA"},
-        {"Current value","\u73FE\u5728\u5024: {0}"},
-        {"Create", "\u4F5C\u6210"},
-        {"Daemon threads","\u30C7\u30FC\u30E2\u30F3\u30FB\u30B9\u30EC\u30C3\u30C9"},
-        {"Disconnected. Click to connect.","\u5207\u65AD\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u30AF\u30EA\u30C3\u30AF\u3059\u308B\u3068\u63A5\u7D9A\u3057\u307E\u3059\u3002"},
-        {"Double click to expand/collapse","\u5C55\u958B\u307E\u305F\u306F\u7E2E\u5C0F\u3059\u308B\u306B\u306F\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u304F\u3060\u3055\u3044"},
-        {"Double click to visualize", "\u8996\u899A\u5316\u3059\u308B\u306B\u306F\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u304F\u3060\u3055\u3044"},
-        {"Description", "\u8AAC\u660E"},
-        {"Description: ", "\u8AAC\u660E: "},
-        {"Descriptor", "\u8A18\u8FF0\u5B50"},
-        {"Details", "\u8A73\u7D30"},
-        {"Detect Deadlock", "\u30C7\u30C3\u30C9\u30ED\u30C3\u30AF\u306E\u691C\u51FA(D)"},
-        {"Detect Deadlock.mnemonic", 'D'},
-        {"Detect Deadlock.toolTip", "\u30C7\u30C3\u30C9\u30ED\u30C3\u30AF\u6E08\u30B9\u30EC\u30C3\u30C9\u306E\u691C\u51FA"},
-        {"Dimension is not supported:","\u6B21\u5143\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093:"},
-        {"Discard chart", "\u30C1\u30E3\u30FC\u30C8\u306E\u7834\u68C4"},
-        {"DurationDaysHoursMinutes","{0,choice,1#{0,number,integer}\u65E5|1.0<{0,number,integer}\u65E5}{1,choice,0<{1,number,integer}\u6642\u9593|1#{1,number,integer}\u6642\u9593|1<{1,number,integer}\u6642\u9593}{2,choice,0<{2,number,integer}\u5206|1#{2,number,integer}\u5206|1.0<{2,number,integer}\u5206}"},
-
-        {"DurationHoursMinutes","{0,choice,1#{0,number,integer}\u6642\u9593|1<{0,number,integer}\u6642\u9593}{1,choice,0<{1,number,integer}\u5206|1#{1,number,integer}\u5206|1.0<{1,number,integer}\u5206}"},
-
-        {"DurationMinutes","{0,choice,1#{0,number,integer}\u5206|1.0<{0,number,integer}\u5206}"},
-        {"DurationSeconds","{0}\u79D2"},
-        {"Empty array", "\u7A7A\u306E\u914D\u5217"},
-        {"Empty opentype viewer", "\u7A7A\u306Eopentype\u30D3\u30E5\u30FC\u30A2"},
-        {"Error","\u30A8\u30E9\u30FC"},
-        {"Error: MBeans already exist","\u30A8\u30E9\u30FC: MBeans\u306F\u3059\u3067\u306B\u5B58\u5728\u3057\u307E\u3059"},
-        {"Error: MBeans do not exist","\u30A8\u30E9\u30FC: MBeans\u306F\u5B58\u5728\u3057\u307E\u305B\u3093"},
-        {"Error:","\u30A8\u30E9\u30FC:"},
-        {"Event","\u30A4\u30D9\u30F3\u30C8"},
-        {"Exit", "\u7D42\u4E86(X)"},
-        {"Exit.mnemonic", 'X'},
-        {"Fail to load plugin", "\u8B66\u544A: \u30D7\u30E9\u30B0\u30A4\u30F3\u306E\u30ED\u30FC\u30C9\u306B\u5931\u6557\u3057\u307E\u3057\u305F: {0}"},
-        {"FileChooser.fileExists.cancelOption", "\u53D6\u6D88"},
-        {"FileChooser.fileExists.message", "<html><center>\u30D5\u30A1\u30A4\u30EB\u306F\u3059\u3067\u306B\u5B58\u5728\u3057\u3066\u3044\u307E\u3059:<br>{0}<br>\u7F6E\u63DB\u3057\u3066\u3082\u3088\u308D\u3057\u3044\u3067\u3059\u304B\u3002"},
-        {"FileChooser.fileExists.okOption", "\u7F6E\u63DB"},
-        {"FileChooser.fileExists.title", "\u30D5\u30A1\u30A4\u30EB\u304C\u5B58\u5728\u3057\u3066\u3044\u307E\u3059"},
-        {"FileChooser.savedFile", "<html>\u30D5\u30A1\u30A4\u30EB\u306B\u4FDD\u5B58\u3057\u307E\u3057\u305F:<br>{0}<br>({1}\u30D0\u30A4\u30C8)"},
-        {"FileChooser.saveFailed.message", "<html><center>\u30D5\u30A1\u30A4\u30EB\u3078\u306E\u4FDD\u5B58\u306B\u5931\u6557\u3057\u307E\u3057\u305F:<br>{0}<br>{1}"},
-        {"FileChooser.saveFailed.title", "\u4FDD\u5B58\u306B\u5931\u6557\u3057\u307E\u3057\u305F"},
-        {"Free physical memory","\u7A7A\u304D\u7269\u7406\u30E1\u30E2\u30EA\u30FC"},
-        {"Free swap space","\u7A7A\u304D\u30B9\u30EF\u30C3\u30D7\u30FB\u30B9\u30DA\u30FC\u30B9"},
-        {"Garbage collector","\u30AC\u30D9\u30FC\u30B8\u30FB\u30B3\u30EC\u30AF\u30BF"},
-        {"GTK","GTK"},
-        {"GcInfo","\u540D\u524D= ''{0}''\u3001\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3= {1,choice,-1#\u3042\u308A\u307E\u305B\u3093|0#{1,number,integer}\u500B}\u3001\u5408\u8A08\u6D88\u8CBB\u6642\u9593= {2}"},
-        {"GC time","GC\u6642\u9593"},
-        {"GC time details","{1}\u3067{0} ({2}\u500B\u306E\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3)"},
-        {"Heap Memory Usage","\u30D2\u30FC\u30D7\u30FB\u30E1\u30E2\u30EA\u30FC\u4F7F\u7528\u7387"},
-        {"Heap", "\u30D2\u30FC\u30D7"},
-        {"Help.AboutDialog.accessibleDescription", "JConsole\u3068JDK\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u306B\u3064\u3044\u3066\u306E\u60C5\u5831\u3092\u542B\u3080\u30C0\u30A4\u30A2\u30ED\u30B0"},
-        {"Help.AboutDialog.jConsoleVersion", "JConsole\u30D0\u30FC\u30B8\u30E7\u30F3:<br>{0}"},
-        {"Help.AboutDialog.javaVersion", "Java VM\u30D0\u30FC\u30B8\u30E7\u30F3:<br>{0}"},
-        {"Help.AboutDialog.masthead.accessibleName", "\u30DE\u30B9\u30C8\u30D8\u30C3\u30C9\u56F3\u5F62"},
-        {"Help.AboutDialog.masthead.title", "JConsole\u306B\u3064\u3044\u3066"},
-        {"Help.AboutDialog.title", "JConsole: \u8A73\u7D30"},
-        {"Help.AboutDialog.userGuideLink", "JConsole\u30E6\u30FC\u30B6\u30FC\u30FB\u30AC\u30A4\u30C9(U):<br>{0}"},
-        {"Help.AboutDialog.userGuideLink.mnemonic", 'U'},
-        {"Help.AboutDialog.userGuideLink.url", "http://java.sun.com/javase/6/docs/technotes/guides/management/jconsole.html"},
-        {"HelpMenu.About.title", "JConsole\u306B\u3064\u3044\u3066(A)"},
-        {"HelpMenu.About.title.mnemonic", 'A'},
-        {"HelpMenu.UserGuide.title", "\u30AA\u30F3\u30E9\u30A4\u30F3\u30FB\u30E6\u30FC\u30B6\u30FC\u30FB\u30AC\u30A4\u30C9"},
-        {"HelpMenu.UserGuide.title.mnemonic", 'U'},
-        {"HelpMenu.title", "\u30D8\u30EB\u30D7(H)"},
-        {"HelpMenu.title.mnemonic", 'H'},
-        {"Hotspot MBeans...", "Hotspot MBeans(H)..."},
-        {"Hotspot MBeans....mnemonic", 'H'},
-        {"Hotspot MBeans.dialog.accessibleDescription", "Hotspot MBeans\u306E\u7BA1\u7406\u7528\u30C0\u30A4\u30A2\u30ED\u30B0"},
-        {"Impact","\u5F71\u97FF"},
-        {"Info","\u60C5\u5831"},
-        {"INFO","\u60C5\u5831"},
-        {"Invalid plugin path", "\u8B66\u544A: \u7121\u52B9\u306A\u30D7\u30E9\u30B0\u30A4\u30F3\u30FB\u30D1\u30B9: {0}"},
-        {"Invalid URL", "\u7121\u52B9\u306AURL: {0}"},
-        {"Is","\u6B21\u306B\u4E00\u81F4\u3059\u308B"},
-        {"Java Monitoring & Management Console", "Java Monitoring & Management Console"},
-        {"JConsole: ","JConsole: {0}"},
-        {"JConsole version","JConsole\u30D0\u30FC\u30B8\u30E7\u30F3\"{0}\""},
-        {"JConsole.accessibleDescription", "Java Monitoring & Management Console"},
-        {"JIT compiler","JIT\u30B3\u30F3\u30D1\u30A4\u30E9"},
-        {"Java Virtual Machine","Java\u4EEE\u60F3\u30DE\u30B7\u30F3"},
-        {"Java","Java"},
-        {"Library path","\u30E9\u30A4\u30D6\u30E9\u30EA\u30FB\u30D1\u30B9"},
-        {"Listeners","\u30EA\u30B9\u30CA\u30FC"},
-        {"Live Threads","\u5B9F\u884C\u4E2D\u306E\u30B9\u30EC\u30C3\u30C9"},
-        {"Loaded", "\u30ED\u30FC\u30C9\u6E08"},
-        {"Local Process:", "\u30ED\u30FC\u30AB\u30EB\u30FB\u30D7\u30ED\u30BB\u30B9(L):"},
-        {"Local Process:.mnemonic", 'L'},
-        {"Look and Feel","Look&Feel"},
-        {"Masthead.font", "Dialog-PLAIN-25"},
-        {"Management Not Enabled","<b>\u6CE8\u610F</b>: \u7BA1\u7406\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u306F\u3053\u306E\u30D7\u30ED\u30BB\u30B9\u3067\u306F\u6709\u52B9\u5316\u3055\u308C\u307E\u305B\u3093\u3002"},
-        {"Management Will Be Enabled","<b>\u6CE8\u610F</b>: \u7BA1\u7406\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u306F\u3053\u306E\u30D7\u30ED\u30BB\u30B9\u3067\u6709\u52B9\u5316\u3055\u308C\u307E\u3059\u3002"},
-        {"MBeanAttributeInfo","MBeanAttributeInfo"},
-        {"MBeanInfo","MBeanInfo"},
-        {"MBeanNotificationInfo","MBeanNotificationInfo"},
-        {"MBeanOperationInfo","MBeanOperationInfo"},
-        {"MBeans","MBeans"},
-        {"MBeansTab.clearNotificationsButton", "\u30AF\u30EA\u30A2(C)"},
-        {"MBeansTab.clearNotificationsButton.mnemonic", 'C'},
-        {"MBeansTab.clearNotificationsButton.toolTip", "\u901A\u77E5\u306E\u30AF\u30EA\u30A2"},
-        {"MBeansTab.compositeNavigationMultiple", "\u30B3\u30F3\u30DD\u30B8\u30C3\u30C8\u30FB\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3{0}/{1}"},
-        {"MBeansTab.compositeNavigationSingle", "\u30B3\u30F3\u30DD\u30B8\u30C3\u30C8\u30FB\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3"},
-        {"MBeansTab.refreshAttributesButton", "\u30EA\u30D5\u30EC\u30C3\u30B7\u30E5(R)"},
-        {"MBeansTab.refreshAttributesButton.mnemonic", 'R'},
-        {"MBeansTab.refreshAttributesButton.toolTip", "\u5C5E\u6027\u306E\u30EA\u30D5\u30EC\u30C3\u30B7\u30E5"},
-        {"MBeansTab.subscribeNotificationsButton", "\u30B5\u30D6\u30B9\u30AF\u30E9\u30A4\u30D6(S)"},
-        {"MBeansTab.subscribeNotificationsButton.mnemonic", 'S'},
-        {"MBeansTab.subscribeNotificationsButton.toolTip", "\u901A\u77E5\u30EA\u30B9\u30CB\u30F3\u30B0\u306E\u958B\u59CB"},
-        {"MBeansTab.tabularNavigationMultiple", "\u30BF\u30D6\u30FB\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3{0}/{1}"},
-        {"MBeansTab.tabularNavigationSingle", "\u30BF\u30D6\u30FB\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3"},
-        {"MBeansTab.unsubscribeNotificationsButton", "\u30B5\u30D6\u30B9\u30AF\u30E9\u30A4\u30D6\u89E3\u9664(U)"},
-        {"MBeansTab.unsubscribeNotificationsButton.mnemonic", 'U'},
-        {"MBeansTab.unsubscribeNotificationsButton.toolTip", "\u901A\u77E5\u30EA\u30B9\u30CB\u30F3\u30B0\u306E\u505C\u6B62"},
-        {"Manage Hotspot MBeans in: ", "Hotspot MBeans\u306E\u7BA1\u7406: "},
-        {"Max","\u6700\u5927"},
-        {"Maximum heap size","\u6700\u5927\u30D2\u30FC\u30D7\u30FB\u30B5\u30A4\u30BA"},
-        {"Memory","\u30E1\u30E2\u30EA\u30FC"},
-        {"MemoryPoolLabel", "\u30E1\u30E2\u30EA\u30FC\u30FB\u30D7\u30FC\u30EB\"{0}\""},
-        {"MemoryTab.heapPlotter.accessibleName", "\u30D2\u30FC\u30D7\u7528\u306E\u30E1\u30E2\u30EA\u30FC\u4F7F\u7528\u7387\u30C1\u30E3\u30FC\u30C8\u3002"},
-        {"MemoryTab.infoLabelFormat", "<html>\u4F7F\u7528\u6E08: {0}    \u30B3\u30DF\u30C3\u30C8\u6E08: {1}    \u6700\u5927: {2}</html>"},
-        {"MemoryTab.nonHeapPlotter.accessibleName", "\u975E\u30D2\u30FC\u30D7\u7528\u306E\u30E1\u30E2\u30EA\u30FC\u4F7F\u7528\u7387\u30C1\u30E3\u30FC\u30C8\u3002"},
-        {"MemoryTab.poolChart.aboveThreshold", "{0}\u306E\u3057\u304D\u3044\u5024\u3088\u308A\u4E0A\u3067\u3059\u3002\n"},
-        {"MemoryTab.poolChart.accessibleName", "\u30E1\u30E2\u30EA\u30FC\u30FB\u30D7\u30FC\u30EB\u4F7F\u7528\u7387\u30C1\u30E3\u30FC\u30C8\u3002"},
-        {"MemoryTab.poolChart.belowThreshold", "{0}\u306E\u3057\u304D\u3044\u5024\u3088\u308A\u4E0B\u3067\u3059\u3002\n"},
-        {"MemoryTab.poolPlotter.accessibleName", "{0}\u306E\u30E1\u30E2\u30EA\u30FC\u4F7F\u7528\u7387\u30C1\u30E3\u30FC\u30C8\u3002"},
-        {"Message","\u30E1\u30C3\u30BB\u30FC\u30B8"},
-        {"Method successfully invoked", "\u30E1\u30BD\u30C3\u30C9\u304C\u6B63\u5E38\u306B\u8D77\u52D5\u3055\u308C\u307E\u3057\u305F"},
-        {"Minimize All", "\u3059\u3079\u3066\u6700\u5C0F\u5316(M)"},
-        {"Minimize All.mnemonic", 'M'},
-        {"Minus Version", "\u3053\u308C\u306F{0}\u306E\u30D0\u30FC\u30B8\u30E7\u30F3{1}\u3067\u3059"},
-        {"Monitor locked",
-             "   - \u30ED\u30C3\u30AF\u6E08{0}\n"},
-        {"Motif","Motif"},
-        {"Name Build and Mode","{0} (\u30D3\u30EB\u30C9{1}, {2})"},
-        {"Name and Build","{0} (\u30D3\u30EB\u30C9{1})"},
-        {"Name","\u540D\u524D"},
-        {"Name: ","\u540D\u524D: "},
-        {"Name State",
-             "\u540D\u524D: {0}\n\u72B6\u614B: {1}\n"},
-        {"Name State LockName",
-             "\u540D\u524D: {0}\n\u72B6\u614B: {2}\u306E{1}\n"},
-        {"Name State LockName LockOwner",
-             "\u540D\u524D: {0}\n\u72B6\u614B: {2}\u306E{1}\u3001\u6240\u6709\u8005: {3}\n"},
-        {"New Connection...", "\u65B0\u898F\u63A5\u7D9A(N)..."},
-        {"New Connection....mnemonic", 'N'},
-        {"New value applied","\u9069\u7528\u3055\u308C\u305F\u65B0\u898F\u5024"},
-        {"No attribute selected","\u5C5E\u6027\u304C\u9078\u629E\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F"},
-        {"No deadlock detected","\u30C7\u30C3\u30C9\u30ED\u30C3\u30AF\u304C\u691C\u51FA\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F"},
-        {"No value selected","\u5024\u304C\u9078\u629E\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F"},
-        {"Non-Heap Memory Usage","\u975E\u30D2\u30FC\u30D7\u30FB\u30E1\u30E2\u30EA\u30FC\u4F7F\u7528\u7387"},
-        {"Non-Heap", "\u975E\u30D2\u30FC\u30D7"},
-        {"Not Yet Implemented","\u307E\u3060\u5B9F\u88C5\u3055\u308C\u3066\u3044\u307E\u305B\u3093"},
-        {"Not a valid event broadcaster", "\u6709\u52B9\u306A\u30A4\u30D9\u30F3\u30C8\u30FB\u30D6\u30ED\u30FC\u30C9\u30AD\u30E3\u30B9\u30BF\u3067\u306F\u3042\u308A\u307E\u305B\u3093"},
-        {"Notification","\u901A\u77E5"},
-        {"Notification buffer","\u901A\u77E5\u30D0\u30C3\u30D5\u30A1"},
-        {"Notifications","\u901A\u77E5"},
-        {"NotifTypes", "NotifTypes"},
-        {"Number of Threads","\u30B9\u30EC\u30C3\u30C9\u6570"},
-        {"Number of Loaded Classes","\u30ED\u30FC\u30C9\u6E08\u30AF\u30E9\u30B9\u6570"},
-        {"Number of processors","\u30D7\u30ED\u30BB\u30C3\u30B5\u6570"},
-        {"ObjectName","ObjectName"},
-        {"Operating System","\u30AA\u30DA\u30EC\u30FC\u30C6\u30A3\u30F3\u30B0\u30FB\u30B7\u30B9\u30C6\u30E0"},
-        {"Operation","\u64CD\u4F5C"},
-        {"Operation invocation","\u64CD\u4F5C\u306E\u547C\u51FA\u3057"},
-        {"Operation return value", "\u64CD\u4F5C\u306E\u623B\u308A\u5024"},
-        {"Operations","\u64CD\u4F5C"},
-        {"Overview","\u6982\u8981"},
-        {"OverviewPanel.plotter.accessibleName", "{0}\u306E\u30C1\u30E3\u30FC\u30C8\u3002"},
-        {"Parameter", "\u30D1\u30E9\u30E1\u30FC\u30BF"},
-        {"Password: ", "\u30D1\u30B9\u30EF\u30FC\u30C9(P): "},
-        {"Password: .mnemonic", 'P'},
-        {"Password.accessibleName", "\u30D1\u30B9\u30EF\u30FC\u30C9"},
-        {"Peak","\u30D4\u30FC\u30AF"},
-        {"Perform GC", "GC\u306E\u5B9F\u884C"},
-        {"Perform GC.mnemonic", 'G'},
-        {"Perform GC.toolTip", "\u30AC\u30D9\u30FC\u30B8\u30FB\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3\u306E\u30EA\u30AF\u30A8\u30B9\u30C8"},
-        {"Plotter.accessibleName", "\u30C1\u30E3\u30FC\u30C8"},
-        {"Plotter.accessibleName.keyAndValue", "{0}={1}\n"},
-        {"Plotter.accessibleName.noData", "\u30C7\u30FC\u30BF\u304C\u30D7\u30ED\u30C3\u30C8\u3055\u308C\u307E\u305B\u3093\u3002"},
-        {"Plotter.saveAsMenuItem", "\u540D\u524D\u3092\u4ED8\u3051\u3066\u30C7\u30FC\u30BF\u3092\u4FDD\u5B58(A)..."},
-        {"Plotter.saveAsMenuItem.mnemonic", 'A'},
-        {"Plotter.timeRangeMenu", "\u6642\u9593\u7BC4\u56F2(T)"},
-        {"Plotter.timeRangeMenu.mnemonic", 'T'},
-        {"Problem adding listener","\u30EA\u30B9\u30CA\u30FC\u8FFD\u52A0\u4E2D\u306E\u554F\u984C"},
-        {"Problem displaying MBean", "MBean\u8868\u793A\u4E2D\u306E\u554F\u984C"},
-        {"Problem invoking", "\u547C\u51FA\u3057\u4E2D\u306E\u554F\u984C"},
-        {"Problem removing listener","\u30EA\u30B9\u30CA\u30FC\u524A\u9664\u4E2D\u306E\u554F\u984C"},
-        {"Problem setting attribute","\u5C5E\u6027\u8A2D\u5B9A\u4E2D\u306E\u554F\u984C"},
-        {"Process CPU time","\u30D7\u30ED\u30BB\u30B9CPU\u6642\u9593"},
-        {"R/W","R/W"},
-        {"Readable","\u8AAD\u53D6\u308A\u53EF\u80FD"},
-        {"Received","\u53D7\u4FE1\u6E08"},
-        {"Reconnect","\u518D\u63A5\u7D9A"},
-        {"Remote Process:", "\u30EA\u30E2\u30FC\u30C8\u30FB\u30D7\u30ED\u30BB\u30B9(R):"},
-        {"Remote Process:.mnemonic", 'R'},
-        {"Remote Process.textField.accessibleName", "\u30EA\u30E2\u30FC\u30C8\u30FB\u30D7\u30ED\u30BB\u30B9"},
-        {"Remove","\u524A\u9664"},
-        {"Restore All", "\u3059\u3079\u3066\u5FA9\u5143(R)"},
-        {"Restore All.mnemonic", 'R'},
-        {"Return value", "\u623B\u308A\u5024"},
-        {"ReturnType", "ReturnType"},
-        {"SeqNum","SeqNum"},
-        {"Size Bytes", "{0,number,integer}\u30D0\u30A4\u30C8"},
-        {"Size Gb","{0} Gb"},
-        {"Size Kb","{0} Kb"},
-        {"Size Mb","{0} Mb"},
-        {"Source","\u30BD\u30FC\u30B9"},
-        {"Stack trace",
-              "\n\u30B9\u30BF\u30C3\u30AF\u30FB\u30C8\u30EC\u30FC\u30B9: \n"},
-        {"Success:","\u6210\u529F:"},
-        // Note: SummaryTab.headerDateTimeFormat can be one the following:
-        // 1. A combination of two styles for date and time, using the
-        //    constants from class DateFormat: SHORT, MEDIUM, LONG, FULL.
-        //    Example: "MEDIUM,MEDIUM" or "FULL,SHORT"
-        // 2. An explicit string pattern used for creating an instance
-        //    of the class SimpleDateFormat.
-        //    Example: "yyyy-MM-dd HH:mm:ss" or "M/d/yyyy h:mm:ss a"
-        {"SummaryTab.headerDateTimeFormat", "FULL,FULL"},
-        {"SummaryTab.pendingFinalization.label", "\u30D5\u30A1\u30A4\u30CA\u30E9\u30A4\u30BA\u306E\u30DA\u30F3\u30C7\u30A3\u30F3\u30B0"},
-        {"SummaryTab.pendingFinalization.value", "{0}\u500B\u306E\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8"},
-        {"SummaryTab.tabName", "VM\u30B5\u30DE\u30EA\u30FC"},
-        {"SummaryTab.vmVersion","{0}\u30D0\u30FC\u30B8\u30E7\u30F3{1}"},
-        {"TabularData are not supported", "TabularData \u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093"},
-        {"Threads","\u30B9\u30EC\u30C3\u30C9"},
-        {"ThreadTab.infoLabelFormat", "<html>\u5B9F\u884C\u4E2D: {0}    \u30D4\u30FC\u30AF: {1}    \u5408\u8A08: {2}</html>"},
-        {"ThreadTab.threadInfo.accessibleName", "\u30B9\u30EC\u30C3\u30C9\u60C5\u5831"},
-        {"ThreadTab.threadPlotter.accessibleName", "\u30B9\u30EC\u30C3\u30C9\u6570\u306E\u30C1\u30E3\u30FC\u30C8\u3002"},
-        {"Threshold","\u3057\u304D\u3044\u5024"},
-        {"Tile", "\u4E26\u3079\u3066\u8868\u793A(T)"},
-        {"Tile.mnemonic", 'T'},
-        {"Time Range:", "\u6642\u9593\u7BC4\u56F2(T):"},
-        {"Time Range:.mnemonic", 'T'},
-        {"Time", "\u6642\u9593"},
-        {"TimeStamp","TimeStamp"},
-        {"Total Loaded", "\u30ED\u30FC\u30C9\u6E08\u5408\u8A08"},
-        {"Total classes loaded","\u30ED\u30FC\u30C9\u6E08\u30AF\u30E9\u30B9\u5408\u8A08"},
-        {"Total classes unloaded","\u30A2\u30F3\u30ED\u30FC\u30C9\u6E08\u30AF\u30E9\u30B9\u5408\u8A08"},
-        {"Total compile time","\u5408\u8A08\u30B3\u30F3\u30D1\u30A4\u30EB\u6642\u9593"},
-        {"Total physical memory","\u5408\u8A08\u7269\u7406\u30E1\u30E2\u30EA\u30FC"},
-        {"Total threads started","\u958B\u59CB\u6E08\u5408\u8A08\u30B9\u30EC\u30C3\u30C9"},
-        {"Total swap space","\u5408\u8A08\u30B9\u30EF\u30C3\u30D7\u30FB\u30B9\u30DA\u30FC\u30B9"},
-        {"Type","\u578B"},
-        {"Unavailable","\u5229\u7528\u4E0D\u53EF"},
-        {"UNKNOWN","UNKNOWN"},
-        {"Unknown Host","\u4E0D\u660E\u306A\u30DB\u30B9\u30C8: {0}"},
-        {"Unregister", "\u767B\u9332\u89E3\u9664"},
-        {"Uptime","\u7A3C\u50CD\u6642\u9593"},
-        {"Uptime: ","\u7A3C\u50CD\u6642\u9593: "},
-        {"Usage Threshold","\u4F7F\u7528\u3057\u304D\u3044\u5024"},
-        {"remoteTF.usage","<b>\u4F7F\u7528\u65B9\u6CD5</b>: &lt;hostname&gt;:&lt;port&gt;\u307E\u305F\u306Fservice:jmx:&lt;protocol&gt;:&lt;sap&gt;"},
-        {"Used","\u4F7F\u7528\u6E08"},
-        {"Username: ", "\u30E6\u30FC\u30B6\u30FC\u540D(U): "},
-        {"Username: .mnemonic", 'U'},
-        {"Username.accessibleName", "\u30E6\u30FC\u30B6\u30FC\u540D"},
-        {"UserData","UserData"},
-        {"Virtual Machine","\u4EEE\u60F3\u30DE\u30B7\u30F3"},
-        {"VM arguments","VM\u5F15\u6570"},
-        {"VM","VM"},
-        {"VMInternalFrame.accessibleDescription", "Java\u4EEE\u60F3\u30DE\u30B7\u30F3\u306E\u30E2\u30CB\u30BF\u30FC\u7528\u306E\u5185\u90E8\u30D5\u30EC\u30FC\u30E0"},
-        {"Value","\u5024"},
-        {"Vendor", "\u30D9\u30F3\u30C0\u30FC"},
-        {"Verbose Output","\u8A73\u7D30\u51FA\u529B"},
-        {"Verbose Output.toolTip", "\u30AF\u30E9\u30B9\u8AAD\u8FBC\u307F\u30B7\u30B9\u30C6\u30E0\u3067\u8A73\u7D30\u51FA\u529B\u3092\u6709\u52B9\u306B\u3059\u308B"},
-        {"View value", "\u5024\u306E\u8868\u793A"},
-        {"View","\u8868\u793A"},
-        {"Window", "\u30A6\u30A3\u30F3\u30C9\u30A6(W)"},
-        {"Window.mnemonic", 'W'},
-        {"Windows","\u30A6\u30A3\u30F3\u30C9\u30A6"},
-        {"Writable","\u66F8\u8FBC\u307F\u53EF\u80FD"},
-        {"You cannot drop a class here", "\u30AF\u30E9\u30B9\u3092\u3053\u3053\u306B\u30C9\u30ED\u30C3\u30D7\u3067\u304D\u307E\u305B\u3093"},
-        {"collapse", "\u7E2E\u5C0F"},
-        {"connectionFailed1","\u63A5\u7D9A\u306B\u5931\u6557\u3057\u307E\u3057\u305F: \u518D\u8A66\u884C\u3057\u307E\u3059\u304B\u3002"},
-        {"connectionFailed2","{0}\u3078\u306E\u63A5\u7D9A\u304C\u6210\u529F\u3057\u307E\u305B\u3093\u3067\u3057\u305F\u3002<br>\u3082\u3046\u4E00\u5EA6\u8A66\u3057\u307E\u3059\u304B\u3002"},
-        {"connectionLost1","\u63A5\u7D9A\u304C\u5931\u308F\u308C\u307E\u3057\u305F: \u518D\u63A5\u7D9A\u3057\u307E\u3059\u304B\u3002"},
-        {"connectionLost2","\u30EA\u30E2\u30FC\u30C8\u30FB\u30D7\u30ED\u30BB\u30B9\u304C\u7D42\u4E86\u3057\u305F\u305F\u3081{0}\u3078\u306E\u63A5\u7D9A\u304C\u5931\u308F\u308C\u307E\u3057\u305F\u3002<br>\u518D\u63A5\u7D9A\u3057\u307E\u3059\u304B\u3002"},
-        {"connectingTo1","{0}\u306B\u63A5\u7D9A\u4E2D"},
-        {"connectingTo2","{0}\u306B\u73FE\u5728\u63A5\u7D9A\u4E2D\u3067\u3059\u3002<br>\u3053\u308C\u306B\u306F\u6570\u5206\u304B\u304B\u308A\u307E\u3059\u3002"},
-        {"deadlockAllTab","\u3059\u3079\u3066"},
-        {"deadlockTab","\u30C7\u30C3\u30C9\u30ED\u30C3\u30AF"},
-        {"deadlockTabN","\u30C7\u30C3\u30C9\u30ED\u30C3\u30AF{0}"},
-        {"expand", "\u5C55\u958B"},
-        {"kbytes","{0} KB"},
-        {"operation","\u64CD\u4F5C"},
-        {"plot", "\u30D7\u30ED\u30C3\u30C8"},
-        {"visualize","\u8996\u899A\u5316"},
-        {"zz usage text",
-             "\u4F7F\u7528\u65B9\u6CD5: {0} [ -interval=n ] [ -notile ] [ -pluginpath <path> ] [ -version ] [ connection ... ]\n\n  -interval   \u66F4\u65B0\u9593\u9694\u3092n\u79D2\u306B\u8A2D\u5B9A\u3059\u308B(\u30C7\u30D5\u30A9\u30EB\u30C8\u306F4\u79D2)\n  -notile     \u30A6\u30A3\u30F3\u30C9\u30A6\u3092\u6700\u521D\u306B\u4E26\u3079\u3066\u8868\u793A\u3057\u306A\u3044(2\u3064\u4EE5\u4E0A\u306E\u63A5\u7D9A\u306B\u3064\u3044\u3066)\n  -pluginpath JConsole\u304C\u30D7\u30E9\u30B0\u30A4\u30F3\u3092\u53C2\u7167\u3059\u308B\u305F\u3081\u306B\u4F7F\u7528\u3059\u308B\u30D1\u30B9\u3092\u6307\u5B9A\u3059\u308B\n  -version    \u30D7\u30ED\u30B0\u30E9\u30E0\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u5370\u5237\u3059\u308B\n\n  connection = pid || host:port || JMX URL (service:jmx:<protocol>://...)\n  pid         \u30BF\u30FC\u30B2\u30C3\u30C8\u30FB\u30D7\u30ED\u30BB\u30B9\u306E\u30D7\u30ED\u30BB\u30B9ID\n  host        \u30EA\u30E2\u30FC\u30C8\u30FB\u30DB\u30B9\u30C8\u540D\u307E\u305F\u306FIP\u30A2\u30C9\u30EC\u30B9\n  port        \u30EA\u30E2\u30FC\u30C8\u63A5\u7D9A\u7528\u306E\u30DD\u30FC\u30C8\u756A\u53F7\n\n  -J          JConsole\u304C\u5B9F\u884C\u4E2D\u306EJava\u4EEE\u60F3\u30DE\u30B7\u30F3\u3078\u306E\n              \u5165\u529B\u5F15\u6570\u3092\u6307\u5B9A\u3059\u308B"},
-        // END OF MATERIAL TO LOCALIZE
-        };
-
-        String ls = System.getProperty("line.separator");
-        for(int i=0;i<temp.length;i++) {
-            if (temp[i][1] instanceof String){
-            temp[i][1] = temp[i][1].toString().replaceAll("\n",ls);
-            }
-        }
-
-        return temp;
-
-    }
-
-    public synchronized Object[][] getContents() {
-        return getContents0();
-    }
-}
--- a/src/share/classes/sun/tools/jconsole/resources/JConsoleResources_zh_CN.java	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,442 +0,0 @@
-/*
- * Copyright (c) 2004, 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.tools.jconsole.resources;
-
-import java.util.*;
-
-import static java.awt.event.KeyEvent.*;
-
-/**
- * <p> This class represents the <code>ResourceBundle</code>
- * for the following package(s):
- *
- * <ol>
- * <li> sun.tools.jconsole
- * </ol>
- *
- * <P>
- * Subclasses must override <code>getContents0</code> and provide an array,
- * where each item in the array consists of a <code>String</code> key,
- * and either a <code>String</code> value associated with that key,
- * or if the keys ends with ".mnemonic", an element
- * representing a mnemomic keycode <code>int</code> or <code>char</code>.
- */
-public class JConsoleResources_zh_CN extends JConsoleResources {
-
-    /**
-     * Returns the contents of this <code>ResourceBundle</code>.
-     *
-     * <p>
-     *
-     * @return the contents of this <code>ResourceBundle</code>.
-     */
-    protected Object[][] getContents0() {
-        Object[][] temp = new Object[][] {
-                // NOTE 1: The value strings in this file containing "{0}" are
-        //         processed by the java.text.MessageFormat class.  Any
-        //         single quotes appearing in these strings need to be
-        //         doubled up.
-        //
-        // NOTE 2: To make working with this file a bit easier, please
-        //         maintain these messages in ASCII sorted order by
-        //         message key.
-        //
-        // LOCALIZE THIS
-        {" 1 day"," 1 \u5929"},
-        {" 1 hour"," 1 \u5C0F\u65F6"},
-        {" 1 min"," 1 \u5206\u949F"},
-        {" 1 month"," 1 \u4E2A\u6708"},
-        {" 1 year"," 1 \u5E74"},
-        {" 2 hours"," 2 \u5C0F\u65F6"},
-        {" 3 hours"," 3 \u5C0F\u65F6"},
-        {" 3 months"," 3 \u4E2A\u6708"},
-        {" 5 min"," 5 \u5206\u949F"},
-        {" 6 hours"," 6 \u5C0F\u65F6"},
-        {" 6 months"," 6 \u4E2A\u6708"},
-        {" 7 days"," 7 \u5929"},
-        {"10 min","10 \u5206\u949F"},
-        {"12 hours","12 \u5C0F\u65F6"},
-        {"30 min","30 \u5206\u949F"},
-        {"<","<"},
-        {"<<","<<"},
-        {">",">"},
-        {"ACTION","ACTION"},
-        {"ACTION_INFO","ACTION_INFO"},
-        {"All","\u5168\u90E8"},
-        {"Apply","\u5E94\u7528"},
-        {"Architecture","\u4F53\u7CFB\u7ED3\u6784"},
-        {"Array, OpenType", "\u6570\u7EC4, OpenType"},
-        {"Array, OpenType, Numeric value viewer","\u6570\u7EC4, OpenType, \u6570\u503C\u67E5\u770B\u5668"},
-        {"Attribute","\u5C5E\u6027"},
-        {"Attribute value","\u5C5E\u6027\u503C"},
-        {"Attribute values","\u5C5E\u6027\u503C"},
-        {"Attributes","\u5C5E\u6027"},
-        {"Blank", "\u7A7A\u767D"},
-        {"BlockedCount WaitedCount",
-             "\u603B\u963B\u6B62\u6570: {0}, \u603B\u7B49\u5F85\u6570: {1}\n"},
-        {"Boot class path","\u5F15\u5BFC\u7C7B\u8DEF\u5F84"},
-        {"BorderedComponent.moreOrLessButton.toolTip", "\u5207\u6362\u4EE5\u663E\u793A\u66F4\u591A\u6216\u66F4\u5C11\u4FE1\u606F"},
-        {"CPU Usage","CPU \u5360\u7528\u7387"},
-        {"CPUUsageFormat","CPU \u5360\u7528\u7387: {0}%"},
-        {"Cancel","\u53D6\u6D88"},
-        {"Cascade", "\u5C42\u53E0(C)"},
-        {"Cascade.mnemonic", 'C'},
-        {"Chart:", "\u56FE\u8868(C):"},
-        {"Chart:.mnemonic", 'C'},
-        {"Class path","\u7C7B\u8DEF\u5F84"},
-        {"Class","\u7C7B"},
-        {"ClassName","ClassName"},
-        {"ClassTab.infoLabelFormat", "<html>\u5DF2\u52A0\u8F7D: {0}    \u5DF2\u5378\u8F7D: {1}    \u603B\u8BA1: {2}</html>"},
-        {"ClassTab.loadedClassesPlotter.accessibleName", "\u5DF2\u52A0\u8F7D\u7C7B\u7684\u56FE\u8868\u3002"},
-        {"Classes","\u7C7B"},
-        {"Close","\u5173\u95ED"},
-        {"Column.Name", "\u540D\u79F0"},
-        {"Column.PID", "PID"},
-        {"Committed memory","\u63D0\u4EA4\u7684\u5185\u5B58"},
-        {"Committed virtual memory","\u63D0\u4EA4\u7684\u865A\u62DF\u5185\u5B58"},
-        {"Committed", "\u5DF2\u63D0\u4EA4"},
-        {"Compiler","\u7F16\u8BD1\u5668"},
-        {"CompositeData","CompositeData"},
-        {"Config","\u914D\u7F6E"},
-        {"Connect", "\u8FDE\u63A5(C)"},
-        {"Connect.mnemonic", 'C'},
-        {"Connect...","\u8FDE\u63A5..."},
-        {"ConnectDialog.connectButton.toolTip", "\u8FDE\u63A5\u5230 Java \u865A\u62DF\u673A"},
-        {"ConnectDialog.accessibleDescription", "\u7528\u4E8E\u4E0E\u672C\u5730\u6216\u8FDC\u7A0B Java \u865A\u62DF\u673A\u5EFA\u7ACB\u65B0\u8FDE\u63A5\u7684\u5BF9\u8BDD\u6846"},
-        {"ConnectDialog.masthead.accessibleName", "\u62A5\u5934\u56FE"},
-        {"ConnectDialog.masthead.title", "\u65B0\u5EFA\u8FDE\u63A5"},
-        {"ConnectDialog.statusBar.accessibleName", "\u72B6\u6001\u680F"},
-        {"ConnectDialog.title", "JConsole: \u65B0\u5EFA\u8FDE\u63A5"},
-        {"Connected. Click to disconnect.","\u5DF2\u8FDE\u63A5\u3002\u5355\u51FB\u53EF\u65AD\u5F00\u8FDE\u63A5\u3002"},
-        {"Connection failed","\u8FDE\u63A5\u5931\u8D25"},
-        {"Connection", "\u8FDE\u63A5(C)"},
-        {"Connection.mnemonic", 'C'},
-        {"Connection name", "\u8FDE\u63A5\u540D\u79F0"},
-        {"ConnectionName (disconnected)","{0} (\u5DF2\u65AD\u5F00\u8FDE\u63A5)"},
-        {"Constructor","\u6784\u9020\u5668"},
-        {"Current classes loaded", "\u5DF2\u52A0\u88C5\u5F53\u524D\u7C7B"},
-        {"Current heap size","\u5F53\u524D\u5806\u5927\u5C0F"},
-        {"Current value","\u5F53\u524D\u503C: {0}"},
-        {"Create", "\u521B\u5EFA"},
-        {"Daemon threads","\u5B88\u62A4\u7A0B\u5E8F\u7EBF\u7A0B"},
-        {"Disconnected. Click to connect.","\u5DF2\u65AD\u5F00\u8FDE\u63A5\u3002\u5355\u51FB\u53EF\u8FDE\u63A5\u3002"},
-        {"Double click to expand/collapse","\u53CC\u51FB\u4EE5\u5C55\u5F00/\u9690\u85CF"},
-        {"Double click to visualize", "\u53CC\u51FB\u4EE5\u4F7F\u5176\u53EF\u89C1"},
-        {"Description", "\u8BF4\u660E"},
-        {"Description: ", "\u8BF4\u660E: "},
-        {"Descriptor", "\u63CF\u8FF0\u7B26"},
-        {"Details", "\u8BE6\u7EC6\u8D44\u6599"},
-        {"Detect Deadlock", "\u68C0\u6D4B\u6B7B\u9501(D)"},
-        {"Detect Deadlock.mnemonic", 'D'},
-        {"Detect Deadlock.toolTip", "\u68C0\u6D4B\u5904\u4E8E\u6B7B\u9501\u72B6\u6001\u7684\u7EBF\u7A0B"},
-        {"Dimension is not supported:","\u4E0D\u652F\u6301\u7EF4:"},
-        {"Discard chart", "\u653E\u5F03\u56FE\u8868"},
-        {"DurationDaysHoursMinutes","{0,choice,1#{0,number,integer} \u5929 |1.0<{0,number,integer} \u5929 }{1,choice,0<{1,number,integer} \u5C0F\u65F6 |1#{1,number,integer} \u5C0F\u65F6 |1<{1,number,integer} \u5C0F\u65F6 }{2,choice,0<{2,number,integer} \u5206\u949F|1#{2,number,integer} \u5206\u949F|1.0<{2,number,integer} \u5206\u949F}"},
-
-        {"DurationHoursMinutes","{0,choice,1#{0,number,integer} \u5C0F\u65F6 |1<{0,number,integer} \u5C0F\u65F6 }{1,choice,0<{1,number,integer} \u5206\u949F|1#{1,number,integer} \u5206\u949F|1.0<{1,number,integer} \u5206\u949F}"},
-
-        {"DurationMinutes","{0,choice,1#{0,number,integer} \u5206\u949F|1.0<{0,number,integer} \u5206\u949F}"},
-        {"DurationSeconds","{0} \u79D2"},
-        {"Empty array", "\u7A7A\u6570\u7EC4"},
-        {"Empty opentype viewer", "\u7A7A opentype \u67E5\u770B\u5668"},
-        {"Error","\u9519\u8BEF"},
-        {"Error: MBeans already exist","\u9519\u8BEF: MBean \u5DF2\u5B58\u5728"},
-        {"Error: MBeans do not exist","\u9519\u8BEF: MBean \u4E0D\u5B58\u5728"},
-        {"Error:","\u9519\u8BEF:"},
-        {"Event","\u4E8B\u4EF6"},
-        {"Exit", "\u9000\u51FA(X)"},
-        {"Exit.mnemonic", 'X'},
-        {"Fail to load plugin", "\u8B66\u544A: \u65E0\u6CD5\u52A0\u8F7D\u63D2\u4EF6: {0}"},
-        {"FileChooser.fileExists.cancelOption", "\u53D6\u6D88"},
-        {"FileChooser.fileExists.message", "<html><center>\u6587\u4EF6\u5DF2\u5B58\u5728:<br>{0}<br>\u662F\u5426\u8981\u66FF\u6362?"},
-        {"FileChooser.fileExists.okOption", "\u66FF\u6362"},
-        {"FileChooser.fileExists.title", "\u6587\u4EF6\u5DF2\u5B58\u5728"},
-        {"FileChooser.savedFile", "<html>\u5DF2\u4FDD\u5B58\u5230\u6587\u4EF6:<br>{0}<br>({1} \u5B57\u8282)"},
-        {"FileChooser.saveFailed.message", "<html><center>\u672A\u80FD\u4FDD\u5B58\u5230\u6587\u4EF6:<br>{0}<br>{1}"},
-        {"FileChooser.saveFailed.title", "\u4FDD\u5B58\u5931\u8D25"},
-        {"Free physical memory","\u7A7A\u95F2\u7269\u7406\u5185\u5B58"},
-        {"Free swap space","\u7A7A\u95F2\u4EA4\u6362\u7A7A\u95F4"},
-        {"Garbage collector","\u5783\u573E\u6536\u96C6\u5668"},
-        {"GTK","GTK"},
-        {"GcInfo","\u540D\u79F0 = ''{0}'', \u6536\u96C6 = {1,choice,-1#Unavailable|0#{1,number,integer}}, \u603B\u82B1\u8D39\u65F6\u95F4 = {2}"},
-        {"GC time","GC \u65F6\u95F4"},
-        {"GC time details","{1}\u4E0A\u7684{0} ({2}\u6536\u96C6)"},
-        {"Heap Memory Usage","\u5806\u5185\u5B58\u4F7F\u7528\u91CF"},
-        {"Heap", "\u5806"},
-        {"Help.AboutDialog.accessibleDescription", "\u5305\u542B\u6709\u5173 JConsole \u548C JDK \u7248\u672C\u4FE1\u606F\u7684\u5BF9\u8BDD\u6846"},
-        {"Help.AboutDialog.jConsoleVersion", "JConsole \u7248\u672C:<br>{0}"},
-        {"Help.AboutDialog.javaVersion", "Java VM \u7248\u672C:<br>{0}"},
-        {"Help.AboutDialog.masthead.accessibleName", "\u62A5\u5934\u56FE"},
-        {"Help.AboutDialog.masthead.title", "\u5173\u4E8E JConsole"},
-        {"Help.AboutDialog.title", "JConsole: \u5173\u4E8E"},
-        {"Help.AboutDialog.userGuideLink", "JConsole \u7528\u6237\u6307\u5357(U):<br>{0}"},
-        {"Help.AboutDialog.userGuideLink.mnemonic", 'U'},
-        {"Help.AboutDialog.userGuideLink.url", "http://java.sun.com/javase/6/docs/technotes/guides/management/jconsole.html"},
-        {"HelpMenu.About.title", "\u5173\u4E8E JConsole(A)"},
-        {"HelpMenu.About.title.mnemonic", 'A'},
-        {"HelpMenu.UserGuide.title", "\u8054\u673A\u7528\u6237\u6307\u5357"},
-        {"HelpMenu.UserGuide.title.mnemonic", 'U'},
-        {"HelpMenu.title", "\u5E2E\u52A9(H)"},
-        {"HelpMenu.title.mnemonic", 'H'},
-        {"Hotspot MBeans...", "HotSpot MBean(H)..."},
-        {"Hotspot MBeans....mnemonic", 'H'},
-        {"Hotspot MBeans.dialog.accessibleDescription", "\u7528\u4E8E\u7BA1\u7406 HotSpot MBean \u7684\u5BF9\u8BDD\u6846"},
-        {"Impact","\u5F71\u54CD"},
-        {"Info","\u4FE1\u606F"},
-        {"INFO","INFO"},
-        {"Invalid plugin path", "\u8B66\u544A: \u63D2\u4EF6\u8DEF\u5F84\u65E0\u6548: {0}"},
-        {"Invalid URL", "URL \u65E0\u6548: {0}"},
-        {"Is","\u662F"},
-        {"Java Monitoring & Management Console", "Java \u76D1\u89C6\u548C\u7BA1\u7406\u63A7\u5236\u53F0"},
-        {"JConsole: ","JConsole: {0}"},
-        {"JConsole version","JConsole \u7248\u672C \"{0}\""},
-        {"JConsole.accessibleDescription", "Java \u76D1\u89C6\u548C\u7BA1\u7406\u63A7\u5236\u53F0"},
-        {"JIT compiler","JIT \u7F16\u8BD1\u5668"},
-        {"Java Virtual Machine","Java \u865A\u62DF\u673A"},
-        {"Java","Java"},
-        {"Library path","\u5E93\u8DEF\u5F84"},
-        {"Listeners","\u76D1\u542C\u7A0B\u5E8F"},
-        {"Live Threads","\u6D3B\u52A8\u7EBF\u7A0B"},
-        {"Loaded", "\u5DF2\u52A0\u8F7D"},
-        {"Local Process:", "\u672C\u5730\u8FDB\u7A0B(L):"},
-        {"Local Process:.mnemonic", 'L'},
-        {"Look and Feel","\u5916\u89C2"},
-        {"Masthead.font", "Dialog-PLAIN-25"},
-        {"Management Not Enabled","<b>\u6CE8</b>: \u672A\u5BF9\u6B64\u8FDB\u7A0B\u542F\u7528\u7BA1\u7406\u4EE3\u7406\u3002"},
-        {"Management Will Be Enabled","<b>\u6CE8</b>: \u5C06\u5BF9\u6B64\u8FDB\u7A0B\u542F\u7528\u7BA1\u7406\u4EE3\u7406\u3002"},
-        {"MBeanAttributeInfo","MBeanAttributeInfo"},
-        {"MBeanInfo","MBeanInfo"},
-        {"MBeanNotificationInfo","MBeanNotificationInfo"},
-        {"MBeanOperationInfo","MBeanOperationInfo"},
-        {"MBeans","MBean"},
-        {"MBeansTab.clearNotificationsButton", "\u6E05\u9664(C)"},
-        {"MBeansTab.clearNotificationsButton.mnemonic", 'C'},
-        {"MBeansTab.clearNotificationsButton.toolTip", "\u6E05\u9664\u901A\u77E5"},
-        {"MBeansTab.compositeNavigationMultiple", "\u7EC4\u5408\u5BFC\u822A{0}/{1}"},
-        {"MBeansTab.compositeNavigationSingle", "\u7EC4\u5408\u5BFC\u822A"},
-        {"MBeansTab.refreshAttributesButton", "\u5237\u65B0(R)"},
-        {"MBeansTab.refreshAttributesButton.mnemonic", 'R'},
-        {"MBeansTab.refreshAttributesButton.toolTip", "\u5237\u65B0\u5C5E\u6027"},
-        {"MBeansTab.subscribeNotificationsButton", "\u8BA2\u9605(S)"},
-        {"MBeansTab.subscribeNotificationsButton.mnemonic", 'S'},
-        {"MBeansTab.subscribeNotificationsButton.toolTip", "\u5F00\u59CB\u76D1\u542C\u901A\u77E5"},
-        {"MBeansTab.tabularNavigationMultiple", "\u8868\u683C\u5F0F\u5BFC\u822A{0}/{1}"},
-        {"MBeansTab.tabularNavigationSingle", "\u8868\u683C\u5F0F\u5BFC\u822A"},
-        {"MBeansTab.unsubscribeNotificationsButton", "\u53D6\u6D88\u8BA2\u9605(U)"},
-        {"MBeansTab.unsubscribeNotificationsButton.mnemonic", 'U'},
-        {"MBeansTab.unsubscribeNotificationsButton.toolTip", "\u505C\u6B62\u76D1\u542C\u901A\u77E5"},
-        {"Manage Hotspot MBeans in: ", "\u7BA1\u7406\u4EE5\u4E0B\u4F4D\u7F6E\u7684 HotSpot MBean: "},
-        {"Max","\u6700\u5927\u503C"},
-        {"Maximum heap size","\u6700\u5927\u5806\u5927\u5C0F"},
-        {"Memory","\u5185\u5B58"},
-        {"MemoryPoolLabel", "\u5185\u5B58\u6C60 \"{0}\""},
-        {"MemoryTab.heapPlotter.accessibleName", "\u5806\u7684\u5185\u5B58\u4F7F\u7528\u91CF\u56FE\u8868\u3002"},
-        {"MemoryTab.infoLabelFormat", "<html>\u5DF2\u7528: {0}    \u5DF2\u63D0\u4EA4: {1}    \u6700\u5927: {2}</html>"},
-        {"MemoryTab.nonHeapPlotter.accessibleName", "\u975E\u5806\u7684\u5185\u5B58\u4F7F\u7528\u91CF\u56FE\u8868\u3002"},
-        {"MemoryTab.poolChart.aboveThreshold", "\u5927\u4E8E{0}\u7684\u9608\u503C\u3002\n"},
-        {"MemoryTab.poolChart.accessibleName", "\u5185\u5B58\u6C60\u4F7F\u7528\u91CF\u56FE\u8868\u3002"},
-        {"MemoryTab.poolChart.belowThreshold", "\u4F4E\u4E8E{0}\u7684\u9608\u503C\u3002\n"},
-        {"MemoryTab.poolPlotter.accessibleName", "{0}\u7684\u5185\u5B58\u4F7F\u7528\u91CF\u56FE\u8868\u3002"},
-        {"Message","\u6D88\u606F"},
-        {"Method successfully invoked", "\u5DF2\u6210\u529F\u8C03\u7528\u65B9\u6CD5"},
-        {"Minimize All", "\u5168\u90E8\u6700\u5C0F\u5316(M)"},
-        {"Minimize All.mnemonic", 'M'},
-        {"Minus Version", "\u8FD9\u662F{0}\u7248\u672C {1}"},
-        {"Monitor locked",
-             "   - \u5DF2\u9501\u5B9A{0}\n"},
-        {"Motif","Motif"},
-        {"Name Build and Mode","{0} (\u5DE5\u4F5C\u7248\u672C {1}, {2})"},
-        {"Name and Build","{0} (\u5DE5\u4F5C\u7248\u672C {1})"},
-        {"Name","\u540D\u79F0"},
-        {"Name: ","\u540D\u79F0: "},
-        {"Name State",
-             "\u540D\u79F0: {0}\n\u72B6\u6001: {1}\n"},
-        {"Name State LockName",
-             "\u540D\u79F0: {0}\n\u72B6\u6001: {2}\u4E0A\u7684{1}\n"},
-        {"Name State LockName LockOwner",
-             "\u540D\u79F0: {0}\n\u72B6\u6001: {2}\u4E0A\u7684{1}, \u62E5\u6709\u8005: {3}\n"},
-        {"New Connection...", "\u65B0\u5EFA\u8FDE\u63A5(N)..."},
-        {"New Connection....mnemonic", 'N'},
-        {"New value applied","\u5DF2\u5E94\u7528\u65B0\u503C"},
-        {"No attribute selected","\u672A\u9009\u62E9\u5C5E\u6027"},
-        {"No deadlock detected","\u672A\u68C0\u6D4B\u5230\u6B7B\u9501"},
-        {"No value selected","\u672A\u9009\u62E9\u503C"},
-        {"Non-Heap Memory Usage","\u975E\u5806\u5185\u5B58\u4F7F\u7528\u91CF"},
-        {"Non-Heap", "\u975E\u5806"},
-        {"Not Yet Implemented","\u5C1A\u672A\u5B9E\u73B0"},
-        {"Not a valid event broadcaster", "\u4E0D\u662F\u6709\u6548\u7684\u4E8B\u4EF6\u5E7F\u64AD\u8005"},
-        {"Notification","\u901A\u77E5"},
-        {"Notification buffer","\u901A\u77E5\u7F13\u51B2\u533A"},
-        {"Notifications","\u901A\u77E5"},
-        {"NotifTypes", "NotifTypes"},
-        {"Number of Threads","\u7EBF\u7A0B\u6570"},
-        {"Number of Loaded Classes","\u5DF2\u52A0\u8F7D\u7C7B\u6570"},
-        {"Number of processors","\u5904\u7406\u7A0B\u5E8F\u6570"},
-        {"ObjectName","ObjectName"},
-        {"Operating System","\u64CD\u4F5C\u7CFB\u7EDF"},
-        {"Operation","\u64CD\u4F5C"},
-        {"Operation invocation","\u64CD\u4F5C\u8C03\u7528"},
-        {"Operation return value", "\u64CD\u4F5C\u8FD4\u56DE\u503C"},
-        {"Operations","\u64CD\u4F5C"},
-        {"Overview","\u6982\u89C8"},
-        {"OverviewPanel.plotter.accessibleName", "{0}\u7684\u56FE\u8868\u3002"},
-        {"Parameter", "\u53C2\u6570"},
-        {"Password: ", "\u53E3\u4EE4(P): "},
-        {"Password: .mnemonic", 'P'},
-        {"Password.accessibleName", "\u53E3\u4EE4"},
-        {"Peak","\u5CF0\u503C"},
-        {"Perform GC", "\u6267\u884C GC"},
-        {"Perform GC.mnemonic", 'G'},
-        {"Perform GC.toolTip", "\u8BF7\u6C42\u5783\u573E\u6536\u96C6"},
-        {"Plotter.accessibleName", "\u56FE\u8868"},
-        {"Plotter.accessibleName.keyAndValue", "{0}={1}\n"},
-        {"Plotter.accessibleName.noData", "\u672A\u7ED8\u5236\u6570\u636E\u3002"},
-        {"Plotter.saveAsMenuItem", "\u5C06\u6570\u636E\u53E6\u5B58\u4E3A(A)..."},
-        {"Plotter.saveAsMenuItem.mnemonic", 'A'},
-        {"Plotter.timeRangeMenu", "\u65F6\u95F4\u8303\u56F4(T)"},
-        {"Plotter.timeRangeMenu.mnemonic", 'T'},
-        {"Problem adding listener","\u6DFB\u52A0\u76D1\u542C\u7A0B\u5E8F\u65F6\u51FA\u73B0\u95EE\u9898"},
-        {"Problem displaying MBean", "\u663E\u793A MBean \u65F6\u51FA\u73B0\u95EE\u9898"},
-        {"Problem invoking", "\u8C03\u7528\u65F6\u51FA\u73B0\u95EE\u9898"},
-        {"Problem removing listener","\u5220\u9664\u76D1\u542C\u7A0B\u5E8F\u65F6\u51FA\u73B0\u95EE\u9898"},
-        {"Problem setting attribute","\u8BBE\u7F6E\u5C5E\u6027\u65F6\u51FA\u73B0\u95EE\u9898"},
-        {"Process CPU time","\u8FDB\u7A0B CPU \u65F6\u95F4"},
-        {"R/W","\u8BFB\u5199"},
-        {"Readable","\u53EF\u8BFB"},
-        {"Received","\u6536\u5230"},
-        {"Reconnect","\u91CD\u65B0\u8FDE\u63A5"},
-        {"Remote Process:", "\u8FDC\u7A0B\u8FDB\u7A0B(R):"},
-        {"Remote Process:.mnemonic", 'R'},
-        {"Remote Process.textField.accessibleName", "\u8FDC\u7A0B\u8FDB\u7A0B"},
-        {"Remove","\u5220\u9664"},
-        {"Restore All", "\u5168\u90E8\u8FD8\u539F(R)"},
-        {"Restore All.mnemonic", 'R'},
-        {"Return value", "\u8FD4\u56DE\u503C"},
-        {"ReturnType", "ReturnType"},
-        {"SeqNum","SeqNum"},
-        {"Size Bytes", "{0,number,integer} \u5B57\u8282"},
-        {"Size Gb","{0} GB"},
-        {"Size Kb","{0} KB"},
-        {"Size Mb","{0} MB"},
-        {"Source","\u6E90"},
-        {"Stack trace",
-              "\n\u5806\u6808\u8DDF\u8E2A: \n"},
-        {"Success:","\u6210\u529F:"},
-        // Note: SummaryTab.headerDateTimeFormat can be one the following:
-        // 1. A combination of two styles for date and time, using the
-        //    constants from class DateFormat: SHORT, MEDIUM, LONG, FULL.
-        //    Example: "MEDIUM,MEDIUM" or "FULL,SHORT"
-        // 2. An explicit string pattern used for creating an instance
-        //    of the class SimpleDateFormat.
-        //    Example: "yyyy-MM-dd HH:mm:ss" or "M/d/yyyy h:mm:ss a"
-        {"SummaryTab.headerDateTimeFormat", "FULL,FULL"},
-        {"SummaryTab.pendingFinalization.label", "\u6682\u6302\u6700\u7EC8\u5904\u7406"},
-        {"SummaryTab.pendingFinalization.value", "{0}\u5BF9\u8C61"},
-        {"SummaryTab.tabName", "VM \u6982\u8981"},
-        {"SummaryTab.vmVersion","{0}\u7248\u672C {1}"},
-        {"TabularData are not supported", "\u4E0D\u652F\u6301 TabularData"},
-        {"Threads","\u7EBF\u7A0B"},
-        {"ThreadTab.infoLabelFormat", "<html>\u6D3B\u52A8: {0}    \u5CF0\u503C: {1}    \u603B\u8BA1: {2}</html>"},
-        {"ThreadTab.threadInfo.accessibleName", "\u7EBF\u7A0B\u4FE1\u606F"},
-        {"ThreadTab.threadPlotter.accessibleName", "\u8868\u793A\u7EBF\u7A0B\u6570\u7684\u56FE\u8868\u3002"},
-        {"Threshold","\u9608\u503C"},
-        {"Tile", "\u5E73\u94FA(T)"},
-        {"Tile.mnemonic", 'T'},
-        {"Time Range:", "\u65F6\u95F4\u8303\u56F4(T):"},
-        {"Time Range:.mnemonic", 'T'},
-        {"Time", "\u65F6\u95F4"},
-        {"TimeStamp","TimeStamp"},
-        {"Total Loaded", "\u52A0\u8F7D\u603B\u6570"},
-        {"Total classes loaded","\u5DF2\u52A0\u8F7D\u7C7B\u603B\u6570"},
-        {"Total classes unloaded","\u5DF2\u5378\u8F7D\u7C7B\u603B\u6570"},
-        {"Total compile time","\u603B\u7F16\u8BD1\u65F6\u95F4"},
-        {"Total physical memory","\u603B\u7269\u7406\u5185\u5B58"},
-        {"Total threads started","\u542F\u52A8\u7684\u7EBF\u7A0B\u603B\u6570"},
-        {"Total swap space","\u603B\u4EA4\u6362\u7A7A\u95F4"},
-        {"Type","\u7C7B\u578B"},
-        {"Unavailable","\u4E0D\u53EF\u7528"},
-        {"UNKNOWN","UNKNOWN"},
-        {"Unknown Host","\u672A\u77E5\u4E3B\u673A: {0}"},
-        {"Unregister", "\u6CE8\u9500"},
-        {"Uptime","\u8FD0\u884C\u65F6\u95F4"},
-        {"Uptime: ","\u8FD0\u884C\u65F6\u95F4: "},
-        {"Usage Threshold","\u7528\u6CD5\u9608\u503C"},
-        {"remoteTF.usage","<b>\u7528\u6CD5</b>: &lt;hostname&gt;:&lt;port&gt; \u6216 service:jmx:&lt;protocol&gt;:&lt;sap&gt;"},
-        {"Used","\u5DF2\u7528"},
-        {"Username: ", "\u7528\u6237\u540D(U): "},
-        {"Username: .mnemonic", 'U'},
-        {"Username.accessibleName", "\u7528\u6237\u540D"},
-        {"UserData","UserData"},
-        {"Virtual Machine","\u865A\u62DF\u673A"},
-        {"VM arguments","VM \u53C2\u6570"},
-        {"VM","VM"},
-        {"VMInternalFrame.accessibleDescription", "\u7528\u4E8E\u76D1\u89C6 Java \u865A\u62DF\u673A\u7684\u5185\u90E8\u6846\u67B6"},
-        {"Value","\u503C"},
-        {"Vendor", "\u5382\u5546"},
-        {"Verbose Output","\u8BE6\u7EC6\u8F93\u51FA"},
-        {"Verbose Output.toolTip", "\u4E3A\u7C7B\u52A0\u8F7D\u7CFB\u7EDF\u542F\u7528\u8BE6\u7EC6\u8F93\u51FA"},
-        {"View value", "\u89C6\u56FE\u503C"},
-        {"View","\u89C6\u56FE"},
-        {"Window", "\u7A97\u53E3(W)"},
-        {"Window.mnemonic", 'W'},
-        {"Windows","Windows"},
-        {"Writable","\u53EF\u5199"},
-        {"You cannot drop a class here", "\u65E0\u6CD5\u5220\u9664\u6B64\u5904\u7684\u7C7B"},
-        {"collapse", "\u9690\u85CF"},
-        {"connectionFailed1","\u8FDE\u63A5\u5931\u8D25: \u662F\u5426\u91CD\u8BD5?"},
-        {"connectionFailed2","\u672A\u6210\u529F\u8FDE\u63A5\u5230{0}\u3002<br>\u662F\u5426\u8981\u91CD\u8BD5?"},
-        {"connectionLost1","\u8FDE\u63A5\u4E22\u5931: \u662F\u5426\u91CD\u65B0\u8FDE\u63A5?"},
-        {"connectionLost2","\u7531\u4E8E\u8FDC\u7A0B\u8FDB\u7A0B\u5DF2\u7EC8\u6B62, \u4E0E{0}\u7684\u8FDE\u63A5\u4E22\u5931\u3002<br>\u662F\u5426\u8981\u91CD\u65B0\u8FDE\u63A5?"},
-        {"connectingTo1","\u6B63\u5728\u8FDE\u63A5\u5230{0}"},
-        {"connectingTo2","\u60A8\u5F53\u524D\u6B63\u5728\u8FDE\u63A5\u5230{0}\u3002<br>\u8FD9\u5C06\u9700\u8981\u51E0\u5206\u949F\u7684\u65F6\u95F4\u3002"},
-        {"deadlockAllTab","\u5168\u90E8"},
-        {"deadlockTab","\u6B7B\u9501"},
-        {"deadlockTabN","\u6B7B\u9501{0}"},
-        {"expand", "\u5C55\u5F00"},
-        {"kbytes","{0} KB"},
-        {"operation","\u64CD\u4F5C"},
-        {"plot", "\u7ED8\u56FE"},
-        {"visualize","\u53EF\u89C6\u5316"},
-        {"zz usage text",
-             "\u7528\u6CD5: {0} [ -interval=n ] [ -notile ] [ -pluginpath <path> ] [ -version ] [ connection ... ]\n\n  -interval   \u5C06\u66F4\u65B0\u95F4\u9694\u8BBE\u7F6E\u4E3A n \u79D2 (\u9ED8\u8BA4\u503C\u4E3A 4 \u79D2)\n  -notile     \u521D\u59CB\u4E0D\u5E73\u94FA\u7A97\u53E3 (\u5BF9\u4E8E\u4E24\u4E2A\u6216\u591A\u4E2A\u8FDE\u63A5)\n  -pluginpath \u6307\u5B9A jconsole \u7528\u4E8E\u67E5\u627E\u63D2\u4EF6\u7684\u8DEF\u5F84\n  -version    \u8F93\u51FA\u7A0B\u5E8F\u7248\u672C\n\n  connection = pid || host:port || JMX URL (service:jmx:<\u534F\u8BAE>://...)\n  pid         \u76EE\u6807\u8FDB\u7A0B\u7684\u8FDB\u7A0B ID\n  host        \u8FDC\u7A0B\u4E3B\u673A\u540D\u6216 IP \u5730\u5740\n  port        \u8FDC\u7A0B\u8FDE\u63A5\u7684\u7AEF\u53E3\u53F7\n\n  -J          \u6307\u5B9A\u8FD0\u884C jconsole \u7684 Java \u865A\u62DF\u673A\n              \u7684\u8F93\u5165\u53C2\u6570"},
-        // END OF MATERIAL TO LOCALIZE
-        };
-
-        String ls = System.getProperty("line.separator");
-        for(int i=0;i<temp.length;i++) {
-            if (temp[i][1] instanceof String){
-            temp[i][1] = temp[i][1].toString().replaceAll("\n",ls);
-            }
-        }
-
-        return temp;
-
-    }
-
-    public synchronized Object[][] getContents() {
-        return getContents0();
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/tools/jconsole/resources/messages.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,276 @@
+ONE_DAY=\ 1 day
+ONE_HOUR=\ 1 hour
+ONE_MIN=\ 1 min
+ONE_MONTH=\ 1 month
+ONE_YEAR=\ 1 year
+TWO_HOURS=\ 2 hours
+THREE_HOURS=\ 3 hours
+THREE_MONTHS=\ 3 months
+FIVE_MIN=\ 5 min
+SIX_HOURS=\ 6 hours
+SIX_MONTHS=\ 6 months
+SEVEN_DAYS=\ 7 days
+TEN_MIN=10 min
+TWELVE_HOURS=12 hours
+THIRTY_MIN=30 min
+LESS_THAN=<
+A_LOT_LESS_THAN=<<
+GREATER_THAN=>
+ACTION_CAPITALIZED=ACTION
+ACTION_INFO_CAPITALIZED=ACTION_INFO
+ALL=All
+ARCHITECTURE=Architecture
+ATTRIBUTE=Attribute
+ATTRIBUTE_VALUE=Attribute value
+ATTRIBUTE_VALUES=Attribute values
+ATTRIBUTES=Attributes
+BLANK=Blank
+BLOCKED_COUNT_WAITED_COUNT=Total blocked: {0}  Total waited: {1}\n
+BOOT_CLASS_PATH=Boot class path
+BORDERED_COMPONENT_MORE_OR_LESS_BUTTON_TOOLTIP=Toggle to show more or less information
+CPU_USAGE=CPU Usage
+CPU_USAGE_FORMAT=CPU Usage: {0}%
+CANCEL=Cancel
+CASCADE=&Cascade
+CHART_COLON=&Chart:
+CLASS_PATH=Class path
+CLASS_NAME=ClassName
+CLASS_TAB_INFO_LABEL_FORMAT=<html>Loaded: {0}    Unloaded: {1}    Total: {2}</html>
+CLASS_TAB_LOADED_CLASSES_PLOTTER_ACCESSIBLE_NAME=Chart for Loaded Classes.
+CLASSES=Classes
+CLOSE=Close
+COLUMN_NAME=Name
+COLUMN_PID=PID
+COMMITTED_MEMORY=Committed memory
+COMMITTED_VIRTUAL_MEMORY=Committed virtual memory
+COMMITTED=Committed
+CONNECT=&Connect
+CONNECT_DIALOG_CONNECT_BUTTON_TOOLTIP=Connect to Java Virtual Machine
+CONNECT_DIALOG_ACCESSIBLE_DESCRIPTION=Dialog for making a new connection to a local or remote Java Virtual Machine
+CONNECT_DIALOG_MASTHEAD_ACCESSIBLE_NAME=Masthead Graphic
+CONNECT_DIALOG_MASTHEAD_TITLE=New Connection
+CONNECT_DIALOG_STATUS_BAR_ACCESSIBLE_NAME=Status Bar
+CONNECT_DIALOG_TITLE=JConsole: New Connection
+CONNECTED_PUNCTUATION_CLICK_TO_DISCONNECT_=Connected. Click to disconnect.
+CONNECTION_FAILED=Connection failed
+CONNECTION=&Connection
+CONNECTION_NAME=Connection name
+CONNECTION_NAME__DISCONNECTED_={0} (disconnected)
+CONSTRUCTOR=Constructor
+CURRENT_CLASSES_LOADED=Current classes loaded
+CURRENT_HEAP_SIZE=Current heap size
+CURRENT_VALUE=Current value: {0}
+CREATE=Create
+DAEMON_THREADS=Daemon threads
+DISCONNECTED_PUNCTUATION_CLICK_TO_CONNECT_=Disconnected. Click to connect.
+DOUBLE_CLICK_TO_EXPAND_FORWARD_SLASH_COLLAPSE=Double click to expand/collapse
+DOUBLE_CLICK_TO_VISUALIZE=Double click to visualize
+DESCRIPTION=Description
+DESCRIPTOR=Descriptor
+DETAILS=Details
+DETECT_DEADLOCK=&Detect Deadlock
+DETECT_DEADLOCK_TOOLTIP=Detect deadlocked threads
+DIMENSION_IS_NOT_SUPPORTED_COLON=Dimension is not supported:
+DISCARD_CHART=Discard chart
+DURATION_DAYS_HOURS_MINUTES={0,choice,1#{0,number,integer} day |1.0<{0,number,integer} days }{1,choice,0<{1,number,integer} hours |1#{1,number,integer} hour |1<{1,number,integer} hours }{2,choice,0<{2,number,integer} minutes|1#{2,number,integer} minute|1.0<{2,number,integer} minutes}
+DURATION_HOURS_MINUTES={0,choice,1#{0,number,integer} hour |1<{0,number,integer} hours }{1,choice,0<{1,number,integer} minutes|1#{1,number,integer} minute|1.0<{1,number,integer} minutes}
+DURATION_MINUTES={0,choice,1#{0,number,integer} minute|1.0<{0,number,integer} minutes}
+DURATION_SECONDS={0} seconds
+EMPTY_ARRAY=Empty array
+ERROR=Error
+ERROR_COLON_MBEANS_ALREADY_EXIST=Error: MBeans already exist
+ERROR_COLON_MBEANS_DO_NOT_EXIST=Error: MBeans do not exist
+EVENT=Event
+EXIT=E&xit
+FAIL_TO_LOAD_PLUGIN=Warning: Fail to load plugin: {0}
+FILE_CHOOSER_FILE_EXISTS_CANCEL_OPTION=Cancel
+FILE_CHOOSER_FILE_EXISTS_MESSAGE=<html><center>File already exists:<br>{0}<br>Do you want to replace it?
+FILE_CHOOSER_FILE_EXISTS_OK_OPTION=Replace
+FILE_CHOOSER_FILE_EXISTS_TITLE=File Exists
+FILE_CHOOSER_SAVED_FILE=<html>Saved to file:<br>{0}<br>({1} bytes)
+FILE_CHOOSER_SAVE_FAILED_MESSAGE=<html><center>Save to file failed:<br>{0}<br>{1}
+FILE_CHOOSER_SAVE_FAILED_TITLE=Save Failed
+FREE_PHYSICAL_MEMORY=Free physical memory
+FREE_SWAP_SPACE=Free swap space
+GARBAGE_COLLECTOR=Garbage collector
+GC_INFO=Name = ''{0}'', Collections = {1,choice,-1#Unavailable|0#{1,number,integer}}, Total time spent = {2}
+GC_TIME=GC time
+GC_TIME_DETAILS={0} on {1} ({2} collections)
+HEAP_MEMORY_USAGE=Heap Memory Usage
+HEAP=Heap
+HELP_ABOUT_DIALOG_ACCESSIBLE_DESCRIPTION=Dialog containing information about JConsole and JDK versions
+HELP_ABOUT_DIALOG_JCONSOLE_VERSION=JConsole version:<br>{0}
+HELP_ABOUT_DIALOG_JAVA_VERSION=Java VM version:<br>{0}
+HELP_ABOUT_DIALOG_MASTHEAD_ACCESSIBLE_NAME=Masthead Graphic
+HELP_ABOUT_DIALOG_MASTHEAD_TITLE=About JConsole
+HELP_ABOUT_DIALOG_TITLE=JConsole: About
+HELP_ABOUT_DIALOG_USER_GUIDE_LINK=JConsole &User Guide:<br>{0}
+HELP_ABOUT_DIALOG_USER_GUIDE_LINK_URL=http://docs.oracle.com/javase/{0}/docs/technotes/guides/management/jconsole.html
+HELP_MENU_ABOUT_TITLE=&About JConsole
+HELP_MENU_USER_GUIDE_TITLE=Online &User Guide
+HELP_MENU_TITLE=&Help
+HOTSPOT_MBEANS_ELLIPSIS=&Hotspot MBeans...
+HOTSPOT_MBEANS_DIALOG_ACCESSIBLE_DESCRIPTION=Dialog for managing Hotspot MBeans
+IMPACT=Impact
+INFO=Info
+INFO_CAPITALIZED=INFO
+INVALID_PLUGIN_PATH=Warning: Invalid plugin path: {0}
+INVALID_URL=Invalid URL: {0}
+IS=Is
+JAVA_MONITORING___MANAGEMENT_CONSOLE=Java Monitoring && Management Console
+JCONSOLE_COLON_=JConsole: {0}
+JCONSOLE_VERSION=JConsole version "{0}"
+JCONSOLE_ACCESSIBLE_DESCRIPTION=Java Monitoring && Management Console
+JIT_COMPILER=JIT compiler
+LIBRARY_PATH=Library path
+LIVE_THREADS=Live threads
+LOADED=Loaded
+LOCAL_PROCESS_COLON=&Local Process:
+MASTHEAD_FONT=Dialog-PLAIN-25
+MANAGEMENT_NOT_ENABLED=<b>Note</b>: The management agent is not enabled on this process.
+MANAGEMENT_WILL_BE_ENABLED=<b>Note</b>: The management agent will be enabled on this process.
+MBEAN_ATTRIBUTE_INFO=MBeanAttributeInfo
+MBEAN_INFO=MBeanInfo
+MBEAN_NOTIFICATION_INFO=MBeanNotificationInfo
+MBEAN_OPERATION_INFO=MBeanOperationInfo
+MBEANS=MBeans
+MBEANS_TAB_CLEAR_NOTIFICATIONS_BUTTON=&Clear
+MBEANS_TAB_CLEAR_NOTIFICATIONS_BUTTON_TOOLTIP=Clear notifications
+MBEANS_TAB_COMPOSITE_NAVIGATION_MULTIPLE=Composite Navigation {0}/{1}
+MBEANS_TAB_COMPOSITE_NAVIGATION_SINGLE=Composite Navigation
+MBEANS_TAB_REFRESH_ATTRIBUTES_BUTTON=&Refresh
+MBEANS_TAB_REFRESH_ATTRIBUTES_BUTTON_TOOLTIP=Refresh attributes
+MBEANS_TAB_SUBSCRIBE_NOTIFICATIONS_BUTTON=&Subscribe
+MBEANS_TAB_SUBSCRIBE_NOTIFICATIONS_BUTTON_TOOLTIP=Start listening for notifications
+MBEANS_TAB_TABULAR_NAVIGATION_MULTIPLE=Tabular Navigation {0}/{1}
+MBEANS_TAB_TABULAR_NAVIGATION_SINGLE=Tabular Navigation
+MBEANS_TAB_UNSUBSCRIBE_NOTIFICATIONS_BUTTON=&Unsubscribe
+MBEANS_TAB_UNSUBSCRIBE_NOTIFICATIONS_BUTTON_TOOLTIP=Stop listening for notifications
+MANAGE_HOTSPOT_MBEANS_IN_COLON_=Manage Hotspot MBeans in:
+MAX=Max
+MAXIMUM_HEAP_SIZE=Maximum heap size
+MEMORY=Memory
+MEMORY_POOL_LABEL=Memory Pool "{0}"
+MEMORY_TAB_HEAP_PLOTTER_ACCESSIBLE_NAME=Memory usage chart for heap.
+MEMORY_TAB_INFO_LABEL_FORMAT=<html>Used: {0}    Committed: {1}    Max: {2}</html>
+MEMORY_TAB_NON_HEAP_PLOTTER_ACCESSIBLE_NAME=Memory usage chart for non heap.
+MEMORY_TAB_POOL_CHART_ABOVE_THRESHOLD=which is above the threshold of {0}.\n
+MEMORY_TAB_POOL_CHART_ACCESSIBLE_NAME=Memory Pool Usage Chart.
+MEMORY_TAB_POOL_CHART_BELOW_THRESHOLD=which is below the threshold of {0}.\n
+MEMORY_TAB_POOL_PLOTTER_ACCESSIBLE_NAME=Memory usage chart for {0}.
+MESSAGE=Message
+METHOD_SUCCESSFULLY_INVOKED=Method successfully invoked
+MINIMIZE_ALL=&Minimize All
+MONITOR_LOCKED=\ \ \ - locked {0}\n
+NAME=Name
+NAME_AND_BUILD={0} (build {1})
+NAME_STATE=Name: {0}\nState: {1}\n
+NAME_STATE_LOCK_NAME=Name: {0}\nState: {1} on {2}\n
+NAME_STATE_LOCK_NAME_LOCK_OWNER=Name: {0}\nState: {1} on {2} owned by: {3}\n
+NEW_CONNECTION_ELLIPSIS=&New Connection...
+NO_DEADLOCK_DETECTED=No deadlock detected
+NON_HEAP_MEMORY_USAGE=Non-Heap Memory Usage
+NON_HEAP=Non-Heap
+NOTIFICATION=Notification
+NOTIFICATION_BUFFER=Notification buffer
+NOTIFICATIONS=Notifications
+NOTIF_TYPES=NotifTypes
+NUMBER_OF_THREADS=Number of Threads
+NUMBER_OF_LOADED_CLASSES=Number of Loaded Classes
+NUMBER_OF_PROCESSORS=Number of processors
+OBJECT_NAME=ObjectName
+OPERATING_SYSTEM=Operating System
+OPERATION=Operation
+OPERATION_INVOCATION=Operation invocation
+OPERATION_RETURN_VALUE=Operation return value
+OPERATIONS=Operations
+OVERVIEW=Overview
+OVERVIEW_PANEL_PLOTTER_ACCESSIBLE_NAME=Chart for {0}.
+PARAMETER=Parameter
+PASSWORD_ACCESSIBLE_NAME=Password
+PASSWORD_COLON_=&Password:
+PEAK=Peak
+PERFORM_GC=Perform &GC
+PERFORM_GC_TOOLTIP=Request Garbage Collection
+PLOTTER_ACCESSIBLE_NAME=Chart
+PLOTTER_ACCESSIBLE_NAME_KEY_AND_VALUE={0}={1}\n
+PLOTTER_ACCESSIBLE_NAME_NO_DATA=No data plotted.
+PLOTTER_SAVE_AS_MENU_ITEM=Save data &as...
+PLOTTER_TIME_RANGE_MENU=&Time Range
+PROBLEM_ADDING_LISTENER=Problem adding listener
+PROBLEM_DISPLAYING_MBEAN=Problem displaying MBean
+PROBLEM_INVOKING=Problem invoking
+PROBLEM_REMOVING_LISTENER=Problem removing listener
+PROBLEM_SETTING_ATTRIBUTE=Problem setting attribute
+PROCESS_CPU_TIME=Process CPU time
+READABLE=Readable
+RECONNECT=Reconnect
+INSECURE=Insecure
+REMOTE_PROCESS_COLON=&Remote Process:
+REMOTE_PROCESS_TEXT_FIELD_ACCESSIBLE_NAME=Remote Process
+RESTORE_ALL=&Restore All
+RETURN_TYPE=ReturnType
+SEQ_NUM=SeqNum
+SIZE_BYTES={0,number,integer} bytes
+SIZE_GB={0} Gb
+SIZE_KB={0} Kb
+SIZE_MB={0} Mb
+SOURCE=Source
+STACK_TRACE=\nStack trace: \n
+SUMMARY_TAB_HEADER_DATE_TIME_FORMAT=FULL,FULL
+SUMMARY_TAB_PENDING_FINALIZATION_LABEL=Pending finalization
+SUMMARY_TAB_PENDING_FINALIZATION_VALUE={0} objects
+SUMMARY_TAB_TAB_NAME=VM Summary
+SUMMARY_TAB_VM_VERSION={0} version {1}
+THREADS=Threads
+THREAD_TAB_THREAD_INFO_ACCESSIBLE_NAME=Thread Information
+THREAD_TAB_THREAD_PLOTTER_ACCESSIBLE_NAME=Chart for number of threads.
+THRESHOLD=Threshold
+TILE=&Tile
+TIME_RANGE_COLON=&Time Range:
+TIME=Time
+TIME_STAMP=TimeStamp
+TOTAL_LOADED=Total Loaded
+TOTAL_CLASSES_LOADED=Total classes loaded
+TOTAL_CLASSES_UNLOADED=Total classes unloaded
+TOTAL_COMPILE_TIME=Total compile time
+TOTAL_PHYSICAL_MEMORY=Total physical memory
+TOTAL_THREADS_STARTED=Total threads started
+TOTAL_SWAP_SPACE=Total swap space
+TYPE=Type
+UNAVAILABLE=Unavailable
+UNKNOWN_CAPITALIZED=UNKNOWN
+UNKNOWN_HOST=Unknown Host: {0}
+UNREGISTER=Unregister
+UPTIME=Uptime
+USAGE_THRESHOLD=Usage Threshold
+REMOTE_TF_USAGE=<b>Usage</b>: &lt;hostname&gt;:&lt;port&gt; OR service:jmx:&lt;protocol&gt;:&lt;sap&gt;
+USED=Used
+USERNAME_COLON_=&Username:
+USERNAME_ACCESSIBLE_NAME=User Name
+USER_DATA=UserData
+VIRTUAL_MACHINE=Virtual Machine
+VM_ARGUMENTS=VM arguments
+VMINTERNAL_FRAME_ACCESSIBLE_DESCRIPTION=Internal frame for monitoring a Java Virtual Machine
+VALUE=Value
+VENDOR=Vendor
+VERBOSE_OUTPUT=Verbose Output
+VERBOSE_OUTPUT_TOOLTIP=Enable verbose output for class loading system
+VIEW=View
+WINDOW=&Window
+WINDOWS=Windows
+WRITABLE=Writable
+CONNECTION_FAILED1=Connection Failed: Retry?
+CONNECTION_FAILED2=The connection to {0} did not succeed.<br>Would you like to try again?
+CONNECTION_LOST1=Connection Lost: Reconnect?
+CONNECTION_INSECURE1=ConnectionFailedSSL1
+CONNECTION_INSECURE2=ConnectionFailedSSL2
+CONNECTING_TO1=Connecting to {0}
+CONNECTING_TO2=You are currently being connected to {0}.<br>This will take a few moments.
+DEADLOCK_TAB=Deadlock
+DEADLOCK_TAB_N=Deadlock {0}
+EXPAND=expand
+KBYTES={0} kbytes
+PLOT=plot
+VISUALIZE=visualize
+ZZ_USAGE_TEXT=Usage: {0} [ -interval=n ] [ -notile ] [ -pluginpath <path> ] [ -version ] [ connection ... ]\n\n  -interval   Set the update interval to n seconds (default is 4 seconds)\n  -notile     Do not tile windows initially (for two or more connections)\n  -pluginpath Specify the path that jconsole uses to look up the plugins\n  -version    Print program version\n\n  connection = pid || host:port || JMX URL (service:jmx:<protocol>://...)\n  pid         The process id of a target process\n  host        A remote host name or IP address\n  port        The port number for the remote connection\n\n  -J          Specify the input arguments to the Java virtual machine\n              on which jconsole is running
--- a/src/share/classes/sun/tools/jconsole/resources/messages_ja.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/resources/messages_ja.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -105,7 +105,7 @@
 HELP_ABOUT_DIALOG_MASTHEAD_TITLE=JConsole\u306B\u3064\u3044\u3066
 HELP_ABOUT_DIALOG_TITLE=JConsole: \u8A73\u7D30
 HELP_ABOUT_DIALOG_USER_GUIDE_LINK=JConsole\u30E6\u30FC\u30B6\u30FC\u30FB\u30AC\u30A4\u30C9(&U):<br>{0}
-HELP_ABOUT_DIALOG_USER_GUIDE_LINK_URL=http://java.sun.com/javase/6/docs/technotes/guides/management/jconsole.html
+HELP_ABOUT_DIALOG_USER_GUIDE_LINK_URL=http://docs.oracle.com/javase/{0}/docs/technotes/guides/management/jconsole.html
 HELP_MENU_ABOUT_TITLE=JConsole\u306B\u3064\u3044\u3066(&A)
 HELP_MENU_USER_GUIDE_TITLE=\u30AA\u30F3\u30E9\u30A4\u30F3\u30FB\u30E6\u30FC\u30B6\u30FC\u30FB\u30AC\u30A4\u30C9(&U)
 HELP_MENU_TITLE=\u30D8\u30EB\u30D7(&H)
--- a/src/share/classes/sun/tools/jconsole/resources/messages_zh_CN.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/tools/jconsole/resources/messages_zh_CN.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -105,7 +105,7 @@
 HELP_ABOUT_DIALOG_MASTHEAD_TITLE=\u5173\u4E8E JConsole
 HELP_ABOUT_DIALOG_TITLE=JConsole: \u5173\u4E8E
 HELP_ABOUT_DIALOG_USER_GUIDE_LINK=JConsole \u7528\u6237\u6307\u5357(&U):<br>{0}
-HELP_ABOUT_DIALOG_USER_GUIDE_LINK_URL=http://java.sun.com/javase/6/docs/technotes/guides/management/jconsole.html
+HELP_ABOUT_DIALOG_USER_GUIDE_LINK_URL=http://docs.oracle.com/javase/{0}/docs/technotes/guides/management/jconsole.html
 HELP_MENU_ABOUT_TITLE=\u5173\u4E8E JConsole(&A)
 HELP_MENU_USER_GUIDE_TITLE=\u8054\u673A\u7528\u6237\u6307\u5357(&U)
 HELP_MENU_TITLE=\u5E2E\u52A9(&H)
--- a/src/share/classes/sun/util/logging/LoggingProxy.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/util/logging/LoggingProxy.java	Fri Jun 21 19:11:42 2013 -0700
@@ -61,6 +61,8 @@
 
     public String getLevelName(Object level);
 
+    public int getLevelValue(Object level);
+
     // return the logging property
     public String getProperty(String key);
 }
--- a/src/share/classes/sun/util/logging/LoggingSupport.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/util/logging/LoggingSupport.java	Fri Jun 21 19:11:42 2013 -0700
@@ -140,6 +140,11 @@
         return proxy.getLevelName(level);
     }
 
+    public static int getLevelValue(Object level) {
+        ensureAvailable();
+        return proxy.getLevelValue(level);
+    }
+
     private static final String DEFAULT_FORMAT =
         "%1$tb %1$td, %1$tY %1$tl:%1$tM:%1$tS %1$Tp %2$s%n%4$s: %5$s%6$s%n";
 
--- a/src/share/classes/sun/util/logging/PlatformLogger.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/util/logging/PlatformLogger.java	Fri Jun 21 19:11:42 2013 -0700
@@ -27,14 +27,12 @@
 package sun.util.logging;
 
 import java.lang.ref.WeakReference;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
 import java.io.PrintStream;
 import java.io.PrintWriter;
 import java.io.StringWriter;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
-import java.text.MessageFormat;
+import java.util.Arrays;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.Map;
@@ -87,7 +85,13 @@
  * @since 1.7
  */
 public class PlatformLogger {
-    // Same values as java.util.logging.Level for easy mapping
+    /*
+     * These constants should be shortcuts to Level enum constants that
+     * the clients of sun.util.logging.PlatformLogger require no source
+     * modification and avoid the conversion from int to Level enum.
+     *
+     * This can be done when JavaFX is converted to use the new PlatformLogger.Level API.
+     */
     public static final int OFF     = Integer.MAX_VALUE;
     public static final int SEVERE  = 1000;
     public static final int WARNING = 900;
@@ -98,7 +102,63 @@
     public static final int FINEST  = 300;
     public static final int ALL     = Integer.MIN_VALUE;
 
-    private static final int defaultLevel = INFO;
+    /**
+     * PlatformLogger logging levels.
+     */
+    public static enum Level {
+        // The name and value must match that of {@code java.util.logging.Level}s.
+        // Declare in ascending order of the given value for binary search.
+        ALL,
+        FINEST,
+        FINER,
+        FINE,
+        CONFIG,
+        INFO,
+        WARNING,
+        SEVERE,
+        OFF;
+
+        /**
+         * Associated java.util.logging.Level lazily initialized in
+         * JavaLoggerProxy's static initializer only once
+         * when java.util.logging is available and enabled.
+         * Only accessed by JavaLoggerProxy.
+         */
+        /* java.util.logging.Level */ Object javaLevel;
+
+        // ascending order for binary search matching the list of enum constants
+        private static final int[] levelValues = new int[] {
+            PlatformLogger.ALL, PlatformLogger.FINEST, PlatformLogger.FINER,
+            PlatformLogger.FINE, PlatformLogger.CONFIG, PlatformLogger.INFO,
+            PlatformLogger.WARNING, PlatformLogger.SEVERE, PlatformLogger.OFF
+        };
+
+        public int intValue() {
+            return levelValues[this.ordinal()];
+        }
+
+        static Level valueOf(int level) {
+            switch (level) {
+                // ordering per the highest occurences in the jdk source
+                // finest, fine, finer, info first
+                case PlatformLogger.FINEST  : return Level.FINEST;
+                case PlatformLogger.FINE    : return Level.FINE;
+                case PlatformLogger.FINER   : return Level.FINER;
+                case PlatformLogger.INFO    : return Level.INFO;
+                case PlatformLogger.WARNING : return Level.WARNING;
+                case PlatformLogger.CONFIG  : return Level.CONFIG;
+                case PlatformLogger.SEVERE  : return Level.SEVERE;
+                case PlatformLogger.OFF     : return Level.OFF;
+                case PlatformLogger.ALL     : return Level.ALL;
+            }
+            // return the nearest Level value >= the given level,
+            // for level > SEVERE, return SEVERE and exclude OFF
+            int i = Arrays.binarySearch(levelValues, 0, levelValues.length-2, level);
+            return values()[i >= 0 ? i : (-i-1)];
+        }
+    }
+
+    private static final Level DEFAULT_LEVEL = Level.INFO;
     private static boolean loggingEnabled;
     static {
         loggingEnabled = AccessController.doPrivileged(
@@ -109,6 +169,20 @@
                     return (cname != null || fname != null);
                 }
             });
+
+        // force loading of all JavaLoggerProxy (sub)classes to make JIT de-optimizations
+        // less probable.  Don't initialize JavaLoggerProxy class since
+        // java.util.logging may not be enabled.
+        try {
+            Class.forName("sun.util.logging.PlatformLogger$DefaultLoggerProxy",
+                          false,
+                          PlatformLogger.class.getClassLoader());
+            Class.forName("sun.util.logging.PlatformLogger$JavaLoggerProxy",
+                          false,   // do not invoke class initializer
+                          PlatformLogger.class.getClassLoader());
+        } catch (ClassNotFoundException ex) {
+            throw new InternalError(ex.getMessage());
+        }
     }
 
     // Table of known loggers.  Maps names to PlatformLoggers.
@@ -143,27 +217,32 @@
             WeakReference<PlatformLogger> ref = entry.getValue();
             PlatformLogger plog = ref.get();
             if (plog != null) {
-                plog.newJavaLogger();
+                plog.redirectToJavaLoggerProxy();
             }
         }
     }
 
     /**
-     * Creates a new JavaLogger that the platform logger uses
+     * Creates a new JavaLoggerProxy and redirects the platform logger to it
      */
-    private void newJavaLogger() {
-        logger = new JavaLogger(logger.name, logger.effectiveLevel);
+    private void redirectToJavaLoggerProxy() {
+        DefaultLoggerProxy lp = DefaultLoggerProxy.class.cast(this.loggerProxy);
+        JavaLoggerProxy jlp = new JavaLoggerProxy(lp.name, lp.level);
+        // the order of assignments is important
+        this.javaLoggerProxy = jlp;   // isLoggable checks javaLoggerProxy if set
+        this.loggerProxy = jlp;
     }
 
-    // logger may be replaced with a JavaLogger object
-    // when the logging facility is enabled
-    private volatile LoggerProxy logger;
-
+    // DefaultLoggerProxy may be replaced with a JavaLoggerProxy object
+    // when the java.util.logging facility is enabled
+    private volatile LoggerProxy loggerProxy;
+    // javaLoggerProxy is only set when the java.util.logging facility is enabled
+    private volatile JavaLoggerProxy javaLoggerProxy;
     private PlatformLogger(String name) {
         if (loggingEnabled) {
-            this.logger = new JavaLogger(name);
+            this.loggerProxy = this.javaLoggerProxy = new JavaLoggerProxy(name);
         } else {
-            this.logger = new LoggerProxy(name);
+            this.loggerProxy = new DefaultLoggerProxy(name);
         }
     }
 
@@ -172,204 +251,278 @@
      * (i.e. its level is OFF).
      */
     public boolean isEnabled() {
-        return logger.isEnabled();
+        return loggerProxy.isEnabled();
     }
 
     /**
      * Gets the name for this platform logger.
      */
     public String getName() {
-        return logger.name;
+        return loggerProxy.name;
+    }
+
+    /**
+     * Returns true if a message of the given level would actually
+     * be logged by this logger.
+     *
+     * @deprecated Use isLoggable(Level) instead.
+     */
+    @Deprecated
+    public boolean isLoggable(int levelValue) {
+        return isLoggable(Level.valueOf(levelValue));
+    }
+
+    /**
+     * Gets the current log level. Returns 0 if the current effective level is
+     * not set (equivalent to Logger.getLevel() returns null).
+     *
+     * @deprecated Use level() instead
+     */
+    @Deprecated
+    public int getLevel() {
+        Level level = loggerProxy.getLevel();
+        return level != null ? level.intValue() : 0;
+    }
+
+    /**
+     * Sets the log level.
+     *
+     * @deprecated Use setLevel(Level) instead
+     */
+    @Deprecated
+    public void setLevel(int newLevel) {
+        loggerProxy.setLevel(newLevel == 0 ? null : Level.valueOf(newLevel));
     }
 
     /**
      * Returns true if a message of the given level would actually
      * be logged by this logger.
      */
-    public boolean isLoggable(int level) {
-        return logger.isLoggable(level);
+    public boolean isLoggable(Level level) {
+        if (level == null) {
+            throw new NullPointerException();
+        }
+        // performance-sensitive method: use two monomorphic call-sites
+        JavaLoggerProxy jlp = javaLoggerProxy;
+        return jlp != null ? jlp.isLoggable(level) : loggerProxy.isLoggable(level);
     }
 
     /**
-     * Gets the current log level.  Returns 0 if the current effective level
-     * is not set (equivalent to Logger.getLevel() returns null).
+     * Get the log level that has been specified for this PlatformLogger.
+     * The result may be null, which means that this logger's
+     * effective level will be inherited from its parent.
+     *
+     * @return  this PlatformLogger's level
      */
-    public int getLevel() {
-        return logger.getLevel();
+    public Level level() {
+        return loggerProxy.getLevel();
     }
 
     /**
-     * Sets the log level.
+     * Set the log level specifying which message levels will be
+     * logged by this logger.  Message levels lower than this
+     * value will be discarded.  The level value {@link #OFF}
+     * can be used to turn off logging.
+     * <p>
+     * If the new level is null, it means that this node should
+     * inherit its level from its nearest ancestor with a specific
+     * (non-null) level value.
+     *
+     * @param newLevel the new value for the log level (may be null)
      */
-    public void setLevel(int newLevel) {
-        logger.setLevel(newLevel);
+    public void setLevel(Level newLevel) {
+        loggerProxy.setLevel(newLevel);
     }
 
     /**
      * Logs a SEVERE message.
      */
     public void severe(String msg) {
-        logger.doLog(SEVERE, msg);
+        loggerProxy.doLog(Level.SEVERE, msg);
     }
 
     public void severe(String msg, Throwable t) {
-        logger.doLog(SEVERE, msg, t);
+        loggerProxy.doLog(Level.SEVERE, msg, t);
     }
 
     public void severe(String msg, Object... params) {
-        logger.doLog(SEVERE, msg, params);
+        loggerProxy.doLog(Level.SEVERE, msg, params);
     }
 
     /**
      * Logs a WARNING message.
      */
     public void warning(String msg) {
-        logger.doLog(WARNING, msg);
+        loggerProxy.doLog(Level.WARNING, msg);
     }
 
     public void warning(String msg, Throwable t) {
-        logger.doLog(WARNING, msg, t);
+        loggerProxy.doLog(Level.WARNING, msg, t);
     }
 
     public void warning(String msg, Object... params) {
-        logger.doLog(WARNING, msg, params);
+        loggerProxy.doLog(Level.WARNING, msg, params);
     }
 
     /**
      * Logs an INFO message.
      */
     public void info(String msg) {
-        logger.doLog(INFO, msg);
+        loggerProxy.doLog(Level.INFO, msg);
     }
 
     public void info(String msg, Throwable t) {
-        logger.doLog(INFO, msg, t);
+        loggerProxy.doLog(Level.INFO, msg, t);
     }
 
     public void info(String msg, Object... params) {
-        logger.doLog(INFO, msg, params);
+        loggerProxy.doLog(Level.INFO, msg, params);
     }
 
     /**
      * Logs a CONFIG message.
      */
     public void config(String msg) {
-        logger.doLog(CONFIG, msg);
+        loggerProxy.doLog(Level.CONFIG, msg);
     }
 
     public void config(String msg, Throwable t) {
-        logger.doLog(CONFIG, msg, t);
+        loggerProxy.doLog(Level.CONFIG, msg, t);
     }
 
     public void config(String msg, Object... params) {
-        logger.doLog(CONFIG, msg, params);
+        loggerProxy.doLog(Level.CONFIG, msg, params);
     }
 
     /**
      * Logs a FINE message.
      */
     public void fine(String msg) {
-        logger.doLog(FINE, msg);
+        loggerProxy.doLog(Level.FINE, msg);
     }
 
     public void fine(String msg, Throwable t) {
-        logger.doLog(FINE, msg, t);
+        loggerProxy.doLog(Level.FINE, msg, t);
     }
 
     public void fine(String msg, Object... params) {
-        logger.doLog(FINE, msg, params);
+        loggerProxy.doLog(Level.FINE, msg, params);
     }
 
     /**
      * Logs a FINER message.
      */
     public void finer(String msg) {
-        logger.doLog(FINER, msg);
+        loggerProxy.doLog(Level.FINER, msg);
     }
 
     public void finer(String msg, Throwable t) {
-        logger.doLog(FINER, msg, t);
+        loggerProxy.doLog(Level.FINER, msg, t);
     }
 
     public void finer(String msg, Object... params) {
-        logger.doLog(FINER, msg, params);
+        loggerProxy.doLog(Level.FINER, msg, params);
     }
 
     /**
      * Logs a FINEST message.
      */
     public void finest(String msg) {
-        logger.doLog(FINEST, msg);
+        loggerProxy.doLog(Level.FINEST, msg);
     }
 
     public void finest(String msg, Throwable t) {
-        logger.doLog(FINEST, msg, t);
+        loggerProxy.doLog(Level.FINEST, msg, t);
     }
 
     public void finest(String msg, Object... params) {
-        logger.doLog(FINEST, msg, params);
+        loggerProxy.doLog(Level.FINEST, msg, params);
     }
 
     /**
-     * Default platform logging support - output messages to
-     * System.err - equivalent to ConsoleHandler with SimpleFormatter.
+     * Abstract base class for logging support, defining the API and common field.
      */
-    static class LoggerProxy {
-        private static final PrintStream defaultStream = System.err;
+    private static abstract class LoggerProxy {
+        final String name;
 
-        final String name;
-        volatile int levelValue;
-        volatile int effectiveLevel = 0; // current effective level value
-
-        LoggerProxy(String name) {
-            this(name, defaultLevel);
+        protected LoggerProxy(String name) {
+            this.name = name;
         }
 
-        LoggerProxy(String name, int level) {
-            this.name = name;
-            this.levelValue = level == 0 ? defaultLevel : level;
+        abstract boolean isEnabled();
+
+        abstract Level getLevel();
+        abstract void setLevel(Level newLevel);
+
+        abstract void doLog(Level level, String msg);
+        abstract void doLog(Level level, String msg, Throwable thrown);
+        abstract void doLog(Level level, String msg, Object... params);
+
+        abstract boolean isLoggable(Level level);
+    }
+
+
+    private static final class DefaultLoggerProxy extends LoggerProxy {
+        /**
+         * Default platform logging support - output messages to System.err -
+         * equivalent to ConsoleHandler with SimpleFormatter.
+         */
+        private static PrintStream outputStream() {
+            return System.err;
+        }
+
+        volatile Level effectiveLevel; // effective level (never null)
+        volatile Level level;          // current level set for this node (may be null)
+
+        DefaultLoggerProxy(String name) {
+            super(name);
+            this.effectiveLevel = deriveEffectiveLevel(null);
+            this.level = null;
         }
 
         boolean isEnabled() {
-            return levelValue != OFF;
+            return effectiveLevel != Level.OFF;
         }
 
-        int getLevel() {
-            return effectiveLevel;
+        Level getLevel() {
+            return level;
         }
 
-        void setLevel(int newLevel) {
-            levelValue = newLevel;
-            effectiveLevel = newLevel;
+        void setLevel(Level newLevel) {
+            Level oldLevel = level;
+            if (oldLevel != newLevel) {
+                level = newLevel;
+                effectiveLevel = deriveEffectiveLevel(newLevel);
+            }
         }
 
-        void doLog(int level, String msg) {
-            if (level < levelValue || levelValue == OFF) {
-                return;
+        void doLog(Level level, String msg) {
+            if (isLoggable(level)) {
+                outputStream().print(format(level, msg, null));
             }
-            defaultStream.print(format(level, msg, null));
         }
 
-        void doLog(int level, String msg, Throwable thrown) {
-            if (level < levelValue || levelValue == OFF) {
-                return;
+        void doLog(Level level, String msg, Throwable thrown) {
+            if (isLoggable(level)) {
+                outputStream().print(format(level, msg, thrown));
             }
-            defaultStream.print(format(level, msg, thrown));
         }
 
-        void doLog(int level, String msg, Object... params) {
-            if (level < levelValue || levelValue == OFF) {
-                return;
+        void doLog(Level level, String msg, Object... params) {
+            if (isLoggable(level)) {
+                String newMsg = formatMessage(msg, params);
+                outputStream().print(format(level, newMsg, null));
             }
-            String newMsg = formatMessage(msg, params);
-            defaultStream.print(format(level, newMsg, null));
         }
 
-        public boolean isLoggable(int level) {
-            if (level < levelValue || levelValue == OFF) {
-                return false;
-            }
-            return true;
+        boolean isLoggable(Level level) {
+            Level effectiveLevel = this.effectiveLevel;
+            return level.intValue() >= effectiveLevel.intValue() && effectiveLevel != Level.OFF;
+        }
+
+        // derive effective level (could do inheritance search like j.u.l.Logger)
+        private Level deriveEffectiveLevel(Level level) {
+            return level == null ? DEFAULT_LEVEL : level;
         }
 
         // Copied from java.util.logging.Formatter.formatMessage
@@ -401,7 +554,7 @@
 
         // minimize memory allocation
         private Date date = new Date();
-        private synchronized String format(int level, String msg, Throwable thrown) {
+        private synchronized String format(Level level, String msg, Throwable thrown) {
             date.setTime(System.currentTimeMillis());
             String throwable = "";
             if (thrown != null) {
@@ -417,7 +570,7 @@
                                  date,
                                  getCallerInfo(),
                                  name,
-                                 PlatformLogger.getLevelName(level),
+                                 level.name(),
                                  msg,
                                  throwable);
         }
@@ -464,58 +617,44 @@
     }
 
     /**
-     * JavaLogger forwards all the calls to its corresponding
+     * JavaLoggerProxy forwards all the calls to its corresponding
      * java.util.logging.Logger object.
      */
-    static class JavaLogger extends LoggerProxy {
-        private static final Map<Integer, Object> levelObjects =
-            new HashMap<>();
-
+    private static final class JavaLoggerProxy extends LoggerProxy {
+        // initialize javaLevel fields for mapping from Level enum -> j.u.l.Level object
         static {
-            if (LoggingSupport.isAvailable()) {
-                // initialize the map to Level objects
-                getLevelObjects();
-            }
-        }
-
-        private static void getLevelObjects() {
-            // get all java.util.logging.Level objects
-            int[] levelArray = new int[] {OFF, SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST, ALL};
-            for (int l : levelArray) {
-                Object level = LoggingSupport.parseLevel(getLevelName(l));
-                levelObjects.put(l, level);
+            for (Level level : Level.values()) {
+                level.javaLevel = LoggingSupport.parseLevel(level.name());
             }
         }
 
-        private final Object javaLogger;
-        JavaLogger(String name) {
-            this(name, 0);
+        private final /* java.util.logging.Logger */ Object javaLogger;
+
+        JavaLoggerProxy(String name) {
+            this(name, null);
         }
 
-        JavaLogger(String name, int level) {
-            super(name, level);
+        JavaLoggerProxy(String name, Level level) {
+            super(name);
             this.javaLogger = LoggingSupport.getLogger(name);
-            if (level != 0) {
+            if (level != null) {
                 // level has been updated and so set the Logger's level
-                LoggingSupport.setLevel(javaLogger, levelObjects.get(level));
+                LoggingSupport.setLevel(javaLogger, level.javaLevel);
             }
         }
 
-       /**
-        * Let Logger.log() do the filtering since if the level of a
-        * platform logger is altered directly from
-        * java.util.logging.Logger.setLevel(), the levelValue will
-        * not be updated.
-        */
-        void doLog(int level, String msg) {
-            LoggingSupport.log(javaLogger, levelObjects.get(level), msg);
+        void doLog(Level level, String msg) {
+            LoggingSupport.log(javaLogger, level.javaLevel, msg);
         }
 
-        void doLog(int level, String msg, Throwable t) {
-            LoggingSupport.log(javaLogger, levelObjects.get(level), msg, t);
+        void doLog(Level level, String msg, Throwable t) {
+            LoggingSupport.log(javaLogger, level.javaLevel, msg, t);
         }
 
-        void doLog(int level, String msg, Object... params) {
+        void doLog(Level level, String msg, Object... params) {
+            if (!isLoggable(level)) {
+                return;
+            }
             // only pass String objects to the j.u.l.Logger which may
             // be created by untrusted code
             int len = (params != null) ? params.length : 0;
@@ -523,49 +662,35 @@
             for (int i = 0; i < len; i++) {
                 sparams [i] = String.valueOf(params[i]);
             }
-            LoggingSupport.log(javaLogger, levelObjects.get(level), msg, sparams);
+            LoggingSupport.log(javaLogger, level.javaLevel, msg, sparams);
         }
 
         boolean isEnabled() {
-            Object level = LoggingSupport.getLevel(javaLogger);
-            return level == null || level.equals(levelObjects.get(OFF)) == false;
-        }
-
-        int getLevel() {
-            Object level = LoggingSupport.getLevel(javaLogger);
-            if (level != null) {
-                for (Map.Entry<Integer, Object> l : levelObjects.entrySet()) {
-                    if (level == l.getValue()) {
-                        return l.getKey();
-                    }
-                }
-            }
-            return 0;
-        }
-
-        void setLevel(int newLevel) {
-            levelValue = newLevel;
-            LoggingSupport.setLevel(javaLogger, levelObjects.get(newLevel));
+            return LoggingSupport.isLoggable(javaLogger, Level.OFF.javaLevel);
         }
 
-        public boolean isLoggable(int level) {
-            return LoggingSupport.isLoggable(javaLogger, levelObjects.get(level));
+        /**
+         * Returns the PlatformLogger.Level mapped from j.u.l.Level
+         * set in the logger.  If the j.u.l.Logger is set to a custom Level,
+         * this method will return the nearest Level.
+         */
+        Level getLevel() {
+            Object javaLevel = LoggingSupport.getLevel(javaLogger);
+            if (javaLevel == null) return null;
+
+            try {
+                return Level.valueOf(LoggingSupport.getLevelName(javaLevel));
+            } catch (IllegalArgumentException e) {
+                return Level.valueOf(LoggingSupport.getLevelValue(javaLevel));
+            }
+        }
+
+        void setLevel(Level level) {
+            LoggingSupport.setLevel(javaLogger, level == null ? null : level.javaLevel);
+        }
+
+        boolean isLoggable(Level level) {
+            return LoggingSupport.isLoggable(javaLogger, level.javaLevel);
         }
     }
-
-    private static String getLevelName(int level) {
-        switch (level) {
-            case OFF     : return "OFF";
-            case SEVERE  : return "SEVERE";
-            case WARNING : return "WARNING";
-            case INFO    : return "INFO";
-            case CONFIG  : return "CONFIG";
-            case FINE    : return "FINE";
-            case FINER   : return "FINER";
-            case FINEST  : return "FINEST";
-            case ALL     : return "ALL";
-            default      : return "UNKNOWN";
-        }
-    }
-
 }
--- a/src/share/classes/sun/util/logging/resources/logging_sv.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/util/logging/resources/logging_sv.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -27,7 +27,7 @@
 # these are the same as the non-localized level name.
 
 # The following ALL CAPS words should be translated.
-ALL=ALL
+ALL=ALLA
 # The following ALL CAPS words should be translated.
 SEVERE=SEVERE
 # The following ALL CAPS words should be translated.
--- a/src/share/classes/sun/util/resources/CurrencyNames_es_VE.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/classes/sun/util/resources/CurrencyNames_es_VE.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -36,5 +36,5 @@
 # Taligent is a registered trademark of Taligent, Inc.
 
 VEB=Bs
-VEF=BsF.
+VEF=Bs.F.
 
--- a/src/share/demo/jfc/Notepad/resources/Notepad_ja.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/demo/jfc/Notepad/resources/Notepad_ja.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -38,7 +38,7 @@
 pasteLabel=\u8CBC\u4ED8\u3051
 pasteImage=resources/paste.gif
 undoLabel=\u5143\u306B\u623B\u3059
-redoLabel=\u518D\u5B9F\u884C
+redoLabel=\u3084\u308A\u76F4\u3057
 
 #
 # debug Menu definition
--- a/src/share/demo/jvmti/hprof/hprof.h	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/demo/jvmti/hprof/hprof.h	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, 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
@@ -65,6 +65,7 @@
 #include "jni.h"
 #include "jvmti.h"
 #include "classfile_constants.h"
+#include "jvm_md.h"
 
 #ifndef SKIP_NPT
 #include "npt.h"   /* To get NptEnv for doing character conversions */
--- a/src/share/demo/jvmti/hprof/hprof_init.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/demo/jvmti/hprof/hprof_init.c	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, 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
@@ -1899,6 +1899,7 @@
      */
     getSystemProperty("sun.boot.library.path", &boot_path);
     md_build_library_name(lname, FILENAME_MAX, boot_path, name);
+    jvmtiDeallocate(boot_path);
     handle = md_load_library(lname, err_buf, (int)sizeof(err_buf));
     if ( handle == NULL ) {
         /* This may be necessary on Windows. */
@@ -1941,6 +1942,9 @@
 JNIEXPORT jint JNICALL
 Agent_OnLoad(JavaVM *vm, char *options, void *reserved)
 {
+    char *boot_path = NULL;
+    char npt_lib[JVM_MAXPATHLEN];
+
     /* See if it's already loaded */
     if ( gdata!=NULL && gdata->isLoaded==JNI_TRUE ) {
         HPROF_ERROR(JNI_TRUE, "Cannot load this JVM TI agent twice, check your java command line for duplicate hprof options.");
@@ -1957,9 +1961,15 @@
 
     gdata->jvm = vm;
 
+    /* Get the JVMTI environment */
+    getJvmti();
+
 #ifndef SKIP_NPT
+    getSystemProperty("sun.boot.library.path", &boot_path);
     /* Load in NPT library for character conversions */
-    NPT_INITIALIZE(&(gdata->npt), NPT_VERSION, NULL);
+    md_build_library_name(npt_lib, sizeof(npt_lib), boot_path, NPT_LIBNAME);
+    jvmtiDeallocate(boot_path);
+    NPT_INITIALIZE(npt_lib, &(gdata->npt), NPT_VERSION, NULL);
     if ( gdata->npt == NULL ) {
         HPROF_ERROR(JNI_TRUE, "Cannot load npt library");
     }
@@ -1969,9 +1979,6 @@
     }
 #endif
 
-    /* Get the JVMTI environment */
-    getJvmti();
-
     /* Lock needed to protect debug_malloc() code, which is not MT safe */
     #ifdef DEBUG
         gdata->debug_malloc_lock = createRawMonitor("HPROF debug_malloc lock");
--- a/src/share/demo/management/MemoryMonitor/MemoryMonitor.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/demo/management/MemoryMonitor/MemoryMonitor.java	Fri Jun 21 19:11:42 2013 -0700
@@ -122,6 +122,7 @@
         private Font font = new Font("Times New Roman", Font.PLAIN, 11);
         private int columnInc;
         private float usedMem[][];
+        private float usedMemMax[]; // Used when max pool size is undefined
         private int ptNum[];
         private int ascent, descent;
         private Rectangle graphOutlineRect = new Rectangle();
@@ -142,6 +143,10 @@
                 }
             });
             usedMem = new float[numPools][];
+            usedMemMax = new float[numPools];
+            for (int i = 0; i < numPools; i++) {
+                usedMemMax[i] = 1024f * 1024f ;
+            }
             ptNum = new int[numPools];
         }
 
@@ -194,6 +199,12 @@
             MemoryPoolMXBean mp = mpools.get(npool);
             float usedMemory =  mp.getUsage().getUsed();
             float totalMemory =  mp.getUsage().getMax();
+            if (totalMemory < 0) { // Max is undefined for this pool
+                if (usedMemory > usedMemMax[npool]) {
+                    usedMemMax[npool] = usedMemory;
+                }
+                totalMemory = usedMemMax[npool];
+            }
 
             // .. Draw allocated and used strings ..
             big.setColor(Color.green);
--- a/src/share/demo/management/MemoryMonitor/README.txt	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/demo/management/MemoryMonitor/README.txt	Fri Jun 21 19:11:42 2013 -0700
@@ -38,7 +38,7 @@
 
 To run the MemoryMonitor demo
 
-   java -jar <JDK_HOME>/demo/management/MemoryMonitor.jar 
+   java -jar <JDK_HOME>/demo/management/MemoryMonitor/MemoryMonitor.jar 
 
 These instructions assume that this installation's version of the java
 command is in your path.  If it isn't, then you should either
--- a/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java	Fri Jun 21 19:11:42 2013 -0700
@@ -466,7 +466,10 @@
             if (eSrc.type == Entry.NEW || eSrc.type == Entry.FILECH)
             {
                 u.type = eSrc.type;    // make it the same type
-                if (!deletesrc) {      // if it's not "rename", just take the data
+                if (deletesrc) {       // if it's a "rename", take the data
+                    u.bytes = eSrc.bytes;
+                    u.file = eSrc.file;
+                } else {               // if it's not "rename", copy the data
                     if (eSrc.bytes != null)
                         u.bytes = Arrays.copyOf(eSrc.bytes, eSrc.bytes.length);
                     else if (eSrc.file != null) {
@@ -651,7 +654,11 @@
                     }
 
                     public int read(ByteBuffer dst) throws IOException {
-                        return rbc.read(dst);
+                        int n = rbc.read(dst);
+                        if (n > 0) {
+                            read += n;
+                        }
+                        return n;
                     }
 
                     public SeekableByteChannel truncate(long size)
@@ -1114,7 +1121,7 @@
             if (old != null) {
                 removeFromTree(old);
             }
-            if (e.type == Entry.NEW || e.type == Entry.FILECH) {
+            if (e.type == Entry.NEW || e.type == Entry.FILECH || e.type == Entry.COPY) {
                 IndexNode parent = inodes.get(LOOKUPKEY.as(getParent(e.name)));
                 e.sibling = parent.child;
                 parent.child = e;
@@ -2322,12 +2329,12 @@
     private void removeFromTree(IndexNode inode) {
         IndexNode parent = inodes.get(LOOKUPKEY.as(getParent(inode.name)));
         IndexNode child = parent.child;
-        if (child == inode) {
+        if (child.equals(inode)) {
             parent.child = child.sibling;
         } else {
             IndexNode last = child;
             while ((child = child.sibling) != null) {
-                if (child == inode) {
+                if (child.equals(inode)) {
                     last.sibling = child.sibling;
                     break;
                 } else {
--- a/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystemProvider.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystemProvider.java	Fri Jun 21 19:11:42 2013 -0700
@@ -78,7 +78,7 @@
         }
         try {
             // only support legacy JAR URL syntax  jar:{uri}!/{entry} for now
-            String spec = uri.getSchemeSpecificPart();
+            String spec = uri.getRawSchemeSpecificPart();
             int sep = spec.indexOf("!/");
             if (sep != -1)
                 spec = spec.substring(0, sep);
--- a/src/share/javavm/export/jawt.h	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/javavm/export/jawt.h	Fri Jun 21 19:11:42 2013 -0700
@@ -154,7 +154,9 @@
     /*
      * Pointer to the platform-specific information.  This can be safely
      * cast to a JAWT_Win32DrawingSurfaceInfo on Windows or a
-     * JAWT_X11DrawingSurfaceInfo on Solaris.  See jawt_md.h for details.
+     * JAWT_X11DrawingSurfaceInfo on Solaris. On Mac OS X, when using the
+     * native Cocoa toolkit this is a pointer to a NSObject that conforms
+     * to the JAWT_SurfaceLayers protocol. See jawt_md.h for details.
      */
     void* platformInfo;
     /* Cached pointer to the underlying drawing surface */
--- a/src/share/lib/security/java.security	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,426 +0,0 @@
-#
-# This is the "master security properties file".
-#
-# In this file, various security properties are set for use by
-# java.security classes. This is where users can statically register
-# Cryptography Package Providers ("providers" for short). The term
-# "provider" refers to a package or set of packages that supply a
-# concrete implementation of a subset of the cryptography aspects of
-# the Java Security API. A provider may, for example, implement one or
-# more digital signature algorithms or message digest algorithms.
-#
-# Each provider must implement a subclass of the Provider class.
-# To register a provider in this master security properties file,
-# specify the Provider subclass name and priority in the format
-#
-#    security.provider.<n>=<className>
-#
-# This declares a provider, and specifies its preference
-# order n. The preference order is the order in which providers are
-# searched for requested algorithms (when no specific provider is
-# requested). The order is 1-based; 1 is the most preferred, followed
-# by 2, and so on.
-#
-# <className> must specify the subclass of the Provider class whose
-# constructor sets the values of various properties that are required
-# for the Java Security API to look up the algorithms or other
-# facilities implemented by the provider.
-#
-# There must be at least one provider specification in java.security.
-# There is a default provider that comes standard with the JDK. It
-# is called the "SUN" provider, and its Provider subclass
-# named Sun appears in the sun.security.provider package. Thus, the
-# "SUN" provider is registered via the following:
-#
-#    security.provider.1=sun.security.provider.Sun
-#
-# (The number 1 is used for the default provider.)
-#
-# Note: Providers can be dynamically registered instead by calls to
-# either the addProvider or insertProviderAt method in the Security
-# class.
-
-#
-# List of providers and their preference orders (see above):
-#
-security.provider.1=sun.security.provider.Sun
-security.provider.2=sun.security.rsa.SunRsaSign
-security.provider.3=sun.security.ec.SunEC
-security.provider.4=com.sun.net.ssl.internal.ssl.Provider
-security.provider.5=com.sun.crypto.provider.SunJCE
-security.provider.6=sun.security.jgss.SunProvider
-security.provider.7=com.sun.security.sasl.Provider
-security.provider.8=org.jcp.xml.dsig.internal.dom.XMLDSigRI
-security.provider.9=sun.security.smartcardio.SunPCSC
-
-#
-# Select the source of seed data for SecureRandom. By default an
-# attempt is made to use the entropy gathering device specified by
-# the securerandom.source property. If an exception occurs when
-# accessing the URL then the traditional system/thread activity
-# algorithm is used.
-#
-# On Solaris and Linux systems, if file:/dev/urandom is specified and it
-# exists, a special SecureRandom implementation is activated by default.
-# This "NativePRNG" reads random bytes directly from /dev/urandom.
-#
-# On Windows systems, the URLs file:/dev/random and file:/dev/urandom
-# enables use of the Microsoft CryptoAPI seed functionality.
-#
-securerandom.source=file:/dev/urandom
-#
-# The entropy gathering device is described as a URL and can also
-# be specified with the system property "java.security.egd". For example,
-#   -Djava.security.egd=file:/dev/urandom
-# Specifying this system property will override the securerandom.source
-# setting.
-
-#
-# Class to instantiate as the javax.security.auth.login.Configuration
-# provider.
-#
-login.configuration.provider=com.sun.security.auth.login.ConfigFile
-
-#
-# Default login configuration file
-#
-#login.config.url.1=file:${user.home}/.java.login.config
-
-#
-# Class to instantiate as the system Policy. This is the name of the class
-# that will be used as the Policy object.
-#
-policy.provider=sun.security.provider.PolicyFile
-
-# The default is to have a single system-wide policy file,
-# and a policy file in the user's home directory.
-policy.url.1=file:${java.home}/lib/security/java.policy
-policy.url.2=file:${user.home}/.java.policy
-
-# whether or not we expand properties in the policy file
-# if this is set to false, properties (${...}) will not be expanded in policy
-# files.
-policy.expandProperties=true
-
-# whether or not we allow an extra policy to be passed on the command line
-# with -Djava.security.policy=somefile. Comment out this line to disable
-# this feature.
-policy.allowSystemProperty=true
-
-# whether or not we look into the IdentityScope for trusted Identities
-# when encountering a 1.1 signed JAR file. If the identity is found
-# and is trusted, we grant it AllPermission.
-policy.ignoreIdentityScope=false
-
-#
-# Default keystore type.
-#
-keystore.type=jks
-
-#
-# List of comma-separated packages that start with or equal this string
-# will cause a security exception to be thrown when
-# passed to checkPackageAccess unless the
-# corresponding RuntimePermission ("accessClassInPackage."+package) has
-# been granted.
-package.access=sun.,\
-               com.sun.xml.internal.,\
-               com.sun.imageio.,\
-               com.sun.istack.internal.,\
-               com.sun.jmx.,\
-               com.sun.proxy.,\
-               com.sun.org.apache.bcel.internal.,\
-               com.sun.org.apache.regexp.internal.,\
-               com.sun.org.apache.xerces.internal.,\
-               com.sun.org.apache.xpath.internal.,\
-               com.sun.org.apache.xalan.internal.extensions.,\
-               com.sun.org.apache.xalan.internal.lib.,\
-               com.sun.org.apache.xalan.internal.res.,\
-               com.sun.org.apache.xalan.internal.templates.,\
-               com.sun.org.apache.xalan.internal.utils.,\
-               com.sun.org.apache.xalan.internal.xslt.,\
-               com.sun.org.apache.xalan.internal.xsltc.cmdline.,\
-               com.sun.org.apache.xalan.internal.xsltc.compiler.,\
-               com.sun.org.apache.xalan.internal.xsltc.trax.,\
-               com.sun.org.apache.xalan.internal.xsltc.util.,\
-               com.sun.org.apache.xml.internal.res.,\
-               com.sun.org.apache.xml.internal.serializer.utils.,\
-               com.sun.org.apache.xml.internal.utils.,\
-               com.sun.org.apache.xml.internal.security.,\
-               com.sun.org.glassfish.,\
-               org.jcp.xml.dsig.internal.
-
-#
-# List of comma-separated packages that start with or equal this string
-# will cause a security exception to be thrown when
-# passed to checkPackageDefinition unless the
-# corresponding RuntimePermission ("defineClassInPackage."+package) has
-# been granted.
-#
-# by default, none of the class loaders supplied with the JDK call
-# checkPackageDefinition.
-#
-package.definition=sun.,\
-                   com.sun.xml.internal.,\
-                   com.sun.imageio.,\
-                   com.sun.istack.internal.,\
-                   com.sun.jmx.,\
-                   com.sun.proxy.,\
-                   com.sun.org.apache.bcel.internal.,\
-                   com.sun.org.apache.regexp.internal.,\
-                   com.sun.org.apache.xerces.internal.,\
-                   com.sun.org.apache.xpath.internal.,\
-                   com.sun.org.apache.xalan.internal.extensions.,\
-                   com.sun.org.apache.xalan.internal.lib.,\
-                   com.sun.org.apache.xalan.internal.res.,\
-                   com.sun.org.apache.xalan.internal.templates.,\
-                   com.sun.org.apache.xalan.internal.utils.,\
-                   com.sun.org.apache.xalan.internal.xslt.,\
-                   com.sun.org.apache.xalan.internal.xsltc.cmdline.,\
-                   com.sun.org.apache.xalan.internal.xsltc.compiler.,\
-                   com.sun.org.apache.xalan.internal.xsltc.trax.,\
-                   com.sun.org.apache.xalan.internal.xsltc.util.,\
-                   com.sun.org.apache.xml.internal.res.,\
-                   com.sun.org.apache.xml.internal.serializer.utils.,\
-                   com.sun.org.apache.xml.internal.utils.,\
-                   com.sun.org.apache.xml.internal.security.,\
-                   com.sun.org.glassfish.,\
-                   org.jcp.xml.dsig.internal.
-
-#
-# Determines whether this properties file can be appended to
-# or overridden on the command line via -Djava.security.properties
-#
-security.overridePropertiesFile=true
-
-#
-# Determines the default key and trust manager factory algorithms for
-# the javax.net.ssl package.
-#
-ssl.KeyManagerFactory.algorithm=SunX509
-ssl.TrustManagerFactory.algorithm=PKIX
-
-#
-# The Java-level namelookup cache policy for successful lookups:
-#
-# any negative value: caching forever
-# any positive value: the number of seconds to cache an address for
-# zero: do not cache
-#
-# default value is forever (FOREVER). For security reasons, this
-# caching is made forever when a security manager is set. When a security
-# manager is not set, the default behavior in this implementation
-# is to cache for 30 seconds.
-#
-# NOTE: setting this to anything other than the default value can have
-#       serious security implications. Do not set it unless
-#       you are sure you are not exposed to DNS spoofing attack.
-#
-#networkaddress.cache.ttl=-1
-
-# The Java-level namelookup cache policy for failed lookups:
-#
-# any negative value: cache forever
-# any positive value: the number of seconds to cache negative lookup results
-# zero: do not cache
-#
-# In some Microsoft Windows networking environments that employ
-# the WINS name service in addition to DNS, name service lookups
-# that fail may take a noticeably long time to return (approx. 5 seconds).
-# For this reason the default caching policy is to maintain these
-# results for 10 seconds.
-#
-#
-networkaddress.cache.negative.ttl=10
-
-#
-# Properties to configure OCSP for certificate revocation checking
-#
-
-# Enable OCSP
-#
-# By default, OCSP is not used for certificate revocation checking.
-# This property enables the use of OCSP when set to the value "true".
-#
-# NOTE: SocketPermission is required to connect to an OCSP responder.
-#
-# Example,
-#   ocsp.enable=true
-
-#
-# Location of the OCSP responder
-#
-# By default, the location of the OCSP responder is determined implicitly
-# from the certificate being validated. This property explicitly specifies
-# the location of the OCSP responder. The property is used when the
-# Authority Information Access extension (defined in RFC 3280) is absent
-# from the certificate or when it requires overriding.
-#
-# Example,
-#   ocsp.responderURL=http://ocsp.example.net:80
-
-#
-# Subject name of the OCSP responder's certificate
-#
-# By default, the certificate of the OCSP responder is that of the issuer
-# of the certificate being validated. This property identifies the certificate
-# of the OCSP responder when the default does not apply. Its value is a string
-# distinguished name (defined in RFC 2253) which identifies a certificate in
-# the set of certificates supplied during cert path validation. In cases where
-# the subject name alone is not sufficient to uniquely identify the certificate
-# then both the "ocsp.responderCertIssuerName" and
-# "ocsp.responderCertSerialNumber" properties must be used instead. When this
-# property is set then those two properties are ignored.
-#
-# Example,
-#   ocsp.responderCertSubjectName="CN=OCSP Responder, O=XYZ Corp"
-
-#
-# Issuer name of the OCSP responder's certificate
-#
-# By default, the certificate of the OCSP responder is that of the issuer
-# of the certificate being validated. This property identifies the certificate
-# of the OCSP responder when the default does not apply. Its value is a string
-# distinguished name (defined in RFC 2253) which identifies a certificate in
-# the set of certificates supplied during cert path validation. When this
-# property is set then the "ocsp.responderCertSerialNumber" property must also
-# be set. When the "ocsp.responderCertSubjectName" property is set then this
-# property is ignored.
-#
-# Example,
-#   ocsp.responderCertIssuerName="CN=Enterprise CA, O=XYZ Corp"
-
-#
-# Serial number of the OCSP responder's certificate
-#
-# By default, the certificate of the OCSP responder is that of the issuer
-# of the certificate being validated. This property identifies the certificate
-# of the OCSP responder when the default does not apply. Its value is a string
-# of hexadecimal digits (colon or space separators may be present) which
-# identifies a certificate in the set of certificates supplied during cert path
-# validation. When this property is set then the "ocsp.responderCertIssuerName"
-# property must also be set. When the "ocsp.responderCertSubjectName" property
-# is set then this property is ignored.
-#
-# Example,
-#   ocsp.responderCertSerialNumber=2A:FF:00
-
-#
-# Policy for failed Kerberos KDC lookups:
-#
-# When a KDC is unavailable (network error, service failure, etc), it is
-# put inside a blacklist and accessed less often for future requests. The
-# value (case-insensitive) for this policy can be:
-#
-# tryLast
-#    KDCs in the blacklist are always tried after those not on the list.
-#
-# tryLess[:max_retries,timeout]
-#    KDCs in the blacklist are still tried by their order in the configuration,
-#    but with smaller max_retries and timeout values. max_retries and timeout
-#    are optional numerical parameters (default 1 and 5000, which means once
-#    and 5 seconds). Please notes that if any of the values defined here is
-#    more than what is defined in krb5.conf, it will be ignored.
-#
-# Whenever a KDC is detected as available, it is removed from the blacklist.
-# The blacklist is reset when krb5.conf is reloaded. You can add
-# refreshKrb5Config=true to a JAAS configuration file so that krb5.conf is
-# reloaded whenever a JAAS authentication is attempted.
-#
-# Example,
-#   krb5.kdc.bad.policy = tryLast
-#   krb5.kdc.bad.policy = tryLess:2,2000
-krb5.kdc.bad.policy = tryLast
-
-# Algorithm restrictions for certification path (CertPath) processing
-#
-# In some environments, certain algorithms or key lengths may be undesirable
-# for certification path building and validation.  For example, "MD2" is
-# generally no longer considered to be a secure hash algorithm.  This section
-# describes the mechanism for disabling algorithms based on algorithm name
-# and/or key length.  This includes algorithms used in certificates, as well
-# as revocation information such as CRLs and signed OCSP Responses.
-#
-# The syntax of the disabled algorithm string is described as this Java
-# BNF-style:
-#   DisabledAlgorithms:
-#       " DisabledAlgorithm { , DisabledAlgorithm } "
-#
-#   DisabledAlgorithm:
-#       AlgorithmName [Constraint]
-#
-#   AlgorithmName:
-#       (see below)
-#
-#   Constraint:
-#       KeySizeConstraint
-#
-#   KeySizeConstraint:
-#       keySize Operator DecimalInteger
-#
-#   Operator:
-#       <= | < | == | != | >= | >
-#
-#   DecimalInteger:
-#       DecimalDigits
-#
-#   DecimalDigits:
-#       DecimalDigit {DecimalDigit}
-#
-#   DecimalDigit: one of
-#       1 2 3 4 5 6 7 8 9 0
-#
-# The "AlgorithmName" is the standard algorithm name of the disabled
-# algorithm. See "Java Cryptography Architecture Standard Algorithm Name
-# Documentation" for information about Standard Algorithm Names.  Matching
-# is performed using a case-insensitive sub-element matching rule.  (For
-# example, in "SHA1withECDSA" the sub-elements are "SHA1" for hashing and
-# "ECDSA" for signatures.)  If the assertion "AlgorithmName" is a
-# sub-element of the certificate algorithm name, the algorithm will be
-# rejected during certification path building and validation.  For example,
-# the assertion algorithm name "DSA" will disable all certificate algorithms
-# that rely on DSA, such as NONEwithDSA, SHA1withDSA.  However, the assertion
-# will not disable algorithms related to "ECDSA".
-#
-# A "Constraint" provides further guidance for the algorithm being specified.
-# The "KeySizeConstraint" requires a key of a valid size range if the
-# "AlgorithmName" is of a key algorithm.  The "DecimalInteger" indicates the
-# key size specified in number of bits.  For example, "RSA keySize <= 1024"
-# indicates that any RSA key with key size less than or equal to 1024 bits
-# should be disabled, and "RSA keySize < 1024, RSA keySize > 2048" indicates
-# that any RSA key with key size less than 1024 or greater than 2048 should
-# be disabled. Note that the "KeySizeConstraint" only makes sense to key
-# algorithms.
-#
-# Note: This property is currently used by Oracle's PKIX implementation. It
-# is not guaranteed to be examined and used by other implementations.
-#
-# Example:
-#   jdk.certpath.disabledAlgorithms=MD2, DSA, RSA keySize < 2048
-#
-#
-jdk.certpath.disabledAlgorithms=MD2
-
-# Algorithm restrictions for Secure Socket Layer/Transport Layer Security
-# (SSL/TLS) processing
-#
-# In some environments, certain algorithms or key lengths may be undesirable
-# when using SSL/TLS.  This section describes the mechanism for disabling
-# algorithms during SSL/TLS security parameters negotiation, including cipher
-# suites selection, peer authentication and key exchange mechanisms.
-#
-# For PKI-based peer authentication and key exchange mechanisms, this list
-# of disabled algorithms will also be checked during certification path
-# building and validation, including algorithms used in certificates, as
-# well as revocation information such as CRLs and signed OCSP Responses.
-# This is in addition to the jdk.certpath.disabledAlgorithms property above.
-#
-# See the specification of "jdk.certpath.disabledAlgorithms" for the
-# syntax of the disabled algorithm string.
-#
-# Note: This property is currently used by Oracle's JSSE implementation.
-# It is not guaranteed to be examined and used by other implementations.
-#
-# Example:
-#   jdk.tls.disabledAlgorithms=MD5, SHA1, DSA, RSA keySize < 2048
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/lib/security/java.security-linux	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,428 @@
+#
+# This is the "master security properties file".
+#
+# In this file, various security properties are set for use by
+# java.security classes. This is where users can statically register
+# Cryptography Package Providers ("providers" for short). The term
+# "provider" refers to a package or set of packages that supply a
+# concrete implementation of a subset of the cryptography aspects of
+# the Java Security API. A provider may, for example, implement one or
+# more digital signature algorithms or message digest algorithms.
+#
+# Each provider must implement a subclass of the Provider class.
+# To register a provider in this master security properties file,
+# specify the Provider subclass name and priority in the format
+#
+#    security.provider.<n>=<className>
+#
+# This declares a provider, and specifies its preference
+# order n. The preference order is the order in which providers are
+# searched for requested algorithms (when no specific provider is
+# requested). The order is 1-based; 1 is the most preferred, followed
+# by 2, and so on.
+#
+# <className> must specify the subclass of the Provider class whose
+# constructor sets the values of various properties that are required
+# for the Java Security API to look up the algorithms or other
+# facilities implemented by the provider.
+#
+# There must be at least one provider specification in java.security.
+# There is a default provider that comes standard with the JDK. It
+# is called the "SUN" provider, and its Provider subclass
+# named Sun appears in the sun.security.provider package. Thus, the
+# "SUN" provider is registered via the following:
+#
+#    security.provider.1=sun.security.provider.Sun
+#
+# (The number 1 is used for the default provider.)
+#
+# Note: Providers can be dynamically registered instead by calls to
+# either the addProvider or insertProviderAt method in the Security
+# class.
+
+#
+# List of providers and their preference orders (see above):
+#
+security.provider.1=sun.security.provider.Sun
+security.provider.2=sun.security.rsa.SunRsaSign
+security.provider.3=sun.security.ec.SunEC
+security.provider.4=com.sun.net.ssl.internal.ssl.Provider
+security.provider.5=com.sun.crypto.provider.SunJCE
+security.provider.6=sun.security.jgss.SunProvider
+security.provider.7=com.sun.security.sasl.Provider
+security.provider.8=org.jcp.xml.dsig.internal.dom.XMLDSigRI
+security.provider.9=sun.security.smartcardio.SunPCSC
+
+#
+# Select the source of seed data for SecureRandom. By default an
+# attempt is made to use the entropy gathering device specified by
+# the securerandom.source property. If an exception occurs when
+# accessing the URL then the traditional system/thread activity
+# algorithm is used.
+#
+# On Solaris and Linux systems, if file:/dev/urandom is specified and it
+# exists, a special SecureRandom implementation is activated by default.
+# This "NativePRNG" reads random bytes directly from /dev/urandom.
+#
+# On Windows systems, the URLs file:/dev/random and file:/dev/urandom
+# enables use of the Microsoft CryptoAPI seed functionality.
+#
+securerandom.source=file:/dev/urandom
+#
+# The entropy gathering device is described as a URL and can also
+# be specified with the system property "java.security.egd". For example,
+#   -Djava.security.egd=file:/dev/urandom
+# Specifying this system property will override the securerandom.source
+# setting.
+
+#
+# Class to instantiate as the javax.security.auth.login.Configuration
+# provider.
+#
+login.configuration.provider=com.sun.security.auth.login.ConfigFile
+
+#
+# Default login configuration file
+#
+#login.config.url.1=file:${user.home}/.java.login.config
+
+#
+# Class to instantiate as the system Policy. This is the name of the class
+# that will be used as the Policy object.
+#
+policy.provider=sun.security.provider.PolicyFile
+
+# The default is to have a single system-wide policy file,
+# and a policy file in the user's home directory.
+policy.url.1=file:${java.home}/lib/security/java.policy
+policy.url.2=file:${user.home}/.java.policy
+
+# whether or not we expand properties in the policy file
+# if this is set to false, properties (${...}) will not be expanded in policy
+# files.
+policy.expandProperties=true
+
+# whether or not we allow an extra policy to be passed on the command line
+# with -Djava.security.policy=somefile. Comment out this line to disable
+# this feature.
+policy.allowSystemProperty=true
+
+# whether or not we look into the IdentityScope for trusted Identities
+# when encountering a 1.1 signed JAR file. If the identity is found
+# and is trusted, we grant it AllPermission.
+policy.ignoreIdentityScope=false
+
+#
+# Default keystore type.
+#
+keystore.type=jks
+
+#
+# List of comma-separated packages that start with or equal this string
+# will cause a security exception to be thrown when
+# passed to checkPackageAccess unless the
+# corresponding RuntimePermission ("accessClassInPackage."+package) has
+# been granted.
+package.access=sun.,\
+               com.sun.corba.se.impl.,\
+               com.sun.xml.internal.,\
+               com.sun.imageio.,\
+               com.sun.istack.internal.,\
+               com.sun.jmx.,\
+               com.sun.proxy.,\
+               com.sun.org.apache.bcel.internal.,\
+               com.sun.org.apache.regexp.internal.,\
+               com.sun.org.apache.xerces.internal.,\
+               com.sun.org.apache.xpath.internal.,\
+               com.sun.org.apache.xalan.internal.extensions.,\
+               com.sun.org.apache.xalan.internal.lib.,\
+               com.sun.org.apache.xalan.internal.res.,\
+               com.sun.org.apache.xalan.internal.templates.,\
+               com.sun.org.apache.xalan.internal.utils.,\
+               com.sun.org.apache.xalan.internal.xslt.,\
+               com.sun.org.apache.xalan.internal.xsltc.cmdline.,\
+               com.sun.org.apache.xalan.internal.xsltc.compiler.,\
+               com.sun.org.apache.xalan.internal.xsltc.trax.,\
+               com.sun.org.apache.xalan.internal.xsltc.util.,\
+               com.sun.org.apache.xml.internal.res.,\
+               com.sun.org.apache.xml.internal.serializer.utils.,\
+               com.sun.org.apache.xml.internal.utils.,\
+               com.sun.org.apache.xml.internal.security.,\
+               com.sun.org.glassfish.,\
+               org.jcp.xml.dsig.internal.,\
+               oracle.jrockit.jfr.
+#
+# List of comma-separated packages that start with or equal this string
+# will cause a security exception to be thrown when
+# passed to checkPackageDefinition unless the
+# corresponding RuntimePermission ("defineClassInPackage."+package) has
+# been granted.
+#
+# by default, none of the class loaders supplied with the JDK call
+# checkPackageDefinition.
+#
+package.definition=sun.,\
+                   com.sun.corba.se.impl.,\
+                   com.sun.xml.internal.,\
+                   com.sun.imageio.,\
+                   com.sun.istack.internal.,\
+                   com.sun.jmx.,\
+                   com.sun.proxy.,\
+                   com.sun.org.apache.bcel.internal.,\
+                   com.sun.org.apache.regexp.internal.,\
+                   com.sun.org.apache.xerces.internal.,\
+                   com.sun.org.apache.xpath.internal.,\
+                   com.sun.org.apache.xalan.internal.extensions.,\
+                   com.sun.org.apache.xalan.internal.lib.,\
+                   com.sun.org.apache.xalan.internal.res.,\
+                   com.sun.org.apache.xalan.internal.templates.,\
+                   com.sun.org.apache.xalan.internal.utils.,\
+                   com.sun.org.apache.xalan.internal.xslt.,\
+                   com.sun.org.apache.xalan.internal.xsltc.cmdline.,\
+                   com.sun.org.apache.xalan.internal.xsltc.compiler.,\
+                   com.sun.org.apache.xalan.internal.xsltc.trax.,\
+                   com.sun.org.apache.xalan.internal.xsltc.util.,\
+                   com.sun.org.apache.xml.internal.res.,\
+                   com.sun.org.apache.xml.internal.serializer.utils.,\
+                   com.sun.org.apache.xml.internal.utils.,\
+                   com.sun.org.apache.xml.internal.security.,\
+                   com.sun.org.glassfish.,\
+                   org.jcp.xml.dsig.internal.,\
+                   oracle.jrockit.jfr.
+#
+# Determines whether this properties file can be appended to
+# or overridden on the command line via -Djava.security.properties
+#
+security.overridePropertiesFile=true
+
+#
+# Determines the default key and trust manager factory algorithms for
+# the javax.net.ssl package.
+#
+ssl.KeyManagerFactory.algorithm=SunX509
+ssl.TrustManagerFactory.algorithm=PKIX
+
+#
+# The Java-level namelookup cache policy for successful lookups:
+#
+# any negative value: caching forever
+# any positive value: the number of seconds to cache an address for
+# zero: do not cache
+#
+# default value is forever (FOREVER). For security reasons, this
+# caching is made forever when a security manager is set. When a security
+# manager is not set, the default behavior in this implementation
+# is to cache for 30 seconds.
+#
+# NOTE: setting this to anything other than the default value can have
+#       serious security implications. Do not set it unless
+#       you are sure you are not exposed to DNS spoofing attack.
+#
+#networkaddress.cache.ttl=-1
+
+# The Java-level namelookup cache policy for failed lookups:
+#
+# any negative value: cache forever
+# any positive value: the number of seconds to cache negative lookup results
+# zero: do not cache
+#
+# In some Microsoft Windows networking environments that employ
+# the WINS name service in addition to DNS, name service lookups
+# that fail may take a noticeably long time to return (approx. 5 seconds).
+# For this reason the default caching policy is to maintain these
+# results for 10 seconds.
+#
+#
+networkaddress.cache.negative.ttl=10
+
+#
+# Properties to configure OCSP for certificate revocation checking
+#
+
+# Enable OCSP
+#
+# By default, OCSP is not used for certificate revocation checking.
+# This property enables the use of OCSP when set to the value "true".
+#
+# NOTE: SocketPermission is required to connect to an OCSP responder.
+#
+# Example,
+#   ocsp.enable=true
+
+#
+# Location of the OCSP responder
+#
+# By default, the location of the OCSP responder is determined implicitly
+# from the certificate being validated. This property explicitly specifies
+# the location of the OCSP responder. The property is used when the
+# Authority Information Access extension (defined in RFC 3280) is absent
+# from the certificate or when it requires overriding.
+#
+# Example,
+#   ocsp.responderURL=http://ocsp.example.net:80
+
+#
+# Subject name of the OCSP responder's certificate
+#
+# By default, the certificate of the OCSP responder is that of the issuer
+# of the certificate being validated. This property identifies the certificate
+# of the OCSP responder when the default does not apply. Its value is a string
+# distinguished name (defined in RFC 2253) which identifies a certificate in
+# the set of certificates supplied during cert path validation. In cases where
+# the subject name alone is not sufficient to uniquely identify the certificate
+# then both the "ocsp.responderCertIssuerName" and
+# "ocsp.responderCertSerialNumber" properties must be used instead. When this
+# property is set then those two properties are ignored.
+#
+# Example,
+#   ocsp.responderCertSubjectName="CN=OCSP Responder, O=XYZ Corp"
+
+#
+# Issuer name of the OCSP responder's certificate
+#
+# By default, the certificate of the OCSP responder is that of the issuer
+# of the certificate being validated. This property identifies the certificate
+# of the OCSP responder when the default does not apply. Its value is a string
+# distinguished name (defined in RFC 2253) which identifies a certificate in
+# the set of certificates supplied during cert path validation. When this
+# property is set then the "ocsp.responderCertSerialNumber" property must also
+# be set. When the "ocsp.responderCertSubjectName" property is set then this
+# property is ignored.
+#
+# Example,
+#   ocsp.responderCertIssuerName="CN=Enterprise CA, O=XYZ Corp"
+
+#
+# Serial number of the OCSP responder's certificate
+#
+# By default, the certificate of the OCSP responder is that of the issuer
+# of the certificate being validated. This property identifies the certificate
+# of the OCSP responder when the default does not apply. Its value is a string
+# of hexadecimal digits (colon or space separators may be present) which
+# identifies a certificate in the set of certificates supplied during cert path
+# validation. When this property is set then the "ocsp.responderCertIssuerName"
+# property must also be set. When the "ocsp.responderCertSubjectName" property
+# is set then this property is ignored.
+#
+# Example,
+#   ocsp.responderCertSerialNumber=2A:FF:00
+
+#
+# Policy for failed Kerberos KDC lookups:
+#
+# When a KDC is unavailable (network error, service failure, etc), it is
+# put inside a blacklist and accessed less often for future requests. The
+# value (case-insensitive) for this policy can be:
+#
+# tryLast
+#    KDCs in the blacklist are always tried after those not on the list.
+#
+# tryLess[:max_retries,timeout]
+#    KDCs in the blacklist are still tried by their order in the configuration,
+#    but with smaller max_retries and timeout values. max_retries and timeout
+#    are optional numerical parameters (default 1 and 5000, which means once
+#    and 5 seconds). Please notes that if any of the values defined here is
+#    more than what is defined in krb5.conf, it will be ignored.
+#
+# Whenever a KDC is detected as available, it is removed from the blacklist.
+# The blacklist is reset when krb5.conf is reloaded. You can add
+# refreshKrb5Config=true to a JAAS configuration file so that krb5.conf is
+# reloaded whenever a JAAS authentication is attempted.
+#
+# Example,
+#   krb5.kdc.bad.policy = tryLast
+#   krb5.kdc.bad.policy = tryLess:2,2000
+krb5.kdc.bad.policy = tryLast
+
+# Algorithm restrictions for certification path (CertPath) processing
+#
+# In some environments, certain algorithms or key lengths may be undesirable
+# for certification path building and validation.  For example, "MD2" is
+# generally no longer considered to be a secure hash algorithm.  This section
+# describes the mechanism for disabling algorithms based on algorithm name
+# and/or key length.  This includes algorithms used in certificates, as well
+# as revocation information such as CRLs and signed OCSP Responses.
+#
+# The syntax of the disabled algorithm string is described as this Java
+# BNF-style:
+#   DisabledAlgorithms:
+#       " DisabledAlgorithm { , DisabledAlgorithm } "
+#
+#   DisabledAlgorithm:
+#       AlgorithmName [Constraint]
+#
+#   AlgorithmName:
+#       (see below)
+#
+#   Constraint:
+#       KeySizeConstraint
+#
+#   KeySizeConstraint:
+#       keySize Operator DecimalInteger
+#
+#   Operator:
+#       <= | < | == | != | >= | >
+#
+#   DecimalInteger:
+#       DecimalDigits
+#
+#   DecimalDigits:
+#       DecimalDigit {DecimalDigit}
+#
+#   DecimalDigit: one of
+#       1 2 3 4 5 6 7 8 9 0
+#
+# The "AlgorithmName" is the standard algorithm name of the disabled
+# algorithm. See "Java Cryptography Architecture Standard Algorithm Name
+# Documentation" for information about Standard Algorithm Names.  Matching
+# is performed using a case-insensitive sub-element matching rule.  (For
+# example, in "SHA1withECDSA" the sub-elements are "SHA1" for hashing and
+# "ECDSA" for signatures.)  If the assertion "AlgorithmName" is a
+# sub-element of the certificate algorithm name, the algorithm will be
+# rejected during certification path building and validation.  For example,
+# the assertion algorithm name "DSA" will disable all certificate algorithms
+# that rely on DSA, such as NONEwithDSA, SHA1withDSA.  However, the assertion
+# will not disable algorithms related to "ECDSA".
+#
+# A "Constraint" provides further guidance for the algorithm being specified.
+# The "KeySizeConstraint" requires a key of a valid size range if the
+# "AlgorithmName" is of a key algorithm.  The "DecimalInteger" indicates the
+# key size specified in number of bits.  For example, "RSA keySize <= 1024"
+# indicates that any RSA key with key size less than or equal to 1024 bits
+# should be disabled, and "RSA keySize < 1024, RSA keySize > 2048" indicates
+# that any RSA key with key size less than 1024 or greater than 2048 should
+# be disabled. Note that the "KeySizeConstraint" only makes sense to key
+# algorithms.
+#
+# Note: This property is currently used by Oracle's PKIX implementation. It
+# is not guaranteed to be examined and used by other implementations.
+#
+# Example:
+#   jdk.certpath.disabledAlgorithms=MD2, DSA, RSA keySize < 2048
+#
+#
+jdk.certpath.disabledAlgorithms=MD2, RSA keySize < 1024
+
+# Algorithm restrictions for Secure Socket Layer/Transport Layer Security
+# (SSL/TLS) processing
+#
+# In some environments, certain algorithms or key lengths may be undesirable
+# when using SSL/TLS.  This section describes the mechanism for disabling
+# algorithms during SSL/TLS security parameters negotiation, including cipher
+# suites selection, peer authentication and key exchange mechanisms.
+#
+# For PKI-based peer authentication and key exchange mechanisms, this list
+# of disabled algorithms will also be checked during certification path
+# building and validation, including algorithms used in certificates, as
+# well as revocation information such as CRLs and signed OCSP Responses.
+# This is in addition to the jdk.certpath.disabledAlgorithms property above.
+#
+# See the specification of "jdk.certpath.disabledAlgorithms" for the
+# syntax of the disabled algorithm string.
+#
+# Note: This property is currently used by Oracle's JSSE implementation.
+# It is not guaranteed to be examined and used by other implementations.
+#
+# Example:
+#   jdk.tls.disabledAlgorithms=MD5, SHA1, DSA, RSA keySize < 2048
+
--- a/src/share/lib/security/java.security-macosx	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/lib/security/java.security-macosx	Fri Jun 21 19:11:42 2013 -0700
@@ -125,6 +125,7 @@
 # corresponding RuntimePermission ("accessClassInPackage."+package) has
 # been granted.
 package.access=sun.,\
+               com.sun.corba.se.impl.,\
                com.sun.xml.internal.,\
                com.sun.imageio.,\
                com.sun.istack.internal.,\
@@ -150,6 +151,7 @@
                com.sun.org.apache.xml.internal.security.,\
                com.sun.org.glassfish.,\
                org.jcp.xml.dsig.internal.,\
+               oracle.jrockit.jfr.,\
                apple.
 
 #
@@ -163,6 +165,7 @@
 # checkPackageDefinition.
 #
 package.definition=sun.,\
+                   com.sun.corba.se.impl.,\
                    com.sun.xml.internal.,\
                    com.sun.imageio.,\
                    com.sun.istack.internal.,\
@@ -188,6 +191,7 @@
                    com.sun.org.apache.xml.internal.security.,\
                    com.sun.org.glassfish.,\
                    org.jcp.xml.dsig.internal.,\
+                   oracle.jrockit.jfr.,\
                    apple.
 
 #
@@ -402,7 +406,7 @@
 #   jdk.certpath.disabledAlgorithms=MD2, DSA, RSA keySize < 2048
 #
 #
-jdk.certpath.disabledAlgorithms=MD2
+jdk.certpath.disabledAlgorithms=MD2, RSA keySize < 1024
 
 # Algorithm restrictions for Secure Socket Layer/Transport Layer Security
 # (SSL/TLS) processing
--- a/src/share/lib/security/java.security-solaris	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/lib/security/java.security-solaris	Fri Jun 21 19:11:42 2013 -0700
@@ -126,6 +126,7 @@
 # corresponding RuntimePermission ("accessClassInPackage."+package) has
 # been granted.
 package.access=sun.,\
+               com.sun.corba.se.impl.,\
                com.sun.xml.internal.,\
                com.sun.imageio.,\
                com.sun.istack.internal.,\
@@ -150,7 +151,8 @@
                com.sun.org.apache.xml.internal.utils.,\
                com.sun.org.apache.xml.internal.security.,\
                com.sun.org.glassfish.,\
-               org.jcp.xml.dsig.internal.
+               org.jcp.xml.dsig.internal.,\
+               oracle.jrockit.jfr.
 
 #
 # List of comma-separated packages that start with or equal this string
@@ -163,6 +165,7 @@
 # checkPackageDefinition.
 #
 package.definition=sun.,\
+                   com.sun.corba.se.impl.,\
                    com.sun.xml.internal.,\
                    com.sun.imageio.,\
                    com.sun.istack.internal.,\
@@ -187,7 +190,8 @@
                    com.sun.org.apache.xml.internal.utils.,\
                    com.sun.org.apache.xml.internal.security.,\
                    com.sun.org.glassfish.,\
-                   org.jcp.xml.dsig.internal.
+                   org.jcp.xml.dsig.internal.,\
+                   oracle.jrockit.jfr.
 
 #
 # Determines whether this properties file can be appended to
@@ -401,7 +405,7 @@
 #   jdk.certpath.disabledAlgorithms=MD2, DSA, RSA keySize < 2048
 #
 #
-jdk.certpath.disabledAlgorithms=MD2
+jdk.certpath.disabledAlgorithms=MD2, RSA keySize < 1024
 
 # Algorithm restrictions for Secure Socket Layer/Transport Layer Security
 # (SSL/TLS) processing
--- a/src/share/lib/security/java.security-windows	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/lib/security/java.security-windows	Fri Jun 21 19:11:42 2013 -0700
@@ -125,6 +125,7 @@
 # corresponding RuntimePermission ("accessClassInPackage."+package) has
 # been granted.
 package.access=sun.,\
+               com.sun.corba.se.impl.,\
                com.sun.xml.internal.,\
                com.sun.imageio.,\
                com.sun.istack.internal.,\
@@ -150,7 +151,8 @@
                com.sun.org.apache.xml.internal.security.,\
                com.sun.org.glassfish.,\
                org.jcp.xml.dsig.internal.,\
-               com.sun.java.accessibility.
+               com.sun.java.accessibility.,\
+               oracle.jrockit.jfr.
 
 #
 # List of comma-separated packages that start with or equal this string
@@ -163,6 +165,7 @@
 # checkPackageDefinition.
 #
 package.definition=sun.,\
+                   com.sun.corba.se.impl.,\
                    com.sun.xml.internal.,\
                    com.sun.imageio.,\
                    com.sun.istack.internal.,\
@@ -188,7 +191,8 @@
                    com.sun.org.apache.xml.internal.security.,\
                    com.sun.org.glassfish.,\
                    org.jcp.xml.dsig.internal.,\
-                   com.sun.java.accessibility.
+                   com.sun.java.accessibility.,\
+                   oracle.jrockit.jfr.
 
 #
 # Determines whether this properties file can be appended to
@@ -402,7 +406,7 @@
 #   jdk.certpath.disabledAlgorithms=MD2, DSA, RSA keySize < 2048
 #
 #
-jdk.certpath.disabledAlgorithms=MD2
+jdk.certpath.disabledAlgorithms=MD2, RSA keySize < 1024
 
 # Algorithm restrictions for Secure Socket Layer/Transport Layer Security
 # (SSL/TLS) processing
--- a/src/share/native/com/sun/java/util/jar/pack/defines.h	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/native/com/sun/java/util/jar/pack/defines.h	Fri Jun 21 19:11:42 2013 -0700
@@ -93,7 +93,7 @@
 // bytes and byte arrays
 
 typedef unsigned int uint;
-#if !defined(MACOSX) || (defined(MACOSX) && defined(NO_ZLIB))
+#if defined(NO_ZLIB)
 #ifdef _LP64
 typedef unsigned int uLong; // Historical zlib, should be 32-bit.
 #else
--- a/src/share/native/com/sun/java/util/jar/pack/jni.cpp	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/native/com/sun/java/util/jar/pack/jni.cpp	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -83,7 +83,11 @@
 static unpacker* get_unpacker() {
   //fprintf(stderr, "get_unpacker()\n");
   JavaVM* vm = null;
-  JNI_GetCreatedJavaVMs(&vm, 1, null);
+  jsize nVM = 0;
+  jint retval = JNI_GetCreatedJavaVMs(&vm, 1, &nVM);
+  // other VM implements may differ, thus for correctness, we need these checks
+  if (retval != JNI_OK || nVM != 1)
+    return null;
   void* envRaw = null;
   vm->GetEnv(&envRaw, JNI_VERSION_1_1);
   JNIEnv* env = (JNIEnv*) envRaw;
--- a/src/share/native/java/io/FileInputStream.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/native/java/io/FileInputStream.c	Fri Jun 21 19:11:42 2013 -0700
@@ -62,7 +62,7 @@
 }
 
 JNIEXPORT jint JNICALL
-Java_java_io_FileInputStream_read(JNIEnv *env, jobject this) {
+Java_java_io_FileInputStream_read0(JNIEnv *env, jobject this) {
     return readSingle(env, this, fis_fd);
 }
 
--- a/src/share/native/java/io/ObjectInputStream.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/native/java/io/ObjectInputStream.c	Fri Jun 21 19:11:42 2013 -0700
@@ -173,16 +173,3 @@
     (*env)->ReleasePrimitiveArrayCritical(env, dst, doubles, 0);
 }
 
-/*
- * Class:     java_io_ObjectInputStream
- * Method:    latestUserDefinedLoader
- * Signature: ()Ljava/lang/ClassLoader;
- *
- * Returns the first non-null class loader up the execution stack, or null
- * if only code from the null class loader is on the stack.
- */
-JNIEXPORT jobject JNICALL
-Java_java_io_ObjectInputStream_latestUserDefinedLoader(JNIEnv *env, jclass cls)
-{
-    return JVM_LatestUserDefinedLoader(env);
-}
--- a/src/share/native/java/io/RandomAccessFile.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/native/java/io/RandomAccessFile.c	Fri Jun 21 19:11:42 2013 -0700
@@ -64,23 +64,23 @@
 }
 
 JNIEXPORT jint JNICALL
-Java_java_io_RandomAccessFile_read(JNIEnv *env, jobject this) {
+Java_java_io_RandomAccessFile_read0(JNIEnv *env, jobject this) {
     return readSingle(env, this, raf_fd);
 }
 
 JNIEXPORT jint JNICALL
-Java_java_io_RandomAccessFile_readBytes(JNIEnv *env,
+Java_java_io_RandomAccessFile_readBytes0(JNIEnv *env,
     jobject this, jbyteArray bytes, jint off, jint len) {
     return readBytes(env, this, bytes, off, len, raf_fd);
 }
 
 JNIEXPORT void JNICALL
-Java_java_io_RandomAccessFile_write(JNIEnv *env, jobject this, jint byte) {
+Java_java_io_RandomAccessFile_write0(JNIEnv *env, jobject this, jint byte) {
     writeSingle(env, this, byte, JNI_FALSE, raf_fd);
 }
 
 JNIEXPORT void JNICALL
-Java_java_io_RandomAccessFile_writeBytes(JNIEnv *env,
+Java_java_io_RandomAccessFile_writeBytes0(JNIEnv *env,
     jobject this, jbyteArray bytes, jint off, jint len) {
     writeBytes(env, this, bytes, off, len, JNI_FALSE, raf_fd);
 }
--- a/src/share/native/java/io/io_util.h	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/native/java/io/io_util.h	Fri Jun 21 19:11:42 2013 -0700
@@ -25,9 +25,6 @@
 
 #include "jni.h"
 #include "jni_util.h"
-#ifdef MACOSX
-char* convertToNFDIfNeeded(const char *origPath, char *buf, size_t bufsize);
-#endif
 
 extern jfieldID IO_fd_fdID;
 extern jfieldID IO_handle_fdID;
@@ -59,7 +56,6 @@
 void throwFileNotFoundException(JNIEnv *env, jstring path);
 
 
-
 /*
  * Macros for managing platform strings.  The typical usage pattern is:
  *
@@ -88,35 +84,6 @@
  * declares a unique variable.
  */
 
-#ifdef MACOSX
-
-#define WITH_PLATFORM_STRING(env, strexp, var)                                \
-    if (1) {                                                                  \
-        const char *var;                                                      \
-        jstring _##var##str = (strexp);                                       \
-        if (_##var##str == NULL) {                                            \
-            JNU_ThrowNullPointerException((env), NULL);                       \
-            goto _##var##end;                                                 \
-        }                                                                     \
-        const char *temp_var = JNU_GetStringPlatformChars((env), _##var##str, NULL);      \
-        if (temp_var == NULL) goto _##var##end;                               \
-        char buf[MAXPATHLEN];                                                 \
-        var = convertToNFDIfNeeded(temp_var, buf, sizeof(buf));
-
-#define WITH_FIELD_PLATFORM_STRING(env, object, id, var)                      \
-    WITH_PLATFORM_STRING(env,                                                 \
-                         ((object == NULL)                                    \
-                          ? NULL                                              \
-                          : (*(env))->GetObjectField((env), (object), (id))), \
-                        var)
-
-#define END_PLATFORM_STRING(env, var)                                         \
-        JNU_ReleaseStringPlatformChars(env, _##var##str, temp_var);           \
-    _##var##end: ;                                                            \
-    } else ((void)NULL)
-
-#else
-
 #define WITH_PLATFORM_STRING(env, strexp, var)                                \
     if (1) {                                                                  \
         const char *var;                                                      \
@@ -140,8 +107,6 @@
     _##var##end: ;                                                            \
     } else ((void)NULL)
 
-#endif
-
 
 /* Macros for transforming Java Strings into native Unicode strings.
  * Works analogously to WITH_PLATFORM_STRING.
--- a/src/share/native/java/lang/System.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/native/java/lang/System.c	Fri Jun 21 19:11:42 2013 -0700
@@ -382,11 +382,19 @@
         sprops->display_variant, sprops->format_variant, putID, getPropID);
     GETPROP(props, "file.encoding", jVMVal);
     if (jVMVal == NULL) {
+#ifdef MACOSX
+        /*
+         * Since sun_jnu_encoding is now hard-coded to UTF-8 on Mac, we don't
+         * want to use it to overwrite file.encoding
+         */
+        PUTPROP(props, "file.encoding", sprops->encoding);
+#else
         if (fmtdefault) {
             PUTPROP(props, "file.encoding", sprops->encoding);
         } else {
             PUTPROP(props, "file.encoding", sprops->sun_jnu_encoding);
         }
+#endif
     } else {
         (*env)->DeleteLocalRef(env, jVMVal);
     }
--- a/src/share/native/java/net/net_util.h	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/native/java/net/net_util.h	Fri Jun 21 19:11:42 2013 -0700
@@ -148,6 +148,9 @@
 int
 NET_IsEqual(jbyte* caddr1, jbyte* caddr2);
 
+int
+NET_IsZeroAddr(jbyte* caddr);
+
 /* Socket operations
  *
  * These work just like the JVM_* procedures, except that they may do some
--- a/src/share/native/java/util/zip/Adler32.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/native/java/util/zip/Adler32.c	Fri Jun 21 19:11:42 2013 -0700
@@ -29,7 +29,7 @@
 
 #include "jni.h"
 #include "jni_util.h"
-#include "zlib.h"
+#include <zlib.h>
 
 #include "java_util_zip_Adler32.h"
 
--- a/src/share/native/java/util/zip/CRC32.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/native/java/util/zip/CRC32.c	Fri Jun 21 19:11:42 2013 -0700
@@ -29,7 +29,7 @@
 
 #include "jni.h"
 #include "jni_util.h"
-#include "zlib.h"
+#include <zlib.h>
 
 #include "java_util_zip_CRC32.h"
 
--- a/src/share/native/java/util/zip/Deflater.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/native/java/util/zip/Deflater.c	Fri Jun 21 19:11:42 2013 -0700
@@ -32,7 +32,7 @@
 #include "jlong.h"
 #include "jni.h"
 #include "jni_util.h"
-#include "zlib.h"
+#include <zlib.h>
 
 #include "java_util_zip_Deflater.h"
 
@@ -215,18 +215,6 @@
     return ((z_stream *)jlong_to_ptr(addr))->adler;
 }
 
-JNIEXPORT jlong JNICALL
-Java_java_util_zip_Deflater_getBytesRead(JNIEnv *env, jclass cls, jlong addr)
-{
-    return ((z_stream *)jlong_to_ptr(addr))->total_in;
-}
-
-JNIEXPORT jlong JNICALL
-Java_java_util_zip_Deflater_getBytesWritten(JNIEnv *env, jclass cls, jlong addr)
-{
-    return ((z_stream *)jlong_to_ptr(addr))->total_out;
-}
-
 JNIEXPORT void JNICALL
 Java_java_util_zip_Deflater_reset(JNIEnv *env, jclass cls, jlong addr)
 {
--- a/src/share/native/java/util/zip/Inflater.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/native/java/util/zip/Inflater.c	Fri Jun 21 19:11:42 2013 -0700
@@ -35,7 +35,7 @@
 #include "jni.h"
 #include "jvm.h"
 #include "jni_util.h"
-#include "zlib.h"
+#include <zlib.h>
 #include "java_util_zip_Inflater.h"
 
 #define ThrowDataFormatException(env, msg) \
@@ -174,18 +174,6 @@
     return ((z_stream *)jlong_to_ptr(addr))->adler;
 }
 
-JNIEXPORT jlong JNICALL
-Java_java_util_zip_Inflater_getBytesRead(JNIEnv *env, jclass cls, jlong addr)
-{
-    return ((z_stream *)jlong_to_ptr(addr))->total_in;
-}
-
-JNIEXPORT jlong JNICALL
-Java_java_util_zip_Inflater_getBytesWritten(JNIEnv *env, jclass cls, jlong addr)
-{
-    return ((z_stream *)jlong_to_ptr(addr))->total_out;
-}
-
 JNIEXPORT void JNICALL
 Java_java_util_zip_Inflater_reset(JNIEnv *env, jclass cls, jlong addr)
 {
--- a/src/share/native/java/util/zip/ZipFile.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/native/java/util/zip/ZipFile.c	Fri Jun 21 19:11:42 2013 -0700
@@ -117,6 +117,7 @@
             result = ptr_to_jlong(zip);
         } else if (msg != 0) {
             ThrowZipException(env, msg);
+            free(msg);
         } else if (errno == ENOMEM) {
             JNU_ThrowOutOfMemoryError(env, 0);
         } else {
--- a/src/share/native/java/util/zip/zip_util.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/native/java/util/zip/zip_util.c	Fri Jun 21 19:11:42 2013 -0700
@@ -44,7 +44,7 @@
 #include "io_util.h"
 #include "io_util_md.h"
 #include "zip_util.h"
-#include "zlib.h"
+#include <zlib.h>
 
 #ifdef _ALLBSD_SOURCE
 #define off64_t off_t
@@ -726,7 +726,7 @@
  * Opens a zip file with the specified mode. Returns the jzfile object
  * or NULL if an error occurred. If a zip error occurred then *pmsg will
  * be set to the error message text if pmsg != 0. Otherwise, *pmsg will be
- * set to NULL.
+ * set to NULL. Caller is responsible to free the error message.
  */
 jzfile *
 ZIP_Open_Generic(const char *name, char **pmsg, int mode, jlong lastModified)
@@ -751,12 +751,12 @@
  * Returns the jzfile corresponding to the given file name from the cache of
  * zip files, or NULL if the file is not in the cache.  If the name is longer
  * than PATH_MAX or a zip error occurred then *pmsg will be set to the error
- * message text if pmsg != 0. Otherwise, *pmsg will be set to NULL.
+ * message text if pmsg != 0. Otherwise, *pmsg will be set to NULL. Caller
+ * is responsible to free the error message.
  */
 jzfile *
 ZIP_Get_From_Cache(const char *name, char **pmsg, jlong lastModified)
 {
-    static char errbuf[256];
     char buf[PATH_MAX];
     jzfile *zip;
 
@@ -771,7 +771,7 @@
 
     if (strlen(name) >= PATH_MAX) {
         if (pmsg) {
-            *pmsg = "zip file name too long";
+            *pmsg = strdup("zip file name too long");
         }
         return NULL;
     }
@@ -796,7 +796,8 @@
  * Reads data from the given file descriptor to create a jzfile, puts the
  * jzfile in a cache, and returns that jzfile.  Returns NULL in case of error.
  * If a zip error occurs, then *pmsg will be set to the error message text if
- * pmsg != 0. Otherwise, *pmsg will be set to NULL.
+ * pmsg != 0. Otherwise, *pmsg will be set to NULL. Caller is responsible to
+ * free the error message.
  */
 
 jzfile *
@@ -809,7 +810,7 @@
 ZIP_Put_In_Cache0(const char *name, ZFILE zfd, char **pmsg, jlong lastModified,
                  jboolean usemmap)
 {
-    static char errbuf[256];
+    char errbuf[256];
     jlong len;
     jzfile *zip;
 
@@ -825,7 +826,7 @@
 
     if (zfd == -1) {
         if (pmsg && JVM_GetLastErrorString(errbuf, sizeof(errbuf)) > 0)
-            *pmsg = errbuf;
+            *pmsg = strdup(errbuf);
         freeZip(zip);
         return NULL;
     }
@@ -842,11 +843,11 @@
     if (len <= 0) {
         if (len == 0) { /* zip file is empty */
             if (pmsg) {
-                *pmsg = "zip file is empty";
+                *pmsg = strdup("zip file is empty");
             }
         } else { /* error */
             if (pmsg && JVM_GetLastErrorString(errbuf, sizeof(errbuf)) > 0)
-                *pmsg = errbuf;
+                *pmsg = strdup(errbuf);
         }
         ZFILE_Close(zfd);
         freeZip(zip);
@@ -858,7 +859,8 @@
         /* An error occurred while trying to read the zip file */
         if (pmsg != 0) {
             /* Set the zip error message */
-            *pmsg = zip->msg;
+            if (zip->msg != NULL)
+                *pmsg = strdup(zip->msg);
         }
         freeZip(zip);
         return NULL;
@@ -875,12 +877,17 @@
  * Opens a zip file for reading. Returns the jzfile object or NULL
  * if an error occurred. If a zip error occurred then *msg will be
  * set to the error message text if msg != 0. Otherwise, *msg will be
- * set to NULL.
+ * set to NULL. Caller doesn't need to free the error message.
  */
 jzfile * JNICALL
 ZIP_Open(const char *name, char **pmsg)
 {
-    return ZIP_Open_Generic(name, pmsg, O_RDONLY, 0);
+    jzfile *file = ZIP_Open_Generic(name, pmsg, O_RDONLY, 0);
+    if (file == NULL && pmsg != NULL && *pmsg != NULL) {
+        free(*pmsg);
+        *pmsg = "Zip file open error";
+    }
+    return file;
 }
 
 /*
--- a/src/share/native/java/util/zip/zip_util.h	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/native/java/util/zip/zip_util.h	Fri Jun 21 19:11:42 2013 -0700
@@ -177,8 +177,8 @@
  */
 typedef struct jzcell {
     unsigned int hash;    /* 32 bit hashcode on name */
+    unsigned int next;    /* hash chain: index into jzfile->entries */
     jlong cenpos;         /* Offset of central directory file header */
-    unsigned int next;    /* hash chain: index into jzfile->entries */
 } jzcell;
 
 typedef struct cencache {
--- a/src/share/native/java/util/zip/zlib-1.2.3/compress.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/native/java/util/zip/zlib-1.2.3/compress.c	Fri Jun 21 19:11:42 2013 -0700
@@ -75,7 +75,7 @@
         deflateEnd(&stream);
         return err == Z_OK ? Z_BUF_ERROR : err;
     }
-    *destLen = (uLong)stream.total_out;
+    *destLen = stream.total_out;
 
     err = deflateEnd(&stream);
     return err;
--- a/src/share/native/java/util/zip/zlib-1.2.3/inflate.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/native/java/util/zip/zlib-1.2.3/inflate.c	Fri Jun 21 19:11:42 2013 -0700
@@ -1287,7 +1287,7 @@
 z_streamp strm;
 {
     unsigned len;               /* number of bytes to look at or looked at */
-    long long in, out;          /* temporary to save total_in and total_out */
+    unsigned long in, out;      /* temporary to save total_in and total_out */
     unsigned char buf[4];       /* to restore bit buffer to byte string */
     struct inflate_state FAR *state;
 
--- a/src/share/native/java/util/zip/zlib-1.2.3/patches/ChangeLog_java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/native/java/util/zip/zlib-1.2.3/patches/ChangeLog_java	Fri Jun 21 19:11:42 2013 -0700
@@ -8,9 +8,3 @@
 
 (3)updated crc32.c/crc32()
    unsigned long      -> uLong
-
-(4)updated zlib.h (to support > 4G zipfile):
-   total_in/out: uLong -> long long
-
-(5)updated upinflate.c/inflateSync()
-   unsigned long in, out; -->  long long in, out;
--- a/src/share/native/java/util/zip/zlib-1.2.3/zlib.h	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/native/java/util/zip/zlib-1.2.3/zlib.h	Fri Jun 21 19:11:42 2013 -0700
@@ -106,11 +106,11 @@
 typedef struct z_stream_s {
     Bytef    *next_in;  /* next input byte */
     uInt     avail_in;  /* number of bytes available at next_in */
-    long long total_in; /* total nb of input bytes read so far */
+    uLong    total_in;  /* total nb of input bytes read so far */
 
     Bytef    *next_out; /* next output byte should be put there */
     uInt     avail_out; /* remaining free space at next_out */
-    long long total_out;/* total nb of bytes output so far */
+    uLong    total_out; /* total nb of bytes output so far */
 
     char     *msg;      /* last error message, NULL if no error */
     struct internal_state FAR *state; /* not visible by applications */
--- a/src/share/native/sun/java2d/opengl/OGLBlitLoops.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/native/sun/java2d/opengl/OGLBlitLoops.c	Fri Jun 21 19:11:42 2013 -0700
@@ -393,7 +393,16 @@
                    OGLSDOps *dstOps,
                    jint dx1, jint dy1, jint dx2, jint dy2)
 {
+    jboolean adjustAlpha = (pf != NULL && !pf->hasAlpha);
     j2d_glBindTexture(dstOps->textureTarget, dstOps->textureID);
+
+    if (adjustAlpha) {
+        // if the source surface does not have an alpha channel,
+        // we need to ensure that the alpha values are forced to 1.0f
+        j2d_glPixelTransferf(GL_ALPHA_SCALE, 0.0f);
+        j2d_glPixelTransferf(GL_ALPHA_BIAS, 1.0f);
+    }
+
     // in case pixel stride is not a multiple of scanline stride the copy
     // has to be done line by line (see 6207877)
     if (srcInfo->scanStride % srcInfo->pixelStride != 0) {
@@ -413,6 +422,11 @@
                             dx1, dy1, dx2-dx1, dy2-dy1,
                             pf->format, pf->type, srcInfo->rasBase);
     }
+    if (adjustAlpha) {
+        // restore scale/bias to their original values
+        j2d_glPixelTransferf(GL_ALPHA_SCALE, 1.0f);
+        j2d_glPixelTransferf(GL_ALPHA_BIAS, 0.0f);
+    }
 }
 
 /**
--- a/src/share/native/sun/misc/VM.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/share/native/sun/misc/VM.c	Fri Jun 21 19:11:42 2013 -0700
@@ -111,6 +111,11 @@
     get_thread_state_info(env, JAVA_THREAD_STATE_TERMINATED, values, names);
 }
 
+JNIEXPORT jobject JNICALL
+Java_sun_misc_VM_latestUserDefinedLoader(JNIEnv *env, jclass cls) {
+    return JVM_LatestUserDefinedLoader(env);
+}
+
 typedef void (JNICALL *GetJvmVersionInfo_fp)(JNIEnv*, jvm_version_info*, size_t);
 
 JNIEXPORT void JNICALL
--- a/src/share/native/sun/rmi/server/MarshalInputStream.c	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 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.
- */
-
-#include "jni.h"
-#include "jvm.h"
-#include "jni_util.h"
-
-#include "sun_rmi_server_MarshalInputStream.h"
-
-/*
- * Class:     sun_rmi_server_MarshalInputStream
- * Method:    latestUserDefinedLoader
- * Signature: ()Ljava/lang/ClassLoader;
- *
- * Returns the first non-null class loader up the execution stack, or null
- * if only code from the null class loader is on the stack.
- */
-JNIEXPORT jobject JNICALL
-Java_sun_rmi_server_MarshalInputStream_latestUserDefinedLoader(JNIEnv *env, jclass cls)
-{
-    return JVM_LatestUserDefinedLoader(env);
-}
--- a/src/solaris/back/linker_md.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/back/linker_md.c	Fri Jun 21 19:11:42 2013 -0700
@@ -54,6 +54,32 @@
 #define LIB_SUFFIX "so"
 #endif
 
+static void dll_build_name(char* buffer, size_t buflen,
+                           const char* pname, const char* fname) {
+    // Based on os_solaris.cpp
+
+    char *path_sep = PATH_SEPARATOR;
+    char *pathname = (char *)pname;
+    while (strlen(pathname) > 0) {
+        char *p = strchr(pathname, *path_sep);
+        if (p == NULL) {
+            p = pathname + strlen(pathname);
+        }
+        /* check for NULL path */
+        if (p == pathname) {
+            continue;
+        }
+        (void)snprintf(buffer, buflen, "%.*s/lib%s." LIB_SUFFIX, (p - pathname),
+                       pathname, fname);
+
+        if (access(buffer, F_OK) == 0) {
+            break;
+        }
+        pathname = p + 1;
+        *buffer = '\0';
+    }
+}
+
 /*
  * create a string for the JNI native function name by adding the
  * appropriate decorations.
@@ -76,16 +102,16 @@
 {
     const int pnamelen = pname ? strlen(pname) : 0;
 
+    *holder = '\0';
     /* Quietly truncate on buffer overflow.  Should be an error. */
     if (pnamelen + (int)strlen(fname) + 10 > holderlen) {
-        *holder = '\0';
         return;
     }
 
     if (pnamelen == 0) {
         (void)snprintf(holder, holderlen, "lib%s." LIB_SUFFIX, fname);
     } else {
-        (void)snprintf(holder, holderlen, "%s/lib%s." LIB_SUFFIX, pname, fname);
+      dll_build_name(holder, holderlen, pname, fname);
     }
 }
 
--- a/src/solaris/bin/java_md_solinux.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/bin/java_md_solinux.c	Fri Jun 21 19:11:42 2013 -0700
@@ -809,7 +809,6 @@
 jboolean
 LoadJavaVM(const char *jvmpath, InvocationFunctions *ifn)
 {
-    Dl_info dlinfo;
     void *libjvm;
 
     JLI_TraceLauncher("JVM path is %s\n", jvmpath);
@@ -982,7 +981,18 @@
 int
 ContinueInNewThread0(int (JNICALL *continuation)(void *), jlong stack_size, void * args) {
     int rslt;
-#ifdef __linux__
+#ifdef __solaris__
+    thread_t tid;
+    long flags = 0;
+    if (thr_create(NULL, stack_size, (void *(*)(void *))continuation, args, flags, &tid) == 0) {
+      void * tmp;
+      thr_join(tid, NULL, &tmp);
+      rslt = (int)tmp;
+    } else {
+      /* See below. Continue in current thread if thr_create() failed */
+      rslt = continuation(args);
+    }
+#else /* ! __solaris__ */
     pthread_t tid;
     pthread_attr_t attr;
     pthread_attr_init(&attr);
@@ -1007,18 +1017,7 @@
     }
 
     pthread_attr_destroy(&attr);
-#else /* ! __linux__ */
-    thread_t tid;
-    long flags = 0;
-    if (thr_create(NULL, stack_size, (void *(*)(void *))continuation, args, flags, &tid) == 0) {
-      void * tmp;
-      thr_join(tid, NULL, &tmp);
-      rslt = (int)tmp;
-    } else {
-      /* See above. Continue in current thread if thr_create() failed */
-      rslt = continuation(args);
-    }
-#endif /* __linux__ */
+#endif /* __solaris__ */
     return rslt;
 }
 
--- a/src/solaris/bin/java_md_solinux.h	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/bin/java_md_solinux.h	Fri Jun 21 19:11:42 2013 -0700
@@ -54,10 +54,10 @@
 #endif
 
 #include <dlfcn.h>
-#ifdef __linux__
+#ifdef __solaris__
+#include <thread.h>
+#else
 #include <pthread.h>
-#else
-#include <thread.h>
 #endif
 
 #define JVM_DLL         "libjvm.so"
--- a/src/solaris/classes/java/lang/Terminator.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/java/lang/Terminator.java	Fri Jun 21 19:11:42 2013 -0700
@@ -53,14 +53,20 @@
             }
         };
         handler = sh;
+        // When -Xrs is specified the user is responsible for
+        // ensuring that shutdown hooks are run by calling
+        // System.exit()
         try {
             Signal.handle(new Signal("HUP"), sh);
+        } catch (IllegalArgumentException e) {
+        }
+        try {
             Signal.handle(new Signal("INT"), sh);
+        } catch (IllegalArgumentException e) {
+        }
+        try {
             Signal.handle(new Signal("TERM"), sh);
         } catch (IllegalArgumentException e) {
-            // When -Xrs is specified the user is responsible for
-            // ensuring that shutdown hooks are run by calling
-            // System.exit()
         }
     }
 
--- a/src/solaris/classes/sun/awt/X11/GtkFileDialogPeer.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/sun/awt/X11/GtkFileDialogPeer.java	Fri Jun 21 19:11:42 2013 -0700
@@ -76,9 +76,12 @@
             accessor.setFiles(fd, null);
         } else {
             // Fix 6987233: add the trailing slash if it's absent
-            accessor.setDirectory(fd, directory +
-                    (directory.endsWith(File.separator) ?
-                     "" : File.separator));
+            String with_separator = directory;
+            if (directory != null) {
+                with_separator = directory.endsWith(File.separator) ?
+                        directory : (directory + File.separator);
+            }
+            accessor.setDirectory(fd, with_separator);
             accessor.setFile(fd, filenames[0]);
 
             int filesNumber = (filenames != null) ? filenames.length : 0;
--- a/src/solaris/classes/sun/awt/X11/XComponentPeer.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/sun/awt/X11/XComponentPeer.java	Fri Jun 21 19:11:42 2013 -0700
@@ -618,7 +618,7 @@
             final XWindowPeer parentXWindow = getParentTopLevel();
             Window parentWindow = (Window)parentXWindow.getTarget();
             if (parentXWindow.isFocusableWindow() && parentXWindow.isSimpleWindow() &&
-                XKeyboardFocusManagerPeer.getCurrentNativeFocusedWindow() != parentWindow)
+                XKeyboardFocusManagerPeer.getInstance().getCurrentFocusedWindow() != parentWindow)
             {
                 postEvent(new InvocationEvent(parentWindow, new  Runnable() {
                         public void run() {
--- a/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1109,7 +1109,7 @@
         focusLog.fine("Request for decorated window focus");
         // If this is Frame or Dialog we can't assure focus request success - but we still can try
         // If this is Window and its owner Frame is active we can be sure request succedded.
-        Window focusedWindow = XKeyboardFocusManagerPeer.getCurrentNativeFocusedWindow();
+        Window focusedWindow = XKeyboardFocusManagerPeer.getInstance().getCurrentFocusedWindow();
         Window activeWindow = XWindowPeer.getDecoratedOwner(focusedWindow);
 
         focusLog.finer("Current window is: active={0}, focused={1}",
@@ -1140,8 +1140,8 @@
             focusLog.finest("Real native focused window: " + realNativeFocusedWindow +
                             "\nKFM's focused window: " + focusedWindow);
 
-            // See 6522725, 6613426.
-            if (target == realNativeFocusedWindow) {
+            // A workaround for Metacity. See 6522725, 6613426, 7147075.
+            if (target == realNativeFocusedWindow && XWM.getWMID() == XWM.METACITY_WM) {
                 focusLog.fine("The window is already natively focused.");
                 return true;
             }
@@ -1202,7 +1202,7 @@
     }
 
     public void handleWindowFocusOut(Window oppositeWindow, long serial) {
-        Window actualFocusedWindow = XKeyboardFocusManagerPeer.getCurrentNativeFocusedWindow();
+        Window actualFocusedWindow = XKeyboardFocusManagerPeer.getInstance().getCurrentFocusedWindow();
 
         // If the actual focused window is not this decorated window then retain it.
         if (actualFocusedWindow != null && actualFocusedWindow != target) {
--- a/src/solaris/classes/sun/awt/X11/XDialogPeer.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/sun/awt/X11/XDialogPeer.java	Fri Jun 21 19:11:42 2013 -0700
@@ -135,7 +135,7 @@
      * Thus we don't have to perform any transitive (a blocker of a blocker) checks.
      */
     boolean isFocusedWindowModalBlocker() {
-        Window focusedWindow = XKeyboardFocusManagerPeer.getCurrentNativeFocusedWindow();
+        Window focusedWindow = XKeyboardFocusManagerPeer.getInstance().getCurrentFocusedWindow();
         XWindowPeer focusedWindowPeer = null;
 
         if (focusedWindow != null) {
--- a/src/solaris/classes/sun/awt/X11/XEmbedChildProxyPeer.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/sun/awt/X11/XEmbedChildProxyPeer.java	Fri Jun 21 19:11:42 2013 -0700
@@ -98,11 +98,11 @@
     public void handleEvent(AWTEvent e) {
         switch (e.getID()) {
           case FocusEvent.FOCUS_GAINED:
-              XKeyboardFocusManagerPeer.setCurrentNativeFocusOwner(proxy);
+              XKeyboardFocusManagerPeer.getInstance().setCurrentFocusOwner(proxy);
               container.focusGained(handle);
               break;
           case FocusEvent.FOCUS_LOST:
-              XKeyboardFocusManagerPeer.setCurrentNativeFocusOwner(null);
+              XKeyboardFocusManagerPeer.getInstance().setCurrentFocusOwner(null);
               container.focusLost(handle);
               break;
           case KeyEvent.KEY_PRESSED:
@@ -174,7 +174,7 @@
         if (lightweightChild == null) {
             lightweightChild = (Component)proxy;
         }
-        Component currentOwner = XKeyboardFocusManagerPeer.getCurrentNativeFocusOwner();
+        Component currentOwner = XKeyboardFocusManagerPeer.getInstance().getCurrentFocusOwner();
         if (currentOwner != null && currentOwner.getPeer() == null) {
             currentOwner = null;
         }
@@ -226,7 +226,8 @@
               if (parent != null) {
                   Window parentWindow = (Window)parent;
                   // and check that it is focused
-                  if (!parentWindow.isFocused() && XKeyboardFocusManagerPeer.getCurrentNativeFocusedWindow() == parentWindow) {
+                  if (!parentWindow.isFocused() &&
+                      XKeyboardFocusManagerPeer.getInstance().getCurrentFocusedWindow() == parentWindow) {
                       // if it is not - skip requesting focus on Solaris
                       // but return true for compatibility.
                       return true;
--- a/src/solaris/classes/sun/awt/X11/XEmbedClientHelper.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/sun/awt/X11/XEmbedClientHelper.java	Fri Jun 21 19:11:42 2013 -0700
@@ -204,7 +204,7 @@
         // XEMBED_FOCUS_OUT client messages), so we first need to check if
         // embedded is an active window before sending WINDOW_LOST_FOCUS
         // to shared code
-        if (XKeyboardFocusManagerPeer.getCurrentNativeFocusedWindow() == embedded.target) {
+        if (XKeyboardFocusManagerPeer.getInstance().getCurrentFocusedWindow() == embedded.target) {
             embedded.handleWindowFocusOut(null, 0);
         }
     }
--- a/src/solaris/classes/sun/awt/X11/XKeyboardFocusManagerPeer.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/sun/awt/X11/XKeyboardFocusManagerPeer.java	Fri Jun 21 19:11:42 2013 -0700
@@ -25,66 +25,48 @@
 package sun.awt.X11;
 
 import java.awt.Component;
-import java.awt.KeyboardFocusManager;
 import java.awt.Window;
-
-import java.awt.event.FocusEvent;
-
-import java.awt.peer.KeyboardFocusManagerPeer;
-import java.awt.peer.ComponentPeer;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
 import sun.util.logging.PlatformLogger;
-
 import sun.awt.CausedFocusEvent;
-import sun.awt.SunToolkit;
 import sun.awt.KeyboardFocusManagerPeerImpl;
 
 public class XKeyboardFocusManagerPeer extends KeyboardFocusManagerPeerImpl {
     private static final PlatformLogger focusLog = PlatformLogger.getLogger("sun.awt.X11.focus.XKeyboardFocusManagerPeer");
+    private static final XKeyboardFocusManagerPeer inst = new XKeyboardFocusManagerPeer();
 
-    private static Object lock = new Object() {};
-    private static Component currentFocusOwner;
-    private static Window currentFocusedWindow;
+    private Component currentFocusOwner;
+    private Window currentFocusedWindow;
 
-    XKeyboardFocusManagerPeer(KeyboardFocusManager manager) {
-        super(manager);
+    public static XKeyboardFocusManagerPeer getInstance() {
+        return inst;
+    }
+
+    private XKeyboardFocusManagerPeer() {
     }
 
     @Override
     public void setCurrentFocusOwner(Component comp) {
-        setCurrentNativeFocusOwner(comp);
+        synchronized (this) {
+            currentFocusOwner = comp;
+        }
     }
 
     @Override
     public Component getCurrentFocusOwner() {
-        return getCurrentNativeFocusOwner();
-    }
-
-    @Override
-    public Window getCurrentFocusedWindow() {
-        return getCurrentNativeFocusedWindow();
-    }
-
-    public static void setCurrentNativeFocusOwner(Component comp) {
-        synchronized (lock) {
-            currentFocusOwner = comp;
-        }
-    }
-
-    public static Component getCurrentNativeFocusOwner() {
-        synchronized(lock) {
+        synchronized(this) {
             return currentFocusOwner;
         }
     }
 
-    public static void setCurrentNativeFocusedWindow(Window win) {
-        if (focusLog.isLoggable(PlatformLogger.FINER)) focusLog.finer("Setting current native focused window " + win);
+    @Override
+    public void setCurrentFocusedWindow(Window win) {
+        if (focusLog.isLoggable(PlatformLogger.FINER)) {
+            focusLog.finer("Setting current focused window " + win);
+        }
+
         XWindowPeer from = null, to = null;
 
-        synchronized(lock) {
+        synchronized(this) {
             if (currentFocusedWindow != null) {
                 from = (XWindowPeer)currentFocusedWindow.getPeer();
             }
@@ -104,8 +86,9 @@
         }
     }
 
-    public static Window getCurrentNativeFocusedWindow() {
-        synchronized(lock) {
+    @Override
+    public Window getCurrentFocusedWindow() {
+        synchronized(this) {
             return currentFocusedWindow;
         }
     }
@@ -124,6 +107,6 @@
                                                          focusedWindowChangeAllowed,
                                                          time,
                                                          cause,
-                                                         getCurrentNativeFocusOwner());
+                                                         getInstance().getCurrentFocusOwner());
     }
 }
--- a/src/solaris/classes/sun/awt/X11/XLabelPeer.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/sun/awt/X11/XLabelPeer.java	Fri Jun 21 19:11:42 2013 -0700
@@ -140,7 +140,7 @@
     }
     public void setFont(Font f) {
         super.setFont(f);
-        target.repaint();
+        repaint();
     }
 
     public void setAlignment(int align) {
--- a/src/solaris/classes/sun/awt/X11/XTextAreaPeer.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/sun/awt/X11/XTextAreaPeer.java	Fri Jun 21 19:11:42 2013 -0700
@@ -105,7 +105,6 @@
         this.target = target;
 
         //ComponentAccessor.enableEvents(target,AWTEvent.MOUSE_WHEEL_EVENT_MASK);
-        target.enableInputMethods(true);
 
         firstChangeSkipped = false;
         String text = ((TextArea)target).getText();
@@ -113,7 +112,6 @@
         jtext.setWrapStyleWord(true);
         jtext.getDocument().addDocumentListener(jtext);
         XToolkit.specialPeerMap.put(jtext,this);
-        jtext.enableInputMethods(true);
         textPane = new AWTTextPane(jtext,this, target.getParent());
 
         setBounds(x, y, width, height, SET_BOUNDS);
@@ -170,6 +168,8 @@
 
     public void dispose() {
         XToolkit.specialPeerMap.remove(jtext);
+        // visible caret has a timer thread which must be stopped
+        jtext.getCaret().setVisible(false);
         jtext.removeNotify();
         textPane.removeNotify();
         super.dispose();
@@ -466,13 +466,6 @@
 
     protected boolean setTextImpl(String txt) {
         if (jtext != null) {
-            // Please note that we do not want to post an event
-            // if setText() replaces an empty text by an empty text,
-            // that is, if component's text remains unchanged.
-            if (jtext.getDocument().getLength() == 0 && txt.length() == 0) {
-                return true;
-            }
-
             // JTextArea.setText() posts two different events (remove & insert).
             // Since we make no differences between text events,
             // the document listener has to be disabled while
@@ -660,10 +653,13 @@
     }
 
 
-    // TODO : fix this duplicate code
-    class XAWTCaret extends DefaultCaret {
+    static class XAWTCaret extends DefaultCaret {
         public void focusGained(FocusEvent e) {
             super.focusGained(e);
+            if (getComponent().isEnabled()){
+                // Make sure the cursor is visible in case of non-editable TextArea
+                super.setVisible(true);
+            }
             getComponent().repaint();
         }
 
--- a/src/solaris/classes/sun/awt/X11/XTextFieldPeer.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/sun/awt/X11/XTextFieldPeer.java	Fri Jun 21 19:11:42 2013 -0700
@@ -73,8 +73,6 @@
         xtext = new XAWTTextField(text,this, target.getParent());
         xtext.getDocument().addDocumentListener(xtext);
         xtext.setCursor(target.getCursor());
-        target.enableInputMethods(true);
-        xtext.enableInputMethods(true);
         XToolkit.specialPeerMap.put(xtext,this);
 
         TextField txt = (TextField) target;
@@ -106,6 +104,8 @@
 
     public void dispose() {
         XToolkit.specialPeerMap.remove(xtext);
+        // visible caret has a timer thread which must be stopped
+        xtext.getCaret().setVisible(false);
         xtext.removeNotify();
         super.dispose();
     }
@@ -579,31 +579,7 @@
         }
 
         protected Caret createCaret() {
-            return new XAWTCaret();
-        }
-    }
-
-    class XAWTCaret extends DefaultCaret {
-        public void focusGained(FocusEvent e) {
-            super.focusGained(e);
-            getComponent().repaint();
-        }
-
-        public void focusLost(FocusEvent e) {
-            super.focusLost(e);
-            getComponent().repaint();
-        }
-
-        // Fix for 5100950: textarea.getSelectedText() returns the de-selected text, on XToolkit
-        // Restoring Motif behaviour
-        // If the text is unhighlighted then we should sets the selection range to zero
-        public void setSelectionVisible(boolean vis) {
-            if (vis){
-                super.setSelectionVisible(vis);
-            }else{
-                // In order to de-select the selection
-                setDot(getDot());
-            }
+            return new XTextAreaPeer.XAWTCaret();
         }
     }
 
--- a/src/solaris/classes/sun/awt/X11/XToolkit.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/sun/awt/X11/XToolkit.java	Fri Jun 21 19:11:42 2013 -0700
@@ -649,7 +649,7 @@
                 long w = 0;
                 if (windowToXWindow(ev.get_xany().get_window()) != null) {
                     Component owner =
-                        XKeyboardFocusManagerPeer.getCurrentNativeFocusOwner();
+                        XKeyboardFocusManagerPeer.getInstance().getCurrentFocusOwner();
                     if (owner != null) {
                         XWindow ownerWindow = (XWindow) AWTAccessor.getComponentAccessor().getPeer(owner);
                         if (ownerWindow != null) {
@@ -1121,9 +1121,8 @@
         return peer;
     }
 
-    public KeyboardFocusManagerPeer createKeyboardFocusManagerPeer(KeyboardFocusManager manager) throws HeadlessException {
-        XKeyboardFocusManagerPeer peer = new XKeyboardFocusManagerPeer(manager);
-        return peer;
+    public KeyboardFocusManagerPeer getKeyboardFocusManagerPeer() throws HeadlessException {
+        return XKeyboardFocusManagerPeer.getInstance();
     }
 
     /**
@@ -1299,6 +1298,15 @@
         return new XInputMethodDescriptor();
     }
 
+    /**
+     * Returns whether enableInputMethods should be set to true for peered
+     * TextComponent instances on this platform. True by default.
+     */
+    @Override
+    public boolean enableInputMethodsForTextComponent() {
+        return true;
+    }
+
     static int getMultiClickTime() {
         if (awt_multiclick_time == 0) {
             initializeMultiClickTime();
--- a/src/solaris/classes/sun/awt/X11/XWindowPeer.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/sun/awt/X11/XWindowPeer.java	Fri Jun 21 19:11:42 2013 -0700
@@ -615,7 +615,7 @@
 
     public void handleWindowFocusIn_Dispatch() {
         if (EventQueue.isDispatchThread()) {
-            XKeyboardFocusManagerPeer.setCurrentNativeFocusedWindow((Window) target);
+            XKeyboardFocusManagerPeer.getInstance().setCurrentFocusedWindow((Window) target);
             WindowEvent we = new WindowEvent((Window)target, WindowEvent.WINDOW_GAINED_FOCUS);
             SunToolkit.setSystemGenerated(we);
             target.dispatchEvent(we);
@@ -624,7 +624,7 @@
 
     public void handleWindowFocusInSync(long serial) {
         WindowEvent we = new WindowEvent((Window)target, WindowEvent.WINDOW_GAINED_FOCUS);
-        XKeyboardFocusManagerPeer.setCurrentNativeFocusedWindow((Window) target);
+        XKeyboardFocusManagerPeer.getInstance().setCurrentFocusedWindow((Window) target);
         sendEvent(we);
     }
     // NOTE: This method may be called by privileged threads.
@@ -632,7 +632,7 @@
     public void handleWindowFocusIn(long serial) {
         WindowEvent we = new WindowEvent((Window)target, WindowEvent.WINDOW_GAINED_FOCUS);
         /* wrap in Sequenced, then post*/
-        XKeyboardFocusManagerPeer.setCurrentNativeFocusedWindow((Window) target);
+        XKeyboardFocusManagerPeer.getInstance().setCurrentFocusedWindow((Window) target);
         postEvent(wrapInSequenced((AWTEvent) we));
     }
 
@@ -640,15 +640,15 @@
     //       DO NOT INVOKE CLIENT CODE ON THIS THREAD!
     public void handleWindowFocusOut(Window oppositeWindow, long serial) {
         WindowEvent we = new WindowEvent((Window)target, WindowEvent.WINDOW_LOST_FOCUS, oppositeWindow);
-        XKeyboardFocusManagerPeer.setCurrentNativeFocusedWindow(null);
-        XKeyboardFocusManagerPeer.setCurrentNativeFocusOwner(null);
+        XKeyboardFocusManagerPeer.getInstance().setCurrentFocusedWindow(null);
+        XKeyboardFocusManagerPeer.getInstance().setCurrentFocusOwner(null);
         /* wrap in Sequenced, then post*/
         postEvent(wrapInSequenced((AWTEvent) we));
     }
     public void handleWindowFocusOutSync(Window oppositeWindow, long serial) {
         WindowEvent we = new WindowEvent((Window)target, WindowEvent.WINDOW_LOST_FOCUS, oppositeWindow);
-        XKeyboardFocusManagerPeer.setCurrentNativeFocusedWindow(null);
-        XKeyboardFocusManagerPeer.setCurrentNativeFocusOwner(null);
+        XKeyboardFocusManagerPeer.getInstance().setCurrentFocusedWindow(null);
+        XKeyboardFocusManagerPeer.getInstance().setCurrentFocusOwner(null);
         sendEvent(we);
     }
 
@@ -1136,7 +1136,7 @@
             // getWMState() always returns 0 (Withdrawn) for simple windows. Hence
             // we ignore the state for such windows.
             if (isVisible() && (state == XUtilConstants.NormalState || isSimpleWindow())) {
-                if (XKeyboardFocusManagerPeer.getCurrentNativeFocusedWindow() ==
+                if (XKeyboardFocusManagerPeer.getInstance().getCurrentFocusedWindow() ==
                         getTarget())
                 {
                     show = true;
@@ -1163,15 +1163,25 @@
     }
 
     public void dispose() {
+        if (isGrabbed()) {
+            if (grabLog.isLoggable(PlatformLogger.FINE)) {
+                grabLog.fine("Generating UngrabEvent on {0} because of the window disposal", this);
+            }
+            postEventToEventQueue(new sun.awt.UngrabEvent(getEventSource()));
+        }
+
         SunToolkit.awtLock();
+
         try {
             windows.remove(this);
         } finally {
             SunToolkit.awtUnlock();
         }
+
         if (warningWindow != null) {
             warningWindow.destroy();
         }
+
         removeRootPropertyEventDispatcher();
         mustControlStackPosition = false;
         super.dispose();
@@ -1183,12 +1193,13 @@
          * receive WM_TAKE_FOCUS.
          */
         if (isSimpleWindow()) {
-            if (target == XKeyboardFocusManagerPeer.getCurrentNativeFocusedWindow()) {
+            if (target == XKeyboardFocusManagerPeer.getInstance().getCurrentFocusedWindow()) {
                 Window owner = getDecoratedOwner((Window)target);
                 ((XWindowPeer)AWTAccessor.getComponentAccessor().getPeer(owner)).requestWindowFocus();
             }
         }
     }
+
     boolean isResizable() {
         return winAttr.isResizable;
     }
@@ -1823,7 +1834,7 @@
         // If this is Frame or Dialog we can't assure focus request success - but we still can try
         // If this is Window and its owner Frame is active we can be sure request succedded.
         Window ownerWindow  = XWindowPeer.getDecoratedOwner((Window)target);
-        Window focusedWindow = XKeyboardFocusManagerPeer.getCurrentNativeFocusedWindow();
+        Window focusedWindow = XKeyboardFocusManagerPeer.getInstance().getCurrentFocusedWindow();
         Window activeWindow = XWindowPeer.getDecoratedOwner(focusedWindow);
 
         if (isWMStateNetHidden()) {
@@ -1864,7 +1875,9 @@
         switch (getWindowType())
         {
             case NORMAL:
-                typeAtom = protocol.XA_NET_WM_WINDOW_TYPE_NORMAL;
+                typeAtom = (ownerPeer == null) ?
+                                protocol.XA_NET_WM_WINDOW_TYPE_NORMAL :
+                                protocol.XA_NET_WM_WINDOW_TYPE_DIALOG;
                 break;
             case UTILITY:
                 typeAtom = protocol.XA_NET_WM_WINDOW_TYPE_UTILITY;
--- a/src/solaris/classes/sun/awt/X11InputMethod.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/sun/awt/X11InputMethod.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -415,6 +415,10 @@
             setXICFocus(getPeer(lastXICFocussedComponent), false, isLastXICActive);
             lastXICFocussedComponent = null;
             isLastXICActive = false;
+
+            resetXIC();
+            needResetXICClient = null;
+            needResetXIC = false;
         }
     }
 
--- a/src/solaris/classes/sun/awt/motif/MToolkit.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/sun/awt/motif/MToolkit.java	Fri Jun 21 19:11:42 2013 -0700
@@ -330,7 +330,7 @@
         return null;
     }
 
-    public KeyboardFocusManagerPeer createKeyboardFocusManagerPeer(KeyboardFocusManager manager) {
+    public KeyboardFocusManagerPeer getKeyboardFocusManagerPeer() {
         return null;
     }
 
--- a/src/solaris/classes/sun/font/FontConfigManager.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/sun/font/FontConfigManager.java	Fri Jun 21 19:11:42 2013 -0700
@@ -347,6 +347,11 @@
         name = name.toLowerCase();
 
         initFontConfigFonts(false);
+        if (fontConfigFonts == null) {
+            // This avoids an immediate NPE if fontconfig look up failed
+            // but doesn't guarantee this is a recoverable situation.
+            return null;
+        }
 
         FcCompFont fcInfo = null;
         for (int i=0; i<fontConfigFonts.length; i++) {
--- a/src/solaris/classes/sun/font/XRGlyphCacheEntry.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/sun/font/XRGlyphCacheEntry.java	Fri Jun 21 19:11:42 2013 -0700
@@ -69,11 +69,28 @@
     }
 
     public static int getGlyphID(long glyphInfoPtr) {
-        return (int) StrikeCache.unsafe.getInt(glyphInfoPtr + StrikeCache.cacheCellOffset);
+        // We need to access the GlyphID with Unsafe.getAddress() because the
+        // corresponding field in the underlying C data-structure is of type
+        // 'void*' (see field 'cellInfo' of struct 'GlyphInfo'
+        // in src/share/native/sun/font/fontscalerdefs.h).
+        // On 64-bit Big-endian architectures it would be wrong to access this
+        // field with Unsafe.getInt().
+        return (int) StrikeCache.unsafe.getAddress(glyphInfoPtr +
+                                                   StrikeCache.cacheCellOffset);
     }
 
     public static void setGlyphID(long glyphInfoPtr, int id) {
-        StrikeCache.unsafe.putInt(glyphInfoPtr + StrikeCache.cacheCellOffset, id);
+        // We need to access the GlyphID with Unsafe.putAddress() because the
+        // corresponding field in the underlying C data-structure is of type
+        // 'void*' (see field 'cellInfo' of struct 'GlyphInfo' in
+        // src/share/native/sun/font/fontscalerdefs.h).
+        // On 64-bit Big-endian architectures it would be wrong to write this
+        // field with Unsafe.putInt() because it is also accessed from native
+        // code as a 'long'.
+        // See Java_sun_java2d_xr_XRBackendNative_XRAddGlyphsNative()
+        // in src/solaris/native/sun/java2d/x11/XRBackendNative.c
+        StrikeCache.unsafe.putAddress(glyphInfoPtr +
+                                      StrikeCache.cacheCellOffset, (long)id);
     }
 
     public int getGlyphID() {
@@ -105,12 +122,9 @@
     }
 
     public void writePixelData(ByteArrayOutputStream os, boolean uploadAsLCD) {
-        long pixelDataAddress;
-        if (StrikeCache.nativeAddressSize == 4) {
-            pixelDataAddress = 0xffffffff & StrikeCache.unsafe.getInt(glyphInfoPtr + StrikeCache.pixelDataOffset);
-        } else {
-            pixelDataAddress = StrikeCache.unsafe.getLong(glyphInfoPtr + StrikeCache.pixelDataOffset);
-        }
+        long pixelDataAddress =
+            StrikeCache.unsafe.getAddress(glyphInfoPtr +
+                                          StrikeCache.pixelDataOffset);
         if (pixelDataAddress == 0L) {
             return;
         }
--- a/src/solaris/classes/sun/net/www/protocol/jar/JarFileFactory.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/sun/net/www/protocol/jar/JarFileFactory.java	Fri Jun 21 19:11:42 2013 -0700
@@ -43,13 +43,24 @@
 class JarFileFactory implements URLJarFile.URLJarFileCloseController {
 
     /* the url to file cache */
-    private static HashMap<String, JarFile> fileCache = new HashMap<String, JarFile>();
+    private static final HashMap<String, JarFile> fileCache = new HashMap<>();
 
     /* the file to url cache */
-    private static HashMap<JarFile, URL> urlCache = new HashMap<JarFile, URL>();
+    private static final HashMap<JarFile, URL> urlCache = new HashMap<>();
+
+    private static final JarFileFactory instance = new JarFileFactory();
+
+    private JarFileFactory() { }
+
+    public static JarFileFactory getInstance() {
+        return instance;
+    }
 
     URLConnection getConnection(JarFile jarFile) throws IOException {
-        URL u = urlCache.get(jarFile);
+        URL u;
+        synchronized (instance) {
+            u = urlCache.get(jarFile);
+        }
         if (u != null)
             return u.openConnection();
 
@@ -62,16 +73,16 @@
 
     JarFile get(URL url, boolean useCaches) throws IOException {
 
-        JarFile result = null;
-        JarFile local_result = null;
+        JarFile result;
+        JarFile local_result;
 
         if (useCaches) {
-            synchronized (this) {
+            synchronized (instance) {
                 result = getCachedJarFile(url);
             }
             if (result == null) {
                 local_result = URLJarFile.getJarFile(url, this);
-                synchronized (this) {
+                synchronized (instance) {
                     result = getCachedJarFile(url);
                     if (result == null) {
                         fileCache.put(URLUtil.urlNoFragString(url), local_result);
@@ -99,14 +110,15 @@
      * remove the JarFile from the cache
      */
     public void close(JarFile jarFile) {
-        URL urlRemoved = urlCache.remove(jarFile);
-        if( urlRemoved != null) {
+        synchronized (instance) {
+            URL urlRemoved = urlCache.remove(jarFile);
+            if (urlRemoved != null)
                 fileCache.remove(URLUtil.urlNoFragString(urlRemoved));
         }
     }
 
-
     private JarFile getCachedJarFile(URL url) {
+        assert Thread.holdsLock(instance);
         JarFile result = fileCache.get(URLUtil.urlNoFragString(url));
 
         /* if the JAR file is cached, the permission will always be there */
--- a/src/solaris/classes/sun/nio/ch/DevPollArrayWrapper.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/sun/nio/ch/DevPollArrayWrapper.java	Fri Jun 21 19:11:42 2013 -0700
@@ -71,7 +71,7 @@
     static final byte  IGNORE        = (byte)-1;
 
     // Maximum number of open file descriptors
-    static final int   OPEN_MAX      = fdLimit();
+    static final int   OPEN_MAX      = IOUtil.fdLimit();
 
     // Number of pollfd structures to create.
     // dpwrite/ioctl(DP_POLL) allows up to OPEN_MAX-1
@@ -316,5 +316,4 @@
     private native int poll0(long pollAddress, int numfds, long timeout,
                              int wfd);
     private static native void interrupt(int fd);
-    private static native int fdLimit();
 }
--- a/src/solaris/classes/sun/nio/ch/EPollArrayWrapper.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/sun/nio/ch/EPollArrayWrapper.java	Fri Jun 21 19:11:42 2013 -0700
@@ -26,9 +26,9 @@
 package sun.nio.ch;
 
 import java.io.IOException;
-import java.util.LinkedList;
-import java.util.HashSet;
-import java.util.Iterator;
+import java.util.BitSet;
+import java.util.HashMap;
+import java.util.Map;
 
 /**
  * Manipulates a native array of epoll_event structs on Linux:
@@ -52,37 +52,78 @@
  * this implementation we set data.fd to be the file descriptor that we
  * register. That way, we have the file descriptor available when we
  * process the events.
- *
- * All file descriptors registered with epoll have the POLLHUP and POLLERR
- * events enabled even when registered with an event set of 0. To ensure
- * that epoll_wait doesn't poll an idle file descriptor when the underlying
- * connection is closed or reset then its registration is deleted from
- * epoll (it will be re-added again if the event set is changed)
  */
 
 class EPollArrayWrapper {
     // EPOLL_EVENTS
-    static final int EPOLLIN      = 0x001;
+    private static final int EPOLLIN      = 0x001;
 
     // opcodes
-    static final int EPOLL_CTL_ADD      = 1;
-    static final int EPOLL_CTL_DEL      = 2;
-    static final int EPOLL_CTL_MOD      = 3;
+    private static final int EPOLL_CTL_ADD      = 1;
+    private static final int EPOLL_CTL_DEL      = 2;
+    private static final int EPOLL_CTL_MOD      = 3;
 
     // Miscellaneous constants
-    static final int SIZE_EPOLLEVENT  = sizeofEPollEvent();
-    static final int EVENT_OFFSET     = 0;
-    static final int DATA_OFFSET      = offsetofData();
-    static final int FD_OFFSET        = DATA_OFFSET;
-    static final int NUM_EPOLLEVENTS  = Math.min(fdLimit(), 8192);
+    private static final int SIZE_EPOLLEVENT  = sizeofEPollEvent();
+    private static final int EVENT_OFFSET     = 0;
+    private static final int DATA_OFFSET      = offsetofData();
+    private static final int FD_OFFSET        = DATA_OFFSET;
+    private static final int OPEN_MAX         = IOUtil.fdLimit();
+    private static final int NUM_EPOLLEVENTS  = Math.min(OPEN_MAX, 8192);
+
+    // Special value to indicate that an update should be ignored
+    private static final byte  KILLED = (byte)-1;
 
-    // Base address of the native pollArray
+    // Initial size of arrays for fd registration changes
+    private static final int INITIAL_PENDING_UPDATE_SIZE = 64;
+
+    // maximum size of updatesLow
+    private static final int MAX_UPDATE_ARRAY_SIZE = Math.min(OPEN_MAX, 64*1024);
+
+
+    // The fd of the epoll driver
+    private final int epfd;
+
+     // The epoll_event array for results from epoll_wait
+    private final AllocatedNativeObject pollArray;
+
+    // Base address of the epoll_event array
     private final long pollArrayAddress;
 
-    // Set of "idle" channels
-    private final HashSet<SelChImpl> idleSet;
+    // The fd of the interrupt line going out
+    private int outgoingInterruptFD;
+
+    // The fd of the interrupt line coming in
+    private int incomingInterruptFD;
+
+    // The index of the interrupt FD
+    private int interruptedIndex;
+
+    // Number of updated pollfd entries
+    int updated;
+
+    // object to synchronize fd registration changes
+    private final Object updateLock = new Object();
 
-    EPollArrayWrapper() {
+    // number of file descriptors with registration changes pending
+    private int updateCount;
+
+    // file descriptors with registration changes pending
+    private int[] updateDescriptors = new int[INITIAL_PENDING_UPDATE_SIZE];
+
+    // events for file descriptors with registration changes pending, indexed
+    // by file descriptor and stored as bytes for efficiency reasons. For
+    // file descriptors higher than MAX_UPDATE_ARRAY_SIZE (unlimited case at
+    // least) then the update is stored in a map.
+    private final byte[] eventsLow = new byte[MAX_UPDATE_ARRAY_SIZE];
+    private Map<Integer,Byte> eventsHigh;
+
+    // Used by release and updateRegistrations to track whether a file
+    // descriptor is registered with epoll.
+    private final BitSet registered = new BitSet();
+
+
+    EPollArrayWrapper() throws IOException {
         // creates the epoll file descriptor
         epfd = epollCreate();
 
@@ -91,50 +132,11 @@
         pollArray = new AllocatedNativeObject(allocationSize, true);
         pollArrayAddress = pollArray.address();
 
-        for (int i=0; i<NUM_EPOLLEVENTS; i++) {
-            putEventOps(i, 0);
-            putData(i, 0L);
-        }
-
-        // create idle set
-        idleSet = new HashSet<SelChImpl>();
+        // eventHigh needed when using file descriptors > 64k
+        if (OPEN_MAX > MAX_UPDATE_ARRAY_SIZE)
+            eventsHigh = new HashMap<>();
     }
 
-    // Used to update file description registrations
-    private static class Updator {
-        SelChImpl channel;
-        int opcode;
-        int events;
-        Updator(SelChImpl channel, int opcode, int events) {
-            this.channel = channel;
-            this.opcode = opcode;
-            this.events = events;
-        }
-        Updator(SelChImpl channel, int opcode) {
-            this(channel, opcode, 0);
-        }
-    }
-
-    private LinkedList<Updator> updateList = new LinkedList<Updator>();
-
-    // The epoll_event array for results from epoll_wait
-    private AllocatedNativeObject pollArray;
-
-    // The fd of the epoll driver
-    final int epfd;
-
-    // The fd of the interrupt line going out
-    int outgoingInterruptFD;
-
-    // The fd of the interrupt line coming in
-    int incomingInterruptFD;
-
-    // The index of the interrupt FD
-    int interruptedIndex;
-
-    // Number of updated pollfd entries
-    int updated;
-
     void initInterrupt(int fd0, int fd1) {
         outgoingInterruptFD = fd1;
         incomingInterruptFD = fd0;
@@ -146,11 +148,6 @@
         pollArray.putInt(offset, event);
     }
 
-    void putData(int i, long value) {
-        int offset = SIZE_EPOLLEVENT * i + DATA_OFFSET;
-        pollArray.putLong(offset, value);
-    }
-
     void putDescriptor(int i, int fd) {
         int offset = SIZE_EPOLLEVENT * i + FD_OFFSET;
         pollArray.putInt(offset, fd);
@@ -167,51 +164,83 @@
     }
 
     /**
-     * Update the events for a given channel.
+     * Sets the pending update events for the given file descriptor. This
+     * method has no effect if the update events is already set to KILLED,
+     * unless {@code force} is {@code true}.
      */
-    void setInterest(SelChImpl channel, int mask) {
-        synchronized (updateList) {
-            // if the previous pending operation is to add this file descriptor
-            // to epoll then update its event set
-            if (updateList.size() > 0) {
-                Updator last = updateList.getLast();
-                if (last.channel == channel && last.opcode == EPOLL_CTL_ADD) {
-                    last.events = mask;
-                    return;
-                }
+    private void setUpdateEvents(int fd, byte events, boolean force) {
+        if (fd < MAX_UPDATE_ARRAY_SIZE) {
+            if ((eventsLow[fd] != KILLED) || force) {
+                eventsLow[fd] = events;
+            }
+        } else {
+            Integer key = Integer.valueOf(fd);
+            if ((eventsHigh.get(key) != KILLED) || force) {
+                eventsHigh.put(key, Byte.valueOf(events));
             }
+        }
+    }
 
-            // update existing registration
-            updateList.add(new Updator(channel, EPOLL_CTL_MOD, mask));
+    /**
+     * Returns the pending update events for the given file descriptor.
+     */
+    private byte getUpdateEvents(int fd) {
+        if (fd < MAX_UPDATE_ARRAY_SIZE) {
+            return eventsLow[fd];
+        } else {
+            Byte result = eventsHigh.get(Integer.valueOf(fd));
+            // result should never be null
+            return result.byteValue();
         }
     }
 
     /**
-     * Add a channel's file descriptor to epoll
+     * Update the events for a given file descriptor
      */
-    void add(SelChImpl channel) {
-        synchronized (updateList) {
-            updateList.add(new Updator(channel, EPOLL_CTL_ADD));
+    void setInterest(int fd, int mask) {
+        synchronized (updateLock) {
+            // record the file descriptor and events
+            int oldCapacity = updateDescriptors.length;
+            if (updateCount == oldCapacity) {
+                int newCapacity = oldCapacity + INITIAL_PENDING_UPDATE_SIZE;
+                int[] newDescriptors = new int[newCapacity];
+                System.arraycopy(updateDescriptors, 0, newDescriptors, 0, oldCapacity);
+                updateDescriptors = newDescriptors;
+            }
+            updateDescriptors[updateCount++] = fd;
+
+            // events are stored as bytes for efficiency reasons
+            byte b = (byte)mask;
+            assert (b == mask) && (b != KILLED);
+            setUpdateEvents(fd, b, false);
         }
     }
 
     /**
-     * Remove a channel's file descriptor from epoll
+     * Add a file descriptor
      */
-    void release(SelChImpl channel) {
-        synchronized (updateList) {
-            // flush any pending updates
-            for (Iterator<Updator> it = updateList.iterator(); it.hasNext();) {
-                if (it.next().channel == channel) {
-                    it.remove();
-                }
+    void add(int fd) {
+        // force the initial update events to 0 as it may be KILLED by a
+        // previous registration.
+        synchronized (updateLock) {
+            assert !registered.get(fd);
+            setUpdateEvents(fd, (byte)0, true);
+        }
+    }
+
+    /**
+     * Remove a file descriptor
+     */
+    void remove(int fd) {
+        synchronized (updateLock) {
+            // kill pending and future update for this file descriptor
+            setUpdateEvents(fd, KILLED, false);
+
+            // remove from epoll
+            if (registered.get(fd)) {
+                epollCtl(epfd, EPOLL_CTL_DEL, fd, 0);
+                registered.clear(fd);
             }
-
-            // remove from the idle set (if present)
-            idleSet.remove(channel);
-
-            // remove from epoll (if registered)
-            epollCtl(epfd, EPOLL_CTL_DEL, channel.getFDVal(), 0);
         }
     }
 
@@ -239,36 +268,38 @@
     /**
      * Update the pending registrations.
      */
-    void updateRegistrations() {
-        synchronized (updateList) {
-            Updator u = null;
-            while ((u = updateList.poll()) != null) {
-                SelChImpl ch = u.channel;
-                if (!ch.isOpen())
-                    continue;
+    private void updateRegistrations() {
+        synchronized (updateLock) {
+            int j = 0;
+            while (j < updateCount) {
+                int fd = updateDescriptors[j];
+                short events = getUpdateEvents(fd);
+                boolean isRegistered = registered.get(fd);
+                int opcode = 0;
 
-                // if the events are 0 then file descriptor is put into "idle
-                // set" to prevent it being polled
-                if (u.events == 0) {
-                    boolean added = idleSet.add(u.channel);
-                    // if added to idle set then remove from epoll if registered
-                    if (added && (u.opcode == EPOLL_CTL_MOD))
-                        epollCtl(epfd, EPOLL_CTL_DEL, ch.getFDVal(), 0);
-                } else {
-                    // events are specified. If file descriptor was in idle set
-                    // it must be re-registered (by converting opcode to ADD)
-                    boolean idle = false;
-                    if (!idleSet.isEmpty())
-                        idle = idleSet.remove(u.channel);
-                    int opcode = (idle) ? EPOLL_CTL_ADD : u.opcode;
-                    epollCtl(epfd, opcode, ch.getFDVal(), u.events);
+                if (events != KILLED) {
+                    if (isRegistered) {
+                        opcode = (events != 0) ? EPOLL_CTL_MOD : EPOLL_CTL_DEL;
+                    } else {
+                        opcode = (events != 0) ? EPOLL_CTL_ADD : 0;
+                    }
+                    if (opcode != 0) {
+                        epollCtl(epfd, opcode, fd, events);
+                        if (opcode == EPOLL_CTL_ADD) {
+                            registered.set(fd);
+                        } else if (opcode == EPOLL_CTL_DEL) {
+                            registered.clear(fd);
+                        }
+                    }
                 }
+                j++;
             }
+            updateCount = 0;
         }
     }
 
     // interrupt support
-    boolean interrupted = false;
+    private boolean interrupted = false;
 
     public void interrupt() {
         interrupt(outgoingInterruptFD);
@@ -296,7 +327,6 @@
                                  int epfd) throws IOException;
     private static native int sizeofEPollEvent();
     private static native int offsetofData();
-    private static native int fdLimit();
     private static native void interrupt(int fd);
     private static native void init();
 }
--- a/src/solaris/classes/sun/nio/ch/EPollSelectorImpl.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/sun/nio/ch/EPollSelectorImpl.java	Fri Jun 21 19:11:42 2013 -0700
@@ -53,26 +53,24 @@
     private volatile boolean closed = false;
 
     // Lock for interrupt triggering and clearing
-    private Object interruptLock = new Object();
+    private final Object interruptLock = new Object();
     private boolean interruptTriggered = false;
 
     /**
      * Package private constructor called by factory method in
      * the abstract superclass Selector.
      */
-    EPollSelectorImpl(SelectorProvider sp) {
+    EPollSelectorImpl(SelectorProvider sp) throws IOException {
         super(sp);
         long pipeFds = IOUtil.makePipe(false);
         fd0 = (int) (pipeFds >>> 32);
         fd1 = (int) pipeFds;
         pollWrapper = new EPollArrayWrapper();
         pollWrapper.initInterrupt(fd0, fd1);
-        fdToKey = new HashMap<Integer,SelectionKeyImpl>();
+        fdToKey = new HashMap<>();
     }
 
-    protected int doSelect(long timeout)
-        throws IOException
-    {
+    protected int doSelect(long timeout) throws IOException {
         if (closed)
             throw new ClosedSelectorException();
         processDeregisterQueue();
@@ -161,8 +159,9 @@
         if (closed)
             throw new ClosedSelectorException();
         SelChImpl ch = ski.channel;
-        fdToKey.put(Integer.valueOf(ch.getFDVal()), ski);
-        pollWrapper.add(ch);
+        int fd = Integer.valueOf(ch.getFDVal());
+        fdToKey.put(fd, ski);
+        pollWrapper.add(fd);
         keys.add(ski);
     }
 
@@ -171,7 +170,7 @@
         SelChImpl ch = ski.channel;
         int fd = ch.getFDVal();
         fdToKey.remove(Integer.valueOf(fd));
-        pollWrapper.release(ch);
+        pollWrapper.remove(fd);
         ski.setIndex(-1);
         keys.remove(ski);
         selectedKeys.remove(ski);
@@ -181,10 +180,11 @@
             ((SelChImpl)selch).kill();
     }
 
-    void putEventOps(SelectionKeyImpl sk, int ops) {
+    void putEventOps(SelectionKeyImpl ski, int ops) {
         if (closed)
             throw new ClosedSelectorException();
-        pollWrapper.setInterest(sk.channel, ops);
+        SelChImpl ch = ski.channel;
+        pollWrapper.setInterest(ch.getFDVal(), ops);
     }
 
     public Selector wakeup() {
@@ -200,5 +200,4 @@
     static {
         Util.load();
     }
-
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/solaris/classes/sun/nio/ch/EventPortSelectorImpl.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,170 @@
+/*
+ * 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.  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.ch;
+
+import java.io.IOException;
+import java.nio.channels.*;
+import java.nio.channels.spi.*;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Iterator;
+
+/**
+ * Selector implementation based on the Solaris event port mechanism.
+ */
+
+class EventPortSelectorImpl
+    extends SelectorImpl
+{
+    private final EventPortWrapper pollWrapper;
+
+    // Maps from file descriptors to keys
+    private Map<Integer,SelectionKeyImpl> fdToKey;
+
+    // True if this Selector has been closed
+    private boolean closed = false;
+
+    // Lock for interrupt triggering and clearing
+    private final Object interruptLock = new Object();
+    private boolean interruptTriggered = false;
+
+    /**
+     * Package private constructor called by factory method in
+     * the abstract superclass Selector.
+     */
+    EventPortSelectorImpl(SelectorProvider sp) throws IOException {
+        super(sp);
+        pollWrapper = new EventPortWrapper();
+        fdToKey = new HashMap<>();
+    }
+
+    protected int doSelect(long timeout) throws IOException {
+        if (closed)
+            throw new ClosedSelectorException();
+        processDeregisterQueue();
+        int entries;
+        try {
+            begin();
+            entries = pollWrapper.poll(timeout);
+        } finally {
+            end();
+        }
+        processDeregisterQueue();
+        int numKeysUpdated = updateSelectedKeys(entries);
+        if (pollWrapper.interrupted()) {
+            synchronized (interruptLock) {
+                interruptTriggered = false;
+            }
+        }
+        return numKeysUpdated;
+    }
+
+    private int updateSelectedKeys(int entries) {
+        int numKeysUpdated = 0;
+        for (int i=0; i<entries; i++) {
+            int nextFD = pollWrapper.getDescriptor(i);
+            SelectionKeyImpl ski = fdToKey.get(Integer.valueOf(nextFD));
+            if (ski != null) {
+                int rOps = pollWrapper.getEventOps(i);
+                if (selectedKeys.contains(ski)) {
+                    if (ski.channel.translateAndSetReadyOps(rOps, ski)) {
+                        numKeysUpdated++;
+                    }
+                } else {
+                    ski.channel.translateAndSetReadyOps(rOps, ski);
+                    if ((ski.nioReadyOps() & ski.nioInterestOps()) != 0) {
+                        selectedKeys.add(ski);
+                        numKeysUpdated++;
+                    }
+                }
+            }
+        }
+        return numKeysUpdated;
+    }
+
+    protected void implClose() throws IOException {
+        if (closed)
+            return;
+        closed = true;
+
+        // prevent further wakeup
+        synchronized (interruptLock) {
+            interruptTriggered = true;
+        }
+
+        pollWrapper.close();
+        selectedKeys = null;
+
+        // Deregister channels
+        Iterator<SelectionKey> i = keys.iterator();
+        while (i.hasNext()) {
+            SelectionKeyImpl ski = (SelectionKeyImpl)i.next();
+            deregister(ski);
+            SelectableChannel selch = ski.channel();
+            if (!selch.isOpen() && !selch.isRegistered())
+                ((SelChImpl)selch).kill();
+            i.remove();
+        }
+    }
+
+    protected void implRegister(SelectionKeyImpl ski) {
+        int fd = IOUtil.fdVal(ski.channel.getFD());
+        fdToKey.put(Integer.valueOf(fd), ski);
+        keys.add(ski);
+    }
+
+    protected void implDereg(SelectionKeyImpl ski) throws IOException {
+        int i = ski.getIndex();
+        assert (i >= 0);
+        int fd = ski.channel.getFDVal();
+        fdToKey.remove(Integer.valueOf(fd));
+        pollWrapper.release(fd);
+        ski.setIndex(-1);
+        keys.remove(ski);
+        selectedKeys.remove(ski);
+        deregister((AbstractSelectionKey)ski);
+        SelectableChannel selch = ski.channel();
+        if (!selch.isOpen() && !selch.isRegistered())
+            ((SelChImpl)selch).kill();
+    }
+
+    public void putEventOps(SelectionKeyImpl sk, int ops) {
+        if (closed)
+            throw new ClosedSelectorException();
+        int fd = sk.channel.getFDVal();
+        pollWrapper.setInterest(fd, ops);
+    }
+
+    public Selector wakeup() {
+        synchronized (interruptLock) {
+            if (!interruptTriggered) {
+                pollWrapper.interrupt();
+                interruptTriggered = true;
+            }
+        }
+        return this;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/solaris/classes/sun/nio/ch/EventPortSelectorProvider.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,42 @@
+/*
+ * 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.  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.ch;
+
+import java.io.IOException;
+import java.nio.channels.*;
+import java.nio.channels.spi.*;
+
+public class EventPortSelectorProvider
+    extends SelectorProviderImpl
+{
+    public AbstractSelector openSelector() throws IOException {
+        return new EventPortSelectorImpl(this);
+    }
+
+    public Channel inheritedChannel() throws IOException {
+        return InheritedChannel.getChannel();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/solaris/classes/sun/nio/ch/EventPortWrapper.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,262 @@
+/*
+ * 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.  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.ch;
+
+import sun.misc.Unsafe;
+import java.io.IOException;
+import java.util.*;
+import static sun.nio.ch.SolarisEventPort.*;
+
+/**
+ * Manages a Solaris event port and manipulates a native array of pollfd structs
+ * on Solaris.
+ */
+
+class EventPortWrapper {
+    private static final Unsafe unsafe = Unsafe.getUnsafe();
+    private static final int addressSize = unsafe.addressSize();
+
+    // Maximum number of open file descriptors
+    static final int   OPEN_MAX     = IOUtil.fdLimit();
+
+    // Maximum number of events to retrive in one call to port_getn
+    static final int   POLL_MAX     =  Math.min(OPEN_MAX-1, 1024);
+
+    // initial size of the array to hold pending updates
+    private final int INITIAL_PENDING_UPDATE_SIZE = 256;
+
+    // maximum size of updateArray
+    private final int MAX_UPDATE_ARRAY_SIZE = Math.min(OPEN_MAX, 64*1024);
+
+    // special update status to indicate that it should be ignored
+    private static final byte IGNORE = -1;
+
+    // port file descriptor
+    private final int pfd;
+
+    // the poll array (populated by port_getn)
+    private final long pollArrayAddress;
+    private final AllocatedNativeObject pollArray;
+
+    // required when accessing the update* fields
+    private final Object updateLock = new Object();
+
+    // the number of pending updates
+    private int updateCount;
+
+    // queue of file descriptors with updates pending
+    private int[] updateDescriptors = new int[INITIAL_PENDING_UPDATE_SIZE];
+
+    // events for file descriptors with registration changes pending, indexed
+    // by file descriptor and stored as bytes for efficiency reasons. For
+    // file descriptors higher than MAX_UPDATE_ARRAY_SIZE (unlimited case at
+    // least then the update is stored in a map.
+    private final byte[] eventsLow = new byte[MAX_UPDATE_ARRAY_SIZE];
+    private Map<Integer,Byte> eventsHigh;
+    // Used by release and updateRegistrations to track whether a file
+    // descriptor is registered with /dev/poll.
+    private final BitSet registered = new BitSet();
+
+    // bit set to indicate if a file descriptor has been visited when
+    // processing updates (used to avoid duplicates calls to port_associate)
+    private BitSet visited = new BitSet();
+
+    EventPortWrapper() throws IOException {
+        int allocationSize = POLL_MAX * SIZEOF_PORT_EVENT;
+        pollArray = new AllocatedNativeObject(allocationSize, true);
+        pollArrayAddress = pollArray.address();
+        this.pfd = port_create();
+        if (OPEN_MAX > MAX_UPDATE_ARRAY_SIZE)
+            eventsHigh = new HashMap<>();
+    }
+
+    void close() throws IOException {
+        port_close(pfd);
+        pollArray.free();
+    }
+
+    private short getSource(int i) {
+        int offset = SIZEOF_PORT_EVENT * i + OFFSETOF_SOURCE;
+        return pollArray.getShort(offset);
+    }
+
+    int getEventOps(int i) {
+        int offset = SIZEOF_PORT_EVENT * i + OFFSETOF_EVENTS;
+        return pollArray.getInt(offset);
+    }
+
+    int getDescriptor(int i) {
+        int offset = SIZEOF_PORT_EVENT * i + OFFSETOF_OBJECT;
+        if (addressSize == 4) {
+            return pollArray.getInt(offset);
+        } else {
+            return (int) pollArray.getLong(offset);
+        }
+    }
+
+    private void setDescriptor(int i, int fd) {
+        int offset = SIZEOF_PORT_EVENT * i + OFFSETOF_OBJECT;
+        if (addressSize == 4) {
+            pollArray.putInt(offset, fd);
+        } else {
+            pollArray.putLong(offset, fd);
+        }
+    }
+
+    private void setUpdate(int fd, byte events) {
+        if (fd < MAX_UPDATE_ARRAY_SIZE) {
+            eventsLow[fd] = events;
+        } else {
+            eventsHigh.put(Integer.valueOf(fd), Byte.valueOf(events));
+        }
+    }
+
+    private byte getUpdate(int fd) {
+        if (fd < MAX_UPDATE_ARRAY_SIZE) {
+            return eventsLow[fd];
+        } else {
+            Byte result = eventsHigh.get(Integer.valueOf(fd));
+            // result should never be null
+            return result.byteValue();
+        }
+    }
+
+    int poll(long timeout) throws IOException {
+        // update registrations prior to poll
+        synchronized (updateLock) {
+
+            // process newest updates first
+            int i = updateCount - 1;
+            while (i >= 0) {
+                int fd = updateDescriptors[i];
+                if (!visited.get(fd)) {
+                    short ev = getUpdate(fd);
+                    if (ev != IGNORE) {
+                        if (ev == 0) {
+                            if (registered.get(fd)) {
+                                port_dissociate(pfd, PORT_SOURCE_FD, (long)fd);
+                                registered.clear(fd);
+                            }
+                        } else {
+                            if (port_associate(pfd, PORT_SOURCE_FD, (long)fd, ev)) {
+                                registered.set(fd);
+                            }
+                        }
+
+                    }
+                    visited.set(fd);
+                }
+                i--;
+            }
+            updateCount = 0;
+        }
+
+        // poll for events
+        int updated = port_getn(pfd, pollArrayAddress, POLL_MAX, timeout);
+
+        // after polling we need to queue all polled file descriptors as they
+        // are candidates to register for the next poll.
+        synchronized (updateLock) {
+            for (int i=0; i<updated; i++) {
+                if (getSource(i) == PORT_SOURCE_USER) {
+                    interrupted = true;
+                    setDescriptor(i, -1);
+                } else {
+                    // the default is to re-associate for the next poll
+                    int fd = getDescriptor(i);
+                    registered.clear(fd);
+                    setInterest(fd);
+                }
+            }
+        }
+
+        return updated;
+    }
+
+    private void setInterest(int fd) {
+        assert Thread.holdsLock(updateLock);
+
+        // record the file descriptor and events, expanding the
+        // respective arrays first if necessary.
+        int oldCapacity = updateDescriptors.length;
+        if (updateCount >= oldCapacity) {
+            int newCapacity = oldCapacity + INITIAL_PENDING_UPDATE_SIZE;
+            int[] newDescriptors = new int[newCapacity];
+            System.arraycopy(updateDescriptors, 0, newDescriptors, 0, oldCapacity);
+            updateDescriptors = newDescriptors;
+        }
+        updateDescriptors[updateCount++] = fd;
+        visited.clear(fd);
+    }
+
+    void setInterest(int fd, int mask) {
+        synchronized (updateLock) {
+            setInterest(fd);
+            setUpdate(fd, (byte)mask);
+            assert getUpdate(fd) == mask;
+        }
+    }
+
+    void release(int fd) {
+        synchronized (updateLock) {
+            if (registered.get(fd)) {
+                try {
+                    port_dissociate(pfd, PORT_SOURCE_FD, (long)fd);
+                } catch (IOException ioe) {
+                    InternalError x =
+                        new InternalError(ioe.getMessage());
+                    x.initCause(ioe);
+                    throw x;
+                }
+                registered.clear(fd);
+            }
+            setUpdate(fd, IGNORE);
+        }
+    }
+
+    // -- wakeup support --
+
+    private boolean interrupted;
+
+    public void interrupt() {
+        try {
+            port_send(pfd, 0);
+        } catch (IOException ioe) {
+            InternalError x =
+                new InternalError(ioe.getMessage());
+            x.initCause(ioe);
+            throw x;
+        }
+    }
+
+    boolean interrupted() {
+        return interrupted;
+    }
+
+    void clearInterrupted() {
+        interrupted = false;
+    }
+}
--- a/src/solaris/classes/sun/nio/ch/FileDispatcherImpl.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/sun/nio/ch/FileDispatcherImpl.java	Fri Jun 21 19:11:42 2013 -0700
@@ -46,8 +46,9 @@
         return read0(fd, address, len);
     }
 
-    int pread(FileDescriptor fd, long address, int len,
-                             long position, Object lock) throws IOException {
+    int pread(FileDescriptor fd, long address, int len, long position)
+        throws IOException
+    {
         return pread0(fd, address, len, position);
     }
 
@@ -59,8 +60,8 @@
         return write0(fd, address, len);
     }
 
-    int pwrite(FileDescriptor fd, long address, int len,
-                             long position, Object lock) throws IOException
+    int pwrite(FileDescriptor fd, long address, int len, long position)
+        throws IOException
     {
         return pwrite0(fd, address, len, position);
     }
--- a/src/solaris/classes/sun/nio/ch/SinkChannelImpl.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/sun/nio/ch/SinkChannelImpl.java	Fri Jun 21 19:11:42 2013 -0700
@@ -165,7 +165,7 @@
                     return 0;
                 thread = NativeThread.current();
                 do {
-                    n = IOUtil.write(fd, src, -1, nd, lock);
+                    n = IOUtil.write(fd, src, -1, nd);
                 } while ((n == IOStatus.INTERRUPTED) && isOpen());
                 return IOStatus.normalize(n);
             } finally {
--- a/src/solaris/classes/sun/nio/ch/SolarisEventPort.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/sun/nio/ch/SolarisEventPort.java	Fri Jun 21 19:11:42 2013 -0700
@@ -31,8 +31,8 @@
 import sun.misc.Unsafe;
 
 /**
- * AsynchronousChannelGroup implementation based on the Solaris 10 event port
- * framework.
+ * Provides an AsynchronousChannelGroup implementation based on the Solaris 10
+ * event port framework and also provides direct access to that framework.
  */
 
 class SolarisEventPort
@@ -54,14 +54,14 @@
      *     void            *portev_user;
      * } port_event_t;
      */
-    private static final int SIZEOF_PORT_EVENT  = dependsArch(16, 24);
-    private static final int OFFSETOF_EVENTS    = 0;
-    private static final int OFFSETOF_SOURCE    = 4;
-    private static final int OFFSETOF_OBJECT    = 8;
+    static final int SIZEOF_PORT_EVENT  = dependsArch(16, 24);
+    static final int OFFSETOF_EVENTS    = 0;
+    static final int OFFSETOF_SOURCE    = 4;
+    static final int OFFSETOF_OBJECT    = 8;
 
     // port sources
-    private static final short PORT_SOURCE_USER     = 3;
-    private static final short PORT_SOURCE_FD       = 4;
+    static final short PORT_SOURCE_USER     = 3;
+    static final short PORT_SOURCE_FD       = 4;
 
     // file descriptor to event port.
     private final int port;
@@ -75,7 +75,7 @@
         super(provider, pool);
 
         // create event port
-        this.port = portCreate();
+        this.port = port_create();
     }
 
     SolarisEventPort start() {
@@ -90,12 +90,12 @@
                 return;
             closed = true;
         }
-        portClose(port);
+        port_close(port);
     }
 
     private void wakeup() {
         try {
-            portSend(port, 0);
+            port_send(port, 0);
         } catch (IOException x) {
             throw new AssertionError(x);
         }
@@ -124,7 +124,7 @@
             // send user event to wakeup each thread
             while (nThreads-- > 0) {
                 try {
-                    portSend(port, 0);
+                    port_send(port, 0);
                 } catch (IOException x) {
                     throw new AssertionError(x);
                 }
@@ -137,7 +137,7 @@
         // (re-)associate file descriptor
         // no need to translate events
         try {
-            portAssociate(port, PORT_SOURCE_FD, fd, events);
+            port_associate(port, PORT_SOURCE_FD, fd, events);
         } catch (IOException x) {
             throw new AssertionError();     // should not happen
         }
@@ -164,7 +164,7 @@
                     // A error here is fatal (thread will not be replaced)
                     replaceMe = false;
                     try {
-                        portGet(port, address);
+                        port_get(port, address);
                     } catch (IOException x) {
                         x.printStackTrace();
                         return;
@@ -220,26 +220,46 @@
         }
     }
 
-    // -- Native methods --
-
-    private static native void init();
-
-    private static native int portCreate() throws IOException;
+    /**
+     * Creates an event port
+     */
+    static native int port_create() throws IOException;
 
-    private static native void portAssociate(int port, int source, long object,
-        int events) throws IOException;
+    /**
+     * Associates specific events of a given object with a port
+     */
+    static native boolean port_associate(int port, int source, long object, int events)
+        throws IOException;
 
-    private static native void portGet(int port, long pe) throws IOException;
-
-    private static native int portGetn(int port, long address, int max)
+    /**
+     * Removes the association of an object with a port.
+     */
+    static native boolean port_dissociate(int port, int source, long object)
         throws IOException;
 
-    private static native void portSend(int port, int events) throws IOException;
+    /**
+     * Retrieves a single event from a port
+     */
+    static native void port_get(int port, long pe) throws IOException;
+
+    /**
+     * Retrieves at most {@code max} events from a port.
+     */
+    static native int port_getn(int port, long address, int max, long timeout)
+        throws IOException;
 
-    private static native void portClose(int port);
+    /**
+     * Sends a user-defined eventto a specified  port.
+     */
+    static native void port_send(int port, int events) throws IOException;
+
+    /**
+     * Closes a port.
+     */
+    static native void port_close(int port);
+
 
     static {
         Util.load();
-        init();
     }
 }
--- a/src/solaris/classes/sun/nio/ch/SourceChannelImpl.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/sun/nio/ch/SourceChannelImpl.java	Fri Jun 21 19:11:42 2013 -0700
@@ -165,7 +165,7 @@
                     return 0;
                 thread = NativeThread.current();
                 do {
-                    n = IOUtil.read(fd, dst, -1, nd, lock);
+                    n = IOUtil.read(fd, dst, -1, nd);
                 } while ((n == IOStatus.INTERRUPTED) && isOpen());
                 return IOStatus.normalize(n);
             } finally {
--- a/src/solaris/classes/sun/nio/ch/UnixAsynchronousSocketChannelImpl.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/sun/nio/ch/UnixAsynchronousSocketChannelImpl.java	Fri Jun 21 19:11:42 2013 -0700
@@ -384,7 +384,7 @@
             if (scattering) {
                 n = (int)IOUtil.read(fd, readBuffers, nd);
             } else {
-                n = IOUtil.read(fd, readBuffer, -1, nd, null);
+                n = IOUtil.read(fd, readBuffer, -1, nd);
             }
             if (n == IOStatus.UNAVAILABLE) {
                 // spurious wakeup, is this possible?
@@ -505,7 +505,7 @@
                 if (isScatteringRead) {
                     n = (int)IOUtil.read(fd, dsts, nd);
                 } else {
-                    n = IOUtil.read(fd, dst, -1, nd, null);
+                    n = IOUtil.read(fd, dst, -1, nd);
                 }
             }
 
@@ -579,7 +579,7 @@
             if (gathering) {
                 n = (int)IOUtil.write(fd, writeBuffers, nd);
             } else {
-                n = IOUtil.write(fd, writeBuffer, -1, nd, null);
+                n = IOUtil.write(fd, writeBuffer, -1, nd);
             }
             if (n == IOStatus.UNAVAILABLE) {
                 // spurious wakeup, is this possible?
@@ -688,7 +688,7 @@
                 if (isGatheringWrite) {
                     n = (int)IOUtil.write(fd, srcs, nd);
                 } else {
-                    n = IOUtil.write(fd, src, -1, nd, null);
+                    n = IOUtil.write(fd, src, -1, nd);
                 }
             }
 
--- a/src/solaris/classes/sun/nio/fs/BsdNativeDispatcher.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/sun/nio/fs/BsdNativeDispatcher.java	Fri Jun 21 19:11:42 2013 -0700
@@ -33,7 +33,7 @@
  */
 
 class BsdNativeDispatcher extends UnixNativeDispatcher {
-    private BsdNativeDispatcher() { }
+    protected BsdNativeDispatcher() { }
 
    /**
     * struct fsstat_iter *getfsstat();
@@ -55,11 +55,6 @@
     private static native void initIDs();
 
     static {
-        AccessController.doPrivileged(new PrivilegedAction<Void>() {
-            public Void run() {
-                System.loadLibrary("nio");
-                return null;
-        }});
-        initIDs();
+         initIDs();
     }
 }
--- a/src/solaris/classes/sun/nio/fs/DefaultFileSystemProvider.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/sun/nio/fs/DefaultFileSystemProvider.java	Fri Jun 21 19:11:42 2013 -0700
@@ -69,7 +69,7 @@
         if (osname.equals("Linux"))
             return createProvider("sun.nio.fs.LinuxFileSystemProvider");
         if (osname.equals("Darwin") || osname.contains("OS X"))
-            return createProvider("sun.nio.fs.BsdFileSystemProvider");
+            return createProvider("sun.nio.fs.MacOSXFileSystemProvider");
         throw new AssertionError("Platform not recognized");
     }
 }
--- a/src/solaris/classes/sun/nio/fs/DefaultFileTypeDetector.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/sun/nio/fs/DefaultFileTypeDetector.java	Fri Jun 21 19:11:42 2013 -0700
@@ -25,12 +25,15 @@
 
 package sun.nio.fs;
 
+import java.nio.file.FileSystems;
 import java.nio.file.spi.FileTypeDetector;
+import java.nio.file.spi.FileSystemProvider;
 
 public class DefaultFileTypeDetector {
     private DefaultFileTypeDetector() { }
 
     public static FileTypeDetector create() {
-        return new GnomeFileTypeDetector();
+        FileSystemProvider provider = FileSystems.getDefault().provider();
+        return ((UnixFileSystemProvider)provider).getFileTypeDetector();
     }
 }
--- a/src/solaris/classes/sun/nio/fs/LinuxFileSystem.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/sun/nio/fs/LinuxFileSystem.java	Fri Jun 21 19:11:42 2013 -0700
@@ -82,7 +82,7 @@
             try {
                 for (;;) {
                     UnixMountEntry entry = new UnixMountEntry();
-                    int res = getextmntent(fp, entry);
+                    int res = getmntent(fp, entry);
                     if (res < 0)
                         break;
                     entries.add(entry);
--- a/src/solaris/classes/sun/nio/fs/LinuxFileSystemProvider.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/sun/nio/fs/LinuxFileSystemProvider.java	Fri Jun 21 19:11:42 2013 -0700
@@ -27,6 +27,7 @@
 
 import java.nio.file.*;
 import java.nio.file.attribute.*;
+import java.nio.file.spi.FileTypeDetector;
 import java.io.IOException;
 
 /**
@@ -96,4 +97,9 @@
             return super.readAttributes(file, type, options);
         }
     }
+
+    @Override
+    FileTypeDetector getFileTypeDetector() {
+        return new GnomeFileTypeDetector();
+    }
 }
--- a/src/solaris/classes/sun/nio/fs/LinuxNativeDispatcher.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/sun/nio/fs/LinuxNativeDispatcher.java	Fri Jun 21 19:11:42 2013 -0700
@@ -51,9 +51,15 @@
     private static native long setmntent0(long pathAddress, long typeAddress)
         throws UnixException;
 
-   /**
-    * int endmntent(FILE* filep);
-    */
+    /**
+     * int getmntent(FILE *fp, struct mnttab *mp, int len);
+     */
+    static native int getmntent(long fp, UnixMountEntry entry)
+        throws UnixException;
+
+    /**
+     * int endmntent(FILE* filep);
+     */
     static native void endmntent(long stream) throws UnixException;
 
     /**
@@ -90,7 +96,6 @@
     private static native void fsetxattr0(int filedes, long nameAddress,
         long valueAdddress, int valueLen) throws UnixException;
 
-
     /**
      * fremovexattr(int filedes, const char *name);
      */
--- a/src/solaris/classes/sun/nio/fs/LinuxUserDefinedFileAttributeView.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/sun/nio/fs/LinuxUserDefinedFileAttributeView.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -55,7 +55,7 @@
         name = USER_NAMESPACE + name;
         byte[] bytes = name.getBytes();
         if (bytes.length > XATTR_NAME_MAX) {
-            throw new FileSystemException(file.getPathForExecptionMessage(),
+            throw new FileSystemException(file.getPathForExceptionMessage(),
                 null, "'" + name + "' is too big");
         }
         return bytes;
@@ -116,7 +116,7 @@
                         buffer = NativeBuffers.getNativeBuffer(size);
                         continue;
                     }
-                    throw new FileSystemException(file.getPathForExecptionMessage(),
+                    throw new FileSystemException(file.getPathForExceptionMessage(),
                         null, "Unable to get list of extended attributes: " +
                         x.getMessage());
                 }
@@ -138,7 +138,7 @@
             // fgetxattr returns size if called with size==0
             return fgetxattr(fd, nameAsBytes(file,name), 0L, 0);
         } catch (UnixException x) {
-            throw new FileSystemException(file.getPathForExecptionMessage(),
+            throw new FileSystemException(file.getPathForExceptionMessage(),
                 null, "Unable to get size of extended attribute '" + name +
                 "': " + x.getMessage());
         } finally {
@@ -191,7 +191,7 @@
             } catch (UnixException x) {
                 String msg = (x.errno() == ERANGE) ?
                     "Insufficient space in buffer" : x.getMessage();
-                throw new FileSystemException(file.getPathForExecptionMessage(),
+                throw new FileSystemException(file.getPathForExceptionMessage(),
                     null, "Error reading extended attribute '" + name + "': " + msg);
             } finally {
                 close(fd);
@@ -243,7 +243,7 @@
                 src.position(pos + rem);
                 return rem;
             } catch (UnixException x) {
-                throw new FileSystemException(file.getPathForExecptionMessage(),
+                throw new FileSystemException(file.getPathForExceptionMessage(),
                     null, "Error writing extended attribute '" + name + "': " +
                     x.getMessage());
             } finally {
@@ -264,7 +264,7 @@
         try {
             fremovexattr(fd, nameAsBytes(file,name));
         } catch (UnixException x) {
-            throw new FileSystemException(file.getPathForExecptionMessage(),
+            throw new FileSystemException(file.getPathForExceptionMessage(),
                 null, "Unable to delete extended attribute '" + name + "': " + x.getMessage());
         } finally {
             close(fd);
--- a/src/solaris/classes/sun/nio/fs/LinuxWatchService.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/sun/nio/fs/LinuxWatchService.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -243,7 +243,7 @@
                 return x.asIOException(dir);
             }
             if (!attrs.isDirectory()) {
-                return new NotDirectoryException(dir.getPathForExecptionMessage());
+                return new NotDirectoryException(dir.getPathForExceptionMessage());
             }
 
             // register with inotify (replaces existing mask if already registered)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/solaris/classes/sun/nio/fs/MacOSXFileSystem.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,69 @@
+/*
+ * 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.
+ */
+
+package sun.nio.fs;
+
+import java.nio.file.*;
+import java.io.IOException;
+import java.util.*;
+import java.util.regex.Pattern;
+import java.security.AccessController;
+import sun.security.action.GetPropertyAction;
+
+import static sun.nio.fs.MacOSXNativeDispatcher.*;
+
+/**
+ * MacOS implementation of FileSystem
+ */
+
+class MacOSXFileSystem extends BsdFileSystem {
+
+    MacOSXFileSystem(UnixFileSystemProvider provider, String dir) {
+        super(provider, dir);
+    }
+
+    // match in unicode canon_eq
+    Pattern compilePathMatchPattern(String expr) {
+        return Pattern.compile(expr, Pattern.CANON_EQ) ;
+    }
+
+    char[] normalizeNativePath(char[] path) {
+        for (char c : path) {
+            if (c > 0x80)
+                return normalizepath(path, kCFStringNormalizationFormD);
+        }
+        return path;
+    }
+
+    String normalizeJavaPath(String path) {
+        for (int i = 0; i < path.length(); i++) {
+            if (path.charAt(i) > 0x80)
+                return new String(normalizepath(path.toCharArray(),
+                                  kCFStringNormalizationFormC));
+        }
+        return path;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/solaris/classes/sun/nio/fs/MacOSXFileSystemProvider.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,45 @@
+/*
+ * 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.
+ */
+
+package sun.nio.fs;
+
+import java.nio.file.*;
+import java.nio.file.attribute.*;
+import java.io.IOException;
+
+/**
+ * MacOSX implementation of FileSystemProvider
+ */
+
+public class MacOSXFileSystemProvider extends BsdFileSystemProvider {
+    public MacOSXFileSystemProvider() {
+        super();
+    }
+
+    @Override
+    MacOSXFileSystem newFileSystem(String dir) {
+        return new MacOSXFileSystem(this, dir);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/solaris/classes/sun/nio/fs/MacOSXNativeDispatcher.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * 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.fs;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+/**
+ * MacOSX specific system calls.
+ */
+
+class MacOSXNativeDispatcher extends BsdNativeDispatcher {
+    private MacOSXNativeDispatcher() { }
+
+    static final int kCFStringNormalizationFormC = 2;
+    static final int kCFStringNormalizationFormD = 0;
+    static native char[] normalizepath(char[] path, int form);
+}
--- a/src/solaris/classes/sun/nio/fs/SolarisAclFileAttributeView.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/sun/nio/fs/SolarisAclFileAttributeView.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -52,10 +52,10 @@
     /**
      * typedef struct ace {
      *     uid_t        a_who;
-     *     uitn32_t     a_access_mark;
+     *     uint32_t     a_access_mask;
      *     uint16_t     a_flags;
      *     uint16_t     a_type;
-     * } act_t;
+     * } ace_t;
      */
     private static final short SIZEOF_ACE_T     = 12;
     private static final short OFFSETOF_UID     = 0;
@@ -209,21 +209,16 @@
 
             // map uid and flags to UserPrincipal
             UnixUserPrincipals.User who = null;
-            if (uid == -1) {
-                if ((flags & ACE_OWNER) > 0)
-                    who = UnixUserPrincipals.SPECIAL_OWNER;
-                if ((flags & ACE_GROUP) > 0)
-                    who = UnixUserPrincipals.SPECIAL_GROUP;
-                if ((flags & ACE_EVERYONE) > 0)
-                    who = UnixUserPrincipals.SPECIAL_EVERYONE;
-                if (who == null)
-                    throw new AssertionError("ACE who not handled");
+            if ((flags & ACE_OWNER) > 0) {
+                who = UnixUserPrincipals.SPECIAL_OWNER;
+            } else if ((flags & ACE_GROUP) > 0) {
+                who = UnixUserPrincipals.SPECIAL_GROUP;
+            } else if ((flags & ACE_EVERYONE) > 0) {
+                who = UnixUserPrincipals.SPECIAL_EVERYONE;
+            } else if ((flags & ACE_IDENTIFIER_GROUP) > 0) {
+                who = UnixUserPrincipals.fromGid(uid);
             } else {
-                // can be gid
-                if ((flags & ACE_IDENTIFIER_GROUP) > 0)
-                    who = UnixUserPrincipals.fromGid(uid);
-                else
-                    who = UnixUserPrincipals.fromUid(uid);
+                who = UnixUserPrincipals.fromUid(uid);
             }
 
             AclEntryType aceType = null;
@@ -324,7 +319,7 @@
                 return decode(address, n);
             } catch (UnixException x) {
                 if ((x.errno() == ENOSYS) || !isAclsEnabled(fd)) {
-                    throw new FileSystemException(file.getPathForExecptionMessage(),
+                    throw new FileSystemException(file.getPathForExceptionMessage(),
                         null, x.getMessage() + " (file system does not support NFSv4 ACLs)");
                 }
                 x.rethrowAsIOException(file);
@@ -355,7 +350,7 @@
                 facl(fd, ACE_SETACL, n, address);
             } catch (UnixException x) {
                 if ((x.errno() == ENOSYS) || !isAclsEnabled(fd)) {
-                    throw new FileSystemException(file.getPathForExecptionMessage(),
+                    throw new FileSystemException(file.getPathForExceptionMessage(),
                         null, x.getMessage() + " (file system does not support NFSv4 ACLs)");
                 }
                 if (x.errno() == EINVAL && (n < 3))
--- a/src/solaris/classes/sun/nio/fs/SolarisFileSystem.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/sun/nio/fs/SolarisFileSystem.java	Fri Jun 21 19:11:42 2013 -0700
@@ -30,7 +30,7 @@
 import java.util.*;
 import java.security.AccessController;
 import sun.security.action.GetPropertyAction;
-import static sun.nio.fs.UnixNativeDispatcher.*;
+import static sun.nio.fs.SolarisNativeDispatcher.*;
 
 /**
  * Solaris implementation of FileSystem
--- a/src/solaris/classes/sun/nio/fs/SolarisFileSystemProvider.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/sun/nio/fs/SolarisFileSystemProvider.java	Fri Jun 21 19:11:42 2013 -0700
@@ -27,6 +27,7 @@
 
 import java.nio.file.*;
 import java.nio.file.attribute.*;
+import java.nio.file.spi.FileTypeDetector;
 import java.io.IOException;
 
 /**
@@ -79,4 +80,9 @@
                                                            Util.followLinks(options));
         return super.getFileAttributeView(obj, name, options);
     }
+
+    @Override
+    FileTypeDetector getFileTypeDetector() {
+        return new GnomeFileTypeDetector();
+    }
 }
--- a/src/solaris/classes/sun/nio/fs/SolarisNativeDispatcher.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/sun/nio/fs/SolarisNativeDispatcher.java	Fri Jun 21 19:11:42 2013 -0700
@@ -36,6 +36,12 @@
     private SolarisNativeDispatcher() { }
 
     /**
+     * int getextmntent(FILE *fp, struct extmnttab *mp, int len);
+     */
+    static native int getextmntent(long fp, UnixMountEntry entry)
+        throws UnixException;
+
+    /**
      * int facl(int filedes, int cmd, int nentries, void aclbufp)
      */
     static native int facl(int fd, int cmd, int nentries, long aclbufp)
--- a/src/solaris/classes/sun/nio/fs/SolarisUserDefinedFileAttributeView.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/sun/nio/fs/SolarisUserDefinedFileAttributeView.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -49,7 +49,7 @@
             if (bytes.length <= 1 ||
                 (bytes.length == 2 && bytes[1] == '.'))
             {
-                throw new FileSystemException(file.getPathForExecptionMessage(),
+                throw new FileSystemException(file.getPathForExceptionMessage(),
                     null, "'" + name + "' is not a valid name");
             }
         }
@@ -96,7 +96,7 @@
                 }
                 return Collections.unmodifiableList(list);
             } catch (UnixException x) {
-                throw new FileSystemException(file.getPathForExecptionMessage(),
+                throw new FileSystemException(file.getPathForExceptionMessage(),
                     null, "Unable to get list of extended attributes: " +
                     x.getMessage());
             }
@@ -126,7 +126,7 @@
                     close(afd);
                 }
             } catch (UnixException x) {
-                throw new FileSystemException(file.getPathForExecptionMessage(),
+                throw new FileSystemException(file.getPathForExceptionMessage(),
                     null, "Unable to get size of extended attribute '" + name +
                     "': " + x.getMessage());
             }
@@ -147,7 +147,7 @@
                 int afd = openat(fd, nameAsBytes(file,name), (O_RDONLY|O_XATTR), 0);
 
                 // wrap with channel
-                FileChannel fc = UnixChannelFactory.newFileChannel(afd, true, false);
+                FileChannel fc = UnixChannelFactory.newFileChannel(afd, file.toString(), true, false);
 
                 // read to EOF (nothing we can do if I/O error occurs)
                 try {
@@ -165,7 +165,7 @@
                     fc.close();
                 }
             } catch (UnixException x) {
-                throw new FileSystemException(file.getPathForExecptionMessage(),
+                throw new FileSystemException(file.getPathForExceptionMessage(),
                     null, "Unable to read extended attribute '" + name +
                     "': " + x.getMessage());
             }
@@ -188,7 +188,7 @@
                                  UnixFileModeAttribute.ALL_PERMISSIONS);
 
                 // wrap with channel
-                FileChannel fc = UnixChannelFactory.newFileChannel(afd, false, true);
+                FileChannel fc = UnixChannelFactory.newFileChannel(afd, file.toString(), false, true);
 
                 // write value (nothing we can do if I/O error occurs)
                 try {
@@ -201,7 +201,7 @@
                     fc.close();
                 }
             } catch (UnixException x) {
-                throw new FileSystemException(file.getPathForExecptionMessage(),
+                throw new FileSystemException(file.getPathForExceptionMessage(),
                     null, "Unable to write extended attribute '" + name +
                     "': " + x.getMessage());
             }
@@ -224,7 +224,7 @@
                 close(dfd);
             }
         } catch (UnixException x) {
-            throw new FileSystemException(file.getPathForExecptionMessage(),
+            throw new FileSystemException(file.getPathForExceptionMessage(),
                 null, "Unable to delete extended attribute '" + name +
                 "': " + x.getMessage());
         } finally {
--- a/src/solaris/classes/sun/nio/fs/SolarisWatchService.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/sun/nio/fs/SolarisWatchService.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -288,7 +288,7 @@
                 return x.asIOException(dir);
             }
             if (!attrs.isDirectory()) {
-                return new NotDirectoryException(dir.getPathForExecptionMessage());
+                return new NotDirectoryException(dir.getPathForExceptionMessage());
             }
 
             // return existing watch key after updating events if already
--- a/src/solaris/classes/sun/nio/fs/UnixChannelFactory.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/sun/nio/fs/UnixChannelFactory.java	Fri Jun 21 19:11:42 2013 -0700
@@ -36,8 +36,6 @@
 import sun.misc.SharedSecrets;
 import sun.misc.JavaIOFileDescriptorAccess;
 
-import com.sun.nio.file.ExtendedOpenOption;
-
 import static sun.nio.fs.UnixNativeDispatcher.*;
 import static sun.nio.fs.UnixConstants.*;
 
@@ -86,13 +84,13 @@
                     }
                     continue;
                 }
-                if (option == LinkOption.NOFOLLOW_LINKS) {
+                if (option == LinkOption.NOFOLLOW_LINKS && supportsNoFollowLinks()) {
                     flags.noFollowLinks = true;
                     continue;
                 }
                 if (option == null)
                     throw new NullPointerException();
-               throw new UnsupportedOperationException();
+               throw new UnsupportedOperationException(option + " not supported");
             }
             return flags;
         }
@@ -102,10 +100,10 @@
     /**
      * Constructs a file channel from an existing (open) file descriptor
      */
-    static FileChannel newFileChannel(int fd, boolean reading, boolean writing) {
+    static FileChannel newFileChannel(int fd, String path, boolean reading, boolean writing) {
         FileDescriptor fdObj = new FileDescriptor();
         fdAccess.set(fdObj, fd);
-        return FileChannelImpl.open(fdObj, reading, writing, null);
+        return FileChannelImpl.open(fdObj, path, reading, writing, null);
     }
 
     /**
@@ -136,7 +134,8 @@
             throw new IllegalArgumentException("APPEND + TRUNCATE_EXISTING not allowed");
 
         FileDescriptor fdObj = open(dfd, path, pathForPermissionCheck, flags, mode);
-        return FileChannelImpl.open(fdObj, flags.read, flags.write, flags.append, null);
+        return FileChannelImpl.open(fdObj, path.toString(),
+            flags.read, flags.write, flags.append, null);
     }
 
     /**
@@ -220,6 +219,15 @@
         // follow links by default
         boolean followLinks = true;
         if (!flags.createNew && (flags.noFollowLinks || flags.deleteOnClose)) {
+            if (flags.deleteOnClose && !supportsNoFollowLinks()) {
+                try {
+                    if (UnixFileAttributes.get(path, false).isSymbolicLink())
+                        throw new UnixException("DELETE_ON_CLOSE specified and file is a symbolic link");
+                } catch (UnixException x) {
+                    if (!flags.create || x.errno() != ENOENT)
+                        throw x;
+                }
+            }
             followLinks = false;
             oflags |= O_NOFOLLOW;
         }
--- a/src/solaris/classes/sun/nio/fs/UnixCopyFile.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/sun/nio/fs/UnixCopyFile.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -383,8 +383,8 @@
             } catch (UnixException x) {
                 if (x.errno() == EXDEV) {
                     throw new AtomicMoveNotSupportedException(
-                        source.getPathForExecptionMessage(),
-                        target.getPathForExecptionMessage(),
+                        source.getPathForExceptionMessage(),
+                        target.getPathForExceptionMessage(),
                         x.errorString());
                 }
                 x.rethrowAsIOException(source, target);
@@ -420,7 +420,7 @@
                 return;  // nothing to do as files are identical
             if (!flags.replaceExisting) {
                 throw new FileAlreadyExistsException(
-                    target.getPathForExecptionMessage());
+                    target.getPathForExceptionMessage());
             }
 
             // attempt to delete target
@@ -436,7 +436,7 @@
                    (x.errno() == EEXIST || x.errno() == ENOTEMPTY))
                 {
                     throw new DirectoryNotEmptyException(
-                        target.getPathForExecptionMessage());
+                        target.getPathForExceptionMessage());
                 }
                 x.rethrowAsIOException(target);
             }
@@ -489,7 +489,7 @@
                 (x.errno() == EEXIST || x.errno() == ENOTEMPTY))
             {
                 throw new DirectoryNotEmptyException(
-                    source.getPathForExecptionMessage());
+                    source.getPathForExceptionMessage());
             }
             x.rethrowAsIOException(source);
         }
@@ -542,7 +542,7 @@
                 return;  // nothing to do as files are identical
             if (!flags.replaceExisting)
                 throw new FileAlreadyExistsException(
-                    target.getPathForExecptionMessage());
+                    target.getPathForExceptionMessage());
             try {
                 if (targetAttrs.isDirectory()) {
                     rmdir(target);
@@ -555,7 +555,7 @@
                    (x.errno() == EEXIST || x.errno() == ENOTEMPTY))
                 {
                     throw new DirectoryNotEmptyException(
-                        target.getPathForExecptionMessage());
+                        target.getPathForExceptionMessage());
                 }
                 x.rethrowAsIOException(target);
             }
--- a/src/solaris/classes/sun/nio/fs/UnixException.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/sun/nio/fs/UnixException.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -97,8 +97,8 @@
     }
 
     void rethrowAsIOException(UnixPath file, UnixPath other) throws IOException {
-        String a = (file == null) ? null : file.getPathForExecptionMessage();
-        String b = (other == null) ? null : other.getPathForExecptionMessage();
+        String a = (file == null) ? null : file.getPathForExceptionMessage();
+        String b = (other == null) ? null : other.getPathForExceptionMessage();
         IOException x = translateToIOException(a, b);
         throw x;
     }
@@ -108,6 +108,6 @@
     }
 
     IOException asIOException(UnixPath file) {
-        return translateToIOException(file.getPathForExecptionMessage(), null);
+        return translateToIOException(file.getPathForExceptionMessage(), null);
     }
 }
--- a/src/solaris/classes/sun/nio/fs/UnixFileSystem.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/sun/nio/fs/UnixFileSystem.java	Fri Jun 21 19:11:42 2013 -0700
@@ -302,7 +302,8 @@
         }
 
         // return matcher
-        final Pattern pattern = Pattern.compile(expr);
+        final Pattern pattern = compilePathMatchPattern(expr);
+
         return new PathMatcher() {
             @Override
             public boolean matches(Path path) {
@@ -310,11 +311,10 @@
             }
         };
     }
+
     private static final String GLOB_SYNTAX = "glob";
     private static final String REGEX_SYNTAX = "regex";
 
-
-
     @Override
     public final UserPrincipalLookupService getUserPrincipalLookupService() {
         return LookupService.instance;
@@ -339,4 +339,23 @@
             };
     }
 
+    // Override if the platform has different path match requrement, such as
+    // case insensitive or Unicode canonical equal on MacOSX
+    Pattern compilePathMatchPattern(String expr) {
+        return Pattern.compile(expr);
+    }
+
+    // Override if the platform uses different Unicode normalization form
+    // for native file path. For example on MacOSX, the native path is stored
+    // in Unicode NFD form.
+    char[] normalizeNativePath(char[] path) {
+        return path;
+    }
+
+    // Override if the native file path use non-NFC form. For example on MacOSX,
+    // the native path is stored in Unicode NFD form, the path need to be
+    // normalized back to NFC before passed back to Java level.
+    String normalizeJavaPath(String path) {
+        return path;
+    }
 }
--- a/src/solaris/classes/sun/nio/fs/UnixFileSystemProvider.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/sun/nio/fs/UnixFileSystemProvider.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -27,6 +27,7 @@
 
 import java.nio.file.*;
 import java.nio.file.attribute.*;
+import java.nio.file.spi.FileTypeDetector;
 import java.nio.channels.*;
 import java.net.URI;
 import java.util.concurrent.ExecutorService;
@@ -238,7 +239,7 @@
             // DirectoryNotEmptyException if not empty
             if (attrs != null && attrs.isDirectory() &&
                 (x.errno() == EEXIST || x.errno() == ENOTEMPTY))
-                throw new DirectoryNotEmptyException(file.getPathForExecptionMessage());
+                throw new DirectoryNotEmptyException(file.getPathForExceptionMessage());
 
             x.rethrowAsIOException(file);
             return false;
@@ -395,13 +396,13 @@
 
         // can't return SecureDirectoryStream on kernels that don't support
         // openat, etc.
-        if (!supportsAtSysCalls()) {
+        if (!supportsAtSysCalls() || !supportsNoFollowLinks()) {
             try {
                 long ptr = opendir(dir);
                 return new UnixDirectoryStream(dir, ptr, filter);
             } catch (UnixException x) {
                 if (x.errno() == ENOTDIR)
-                    throw new NotDirectoryException(dir.getPathForExecptionMessage());
+                    throw new NotDirectoryException(dir.getPathForExceptionMessage());
                 x.rethrowAsIOException(dir);
             }
         }
@@ -421,7 +422,7 @@
             if (dfd2 != -1)
                 UnixNativeDispatcher.close(dfd2);
             if (x.errno() == UnixConstants.ENOTDIR)
-                throw new NotDirectoryException(dir.getPathForExecptionMessage());
+                throw new NotDirectoryException(dir.getPathForExceptionMessage());
             x.rethrowAsIOException(dir);
         }
         return new UnixSecureDirectoryStream(dir, dp, dfd2, filter);
@@ -490,9 +491,22 @@
             return new UnixPath(link.getFileSystem(), target);
         } catch (UnixException x) {
            if (x.errno() == UnixConstants.EINVAL)
-                throw new NotLinkException(link.getPathForExecptionMessage());
+                throw new NotLinkException(link.getPathForExceptionMessage());
             x.rethrowAsIOException(link);
             return null;    // keep compiler happy
         }
     }
+
+    /**
+     * Returns a {@code FileTypeDetector} for this platform.
+     */
+    FileTypeDetector getFileTypeDetector() {
+        return new AbstractFileTypeDetector() {
+            @Override
+            public String implProbeContentType(Path file) {
+                return null;
+            }
+        };
+    }
+
 }
--- a/src/solaris/classes/sun/nio/fs/UnixNativeDispatcher.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/sun/nio/fs/UnixNativeDispatcher.java	Fri Jun 21 19:11:42 2013 -0700
@@ -498,11 +498,6 @@
     private static native int getgrnam0(long nameAddress) throws UnixException;
 
     /**
-     * int getextmntent(FILE *fp, struct extmnttab *mp, int len);
-     */
-    static native int getextmntent(long fp, UnixMountEntry entry) throws UnixException;
-
-    /**
      * statvfs(const char* path, struct statvfs *buf)
      */
     static void statvfs(UnixPath path, UnixFileStoreAttributes attrs)
@@ -548,6 +543,10 @@
         return hasAtSysCalls;
     }
 
+    static boolean supportsNoFollowLinks() {
+        return UnixConstants.O_NOFOLLOW != 0;
+    }
+
     // initialize syscalls and fieldIDs
     private static native int init();
 
--- a/src/solaris/classes/sun/nio/fs/UnixPath.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/sun/nio/fs/UnixPath.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -68,7 +68,7 @@
 
     UnixPath(UnixFileSystem fs, String input) {
         // removes redundant slashes and checks for invalid characters
-        this(fs, encode(normalizeAndCheck(input)));
+        this(fs, encode(fs, normalizeAndCheck(input)));
     }
 
     // package-private
@@ -116,7 +116,7 @@
     }
 
     // encodes the given path-string into a sequence of bytes
-    private static byte[] encode(String input) {
+    private static byte[] encode(UnixFileSystem fs, String input) {
         SoftReference<CharsetEncoder> ref = encoder.get();
         CharsetEncoder ce = (ref != null) ? ref.get() : null;
         if (ce == null) {
@@ -126,7 +126,7 @@
             encoder.set(new SoftReference<CharsetEncoder>(ce));
         }
 
-        char[] ca = input.toCharArray();
+        char[] ca = fs.normalizeNativePath(input.toCharArray());
 
         // size output buffer for worse-case size
         byte[] ba = new byte[(int)(ca.length * (double)ce.maxBytesPerChar())];
@@ -179,7 +179,7 @@
     }
 
     // use this message when throwing exceptions
-    String getPathForExecptionMessage() {
+    String getPathForExceptionMessage() {
         return toString();
     }
 
@@ -728,7 +728,7 @@
             if (c1 != c2) {
                 return c1 - c2;
             }
-            k++;
+           k++;
         }
         return len1 - len2;
     }
@@ -757,8 +757,9 @@
     @Override
     public String toString() {
         // OK if two or more threads create a String
-        if (stringValue == null)
-            stringValue = new String(path);     // platform encoding
+        if (stringValue == null) {
+            stringValue = fs.normalizeJavaPath(new String(path));     // platform encoding
+        }
         return stringValue;
     }
 
@@ -767,8 +768,11 @@
     // package-private
     int openForAttributeAccess(boolean followLinks) throws IOException {
         int flags = O_RDONLY;
-        if (!followLinks)
+        if (!followLinks) {
+            if (!supportsNoFollowLinks())
+                throw new IOException("NOFOLLOW_LINKS is not supported on this platform");
             flags |= O_NOFOLLOW;
+        }
         try {
             return open(this, flags, 0);
         } catch (UnixException x) {
@@ -777,7 +781,7 @@
                 x.setError(ELOOP);
 
             if (x.errno() == ELOOP)
-                throw new FileSystemException(getPathForExecptionMessage(), null,
+                throw new FileSystemException(getPathForExceptionMessage(), null,
                     x.getMessage() + " or unable to access attributes of symbolic link");
 
             x.rethrowAsIOException(this);
--- a/src/solaris/classes/sun/print/IPPPrintService.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/sun/print/IPPPrintService.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1023,6 +1023,13 @@
 
             // this is already supported in UnixPrintJob
             catList.add(Destination.class);
+
+            // It is unfortunate that CUPS doesn't provide a way to query
+            // if printer supports collation but since most printers
+            // now supports collation and that most OS has a way
+            // of setting it, it is a safe assumption to just always
+            // include SheetCollate as supported attribute.
+            catList.add(SheetCollate.class);
         }
 
         // With the assumption that  Chromaticity is equivalent to
--- a/src/solaris/classes/sun/print/UnixPrintJob.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/sun/print/UnixPrintJob.java	Fri Jun 21 19:11:42 2013 -0700
@@ -38,7 +38,9 @@
 import java.io.OutputStream;
 import java.io.OutputStreamWriter;
 import java.io.IOException;
+import java.io.PrintWriter;
 import java.io.Reader;
+import java.io.StringWriter;
 import java.io.UnsupportedEncodingException;
 import java.nio.file.Files;
 import java.util.Vector;
@@ -937,7 +939,7 @@
                      * is not removed for some reason, request that it is
                      * removed when the VM exits.
                      */
-                    spoolFile = Files.createTempFile("javaprint", ".ps").toFile();
+                    spoolFile = Files.createTempFile("javaprint", "").toFile();
                     spoolFile.deleteOnExit();
                 }
                 result = new FileOutputStream(spoolFile);
@@ -956,23 +958,49 @@
     private class PrinterSpooler implements java.security.PrivilegedAction {
         PrintException pex;
 
+        private void handleProcessFailure(final Process failedProcess,
+                final String[] execCmd, final int result) throws IOException {
+            try (StringWriter sw = new StringWriter();
+                    PrintWriter pw = new PrintWriter(sw)) {
+                pw.append("error=").append(Integer.toString(result));
+                pw.append(" running:");
+                for (String arg: execCmd) {
+                    pw.append(" '").append(arg).append("'");
+                }
+                try (InputStream is = failedProcess.getErrorStream();
+                        InputStreamReader isr = new InputStreamReader(is);
+                        BufferedReader br = new BufferedReader(isr)) {
+                    while (br.ready()) {
+                        pw.println();
+                        pw.append("\t\t").append(br.readLine());
+                    }
+                } finally {
+                    pw.flush();
+                    throw new IOException(sw.toString());
+                }
+            }
+        }
+
         public Object run() {
+            if (spoolFile == null || !spoolFile.exists()) {
+               pex = new PrintException("No spool file");
+               notifyEvent(PrintJobEvent.JOB_FAILED);
+               return null;
+            }
             try {
                 /**
                  * Spool to the printer.
                  */
-                if (spoolFile == null || !spoolFile.exists()) {
-                   pex = new PrintException("No spool file");
-                   notifyEvent(PrintJobEvent.JOB_FAILED);
-                   return null;
-                }
                 String fileName = spoolFile.getAbsolutePath();
                 String execCmd[] = printExecCmd(mDestination, mOptions,
                                mNoJobSheet, jobName, copies, fileName);
 
                 Process process = Runtime.getRuntime().exec(execCmd);
                 process.waitFor();
-                spoolFile.delete();
+                final int result = process.exitValue();
+                if (0 != result) {
+                    handleProcessFailure(process, execCmd, result);
+                }
                 notifyEvent(PrintJobEvent.DATA_TRANSFER_COMPLETE);
             } catch (IOException ex) {
                 notifyEvent(PrintJobEvent.JOB_FAILED);
@@ -982,6 +1010,7 @@
                 notifyEvent(PrintJobEvent.JOB_FAILED);
                 pex = new PrintException(ie);
             } finally {
+                spoolFile.delete();
                 notifyEvent(PrintJobEvent.NO_MORE_EVENTS);
             }
             return null;
--- a/src/solaris/classes/sun/print/UnixPrintServiceLookup.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/classes/sun/print/UnixPrintServiceLookup.java	Fri Jun 21 19:11:42 2013 -0700
@@ -362,10 +362,33 @@
      */
     private PrintService getServiceByName(PrinterName nameAttr) {
         String name = nameAttr.getValue();
-        PrintService printer = null;
         if (name == null || name.equals("") || !checkPrinterName(name)) {
             return null;
         }
+        /* check is all printers are already available */
+        if (printServices != null) {
+            for (PrintService printService : printServices) {
+                if (printService.getName().equals(name)) {
+                    return printService;
+                }
+            }
+        }
+        /* take CUPS into account first */
+        if (CUPSPrinter.isCupsRunning()) {
+            try {
+                return new IPPPrintService(name,
+                                           new URL("http://"+
+                                                   CUPSPrinter.getServer()+":"+
+                                                   CUPSPrinter.getPort()+"/"+
+                                                   name));
+            } catch (Exception e) {
+                IPPPrintService.debug_println(debugPrefix+
+                                              " getServiceByName Exception "+
+                                              e);
+            }
+        }
+        /* fallback if nothing not having a printer at this point */
+        PrintService printer = null;
         if (isMac() || isSysV()) {
             printer = getNamedPrinterNameSysV(name);
         } else {
--- a/src/solaris/demo/jvmti/hprof/hprof_md.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/demo/jvmti/hprof/hprof_md.c	Fri Jun 21 19:11:42 2013 -0700
@@ -375,6 +375,31 @@
     return ntohl(l);
 }
 
+static void dll_build_name(char* buffer, size_t buflen,
+                           const char* pname, const char* fname) {
+    // Loosely based on os_solaris.cpp
+
+      char *pathname = (char *)pname;
+      while (strlen(pathname) > 0) {
+          char *p = strchr(pathname, ':');
+          if (p == NULL) {
+              p = pathname + strlen(pathname);
+          }
+          /* check for NULL path */
+          if (p == pathname) {
+              continue;
+          }
+          (void)snprintf(buffer, buflen, "%.*s/lib%s" JNI_LIB_SUFFIX,
+                         (p - pathname), pathname, fname);
+
+          if (access(buffer, F_OK) == 0) {
+            break;
+          }
+          pathname = p + 1;
+          *buffer = '\0';
+      }
+}
+
 /* Create the actual fill filename for a dynamic library.  */
 void
 md_build_library_name(char *holder, int holderlen, char *pname, char *fname)
@@ -384,9 +409,9 @@
     /* Length of options directory location. */
     pnamelen = pname ? strlen(pname) : 0;
 
+    *holder = '\0';
     /* Quietly truncate on buffer overflow.  Should be an error. */
     if (pnamelen + (int)strlen(fname) + 10 > holderlen) {
-        *holder = '\0';
         return;
     }
 
@@ -394,7 +419,7 @@
     if (pnamelen == 0) {
         (void)snprintf(holder, holderlen, "lib%s" JNI_LIB_SUFFIX, fname);
     } else {
-        (void)snprintf(holder, holderlen, "%s/lib%s" JNI_LIB_SUFFIX, pname, fname);
+      dll_build_name(holder, holderlen, pname, fname);
     }
 }
 
--- a/src/solaris/lib/content-types.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/lib/content-types.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -225,6 +225,10 @@
 	icon=png;\
 	action=browser
 
+image/bmp: \
+	description=Bitmap Image;\
+	file_extensions=.bmp;
+
 text/html: \
 	description=HTML Document;\
 	file_extensions=.htm,.html;\
--- a/src/solaris/native/java/io/UnixFileSystem_md.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/native/java/io/UnixFileSystem_md.c	Fri Jun 21 19:11:42 2013 -0700
@@ -38,6 +38,7 @@
 #include "jlong.h"
 #include "jvm.h"
 #include "io_util.h"
+#include "io_util_md.h"
 #include "java_io_FileSystem.h"
 #include "java_io_UnixFileSystem.h"
 
@@ -80,7 +81,11 @@
                          canonicalPath, JVM_MAXPATHLEN) < 0) {
             JNU_ThrowIOExceptionWithLastError(env, "Bad pathname");
         } else {
+#ifdef MACOSX
+            rv = newStringPlatform(env, canonicalPath);
+#else
             rv = JNU_NewStringPlatform(env, canonicalPath);
+#endif
         }
     } END_PLATFORM_STRING(env, path);
     return rv;
@@ -311,7 +316,11 @@
             if (JNU_CopyObjectArray(env, rv, old, len) < 0) goto error;
             (*env)->DeleteLocalRef(env, old);
         }
+#ifdef MACOSX
+        name = newStringPlatform(env, ptr->d_name);
+#else
         name = JNU_NewStringPlatform(env, ptr->d_name);
+#endif
         if (name == NULL) goto error;
         (*env)->SetObjectArrayElement(env, rv, len++, name);
         (*env)->DeleteLocalRef(env, name);
--- a/src/solaris/native/java/io/io_util_md.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/native/java/io/io_util_md.c	Fri Jun 21 19:11:42 2013 -0700
@@ -34,37 +34,32 @@
 
 #include <CoreFoundation/CoreFoundation.h>
 
-static inline char *convertToNFD(const char *path, char *buf, size_t bufsize)
+__private_extern__
+jstring newStringPlatform(JNIEnv *env, const char* str)
 {
-    CFMutableStringRef mutable = CFStringCreateMutable(NULL, 0);
-    CFStringAppendCString(mutable, path, kCFStringEncodingUTF8);
-    CFStringNormalize(mutable, kCFStringNormalizationFormD);
-
-    CFStringGetCString(mutable, buf, bufsize, kCFStringEncodingUTF8);
-
-    CFRelease(mutable);
-    return buf;
-}
-
-/* Converts the path to NFD form if it was in NFC form. Returns a pointer to
- * the converting string which could be buf (if the converstion took place) or
- * origPath if no conversion was needed
- */
-__private_extern__
-char* convertToNFDIfNeeded(const char *origPath, char *buf, size_t bufsize)
-{
-    const char *current = origPath;
-    int c;
-    for (c = *current; c != 0; current++, c = *current) {
-        if (c < 0) {
-            // Need to convert
-            return convertToNFD(origPath, buf, bufsize);
+    jstring rv = NULL;
+    CFMutableStringRef csref = CFStringCreateMutable(NULL, 0);
+    if (csref == NULL) {
+        JNU_ThrowOutOfMemoryError(env, "native heap");
+    } else {
+        CFStringAppendCString(csref, str, kCFStringEncodingUTF8);
+        CFStringNormalize(csref, kCFStringNormalizationFormC);
+        int clen = CFStringGetLength(csref);
+        int ulen = (clen + 1) * 2;        // utf16 + zero padding
+        char* chars = malloc(ulen);
+        if (chars == NULL) {
+            CFRelease(csref);
+            JNU_ThrowOutOfMemoryError(env, "native heap");
+        } else {
+            if (CFStringGetCString(csref, chars, ulen, kCFStringEncodingUTF16)) {
+                rv = (*env)->NewString(env, (jchar*)chars, clen);
+            }
+            free(chars);
+            CFRelease(csref);
         }
     }
-
-    return (char *)origPath;
+    return rv;
 }
-
 #endif
 
 void
--- a/src/solaris/native/java/io/io_util_md.h	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/native/java/io/io_util_md.h	Fri Jun 21 19:11:42 2013 -0700
@@ -72,3 +72,7 @@
  * IO helper function(s)
  */
 void fileClose(JNIEnv *env, jobject this, jfieldID fid);
+
+#ifdef MACOSX
+jstring newStringPlatform(JNIEnv *env, const char* str);
+#endif
--- a/src/solaris/native/java/lang/java_props_macosx.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/native/java/lang/java_props_macosx.c	Fri Jun 21 19:11:42 2013 -0700
@@ -115,10 +115,6 @@
     return true;
 }
 
-static bool isXDisplayDefined() {
-    return getenv("DISPLAY") != NULL;
-}
-
 PreferredToolkit getPreferredToolkit() {
     static PreferredToolkit pref = unset;
     if (pref != unset) return pref;
@@ -127,7 +123,6 @@
     if (prefFromEnv != unset) return pref = prefFromEnv;
 
     if (isInAquaSession()) return pref = CToolkit;
-    if (isXDisplayDefined()) return pref = XToolkit;
     return pref = HToolkit;
 }
 
--- a/src/solaris/native/java/lang/java_props_md.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/native/java/lang/java_props_md.c	Fri Jun 21 19:11:42 2013 -0700
@@ -498,7 +498,12 @@
     sprops.display_script = sprops.script;
     sprops.display_country = sprops.country;
     sprops.display_variant = sprops.variant;
+
+#ifdef MACOSX
+    sprops.sun_jnu_encoding = "UTF-8";
+#else
     sprops.sun_jnu_encoding = sprops.encoding;
+#endif
 
 #ifdef _ALLBSD_SOURCE
 #if BYTE_ORDER == _LITTLE_ENDIAN
--- a/src/solaris/native/java/net/Inet4AddressImpl.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/native/java/net/Inet4AddressImpl.c	Fri Jun 21 19:11:42 2013 -0700
@@ -190,7 +190,7 @@
                 struct addrinfo *next
                     = (struct addrinfo*) malloc(sizeof(struct addrinfo));
                 if (!next) {
-                    JNU_ThrowOutOfMemoryError(env, "heap allocation failed");
+                    JNU_ThrowOutOfMemoryError(env, "Native heap allocation failed");
                     ret = NULL;
                     goto cleanupAndReturn;
                 }
@@ -655,11 +655,11 @@
                  sizeof(struct sockaddr));
       if (n < 0 && errno != EINPROGRESS ) {
 #ifdef __linux__
-        if (errno != EINVAL)
+        if (errno != EINVAL && errno != EHOSTUNREACH)
           /*
            * On some Linuxes, when bound to the loopback interface, sendto
-           * will fail and errno will be set to EINVAL. When that happens,
-           * don't throw an exception, just return false.
+           * will fail and errno will be set to EINVAL or EHOSTUNREACH.
+           * When that happens, don't throw an exception, just return false.
            */
 #endif /*__linux__ */
           NET_ThrowNew(env, errno, "Can't send ICMP packet");
@@ -681,12 +681,19 @@
            * We did receive something, but is it what we were expecting?
            * I.E.: A ICMP_ECHOREPLY packet with the proper PID.
            */
-          if (icmplen >= 8 && icmp->icmp_type == ICMP_ECHOREPLY &&
-               (ntohs(icmp->icmp_id) == pid) &&
-               (him->sin_addr.s_addr == sa_recv.sin_addr.s_addr)) {
-            close(fd);
-            return JNI_TRUE;
-          }
+          if (icmplen >= 8 && icmp->icmp_type == ICMP_ECHOREPLY
+               && (ntohs(icmp->icmp_id) == pid)) {
+            if ((him->sin_addr.s_addr == sa_recv.sin_addr.s_addr)) {
+              close(fd);
+              return JNI_TRUE;
+            }
+
+            if (him->sin_addr.s_addr == 0) {
+              close(fd);
+              return JNI_TRUE;
+            }
+         }
+
         }
       } while (tmout2 > 0);
       timeout -= 1000;
@@ -814,10 +821,11 @@
         case EADDRNOTAVAIL: /* address is not available on  the  remote machine */
 #ifdef __linux__
         case EINVAL:
+        case EHOSTUNREACH:
           /*
            * On some Linuxes, when bound to the loopback interface, connect
-           * will fail and errno will be set to EINVAL. When that happens,
-           * don't throw an exception, just return false.
+           * will fail and errno will be set to EINVAL or EHOSTUNREACH.
+           * When that happens, don't throw an exception, just return false.
            */
 #endif /* __linux__ */
           close(fd);
--- a/src/solaris/native/java/net/Inet6AddressImpl.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/native/java/net/Inet6AddressImpl.c	Fri Jun 21 19:11:42 2013 -0700
@@ -264,7 +264,7 @@
                     struct addrinfo *next
                         = (struct addrinfo*) malloc(sizeof(struct addrinfo));
                     if (!next) {
-                        JNU_ThrowOutOfMemoryError(env, "heap allocation failed");
+                        JNU_ThrowOutOfMemoryError(env, "Native heap allocation failed");
                         ret = NULL;
                         goto cleanupAndReturn;
                     }
@@ -505,11 +505,11 @@
       n = sendto(fd, sendbuf, plen, 0, (struct sockaddr*) him, sizeof(struct sockaddr_in6));
       if (n < 0 && errno != EINPROGRESS) {
 #ifdef __linux__
-        if (errno != EINVAL)
+        if (errno != EINVAL && errno != EHOSTUNREACH)
           /*
            * On some Linuxes, when bound to the loopback interface, sendto
-           * will fail and errno will be set to EINVAL. When that happens,
-           * don't throw an exception, just return false.
+           * will fail and errno will be set to EINVAL or EHOSTUNREACH.
+           * When that happens, don't throw an exception, just return false.
            */
 #endif /*__linux__ */
         NET_ThrowNew(env, errno, "Can't send ICMP packet");
@@ -532,10 +532,15 @@
            *       from the host that we are trying to determine is reachable.
            */
           if (n >= 8 && icmp6->icmp6_type == ICMP6_ECHO_REPLY &&
-              (ntohs(icmp6->icmp6_id) == pid) &&
-              NET_IsEqual(caddr, recv_caddr)) {
-            close(fd);
-            return JNI_TRUE;
+              (ntohs(icmp6->icmp6_id) == pid)) {
+            if (NET_IsEqual(caddr, recv_caddr)) {
+              close(fd);
+              return JNI_TRUE;
+            }
+            if (NET_IsZeroAddr(caddr)) {
+              close(fd);
+              return JNI_TRUE;
+            }
           }
         }
       } while (tmout2 > 0);
@@ -673,10 +678,11 @@
         case EADDRNOTAVAIL: /* address is not available on  the  remote machine */
 #ifdef __linux__
         case EINVAL:
+        case EHOSTUNREACH:
           /*
            * On some Linuxes, when bound to the loopback interface, connect
-           * will fail and errno will be set to EINVAL. When that happens,
-           * don't throw an exception, just return false.
+           * will fail and errno will be set to EINVAL or EHOSTUNREACH.
+           * When that happens, don't throw an exception, just return false.
            */
 #endif /* __linux__ */
           close(fd);
--- a/src/solaris/native/java/net/NetworkInterface.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/native/java/net/NetworkInterface.c	Fri Jun 21 19:11:42 2013 -0700
@@ -145,7 +145,7 @@
 static short   getSubnet(JNIEnv *env, int sock, const char *ifname);
 static int     getIndex(int sock, const char *ifname);
 
-static int     getFlags(int sock, const char *ifname);
+static int     getFlags(int sock, const char *ifname, int *flags);
 static int     getMacAddress(JNIEnv *env, int sock,  const char* ifname, const struct in_addr* addr, unsigned char *buf);
 static int     getMTU(JNIEnv *env, int sock, const char *ifname);
 
@@ -557,6 +557,7 @@
     jboolean isCopy;
     int ret, sock;
     const char* name_utf;
+    int flags = 0;
 
     name_utf = (*env)->GetStringUTFChars(env, name, &isCopy);
 
@@ -567,7 +568,7 @@
 
     name_utf = (*env)->GetStringUTFChars(env, name, &isCopy);
 
-    ret = getFlags(sock, name_utf);
+    ret = getFlags(sock, name_utf, &flags);
 
     close(sock);
     (*env)->ReleaseStringUTFChars(env, name, name_utf);
@@ -577,7 +578,7 @@
         return -1;
     }
 
-    return ret;
+    return flags;
 }
 
 
@@ -799,7 +800,7 @@
        do{ \
         _pointer = (_type)malloc( _size ); \
         if (_pointer == NULL) { \
-            JNU_ThrowOutOfMemoryError(env, "heap allocation failed"); \
+            JNU_ThrowOutOfMemoryError(env, "Native heap allocation failed"); \
             return ifs; /* return untouched list */ \
         } \
        } while(0)
@@ -833,20 +834,26 @@
     }
 }
 
-netif *addif(JNIEnv *env, int sock, const char * if_name, netif *ifs, struct sockaddr* ifr_addrP, int family, short prefix) {
+netif *addif(JNIEnv *env, int sock, const char * if_name,
+             netif *ifs, struct sockaddr* ifr_addrP, int family,
+             short prefix)
+{
     netif *currif = ifs, *parent;
     netaddr *addrP;
 
 #ifdef LIFNAMSIZ
-    char name[LIFNAMSIZ],  vname[LIFNAMSIZ];
+    int ifnam_size = LIFNAMSIZ;
+    char name[LIFNAMSIZ], vname[LIFNAMSIZ];
 #else
-    char name[IFNAMSIZ],  vname[IFNAMSIZ];
+    int ifnam_size = IFNAMSIZ;
+    char name[IFNAMSIZ], vname[IFNAMSIZ];
 #endif
 
     char  *name_colonP;
     int mask;
     int isVirtual = 0;
     int addr_size;
+    int flags = 0;
 
     /*
      * If the interface name is a logical interface then we
@@ -855,7 +862,8 @@
      * currently doesn't have any concept of physical vs.
      * logical interfaces.
      */
-    strcpy(name, if_name);
+    strncpy(name, if_name, ifnam_size);
+    name[ifnam_size - 1] = '\0';
     *vname = 0;
 
     /*
@@ -901,7 +909,7 @@
        * the 'parent' interface with the new records.
        */
         *name_colonP = 0;
-        if (getFlags(sock, name) < 0) {
+        if (getFlags(sock, name, &flags) < 0 || flags < 0) {
             // failed to access parent interface do not create parent.
             // We are a virtual interface with no parent.
             isVirtual = 1;
@@ -932,9 +940,10 @@
      * insert it onto the list.
      */
     if (currif == NULL) {
-         CHECKED_MALLOC3(currif, netif *, sizeof(netif)+IFNAMSIZ );
+         CHECKED_MALLOC3(currif, netif *, sizeof(netif) + ifnam_size);
          currif->name = (char *) currif+sizeof(netif);
-         strcpy(currif->name, name);
+         strncpy(currif->name, name, ifnam_size);
+         currif->name[ifnam_size - 1] = '\0';
          currif->index = getIndex(sock, name);
          currif->addr = NULL;
          currif->childs = NULL;
@@ -967,9 +976,10 @@
         }
 
         if (currif == NULL) {
-            CHECKED_MALLOC3(currif, netif *, sizeof(netif)+ IFNAMSIZ );
+            CHECKED_MALLOC3(currif, netif *, sizeof(netif) + ifnam_size);
             currif->name = (char *) currif + sizeof(netif);
-            strcpy(currif->name, vname);
+            strncpy(currif->name, vname, ifnam_size);
+            currif->name[ifnam_size - 1] = '\0';
             currif->index = getIndex(sock, vname);
             currif->addr = NULL;
            /* Need to duplicate the addr entry? */
@@ -1122,7 +1132,7 @@
     uint8_t ipv6addr[16];
 
     if ((f = fopen(_PATH_PROCNET_IFINET6, "r")) != NULL) {
-        while (fscanf(f, "%4s%4s%4s%4s%4s%4s%4s%4s %02x %02x %02x %02x %20s\n",
+        while (fscanf(f, "%4s%4s%4s%4s%4s%4s%4s%4s %08x %02x %02x %02x %20s\n",
                          addr6p[0], addr6p[1], addr6p[2], addr6p[3], addr6p[4], addr6p[5], addr6p[6], addr6p[7],
                          &if_idx, &plen, &scope, &dad_status, devname) != EOF) {
 
@@ -1273,9 +1283,8 @@
     return  if2.ifr_mtu;
 }
 
-static int getFlags(int sock, const char *ifname) {
+static int getFlags(int sock, const char *ifname, int *flags) {
   struct ifreq if2;
-  int ret = -1;
 
   memset((char *) &if2, 0, sizeof(if2));
   strcpy(if2.ifr_name, ifname);
@@ -1284,7 +1293,12 @@
       return -1;
   }
 
-  return if2.ifr_flags;
+  if (sizeof(if2.ifr_flags) == sizeof(short)) {
+      *flags = (if2.ifr_flags & 0xffff);
+  } else {
+      *flags = if2.ifr_flags;
+  }
+  return 0;
 }
 
 #endif
@@ -1658,7 +1672,7 @@
 }
 
 
-static int getFlags(int sock, const char *ifname) {
+static int getFlags(int sock, const char *ifname, int *flags) {
      struct   lifreq lifr;
      memset((caddr_t)&lifr, 0, sizeof(lifr));
      strcpy((caddr_t)&(lifr.lifr_name), ifname);
@@ -1667,7 +1681,8 @@
          return -1;
      }
 
-     return  lifr.lifr_flags;
+     *flags = lifr.lifr_flags;
+     return 0;
 }
 
 
@@ -1963,7 +1978,7 @@
     return  if2.ifr_mtu;
 }
 
-static int getFlags(int sock, const char *ifname) {
+static int getFlags(int sock, const char *ifname, int *flags) {
   struct ifreq if2;
   int ret = -1;
 
@@ -1974,7 +1989,12 @@
       return -1;
   }
 
-  return (((int) if2.ifr_flags) & 0xffff);
+  if (sizeof(if2.ifr_flags) == sizeof(short)) {
+    *flags = (if2.ifr_flags & 0xffff);
+  } else {
+    *flags = if2.ifr_flags;
+  }
+  return 0;
 }
 
 #endif
--- a/src/solaris/native/java/net/PlainDatagramSocketImpl.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/native/java/net/PlainDatagramSocketImpl.c	Fri Jun 21 19:11:42 2013 -0700
@@ -485,7 +485,7 @@
         fullPacket = (char *)malloc(packetBufferLen);
 
         if (!fullPacket) {
-            JNU_ThrowOutOfMemoryError(env, "heap allocation failed");
+            JNU_ThrowOutOfMemoryError(env, "Send buffer native heap allocation failed");
             return;
         } else {
             mallocedPacket = JNI_TRUE;
@@ -713,7 +713,7 @@
         fullPacket = (char *)malloc(packetBufferLen);
 
         if (!fullPacket) {
-            JNU_ThrowOutOfMemoryError(env, "heap allocation failed");
+            JNU_ThrowOutOfMemoryError(env, "Peek buffer native heap allocation failed");
             return -1;
         } else {
             mallocedPacket = JNI_TRUE;
@@ -873,7 +873,7 @@
         fullPacket = (char *)malloc(packetBufferLen);
 
         if (!fullPacket) {
-            JNU_ThrowOutOfMemoryError(env, "heap allocation failed");
+            JNU_ThrowOutOfMemoryError(env, "Receive buffer native heap allocation failed");
             return;
         } else {
             mallocedPacket = JNI_TRUE;
@@ -1336,19 +1336,18 @@
          * value is an InetAddress.
          */
 #ifdef AF_INET6
-#if defined(__solaris__) || defined(MACOSX)
+#ifdef __linux__
+        mcast_set_if_by_addr_v4(env, this, fd, value);
+        if (ipv6_available()) {
+            mcast_set_if_by_addr_v6(env, this, fd, value);
+        }
+#else  /* __linux__ not defined */
         if (ipv6_available()) {
             mcast_set_if_by_addr_v6(env, this, fd, value);
         } else {
             mcast_set_if_by_addr_v4(env, this, fd, value);
         }
-#endif
-#ifdef __linux__
-        mcast_set_if_by_addr_v4(env, this, fd, value);
-        if (ipv6_available()) {
-            mcast_set_if_by_addr_v6(env, this, fd, value);
-        }
-#endif
+#endif  /* __linux__ */
 #else
         mcast_set_if_by_addr_v4(env, this, fd, value);
 #endif  /* AF_INET6 */
@@ -1359,19 +1358,18 @@
          * value is a NetworkInterface.
          */
 #ifdef AF_INET6
-#if defined(__solaris__) || defined(MACOSX)
+#ifdef __linux__
+        mcast_set_if_by_if_v4(env, this, fd, value);
+        if (ipv6_available()) {
+            mcast_set_if_by_if_v6(env, this, fd, value);
+        }
+#else  /* __linux__ not defined */
         if (ipv6_available()) {
             mcast_set_if_by_if_v6(env, this, fd, value);
         } else {
             mcast_set_if_by_if_v4(env, this, fd, value);
         }
-#endif
-#ifdef __linux__
-        mcast_set_if_by_if_v4(env, this, fd, value);
-        if (ipv6_available()) {
-            mcast_set_if_by_if_v6(env, this, fd, value);
-        }
-#endif
+#endif  /* __linux__ */
 #else
         mcast_set_if_by_if_v4(env, this, fd, value);
 #endif  /* AF_INET6 */
@@ -1442,19 +1440,18 @@
 static void setMulticastLoopbackMode(JNIEnv *env, jobject this, int fd,
                                   jint opt, jobject value) {
 #ifdef AF_INET6
-#if defined(__solaris__) || defined(MACOSX)
+#ifdef __linux__
+    mcast_set_loop_v4(env, this, fd, value);
+    if (ipv6_available()) {
+        mcast_set_loop_v6(env, this, fd, value);
+    }
+#else  /* __linux__ not defined */
     if (ipv6_available()) {
         mcast_set_loop_v6(env, this, fd, value);
     } else {
         mcast_set_loop_v4(env, this, fd, value);
     }
-#endif
-#ifdef __linux__
-    mcast_set_loop_v4(env, this, fd, value);
-    if (ipv6_available()) {
-        mcast_set_loop_v6(env, this, fd, value);
-    }
-#endif
+#endif  /* __linux__ */
 #else
     mcast_set_loop_v4(env, this, fd, value);
 #endif  /* AF_INET6 */
@@ -2013,13 +2010,6 @@
     }
     /* setsockopt to be correct ttl */
 #ifdef AF_INET6
-#if defined(__solaris__) || defined(MACOSX)
-    if (ipv6_available()) {
-        setHopLimit(env, fd, ttl);
-    } else {
-        setTTL(env, fd, ttl);
-    }
-#endif
 #ifdef __linux__
     setTTL(env, fd, ttl);
     if (ipv6_available()) {
@@ -2028,7 +2018,13 @@
             (*env)->SetIntField(env, this, pdsi_ttlID, ttl);
         }
     }
-#endif  // __linux__
+#else  /*  __linux__ not defined */
+    if (ipv6_available()) {
+        setHopLimit(env, fd, ttl);
+    } else {
+        setTTL(env, fd, ttl);
+    }
+#endif  /* __linux__ */
 #else
     setTTL(env, fd, ttl);
 #endif  /* AF_INET6 */
--- a/src/solaris/native/java/net/net_util_md.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/native/java/net/net_util_md.c	Fri Jun 21 19:11:42 2013 -0700
@@ -1010,6 +1010,16 @@
     return (jboolean)(getaddrinfo_ptr != NULL);
 }
 
+int NET_IsZeroAddr(jbyte* caddr) {
+    int i;
+    for (i = 0; i < 16; i++) {
+        if (caddr[i] != 0) {
+            return 0;
+        }
+    }
+    return 1;
+}
+
 /*
  * Map the Java level socket option to the platform specific
  * level and option name.
--- a/src/solaris/native/sun/awt/fontpath.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/native/sun/awt/fontpath.c	Fri Jun 21 19:11:42 2013 -0700
@@ -589,9 +589,6 @@
 }
 
 #include <dlfcn.h>
-#if !(defined(__linux__) || defined(MACOSX))
-#include <link.h>
-#endif
 
 #include "fontconfig.h"
 
--- a/src/solaris/native/sun/awt/splashscreen/splashscreen_config.h	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/native/sun/awt/splashscreen/splashscreen_config.h	Fri Jun 21 19:11:42 2013 -0700
@@ -32,7 +32,7 @@
 #include <X11/Xutil.h>
 #include <X11/extensions/shape.h>
 #include <sys/types.h>
-#include <sys/unistd.h>
+#include <unistd.h>
 #include <pthread.h>
 #include <signal.h>
 #include <inttypes.h>
--- a/src/solaris/native/sun/java2d/opengl/OGLFuncs_md.h	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/native/sun/java2d/opengl/OGLFuncs_md.h	Fri Jun 21 19:11:42 2013 -0700
@@ -28,7 +28,7 @@
 
 #include <stdlib.h>
 #ifndef MACOSX
-#include <link.h>
+#include <dlfcn.h>
 #endif
 #include "jvm_md.h"
 #include "J2D_GL/glx.h"
--- a/src/solaris/native/sun/java2d/x11/X11SurfaceData.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/native/sun/java2d/x11/X11SurfaceData.c	Fri Jun 21 19:11:42 2013 -0700
@@ -572,6 +572,8 @@
         J2dRlsTraceLn1(J2D_TRACE_ERROR,
                        "X11SD_SetupSharedSegment shmget has failed: %s",
                        strerror(errno));
+        free((void *)shminfo);
+        XDestroyImage(img);
         return NULL;
     }
 
@@ -581,6 +583,8 @@
         J2dRlsTraceLn1(J2D_TRACE_ERROR,
                        "X11SD_SetupSharedSegment shmat has failed: %s",
                        strerror(errno));
+        free((void *)shminfo);
+        XDestroyImage(img);
         return NULL;
     }
 
@@ -601,6 +605,9 @@
         J2dRlsTraceLn1(J2D_TRACE_ERROR,
                        "X11SD_SetupSharedSegment XShmAttach has failed: %s",
                        strerror(errno));
+        shmdt(shminfo->shmaddr);
+        free((void *)shminfo);
+        XDestroyImage(img);
         return NULL;
     }
 
@@ -1494,13 +1501,10 @@
 #ifdef MITSHM
         if (image->obdata != NULL) {
             X11SD_DropSharedSegment((XShmSegmentInfo*)image->obdata);
-        } else {
-            free(image->data);
+            image->obdata = NULL;
         }
-#else
-        free(image->data);
 #endif /* MITSHM */
-        XFree(image);
+        XDestroyImage(image);
     }
 }
 
--- a/src/solaris/native/sun/java2d/x11/XRBackendNative.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/native/sun/java2d/x11/XRBackendNative.c	Fri Jun 21 19:11:42 2013 -0700
@@ -70,7 +70,6 @@
 
 #ifdef __solaris__
 /* Solaris 10 will not have these symbols at runtime */
-#include <link.h>
 
 typedef Picture (*XRenderCreateLinearGradientFuncType)
                                      (Display *dpy,
@@ -743,7 +742,12 @@
     for (i=0; i < glyphCnt; i++) {
       GlyphInfo *jginfo = (GlyphInfo *) jlong_to_ptr(glyphInfoPtrs[i]);
 
-      gid[i] = (Glyph) (0x0ffffffffL & ((unsigned long)(jginfo->cellInfo)));
+      // 'jginfo->cellInfo' is of type 'void*'
+      // (see definition of 'GlyphInfo' in fontscalerdefs.h)
+      // 'Glyph' is typedefed to 'unsigned long'
+      // (see http://www.x.org/releases/X11R7.7/doc/libXrender/libXrender.txt)
+      // Maybe we should assert that (sizeof(void*) == sizeof(Glyph)) ?
+      gid[i] = (Glyph) (jginfo->cellInfo);
       xginfo[i].x = (-jginfo->topLeftX);
       xginfo[i].y = (-jginfo->topLeftY);
       xginfo[i].width = jginfo->width;
--- a/src/solaris/native/sun/nio/ch/DatagramChannelImpl.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/native/sun/nio/ch/DatagramChannelImpl.c	Fri Jun 21 19:11:42 2013 -0700
@@ -72,7 +72,7 @@
 
 JNIEXPORT void JNICALL
 Java_sun_nio_ch_DatagramChannelImpl_disconnect0(JNIEnv *env, jobject this,
-                                                jobject fdo)
+                                                jobject fdo, jboolean isIPv6)
 {
     jint fd = fdval(env, fdo);
     int rv;
@@ -89,7 +89,7 @@
         memset(&sa, 0, sizeof(sa));
 
 #ifdef AF_INET6
-        if (ipv6_available()) {
+        if (isIPv6) {
             struct sockaddr_in6 *him6 = (struct sockaddr_in6 *)&sa;
 #if defined(_ALLBSD_SOURCE)
             him6->sin6_family = AF_INET6;
--- a/src/solaris/native/sun/nio/ch/DatagramDispatcher.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/native/sun/nio/ch/DatagramDispatcher.c	Fri Jun 21 19:11:42 2013 -0700
@@ -34,8 +34,10 @@
 #include <sys/types.h>
 #include <sys/uio.h>
 #include <sys/socket.h>
+#include <string.h>
 
 #include "nio_util.h"
+#include <limits.h>
 
 JNIEXPORT jint JNICALL
 Java_sun_nio_ch_DatagramDispatcher_read0(JNIEnv *env, jclass clazz,
@@ -60,23 +62,14 @@
     ssize_t result = 0;
     struct iovec *iov = (struct iovec *)jlong_to_ptr(address);
     struct msghdr m;
-    if (len > 16) {
-        len = 16;
+    if (len > IOV_MAX) {
+        len = IOV_MAX;
     }
 
-    m.msg_name = NULL;
-    m.msg_namelen = 0;
+    // initialize the message
+    memset(&m, 0, sizeof(m));
     m.msg_iov = iov;
     m.msg_iovlen = len;
-#ifdef __solaris__
-    m.msg_accrights = NULL;
-    m.msg_accrightslen = 0;
-#endif
-
-#if defined(__linux__) || defined(_ALLBSD_SOURCE)
-    m.msg_control = NULL;
-    m.msg_controllen = 0;
-#endif
 
     result = recvmsg(fd, &m, 0);
     if (result < 0 && errno == ECONNREFUSED) {
@@ -108,23 +101,14 @@
     struct iovec *iov = (struct iovec *)jlong_to_ptr(address);
     struct msghdr m;
     ssize_t result = 0;
-    if (len > 16) {
-        len = 16;
+    if (len > IOV_MAX) {
+        len = IOV_MAX;
     }
 
-    m.msg_name = NULL;
-    m.msg_namelen = 0;
+    // initialize the message
+    memset(&m, 0, sizeof(m));
     m.msg_iov = iov;
     m.msg_iovlen = len;
-#ifdef __solaris__
-    m.msg_accrights = NULL;
-    m.msg_accrightslen = 0;
-#endif
-
-#if defined(__linux__) || defined(_ALLBSD_SOURCE)
-    m.msg_control = NULL;
-    m.msg_controllen = 0;
-#endif
 
     result = sendmsg(fd, &m, 0);
     if (result < 0 && errno == ECONNREFUSED) {
--- a/src/solaris/native/sun/nio/ch/DevPollArrayWrapper.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/native/sun/nio/ch/DevPollArrayWrapper.c	Fri Jun 21 19:11:42 2013 -0700
@@ -28,9 +28,7 @@
 #include "jvm.h"
 #include "jlong.h"
 #include "sun_nio_ch_DevPollArrayWrapper.h"
-#include "java_lang_Integer.h"
 #include <sys/poll.h>
-#include <sys/resource.h>
 #include <unistd.h>
 #include <sys/time.h>
 
@@ -178,21 +176,6 @@
     return result;
 }
 
-JNIEXPORT jint JNICALL
-Java_sun_nio_ch_DevPollArrayWrapper_fdLimit(JNIEnv *env, jclass this)
-{
-    struct rlimit rlp;
-    if (getrlimit(RLIMIT_NOFILE, &rlp) < 0) {
-        JNU_ThrowIOExceptionWithLastError(env,
-                                          "getrlimit failed");
-    }
-    if (rlp.rlim_max < 0 || rlp.rlim_max > java_lang_Integer_MAX_VALUE) {
-        return java_lang_Integer_MAX_VALUE;
-    } else {
-        return (jint)rlp.rlim_max;
-    }
-}
-
 JNIEXPORT void JNICALL
 Java_sun_nio_ch_DevPollArrayWrapper_interrupt(JNIEnv *env, jclass this, jint fd)
 {
--- a/src/solaris/native/sun/nio/ch/EPollArrayWrapper.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/native/sun/nio/ch/EPollArrayWrapper.c	Fri Jun 21 19:11:42 2013 -0700
@@ -30,40 +30,9 @@
 
 #include "sun_nio_ch_EPollArrayWrapper.h"
 
-#include <dlfcn.h>
 #include <unistd.h>
-#include <sys/resource.h>
 #include <sys/time.h>
-
-#ifdef  __cplusplus
-extern "C" {
-#endif
-
-/* epoll_wait(2) man page */
-
-typedef union epoll_data {
-    void *ptr;
-    int fd;
-    __uint32_t u32;
-    __uint64_t u64;
-} epoll_data_t;
-
-
-/* x86-64 has same alignment as 32-bit */
-#ifdef __x86_64__
-#define EPOLL_PACKED __attribute__((packed))
-#else
-#define EPOLL_PACKED
-#endif
-
-struct epoll_event {
-    __uint32_t events;  /* Epoll events */
-    epoll_data_t data;  /* User data variable */
-} EPOLL_PACKED;
-
-#ifdef  __cplusplus
-}
-#endif
+#include <sys/epoll.h>
 
 #define RESTARTABLE(_cmd, _result) do { \
   do { \
@@ -71,18 +40,6 @@
   } while((_result == -1) && (errno == EINTR)); \
 } while(0)
 
-/*
- * epoll event notification is new in 2.6 kernel. As the offical build
- * platform for the JDK is on a 2.4-based distribution then we must
- * obtain the addresses of the epoll functions dynamically.
- */
-typedef int (*epoll_create_t)(int size);
-typedef int (*epoll_ctl_t)   (int epfd, int op, int fd, struct epoll_event *event);
-typedef int (*epoll_wait_t)  (int epfd, struct epoll_event *events, int maxevents, int timeout);
-
-static epoll_create_t epoll_create_func;
-static epoll_ctl_t    epoll_ctl_func;
-static epoll_wait_t   epoll_wait_func;
 
 static int
 iepoll(int epfd, struct epoll_event *events, int numfds, jlong timeout)
@@ -96,7 +53,7 @@
     start = t.tv_sec * 1000 + t.tv_usec / 1000;
 
     for (;;) {
-        int res = (*epoll_wait_func)(epfd, events, numfds, timeout);
+        int res = epoll_wait(epfd, events, numfds, timeout);
         if (res < 0 && errno == EINTR) {
             if (remaining >= 0) {
                 gettimeofday(&t, NULL);
@@ -117,14 +74,6 @@
 JNIEXPORT void JNICALL
 Java_sun_nio_ch_EPollArrayWrapper_init(JNIEnv *env, jclass this)
 {
-    epoll_create_func = (epoll_create_t) dlsym(RTLD_DEFAULT, "epoll_create");
-    epoll_ctl_func    = (epoll_ctl_t)    dlsym(RTLD_DEFAULT, "epoll_ctl");
-    epoll_wait_func   = (epoll_wait_t)   dlsym(RTLD_DEFAULT, "epoll_wait");
-
-    if ((epoll_create_func == NULL) || (epoll_ctl_func == NULL) ||
-        (epoll_wait_func == NULL)) {
-        JNU_ThrowInternalError(env, "unable to get address of epoll functions, pre-2.6 kernel?");
-    }
 }
 
 JNIEXPORT jint JNICALL
@@ -134,7 +83,7 @@
      * epoll_create expects a size as a hint to the kernel about how to
      * dimension internal structures. We can't predict the size in advance.
      */
-    int epfd = (*epoll_create_func)(256);
+    int epfd = epoll_create(256);
     if (epfd < 0) {
        JNU_ThrowIOExceptionWithLastError(env, "epoll_create failed");
     }
@@ -142,16 +91,6 @@
 }
 
 JNIEXPORT jint JNICALL
-Java_sun_nio_ch_EPollArrayWrapper_fdLimit(JNIEnv *env, jclass this)
-{
-    struct rlimit rlp;
-    if (getrlimit(RLIMIT_NOFILE, &rlp) < 0) {
-        JNU_ThrowIOExceptionWithLastError(env, "getrlimit failed");
-    }
-    return (jint)rlp.rlim_max;
-}
-
-JNIEXPORT jint JNICALL
 Java_sun_nio_ch_EPollArrayWrapper_sizeofEPollEvent(JNIEnv* env, jclass this)
 {
     return sizeof(struct epoll_event);
@@ -173,7 +112,7 @@
     event.events = events;
     event.data.fd = fd;
 
-    RESTARTABLE((*epoll_ctl_func)(epfd, (int)opcode, (int)fd, &event), res);
+    RESTARTABLE(epoll_ctl(epfd, (int)opcode, (int)fd, &event), res);
 
     /*
      * A channel may be registered with several Selectors. When each Selector
@@ -199,7 +138,7 @@
     int res;
 
     if (timeout <= 0) {           /* Indefinite or no wait */
-        RESTARTABLE((*epoll_wait_func)(epfd, events, numfds, timeout), res);
+        RESTARTABLE(epoll_wait(epfd, events, numfds, timeout), res);
     } else {                      /* Bounded wait; bounded restarts */
         res = iepoll(epfd, events, numfds, timeout);
     }
--- a/src/solaris/native/sun/nio/ch/FileDispatcherImpl.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/native/sun/nio/ch/FileDispatcherImpl.c	Fri Jun 21 19:11:42 2013 -0700
@@ -200,7 +200,7 @@
     }
     lockResult = fcntl(fd, cmd, &fl);
     if (lockResult < 0) {
-        if ((cmd == F_SETLK64) && (errno == EAGAIN))
+        if ((cmd == F_SETLK64) && (errno == EAGAIN || errno == EACCES))
             return sun_nio_ch_FileDispatcherImpl_NO_LOCK;
         if (errno == EINTR)
             return sun_nio_ch_FileDispatcherImpl_INTERRUPTED;
--- a/src/solaris/native/sun/nio/ch/IOUtil.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/native/sun/nio/ch/IOUtil.c	Fri Jun 21 19:11:42 2013 -0700
@@ -25,11 +25,14 @@
 
 #include <sys/types.h>
 #include <string.h>
+#include <sys/resource.h>
+
 #include "jni.h"
 #include "jni_util.h"
 #include "jvm.h"
 #include "jlong.h"
 #include "sun_nio_ch_IOUtil.h"
+#include "java_lang_Integer.h"
 #include "nio.h"
 #include "nio_util.h"
 
@@ -118,6 +121,20 @@
     }
 }
 
+JNIEXPORT jint JNICALL
+Java_sun_nio_ch_IOUtil_fdLimit(JNIEnv *env, jclass this)
+{
+    struct rlimit rlp;
+    if (getrlimit(RLIMIT_NOFILE, &rlp) < 0) {
+        JNU_ThrowIOExceptionWithLastError(env, "getrlimit failed");
+        return -1;
+    }
+    if (rlp.rlim_max < 0 || rlp.rlim_max > java_lang_Integer_MAX_VALUE) {
+        return java_lang_Integer_MAX_VALUE;
+    } else {
+        return (jint)rlp.rlim_max;
+    }
+}
 
 /* Declared in nio_util.h for use elsewhere in NIO */
 
--- a/src/solaris/native/sun/nio/ch/Net.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/native/sun/nio/ch/Net.c	Fri Jun 21 19:11:42 2013 -0700
@@ -39,83 +39,6 @@
 #include "nio_util.h"
 #include "nio.h"
 
-/**
- * Definitions for source-specific multicast to allow for building
- * with older header files.
- */
-
-#ifdef __solaris__
-
-#ifndef IP_BLOCK_SOURCE
-
-#define IP_BLOCK_SOURCE                 0x15
-#define IP_UNBLOCK_SOURCE               0x16
-#define IP_ADD_SOURCE_MEMBERSHIP        0x17
-#define IP_DROP_SOURCE_MEMBERSHIP       0x18
-
-#define MCAST_BLOCK_SOURCE              0x2b
-#define MCAST_UNBLOCK_SOURCE            0x2c
-#define MCAST_JOIN_SOURCE_GROUP         0x2d
-#define MCAST_LEAVE_SOURCE_GROUP        0x2e
-
-#endif  /* IP_BLOCK_SOURCE */
-
-struct my_ip_mreq_source {
-        struct in_addr  imr_multiaddr;
-        struct in_addr  imr_sourceaddr;
-        struct in_addr  imr_interface;
-};
-
-/*
- * Use #pragma pack() construct to force 32-bit alignment on amd64.
- */
-#if defined(amd64)
-#pragma pack(4)
-#endif
-
-struct my_group_source_req {
-        uint32_t                gsr_interface;  /* interface index */
-        struct sockaddr_storage gsr_group;      /* group address */
-        struct sockaddr_storage gsr_source;     /* source address */
-};
-
-#if defined(amd64)
-#pragma pack()
-#endif
-
-#endif  /* __solaris__ */
-
-
-#ifdef __linux__
-
-#ifndef IP_BLOCK_SOURCE
-
-#define IP_BLOCK_SOURCE                 38
-#define IP_UNBLOCK_SOURCE               37
-#define IP_ADD_SOURCE_MEMBERSHIP        39
-#define IP_DROP_SOURCE_MEMBERSHIP       40
-
-#define MCAST_BLOCK_SOURCE              43
-#define MCAST_UNBLOCK_SOURCE            44
-#define MCAST_JOIN_SOURCE_GROUP         42
-#define MCAST_LEAVE_SOURCE_GROUP        45
-
-#endif  /* IP_BLOCK_SOURCE */
-
-struct my_ip_mreq_source {
-        struct in_addr  imr_multiaddr;
-        struct in_addr  imr_interface;
-        struct in_addr  imr_sourceaddr;
-};
-
-struct my_group_source_req {
-        uint32_t                gsr_interface;  /* interface index */
-        struct sockaddr_storage gsr_group;      /* group address */
-        struct sockaddr_storage gsr_source;     /* source address */
-};
-
-#endif   /* __linux__ */
-
 #ifdef _ALLBSD_SOURCE
 
 #ifndef IP_BLOCK_SOURCE
@@ -155,7 +78,12 @@
         struct sockaddr_storage gsr_source;     /* source address */
 };
 
-#endif   /* _ALLBSD_SOURCE */
+#else   /* _ALLBSD_SOURCE */
+
+#define my_ip_mreq_source         ip_mreq_source
+#define my_group_source_req       group_source_req
+
+#endif
 
 
 #define COPY_INET6_ADDRESS(env, source, target) \
@@ -581,8 +509,8 @@
         optval = (void*)&mreq6;
         optlen = sizeof(mreq6);
     } else {
-#if defined (__linux__) || defined(MACOSX)
-        /* Include-mode filtering broken on Mac OS & Linux at least to 2.6.24 */
+#ifdef MACOSX
+        /* no IPv6 include-mode filtering for now */
         return IOS_UNAVAILABLE;
 #else
         initGroupSourceReq(env, group, index, source, &req);
--- a/src/solaris/native/sun/nio/ch/SolarisEventPort.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/native/sun/nio/ch/SolarisEventPort.c	Fri Jun 21 19:11:42 2013 -0700
@@ -32,17 +32,12 @@
 #include <stdlib.h>
 #include <dlfcn.h>
 #include <sys/types.h>
-#include <port.h>       // Solaris 10
+#include <port.h>
 
 #include "sun_nio_ch_SolarisEventPort.h"
 
-JNIEXPORT void JNICALL
-Java_sun_nio_ch_SolarisEventPort_init(JNIEnv *env, jclass clazz)
-{
-}
-
 JNIEXPORT jint JNICALL
-Java_sun_nio_ch_SolarisEventPort_portCreate
+Java_sun_nio_ch_SolarisEventPort_port_1create
     (JNIEnv* env, jclass clazz)
 {
     int port = port_create();
@@ -53,37 +48,44 @@
 }
 
 JNIEXPORT void JNICALL
-Java_sun_nio_ch_SolarisEventPort_portClose
+Java_sun_nio_ch_SolarisEventPort_port_1close
     (JNIEnv* env, jclass clazz, jint port)
 {
     int res;
     RESTARTABLE(close(port), res);
 }
 
-JNIEXPORT void JNICALL
-Java_sun_nio_ch_SolarisEventPort_portAssociate
+JNIEXPORT jboolean JNICALL
+Java_sun_nio_ch_SolarisEventPort_port_1associate
     (JNIEnv* env, jclass clazz, jint port, jint source, jlong objectAddress, jint events)
 {
     uintptr_t object = (uintptr_t)jlong_to_ptr(objectAddress);
+    if (port_associate((int)port, (int)source, object, (int)events, NULL) == 0) {
+        return JNI_TRUE;
+    } else {
+        if (errno != EBADFD)
+            JNU_ThrowIOExceptionWithLastError(env, "port_associate");
+        return JNI_FALSE;
+    }
+}
 
-    if (port_associate((int)port, (int)source, object, (int)events, NULL) == -1) {
-        JNU_ThrowIOExceptionWithLastError(env, "port_associate");
+JNIEXPORT jboolean JNICALL
+Java_sun_nio_ch_SolarisEventPort_port_1dissociate
+    (JNIEnv* env, jclass clazz, jint port, jint source, jlong objectAddress)
+{
+    uintptr_t object = (uintptr_t)jlong_to_ptr(objectAddress);
+
+    if (port_dissociate((int)port, (int)source, object) == 0) {
+        return JNI_TRUE;
+    } else {
+        if (errno != ENOENT)
+            JNU_ThrowIOExceptionWithLastError(env, "port_dissociate");
+        return JNI_FALSE;
     }
 }
 
 JNIEXPORT void JNICALL
-Java_sun_nio_ch_SolarisEventPort_portDissociate
-    (JNIEnv* env, jclass clazz, jint port, jint source, jlong objectAddress)
-{
-    uintptr_t object = (uintptr_t)jlong_to_ptr(objectAddress);
-
-    if (port_dissociate((int)port, (int)source, object) == -1) {
-        JNU_ThrowIOExceptionWithLastError(env, "port_dissociate");
-    }
-}
-
-JNIEXPORT void JNICALL
-Java_sun_nio_ch_SolarisEventPort_portSend(JNIEnv* env, jclass clazz,
+Java_sun_nio_ch_SolarisEventPort_port_1send(JNIEnv* env, jclass clazz,
     jint port, jint events)
 {
     if (port_send((int)port, (int)events, NULL) == -1) {
@@ -92,7 +94,7 @@
 }
 
 JNIEXPORT void JNICALL
-Java_sun_nio_ch_SolarisEventPort_portGet(JNIEnv* env, jclass clazz,
+Java_sun_nio_ch_SolarisEventPort_port_1get(JNIEnv* env, jclass clazz,
     jint port, jlong eventAddress)
 {
     int res;
@@ -105,16 +107,28 @@
 }
 
 JNIEXPORT jint JNICALL
-Java_sun_nio_ch_SolarisEventPort_portGetn(JNIEnv* env, jclass clazz,
-    jint port, jlong arrayAddress, jint max)
+Java_sun_nio_ch_SolarisEventPort_port_1getn(JNIEnv* env, jclass clazz,
+    jint port, jlong arrayAddress, jint max, jlong timeout)
 {
     int res;
     uint_t n = 1;
     port_event_t* list = (port_event_t*)jlong_to_ptr(arrayAddress);
+    timespec_t ts;
+    timespec_t* tsp;
 
-    RESTARTABLE(port_getn((int)port, list, (uint_t)max, &n, NULL), res);
+    if (timeout >= 0L) {
+        ts.tv_sec = timeout / 1000;
+        ts.tv_nsec = 1000000 * (timeout % 1000);
+        tsp = &ts;
+    } else {
+        tsp = NULL;
+    }
+
+    res = port_getn((int)port, list, (uint_t)max, &n, tsp);
     if (res == -1) {
-        JNU_ThrowIOExceptionWithLastError(env, "port_getn");
+        if (errno != ETIME && errno != EINTR)
+            JNU_ThrowIOExceptionWithLastError(env, "port_getn");
     }
+
     return (jint)n;
 }
--- a/src/solaris/native/sun/nio/fs/BsdNativeDispatcher.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/native/sun/nio/fs/BsdNativeDispatcher.c	Fri Jun 21 19:11:42 2013 -0700
@@ -46,8 +46,6 @@
 static jfieldID entry_dir;
 static jfieldID entry_fstype;
 static jfieldID entry_options;
-static jfieldID entry_dev;
-
 
 struct fsstat_iter {
     struct statfs *buf;
@@ -81,7 +79,6 @@
     entry_dir = (*env)->GetFieldID(env, clazz, "dir", "[B");
     entry_fstype = (*env)->GetFieldID(env, clazz, "fstype", "[B");
     entry_options = (*env)->GetFieldID(env, clazz, "opts", "[B");
-    entry_dev = (*env)->GetFieldID(env, clazz, "dev", "J");
 }
 
 JNIEXPORT jlong JNICALL
@@ -160,7 +157,6 @@
         options="ro";
     else
         options="";
-    dev = 0;
 
     iter->pos++;
 
@@ -192,9 +188,6 @@
     (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)options);
     (*env)->SetObjectField(env, entry, entry_options, bytes);
 
-    if (dev != 0)
-        (*env)->SetLongField(env, entry, entry_dev, (jlong)dev);
-
     return 0;
 }
 
@@ -208,3 +201,4 @@
         free(iter);
     }
 }
+
--- a/src/solaris/native/sun/nio/fs/GnomeFileTypeDetector.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/native/sun/nio/fs/GnomeFileTypeDetector.c	Fri Jun 21 19:11:42 2013 -0700
@@ -30,15 +30,12 @@
 
 #include <stdlib.h>
 #include <dlfcn.h>
-#ifndef __APPLE__
-#include <link.h>
-#endif
 
 #ifdef __solaris__
 #include <strings.h>
 #endif
 
-#if defined(__linux__) || defined(__APPLE__)
+#if defined(__linux__)
 #include <string.h>
 #endif
 
--- a/src/solaris/native/sun/nio/fs/LinuxNativeDispatcher.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/native/sun/nio/fs/LinuxNativeDispatcher.c	Fri Jun 21 19:11:42 2013 -0700
@@ -29,6 +29,7 @@
 #include "jlong.h"
 
 #include <stdio.h>
+#include <string.h>
 #include <dlfcn.h>
 #include <errno.h>
 #include <mntent.h>
@@ -45,6 +46,11 @@
 fremovexattr_func* my_fremovexattr_func = NULL;
 flistxattr_func* my_flistxattr_func = NULL;
 
+static jfieldID entry_name;
+static jfieldID entry_dir;
+static jfieldID entry_fstype;
+static jfieldID entry_options;
+
 static void throwUnixException(JNIEnv* env, int errnum) {
     jobject x = JNU_NewObjectByName(env, "sun/nio/fs/UnixException",
         "(I)V", errnum);
@@ -60,6 +66,15 @@
     my_fsetxattr_func = (fsetxattr_func*)dlsym(RTLD_DEFAULT, "fsetxattr");
     my_fremovexattr_func = (fremovexattr_func*)dlsym(RTLD_DEFAULT, "fremovexattr");
     my_flistxattr_func = (flistxattr_func*)dlsym(RTLD_DEFAULT, "flistxattr");
+
+    clazz = (*env)->FindClass(env, "sun/nio/fs/UnixMountEntry");
+    if (clazz == NULL)
+        return;
+
+    entry_name = (*env)->GetFieldID(env, clazz, "name", "[B");
+    entry_dir = (*env)->GetFieldID(env, clazz, "dir", "[B");
+    entry_fstype = (*env)->GetFieldID(env, clazz, "fstype", "[B");
+    entry_options = (*env)->GetFieldID(env, clazz, "opts", "[B");
 }
 
 JNIEXPORT jint JNICALL
@@ -151,6 +166,61 @@
     return ptr_to_jlong(fp);
 }
 
+JNIEXPORT jint JNICALL
+Java_sun_nio_fs_LinuxNativeDispatcher_getmntent(JNIEnv* env, jclass this,
+    jlong value, jobject entry)
+{
+    struct mntent ent;
+    char buf[1024];
+    int buflen = sizeof(buf);
+    struct mntent* m;
+    FILE* fp = jlong_to_ptr(value);
+    jsize len;
+    jbyteArray bytes;
+    char* name;
+    char* dir;
+    char* fstype;
+    char* options;
+
+    m = getmntent_r(fp, &ent, (char*)&buf, buflen);
+    if (m == NULL)
+        return -1;
+    name = m->mnt_fsname;
+    dir = m->mnt_dir;
+    fstype = m->mnt_type;
+    options = m->mnt_opts;
+
+    len = strlen(name);
+    bytes = (*env)->NewByteArray(env, len);
+    if (bytes == NULL)
+        return -1;
+    (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)name);
+    (*env)->SetObjectField(env, entry, entry_name, bytes);
+
+    len = strlen(dir);
+    bytes = (*env)->NewByteArray(env, len);
+    if (bytes == NULL)
+        return -1;
+    (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)dir);
+    (*env)->SetObjectField(env, entry, entry_dir, bytes);
+
+    len = strlen(fstype);
+    bytes = (*env)->NewByteArray(env, len);
+    if (bytes == NULL)
+        return -1;
+    (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)fstype);
+    (*env)->SetObjectField(env, entry, entry_fstype, bytes);
+
+    len = strlen(options);
+    bytes = (*env)->NewByteArray(env, len);
+    if (bytes == NULL)
+        return -1;
+    (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)options);
+    (*env)->SetObjectField(env, entry, entry_options, bytes);
+
+    return 0;
+}
+
 JNIEXPORT void JNICALL
 Java_sun_nio_fs_LinuxNativeDispatcher_endmntent(JNIEnv* env, jclass this, jlong stream)
 {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/solaris/native/sun/nio/fs/MacOSXNativeDispatcher.c	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * 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 "jni.h"
+#include "jni_util.h"
+#include "jvm.h"
+#include "jlong.h"
+
+#include <stdlib.h>
+#include <string.h>
+
+#include <CoreFoundation/CoreFoundation.h>
+
+JNIEXPORT jcharArray JNICALL
+Java_sun_nio_fs_MacOSXNativeDispatcher_normalizepath(JNIEnv* env, jclass this,
+                                                     jcharArray path,
+                                                     jint form)
+{
+    jcharArray result = NULL;
+    char chars_buf[(PATH_MAX + 1) * 2];     // utf16 + zero padding
+    CFMutableStringRef csref = CFStringCreateMutable(NULL, 0);
+    if (csref == NULL) {
+        JNU_ThrowOutOfMemoryError(env, "native heap");
+    } else {
+        char *chars = (char*)(*env)->GetPrimitiveArrayCritical(env, path, 0);
+        jsize len = (*env)->GetArrayLength(env, path);
+        CFStringAppendCharacters(csref, (const UniChar*)chars, len);
+        (*env)->ReleasePrimitiveArrayCritical(env, path, chars, 0);
+        CFStringNormalize(csref, form);
+        len = CFStringGetLength(csref);
+        if (len < PATH_MAX) {
+            if (CFStringGetCString(csref, chars_buf, sizeof(chars_buf), kCFStringEncodingUTF16)) {
+                result = (*env)->NewCharArray(env, len);
+                (*env)->SetCharArrayRegion(env, result, 0, len, (jchar*)&chars_buf);
+            }
+        } else {
+            int ulen = (len + 1) * 2;
+            chars = malloc(ulen);
+            if (chars == NULL) {
+                CFRelease(csref);
+                JNU_ThrowOutOfMemoryError(env, "native heap");
+                return result;
+            } else {
+                if (CFStringGetCString(csref, chars, ulen, kCFStringEncodingUTF16)) {
+                    result = (*env)->NewCharArray(env, len);
+                    (*env)->SetCharArrayRegion(env, result, 0, len, (jchar*)chars);
+                }
+                free(chars);
+            }
+        }
+        CFRelease(csref);
+    }
+    return result;
+}
--- a/src/solaris/native/sun/nio/fs/SolarisNativeDispatcher.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/native/sun/nio/fs/SolarisNativeDispatcher.c	Fri Jun 21 19:11:42 2013 -0700
@@ -28,12 +28,22 @@
 #include "jvm.h"
 #include "jlong.h"
 
-#include <dlfcn.h>
+#include <strings.h>
 #include <errno.h>
 #include <sys/acl.h>
+#include <sys/mnttab.h>
+#include <sys/mkdev.h>
+
+#include "jni.h"
 
 #include "sun_nio_fs_SolarisNativeDispatcher.h"
 
+static jfieldID entry_name;
+static jfieldID entry_dir;
+static jfieldID entry_fstype;
+static jfieldID entry_options;
+static jfieldID entry_dev;
+
 static void throwUnixException(JNIEnv* env, int errnum) {
     jobject x = JNU_NewObjectByName(env, "sun/nio/fs/UnixException",
         "(I)V", errnum);
@@ -44,6 +54,15 @@
 
 JNIEXPORT void JNICALL
 Java_sun_nio_fs_SolarisNativeDispatcher_init(JNIEnv *env, jclass clazz) {
+    clazz = (*env)->FindClass(env, "sun/nio/fs/UnixMountEntry");
+    if (clazz == NULL)
+        return;
+
+    entry_name = (*env)->GetFieldID(env, clazz, "name", "[B");
+    entry_dir = (*env)->GetFieldID(env, clazz, "dir", "[B");
+    entry_fstype = (*env)->GetFieldID(env, clazz, "fstype", "[B");
+    entry_options = (*env)->GetFieldID(env, clazz, "opts", "[B");
+    entry_dev = (*env)->GetFieldID(env, clazz, "dev", "J");
 }
 
 JNIEXPORT jint JNICALL
@@ -59,3 +78,63 @@
     }
     return (jint)n;
 }
+
+JNIEXPORT jint JNICALL
+Java_sun_nio_fs_SolarisNativeDispatcher_getextmntent(JNIEnv* env, jclass this,
+    jlong value, jobject entry)
+{
+    struct extmnttab ent;
+    FILE* fp = jlong_to_ptr(value);
+    jsize len;
+    jbyteArray bytes;
+    char* name;
+    char* dir;
+    char* fstype;
+    char* options;
+    dev_t dev;
+
+    if (getextmntent(fp, &ent, 0))
+        return -1;
+    name = ent.mnt_special;
+    dir = ent.mnt_mountp;
+    fstype = ent.mnt_fstype;
+    options = ent.mnt_mntopts;
+    dev = makedev(ent.mnt_major, ent.mnt_minor);
+    if (dev == NODEV) {
+        throwUnixException(env, errno);
+        return -1;
+    }
+
+    len = strlen(name);
+    bytes = (*env)->NewByteArray(env, len);
+    if (bytes == NULL)
+        return -1;
+    (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)name);
+    (*env)->SetObjectField(env, entry, entry_name, bytes);
+
+    len = strlen(dir);
+    bytes = (*env)->NewByteArray(env, len);
+    if (bytes == NULL)
+        return -1;
+    (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)dir);
+    (*env)->SetObjectField(env, entry, entry_dir, bytes);
+
+    len = strlen(fstype);
+    bytes = (*env)->NewByteArray(env, len);
+    if (bytes == NULL)
+        return -1;
+    (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)fstype);
+    (*env)->SetObjectField(env, entry, entry_fstype, bytes);
+
+    len = strlen(options);
+    bytes = (*env)->NewByteArray(env, len);
+    if (bytes == NULL)
+        return -1;
+    (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)options);
+    (*env)->SetObjectField(env, entry, entry_options, bytes);
+
+    if (dev != 0)
+        (*env)->SetLongField(env, entry, entry_dev, (jlong)dev);
+
+    return 0;
+}
--- a/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c	Fri Jun 21 19:11:42 2013 -0700
@@ -40,13 +40,10 @@
 
 #ifdef __solaris__
 #include <strings.h>
-#include <sys/mnttab.h>
-#include <sys/mkdev.h>
 #endif
 
 #ifdef __linux__
 #include <string.h>
-#include <mntent.h>
 #endif
 
 #ifdef _ALLBSD_SOURCE
@@ -1018,7 +1015,7 @@
 
         if (res != 0 || p == NULL || p->pw_name == NULL || *(p->pw_name) == '\0') {
             /* not found or error */
-            if (errno != 0 && errno != ENOENT)
+            if (errno != 0 && errno != ENOENT && errno != ESRCH)
                 throwUnixException(env, errno);
         } else {
             uid = p->pw_uid;
@@ -1064,7 +1061,7 @@
         retry = 0;
         if (res != 0 || g == NULL || g->gr_name == NULL || *(g->gr_name) == '\0') {
             /* not found or error */
-            if (errno != 0 && errno != ENOENT) {
+            if (errno != 0 && errno != ENOENT && errno != ESRCH) {
                 if (errno == ERANGE) {
                     /* insufficient buffer size so need larger buffer */
                     buflen += ENT_BUF_SIZE;
@@ -1083,105 +1080,3 @@
 
     return gid;
 }
-
-JNIEXPORT jint JNICALL
-Java_sun_nio_fs_UnixNativeDispatcher_getextmntent(JNIEnv* env, jclass this,
-    jlong value, jobject entry)
-{
-#ifdef __solaris__
-    struct extmnttab ent;
-#elif defined(_ALLBSD_SOURCE)
-    char buf[1024];
-    char *str;
-    char *last;
-#else
-    struct mntent ent;
-    char buf[1024];
-    int buflen = sizeof(buf);
-    struct mntent* m;
-#endif
-    FILE* fp = jlong_to_ptr(value);
-    jsize len;
-    jbyteArray bytes;
-    char* name;
-    char* dir;
-    char* fstype;
-    char* options;
-    dev_t dev;
-
-#ifdef __solaris__
-    if (getextmntent(fp, &ent, 0))
-        return -1;
-    name = ent.mnt_special;
-    dir = ent.mnt_mountp;
-    fstype = ent.mnt_fstype;
-    options = ent.mnt_mntopts;
-    dev = makedev(ent.mnt_major, ent.mnt_minor);
-    if (dev == NODEV) {
-        /* possible bug on Solaris 8 and 9 */
-        throwUnixException(env, errno);
-        return -1;
-    }
-#elif defined(_ALLBSD_SOURCE)
-again:
-    if (!(str = fgets(buf, sizeof(buf), fp)))
-        return -1;
-
-    name = strtok_r(str, " \t\n", &last);
-    if (name == NULL)
-        return -1;
-
-    // skip comments
-    if (*name == '#')
-        goto again;
-
-    dir = strtok_r((char *)NULL, " \t\n", &last);
-    fstype = strtok_r((char *)NULL, " \t\n", &last);
-    options = strtok_r((char *)NULL, " \t\n", &last);
-    if (options == NULL)
-        return -1;
-    dev = 0;
-#else
-    m = getmntent_r(fp, &ent, (char*)&buf, buflen);
-    if (m == NULL)
-        return -1;
-    name = m->mnt_fsname;
-    dir = m->mnt_dir;
-    fstype = m->mnt_type;
-    options = m->mnt_opts;
-    dev = 0;
-#endif
-
-    len = strlen(name);
-    bytes = (*env)->NewByteArray(env, len);
-    if (bytes == NULL)
-        return -1;
-    (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)name);
-    (*env)->SetObjectField(env, entry, entry_name, bytes);
-
-    len = strlen(dir);
-    bytes = (*env)->NewByteArray(env, len);
-    if (bytes == NULL)
-        return -1;
-    (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)dir);
-    (*env)->SetObjectField(env, entry, entry_dir, bytes);
-
-    len = strlen(fstype);
-    bytes = (*env)->NewByteArray(env, len);
-    if (bytes == NULL)
-        return -1;
-    (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)fstype);
-    (*env)->SetObjectField(env, entry, entry_fstype, bytes);
-
-    len = strlen(options);
-    bytes = (*env)->NewByteArray(env, len);
-    if (bytes == NULL)
-        return -1;
-    (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)options);
-    (*env)->SetObjectField(env, entry, entry_options, bytes);
-
-    if (dev != 0)
-        (*env)->SetLongField(env, entry, entry_dev, (jlong)dev);
-
-    return 0;
-}
--- a/src/solaris/native/sun/nio/fs/genSolarisConstants.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/native/sun/nio/fs/genSolarisConstants.c	Fri Jun 21 19:11:42 2013 -0700
@@ -27,7 +27,7 @@
 #include <errno.h>
 #include <unistd.h>
 #include <sys/acl.h>
-#include <sys/fcntl.h>
+#include <fcntl.h>
 #include <sys/stat.h>
 
 /**
--- a/src/solaris/native/sun/nio/fs/genUnixConstants.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/native/sun/nio/fs/genUnixConstants.c	Fri Jun 21 19:11:42 2013 -0700
@@ -26,7 +26,7 @@
 #include <stdio.h>
 #include <errno.h>
 #include <unistd.h>
-#include <sys/fcntl.h>
+#include <fcntl.h>
 #include <sys/stat.h>
 
 /**
@@ -69,7 +69,12 @@
 #else
     DEFX(O_DSYNC);
 #endif
+#ifdef O_NOFOLLOW
     DEFX(O_NOFOLLOW);
+#else
+    // not supported (dummy values will not be used at runtime).
+    emitX("O_NOFOLLOW", 0x0);
+#endif
 
     // mode masks
     emitX("S_IAMB",
--- a/src/solaris/native/sun/security/jgss/wrapper/NativeFunc.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/native/sun/security/jgss/wrapper/NativeFunc.c	Fri Jun 21 19:11:42 2013 -0700
@@ -26,9 +26,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <dlfcn.h>
-#ifndef __APPLE__
-#include <link.h>
-#endif
 #include "NativeFunc.h"
 
 /* standard GSS method names (ordering is from mapfile) */
--- a/src/solaris/native/sun/security/pkcs11/j2secmod_md.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/native/sun/security/pkcs11/j2secmod_md.c	Fri Jun 21 19:11:42 2013 -0700
@@ -28,9 +28,6 @@
 #include <string.h>
 
 #include <dlfcn.h>
-#ifndef __APPLE__
-#include <link.h>
-#endif
 
 #include <jni_util.h>
 
--- a/src/solaris/native/sun/security/pkcs11/wrapper/p11_md.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/native/sun/security/pkcs11/wrapper/p11_md.c	Fri Jun 21 19:11:42 2013 -0700
@@ -64,9 +64,6 @@
 #include <assert.h>
 
 #include <dlfcn.h>
-#ifndef __APPLE__
-#include <link.h>
-#endif
 
 #include <jni.h>
 
--- a/src/solaris/native/sun/security/smartcardio/pcsc_md.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/native/sun/security/smartcardio/pcsc_md.c	Fri Jun 21 19:11:42 2013 -0700
@@ -29,9 +29,6 @@
 #include <assert.h>
 
 #include <dlfcn.h>
-#ifndef __APPLE__
-#include <link.h>
-#endif
 
 #include <winscard.h>
 
--- a/src/solaris/native/sun/xawt/XlibWrapper.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/native/sun/xawt/XlibWrapper.c	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -1261,13 +1261,15 @@
 
 JavaVM* jvm = NULL;
 static int ToolkitErrorHandler(Display * dpy, XErrorEvent * event) {
+    JNIEnv * env;
     if (jvm != NULL) {
-        JNIEnv * env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
-        return JNU_CallStaticMethodByName(env, NULL, "sun/awt/X11/XToolkit", "globalErrorHandler", "(JJ)I",
-                                          ptr_to_jlong(dpy), ptr_to_jlong(event)).i;
-    } else {
-        return 0;
+        env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
+        if (env) {
+            return JNU_CallStaticMethodByName(env, NULL, "sun/awt/X11/XToolkit", "globalErrorHandler", "(JJ)I",
+                                              ptr_to_jlong(dpy), ptr_to_jlong(event)).i;
+        }
     }
+    return 0;
 }
 
 /*
@@ -1945,13 +1947,16 @@
 JNIEXPORT jboolean JNICALL
 Java_sun_awt_X11_XlibWrapper_XNextSecondaryLoopEvent(JNIEnv *env, jclass clazz,
                                                      jlong display, jlong ptr) {
+    uint32_t timeout = 1;
+
     AWT_CHECK_HAVE_LOCK();
     exitSecondaryLoop = False;
     while (!exitSecondaryLoop) {
         if (XCheckIfEvent((Display*) jlong_to_ptr(display), (XEvent*) jlong_to_ptr(ptr), secondary_loop_event, NULL)) {
             return JNI_TRUE;
         }
-        AWT_WAIT(AWT_SECONDARY_LOOP_TIMEOUT);
+        timeout = (timeout < AWT_SECONDARY_LOOP_TIMEOUT) ? (timeout << 1) : AWT_SECONDARY_LOOP_TIMEOUT;
+        AWT_WAIT(timeout);
     }
     return JNI_FALSE;
 }
--- a/src/solaris/npt/npt_md.h	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/npt/npt_md.h	Fri Jun 21 19:11:42 2013 -0700
@@ -32,21 +32,18 @@
 #include <string.h>
 #include <errno.h>
 #include <dlfcn.h>
-#ifndef __APPLE__
-#include <link.h>
-#endif
 #include <jvm_md.h>
 
 #define NPT_LIBNAME "npt"
 
-#define NPT_INITIALIZE(pnpt,version,options)                            \
+#define NPT_INITIALIZE(path,pnpt,version,options)                       \
     {                                                                   \
         void   *_handle;                                                \
         void   *_sym;                                                   \
                                                                         \
         if ( (pnpt) == NULL ) NPT_ERROR("NptEnv* is NULL");             \
         *(pnpt) = NULL;                                                 \
-        _handle =  dlopen(JNI_LIB_NAME(NPT_LIBNAME), RTLD_LAZY);              \
+        _handle =  dlopen(path, RTLD_LAZY);                             \
         if ( _handle == NULL ) NPT_ERROR("Cannot open library");        \
         _sym = dlsym(_handle, "nptInitialize");                         \
         if ( _sym == NULL ) NPT_ERROR("Cannot find nptInitialize");     \
--- a/src/solaris/transport/socket/socket_md.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/solaris/transport/socket/socket_md.c	Fri Jun 21 19:11:42 2013 -0700
@@ -35,8 +35,7 @@
 #include <sys/time.h>
 #ifdef __solaris__
 #include <thread.h>
-#endif
-#if defined(__linux__) || defined(_ALLBSD_SOURCE)
+#else
 #include <pthread.h>
 #include <sys/poll.h>
 #endif
@@ -306,9 +305,7 @@
     return r;
 }
 
-#endif
-
-#if defined(__linux__) || defined(_ALLBSD_SOURCE)
+#else
 int
 dbgsysTlsAlloc() {
     pthread_key_t key;
--- a/src/windows/back/linker_md.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/windows/back/linker_md.c	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -32,11 +32,42 @@
 #include <stdio.h>
 #include <string.h>
 #include <errno.h>
+#include <io.h>
 
 #include "sys.h"
 
 #include "path_md.h"
 
+static void dll_build_name(char* buffer, size_t buflen,
+                           const char* pname, const char* fname) {
+    // Based on os_windows.cpp
+
+    char *path_sep = PATH_SEPARATOR;
+    char *pathname = (char *)pname;
+    while (strlen(pathname) > 0) {
+        char *p = strchr(pathname, *path_sep);
+        if (p == NULL) {
+            p = pathname + strlen(pathname);
+        }
+        /* check for NULL path */
+        if (p == pathname) {
+            continue;
+        }
+        if (*(p-1) == ':' || *(p-1) == '\\') {
+            (void)_snprintf(buffer, buflen, "%.*s%s.dll", (p - pathname),
+                            pathname, fname);
+        } else {
+            (void)_snprintf(buffer, buflen, "%.*s\\%s.dll", (p - pathname),
+                            pathname, fname);
+        }
+        if (_access(buffer, 0) == 0) {
+            break;
+        }
+        pathname = p + 1;
+        *buffer = '\0';
+    }
+}
+
 /*
  * From system_md.c v1.54
  */
@@ -80,20 +111,17 @@
 dbgsysBuildLibName(char *holder, int holderlen, char *pname, char *fname)
 {
     const int pnamelen = pname ? (int)strlen(pname) : 0;
-    const char c = (pnamelen > 0) ? pname[pnamelen-1] : 0;
 
+    *holder = '\0';
     /* Quietly truncates on buffer overflow. Should be an error. */
     if (pnamelen + (int)strlen(fname) + 10 > holderlen) {
-        *holder = '\0';
         return;
     }
 
     if (pnamelen == 0) {
         sprintf(holder, "%s.dll", fname);
-    } else if (c == ':' || c == '\\') {
-        sprintf(holder, "%s%s.dll", pname, fname);
     } else {
-        sprintf(holder, "%s\\%s.dll", pname, fname);
+      dll_build_name(holder, holderlen, pname, fname);
     }
 }
 
--- a/src/windows/bin/cmdtoargs.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/windows/bin/cmdtoargs.c	Fri Jun 21 19:11:42 2013 -0700
@@ -128,7 +128,9 @@
                 *wildcard = JNI_TRUE;
             }
             if (prev == '\\') {
-                *dest++ = prev;
+                for (i = 0 ; i < slashes ; i++) {
+                    *dest++ = prev;
+                }
             }
             *dest++ = ch;
             break;
@@ -184,7 +186,7 @@
         argv = (StdArg*) JLI_MemRealloc(argv, (nargs+1) * sizeof(StdArg));
         argv[nargs].arg = JLI_StringDup(arg);
         argv[nargs].has_wildcard = wildcard;
-
+        *arg = NULL;
         nargs++;
     } while (src != NULL);
 
@@ -602,6 +604,14 @@
     v->add("d", FALSE);
     vectors[i++] = v;
 
+    v= new Vector(argv[0], "\\\\?");
+    v->add("\\\\?", TRUE);
+    vectors[i++] = v;
+
+    v= new Vector(argv[0], "\\\\*");
+    v->add("\\\\*", TRUE);
+    vectors[i++] = v;
+
     dotest(vectors);
     printf("All tests pass [%d]\n", i);
     doexit(0);
--- a/src/windows/classes/java/lang/Terminator.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/windows/classes/java/lang/Terminator.java	Fri Jun 21 19:11:42 2013 -0700
@@ -53,13 +53,17 @@
             }
         };
         handler = sh;
+
+        // When -Xrs is specified the user is responsible for
+        // ensuring that shutdown hooks are run by calling
+        // System.exit()
         try {
             Signal.handle(new Signal("INT"), sh);
+        } catch (IllegalArgumentException e) {
+        }
+        try {
             Signal.handle(new Signal("TERM"), sh);
         } catch (IllegalArgumentException e) {
-            // When -Xrs is specified the user is responsible for
-            // ensuring that shutdown hooks are run by calling
-            // System.exit()
         }
     }
 
--- a/src/windows/classes/sun/awt/shell/Win32ShellFolder2.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/windows/classes/sun/awt/shell/Win32ShellFolder2.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1099,7 +1099,7 @@
                                     ? SwingConstants.CENTER
                                     : SwingConstants.LEADING);
 
-                            column.setComparator(new ColumnComparator(getIShellFolder(), i));
+                            column.setComparator(new ColumnComparator(Win32ShellFolder2.this, i));
 
                             notNullColumns.add(column);
                         }
@@ -1135,7 +1135,7 @@
         // synchronize the whole code of the sort method once
         invoke(new Callable<Void>() {
             public Void call() {
-                Collections.sort(files, new ColumnComparator(getIShellFolder(), 0));
+                Collections.sort(files, new ColumnComparator(Win32ShellFolder2.this, 0));
 
                 return null;
             }
@@ -1143,12 +1143,12 @@
     }
 
     private static class ColumnComparator implements Comparator<File> {
-        private final long parentIShellFolder;
+        private final Win32ShellFolder2 shellFolder;
 
         private final int columnIdx;
 
-        public ColumnComparator(long parentIShellFolder, int columnIdx) {
-            this.parentIShellFolder = parentIShellFolder;
+        public ColumnComparator(Win32ShellFolder2 shellFolder, int columnIdx) {
+            this.shellFolder = shellFolder;
             this.columnIdx = columnIdx;
         }
 
@@ -1159,7 +1159,7 @@
                     if (o instanceof Win32ShellFolder2
                         && o1 instanceof Win32ShellFolder2) {
                         // delegates comparison to native method
-                        return compareIDsByColumn(parentIShellFolder,
+                        return compareIDsByColumn(shellFolder.getIShellFolder(),
                             ((Win32ShellFolder2) o).getRelativePIDL(),
                             ((Win32ShellFolder2) o1).getRelativePIDL(),
                             columnIdx);
--- a/src/windows/classes/sun/awt/windows/WDesktopPeer.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/windows/classes/sun/awt/windows/WDesktopPeer.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -51,15 +51,15 @@
     }
 
     public void open(File file) throws IOException {
-        this.ShellExecute(file.toURI(), ACTION_OPEN_VERB);
+        this.ShellExecute(file, ACTION_OPEN_VERB);
     }
 
     public void edit(File file) throws IOException {
-        this.ShellExecute(file.toURI(), ACTION_EDIT_VERB);
+        this.ShellExecute(file, ACTION_EDIT_VERB);
     }
 
     public void print(File file) throws IOException {
-        this.ShellExecute(file.toURI(), ACTION_PRINT_VERB);
+        this.ShellExecute(file, ACTION_PRINT_VERB);
     }
 
     public void mail(URI uri) throws IOException {
@@ -70,6 +70,13 @@
         this.ShellExecute(uri, ACTION_OPEN_VERB);
     }
 
+    private void ShellExecute(File file, String verb) throws IOException {
+        String errMsg = ShellExecute(file.getAbsolutePath(), verb);
+        if (errMsg != null) {
+            throw new IOException("Failed to " + verb + " " + file + ". Error message: " + errMsg);
+        }
+    }
+
     private void ShellExecute(URI uri, String verb) throws IOException {
         String errmsg = ShellExecute(uri.toString(), verb);
 
@@ -79,6 +86,6 @@
         }
     }
 
-    private static native String ShellExecute(String uri, String verb);
+    private static native String ShellExecute(String fileOrUri, String verb);
 
 }
--- a/src/windows/classes/sun/awt/windows/WKeyboardFocusManagerPeer.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/windows/classes/sun/awt/windows/WKeyboardFocusManagerPeer.java	Fri Jun 21 19:11:42 2013 -0700
@@ -25,7 +25,6 @@
 
 package sun.awt.windows;
 
-import java.awt.KeyboardFocusManager;
 import java.awt.Window;
 import java.awt.Component;
 import java.awt.peer.ComponentPeer;
@@ -37,8 +36,13 @@
     static native Component getNativeFocusOwner();
     static native Window getNativeFocusedWindow();
 
-    WKeyboardFocusManagerPeer(KeyboardFocusManager manager) {
-        super(manager);
+    private static final WKeyboardFocusManagerPeer inst = new WKeyboardFocusManagerPeer();
+
+    public static WKeyboardFocusManagerPeer getInstance() {
+        return inst;
+    }
+
+    private WKeyboardFocusManagerPeer() {
     }
 
     @Override
@@ -52,6 +56,12 @@
     }
 
     @Override
+    public void setCurrentFocusedWindow(Window win) {
+        // Not used on Windows
+        throw new RuntimeException("not implemented");
+    }
+
+    @Override
     public Window getCurrentFocusedWindow() {
         return getNativeFocusedWindow();
     }
--- a/src/windows/classes/sun/awt/windows/WPathGraphics.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/windows/classes/sun/awt/windows/WPathGraphics.java	Fri Jun 21 19:11:42 2013 -0700
@@ -549,6 +549,8 @@
                 userx += xAdvance;
                 userpos.x += xAdvance;
                 deviceTransform.transform(userpos, devpos);
+                devx = devpos.x;
+                devy = devpos.y;
             }
         } else {
             super.drawString(str, x, y, font, frc, targetW);
--- a/src/windows/classes/sun/awt/windows/WToolkit.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/windows/classes/sun/awt/windows/WToolkit.java	Fri Jun 21 19:11:42 2013 -0700
@@ -500,10 +500,10 @@
         return true;
     }
 
-    public KeyboardFocusManagerPeer createKeyboardFocusManagerPeer(KeyboardFocusManager manager)
+    public KeyboardFocusManagerPeer getKeyboardFocusManagerPeer()
       throws HeadlessException
     {
-        return new WKeyboardFocusManagerPeer(manager);
+        return WKeyboardFocusManagerPeer.getInstance();
     }
 
     protected native void setDynamicLayoutNative(boolean b);
--- a/src/windows/classes/sun/java2d/ScreenUpdateManager.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/windows/classes/sun/java2d/ScreenUpdateManager.java	Fri Jun 21 19:11:42 2013 -0700
@@ -110,6 +110,11 @@
     public SurfaceData getReplacementScreenSurface(WComponentPeer peer,
                                                    SurfaceData oldsd)
     {
+        SurfaceData surfaceData = peer.getSurfaceData();
+        if (surfaceData == null || surfaceData.isValid()) {
+            return surfaceData;
+        }
+        peer.replaceSurfaceData();
         return peer.getSurfaceData();
     }
 
--- a/src/windows/classes/sun/java2d/d3d/D3DSurfaceData.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/windows/classes/sun/java2d/d3d/D3DSurfaceData.java	Fri Jun 21 19:11:42 2013 -0700
@@ -486,7 +486,7 @@
             int dataType = 0;
             int scanStride = width;
 
-            if (dcm.getPixelSize() == 24 || dcm.getPixelSize() == 32) {
+            if (dcm.getPixelSize() > 16) {
                 dataType = DataBuffer.TYPE_INT;
             } else {
                 // 15, 16
--- a/src/windows/classes/sun/net/www/protocol/http/ntlm/NTLMAuthentication.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/windows/classes/sun/net/www/protocol/http/ntlm/NTLMAuthentication.java	Fri Jun 21 19:11:42 2013 -0700
@@ -194,12 +194,12 @@
             }
             String response = "NTLM " + seq.getAuthHeader (raw.length()>6?raw.substring(5):null);
             conn.setAuthenticationProperty(getHeaderName(), response);
-            if (seq.isComplete()) { // 7200720
+            if (seq.isComplete()) {
                 conn.authObj(null);
             }
             return true;
         } catch (IOException e) {
-            conn.authObj(null); // MMM 7200720 ??
+            conn.authObj(null);
             return false;
         }
     }
--- a/src/windows/classes/sun/net/www/protocol/jar/JarFileFactory.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/windows/classes/sun/net/www/protocol/jar/JarFileFactory.java	Fri Jun 21 19:11:42 2013 -0700
@@ -43,13 +43,24 @@
 class JarFileFactory implements URLJarFile.URLJarFileCloseController {
 
     /* the url to file cache */
-    private static HashMap<String, JarFile> fileCache = new HashMap<String, JarFile>();
+    private static final HashMap<String, JarFile> fileCache = new HashMap<>();
 
     /* the file to url cache */
-    private static HashMap<JarFile, URL> urlCache = new HashMap<JarFile, URL>();
+    private static final HashMap<JarFile, URL> urlCache = new HashMap<>();
+
+    private static final JarFileFactory instance = new JarFileFactory();
+
+    private JarFileFactory() { }
+
+    public static JarFileFactory getInstance() {
+        return instance;
+    }
 
     URLConnection getConnection(JarFile jarFile) throws IOException {
-        URL u = urlCache.get(jarFile);
+        URL u;
+        synchronized (instance) {
+            u = urlCache.get(jarFile);
+        }
         if (u != null)
             return u.openConnection();
 
@@ -72,16 +83,16 @@
             }
         }
 
-        JarFile result = null;
-        JarFile local_result = null;
+        JarFile result;
+        JarFile local_result;
 
         if (useCaches) {
-            synchronized (this) {
+            synchronized (instance) {
                 result = getCachedJarFile(url);
             }
             if (result == null) {
                 local_result = URLJarFile.getJarFile(url, this);
-                synchronized (this) {
+                synchronized (instance) {
                     result = getCachedJarFile(url);
                     if (result == null) {
                         fileCache.put(URLUtil.urlNoFragString(url), local_result);
@@ -109,13 +120,15 @@
      * remove the JarFile from the cache
      */
     public void close(JarFile jarFile) {
-        URL urlRemoved = urlCache.remove(jarFile);
-        if( urlRemoved != null) {
+        synchronized (instance) {
+            URL urlRemoved = urlCache.remove(jarFile);
+            if (urlRemoved != null)
                 fileCache.remove(URLUtil.urlNoFragString(urlRemoved));
         }
     }
 
     private JarFile getCachedJarFile(URL url) {
+        assert Thread.holdsLock(instance);
         JarFile result = fileCache.get(URLUtil.urlNoFragString(url));
 
         /* if the JAR file is cached, the permission will always be there */
--- a/src/windows/classes/sun/nio/ch/FileDispatcherImpl.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/windows/classes/sun/nio/ch/FileDispatcherImpl.java	Fri Jun 21 19:11:42 2013 -0700
@@ -49,18 +49,21 @@
         this(false);
     }
 
+    @Override
+    boolean needsPositionLock() {
+        return true;
+    }
+
     int read(FileDescriptor fd, long address, int len)
         throws IOException
     {
         return read0(fd, address, len);
     }
 
-    int pread(FileDescriptor fd, long address, int len,
-                             long position, Object lock) throws IOException
+    int pread(FileDescriptor fd, long address, int len, long position)
+        throws IOException
     {
-        synchronized(lock) {
-            return pread0(fd, address, len, position);
-        }
+        return pread0(fd, address, len, position);
     }
 
     long readv(FileDescriptor fd, long address, int len) throws IOException {
@@ -71,12 +74,10 @@
         return write0(fd, address, len, append);
     }
 
-    int pwrite(FileDescriptor fd, long address, int len,
-                             long position, Object lock) throws IOException
+    int pwrite(FileDescriptor fd, long address, int len, long position)
+        throws IOException
     {
-        synchronized(lock) {
-            return pwrite0(fd, address, len, position);
-        }
+        return pwrite0(fd, address, len, position);
     }
 
     long writev(FileDescriptor fd, long address, int len) throws IOException {
--- a/src/windows/classes/sun/nio/ch/WindowsSelectorImpl.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/windows/classes/sun/nio/ch/WindowsSelectorImpl.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -35,6 +35,7 @@
 import java.nio.channels.Pipe;
 import java.nio.channels.SelectableChannel;
 import java.io.IOException;
+import java.nio.channels.CancelledKeyException;
 import java.util.List;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -561,17 +562,19 @@
     protected void implDereg(SelectionKeyImpl ski) throws IOException{
         int i = ski.getIndex();
         assert (i >= 0);
-        if (i != totalChannels - 1) {
-            // Copy end one over it
-            SelectionKeyImpl endChannel = channelArray[totalChannels-1];
-            channelArray[i] = endChannel;
-            endChannel.setIndex(i);
-            pollWrapper.replaceEntry(pollWrapper, totalChannels - 1,
+        synchronized (closeLock) {
+            if (i != totalChannels - 1) {
+                // Copy end one over it
+                SelectionKeyImpl endChannel = channelArray[totalChannels-1];
+                channelArray[i] = endChannel;
+                endChannel.setIndex(i);
+                pollWrapper.replaceEntry(pollWrapper, totalChannels - 1,
                                                                 pollWrapper, i);
+            }
+            ski.setIndex(-1);
         }
         channelArray[totalChannels - 1] = null;
         totalChannels--;
-        ski.setIndex(-1);
         if ( totalChannels != 1 && totalChannels % MAX_SELECTABLE_FDS == 1) {
             totalChannels--;
             threadsCount--; // The last thread has become redundant.
@@ -589,7 +592,11 @@
         synchronized (closeLock) {
             if (pollWrapper == null)
                 throw new ClosedSelectorException();
-            pollWrapper.putEventOps(sk.getIndex(), ops);
+            // make sure this sk has not been removed yet
+            int index = sk.getIndex();
+            if (index == -1)
+                throw new CancelledKeyException();
+            pollWrapper.putEventOps(index, ops);
         }
     }
 
--- a/src/windows/classes/sun/nio/fs/WindowsChannelFactory.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/windows/classes/sun/nio/fs/WindowsChannelFactory.java	Fri Jun 21 19:11:42 2013 -0700
@@ -157,7 +157,7 @@
             throw new IllegalArgumentException("APPEND + TRUNCATE_EXISTING not allowed");
 
         FileDescriptor fdObj = open(pathForWindows, pathToCheck, flags, pSecurityDescriptor);
-        return FileChannelImpl.open(fdObj, flags.read, flags.write, flags.append, null);
+        return FileChannelImpl.open(fdObj, pathForWindows, flags.read, flags.write, flags.append, null);
     }
 
     /**
--- a/src/windows/classes/sun/nio/fs/WindowsConstants.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/windows/classes/sun/nio/fs/WindowsConstants.java	Fri Jun 21 19:11:42 2013 -0700
@@ -181,6 +181,11 @@
     public static final int FILE_READ_ATTRIBUTES        = 0x0080;
     public static final int FILE_WRITE_ATTRIBUTES       = 0x0100;
 
+    public static final int FILE_GENERIC_READ           = 0x00120089;
+    public static final int FILE_GENERIC_WRITE          = 0x00120116;
+    public static final int FILE_GENERIC_EXECUTE        = 0x001200a0;
+    public static final int FILE_ALL_ACCESS             = 0x001f01ff;
+
     // operating system security
     public static final int TOKEN_DUPLICATE             = 0x0002;
     public static final int TOKEN_IMPERSONATE           = 0x0004;
--- a/src/windows/classes/sun/nio/fs/WindowsFileCopy.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/windows/classes/sun/nio/fs/WindowsFileCopy.java	Fri Jun 21 19:11:42 2013 -0700
@@ -224,7 +224,7 @@
                 String linkTarget = WindowsLinkSupport.readLink(source);
                 int flags = SYMBOLIC_LINK_FLAG_DIRECTORY;
                 CreateSymbolicLink(targetPath,
-                                   addPrefixIfNeeded(linkTarget),
+                                   WindowsPath.addPrefixIfNeeded(linkTarget),
                                    flags);
             }
         } catch (WindowsException x) {
@@ -414,7 +414,7 @@
             } else {
                 String linkTarget = WindowsLinkSupport.readLink(source);
                 CreateSymbolicLink(targetPath,
-                                   addPrefixIfNeeded(linkTarget),
+                                   WindowsPath.addPrefixIfNeeded(linkTarget),
                                    SYMBOLIC_LINK_FLAG_DIRECTORY);
             }
         } catch (WindowsException x) {
@@ -502,18 +502,4 @@
             priv.drop();
         }
     }
-
-    /**
-     * Add long path prefix to path if required
-     */
-    private static String addPrefixIfNeeded(String path) {
-        if (path.length() > 248) {
-            if (path.startsWith("\\\\")) {
-                path = "\\\\?\\UNC" + path.substring(1, path.length());
-            } else {
-                path = "\\\\?\\" + path;
-            }
-        }
-        return path;
-    }
 }
--- a/src/windows/classes/sun/nio/fs/WindowsFileSystemProvider.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/windows/classes/sun/nio/fs/WindowsFileSystemProvider.java	Fri Jun 21 19:11:42 2013 -0700
@@ -38,6 +38,7 @@
 import sun.security.util.SecurityConstants;
 
 import static sun.nio.fs.WindowsNativeDispatcher.*;
+import static sun.nio.fs.WindowsSecurity.*;
 import static sun.nio.fs.WindowsConstants.*;
 
 public class WindowsFileSystemProvider
@@ -289,82 +290,59 @@
     }
 
     /**
-     * Returns buffer with SID_AND_ATTRIBUTES structure representing the user
-     * associated with the current thread access token.
-     * FIXME - this should be cached.
+     * Checks the file security against desired access.
      */
-    private static NativeBuffer getUserInfo(WindowsPath file) throws IOException {
+    private static boolean hasDesiredAccess(WindowsPath file, int rights) throws IOException {
+        // read security descriptor containing ACL (symlinks are followed)
+        boolean hasRights = false;
+        String target = WindowsLinkSupport.getFinalPath(file, true);
+        NativeBuffer aclBuffer = WindowsAclFileAttributeView
+            .getFileSecurity(target,
+                DACL_SECURITY_INFORMATION
+                | OWNER_SECURITY_INFORMATION
+                | GROUP_SECURITY_INFORMATION);
         try {
-            long hToken = WindowsSecurity.processTokenWithQueryAccess;
-            int size = GetTokenInformation(hToken, TokenUser, 0L, 0);
-            assert size > 0;
-
-            NativeBuffer buffer = NativeBuffers.getNativeBuffer(size);
-            try {
-                int newsize = GetTokenInformation(hToken, TokenUser,
-                                                  buffer.address(), size);
-                if (newsize != size)
-                    throw new AssertionError();
-                return buffer;
-            } catch (WindowsException x) {
-                buffer.release();
-                throw x;
-            }
-        } catch (WindowsException x) {
-            throw new IOException(x.getMessage());
+            hasRights = checkAccessMask(aclBuffer.address(), rights,
+                FILE_GENERIC_READ,
+                FILE_GENERIC_WRITE,
+                FILE_GENERIC_EXECUTE,
+                FILE_ALL_ACCESS);
+        } catch (WindowsException exc) {
+            exc.rethrowAsIOException(file);
+        } finally {
+            aclBuffer.release();
         }
+        return hasRights;
     }
 
     /**
-     * Reads the file ACL and return the effective access as ACCESS_MASK
+     * Checks if the given file(or directory) exists and is readable.
      */
-    private static int getEffectiveAccess(WindowsPath file) throws IOException {
-        // read security descriptor continaing ACL (symlinks are followed)
-        String target = WindowsLinkSupport.getFinalPath(file, true);
-        NativeBuffer aclBuffer = WindowsAclFileAttributeView
-            .getFileSecurity(target, DACL_SECURITY_INFORMATION);
-
-        // retrieves DACL from security descriptor
-        long pAcl = GetSecurityDescriptorDacl(aclBuffer.address());
-
-        // Use GetEffectiveRightsFromAcl to get effective access to file
+    private void checkReadAccess(WindowsPath file) throws IOException {
         try {
-            NativeBuffer userBuffer = getUserInfo(file);
+            Set<OpenOption> opts = Collections.emptySet();
+            FileChannel fc = WindowsChannelFactory
+                .newFileChannel(file.getPathForWin32Calls(),
+                                file.getPathForPermissionCheck(),
+                                opts,
+                                0L);
+            fc.close();
+        } catch (WindowsException exc) {
+            // Windows errors are very inconsistent when the file is a directory
+            // (ERROR_PATH_NOT_FOUND returned for root directories for example)
+            // so we retry by attempting to open it as a directory.
             try {
-                try {
-                    // SID_AND_ATTRIBUTES->pSid
-                    long pSid = unsafe.getAddress(userBuffer.address());
-                    long pTrustee = BuildTrusteeWithSid(pSid);
-                    try {
-                        return GetEffectiveRightsFromAcl(pAcl, pTrustee);
-                    } finally {
-                        LocalFree(pTrustee);
-                    }
-                } catch (WindowsException x) {
-                    throw new IOException("Unable to get effective rights from ACL: " +
-                        x.getMessage());
-                }
-            } finally {
-                userBuffer.release();
+                new WindowsDirectoryStream(file, null).close();
+            } catch (IOException ioe) {
+                // translate and throw original exception
+                exc.rethrowAsIOException(file);
             }
-        } finally {
-            aclBuffer.release();
         }
     }
 
     @Override
     public void checkAccess(Path obj, AccessMode... modes) throws IOException {
         WindowsPath file = WindowsPath.toWindowsPath(obj);
-        // if no access modes then simply file attributes
-        if (modes.length == 0) {
-            file.checkRead();
-            try {
-                WindowsFileAttributes.get(file, true);
-            } catch (WindowsException exc) {
-                exc.rethrowAsIOException(file);
-            }
-            return;
-        }
 
         boolean r = false;
         boolean w = false;
@@ -378,6 +356,13 @@
             }
         }
 
+        // special-case read access to avoid needing to determine effective
+        // access to file; default if modes not specified
+        if (!w && !x) {
+            checkReadAccess(file);
+            return;
+        }
+
         int mask = 0;
         if (r) {
             file.checkRead();
@@ -394,10 +379,10 @@
             mask |= FILE_EXECUTE;
         }
 
-        if ((getEffectiveAccess(file) & mask) == 0)
+        if (!hasDesiredAccess(file, mask))
             throw new AccessDeniedException(
                 file.getPathForExceptionMessage(), null,
-                "Effective permissions does not allow requested access");
+                "Permissions does not allow requested access");
 
         // for write access we neeed to check if the DOS readonly attribute
         // and if the volume is read-only
@@ -416,7 +401,6 @@
                 throw new AccessDeniedException(
                     file.getPathForExceptionMessage(), null, "Read-only file system");
             }
-            return;
         }
     }
 
--- a/src/windows/classes/sun/nio/fs/WindowsLinkSupport.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/windows/classes/sun/nio/fs/WindowsLinkSupport.java	Fri Jun 21 19:11:42 2013 -0700
@@ -231,7 +231,7 @@
             int end = (next == -1) ? path.length() : next;
             String search = sb.toString() + path.substring(curr, end);
             try {
-                FirstFile fileData = FindFirstFile(addLongPathPrefixIfNeeded(search));
+                FirstFile fileData = FindFirstFile(WindowsPath.addPrefixIfNeeded(search));
                 FindClose(fileData.handle());
 
                 // if a reparse point is encountered then we must return the
@@ -406,20 +406,6 @@
     }
 
     /**
-     * Add long path prefix to path if required.
-     */
-    private static String addLongPathPrefixIfNeeded(String path) {
-        if (path.length() > 248) {
-            if (path.startsWith("\\\\")) {
-                path = "\\\\?\\UNC" + path.substring(1, path.length());
-            } else {
-                path = "\\\\?\\" + path;
-            }
-        }
-        return path;
-    }
-
-    /**
      * Strip long path or symbolic link prefix from path
      */
     private static String stripPrefix(String path) {
--- a/src/windows/classes/sun/nio/fs/WindowsNativeDispatcher.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/windows/classes/sun/nio/fs/WindowsNativeDispatcher.java	Fri Jun 21 19:11:42 2013 -0700
@@ -844,6 +844,23 @@
     static native void AdjustTokenPrivileges(long token, long luid, int attributes)
         throws WindowsException;
 
+
+    /**
+     * AccessCheck(
+     *   PSECURITY_DESCRIPTOR pSecurityDescriptor,
+     *   HANDLE ClientToken,
+     *   DWORD DesiredAccess,
+     *   PGENERIC_MAPPING GenericMapping,
+     *   PPRIVILEGE_SET PrivilegeSet,
+     *   LPDWORD PrivilegeSetLength,
+     *   LPDWORD GrantedAccess,
+     *   LPBOOL AccessStatus
+     * )
+     */
+    static native boolean AccessCheck(long token, long securityInfo, int accessMask,
+        int genericRead, int genericWrite, int genericExecute, int genericAll)
+        throws WindowsException;
+
     /**
      */
     static long LookupPrivilegeValue(String name) throws WindowsException {
@@ -858,28 +875,6 @@
         throws WindowsException;
 
     /**
-     * BuildTrusteeWithSid(
-     *   PTRUSTEE pTrustee,
-     *   PSID pSid
-     * )
-     *
-     * @return  pTrustee
-     */
-    static native long BuildTrusteeWithSid(long pSid);
-
-    /**
-     * GetEffectiveRightsFromAcl(
-     *   PACL pacl,
-     *   PTRUSTEE pTrustee,
-     *   PACCESS_MASK pAccessRights
-     * )
-     *
-     * @return  AccessRights
-     */
-    static native int GetEffectiveRightsFromAcl(long pAcl, long pTrustee)
-        throws WindowsException;
-
-    /**
      * CreateSymbolicLink(
      *   LPCWSTR lpSymlinkFileName,
      *   LPCWSTR lpTargetFileName,
--- a/src/windows/classes/sun/nio/fs/WindowsPath.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/windows/classes/sun/nio/fs/WindowsPath.java	Fri Jun 21 19:11:42 2013 -0700
@@ -283,7 +283,7 @@
 
     // Add long path prefix to path if required
     static String addPrefixIfNeeded(String path) {
-        if (path.length() > 248) {
+        if (path.length() > MAX_PATH) {
             if (path.startsWith("\\\\")) {
                 path = "\\\\?\\UNC" + path.substring(1, path.length());
             } else {
--- a/src/windows/classes/sun/nio/fs/WindowsSecurity.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/windows/classes/sun/nio/fs/WindowsSecurity.java	Fri Jun 21 19:11:42 2013 -0700
@@ -105,19 +105,46 @@
         return new Privilege() {
             @Override
             public void drop() {
-                try {
-                    if (stopImpersontating) {
-                        SetThreadToken(0L, 0L);
-                    } else {
-                        if (needToRevert) {
+                if (token != 0L) {
+                    try {
+                        if (stopImpersontating)
+                            SetThreadToken(0L, 0L);
+                        else if (needToRevert)
                             AdjustTokenPrivileges(token, pLuid, 0);
-                        }
+                    } catch (WindowsException x) {
+                        // should not happen
+                        throw new AssertionError(x);
+                    } finally {
+                        CloseHandle(token);
                     }
-                } catch (WindowsException x) {
-                    // should not happen
-                    throw new AssertionError(x);
                 }
             }
         };
     }
+
+    /**
+     * Check the access right against the securityInfo in the current thread.
+     */
+    static boolean checkAccessMask(long securityInfo, int accessMask,
+        int genericRead, int genericWrite, int genericExecute, int genericAll)
+        throws WindowsException
+    {
+        int privilegies = TOKEN_QUERY;
+        long hToken = OpenThreadToken(GetCurrentThread(), privilegies, false);
+        if (hToken == 0L && processTokenWithDuplicateAccess != 0L)
+            hToken = DuplicateTokenEx(processTokenWithDuplicateAccess,
+                privilegies);
+
+        boolean hasRight = false;
+        if (hToken != 0L) {
+            try {
+                hasRight = AccessCheck(hToken, securityInfo, accessMask,
+                    genericRead, genericWrite, genericExecute, genericAll);
+            } finally {
+                CloseHandle(hToken);
+            }
+        }
+        return hasRight;
+    }
+
 }
--- a/src/windows/classes/sun/security/krb5/internal/tools/Ktab.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/windows/classes/sun/security/krb5/internal/tools/Ktab.java	Fri Jun 21 19:11:42 2013 -0700
@@ -80,42 +80,24 @@
         } else {
             ktab.processArgs(args);
         }
-        try {
+        ktab.table = KeyTab.getInstance(ktab.name);
+        if (ktab.table.isMissing() && ktab.action != 'a') {
             if (ktab.name == null) {
-                //  ktab.admin = new KeyTabAdmin();    // use the default keytab.
-                ktab.table = KeyTab.getInstance();
-                if (ktab.table == null) {
-                    if (ktab.action == 'a') {
-                        ktab.table = KeyTab.create();
-                    } else {
-                        System.out.println("No default key table exists.");
-                        System.exit(-1);
-                    }
-                }
+                System.out.println("No default key table exists.");
             } else {
-                if ((ktab.action != 'a') &&
-                    !(new File(ktab.name)).exists()) {
-                    System.out.println("Key table " +
-                                ktab.name + " does not exist.");
-                    System.exit(-1);
-                } else {
-                    ktab.table = KeyTab.getInstance(ktab.name);
-                }
-                if (ktab.table == null) {
-                    if (ktab.action == 'a') {
-                        ktab.table = KeyTab.create(ktab.name);
-                    } else {
-                        System.out.println("The format of key table " +
-                                ktab.name + " is incorrect.");
-                        System.exit(-1);
-                    }
-                }
+                System.out.println("Key table " +
+                        ktab.name + " does not exist.");
             }
-        } catch (RealmException e) {
-            System.err.println("Error loading key table.");
             System.exit(-1);
-        } catch (IOException e) {
-            System.err.println("Error loading key table.");
+        }
+        if (!ktab.table.isValid()) {
+            if (ktab.name == null) {
+                System.out.println("The format of the default key table " +
+                        " is incorrect.");
+            } else {
+                System.out.println("The format of key table " +
+                        ktab.name + " is incorrect.");
+            }
             System.exit(-1);
         }
         switch (ktab.action) {
--- a/src/windows/demo/jvmti/hprof/hprof_md.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/windows/demo/jvmti/hprof/hprof_md.c	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, 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
@@ -367,28 +367,53 @@
     return 0;
 }
 
+static void dll_build_name(char* buffer, size_t buflen,
+                           const char* pname, const char* fname) {
+    // Loosley based on os_windows.cpp
+
+    char *pathname = (char *)pname;
+    while (strlen(pathname) > 0) {
+        char *p = strchr(pathname, ';');
+        if (p == NULL) {
+            p = pathname + strlen(pathname);
+        }
+        /* check for NULL path */
+        if (p == pathname) {
+            continue;
+        }
+        if (*(p-1) == ':' || *(p-1) == '\\') {
+            (void)_snprintf(buffer, buflen, "%.*s%s.dll", (p - pathname),
+                            pathname, fname);
+        } else {
+            (void)_snprintf(buffer, buflen, "%.*s\\%s.dll", (p - pathname),
+                            pathname, fname);
+        }
+        if (_access(buffer, 0) == 0) {
+            break;
+        }
+        pathname = p + 1;
+        *buffer = '\0';
+    }
+}
+
 /* Build a machine dependent library name out of a path and file name.  */
 void
 md_build_library_name(char *holder, int holderlen, char *pname, char *fname)
 {
     int   pnamelen;
-    char  c;
 
     pnamelen = pname ? (int)strlen(pname) : 0;
-    c = (pnamelen > 0) ? pname[pnamelen-1] : 0;
 
+    *holder = '\0';
     /* Quietly truncates on buffer overflow. Should be an error. */
     if (pnamelen + strlen(fname) + 10 > (unsigned int)holderlen) {
-        *holder = '\0';
         return;
     }
 
     if (pnamelen == 0) {
         sprintf(holder, "%s.dll", fname);
-    } else if (c == ':' || c == '\\') {
-        sprintf(holder, "%s%s.dll", pname, fname);
     } else {
-        sprintf(holder, "%s\\%s.dll", pname, fname);
+      dll_build_name(holder, holderlen, pname, fname);
     }
 }
 
--- a/src/windows/lib/content-types.properties	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/windows/lib/content-types.properties	Fri Jun 21 19:11:42 2013 -0700
@@ -222,6 +222,10 @@
 	icon=png;\
 	action=browser
 
+image/bmp: \
+	description=Bitmap Image;\
+	file_extensions=.bmp;
+
 text/html: \
 	description=HTML Document;\
 	file_extensions=.htm,.html;\
--- a/src/windows/native/java/io/WinNTFileSystem_md.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/windows/native/java/io/WinNTFileSystem_md.c	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -36,9 +36,7 @@
 #include <windows.h>
 #include <io.h>
 
-#include "jvm.h"
 #include "jni.h"
-#include "jni_util.h"
 #include "io_util.h"
 #include "jlong.h"
 #include "io_util_md.h"
@@ -115,13 +113,15 @@
         DWORD len = (*GetFinalPathNameByHandle_func)(h, result, MAX_PATH, 0);
         if (len >= MAX_PATH) {
             /* retry with a buffer of the right size */
-            result = (WCHAR*)realloc(result, (len+1) * sizeof(WCHAR));
-            if (result != NULL) {
+            WCHAR* newResult = (WCHAR*)realloc(result, (len+1) * sizeof(WCHAR));
+            if (newResult != NULL) {
+                result = newResult;
                 len = (*GetFinalPathNameByHandle_func)(h, result, len, 0);
             } else {
                 len = 0;
             }
         }
+
         if (len > 0) {
             /**
              * Strip prefix (should be \\?\ or \\?\UNC)
@@ -199,7 +199,7 @@
 
 /**
  * If the given attributes are the attributes of a reparse point, then
- * read and return the attributes of the final target.
+ * read and return the attributes of the special cases.
  */
 DWORD getFinalAttributesIfReparsePoint(WCHAR *path, DWORD a)
 {
@@ -213,6 +213,28 @@
     return a;
 }
 
+/**
+ * Take special cases into account when retrieving the attributes
+ * of path
+ */
+DWORD getFinalAttributes(WCHAR *path)
+{
+    DWORD attr = INVALID_FILE_ATTRIBUTES;
+
+    WIN32_FILE_ATTRIBUTE_DATA wfad;
+    WIN32_FIND_DATAW wfd;
+    HANDLE h;
+
+    if (GetFileAttributesExW(path, GetFileExInfoStandard, &wfad)) {
+        attr = getFinalAttributesIfReparsePoint(path, wfad.dwFileAttributes);
+    } else if (GetLastError() == ERROR_SHARING_VIOLATION &&
+               (h = FindFirstFileW(path, &wfd)) != INVALID_HANDLE_VALUE) {
+        attr = getFinalAttributesIfReparsePoint(path, wfd.dwFileAttributes);
+        FindClose(h);
+    }
+    return attr;
+}
+
 JNIEXPORT jstring JNICALL
 Java_java_io_WinNTFileSystem_canonicalize0(JNIEnv *env, jobject this,
                                            jstring pathname)
@@ -337,38 +359,21 @@
 Java_java_io_WinNTFileSystem_getBooleanAttributes(JNIEnv *env, jobject this,
                                                   jobject file)
 {
-
     jint rv = 0;
     jint pathlen;
 
-    /* both pagefile.sys and hiberfil.sys have length 12 */
-#define SPECIALFILE_NAMELEN 12
-
     WCHAR *pathbuf = fileToNTPath(env, file, ids.path);
-    WIN32_FILE_ATTRIBUTE_DATA wfad;
     if (pathbuf == NULL)
         return rv;
     if (!isReservedDeviceNameW(pathbuf)) {
-        if (GetFileAttributesExW(pathbuf, GetFileExInfoStandard, &wfad)) {
-            DWORD a = getFinalAttributesIfReparsePoint(pathbuf, wfad.dwFileAttributes);
-            if (a != INVALID_FILE_ATTRIBUTES) {
-                rv = (java_io_FileSystem_BA_EXISTS
-                    | ((a & FILE_ATTRIBUTE_DIRECTORY)
-                        ? java_io_FileSystem_BA_DIRECTORY
-                        : java_io_FileSystem_BA_REGULAR)
-                    | ((a & FILE_ATTRIBUTE_HIDDEN)
-                        ? java_io_FileSystem_BA_HIDDEN : 0));
-            }
-        } else { /* pagefile.sys is a special case */
-            if (GetLastError() == ERROR_SHARING_VIOLATION) {
-                rv = java_io_FileSystem_BA_EXISTS;
-                if ((pathlen = (jint)wcslen(pathbuf)) >= SPECIALFILE_NAMELEN &&
-                    (_wcsicmp(pathbuf + pathlen - SPECIALFILE_NAMELEN,
-                              L"pagefile.sys") == 0) ||
-                    (_wcsicmp(pathbuf + pathlen - SPECIALFILE_NAMELEN,
-                              L"hiberfil.sys") == 0))
-                  rv |= java_io_FileSystem_BA_REGULAR;
-            }
+        DWORD a = getFinalAttributes(pathbuf);
+        if (a != INVALID_FILE_ATTRIBUTES) {
+            rv = (java_io_FileSystem_BA_EXISTS
+                | ((a & FILE_ATTRIBUTE_DIRECTORY)
+                    ? java_io_FileSystem_BA_DIRECTORY
+                    : java_io_FileSystem_BA_REGULAR)
+                | ((a & FILE_ATTRIBUTE_HIDDEN)
+                    ? java_io_FileSystem_BA_HIDDEN : 0));
         }
     }
     free(pathbuf);
@@ -536,6 +541,10 @@
     WCHAR *pathbuf = pathToNTPath(env, path, JNI_FALSE);
     if (pathbuf == NULL)
         return JNI_FALSE;
+    if (isReservedDeviceNameW(pathbuf)) {
+        free(pathbuf);
+        return JNI_FALSE;
+    }
     h = CreateFileW(
         pathbuf,                              /* Wide char path name */
         GENERIC_READ | GENERIC_WRITE,         /* Read and write permission */
--- a/src/windows/native/java/net/DualStackPlainDatagramSocketImpl.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/windows/native/java/net/DualStackPlainDatagramSocketImpl.c	Fri Jun 21 19:11:42 2013 -0700
@@ -89,6 +89,7 @@
     rv = setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, (char *) &opt, sizeof(opt));
     if (rv == SOCKET_ERROR) {
         NET_ThrowNew(env, WSAGetLastError(), "Socket creation failed");
+        closesocket(fd);
         return -1;
     }
 
@@ -264,7 +265,7 @@
         }
         fullPacket = (char *)malloc(packetBufferLen);
         if (!fullPacket) {
-            JNU_ThrowOutOfMemoryError(env, "heap allocation failed");
+            JNU_ThrowOutOfMemoryError(env, "Native heap allocation failed");
             return -1;
         }
     } else {
@@ -426,7 +427,7 @@
         }
         fullPacket = (char *)malloc(length);
         if (!fullPacket) {
-            JNU_ThrowOutOfMemoryError(env, "heap allocation failed");
+            JNU_ThrowOutOfMemoryError(env, "Native heap allocation failed");
             return;
         }
     } else {
--- a/src/windows/native/java/net/Inet6AddressImpl.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/windows/native/java/net/Inet6AddressImpl.c	Fri Jun 21 19:11:42 2013 -0700
@@ -191,7 +191,7 @@
                 struct addrinfo *next
                     = (struct addrinfo*) malloc(sizeof(struct addrinfo));
                 if (!next) {
-                    JNU_ThrowOutOfMemoryError(env, "heap allocation failed");
+                    JNU_ThrowOutOfMemoryError(env, "Native heap allocation failed");
                     ret = NULL;
                     goto cleanupAndReturn;
                 }
--- a/src/windows/native/java/net/NetworkInterface.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/windows/native/java/net/NetworkInterface.c	Fri Jun 21 19:11:42 2013 -0700
@@ -177,7 +177,7 @@
     int count;
     netif *netifP;
     DWORD i;
-    int lo=0, eth=0, tr=0, fddi=0, ppp=0, sl=0, net=0;
+    int lo=0, eth=0, tr=0, fddi=0, ppp=0, sl=0, net=0, wlen=0;
 
     /*
      * Ask the IP Helper library to enumerate the adapters
@@ -255,8 +255,17 @@
          */
         curr = (netif *)calloc(1, sizeof(netif));
         if (curr != NULL) {
+            wlen = MultiByteToWideChar(CP_OEMCP, 0, ifrowP->bDescr,
+                       ifrowP->dwDescrLen, NULL, 0);
+            if(wlen == 0) {
+                // MultiByteToWideChar should not fail
+                // But in rare case it fails, we allow 'char' to be displayed
+                curr->displayName = (char *)malloc(ifrowP->dwDescrLen + 1);
+            } else {
+                curr->displayName = (wchar_t *)malloc(wlen*(sizeof(wchar_t))+1);
+            }
+
             curr->name = (char *)malloc(strlen(dev_name) + 1);
-            curr->displayName = (char *)malloc(ifrowP->dwDescrLen + 1);
 
             if (curr->name == NULL || curr->displayName == NULL) {
                 if (curr->name) free(curr->name);
@@ -265,7 +274,7 @@
             }
         }
         if (curr == NULL) {
-            JNU_ThrowOutOfMemoryError(env, "heap allocation failure");
+            JNU_ThrowOutOfMemoryError(env, "Native heap allocation failure");
             free_netif(netifP);
             free(tableP);
             return -1;
@@ -277,8 +286,29 @@
          * 32-bit numbers as index values.
          */
         strcpy(curr->name, dev_name);
-        strncpy(curr->displayName, ifrowP->bDescr, ifrowP->dwDescrLen);
-        curr->displayName[ifrowP->dwDescrLen] = '\0';
+        if (wlen == 0) {
+            // display char type in case of MultiByteToWideChar failure
+            strncpy(curr->displayName, ifrowP->bDescr, ifrowP->dwDescrLen);
+            curr->displayName[ifrowP->dwDescrLen] = '\0';
+        } else {
+            // call MultiByteToWideChar again to fill curr->displayName
+            // it should not fail, because we have called it once before
+            if (MultiByteToWideChar(CP_OEMCP, 0, ifrowP->bDescr,
+                   ifrowP->dwDescrLen, curr->displayName, wlen) == 0) {
+                JNU_ThrowByName(env, "java/lang/Error",
+                       "Cannot get multibyte char for interface display name");
+                free_netif(netifP);
+                free(tableP);
+                free(curr->name);
+                free(curr->displayName);
+                free(curr);
+                return -1;
+            } else {
+                curr->displayName[wlen*(sizeof(wchar_t))] = '\0';
+                curr->dNameIsUnicode = TRUE;
+            }
+        }
+
         curr->dwIndex = ifrowP->dwIndex;
         curr->ifType = ifrowP->dwType;
         curr->index = GetFriendlyIfIndex(ifrowP->dwIndex);
@@ -365,7 +395,7 @@
 
             netaddr *curr = (netaddr *)malloc(sizeof(netaddr));
             if (curr == NULL) {
-                JNU_ThrowOutOfMemoryError(env, "heap allocation failure");
+                JNU_ThrowOutOfMemoryError(env, "Native heap allocation failure");
                 free_netaddr(netaddrP);
                 free(tableP);
                 return -1;
@@ -502,8 +532,7 @@
      */
     if (netaddrCount < 0) {
         netaddrCount = enumAddresses_win(env, ifs, &netaddrP);
-        if ((*env)->ExceptionOccurred(env)) {
-            free_netaddr(netaddrP);
+        if (netaddrCount == -1) {
             return NULL;
         }
     }
--- a/src/windows/native/java/net/NetworkInterface_winXP.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/windows/native/java/net/NetworkInterface_winXP.c	Fri Jun 21 19:11:42 2013 -0700
@@ -195,8 +195,7 @@
     while (curr != NULL) {
         netaddr *netaddrP;
         ret = enumAddresses_win(env, curr, &netaddrP);
-        if ((*env)->ExceptionOccurred(env)) {
-            free_netaddr(netaddrP);
+        if (ret == -1) {
             return -1;
         }
         curr->addrs = netaddrP;
@@ -450,8 +449,7 @@
      */
     if (netaddrCount < 0) {
         netaddrCount = enumAddresses_win(env, ifs, &netaddrP);
-        if ((*env)->ExceptionOccurred(env)) {
-            free_netaddr(netaddrP);
+        if (netaddrCount == -1) {
             return NULL;
         }
     }
--- a/src/windows/native/java/net/TwoStacksPlainDatagramSocketImpl.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/windows/native/java/net/TwoStacksPlainDatagramSocketImpl.c	Fri Jun 21 19:11:42 2013 -0700
@@ -243,7 +243,7 @@
                                 addrList = curr;
                             }
                             LeaveCriticalSection(&sizeCheckLock);
-                            JNU_ThrowOutOfMemoryError(env, "heap allocation failed");
+                            JNU_ThrowOutOfMemoryError(env, "Native heap allocation failed");
                             return JNI_TRUE;
                         }
                         curr->addr = htonl((*addrp)->S_un.S_addr);
@@ -741,7 +741,7 @@
          */
         fullPacket = (char *)malloc(packetBufferLen);
         if (!fullPacket) {
-            JNU_ThrowOutOfMemoryError(env, "heap allocation failed");
+            JNU_ThrowOutOfMemoryError(env, "Send buf native heap allocation failed");
             return;
         }
     } else {
@@ -1003,7 +1003,7 @@
          */
         fullPacket = (char *)malloc(packetBufferLen);
         if (!fullPacket) {
-            JNU_ThrowOutOfMemoryError(env, "heap allocation failed");
+            JNU_ThrowOutOfMemoryError(env, "Native heap allocation failed");
             return -1;
         }
     } else {
@@ -1287,7 +1287,7 @@
          */
         fullPacket = (char *)malloc(packetBufferLen);
         if (!fullPacket) {
-            JNU_ThrowOutOfMemoryError(env, "heap allocation failed");
+            JNU_ThrowOutOfMemoryError(env, "Receive buf native heap allocation failed");
             return;
         }
     } else {
--- a/src/windows/native/java/util/TimeZone_md.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/windows/native/java/util/TimeZone_md.c	Fri Jun 21 19:11:42 2013 -0700
@@ -165,6 +165,7 @@
     WCHAR *stdNamePtr = tzi.StandardName;
     DWORD valueSize;
     DWORD timeType;
+    int isVista;
 
     /*
      * Get the current time zone setting of the platform.
@@ -180,6 +181,7 @@
     ver.dwOSVersionInfoSize = sizeof(ver);
     GetVersionEx(&ver);
     isNT = ver.dwPlatformId == VER_PLATFORM_WIN32_NT;
+    isVista = isNT && ver.dwMajorVersion >= 6;
 
     ret = RegOpenKeyEx(HKEY_LOCAL_MACHINE, WIN_CURRENT_TZ_KEY, 0,
                        KEY_READ, (PHKEY)&hKey);
@@ -202,8 +204,13 @@
             ret = RegQueryValueExA(hKey, "DynamicDaylightTimeDisabled",
                                    NULL, &valueType, (LPBYTE) &val, &bufSize);
         }
+
         if (ret == ERROR_SUCCESS) {
-            if (val == 1) {
+            int daylightSavingsUpdateDisabledOther = val == 1 && tzi.DaylightDate.wMonth != 0;
+            int daylightSavingsUpdateDisabledVista = val == 1;
+            int daylightSavingsUpdateDisabled = isVista ? daylightSavingsUpdateDisabledVista : daylightSavingsUpdateDisabledOther;
+
+            if (daylightSavingsUpdateDisabled) {
                 (void) RegCloseKey(hKey);
                 customZoneName(tzi.Bias, winZoneName);
                 return VALUE_GMTOFFSET;
@@ -213,7 +220,7 @@
         /*
          * Vista has the key for the current "Time Zones" entry.
          */
-        if (isNT && ver.dwMajorVersion >= 6) {
+        if (isVista) {
             valueType = 0;
             bufSize = MAX_ZONE_CHAR;
             ret = RegQueryValueExA(hKey, "TimeZoneKeyName", NULL,
--- a/src/windows/native/sun/nio/ch/DatagramChannelImpl.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/windows/native/sun/nio/ch/DatagramChannelImpl.c	Fri Jun 21 19:11:42 2013 -0700
@@ -103,7 +103,7 @@
 
 JNIEXPORT void JNICALL
 Java_sun_nio_ch_DatagramChannelImpl_disconnect0(JNIEnv *env, jobject this,
-                                                jobject fdo)
+                                                jobject fdo, jboolean isIPv6)
 {
     jint fd = fdval(env, fdo);
     int rv = 0;
--- a/src/windows/native/sun/nio/fs/WindowsNativeDispatcher.c	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/windows/native/sun/nio/fs/WindowsNativeDispatcher.c	Fri Jun 21 19:11:42 2013 -0700
@@ -1021,6 +1021,33 @@
         throwWindowsException(env, GetLastError());
 }
 
+JNIEXPORT jboolean JNICALL
+Java_sun_nio_fs_WindowsNativeDispatcher_AccessCheck(JNIEnv* env,
+    jclass this, jlong token, jlong securityInfo, jint accessMask,
+    jint genericRead, jint genericWrite, jint genericExecute, jint genericAll)
+{
+    HANDLE hImpersonatedToken = (HANDLE)jlong_to_ptr(token);
+    PSECURITY_DESCRIPTOR security = (PSECURITY_DESCRIPTOR)jlong_to_ptr(securityInfo);
+    DWORD checkAccessRights = (DWORD)accessMask;
+    GENERIC_MAPPING mapping = {
+        genericRead,
+        genericWrite,
+        genericExecute,
+        genericAll};
+    PRIVILEGE_SET privileges = {0};
+    DWORD privilegesLength = sizeof(privileges);
+    DWORD grantedAccess = 0;
+    BOOL result = FALSE;
+
+    /* checkAccessRights is in-out parameter */
+    MapGenericMask(&checkAccessRights, &mapping);
+    if (AccessCheck(security, hImpersonatedToken, checkAccessRights,
+            &mapping, &privileges, &privilegesLength, &grantedAccess, &result) == 0)
+        throwWindowsException(env, GetLastError());
+
+    return (result == FALSE) ? JNI_FALSE : JNI_TRUE;
+}
+
 JNIEXPORT jlong JNICALL
 Java_sun_nio_fs_WindowsNativeDispatcher_LookupPrivilegeValue0(JNIEnv* env,
     jclass this, jlong name)
@@ -1037,35 +1064,6 @@
     return ptr_to_jlong(pLuid);
 }
 
-JNIEXPORT jlong JNICALL
-Java_sun_nio_fs_WindowsNativeDispatcher_BuildTrusteeWithSid(JNIEnv* env,
-    jclass this, jlong sid)
-{
-    PSID pSid = (HANDLE)jlong_to_ptr(sid);
-    PTRUSTEE_W pTrustee = LocalAlloc(0, sizeof(TRUSTEE_W));
-
-    if (pTrustee == NULL) {
-        JNU_ThrowInternalError(env, "Unable to allocate TRUSTEE_W structure");
-    } else {
-        BuildTrusteeWithSidW(pTrustee, pSid);
-    }
-    return ptr_to_jlong(pTrustee);
-}
-
-JNIEXPORT jint JNICALL
-Java_sun_nio_fs_WindowsNativeDispatcher_GetEffectiveRightsFromAcl(JNIEnv* env,
-    jclass this, jlong acl, jlong trustee)
-{
-    ACCESS_MASK access;
-    PACL pAcl = (PACL)jlong_to_ptr(acl);
-    PTRUSTEE pTrustee = (PTRUSTEE)jlong_to_ptr(trustee);
-
-    if (GetEffectiveRightsFromAcl(pAcl, pTrustee, &access) != ERROR_SUCCESS) {
-        throwWindowsException(env, GetLastError());
-    }
-    return (jint)access;
-}
-
 JNIEXPORT void JNICALL
 Java_sun_nio_fs_WindowsNativeDispatcher_CreateSymbolicLink0(JNIEnv* env,
     jclass this, jlong linkAddress, jlong targetAddress, jint flags)
--- a/src/windows/native/sun/windows/awt_Component.cpp	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/windows/native/sun/windows/awt_Component.cpp	Fri Jun 21 19:11:42 2013 -0700
@@ -558,6 +558,8 @@
 
     m_hwnd = hwnd;
 
+    ::ImmAssociateContext(m_hwnd, NULL);
+
     SetDrawState((jint)JAWT_LOCK_SURFACE_CHANGED |
         (jint)JAWT_LOCK_BOUNDS_CHANGED |
         (jint)JAWT_LOCK_CLIP_CHANGED);
@@ -3142,7 +3144,8 @@
     return;
 }
 
-UINT AwtComponent::WindowsKeyToJavaKey(UINT windowsKey, UINT modifiers)
+UINT AwtComponent::WindowsKeyToJavaKey(UINT windowsKey, UINT modifiers, UINT character, BOOL isDeadKey)
+
 {
     // Handle the few cases where we need to take the modifier into
     // consideration for the Java VK code or where we have to take the keyboard
@@ -3169,6 +3172,15 @@
             break;
     };
 
+    // check dead key
+    if (isDeadKey) {
+      for (int i = 0; charToDeadVKTable[i].c != 0; i++) {
+        if (charToDeadVKTable[i].c == character) {
+            return charToDeadVKTable[i].javaKey;
+        }
+      }
+    }
+
     // for the general case, use a bi-directional table
     for (int i = 0; keyMapTable[i].windowsKey != 0; i++) {
         if (keyMapTable[i].windowsKey == windowsKey) {
@@ -3382,14 +3394,18 @@
     }
 }
 
-UINT AwtComponent::WindowsKeyToJavaChar(UINT wkey, UINT modifiers, TransOps ops)
+UINT AwtComponent::WindowsKeyToJavaChar(UINT wkey, UINT modifiers, TransOps ops, BOOL &isDeadKey)
 {
     static Hashtable transTable("VKEY translations");
+    static Hashtable deadKeyFlagTable("Dead Key Flags");
+    isDeadKey = FALSE;
 
     // Try to translate using last saved translation
     if (ops == LOAD) {
+       void* deadKeyFlag = deadKeyFlagTable.remove(reinterpret_cast<void*>(static_cast<INT_PTR>(wkey)));
        void* value = transTable.remove(reinterpret_cast<void*>(static_cast<INT_PTR>(wkey)));
        if (value != NULL) {
+           isDeadKey = static_cast<BOOL>(reinterpret_cast<INT_PTR>(deadKeyFlag));
            return static_cast<UINT>(reinterpret_cast<INT_PTR>(value));
        }
     }
@@ -3482,12 +3498,13 @@
 
     // instead of creating our own conversion tables, I'll let Win32
     // convert the character for me.
-    WORD mbChar;
+    WORD wChar[2];
     UINT scancode = ::MapVirtualKey(wkey, 0);
-    int converted = ::ToAsciiEx(wkey, scancode, keyboardState,
-                                &mbChar, 0, GetKeyboardLayout());
+    int converted = ::ToUnicodeEx(wkey, scancode, keyboardState,
+                                  wChar, 2, 0, GetKeyboardLayout());
 
     UINT translation;
+    BOOL deadKeyFlag = (converted == 2);
 
     // Dead Key
     if (converted < 0) {
@@ -3506,16 +3523,16 @@
     } else
     // the caller expects a Unicode character.
     if (converted > 0) {
-        WCHAR unicodeChar[2];
-        VERIFY(::MultiByteToWideChar(GetCodePage(), MB_PRECOMPOSED,
-        (LPCSTR)&mbChar, 1, unicodeChar, 1));
-
-        translation = unicodeChar[0];
+        translation = wChar[0];
     }
     if (ops == SAVE) {
         transTable.put(reinterpret_cast<void*>(static_cast<INT_PTR>(wkey)),
                        reinterpret_cast<void*>(static_cast<INT_PTR>(translation)));
-    }
+        deadKeyFlagTable.put(reinterpret_cast<void*>(static_cast<INT_PTR>(wkey)),
+                       reinterpret_cast<void*>(static_cast<INT_PTR>(deadKeyFlag)));
+    }
+
+    isDeadKey = deadKeyFlag;
     return translation;
 }
 
@@ -3535,8 +3552,9 @@
 
     UINT modifiers = GetJavaModifiers();
     jint keyLocation = GetKeyLocation(wkey, flags);
-    UINT jkey = WindowsKeyToJavaKey(wkey, modifiers);
-    UINT character = WindowsKeyToJavaChar(wkey, modifiers, SAVE);
+    BOOL isDeadKey = FALSE;
+    UINT character = WindowsKeyToJavaChar(wkey, modifiers, SAVE, isDeadKey);
+    UINT jkey = WindowsKeyToJavaKey(wkey, modifiers, character, isDeadKey);
     UpdateDynPrimaryKeymap(wkey, jkey, keyLocation, modifiers);
 
 
@@ -3577,8 +3595,9 @@
 
     UINT modifiers = GetJavaModifiers();
     jint keyLocation = GetKeyLocation(wkey, flags);
-    UINT jkey = WindowsKeyToJavaKey(wkey, modifiers);
-    UINT character = WindowsKeyToJavaChar(wkey, modifiers, LOAD);
+    BOOL isDeadKey = FALSE;
+    UINT character = WindowsKeyToJavaChar(wkey, modifiers, LOAD, isDeadKey);
+    UINT jkey = WindowsKeyToJavaKey(wkey, modifiers, character, isDeadKey);
     UpdateDynPrimaryKeymap(wkey, jkey, keyLocation, modifiers);
 
     SendKeyEventToFocusOwner(java_awt_event_KeyEvent_KEY_RELEASED,
@@ -5626,7 +5645,8 @@
                         }
                     }
 
-                    modifiedChar = p->WindowsKeyToJavaChar(winKey, modifiers, AwtComponent::NONE);
+                    BOOL isDeadKey = FALSE;
+                    modifiedChar = p->WindowsKeyToJavaChar(winKey, modifiers, AwtComponent::NONE, isDeadKey);
                     bCharChanged = (keyChar != modifiedChar);
                 }
                 break;
--- a/src/windows/native/sun/windows/awt_Component.h	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/windows/native/sun/windows/awt_Component.h	Fri Jun 21 19:11:42 2013 -0700
@@ -441,7 +441,7 @@
     static jint GetJavaModifiers();
     static jint GetButton(int mouseButton);
     static UINT GetButtonMK(int mouseButton);
-    static UINT WindowsKeyToJavaKey(UINT windowsKey, UINT modifiers);
+    static UINT WindowsKeyToJavaKey(UINT windowsKey, UINT modifiers, UINT character, BOOL isDeadKey);
     static void JavaKeyToWindowsKey(UINT javaKey, UINT *windowsKey, UINT *modifiers, UINT originalWindowsKey);
     static void UpdateDynPrimaryKeymap(UINT wkey, UINT jkeyLegacy, jint keyLocation, UINT modifiers);
 
@@ -453,7 +453,7 @@
 
     enum TransOps {NONE, LOAD, SAVE};
 
-    UINT WindowsKeyToJavaChar(UINT wkey, UINT modifiers, TransOps ops);
+    UINT WindowsKeyToJavaChar(UINT wkey, UINT modifiers, TransOps ops, BOOL &isDeadKey);
 
     /* routines used for input method support */
     void SetInputMethod(jobject im, BOOL useNativeCompWindow);
--- a/src/windows/native/sun/windows/awt_Desktop.cpp	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/windows/native/sun/windows/awt_Desktop.cpp	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -38,17 +38,17 @@
  * Signature: (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
  */
 JNIEXPORT jstring JNICALL Java_sun_awt_windows_WDesktopPeer_ShellExecute
-  (JNIEnv *env, jclass cls, jstring uri_j, jstring verb_j)
+  (JNIEnv *env, jclass cls, jstring fileOrUri_j, jstring verb_j)
 {
-    LPCWSTR uri_c = JNU_GetStringPlatformChars(env, uri_j, JNI_FALSE);
+    LPCWSTR fileOrUri_c = JNU_GetStringPlatformChars(env, fileOrUri_j, JNI_FALSE);
     LPCWSTR verb_c = JNU_GetStringPlatformChars(env, verb_j, JNI_FALSE);
 
     // 6457572: ShellExecute possibly changes FPU control word - saving it here
     unsigned oldcontrol87 = _control87(0, 0);
-    HINSTANCE retval = ::ShellExecute(NULL, verb_c, uri_c, NULL, NULL, SW_SHOWNORMAL);
+    HINSTANCE retval = ::ShellExecute(NULL, verb_c, fileOrUri_c, NULL, NULL, SW_SHOWNORMAL);
     _control87(oldcontrol87, 0xffffffff);
 
-    JNU_ReleaseStringPlatformChars(env, uri_j, uri_c);
+    JNU_ReleaseStringPlatformChars(env, fileOrUri_j, fileOrUri_c);
     JNU_ReleaseStringPlatformChars(env, verb_j, verb_c);
 
     if ((int)retval <= 32) {
--- a/src/windows/native/sun/windows/awt_InputMethod.cpp	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/windows/native/sun/windows/awt_InputMethod.cpp	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -520,7 +520,7 @@
         szImmDescription = (LPTSTR) SAFE_SIZE_ARRAY_ALLOC(safe_Malloc, (buffSize+1), sizeof(TCHAR));
 
         if (szImmDescription != NULL) {
-            ImmGetDescription(hkl, szImmDescription, buffSize);
+            ImmGetDescription(hkl, szImmDescription, (buffSize+1));
 
             infojStr = JNU_NewStringPlatform(env, szImmDescription);
 
--- a/src/windows/native/sun/windows/awt_TextField.cpp	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/windows/native/sun/windows/awt_TextField.cpp	Fri Jun 21 19:11:42 2013 -0700
@@ -75,6 +75,7 @@
 AwtTextField::HandleEvent(MSG *msg, BOOL synthetic)
 {
     MsgRouting returnVal;
+    BOOL systemBeeperEnabled = FALSE;
     /*
      * RichEdit 1.0 control starts internal message loop if the
      * left mouse button is pressed while the cursor is not over
@@ -217,6 +218,25 @@
         }
         delete msg;
         return mrConsume;
+    } else if (msg->message == WM_KEYDOWN) {
+        UINT virtualKey = (UINT) msg->wParam;
+
+        switch(virtualKey){
+          case VK_RETURN:
+          case VK_UP:
+          case VK_DOWN:
+          case VK_LEFT:
+          case VK_RIGHT:
+          case VK_DELETE:
+          case VK_BACK:
+              SystemParametersInfo(SPI_GETBEEP, 0, &systemBeeperEnabled, 0);
+              if(systemBeeperEnabled){
+                  // disable system beeper for the RICHEDIT control to be compatible
+                  // with the EDIT control behaviour
+                  SystemParametersInfo(SPI_SETBEEP, 0, NULL, 0);
+              }
+              break;
+          }
     }
     /*
      * Store the 'synthetic' parameter so that the WM_PASTE security check
@@ -226,6 +246,10 @@
     returnVal = AwtComponent::HandleEvent(msg, synthetic);
     m_synthetic = FALSE;
 
+    if(systemBeeperEnabled){
+      SystemParametersInfo(SPI_SETBEEP, 1, NULL, 0);
+    }
+
     return returnVal;
 }
 
--- a/src/windows/npt/npt_md.h	Wed Jun 19 21:51:50 2013 -0700
+++ b/src/windows/npt/npt_md.h	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -33,30 +33,16 @@
 #include <string.h>
 #include <errno.h>
 
-#define NPT_LIBNAME "npt.dll"
+#define NPT_LIBNAME "npt"
 
-#define NPT_INITIALIZE(pnpt,version,options)                            \
+#define NPT_INITIALIZE(path,pnpt,version,options)                       \
     {                                                                   \
-        HINSTANCE jvm;                                                  \
         void   *_handle;                                                \
         void   *_sym;                                                   \
-        char    buf[FILENAME_MAX+32];                                   \
-        char   *lastSlash;                                              \
                                                                         \
         if ( (pnpt) == NULL ) NPT_ERROR("NptEnv* is NULL");             \
-        _handle =  NULL;                                                \
         *(pnpt) = NULL;                                                 \
-        buf[0] = 0;                                                     \
-        jvm = GetModuleHandle("jvm.dll");                               \
-        if ( jvm == NULL ) NPT_ERROR("Cannot find jvm.dll");            \
-        GetModuleFileName(jvm, buf, FILENAME_MAX);                      \
-        lastSlash = strrchr(buf, '\\');                                 \
-        if ( lastSlash != NULL ) {                                      \
-            *lastSlash = '\0';                                          \
-            (void)strcat(buf, "\\..\\");                                \
-            (void)strcat(buf, NPT_LIBNAME);                             \
-            _handle =  LoadLibrary(buf);                                \
-        }                                                               \
+        _handle =  LoadLibrary(path);                                   \
         if ( _handle == NULL ) NPT_ERROR("Cannot open library");        \
         _sym = GetProcAddress(_handle, "nptInitialize");                \
         if ( _sym == NULL ) NPT_ERROR("Cannot find nptInitialize");     \
--- a/test/Makefile	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/Makefile	Fri Jun 21 19:11:42 2013 -0700
@@ -484,72 +484,62 @@
 
 # Stable agentvm testruns (minus items from PROBLEM_LIST)
 JDK_ALL_TARGETS += jdk_lang
-jdk_lang: $(call TestDirs, java/lang sun/reflect)
+jdk_lang: $(call TestDirs, java/lang sun/invoke sun/misc vm sun/reflect)
 	$(call RunAgentvmBatch)
 
 # Stable othervm testruns (minus items from PROBLEM_LIST)
 #   Using agentvm has serious problems with these tests
-JDK_ALL_TARGETS += jdk_management1
-jdk_management1: $(call TestDirs, javax/management)
+JDK_ALL_TARGETS += jdk_jmx
+jdk_jmx: $(call TestDirs, javax/management com/sun/jmx)
 	$(call RunOthervmBatch)
 
 # Stable othervm testruns (minus items from PROBLEM_LIST)
 #   Using agentvm has serious problems with these tests
-JDK_ALL_TARGETS += jdk_management2
-jdk_management2: $(call TestDirs, com/sun/jmx com/sun/management sun/management)
+JDK_ALL_TARGETS += jdk_management
+jdk_management: $(call TestDirs, com/sun/management sun/management)
 	$(call RunOthervmBatch)
 
-# All management tests
-jdk_management: jdk_management1 jdk_management2
-	@$(SummaryInfo)
-
 # Stable samevm testruns (minus items from PROBLEM_LIST)
 JDK_ALL_TARGETS += jdk_math
 jdk_math: $(call TestDirs, java/math)
 	$(call RunAgentvmBatch)
 
 # Stable samevm testruns (minus items from PROBLEM_LIST)
-JDK_ALL_TARGETS += jdk_misc
-jdk_misc: $(call TestDirs, \
-          demo/jvmti demo/zipfs javax/naming javax/script \
-          javax/smartcardio javax/xml com/sun/jndi com/sun/org/glassfish \
-          com/sun/corba com/sun/xml sun/misc)
+JDK_ALL_TARGETS += jdk_other
+jdk_other: $(call TestDirs, \
+          demo/jvmti demo/zipfs \
+          javax/naming com/sun/jndi \
+          javax/script \
+          java/sql javax/sql \
+          javax/smartcardio \
+          javax/xml/soap \
+          javax/xml/jaxp \
+          com/sun/xml \
+          javax/xml/ws com/sun/internal/ws \
+          com/sun/org/apache/xerces \
+          com/sun/corba \
+          com/sun/tracing \
+          sun/usagetracker) 
 	$(call RunAgentvmBatch)
 
 # Stable samevm testruns (minus items from PROBLEM_LIST)
 JDK_ALL_TARGETS += jdk_net
-jdk_net: $(call TestDirs, com/sun/net java/net sun/net)
-	$(call RunAgentvmBatch)
-
-# Stable samevm testruns (minus items from PROBLEM_LIST)
-JDK_ALL_TARGETS += jdk_nio1
-jdk_nio1: $(call TestDirs, java/nio/file)
+jdk_net: $(call TestDirs, com/sun/net java/net sun/net com/oracle/net)
 	$(call RunAgentvmBatch)
 
 # Stable samevm testruns (minus items from PROBLEM_LIST)
-JDK_ALL_TARGETS += jdk_nio2
-jdk_nio2: $(call TestDirs, java/nio/Buffer java/nio/ByteOrder \
-          java/nio/channels java/nio/MappedByteBuffer)
+jdk_nio: $(call TestDirs, java/nio sun/nio com/oracle/nio)
 	$(call SharedLibraryPermissions,java/nio/channels)
 	$(call RunAgentvmBatch)
 
 # Stable samevm testruns (minus items from PROBLEM_LIST)
-JDK_ALL_TARGETS += jdk_nio3
-jdk_nio3: $(call TestDirs, sun/nio)
-	$(call RunAgentvmBatch)
-
-# All nio tests
-jdk_nio: jdk_nio1 jdk_nio2 jdk_nio3
-	@$(SummaryInfo)
-
-# Stable samevm testruns (minus items from PROBLEM_LIST)
 jdk_sctp: $(call TestDirs, com/sun/nio/sctp)
 	$(call RunAgentvmBatch)
 
 # Stable othervm testruns (minus items from PROBLEM_LIST)
 #   Using samevm has serious problems with these tests
 JDK_ALL_TARGETS += jdk_rmi
-jdk_rmi: $(call TestDirs, java/rmi javax/rmi sun/rmi)
+jdk_rmi: $(call TestDirs, java/rmi sun/rmi javax/rmi/ssl)
 	$(call RunOthervmBatch)
 
 # Stable samevm testruns (minus items from PROBLEM_LIST)
@@ -567,9 +557,9 @@
 #   Using samevm has serious problems with these tests
 JDK_ALL_TARGETS += jdk_security3
 jdk_security3: $(call TestDirs, com/sun/security lib/security \
-               javax/security sun/security \
-               com/sun/org/apache/xml/internal/security \
-               com/oracle/security/ucrypto)
+		javax/security sun/security \
+		com/sun/org/apache/xml/internal/security \
+		com/oracle/security)
 	$(call SharedLibraryPermissions,sun/security)
 	$(call RunAgentvmBatch)
 
@@ -595,23 +585,19 @@
 	$(call RunAgentvmBatch)
 
 # Stable samevm testruns (minus items from PROBLEM_LIST)
-JDK_ALL_TARGETS += jdk_tools1
-jdk_tools1: $(call TestDirs, com/sun/jdi)
+JDK_ALL_TARGETS += jdk_jdi
+jdk_jdi: $(call TestDirs, com/sun/jdi)
 	$(call RunAgentvmBatch)
 
 # Stable othervm testruns (minus items from PROBLEM_LIST)
 #   Using samevm has serious problems with these tests
-JDK_ALL_TARGETS += jdk_tools2
-jdk_tools2: $(call TestDirs, \
-            com/sun/tools sun/jvmstat sun/tools tools vm \
-            com/sun/servicetag com/sun/tracing)
+JDK_ALL_TARGETS += jdk_tools
+jdk_tools: $(call TestDirs, \
+		com/sun/tools sun/jvmstat sun/tools tools \
+		com/sun/tracing)
 	$(call SharedLibraryPermissions,tools/launcher)
 	$(call RunAgentvmBatch)
 
-# All tools tests
-jdk_tools: jdk_tools1 jdk_tools2
-	@$(SummaryInfo)
-
 # Stable samevm testruns (minus items from PROBLEM_LIST)
 JDK_ALL_TARGETS += jdk_util
 jdk_util: $(call TestDirs, java/util sun/util)
--- a/test/ProblemList.txt	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/ProblemList.txt	Fri Jun 21 19:11:42 2013 -0700
@@ -134,9 +134,6 @@
 # Times out on solaris sparc -server
 java/lang/ThreadLocal/MemoryLeak.java                           solaris-all
 
-# Windows X64, RuntimeException: MyThread expected to have RUNNABLE but got WAITING
-java/lang/Thread/ThreadStateTest.java                           generic-all
-
 # 7148492
 java/lang/management/MemoryMXBean/ResetPeakMemoryUsage.java	generic-all
 
@@ -144,18 +141,44 @@
 
 # jdk_management
 
-# Failing, bug was filed: 6959636
-javax/management/loading/LibraryLoader/LibraryLoaderTest.java   generic-all
-
 # Access denied messages on windows/mks, filed 6954450
 sun/management/jmxremote/bootstrap/RmiSslNoKeyStoreTest.sh      windows-all
 
+# Port conflict? Fails with communication error
+sun/management/jmxremote/bootstrap/PasswordFilePermissionTest.sh generic-all
+
+# Fails with port already in use
+sun/management/jmxremote/bootstrap/SSLConfigFilePermissionTest.sh generic-all
+
+# Fails with port already in use
+sun/management/jmxremote/bootstrap/RmiRegistrySslTest.sh        generic-all
+
+# Windows run seems to have triggered a hotspot gc error (see 6801625)
+com/sun/management/HotSpotDiagnosticMXBean/DumpHeap.sh          generic-all
+
+# Port already in use
+sun/management/jmxremote/bootstrap/LocalManagementTest.sh       generic-all
+
+# Failed to initialize connector (also overflowing jtreg io buffers)
+sun/management/jmxremote/bootstrap/RmiBootstrapTest.sh          generic-all
+sun/management/jmxremote/bootstrap/RmiSslBootstrapTest.sh       generic-all
+
+# Windows X64, java.lang.IllegalStateException
+javax/management/monitor/AttributeArbitraryDataTypeTest.java    generic-all
+
+# 7149181
+sun/management/jmxremote/startstop/JMXStartStopTest.sh          generic-all
+
+############################################################################
+
+# jdk_jmx
+
+# Failing, bug was filed: 6959636
+javax/management/loading/LibraryLoader/LibraryLoaderTest.java   generic-all
+
 # Fails on linux: KO: StringMonitor notification missed or not emitted
 javax/management/monitor/NonComparableAttributeValueTest.java   generic-all
 
-# Port conflict? Fails with communication error
-sun/management/jmxremote/bootstrap/PasswordFilePermissionTest.sh generic-all
-
 # Fails on Windows 2000, Test failed for iiop java.lang.NullPointerException
 #  at org.omg.stub.javax.management.remote.rmi._RMIConnectionImpl_Tie._invoke(Unknown Source)
 #  at com.sun.corba.se.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:653)
@@ -170,21 +193,12 @@
 # Problems with rmi connection, othervm
 javax/management/remote/mandatory/subjectDelegation/SubjectDelegation2Test.java generic-all
 
-# Fails with port already in use
-sun/management/jmxremote/bootstrap/SSLConfigFilePermissionTest.sh generic-all
-
-# Fails with port already in use
-sun/management/jmxremote/bootstrap/RmiRegistrySslTest.sh        generic-all
-
 # Windows, connection can't last that long
 javax/management/eventService/LeaseTest.java                    generic-all
 
 # Linux othervm, X64, java.lang.Exception: Failed: ratio=102.4027795593753
 javax/management/remote/mandatory/notif/ListenerScaleTest.java  generic-all
 
-# Windows run seems to have triggered a hotspot gc error (see 6801625)
-com/sun/management/HotSpotDiagnosticMXBean/DumpHeap.sh          generic-all
-
 # rmi problem? othervm, java.lang.reflect.UndeclaredThrowableException
 javax/management/remote/mandatory/subjectDelegation/SubjectDelegation3Test.java generic-all
 
@@ -207,26 +221,13 @@
 # Windows i586 failure, callback did not complete
 javax/management/eventService/LeaseManagerDeadlockTest.java     windows-all
 
-# Port already in use
-sun/management/jmxremote/bootstrap/LocalManagementTest.sh       generic-all
-
-# Failed to initialize connector (also overflowing jtreg io buffers)
-sun/management/jmxremote/bootstrap/RmiBootstrapTest.sh          generic-all
-sun/management/jmxremote/bootstrap/RmiSslBootstrapTest.sh       generic-all
-
-# Windows X64, java.lang.IllegalStateException
-javax/management/monitor/AttributeArbitraryDataTypeTest.java    generic-all
-
-# 7149181
-sun/management/jmxremote/startstop/JMXStartStopTest.sh          generic-all
-
 ############################################################################
 
 # jdk_math
 
 ############################################################################
 
-# jdk_misc
+# jdk_other
 
 # 6988950
 demo/jvmti/compiledMethodLoad/CompiledMethodLoadTest.java       generic-all
@@ -234,27 +235,6 @@
 # 7056489
 com/sun/jndi/ldap/ReadTimeoutTest.java                          generic-all
 
-# 7162111
-demo/jvmti/mtrace/TraceJFrame.java                              macosx-all
-javax/script/CauseExceptionTest.java                            macosx-all
-javax/script/GetInterfaceTest.java                              macosx-all
-javax/script/JavaScriptScopeTest.java                           macosx-all
-javax/script/NullUndefinedVarTest.java                          macosx-all
-javax/script/PluggableContextTest.java                          macosx-all
-javax/script/ProviderTest.sh                                    macosx-all
-javax/script/RhinoExceptionTest.java                            macosx-all
-javax/script/StringWriterPrintTest.java                         macosx-all
-javax/script/Test1.java                                         macosx-all
-javax/script/Test2.java                                         macosx-all
-javax/script/Test3.java                                         macosx-all
-javax/script/Test4.java                                         macosx-all
-javax/script/Test5.java                                         macosx-all
-javax/script/Test6.java                                         macosx-all
-javax/script/Test7.java                                         macosx-all
-javax/script/Test8.java                                         macosx-all
-javax/script/UnescapedBracketRegExTest.java                     macosx-all
-javax/script/VersionTest.java                                   macosx-all
-
 ############################################################################
 
 # jdk_net
@@ -284,9 +264,6 @@
 # 7162118
 java/net/CookieHandler/CookieManagerTest.java			macosx-all
 
-# 7162123
-test/java/net/InetSocketAddress/B6469803.java			macosx-all
-
 # JPRT needs to set 127.0.0.1 in proxy bypass list
 java/net/URLClassLoader/closetest/CloseTest.java		macosx-all
 
@@ -392,6 +369,15 @@
 # 7147060
 com/sun/org/apache/xml/internal/security/transforms/ClassLoaderTest.java        generic-all
 
+# 8000439: NPG: REGRESSION : sun/security/krb5/auto/MaxRetries.java fails with timeout
+sun/security/krb5/auto/MaxRetries.java                          solaris-sparcv9
+
+# 8006690: sun/security/krb5/auto/BadKdc1.java fails intermittently
+sun/security/krb5/auto/BadKdc1.java                             solaris-sparcv9
+sun/security/krb5/auto/BadKdc2.java                             solaris-sparcv9
+sun/security/krb5/auto/BadKdc3.java                             solaris-sparcv9
+sun/security/krb5/auto/BadKdc4.java                             solaris-sparcv9
+
 ############################################################################
 
 # jdk_swing
@@ -407,15 +393,12 @@
 
 # jdk_tools
 
+# 8012474
+sun/tools/jmap/Basic.sh                                         generic-all
+
 # 6461635
 com/sun/tools/attach/BasicTests.sh                              generic-all
 
-# Filed 6952105
-com/sun/jdi/SuspendThreadTest.java                              generic-all
-
-# Filed 6987312
-com/sun/jdi/DoubleAgentTest.java                                generic-all
-
 # Filed 6986875
 sun/tools/jps/jps-Vvml.sh                                       generic-all
 
@@ -425,14 +408,6 @@
 # 7132203
 sun/jvmstat/monitor/MonitoredVm/CR6672135.java                  generic-all
 
-# 7162111
-sun/tools/jrunscript/jrunscript-DTest.sh                       macosx-all
-sun/tools/jrunscript/jrunscript-argsTest.sh                    macosx-all
-sun/tools/jrunscript/jrunscript-cpTest.sh                      macosx-all
-sun/tools/jrunscript/jrunscript-eTest.sh                       macosx-all
-sun/tools/jrunscript/jrunscript-fTest.sh                       macosx-all
-sun/tools/jrunscript/jrunscriptTest.sh                         macosx-all
-
 # 8001118
 sun/tools/jcmd/jcmd-f.sh					generic-all
 sun/tools/jcmd/jcmd-help-help.sh				generic-all
@@ -442,6 +417,16 @@
 
 ############################################################################
 
+# jdk_jdi
+
+# Filed 6952105
+com/sun/jdi/SuspendThreadTest.java                              generic-all
+
+# Filed 6987312
+com/sun/jdi/DoubleAgentTest.java                                generic-all
+
+############################################################################
+
 # jdk_util
 
 # Need 7094995 back-ported from jdk8
@@ -471,10 +456,6 @@
 # Problems on windows, jmap.exe hangs? (these run jmap), fails on Solaris 10 x86
 java/util/concurrent/locks/Lock/TimedAcquireLeak.java           generic-all
 
-# 7162111
-java/util/ResourceBundle/Control/Bug6530694.java               macosx-all
-java/util/logging/LoggingDeadlock4.java                        macosx-all
-
 # 7041639, Solaris DSA keypair generation bug
 java/util/TimeZone/TimeZoneDatePermissionCheck.sh               solaris-all
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/corba/cachedSocket/7056731.sh	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,122 @@
+#
+# 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 7056731
+#  @summary Race condition in CORBA code causes re-use of ABORTed connections
+#
+#  @run shell 7056731.sh
+#
+
+OS=`uname -s`
+case "$OS" in
+  SunOS | Linux | Darwin )
+    PS=":"
+    FS="/"
+    ;;
+  Windows* | CYGWIN* )
+    PS=";"
+    FS="\\"
+    ;;
+  * )
+    echo "Unrecognized system!"
+    exit 1;
+    ;;
+esac
+
+if [ "${TESTJAVA}" = "" ] ; then
+  echo "TESTJAVA not set.  Test cannot execute.  Failed."
+  exit 1
+fi
+
+JAVA="${TESTJAVA}${FS}bin${FS}java"
+PORT=1052
+cp -r ${TESTSRC}${FS}*.java  ${TESTSRC}${FS}Hello.idl .
+echo "Testing...please wait"
+
+${TESTJAVA}${FS}bin${FS}idlj -fall Hello.idl
+${TESTJAVA}${FS}bin${FS}javac *.java HelloApp/*.java
+
+echo "starting orbd"
+${TESTJAVA}${FS}bin${FS}orbd -ORBInitialPort $PORT -ORBInitialHost localhost &
+ORB_PROC=$!
+sleep 2 #give orbd time to start
+echo "started orb"
+echo "starting server"
+${TESTJAVA}${FS}bin${FS}java -cp . HelloServer -ORBInitialPort $PORT -ORBInitialHost localhost &
+SERVER_PROC=$!
+sleep 2 #give server time to start
+echo "started server"
+echo "starting client (debug mode)"
+${TESTJAVA}${FS}bin${FS}java -cp . -agentlib:jdwp=transport=dt_socket,server=y,address=8000 HelloClient -ORBInitialPort $PORT -ORBInitialHost localhost > client.$$ 2>&1 & 
+JVM_PROC=$!
+sleep 2 #give jvm/debugger/client time to start
+
+echo "started client (debug mode)"
+echo "starting debugger and issuing commands"
+(sleep 2;
+echo "stop in com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.unregisterWaiter";
+sleep 2;
+echo "run";
+sleep 2;
+echo "cont";
+sleep 2;
+echo "cont";
+sleep 2;
+echo "cont";
+sleep 2;
+echo "suspend 1";
+sleep 2;
+kill -9 $SERVER_PROC &> /dev/null;
+sleep 2;
+echo "cont";
+sleep 2;
+echo "thread 1"
+sleep 2;
+echo "clear com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.unregisterWaiter"
+sleep 2;
+echo "resume 1";
+)| ${TESTJAVA}${FS}bin${FS}jdb -connect com.sun.jdi.SocketAttach:hostname=localhost,port=8000
+
+sleep 5 # give time for Client to throw exception
+
+# JVM_PROC should have exited but just in case, include it.
+kill -9 $ORB_PROC $JVM_PROC
+
+grep "ORBUtilSystemException.writeErrorSend" client.$$
+result=$?
+if [ $result -eq 0 ]
+then
+    echo "Failed"
+    exitCode=1;
+else 
+    echo "Passed"
+    exitCode=0
+fi
+
+#jtreg complaining about not being able to clean up; let's sleep
+sleep 2
+rm -rf out.$$ client.$$
+sleep 2
+exit ${exitCode}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/corba/cachedSocket/Hello.idl	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,31 @@
+/*
+ * 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.
+ */
+
+module HelloApp
+{
+  interface Hello
+  {
+    string sayHello();
+    oneway void shutdown();
+  };
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/corba/cachedSocket/HelloClient.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,67 @@
+/*
+ * 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.
+ */
+
+import HelloApp.*;
+import org.omg.CosNaming.*;
+import org.omg.CosNaming.NamingContextPackage.*;
+import org.omg.CORBA.*;
+
+public class HelloClient
+{
+    static Hello helloImpl;
+
+    public static void main(String args[])
+    {
+        try{
+            // create and initialize the ORB
+            ORB orb = ORB.init(args, null);
+
+            // get the root naming context
+            org.omg.CORBA.Object objRef =
+                orb.resolve_initial_references("NameService");
+            // Use NamingContextExt instead of NamingContext. This is
+            // part of the Interoperable naming Service.
+            NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);
+
+            // resolve the Object Reference in Naming
+            String name = "Hello";
+            helloImpl = HelloHelper.narrow(ncRef.resolve_str(name));
+
+            System.out.println("Obtained a handle on server object: " + helloImpl);
+            for (int i = 0; i < 2; i++) {
+                try {
+                    System.out.println(helloImpl.sayHello());
+                } catch (Exception e) {
+                    System.out.println("Exception: " + e.getMessage());
+                    e.printStackTrace();
+                }
+                Thread.sleep(2000);
+            }
+
+        } catch (Exception e) {
+            System.out.println("ERROR : " + e) ;
+            e.printStackTrace(System.out);
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/corba/cachedSocket/HelloServer.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,97 @@
+/*
+ * 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.
+ */
+
+import HelloApp.*;
+import org.omg.CosNaming.*;
+import org.omg.CosNaming.NamingContextPackage.*;
+import org.omg.CORBA.*;
+import org.omg.PortableServer.*;
+import org.omg.PortableServer.POA;
+
+import java.util.Properties;
+
+class HelloImpl extends HelloPOA {
+    private ORB orb;
+
+    public void setORB(ORB orb_val) {
+        orb = orb_val;
+    }
+
+    // implement sayHello() method
+    public String sayHello() {
+        return "\nHello world !!\n";
+    }
+
+    // implement shutdown() method
+    public void shutdown() {
+        orb.shutdown(false);
+    }
+}
+
+
+public class HelloServer {
+
+    public static void main(String args[]) {
+        try{
+            // create and initialize the ORB
+            ORB orb = ORB.init(args, null);
+
+            // get reference to rootpoa & activate the POAManager
+            POA rootpoa = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
+            rootpoa.the_POAManager().activate();
+
+            // create servant and register it with the ORB
+            HelloImpl helloImpl = new HelloImpl();
+            helloImpl.setORB(orb);
+
+            // get object reference from the servant
+            org.omg.CORBA.Object ref = rootpoa.servant_to_reference(helloImpl);
+            Hello href = HelloHelper.narrow(ref);
+
+            // get the root naming context
+            org.omg.CORBA.Object objRef =
+                orb.resolve_initial_references("NameService");
+            // Use NamingContextExt which is part of the Interoperable
+            // Naming Service (INS) specification.
+            NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);
+
+            // bind the Object Reference in Naming
+            String name = "Hello";
+            NameComponent path[] = ncRef.to_name( name );
+            ncRef.rebind(path, href);
+
+            System.out.println("HelloServer ready and waiting ...");
+
+            // wait for invocations from clients
+            while (true) {
+                orb.run();
+            }
+        } catch (Exception e) {
+            System.out.println("ERROR: " + e);
+            e.printStackTrace(System.out);
+        }
+
+        System.out.println("HelloServer Exiting ...");
+
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/java/swing/plaf/gtk/4928019/bug4928019.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,244 @@
+/*
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 4928019
+ * @summary Makes sure all the basic classes can be created with GTK.
+ * @author Scott Violet
+ */
+
+import javax.swing.*;
+import javax.swing.plaf.basic.*;
+
+public class bug4928019 {
+    public static void main(String[] args) throws Throwable {
+        try {
+            UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");
+        } catch (UnsupportedLookAndFeelException ex) {
+            System.err.println("GTKLookAndFeel is not supported on this platform." +
+                    " Test is considered passed.");
+            return;
+        } catch (ClassNotFoundException ex) {
+            System.err.println("GTKLookAndFeel class is not found." +
+                    " Test is considered passed.");
+            return;
+        }
+        new JButton() {
+            public void updateUI() {
+                setUI(new BasicButtonUI());
+            }
+        };
+        new JCheckBox() {
+            public void updateUI() {
+                setUI(new BasicCheckBoxUI());
+            }
+        };
+        new JCheckBoxMenuItem() {
+            public void updateUI() {
+                setUI(new BasicCheckBoxMenuItemUI());
+            }
+        };
+        new JColorChooser() {
+            public void updateUI() {
+                setUI(new BasicColorChooserUI());
+            }
+        };
+        new JComboBox() {
+            public void updateUI() {
+                setUI(new BasicComboBoxUI());
+            }
+        };
+        new JDesktopPane() {
+            public void updateUI() {
+                setUI(new BasicDesktopPaneUI());
+            }
+        };
+        new JEditorPane() {
+            public void updateUI() {
+                setUI(new BasicEditorPaneUI());
+            }
+        };
+        new JFileChooser() {
+            public void updateUI() {
+                setUI(new BasicFileChooserUI(null));
+            }
+        };
+        new JFormattedTextField() {
+            public void updateUI() {
+                setUI(new BasicFormattedTextFieldUI());
+            }
+        };
+        new JInternalFrame() {
+            public void updateUI() {
+                setUI(new BasicInternalFrameUI(null));
+            }
+        };
+        new JLabel() {
+            public void updateUI() {
+                setUI(new BasicLabelUI());
+            }
+        };
+        new JList() {
+            public void updateUI() {
+                setUI(new BasicListUI());
+            }
+        };
+        new JMenuBar() {
+            public void updateUI() {
+                setUI(new BasicMenuBarUI());
+            }
+        };
+        new JMenuItem() {
+            public void updateUI() {
+                setUI(new BasicMenuItemUI());
+            }
+        };
+        new JMenu() {
+            public void updateUI() {
+                setUI(new BasicMenuUI());
+            }
+        };
+        new JOptionPane() {
+            public void updateUI() {
+                setUI(new BasicOptionPaneUI());
+            }
+        };
+        new JPanel() {
+            public void updateUI() {
+                setUI(new BasicPanelUI());
+            }
+        };
+        new JPasswordField() {
+            public void updateUI() {
+                setUI(new BasicPasswordFieldUI());
+            }
+        };
+        new JPopupMenu() {
+            public void updateUI() {
+                setUI(new BasicPopupMenuUI());
+            }
+        };
+        new JProgressBar() {
+            public void updateUI() {
+                setUI(new BasicProgressBarUI());
+            }
+        };
+        new JRadioButton() {
+            public void updateUI() {
+                setUI(new BasicRadioButtonUI());
+            }
+        };
+        new JRadioButtonMenuItem() {
+            public void updateUI() {
+                setUI(new BasicRadioButtonMenuItemUI());
+            }
+        };
+        new JRootPane() {
+            public void updateUI() {
+                setUI(new BasicRootPaneUI());
+            }
+        };
+        new JScrollBar() {
+            public void updateUI() {
+                setUI(new BasicScrollBarUI());
+            }
+        };
+        new JScrollPane() {
+            public void updateUI() {
+                setUI(new BasicScrollPaneUI());
+            }
+        };
+        new JSeparator() {
+            public void updateUI() {
+                setUI(new BasicSeparatorUI());
+            }
+        };
+        new JSlider() {
+            public void updateUI() {
+                setUI(new BasicSliderUI(null));
+            }
+        };
+        new JSpinner() {
+            public void updateUI() {
+                setUI(new BasicSpinnerUI());
+            }
+        };
+        new JSplitPane() {
+            public void updateUI() {
+                setUI(new BasicSplitPaneUI());
+            }
+        };
+        new JTabbedPane() {
+            public void updateUI() {
+                setUI(new BasicTabbedPaneUI());
+            }
+        };
+        new JTable() {
+            public void updateUI() {
+                setUI(new BasicTableUI());
+            }
+        };
+        new JTextArea() {
+            public void updateUI() {
+                setUI(new BasicTextAreaUI());
+            }
+        };
+        new JTextField() {
+            public void updateUI() {
+                setUI(new BasicTextFieldUI());
+            }
+        };
+        new JTextPane() {
+            public void updateUI() {
+                setUI(new BasicTextPaneUI());
+            }
+        };
+        new JToggleButton() {
+            public void updateUI() {
+                setUI(new BasicToggleButtonUI());
+            }
+        };
+        new JToolBar() {
+            public void updateUI() {
+                setUI(new BasicToolBarUI());
+            }
+        };
+        new JToolTip() {
+            public void updateUI() {
+                setUI(new BasicToolTipUI());
+            }
+        };
+        new JTree() {
+            public void updateUI() {
+                setUI(new BasicTreeUI());
+            }
+        };
+        new JViewport() {
+            public void updateUI() {
+                setUI(new BasicViewportUI());
+            }
+        };
+        System.out.println("DONE");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/java/swing/plaf/windows/WindowsRadioButtonUI/7089914/bug7089914.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,77 @@
+/*
+ * 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.
+ */
+
+/*
+ * Portions Copyright (c) 2012 IBM Corporation
+ */
+
+/* @test
+ * @bug 7089914
+ * @summary Focus on image icons are not visible in javaws cache with high contrast mode
+ * @author Sean Chou
+ */
+
+import javax.swing.*;
+import java.lang.reflect.Field;
+
+public class bug7089914 {
+
+    public static void main(String[] args) throws Exception {
+        try {
+            UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
+        } catch (Exception e) {
+            System.out.println("Not WindowsLookAndFeel, test skipped");
+
+            return;
+        }
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+
+                JRadioButton rb = new JRadioButton();
+
+                if (!"com.sun.java.swing.plaf.windows.WindowsRadioButtonUI".equals(rb.getUI().getClass().getName())) {
+                    throw new RuntimeException("Unexpected UI class of JRadioButton");
+                }
+
+                try {
+                    Field initializedField = rb.getUI().getClass().getDeclaredField("initialized");
+                    initializedField.setAccessible(true);
+
+                    if (!initializedField.getBoolean(rb.getUI())) {
+                        throw new RuntimeException("initialized is false");
+                    }
+
+                    rb.getUI().uninstallUI(rb);
+
+                    if (initializedField.getBoolean(rb.getUI())) {
+                        throw new RuntimeException("initialized is true");
+                    }
+                } catch (NoSuchFieldException | IllegalAccessException e) {
+                    throw new RuntimeException(e);
+                }
+            }
+        });
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/jndi/ldap/LdapTimeoutTest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,177 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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 7094377 8000487 6176036 7056489
+ * @summary Timeout tests for ldap
+ */
+
+import java.net.Socket;
+import java.net.ServerSocket;
+import java.net.SocketTimeoutException;
+import java.io.*;
+import javax.naming.*;
+import javax.naming.directory.*;
+import java.util.Hashtable;
+import java.util.concurrent.Callable;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledFuture;
+import java.util.concurrent.TimeUnit;
+
+public class LdapTimeoutTest {
+    private static final ScheduledExecutorService pool =
+        Executors.newScheduledThreadPool(1);
+    static volatile int passed = 0, failed = 0;
+    static void pass() {passed++;}
+    static void fail() {failed++; Thread.dumpStack();}
+
+    public static void main(String[] args) throws Exception {
+        ServerSocket serverSock = new ServerSocket(0);
+        Server s = new Server(serverSock);
+        s.start();
+        Thread.sleep(200);
+
+        Hashtable env = new Hashtable(11);
+        env.put(Context.INITIAL_CONTEXT_FACTORY,
+            "com.sun.jndi.ldap.LdapCtxFactory");
+        env.put(Context.PROVIDER_URL, "ldap://localhost:" +
+            serverSock.getLocalPort());
+
+        env.put(Context.SECURITY_AUTHENTICATION,"simple");
+
+        env.put(Context.SECURITY_PRINCIPAL, "user");
+        env.put(Context.SECURITY_CREDENTIALS, "password");
+
+        env.put("com.sun.jndi.ldap.connect.timeout", "10");
+        env.put("com.sun.jndi.ldap.read.timeout", "3000");
+
+        InitialContext ctx = null;
+        try {
+            new LdapTimeoutTest().ldapReadTimeoutTest(env, false);
+            new LdapTimeoutTest().ldapReadTimeoutTest(env, true);
+            new LdapTimeoutTest().simpleAuthConnectTest(env);
+        } finally {
+            s.interrupt();
+            LdapTimeoutTest.pool.shutdown();
+        }
+
+        System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed);
+        if (failed > 0) throw new AssertionError("Some tests failed");
+    }
+
+    void ldapReadTimeoutTest(Hashtable env, boolean ssl) {
+        InitialContext ctx = null;
+        if (ssl) env.put(Context.SECURITY_PROTOCOL, "ssl");
+        ScheduledFuture killer = killSwitch();
+        long start = System.nanoTime();
+        try {
+            ctx = new InitialDirContext(env);
+            SearchControls scl = new SearchControls();
+            scl.setSearchScope(SearchControls.SUBTREE_SCOPE);
+            NamingEnumeration<SearchResult> answer = ((InitialDirContext)ctx)
+                .search("ou=People,o=JNDITutorial", "(objectClass=*)", scl);
+            // shouldn't reach here
+            fail();
+        } catch (NamingException e) {
+            if (ssl) {
+                if (e.getCause() instanceof SocketTimeoutException) {
+                    pass();
+                } else if (e.getCause() instanceof InterruptedIOException) {
+                    Thread.interrupted();
+                    fail();
+                }
+            } else {
+                pass();
+            }
+        } finally {
+            if (!shutItDown(killer, ctx)) fail();
+        }
+    }
+
+    void simpleAuthConnectTest(Hashtable env) {
+        InitialContext ctx = null;
+        ScheduledFuture killer = killSwitch();
+        long start = System.nanoTime();
+        try {
+            ctx = new InitialDirContext(env);
+            // shouldn't reach here
+            System.err.println("Fail: InitialDirContext succeeded");
+            fail();
+        } catch (NamingException e) {
+            long end = System.nanoTime();
+            if (e.getCause() instanceof SocketTimeoutException) {
+                if (TimeUnit.NANOSECONDS.toMillis(end - start) < 2900) {
+                    pass();
+                } else {
+                    System.err.println("Fail: Waited too long");
+                    fail();
+                }
+            } else if (e.getCause() instanceof InterruptedIOException) {
+                Thread.interrupted();
+                fail();
+            } else {
+                fail();
+            }
+        } finally {
+            if (!shutItDown(killer, ctx)) fail();
+        }
+    }
+
+    boolean shutItDown(ScheduledFuture killer, InitialContext ctx) {
+        killer.cancel(true);
+        try {
+            if (ctx != null) ctx.close();
+            return true;
+        } catch (NamingException ex) {
+            return false;
+        }
+    }
+
+    ScheduledFuture killSwitch() {
+        final Thread current = Thread.currentThread();
+        return LdapTimeoutTest.pool.schedule(new Callable<Void>() {
+            public Void call() throws Exception {
+                System.err.println("Fail: killSwitch()");
+                current.interrupt();
+                return null;
+            }
+        }, 5000, TimeUnit.MILLISECONDS);
+    }
+
+    static class Server extends Thread {
+        final ServerSocket serverSock;
+
+        Server(ServerSocket serverSock) {
+            this.serverSock = serverSock;
+        }
+
+        public void run() {
+            try {
+                Socket socket = serverSock.accept();
+            } catch (IOException e) {}
+        }
+    }
+}
+
--- a/test/com/sun/jndi/ldap/LdapsReadTimeoutTest.java	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,118 +0,0 @@
-/*
- * Copyright (c) 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.
- *
- * 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 7094377
- * @summary Com.sun.jndi.ldap.read.timeout doesn't work with ldaps.
- */
-
-import java.net.Socket;
-import java.net.ServerSocket;
-import java.io.*;
-import javax.naming.*;
-import javax.naming.directory.*;
-import java.util.Hashtable;
-
-public class LdapsReadTimeoutTest {
-
-    public static void main(String[] args) throws Exception {
-        boolean passed = false;
-
-        // create the server
-        try (Server server = Server.create()) {
-            // Set up the environment for creating the initial context
-            Hashtable<String,Object> env = new Hashtable<>(11);
-            env.put(Context.INITIAL_CONTEXT_FACTORY,
-                "com.sun.jndi.ldap.LdapCtxFactory");
-            env.put("com.sun.jndi.ldap.connect.timeout", "1000");
-            env.put("com.sun.jndi.ldap.read.timeout", "1000");
-            env.put(Context.PROVIDER_URL, "ldaps://localhost:" + server.port());
-
-
-            // Create initial context
-            DirContext ctx = new InitialDirContext(env);
-            try {
-                System.out.println("LDAP Client: Connected to the Server");
-
-                SearchControls scl = new SearchControls();
-                scl.setSearchScope(SearchControls.SUBTREE_SCOPE);
-                System.out.println("Performing Search");
-                NamingEnumeration<SearchResult> answer =
-                    ctx.search("ou=People,o=JNDITutorial", "(objectClass=*)", scl);
-            } finally {
-                // Close the context when we're done
-                ctx.close();
-            }
-        } catch (NamingException e) {
-            passed = true;
-            e.printStackTrace();
-        }
-
-        if (!passed) {
-            throw new Exception("Read timeout test failed," +
-                         " read timeout exception not thrown");
-        }
-        System.out.println("The test PASSED");
-    }
-
-    static class Server implements Runnable, Closeable {
-        private final ServerSocket ss;
-        private Socket sref;
-
-        private Server(ServerSocket ss) {
-            this.ss = ss;
-        }
-
-        static Server create() throws IOException {
-            Server server = new Server(new ServerSocket(0));
-            new Thread(server).start();
-            return server;
-        }
-
-        int port() {
-            return ss.getLocalPort();
-        }
-
-        public void run() {
-            try (Socket s = ss.accept()) {
-                sref = s;
-                System.out.println("Server: Connection accepted");
-                BufferedInputStream bis =
-                    new BufferedInputStream(s.getInputStream());
-                byte[] buf = new byte[100];
-                int n;
-                do {
-                    n = bis.read(buf);
-                } while (n > 0);
-            } catch (IOException e) {
-                // ignore
-            }
-        }
-
-        public void close() throws IOException {
-            ss.close();
-            sref.close();
-        }
-    }
-}
--- a/test/com/sun/jndi/ldap/ReadTimeoutTest.java	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,104 +0,0 @@
-/*
- * Copyright (c) 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.
- *
- * 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 6176036
- * @summary Read-timeout specification for LDAP operations
- */
-
-import java.net.Socket;
-import java.net.ServerSocket;
-import java.io.*;
-import javax.naming.*;
-import javax.naming.directory.*;
-import java.util.Hashtable;
-
-public class ReadTimeoutTest {
-
-    public static void main(String[] args) throws Exception {
-
-        boolean passed = false;
-
-        // Set up the environment for creating the initial context
-        Hashtable env = new Hashtable(11);
-        env.put(Context.INITIAL_CONTEXT_FACTORY,
-            "com.sun.jndi.ldap.LdapCtxFactory");
-        env.put("com.sun.jndi.ldap.read.timeout", "1000");
-        env.put(Context.PROVIDER_URL, "ldap://localhost:2001");
-
-        Server s = new Server();
-
-        try {
-
-            // start the server
-            s.start();
-
-            // Create initial context
-            DirContext ctx = new InitialDirContext(env);
-            System.out.println("LDAP Client: Connected to the Server");
-
-            SearchControls scl = new SearchControls();
-            scl.setSearchScope(SearchControls.SUBTREE_SCOPE);
-            System.out.println("Performing Search");
-            NamingEnumeration answer =
-                ctx.search("ou=People,o=JNDITutorial", "(objectClass=*)", scl);
-
-            // Close the context when we're done
-            ctx.close();
-        } catch (NamingException e) {
-            passed = true;
-            e.printStackTrace();
-        }
-        s.interrupt();
-        if (!passed) {
-            throw new Exception("Read timeout test failed," +
-                         " read timeout exception not thrown");
-        }
-        System.out.println("The test PASSED");
-    }
-
-    static class Server extends Thread {
-
-        static int serverPort = 2001;
-
-        Server() {
-        }
-
-        public void run() {
-            try {
-                ServerSocket serverSock = new ServerSocket(serverPort);
-                Socket socket = serverSock.accept();
-                System.out.println("Server: Connection accepted");
-
-                BufferedInputStream bin = new BufferedInputStream(socket.
-                                getInputStream());
-                while (true) {
-                    bin.read();
-                }
-            } catch (IOException e) {
-                // ignore
-            }
-    }
-}
-}
--- a/test/com/sun/servicetag/DeleteServiceTag.java	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,129 +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.
- */
-
-/*
- * @test
- * @bug     6622366
- * @summary Basic Test for deleting a service tag in a product registration
- * @author  Mandy Chung
- *
- * @run build DeleteServiceTag Util
- * @run main DeleteServiceTag
- */
-
-import com.sun.servicetag.*;
-import java.io.*;
-import java.util.*;
-
-public class DeleteServiceTag {
-    private static RegistrationData registration;
-    private static File regFile;
-    private static Map<String, ServiceTag> stMap =
-        new LinkedHashMap<String, ServiceTag>();
-    private static String[] files = new String[] {
-                                        "servicetag1.properties",
-                                        "servicetag2.properties",
-                                        "servicetag3.properties"
-                                    };
-
-    public static void main(String[] argv) throws Exception {
-        String registrationDir = System.getProperty("test.classes");
-        String servicetagDir = System.getProperty("test.src");
-
-        File original = new File(servicetagDir, "registration.xml");
-        regFile = new File(registrationDir, "registration.xml");
-        copyRegistrationXML(original, regFile);
-
-        // loads all the service tags
-        for (String f : files) {
-            File stfile = new File(servicetagDir, f);
-            ServiceTag svcTag = Util.newServiceTag(stfile);
-            stMap.put(svcTag.getInstanceURN(), svcTag);
-        }
-
-        // load the registration data with all service tags
-        BufferedInputStream in = new BufferedInputStream(new FileInputStream(regFile));
-        registration = RegistrationData.loadFromXML(in);
-
-        if (stMap.size() != files.length) {
-            throw new RuntimeException("Invalid service tag count= " +
-                stMap.size() + " expected=" + files.length);
-        }
-        // check the service tags
-        Util.checkRegistrationData(regFile.getCanonicalPath(), stMap);
-
-        // delete a service tag
-        deleteServiceTag(servicetagDir, files[0]);
-
-        System.out.println("Test passed: service tags deleted.");
-    }
-
-    private static void copyRegistrationXML(File from, File to) throws IOException {
-
-        to.delete();
-        BufferedReader reader = new BufferedReader(new FileReader(from));
-        PrintWriter writer = new PrintWriter(to);
-        try {
-            String line = null;
-            while ((line = reader.readLine()) != null) {
-                writer.println(line);
-            }
-            writer.flush();
-        } finally {
-            writer.close();
-        }
-    }
-
-    private static void deleteServiceTag(String parent, String filename) throws Exception {
-        File f = new File(parent, filename);
-        ServiceTag svcTag = Util.newServiceTag(f);
-
-        ServiceTag st = registration.removeServiceTag(svcTag.getInstanceURN());
-        if (st == null) {
-            throw new RuntimeException("RegistrationData.remove method" +
-                " returns null");
-        }
-        if (!Util.matches(st, svcTag)) {
-            throw new RuntimeException("ServiceTag added in the registration " +
-                " doesn't match.");
-        }
-        // check the service tags before storing the updated data
-        Util.checkRegistrationData(regFile.getCanonicalPath(), stMap);
-
-        ServiceTag st1 = registration.getServiceTag(svcTag.getInstanceURN());
-        if (st1 != null) {
-            throw new RuntimeException("RegistrationData.get method returns " +
-                "non-null.");
-        }
-        // Now remove the service tag from the map and store to the XML file
-        stMap.remove(svcTag.getInstanceURN());
-        BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(regFile));
-        try {
-            registration.storeToXML(out);
-        } finally {
-            out.close();
-        }
-    }
-}
--- a/test/com/sun/servicetag/DuplicateNotFound.java	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,97 +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.
- */
-
-/*
- * @test
- * @bug     6622366
- * @summary Basic Test for RegistrationData.removeServiceTag and
- *          updateServiceTag.
- * @author  Mandy Chung
- *
- * @run build DuplicateNotFound Util
- * @run main DuplicateNotFound
- */
-
-import com.sun.servicetag.*;
-import java.io.*;
-import java.util.*;
-
-public class DuplicateNotFound {
-    private static String servicetagDir = System.getProperty("test.src");
-    private static String[] files = new String[] {
-                                        "servicetag1.properties",
-                                        "servicetag2.properties",
-                                        "servicetag3.properties"
-                                    };
-
-    private static RegistrationData registration = new RegistrationData();
-
-    public static void main(String[] argv) throws Exception {
-        ServiceTag svcTag;
-        registration.addServiceTag(loadServiceTag(files[0]));
-        registration.addServiceTag(loadServiceTag(files[1]));
-        testDuplicate(files[0]);
-        testDuplicate(files[1]);
-        testNotFound(files[2]);
-    }
-
-    private static void testDuplicate(String filename) throws Exception {
-        boolean dup = false;
-        try {
-           registration.addServiceTag(loadServiceTag(filename));
-        } catch (IllegalArgumentException e) {
-           dup = true;
-        }
-        if (!dup) {
-           throw new RuntimeException(filename +
-               " added successfully but expected to be a duplicated.");
-        }
-    }
-    private static void testNotFound(String filename) throws Exception {
-        ServiceTag st = loadServiceTag(filename);
-        ServiceTag svctag = registration.getServiceTag(st.getInstanceURN());
-        if (svctag != null) {
-           throw new RuntimeException(st.getInstanceURN() +
-               " exists but expected not found");
-        }
-
-        svctag = registration.removeServiceTag(st.getInstanceURN());
-        if (svctag != null) {
-           throw new RuntimeException(st.getInstanceURN() +
-               " exists but expected not found");
-        }
-
-        svctag = registration.updateServiceTag(st.getInstanceURN(), "testing");
-        if (svctag != null) {
-           throw new RuntimeException(st.getInstanceURN() +
-               " updated successfully but expected not found.");
-        }
-    }
-
-    private static ServiceTag loadServiceTag(String filename) throws Exception {
-        File f = new File(servicetagDir, filename);
-        return Util.newServiceTag(f);
-    }
-}
--- a/test/com/sun/servicetag/FindServiceTags.java	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,141 +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.  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     6622366
- * @summary Basic Test for Registry.findServiceTags()
- * @author  Mandy Chung
- *
- * @run build FindServiceTags SvcTagClient Util
- * @run main FindServiceTags
- */
-
-import com.sun.servicetag.*;
-import java.io.*;
-import java.util.*;
-
-// This test creates a few service tags in the Registry.
-// Check if the findServiceTags method returns the expected ones.
-public class FindServiceTags {
-    private static String registryDir = System.getProperty("test.classes");
-    private static String servicetagDir = System.getProperty("test.src");
-    private static String[] files = new String[] {
-                                        "servicetag1.properties",
-                                        "servicetag2.properties",
-                                        "servicetag3.properties",
-                                        "servicetag4.properties",
-                                        "servicetag5.properties"
-                                    };
-
-    private static Registry registry;
-    private static Set<ServiceTag> set = new HashSet<ServiceTag>();
-    private static Set<String> productUrns = new HashSet<String>();
-    private static int expectedUrnCount = 3;
-
-    public static void main(String[] argv) throws Exception {
-        try {
-            registry = Util.getSvcTagClientRegistry();
-            runTest();
-        } finally {
-            // restore empty registry file
-            Util.emptyRegistryFile();
-        }
-        System.out.println("Test passed.");
-    }
-
-    public static void runTest() throws Exception {
-        for (String filename : files) {
-            File f = new File(servicetagDir, filename);
-            ServiceTag svcTag = Util.newServiceTag(f);
-            ServiceTag st = registry.addServiceTag(svcTag);
-
-            set.add(st);
-            productUrns.add(st.getProductURN());
-        }
-        if (productUrns.size() != expectedUrnCount) {
-            throw new RuntimeException("Unexpected number of product URNs = " +
-                productUrns.size() + " expected " + expectedUrnCount);
-        }
-        if (set.size() != files.length) {
-            throw new RuntimeException("Unexpected number of service tags = " +
-                set.size() + " expected " + files.length);
-        }
-        String purn = null;
-        for (String urn : productUrns) {
-            if (purn == null) {
-                // save the first product_urn for later use
-                purn = urn;
-            }
-            findServiceTags(urn);
-        }
-
-        // remove all service tags of purn
-        Set<ServiceTag> tags = registry.findServiceTags(purn);
-        for (ServiceTag st : tags) {
-            System.out.println("Removing service tag " + st.getInstanceURN());
-            registry.removeServiceTag(st.getInstanceURN());
-        }
-        tags = registry.findServiceTags(purn);
-        if (tags.size() != 0) {
-            throw new RuntimeException("Unexpected service tag count = " +
-                tags.size());
-        }
-
-    }
-
-    private static void findServiceTags(String productUrn) throws Exception {
-        Set<ServiceTag> found = registry.findServiceTags(productUrn);
-        Set<ServiceTag> matched = new HashSet<ServiceTag>();
-        System.out.println("Finding service tags of product_urn=" +
-            productUrn);
-        for (ServiceTag st : set) {
-            if (st.getProductURN().equals(productUrn)) {
-                System.out.println(st.getInstanceURN());
-                matched.add(st);
-            }
-        }
-        if (found.size() != matched.size()) {
-            throw new RuntimeException("Unmatched service tag count = " +
-                found.size() + " expected " + matched.size());
-        }
-
-        for (ServiceTag st0 : found) {
-            ServiceTag st = null;
-            for (ServiceTag st1 : matched) {
-                if (Util.matches(st0, st1)) {
-                    st = st1;
-                    break;
-                }
-            }
-            if (st == null) {
-                System.out.println("product_urn=" + st0.getProductURN());
-                System.out.println("instance_urn=" + st0.getInstanceURN() );
-                throw new RuntimeException(st0.getInstanceURN() +
-                    " not expected in the returned list");
-            }
-        }
-    }
-}
--- a/test/com/sun/servicetag/InstanceUrnCheck.java	Wed Jun 19 21:51:50 2013 -0700
+++ /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.
- */
-
-/*
- * @test
- * @bug     6622366
- * @summary Basic Test for checking instance_urn
- * @author  Mandy Chung
- *
- * @run build InstanceUrnCheck Util
- * @run main InstanceUrnCheck
- */
-
-import com.sun.servicetag.*;
-import java.io.*;
-import java.util.*;
-
-public class InstanceUrnCheck {
-    private static String servicetagDir = System.getProperty("test.src");
-    private static String[] files = new String[] {
-                                        "servicetag1.properties",
-                                        "servicetag2.properties",
-                                        "servicetag3.properties"
-                                    };
-    private static RegistrationData registration = new RegistrationData();
-
-    public static void main(String[] argv) throws Exception {
-        for (String f : files) {
-            addServiceTag(f);
-        }
-    }
-
-   private static void addServiceTag(String filename) throws Exception {
-        File f = new File(servicetagDir, filename);
-        ServiceTag svcTag = Util.newServiceTag(f, true /* no instance_urn */);
-        ServiceTag st = registration.addServiceTag(svcTag);
-        if (!Util.matchesNoInstanceUrn(svcTag, st)) {
-            throw new RuntimeException("ServiceTag " +
-                " doesn't match.");
-        }
-        System.out.println("New service tag instance_urn=" + st.getInstanceURN());
-        if (!st.getInstanceURN().startsWith("urn:st:")) {
-            throw new RuntimeException("Invalid generated instance_urn " +
-                st.getInstanceURN());
-        }
-        if (st.getInstallerUID() != -1) {
-            throw new RuntimeException("Invalid installer_uid " +
-                st.getInstallerUID());
-        }
-        if (st.getTimestamp() == null) {
-            throw new RuntimeException("null timestamp ");
-        }
-    }
-}
--- a/test/com/sun/servicetag/InvalidRegistrationData.java	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +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.
- */
-
-/*
- * @test
- * @bug     6622366
- * @summary Basic Test for invalid product registry
- * @author  Mandy Chung
- *
- * @run build InvalidRegistrationData
- * @run main InvalidRegistrationData
- */
-
-import com.sun.servicetag.*;
-import java.io.*;
-import java.util.*;
-
-public class InvalidRegistrationData {
-    public static void main(String[] argv) throws Exception {
-        String servicetagDir = System.getProperty("test.src");
-
-        checkRegistrationData(servicetagDir, "missing-environ-field.xml");
-        checkRegistrationData(servicetagDir, "newer-registry-version.xml");
-    }
-
-    private static void checkRegistrationData(String parent, String filename)
-           throws Exception {
-        boolean thrown = false;
-        File f = new File(parent, filename);
-        BufferedInputStream in = new BufferedInputStream(new FileInputStream(f));
-        try {
-            RegistrationData regData = RegistrationData.loadFromXML(in);
-        } catch (IllegalArgumentException e) {
-            System.out.println(e.getMessage() + " thrown expected");
-            thrown = true;
-        }
-
-        if (!thrown) {
-            throw new RuntimeException("ERROR: No IllegalArgumentException thrown");
-        }
-    }
-
-}
--- a/test/com/sun/servicetag/InvalidServiceTag.java	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +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.
- */
-
-/*
- * @test
- * @bug     6622366
- * @summary Basic Test for ServiceTag.newServiceTag() to test invalid fields.
- * @author  Mandy Chung
- *
- * @run build InvalidServiceTag
- * @run main InvalidServiceTag
- */
-
-import com.sun.servicetag.*;
-import java.io.*;
-import java.util.*;
-
-public class InvalidServiceTag {
-    private final static int MAX_CONTAINER_LEN = 64 - 1;
-    public static void main(String[] argv) throws Exception {
-        // all fields valid
-        ServiceTag st1 = ServiceTag.newInstance("product name",
-                                                "product version",
-                                                "product urn",
-                                                "product parent",
-                                                "product parent urn",
-                                                "product defined instance ID",
-                                                "product vendor",
-                                                "platform arch",
-                                                "container",
-                                                "source");
-        // empty optional field
-        ServiceTag st2 = ServiceTag.newInstance("product name",
-                                                "product version",
-                                                "product urn",
-                                                "product parent",
-                                                "",
-                                                "",
-                                                "product vendor",
-                                                "platform arch",
-                                                "container",
-                                                "source");
-        // Invalid - empty required field
-        setInvalidContainer("");
-        // Invalid - required field exceeds max length.
-        StringBuilder sb = new StringBuilder();
-        for (int i = 0; i <= MAX_CONTAINER_LEN; i++) {
-            sb.append('x');
-        }
-        setInvalidContainer(sb.toString());
-        System.out.println("Test passed.");
-    }
-    private static void setInvalidContainer(String container) {
-        boolean exceptionThrown = false;
-        try {
-            ServiceTag st2 = ServiceTag.newInstance("product name",
-                                                    "product version",
-                                                    "product urn",
-                                                    "product parent",
-                                                    "product parent urn",
-                                                    "product defined instance ID",
-                                                    "product vendor",
-                                                    "platform arch",
-                                                    container,
-                                                    "source");
-        } catch (IllegalArgumentException iae) {
-            iae.printStackTrace();
-            exceptionThrown = true;
-        }
-        if (!exceptionThrown) {
-            throw new RuntimeException("IllegalArgumentException not thrown");
-        }
-    }
-}
--- a/test/com/sun/servicetag/JavaServiceTagTest.java	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,177 +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.
- */
-
-/*
- * @test
- * @bug     6622366
- * @summary Basic Test for ServiceTag.getJavaServiceTag()
- *          Disable creating the service tag in the system registry.
- *          Verify the existence of registration.xml file and the
- *          content of the service tag.
- * @author  Mandy Chung
- *
- * @run build JavaServiceTagTest
- * @run main JavaServiceTagTest
- */
-
-import com.sun.servicetag.*;
-import java.io.*;
-import java.util.*;
-
-public class JavaServiceTagTest {
-    public static void main(String[] argv) throws Exception {
-        String registrationDir = System.getProperty("test.classes");
-
-        // disable calling to stclient
-        System.setProperty("servicetag.sthelper.supported", "false");
-
-        if (Registry.isSupported()) {
-            throw new RuntimeException("Registry.isSupported() should " +
-                "return false");
-        }
-        // For debugging
-        // System.setProperty("servicetag.verbose", "");
-
-        // cleanup the registration.xml and servicetag file in the test directory
-        System.setProperty("servicetag.dir.path", registrationDir);
-        File regFile = new File(registrationDir, "registration.xml");
-        regFile.delete();
-        File svcTagFile = new File(registrationDir, "servicetag");
-        svcTagFile.delete();
-
-        ServiceTag svctag = ServiceTag.getJavaServiceTag("JavaServiceTagTest");
-        checkServiceTag(svctag);
-
-        if (svcTagFile.exists()) {
-            throw new RuntimeException(svcTagFile + " should not exist.");
-        }
-
-        // registration.xml should be created
-        if (!regFile.exists()) {
-            throw new RuntimeException(regFile + " not created.");
-        }
-        BufferedInputStream in = new BufferedInputStream(new FileInputStream(regFile));
-        RegistrationData registration = RegistrationData.loadFromXML(in);
-        Set<ServiceTag> c = registration.getServiceTags();
-        if (c.size() != 1) {
-            throw new RuntimeException(regFile + " has " + c.size() +
-                " service tags. Expected 1.");
-        }
-        ServiceTag st = registration.getServiceTag(svctag.getInstanceURN());
-        if (!Util.matches(st, svctag)) {
-            throw new RuntimeException("ServiceTag " +
-                " doesn't match.");
-        }
-    }
-
-    private static void checkServiceTag(ServiceTag st) throws IOException {
-        Properties props = loadSwordfishEntries();
-        if (st.getProductURN().
-                equals(props.getProperty("servicetag.jdk.urn"))) {
-            if (!st.getProductName().
-                    equals(props.getProperty("servicetag.jdk.name"))) {
-                throw new RuntimeException("Product URN and name don't match.");
-            }
-        } else if (st.getProductURN().
-                equals(props.getProperty("servicetag.jre.urn"))) {
-            if (!st.getProductName().
-                    equals(props.getProperty("servicetag.jre.name"))) {
-                throw new RuntimeException("Product URN and name don't match.");
-            }
-        } else {
-            throw new RuntimeException("Unexpected product_urn: " +
-                st.getProductURN());
-        }
-        if (!st.getProductVersion().
-                equals(System.getProperty("java.version"))) {
-            throw new RuntimeException("Unexpected product_version: " +
-                st.getProductVersion());
-        }
-        if (!st.getProductParent().
-                equals(props.getProperty("servicetag.parent.name"))) {
-            throw new RuntimeException("Unexpected product_parent: " +
-                st.getProductParent());
-        }
-        if (!st.getProductParentURN().
-                equals(props.getProperty("servicetag.parent.urn"))) {
-            throw new RuntimeException("Unexpected product_parent_urn: " +
-                st.getProductParentURN());
-        }
-        if (!st.getPlatformArch().
-                equals(System.getProperty("os.arch"))) {
-            throw new RuntimeException("Unexpected platform_arch: " +
-                st.getPlatformArch());
-        }
-        String vendor = System.getProperty("java.vendor");
-        if (!st.getProductVendor().
-                equals(vendor)) {
-            throw new RuntimeException("Unexpected product_vendor: " +
-                st.getProductVendor());
-        }
-        if (!st.getSource().
-                equals("JavaServiceTagTest")) {
-            throw new RuntimeException("Unexpected source: " +
-                st.getSource());
-        }
-        String[] ss = st.getProductDefinedInstanceID().split(",");
-        boolean id = false;
-        boolean dir = false;
-        for (String s : ss) {
-            String[] values = s.split("=");
-            if (values[0].equals("id")) {
-                id = true;
-                String[] sss = values[1].split(" ");
-                if (!sss[0].equals(System.getProperty("java.runtime.version"))) {
-                    throw new RuntimeException("Unexpected version in id: " +
-                        sss[0]);
-                }
-                if (sss.length < 2) {
-                    throw new RuntimeException("Unexpected id=" + values[1]);
-                }
-            } else if (values[0].equals("dir")) {
-                dir = true;
-            }
-        }
-        if (!id || !dir) {
-            throw new RuntimeException("Unexpected product_defined_instance_id: " +
-                st.getProductDefinedInstanceID());
-        }
-    }
-
-    private static Properties loadSwordfishEntries()
-           throws IOException {
-        int version = sun.misc.Version.jdkMinorVersion();
-        String filename = "/com/sun/servicetag/resources/javase_" +
-                version + "_swordfish.properties";
-        InputStream in = Installer.class.getClass().getResourceAsStream(filename);
-        Properties props = new Properties();
-        try {
-            props.load(in);
-        } finally {
-            in.close();
-        }
-        return props;
-    }
-}
--- a/test/com/sun/servicetag/JavaServiceTagTest1.java	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,250 +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.  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     6622366
- * @summary Basic Test for ServiceTag.getJavaServiceTag(String)
- *          to verify that the registration.xml and servicetag files
- *          are both created correctly.
- * @author  Mandy Chung
- *
- * @run build JavaServiceTagTest1 SvcTagClient Util
- * @run main JavaServiceTagTest1
- */
-
-import com.sun.servicetag.*;
-import java.io.*;
-import java.util.*;
-
-public class JavaServiceTagTest1 {
-    private static String registrationDir = System.getProperty("test.classes");
-    private static String servicetagDir = System.getProperty("test.src");
-    private static File regFile;
-    private static File svcTagFile;
-    private static Registry registry;
-    public static void main(String[] argv) throws Exception {
-        try {
-            registry = Util.getSvcTagClientRegistry();
-            runTest();
-        } finally {
-            // restore empty registry file
-            Util.emptyRegistryFile();
-        }
-    }
-
-    private static void runTest() throws Exception {
-        // cleanup the registration.xml and servicetag file in the test directory
-        System.setProperty("servicetag.dir.path", registrationDir);
-        regFile = new File(registrationDir, "registration.xml");
-        regFile.delete();
-
-        svcTagFile = new File(registrationDir, "servicetag");
-        svcTagFile.delete();
-
-        // verify that only one service tag is created
-        ServiceTag st1 = testJavaServiceTag("Test1");
-
-        // getJavaServiceTag method should create a new service tag
-        // and delete the old one
-        ServiceTag st2 = testJavaServiceTag("Test2");
-        if (registry.getServiceTag(st1.getInstanceURN()) != null) {
-            throw new RuntimeException("instance_urn: " + st1.getInstanceURN() +
-                " exists but expected to be removed");
-        }
-
-        // expected to have different instance_urn
-        if (st1.getInstanceURN().equals(st2.getInstanceURN())) {
-            throw new RuntimeException("instance_urn: " + st1.getInstanceURN() +
-                " == " + st2.getInstanceURN());
-        }
-
-        // Delete the service tag from the Registry and the servicetag file
-        if (registry.removeServiceTag(st2.getInstanceURN()) == null) {
-            throw new RuntimeException("Failed to remove " +
-                st1.getInstanceURN() + " from the registry");
-        }
-        svcTagFile.delete();
-
-        // call the getJavaServiceTag(String) method again
-        // should create the servicetag file.
-        ServiceTag st3 = testJavaServiceTag("Test2");
-        if (!Util.matches(st2, st3)) {
-            System.out.println(st2);
-            System.out.println(st3);
-            throw new RuntimeException("Test Failed: Expected to be the same");
-        }
-
-    }
-
-    private static ServiceTag testJavaServiceTag(String source) throws Exception {
-        ServiceTag svctag = ServiceTag.getJavaServiceTag(source);
-        checkServiceTag(svctag, source);
-
-        // verify if registration.xml is created
-        if (!regFile.exists()) {
-            throw new RuntimeException(regFile + " not created.");
-        }
-
-        // verify the registration.xml content is the expected service tag
-        BufferedInputStream in = new BufferedInputStream(new FileInputStream(regFile));
-        RegistrationData registration = RegistrationData.loadFromXML(in);
-        Set<ServiceTag> c = registration.getServiceTags();
-        if (c.size() != 1) {
-            throw new RuntimeException(regFile + " has " + c.size() +
-                " service tags. Expected 1.");
-        }
-        ServiceTag st = registration.getServiceTag(svctag.getInstanceURN());
-        if (!Util.matches(st, svctag)) {
-            throw new RuntimeException("RegistrationData ServiceTag " +
-                " doesn't match.");
-        }
-
-        // verify the service tag added in the registry
-        st = registry.getServiceTag(svctag.getInstanceURN());
-        if (!Util.matches(st, svctag)) {
-            throw new RuntimeException("Registry ServiceTag " +
-                " doesn't match.");
-        }
-
-        // verify if servicetag file is created
-        if (!svcTagFile.exists()) {
-            throw new RuntimeException(svcTagFile + " not created.");
-        }
-
-        // verify that the servicetag file only contains one instance_urn
-        BufferedReader reader = new BufferedReader(new FileReader(svcTagFile));
-        int count = 0;
-        try {
-            String line;
-            while ((line = reader.readLine()) != null) {
-                if (line.equals(svctag.getInstanceURN())) {
-                    count++;
-                } else {
-                    throw new RuntimeException("servicetag contains " +
-                        " unexpected instance_urn " + line);
-                }
-            }
-        } finally {
-            reader.close();
-        }
-        if (count != 1) {
-            throw new RuntimeException("servicetag contains unexpected " +
-                "number of instance_urn = " + count);
-        }
-        return svctag;
-    }
-
-    private static void checkServiceTag(ServiceTag st, String source)
-            throws IOException {
-        Properties props = loadSwordfishEntries();
-        if (st.getProductURN().
-                equals(props.getProperty("servicetag.jdk.urn"))) {
-            if (!st.getProductName().
-                    equals(props.getProperty("servicetag.jdk.name"))) {
-                throw new RuntimeException("Product URN and name don't match.");
-            }
-        } else if (st.getProductURN().
-                equals(props.getProperty("servicetag.jre.urn"))) {
-            if (!st.getProductName().
-                    equals(props.getProperty("servicetag.jre.name"))) {
-                throw new RuntimeException("Product URN and name don't match.");
-            }
-        } else {
-            throw new RuntimeException("Unexpected product_urn: " +
-                st.getProductURN());
-        }
-        if (!st.getProductVersion().
-                equals(System.getProperty("java.version"))) {
-            throw new RuntimeException("Unexpected product_version: " +
-                st.getProductVersion());
-        }
-        if (!st.getProductParent().
-                equals(props.getProperty("servicetag.parent.name"))) {
-            throw new RuntimeException("Unexpected product_parent: " +
-                st.getProductParent());
-        }
-        if (!st.getProductParentURN().
-                equals(props.getProperty("servicetag.parent.urn"))) {
-            throw new RuntimeException("Unexpected product_parent_urn: " +
-                st.getProductParentURN());
-        }
-        if (!st.getPlatformArch().
-                equals(System.getProperty("os.arch"))) {
-            throw new RuntimeException("Unexpected platform_arch: " +
-                st.getPlatformArch());
-        }
-
-        String vendor = System.getProperty("java.vendor");
-        if (!st.getProductVendor().
-                equals(vendor)) {
-            throw new RuntimeException("Unexpected product_vendor: " +
-                st.getProductVendor());
-        }
-        if (!st.getSource().
-                equals(source)) {
-            throw new RuntimeException("Unexpected source: " +
-                st.getSource() + " expected: " + source);
-        }
-        String[] ss = st.getProductDefinedInstanceID().split(",");
-        boolean id = false;
-        boolean dir = false;
-        for (String s : ss) {
-            String[] values = s.split("=");
-            if (values[0].equals("id")) {
-                id = true;
-                String[] sss = values[1].split(" ");
-                if (!sss[0].equals(System.getProperty("java.runtime.version"))) {
-                    throw new RuntimeException("Unexpected version in id: " +
-                        sss[0]);
-                }
-                if (sss.length < 2) {
-                    throw new RuntimeException("Unexpected id=" + values[1]);
-                }
-            } else if (values[0].equals("dir")) {
-                dir = true;
-            }
-        }
-        if (!id || !dir) {
-            throw new RuntimeException("Unexpected product_defined_instance_id: " +
-                st.getProductDefinedInstanceID());
-        }
-    }
-
-    private static Properties loadSwordfishEntries()
-           throws IOException {
-        int version = sun.misc.Version.jdkMinorVersion();
-        String filename = "/com/sun/servicetag/resources/javase_" +
-                version + "_swordfish.properties";
-        InputStream in = Installer.class.getClass().getResourceAsStream(filename);
-        Properties props = new Properties();
-        try {
-            props.load(in);
-        } finally {
-            in.close();
-        }
-        return props;
-    }
-}
--- a/test/com/sun/servicetag/NewRegistrationData.java	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,105 +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.
- */
-
-/*
- * @test
- * @bug     6622366
- * @summary Basic Test for Registration Data
- * @author  Mandy Chung
- *
- * @run build NewRegistrationData Util
- * @run main NewRegistrationData
- */
-
-import com.sun.servicetag.*;
-import java.io.*;
-import java.util.*;
-
-public class NewRegistrationData {
-    private static RegistrationData regData;
-    private static Map<String, ServiceTag> stMap = new LinkedHashMap<String, ServiceTag>();
-    private static String[] files = new String[] {
-                                        "servicetag1.properties",
-                                        "servicetag2.properties",
-                                        "servicetag3.properties"
-                                    };
-
-    public static void main(String[] argv) throws Exception {
-        String regDataDir = System.getProperty("test.classes");
-        String servicetagDir = System.getProperty("test.src");
-
-        File reg = new File(regDataDir, "registration.xml");
-        // Make sure a brand new file is created
-        reg.delete();
-
-        regData = new RegistrationData();
-        if (regData.getRegistrationURN().isEmpty()) {
-            throw new RuntimeException("Empty registration urn");
-        }
-
-        int count = 0;
-        for (String f : files) {
-            addServiceTag(servicetagDir, f, ++count);
-        }
-
-        // check if the registration data contains all service tags
-        Set<ServiceTag> c = regData.getServiceTags();
-        for (ServiceTag st : c) {
-            if (!Util.matches(st, regData.getServiceTag(st.getInstanceURN()))) {
-                throw new RuntimeException("ServiceTag added in the regData " +
-                    " doesn't match.");
-            }
-        }
-
-        // store the service tag to a file
-        BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(reg));
-        try {
-            regData.storeToXML(out);
-        } finally {
-            out.close();
-        }
-
-        Util.checkRegistrationData(reg.getCanonicalPath(), stMap);
-        System.out.println("Test passed: " + count + " service tags added");
-    }
-
-    private static void addServiceTag(String parent, String filename, int count) throws Exception {
-        File f = new File(parent, filename);
-        ServiceTag svcTag = Util.newServiceTag(f);
-        regData.addServiceTag(svcTag);
-        stMap.put(svcTag.getInstanceURN(), svcTag);
-
-        Set<ServiceTag> c = regData.getServiceTags();
-        if (c.size() != count) {
-            throw new RuntimeException("Invalid service tag count= " +
-                c.size() + " expected=" + count);
-        }
-        ServiceTag st = regData.getServiceTag(svcTag.getInstanceURN());
-        if (!Util.matches(st, svcTag)) {
-            throw new RuntimeException("ServiceTag added in the regData " +
-                " doesn't match.");
-        }
-    }
-}
--- a/test/com/sun/servicetag/SvcTagClient.java	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,200 +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.
- */
-
-/*
- * @bug     6622366
- */
-
-import com.sun.servicetag.*;
-import java.io.*;
-import java.util.*;
-
-/**
- * A utility class simulating stclient for testing purpose.
- */
-public class SvcTagClient {
-    private static File xmlFile;
-    private static RegistrationData registration;
-    private static String instanceURN;
-    private static String productName;
-    private static String productVersion;
-    private static String productURN;
-    private static String productParent;
-    private static String productParentURN = ""; // optional
-    private static String productDefinedInstanceID = ""; //optional
-    private static String productVendor;
-    private static String platformArch;
-    private static String container;
-    private static String source;
-
-    // stclient exit value
-    private static final int ST_ERR_REC_NOT_FOUND = 225;
-
-    public static void main(String[] args) throws Exception {
-        String path = System.getProperty("stclient.registry.path");
-        if (path == null) {
-            System.err.println("stclient registry path missing");
-            System.exit(-1);
-        }
-        xmlFile = new File(path);
-        if (xmlFile.exists()) {
-            BufferedInputStream in = new BufferedInputStream(new FileInputStream(xmlFile));
-            registration = RegistrationData.loadFromXML(in);
-        } else {
-            registration = new RegistrationData();
-        }
-        boolean add = false;
-        boolean delete = false;
-        boolean update = false;
-        boolean get = false;
-        boolean find = false;
-
-        int count = 0;
-        while (count < args.length) {
-            String arg = args[count];
-            if (!arg.startsWith("-")) {
-                System.err.println("Invalid option:" + arg);
-                System.exit(-1);
-            }
-            if (arg.equals("-a")) {
-                add = true;
-            } else if (arg.equals("-d")) {
-                delete = true;
-            } else if (arg.equals("-u")) {
-                update = true;
-            } else if (arg.equals("-g")) {
-                get = true;
-            } else if (arg.equals("-f")) {
-                find = true;
-                productURN = "";
-            } else if (arg.equals("-t")) {
-                productURN = args[++count];
-            } else if (arg.equals("-i")) {
-                instanceURN = args[++count];
-            } else if (arg.equals("-p")) {
-                productName = args[++count];
-            } else if (arg.equals("-e")) {
-                productVersion = args[++count];
-            } else if (arg.equals("-t")) {
-                productURN = args[++count];
-            } else if (arg.equals("-F")) {
-                productParentURN = args[++count];
-            } else if (arg.equals("-P")) {
-                productParent = args[++count];
-            } else if (arg.equals("-I")) {
-                productDefinedInstanceID = args[++count];
-            } else if (arg.equals("-m")) {
-                productVendor = args[++count];
-            } else if (arg.equals("-A")) {
-                platformArch = args[++count];
-            } else if (arg.equals("-z")) {
-                container = args[++count];
-            } else if (arg.equals("-S")) {
-                source = args[++count];
-            } else {
-                System.err.println("Invalid option:" + arg);
-                System.exit(-1);
-            }
-            count++;
-        }
-
-        if (add) {
-            addServiceTag();
-        } else if (delete) {
-            deleteServiceTag();
-        } else if (update) {
-            updateServiceTag();
-        } else if (get) {
-            getServiceTag();
-        } else if (find) {
-            findServiceTags();
-        } else {
-            System.err.println("Error");
-            System.exit(-1);
-        }
-        updateXmlFile();
-    }
-    private static String OUTPUT = "Product instance URN=";
-
-    private static void addServiceTag() {
-        if (instanceURN == null) {
-            instanceURN = ServiceTag.generateInstanceURN();
-        }
-        ServiceTag st = ServiceTag.newInstance(instanceURN,
-                                               productName,
-                                               productVersion,
-                                               productURN,
-                                               productParent,
-                                               productParentURN,
-                                               productDefinedInstanceID,
-                                               productVendor,
-                                               platformArch,
-                                               container,
-                                               source);
-        registration.addServiceTag(st);
-        System.out.println(OUTPUT + st.getInstanceURN());
-    }
-
-    private static void deleteServiceTag() {
-        registration.removeServiceTag(instanceURN);
-        System.out.println("instance_urn=" + instanceURN + " deleted");
-    }
-
-    private static void updateServiceTag() {
-        registration.updateServiceTag(instanceURN, productDefinedInstanceID);
-        System.out.println("instance_urn=" + instanceURN + " updated");
-    }
-
-    private static void getServiceTag() {
-        ServiceTag st = registration.getServiceTag(instanceURN);
-        if (st == null) {
-            System.err.println("instance_urn=" + instanceURN + " not found");
-            System.exit(ST_ERR_REC_NOT_FOUND);
-        } else {
-            System.out.println(st);
-        }
-    }
-
-    private static void findServiceTags() {
-        Set<ServiceTag> set = registration.getServiceTags();
-        for (ServiceTag st : set) {
-            if (st.getProductURN().equals(productURN)) {
-                System.out.println(st.getInstanceURN());
-            }
-        }
-        if (set.size() == 0) {
-            System.out.println("No records found");
-            System.exit(ST_ERR_REC_NOT_FOUND);
-        }
-    }
-    private static void updateXmlFile() throws IOException {
-        BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(xmlFile));
-        try {
-            registration.storeToXML(out);
-        } finally {
-            out.close();
-        }
-    }
-}
--- a/test/com/sun/servicetag/SystemRegistryTest.java	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,139 +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.  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     6622366
- * @summary Basic Test for registry class
- *          by replacing stclient with SvcTagClient utility
- * @author  Mandy Chung
- *
- * @run build SvcTagClient SystemRegistryTest Util
- * @run main SystemRegistryTest
- */
-
-import com.sun.servicetag.*;
-import java.io.*;
-import java.util.*;
-
-public class SystemRegistryTest {
-    private static String registryDir = System.getProperty("test.classes");
-    private static String servicetagDir = System.getProperty("test.src");
-    private static List<ServiceTag> list = new ArrayList<ServiceTag>();
-    private static String[] files = new String[] {
-                                        "servicetag1.properties",
-                                        "servicetag2.properties",
-                                        "servicetag3.properties"
-                                    };
-
-    private static Registry registry;
-    public static void main(String[] argv) throws Exception {
-        try {
-            registry = Util.getSvcTagClientRegistry();
-            runTest();
-        } finally {
-            // restore empty registry file
-            Util.emptyRegistryFile();
-        }
-    }
-
-    private static void runTest() throws Exception {
-        for (String filename : files) {
-            File f = new File(servicetagDir, filename);
-            ServiceTag svcTag = Util.newServiceTag(f);
-            ServiceTag st = registry.addServiceTag(svcTag);
-            list.add(st);
-            System.out.println(st);
-        }
-
-        testDuplicate(list.get(0));
-        testNotFound();
-
-        // remove a service tag
-        String urn = list.get(0).getInstanceURN();
-        ServiceTag svcTag = registry.removeServiceTag(urn);
-        if (!Util.matches(svcTag, list.get(0))) {
-           throw new RuntimeException(urn +
-               " deleted but does not match.");
-        }
-
-        // get a service tag
-        svcTag = list.get(1);
-        urn = svcTag.getInstanceURN();
-        ServiceTag st = registry.getServiceTag(urn);
-        if (!Util.matches(svcTag, st)) {
-           throw new RuntimeException(urn +
-               " returned from getServiceTag but does not match.");
-        }
-        // update the service tag
-        registry.updateServiceTag(urn, "My new defined ID");
-        st = registry.getServiceTag(urn);
-        if (Util.matches(svcTag, st)) {
-           throw new RuntimeException(urn +
-               " updated but expected to be different.");
-        }
-
-        if (!st.getProductDefinedInstanceID().equals("My new defined ID")) {
-            throw new RuntimeException("Invalid product_defined_instance_id " +
-                st.getProductDefinedInstanceID());
-        }
-        if (st.getInstallerUID() != -1) {
-            throw new RuntimeException("Invalid installer_uid " +
-                st.getInstallerUID());
-        }
-        if (st.getTimestamp().equals(svcTag.getTimestamp())) {
-            throw new RuntimeException("Timestamp " +
-                st.getTimestamp() + " == " + svcTag.getTimestamp());
-        }
-
-    }
-    private static void testDuplicate(ServiceTag st) throws IOException {
-        boolean dup = false;
-        try {
-           registry.addServiceTag(st);
-        } catch (IllegalArgumentException e) {
-           dup = true;
-        }
-        if (!dup) {
-           throw new RuntimeException(st.getInstanceURN() +
-               " added successfully but expected to be a duplicated.");
-        }
-    }
-
-    private static void testNotFound() throws Exception {
-        String instanceURN = "urn:st:721cf98a-f4d7-6231-bb1d-f2f5aa903ef7";
-        ServiceTag svctag = registry.removeServiceTag(instanceURN);
-        if (svctag != null) {
-           throw new RuntimeException(instanceURN +
-               " exists but expected not found");
-        }
-
-        svctag = registry.updateServiceTag(instanceURN, "testing");
-        if (svctag != null) {
-           throw new RuntimeException(instanceURN +
-               " exists but expected not found");
-        }
-    }
-}
--- a/test/com/sun/servicetag/TestLoadFromXML.java	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +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.
- */
-
-/*
- * @test
- * @bug     6622366
- * @summary Basic Test for RegistrationData.loadFromXML
- * @author  Mandy Chung
- *
- * @run build TestLoadFromXML
- * @run main TestLoadFromXML
- */
-
-import com.sun.servicetag.*;
-import java.io.*;
-import java.util.*;
-
-public class TestLoadFromXML {
-    public static void main(String[] argv) throws Exception {
-        String registrationDir = System.getProperty("test.classes");
-        String servicetagDir = System.getProperty("test.src");
-
-        File inFile = new File(servicetagDir, "registration.xml");
-        File outFile = new File(registrationDir, "out.xml");
-        BufferedInputStream in = new BufferedInputStream(new FileInputStream(inFile));
-        RegistrationData regData = RegistrationData.loadFromXML(in);
-        boolean closed = false;
-        try {
-           in.read();
-        } catch (IOException e) {
-           // expect the InputStream is closed
-           closed = true;
-           System.out.println("*** Expected IOException ***");
-           e.printStackTrace();
-        }
-        if (!closed) {
-           throw new RuntimeException("InputStream not closed after " +
-               "RegistrationData.loadFromXML() call");
-        }
-
-        BufferedOutputStream out =
-            new BufferedOutputStream(new FileOutputStream(outFile));
-        regData.storeToXML(out);
-        // should be able to write to the OutputStream
-        out.write(0);
-    }
-}
--- a/test/com/sun/servicetag/UpdateServiceTagTest.java	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,109 +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.
- */
-
-/*
- * @test
- * @bug     6622366
- * @summary Basic Test for RegistrationData.updateServiceTag
- * @author  Mandy Chung
- *
- * @run build UpdateServiceTagTest Util
- * @run main UpdateServiceTagTest
- */
-
-import com.sun.servicetag.*;
-import java.io.*;
-import java.util.*;
-
-public class UpdateServiceTagTest {
-    private static String servicetagDir = System.getProperty("test.src");
-    private static String[] files = new String[] {
-                                        "servicetag1.properties",
-                                        "servicetag2.properties",
-                                        "servicetag3.properties"
-                                    };
-    private static RegistrationData registration = new RegistrationData();
-    private static Set<ServiceTag> set = new HashSet<ServiceTag>();
-
-    public static void main(String[] argv) throws Exception {
-        for (String f : files) {
-            ServiceTag st = addServiceTag(f);
-            set.add(st);
-        }
-        Thread.sleep(1000);
-        for (ServiceTag st : set) {
-            updateServiceTag(st);
-        }
-    }
-
-    private static ServiceTag addServiceTag(String filename) throws Exception {
-        File f = new File(servicetagDir, filename);
-        ServiceTag svcTag = Util.newServiceTag(f, true /* no instance_urn */);
-        ServiceTag st = registration.addServiceTag(svcTag);
-        if (!Util.matchesNoInstanceUrn(svcTag, st)) {
-            throw new RuntimeException("ServiceTag " +
-                " doesn't match.");
-        }
-        String urn = st.getInstanceURN();
-        if (!urn.startsWith("urn:st:")) {
-            throw new RuntimeException("Invalid generated instance_urn " +
-                urn);
-        }
-        if (st.getInstallerUID() != -1) {
-            throw new RuntimeException("Invalid installer_uid " +
-                st.getInstallerUID());
-        }
-        if (st.getTimestamp() == null) {
-            throw new RuntimeException("null timestamp ");
-        }
-        return st;
-    }
-
-    private static String newID = "New product defined instance ID";
-    private static void updateServiceTag(ServiceTag svcTag) throws Exception {
-        // update the service tag
-        String urn = svcTag.getInstanceURN();
-        registration.updateServiceTag(urn, newID);
-
-        // get the updated service tag
-        ServiceTag st = registration.getServiceTag(urn);
-        if (Util.matches(svcTag, st)) {
-            throw new RuntimeException("ServiceTag " +
-                " should not match.");
-        }
-        if (!st.getProductDefinedInstanceID().equals(newID)) {
-            throw new RuntimeException("Invalid product_defined_instance_id " +
-                st.getProductDefinedInstanceID());
-        }
-        if (st.getInstallerUID() != -1) {
-            throw new RuntimeException("Invalid installer_uid " +
-                st.getInstallerUID());
-        }
-        if (st.getTimestamp().equals(svcTag.getTimestamp())) {
-            throw new RuntimeException("Timestamp " +
-                st.getTimestamp() + " == " + svcTag.getTimestamp());
-        }
-    }
-}
--- a/test/com/sun/servicetag/Util.java	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,265 +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.  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.
- */
-
-/*
- * @bug     6622366
- * @summary Utility class used by other jtreg tests
- */
-
-import com.sun.servicetag.RegistrationData;
-import com.sun.servicetag.ServiceTag;
-import com.sun.servicetag.Registry;
-
-import java.util.Set;
-import java.util.Date;
-import java.util.Map;
-import java.util.Properties;
-import java.util.TimeZone;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.io.*;
-
-public class Util {
-    public static ServiceTag newServiceTag(File f)
-            throws FileNotFoundException, IOException, NumberFormatException {
-        return newServiceTag(f, false /* with instance_urn */);
-    }
-
-    public static ServiceTag newServiceTag(File f, boolean noInstanceURN)
-            throws FileNotFoundException, IOException, NumberFormatException {
-        Properties props = new Properties();
-        FileReader reader = new FileReader(f);
-        try {
-            props.load(reader);
-        } finally {
-            reader.close();
-        }
-        if (noInstanceURN) {
-            return ServiceTag.newInstance(
-                            props.getProperty("product_name"),
-                            props.getProperty("product_version"),
-                            props.getProperty("product_urn"),
-                            props.getProperty("product_parent"),
-                            props.getProperty("product_parent_urn"),
-                            props.getProperty("product_defined_inst_id"),
-                            props.getProperty("product_vendor"),
-                            props.getProperty("platform_arch"),
-                            props.getProperty("container"),
-                            props.getProperty("source"));
-        } else {
-            return ServiceTag.newInstance(
-                            props.getProperty("instance_urn"),
-                            props.getProperty("product_name"),
-                            props.getProperty("product_version"),
-                            props.getProperty("product_urn"),
-                            props.getProperty("product_parent"),
-                            props.getProperty("product_parent_urn"),
-                            props.getProperty("product_defined_inst_id"),
-                            props.getProperty("product_vendor"),
-                            props.getProperty("platform_arch"),
-                            props.getProperty("container"),
-                            props.getProperty("source"));
-        }
-    }
-
-    public static boolean matches(ServiceTag st1, ServiceTag st2) {
-        if (!st1.getInstanceURN().equals(st2.getInstanceURN())) {
-            System.out.println("instance_urn: " + st1.getInstanceURN() +
-                " != " + st2.getInstanceURN());
-            return false;
-        }
-        return matchesNoInstanceUrn(st1, st2);
-    }
-
-    public static boolean matchesNoInstanceUrn(ServiceTag st1, ServiceTag st2) {
-        if (!st1.getProductName().equals(st2.getProductName())) {
-            System.out.println("product_name: " + st1.getProductName() +
-                " != " + st2.getProductName());
-            return false;
-        }
-
-        if (!st1.getProductVersion().equals(st2.getProductVersion())) {
-            System.out.println("product_version: " + st1.getProductVersion() +
-                " != " + st2.getProductVersion());
-            return false;
-        }
-        if (!st1.getProductURN().equals(st2.getProductURN())) {
-            System.out.println("product_urn: " + st1.getProductURN() +
-                " != " + st2.getProductURN());
-            return false;
-        }
-        if (!st1.getProductParentURN().equals(st2.getProductParentURN())) {
-            System.out.println("product_parent_urn: " + st1.getProductParentURN() +
-                " != " + st2.getProductParentURN());
-            return false;
-        }
-        if (!st1.getProductParent().equals(st2.getProductParent())) {
-            System.out.println("product_parent: " + st1.getProductParent() +
-                " != " + st2.getProductParent());
-            return false;
-        }
-        if (!st1.getProductDefinedInstanceID().equals(st2.getProductDefinedInstanceID())) {
-            System.out.println("product_defined_inst_id: " +
-                st1.getProductDefinedInstanceID() +
-                " != " + st2.getProductDefinedInstanceID());
-            return false;
-        }
-        if (!st1.getProductVendor().equals(st2.getProductVendor())) {
-            System.out.println("product_vendor: " + st1.getProductVendor() +
-                " != " + st2.getProductVendor());
-            return false;
-        }
-        if (!st1.getPlatformArch().equals(st2.getPlatformArch())) {
-            System.out.println("platform_arch: " + st1.getPlatformArch() +
-                " != " + st2.getPlatformArch());
-            return false;
-        }
-        if (!st1.getContainer().equals(st2.getContainer())) {
-            System.out.println("container: " + st1.getContainer() +
-                " != " + st2.getContainer());
-            return false;
-        }
-        if (!st1.getSource().equals(st2.getSource())) {
-            System.out.println("source: " + st1.getSource() +
-                " != " + st2.getSource());
-            return false;
-        }
-        return true;
-    }
-
-    public static void checkRegistrationData(String regFile,
-                                             Map<String, ServiceTag> stMap)
-            throws IOException {
-        BufferedInputStream in = new BufferedInputStream(new FileInputStream(regFile));
-        RegistrationData registration = RegistrationData.loadFromXML(in);
-        Set<ServiceTag> svcTags = registration.getServiceTags();
-        if (svcTags.size() != stMap.size()) {
-            throw new RuntimeException("Invalid service tag count= " +
-                svcTags.size() + " expected=" + stMap.size());
-        }
-        for (ServiceTag st : svcTags) {
-            ServiceTag st1 = stMap.get(st.getInstanceURN());
-            if (!matches(st, st1)) {
-                System.err.println(st);
-                System.err.println(st1);
-                throw new RuntimeException("ServiceTag in the registry " +
-                    "does not match the one in the map");
-            }
-        }
-    }
-
-
-    /**
-     * Formats the Date into a timestamp string in YYYY-MM-dd HH:mm:ss GMT.
-     * @param timestamp Date
-     * @return a string representation of the timestamp in the YYYY-MM-dd HH:mm:ss GMT format.
-     */
-    static String formatTimestamp(Date timestamp) {
-        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z");
-        df.setTimeZone(TimeZone.getTimeZone("GMT"));
-        return df.format(timestamp);
-    }
-
-    /**
-     * Parses a timestamp string in YYYY-MM-dd HH:mm:ss GMT format.
-     * @param timestamp Timestamp in the YYYY-MM-dd HH:mm:ss GMT format.
-     * @return Date
-     */
-    static Date parseTimestamp(String timestamp) {
-        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z");
-        df.setTimeZone(TimeZone.getTimeZone("GMT"));
-        try {
-            return df.parse(timestamp);
-        } catch (ParseException e) {
-            // should not reach here
-            e.printStackTrace();
-            return new Date();
-        }
-    }
-
-    /**
-     * Returns the command simulating stclient behavior.
-     */
-    static String getSvcClientCommand(String stclientRegistry) {
-        String regDir = System.getProperty("test.classes");
-
-        StringBuilder sb = new StringBuilder();
-        // wrap each argument to the command with double quotes
-        sb.append("\"");
-        sb.append(System.getProperty("java.home"));
-        sb.append(File.separator).append("bin");
-        sb.append(File.separator).append("java");
-        sb.append("\"");
-        sb.append(" -cp ");
-        sb.append("\"").append(regDir).append("\"");
-        sb.append(" \"-Dstclient.registry.path=");
-        sb.append(stclientRegistry).append("\"");
-        sb.append(" SvcTagClient");
-        return sb.toString();
-    }
-
-    private static Registry registry = null;
-    private static File registryFile = null;
-    /**
-     * Returns the Registry processed by SvcTagClient that simulates
-     * stclient.
-     */
-    static synchronized Registry getSvcTagClientRegistry() throws IOException {
-        String regDir = System.getProperty("test.classes");
-        File f = new File(regDir, "registry.xml");
-        if (registry != null) {
-            if (!f.equals(registryFile) && f.length() != 0) {
-                throw new AssertionError("Has to be empty registry.xml to run in samevm");
-            }
-            return registry;
-        }
-
-        // System.setProperty("servicetag.verbose", "true");
-        // enable the helper class
-        System.setProperty("servicetag.sthelper.supported", "true");
-        registryFile = f;
-
-        String stclientCmd = Util.getSvcClientCommand(registryFile.getCanonicalPath());
-        System.out.println("stclient cmd: " + stclientCmd);
-        System.setProperty("servicetag.stclient.cmd", stclientCmd);
-
-        // get the Registry object after the system properties are set
-        registry = Registry.getSystemRegistry();
-        return registry;
-    }
-
-    static void emptyRegistryFile() throws IOException {
-        if (registryFile.exists()) {
-            BufferedOutputStream out = new BufferedOutputStream(
-                new FileOutputStream(registryFile));
-            try {
-                RegistrationData data = new RegistrationData();
-                data.storeToXML(out);
-            } finally {
-                out.close();
-            }
-        }
-    }
-}
--- a/test/com/sun/servicetag/ValidRegistrationData.java	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,112 +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.
- */
-
-/*
- * @test
- * @bug     6622366
- * @summary Basic Test for reading a valid registration
- * @author  Mandy Chung
- *
- * @run build ValidRegistrationData
- * @run main ValidRegistrationData
- */
-
-import com.sun.servicetag.*;
-import java.io.*;
-import java.util.*;
-
-public class ValidRegistrationData {
-    private static String registrationDir = System.getProperty("test.classes");
-    private static String servicetagDir = System.getProperty("test.src");
-    private static RegistrationData registration;
-    private static Map<String, ServiceTag> stMap =
-        new LinkedHashMap<String, ServiceTag>();
-    private static String[] files = new String[] {
-                                        "servicetag1.properties",
-                                        "servicetag2.properties",
-                                        "servicetag3.properties"
-                                    };
-    private static String URN = "urn:st:9543ffaa-a4f1-4f77-b2d1-f561922d4e4a";
-
-    public static void main(String[] argv) throws Exception {
-        File f = new File(servicetagDir, "registration.xml");
-
-        // load the registration data with all service tags
-        BufferedInputStream in = new BufferedInputStream(new FileInputStream(f));
-        registration = RegistrationData.loadFromXML(in);
-        if (!registration.getRegistrationURN().equals(URN)){
-            throw new RuntimeException("Invalid URN=" +
-                registration.getRegistrationURN());
-        }
-        Map<String,String> environMap = registration.getEnvironmentMap();
-        checkEnvironmentMap(environMap);
-
-        // set environment
-        setInvalidEnvironment("hostname", "");
-        setInvalidEnvironment("osName", "");
-        setInvalidEnvironment("invalid", "");
-    }
-
-    private static void checkEnvironmentMap(Map<String,String> envMap)
-            throws Exception {
-        Properties props = new Properties();
-        File f = new File(servicetagDir, "environ.properties");
-        FileReader reader = new FileReader(f);
-        try {
-            props.load(reader);
-        } finally {
-            reader.close();
-        }
-        for (Map.Entry<String,String> entry : envMap.entrySet()) {
-            String name = entry.getKey();
-            String value = entry.getValue();
-            String expected = props.getProperty(name);
-            if (expected == null || !value.equals(expected)) {
-                throw new RuntimeException("Invalid environment " +
-                    name + "=" + value);
-            }
-            props.remove(name);
-        }
-        if (!props.isEmpty()) {
-            System.out.println("Environment missing: ");
-            for (String s : props.stringPropertyNames()) {
-                System.out.println("   " + s + "=" + props.getProperty(s));
-            }
-            throw new RuntimeException("Invalid environment read");
-        }
-    }
-    private static void setInvalidEnvironment(String name, String value) {
-        boolean invalid = false;
-        try {
-            registration.setEnvironment(name, value);
-        } catch (IllegalArgumentException e) {
-            invalid = true;
-        }
-        if (!invalid) {
-           throw new RuntimeException(name + "=" + value +
-               " set but expected to fail.");
-        }
-    }
-}
--- a/test/com/sun/servicetag/environ.properties	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-hostname=ko
-hostId=83abc1ab
-osName=SunOS
-osVersion=5.10
-osArchitecture=sparc
-systemModel=Sun-Fire-V440
-systemManufacturer=Oracle Corporation
-cpuManufacturer=Oracle Corporation
-serialNumber=BEL078932
--- a/test/com/sun/servicetag/missing-environ-field.xml	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<registration_data version="1.0">
-<environment>
-<hostname>ko</hostname>
-<hostId/>
-<osName>SunOS</osName>
-<osVersion>5.10</osVersion>
-<osArchitecture>sparc</osArchitecture>
-<systemModel/>
-<systemManufacturer/>
-<cpuManufacturer/>
-</environment>
-<registry urn="urn:st:9b2c801f-89d5-431e-a930-1335a9049124" version="1.0">
-<service_tag>
-<instance_urn>urn:st:9efff93a-767c-4714-fcfa-c48988293110</instance_urn>
-<product_name>Java SE 6 Runtime Environment</product_name>
-<product_version>1.6.0-internal</product_version>
-<product_urn>urn:uuid:92d1de8c-1e59-42c6-a280-1c379526bcbc</product_urn>
-<product_parent_urn>urn:uuid:fdc90b21-018d-4cab-b866-612c7c119ed3</product_parent_urn>
-<product_parent>Java Platform Standard Edition 6 (Java SE 6)</product_parent>
-<product_defined_inst_id>id=1.6.0-internal-b00 sparc,dir=/myjdk/solaris-sparc</product_defined_inst_id>
-<product_vendor>Oracle Corporation</product_vendor>
-<platform_arch>sparc</platform_arch>
-<timestamp>2007-11-12 06:15:11 GMT</timestamp>
-<container>global</container>
-<source>servicetag1.properties</source>
-<installer_uid>121937</installer_uid>
-</service_tag>
-<service_tag>
-<instance_urn>urn:st:0e9712bf-4832-e315-8e40-c4b17ffac9a9</instance_urn>
-<product_name>Java SE 6 Development Kit</product_name>
-<product_version>1.6.0</product_version>
-<product_urn>urn:uuid:b58ef9a8-5ae8-11db-a023-080020a9ed93</product_urn>
-<product_parent_urn>urn:uuid:fdc90b21-018d-4cab-b866-612c7c119ed3</product_parent_urn>
-<product_parent>Java Platform Standard Edition 6 (Java SE 6)</product_parent>
-<product_defined_inst_id>id=1.6.0_05-b01 sparc,dir=/myjdk/solaris-i586</product_defined_inst_id>
-<product_vendor>Oracle Corporation</product_vendor>
-<platform_arch>i386</platform_arch>
-<timestamp>2007-11-12 06:15:11 GMT</timestamp>
-<container>global</container>
-<source>servicetag2.properties</source>
-<installer_uid>121937</installer_uid>
-</service_tag>
-</registry>
-</registration_data>
--- a/test/com/sun/servicetag/newer-registry-version.xml	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<registration_data version="1.0">
-<environment>
-<hostname>ko</hostname>
-<hostId/>
-<osName>SunOS</osName>
-<osVersion>5.10</osVersion>
-<osArchitecture>sparc</osArchitecture>
-<systemModel/>
-<systemManufacturer/>
-<cpuManufacturer/>
-<serialNumber/>
-</environment>
-<registry urn="urn:st:9543ffaa-a4f1-4f77-b2d1-f561922d4e4a" version="100.0">
-<service_tag>
-<instance_urn>urn:st:9efff93a-767c-4714-fcfa-c48988293110</instance_urn>
-<product_name>Java SE 6 Runtime Environment</product_name>
-<product_version>1.6.0-internal</product_version>
-<product_urn>urn:uuid:92d1de8c-1e59-42c6-a280-1c379526bcbc</product_urn>
-<product_parent_urn>urn:uuid:fdc90b21-018d-4cab-b866-612c7c119ed3</product_parent_urn>
-<product_parent>Java Platform Standard Edition 6 (Java SE 6)</product_parent>
-<product_defined_inst_id>id=1.6.0-internal-b00 sparc,dir=/myjdk/solaris-sparc</product_defined_inst_id>
-<product_vendor>Oracle Corporation</product_vendor>
-<platform_arch>sparc</platform_arch>
-<timestamp>2007-11-13 00:49:01 GMT</timestamp>
-<container>global</container>
-<source>servicetag1.properties</source>
-<installer_uid>121937</installer_uid>
-<NEW-FIELD/>
-</service_tag>
-</registry>
-</registration_data>
--- a/test/com/sun/servicetag/registration.xml	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<registration_data version="1.0">
-<environment>
-<hostname>ko</hostname>
-<hostId>83abc1ab</hostId>
-<osName>SunOS</osName>
-<osVersion>5.10</osVersion>
-<osArchitecture>sparc</osArchitecture>
-<systemModel>Sun-Fire-V440</systemModel>
-<systemManufacturer>Oracle Corporation</systemManufacturer>
-<cpuManufacturer>Oracle Corporation</cpuManufacturer>
-<serialNumber>BEL078932</serialNumber>
-</environment>
-<registry urn="urn:st:9543ffaa-a4f1-4f77-b2d1-f561922d4e4a" version="1.0">
-<service_tag>
-<instance_urn>urn:st:9efff93a-767c-4714-fcfa-c48988293110</instance_urn>
-<product_name>Java SE 6 Runtime Environment</product_name>
-<product_version>1.6.0-internal</product_version>
-<product_urn>urn:uuid:92d1de8c-1e59-42c6-a280-1c379526bcbc</product_urn>
-<product_parent_urn>urn:uuid:fdc90b21-018d-4cab-b866-612c7c119ed3</product_parent_urn>
-<product_parent>Java Platform Standard Edition 6 (Java SE 6)</product_parent>
-<product_defined_inst_id>id=1.6.0-internal-b00 sparc,dir=/myjdk/solaris-sparc</product_defined_inst_id>
-<product_vendor>Oracle Corporation</product_vendor>
-<platform_arch>sparc</platform_arch>
-<timestamp>2007-11-13 00:49:01 GMT</timestamp>
-<container>global</container>
-<source>servicetag1.properties</source>
-<installer_uid>121937</installer_uid>
-</service_tag>
-<service_tag>
-<instance_urn>urn:st:0e9712bf-4832-e315-8e40-c4b17ffac9a9</instance_urn>
-<product_name>Java SE 6 Development Kit</product_name>
-<product_version>1.6.0</product_version>
-<product_urn>urn:uuid:b58ef9a8-5ae8-11db-a023-080020a9ed93</product_urn>
-<product_parent_urn>urn:uuid:fdc90b21-018d-4cab-b866-612c7c119ed3</product_parent_urn>
-<product_parent>Java Platform Standard Edition 6 (Java SE 6)</product_parent>
-<product_defined_inst_id>id=1.6.0_05-b01 i386,dir=/myjdk/solaris-i586</product_defined_inst_id>
-<product_vendor>Oracle Corporation</product_vendor>
-<platform_arch>i386</platform_arch>
-<timestamp>2007-11-13 00:49:01 GMT</timestamp>
-<container>global</container>
-<source>servicetag2.properties</source>
-<installer_uid>121937</installer_uid>
-</service_tag>
-<service_tag>
-<instance_urn>urn:st:8a6ff75e-21a4-c8d7-bbda-de2c971bd67d</instance_urn>
-<product_name>Solaris 10 Operating System</product_name>
-<product_version>10</product_version>
-<product_urn>urn:uuid:5005588c-36f3-11d6-9cec-fc96f718e113</product_urn>
-<product_parent_urn>urn:uuid:596ffcfa-63d5-11d7-9886-ac816a682f92</product_parent_urn>
-<product_parent>Solaris Operating System</product_parent>
-<product_defined_inst_id/>
-<product_vendor>Oracle Corporation</product_vendor>
-<platform_arch>sparc</platform_arch>
-<timestamp>2007-11-13 00:49:01 GMT</timestamp>
-<container>global</container>
-<source>servicetag3.properties</source>
-<installer_uid>212883</installer_uid>
-</service_tag>
-</registry>
-</registration_data>
--- a/test/com/sun/servicetag/servicetag1.properties	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-instance_urn=urn:st:9efff93a-767c-4714-fcfa-c48988293110
-product_name=Java SE 6 Runtime Environment
-product_version=1.6.0-internal
-product_urn=urn:uuid:92d1de8c-1e59-42c6-a280-1c379526bcbc
-product_parent_urn=urn:uuid:fdc90b21-018d-4cab-b866-612c7c119ed3
-product_parent=Java Platform Standard Edition 6 (Java SE 6)
-product_defined_inst_id=id=1.6.0-internal-b00 sparc,dir=/myjdk/solaris-sparc
-product_vendor=Oracle Corporation
-platform_arch=sparc
-timestamp=2007-11-12 05:19:40 GMT
-container=global
-source=servicetag1.properties
-installer_uid=121937
--- a/test/com/sun/servicetag/servicetag2.properties	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-instance_urn=urn:st:0e9712bf-4832-e315-8e40-c4b17ffac9a9
-product_name=Java SE 6 Development Kit
-product_version=1.6.0
-product_urn=urn:uuid:b58ef9a8-5ae8-11db-a023-080020a9ed93
-product_parent_urn=urn:uuid:fdc90b21-018d-4cab-b866-612c7c119ed3
-product_parent=Java Platform Standard Edition 6 (Java SE 6)
-product_defined_inst_id=id=1.6.0_05-b01 i386,dir=/myjdk/solaris-i586
-product_vendor=Oracle Corporation
-platform_arch=i386
-timestamp=2007-11-12 06:12:21 GMT
-container=global
-source=servicetag2.properties
-installer_uid=121937
--- a/test/com/sun/servicetag/servicetag3.properties	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-instance_urn=urn:st:8a6ff75e-21a4-c8d7-bbda-de2c971bd67d
-product_name=Solaris 10 Operating System
-product_version=10
-product_urn=urn:uuid:5005588c-36f3-11d6-9cec-fc96f718e113
-product_parent_urn=urn:uuid:596ffcfa-63d5-11d7-9886-ac816a682f92
-product_parent=Solaris Operating System
-product_defined_inst_id=
-product_vendor=Oracle Corporation
-platform_arch=sparc
-timestamp=2007-06-20 22:07:11 GMT
-container=global
-source=servicetag3.properties
-installer_uid=212883
--- a/test/com/sun/servicetag/servicetag4.properties	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-instance_urn=urn:st:b8171b45-a087-47b3-92c8-f2d9fb34e8c2
-product_name=Java SE 6 Runtime Environment
-product_version=1.6.0_05
-product_urn=urn:uuid:92d1de8c-1e59-42c6-a280-1c379526bcbc
-product_parent_urn=urn:uuid:fdc90b21-018d-4cab-b866-612c7c119ed3
-product_parent=Java Platform Standard Edition 6 (Java SE 6)
-product_defined_inst_id=id=1.6.0_05-b01 amd64,dir=/myjdk/linux-amd64
-product_vendor=Oracle Corporation
-platform_arch=x64
-timestamp=2007-12-12 05:19:40 GMT
-container=global
-source=servicetag4.properties
-installer_uid=121937
--- a/test/com/sun/servicetag/servicetag5.properties	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-instance_urn=urn:st:1d4269a1-71e3-4e44-bc8f-3793da7928ed
-product_name=Java SE 6 Runtime Environment
-product_version=1.6.0_06
-product_urn=urn:uuid:92d1de8c-1e59-42c6-a280-1c379526bcbc
-product_parent_urn=urn:uuid:fdc90b21-018d-4cab-b866-612c7c119ed3
-product_parent=Java Platform Standard Edition 6 (Java SE 6)
-product_defined_inst_id=id=1.6.0_06-b06 i386,dir=/w/mchung/bundles/jdk1.6.0_05/jre
-product_vendor=Oracle Corporation
-platform_arch=x86
-timestamp=2007-11-29 17:59:42 GMT
-container=global
-source=servicetag5.properties
-installer_uid=-1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/demo/zipfs/ZFSTests.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,56 @@
+/*
+ * 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 7156873
+   @summary ZipFileSystem regression tests
+ */
+
+
+import java.net.URI;
+import java.nio.file.*;
+import java.util.Map;
+import java.util.HashMap;
+
+public class ZFSTests {
+
+    public static void main(String[] args) throws Throwable {
+        test7156873();
+    }
+
+    static void test7156873() throws Throwable {
+        String DIRWITHSPACE = "testdir with spaces";
+        Path dir = Paths.get(DIRWITHSPACE);
+        Path path = Paths.get(DIRWITHSPACE, "file.zip");
+        try {
+            Files.createDirectory(dir);
+            URI uri = URI.create("jar:" + path.toUri());
+            Map<String, Object> env = new HashMap<String, Object>();
+            env.put("create", "true");
+            try (FileSystem fs = FileSystems.newFileSystem(uri, env)) {}
+        } finally {
+            Files.deleteIfExists(path);
+            Files.deleteIfExists(dir);
+        }
+    }
+}
--- a/test/demo/zipfs/ZipFSTester.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/demo/zipfs/ZipFSTester.java	Fri Jun 21 19:11:42 2013 -0700
@@ -138,14 +138,31 @@
             Path dst3 = Paths.get(tmpName + "_Tmp");
             Files.move(dst2, dst3);
             checkEqual(src, dst3);
+            if (Files.exists(dst2))
+                throw new RuntimeException("Failed!");
+
+            // copyback + move
+            Files.copy(dst3, dst);
+            Path dst4 = getPathWithParents(fs, tmpName + "_Tmp0");
+            Files.move(dst, dst4);
+            checkEqual(src, dst4);
 
             // delete
-            if (Files.exists(dst2))
+            Files.delete(dst4);
+            if (Files.exists(dst4))
                 throw new RuntimeException("Failed!");
             Files.delete(dst3);
             if (Files.exists(dst3))
                 throw new RuntimeException("Failed!");
 
+            // move (existing entry)
+            Path dst5 = fs.getPath("META-INF/MANIFEST.MF");
+            if (Files.exists(dst5)) {
+                Path dst6 = fs.getPath("META-INF/MANIFEST.MF_TMP");
+                Files.move(dst5, dst6);
+                walk(fs.getPath("/"));
+            }
+
             // newInputStream on dir
             Path parent = dst2.getParent();
             try {
@@ -540,6 +557,20 @@
                 bbSrc.flip();
                 bbDst.flip();
             }
+
+            // Check if source read position is at the end
+            if (chSrc.position() != chSrc.size()) {
+                System.out.printf("src[%s]: size=%d, position=%d%n",
+                                  chSrc.toString(), chSrc.size(), chSrc.position());
+                throw new RuntimeException("CHECK FAILED!");
+            }
+
+            // Check if destination read position is at the end
+            if (chDst.position() != chDst.size()) {
+                System.out.printf("dst[%s]: size=%d, position=%d%n",
+                                  chDst.toString(), chDst.size(), chDst.position());
+                throw new RuntimeException("CHECK FAILED!");
+            }
         } catch (IOException x) {
             x.printStackTrace();
         }
@@ -587,6 +618,20 @@
                 dstCh.write(bb);
                 bb.clear();
             }
+
+            // Check if source read position is at the end
+            if (srcCh.position() != srcCh.size()) {
+                System.out.printf("src[%s]: size=%d, position=%d%n",
+                                  srcCh.toString(), srcCh.size(), srcCh.position());
+                throw new RuntimeException("CHECK FAILED!");
+            }
+
+            // Check if destination write position is at the end
+            if (dstCh.position() != dstCh.size()) {
+                System.out.printf("dst[%s]: size=%d, position=%d%n",
+                                  dstCh.toString(), dstCh.size(), dstCh.position());
+                throw new RuntimeException("CHECK FAILED!");
+            }
         }
     }
 
@@ -616,10 +661,17 @@
 
         try (SeekableByteChannel sbc = Files.newByteChannel(path)) {
             System.out.printf("   sbc[0]: pos=%d, size=%d%n", sbc.position(), sbc.size());
+            if (sbc.position() != 0) {
+                throw new RuntimeException("CHECK FAILED!");
+            }
+
             bb = ByteBuffer.allocate((int)sbc.size());
             n = sbc.read(bb);
             System.out.printf("   sbc[1]: read=%d, pos=%d, size=%d%n",
                               n, sbc.position(), sbc.size());
+            if (sbc.position() != sbc.size()) {
+                throw new RuntimeException("CHECK FAILED!");
+            }
             bb2 = ByteBuffer.allocate((int)sbc.size());
         }
 
@@ -629,10 +681,16 @@
             sbc.position(N);
             System.out.printf("   sbc[2]: pos=%d, size=%d%n",
                               sbc.position(), sbc.size());
+            if (sbc.position() != N) {
+                throw new RuntimeException("CHECK FAILED!");
+            }
             bb2.limit(100);
             n = sbc.read(bb2);
             System.out.printf("   sbc[3]: read=%d, pos=%d, size=%d%n",
                               n, sbc.position(), sbc.size());
+            if (n < 0 || sbc.position() != (N + n)) {
+                throw new RuntimeException("CHECK FAILED!");
+            }
             System.out.printf("   sbc[4]: bb[%d]=%d, bb1[0]=%d%n",
                               N, bb.get(N) & 0xff, bb2.get(0) & 0xff);
         }
--- a/test/demo/zipfs/basic.sh	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/demo/zipfs/basic.sh	Fri Jun 21 19:11:42 2013 -0700
@@ -22,6 +22,7 @@
 #
 # @test
 # @bug 6990846 7009092 7009085 7015391 7014948 7005986 7017840 7007596
+# 7157656 8002390
 # @summary Test ZipFileSystem demo
 # @build Basic PathOps ZipFSTester
 # @run shell basic.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Desktop/OpenByUNCPathNameTest/OpenByUNCPathNameTest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,98 @@
+/*
+ * 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.
+ */
+
+/* @test
+   @bug 6550588
+   @summary java.awt.Desktop cannot open file with Windows UNC filename
+   @author Anton Litvinov
+*/
+
+import java.awt.*;
+import java.awt.event.*;
+import java.io.*;
+
+public class OpenByUNCPathNameTest {
+    private static boolean validatePlatform() {
+        String osName = System.getProperty("os.name");
+        if (osName == null) {
+            throw new RuntimeException("Name of the current OS could not be retrieved.");
+        }
+        return osName.startsWith("Windows");
+    }
+
+    private static void openFile() throws IOException {
+        if (!Desktop.isDesktopSupported()) {
+            System.out.println("java.awt.Desktop is not supported on this platform.");
+        } else {
+            Desktop desktop = Desktop.getDesktop();
+            File file = File.createTempFile("Read Me File", ".txt");
+            try {
+                // Test opening of the file with Windows local file path.
+                desktop.open(file);
+                Robot robot = null;
+                try {
+                    Thread.sleep(5000);
+                    robot = new Robot();
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+                pressAltF4Keys(robot);
+
+                // Test opening of the file with Windows UNC pathname.
+                String uncFilePath = "\\\\127.0.0.1\\" + file.getAbsolutePath().replace(':', '$');
+                File uncFile = new File(uncFilePath);
+                if (!uncFile.exists()) {
+                    throw new RuntimeException(String.format(
+                        "File with UNC pathname '%s' does not exist.", uncFilePath));
+                }
+                desktop.open(uncFile);
+                try {
+                    Thread.sleep(5000);
+                } catch (InterruptedException ie) {
+                    ie.printStackTrace();
+                }
+                pressAltF4Keys(robot);
+            } finally {
+                file.delete();
+            }
+        }
+    }
+
+    private static void pressAltF4Keys(Robot robot) {
+        if (robot != null) {
+            robot.keyPress(KeyEvent.VK_ALT);
+            robot.keyPress(KeyEvent.VK_F4);
+            robot.delay(50);
+            robot.keyRelease(KeyEvent.VK_F4);
+            robot.keyRelease(KeyEvent.VK_ALT);
+        }
+    }
+
+    public static void main(String[] args) throws IOException {
+        if (!validatePlatform()) {
+            System.out.println("This test is only for MS Windows OS.");
+        } else {
+            openFile();
+        }
+    }
+}
--- a/test/java/awt/Focus/OverrideRedirectWindowActivationTest/OverrideRedirectWindowActivationTest.java	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,157 +0,0 @@
-/*
- * 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       6385277
- * @summary   Tests that override redirect window gets activated on click.
- * @author    anton.tarasov@sun.com: area=awt.focus
- * @library   ../../regtesthelpers
- * @build     Util
- * @run       main OverrideRedirectWindowActivationTest
- */
-import java.awt.*;
-import java.awt.event.*;
-import java.util.concurrent.Callable;
-import javax.swing.SwingUtilities;
-import sun.awt.SunToolkit;
-import test.java.awt.regtesthelpers.Util;
-
-public class OverrideRedirectWindowActivationTest {
-
-    private static Frame frame;
-    private static Window window;
-    private static Button fbutton;
-    private static Button wbutton;
-    private static Label label;
-    private static Robot robot;
-    private static SunToolkit toolkit;
-
-    public static void main(String[] args) throws Exception {
-
-        if ("sun.awt.motif.MToolkit".equals(Toolkit.getDefaultToolkit().getClass().getName())) {
-            System.out.println("No testing on Motif. Test passed.");
-            return;
-        }
-
-        toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
-        robot = new Robot();
-        robot.setAutoDelay(50);
-
-        Toolkit.getDefaultToolkit().addAWTEventListener(new AWTEventListener() {
-
-            public void eventDispatched(AWTEvent e) {
-                System.out.println(e);
-            }
-        }, FocusEvent.FOCUS_EVENT_MASK | WindowEvent.WINDOW_FOCUS_EVENT_MASK);
-
-        createAndShowWindow();
-        toolkit.realSync();
-
-        createAndShowFrame();
-        toolkit.realSync();
-
-        // click on Frame
-        clickOn(getClickPoint(frame));
-
-        if (!frame.isFocused()) {
-            throw new RuntimeException("Error: a frame couldn't be focused by click.");
-        }
-
-        //click on Label in Window
-        clickOn(getClickPoint(label));
-
-        if (!window.isFocused()) {
-            throw new RuntimeException("Test failed: the window couldn't be activated by click!");
-        }
-
-        // bring focus back to the frame
-        clickOn(getClickPoint(fbutton));
-
-        if (!frame.isFocused()) {
-            throw new RuntimeException("Error: a frame couldn't be focused by click.");
-        }
-
-        // Test 2. Verifies that clicking on a component of unfocusable Window
-        //         won't activate it.
-
-        window.setFocusableWindowState(false);
-        toolkit.realSync();
-
-
-        clickOn(getClickPoint(label));
-
-        if (window.isFocused()) {
-            throw new RuntimeException("Test failed: unfocusable window got activated by click!");
-        }
-        System.out.println("Test passed.");
-
-    }
-
-    private static void createAndShowWindow() {
-
-        frame = new Frame("Test Frame");
-        window = new Window(frame);
-        wbutton = new Button("wbutton");
-        label = new Label("label");
-
-        window.setBounds(800, 200, 200, 100);
-        window.setLayout(new FlowLayout());
-        window.add(wbutton);
-        window.add(label);
-        window.setVisible(true);
-
-    }
-
-    private static void createAndShowFrame() {
-        fbutton = new Button("fbutton");
-
-        frame.setBounds(800, 0, 200, 100);
-        frame.setLayout(new FlowLayout());
-        frame.add(fbutton);
-        frame.setVisible(true);
-
-    }
-
-    static void clickOn(Point point) {
-
-        robot.mouseMove(point.x, point.y);
-
-        robot.mousePress(InputEvent.BUTTON1_MASK);
-        robot.mouseRelease(InputEvent.BUTTON1_MASK);
-
-        toolkit.realSync();
-    }
-
-    static Point getClickPoint(Component c) {
-        Point p = c.getLocationOnScreen();
-        Dimension d = c.getSize();
-        return new Point(p.x + (int) (d.getWidth() / 2), p.y + (int) (d.getHeight() / 2));
-    }
-
-    static Point getClickPoint(Frame frame) {
-        Point p = frame.getLocationOnScreen();
-        Dimension d = frame.getSize();
-        return new Point(p.x + (int) (d.getWidth() / 2), p.y + (frame.getInsets().top / 2));
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Focus/SimpleWindowActivationTest/SimpleWindowActivationTest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,157 @@
+/*
+ * Copyright (c) 2012, 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.
+ */
+
+/*
+ * @test
+ * @bug       6385277
+ * @summary   Tests that override redirect window gets activated on click.
+ * @author    anton.tarasov@sun.com: area=awt.focus
+ * @library   ../../regtesthelpers
+ * @build     Util
+ * @run       main SimpleWindowActivationTest
+ */
+import java.awt.*;
+import java.awt.event.*;
+import java.util.concurrent.Callable;
+import javax.swing.SwingUtilities;
+import sun.awt.SunToolkit;
+import test.java.awt.regtesthelpers.Util;
+
+public class SimpleWindowActivationTest {
+
+    private static Frame frame;
+    private static Window window;
+    private static Button fbutton;
+    private static Button wbutton;
+    private static Label label;
+    private static Robot robot;
+    private static SunToolkit toolkit;
+
+    public static void main(String[] args) throws Exception {
+
+        if ("sun.awt.motif.MToolkit".equals(Toolkit.getDefaultToolkit().getClass().getName())) {
+            System.out.println("No testing on Motif. Test passed.");
+            return;
+        }
+
+        toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+        robot = new Robot();
+        robot.setAutoDelay(50);
+
+        Toolkit.getDefaultToolkit().addAWTEventListener(new AWTEventListener() {
+
+            public void eventDispatched(AWTEvent e) {
+                System.out.println(e);
+            }
+        }, FocusEvent.FOCUS_EVENT_MASK | WindowEvent.WINDOW_FOCUS_EVENT_MASK);
+
+        createAndShowWindow();
+        toolkit.realSync();
+
+        createAndShowFrame();
+        toolkit.realSync();
+
+        // click on Frame
+        clickOn(getClickPoint(frame));
+
+        if (!frame.isFocused()) {
+            throw new RuntimeException("Error: a frame couldn't be focused by click.");
+        }
+
+        //click on Label in Window
+        clickOn(getClickPoint(label));
+
+        if (!window.isFocused()) {
+            throw new RuntimeException("Test failed: the window couldn't be activated by click!");
+        }
+
+        // bring focus back to the frame
+        clickOn(getClickPoint(fbutton));
+
+        if (!frame.isFocused()) {
+            throw new RuntimeException("Error: a frame couldn't be focused by click.");
+        }
+
+        // Test 2. Verifies that clicking on a component of unfocusable Window
+        //         won't activate it.
+
+        window.setFocusableWindowState(false);
+        toolkit.realSync();
+
+
+        clickOn(getClickPoint(label));
+
+        if (window.isFocused()) {
+            throw new RuntimeException("Test failed: unfocusable window got activated by click!");
+        }
+        System.out.println("Test passed.");
+
+    }
+
+    private static void createAndShowWindow() {
+
+        frame = new Frame("Test Frame");
+        window = new Window(frame);
+        wbutton = new Button("wbutton");
+        label = new Label("label");
+
+        window.setBounds(800, 200, 300, 100);
+        window.setLayout(new FlowLayout());
+        window.add(wbutton);
+        window.add(label);
+        window.setVisible(true);
+
+    }
+
+    private static void createAndShowFrame() {
+        fbutton = new Button("fbutton");
+
+        frame.setBounds(800, 0, 300, 100);
+        frame.setLayout(new FlowLayout());
+        frame.add(fbutton);
+        frame.setVisible(true);
+
+    }
+
+    static void clickOn(Point point) {
+
+        robot.mouseMove(point.x, point.y);
+
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+
+        toolkit.realSync();
+    }
+
+    static Point getClickPoint(Component c) {
+        Point p = c.getLocationOnScreen();
+        Dimension d = c.getSize();
+        return new Point(p.x + (int) (d.getWidth() / 2), p.y + (int) (d.getHeight() / 2));
+    }
+
+    static Point getClickPoint(Frame frame) {
+        Point p = frame.getLocationOnScreen();
+        Dimension d = frame.getSize();
+        return new Point(p.x + (int) (d.getWidth() / 2), p.y + (frame.getInsets().top / 2));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/FontClass/SurrogateTest/SuppCharTest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,127 @@
+/*
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8015556
+ * @summary Surrogate pairs do not render properly on MacOS X.
+ */
+
+import java.util.Locale;
+import java.awt.*;
+import java.awt.font.*;
+import javax.swing.*;
+
+public class SuppCharTest {
+
+   static String str = "ABC\uD840\uDC01\uD840\uDC00AB";
+   static String EXTB_FONT = "MingLiU-ExtB";
+
+   public static void main(String args[]) throws Exception {
+
+      final Font font = new Font(EXTB_FONT, Font.PLAIN, 36);
+      if (!EXTB_FONT.equalsIgnoreCase(font.getFamily(Locale.ENGLISH))) {
+         return;
+      }
+
+      SwingUtilities.invokeLater(new Runnable(){
+        @Override
+        public void run(){
+            JFrame f = new JFrame("Test Supplementary Char Support");
+            Component c = new SuppCharComp(font, str);
+            f.add("Center", c);
+            JButton b = new JButton(str);
+            b.setFont(font);
+            f.add("South", b);
+            f.pack();
+            f.setVisible(true);
+        }
+      });
+
+      /* If a supplementary character was found, 'invisible glyphs'
+       * with value 65535 will be inserted in the place of the 2nd (low)
+       * char index. So we are looking here to make sure such substitutions
+       * took place.
+       */
+      FontRenderContext frc = new FontRenderContext(null, false, false);
+      GlyphVector gv = font.createGlyphVector(frc, str);
+      int numGlyphs = gv.getNumGlyphs();
+      int[] codes = gv.getGlyphCodes(0, numGlyphs, null);
+      boolean foundInvisibleGlyph = false;
+      for (int i=0; i<numGlyphs;i++) {
+           if (codes[i] == 65535) {
+               foundInvisibleGlyph = true;
+               break;
+           }
+      }
+
+      if (!foundInvisibleGlyph) {
+           throw new RuntimeException("No invisible glyphs");
+      }
+
+      if (font.canDisplayUpTo(str) != -1) {
+          throw new RuntimeException("Font can't display all chars");
+      }
+
+   }
+}
+
+class SuppCharComp extends Component {
+
+  static final int w=400, h=250;
+  public Dimension preferredSize() {
+     return new Dimension(w,h);
+  }
+
+  String str = null;
+  Font font = null;
+  public SuppCharComp(Font font, String str) {
+    this.font = font;
+    this.str = str;
+  }
+  public void paint(Graphics g) {
+     Graphics2D g2d = (Graphics2D)g.create();
+     g2d.setColor(Color.white);
+     g2d.fillRect(0,0,w,h);
+     g2d.setColor(Color.black);
+     int y = 0;
+     g2d.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,
+                          RenderingHints.VALUE_FRACTIONALMETRICS_ON);
+     g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
+                          RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
+
+     g2d.setFont(font);
+     g2d.drawString(str, 10, 50);
+
+     FontRenderContext frc = g2d.getFontRenderContext();
+     GlyphVector gv = font.createGlyphVector(frc, str);
+     g2d.drawGlyphVector(gv, 10, 100);
+     TextLayout tl = new TextLayout(str, font, frc);
+     tl.draw(g2d, 10, 150);
+     char[] ca = str.toCharArray();
+     g2d.drawChars(ca, 0, ca.length, 10, 200);
+
+  }
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Frame/FrameSetSizeStressTest/FrameSetSizeStressTest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,47 @@
+/*
+ * 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.  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.Frame;
+
+/*
+  @test
+  @bug 7177173
+  @summary setBounds can cause StackOverflow in case of the considerable loading
+  @author Sergey Bylokhov
+*/
+public final class FrameSetSizeStressTest {
+
+    public static void main(final String[] args) {
+        final Frame frame = new Frame();
+        frame.setSize(200, 200);
+        frame.setLocationRelativeTo(null);
+        frame.setVisible(true);
+        for (int i = 0; i < 1000; ++i) {
+            frame.setSize(100, 100);
+            frame.setSize(200, 200);
+            frame.setSize(300, 300);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Frame/ResizeAfterSetFont/ResizeAfterSetFont.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,75 @@
+/*
+ * 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.
+ */
+
+/*
+ * Portions Copyright (c) 2012 IBM Corporation
+ */
+
+/*
+ @test
+ @bug 7170655
+ @summary Frame size does not change after changing font
+ @author Jonathan Lu
+ @library ../../regtesthelpers
+ @build Util
+ @run main ResizeAfterSetFont
+ */
+
+import java.awt.*;
+import test.java.awt.regtesthelpers.Util;
+
+public class ResizeAfterSetFont {
+
+    public static void main(String[] args) throws Exception {
+        Frame frame = new Frame("bug7170655");
+        frame.setLayout(new BorderLayout());
+        frame.setBackground(Color.LIGHT_GRAY);
+
+        Panel panel = new Panel();
+        panel.setLayout(new GridLayout(0, 1, 1, 1));
+
+        Label label = new Label("Test Label");
+        label.setBackground(Color.white);
+        label.setForeground(Color.RED);
+        label.setFont(new Font("Dialog", Font.PLAIN, 12));
+
+        panel.add(label);
+        frame.add(panel, "South");
+        frame.pack();
+        frame.setVisible(true);
+
+        Util.waitForIdle(null);
+
+        Dimension dimBefore = frame.getSize();
+        label.setFont(new Font("Dialog", Font.PLAIN, 24));
+
+        frame.validate();
+        frame.pack();
+        Dimension dimAfter = frame.getSize();
+
+        if (dimBefore.equals(dimAfter)) {
+            throw new Exception(
+                    "Frame size does not change after Label.setFont()!");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/FullScreen/FullScreenInsets/FullScreenInsets.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,156 @@
+/*
+ * 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.
+ */
+
+import java.awt.AWTException;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.DisplayMode;
+import java.awt.Frame;
+import java.awt.GraphicsDevice;
+import java.awt.GraphicsEnvironment;
+import java.awt.Insets;
+import java.awt.Robot;
+import java.awt.Toolkit;
+import java.awt.Window;
+import java.awt.image.BufferedImage;
+
+import sun.awt.SunToolkit;
+
+/**
+ * @test
+ * @bug 8003173 7019055
+ * @summary Full-screen windows should have the proper insets.
+ * @author Sergey Bylokhov
+ */
+public final class FullScreenInsets {
+
+    private static boolean passed = true;
+
+    public static void main(final String[] args) {
+        final GraphicsEnvironment ge = GraphicsEnvironment
+                .getLocalGraphicsEnvironment();
+        final GraphicsDevice[] devices = ge.getScreenDevices();
+
+        final Window wGreen = new Frame();
+        wGreen.setBackground(Color.GREEN);
+        wGreen.setSize(300, 300);
+        wGreen.setVisible(true);
+        sleep();
+        final Insets iGreen = wGreen.getInsets();
+        final Dimension sGreen = wGreen.getSize();
+
+        final Window wRed = new Frame();
+        wRed.setBackground(Color.RED);
+        wRed.setSize(300, 300);
+        wRed.setVisible(true);
+        sleep();
+        final Insets iRed = wGreen.getInsets();
+        final Dimension sRed = wGreen.getSize();
+
+        for (final GraphicsDevice device : devices) {
+            if (!device.isFullScreenSupported()) {
+                continue;
+            }
+            device.setFullScreenWindow(wGreen);
+            sleep();
+            testWindowBounds(device.getDisplayMode(), wGreen);
+            testColor(wGreen, Color.GREEN);
+
+            device.setFullScreenWindow(wRed);
+            sleep();
+            testWindowBounds(device.getDisplayMode(), wRed);
+            testColor(wRed, Color.RED);
+
+            device.setFullScreenWindow(null);
+            sleep();
+            testInsets(wGreen.getInsets(), iGreen);
+            testInsets(wRed.getInsets(), iRed);
+            testSize(wGreen.getSize(), sGreen);
+            testSize(wRed.getSize(), sRed);
+        }
+        wGreen.dispose();
+        wRed.dispose();
+        if (!passed) {
+            throw new RuntimeException("Test failed");
+        }
+    }
+
+    private static void testSize(final Dimension actual, final Dimension exp) {
+        if (!exp.equals(actual)) {
+            System.err.println(" Wrong window size:" +
+                               " Expected: " + exp + " Actual: " + actual);
+            passed = false;
+        }
+    }
+
+    private static void testInsets(final Insets actual, final Insets exp) {
+        if (!actual.equals(exp)) {
+            System.err.println(" Wrong window insets:" +
+                               " Expected: " + exp + " Actual: " + actual);
+            passed = false;
+        }
+    }
+
+    private static void testWindowBounds(final DisplayMode dm, final Window w) {
+        if (w.getWidth() != dm.getWidth() || w.getHeight() != dm.getHeight()) {
+            System.err.println(" Wrong window bounds:" +
+                               " Expected: width = " + dm.getWidth()
+                               + ", height = " + dm.getHeight() + " Actual: "
+                               + w.getSize());
+            passed = false;
+        }
+    }
+
+    private static void testColor(final Window w, final Color color) {
+        final Robot r;
+        try {
+            r = new Robot(w.getGraphicsConfiguration().getDevice());
+        } catch (AWTException e) {
+            e.printStackTrace();
+            passed = false;
+            return;
+        }
+        final BufferedImage bi = r.createScreenCapture(w.getBounds());
+        for (int y = 0; y < bi.getHeight(); y++) {
+            for (int x = 0; x < bi.getWidth(); x++) {
+                if (bi.getRGB(x, y) != color.getRGB()) {
+                    System.err.println(
+                            "Incorrect pixel at " + x + "x" + y + " : " +
+                            Integer.toHexString(bi.getRGB(x, y)) +
+                            " ,expected : " + Integer.toHexString(
+                                    color.getRGB()));
+                    passed = false;
+                    return;
+                }
+            }
+        }
+    }
+
+    private static void sleep() {
+        ((SunToolkit) Toolkit.getDefaultToolkit()).realSync();
+        try {
+            Thread.sleep(2000);
+        } catch (InterruptedException ignored) {
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Graphics2D/FillTexturePaint/FillTexturePaint.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,96 @@
+/*
+ * 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.
+ */
+
+import java.awt.AlphaComposite;
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsEnvironment;
+import java.awt.Rectangle;
+import java.awt.TexturePaint;
+import java.awt.image.BufferedImage;
+import java.awt.image.VolatileImage;
+
+/**
+ * @test
+ * @bug 8000629
+ * @summary TexturePaint areas shouldn't separates.
+ * @author Sergey Bylokhov
+ */
+public class FillTexturePaint {
+
+    private static TexturePaint shape;
+    private static final int size = 400;
+
+    static {
+        BufferedImage bi = new BufferedImage(50, 50,
+                                             BufferedImage.TYPE_INT_RGB);
+        Graphics2D gi = bi.createGraphics();
+        gi.setBackground(Color.GREEN);
+        gi.clearRect(0, 0, 50, 50);
+        shape = new TexturePaint(bi, new Rectangle(0, 0, 50, 50));
+    }
+
+    public static void main(final String[] args) {
+        GraphicsEnvironment ge =
+                GraphicsEnvironment.getLocalGraphicsEnvironment();
+        GraphicsConfiguration gc =
+                ge.getDefaultScreenDevice().getDefaultConfiguration();
+        VolatileImage vi = gc.createCompatibleVolatileImage(size, size);
+        while (true) {
+            vi.validate(gc);
+            Graphics2D g2d = vi.createGraphics();
+            g2d.setComposite(AlphaComposite.Src);
+            g2d.setPaint(shape);
+            g2d.fill(new Rectangle(0, 0, size, size));
+            g2d.dispose();
+
+            if (vi.validate(gc) != VolatileImage.IMAGE_OK) {
+                try {
+                    Thread.sleep(100);
+                } catch (InterruptedException ignored) {
+                }
+                continue;
+            }
+
+            BufferedImage bi = vi.getSnapshot();
+
+            if (vi.contentsLost()) {
+                try {
+                    Thread.sleep(100);
+                } catch (InterruptedException ignored) {
+                }
+                continue;
+            }
+
+            for (int x = 0; x < size; ++x) {
+                for (int y = 0; y < size; ++y) {
+                    if (bi.getRGB(x, y) != Color.GREEN.getRGB()) {
+                        throw new RuntimeException("Test failed.");
+                    }
+                }
+            }
+            break;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Graphics2D/FlipDrawImage/FlipDrawImage.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,105 @@
+/*
+ * 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.
+ */
+
+
+import java.awt.AlphaComposite;
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsEnvironment;
+import java.awt.image.BufferedImage;
+import java.awt.image.VolatileImage;
+
+/**
+ * @test
+ * @bug 8000629
+ * @author Sergey Bylokhov
+ */
+public final class FlipDrawImage {
+
+    private static final int width = 400;
+    private static final int height = 400;
+
+    public static void main(final String[] args) {
+        GraphicsEnvironment ge =
+                GraphicsEnvironment.getLocalGraphicsEnvironment();
+        GraphicsConfiguration gc =
+                ge.getDefaultScreenDevice().getDefaultConfiguration();
+        VolatileImage vi = gc.createCompatibleVolatileImage(width, height);
+        final BufferedImage bi = new BufferedImage(width, height,
+                                                   BufferedImage.TYPE_INT_ARGB);
+        while (true) {
+            vi.validate(gc);
+            Graphics2D g2d = vi.createGraphics();
+            g2d.setColor(Color.red);
+            g2d.fillRect(0, 0, width, height);
+            g2d.setColor(Color.green);
+            g2d.fillRect(0, 0, width / 2, height / 2);
+            g2d.dispose();
+
+            if (vi.validate(gc) != VolatileImage.IMAGE_OK) {
+                try {
+                    Thread.sleep(100);
+                } catch (InterruptedException ignored) {
+                }
+                continue;
+            }
+
+            Graphics2D g = bi.createGraphics();
+            g.setComposite(AlphaComposite.Src);
+            g.setColor(Color.BLUE);
+            g.fillRect(0, 0, width, height);
+            // destination width and height are flipped and scale is used.
+            g.drawImage(vi, width / 2, height / 2, -width / 2, -height / 2,
+                        null, null);
+            g.dispose();
+
+            if (vi.contentsLost()) {
+                try {
+                    Thread.sleep(100);
+                } catch (InterruptedException ignored) {
+                }
+                continue;
+            }
+
+            for (int x = 0; x < width; ++x) {
+                for (int y = 0; y < height; ++y) {
+                    if (x < width / 2 && y < height / 2) {
+                        if (x >= width / 4 && y >= height / 4) {
+                            if (bi.getRGB(x, y) != Color.green.getRGB()) {
+                                throw new RuntimeException("Test failed.");
+                            }
+                        } else if (bi.getRGB(x, y) != Color.red.getRGB()) {
+                            throw new RuntimeException("Test failed.");
+                        }
+                    } else {
+                        if (bi.getRGB(x, y) != Color.BLUE.getRGB()) {
+                            throw new RuntimeException("Test failed.");
+                        }
+                    }
+                }
+            }
+            break;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Graphics2D/TransformSetGet/TransformSetGet.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,59 @@
+/*
+ * 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.
+ */
+
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsEnvironment;
+import java.awt.geom.AffineTransform;
+import java.awt.image.VolatileImage;
+
+import sun.java2d.SunGraphics2D;
+
+/**
+ * @test
+ * @bug 8000629
+ * @summary Set/get transform should work on constrained graphics.
+ * @author Sergey Bylokhov
+ */
+public class TransformSetGet {
+
+    public static void main(final String[] args) {
+        final GraphicsEnvironment ge =
+                GraphicsEnvironment.getLocalGraphicsEnvironment();
+        final GraphicsConfiguration gc =
+                ge.getDefaultScreenDevice().getDefaultConfiguration();
+        final VolatileImage vi = gc.createCompatibleVolatileImage(200, 200);
+        final SunGraphics2D sg2d = (SunGraphics2D) vi.createGraphics();
+
+        sg2d.constrain(0, 61, 100, 100);
+        final AffineTransform expected = sg2d.cloneTransform();
+        sg2d.setTransform(sg2d.getTransform());
+        final AffineTransform actual = sg2d.cloneTransform();
+        sg2d.dispose();
+        vi.flush();
+        if (!expected.equals(actual)) {
+            System.out.println("Expected = " + expected);
+            System.out.println("Actual = " + actual);
+            throw new RuntimeException("Wrong transform");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/GraphicsConfiguration/NormalizingTransformTest/NormalizingTransformTest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,55 @@
+/*
+ * 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 6373505
+ * @summary Tests that the result of Toolkit.getScreenResolution() is
+ * consistent with GraphicsConfiguration.getNormalizingTransform().
+ * @author Dmitri.Trembovetski@Sun.COM: area=GraphicsConfiguration
+ * @run main NormalizingTransformTest
+ */
+
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsEnvironment;
+import java.awt.Toolkit;
+import java.awt.geom.AffineTransform;
+
+public class NormalizingTransformTest {
+
+    public static void main(String[] args) {
+        GraphicsConfiguration gc =
+            GraphicsEnvironment.getLocalGraphicsEnvironment().
+                getDefaultScreenDevice().getDefaultConfiguration();
+        AffineTransform normTransform = gc.getNormalizingTransform();
+        int dpiX = Toolkit.getDefaultToolkit().getScreenResolution();
+        int normDpiX = (int)(normTransform.getScaleX() * 72.0);
+        if (dpiX != normDpiX) {
+            throw new RuntimeException(
+                "Test FAILED. Toolkit.getScreenResolution()=" + dpiX +
+                " GraphicsConfiguration.getNormalizingTransform()="+normDpiX);
+        }
+        System.out.println("Test PASSED. DPI="+normDpiX);
+    }
+
+}
--- a/test/java/awt/KeyboardFocusmanager/TypeAhead/SubMenuShowTest/SubMenuShowTest.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/awt/KeyboardFocusmanager/TypeAhead/SubMenuShowTest/SubMenuShowTest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -36,6 +36,7 @@
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.lang.reflect.InvocationTargetException;
 import test.java.awt.regtesthelpers.Util;
+import sun.awt.OSInfo;
 
 public class SubMenuShowTest extends Applet {
     Robot robot;
@@ -86,6 +87,11 @@
         frame.setVisible(true);
         Util.waitForIdle(robot);
 
+        boolean isMacOSX = (OSInfo.getOSType() == OSInfo.OSType.MACOSX);
+        if (isMacOSX) {
+            robot.keyPress(KeyEvent.VK_CONTROL);
+            robot.delay(20);
+        }
         robot.keyPress(KeyEvent.VK_ALT);
         robot.delay(20);
         robot.keyPress(KeyEvent.VK_F);
@@ -93,6 +99,10 @@
         robot.keyRelease(KeyEvent.VK_F);
         robot.delay(20);
         robot.keyRelease(KeyEvent.VK_ALT);
+        if (isMacOSX) {
+            robot.keyRelease(KeyEvent.VK_CONTROL);
+            robot.delay(20);
+        }
         Util.waitForIdle(robot);
 
         robot.keyPress(KeyEvent.VK_M);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/List/MouseDraggedOutCauseScrollingTest/MouseDraggedOutCauseScrollingTest.html	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,43 @@
+<html>
+<!--
+  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.
+  -->
+
+<!--  
+  @test
+  @bug 6243382 8006070
+  @summary Dragging of mouse outside of a List and Choice area don't work properly on XAWT
+  @author Dmitry.Cherepanov@SUN.COM area=awt.list
+  @run applet/manual=yesno MouseDraggedOutCauseScrollingTest.html
+  -->
+<head>
+<title> ManualYesNoTest </title>
+</head>
+<body>
+
+<h1>ManualYesNoTest<br>Bug ID: </h1>
+
+<p> See the dialog box (usually in upper left corner) for instructions</p>
+
+<APPLET CODE="MouseDraggedOutCauseScrollingTest.class" WIDTH=200 HEIGHT=200></APPLET>
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/List/MouseDraggedOutCauseScrollingTest/MouseDraggedOutCauseScrollingTest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,246 @@
+/*
+ * 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.
+ */
+
+/*
+  test
+  @bug 6243382 8006070
+  @summary Dragging of mouse outside of a List and Choice area don't work properly on XAWT
+  @author Dmitry.Cherepanov@SUN.COM area=awt.list
+  @run applet/manual=yesno MouseDraggedOutCauseScrollingTest.html
+*/
+
+import java.applet.Applet;
+import java.awt.*;
+
+public class MouseDraggedOutCauseScrollingTest extends Applet
+{
+    Choice choice;
+    List singleList;
+    List multipleList;
+
+    public void init()
+    {
+        this.setLayout (new GridLayout (1, 3));
+
+        choice = new Choice();
+        singleList = new List(3, false);
+        multipleList = new List(3, true);
+
+        choice.add("Choice");
+        for (int i = 1; i < 100; i++){
+            choice.add(""+i);
+        }
+
+        singleList.add("Single list");
+        for (int i = 1; i < 100; i++)
+            singleList.add(""+i);
+
+        multipleList.add("Multiple list");
+        for (int i = 1; i < 100; i++)
+            multipleList.add(""+i);
+
+        this.add(choice);
+        this.add(singleList);
+        this.add(multipleList);
+
+        String toolkitName = Toolkit.getDefaultToolkit().getClass().getName();
+        if (!toolkitName.equals("sun.awt.X11.XToolkit")) {
+            String[] instructions =
+            {
+                "This test is not applicable to the current platform. Press PASS"
+            };
+            Sysout.createDialogWithInstructions( instructions );
+        } else {
+            String[] instructions =
+            {
+                "0) Please note, that this is only Motif/XAWT test. At first, make the applet active",
+                "1.1) Click on the choice",
+                "1.2) Press the left button of the mouse and keep on any item of the choice, for example 5",
+                "1.3) Drag mouse out of the area of the unfurled list, at the same time hold the X coordinate of the mouse position about the same",
+                "1.4) To make sure, that when the Y coordinate of the mouse position higher of the upper bound of the list then scrolling UP of the list and selected item changes on the upper. If not, the test failed",
+                "1.5) To make sure, that when the Y coordinate of the mouse position under of the lower bound of the list then scrolling DOWN of the list and selected item changes on the lower. If not, the test failed",
+                "-----------------------------------",
+                "2.1) Click on the single list",
+                "2.2) Press the left button of the mouse and keep on any item of the list, for example 5",
+                "2.3) Drag mouse out of the area of the unfurled list, at the same time hold the X coordinate of the mouse position about the same",
+                "2.4) To make sure, that when the Y coordinate of the mouse position higher of the upper bound of the list then scrolling UP of the list and selected item changes on the upper. If not, the test failed",
+                "2.5) To make sure, that when the Y coordinate of the mouse position under of the lower bound of the list then scrolling DOWN of the list and selected item changes on the lower. If not, the test failed",
+                "-----------------------------------",
+                "3.1) Click on the multiple list",
+                "3.2) Press the left button of the mouse and keep on any item of the list, for example 5",
+                "3.3) Drag mouse out of the area of the unfurled list, at the same time hold the X coordinate of the mouse position about the same",
+                "3.4) To make sure, that when the Y coordinate of the mouse position higher of the upper bound of the list then scrolling of the list NO OCCURED and selected item NO CHANGES on the upper. If not, the test failed",
+                "3.5) To make sure, that when the Y coordinate of the mouse position under of the lower bound of the list then scrolling of the list NO OCCURED and selected item NO CHANGES on the lower. If not, the test failed",
+                "4) Test passed."
+            };
+            Sysout.createDialogWithInstructions( instructions );
+        }
+
+    }//End  init()
+
+    public void start ()
+    {
+        setSize (400,100);
+        setVisible(true);
+        validate();
+
+    }// start()
+
+}// class ManualYesNoTest
+
+/****************************************************
+ Standard Test Machinery
+ DO NOT modify anything below -- it's a standard
+  chunk of code whose purpose is to make user
+  interaction uniform, and thereby make it simpler
+  to read and understand someone else's test.
+ ****************************************************/
+
+/**
+ This is part of the standard test machinery.
+ It creates a dialog (with the instructions), and is the interface
+  for sending text messages to the user.
+ To print the instructions, send an array of strings to Sysout.createDialog
+  WithInstructions method.  Put one line of instructions per array entry.
+ To display a message for the tester to see, simply call Sysout.println
+  with the string to be displayed.
+ This mimics System.out.println but works within the test harness as well
+  as standalone.
+ */
+
+class Sysout
+{
+    private static TestDialog dialog;
+
+    public static void createDialogWithInstructions( String[] instructions )
+    {
+        dialog = new TestDialog( new Frame(), "Instructions" );
+        dialog.printInstructions( instructions );
+        dialog.setVisible(true);
+        println( "Any messages for the tester will display here." );
+    }
+
+    public static void createDialog( )
+    {
+        dialog = new TestDialog( new Frame(), "Instructions" );
+        String[] defInstr = { "Instructions will appear here. ", "" } ;
+        dialog.printInstructions( defInstr );
+        dialog.setVisible(true);
+        println( "Any messages for the tester will display here." );
+    }
+
+
+    public static void printInstructions( String[] instructions )
+    {
+        dialog.printInstructions( instructions );
+    }
+
+
+    public static void println( String messageIn )
+    {
+        dialog.displayMessage( messageIn );
+    }
+
+}// Sysout  class
+
+/**
+  This is part of the standard test machinery.  It provides a place for the
+   test instructions to be displayed, and a place for interactive messages
+   to the user to be displayed.
+  To have the test instructions displayed, see Sysout.
+  To have a message to the user be displayed, see Sysout.
+  Do not call anything in this dialog directly.
+  */
+class TestDialog extends Dialog
+{
+
+    TextArea instructionsText;
+    TextArea messageText;
+    int maxStringLength = 80;
+
+    //DO NOT call this directly, go through Sysout
+    public TestDialog( Frame frame, String name )
+    {
+        super( frame, name );
+        int scrollBoth = TextArea.SCROLLBARS_BOTH;
+        instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth );
+        add( "North", instructionsText );
+
+        messageText = new TextArea( "", 5, maxStringLength, scrollBoth );
+        add("Center", messageText);
+
+        pack();
+
+        setVisible(true);
+    }// TestDialog()
+
+    //DO NOT call this directly, go through Sysout
+    public void printInstructions( String[] instructions )
+    {
+        //Clear out any current instructions
+        instructionsText.setText( "" );
+
+        //Go down array of instruction strings
+
+        String printStr, remainingStr;
+        for( int i=0; i < instructions.length; i++ )
+        {
+            //chop up each into pieces maxSringLength long
+            remainingStr = instructions[ i ];
+            while( remainingStr.length() > 0 )
+            {
+                //if longer than max then chop off first max chars to print
+                if( remainingStr.length() >= maxStringLength )
+                {
+                    //Try to chop on a word boundary
+                    int posOfSpace = remainingStr.
+                        lastIndexOf( ' ', maxStringLength - 1 );
+
+                    if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1;
+
+                    printStr = remainingStr.substring( 0, posOfSpace + 1 );
+                    remainingStr = remainingStr.substring( posOfSpace + 1 );
+                }
+                //else just print
+                else
+                {
+                    printStr = remainingStr;
+                    remainingStr = "";
+                }
+
+                instructionsText.append( printStr + "\n" );
+
+            }// while
+
+        }// for
+
+    }//printInstructions()
+
+    //DO NOT call this directly, go through Sysout
+    public void displayMessage( String messageIn )
+    {
+        messageText.append( messageIn + "\n" );
+        System.out.println(messageIn);
+    }
+
+}// TestDialog  class
--- a/test/java/awt/Mixing/MixingInHwPanel.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/awt/Mixing/MixingInHwPanel.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,8 +22,8 @@
  */
 
 /*
-  @test %W% %E%
-  @bug 6829858
+  @test
+  @bug 6829858 7109977
   @summary Mixing should work inside heavyweight containers
   @author anthony.petrov@sun.com: area=awt.mixing
   @library ../regtesthelpers
@@ -104,7 +104,7 @@
 
         // And click the part of the button that has been previously hidden
         Point bLoc = button.getLocationOnScreen();
-        robot.mouseMove(bLoc.x + button.getWidth() - 6, bLoc.y + button.getHeight() / 2);
+        robot.mouseMove(bLoc.x + button.getWidth() - 15, bLoc.y + button.getHeight() / 2);
 
         Util.waitForIdle(robot);
 
--- a/test/java/awt/Mouse/EnterExitEvents/DragWindowTest.java	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,219 +0,0 @@
-/*
- * Copyright (c) 2005, 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.
- *
- * 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 7154048
- * @summary Window created under a mouse does not receive mouse enter event.
- *     Mouse Entered/Exited events are wrongly generated during dragging the window
- *     from one component to another
- * @library ../../regtesthelpers
- * @build Util
- * @author alexandr.scherbatiy area=awt.event
- * @run main DragWindowTest
- */
-
-import java.awt.*;
-import java.awt.event.*;
-import javax.swing.*;
-
-import java.util.concurrent.*;
-import sun.awt.SunToolkit;
-
-import test.java.awt.regtesthelpers.Util;
-
-public class DragWindowTest {
-
-    private static volatile int dragWindowMouseEnteredCount = 0;
-    private static volatile int dragWindowMouseReleasedCount = 0;
-    private static volatile int buttonMouseEnteredCount = 0;
-    private static volatile int labelMouseReleasedCount = 0;
-    private static MyDragWindow dragWindow;
-    private static JLabel label;
-    private static JButton button;
-
-    public static void main(String[] args) throws Exception {
-
-        SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
-        Robot robot = new Robot();
-        robot.setAutoDelay(50);
-
-        SwingUtilities.invokeAndWait(new Runnable() {
-
-            @Override
-            public void run() {
-                createAndShowGUI();
-            }
-        });
-
-        toolkit.realSync();
-
-        Point pointToClick = Util.invokeOnEDT(new Callable<Point>() {
-
-            @Override
-            public Point call() throws Exception {
-                return getCenterPoint(label);
-            }
-        });
-
-
-        robot.mouseMove(pointToClick.x, pointToClick.y);
-        robot.mousePress(InputEvent.BUTTON1_MASK);
-        toolkit.realSync();
-
-        if (dragWindowMouseEnteredCount != 1) {
-            throw new RuntimeException("No MouseEntered event on Drag Window!");
-        }
-
-        Point pointToDrag = Util.invokeOnEDT(new Callable<Point>() {
-
-            @Override
-            public Point call() throws Exception {
-                button.addMouseListener(new ButtonMouseListener());
-                return getCenterPoint(button);
-            }
-        });
-
-        robot.mouseMove(pointToDrag.x, pointToDrag.y);
-        toolkit.realSync();
-
-        if (buttonMouseEnteredCount != 0) {
-            throw new RuntimeException("Extra MouseEntered event on button!");
-        }
-
-        robot.mouseRelease(InputEvent.BUTTON1_MASK);
-        toolkit.realSync();
-
-        if (labelMouseReleasedCount != 1) {
-            throw new RuntimeException("No MouseReleased event on label!");
-        }
-
-    }
-
-    private static Point getCenterPoint(Component comp) {
-        Point p = comp.getLocationOnScreen();
-        Rectangle rect = comp.getBounds();
-        return new Point(p.x + rect.width / 2, p.y + rect.height / 2);
-    }
-
-    private static void createAndShowGUI() {
-
-        JFrame frame = new JFrame("Main Frame");
-        frame.setSize(300, 200);
-        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
-
-        label = new JLabel("Label");
-
-        LabelMouseListener listener = new LabelMouseListener(frame);
-        label.addMouseListener(listener);
-        label.addMouseMotionListener(listener);
-
-        button = new JButton("Button");
-        Panel panel = new Panel(new BorderLayout());
-
-        panel.add(label, BorderLayout.NORTH);
-        panel.add(button, BorderLayout.CENTER);
-
-        frame.getContentPane().add(panel);
-        frame.setVisible(true);
-
-    }
-
-    private static Point getAbsoluteLocation(MouseEvent e) {
-        return new Point(e.getXOnScreen(), e.getYOnScreen());
-    }
-
-    static class MyDragWindow extends Window {
-
-        static int d = 30;
-
-        public MyDragWindow(Window parent, Point location) {
-            super(parent);
-            setSize(150, 150);
-            setVisible(true);
-            JPanel panel = new JPanel();
-            add(panel);
-            setLocation(location.x - d, location.y - d);
-            addMouseListener(new DragWindowMouseListener());
-        }
-
-        void dragTo(Point point) {
-            setLocation(point.x - d, point.y - d);
-        }
-    }
-
-    static class LabelMouseListener extends MouseAdapter {
-
-        Point origin;
-        Window parent;
-
-        public LabelMouseListener(Window parent) {
-            this.parent = parent;
-        }
-
-        @Override
-        public void mousePressed(MouseEvent e) {
-            if (dragWindow == null) {
-                dragWindow = new MyDragWindow(parent, getAbsoluteLocation(e));
-            } else {
-                dragWindow.setVisible(true);
-                dragWindow.dragTo(getAbsoluteLocation(e));
-            }
-        }
-
-        @Override
-        public void mouseReleased(MouseEvent e) {
-            labelMouseReleasedCount++;
-            if (dragWindow != null) {
-                dragWindow.setVisible(false);
-            }
-        }
-
-        public void mouseDragged(MouseEvent e) {
-            if (dragWindow != null) {
-                dragWindow.dragTo(getAbsoluteLocation(e));
-            }
-        }
-    }
-
-    static class DragWindowMouseListener extends MouseAdapter {
-
-        @Override
-        public void mouseEntered(MouseEvent e) {
-            dragWindowMouseEnteredCount++;
-        }
-
-        @Override
-        public void mouseReleased(MouseEvent e) {
-            dragWindowMouseReleasedCount++;
-        }
-    }
-
-    static class ButtonMouseListener extends MouseAdapter {
-
-        @Override
-        public void mouseEntered(MouseEvent e) {
-            buttonMouseEnteredCount++;
-        }
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/TextArea/DisposeTest/TestDispose.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,101 @@
+/*
+ * 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.
+ */
+
+/*
+ * Portions Copyright (c) 2012 IBM Corporation
+ */
+
+/* @test
+ * @bug 7155298
+ * @run main/othervm/timeout=60 TestDispose
+ * @summary Editable TextArea blocks GUI application from exit.
+ * @author Sean Chou
+ */
+
+import java.awt.FlowLayout;
+import java.awt.Frame;
+import java.awt.TextArea;
+import java.awt.Toolkit;
+import java.lang.reflect.InvocationTargetException;
+
+import javax.swing.JFrame;
+import javax.swing.SwingUtilities;
+
+import sun.awt.SunToolkit;
+
+public class TestDispose {
+
+    public static Frame frame = null;
+    public static TextArea textArea = null;
+    public static volatile Process worker = null;
+
+    public void testDispose() throws InvocationTargetException,
+            InterruptedException {
+        SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                frame = new JFrame("Test");
+
+                textArea = new TextArea("editable textArea");
+                textArea.setEditable(true);
+                // textArea.setEditable(false); // this testcase passes if textArea is non-editable
+
+                frame.setLayout(new FlowLayout());
+                frame.add(textArea);
+
+                frame.pack();
+                frame.setVisible(true);
+            }
+        });
+        toolkit.realSync();
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                frame.dispose();
+            }
+        });
+        toolkit.realSync();
+    }
+
+    public static void main(String[] args) throws Exception{
+        if(args.length == 0) {
+            Runtime.getRuntime().addShutdownHook(new Thread(){
+                public void run() {
+                    worker.destroy();
+                }
+            });
+
+            System.out.println(System.getProperty("java.home")+"/bin/java TestDispose workprocess");
+            worker = Runtime.getRuntime().exec(System.getProperty("java.home")+"/bin/java TestDispose workprocess");
+            worker.waitFor();
+            return;
+        }
+
+        TestDispose app = new TestDispose();
+        app.testDispose();
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/TextArea/TextAreaCaretVisibilityTest/bug7129742.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,113 @@
+/*
+ * 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.
+ */
+
+/*
+ * Portions Copyright (c) 2012 IBM Corporation
+ */
+
+
+/* @test
+ * @bug 7129742
+ * @summary Focus in non-editable TextArea is not shown on Linux.
+ * @author Sean Chou
+ */
+
+import java.awt.FlowLayout;
+import java.awt.TextArea;
+import java.awt.Toolkit;
+import java.lang.reflect.Field;
+
+import javax.swing.JFrame;
+import javax.swing.JTextArea;
+import javax.swing.SwingUtilities;
+import javax.swing.text.DefaultCaret;
+
+import sun.awt.SunToolkit;
+
+public class bug7129742 {
+
+    public static DefaultCaret caret = null;
+    public static JFrame frame = null;
+    public static boolean fastreturn = false;
+
+    public static void main(String[] args) throws Exception {
+        SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                frame = new JFrame("Test");
+                TextArea textArea = new TextArea("Non-editable textArea");
+                textArea.setEditable(false);
+                frame.setLayout(new FlowLayout());
+                frame.add(textArea);
+                frame.pack();
+                frame.setVisible(true);
+
+                try {
+                    Class XTextAreaPeerClzz  = textArea.getPeer().getClass();
+                    System.out.println(XTextAreaPeerClzz.getName());
+                    if (!XTextAreaPeerClzz.getName().equals("sun.awt.X11.XTextAreaPeer")) {
+                        fastreturn = true;
+                        return;
+                    }
+
+                    Field jtextField = XTextAreaPeerClzz.getDeclaredField("jtext");
+                    jtextField.setAccessible(true);
+                    JTextArea jtext = (JTextArea)jtextField.get(textArea.getPeer());
+                    caret = (DefaultCaret) jtext.getCaret();
+
+                    textArea.requestFocusInWindow();
+                } catch (NoSuchFieldException | SecurityException
+                         | IllegalArgumentException | IllegalAccessException e) {
+                    /* These exceptions mean the implementation of XTextAreaPeer is
+                     * changed, this testcase is not valid any more, fix it or remove.
+                     */
+                    frame.dispose();
+                    throw new RuntimeException("This testcase is not valid any more!");
+                }
+            }
+        });
+        toolkit.realSync();
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                try{
+                    if (fastreturn) {
+                        return;
+                    }
+                    boolean passed = caret.isActive();
+                    System.out.println("is caret visible : " + passed);
+
+                    if (!passed) {
+                        throw new RuntimeException("The test for bug 71297422 failed");
+                    }
+                } finally {
+                    frame.dispose();
+                }
+            }
+        });
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/TextField/DisposeTest/TestDispose.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,102 @@
+/*
+ * 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.
+ */
+
+/*
+ * Portions Copyright (c) 2012 IBM Corporation
+ */
+
+/* @test
+ * @bug 7155298
+ * @run main/othervm/timeout=60 TestDispose
+ * @summary Editable TextField blocks GUI application from exit.
+ * @author Sean Chou
+ */
+
+import java.awt.FlowLayout;
+import java.awt.Frame;
+import java.awt.TextField;
+import java.awt.Toolkit;
+import java.lang.reflect.InvocationTargetException;
+
+import javax.swing.JFrame;
+import javax.swing.SwingUtilities;
+
+import sun.awt.SunToolkit;
+
+public class TestDispose {
+
+    public static Frame frame = null;
+    public static TextField textField = null;
+    public static volatile Process worker = null;
+
+    public void testDispose() throws InvocationTargetException,
+            InterruptedException {
+        SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                frame = new JFrame("Test");
+
+                textField = new TextField("editable textArea");
+                textField.setEditable(true);
+                // textField.setEditable(false); // this testcase passes if textField is non-editable
+
+                frame.setLayout(new FlowLayout());
+                frame.add(textField);
+
+                frame.pack();
+                frame.setVisible(true);
+            }
+        });
+        toolkit.realSync();
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                frame.dispose();
+            }
+        });
+        toolkit.realSync();
+
+    }
+
+    public static void main(String[] args) throws Exception{
+        if(args.length == 0) {
+            Runtime.getRuntime().addShutdownHook(new Thread(){
+                public void run() {
+                    worker.destroy();
+                }
+            });
+
+            System.out.println(System.getProperty("java.home")+"/bin/java TestDispose workprocess");
+            worker = Runtime.getRuntime().exec(System.getProperty("java.home")+"/bin/java TestDispose workprocess");
+            worker.waitFor();
+            return;
+        }
+
+        TestDispose app = new TestDispose();
+        app.testDispose();
+    }
+
+}
--- a/test/java/awt/TrayIcon/DragEventSource/DragEventSource.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/awt/TrayIcon/DragEventSource/DragEventSource.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -64,6 +64,21 @@
     }
 
     private static void init() {
+
+        boolean isSupported = tray.isSupported();
+        System.out.println("is SysTray Supported: " + isSupported);
+
+        if (!isSupported) {
+            String[] instructions =
+            {
+              "The test cannot be run because SystemTray is not supported.",
+              "Simply press PASS button."
+            };
+            Sysout.createDialog( );
+            Sysout.printInstructions( instructions );
+            return;
+        }
+
         String[] instructions =
         {
             "Use see a Frame with a button in it.",
@@ -79,8 +94,8 @@
 
         frame.setLayout(new FlowLayout());
         tray = SystemTray.getSystemTray();
-        boolean isSupported = tray.isSupported();
-        System.out.println("is SysTray Supported: " + isSupported);
+
+
         TrayIcon icons[] = tray.getTrayIcons();
         System.out.println(icons.length);
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/WMSpecificTests/Metacity/FullscreenDialogModality.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,146 @@
+/*
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8012586
+ * @summary verify that modal dialog will appeared above fullscreen window under Metacity WM.
+ * @library ../../regtesthelpers
+ * @build Util
+ * @run main FullscreenDialogModality
+ * @run main/othervm FullscreenDialogModality
+ * @author vkravets
+ */
+
+import test.java.awt.regtesthelpers.Util;
+
+import java.awt.*;
+import java.lang.reflect.InvocationTargetException;
+
+public class FullscreenDialogModality extends Frame {
+
+    static Robot robot = null;
+
+    public void enterFS() {
+        GraphicsDevice gd = getGraphicsConfiguration().getDevice();
+        final boolean fs = gd.isFullScreenSupported();
+        System.out.println("FullscreenSupported: " + (fs ? "yes" : "no"));
+        gd.setFullScreenWindow(this);
+        try {
+            // Give the system time to set the FS window and display it
+            // properly
+            Thread.sleep(2000);
+        } catch (Exception e) {}
+    }
+
+    public void exitFS() {
+        GraphicsDevice gd = getGraphicsConfiguration().getDevice();
+        // reset window
+        gd.setFullScreenWindow(null);
+        try {
+            // Give the system time to set the FS window and display it
+            // properly
+            Thread.sleep(2000);
+        } catch (Exception e) {}
+    }
+
+    public void checkDialogModality() throws InvocationTargetException, InterruptedException {
+        // Dialog
+        final Dialog d = new Dialog(FullscreenDialogModality.this, "Modal dialog", Dialog.ModalityType.APPLICATION_MODAL);
+        d.setBounds(500, 500, 160, 160);
+        d.setModal(true);
+        d.setBackground(Color.red);
+        EventQueue.invokeLater(new Runnable()
+        {
+            public void run()
+            {
+                d.setVisible(true);
+            }
+        });
+        // Wait until the dialog is shown
+        EventQueue.invokeLater(new Runnable() {
+            public void run() {
+                // Empty
+            }
+        });
+
+        Util.waitForIdle(robot);
+        try {
+            //Check color
+            Point checkPoint = new Point(d.getX() + d.getWidth() / 2, d.getY() + d.getHeight() / 2);
+            Color actual = robot.getPixelColor(checkPoint.x, checkPoint.y);
+            System.out.println("Color = " + actual);
+            if (actual.getRGB() == Color.GREEN.getRGB()) {
+                throw new RuntimeException("Test FAILED: Modal dialog shown below fullscreen window");
+            } else if (actual.getRGB() == Color.RED.getRGB()) {
+                System.out.println("Test PASSED: Modal dialog shown above fullscreen window");
+            } else {
+                System.out.println("pixelColor " +
+                        Integer.toHexString(actual.getRGB()) +
+                        " at coordinates (" + checkPoint.x + ", " + checkPoint.y + ")");
+                throw new RuntimeException("Test FAILED: Unexpected behavior");
+            }
+
+            robot.delay(2000);
+            Util.waitForIdle(robot);
+        } finally {
+            d.dispose();
+        }
+    }
+
+    public static void main(String args[]) throws InvocationTargetException, InterruptedException {
+        if (Util.getWMID() != Util.METACITY_WM) {
+            System.out.println("This test is only useful on Metacity");
+            return;
+        }
+        robot = Util.createRobot();
+        Util.waitForIdle(robot);
+        final FullscreenDialogModality frame = new FullscreenDialogModality();
+        frame.setUndecorated(true);
+        frame.setBackground(Color.green);
+        frame.setSize(500, 500);
+        frame.setVisible(true);
+        try {
+            robot.delay(100);
+            Util.waitForIdle(robot);
+
+            EventQueue.invokeAndWait(new Runnable() {
+                public void run() {
+                    frame.enterFS();
+                }
+            });
+            robot.delay(200);
+            Util.waitForIdle(robot);
+
+            frame.checkDialogModality();
+
+            EventQueue.invokeAndWait(new Runnable() {
+                public void run() {
+                    frame.exitFS();
+                }
+            });
+        } finally {
+            frame.dispose();
+        }
+    }
+}
--- a/test/java/awt/Window/Grab/GrabTest.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/awt/Window/Grab/GrabTest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -65,7 +65,7 @@
             }, sun.awt.SunToolkit.GRAB_EVENT_MASK);
 
         f = new Frame("Frame");
-        f.setSize(200, 200);
+        f.setBounds(0, 0, 300, 300);
         f.addMouseListener(new MouseAdapter() {
                 public void mousePressed(MouseEvent e) {
                     System.out.println(e);
@@ -74,7 +74,7 @@
             });
 
         f1 = new Frame("OtherFrame");
-        f1.setBounds(600, 100, 200, 200);
+        f1.setBounds(700, 100, 200, 200);
 
         w = new Window(f);
         w.setLayout(new FlowLayout());
@@ -86,7 +86,7 @@
                 }
             });
         w.add(b);
-        w.setBounds(300, 100, 200, 200);
+        w.setBounds(400, 100, 200, 200);
         w.setBackground(Color.blue);
         w.addMouseListener(new MouseAdapter() {
                 public void mousePressed(MouseEvent e) {
@@ -175,7 +175,8 @@
 
         // 6. Check that press on the outside area causes ungrab
         Point loc = f.getLocationOnScreen();
-        robot.mouseMove(loc.x + 100, loc.y + f.getSize().height + 300);
+        robot.mouseMove(loc.x + 100, loc.y + f.getSize().height + 1);
+        Util.waitForIdle(robot);
         robot.mousePress(InputEvent.BUTTON1_MASK);
         robot.delay(50);
         robot.mouseRelease(InputEvent.BUTTON1_MASK);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/event/KeyEvent/DeadKey/DeadKeyMacOSX.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,138 @@
+/*
+ * 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 7196547
+ * @summary Dead Key implementation for KeyEvent on Mac OS X
+ * @author alexandr.scherbatiy area=awt.event
+ * @run main DeadKeyMacOSX
+ */
+
+import java.awt.*;
+import java.awt.event.*;
+import java.awt.event.KeyEvent;
+import sun.awt.OSInfo;
+import sun.awt.SunToolkit;
+
+public class DeadKeyMacOSX {
+
+    private static SunToolkit toolkit;
+    private static volatile int state = 0;
+
+    public static void main(String[] args) throws Exception {
+
+        if (OSInfo.getOSType() != OSInfo.OSType.MACOSX) {
+            return;
+        }
+
+        toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+        Robot robot = new Robot();
+        robot.setAutoDelay(50);
+
+        createAndShowGUI();
+
+        // Pressed keys: Alt + E + A
+        // Results:  ALT + VK_DEAD_ACUTE + a with accute accent
+        robot.keyPress(KeyEvent.VK_ALT);
+        robot.keyPress(KeyEvent.VK_E);
+        robot.keyRelease(KeyEvent.VK_E);
+        robot.keyRelease(KeyEvent.VK_ALT);
+
+        robot.keyPress(KeyEvent.VK_A);
+        robot.keyRelease(KeyEvent.VK_A);
+
+        if (state != 3) {
+            throw new RuntimeException("Wrong number of key events.");
+        }
+    }
+
+    static void createAndShowGUI() {
+        Frame frame = new Frame();
+        frame.setSize(300, 300);
+        Panel panel = new Panel();
+        panel.addKeyListener(new DeadKeyListener());
+        frame.add(panel);
+        frame.setVisible(true);
+        toolkit.realSync();
+
+        panel.requestFocusInWindow();
+        toolkit.realSync();
+    }
+
+    static class DeadKeyListener extends KeyAdapter {
+
+        @Override
+        public void keyPressed(KeyEvent e) {
+            int keyCode = e.getKeyCode();
+            char keyChar = e.getKeyChar();
+
+            switch (state) {
+                case 0:
+                    if (keyCode != KeyEvent.VK_ALT) {
+                        throw new RuntimeException("Alt is not pressed.");
+                    }
+                    state++;
+                    break;
+                case 1:
+                    if (keyCode != KeyEvent.VK_DEAD_ACUTE) {
+                        throw new RuntimeException("Dead ACUTE is not pressed.");
+                    }
+                    if (keyChar != 0xB4) {
+                        throw new RuntimeException("Pressed char is not dead acute.");
+                    }
+
+                    state++;
+                    break;
+                case 2:
+                    if (keyCode != KeyEvent.VK_A) {
+                        throw new RuntimeException("A is not pressed.");
+                    }
+                    if (keyChar != 0xE1) {
+                        throw new RuntimeException("A char does not have ACCUTE accent");
+                    }
+                    state++;
+                    break;
+                default:
+                    throw new RuntimeException("Excessive keyPressed event.");
+            }
+        }
+
+        @Override
+        public void keyTyped(KeyEvent e) {
+            int keyCode = e.getKeyCode();
+            char keyChar = e.getKeyChar();
+
+            if (state == 3) {
+                if (keyCode != 0) {
+                    throw new RuntimeException("Key code should be undefined.");
+                }
+                if (keyChar != 0xE1) {
+                    throw new RuntimeException("A char does not have ACCUTE accent");
+                }
+            } else {
+                throw new RuntimeException("Wron number of keyTyped events.");
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/event/KeyEvent/DeadKey/DeadKeyMacOSXInputText.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,131 @@
+/*
+ * 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 7199180
+ * @summary [macosx] Dead keys handling for input methods
+ * @author alexandr.scherbatiy area=awt.event
+ * @run main DeadKeyMacOSXInputText
+ */
+import java.awt.*;
+import java.awt.event.*;
+import java.awt.event.KeyEvent;
+import javax.swing.JTextField;
+import sun.awt.OSInfo;
+import sun.awt.SunToolkit;
+
+public class DeadKeyMacOSXInputText {
+
+    private static SunToolkit toolkit;
+    private static volatile int state = 0;
+
+    public static void main(String[] args) throws Exception {
+
+        if (OSInfo.getOSType() != OSInfo.OSType.MACOSX) {
+            return;
+        }
+
+        toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+        Robot robot = new Robot();
+        robot.setAutoDelay(50);
+
+        createAndShowGUI();
+
+        // Pressed keys: Alt + E + A
+        // Results:  ALT + VK_DEAD_ACUTE + a with accute accent
+        robot.keyPress(KeyEvent.VK_ALT);
+        robot.keyPress(KeyEvent.VK_E);
+        robot.keyRelease(KeyEvent.VK_E);
+        robot.keyRelease(KeyEvent.VK_ALT);
+
+        robot.keyPress(KeyEvent.VK_A);
+        robot.keyRelease(KeyEvent.VK_A);
+        toolkit.realSync();
+
+        if (state != 3) {
+            throw new RuntimeException("Wrong number of key events.");
+        }
+    }
+
+    static void createAndShowGUI() {
+        Frame frame = new Frame();
+        frame.setSize(300, 300);
+        Panel panel = new Panel(new BorderLayout());
+        JTextField textField = new JTextField();
+        textField.addKeyListener(new DeadKeyListener());
+        panel.add(textField, BorderLayout.CENTER);
+        frame.add(panel);
+        frame.setVisible(true);
+        toolkit.realSync();
+
+        textField.requestFocusInWindow();
+        toolkit.realSync();
+
+    }
+
+    static class DeadKeyListener extends KeyAdapter {
+
+        @Override
+        public void keyPressed(KeyEvent e) {
+            int keyCode = e.getKeyCode();
+            char keyChar = e.getKeyChar();
+
+            switch (state) {
+                case 0:
+                    if (keyCode != KeyEvent.VK_ALT) {
+                        throw new RuntimeException("Alt is not pressed.");
+                    }
+                    state++;
+                    break;
+                case 1:
+                    if (keyCode != KeyEvent.VK_DEAD_ACUTE) {
+                        throw new RuntimeException("Dead ACUTE is not pressed.");
+                    }
+                    if (keyChar != 0xB4) {
+                        throw new RuntimeException("Pressed char is not dead acute.");
+                    }
+                    state++;
+                    break;
+            }
+        }
+
+        @Override
+        public void keyTyped(KeyEvent e) {
+            int keyCode = e.getKeyCode();
+            char keyChar = e.getKeyChar();
+
+            if (state == 2) {
+                if (keyCode != 0) {
+                    throw new RuntimeException("Key code should be undefined.");
+                }
+                if (keyChar != 0xE1) {
+                    throw new RuntimeException("A char does not have ACCUTE accent");
+                }
+                state++;
+            } else {
+                throw new RuntimeException("Wron number of keyTyped events.");
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/event/TextEvent/TextEventSequenceTest/TextEventSequenceTest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,138 @@
+/*
+ * 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 4028580
+ * @summary TextArea does not send TextEvent when setText. Does for insert
+ * @author kdm@sparc.spb.su: area= awt.TextAvent
+ * @run main TextEventSequenceTest
+ */
+import java.awt.*;
+import java.awt.event.*;
+import sun.awt.SunToolkit;
+
+public class TextEventSequenceTest {
+
+    private static Frame f;
+    private static TextField tf;
+    private static TextArea t;
+    private static int cntEmptyStrings = 0;
+    private static int cntNonEmptyStrings = 0;
+
+    public static void main(String[] args) {
+
+        test("non-empty text string");
+        test("");
+        test(null);
+    }
+
+    private static void test(String test) {
+        SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+
+        createAndShowGUI(test);
+        toolkit.realSync();
+
+        initCounts();
+        t.setText("Hello ");
+        toolkit.realSync();
+        t.append("World! !");
+        toolkit.realSync();
+        t.insert("from Roger Pham", 13);
+        toolkit.realSync();
+        t.replaceRange("Java Duke", 18, 28);
+        toolkit.realSync();
+        checkCounts(0, 4);
+
+        initCounts();
+        t.setText("");
+        toolkit.realSync();
+        t.setText("");
+        toolkit.realSync();
+        t.setText("");
+        toolkit.realSync();
+        checkCounts(1, 0);
+
+        initCounts();
+        tf.setText("Hello There!");
+        toolkit.realSync();
+        checkCounts(0, 1);
+
+        initCounts();
+        tf.setText("");
+        toolkit.realSync();
+        tf.setText("");
+        toolkit.realSync();
+        tf.setText("");
+        toolkit.realSync();
+        checkCounts(1, 0);
+
+        f.dispose();
+    }
+
+    private static void createAndShowGUI(String text) {
+        f = new Frame("TextEventSequenceTest");
+        f.setLayout(new FlowLayout());
+
+        TextListener listener = new MyTextListener();
+
+        tf = new TextField(text);
+        tf.addTextListener(listener);
+        f.add(tf);
+
+        t = new TextArea(text, 10, 30);
+        t.addTextListener(listener);
+        f.add(t);
+
+        f.pack();
+        f.setVisible(true);
+    }
+
+    static class MyTextListener implements TextListener {
+
+        public synchronized void textValueChanged(TextEvent e) {
+            TextComponent tc = (TextComponent) e.getSource();
+            String text = tc.getText();
+            if (text.length() == 0) {
+                cntEmptyStrings++;
+            } else {
+                cntNonEmptyStrings++;
+            }
+        }
+    }
+
+    synchronized static void initCounts() {
+        cntEmptyStrings = 0;
+        cntNonEmptyStrings = 0;
+    }
+
+    synchronized static void checkCounts(int empty, int nonempty) {
+        if (empty != cntEmptyStrings || nonempty != cntNonEmptyStrings) {
+            throw new RuntimeException(
+                    String.format("Expected events: empty = %d, nonempty = %d, "
+                    + "actual events: empty = %d, nonempty = %d",
+                    empty, nonempty, cntEmptyStrings, cntNonEmptyStrings));
+        }
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/image/DrawImage/IncorrectBounds.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,102 @@
+/*
+ * 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.
+ */
+
+
+import java.awt.AlphaComposite;
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsEnvironment;
+import java.awt.image.BufferedImage;
+import java.awt.image.VolatileImage;
+
+/**
+ * @test
+ * @bug 8000629
+ * @summary Temporary backbuffer in the DrawImage should not fill background
+ * outside of source image bounds.
+ * @author Sergey Bylokhov
+ */
+public final class IncorrectBounds {
+
+    private static final int width = 400;
+    private static final int height = 400;
+
+    public static void main(final String[] args) {
+        GraphicsEnvironment ge =
+                GraphicsEnvironment.getLocalGraphicsEnvironment();
+        GraphicsConfiguration gc =
+                ge.getDefaultScreenDevice().getDefaultConfiguration();
+        VolatileImage vi = gc.createCompatibleVolatileImage(width / 4,
+                                                            height / 4);
+        final BufferedImage bi = new BufferedImage(width, height,
+                                                   BufferedImage.TYPE_INT_ARGB);
+        while (true) {
+            vi.validate(gc);
+            Graphics2D g2d = vi.createGraphics();
+            g2d.setColor(Color.green);
+            g2d.fillRect(0, 0, width / 4, height / 4);
+            g2d.dispose();
+
+            if (vi.validate(gc) != VolatileImage.IMAGE_OK) {
+                try {
+                    Thread.sleep(100);
+                } catch (InterruptedException ignored) {
+                }
+                continue;
+            }
+
+            Graphics2D g = bi.createGraphics();
+            g.setComposite(AlphaComposite.Src);
+            g.setColor(Color.red);
+            g.fillRect(0, 0, width, height);
+            // Use sx and sy outside of VI bounds.
+            g.drawImage(vi, 0, 0, width / 2, height / 2, 0, 0, width * 2,
+                        height * 2, null);
+            g.dispose();
+
+            if (vi.contentsLost()) {
+                try {
+                    Thread.sleep(100);
+                } catch (InterruptedException ignored) {
+                }
+                continue;
+            }
+
+            for (int x = 0; x < width; ++x) {
+                for (int y = 0; y < height; ++y) {
+                    if (x < width / 16 && y < height / 16) {
+                        if (bi.getRGB(x, y) != Color.green.getRGB()) {
+                            throw new RuntimeException("Test failed.");
+                        }
+                    } else {
+                        if (bi.getRGB(x, y) != Color.red.getRGB()) {
+                            throw new RuntimeException("Test failed.");
+                        }
+                    }
+                }
+            }
+            break;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/image/DrawImage/IncorrectOffset.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,93 @@
+/*
+ * 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.
+ */
+
+import java.awt.AlphaComposite;
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsEnvironment;
+import java.awt.image.BufferedImage;
+import java.awt.image.VolatileImage;
+
+/**
+ * @test
+ * @bug 8000629
+ * @summary Temporary backbuffer in the DrawImage should have correct offset.
+ * @author Sergey Bylokhov
+ */
+public final class IncorrectOffset {
+
+    private static final int width = 400;
+    private static final int height = 400;
+
+    public static void main(final String[] args) {
+        GraphicsEnvironment ge =
+                GraphicsEnvironment.getLocalGraphicsEnvironment();
+        GraphicsConfiguration gc =
+                ge.getDefaultScreenDevice().getDefaultConfiguration();
+        VolatileImage vi = gc.createCompatibleVolatileImage(width, height);
+        BufferedImage bi = new BufferedImage(width / 4, height / 4,
+                                             BufferedImage.TYPE_INT_ARGB);
+        while (true) {
+            vi.validate(gc);
+            Graphics2D g2d = vi.createGraphics();
+            g2d.setColor(Color.black);
+            g2d.fillRect(0, 0, width, height);
+            g2d.setColor(Color.green);
+            g2d.fillRect(width / 4, height / 4, width / 2, height / 2);
+            g2d.dispose();
+
+            if (vi.validate(gc) != VolatileImage.IMAGE_OK) {
+                try {
+                    Thread.sleep(100);
+                } catch (InterruptedException ignored) {
+                }
+                continue;
+            }
+
+            Graphics2D g = bi.createGraphics();
+            g.setComposite(AlphaComposite.Src);
+            // Scale part of VI to BI. Only green area should be copied.
+            g.drawImage(vi, 0, 0, width / 4, height / 4, width / 4, height / 4,
+                        width / 4 + width / 2, height / 4 + height / 2, null);
+            g.dispose();
+
+            if (vi.contentsLost()) {
+                try {
+                    Thread.sleep(100);
+                } catch (InterruptedException ignored) {
+                }
+                continue;
+            }
+
+            for (int x = 0; x < width / 4; ++x) {
+                for (int y = 0; y < height / 4; ++y) {
+                    if (bi.getRGB(x, y) != Color.green.getRGB()) {
+                        throw new RuntimeException("Test failed.");
+                    }
+                }
+            }
+            break;
+        }
+    }
+}
--- a/test/java/awt/print/PrinterJob/Collate2DPrintingTest.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/awt/print/PrinterJob/Collate2DPrintingTest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -23,7 +23,7 @@
 
 /**
  * @test
- * @bug 6362683
+ * @bug 6362683 8012381
  * @summary Collation should work.
  * @run main/manual Collate2DPrintingTest
  */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/print/PrinterJob/PrintLatinCJKTest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,102 @@
+/*
+ * 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.
+ */
+
+/**
+ * @test
+ * @bug 800535
+ * @summary JDK7 Printing: CJK and Latin Text in string overlap
+ * @run main/manual=yesno PrintLatinCJKTest
+ */
+
+import java.awt.Font;
+import java.awt.Graphics;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.print.PageFormat;
+import java.awt.print.Pageable;
+import java.awt.print.Printable;
+import java.awt.print.PrinterException;
+import java.awt.print.PrinterJob;
+import javax.swing.JButton;
+import javax.swing.JFrame;
+import javax.swing.JTextArea;
+
+import javax.swing.SwingUtilities;
+
+public class PrintLatinCJKTest implements Printable, ActionListener {
+
+    static PrintLatinCJKTest testInstance = new PrintLatinCJKTest();
+    private PageFormat pf;
+
+    static String info =
+       "You need a printer for this test. If you have none, let "+
+       "the test pass. If there is a printer, press Print, send "+
+       "the output to the printer, and examine it. It should have "+
+       "text looking like this : \u4e00\u4e01\u4e02\u4e03\u4e04English.";
+
+    public static void showFrame() {
+         JFrame f = new JFrame();
+         JTextArea jta = new JTextArea(info, 4, 30);
+         jta.setLineWrap(true);
+         jta.setWrapStyleWord(true);
+         f.add("Center", jta);
+         JButton b = new JButton("Print");
+         b.addActionListener(testInstance);
+         f.add("South", b);
+         f.pack();
+         f.setVisible(true);
+    }
+
+    public int print(Graphics g, PageFormat pf, int pageIndex)
+                         throws PrinterException {
+
+        if (pageIndex > 0) {
+            return Printable.NO_SUCH_PAGE;
+        }
+        g.translate((int) pf.getImageableX(), (int) pf.getImageableY());
+        g.setFont(new Font("Dialog", Font.PLAIN, 36));
+        g.drawString("\u4e00\u4e01\u4e02\u4e03\u4e04English", 20, 100);
+        return Printable.PAGE_EXISTS;
+    }
+
+    public void actionPerformed(ActionEvent e) {
+        try {
+            PrinterJob job = PrinterJob.getPrinterJob();
+            job.setPrintable(testInstance);
+            if (job.printDialog()) {
+                job.print();
+            }
+        } catch (PrinterException ex) {
+            ex.printStackTrace();
+        }
+    }
+
+    public static void main(String[] args) {
+        SwingUtilities.invokeLater(new Runnable() {
+            @Override
+            public void run() {
+                showFrame();
+            }
+        });
+    }
+}
--- a/test/java/beans/EventHandler/Test6277266.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/beans/EventHandler/Test6277266.java	Fri Jun 21 19:11:42 2013 -0700
@@ -51,9 +51,11 @@
                     )
             );
             throw new Error("SecurityException expected");
+        } catch (SecurityException exception) {
+            return; // expected security exception in JDK 7
         } catch (InvocationTargetException exception) {
             if (exception.getCause() instanceof SecurityException){
-                return; // expected security exception
+                return; // expected security exception in JDK 8
             }
             throw new Error("unexpected exception", exception);
         } catch (InterruptedException exception) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/beans/Introspector/Test7186794.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,55 @@
+/*
+ * 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 7186794
+ * @summary Tests setter in the super class
+ * @author Sergey Malenkov
+ */
+
+import java.util.List;
+
+public class Test7186794 {
+
+    public static void main(String[] args) {
+        if (null == BeanUtils.findPropertyDescriptor(MyBean.class, "value").getWriteMethod()) {
+            throw new Error("The property setter is not found");
+        }
+    }
+
+    public static class BaseBean {
+
+        protected List<String> value;
+
+        public void setValue(List<String> value) {
+            this.value = value;
+        }
+    }
+
+    public static class MyBean extends BaseBean {
+        public List<String> getValue() {
+            return super.value;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/beans/Introspector/Test7189112.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,58 @@
+/*
+ * 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 7189112
+ * @summary Tests overridden getter
+ * @author Sergey Malenkov
+ */
+
+public class Test7189112 {
+
+    public static void main(String[] args) {
+        if (null == BeanUtils.findPropertyDescriptor(MyBean.class, "value").getWriteMethod()) {
+            throw new Error("The property setter is not found");
+        }
+    }
+
+    public static class BaseBean {
+
+        private Object value;
+
+        public Object getValue() {
+            return this.value;
+        }
+
+        public void setValue(Object value) {
+            this.value = value;
+        }
+    }
+
+    public static class MyBean extends BaseBean {
+        @Override
+        public String getValue() {
+            return (String) super.getValue();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/beans/Introspector/Test7192955.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2012, 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.
+ */
+
+/*
+ * @test
+ * @bug 7192955 8000183
+ * @summary Tests that all properties are bound
+ * @author Sergey Malenkov
+ */
+
+import java.beans.IntrospectionException;
+import java.beans.Introspector;
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyDescriptor;
+import java.util.List;
+
+public class Test7192955 {
+
+    public static void main(String[] args) throws IntrospectionException {
+        if (!BeanUtils.findPropertyDescriptor(MyBean.class, "test").isBound()) {
+            throw new Error("a simple property is not bound");
+        }
+        if (!BeanUtils.findPropertyDescriptor(MyBean.class, "list").isBound()) {
+            throw new Error("a generic property is not bound");
+        }
+        if (!BeanUtils.findPropertyDescriptor(MyBean.class, "readOnly").isBound()) {
+            throw new Error("a read-only property is not bound");
+        }
+        PropertyDescriptor[] pds = Introspector.getBeanInfo(MyBean.class, BaseBean.class).getPropertyDescriptors();
+        for (PropertyDescriptor pd : pds) {
+            if (pd.getName().equals("test") && pd.isBound()) {
+                throw new Error("a simple property is bound without superclass");
+            }
+        }
+    }
+
+    public static class BaseBean {
+
+        private List<String> list;
+
+        public List<String> getList() {
+            return this.list;
+        }
+
+        public void setList(List<String> list) {
+            this.list = list;
+        }
+
+        public void addPropertyChangeListener(PropertyChangeListener listener) {
+        }
+
+        public void removePropertyChangeListener(PropertyChangeListener listener) {
+        }
+
+        public List<String> getReadOnly() {
+            return this.list;
+        }
+    }
+
+    public static class MyBean extends BaseBean {
+
+        private String test;
+
+        public String getTest() {
+            return this.test;
+        }
+
+        public void setTest(String test) {
+            this.test = test;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/beans/Performance/Test7122740.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,57 @@
+/*
+ * 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 7122740
+ * @summary Tests just a benchmark of PropertyDescriptor(String, Class) performance
+ * @author Sergey Malenkov
+ * @run main/manual Test7122740
+ */
+
+import java.beans.PropertyDescriptor;
+
+public class Test7122740 {
+    public static void main(String[] args) throws Exception {
+        long time = System.nanoTime();
+        for (int i = 0; i < 1000; i++) {
+            new PropertyDescriptor("name", PropertyDescriptor.class);
+            new PropertyDescriptor("value", Concrete.class);
+        }
+        time -= System.nanoTime();
+        System.out.println("Time (ms): " + (-time / 1000000));
+    }
+
+    public static class Abstract<T> {
+        private T value;
+        public T getValue() {
+            return this.value;
+        }
+        public void setValue(T value) {
+            this.value = value;
+        }
+    }
+
+    private static class Concrete extends Abstract<String> {
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/beans/Performance/Test7184799.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,71 @@
+/*
+ * 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 7184799
+ * @summary Tests just a benchmark of Introspector.getBeanInfo(Class) performance
+ * @author Sergey Malenkov
+ * @run main/manual Test7184799
+ */
+
+import java.beans.Introspector;
+import java.util.*;
+import java.util.concurrent.ConcurrentHashMap;
+
+public class Test7184799 {
+    private static final Class[] TYPES = {
+            Class.class,
+            String.class,
+            Character.class,
+            Boolean.class,
+            Byte.class,
+            Short.class,
+            Integer.class,
+            Long.class,
+            Float.class,
+            Double.class,
+            Collection.class,
+            Set.class,
+            HashSet.class,
+            TreeSet.class,
+            LinkedHashSet.class,
+            Map.class,
+            HashMap.class,
+            TreeMap.class,
+            LinkedHashMap.class,
+            WeakHashMap.class,
+            ConcurrentHashMap.class,
+            Dictionary.class,
+            Exception.class,
+    };
+
+    public static void main(String[] args) throws Exception {
+        long time = System.nanoTime();
+        for (Class type : TYPES) {
+            Introspector.getBeanInfo(type);
+        }
+        time -= System.nanoTime();
+        System.out.println("Time (ms): " + (-time / 1000000));
+    }
+}
--- a/test/java/beans/XMLEncoder/AbstractTest.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/beans/XMLEncoder/AbstractTest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -30,8 +30,10 @@
 
 import java.nio.charset.Charset;
 
+import java.lang.reflect.Field;
+
 abstract class AbstractTest<T> implements ExceptionListener {
-    private final BeanValidator validator = new BeanValidator();
+    final BeanValidator validator = new BeanValidator();
 
     public final void exceptionThrown(Exception exception) {
         throw new Error("unexpected exception", exception);
@@ -59,7 +61,7 @@
     }
 
     /**
-     * This method should be overriden
+     * This method should be overridden
      * if specified encoder should be initialized.
      *
      * @param encoder  the XML encoder to initialize
@@ -68,7 +70,7 @@
     }
 
     /**
-     * This method should be overriden
+     * This method should be overridden
      * if specified decoder should be initialized.
      *
      * @param decoder  the XML decoder to initialize
@@ -77,7 +79,7 @@
     }
 
     /**
-     * This method should be overriden
+     * This method should be overridden
      * for test-specific comparison.
      *
      * @param before  the object before encoding
@@ -134,6 +136,7 @@
     private byte[] writeObject(Object object) {
         ByteArrayOutputStream output = new ByteArrayOutputStream();
         XMLEncoder encoder = new XMLEncoder(output);
+        encoder.setExceptionListener(this);
         initialize(encoder);
         encoder.writeObject(object);
         encoder.close();
@@ -143,9 +146,24 @@
     private Object readObject(byte[] array) {
         ByteArrayInputStream input = new ByteArrayInputStream(array);
         XMLDecoder decoder = new XMLDecoder(input);
+        decoder.setExceptionListener(this);
         initialize(decoder);
         Object object = decoder.readObject();
         decoder.close();
         return object;
     }
+
+    static Field getField(String name) {
+        try {
+            int index = name.lastIndexOf('.');
+            String className = name.substring(0, index);
+            String fieldName = name.substring(1 + index);
+            Field field = Class.forName(className).getDeclaredField(fieldName);
+            field.setAccessible(true);
+            return field;
+        }
+        catch (Exception exception) {
+            throw new Error(exception);
+        }
+    }
 }
--- a/test/java/beans/XMLEncoder/BeanValidator.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/beans/XMLEncoder/BeanValidator.java	Fri Jun 21 19:11:42 2013 -0700
@@ -63,6 +63,15 @@
         }
         Class type = object1.getClass();
         if (!type.equals(object2.getClass())) {
+            // resolve different implementations of the Map.Entry interface
+            if ((object1 instanceof Map.Entry) && (object2 instanceof Map.Entry)) {
+                log("!!! special case", "Map.Entry");
+                Map.Entry entry1 = (Map.Entry) object1;
+                Map.Entry entry2 = (Map.Entry) object2;
+                validate(entry1.getKey(), entry2.getKey());
+                validate(entry1.getValue(), entry2.getValue());
+                return;
+            }
             throw new IllegalStateException("could not compare objects with different types");
         }
         // validate elements of arrays
@@ -82,10 +91,14 @@
             }
             return;
         }
+        // special case for collections: do not use equals
+        boolean ignore = Collection.class.isAssignableFrom(type)
+                || Map.Entry.class.isAssignableFrom(type)
+                || Map.class.isAssignableFrom(type);
         // validate objects using equals()
         // we assume that the method equals(Object) can be called,
         // if the class declares such method
-        if (isDefined(type, "equals", Object.class)) {
+        if (!ignore && isDefined(type, "equals", Object.class)) {
             if (object1.equals(object2)) {
                 return;
             }
@@ -205,27 +218,7 @@
     }
 
     private void validate(Map map1, Map map2, boolean sorted) {
-        if (map1.size() != map2.size()) {
-            throw new IllegalStateException("could not compare maps with different sizes");
-        }
-        if (sorted) {
-            Iterator first = map1.entrySet().iterator();
-            Iterator second = map2.entrySet().iterator();
-            int index = 0;
-            while (first.hasNext() && second.hasNext()) {
-                log("validate map entry", Integer.valueOf(index++));
-                validate(first.next(), second.next());
-            }
-            if (first.hasNext() || second.hasNext()) {
-                throw new IllegalStateException("one map contains more entries than another one");
-            }
-        } else {
-            // assume that equals() can be used for keys
-            for (Object key : map1.keySet()) {
-                log("validate map value for key", key);
-                validate(map1.get(key), map2.get(key));
-            }
-        }
+        validate(map1.entrySet(), map2.entrySet(), sorted);
     }
 
     private boolean isCyclic(Object object1, Object object2) {
--- a/test/java/beans/XMLEncoder/Test4631471.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/beans/XMLEncoder/Test4631471.java	Fri Jun 21 19:11:42 2013 -0700
@@ -28,7 +28,6 @@
  * @author Sergey Malenkov, Mark Davidson
  */
 
-import java.beans.XMLEncoder;
 import javax.swing.JTree;
 import javax.swing.tree.DefaultMutableTreeNode;
 import javax.swing.tree.DefaultTreeModel;
@@ -78,10 +77,6 @@
         // do not any validation
     }
 
-    protected final void initialize(XMLEncoder encoder) {
-        encoder.setExceptionListener(this);
-    }
-
     public static TreeNode getRoot() {
         DefaultMutableTreeNode node = new DefaultMutableTreeNode("root");
         DefaultMutableTreeNode first = new DefaultMutableTreeNode("first");
--- a/test/java/beans/XMLEncoder/Test4679556.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/beans/XMLEncoder/Test4679556.java	Fri Jun 21 19:11:42 2013 -0700
@@ -103,7 +103,6 @@
     }
 
     protected void initialize(XMLEncoder encoder) {
-        encoder.setExceptionListener(this);
         encoder.setPersistenceDelegate(C.class, new DefaultPersistenceDelegate() {
             protected Expression instantiate(Object oldInstance, Encoder out) {
                 C c = (C) oldInstance;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/beans/XMLEncoder/Test6989223.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,60 @@
+/*
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 6989223
+ * @summary Tests Rectangle2D.Double encoding
+ * @author Sergey Malenkov
+ */
+
+import java.awt.geom.Rectangle2D;
+
+public class Test6989223 extends AbstractTest {
+    public static void main(String[] args) {
+        new Test6989223().test(true);
+    }
+
+    protected Object getObject() {
+        return new Bean(1, 2, 3, 4);
+    }
+
+    @Override
+    protected Object getAnotherObject() {
+        return new Bean(1, 2, 3, 5);
+    }
+
+    public static class Bean extends Rectangle2D.Double {
+        public Bean() {
+        }
+
+        public Bean(double x, double y, double w, double h) {
+            super(x, y, w, h);
+        }
+
+        @Override
+        public boolean equals(Object object) {
+            return super.equals(object); // to avoid recursion during validation
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/beans/XMLEncoder/Test7080156.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,60 @@
+/*
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 7080156 7094245
+ * @summary Tests beans with public arrays
+ * @author Sergey Malenkov
+ */
+
+public class Test7080156 extends AbstractTest {
+    public static void main(String[] args) {
+        new Test7080156().test(true);
+    }
+
+    protected Object getObject() {
+        Bean bean = new Bean();
+        bean.setArray("something");
+        return bean;
+    }
+
+    @Override
+    protected Object getAnotherObject() {
+        Bean bean = new Bean();
+        bean.setArray("some", "thing");
+        return bean;
+    }
+
+    public static class Bean {
+        public String[] array = {"default"};
+
+        public void setArray(String... array) {
+            this.array = array;
+        }
+
+        public String[] getArray() {
+            return this.array;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/beans/XMLEncoder/Test8013416.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,90 @@
+/*
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8013416
+ * @summary Tests public synthetic methods
+ * @author Sergey Malenkov
+ */
+
+import java.beans.DefaultPersistenceDelegate;
+import java.beans.Encoder;
+import java.beans.Expression;
+import java.beans.Statement;
+import java.beans.XMLEncoder;
+import java.util.HashMap;
+import java.util.Map.Entry;
+import java.util.Set;
+
+public class Test8013416 extends AbstractTest {
+    public static void main(String[] args) {
+        new Test8013416().test(true);
+    }
+
+    protected Object getObject() {
+        Public<String, String> map = new Public<String, String>();
+        map.put(" pz1 ", " pz2 ");
+        map.put(" pz3 ", " pz4 ");
+        return map;
+    }
+
+    @Override
+    protected void initialize(XMLEncoder encoder) {
+        super.initialize(encoder);
+        encoder.setPersistenceDelegate(Public.class, new PublicPersistenceDelegate());
+    }
+
+    private static final class PublicPersistenceDelegate extends DefaultPersistenceDelegate {
+        @Override
+        protected Expression instantiate(Object oldInstance, Encoder out) {
+            return new Expression(oldInstance, oldInstance.getClass(), "new", null);
+        }
+
+        @Override
+        protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
+            super.initialize(type, oldInstance, newInstance, out);
+
+            Public<String, String> map = (Public) oldInstance;
+            for (Entry<String, String> entry : map.getAll()) {
+                String[] args = {entry.getKey(), entry.getValue()};
+                out.writeStatement(new Statement(oldInstance, "put", args));
+            }
+        }
+    }
+
+    public static final class Public<K, V> extends Private<K, V> {
+    }
+
+    private static class Private<K, V> {
+        private HashMap<K, V> map = new HashMap<K, V>();
+
+        public void put(K key, V value) {
+            this.map.put(key, value);
+        }
+
+        public Set<Entry<K, V>> getAll() {
+            return this.map.entrySet();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/beans/XMLEncoder/Test8013557.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,84 @@
+/*
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8013557
+ * @summary Tests beans with public fields
+ * @author Sergey Malenkov
+ */
+
+public class Test8013557 extends AbstractTest {
+    public static void main(String[] args) {
+        new Test8013557().test(true);
+    }
+
+    protected Object getObject() {
+        return new Bean(new Value("something"));
+    }
+
+    @Override
+    protected Object getAnotherObject() {
+        return new Bean(new Value());
+    }
+
+    public static class Bean {
+        public Value value;
+
+        public Bean() {
+            this.value = new Value();
+        }
+
+        public Bean(Value value) {
+            this.value = value;
+        }
+
+        public void setValue(Value value) {
+            this.value = value;
+        }
+
+        public Value getValue() {
+            return this.value;
+        }
+    }
+
+    public static class Value {
+        private String string;
+
+        public Value() {
+            this.string = "default";
+        }
+
+        public Value(String value) {
+            this.string = value;
+        }
+
+        public void setString(String string) {
+            this.string = string;
+        }
+
+        public String getString() {
+            return this.string;
+        }
+    }
+}
--- a/test/java/beans/XMLEncoder/java_awt_BorderLayout.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/beans/XMLEncoder/java_awt_BorderLayout.java	Fri Jun 21 19:11:42 2013 -0700
@@ -68,11 +68,9 @@
     @Override
     protected void validate(BorderLayout before, BorderLayout after) {
         super.validate(before, after);
-
-        BeanValidator validator = new BeanValidator();
         for (String constraint : CONSTRAINTS) {
-            validator.validate(before.getLayoutComponent(constraint),
-                               after.getLayoutComponent(constraint));
+            super.validator.validate(before.getLayoutComponent(constraint),
+                                     after.getLayoutComponent(constraint));
         }
     }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/beans/XMLEncoder/java_awt_CardLayout.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,83 @@
+/*
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8007458
+ * @summary Tests CardLayout encoding
+ * @author Sergey Malenkov
+ */
+
+import java.awt.CardLayout;
+import java.lang.reflect.Field;
+import java.util.Vector;
+import javax.swing.JLabel;
+
+public final class java_awt_CardLayout extends AbstractTest<CardLayout> {
+    private static final Field VECTOR = getField("java.awt.CardLayout.vector");
+    private static final Field NAME = getField("java.awt.CardLayout$Card.name");
+    private static final Field COMP = getField("java.awt.CardLayout$Card.comp");
+
+    public static void main(String[] args) throws Exception {
+        new java_awt_CardLayout().test(true);
+    }
+
+    @Override
+    protected CardLayout getObject() {
+        CardLayout layout = new CardLayout();
+        layout.addLayoutComponent(new JLabel("a"), "a");
+        layout.addLayoutComponent(new JLabel("b"), "b");
+        layout.addLayoutComponent(new JLabel("c"), "c");
+        return layout;
+    }
+
+    @Override
+    protected CardLayout getAnotherObject() {
+        CardLayout layout = new CardLayout();
+        layout.addLayoutComponent(new JLabel("a"), "a");
+        layout.addLayoutComponent(new JLabel("b"), "b");
+        layout.addLayoutComponent(new JLabel("c"), "c");
+        layout.addLayoutComponent(new JLabel("d"), "d");
+        return layout;
+    }
+
+    @Override
+    protected void validate(CardLayout before, CardLayout after) {
+        super.validate(before, after);
+        try {
+            Vector a = (Vector) VECTOR.get(after);
+            Vector b = (Vector) VECTOR.get(before);
+            int size = a.size();
+            if (size != b.size()) {
+                throw new Error("different content");
+            }
+            for (int i = 0; i < size; i++) {
+                super.validator.validate(NAME.get(a.get(i)), NAME.get(b.get(i)));
+                super.validator.validate(COMP.get(a.get(i)), COMP.get(b.get(i)));
+            }
+        }
+        catch (Exception exception) {
+            throw new Error(exception);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/beans/XMLEncoder/java_awt_GridBagLayout.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,101 @@
+/*
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8007458
+ * @summary Tests GridBagLayout encoding
+ * @author Sergey Malenkov
+ */
+
+import java.awt.Component;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.lang.reflect.Field;
+import java.util.Hashtable;
+import java.util.Map;
+import javax.swing.JLabel;
+
+public final class java_awt_GridBagLayout extends AbstractTest<GridBagLayout> {
+    private static final Field HASHTABLE = getField("java.awt.GridBagLayout.comptable");
+
+    public static void main(String[] args) {
+        new java_awt_GridBagLayout().test(true);
+    }
+
+    @Override
+    protected GridBagLayout getObject() {
+        GridBagLayout layout = new GridBagLayout();
+        update(layout, "1", 1, 1);
+        update(layout, "2", 2, 2);
+        update(layout, "3", 3, 3);
+        return layout;
+    }
+
+    @Override
+    protected GridBagLayout getAnotherObject() {
+        GridBagLayout layout = new GridBagLayout();
+        update(layout, "11", 1, 1);
+        update(layout, "12", 1, 2);
+        update(layout, "21", 2, 1);
+        update(layout, "22", 2, 2);
+        return layout;
+    }
+
+    @Override
+    protected void validate(GridBagLayout before, GridBagLayout after) {
+        super.validate(before, after);
+        try {
+            Hashtable a = (Hashtable) HASHTABLE.get(after);
+            Hashtable b = (Hashtable) HASHTABLE.get(before);
+            super.validator.validate(a, b);
+
+//            for (int i = 0; i < size; i++) {
+//                validator.validate(NAME.get(a.get(i)), NAME.get(b.get(i)));
+//                validator.validate(COMP.get(a.get(i)), COMP.get(b.get(i)));
+//            }
+        }
+        catch (Exception exception) {
+            throw new Error(exception);
+        }
+
+
+
+//        for (String name : names) {
+//            validator.validate(getConstraints(before, name), getConstraints(after, name));
+//        }
+    }
+
+    private static void update(GridBagLayout layout, String id, int x, int y) {
+        GridBagConstraints gbc = new GridBagConstraints();
+        gbc.gridx = x;
+        gbc.gridy = y;
+        layout.addLayoutComponent(new JLabel(id), gbc);
+    }
+
+/*
+    private static GridBagConstraints getConstraints(GridBagLayout layout, String id) {
+        return (layout == null) ? null : ((MyGridBagLayout) layout).getConstraints(id);
+    }
+*/
+}
--- a/test/java/beans/XMLEncoder/javax_swing_DefaultCellEditor.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/beans/XMLEncoder/javax_swing_DefaultCellEditor.java	Fri Jun 21 19:11:42 2013 -0700
@@ -28,6 +28,7 @@
  * @author Sergey Malenkov
  */
 
+import java.beans.XMLEncoder;
 import javax.swing.DefaultCellEditor;
 import javax.swing.JTextField;
 import javax.swing.text.JTextComponent;
@@ -46,6 +47,11 @@
         // return new DefaultCellEditor(new JTextField("Second"));
     }
 
+    @Override
+    protected void initialize(XMLEncoder encoder) {
+        encoder.setExceptionListener(null); // TODO: ignore non-public listener because of 4808251
+    }
+
     protected void validate(DefaultCellEditor before, DefaultCellEditor after) {
         String text = ((JTextComponent) after.getComponent()).getText();
         if (!text.equals(((JTextComponent) before.getComponent()).getText()))
--- a/test/java/io/File/CreateNewFile.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/io/File/CreateNewFile.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2001, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,7 +22,7 @@
  */
 
 /* @test
-   @bug 4130498 4391178
+   @bug 4130498 4391178 6198547
    @summary Basic test for createNewFile method
  */
 
@@ -51,5 +51,20 @@
         } catch (IOException e) {
             // Exception expected
         }
+
+        testCreateExistingDir();
+    }
+
+    // Test JDK-6198547
+    private static void testCreateExistingDir() throws IOException {
+        File tmpFile = new File("hugo");
+        if (tmpFile.exists() && !tmpFile.delete())
+            throw new RuntimeException("Cannot delete " + tmpFile);
+        if (!tmpFile.mkdir())
+            throw new RuntimeException("Cannot create dir " + tmpFile);
+        if (!tmpFile.exists())
+            throw new RuntimeException("Cannot see created dir " + tmpFile);
+        if (tmpFile.createNewFile())
+            throw new RuntimeException("Should fail to create file " + tmpFile);
     }
 }
--- a/test/java/io/File/IsHidden.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/io/File/IsHidden.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -46,6 +46,11 @@
         Files.getFileAttributeView(f.toPath(), DosFileAttributeView.class).setHidden(value);
     }
 
+    private static void checkHidden(File f) {
+        if (!f.isHidden())
+            throw new RuntimeException(f + " should be hidden");
+    }
+
     private static void testWin32() throws Exception {
         File f = new File(dir, "test");
         f.deleteOnExit();
@@ -58,6 +63,11 @@
         }
         ck(".foo", false);
         ck("foo", false);
+
+        File pagefile = new File("C:\\pagefile.sys");
+        File hiberfil = new File("C:\\hiberfil.sys");
+        if (pagefile.exists()) checkHidden(pagefile);
+        if (hiberfil.exists()) checkHidden(hiberfil);
     }
 
     private static void testUnix() throws Exception {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/io/File/MacPathTest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,166 @@
+/*
+ * 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.
+ *
+ * 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 7130915
+ * @summary Tests file path with nfc/nfd forms on MacOSX
+ * @build MacPathTest
+ * @run shell MacPathTest.sh
+ */
+
+import java.io.*;
+import java.text.*;
+import java.util.*;
+
+public class MacPathTest {
+
+    public static void main(String args[]) throws Throwable {
+        String osname = System.getProperty("os.name");
+        if (!osname.contains("OS X") && !osname.contains("Darwin"))
+            return;
+
+        // English
+        test("TestDir_apple",                                    // test dir
+             "dir_macosx",                                       // dir
+             "file_macosx");                                     // file
+
+        // Japanese composite character
+        test("TestDir_\u30c8\u30a4\u30e4\u30cb\u30ca\u30eb/",
+             "dir_\u30a4\u30c1\u30b4\u306e\u30b1\u30fc\u30ad",
+             "file_\u30a4\u30c1\u30b4\u306e\u30b1\u30fc\u30ad");
+
+        // latin-1 supplementory
+        test("TestDir_K\u00f6rperlich\u00e4\u00df/",
+             "dir_Entt\u00e4uschung",
+             "file_Entt\u00e4uschung");
+
+        test("TestDir_K\u00f6rperlich\u00e4\u00df/",
+             "dir_Entt\u00c4uschung",
+             "file_Entt\u00c4uschung");
+
+        // Korean syblla
+        test("TestDir_\uac00\uac01\uac02",
+             "dir_\uac20\uac21\uac22",
+             "file_\uacc0\uacc1\uacc2");
+    }
+
+    private static void removeAll(File file) throws Throwable {
+        if (file.isDirectory()) {
+            for (File f : file.listFiles()) {
+                removeAll(f);
+            }
+        }
+        file.delete();
+    }
+
+    private static boolean equal(Object x, Object y) {
+        return x == null ? y == null : x.equals(y);
+    }
+
+    private static boolean match(File target, File src) {
+        if (target.equals(src)) {
+            String fname = target.toString();
+            System.out.printf("    ->matched   : [%s], length=%d%n", fname, fname.length());
+            return true;
+        }
+        return false;
+    }
+
+    private static void open_read(String what, File file) throws Throwable {
+        try (FileInputStream fis = new FileInputStream(file)) {
+           byte[] bytes = new byte[10];
+           fis.read(bytes);
+           System.out.printf("    %s:%s%n", what, new String(bytes));
+        }
+    }
+
+    private static void test(String testdir, String dname, String fname_nfc)
+        throws Throwable
+    {
+        String fname = null;
+        String dname_nfd = Normalizer.normalize(dname, Normalizer.Form.NFD);
+        String fname_nfd = Normalizer.normalize(fname_nfc, Normalizer.Form.NFD);
+
+        System.out.printf("%n%n--------Testing...----------%n");
+        File base = new File(testdir);
+        File dir  = new File(base, dname);
+        File dir_nfd =  new File(base, dname_nfd);
+        File file_nfc = new File(base, fname_nfc);
+        File file_nfd = new File(base, fname_nfd);
+
+        System.out.printf("base           :[%s][len=%d]%n", testdir, testdir.length());
+        System.out.printf("dir            :[%s][len=%d]%n", dname, dname.length());
+        System.out.printf("fname_nfc      :[%s][len=%d]%n", fname_nfc, fname_nfc.length());
+        System.out.printf("fname_nfd      :[%s][len=%d]%n", fname_nfd, fname_nfd.length());
+
+        fname = file_nfc.toString();
+        System.out.printf("file_nfc ->[%s][len=%d]%n", fname, fname.length());
+        fname = file_nfd.toString();
+        System.out.printf("file_nfd ->[%s][len=%d]%n%n", fname, fname.length());
+
+        removeAll(base);
+        dir.mkdirs();
+
+        fname = dir.toString();
+        System.out.printf(":Directory [%s][len=%d] created%n", fname, fname.length());
+
+        //////////////////////////////////////////////////////////////
+        if (!dir.isDirectory() || !dir_nfd.isDirectory()) {
+            throw new RuntimeException("File.isDirectory() failed");
+        }
+
+        //////////////////////////////////////////////////////////////
+        // write to via nfd
+        try (FileOutputStream fos = new FileOutputStream(file_nfd)) {
+           fos.write('n'); fos.write('f'); fos.write('d');
+        }
+        open_read("read in with nfc (from nfd)", file_nfc);
+        file_nfd.delete();
+
+        //////////////////////////////////////////////////////////////
+        // write to with nfc
+        try (FileOutputStream fos = new FileOutputStream(file_nfc)) {
+           fos.write('n'); fos.write('f'); fos.write('c');
+        }
+        open_read("read in with nfd      (from nfc)", file_nfd);
+        //file_nfc.delete();
+
+        //////////////////////////////////////////////////////////////
+        boolean found_dir = false;
+        boolean found_file_nfc = false;
+        boolean found_file_nfd = false;
+
+        for (File f : base.listFiles()) {
+            fname = f.toString();
+            System.out.printf("Found   : [%s], length=%d%n", fname, fname.length());
+            found_dir      |= match(dir, f);
+            found_file_nfc |= match(file_nfc, f);
+            found_file_nfd |= match(file_nfd, f);
+        }
+
+        if (!found_dir || !found_file_nfc || !found_file_nfc) {
+            throw new RuntimeException("File.equal() failed");
+        }
+        removeAll(base);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/io/File/MacPathTest.sh	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,39 @@
+#! /bin/sh
+
+#
+# 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.
+#
+#
+OS=`uname -s`
+case "$OS" in
+  Darwin ) ;;
+  * )
+    exit 0
+    ;;
+esac
+
+if [ "x$TESTJAVA" = x ]; then
+  TESTJAVA=$1; shift
+  TESTCLASSES=.
+fi
+
+export LC_ALL=en_US.UTF-8 ;${TESTJAVA}/bin/java -cp ${TESTCLASSES} MacPathTest
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/io/File/NulFile.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,625 @@
+/*
+ * 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.
+ */
+
+/* @test
+ * @bug 8003992
+ * @summary Test a file whose path name is embedded with NUL character, and
+ *          ensure it is handled correctly.
+ * @author Dan Xu
+ */
+
+import java.io.File;
+import java.io.FileFilter;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.RandomAccessFile;
+import java.io.FileNotFoundException;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.nio.file.InvalidPathException;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.ObjectOutputStream;
+import java.io.ObjectInputStream;
+
+public class NulFile {
+
+    private static final char CHAR_NUL = '\u0000';
+
+    private static final String ExceptionMsg = "Invalid file path";
+
+    public static void main(String[] args) {
+        testFile();
+        testFileInUnix();
+        testFileInWindows();
+        testTempFile();
+    }
+
+    private static void testFile() {
+        test(new File(new StringBuilder().append(CHAR_NUL).toString()));
+        test(new File(
+                new StringBuilder().append("").append(CHAR_NUL).toString()));
+        test(new File(
+                new StringBuilder().append(CHAR_NUL).append("").toString()));
+    }
+
+    private static void testFileInUnix() {
+        String osName = System.getProperty("os.name");
+        if (osName.startsWith("Windows"))
+            return;
+
+        String unixFile = "/";
+        test(unixFile);
+
+        unixFile = "//";
+        test(unixFile);
+
+        unixFile = "data/info";
+        test(unixFile);
+
+        unixFile = "/data/info";
+        test(unixFile);
+
+        unixFile = "//data//info";
+        test(unixFile);
+    }
+
+    private static void testFileInWindows() {
+        String osName = System.getProperty("os.name");
+        if (!osName.startsWith("Windows"))
+            return;
+
+        String windowsFile = "\\";
+        test(windowsFile);
+
+        windowsFile = "\\\\";
+        test(windowsFile);
+
+        windowsFile = "/";
+        test(windowsFile);
+
+        windowsFile = "//";
+        test(windowsFile);
+
+        windowsFile = "/\\";
+        test(windowsFile);
+
+        windowsFile = "\\/";
+        test(windowsFile);
+
+        windowsFile = "data\\info";
+        test(windowsFile);
+
+        windowsFile = "\\data\\info";
+        test(windowsFile);
+
+        windowsFile = "\\\\server\\data\\info";
+        test(windowsFile);
+
+        windowsFile = "z:data\\info";
+        test(windowsFile);
+
+        windowsFile = "z:\\data\\info";
+        test(windowsFile);
+    }
+
+    private static void test(final String name) {
+        int length = name.length();
+
+        for (int i = 0; i <= length; i++) {
+            StringBuilder sbName = new StringBuilder(name);
+            sbName.insert(i, CHAR_NUL);
+            String curName = sbName.toString();
+
+            // test File(String parent, String child)
+            File testFile = new File(curName, "child");
+            test(testFile);
+            testFile = new File("parent", curName);
+            test(testFile);
+
+            // test File(String pathname)
+            testFile = new File(curName);
+            test(testFile);
+
+            // test File(File parent, String child)
+            testFile = new File(new File(curName), "child");
+            test(testFile);
+            testFile = new File(new File("parent"), curName);
+            test(testFile);
+
+            // test FileInputStream
+            testFileInputStream(curName);
+
+            // test FileOutputStream
+            testFileOutputStream(curName);
+
+            // test RandomAccessFile
+            testRandomAccessFile(curName);
+        }
+    }
+
+    private static void testFileInputStream(final String str) {
+        boolean exceptionThrown = false;
+        FileInputStream is = null;
+        try {
+            is = new FileInputStream(str);
+        } catch (FileNotFoundException ex) {
+            if (ExceptionMsg.equals(ex.getMessage()))
+                exceptionThrown = true;
+        }
+        if (!exceptionThrown) {
+            throw new RuntimeException("FileInputStream constructor"
+                    + " should throw FileNotFoundException");
+        }
+        if (is != null) {
+            throw new RuntimeException("FileInputStream constructor"
+                    + " should fail");
+        }
+
+        exceptionThrown = false;
+        is = null;
+        try {
+            is = new FileInputStream(new File(str));
+        } catch (FileNotFoundException ex) {
+            if (ExceptionMsg.equals(ex.getMessage()))
+                exceptionThrown = true;
+        }
+        if (!exceptionThrown) {
+            throw new RuntimeException("FileInputStream constructor"
+                    + " should throw FileNotFoundException");
+        }
+        if (is != null) {
+            throw new RuntimeException("FileInputStream constructor"
+                    + " should fail");
+        }
+    }
+
+    private static void testFileOutputStream(final String str) {
+        boolean exceptionThrown = false;
+        FileOutputStream os = null;
+        try {
+            os = new FileOutputStream(str);
+        } catch (FileNotFoundException ex) {
+            if (ExceptionMsg.equals(ex.getMessage()))
+                exceptionThrown = true;
+        }
+        if (!exceptionThrown) {
+            throw new RuntimeException("FileOutputStream constructor"
+                    + " should throw FileNotFoundException");
+        }
+        if (os != null) {
+            throw new RuntimeException("FileOutputStream constructor"
+                    + " should fail");
+        }
+
+        exceptionThrown = false;
+        os = null;
+        try {
+            os = new FileOutputStream(new File(str));
+        } catch (FileNotFoundException ex) {
+            if (ExceptionMsg.equals(ex.getMessage()))
+                exceptionThrown = true;
+        }
+        if (!exceptionThrown) {
+            throw new RuntimeException("FileOutputStream constructor"
+                    + " should throw FileNotFoundException");
+        }
+        if (os != null) {
+            throw new RuntimeException("FileOutputStream constructor"
+                    + " should fail");
+        }
+    }
+
+    private static void testRandomAccessFile(final String str) {
+        boolean exceptionThrown = false;
+        RandomAccessFile raf = null;
+        String[] modes = {"r", "rw", "rws", "rwd"};
+
+        for (String mode : modes) {
+            try {
+                raf = new RandomAccessFile(str, mode);
+            } catch (FileNotFoundException ex) {
+                if (ExceptionMsg.equals(ex.getMessage()))
+                    exceptionThrown = true;
+            }
+            if (!exceptionThrown) {
+                throw new RuntimeException("RandomAccessFile constructor"
+                        + " should throw FileNotFoundException");
+            }
+            if (raf != null) {
+                throw new RuntimeException("RandomAccessFile constructor"
+                        + " should fail");
+            }
+
+            exceptionThrown = false;
+            raf = null;
+            try {
+                raf = new RandomAccessFile(new File(str), mode);
+            } catch (FileNotFoundException ex) {
+                if (ExceptionMsg.equals(ex.getMessage()))
+                    exceptionThrown = true;
+            }
+            if (!exceptionThrown) {
+                throw new RuntimeException("RandomAccessFile constructor"
+                        + " should throw FileNotFoundException");
+            }
+            if (raf != null) {
+                throw new RuntimeException("RandomAccessFile constructor"
+                        + " should fail");
+            }
+        }
+    }
+
+    private static void test(File testFile) {
+        test(testFile, false);
+        // test serialization
+        testSerialization(testFile);
+    }
+
+    @SuppressWarnings("deprecation")
+    private static void test(File testFile, boolean derived) {
+        boolean exceptionThrown = false;
+
+        if (testFile == null) {
+            throw new RuntimeException("test file should not be null.");
+        }
+
+        // getPath()
+        if (testFile.getPath().indexOf(CHAR_NUL) < 0) {
+            throw new RuntimeException(
+                    "File path should contain Nul character");
+        }
+        // getAbsolutePath()
+        if (testFile.getAbsolutePath().indexOf(CHAR_NUL) < 0) {
+            throw new RuntimeException(
+                    "File absolute path should contain Nul character");
+        }
+        // getAbsoluteFile()
+        File derivedAbsFile = testFile.getAbsoluteFile();
+        if (derived) {
+            if (derivedAbsFile.getPath().indexOf(CHAR_NUL) < 0) {
+                throw new RuntimeException(
+                        "Derived file path should also contain Nul character");
+            }
+        } else {
+            test(derivedAbsFile, true);
+        }
+        // getCanonicalPath()
+        try {
+            exceptionThrown = false;
+            testFile.getCanonicalPath();
+        } catch (IOException ex) {
+            if (ExceptionMsg.equals(ex.getMessage()))
+                exceptionThrown = true;
+        }
+        if (!exceptionThrown) {
+            throw new RuntimeException(
+                    "getCanonicalPath() should throw IOException with"
+                        + " message \"" + ExceptionMsg + "\"");
+        }
+        // getCanonicalFile()
+        try {
+            exceptionThrown = false;
+            testFile.getCanonicalFile();
+        } catch (IOException ex) {
+            if (ExceptionMsg.equals(ex.getMessage()))
+                exceptionThrown = true;
+        }
+        if (!exceptionThrown) {
+            throw new RuntimeException(
+                    "getCanonicalFile() should throw IOException with"
+                        + " message \"" + ExceptionMsg + "\"");
+        }
+        // toURL()
+        try {
+            exceptionThrown = false;
+            testFile.toURL();
+        } catch (MalformedURLException ex) {
+            if (ExceptionMsg.equals(ex.getMessage()))
+                exceptionThrown = true;
+        }
+        if (!exceptionThrown) {
+            throw new RuntimeException("toURL() should throw IOException with"
+                + " message \"" + ExceptionMsg + "\"");
+        }
+        // canRead()
+        if (testFile.canRead())
+            throw new RuntimeException("File should not be readable");
+        // canWrite()
+        if (testFile.canWrite())
+            throw new RuntimeException("File should not be writable");
+        // exists()
+        if (testFile.exists())
+            throw new RuntimeException("File should not be existed");
+        // isDirectory()
+        if (testFile.isDirectory())
+            throw new RuntimeException("File should not be a directory");
+        // isFile()
+        if (testFile.isFile())
+            throw new RuntimeException("File should not be a file");
+        // isHidden()
+        if (testFile.isHidden())
+            throw new RuntimeException("File should not be hidden");
+        // lastModified()
+        if (testFile.lastModified() != 0L)
+            throw new RuntimeException("File last modified time should be 0L");
+        // length()
+        if (testFile.length() != 0L)
+            throw new RuntimeException("File length should be 0L");
+        // createNewFile()
+        try {
+            exceptionThrown = false;
+            testFile.createNewFile();
+        } catch (IOException ex) {
+            if (ExceptionMsg.equals(ex.getMessage()))
+                exceptionThrown = true;
+        }
+        if (!exceptionThrown) {
+            throw new RuntimeException(
+                    "createNewFile() should throw IOException with"
+                        + " message \"" + ExceptionMsg + "\"");
+        }
+        // delete()
+        if (testFile.delete())
+            throw new RuntimeException("Delete operation should fail");
+        // list()
+        if (testFile.list() != null)
+            throw new RuntimeException("File list() should return null");
+        // list(FilenameFilter)
+        FilenameFilter fnFilter = new FilenameFilter() {
+            @Override
+            public boolean accept(File dir, String name) {
+                return false;
+            }
+        };
+        if (testFile.list(fnFilter) != null) {
+            throw new RuntimeException("File list(FilenameFilter) should"
+                + " return null");
+        }
+        // listFiles()
+        if (testFile.listFiles() != null)
+            throw new RuntimeException("File listFiles() should return null");
+        // listFiles(FilenameFilter)
+        if (testFile.listFiles(fnFilter) != null) {
+            throw new RuntimeException("File listFiles(FilenameFilter)"
+                + " should return null");
+        }
+        // listFiles(FileFilter)
+        FileFilter fFilter = new FileFilter() {
+            @Override
+            public boolean accept(File file) {
+                return false;
+            }
+        };
+        if (testFile.listFiles(fFilter) != null) {
+            throw new RuntimeException("File listFiles(FileFilter)"
+                + " should return null");
+        }
+        // mkdir()
+        if (testFile.mkdir()) {
+            throw new RuntimeException("File should not be able to"
+                + " create directory");
+        }
+        // mkdirs()
+        if (testFile.mkdirs()) {
+            throw new RuntimeException("File should not be able to"
+                + " create directories");
+        }
+        // renameTo(File)
+        if (testFile.renameTo(new File("dest")))
+            throw new RuntimeException("File rename should fail");
+        if (new File("dest").renameTo(testFile))
+            throw new RuntimeException("File rename should fail");
+        try {
+            exceptionThrown = false;
+            testFile.renameTo(null);
+        } catch (NullPointerException ex) {
+            exceptionThrown = true;
+        }
+        if (!exceptionThrown) {
+            throw new RuntimeException("File rename should thrown NPE");
+        }
+        // setLastModified(long)
+        if (testFile.setLastModified(0L)) {
+            throw new RuntimeException("File should fail to set"
+                + " last modified time");
+        }
+        try {
+            exceptionThrown = false;
+            testFile.setLastModified(-1);
+        } catch (IllegalArgumentException ex) {
+            if ("Negative time".equals(ex.getMessage()))
+                exceptionThrown = true;
+        }
+        if (!exceptionThrown) {
+            throw new RuntimeException("File should fail to set"
+                + " last modified time with message \"Negative time\"");
+        }
+        // setReadOnly()
+        if (testFile.setReadOnly())
+            throw new RuntimeException("File should fail to set read-only");
+        // setWritable(boolean writable, boolean ownerOnly)
+        if (testFile.setWritable(true, true))
+            throw new RuntimeException("File should fail to set writable");
+        if (testFile.setWritable(true, false))
+            throw new RuntimeException("File should fail to set writable");
+        if (testFile.setWritable(false, true))
+            throw new RuntimeException("File should fail to set writable");
+        if (testFile.setWritable(false, false))
+            throw new RuntimeException("File should fail to set writable");
+        // setWritable(boolean writable)
+        if (testFile.setWritable(false))
+            throw new RuntimeException("File should fail to set writable");
+        if (testFile.setWritable(true))
+            throw new RuntimeException("File should fail to set writable");
+        // setReadable(boolean readable, boolean ownerOnly)
+        if (testFile.setReadable(true, true))
+            throw new RuntimeException("File should fail to set readable");
+        if (testFile.setReadable(true, false))
+            throw new RuntimeException("File should fail to set readable");
+        if (testFile.setReadable(false, true))
+            throw new RuntimeException("File should fail to set readable");
+        if (testFile.setReadable(false, false))
+            throw new RuntimeException("File should fail to set readable");
+        // setReadable(boolean readable)
+        if (testFile.setReadable(false))
+            throw new RuntimeException("File should fail to set readable");
+        if (testFile.setReadable(true))
+            throw new RuntimeException("File should fail to set readable");
+        // setExecutable(boolean executable, boolean ownerOnly)
+        if (testFile.setExecutable(true, true))
+            throw new RuntimeException("File should fail to set executable");
+        if (testFile.setExecutable(true, false))
+            throw new RuntimeException("File should fail to set executable");
+        if (testFile.setExecutable(false, true))
+            throw new RuntimeException("File should fail to set executable");
+        if (testFile.setExecutable(false, false))
+            throw new RuntimeException("File should fail to set executable");
+        // setExecutable(boolean executable)
+        if (testFile.setExecutable(false))
+            throw new RuntimeException("File should fail to set executable");
+        if (testFile.setExecutable(true))
+            throw new RuntimeException("File should fail to set executable");
+        // canExecute()
+        if (testFile.canExecute())
+            throw new RuntimeException("File should not be executable");
+        // getTotalSpace()
+        if (testFile.getTotalSpace() != 0L)
+            throw new RuntimeException("The total space should be 0L");
+        // getFreeSpace()
+        if (testFile.getFreeSpace() != 0L)
+            throw new RuntimeException("The free space should be 0L");
+        // getUsableSpace()
+        if (testFile.getUsableSpace() != 0L)
+            throw new RuntimeException("The usable space should be 0L");
+        // compareTo(File null)
+        try {
+            exceptionThrown = false;
+            testFile.compareTo(null);
+        } catch (NullPointerException ex) {
+            exceptionThrown = true;
+        }
+        if (!exceptionThrown) {
+            throw new RuntimeException("compareTo(null) should throw NPE");
+        }
+        // toString()
+        if (testFile.toString().indexOf(CHAR_NUL) < 0) {
+            throw new RuntimeException(
+                    "File path should contain Nul character");
+        }
+        // toPath()
+        try {
+            exceptionThrown = false;
+            testFile.toPath();
+        } catch (InvalidPathException ex) {
+            exceptionThrown = true;
+        }
+        if (!exceptionThrown) {
+            throw new RuntimeException("toPath() should throw"
+                + " InvalidPathException");
+        }
+    }
+
+    private static void testSerialization(File testFile) {
+        String path = testFile.getPath();
+        try {
+            // serialize test file
+            ByteArrayOutputStream baos = new ByteArrayOutputStream();
+            ObjectOutputStream oos = new ObjectOutputStream(baos);
+            oos.writeObject(testFile);
+            oos.close();
+            // deserialize test file
+            byte[] bytes = baos.toByteArray();
+            ByteArrayInputStream is = new ByteArrayInputStream(bytes);
+            ObjectInputStream ois = new ObjectInputStream(is);
+            File newFile = (File) ois.readObject();
+            // test
+            String newPath = newFile.getPath();
+            if (!path.equals(newPath)) {
+                throw new RuntimeException(
+                        "Serialization should not change file path");
+            }
+            test(newFile, false);
+        } catch (IOException | ClassNotFoundException ex) {
+            System.err.println("Exception happens in testSerialization");
+            System.err.println(ex.getMessage());
+        }
+    }
+
+    private static void testTempFile() {
+        final String[] names = {"x", "xx", "xxx", "xxxx"};
+        final String shortPrefix = "sp";
+        final String prefix = "prefix";
+        final String suffix = "suffix";
+        File tmpDir = new File("tmpDir");
+
+        for (String name : names) {
+            int length = name.length();
+            for (int i = 0; i <= length; i++) {
+                StringBuilder sbName = new StringBuilder(name);
+                sbName.insert(i, CHAR_NUL);
+                String curName = sbName.toString();
+
+                // test prefix
+                testCreateTempFile(curName, suffix, tmpDir);
+                // test suffix
+                testCreateTempFile(shortPrefix, curName, tmpDir);
+                testCreateTempFile(prefix, curName, tmpDir);
+                // test directory
+                testCreateTempFile(shortPrefix, suffix, new File(curName));
+                testCreateTempFile(prefix, suffix, new File(curName));
+            }
+        }
+    }
+
+    private static void testCreateTempFile(String prefix, String suffix,
+                                           File directory) {
+        // createTempFile(String prefix, String suffix, File directory)
+        boolean exceptionThrown = false;
+        boolean shortPrefix = (prefix.length() < 3);
+        if (shortPrefix) {
+            try {
+                File.createTempFile(prefix, suffix, directory);
+            } catch (IllegalArgumentException ex) {
+                if ("Prefix string too short".equals(ex.getMessage()))
+                    exceptionThrown = true;
+            } catch (IOException ioe) {
+                System.err.println("IOException happens in testCreateTempFile");
+                System.err.println(ioe.getMessage());
+            }
+        } else {
+            try {
+                File.createTempFile(prefix, suffix, directory);
+            } catch (IOException ex) {
+                if (ExceptionMsg.equals(ex.getMessage()))
+                    exceptionThrown = true;
+            }
+        }
+        if (!exceptionThrown) {
+            throw new RuntimeException("createTempFile() should throw"
+                    + (shortPrefix ? " IllegalArgumentException"
+                                   : " IOException"));
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/io/File/createTempFile/SpecialTempFile.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,80 @@
+/*
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8013827 8011950
+ * @summary Check whether File.createTempFile can handle special parameters
+ *          on Windows platforms
+ * @author Dan Xu
+ */
+
+import java.io.File;
+import java.io.IOException;
+
+public class SpecialTempFile {
+
+    private static void test(String name, String[] prefix, String[] suffix) {
+        if (prefix == null || suffix == null
+            || prefix.length != suffix.length)
+        {
+            return;
+        }
+
+        final String exceptionMsg = "Unable to create temporary file";
+        final String errMsg = "IOException is expected";
+
+        for (int i = 0; i < prefix.length; i++) {
+            boolean exceptionThrown = false;
+            File f = null;
+            System.out.println("In test " + name
+                               + ", creating temp file with prefix, "
+                               + prefix[i] + ", suffix, " + suffix[i]);
+            try {
+                f = File.createTempFile(prefix[i], suffix[i]);
+            } catch (IOException e) {
+                if (exceptionMsg.equals(e.getMessage()))
+                    exceptionThrown = true;
+                else
+                    System.out.println("Wrong error message:" + e.getMessage());
+            }
+            if (!exceptionThrown || f != null)
+                throw new RuntimeException(errMsg);
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        if (!System.getProperty("os.name").startsWith("Windows"))
+            return;
+
+        // Test JDK-8013827
+        String[] resvPre = { "LPT1.package.zip", "com7.4.package.zip" };
+        String[] resvSuf = { ".temp", ".temp" };
+        test("ReservedName", resvPre, resvSuf);
+
+        // Test JDK-8011950
+        String[] slashPre = { "///..///", "temp", "///..///" };
+        String[] slashSuf = { ".temp", "///..///..", "///..///.." };
+        test("SlashedName", slashPre, slashSuf);
+    }
+}
--- a/test/java/io/File/isDirectory/Applet.html	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-<!---->
-<applet code=Applet.class width=100 height=100></applet>
--- a/test/java/io/Serializable/accessConstants/AccessConstants.java	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
- * 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 4067964
-@clean AccessConstants
-@build AccessConstants
-@summary Verify that ObjectStreamConstants is public accessible.
-         This test will not compile pre-JDK 1.2.
-*/
-
-import java.io.ObjectStreamConstants;
-
-public class AccessConstants {
-    public static void main(String[] args) {
-        byte[] ref = new byte[4];
-        ref[0] = ObjectStreamConstants.TC_BASE;
-        ref[1] = ObjectStreamConstants.TC_NULL;
-        ref[2] = ObjectStreamConstants.TC_REFERENCE;
-        ref[3] = ObjectStreamConstants.TC_CLASSDESC;
-        int version = ObjectStreamConstants.PROTOCOL_VERSION_1;
-    }
-}
--- a/test/java/io/Serializable/badSubstByReplace/BadSubstByReplace.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/io/Serializable/badSubstByReplace/BadSubstByReplace.java	Fri Jun 21 19:11:42 2013 -0700
@@ -22,7 +22,6 @@
  */
 
 /* @test
- * @clean A B Container ReplacerObjectOutputStream
  * @summary Verify that ClassCastException is thrown when deserializing
  *          an object and one of its object fields is  incompatibly replaced
  *          by either replaceObject/resolveObject.
--- a/test/java/io/Serializable/replaceStringArray/ReplaceStringArray.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/io/Serializable/replaceStringArray/ReplaceStringArray.java	Fri Jun 21 19:11:42 2013 -0700
@@ -22,7 +22,6 @@
  */
 
 /* @test
- * @clean A SubstituteObjectOutputStream SubstituteObjectInputStream
  * @bug 4099013
  * @summary Enable substitution of String and Array by ObjectStreams.
  */
--- a/test/java/io/Serializable/replaceWithNull/ReplaceWithNull.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/io/Serializable/replaceWithNull/ReplaceWithNull.java	Fri Jun 21 19:11:42 2013 -0700
@@ -23,7 +23,6 @@
 
 /* @test
  * @bug 4065313
- * @clean A ReplaceWithNull MyObjectOutputStream
  * @summary Ensure that it is okay to replace an object with null.
  */
 import java.io.*;
--- a/test/java/io/Serializable/verifyDynamicObjHandleTable/VerifyDynamicObjHandleTable.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/io/Serializable/verifyDynamicObjHandleTable/VerifyDynamicObjHandleTable.java	Fri Jun 21 19:11:42 2013 -0700
@@ -22,7 +22,6 @@
  */
 
 /* @test
- * @clean A
  * @bug 4146453
  * @summary Test that regrow of object/handle table of ObjectOutputStream works.
  */
--- a/test/java/lang/Runtime/exec/WinCommand.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/lang/Runtime/exec/WinCommand.java	Fri Jun 21 19:11:42 2013 -0700
@@ -135,24 +135,19 @@
 
         // Win9x systems don't have a cmd.exe
         if (new File(systemDirW, "cmd.exe").exists()) {
-            try {
-                out.println("Running cmd.exe tests...");
-                writeFile("cdcmd.cmd", "@echo off\r\nCD\r\n");
-                writeFile("cdbat.bat", "@echo off\r\nCD\r\n");
-                checkCD("cmd",
-                        "cmd.exe",
-                        systemDirW + "\\cmd.exe",
-                        // Only the ".exe" extension can be omitted
-                        systemDirW + "\\cmd",
-                        systemDirM + "/cmd.exe",
-                        systemDirM + "/cmd",
-                        "/" + systemDirM + "/cmd",
-                        "cdcmd.cmd", "./cdcmd.cmd", ".\\cdcmd.cmd",
-                        "cdbat.bat", "./cdbat.bat", ".\\cdbat.bat");
-            } finally {
-                new File("cdcmd.cmd").delete();
-                new File("cdbat.bat").delete();
-            }
+            out.println("Running cmd.exe tests...");
+            writeFile("cdcmd.cmd", "@echo off\r\nCD\r\n");
+            writeFile("cdbat.bat", "@echo off\r\nCD\r\n");
+            checkCD("cmd",
+                    "cmd.exe",
+                    systemDirW + "\\cmd.exe",
+                    // Only the ".exe" extension can be omitted
+                    systemDirW + "\\cmd",
+                    systemDirM + "/cmd.exe",
+                    systemDirM + "/cmd",
+                    "/" + systemDirM + "/cmd",
+                    "cdcmd.cmd", "./cdcmd.cmd", ".\\cdcmd.cmd",
+                    "cdbat.bat", "./cdbat.bat", ".\\cdbat.bat");
         }
 
         // 16-bit apps like command.com must have a console;
--- a/test/java/lang/SecurityManager/CheckPackageAccess.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/lang/SecurityManager/CheckPackageAccess.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -23,8 +23,8 @@
 
 /*
  * @test
- * @bug 7146431
- * @summary Test that internal JAXP packages cannot be accessed
+ * @bug 7146431 8000450
+ * @summary Test that internal packages cannot be accessed
  */
 
 public class CheckPackageAccess {
@@ -32,6 +32,7 @@
     public static void main(String[] args) throws Exception {
 
         String[] pkgs = new String[] {
+            "com.sun.corba.se.impl.",
             "com.sun.org.apache.xerces.internal.utils.",
             "com.sun.org.apache.xalan.internal.utils." };
         SecurityManager sm = new SecurityManager();
@@ -40,7 +41,11 @@
             System.out.println("Checking package access for " + pkg);
             try {
                 sm.checkPackageAccess(pkg);
-                throw new Exception("Expected SecurityException not thrown");
+                throw new Exception("Expected PackageAccess SecurityException not thrown");
+            } catch (SecurityException se) { }
+            try {
+                sm.checkPackageDefinition(pkg);
+                throw new Exception("Expected PackageDefinition SecurityException not thrown");
             } catch (SecurityException se) { }
         }
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/lang/System/MacJNUEncoding/ExpectedEncoding.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,56 @@
+/*
+ * 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.
+ */
+
+/**
+ * Check that the value of file.encoding and sun.jnu.encoding match the expected
+ * values passed in on the command-line.
+ */
+public class ExpectedEncoding {
+    public static void main(String[] args) {
+        boolean failed = false;
+        if (args.length != 2) {
+            System.out.println("Usage:");
+            System.out.println("$ java ExpectedEncoding <expected file.encoding> <expected sun.jnu.encoding>");
+            System.exit(1);
+        }
+        String expectFileEnc = args[0];
+        String expectSunJnuEnc = args[1];
+
+        String fileEnc = System.getProperty("file.encoding");
+        String jnuEnc = System.getProperty("sun.jnu.encoding");
+
+        if (fileEnc == null || !fileEnc.equals(expectFileEnc)) {
+            System.err.println("Expected file.encoding: " + expectFileEnc);
+            System.err.println("Actual file.encoding: " + fileEnc);
+            failed = true;
+        }
+        if (jnuEnc == null || !jnuEnc.equals(expectSunJnuEnc)) {
+            System.err.println("Expected sun.jnu.encoding: " + expectSunJnuEnc);
+            System.err.println("Actual sun.jnu.encoding: " + jnuEnc);
+            failed = true;
+        }
+        if (failed) {
+            throw new RuntimeException("Test Failed");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/lang/System/MacJNUEncoding/MacJNUEncoding.sh	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,96 @@
+#!/bin/sh
+
+#
+# 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 8003228
+# @summary Test the value of sun.jnu.encoding on Mac
+# @author Brent Christian
+#
+# @run shell MacJNUEncoding.sh
+
+# Only run test on Mac
+OS=`uname -s`
+case "$OS" in
+  Darwin )  ;;
+  * )
+    exit 0
+    ;;
+esac
+
+if [ "${TESTJAVA}" = "" ]
+then
+  echo "TESTJAVA not set.  Test cannot execute.  Failed."
+  exit 1
+fi
+
+if [ "${TESTSRC}" = "" ]
+then
+  echo "TESTSRC not set.  Test cannot execute.  Failed."
+  exit 1
+fi
+
+if [ "${TESTCLASSES}" = "" ]
+then
+  echo "TESTCLASSES not set.  Test cannot execute.  Failed."
+  exit 1
+fi
+
+JAVAC="${TESTJAVA}"/bin/javac
+JAVA="${TESTJAVA}"/bin/java
+
+echo "Building test classes..."
+"$JAVAC" -d "${TESTCLASSES}" "${TESTSRC}"/ExpectedEncoding.java 
+
+echo ""
+echo "Running test for C locale"
+export LANG=C
+export LC_ALL=C
+"${JAVA}" ${TESTVMOPTS} -classpath "${TESTCLASSES}" ExpectedEncoding US-ASCII UTF-8
+result1=$?
+
+echo ""
+echo "Running test for en_US.UTF-8 locale"
+export LANG=en_US.UTF-8
+export LC_ALL=en_US.UTF-8
+"${JAVA}" ${TESTVMOPTS} -classpath "${TESTCLASSES}" ExpectedEncoding UTF-8 UTF-8
+result2=$?
+
+echo ""
+echo "Cleanup"
+rm ${TESTCLASSES}/ExpectedEncoding.class
+
+if [ ${result1} -ne 0 ] ; then
+    echo "Test failed for C locale"
+    echo "  LANG=\"${LANG}\""
+    echo "  LC_ALL=\"${LC_ALL}\""
+    exit ${result1}
+fi
+if [ ${result2} -ne 0 ] ; then
+    echo "Test failed for en_US.UTF-8 locale"
+    echo "  LANG=\"${LANG}\""
+    echo "  LC_ALL=\"${LC_ALL}\""
+    exit ${result2}
+fi
+exit 0
+
--- a/test/java/lang/Thread/ThreadStateTest.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/lang/Thread/ThreadStateTest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -34,21 +34,16 @@
  */
 
 import java.util.concurrent.locks.LockSupport;
-import java.util.concurrent.Semaphore;
+import java.util.concurrent.Phaser;
 
 public class ThreadStateTest {
+    // maximum number of retries when checking for thread state.
+    static final int MAX_RETRY = 500;
+
     private static boolean testFailed = false;
 
-    static class Lock {
-        private String name;
-        Lock(String name) {
-            this.name = name;
-        }
-        public String toString() {
-            return name;
-        }
-    }
-    private static Lock globalLock = new Lock("my lock");
+    // used to achieve waiting states
+    static final Object globalLock = new Object();
 
     public static void main(String[] argv) {
         // Call Thread.getState to force all initialization done
@@ -102,13 +97,27 @@
             System.out.println("Unexpected exception.");
             testFailed = true;
         }
+
         if (testFailed)
             throw new RuntimeException("TEST FAILED.");
         System.out.println("Test passed.");
     }
 
     private static void checkThreadState(Thread t, Thread.State expected) {
-        Thread.State state = t.getState();
+        // wait for the thread to transition to the expected state.
+        // There is a small window between the thread checking the state
+        // and the thread actual entering that state.
+        Thread.State state;
+        int retryCount=0;
+        while ((state = t.getState()) != expected && retryCount < MAX_RETRY) {
+            if (state != Thread.State.RUNNABLE) {
+                throw new RuntimeException("Thread not in expected state yet," +
+                        " but it should at least be RUNNABLE");
+            }
+            goSleep(10);
+            retryCount++;
+        }
+
         System.out.println("Checking thread state " + state);
         if (state == null) {
             throw new RuntimeException(t.getName() + " expected to have " +
@@ -121,13 +130,6 @@
         }
     }
 
-    private static String getLockName(Object lock) {
-        if (lock == null) return null;
-
-        return lock.getClass().getName() + '@' +
-            Integer.toHexString(System.identityHashCode(lock));
-    }
-
     private static void goSleep(long ms) {
         try {
             Thread.sleep(ms);
@@ -139,7 +141,9 @@
     }
 
     static class MyThread extends Thread {
-        private ThreadExecutionSynchronizer thrsync = new ThreadExecutionSynchronizer();
+        // Phaser to sync between the main thread putting
+        // this thread into various states
+        private Phaser phaser =  new Phaser(2);
 
         MyThread(String name) {
             super(name);
@@ -153,12 +157,14 @@
         private final int TIMED_PARKED = 5;
         private final int SLEEPING = 6;
         private final int TERMINATE = 7;
-        private int state = RUNNABLE;
+
+        private volatile int state = RUNNABLE;
 
         private boolean done = false;
         public void run() {
             // Signal main thread to continue.
-            thrsync.signal();
+            phaser.arriveAndAwaitAdvance();
+
             while (!done) {
                 switch (state) {
                     case RUNNABLE: {
@@ -172,7 +178,7 @@
                     }
                     case BLOCKED: {
                         // signal main thread.
-                        thrsync.signal();
+                        phaser.arrive();
                         System.out.println("  myThread is going to block.");
                         synchronized (globalLock) {
                             // finish blocking
@@ -183,7 +189,7 @@
                     case WAITING: {
                         synchronized (globalLock) {
                             // signal main thread.
-                            thrsync.signal();
+                            phaser.arrive();
                             System.out.println("  myThread is going to wait.");
                             try {
                                 globalLock.wait();
@@ -196,7 +202,7 @@
                     case TIMED_WAITING: {
                         synchronized (globalLock) {
                             // signal main thread.
-                            thrsync.signal();
+                            phaser.arrive();
                             System.out.println("  myThread is going to timed wait.");
                             try {
                                 globalLock.wait(10000);
@@ -208,7 +214,7 @@
                     }
                     case PARKED: {
                         // signal main thread.
-                        thrsync.signal();
+                        phaser.arrive();
                         System.out.println("  myThread is going to park.");
                         LockSupport.park();
                         // give a chance for the main thread to block
@@ -217,7 +223,7 @@
                     }
                     case TIMED_PARKED: {
                         // signal main thread.
-                        thrsync.signal();
+                        phaser.arrive();
                         System.out.println("  myThread is going to timed park.");
                         long deadline = System.currentTimeMillis() + 10000*1000;
                         LockSupport.parkUntil(deadline);
@@ -228,20 +234,19 @@
                     }
                     case SLEEPING: {
                         // signal main thread.
-                        thrsync.signal();
+                        phaser.arrive();
                         System.out.println("  myThread is going to sleep.");
                         try {
                             Thread.sleep(1000000);
                         } catch (InterruptedException e) {
                             // finish sleeping
-                            interrupted();
                         }
                         break;
                     }
                     case TERMINATE: {
                         done = true;
                         // signal main thread.
-                        thrsync.signal();
+                        phaser.arrive();
                         break;
                     }
                     default:
@@ -249,69 +254,66 @@
                 }
             }
         }
+
         public void waitUntilStarted() {
             // wait for MyThread.
-            thrsync.waitForSignal();
-            goSleep(10);
+            phaser.arriveAndAwaitAdvance();
         }
 
         public void goBlocked() {
             System.out.println("Waiting myThread to go blocked.");
             setState(BLOCKED);
-            // wait for MyThread to get blocked
-            thrsync.waitForSignal();
-            goSleep(20);
+            // wait for MyThread to get to a point just before being blocked
+            phaser.arriveAndAwaitAdvance();
         }
 
         public void goWaiting() {
             System.out.println("Waiting myThread to go waiting.");
             setState(WAITING);
-            // wait for  MyThread to wait on object.
-            thrsync.waitForSignal();
-            goSleep(20);
+            // wait for MyThread to get to just before wait on object.
+            phaser.arriveAndAwaitAdvance();
         }
+
         public void goTimedWaiting() {
             System.out.println("Waiting myThread to go timed waiting.");
             setState(TIMED_WAITING);
-            // wait for MyThread timed wait call.
-            thrsync.waitForSignal();
-            goSleep(20);
+            // wait for MyThread to get to just before timed wait call.
+            phaser.arriveAndAwaitAdvance();
         }
+
         public void goParked() {
             System.out.println("Waiting myThread to go parked.");
             setState(PARKED);
-            // wait for  MyThread state change to PARKED.
-            thrsync.waitForSignal();
-            goSleep(20);
+            // wait for MyThread to get to just before parked.
+            phaser.arriveAndAwaitAdvance();
         }
+
         public void goTimedParked() {
             System.out.println("Waiting myThread to go timed parked.");
             setState(TIMED_PARKED);
-            // wait for  MyThread.
-            thrsync.waitForSignal();
-            goSleep(20);
+            // wait for MyThread to get to just before timed park.
+            phaser.arriveAndAwaitAdvance();
         }
 
         public void goSleeping() {
             System.out.println("Waiting myThread to go sleeping.");
             setState(SLEEPING);
-            // wait for  MyThread.
-            thrsync.waitForSignal();
-            goSleep(20);
+            // wait for MyThread to get to just before sleeping
+            phaser.arriveAndAwaitAdvance();
         }
+
         public void terminate() {
             System.out.println("Waiting myThread to terminate.");
             setState(TERMINATE);
-            // wait for  MyThread.
-            thrsync.waitForSignal();
-            goSleep(20);
+            // wait for MyThread to get to just before terminate
+            phaser.arriveAndAwaitAdvance();
         }
 
         private void setState(int newState) {
             switch (state) {
                 case BLOCKED:
                     while (state == BLOCKED) {
-                        goSleep(20);
+                        goSleep(10);
                     }
                     state = newState;
                     break;
@@ -337,50 +339,4 @@
             }
         }
     }
-
-
-
-    static class ThreadExecutionSynchronizer {
-
-        private boolean  waiting;
-        private Semaphore semaphore;
-
-        public ThreadExecutionSynchronizer() {
-            semaphore = new Semaphore(1);
-        waiting = false;
-        }
-
-        // Synchronizes two threads execution points.
-        // Basically any thread could get scheduled to run and
-        // it is not possible to know which thread reaches expected
-        // execution point. So whichever thread reaches a execution
-        // point first wait for the second thread. When the second thread
-        // reaches the expected execution point will wake up
-        // the thread which is waiting here.
-        void stopOrGo() {
-        semaphore.acquireUninterruptibly(); // Thread can get blocked.
-        if (!waiting) {
-            waiting = true;
-            // Wait for second thread to enter this method.
-            while(!semaphore.hasQueuedThreads()) {
-                try {
-                    Thread.sleep(20);
-                } catch (InterruptedException xx) {}
-            }
-            semaphore.release();
-        } else {
-            waiting = false;
-            semaphore.release();
-        }
-        }
-
-        // Wrapper function just for code readability.
-        void waitForSignal() {
-        stopOrGo();
-        }
-
-        void signal() {
-        stopOrGo();
-        }
-    }
 }
--- a/test/java/lang/Throwable/SuppressedExceptions.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/lang/Throwable/SuppressedExceptions.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -26,7 +26,7 @@
 
 /*
  * @test
- * @bug     6911258 6962571 6963622 6991528 7005628
+ * @bug     6911258 6962571 6963622 6991528 7005628 8012044
  * @summary Basic tests of suppressed exceptions
  * @author  Joseph D. Darcy
  */
@@ -40,6 +40,7 @@
         serializationTest();
         selfReference();
         noModification();
+        initCausePlumbing();
     }
 
     private static void noSelfSuppression() {
@@ -48,7 +49,9 @@
             throwable.addSuppressed(throwable);
             throw new RuntimeException("IllegalArgumentException for self-suppresion not thrown.");
         } catch (IllegalArgumentException iae) {
-            ; // Expected
+            // Expected to be here
+            if (iae.getCause() != throwable)
+                throw new RuntimeException("Bad cause after self-suppresion.");
         }
     }
 
@@ -208,4 +211,36 @@
             super("The medium.", null, enableSuppression, true);
         }
     }
+
+    private static void initCausePlumbing() {
+        Throwable t1 = new Throwable();
+        Throwable t2 = new Throwable("message", t1);
+        Throwable t3 = new Throwable();
+
+        try {
+            t2.initCause(t3);
+            throw new RuntimeException("Shouldn't reach.");
+        } catch (IllegalStateException ise) {
+            if (ise.getCause() != t2)
+                throw new RuntimeException("Unexpected cause in ISE", ise);
+            Throwable[] suppressed = ise.getSuppressed();
+            if (suppressed.length !=  0)
+                throw new RuntimeException("Bad suppression in ISE", ise);
+        }
+
+        try {
+            t2.initCause(null);
+            throw new RuntimeException("Shouldn't reach.");
+        } catch (IllegalStateException ise) {
+            ; // Expected; don't want an NPE.
+        }
+
+        try {
+            t3.initCause(t3);
+            throw new RuntimeException("Shouldn't reach.");
+        } catch (IllegalArgumentException iae) {
+            if (iae.getCause() != t3)
+                throw new RuntimeException("Unexpected cause in ISE", iae);
+        }
+    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/lang/invoke/7157574/Test7157574.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,111 @@
+/*
+ * 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.
+ *
+ */
+
+/*
+7157574 method handles returned by reflective lookup API sometimes have wrong receiver type
+
+When an inherited non-static field or method is looked up in a class C using Lookup.findVirtual(C...), etc., the JSR 292 API, the first argument of the resulting method handle must be the receiver ('this'), and must be the requested class (or more specific, in the case of findSpecial or a lookup of a protected method).
+
+But currently, if a supertype T defines the looked-up method or field and C inherits it, the returned method handle might have the more specific initial type T.
+
+The relevant javadoc (and 292 spec.) is as follows:
+    * The formal parameter {@code this} stands for the self-reference of type {@code C};
+    * if it is present, it is always the leading argument to the method handle invocation.
+    * (In the case of some {@code protected} members, {@code this} may be
+    * restricted in type to the lookup class; see below.)
+
+Because of this bug, all of the assertions fail in the following example:
+*/
+
+/* @test
+ * @bug 7157574
+ * @summary method handles returned by reflective lookup API sometimes have wrong receiver type
+ *
+ * @run main Test7157574
+ */
+
+import java.lang.invoke.*;
+import static java.lang.invoke.MethodHandles.*;
+import static java.lang.invoke.MethodType.*;
+public class Test7157574 {
+    interface Intf { void ig1(); void ig2(); void ig3(); void ig4(); void m1(); }
+    static abstract class Super implements Intf { public abstract void m2(); public int f2; }
+    static abstract class Sub extends Super { }
+    public static void main(String... av) throws Throwable {
+        MethodHandle m1 = lookup().findVirtual(Sub.class, "m1", methodType(void.class));
+        System.out.println(m1);
+        MethodHandle m2 = lookup().findVirtual(Sub.class, "m2", methodType(void.class));
+        System.out.println(m2);
+        MethodHandle f2 = lookup().findGetter(Sub.class, "f2", int.class);
+        System.out.println(f2);
+        MethodHandle f2s = lookup().findSetter(Sub.class, "f2", int.class);
+        System.out.println(f2s);
+        MethodHandle chc = lookup().findVirtual(Sub.class,  "hashCode", methodType(int.class));
+        System.out.println(chc);
+        MethodHandle ihc = lookup().findVirtual(Intf.class, "hashCode", methodType(int.class));
+        System.out.println(ihc);
+        assertEquals(Sub.class, m1.type().parameterType(0));
+        assertEquals(Sub.class, m2.type().parameterType(0));
+        assertEquals(Sub.class, f2.type().parameterType(0));
+        assertEquals(Sub.class, f2s.type().parameterType(0));
+        assertEquals(Sub.class, chc.type().parameterType(0));
+        assertEquals(Intf.class, ihc.type().parameterType(0));
+        // test the MHs on a concrete version of Sub
+        class C extends Sub {
+            public void m1() { this.f2 = -1; }
+            public void m2() { this.f2 = -2; }
+            // Pack the vtable of Intf with leading junk:
+            private void ig() { throw new RuntimeException(); }
+            public void ig1() { ig(); }
+            public void ig2() { ig(); }
+            public void ig3() { ig(); }
+            public void ig4() { ig(); }
+        }
+        testConcrete(new C(), m1, m2, f2, f2s, chc, ihc);
+    }
+    private static void testConcrete(Sub s,
+                                     MethodHandle m1, MethodHandle m2,
+                                     MethodHandle f2, MethodHandle f2s,
+                                     MethodHandle chc, MethodHandle ihc
+                                     ) throws Throwable {
+        s.f2 = 0;
+        m1.invokeExact(s);
+        assertEquals(-1, s.f2);
+        m2.invokeExact(s);
+        assertEquals(-2, s.f2);
+        s.f2 = 2;
+        assertEquals(2, (int) f2.invokeExact(s));
+        f2s.invokeExact(s, 0);
+        assertEquals(0, s.f2);
+        assertEquals(s.hashCode(), (int) chc.invokeExact(s));
+        assertEquals(s.hashCode(), (int) ihc.invokeExact((Intf)s));
+    }
+
+    private static void assertEquals(Object expect, Object observe) {
+        if (java.util.Objects.equals(expect, observe))  return;
+        String msg = ("expected "+expect+" but observed "+observe);
+        System.out.println("FAILED: "+msg);
+        throw new AssertionError(msg);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/lang/invoke/BigArityTest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,1044 @@
+/*
+ * 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.  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 High arity invocations, up to the maximum of 255 arguments
+ * @compile BigArityTest.java
+ * @run junit/othervm -DBigArityTest.ITERATION_COUNT=1 test.java.lang.invoke.BigArityTest
+ */
+
+package test.java.lang.invoke;
+
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodType;
+import java.lang.invoke.WrongMethodTypeException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Objects;
+import static org.junit.Assert.assertEquals;
+import org.junit.Test;
+
+public class BigArityTest {
+
+    static MethodHandles.Lookup LOOKUP = MethodHandles.lookup();
+
+    static final int MAX_JVM_ARITY = 255;
+    static final int ITERATION_COUNT = getProperty("ITERATION_COUNT", 40000);
+    static final int MIN_ARITY = getProperty("MIN_ARITY", 250);
+    static final int SLOW_ARITY = getProperty("SLOW_ARITY", MAX_JVM_ARITY-3);
+    static final int MAX_ARITY = getProperty("MAX_ARITY", MAX_JVM_ARITY-1);  // always -1 for the MH reciever itself
+    private static int getProperty(String name, int dflt) {
+        return Integer.parseInt(getProperty(name, ""+dflt));
+    }
+    private static String getProperty(String name, String dflt) {
+        String x = System.getProperty(BigArityTest.class.getSimpleName() + "." + name);
+        if (x == null)  x = System.getProperty(BigArityTest.class.getName() + "." + name);
+        return x == null ? dflt : x;
+    }
+
+    static Object hashArguments(Object... args) {
+        return Objects.hash(args);
+    }
+    static final MethodHandle MH_hashArguments_VA;
+    static {
+        try {
+            MH_hashArguments_VA =
+                MethodHandles.lookup().unreflect(
+                    BigArityTest.class.getDeclaredMethod("hashArguments", Object[].class));
+        } catch (ReflectiveOperationException ex) {
+            throw new Error(ex);
+        }
+    }
+    static MethodHandle MH_hashArguments(int arity) {
+        MethodType mt = MethodType.genericMethodType(arity);
+        return MH_hashArguments_VA.asType(mt);
+    }
+    static MethodHandle MH_hashArguments(Class<? extends Object[]> arrayClass, int arity) {
+        if (arrayClass == Object[].class)
+            return MH_hashArguments(arity);
+        ArrayList<Class<?>> ptypes = new ArrayList<>(Collections.<Class<?>>nCopies(arity, arrayClass.getComponentType()));
+        MethodType mt = MethodType.methodType(Object.class, ptypes);
+        return MH_hashArguments_VA.asType(mt);
+    }
+
+    static Object[] testArgs(int arity) {
+        Object args[] = new Object[arity];
+        for (int i = 0; i < arity; i++)
+            args[i] = i * (i + 1) / 2;
+        return args;
+    }
+
+    @Test
+    public void testBoundaryValues() throws Throwable {
+        for (int badArity : new int[]{ -1, MAX_JVM_ARITY+1, MAX_JVM_ARITY }) {
+            try {
+                MethodHandle badmh = MH_hashArguments(badArity);
+                throw new AssertionError("should not be able to build a 255-arity MH: "+badmh);
+            } catch (IllegalArgumentException | WrongMethodTypeException ex) {
+                System.out.println("OK: "+ex);
+            }
+        }
+    }
+
+    // Make sure the basic argument spreading and varargs mechanisms are working.
+    // Exercise arity 3 thoroughly.
+    @Test
+    public void testSpreads() throws Throwable {
+        System.out.println("testing asSpreader on arity=3");
+        Object[] args = testArgs(3);
+        int r0 = Objects.hash(args);
+        MethodHandle mh = MH_hashArguments(3);
+        Object r;
+        r = mh.invokeExact(args[0], args[1], args[2]);
+        assertEquals(r0, r);
+        r = mh.invoke(args[0], args[1], args[2]);
+        assertEquals(r0, r);
+        r = mh.invoke((Comparable) args[0], (Integer) args[1], (Number) args[2]);
+        assertEquals(r0, r);
+        r = mh.invokeWithArguments(args);
+        assertEquals(r0, r);
+        for (Class<?> cls0 : new Class<?>[] {
+            Object[].class, Number[].class, Integer[].class, Comparable[].class
+        }) {
+            @SuppressWarnings("unchecked")
+            Class<? extends Object[]> cls = (Class<? extends Object[]>) cls0;
+            //Class<? extends Object[]> cls = Object[].class.asSubclass(cls0);
+            int nargs = args.length, skip;
+            MethodHandle smh = mh.asSpreader(cls, nargs - (skip = 0));
+            Object[] tail = Arrays.copyOfRange(args, skip, nargs, cls);
+            if (cls == Object[].class)
+                r = smh.invokeExact(tail);
+            else if (cls == Integer[].class)
+                r = smh.invokeExact((Integer[]) tail);
+            else
+                r = smh.invoke(tail);
+            assertEquals(r0, r);
+            smh = mh.asSpreader(cls, nargs - (skip = 1));
+            tail = Arrays.copyOfRange(args, skip, nargs, cls);
+            if (cls == Object[].class)
+                r = smh.invokeExact(args[0], tail);
+            else if (cls == Integer[].class)
+                r = smh.invokeExact(args[0], (Integer[]) tail);
+            else
+                r = smh.invoke(args[0], tail);
+            assertEquals(r0, r);
+            smh = mh.asSpreader(cls, nargs - (skip = 2));
+            tail = Arrays.copyOfRange(args, skip, nargs, cls);
+            if (cls == Object[].class)
+                r = smh.invokeExact(args[0], args[1], tail);
+            else if (cls == Integer[].class)
+                r = smh.invokeExact(args[0], args[1], (Integer[]) tail);
+            else
+                r = smh.invoke(args[0], args[1], tail);
+            assertEquals(r0, r);
+            smh = mh.asSpreader(cls, nargs - (skip = 3));
+            tail = Arrays.copyOfRange(args, skip, nargs, cls);
+            if (cls == Object[].class)
+                r = smh.invokeExact(args[0], args[1], args[2], tail);
+            else if (cls == Integer[].class)
+                r = smh.invokeExact(args[0], args[1], args[2], (Integer[]) tail);
+            else
+                r = smh.invoke(args[0], args[1], args[2], tail);
+            assertEquals(r0, r);
+            // Try null array in addition to zero-length array:
+            tail = null;
+            if (cls == Object[].class)
+                r = smh.invokeExact(args[0], args[1], args[2], tail);
+            else if (cls == Integer[].class)
+                r = smh.invokeExact(args[0], args[1], args[2], (Integer[]) tail);
+            else
+                r = smh.invoke(args[0], args[1], args[2], tail);
+            assertEquals(r0, r);
+        }
+    }
+
+    @Test
+    public void testInvokeWithArguments() throws Throwable {
+        System.out.println("testing invokeWithArguments on all arities");
+        for (int arity = 0; arity < MAX_ARITY; arity++) {
+            Object[] args = testArgs(arity);
+            Object r0 = Objects.hash(args);
+            Object r = MH_hashArguments(arity).invokeWithArguments(args);
+            assertEquals("arity="+arity, r0, r);
+        }
+        // The next one is the most likely to fail:
+        int arity = MAX_ARITY;
+        Object[] args = testArgs(arity);
+        Object r0 = Objects.hash(args);
+        Object r = MH_hashArguments(arity).invokeWithArguments(args);
+        assertEquals("arity=MAX_ARITY", r0, r);
+    }
+
+    static Object[] cat(Object a, Object[] b) {
+        int alen = 1, blen = b.length;
+        Object[] c = new Object[alen + blen];
+        c[0] = a;
+        System.arraycopy(b, 0, c, alen, blen);
+        return c;
+    }
+
+    @Test
+    public void testArities() throws Throwable {
+        System.out.println("testing spreaders and collectors on high arities...");
+            int iterations = ITERATION_COUNT;
+        testArities(Object[].class, MIN_ARITY-10, MIN_ARITY-1, iterations / 1000);
+        testArities(Object[].class, MIN_ARITY, SLOW_ARITY-1, iterations);
+        testArities(Object[].class, SLOW_ARITY, MAX_ARITY, iterations / 1000);
+    }
+
+    @Test
+    public void testAritiesOnTypedArrays() throws Throwable {
+        for (Class<?> cls0 : new Class<?>[] {
+            Number[].class, Integer[].class, Comparable[].class
+        }) {
+            @SuppressWarnings("unchecked")
+            Class<? extends Object[]> cls = (Class<? extends Object[]>) cls0;
+            System.out.println("array class: "+cls.getSimpleName());
+            int iterations = ITERATION_COUNT / 1000;
+            testArities(cls, MIN_ARITY, SLOW_ARITY-1, iterations);
+            testArities(cls, SLOW_ARITY, MAX_ARITY, iterations / 100);
+        }
+    }
+
+    private void testArities(Class<? extends Object[]> cls,
+                             int minArity,
+                             int maxArity,
+                             int iterations) throws Throwable {
+        boolean verbose = (cls == Object[].class);
+        for (int arity = minArity; arity <= maxArity; arity++) {
+            if (verbose)  System.out.println("arity="+arity);
+            MethodHandle mh = MH_hashArguments(cls, arity);
+            MethodHandle mh_VA = mh.asSpreader(cls, arity);
+            assert(mh_VA.type().parameterType(0) == cls);
+            testArities(cls, arity, iterations, verbose, mh, mh_VA);
+            if (cls != Object[].class) {
+                // mh_CA will collect arguments of a particular type and pass them to mh_VA
+                MethodHandle mh_CA = mh_VA.asCollector(cls, arity);
+                MethodHandle mh_VA2 = mh_CA.asSpreader(cls, arity);
+                try {
+                    mh_VA2.invokeWithArguments(new Object[arity]);
+                    throw new AssertionError("should not reach");
+                } catch (ClassCastException | WrongMethodTypeException ex) {
+                }
+                assert(mh_CA.type().equals(mh.type()));
+                assert(mh_VA2.type().equals(mh_VA.type()));
+                testArities(cls, arity, iterations, false, mh_CA, mh_VA2);
+            }
+        }
+    }
+    private void testArities(Class<? extends Object[]> cls,
+                             int arity,
+                             int iterations,
+                             boolean verbose,
+                             MethodHandle mh,
+                             MethodHandle mh_VA
+                             ) throws Throwable {
+        if (iterations < 4)  iterations = 4;
+        final int MAX_MH_ARITY      = MAX_JVM_ARITY - 1;  // mh.invoke(arg*[N])
+        final int MAX_INVOKER_ARITY = MAX_MH_ARITY - 1;   // inv.invoke(mh, arg*[N])
+        Object[] args = testArgs(arity);
+        if (cls != Object[].class)
+            args = Arrays.copyOf(args, arity, cls);
+        Object r0 = Objects.hash(args);
+        Object r;
+        MethodHandle ximh = null;
+        MethodHandle gimh = null;
+        if (arity <= MAX_INVOKER_ARITY) {
+            ximh = MethodHandles.exactInvoker(mh.type());
+            gimh = MethodHandles.invoker(mh.type());
+        } else {
+            try {
+                ximh = MethodHandles.exactInvoker(mh.type());
+                throw new AssertionError("should fail to create ximh of arity "+arity);
+            } catch (IllegalArgumentException ex) {
+                if (verbose)
+                    System.out.println("OK: xmih["+arity+"] => "+ex);
+            }
+            try {
+                gimh = MethodHandles.invoker(mh.type());
+                throw new AssertionError("should fail to create gimh of arity "+arity);
+            } catch (IllegalArgumentException ex) {
+                if (verbose)
+                    System.out.println("OK: gmih["+arity+"] => "+ex);
+            }
+        }
+        Object[] mh_args = cat(mh, args);
+        assert(arity <= MAX_MH_ARITY);
+        for (int i = 0; i < iterations; ++i) {
+            if (cls == Object[].class)
+                r = mh_VA.invokeExact(args);
+            else if (cls == Integer[].class)
+                r = mh_VA.invokeExact((Integer[])args);
+            else
+                r = mh_VA.invoke(args);
+            assertEquals(r0, r);
+            r = mh.invokeWithArguments(args);
+            assertEquals(r0, r);
+            if (ximh != null) {
+                r = ximh.invokeWithArguments(mh_args);
+                assertEquals(r0, r);
+            }
+            if (gimh != null) {
+                r = gimh.invokeWithArguments(mh_args);
+                assertEquals(r0, r);
+            }
+        }
+    }
+
+    static Object hashArguments_252(
+    // <editor-fold defaultstate="collapsed" desc="Object x00, Object x01, Object x02, Object x03, Object x04, ...">
+    Object x00, Object x01, Object x02, Object x03, Object x04, Object x05, Object x06, Object x07,
+    Object x08, Object x09, Object x0A, Object x0B, Object x0C, Object x0D, Object x0E, Object x0F,
+    Object x10, Object x11, Object x12, Object x13, Object x14, Object x15, Object x16, Object x17,
+    Object x18, Object x19, Object x1A, Object x1B, Object x1C, Object x1D, Object x1E, Object x1F,
+    Object x20, Object x21, Object x22, Object x23, Object x24, Object x25, Object x26, Object x27,
+    Object x28, Object x29, Object x2A, Object x2B, Object x2C, Object x2D, Object x2E, Object x2F,
+    Object x30, Object x31, Object x32, Object x33, Object x34, Object x35, Object x36, Object x37,
+    Object x38, Object x39, Object x3A, Object x3B, Object x3C, Object x3D, Object x3E, Object x3F,
+    Object x40, Object x41, Object x42, Object x43, Object x44, Object x45, Object x46, Object x47,
+    Object x48, Object x49, Object x4A, Object x4B, Object x4C, Object x4D, Object x4E, Object x4F,
+    Object x50, Object x51, Object x52, Object x53, Object x54, Object x55, Object x56, Object x57,
+    Object x58, Object x59, Object x5A, Object x5B, Object x5C, Object x5D, Object x5E, Object x5F,
+    Object x60, Object x61, Object x62, Object x63, Object x64, Object x65, Object x66, Object x67,
+    Object x68, Object x69, Object x6A, Object x6B, Object x6C, Object x6D, Object x6E, Object x6F,
+    Object x70, Object x71, Object x72, Object x73, Object x74, Object x75, Object x76, Object x77,
+    Object x78, Object x79, Object x7A, Object x7B, Object x7C, Object x7D, Object x7E, Object x7F,
+    Object x80, Object x81, Object x82, Object x83, Object x84, Object x85, Object x86, Object x87,
+    Object x88, Object x89, Object x8A, Object x8B, Object x8C, Object x8D, Object x8E, Object x8F,
+    Object x90, Object x91, Object x92, Object x93, Object x94, Object x95, Object x96, Object x97,
+    Object x98, Object x99, Object x9A, Object x9B, Object x9C, Object x9D, Object x9E, Object x9F,
+    Object xA0, Object xA1, Object xA2, Object xA3, Object xA4, Object xA5, Object xA6, Object xA7,
+    Object xA8, Object xA9, Object xAA, Object xAB, Object xAC, Object xAD, Object xAE, Object xAF,
+    Object xB0, Object xB1, Object xB2, Object xB3, Object xB4, Object xB5, Object xB6, Object xB7,
+    Object xB8, Object xB9, Object xBA, Object xBB, Object xBC, Object xBD, Object xBE, Object xBF,
+    Object xC0, Object xC1, Object xC2, Object xC3, Object xC4, Object xC5, Object xC6, Object xC7,
+    Object xC8, Object xC9, Object xCA, Object xCB, Object xCC, Object xCD, Object xCE, Object xCF,
+    Object xD0, Object xD1, Object xD2, Object xD3, Object xD4, Object xD5, Object xD6, Object xD7,
+    Object xD8, Object xD9, Object xDA, Object xDB, Object xDC, Object xDD, Object xDE, Object xDF,
+    Object xE0, Object xE1, Object xE2, Object xE3, Object xE4, Object xE5, Object xE6, Object xE7,
+    Object xE8, Object xE9, Object xEA, Object xEB, Object xEC, Object xED, Object xEE, Object xEF,
+    Object xF0, Object xF1, Object xF2, Object xF3, Object xF4, Object xF5, Object xF6, Object xF7,
+    // </editor-fold>
+    Object xF8, Object xF9, Object xFA, Object xFB) {
+        return Objects.hash(
+    // <editor-fold defaultstate="collapsed" desc="x00, x01, x02, x03, x04, ...">
+    x00, x01, x02, x03, x04, x05, x06, x07, x08, x09, x0A, x0B, x0C, x0D, x0E, x0F,
+    x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x1A, x1B, x1C, x1D, x1E, x1F,
+    x20, x21, x22, x23, x24, x25, x26, x27, x28, x29, x2A, x2B, x2C, x2D, x2E, x2F,
+    x30, x31, x32, x33, x34, x35, x36, x37, x38, x39, x3A, x3B, x3C, x3D, x3E, x3F,
+    x40, x41, x42, x43, x44, x45, x46, x47, x48, x49, x4A, x4B, x4C, x4D, x4E, x4F,
+    x50, x51, x52, x53, x54, x55, x56, x57, x58, x59, x5A, x5B, x5C, x5D, x5E, x5F,
+    x60, x61, x62, x63, x64, x65, x66, x67, x68, x69, x6A, x6B, x6C, x6D, x6E, x6F,
+    x70, x71, x72, x73, x74, x75, x76, x77, x78, x79, x7A, x7B, x7C, x7D, x7E, x7F,
+    x80, x81, x82, x83, x84, x85, x86, x87, x88, x89, x8A, x8B, x8C, x8D, x8E, x8F,
+    x90, x91, x92, x93, x94, x95, x96, x97, x98, x99, x9A, x9B, x9C, x9D, x9E, x9F,
+    xA0, xA1, xA2, xA3, xA4, xA5, xA6, xA7, xA8, xA9, xAA, xAB, xAC, xAD, xAE, xAF,
+    xB0, xB1, xB2, xB3, xB4, xB5, xB6, xB7, xB8, xB9, xBA, xBB, xBC, xBD, xBE, xBF,
+    xC0, xC1, xC2, xC3, xC4, xC5, xC6, xC7, xC8, xC9, xCA, xCB, xCC, xCD, xCE, xCF,
+    xD0, xD1, xD2, xD3, xD4, xD5, xD6, xD7, xD8, xD9, xDA, xDB, xDC, xDD, xDE, xDF,
+    xE0, xE1, xE2, xE3, xE4, xE5, xE6, xE7, xE8, xE9, xEA, xEB, xEC, xED, xEE, xEF,
+    xF0, xF1, xF2, xF3, xF4, xF5, xF6, xF7,
+    // </editor-fold>
+    xF8, xF9, xFA, xFB);
+    }
+
+    @Test
+    public void test252() throws Throwable {
+        final int ARITY = 252;
+        System.out.println("test"+ARITY);
+        Object[] a = testArgs(ARITY);
+        Object r0 = hashArguments(a);
+        Object r;
+        r = hashArguments_252(
+    // <editor-fold defaultstate="collapsed" desc="a[0x00], a[0x01], a[0x02], a[0x03], a[0x04], ...">
+    a[0x00], a[0x01], a[0x02], a[0x03], a[0x04], a[0x05], a[0x06], a[0x07], a[0x08], a[0x09], a[0x0A], a[0x0B], a[0x0C], a[0x0D], a[0x0E], a[0x0F],
+    a[0x10], a[0x11], a[0x12], a[0x13], a[0x14], a[0x15], a[0x16], a[0x17], a[0x18], a[0x19], a[0x1A], a[0x1B], a[0x1C], a[0x1D], a[0x1E], a[0x1F],
+    a[0x20], a[0x21], a[0x22], a[0x23], a[0x24], a[0x25], a[0x26], a[0x27], a[0x28], a[0x29], a[0x2A], a[0x2B], a[0x2C], a[0x2D], a[0x2E], a[0x2F],
+    a[0x30], a[0x31], a[0x32], a[0x33], a[0x34], a[0x35], a[0x36], a[0x37], a[0x38], a[0x39], a[0x3A], a[0x3B], a[0x3C], a[0x3D], a[0x3E], a[0x3F],
+    a[0x40], a[0x41], a[0x42], a[0x43], a[0x44], a[0x45], a[0x46], a[0x47], a[0x48], a[0x49], a[0x4A], a[0x4B], a[0x4C], a[0x4D], a[0x4E], a[0x4F],
+    a[0x50], a[0x51], a[0x52], a[0x53], a[0x54], a[0x55], a[0x56], a[0x57], a[0x58], a[0x59], a[0x5A], a[0x5B], a[0x5C], a[0x5D], a[0x5E], a[0x5F],
+    a[0x60], a[0x61], a[0x62], a[0x63], a[0x64], a[0x65], a[0x66], a[0x67], a[0x68], a[0x69], a[0x6A], a[0x6B], a[0x6C], a[0x6D], a[0x6E], a[0x6F],
+    a[0x70], a[0x71], a[0x72], a[0x73], a[0x74], a[0x75], a[0x76], a[0x77], a[0x78], a[0x79], a[0x7A], a[0x7B], a[0x7C], a[0x7D], a[0x7E], a[0x7F],
+    a[0x80], a[0x81], a[0x82], a[0x83], a[0x84], a[0x85], a[0x86], a[0x87], a[0x88], a[0x89], a[0x8A], a[0x8B], a[0x8C], a[0x8D], a[0x8E], a[0x8F],
+    a[0x90], a[0x91], a[0x92], a[0x93], a[0x94], a[0x95], a[0x96], a[0x97], a[0x98], a[0x99], a[0x9A], a[0x9B], a[0x9C], a[0x9D], a[0x9E], a[0x9F],
+    a[0xA0], a[0xA1], a[0xA2], a[0xA3], a[0xA4], a[0xA5], a[0xA6], a[0xA7], a[0xA8], a[0xA9], a[0xAA], a[0xAB], a[0xAC], a[0xAD], a[0xAE], a[0xAF],
+    a[0xB0], a[0xB1], a[0xB2], a[0xB3], a[0xB4], a[0xB5], a[0xB6], a[0xB7], a[0xB8], a[0xB9], a[0xBA], a[0xBB], a[0xBC], a[0xBD], a[0xBE], a[0xBF],
+    a[0xC0], a[0xC1], a[0xC2], a[0xC3], a[0xC4], a[0xC5], a[0xC6], a[0xC7], a[0xC8], a[0xC9], a[0xCA], a[0xCB], a[0xCC], a[0xCD], a[0xCE], a[0xCF],
+    a[0xD0], a[0xD1], a[0xD2], a[0xD3], a[0xD4], a[0xD5], a[0xD6], a[0xD7], a[0xD8], a[0xD9], a[0xDA], a[0xDB], a[0xDC], a[0xDD], a[0xDE], a[0xDF],
+    a[0xE0], a[0xE1], a[0xE2], a[0xE3], a[0xE4], a[0xE5], a[0xE6], a[0xE7], a[0xE8], a[0xE9], a[0xEA], a[0xEB], a[0xEC], a[0xED], a[0xEE], a[0xEF],
+    a[0xF0], a[0xF1], a[0xF2], a[0xF3], a[0xF4], a[0xF5], a[0xF6], a[0xF7],
+    // </editor-fold>
+    a[0xF8], a[0xF9], a[0xFA], a[0xFB]);
+        assertEquals(r0, r);
+        MethodType mt = MethodType.genericMethodType(ARITY);
+        MethodHandle mh = MethodHandles.lookup().findStatic(BigArityTest.class, "hashArguments_"+ARITY, mt);
+        r = mh.invokeExact(
+    // <editor-fold defaultstate="collapsed" desc="a[0x00], a[0x01], a[0x02], a[0x03], a[0x04], ...">
+    a[0x00], a[0x01], a[0x02], a[0x03], a[0x04], a[0x05], a[0x06], a[0x07], a[0x08], a[0x09], a[0x0A], a[0x0B], a[0x0C], a[0x0D], a[0x0E], a[0x0F],
+    a[0x10], a[0x11], a[0x12], a[0x13], a[0x14], a[0x15], a[0x16], a[0x17], a[0x18], a[0x19], a[0x1A], a[0x1B], a[0x1C], a[0x1D], a[0x1E], a[0x1F],
+    a[0x20], a[0x21], a[0x22], a[0x23], a[0x24], a[0x25], a[0x26], a[0x27], a[0x28], a[0x29], a[0x2A], a[0x2B], a[0x2C], a[0x2D], a[0x2E], a[0x2F],
+    a[0x30], a[0x31], a[0x32], a[0x33], a[0x34], a[0x35], a[0x36], a[0x37], a[0x38], a[0x39], a[0x3A], a[0x3B], a[0x3C], a[0x3D], a[0x3E], a[0x3F],
+    a[0x40], a[0x41], a[0x42], a[0x43], a[0x44], a[0x45], a[0x46], a[0x47], a[0x48], a[0x49], a[0x4A], a[0x4B], a[0x4C], a[0x4D], a[0x4E], a[0x4F],
+    a[0x50], a[0x51], a[0x52], a[0x53], a[0x54], a[0x55], a[0x56], a[0x57], a[0x58], a[0x59], a[0x5A], a[0x5B], a[0x5C], a[0x5D], a[0x5E], a[0x5F],
+    a[0x60], a[0x61], a[0x62], a[0x63], a[0x64], a[0x65], a[0x66], a[0x67], a[0x68], a[0x69], a[0x6A], a[0x6B], a[0x6C], a[0x6D], a[0x6E], a[0x6F],
+    a[0x70], a[0x71], a[0x72], a[0x73], a[0x74], a[0x75], a[0x76], a[0x77], a[0x78], a[0x79], a[0x7A], a[0x7B], a[0x7C], a[0x7D], a[0x7E], a[0x7F],
+    a[0x80], a[0x81], a[0x82], a[0x83], a[0x84], a[0x85], a[0x86], a[0x87], a[0x88], a[0x89], a[0x8A], a[0x8B], a[0x8C], a[0x8D], a[0x8E], a[0x8F],
+    a[0x90], a[0x91], a[0x92], a[0x93], a[0x94], a[0x95], a[0x96], a[0x97], a[0x98], a[0x99], a[0x9A], a[0x9B], a[0x9C], a[0x9D], a[0x9E], a[0x9F],
+    a[0xA0], a[0xA1], a[0xA2], a[0xA3], a[0xA4], a[0xA5], a[0xA6], a[0xA7], a[0xA8], a[0xA9], a[0xAA], a[0xAB], a[0xAC], a[0xAD], a[0xAE], a[0xAF],
+    a[0xB0], a[0xB1], a[0xB2], a[0xB3], a[0xB4], a[0xB5], a[0xB6], a[0xB7], a[0xB8], a[0xB9], a[0xBA], a[0xBB], a[0xBC], a[0xBD], a[0xBE], a[0xBF],
+    a[0xC0], a[0xC1], a[0xC2], a[0xC3], a[0xC4], a[0xC5], a[0xC6], a[0xC7], a[0xC8], a[0xC9], a[0xCA], a[0xCB], a[0xCC], a[0xCD], a[0xCE], a[0xCF],
+    a[0xD0], a[0xD1], a[0xD2], a[0xD3], a[0xD4], a[0xD5], a[0xD6], a[0xD7], a[0xD8], a[0xD9], a[0xDA], a[0xDB], a[0xDC], a[0xDD], a[0xDE], a[0xDF],
+    a[0xE0], a[0xE1], a[0xE2], a[0xE3], a[0xE4], a[0xE5], a[0xE6], a[0xE7], a[0xE8], a[0xE9], a[0xEA], a[0xEB], a[0xEC], a[0xED], a[0xEE], a[0xEF],
+    a[0xF0], a[0xF1], a[0xF2], a[0xF3], a[0xF4], a[0xF5], a[0xF6], a[0xF7],
+    // </editor-fold>
+    a[0xF8], a[0xF9], a[0xFA], a[0xFB]);
+        assertEquals(r0, r);
+        r = mh.invokeWithArguments(a);
+        assertEquals(r0, r);
+        MethodHandle ximh = MethodHandles.exactInvoker(mh.type());
+        r = ximh.invokeExact(mh,
+    // <editor-fold defaultstate="collapsed" desc="a[0x00], a[0x01], a[0x02], a[0x03], a[0x04], ...">
+    a[0x00], a[0x01], a[0x02], a[0x03], a[0x04], a[0x05], a[0x06], a[0x07], a[0x08], a[0x09], a[0x0A], a[0x0B], a[0x0C], a[0x0D], a[0x0E], a[0x0F],
+    a[0x10], a[0x11], a[0x12], a[0x13], a[0x14], a[0x15], a[0x16], a[0x17], a[0x18], a[0x19], a[0x1A], a[0x1B], a[0x1C], a[0x1D], a[0x1E], a[0x1F],
+    a[0x20], a[0x21], a[0x22], a[0x23], a[0x24], a[0x25], a[0x26], a[0x27], a[0x28], a[0x29], a[0x2A], a[0x2B], a[0x2C], a[0x2D], a[0x2E], a[0x2F],
+    a[0x30], a[0x31], a[0x32], a[0x33], a[0x34], a[0x35], a[0x36], a[0x37], a[0x38], a[0x39], a[0x3A], a[0x3B], a[0x3C], a[0x3D], a[0x3E], a[0x3F],
+    a[0x40], a[0x41], a[0x42], a[0x43], a[0x44], a[0x45], a[0x46], a[0x47], a[0x48], a[0x49], a[0x4A], a[0x4B], a[0x4C], a[0x4D], a[0x4E], a[0x4F],
+    a[0x50], a[0x51], a[0x52], a[0x53], a[0x54], a[0x55], a[0x56], a[0x57], a[0x58], a[0x59], a[0x5A], a[0x5B], a[0x5C], a[0x5D], a[0x5E], a[0x5F],
+    a[0x60], a[0x61], a[0x62], a[0x63], a[0x64], a[0x65], a[0x66], a[0x67], a[0x68], a[0x69], a[0x6A], a[0x6B], a[0x6C], a[0x6D], a[0x6E], a[0x6F],
+    a[0x70], a[0x71], a[0x72], a[0x73], a[0x74], a[0x75], a[0x76], a[0x77], a[0x78], a[0x79], a[0x7A], a[0x7B], a[0x7C], a[0x7D], a[0x7E], a[0x7F],
+    a[0x80], a[0x81], a[0x82], a[0x83], a[0x84], a[0x85], a[0x86], a[0x87], a[0x88], a[0x89], a[0x8A], a[0x8B], a[0x8C], a[0x8D], a[0x8E], a[0x8F],
+    a[0x90], a[0x91], a[0x92], a[0x93], a[0x94], a[0x95], a[0x96], a[0x97], a[0x98], a[0x99], a[0x9A], a[0x9B], a[0x9C], a[0x9D], a[0x9E], a[0x9F],
+    a[0xA0], a[0xA1], a[0xA2], a[0xA3], a[0xA4], a[0xA5], a[0xA6], a[0xA7], a[0xA8], a[0xA9], a[0xAA], a[0xAB], a[0xAC], a[0xAD], a[0xAE], a[0xAF],
+    a[0xB0], a[0xB1], a[0xB2], a[0xB3], a[0xB4], a[0xB5], a[0xB6], a[0xB7], a[0xB8], a[0xB9], a[0xBA], a[0xBB], a[0xBC], a[0xBD], a[0xBE], a[0xBF],
+    a[0xC0], a[0xC1], a[0xC2], a[0xC3], a[0xC4], a[0xC5], a[0xC6], a[0xC7], a[0xC8], a[0xC9], a[0xCA], a[0xCB], a[0xCC], a[0xCD], a[0xCE], a[0xCF],
+    a[0xD0], a[0xD1], a[0xD2], a[0xD3], a[0xD4], a[0xD5], a[0xD6], a[0xD7], a[0xD8], a[0xD9], a[0xDA], a[0xDB], a[0xDC], a[0xDD], a[0xDE], a[0xDF],
+    a[0xE0], a[0xE1], a[0xE2], a[0xE3], a[0xE4], a[0xE5], a[0xE6], a[0xE7], a[0xE8], a[0xE9], a[0xEA], a[0xEB], a[0xEC], a[0xED], a[0xEE], a[0xEF],
+    a[0xF0], a[0xF1], a[0xF2], a[0xF3], a[0xF4], a[0xF5], a[0xF6], a[0xF7],
+    // </editor-fold>
+    a[0xF8], a[0xF9], a[0xFA], a[0xFB]);
+        assertEquals(r0, r);
+        r = ximh.invokeWithArguments(cat(mh,a));
+        assertEquals(r0, r);
+        MethodHandle gimh = MethodHandles.invoker(mh.type());
+        r = gimh.invoke(mh,
+    // <editor-fold defaultstate="collapsed" desc="(Number) a[0x00], a[0x01], a[0x02], a[0x03], a[0x04], ...">
+    (Number)
+    a[0x00], a[0x01], a[0x02], a[0x03], a[0x04], a[0x05], a[0x06], a[0x07], a[0x08], a[0x09], a[0x0A], a[0x0B], a[0x0C], a[0x0D], a[0x0E], a[0x0F],
+    a[0x10], a[0x11], a[0x12], a[0x13], a[0x14], a[0x15], a[0x16], a[0x17], a[0x18], a[0x19], a[0x1A], a[0x1B], a[0x1C], a[0x1D], a[0x1E], a[0x1F],
+    a[0x20], a[0x21], a[0x22], a[0x23], a[0x24], a[0x25], a[0x26], a[0x27], a[0x28], a[0x29], a[0x2A], a[0x2B], a[0x2C], a[0x2D], a[0x2E], a[0x2F],
+    a[0x30], a[0x31], a[0x32], a[0x33], a[0x34], a[0x35], a[0x36], a[0x37], a[0x38], a[0x39], a[0x3A], a[0x3B], a[0x3C], a[0x3D], a[0x3E], a[0x3F],
+    a[0x40], a[0x41], a[0x42], a[0x43], a[0x44], a[0x45], a[0x46], a[0x47], a[0x48], a[0x49], a[0x4A], a[0x4B], a[0x4C], a[0x4D], a[0x4E], a[0x4F],
+    a[0x50], a[0x51], a[0x52], a[0x53], a[0x54], a[0x55], a[0x56], a[0x57], a[0x58], a[0x59], a[0x5A], a[0x5B], a[0x5C], a[0x5D], a[0x5E], a[0x5F],
+    a[0x60], a[0x61], a[0x62], a[0x63], a[0x64], a[0x65], a[0x66], a[0x67], a[0x68], a[0x69], a[0x6A], a[0x6B], a[0x6C], a[0x6D], a[0x6E], a[0x6F],
+    a[0x70], a[0x71], a[0x72], a[0x73], a[0x74], a[0x75], a[0x76], a[0x77], a[0x78], a[0x79], a[0x7A], a[0x7B], a[0x7C], a[0x7D], a[0x7E], a[0x7F],
+    a[0x80], a[0x81], a[0x82], a[0x83], a[0x84], a[0x85], a[0x86], a[0x87], a[0x88], a[0x89], a[0x8A], a[0x8B], a[0x8C], a[0x8D], a[0x8E], a[0x8F],
+    a[0x90], a[0x91], a[0x92], a[0x93], a[0x94], a[0x95], a[0x96], a[0x97], a[0x98], a[0x99], a[0x9A], a[0x9B], a[0x9C], a[0x9D], a[0x9E], a[0x9F],
+    a[0xA0], a[0xA1], a[0xA2], a[0xA3], a[0xA4], a[0xA5], a[0xA6], a[0xA7], a[0xA8], a[0xA9], a[0xAA], a[0xAB], a[0xAC], a[0xAD], a[0xAE], a[0xAF],
+    a[0xB0], a[0xB1], a[0xB2], a[0xB3], a[0xB4], a[0xB5], a[0xB6], a[0xB7], a[0xB8], a[0xB9], a[0xBA], a[0xBB], a[0xBC], a[0xBD], a[0xBE], a[0xBF],
+    a[0xC0], a[0xC1], a[0xC2], a[0xC3], a[0xC4], a[0xC5], a[0xC6], a[0xC7], a[0xC8], a[0xC9], a[0xCA], a[0xCB], a[0xCC], a[0xCD], a[0xCE], a[0xCF],
+    a[0xD0], a[0xD1], a[0xD2], a[0xD3], a[0xD4], a[0xD5], a[0xD6], a[0xD7], a[0xD8], a[0xD9], a[0xDA], a[0xDB], a[0xDC], a[0xDD], a[0xDE], a[0xDF],
+    a[0xE0], a[0xE1], a[0xE2], a[0xE3], a[0xE4], a[0xE5], a[0xE6], a[0xE7], a[0xE8], a[0xE9], a[0xEA], a[0xEB], a[0xEC], a[0xED], a[0xEE], a[0xEF],
+    a[0xF0], a[0xF1], a[0xF2], a[0xF3], a[0xF4], a[0xF5], a[0xF6], a[0xF7],
+    // </editor-fold>
+    a[0xF8], a[0xF9], a[0xFA], a[0xFB]);
+        assertEquals(r0, r);
+        r = gimh.invokeWithArguments(cat(mh,a));
+        assertEquals(r0, r);
+        mh = mh.asType(mh.type().changeParameterType(0x10, Integer.class));
+        //System.out.println("type="+mh.type().toString().replaceAll("Object", ""));
+        r = mh.invokeExact(
+    // <editor-fold defaultstate="collapsed" desc="a[0x00], a[0x01], a[0x02], a[0x03], a[0x04], ... (Integer) a[0x10], ...">
+    a[0x00], a[0x01], a[0x02], a[0x03], a[0x04], a[0x05], a[0x06], a[0x07], a[0x08], a[0x09], a[0x0A], a[0x0B], a[0x0C], a[0x0D], a[0x0E], a[0x0F],
+    (Integer)
+    a[0x10], a[0x11], a[0x12], a[0x13], a[0x14], a[0x15], a[0x16], a[0x17], a[0x18], a[0x19], a[0x1A], a[0x1B], a[0x1C], a[0x1D], a[0x1E], a[0x1F],
+    a[0x20], a[0x21], a[0x22], a[0x23], a[0x24], a[0x25], a[0x26], a[0x27], a[0x28], a[0x29], a[0x2A], a[0x2B], a[0x2C], a[0x2D], a[0x2E], a[0x2F],
+    a[0x30], a[0x31], a[0x32], a[0x33], a[0x34], a[0x35], a[0x36], a[0x37], a[0x38], a[0x39], a[0x3A], a[0x3B], a[0x3C], a[0x3D], a[0x3E], a[0x3F],
+    a[0x40], a[0x41], a[0x42], a[0x43], a[0x44], a[0x45], a[0x46], a[0x47], a[0x48], a[0x49], a[0x4A], a[0x4B], a[0x4C], a[0x4D], a[0x4E], a[0x4F],
+    a[0x50], a[0x51], a[0x52], a[0x53], a[0x54], a[0x55], a[0x56], a[0x57], a[0x58], a[0x59], a[0x5A], a[0x5B], a[0x5C], a[0x5D], a[0x5E], a[0x5F],
+    a[0x60], a[0x61], a[0x62], a[0x63], a[0x64], a[0x65], a[0x66], a[0x67], a[0x68], a[0x69], a[0x6A], a[0x6B], a[0x6C], a[0x6D], a[0x6E], a[0x6F],
+    a[0x70], a[0x71], a[0x72], a[0x73], a[0x74], a[0x75], a[0x76], a[0x77], a[0x78], a[0x79], a[0x7A], a[0x7B], a[0x7C], a[0x7D], a[0x7E], a[0x7F],
+    a[0x80], a[0x81], a[0x82], a[0x83], a[0x84], a[0x85], a[0x86], a[0x87], a[0x88], a[0x89], a[0x8A], a[0x8B], a[0x8C], a[0x8D], a[0x8E], a[0x8F],
+    a[0x90], a[0x91], a[0x92], a[0x93], a[0x94], a[0x95], a[0x96], a[0x97], a[0x98], a[0x99], a[0x9A], a[0x9B], a[0x9C], a[0x9D], a[0x9E], a[0x9F],
+    a[0xA0], a[0xA1], a[0xA2], a[0xA3], a[0xA4], a[0xA5], a[0xA6], a[0xA7], a[0xA8], a[0xA9], a[0xAA], a[0xAB], a[0xAC], a[0xAD], a[0xAE], a[0xAF],
+    a[0xB0], a[0xB1], a[0xB2], a[0xB3], a[0xB4], a[0xB5], a[0xB6], a[0xB7], a[0xB8], a[0xB9], a[0xBA], a[0xBB], a[0xBC], a[0xBD], a[0xBE], a[0xBF],
+    a[0xC0], a[0xC1], a[0xC2], a[0xC3], a[0xC4], a[0xC5], a[0xC6], a[0xC7], a[0xC8], a[0xC9], a[0xCA], a[0xCB], a[0xCC], a[0xCD], a[0xCE], a[0xCF],
+    a[0xD0], a[0xD1], a[0xD2], a[0xD3], a[0xD4], a[0xD5], a[0xD6], a[0xD7], a[0xD8], a[0xD9], a[0xDA], a[0xDB], a[0xDC], a[0xDD], a[0xDE], a[0xDF],
+    a[0xE0], a[0xE1], a[0xE2], a[0xE3], a[0xE4], a[0xE5], a[0xE6], a[0xE7], a[0xE8], a[0xE9], a[0xEA], a[0xEB], a[0xEC], a[0xED], a[0xEE], a[0xEF],
+    a[0xF0], a[0xF1], a[0xF2], a[0xF3], a[0xF4], a[0xF5], a[0xF6], a[0xF7],
+    // </editor-fold>
+    a[0xF8], a[0xF9], a[0xFA], a[0xFB]);
+        assertEquals(r0, r);
+        r = mh.invoke(
+    // <editor-fold defaultstate="collapsed" desc="(Comparable) a[0x00], a[0x01], a[0x02], a[0x03], a[0x04], ...">
+    (Comparable<?>)
+    a[0x00], a[0x01], a[0x02], a[0x03], a[0x04], a[0x05], a[0x06], a[0x07], a[0x08], a[0x09], a[0x0A], a[0x0B], a[0x0C], a[0x0D], a[0x0E], a[0x0F],
+    a[0x10], a[0x11], a[0x12], a[0x13], a[0x14], a[0x15], a[0x16], a[0x17], a[0x18], a[0x19], a[0x1A], a[0x1B], a[0x1C], a[0x1D], a[0x1E], a[0x1F],
+    a[0x20], a[0x21], a[0x22], a[0x23], a[0x24], a[0x25], a[0x26], a[0x27], a[0x28], a[0x29], a[0x2A], a[0x2B], a[0x2C], a[0x2D], a[0x2E], a[0x2F],
+    a[0x30], a[0x31], a[0x32], a[0x33], a[0x34], a[0x35], a[0x36], a[0x37], a[0x38], a[0x39], a[0x3A], a[0x3B], a[0x3C], a[0x3D], a[0x3E], a[0x3F],
+    a[0x40], a[0x41], a[0x42], a[0x43], a[0x44], a[0x45], a[0x46], a[0x47], a[0x48], a[0x49], a[0x4A], a[0x4B], a[0x4C], a[0x4D], a[0x4E], a[0x4F],
+    a[0x50], a[0x51], a[0x52], a[0x53], a[0x54], a[0x55], a[0x56], a[0x57], a[0x58], a[0x59], a[0x5A], a[0x5B], a[0x5C], a[0x5D], a[0x5E], a[0x5F],
+    a[0x60], a[0x61], a[0x62], a[0x63], a[0x64], a[0x65], a[0x66], a[0x67], a[0x68], a[0x69], a[0x6A], a[0x6B], a[0x6C], a[0x6D], a[0x6E], a[0x6F],
+    a[0x70], a[0x71], a[0x72], a[0x73], a[0x74], a[0x75], a[0x76], a[0x77], a[0x78], a[0x79], a[0x7A], a[0x7B], a[0x7C], a[0x7D], a[0x7E], a[0x7F],
+    a[0x80], a[0x81], a[0x82], a[0x83], a[0x84], a[0x85], a[0x86], a[0x87], a[0x88], a[0x89], a[0x8A], a[0x8B], a[0x8C], a[0x8D], a[0x8E], a[0x8F],
+    a[0x90], a[0x91], a[0x92], a[0x93], a[0x94], a[0x95], a[0x96], a[0x97], a[0x98], a[0x99], a[0x9A], a[0x9B], a[0x9C], a[0x9D], a[0x9E], a[0x9F],
+    a[0xA0], a[0xA1], a[0xA2], a[0xA3], a[0xA4], a[0xA5], a[0xA6], a[0xA7], a[0xA8], a[0xA9], a[0xAA], a[0xAB], a[0xAC], a[0xAD], a[0xAE], a[0xAF],
+    a[0xB0], a[0xB1], a[0xB2], a[0xB3], a[0xB4], a[0xB5], a[0xB6], a[0xB7], a[0xB8], a[0xB9], a[0xBA], a[0xBB], a[0xBC], a[0xBD], a[0xBE], a[0xBF],
+    a[0xC0], a[0xC1], a[0xC2], a[0xC3], a[0xC4], a[0xC5], a[0xC6], a[0xC7], a[0xC8], a[0xC9], a[0xCA], a[0xCB], a[0xCC], a[0xCD], a[0xCE], a[0xCF],
+    a[0xD0], a[0xD1], a[0xD2], a[0xD3], a[0xD4], a[0xD5], a[0xD6], a[0xD7], a[0xD8], a[0xD9], a[0xDA], a[0xDB], a[0xDC], a[0xDD], a[0xDE], a[0xDF],
+    a[0xE0], a[0xE1], a[0xE2], a[0xE3], a[0xE4], a[0xE5], a[0xE6], a[0xE7], a[0xE8], a[0xE9], a[0xEA], a[0xEB], a[0xEC], a[0xED], a[0xEE], a[0xEF],
+    a[0xF0], a[0xF1], a[0xF2], a[0xF3], a[0xF4], a[0xF5], a[0xF6], a[0xF7],
+    // </editor-fold>
+    a[0xF8], a[0xF9], a[0xFA], a[0xFB]);
+        assertEquals(r0, r);
+    }
+
+    static Object hashArguments_253(
+    // <editor-fold defaultstate="collapsed" desc="Object x00, Object x01, Object x02, Object x03, Object x04, ...">
+    Object x00, Object x01, Object x02, Object x03, Object x04, Object x05, Object x06, Object x07,
+    Object x08, Object x09, Object x0A, Object x0B, Object x0C, Object x0D, Object x0E, Object x0F,
+    Object x10, Object x11, Object x12, Object x13, Object x14, Object x15, Object x16, Object x17,
+    Object x18, Object x19, Object x1A, Object x1B, Object x1C, Object x1D, Object x1E, Object x1F,
+    Object x20, Object x21, Object x22, Object x23, Object x24, Object x25, Object x26, Object x27,
+    Object x28, Object x29, Object x2A, Object x2B, Object x2C, Object x2D, Object x2E, Object x2F,
+    Object x30, Object x31, Object x32, Object x33, Object x34, Object x35, Object x36, Object x37,
+    Object x38, Object x39, Object x3A, Object x3B, Object x3C, Object x3D, Object x3E, Object x3F,
+    Object x40, Object x41, Object x42, Object x43, Object x44, Object x45, Object x46, Object x47,
+    Object x48, Object x49, Object x4A, Object x4B, Object x4C, Object x4D, Object x4E, Object x4F,
+    Object x50, Object x51, Object x52, Object x53, Object x54, Object x55, Object x56, Object x57,
+    Object x58, Object x59, Object x5A, Object x5B, Object x5C, Object x5D, Object x5E, Object x5F,
+    Object x60, Object x61, Object x62, Object x63, Object x64, Object x65, Object x66, Object x67,
+    Object x68, Object x69, Object x6A, Object x6B, Object x6C, Object x6D, Object x6E, Object x6F,
+    Object x70, Object x71, Object x72, Object x73, Object x74, Object x75, Object x76, Object x77,
+    Object x78, Object x79, Object x7A, Object x7B, Object x7C, Object x7D, Object x7E, Object x7F,
+    Object x80, Object x81, Object x82, Object x83, Object x84, Object x85, Object x86, Object x87,
+    Object x88, Object x89, Object x8A, Object x8B, Object x8C, Object x8D, Object x8E, Object x8F,
+    Object x90, Object x91, Object x92, Object x93, Object x94, Object x95, Object x96, Object x97,
+    Object x98, Object x99, Object x9A, Object x9B, Object x9C, Object x9D, Object x9E, Object x9F,
+    Object xA0, Object xA1, Object xA2, Object xA3, Object xA4, Object xA5, Object xA6, Object xA7,
+    Object xA8, Object xA9, Object xAA, Object xAB, Object xAC, Object xAD, Object xAE, Object xAF,
+    Object xB0, Object xB1, Object xB2, Object xB3, Object xB4, Object xB5, Object xB6, Object xB7,
+    Object xB8, Object xB9, Object xBA, Object xBB, Object xBC, Object xBD, Object xBE, Object xBF,
+    Object xC0, Object xC1, Object xC2, Object xC3, Object xC4, Object xC5, Object xC6, Object xC7,
+    Object xC8, Object xC9, Object xCA, Object xCB, Object xCC, Object xCD, Object xCE, Object xCF,
+    Object xD0, Object xD1, Object xD2, Object xD3, Object xD4, Object xD5, Object xD6, Object xD7,
+    Object xD8, Object xD9, Object xDA, Object xDB, Object xDC, Object xDD, Object xDE, Object xDF,
+    Object xE0, Object xE1, Object xE2, Object xE3, Object xE4, Object xE5, Object xE6, Object xE7,
+    Object xE8, Object xE9, Object xEA, Object xEB, Object xEC, Object xED, Object xEE, Object xEF,
+    Object xF0, Object xF1, Object xF2, Object xF3, Object xF4, Object xF5, Object xF6, Object xF7,
+    // </editor-fold>
+    Object xF8, Object xF9, Object xFA, Object xFB, Object xFC) {
+        return Objects.hash(
+    // <editor-fold defaultstate="collapsed" desc="x00, x01, x02, x03, x04, ...">
+    x00, x01, x02, x03, x04, x05, x06, x07, x08, x09, x0A, x0B, x0C, x0D, x0E, x0F,
+    x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x1A, x1B, x1C, x1D, x1E, x1F,
+    x20, x21, x22, x23, x24, x25, x26, x27, x28, x29, x2A, x2B, x2C, x2D, x2E, x2F,
+    x30, x31, x32, x33, x34, x35, x36, x37, x38, x39, x3A, x3B, x3C, x3D, x3E, x3F,
+    x40, x41, x42, x43, x44, x45, x46, x47, x48, x49, x4A, x4B, x4C, x4D, x4E, x4F,
+    x50, x51, x52, x53, x54, x55, x56, x57, x58, x59, x5A, x5B, x5C, x5D, x5E, x5F,
+    x60, x61, x62, x63, x64, x65, x66, x67, x68, x69, x6A, x6B, x6C, x6D, x6E, x6F,
+    x70, x71, x72, x73, x74, x75, x76, x77, x78, x79, x7A, x7B, x7C, x7D, x7E, x7F,
+    x80, x81, x82, x83, x84, x85, x86, x87, x88, x89, x8A, x8B, x8C, x8D, x8E, x8F,
+    x90, x91, x92, x93, x94, x95, x96, x97, x98, x99, x9A, x9B, x9C, x9D, x9E, x9F,
+    xA0, xA1, xA2, xA3, xA4, xA5, xA6, xA7, xA8, xA9, xAA, xAB, xAC, xAD, xAE, xAF,
+    xB0, xB1, xB2, xB3, xB4, xB5, xB6, xB7, xB8, xB9, xBA, xBB, xBC, xBD, xBE, xBF,
+    xC0, xC1, xC2, xC3, xC4, xC5, xC6, xC7, xC8, xC9, xCA, xCB, xCC, xCD, xCE, xCF,
+    xD0, xD1, xD2, xD3, xD4, xD5, xD6, xD7, xD8, xD9, xDA, xDB, xDC, xDD, xDE, xDF,
+    xE0, xE1, xE2, xE3, xE4, xE5, xE6, xE7, xE8, xE9, xEA, xEB, xEC, xED, xEE, xEF,
+    xF0, xF1, xF2, xF3, xF4, xF5, xF6, xF7,
+    // </editor-fold>
+    xF8, xF9, xFA, xFB, xFC);
+    }
+
+    @Test
+    public void test253() throws Throwable {
+        final int ARITY = 253;
+        System.out.println("test"+ARITY);
+        Object[] a = testArgs(ARITY);
+        Object r0 = hashArguments(a);
+        Object r;
+        r = hashArguments_253(
+    // <editor-fold defaultstate="collapsed" desc="a[0x00], a[0x01], a[0x02], a[0x03], a[0x04], ...">
+    a[0x00], a[0x01], a[0x02], a[0x03], a[0x04], a[0x05], a[0x06], a[0x07], a[0x08], a[0x09], a[0x0A], a[0x0B], a[0x0C], a[0x0D], a[0x0E], a[0x0F],
+    a[0x10], a[0x11], a[0x12], a[0x13], a[0x14], a[0x15], a[0x16], a[0x17], a[0x18], a[0x19], a[0x1A], a[0x1B], a[0x1C], a[0x1D], a[0x1E], a[0x1F],
+    a[0x20], a[0x21], a[0x22], a[0x23], a[0x24], a[0x25], a[0x26], a[0x27], a[0x28], a[0x29], a[0x2A], a[0x2B], a[0x2C], a[0x2D], a[0x2E], a[0x2F],
+    a[0x30], a[0x31], a[0x32], a[0x33], a[0x34], a[0x35], a[0x36], a[0x37], a[0x38], a[0x39], a[0x3A], a[0x3B], a[0x3C], a[0x3D], a[0x3E], a[0x3F],
+    a[0x40], a[0x41], a[0x42], a[0x43], a[0x44], a[0x45], a[0x46], a[0x47], a[0x48], a[0x49], a[0x4A], a[0x4B], a[0x4C], a[0x4D], a[0x4E], a[0x4F],
+    a[0x50], a[0x51], a[0x52], a[0x53], a[0x54], a[0x55], a[0x56], a[0x57], a[0x58], a[0x59], a[0x5A], a[0x5B], a[0x5C], a[0x5D], a[0x5E], a[0x5F],
+    a[0x60], a[0x61], a[0x62], a[0x63], a[0x64], a[0x65], a[0x66], a[0x67], a[0x68], a[0x69], a[0x6A], a[0x6B], a[0x6C], a[0x6D], a[0x6E], a[0x6F],
+    a[0x70], a[0x71], a[0x72], a[0x73], a[0x74], a[0x75], a[0x76], a[0x77], a[0x78], a[0x79], a[0x7A], a[0x7B], a[0x7C], a[0x7D], a[0x7E], a[0x7F],
+    a[0x80], a[0x81], a[0x82], a[0x83], a[0x84], a[0x85], a[0x86], a[0x87], a[0x88], a[0x89], a[0x8A], a[0x8B], a[0x8C], a[0x8D], a[0x8E], a[0x8F],
+    a[0x90], a[0x91], a[0x92], a[0x93], a[0x94], a[0x95], a[0x96], a[0x97], a[0x98], a[0x99], a[0x9A], a[0x9B], a[0x9C], a[0x9D], a[0x9E], a[0x9F],
+    a[0xA0], a[0xA1], a[0xA2], a[0xA3], a[0xA4], a[0xA5], a[0xA6], a[0xA7], a[0xA8], a[0xA9], a[0xAA], a[0xAB], a[0xAC], a[0xAD], a[0xAE], a[0xAF],
+    a[0xB0], a[0xB1], a[0xB2], a[0xB3], a[0xB4], a[0xB5], a[0xB6], a[0xB7], a[0xB8], a[0xB9], a[0xBA], a[0xBB], a[0xBC], a[0xBD], a[0xBE], a[0xBF],
+    a[0xC0], a[0xC1], a[0xC2], a[0xC3], a[0xC4], a[0xC5], a[0xC6], a[0xC7], a[0xC8], a[0xC9], a[0xCA], a[0xCB], a[0xCC], a[0xCD], a[0xCE], a[0xCF],
+    a[0xD0], a[0xD1], a[0xD2], a[0xD3], a[0xD4], a[0xD5], a[0xD6], a[0xD7], a[0xD8], a[0xD9], a[0xDA], a[0xDB], a[0xDC], a[0xDD], a[0xDE], a[0xDF],
+    a[0xE0], a[0xE1], a[0xE2], a[0xE3], a[0xE4], a[0xE5], a[0xE6], a[0xE7], a[0xE8], a[0xE9], a[0xEA], a[0xEB], a[0xEC], a[0xED], a[0xEE], a[0xEF],
+    a[0xF0], a[0xF1], a[0xF2], a[0xF3], a[0xF4], a[0xF5], a[0xF6], a[0xF7],
+    // </editor-fold>
+    a[0xF8], a[0xF9], a[0xFA], a[0xFB], a[0xFC]);
+        assertEquals(r0, r);
+        MethodType mt = MethodType.genericMethodType(ARITY);
+        MethodHandle mh = MethodHandles.lookup().findStatic(BigArityTest.class, "hashArguments_"+ARITY, mt);
+        r = mh.invokeExact(
+    // <editor-fold defaultstate="collapsed" desc="a[0x00], a[0x01], a[0x02], a[0x03], a[0x04], ...">
+    a[0x00], a[0x01], a[0x02], a[0x03], a[0x04], a[0x05], a[0x06], a[0x07], a[0x08], a[0x09], a[0x0A], a[0x0B], a[0x0C], a[0x0D], a[0x0E], a[0x0F],
+    a[0x10], a[0x11], a[0x12], a[0x13], a[0x14], a[0x15], a[0x16], a[0x17], a[0x18], a[0x19], a[0x1A], a[0x1B], a[0x1C], a[0x1D], a[0x1E], a[0x1F],
+    a[0x20], a[0x21], a[0x22], a[0x23], a[0x24], a[0x25], a[0x26], a[0x27], a[0x28], a[0x29], a[0x2A], a[0x2B], a[0x2C], a[0x2D], a[0x2E], a[0x2F],
+    a[0x30], a[0x31], a[0x32], a[0x33], a[0x34], a[0x35], a[0x36], a[0x37], a[0x38], a[0x39], a[0x3A], a[0x3B], a[0x3C], a[0x3D], a[0x3E], a[0x3F],
+    a[0x40], a[0x41], a[0x42], a[0x43], a[0x44], a[0x45], a[0x46], a[0x47], a[0x48], a[0x49], a[0x4A], a[0x4B], a[0x4C], a[0x4D], a[0x4E], a[0x4F],
+    a[0x50], a[0x51], a[0x52], a[0x53], a[0x54], a[0x55], a[0x56], a[0x57], a[0x58], a[0x59], a[0x5A], a[0x5B], a[0x5C], a[0x5D], a[0x5E], a[0x5F],
+    a[0x60], a[0x61], a[0x62], a[0x63], a[0x64], a[0x65], a[0x66], a[0x67], a[0x68], a[0x69], a[0x6A], a[0x6B], a[0x6C], a[0x6D], a[0x6E], a[0x6F],
+    a[0x70], a[0x71], a[0x72], a[0x73], a[0x74], a[0x75], a[0x76], a[0x77], a[0x78], a[0x79], a[0x7A], a[0x7B], a[0x7C], a[0x7D], a[0x7E], a[0x7F],
+    a[0x80], a[0x81], a[0x82], a[0x83], a[0x84], a[0x85], a[0x86], a[0x87], a[0x88], a[0x89], a[0x8A], a[0x8B], a[0x8C], a[0x8D], a[0x8E], a[0x8F],
+    a[0x90], a[0x91], a[0x92], a[0x93], a[0x94], a[0x95], a[0x96], a[0x97], a[0x98], a[0x99], a[0x9A], a[0x9B], a[0x9C], a[0x9D], a[0x9E], a[0x9F],
+    a[0xA0], a[0xA1], a[0xA2], a[0xA3], a[0xA4], a[0xA5], a[0xA6], a[0xA7], a[0xA8], a[0xA9], a[0xAA], a[0xAB], a[0xAC], a[0xAD], a[0xAE], a[0xAF],
+    a[0xB0], a[0xB1], a[0xB2], a[0xB3], a[0xB4], a[0xB5], a[0xB6], a[0xB7], a[0xB8], a[0xB9], a[0xBA], a[0xBB], a[0xBC], a[0xBD], a[0xBE], a[0xBF],
+    a[0xC0], a[0xC1], a[0xC2], a[0xC3], a[0xC4], a[0xC5], a[0xC6], a[0xC7], a[0xC8], a[0xC9], a[0xCA], a[0xCB], a[0xCC], a[0xCD], a[0xCE], a[0xCF],
+    a[0xD0], a[0xD1], a[0xD2], a[0xD3], a[0xD4], a[0xD5], a[0xD6], a[0xD7], a[0xD8], a[0xD9], a[0xDA], a[0xDB], a[0xDC], a[0xDD], a[0xDE], a[0xDF],
+    a[0xE0], a[0xE1], a[0xE2], a[0xE3], a[0xE4], a[0xE5], a[0xE6], a[0xE7], a[0xE8], a[0xE9], a[0xEA], a[0xEB], a[0xEC], a[0xED], a[0xEE], a[0xEF],
+    a[0xF0], a[0xF1], a[0xF2], a[0xF3], a[0xF4], a[0xF5], a[0xF6], a[0xF7],
+    // </editor-fold>
+    a[0xF8], a[0xF9], a[0xFA], a[0xFB], a[0xFC]);
+        assertEquals(r0, r);
+        r = mh.invokeWithArguments(a);
+        assertEquals(r0, r);
+        MethodHandle ximh = MethodHandles.exactInvoker(mh.type());
+        r = ximh.invokeExact(mh,
+    // <editor-fold defaultstate="collapsed" desc="a[0x00], a[0x01], a[0x02], a[0x03], a[0x04], ...">
+    a[0x00], a[0x01], a[0x02], a[0x03], a[0x04], a[0x05], a[0x06], a[0x07], a[0x08], a[0x09], a[0x0A], a[0x0B], a[0x0C], a[0x0D], a[0x0E], a[0x0F],
+    a[0x10], a[0x11], a[0x12], a[0x13], a[0x14], a[0x15], a[0x16], a[0x17], a[0x18], a[0x19], a[0x1A], a[0x1B], a[0x1C], a[0x1D], a[0x1E], a[0x1F],
+    a[0x20], a[0x21], a[0x22], a[0x23], a[0x24], a[0x25], a[0x26], a[0x27], a[0x28], a[0x29], a[0x2A], a[0x2B], a[0x2C], a[0x2D], a[0x2E], a[0x2F],
+    a[0x30], a[0x31], a[0x32], a[0x33], a[0x34], a[0x35], a[0x36], a[0x37], a[0x38], a[0x39], a[0x3A], a[0x3B], a[0x3C], a[0x3D], a[0x3E], a[0x3F],
+    a[0x40], a[0x41], a[0x42], a[0x43], a[0x44], a[0x45], a[0x46], a[0x47], a[0x48], a[0x49], a[0x4A], a[0x4B], a[0x4C], a[0x4D], a[0x4E], a[0x4F],
+    a[0x50], a[0x51], a[0x52], a[0x53], a[0x54], a[0x55], a[0x56], a[0x57], a[0x58], a[0x59], a[0x5A], a[0x5B], a[0x5C], a[0x5D], a[0x5E], a[0x5F],
+    a[0x60], a[0x61], a[0x62], a[0x63], a[0x64], a[0x65], a[0x66], a[0x67], a[0x68], a[0x69], a[0x6A], a[0x6B], a[0x6C], a[0x6D], a[0x6E], a[0x6F],
+    a[0x70], a[0x71], a[0x72], a[0x73], a[0x74], a[0x75], a[0x76], a[0x77], a[0x78], a[0x79], a[0x7A], a[0x7B], a[0x7C], a[0x7D], a[0x7E], a[0x7F],
+    a[0x80], a[0x81], a[0x82], a[0x83], a[0x84], a[0x85], a[0x86], a[0x87], a[0x88], a[0x89], a[0x8A], a[0x8B], a[0x8C], a[0x8D], a[0x8E], a[0x8F],
+    a[0x90], a[0x91], a[0x92], a[0x93], a[0x94], a[0x95], a[0x96], a[0x97], a[0x98], a[0x99], a[0x9A], a[0x9B], a[0x9C], a[0x9D], a[0x9E], a[0x9F],
+    a[0xA0], a[0xA1], a[0xA2], a[0xA3], a[0xA4], a[0xA5], a[0xA6], a[0xA7], a[0xA8], a[0xA9], a[0xAA], a[0xAB], a[0xAC], a[0xAD], a[0xAE], a[0xAF],
+    a[0xB0], a[0xB1], a[0xB2], a[0xB3], a[0xB4], a[0xB5], a[0xB6], a[0xB7], a[0xB8], a[0xB9], a[0xBA], a[0xBB], a[0xBC], a[0xBD], a[0xBE], a[0xBF],
+    a[0xC0], a[0xC1], a[0xC2], a[0xC3], a[0xC4], a[0xC5], a[0xC6], a[0xC7], a[0xC8], a[0xC9], a[0xCA], a[0xCB], a[0xCC], a[0xCD], a[0xCE], a[0xCF],
+    a[0xD0], a[0xD1], a[0xD2], a[0xD3], a[0xD4], a[0xD5], a[0xD6], a[0xD7], a[0xD8], a[0xD9], a[0xDA], a[0xDB], a[0xDC], a[0xDD], a[0xDE], a[0xDF],
+    a[0xE0], a[0xE1], a[0xE2], a[0xE3], a[0xE4], a[0xE5], a[0xE6], a[0xE7], a[0xE8], a[0xE9], a[0xEA], a[0xEB], a[0xEC], a[0xED], a[0xEE], a[0xEF],
+    a[0xF0], a[0xF1], a[0xF2], a[0xF3], a[0xF4], a[0xF5], a[0xF6], a[0xF7],
+    // </editor-fold>
+    a[0xF8], a[0xF9], a[0xFA], a[0xFB], a[0xFC]);
+        assertEquals(r0, r);
+        // FIXME: This next one fails, because it uses an internal invoker of arity 255.
+        r = ximh.invokeWithArguments(cat(mh,a));
+        assertEquals(r0, r);
+        MethodHandle gimh = MethodHandles.invoker(mh.type());
+        r = gimh.invoke(mh,
+    // <editor-fold defaultstate="collapsed" desc="(Number) a[0x00], a[0x01], a[0x02], a[0x03], a[0x04], ...">
+    (Number)
+    a[0x00], a[0x01], a[0x02], a[0x03], a[0x04], a[0x05], a[0x06], a[0x07], a[0x08], a[0x09], a[0x0A], a[0x0B], a[0x0C], a[0x0D], a[0x0E], a[0x0F],
+    a[0x10], a[0x11], a[0x12], a[0x13], a[0x14], a[0x15], a[0x16], a[0x17], a[0x18], a[0x19], a[0x1A], a[0x1B], a[0x1C], a[0x1D], a[0x1E], a[0x1F],
+    a[0x20], a[0x21], a[0x22], a[0x23], a[0x24], a[0x25], a[0x26], a[0x27], a[0x28], a[0x29], a[0x2A], a[0x2B], a[0x2C], a[0x2D], a[0x2E], a[0x2F],
+    a[0x30], a[0x31], a[0x32], a[0x33], a[0x34], a[0x35], a[0x36], a[0x37], a[0x38], a[0x39], a[0x3A], a[0x3B], a[0x3C], a[0x3D], a[0x3E], a[0x3F],
+    a[0x40], a[0x41], a[0x42], a[0x43], a[0x44], a[0x45], a[0x46], a[0x47], a[0x48], a[0x49], a[0x4A], a[0x4B], a[0x4C], a[0x4D], a[0x4E], a[0x4F],
+    a[0x50], a[0x51], a[0x52], a[0x53], a[0x54], a[0x55], a[0x56], a[0x57], a[0x58], a[0x59], a[0x5A], a[0x5B], a[0x5C], a[0x5D], a[0x5E], a[0x5F],
+    a[0x60], a[0x61], a[0x62], a[0x63], a[0x64], a[0x65], a[0x66], a[0x67], a[0x68], a[0x69], a[0x6A], a[0x6B], a[0x6C], a[0x6D], a[0x6E], a[0x6F],
+    a[0x70], a[0x71], a[0x72], a[0x73], a[0x74], a[0x75], a[0x76], a[0x77], a[0x78], a[0x79], a[0x7A], a[0x7B], a[0x7C], a[0x7D], a[0x7E], a[0x7F],
+    a[0x80], a[0x81], a[0x82], a[0x83], a[0x84], a[0x85], a[0x86], a[0x87], a[0x88], a[0x89], a[0x8A], a[0x8B], a[0x8C], a[0x8D], a[0x8E], a[0x8F],
+    a[0x90], a[0x91], a[0x92], a[0x93], a[0x94], a[0x95], a[0x96], a[0x97], a[0x98], a[0x99], a[0x9A], a[0x9B], a[0x9C], a[0x9D], a[0x9E], a[0x9F],
+    a[0xA0], a[0xA1], a[0xA2], a[0xA3], a[0xA4], a[0xA5], a[0xA6], a[0xA7], a[0xA8], a[0xA9], a[0xAA], a[0xAB], a[0xAC], a[0xAD], a[0xAE], a[0xAF],
+    a[0xB0], a[0xB1], a[0xB2], a[0xB3], a[0xB4], a[0xB5], a[0xB6], a[0xB7], a[0xB8], a[0xB9], a[0xBA], a[0xBB], a[0xBC], a[0xBD], a[0xBE], a[0xBF],
+    a[0xC0], a[0xC1], a[0xC2], a[0xC3], a[0xC4], a[0xC5], a[0xC6], a[0xC7], a[0xC8], a[0xC9], a[0xCA], a[0xCB], a[0xCC], a[0xCD], a[0xCE], a[0xCF],
+    a[0xD0], a[0xD1], a[0xD2], a[0xD3], a[0xD4], a[0xD5], a[0xD6], a[0xD7], a[0xD8], a[0xD9], a[0xDA], a[0xDB], a[0xDC], a[0xDD], a[0xDE], a[0xDF],
+    a[0xE0], a[0xE1], a[0xE2], a[0xE3], a[0xE4], a[0xE5], a[0xE6], a[0xE7], a[0xE8], a[0xE9], a[0xEA], a[0xEB], a[0xEC], a[0xED], a[0xEE], a[0xEF],
+    a[0xF0], a[0xF1], a[0xF2], a[0xF3], a[0xF4], a[0xF5], a[0xF6], a[0xF7],
+    // </editor-fold>
+    a[0xF8], a[0xF9], a[0xFA], a[0xFB], a[0xFC]);
+        assertEquals(r0, r);
+        // FIXME: This next one fails, because it uses an internal invoker of arity 255.
+        r = gimh.invokeWithArguments(cat(mh,a));
+        assertEquals(r0, r);
+        mh = mh.asType(mh.type().changeParameterType(0x10, Integer.class));
+        //System.out.println("type="+mh.type().toString().replaceAll("Object", ""));
+        r = mh.invokeExact(
+    // <editor-fold defaultstate="collapsed" desc="a[0x00], a[0x01], a[0x02], a[0x03], a[0x04], ... (Integer) a[0x10], ...">
+    a[0x00], a[0x01], a[0x02], a[0x03], a[0x04], a[0x05], a[0x06], a[0x07], a[0x08], a[0x09], a[0x0A], a[0x0B], a[0x0C], a[0x0D], a[0x0E], a[0x0F],
+    (Integer)
+    a[0x10], a[0x11], a[0x12], a[0x13], a[0x14], a[0x15], a[0x16], a[0x17], a[0x18], a[0x19], a[0x1A], a[0x1B], a[0x1C], a[0x1D], a[0x1E], a[0x1F],
+    a[0x20], a[0x21], a[0x22], a[0x23], a[0x24], a[0x25], a[0x26], a[0x27], a[0x28], a[0x29], a[0x2A], a[0x2B], a[0x2C], a[0x2D], a[0x2E], a[0x2F],
+    a[0x30], a[0x31], a[0x32], a[0x33], a[0x34], a[0x35], a[0x36], a[0x37], a[0x38], a[0x39], a[0x3A], a[0x3B], a[0x3C], a[0x3D], a[0x3E], a[0x3F],
+    a[0x40], a[0x41], a[0x42], a[0x43], a[0x44], a[0x45], a[0x46], a[0x47], a[0x48], a[0x49], a[0x4A], a[0x4B], a[0x4C], a[0x4D], a[0x4E], a[0x4F],
+    a[0x50], a[0x51], a[0x52], a[0x53], a[0x54], a[0x55], a[0x56], a[0x57], a[0x58], a[0x59], a[0x5A], a[0x5B], a[0x5C], a[0x5D], a[0x5E], a[0x5F],
+    a[0x60], a[0x61], a[0x62], a[0x63], a[0x64], a[0x65], a[0x66], a[0x67], a[0x68], a[0x69], a[0x6A], a[0x6B], a[0x6C], a[0x6D], a[0x6E], a[0x6F],
+    a[0x70], a[0x71], a[0x72], a[0x73], a[0x74], a[0x75], a[0x76], a[0x77], a[0x78], a[0x79], a[0x7A], a[0x7B], a[0x7C], a[0x7D], a[0x7E], a[0x7F],
+    a[0x80], a[0x81], a[0x82], a[0x83], a[0x84], a[0x85], a[0x86], a[0x87], a[0x88], a[0x89], a[0x8A], a[0x8B], a[0x8C], a[0x8D], a[0x8E], a[0x8F],
+    a[0x90], a[0x91], a[0x92], a[0x93], a[0x94], a[0x95], a[0x96], a[0x97], a[0x98], a[0x99], a[0x9A], a[0x9B], a[0x9C], a[0x9D], a[0x9E], a[0x9F],
+    a[0xA0], a[0xA1], a[0xA2], a[0xA3], a[0xA4], a[0xA5], a[0xA6], a[0xA7], a[0xA8], a[0xA9], a[0xAA], a[0xAB], a[0xAC], a[0xAD], a[0xAE], a[0xAF],
+    a[0xB0], a[0xB1], a[0xB2], a[0xB3], a[0xB4], a[0xB5], a[0xB6], a[0xB7], a[0xB8], a[0xB9], a[0xBA], a[0xBB], a[0xBC], a[0xBD], a[0xBE], a[0xBF],
+    a[0xC0], a[0xC1], a[0xC2], a[0xC3], a[0xC4], a[0xC5], a[0xC6], a[0xC7], a[0xC8], a[0xC9], a[0xCA], a[0xCB], a[0xCC], a[0xCD], a[0xCE], a[0xCF],
+    a[0xD0], a[0xD1], a[0xD2], a[0xD3], a[0xD4], a[0xD5], a[0xD6], a[0xD7], a[0xD8], a[0xD9], a[0xDA], a[0xDB], a[0xDC], a[0xDD], a[0xDE], a[0xDF],
+    a[0xE0], a[0xE1], a[0xE2], a[0xE3], a[0xE4], a[0xE5], a[0xE6], a[0xE7], a[0xE8], a[0xE9], a[0xEA], a[0xEB], a[0xEC], a[0xED], a[0xEE], a[0xEF],
+    a[0xF0], a[0xF1], a[0xF2], a[0xF3], a[0xF4], a[0xF5], a[0xF6], a[0xF7],
+    // </editor-fold>
+    a[0xF8], a[0xF9], a[0xFA], a[0xFB], a[0xFC]);
+        assertEquals(r0, r);
+        r = mh.invoke(
+    // <editor-fold defaultstate="collapsed" desc="(Comparable) a[0x00], a[0x01], a[0x02], a[0x03], a[0x04], ...">
+    (Comparable<?>)
+    a[0x00], a[0x01], a[0x02], a[0x03], a[0x04], a[0x05], a[0x06], a[0x07], a[0x08], a[0x09], a[0x0A], a[0x0B], a[0x0C], a[0x0D], a[0x0E], a[0x0F],
+    a[0x10], a[0x11], a[0x12], a[0x13], a[0x14], a[0x15], a[0x16], a[0x17], a[0x18], a[0x19], a[0x1A], a[0x1B], a[0x1C], a[0x1D], a[0x1E], a[0x1F],
+    a[0x20], a[0x21], a[0x22], a[0x23], a[0x24], a[0x25], a[0x26], a[0x27], a[0x28], a[0x29], a[0x2A], a[0x2B], a[0x2C], a[0x2D], a[0x2E], a[0x2F],
+    a[0x30], a[0x31], a[0x32], a[0x33], a[0x34], a[0x35], a[0x36], a[0x37], a[0x38], a[0x39], a[0x3A], a[0x3B], a[0x3C], a[0x3D], a[0x3E], a[0x3F],
+    a[0x40], a[0x41], a[0x42], a[0x43], a[0x44], a[0x45], a[0x46], a[0x47], a[0x48], a[0x49], a[0x4A], a[0x4B], a[0x4C], a[0x4D], a[0x4E], a[0x4F],
+    a[0x50], a[0x51], a[0x52], a[0x53], a[0x54], a[0x55], a[0x56], a[0x57], a[0x58], a[0x59], a[0x5A], a[0x5B], a[0x5C], a[0x5D], a[0x5E], a[0x5F],
+    a[0x60], a[0x61], a[0x62], a[0x63], a[0x64], a[0x65], a[0x66], a[0x67], a[0x68], a[0x69], a[0x6A], a[0x6B], a[0x6C], a[0x6D], a[0x6E], a[0x6F],
+    a[0x70], a[0x71], a[0x72], a[0x73], a[0x74], a[0x75], a[0x76], a[0x77], a[0x78], a[0x79], a[0x7A], a[0x7B], a[0x7C], a[0x7D], a[0x7E], a[0x7F],
+    a[0x80], a[0x81], a[0x82], a[0x83], a[0x84], a[0x85], a[0x86], a[0x87], a[0x88], a[0x89], a[0x8A], a[0x8B], a[0x8C], a[0x8D], a[0x8E], a[0x8F],
+    a[0x90], a[0x91], a[0x92], a[0x93], a[0x94], a[0x95], a[0x96], a[0x97], a[0x98], a[0x99], a[0x9A], a[0x9B], a[0x9C], a[0x9D], a[0x9E], a[0x9F],
+    a[0xA0], a[0xA1], a[0xA2], a[0xA3], a[0xA4], a[0xA5], a[0xA6], a[0xA7], a[0xA8], a[0xA9], a[0xAA], a[0xAB], a[0xAC], a[0xAD], a[0xAE], a[0xAF],
+    a[0xB0], a[0xB1], a[0xB2], a[0xB3], a[0xB4], a[0xB5], a[0xB6], a[0xB7], a[0xB8], a[0xB9], a[0xBA], a[0xBB], a[0xBC], a[0xBD], a[0xBE], a[0xBF],
+    a[0xC0], a[0xC1], a[0xC2], a[0xC3], a[0xC4], a[0xC5], a[0xC6], a[0xC7], a[0xC8], a[0xC9], a[0xCA], a[0xCB], a[0xCC], a[0xCD], a[0xCE], a[0xCF],
+    a[0xD0], a[0xD1], a[0xD2], a[0xD3], a[0xD4], a[0xD5], a[0xD6], a[0xD7], a[0xD8], a[0xD9], a[0xDA], a[0xDB], a[0xDC], a[0xDD], a[0xDE], a[0xDF],
+    a[0xE0], a[0xE1], a[0xE2], a[0xE3], a[0xE4], a[0xE5], a[0xE6], a[0xE7], a[0xE8], a[0xE9], a[0xEA], a[0xEB], a[0xEC], a[0xED], a[0xEE], a[0xEF],
+    a[0xF0], a[0xF1], a[0xF2], a[0xF3], a[0xF4], a[0xF5], a[0xF6], a[0xF7],
+    // </editor-fold>
+    a[0xF8], a[0xF9], a[0xFA], a[0xFB], a[0xFC]);
+        assertEquals(r0, r);
+    }
+
+    static Object hashArguments_254(
+    // <editor-fold defaultstate="collapsed" desc="Object x00, Object x01, Object x02, Object x03, Object x04, ...">
+    Object x00, Object x01, Object x02, Object x03, Object x04, Object x05, Object x06, Object x07,
+    Object x08, Object x09, Object x0A, Object x0B, Object x0C, Object x0D, Object x0E, Object x0F,
+    Object x10, Object x11, Object x12, Object x13, Object x14, Object x15, Object x16, Object x17,
+    Object x18, Object x19, Object x1A, Object x1B, Object x1C, Object x1D, Object x1E, Object x1F,
+    Object x20, Object x21, Object x22, Object x23, Object x24, Object x25, Object x26, Object x27,
+    Object x28, Object x29, Object x2A, Object x2B, Object x2C, Object x2D, Object x2E, Object x2F,
+    Object x30, Object x31, Object x32, Object x33, Object x34, Object x35, Object x36, Object x37,
+    Object x38, Object x39, Object x3A, Object x3B, Object x3C, Object x3D, Object x3E, Object x3F,
+    Object x40, Object x41, Object x42, Object x43, Object x44, Object x45, Object x46, Object x47,
+    Object x48, Object x49, Object x4A, Object x4B, Object x4C, Object x4D, Object x4E, Object x4F,
+    Object x50, Object x51, Object x52, Object x53, Object x54, Object x55, Object x56, Object x57,
+    Object x58, Object x59, Object x5A, Object x5B, Object x5C, Object x5D, Object x5E, Object x5F,
+    Object x60, Object x61, Object x62, Object x63, Object x64, Object x65, Object x66, Object x67,
+    Object x68, Object x69, Object x6A, Object x6B, Object x6C, Object x6D, Object x6E, Object x6F,
+    Object x70, Object x71, Object x72, Object x73, Object x74, Object x75, Object x76, Object x77,
+    Object x78, Object x79, Object x7A, Object x7B, Object x7C, Object x7D, Object x7E, Object x7F,
+    Object x80, Object x81, Object x82, Object x83, Object x84, Object x85, Object x86, Object x87,
+    Object x88, Object x89, Object x8A, Object x8B, Object x8C, Object x8D, Object x8E, Object x8F,
+    Object x90, Object x91, Object x92, Object x93, Object x94, Object x95, Object x96, Object x97,
+    Object x98, Object x99, Object x9A, Object x9B, Object x9C, Object x9D, Object x9E, Object x9F,
+    Object xA0, Object xA1, Object xA2, Object xA3, Object xA4, Object xA5, Object xA6, Object xA7,
+    Object xA8, Object xA9, Object xAA, Object xAB, Object xAC, Object xAD, Object xAE, Object xAF,
+    Object xB0, Object xB1, Object xB2, Object xB3, Object xB4, Object xB5, Object xB6, Object xB7,
+    Object xB8, Object xB9, Object xBA, Object xBB, Object xBC, Object xBD, Object xBE, Object xBF,
+    Object xC0, Object xC1, Object xC2, Object xC3, Object xC4, Object xC5, Object xC6, Object xC7,
+    Object xC8, Object xC9, Object xCA, Object xCB, Object xCC, Object xCD, Object xCE, Object xCF,
+    Object xD0, Object xD1, Object xD2, Object xD3, Object xD4, Object xD5, Object xD6, Object xD7,
+    Object xD8, Object xD9, Object xDA, Object xDB, Object xDC, Object xDD, Object xDE, Object xDF,
+    Object xE0, Object xE1, Object xE2, Object xE3, Object xE4, Object xE5, Object xE6, Object xE7,
+    Object xE8, Object xE9, Object xEA, Object xEB, Object xEC, Object xED, Object xEE, Object xEF,
+    Object xF0, Object xF1, Object xF2, Object xF3, Object xF4, Object xF5, Object xF6, Object xF7,
+    // </editor-fold>
+    Object xF8, Object xF9, Object xFA, Object xFB, Object xFC, Object xFD) {
+        return Objects.hash(
+    // <editor-fold defaultstate="collapsed" desc="x00, x01, x02, x03, x04, ...">
+    x00, x01, x02, x03, x04, x05, x06, x07, x08, x09, x0A, x0B, x0C, x0D, x0E, x0F,
+    x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x1A, x1B, x1C, x1D, x1E, x1F,
+    x20, x21, x22, x23, x24, x25, x26, x27, x28, x29, x2A, x2B, x2C, x2D, x2E, x2F,
+    x30, x31, x32, x33, x34, x35, x36, x37, x38, x39, x3A, x3B, x3C, x3D, x3E, x3F,
+    x40, x41, x42, x43, x44, x45, x46, x47, x48, x49, x4A, x4B, x4C, x4D, x4E, x4F,
+    x50, x51, x52, x53, x54, x55, x56, x57, x58, x59, x5A, x5B, x5C, x5D, x5E, x5F,
+    x60, x61, x62, x63, x64, x65, x66, x67, x68, x69, x6A, x6B, x6C, x6D, x6E, x6F,
+    x70, x71, x72, x73, x74, x75, x76, x77, x78, x79, x7A, x7B, x7C, x7D, x7E, x7F,
+    x80, x81, x82, x83, x84, x85, x86, x87, x88, x89, x8A, x8B, x8C, x8D, x8E, x8F,
+    x90, x91, x92, x93, x94, x95, x96, x97, x98, x99, x9A, x9B, x9C, x9D, x9E, x9F,
+    xA0, xA1, xA2, xA3, xA4, xA5, xA6, xA7, xA8, xA9, xAA, xAB, xAC, xAD, xAE, xAF,
+    xB0, xB1, xB2, xB3, xB4, xB5, xB6, xB7, xB8, xB9, xBA, xBB, xBC, xBD, xBE, xBF,
+    xC0, xC1, xC2, xC3, xC4, xC5, xC6, xC7, xC8, xC9, xCA, xCB, xCC, xCD, xCE, xCF,
+    xD0, xD1, xD2, xD3, xD4, xD5, xD6, xD7, xD8, xD9, xDA, xDB, xDC, xDD, xDE, xDF,
+    xE0, xE1, xE2, xE3, xE4, xE5, xE6, xE7, xE8, xE9, xEA, xEB, xEC, xED, xEE, xEF,
+    xF0, xF1, xF2, xF3, xF4, xF5, xF6, xF7,
+    // </editor-fold>
+    xF8, xF9, xFA, xFB, xFC, xFD);
+    }
+
+    @Test
+    public void test254() throws Throwable {
+        final int ARITY = 254;
+        System.out.println("test"+ARITY);
+        Object[] a = testArgs(ARITY);
+        Object r0 = hashArguments(a);
+        Object r;
+        r = hashArguments_254(
+    // <editor-fold defaultstate="collapsed" desc="a[0x00], a[0x01], a[0x02], a[0x03], a[0x04], ...">
+    a[0x00], a[0x01], a[0x02], a[0x03], a[0x04], a[0x05], a[0x06], a[0x07], a[0x08], a[0x09], a[0x0A], a[0x0B], a[0x0C], a[0x0D], a[0x0E], a[0x0F],
+    a[0x10], a[0x11], a[0x12], a[0x13], a[0x14], a[0x15], a[0x16], a[0x17], a[0x18], a[0x19], a[0x1A], a[0x1B], a[0x1C], a[0x1D], a[0x1E], a[0x1F],
+    a[0x20], a[0x21], a[0x22], a[0x23], a[0x24], a[0x25], a[0x26], a[0x27], a[0x28], a[0x29], a[0x2A], a[0x2B], a[0x2C], a[0x2D], a[0x2E], a[0x2F],
+    a[0x30], a[0x31], a[0x32], a[0x33], a[0x34], a[0x35], a[0x36], a[0x37], a[0x38], a[0x39], a[0x3A], a[0x3B], a[0x3C], a[0x3D], a[0x3E], a[0x3F],
+    a[0x40], a[0x41], a[0x42], a[0x43], a[0x44], a[0x45], a[0x46], a[0x47], a[0x48], a[0x49], a[0x4A], a[0x4B], a[0x4C], a[0x4D], a[0x4E], a[0x4F],
+    a[0x50], a[0x51], a[0x52], a[0x53], a[0x54], a[0x55], a[0x56], a[0x57], a[0x58], a[0x59], a[0x5A], a[0x5B], a[0x5C], a[0x5D], a[0x5E], a[0x5F],
+    a[0x60], a[0x61], a[0x62], a[0x63], a[0x64], a[0x65], a[0x66], a[0x67], a[0x68], a[0x69], a[0x6A], a[0x6B], a[0x6C], a[0x6D], a[0x6E], a[0x6F],
+    a[0x70], a[0x71], a[0x72], a[0x73], a[0x74], a[0x75], a[0x76], a[0x77], a[0x78], a[0x79], a[0x7A], a[0x7B], a[0x7C], a[0x7D], a[0x7E], a[0x7F],
+    a[0x80], a[0x81], a[0x82], a[0x83], a[0x84], a[0x85], a[0x86], a[0x87], a[0x88], a[0x89], a[0x8A], a[0x8B], a[0x8C], a[0x8D], a[0x8E], a[0x8F],
+    a[0x90], a[0x91], a[0x92], a[0x93], a[0x94], a[0x95], a[0x96], a[0x97], a[0x98], a[0x99], a[0x9A], a[0x9B], a[0x9C], a[0x9D], a[0x9E], a[0x9F],
+    a[0xA0], a[0xA1], a[0xA2], a[0xA3], a[0xA4], a[0xA5], a[0xA6], a[0xA7], a[0xA8], a[0xA9], a[0xAA], a[0xAB], a[0xAC], a[0xAD], a[0xAE], a[0xAF],
+    a[0xB0], a[0xB1], a[0xB2], a[0xB3], a[0xB4], a[0xB5], a[0xB6], a[0xB7], a[0xB8], a[0xB9], a[0xBA], a[0xBB], a[0xBC], a[0xBD], a[0xBE], a[0xBF],
+    a[0xC0], a[0xC1], a[0xC2], a[0xC3], a[0xC4], a[0xC5], a[0xC6], a[0xC7], a[0xC8], a[0xC9], a[0xCA], a[0xCB], a[0xCC], a[0xCD], a[0xCE], a[0xCF],
+    a[0xD0], a[0xD1], a[0xD2], a[0xD3], a[0xD4], a[0xD5], a[0xD6], a[0xD7], a[0xD8], a[0xD9], a[0xDA], a[0xDB], a[0xDC], a[0xDD], a[0xDE], a[0xDF],
+    a[0xE0], a[0xE1], a[0xE2], a[0xE3], a[0xE4], a[0xE5], a[0xE6], a[0xE7], a[0xE8], a[0xE9], a[0xEA], a[0xEB], a[0xEC], a[0xED], a[0xEE], a[0xEF],
+    a[0xF0], a[0xF1], a[0xF2], a[0xF3], a[0xF4], a[0xF5], a[0xF6], a[0xF7],
+    // </editor-fold>
+    a[0xF8], a[0xF9], a[0xFA], a[0xFB], a[0xFC], a[0xFD]);
+        assertEquals(r0, r);
+        MethodType mt = MethodType.genericMethodType(ARITY);
+        MethodHandle mh = MethodHandles.lookup().findStatic(BigArityTest.class, "hashArguments_"+ARITY, mt);
+        r = mh.invokeExact(
+    // <editor-fold defaultstate="collapsed" desc="a[0x00], a[0x01], a[0x02], a[0x03], a[0x04], ...">
+    a[0x00], a[0x01], a[0x02], a[0x03], a[0x04], a[0x05], a[0x06], a[0x07], a[0x08], a[0x09], a[0x0A], a[0x0B], a[0x0C], a[0x0D], a[0x0E], a[0x0F],
+    a[0x10], a[0x11], a[0x12], a[0x13], a[0x14], a[0x15], a[0x16], a[0x17], a[0x18], a[0x19], a[0x1A], a[0x1B], a[0x1C], a[0x1D], a[0x1E], a[0x1F],
+    a[0x20], a[0x21], a[0x22], a[0x23], a[0x24], a[0x25], a[0x26], a[0x27], a[0x28], a[0x29], a[0x2A], a[0x2B], a[0x2C], a[0x2D], a[0x2E], a[0x2F],
+    a[0x30], a[0x31], a[0x32], a[0x33], a[0x34], a[0x35], a[0x36], a[0x37], a[0x38], a[0x39], a[0x3A], a[0x3B], a[0x3C], a[0x3D], a[0x3E], a[0x3F],
+    a[0x40], a[0x41], a[0x42], a[0x43], a[0x44], a[0x45], a[0x46], a[0x47], a[0x48], a[0x49], a[0x4A], a[0x4B], a[0x4C], a[0x4D], a[0x4E], a[0x4F],
+    a[0x50], a[0x51], a[0x52], a[0x53], a[0x54], a[0x55], a[0x56], a[0x57], a[0x58], a[0x59], a[0x5A], a[0x5B], a[0x5C], a[0x5D], a[0x5E], a[0x5F],
+    a[0x60], a[0x61], a[0x62], a[0x63], a[0x64], a[0x65], a[0x66], a[0x67], a[0x68], a[0x69], a[0x6A], a[0x6B], a[0x6C], a[0x6D], a[0x6E], a[0x6F],
+    a[0x70], a[0x71], a[0x72], a[0x73], a[0x74], a[0x75], a[0x76], a[0x77], a[0x78], a[0x79], a[0x7A], a[0x7B], a[0x7C], a[0x7D], a[0x7E], a[0x7F],
+    a[0x80], a[0x81], a[0x82], a[0x83], a[0x84], a[0x85], a[0x86], a[0x87], a[0x88], a[0x89], a[0x8A], a[0x8B], a[0x8C], a[0x8D], a[0x8E], a[0x8F],
+    a[0x90], a[0x91], a[0x92], a[0x93], a[0x94], a[0x95], a[0x96], a[0x97], a[0x98], a[0x99], a[0x9A], a[0x9B], a[0x9C], a[0x9D], a[0x9E], a[0x9F],
+    a[0xA0], a[0xA1], a[0xA2], a[0xA3], a[0xA4], a[0xA5], a[0xA6], a[0xA7], a[0xA8], a[0xA9], a[0xAA], a[0xAB], a[0xAC], a[0xAD], a[0xAE], a[0xAF],
+    a[0xB0], a[0xB1], a[0xB2], a[0xB3], a[0xB4], a[0xB5], a[0xB6], a[0xB7], a[0xB8], a[0xB9], a[0xBA], a[0xBB], a[0xBC], a[0xBD], a[0xBE], a[0xBF],
+    a[0xC0], a[0xC1], a[0xC2], a[0xC3], a[0xC4], a[0xC5], a[0xC6], a[0xC7], a[0xC8], a[0xC9], a[0xCA], a[0xCB], a[0xCC], a[0xCD], a[0xCE], a[0xCF],
+    a[0xD0], a[0xD1], a[0xD2], a[0xD3], a[0xD4], a[0xD5], a[0xD6], a[0xD7], a[0xD8], a[0xD9], a[0xDA], a[0xDB], a[0xDC], a[0xDD], a[0xDE], a[0xDF],
+    a[0xE0], a[0xE1], a[0xE2], a[0xE3], a[0xE4], a[0xE5], a[0xE6], a[0xE7], a[0xE8], a[0xE9], a[0xEA], a[0xEB], a[0xEC], a[0xED], a[0xEE], a[0xEF],
+    a[0xF0], a[0xF1], a[0xF2], a[0xF3], a[0xF4], a[0xF5], a[0xF6], a[0xF7],
+    // </editor-fold>
+    a[0xF8], a[0xF9], a[0xFA], a[0xFB], a[0xFC], a[0xFD]);
+        assertEquals(r0, r);
+        // FIXME: This next one fails, because it uses an internal invoker of arity 255.
+        r = mh.invokeWithArguments(a);
+        assertEquals(r0, r);
+        try {
+            MethodHandle ximh = MethodHandles.exactInvoker(mh.type());
+            throw new AssertionError("should have thrown IAE; cannot have 1+1+254 arguments");
+        } catch (IllegalArgumentException ex) {
+            System.out.println("OK: "+ex);
+        }
+        mh = mh.asType(mh.type().changeParameterType(0x10, Integer.class));
+        //System.out.println("type="+mh.type().toString().replaceAll("Object", ""));
+        r = mh.invokeExact(
+    // <editor-fold defaultstate="collapsed" desc="a[0x00], a[0x01], a[0x02], a[0x03], a[0x04], ... (Integer) a[0x10], ...">
+    a[0x00], a[0x01], a[0x02], a[0x03], a[0x04], a[0x05], a[0x06], a[0x07], a[0x08], a[0x09], a[0x0A], a[0x0B], a[0x0C], a[0x0D], a[0x0E], a[0x0F],
+    (Integer)
+    a[0x10], a[0x11], a[0x12], a[0x13], a[0x14], a[0x15], a[0x16], a[0x17], a[0x18], a[0x19], a[0x1A], a[0x1B], a[0x1C], a[0x1D], a[0x1E], a[0x1F],
+    a[0x20], a[0x21], a[0x22], a[0x23], a[0x24], a[0x25], a[0x26], a[0x27], a[0x28], a[0x29], a[0x2A], a[0x2B], a[0x2C], a[0x2D], a[0x2E], a[0x2F],
+    a[0x30], a[0x31], a[0x32], a[0x33], a[0x34], a[0x35], a[0x36], a[0x37], a[0x38], a[0x39], a[0x3A], a[0x3B], a[0x3C], a[0x3D], a[0x3E], a[0x3F],
+    a[0x40], a[0x41], a[0x42], a[0x43], a[0x44], a[0x45], a[0x46], a[0x47], a[0x48], a[0x49], a[0x4A], a[0x4B], a[0x4C], a[0x4D], a[0x4E], a[0x4F],
+    a[0x50], a[0x51], a[0x52], a[0x53], a[0x54], a[0x55], a[0x56], a[0x57], a[0x58], a[0x59], a[0x5A], a[0x5B], a[0x5C], a[0x5D], a[0x5E], a[0x5F],
+    a[0x60], a[0x61], a[0x62], a[0x63], a[0x64], a[0x65], a[0x66], a[0x67], a[0x68], a[0x69], a[0x6A], a[0x6B], a[0x6C], a[0x6D], a[0x6E], a[0x6F],
+    a[0x70], a[0x71], a[0x72], a[0x73], a[0x74], a[0x75], a[0x76], a[0x77], a[0x78], a[0x79], a[0x7A], a[0x7B], a[0x7C], a[0x7D], a[0x7E], a[0x7F],
+    a[0x80], a[0x81], a[0x82], a[0x83], a[0x84], a[0x85], a[0x86], a[0x87], a[0x88], a[0x89], a[0x8A], a[0x8B], a[0x8C], a[0x8D], a[0x8E], a[0x8F],
+    a[0x90], a[0x91], a[0x92], a[0x93], a[0x94], a[0x95], a[0x96], a[0x97], a[0x98], a[0x99], a[0x9A], a[0x9B], a[0x9C], a[0x9D], a[0x9E], a[0x9F],
+    a[0xA0], a[0xA1], a[0xA2], a[0xA3], a[0xA4], a[0xA5], a[0xA6], a[0xA7], a[0xA8], a[0xA9], a[0xAA], a[0xAB], a[0xAC], a[0xAD], a[0xAE], a[0xAF],
+    a[0xB0], a[0xB1], a[0xB2], a[0xB3], a[0xB4], a[0xB5], a[0xB6], a[0xB7], a[0xB8], a[0xB9], a[0xBA], a[0xBB], a[0xBC], a[0xBD], a[0xBE], a[0xBF],
+    a[0xC0], a[0xC1], a[0xC2], a[0xC3], a[0xC4], a[0xC5], a[0xC6], a[0xC7], a[0xC8], a[0xC9], a[0xCA], a[0xCB], a[0xCC], a[0xCD], a[0xCE], a[0xCF],
+    a[0xD0], a[0xD1], a[0xD2], a[0xD3], a[0xD4], a[0xD5], a[0xD6], a[0xD7], a[0xD8], a[0xD9], a[0xDA], a[0xDB], a[0xDC], a[0xDD], a[0xDE], a[0xDF],
+    a[0xE0], a[0xE1], a[0xE2], a[0xE3], a[0xE4], a[0xE5], a[0xE6], a[0xE7], a[0xE8], a[0xE9], a[0xEA], a[0xEB], a[0xEC], a[0xED], a[0xEE], a[0xEF],
+    a[0xF0], a[0xF1], a[0xF2], a[0xF3], a[0xF4], a[0xF5], a[0xF6], a[0xF7],
+    // </editor-fold>
+    a[0xF8], a[0xF9], a[0xFA], a[0xFB], a[0xFC], a[0xFD]);
+        assertEquals(r0, r);
+        mh = mh.asType(mh.type().changeParameterType(0xE0, Number.class));
+        //System.out.println("type="+mh.type().toString().replaceAll("Object", ""));
+        r = mh.invokeExact(
+    // <editor-fold defaultstate="collapsed" desc="a[0x00], a[0x01], a[0x02], a[0x03], a[0x04], ... (Integer) a[0x10], ... (Number) a[0xE0], ...">
+    a[0x00], a[0x01], a[0x02], a[0x03], a[0x04], a[0x05], a[0x06], a[0x07], a[0x08], a[0x09], a[0x0A], a[0x0B], a[0x0C], a[0x0D], a[0x0E], a[0x0F],
+    (Integer)
+    a[0x10], a[0x11], a[0x12], a[0x13], a[0x14], a[0x15], a[0x16], a[0x17], a[0x18], a[0x19], a[0x1A], a[0x1B], a[0x1C], a[0x1D], a[0x1E], a[0x1F],
+    a[0x20], a[0x21], a[0x22], a[0x23], a[0x24], a[0x25], a[0x26], a[0x27], a[0x28], a[0x29], a[0x2A], a[0x2B], a[0x2C], a[0x2D], a[0x2E], a[0x2F],
+    a[0x30], a[0x31], a[0x32], a[0x33], a[0x34], a[0x35], a[0x36], a[0x37], a[0x38], a[0x39], a[0x3A], a[0x3B], a[0x3C], a[0x3D], a[0x3E], a[0x3F],
+    a[0x40], a[0x41], a[0x42], a[0x43], a[0x44], a[0x45], a[0x46], a[0x47], a[0x48], a[0x49], a[0x4A], a[0x4B], a[0x4C], a[0x4D], a[0x4E], a[0x4F],
+    a[0x50], a[0x51], a[0x52], a[0x53], a[0x54], a[0x55], a[0x56], a[0x57], a[0x58], a[0x59], a[0x5A], a[0x5B], a[0x5C], a[0x5D], a[0x5E], a[0x5F],
+    a[0x60], a[0x61], a[0x62], a[0x63], a[0x64], a[0x65], a[0x66], a[0x67], a[0x68], a[0x69], a[0x6A], a[0x6B], a[0x6C], a[0x6D], a[0x6E], a[0x6F],
+    a[0x70], a[0x71], a[0x72], a[0x73], a[0x74], a[0x75], a[0x76], a[0x77], a[0x78], a[0x79], a[0x7A], a[0x7B], a[0x7C], a[0x7D], a[0x7E], a[0x7F],
+    a[0x80], a[0x81], a[0x82], a[0x83], a[0x84], a[0x85], a[0x86], a[0x87], a[0x88], a[0x89], a[0x8A], a[0x8B], a[0x8C], a[0x8D], a[0x8E], a[0x8F],
+    a[0x90], a[0x91], a[0x92], a[0x93], a[0x94], a[0x95], a[0x96], a[0x97], a[0x98], a[0x99], a[0x9A], a[0x9B], a[0x9C], a[0x9D], a[0x9E], a[0x9F],
+    a[0xA0], a[0xA1], a[0xA2], a[0xA3], a[0xA4], a[0xA5], a[0xA6], a[0xA7], a[0xA8], a[0xA9], a[0xAA], a[0xAB], a[0xAC], a[0xAD], a[0xAE], a[0xAF],
+    a[0xB0], a[0xB1], a[0xB2], a[0xB3], a[0xB4], a[0xB5], a[0xB6], a[0xB7], a[0xB8], a[0xB9], a[0xBA], a[0xBB], a[0xBC], a[0xBD], a[0xBE], a[0xBF],
+    a[0xC0], a[0xC1], a[0xC2], a[0xC3], a[0xC4], a[0xC5], a[0xC6], a[0xC7], a[0xC8], a[0xC9], a[0xCA], a[0xCB], a[0xCC], a[0xCD], a[0xCE], a[0xCF],
+    a[0xD0], a[0xD1], a[0xD2], a[0xD3], a[0xD4], a[0xD5], a[0xD6], a[0xD7], a[0xD8], a[0xD9], a[0xDA], a[0xDB], a[0xDC], a[0xDD], a[0xDE], a[0xDF],
+    (Number)
+    a[0xE0], a[0xE1], a[0xE2], a[0xE3], a[0xE4], a[0xE5], a[0xE6], a[0xE7], a[0xE8], a[0xE9], a[0xEA], a[0xEB], a[0xEC], a[0xED], a[0xEE], a[0xEF],
+    a[0xF0], a[0xF1], a[0xF2], a[0xF3], a[0xF4], a[0xF5], a[0xF6], a[0xF7],
+    // </editor-fold>
+    a[0xF8], a[0xF9], a[0xFA], a[0xFB], a[0xFC], a[0xFD]);
+        assertEquals(r0, r);
+        r = mh.invoke(
+    // <editor-fold defaultstate="collapsed" desc="(Comparable) a[0x00], a[0x01], a[0x02], a[0x03], a[0x04], ...">
+    (Comparable<?>)
+    a[0x00], a[0x01], a[0x02], a[0x03], a[0x04], a[0x05], a[0x06], a[0x07], a[0x08], a[0x09], a[0x0A], a[0x0B], a[0x0C], a[0x0D], a[0x0E], a[0x0F],
+    a[0x10], a[0x11], a[0x12], a[0x13], a[0x14], a[0x15], a[0x16], a[0x17], a[0x18], a[0x19], a[0x1A], a[0x1B], a[0x1C], a[0x1D], a[0x1E], a[0x1F],
+    a[0x20], a[0x21], a[0x22], a[0x23], a[0x24], a[0x25], a[0x26], a[0x27], a[0x28], a[0x29], a[0x2A], a[0x2B], a[0x2C], a[0x2D], a[0x2E], a[0x2F],
+    a[0x30], a[0x31], a[0x32], a[0x33], a[0x34], a[0x35], a[0x36], a[0x37], a[0x38], a[0x39], a[0x3A], a[0x3B], a[0x3C], a[0x3D], a[0x3E], a[0x3F],
+    a[0x40], a[0x41], a[0x42], a[0x43], a[0x44], a[0x45], a[0x46], a[0x47], a[0x48], a[0x49], a[0x4A], a[0x4B], a[0x4C], a[0x4D], a[0x4E], a[0x4F],
+    a[0x50], a[0x51], a[0x52], a[0x53], a[0x54], a[0x55], a[0x56], a[0x57], a[0x58], a[0x59], a[0x5A], a[0x5B], a[0x5C], a[0x5D], a[0x5E], a[0x5F],
+    a[0x60], a[0x61], a[0x62], a[0x63], a[0x64], a[0x65], a[0x66], a[0x67], a[0x68], a[0x69], a[0x6A], a[0x6B], a[0x6C], a[0x6D], a[0x6E], a[0x6F],
+    a[0x70], a[0x71], a[0x72], a[0x73], a[0x74], a[0x75], a[0x76], a[0x77], a[0x78], a[0x79], a[0x7A], a[0x7B], a[0x7C], a[0x7D], a[0x7E], a[0x7F],
+    a[0x80], a[0x81], a[0x82], a[0x83], a[0x84], a[0x85], a[0x86], a[0x87], a[0x88], a[0x89], a[0x8A], a[0x8B], a[0x8C], a[0x8D], a[0x8E], a[0x8F],
+    a[0x90], a[0x91], a[0x92], a[0x93], a[0x94], a[0x95], a[0x96], a[0x97], a[0x98], a[0x99], a[0x9A], a[0x9B], a[0x9C], a[0x9D], a[0x9E], a[0x9F],
+    a[0xA0], a[0xA1], a[0xA2], a[0xA3], a[0xA4], a[0xA5], a[0xA6], a[0xA7], a[0xA8], a[0xA9], a[0xAA], a[0xAB], a[0xAC], a[0xAD], a[0xAE], a[0xAF],
+    a[0xB0], a[0xB1], a[0xB2], a[0xB3], a[0xB4], a[0xB5], a[0xB6], a[0xB7], a[0xB8], a[0xB9], a[0xBA], a[0xBB], a[0xBC], a[0xBD], a[0xBE], a[0xBF],
+    a[0xC0], a[0xC1], a[0xC2], a[0xC3], a[0xC4], a[0xC5], a[0xC6], a[0xC7], a[0xC8], a[0xC9], a[0xCA], a[0xCB], a[0xCC], a[0xCD], a[0xCE], a[0xCF],
+    a[0xD0], a[0xD1], a[0xD2], a[0xD3], a[0xD4], a[0xD5], a[0xD6], a[0xD7], a[0xD8], a[0xD9], a[0xDA], a[0xDB], a[0xDC], a[0xDD], a[0xDE], a[0xDF],
+    a[0xE0], a[0xE1], a[0xE2], a[0xE3], a[0xE4], a[0xE5], a[0xE6], a[0xE7], a[0xE8], a[0xE9], a[0xEA], a[0xEB], a[0xEC], a[0xED], a[0xEE], a[0xEF],
+    a[0xF0], a[0xF1], a[0xF2], a[0xF3], a[0xF4], a[0xF5], a[0xF6], a[0xF7],
+    // </editor-fold>
+    a[0xF8], a[0xF9], a[0xFA], a[0xFB], a[0xFC], a[0xFD]);
+        assertEquals(r0, r);
+    }
+
+    static Object hashArguments_255(
+    // <editor-fold defaultstate="collapsed" desc="Object x00, Object x01, Object x02, Object x03, Object x04, ...">
+    Object x00, Object x01, Object x02, Object x03, Object x04, Object x05, Object x06, Object x07,
+    Object x08, Object x09, Object x0A, Object x0B, Object x0C, Object x0D, Object x0E, Object x0F,
+    Object x10, Object x11, Object x12, Object x13, Object x14, Object x15, Object x16, Object x17,
+    Object x18, Object x19, Object x1A, Object x1B, Object x1C, Object x1D, Object x1E, Object x1F,
+    Object x20, Object x21, Object x22, Object x23, Object x24, Object x25, Object x26, Object x27,
+    Object x28, Object x29, Object x2A, Object x2B, Object x2C, Object x2D, Object x2E, Object x2F,
+    Object x30, Object x31, Object x32, Object x33, Object x34, Object x35, Object x36, Object x37,
+    Object x38, Object x39, Object x3A, Object x3B, Object x3C, Object x3D, Object x3E, Object x3F,
+    Object x40, Object x41, Object x42, Object x43, Object x44, Object x45, Object x46, Object x47,
+    Object x48, Object x49, Object x4A, Object x4B, Object x4C, Object x4D, Object x4E, Object x4F,
+    Object x50, Object x51, Object x52, Object x53, Object x54, Object x55, Object x56, Object x57,
+    Object x58, Object x59, Object x5A, Object x5B, Object x5C, Object x5D, Object x5E, Object x5F,
+    Object x60, Object x61, Object x62, Object x63, Object x64, Object x65, Object x66, Object x67,
+    Object x68, Object x69, Object x6A, Object x6B, Object x6C, Object x6D, Object x6E, Object x6F,
+    Object x70, Object x71, Object x72, Object x73, Object x74, Object x75, Object x76, Object x77,
+    Object x78, Object x79, Object x7A, Object x7B, Object x7C, Object x7D, Object x7E, Object x7F,
+    Object x80, Object x81, Object x82, Object x83, Object x84, Object x85, Object x86, Object x87,
+    Object x88, Object x89, Object x8A, Object x8B, Object x8C, Object x8D, Object x8E, Object x8F,
+    Object x90, Object x91, Object x92, Object x93, Object x94, Object x95, Object x96, Object x97,
+    Object x98, Object x99, Object x9A, Object x9B, Object x9C, Object x9D, Object x9E, Object x9F,
+    Object xA0, Object xA1, Object xA2, Object xA3, Object xA4, Object xA5, Object xA6, Object xA7,
+    Object xA8, Object xA9, Object xAA, Object xAB, Object xAC, Object xAD, Object xAE, Object xAF,
+    Object xB0, Object xB1, Object xB2, Object xB3, Object xB4, Object xB5, Object xB6, Object xB7,
+    Object xB8, Object xB9, Object xBA, Object xBB, Object xBC, Object xBD, Object xBE, Object xBF,
+    Object xC0, Object xC1, Object xC2, Object xC3, Object xC4, Object xC5, Object xC6, Object xC7,
+    Object xC8, Object xC9, Object xCA, Object xCB, Object xCC, Object xCD, Object xCE, Object xCF,
+    Object xD0, Object xD1, Object xD2, Object xD3, Object xD4, Object xD5, Object xD6, Object xD7,
+    Object xD8, Object xD9, Object xDA, Object xDB, Object xDC, Object xDD, Object xDE, Object xDF,
+    Object xE0, Object xE1, Object xE2, Object xE3, Object xE4, Object xE5, Object xE6, Object xE7,
+    Object xE8, Object xE9, Object xEA, Object xEB, Object xEC, Object xED, Object xEE, Object xEF,
+    Object xF0, Object xF1, Object xF2, Object xF3, Object xF4, Object xF5, Object xF6, Object xF7,
+    // </editor-fold>
+    Object xF8, Object xF9, Object xFA, Object xFB, Object xFC, Object xFD, Object xFE) {
+        return Objects.hash(
+    // <editor-fold defaultstate="collapsed" desc="x00, x01, x02, x03, x04, ...">
+    x00, x01, x02, x03, x04, x05, x06, x07, x08, x09, x0A, x0B, x0C, x0D, x0E, x0F,
+    x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x1A, x1B, x1C, x1D, x1E, x1F,
+    x20, x21, x22, x23, x24, x25, x26, x27, x28, x29, x2A, x2B, x2C, x2D, x2E, x2F,
+    x30, x31, x32, x33, x34, x35, x36, x37, x38, x39, x3A, x3B, x3C, x3D, x3E, x3F,
+    x40, x41, x42, x43, x44, x45, x46, x47, x48, x49, x4A, x4B, x4C, x4D, x4E, x4F,
+    x50, x51, x52, x53, x54, x55, x56, x57, x58, x59, x5A, x5B, x5C, x5D, x5E, x5F,
+    x60, x61, x62, x63, x64, x65, x66, x67, x68, x69, x6A, x6B, x6C, x6D, x6E, x6F,
+    x70, x71, x72, x73, x74, x75, x76, x77, x78, x79, x7A, x7B, x7C, x7D, x7E, x7F,
+    x80, x81, x82, x83, x84, x85, x86, x87, x88, x89, x8A, x8B, x8C, x8D, x8E, x8F,
+    x90, x91, x92, x93, x94, x95, x96, x97, x98, x99, x9A, x9B, x9C, x9D, x9E, x9F,
+    xA0, xA1, xA2, xA3, xA4, xA5, xA6, xA7, xA8, xA9, xAA, xAB, xAC, xAD, xAE, xAF,
+    xB0, xB1, xB2, xB3, xB4, xB5, xB6, xB7, xB8, xB9, xBA, xBB, xBC, xBD, xBE, xBF,
+    xC0, xC1, xC2, xC3, xC4, xC5, xC6, xC7, xC8, xC9, xCA, xCB, xCC, xCD, xCE, xCF,
+    xD0, xD1, xD2, xD3, xD4, xD5, xD6, xD7, xD8, xD9, xDA, xDB, xDC, xDD, xDE, xDF,
+    xE0, xE1, xE2, xE3, xE4, xE5, xE6, xE7, xE8, xE9, xEA, xEB, xEC, xED, xEE, xEF,
+    xF0, xF1, xF2, xF3, xF4, xF5, xF6, xF7,
+    // </editor-fold>
+    xF8, xF9, xFA, xFB, xFC, xFD, xFE);
+    }
+
+    @Test
+    public void test255() throws Throwable {
+        final int ARITY = 255;
+        System.out.println("test"+ARITY);
+        Object[] a = testArgs(ARITY);
+        Object r0 = hashArguments(a);
+        Object r;
+        r = hashArguments_255(
+    // <editor-fold defaultstate="collapsed" desc="a[0x00], a[0x01], a[0x02], a[0x03], a[0x04], ...">
+    a[0x00], a[0x01], a[0x02], a[0x03], a[0x04], a[0x05], a[0x06], a[0x07], a[0x08], a[0x09], a[0x0A], a[0x0B], a[0x0C], a[0x0D], a[0x0E], a[0x0F],
+    a[0x10], a[0x11], a[0x12], a[0x13], a[0x14], a[0x15], a[0x16], a[0x17], a[0x18], a[0x19], a[0x1A], a[0x1B], a[0x1C], a[0x1D], a[0x1E], a[0x1F],
+    a[0x20], a[0x21], a[0x22], a[0x23], a[0x24], a[0x25], a[0x26], a[0x27], a[0x28], a[0x29], a[0x2A], a[0x2B], a[0x2C], a[0x2D], a[0x2E], a[0x2F],
+    a[0x30], a[0x31], a[0x32], a[0x33], a[0x34], a[0x35], a[0x36], a[0x37], a[0x38], a[0x39], a[0x3A], a[0x3B], a[0x3C], a[0x3D], a[0x3E], a[0x3F],
+    a[0x40], a[0x41], a[0x42], a[0x43], a[0x44], a[0x45], a[0x46], a[0x47], a[0x48], a[0x49], a[0x4A], a[0x4B], a[0x4C], a[0x4D], a[0x4E], a[0x4F],
+    a[0x50], a[0x51], a[0x52], a[0x53], a[0x54], a[0x55], a[0x56], a[0x57], a[0x58], a[0x59], a[0x5A], a[0x5B], a[0x5C], a[0x5D], a[0x5E], a[0x5F],
+    a[0x60], a[0x61], a[0x62], a[0x63], a[0x64], a[0x65], a[0x66], a[0x67], a[0x68], a[0x69], a[0x6A], a[0x6B], a[0x6C], a[0x6D], a[0x6E], a[0x6F],
+    a[0x70], a[0x71], a[0x72], a[0x73], a[0x74], a[0x75], a[0x76], a[0x77], a[0x78], a[0x79], a[0x7A], a[0x7B], a[0x7C], a[0x7D], a[0x7E], a[0x7F],
+    a[0x80], a[0x81], a[0x82], a[0x83], a[0x84], a[0x85], a[0x86], a[0x87], a[0x88], a[0x89], a[0x8A], a[0x8B], a[0x8C], a[0x8D], a[0x8E], a[0x8F],
+    a[0x90], a[0x91], a[0x92], a[0x93], a[0x94], a[0x95], a[0x96], a[0x97], a[0x98], a[0x99], a[0x9A], a[0x9B], a[0x9C], a[0x9D], a[0x9E], a[0x9F],
+    a[0xA0], a[0xA1], a[0xA2], a[0xA3], a[0xA4], a[0xA5], a[0xA6], a[0xA7], a[0xA8], a[0xA9], a[0xAA], a[0xAB], a[0xAC], a[0xAD], a[0xAE], a[0xAF],
+    a[0xB0], a[0xB1], a[0xB2], a[0xB3], a[0xB4], a[0xB5], a[0xB6], a[0xB7], a[0xB8], a[0xB9], a[0xBA], a[0xBB], a[0xBC], a[0xBD], a[0xBE], a[0xBF],
+    a[0xC0], a[0xC1], a[0xC2], a[0xC3], a[0xC4], a[0xC5], a[0xC6], a[0xC7], a[0xC8], a[0xC9], a[0xCA], a[0xCB], a[0xCC], a[0xCD], a[0xCE], a[0xCF],
+    a[0xD0], a[0xD1], a[0xD2], a[0xD3], a[0xD4], a[0xD5], a[0xD6], a[0xD7], a[0xD8], a[0xD9], a[0xDA], a[0xDB], a[0xDC], a[0xDD], a[0xDE], a[0xDF],
+    a[0xE0], a[0xE1], a[0xE2], a[0xE3], a[0xE4], a[0xE5], a[0xE6], a[0xE7], a[0xE8], a[0xE9], a[0xEA], a[0xEB], a[0xEC], a[0xED], a[0xEE], a[0xEF],
+    a[0xF0], a[0xF1], a[0xF2], a[0xF3], a[0xF4], a[0xF5], a[0xF6], a[0xF7],
+    // </editor-fold>
+    a[0xF8], a[0xF9], a[0xFA], a[0xFB], a[0xFC], a[0xFD], a[0xFE]);
+        assertEquals(r0, r);
+        MethodType mt = MethodType.genericMethodType(ARITY);
+        MethodHandle mh;
+        try {
+            mh = MethodHandles.lookup().findStatic(BigArityTest.class, "hashArguments_"+ARITY, mt);
+            throw new AssertionError("should not create an arity 255 method handle");
+        } catch (IllegalArgumentException ex) {
+            System.out.println("OK: "+ex);
+            mh = MethodHandles.lookup().findStatic(BigArityTest.class, "hashArguments_"+(ARITY-1), mt.dropParameterTypes(ARITY-1, ARITY));
+        }
+        try {
+            r = mh.invokeExact(
+    // <editor-fold defaultstate="collapsed" desc="a[0x00], a[0x01], a[0x02], a[0x03], a[0x04], ...">
+    a[0x00], a[0x01], a[0x02], a[0x03], a[0x04], a[0x05], a[0x06], a[0x07], a[0x08], a[0x09], a[0x0A], a[0x0B], a[0x0C], a[0x0D], a[0x0E], a[0x0F],
+    a[0x10], a[0x11], a[0x12], a[0x13], a[0x14], a[0x15], a[0x16], a[0x17], a[0x18], a[0x19], a[0x1A], a[0x1B], a[0x1C], a[0x1D], a[0x1E], a[0x1F],
+    a[0x20], a[0x21], a[0x22], a[0x23], a[0x24], a[0x25], a[0x26], a[0x27], a[0x28], a[0x29], a[0x2A], a[0x2B], a[0x2C], a[0x2D], a[0x2E], a[0x2F],
+    a[0x30], a[0x31], a[0x32], a[0x33], a[0x34], a[0x35], a[0x36], a[0x37], a[0x38], a[0x39], a[0x3A], a[0x3B], a[0x3C], a[0x3D], a[0x3E], a[0x3F],
+    a[0x40], a[0x41], a[0x42], a[0x43], a[0x44], a[0x45], a[0x46], a[0x47], a[0x48], a[0x49], a[0x4A], a[0x4B], a[0x4C], a[0x4D], a[0x4E], a[0x4F],
+    a[0x50], a[0x51], a[0x52], a[0x53], a[0x54], a[0x55], a[0x56], a[0x57], a[0x58], a[0x59], a[0x5A], a[0x5B], a[0x5C], a[0x5D], a[0x5E], a[0x5F],
+    a[0x60], a[0x61], a[0x62], a[0x63], a[0x64], a[0x65], a[0x66], a[0x67], a[0x68], a[0x69], a[0x6A], a[0x6B], a[0x6C], a[0x6D], a[0x6E], a[0x6F],
+    a[0x70], a[0x71], a[0x72], a[0x73], a[0x74], a[0x75], a[0x76], a[0x77], a[0x78], a[0x79], a[0x7A], a[0x7B], a[0x7C], a[0x7D], a[0x7E], a[0x7F],
+    a[0x80], a[0x81], a[0x82], a[0x83], a[0x84], a[0x85], a[0x86], a[0x87], a[0x88], a[0x89], a[0x8A], a[0x8B], a[0x8C], a[0x8D], a[0x8E], a[0x8F],
+    a[0x90], a[0x91], a[0x92], a[0x93], a[0x94], a[0x95], a[0x96], a[0x97], a[0x98], a[0x99], a[0x9A], a[0x9B], a[0x9C], a[0x9D], a[0x9E], a[0x9F],
+    a[0xA0], a[0xA1], a[0xA2], a[0xA3], a[0xA4], a[0xA5], a[0xA6], a[0xA7], a[0xA8], a[0xA9], a[0xAA], a[0xAB], a[0xAC], a[0xAD], a[0xAE], a[0xAF],
+    a[0xB0], a[0xB1], a[0xB2], a[0xB3], a[0xB4], a[0xB5], a[0xB6], a[0xB7], a[0xB8], a[0xB9], a[0xBA], a[0xBB], a[0xBC], a[0xBD], a[0xBE], a[0xBF],
+    a[0xC0], a[0xC1], a[0xC2], a[0xC3], a[0xC4], a[0xC5], a[0xC6], a[0xC7], a[0xC8], a[0xC9], a[0xCA], a[0xCB], a[0xCC], a[0xCD], a[0xCE], a[0xCF],
+    a[0xD0], a[0xD1], a[0xD2], a[0xD3], a[0xD4], a[0xD5], a[0xD6], a[0xD7], a[0xD8], a[0xD9], a[0xDA], a[0xDB], a[0xDC], a[0xDD], a[0xDE], a[0xDF],
+    a[0xE0], a[0xE1], a[0xE2], a[0xE3], a[0xE4], a[0xE5], a[0xE6], a[0xE7], a[0xE8], a[0xE9], a[0xEA], a[0xEB], a[0xEC], a[0xED], a[0xEE], a[0xEF],
+    a[0xF0], a[0xF1], a[0xF2], a[0xF3], a[0xF4], a[0xF5], a[0xF6], a[0xF7],
+    // </editor-fold>
+    a[0xF8], a[0xF9], a[0xFA], a[0xFB], a[0xFC], a[0xFD], a[0xFE]);
+            throw new AssertionError("should not call an arity 255 method handle");
+        } catch (LinkageError ex) {
+            System.out.println("OK: "+ex);
+        }
+        try {
+            MethodHandle ximh = MethodHandles.exactInvoker(mt);
+            throw new AssertionError("should have thrown IAE; cannot have 1+1+255 arguments");
+        } catch (IllegalArgumentException ex) {
+            System.out.println("OK: "+ex);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/lang/invoke/CallSiteTest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,164 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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 smoke tests for CallSite
+ *
+ * @build indify.Indify
+ * @compile CallSiteTest.java
+ * @run main/othervm
+ *      indify.Indify
+ *      --expand-properties --classpath ${test.classes}
+ *      --java test.java.lang.invoke.CallSiteTest
+ */
+
+package test.java.lang.invoke;
+
+import java.io.*;
+
+import java.lang.invoke.*;
+import static java.lang.invoke.MethodHandles.*;
+import static java.lang.invoke.MethodType.*;
+
+public class CallSiteTest {
+    private final static Class<?> CLASS = CallSiteTest.class;
+
+    private static CallSite mcs;
+    private static CallSite vcs;
+    private static MethodHandle mh_foo;
+    private static MethodHandle mh_bar;
+
+    static {
+        try {
+            mh_foo = lookup().findStatic(CLASS, "foo", methodType(int.class, int.class, int.class));
+            mh_bar = lookup().findStatic(CLASS, "bar", methodType(int.class, int.class, int.class));
+            mcs = new MutableCallSite(mh_foo);
+            vcs = new VolatileCallSite(mh_foo);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    public static void main(String... av) throws Throwable {
+        testMutableCallSite();
+        testVolatileCallSite();
+    }
+
+    private final static int N = Integer.MAX_VALUE / 100;
+    private final static int RESULT1 = 762786192;
+    private final static int RESULT2 = -21474836;
+
+    private static void assertEquals(int expected, int actual) {
+        if (expected != actual)
+            throw new AssertionError("expected: " + expected + ", actual: " + actual);
+    }
+
+    private static void testMutableCallSite() throws Throwable {
+        // warm-up
+        for (int i = 0; i < 20000; i++) {
+            mcs.setTarget(mh_foo);
+        }
+        // run
+        for (int n = 0; n < 2; n++) {
+            mcs.setTarget(mh_foo);
+            for (int i = 0; i < 5; i++) {
+                assertEquals(RESULT1, runMutableCallSite());
+            }
+            mcs.setTarget(mh_bar);
+            for (int i = 0; i < 5; i++) {
+                assertEquals(RESULT2, runMutableCallSite());
+            }
+        }
+    }
+    private static void testVolatileCallSite() throws Throwable {
+        // warm-up
+        for (int i = 0; i < 20000; i++) {
+            vcs.setTarget(mh_foo);
+        }
+        // run
+        for (int n = 0; n < 2; n++) {
+            vcs.setTarget(mh_foo);
+            for (int i = 0; i < 5; i++) {
+                assertEquals(RESULT1, runVolatileCallSite());
+            }
+            vcs.setTarget(mh_bar);
+            for (int i = 0; i < 5; i++) {
+                assertEquals(RESULT2, runVolatileCallSite());
+            }
+        }
+    }
+
+    private static int runMutableCallSite() throws Throwable {
+        int sum = 0;
+        for (int i = 0; i < N; i++) {
+            sum += (int) INDY_mcs().invokeExact(i, i+1);
+        }
+        return sum;
+    }
+    private static int runVolatileCallSite() throws Throwable {
+        int sum = 0;
+        for (int i = 0; i < N; i++) {
+            sum += (int) INDY_vcs().invokeExact(i, i+1);
+        }
+        return sum;
+    }
+
+    static int foo(int a, int b) { return a + b; }
+    static int bar(int a, int b) { return a - b; }
+
+    private static MethodType MT_bsm() {
+        shouldNotCallThis();
+        return methodType(CallSite.class, Lookup.class, String.class, MethodType.class);
+    }
+
+    private static CallSite bsm_mcs(Lookup caller, String name, MethodType type) throws ReflectiveOperationException {
+        return mcs;
+    }
+    private static MethodHandle MH_bsm_mcs() throws ReflectiveOperationException {
+        shouldNotCallThis();
+        return lookup().findStatic(lookup().lookupClass(), "bsm_mcs", MT_bsm());
+    }
+    private static MethodHandle INDY_mcs() throws Throwable {
+        shouldNotCallThis();
+        return ((CallSite) MH_bsm_mcs().invoke(lookup(), "foo", methodType(int.class, int.class, int.class))).dynamicInvoker();
+    }
+
+    private static CallSite bsm_vcs(Lookup caller, String name, MethodType type) throws ReflectiveOperationException {
+        return vcs;
+    }
+    private static MethodHandle MH_bsm_vcs() throws ReflectiveOperationException {
+        shouldNotCallThis();
+        return lookup().findStatic(lookup().lookupClass(), "bsm_vcs", MT_bsm());
+    }
+    private static MethodHandle INDY_vcs() throws Throwable {
+        shouldNotCallThis();
+        return ((CallSite) MH_bsm_vcs().invoke(lookup(), "foo", methodType(int.class, int.class, int.class))).dynamicInvoker();
+    }
+
+    private static void shouldNotCallThis() {
+        // if this gets called, the transformation has not taken place
+        throw new AssertionError("this code should be statically transformed away by Indify");
+    }
+}
--- a/test/java/lang/invoke/ClassValueTest.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/lang/invoke/ClassValueTest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -38,10 +38,6 @@
 
 package test.java.lang.invoke;
 
-import java.util.*;
-
-import java.lang.invoke.*;
-
 import org.junit.*;
 import static org.junit.Assert.*;
 
--- a/test/java/lang/invoke/InvokeGenericTest.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/lang/invoke/InvokeGenericTest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -45,6 +45,7 @@
  *
  * @author jrose
  */
+@SuppressWarnings("cast")  // various casts help emphasize arguments to invokeExact
 public class InvokeGenericTest {
     // How much output?
     static int verbosity = 0;
@@ -67,24 +68,6 @@
     public InvokeGenericTest() {
     }
 
-    @Before
-    public void checkImplementedPlatform() {
-        boolean platformOK = false;
-        Properties properties = System.getProperties();
-        String vers = properties.getProperty("java.vm.version");
-        String name = properties.getProperty("java.vm.name");
-        String arch = properties.getProperty("os.arch");
-        if ((arch.equals("amd64") || arch.equals("i386") || arch.equals("x86") ||
-             arch.equals("x86_64") || arch.equals("sparc") || arch.equals("sparcv9")) &&
-            (name.contains("Client") || name.contains("Server"))
-            ) {
-            platformOK = true;
-        } else {
-            System.err.println("Skipping tests for unsupported platform: "+Arrays.asList(vers, name, arch));
-        }
-        assumeTrue(platformOK);
-    }
-
     String testName;
     static int allPosTests, allNegTests;
     int posTests, negTests;
@@ -129,7 +112,7 @@
         }
     }
 
-    static List<Object> calledLog = new ArrayList<Object>();
+    static List<Object> calledLog = new ArrayList<>();
     static Object logEntry(String name, Object... args) {
         return Arrays.asList(name, Arrays.asList(args));
     }
@@ -237,8 +220,7 @@
         else
             try {
                 return param.newInstance();
-            } catch (InstantiationException ex) {
-            } catch (IllegalAccessException ex) {
+            } catch (InstantiationException | IllegalAccessException ex) {
             }
         return null;  // random class not Object, String, Integer, etc.
     }
@@ -274,9 +256,11 @@
         return zeroArgs(params.toArray(new Class<?>[0]));
     }
 
+    @SafeVarargs @SuppressWarnings("varargs")
     static <T, E extends T> T[] array(Class<T[]> atype, E... a) {
         return Arrays.copyOf(a, a.length, atype);
     }
+    @SafeVarargs @SuppressWarnings("varargs")
     static <T> T[] cat(T[] a, T... b) {
         int alen = a.length, blen = b.length;
         if (blen == 0)  return a;
@@ -311,7 +295,7 @@
             int beg, int end, Class<?> argType) {
         MethodType targetType = target.type();
         end = Math.min(end, targetType.parameterCount());
-        ArrayList<Class<?>> argTypes = new ArrayList<Class<?>>(targetType.parameterList());
+        ArrayList<Class<?>> argTypes = new ArrayList<>(targetType.parameterList());
         Collections.fill(argTypes.subList(beg, end), argType);
         MethodType ttype2 = MethodType.methodType(targetType.returnType(), argTypes);
         return target.asType(ttype2);
@@ -320,7 +304,7 @@
     // This lookup is good for all members in and under InvokeGenericTest.
     static final Lookup LOOKUP = MethodHandles.lookup();
 
-    Map<List<Class<?>>, MethodHandle> CALLABLES = new HashMap<List<Class<?>>, MethodHandle>();
+    Map<List<Class<?>>, MethodHandle> CALLABLES = new HashMap<>();
     MethodHandle callable(List<Class<?>> params) {
         MethodHandle mh = CALLABLES.get(params);
         if (mh == null) {
@@ -353,8 +337,8 @@
         countTest();
         String[] args = { "one", "two" };
         MethodHandle mh = callable(Object.class, String.class);
-        Object res; List resl;
-        res = resl = (List) mh.invoke((String)args[0], (Object)args[1]);
+        Object res; List<?> resl;
+        res = resl = (List<?>) mh.invoke((String)args[0], (Object)args[1]);
         //System.out.println(res);
         assertEquals(Arrays.asList(args), res);
     }
@@ -365,8 +349,8 @@
         countTest();
         int[] args = { 1, 2 };
         MethodHandle mh = callable(Object.class, Object.class);
-        Object res; List resl;
-        res = resl = (List) mh.invoke(args[0], args[1]);
+        Object res; List<?> resl;
+        res = resl = (List<?>) mh.invoke(args[0], args[1]);
         //System.out.println(res);
         assertEquals(Arrays.toString(args), res.toString());
     }
@@ -377,8 +361,8 @@
         countTest();
         String[] args = { "one", "two" };
         MethodHandle mh = callable(Object.class, String.class);
-        Object res; List resl;
-        res = resl = (List) mh.invoke((String)args[0], (Object)args[1]);
+        Object res; List<?> resl;
+        res = resl = (List<?>) mh.invoke((String)args[0], (Object)args[1]);
         //System.out.println(res);
         assertEquals(Arrays.asList(args), res);
     }
@@ -440,9 +424,9 @@
      *  A void return type is possible iff the first type is void.class.
      */
     static List<MethodType> allMethodTypes(int minargc, int maxargc, Class<?>... types) {
-        ArrayList<MethodType> result = new ArrayList<MethodType>();
+        ArrayList<MethodType> result = new ArrayList<>();
         if (types.length > 0) {
-            ArrayList<MethodType> argcTypes = new ArrayList<MethodType>();
+            ArrayList<MethodType> argcTypes = new ArrayList<>();
             // build arity-zero types first
             for (Class<?> rtype : types) {
                 argcTypes.add(MethodType.methodType(rtype));
@@ -456,7 +440,7 @@
                 if (argc >= maxargc)
                     break;
                 ArrayList<MethodType> prevTypes = argcTypes;
-                argcTypes = new ArrayList<MethodType>();
+                argcTypes = new ArrayList<>();
                 for (MethodType prevType : prevTypes) {
                     for (Class<?> ptype : types) {
                         argcTypes.add(prevType.insertParameterTypes(argc, ptype));
@@ -524,8 +508,8 @@
         countTest();
         Object[] args = { 1, 2 };
         MethodHandle mh = callable(Object.class, int.class);
-        Object res; List resl; int resi;
-        res = resl = (List) mh.invoke((int)args[0], (Object)args[1]);
+        Object res; List<?> resl; int resi;
+        res = resl = (List<?>) mh.invoke((int)args[0], (Object)args[1]);
         //System.out.println(res);
         assertEquals(Arrays.asList(args), res);
         mh = MethodHandles.identity(int.class);
--- a/test/java/lang/invoke/JavaDocExamplesTest.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/lang/invoke/JavaDocExamplesTest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -69,6 +69,7 @@
         testDropArguments();
         testFilterArguments();
         testFoldArguments();
+        testFoldArguments2();
         testMethodHandlesSummary();
         testAsSpreader();
         testAsCollector();
@@ -335,6 +336,7 @@
             }}
     }
 
+    @SuppressWarnings("rawtypes")
     @Test public void testAsVarargsCollector() throws Throwable {
         {{
 {} /// JAVADOC
@@ -490,6 +492,47 @@
             }}
     }
 
+    @Test public void testFoldArguments2() throws Throwable {
+        {{
+{} /// JAVADOC
+// argument-based dispatch for methods of the form boolean x.___(y: String)
+Lookup lookup = publicLookup();
+// first, a tracing hack:
+MethodHandle println = lookup.findVirtual(java.io.PrintStream.class, "println", methodType(void.class, String.class));
+MethodHandle arrayToString = lookup.findStatic(Arrays.class, "toString", methodType(String.class, Object[].class));
+MethodHandle concat = lookup.findVirtual(String.class, "concat", methodType(String.class, String.class));
+MethodHandle arrayToString_DIS = filterReturnValue(arrayToString, concat.bindTo("DIS:"));
+MethodHandle arrayToString_INV = filterReturnValue(arrayToString, concat.bindTo("INV:"));
+MethodHandle printArgs_DIS = filterReturnValue(arrayToString_DIS, println.bindTo(System.out)).asVarargsCollector(Object[].class);
+MethodHandle printArgs_INV = filterReturnValue(arrayToString_INV, println.bindTo(System.out)).asVarargsCollector(Object[].class);
+// metaobject protocol:
+MethodType mtype = methodType(boolean.class, String.class);
+MethodHandle findVirtual = lookup.findVirtual(Lookup.class,
+  "findVirtual", methodType(MethodHandle.class, Class.class, String.class, MethodType.class));
+MethodHandle getClass = lookup.findVirtual(Object.class,
+  "getClass", methodType(Class.class));
+MethodHandle dispatch = findVirtual;
+dispatch = filterArguments(dispatch, 1, getClass);
+dispatch = insertArguments(dispatch, 3, mtype);
+dispatch = dispatch.bindTo(lookup);
+assertEquals(methodType(MethodHandle.class, Object.class, String.class), dispatch.type());
+MethodHandle invoker = invoker(mtype.insertParameterTypes(0, Object.class));
+// wrap tracing around the dispatch and invoke steps:
+dispatch = foldArguments(dispatch, printArgs_DIS.asType(dispatch.type().changeReturnType(void.class)));
+invoker = foldArguments(invoker, printArgs_INV.asType(invoker.type().changeReturnType(void.class)));
+invoker = dropArguments(invoker, 2, String.class);  // ignore selector
+// compose the dispatcher and the invoker:
+MethodHandle invokeDispatched = foldArguments(invoker, dispatch);
+Object x = "football", y = new java.util.Scanner("bar");
+assert( (boolean) invokeDispatched.invokeExact(x, "startsWith", "foo"));
+assert(!(boolean) invokeDispatched.invokeExact(x, "startsWith", "#"));
+assert( (boolean) invokeDispatched.invokeExact(x, "endsWith", "all"));
+assert(!(boolean) invokeDispatched.invokeExact(x, "endsWith", "foo"));
+assert( (boolean) invokeDispatched.invokeExact(y, "hasNext", "[abc]+[rst]"));
+assert(!(boolean) invokeDispatched.invokeExact(y, "hasNext", "[123]+[789]"));
+            }}
+    }
+
     /* ---- TEMPLATE ----
     @Test public void testFoo() throws Throwable {
         {{
--- a/test/java/lang/invoke/MethodHandlesTest.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/lang/invoke/MethodHandlesTest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -25,19 +25,19 @@
 
 /* @test
  * @summary unit tests for java.lang.invoke.MethodHandles
- * @compile -source 7 -target 7 MethodHandlesTest.java
+ * @compile MethodHandlesTest.java remote/RemoteExample.java
  * @run junit/othervm test.java.lang.invoke.MethodHandlesTest
  */
 
 package test.java.lang.invoke;
 
+import test.java.lang.invoke.remote.RemoteExample;
 import java.lang.invoke.*;
 import java.lang.invoke.MethodHandles.Lookup;
 import java.lang.reflect.*;
 import java.util.*;
 import org.junit.*;
 import static org.junit.Assert.*;
-import static org.junit.Assume.*;
 
 
 /**
@@ -45,22 +45,30 @@
  * @author jrose
  */
 public class MethodHandlesTest {
+    static final Class<?> THIS_CLASS = MethodHandlesTest.class;
     // How much output?
     static int verbosity = 0;
     static {
-        String vstr = System.getProperty("test.java.lang.invoke.MethodHandlesTest.verbosity");
+        String vstr = System.getProperty(THIS_CLASS.getSimpleName()+".verbosity");
+        if (vstr == null)
+            vstr = System.getProperty(THIS_CLASS.getName()+".verbosity");
         if (vstr != null)  verbosity = Integer.parseInt(vstr);
     }
 
     // Set this true during development if you want to fast-forward to
     // a particular new, non-working test.  Tests which are known to
     // work (or have recently worked) test this flag and return on true.
-    static boolean CAN_SKIP_WORKING = false;
-    //static { CAN_SKIP_WORKING = true; }
+    static final boolean CAN_SKIP_WORKING;
+    static {
+        String vstr = System.getProperty(THIS_CLASS.getSimpleName()+".CAN_SKIP_WORKING");
+        if (vstr == null)
+            vstr = System.getProperty(THIS_CLASS.getName()+".CAN_SKIP_WORKING");
+        CAN_SKIP_WORKING = Boolean.parseBoolean(vstr);
+    }
 
-    // Set true to test more calls.  If false, some tests are just
-    // lookups, without exercising the actual method handle.
-    static boolean DO_MORE_CALLS = true;
+    // Set 'true' to do about 15x fewer tests, especially those redundant with RicochetTest.
+    // This might be useful with -Xcomp stress tests that compile all method handles.
+    static boolean CAN_TEST_LIGHTLY = Boolean.getBoolean(THIS_CLASS.getName()+".CAN_TEST_LIGHTLY");
 
     @Test
     public void testFirst() throws Throwable {
@@ -69,62 +77,6 @@
         } finally { printCounts(); verbosity -= 9; }
     }
 
-    // current failures
-    @Test @Ignore("failure in call to makeRawRetypeOnly in ToGeneric")
-    public void testFail_1() throws Throwable {
-        // AMH.<init>: IllegalArgumentException: bad adapter (conversion=0xfffab300): adapter pushes too many parameters
-        testSpreadArguments(int.class, 0, 6);
-    }
-    @Test @Ignore("failure in JVM when expanding the stack using asm stub for _adapter_spread_args")
-    public void testFail_2() throws Throwable {
-        // if CONV_OP_IMPLEMENTED_MASK includes OP_SPREAD_ARGS, this crashes:
-        testSpreadArguments(Object.class, 0, 2);
-    }
-    @Test @Ignore("IllArgEx failure in call to ToGeneric.make")
-    public void testFail_3() throws Throwable {
-        // ToGeneric.<init>: UnsupportedOperationException: NYI: primitive parameters must follow references; entryType = (int,java.lang.Object)java.lang.Object
-        testSpreadArguments(int.class, 1, 2);
-    }
-    @Test @Ignore("IllArgEx failure in call to ToGeneric.make")
-    public void testFail_4() throws Throwable {
-        // ToGeneric.<init>: UnsupportedOperationException: NYI: primitive parameters must follow references; entryType = (int,java.lang.Object)java.lang.Object
-        testCollectArguments(int.class, 1, 2);
-    }
-    @Test @Ignore("cannot collect leading primitive types")
-    public void testFail_5() throws Throwable {
-        // ToGeneric.<init>: UnsupportedOperationException: NYI: primitive parameters must follow references; entryType = (int,java.lang.Object)java.lang.Object
-        testInvokers(MethodType.genericMethodType(2).changeParameterType(0, int.class));
-    }
-    @Test @Ignore("should not insert arguments beyond MethodHandlePushLimit")
-    public void testFail_6() throws Throwable {
-        // ValueConversions.varargsArray: UnsupportedOperationException: NYI: cannot form a varargs array of length 13
-        testInsertArguments(0, 0, MAX_ARG_INCREASE+10);
-    }
-    @Test @Ignore("permuteArguments has trouble with double slots")
-    public void testFail_7() throws Throwable {
-        testPermuteArguments(new Object[]{10, 200L},
-                             new Class<?>[]{Integer.class, long.class},
-                             new int[]{1,0});
-        testPermuteArguments(new Object[]{10, 200L, 5000L},
-                             new Class<?>[]{Integer.class, long.class, long.class},
-                             new int[]{2,0,1}); //rot
-        testPermuteArguments(new Object[]{10, 200L, 5000L},
-                             new Class<?>[]{Integer.class, long.class, long.class},
-                             new int[]{1,2,0}); //rot
-        testPermuteArguments(new Object[]{10, 200L, 5000L},
-                             new Class<?>[]{Integer.class, long.class, long.class},
-                             new int[]{2,1,0}); //swap
-        testPermuteArguments(new Object[]{10, 200L, 5000L},
-                             new Class<?>[]{Integer.class, long.class, long.class},
-                             new int[]{0,1,2,2}); //dup
-        testPermuteArguments(new Object[]{10, 200L, 5000L},
-                             new Class<?>[]{Integer.class, long.class, long.class},
-                             new int[]{2,0,1,2});
-        testPermuteArguments(new Object[]{10, 200L, 5000L},
-                             new Class<?>[]{Integer.class, long.class, long.class},
-                             new int[]{2,2,0,1});
-        testPermuteArguments(4, Integer.class,  2, long.class,    6);
-    }
     static final int MAX_ARG_INCREASE = 3;
 
     public MethodHandlesTest() {
@@ -167,18 +119,18 @@
     @AfterClass
     public static void tearDownClass() throws Exception {
         int posTests = allPosTests, negTests = allNegTests;
-        if (verbosity >= 2 && (posTests | negTests) != 0) {
+        if (verbosity >= 0 && (posTests | negTests) != 0) {
             System.out.println();
             if (posTests != 0)  System.out.println("=== "+posTests+" total positive test cases");
             if (negTests != 0)  System.out.println("=== "+negTests+" total negative test cases");
         }
     }
 
-    static List<Object> calledLog = new ArrayList<Object>();
+    static List<Object> calledLog = new ArrayList<>();
     static Object logEntry(String name, Object... args) {
         return Arrays.asList(name, Arrays.asList(args));
     }
-    static Object called(String name, Object... args) {
+    public static Object called(String name, Object... args) {
         Object entry = logEntry(name, args);
         calledLog.add(entry);
         return entry;
@@ -209,6 +161,7 @@
         return dst.cast(value);
     }
 
+    @SuppressWarnings("cast")  // primitive cast to (long) is part of the pattern
     static Object castToWrapperOrNull(long value, Class<?> dst) {
         if (dst == int.class || dst == Integer.class)
             return (int)(value);
@@ -277,13 +230,14 @@
                     { param = c; break; }
             }
         }
+        if (param.isInterface() && param.isAssignableFrom(List.class))
+            return Arrays.asList("#"+nextArg());
         if (param.isInterface() || param.isAssignableFrom(String.class))
             return "#"+nextArg();
         else
             try {
                 return param.newInstance();
-            } catch (InstantiationException ex) {
-            } catch (IllegalAccessException ex) {
+            } catch (InstantiationException | IllegalAccessException ex) {
             }
         return null;  // random class not Object, String, Integer, etc.
     }
@@ -300,9 +254,11 @@
         return args;
     }
 
+    @SafeVarargs @SuppressWarnings("varargs")
     static <T, E extends T> T[] array(Class<T[]> atype, E... a) {
         return Arrays.copyOf(a, a.length, atype);
     }
+    @SafeVarargs @SuppressWarnings("varargs")
     static <T> T[] cat(T[] a, T... b) {
         int alen = a.length, blen = b.length;
         if (blen == 0)  return a;
@@ -352,14 +308,14 @@
                 try {
                     LIST_TO_STRING = PRIVATE.findStatic(PRIVATE.lookupClass(), "listToString",
                                                         MethodType.methodType(String.class, List.class));
-                } catch (Exception ex) { throw new RuntimeException(ex); }
+                } catch (NoSuchMethodException | IllegalAccessException ex) { throw new RuntimeException(ex); }
             list = MethodHandles.filterReturnValue(list, LIST_TO_STRING);
         } else if (rtype.isPrimitive()) {
             if (LIST_TO_INT == null)
                 try {
                     LIST_TO_INT = PRIVATE.findStatic(PRIVATE.lookupClass(), "listToInt",
                                                      MethodType.methodType(int.class, List.class));
-                } catch (Exception ex) { throw new RuntimeException(ex); }
+                } catch (NoSuchMethodException | IllegalAccessException ex) { throw new RuntimeException(ex); }
             list = MethodHandles.filterReturnValue(list, LIST_TO_INT);
             list = MethodHandles.explicitCastArguments(list, listType);
         } else {
@@ -368,8 +324,8 @@
         return list.asType(listType);
     }
     private static MethodHandle LIST_TO_STRING, LIST_TO_INT;
-    private static String listToString(List x) { return x.toString(); }
-    private static int listToInt(List x) { return x.toString().hashCode(); }
+    private static String listToString(List<?> x) { return x.toString(); }
+    private static int listToInt(List<?> x) { return x.toString().hashCode(); }
 
     static MethodHandle changeArgTypes(MethodHandle target, Class<?> argType) {
         return changeArgTypes(target, 0, 999, argType);
@@ -378,16 +334,25 @@
             int beg, int end, Class<?> argType) {
         MethodType targetType = target.type();
         end = Math.min(end, targetType.parameterCount());
-        ArrayList<Class<?>> argTypes = new ArrayList<Class<?>>(targetType.parameterList());
+        ArrayList<Class<?>> argTypes = new ArrayList<>(targetType.parameterList());
         Collections.fill(argTypes.subList(beg, end), argType);
         MethodType ttype2 = MethodType.methodType(targetType.returnType(), argTypes);
         return target.asType(ttype2);
     }
+    static MethodHandle addTrailingArgs(MethodHandle target, int nargs, Class<?> argClass) {
+        int targetLen = target.type().parameterCount();
+        int extra = (nargs - targetLen);
+        if (extra <= 0)  return target;
+        List<Class<?>> fakeArgs = Collections.<Class<?>>nCopies(extra, argClass);
+        return MethodHandles.dropArguments(target, targetLen, fakeArgs);
+    }
 
     // This lookup is good for all members in and under MethodHandlesTest.
     static final Lookup PRIVATE = MethodHandles.lookup();
     // This lookup is good for package-private members but not private ones.
     static final Lookup PACKAGE = PackageSibling.lookup();
+    // This lookup is good for public members and protected members of PubExample
+    static final Lookup SUBCLASS = RemoteExample.lookup();
     // This lookup is good only for public members.
     static final Lookup PUBLIC  = MethodHandles.publicLookup();
 
@@ -396,13 +361,16 @@
         final String name;
         public Example() { name = "Example#"+nextArg(); }
         protected Example(String name) { this.name = name; }
+        @SuppressWarnings("LeakingThisInConstructor")
         protected Example(int x) { this(); called("protected <init>", this, x); }
         @Override public String toString() { return name; }
 
         public void            v0()     { called("v0", this); }
+        protected void         pro_v0() { called("pro_v0", this); }
         void                   pkg_v0() { called("pkg_v0", this); }
         private void           pri_v0() { called("pri_v0", this); }
         public static void     s0()     { called("s0"); }
+        protected static void  pro_s0() { called("pro_s0"); }
         static void            pkg_s0() { called("pkg_s0"); }
         private static void    pri_s0() { called("pri_s0"); }
 
@@ -419,15 +387,29 @@
         public static Object   s6(int x, long y) { return called("s6", x, y); }
         public static Object   s7(float x, double y) { return called("s7", x, y); }
 
+        // for testing findConstructor:
+        public Example(String x, int y) { this.name = x+y; called("Example.<init>", x, y); }
+        public Example(int x, String y) { this.name = x+y; called("Example.<init>", x, y); }
+        public Example(int x, int    y) { this.name = x+""+y; called("Example.<init>", x, y); }
+        public Example(int x, long   y) { this.name = x+""+y; called("Example.<init>", x, y); }
+        public Example(int x, float  y) { this.name = x+""+y; called("Example.<init>", x, y); }
+        public Example(int x, double y) { this.name = x+""+y; called("Example.<init>", x, y); }
+        public Example(int x, int    y, int z) { this.name = x+""+y+""+z; called("Example.<init>", x, y, z); }
+        public Example(int x, int    y, int z, int a) { this.name = x+""+y+""+z+""+a; called("Example.<init>", x, y, z, a); }
+
         static final Lookup EXAMPLE = MethodHandles.lookup();  // for testing findSpecial
     }
     static final Lookup EXAMPLE = Example.EXAMPLE;
     public static class PubExample extends Example {
-        public PubExample() { super("PubExample#"+nextArg()); }
+        public PubExample() { this("PubExample"); }
+        protected PubExample(String prefix) { super(prefix+"#"+nextArg()); }
+        protected void         pro_v0() { called("Pub/pro_v0", this); }
+        protected static void  pro_s0() { called("Pub/pro_s0"); }
     }
     static class SubExample extends Example {
         @Override public void  v0()     { called("Sub/v0", this); }
         @Override void         pkg_v0() { called("Sub/pkg_v0", this); }
+        @SuppressWarnings("LeakingThisInConstructor")
         private      SubExample(int x)  { called("<init>", this, x); }
         public SubExample() { super("SubExample#"+nextArg()); }
     }
@@ -440,12 +422,14 @@
             @Override public String toString() { return name; }
         }
     }
+    static interface SubIntExample extends IntExample { }
 
     static final Object[][][] ACCESS_CASES = {
-        { { false, PUBLIC }, { false, PACKAGE }, { false, PRIVATE }, { false, EXAMPLE } }, //[0]: all false
-        { { false, PUBLIC }, { false, PACKAGE }, { true,  PRIVATE }, { true,  EXAMPLE } }, //[1]: only PRIVATE
-        { { false, PUBLIC }, { true,  PACKAGE }, { true,  PRIVATE }, { true,  EXAMPLE } }, //[2]: PUBLIC false
-        { { true,  PUBLIC }, { true,  PACKAGE }, { true,  PRIVATE }, { true,  EXAMPLE } }, //[3]: all true
+        { { false, PUBLIC }, { false, SUBCLASS }, { false, PACKAGE }, { false, PRIVATE }, { false, EXAMPLE } }, //[0]: all false
+        { { false, PUBLIC }, { false, SUBCLASS }, { false, PACKAGE }, { true,  PRIVATE }, { true,  EXAMPLE } }, //[1]: only PRIVATE
+        { { false, PUBLIC }, { false, SUBCLASS }, { true,  PACKAGE }, { true,  PRIVATE }, { true,  EXAMPLE } }, //[2]: PUBLIC false
+        { { false, PUBLIC }, { true,  SUBCLASS }, { true,  PACKAGE }, { true,  PRIVATE }, { true,  EXAMPLE } }, //[3]: subclass OK
+        { { true,  PUBLIC }, { true,  SUBCLASS }, { true,  PACKAGE }, { true,  PRIVATE }, { true,  EXAMPLE } }, //[4]: all true
     };
 
     static Object[][] accessCases(Class<?> defc, String name, boolean isSpecial) {
@@ -454,11 +438,13 @@
             cases = ACCESS_CASES[1]; // PRIVATE only
         } else if (name.contains("pkg_") || !Modifier.isPublic(defc.getModifiers())) {
             cases = ACCESS_CASES[2]; // not PUBLIC
+        } else if (name.contains("pro_")) {
+            cases = ACCESS_CASES[3]; // PUBLIC class, protected member
         } else {
-            assertTrue(name.indexOf('_') < 0);
+            assertTrue(name.indexOf('_') < 0 || name.contains("fin_"));
             boolean pubc = Modifier.isPublic(defc.getModifiers());
             if (pubc)
-                cases = ACCESS_CASES[3]; // all access levels
+                cases = ACCESS_CASES[4]; // all access levels
             else
                 cases = ACCESS_CASES[2]; // PACKAGE but not PUBLIC
         }
@@ -470,6 +456,13 @@
         return accessCases(defc, name, false);
     }
 
+    static Lookup maybeMoveIn(Lookup lookup, Class<?> defc) {
+        if (lookup == PUBLIC || lookup == SUBCLASS || lookup == PACKAGE)
+            // external views stay external
+            return lookup;
+        return lookup.in(defc);
+    }
+
     @Test
     public void testFindStatic() throws Throwable {
         if (CAN_SKIP_WORKING)  return;
@@ -478,6 +471,8 @@
         testFindStatic(Example.class, void.class, "s0");
         testFindStatic(Example.class, void.class, "pkg_s0");
         testFindStatic(Example.class, void.class, "pri_s0");
+        testFindStatic(Example.class, void.class, "pro_s0");
+        testFindStatic(PubExample.class, void.class, "Pub/pro_s0");
 
         testFindStatic(Example.class, Object.class, "s1", Object.class);
         testFindStatic(Example.class, Object.class, "s2", int.class);
@@ -488,6 +483,7 @@
         testFindStatic(Example.class, Object.class, "s7", float.class, double.class);
 
         testFindStatic(false, PRIVATE, Example.class, void.class, "bogus");
+        testFindStatic(false, PRIVATE, Example.class, void.class, "v0");
     }
 
     void testFindStatic(Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
@@ -500,14 +496,16 @@
     }
     void testFindStatic(boolean positive, Lookup lookup, Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
         countTest(positive);
+        String methodName = name.substring(1 + name.indexOf('/'));  // foo/bar => foo
         MethodType type = MethodType.methodType(ret, params);
         MethodHandle target = null;
         Exception noAccess = null;
         try {
             if (verbosity >= 4)  System.out.println("lookup via "+lookup+" of "+defc+" "+name+type);
-            target = lookup.in(defc).findStatic(defc, name, type);
+            target = maybeMoveIn(lookup, defc).findStatic(defc, methodName, type);
         } catch (ReflectiveOperationException ex) {
             noAccess = ex;
+            if (verbosity >= 5)  ex.printStackTrace(System.out);
             if (name.contains("bogus"))
                 assertTrue(noAccess instanceof NoSuchMethodException);
             else
@@ -520,8 +518,7 @@
         assertEquals(positive ? "positive test" : "negative test erroneously passed", positive, target != null);
         if (!positive)  return; // negative test failed as expected
         assertEquals(type, target.type());
-        assertNameStringContains(target, name);
-        if (!DO_MORE_CALLS && lookup != PRIVATE)  return;
+        assertNameStringContains(target, methodName);
         Object[] args = randomArgs(params);
         printCalled(target, name, args);
         target.invokeWithArguments(args);
@@ -555,7 +552,12 @@
         testFindVirtual(Example.class, Object.class, "v2", Object.class, int.class);
         testFindVirtual(Example.class, Object.class, "v2", int.class, Object.class);
         testFindVirtual(Example.class, Object.class, "v2", int.class, int.class);
+        testFindVirtual(Example.class, void.class, "pro_v0");
+        testFindVirtual(PubExample.class, void.class, "Pub/pro_v0");
+
         testFindVirtual(false, PRIVATE, Example.class, Example.class, void.class, "bogus");
+        testFindVirtual(false, PRIVATE, Example.class, Example.class, void.class, "s0");
+
         // test dispatch
         testFindVirtual(SubExample.class,      SubExample.class, void.class, "Sub/v0");
         testFindVirtual(SubExample.class,         Example.class, void.class, "Sub/v0");
@@ -586,9 +588,10 @@
         Exception noAccess = null;
         try {
             if (verbosity >= 4)  System.out.println("lookup via "+lookup+" of "+defc+" "+name+type);
-            target = lookup.in(defc).findVirtual(defc, methodName, type);
+            target = maybeMoveIn(lookup, defc).findVirtual(defc, methodName, type);
         } catch (ReflectiveOperationException ex) {
             noAccess = ex;
+            if (verbosity >= 5)  ex.printStackTrace(System.out);
             if (name.contains("bogus"))
                 assertTrue(noAccess instanceof NoSuchMethodException);
             else
@@ -600,13 +603,20 @@
         if (positive && noAccess != null)  throw noAccess;
         assertEquals(positive ? "positive test" : "negative test erroneously passed", positive, target != null);
         if (!positive)  return; // negative test failed as expected
-        Class<?>[] paramsWithSelf = cat(array(Class[].class, (Class)defc), params);
+        Class<?> selfc = defc;
+        // predict receiver type narrowing:
+        if (lookup == SUBCLASS &&
+                name.contains("pro_") &&
+                selfc.isAssignableFrom(lookup.lookupClass())) {
+            selfc = lookup.lookupClass();
+            if (name.startsWith("Pub/"))  name = "Rem/"+name.substring(4);
+        }
+        Class<?>[] paramsWithSelf = cat(array(Class[].class, (Class)selfc), params);
         MethodType typeWithSelf = MethodType.methodType(ret, paramsWithSelf);
         assertEquals(typeWithSelf, target.type());
         assertNameStringContains(target, methodName);
-        if (!DO_MORE_CALLS && lookup != PRIVATE)  return;
         Object[] argsWithSelf = randomArgs(paramsWithSelf);
-        if (rcvc != defc)  argsWithSelf[0] = randomArg(rcvc);
+        if (selfc.isAssignableFrom(rcvc) && rcvc != selfc)  argsWithSelf[0] = randomArg(rcvc);
         printCalled(target, name, argsWithSelf);
         target.invokeWithArguments(argsWithSelf);
         assertCalled(name, argsWithSelf);
@@ -620,6 +630,7 @@
         startTest("findSpecial");
         testFindSpecial(SubExample.class, Example.class, void.class, "v0");
         testFindSpecial(SubExample.class, Example.class, void.class, "pkg_v0");
+        testFindSpecial(RemoteExample.class, PubExample.class, void.class, "Pub/pro_v0");
         // Do some negative testing:
         testFindSpecial(false, EXAMPLE, SubExample.class, Example.class, void.class, "bogus");
         testFindSpecial(false, PRIVATE, SubExample.class, Example.class, void.class, "bogus");
@@ -632,23 +643,34 @@
 
     void testFindSpecial(Class<?> specialCaller,
                          Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
-        testFindSpecial(true,  EXAMPLE, specialCaller, defc, ret, name, params);
-        testFindSpecial(true,  PRIVATE, specialCaller, defc, ret, name, params);
-        testFindSpecial(false, PACKAGE, specialCaller, defc, ret, name, params);
-        testFindSpecial(false, PUBLIC,  specialCaller, defc, ret, name, params);
+        if (specialCaller == RemoteExample.class) {
+            testFindSpecial(false, EXAMPLE,  specialCaller, defc, ret, name, params);
+            testFindSpecial(false, PRIVATE,  specialCaller, defc, ret, name, params);
+            testFindSpecial(false, PACKAGE,  specialCaller, defc, ret, name, params);
+            testFindSpecial(true,  SUBCLASS, specialCaller, defc, ret, name, params);
+            testFindSpecial(false, PUBLIC,   specialCaller, defc, ret, name, params);
+            return;
+        }
+        testFindSpecial(true,  EXAMPLE,  specialCaller, defc, ret, name, params);
+        testFindSpecial(true,  PRIVATE,  specialCaller, defc, ret, name, params);
+        testFindSpecial(false, PACKAGE,  specialCaller, defc, ret, name, params);
+        testFindSpecial(false, SUBCLASS, specialCaller, defc, ret, name, params);
+        testFindSpecial(false, PUBLIC,   specialCaller, defc, ret, name, params);
     }
     void testFindSpecial(boolean positive, Lookup lookup, Class<?> specialCaller,
                          Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
         countTest(positive);
+        String methodName = name.substring(1 + name.indexOf('/'));  // foo/bar => foo
         MethodType type = MethodType.methodType(ret, params);
         MethodHandle target = null;
         Exception noAccess = null;
         try {
             if (verbosity >= 4)  System.out.println("lookup via "+lookup+" of "+defc+" "+name+type);
-            if (verbosity >= 5)  System.out.println("  lookup => "+lookup.in(specialCaller));
-            target = lookup.in(specialCaller).findSpecial(defc, name, type, specialCaller);
+            if (verbosity >= 5)  System.out.println("  lookup => "+maybeMoveIn(lookup, specialCaller));
+            target = maybeMoveIn(lookup, specialCaller).findSpecial(defc, methodName, type, specialCaller);
         } catch (ReflectiveOperationException ex) {
             noAccess = ex;
+            if (verbosity >= 5)  ex.printStackTrace(System.out);
             if (name.contains("bogus"))
                 assertTrue(noAccess instanceof NoSuchMethodException);
             else
@@ -665,8 +687,7 @@
         assertEquals(type,          target.type().dropParameterTypes(0,1));
         Class<?>[] paramsWithSelf = cat(array(Class[].class, (Class)specialCaller), params);
         MethodType typeWithSelf = MethodType.methodType(ret, paramsWithSelf);
-        assertNameStringContains(target, name);
-        if (!DO_MORE_CALLS && lookup != PRIVATE && lookup != EXAMPLE)  return;
+        assertNameStringContains(target, methodName);
         Object[] args = randomArgs(paramsWithSelf);
         printCalled(target, name, args);
         target.invokeWithArguments(args);
@@ -674,6 +695,49 @@
     }
 
     @Test
+    public void testFindConstructor() throws Throwable {
+        if (CAN_SKIP_WORKING)  return;
+        startTest("findConstructor");
+        testFindConstructor(true, EXAMPLE, Example.class);
+        testFindConstructor(true, EXAMPLE, Example.class, int.class);
+        testFindConstructor(true, EXAMPLE, Example.class, int.class, int.class);
+        testFindConstructor(true, EXAMPLE, Example.class, int.class, long.class);
+        testFindConstructor(true, EXAMPLE, Example.class, int.class, float.class);
+        testFindConstructor(true, EXAMPLE, Example.class, int.class, double.class);
+        testFindConstructor(true, EXAMPLE, Example.class, String.class);
+        testFindConstructor(true, EXAMPLE, Example.class, int.class, int.class, int.class);
+        testFindConstructor(true, EXAMPLE, Example.class, int.class, int.class, int.class, int.class);
+    }
+    void testFindConstructor(boolean positive, Lookup lookup,
+                             Class<?> defc, Class<?>... params) throws Throwable {
+        countTest(positive);
+        MethodType type = MethodType.methodType(void.class, params);
+        MethodHandle target = null;
+        Exception noAccess = null;
+        try {
+            if (verbosity >= 4)  System.out.println("lookup via "+lookup+" of "+defc+" <init>"+type);
+            target = lookup.findConstructor(defc, type);
+        } catch (ReflectiveOperationException ex) {
+            noAccess = ex;
+            assertTrue(noAccess instanceof IllegalAccessException);
+        }
+        if (verbosity >= 3)
+            System.out.println("findConstructor "+defc.getName()+".<init>/"+type+" => "+target
+                               +(target == null ? "" : target.type())
+                               +(noAccess == null ? "" : " !! "+noAccess));
+        if (positive && noAccess != null)  throw noAccess;
+        assertEquals(positive ? "positive test" : "negative test erroneously passed", positive, target != null);
+        if (!positive)  return; // negative test failed as expected
+        assertEquals(type.changeReturnType(defc), target.type());
+        Object[] args = randomArgs(params);
+        printCalled(target, defc.getSimpleName(), args);
+        Object obj = target.invokeWithArguments(args);
+        if (!(defc == Example.class && params.length < 2))
+            assertCalled(defc.getSimpleName()+".<init>", args);
+        assertTrue("instance of "+defc.getName(), defc.isInstance(obj));
+    }
+
+    @Test
     public void testBind() throws Throwable {
         if (CAN_SKIP_WORKING)  return;
         startTest("bind");
@@ -706,9 +770,10 @@
         Exception noAccess = null;
         try {
             if (verbosity >= 4)  System.out.println("lookup via "+lookup+" of "+defc+" "+name+type);
-            target = lookup.in(defc).bind(receiver, methodName, type);
+            target = maybeMoveIn(lookup, defc).bind(receiver, methodName, type);
         } catch (ReflectiveOperationException ex) {
             noAccess = ex;
+            if (verbosity >= 5)  ex.printStackTrace(System.out);
             if (name.contains("bogus"))
                 assertTrue(noAccess instanceof NoSuchMethodException);
             else
@@ -735,6 +800,7 @@
         if (CAN_SKIP_WORKING)  return;
         startTest("unreflect");
         testUnreflect(Example.class, true, void.class, "s0");
+        testUnreflect(Example.class, true, void.class, "pro_s0");
         testUnreflect(Example.class, true, void.class, "pkg_s0");
         testUnreflect(Example.class, true, void.class, "pri_s0");
 
@@ -753,6 +819,9 @@
         testUnreflect(Example.class, false, Object.class, "v2", Object.class, int.class);
         testUnreflect(Example.class, false, Object.class, "v2", int.class, Object.class);
         testUnreflect(Example.class, false, Object.class, "v2", int.class, int.class);
+
+        // Test a public final member in another package:
+        testUnreflect(RemoteExample.class, false, void.class, "Rem/fin_v0");
     }
 
     void testUnreflect(Class<?> defc, boolean isStatic, Class<?> ret, String name, Class<?>... params) throws Throwable {
@@ -769,8 +838,9 @@
                                    boolean positive, Lookup lookup,
                                    Class<?> defc, Class<?> rcvc, Class<?> ret, String name, Class<?>... params) throws Throwable {
         countTest(positive);
+        String methodName = name.substring(1 + name.indexOf('/'));  // foo/bar => foo
         MethodType type = MethodType.methodType(ret, params);
-        Method rmethod = defc.getDeclaredMethod(name, params);
+        Method rmethod = defc.getDeclaredMethod(methodName, params);
         MethodHandle target = null;
         Exception noAccess = null;
         boolean isStatic = (rcvc == null);
@@ -778,11 +848,12 @@
         try {
             if (verbosity >= 4)  System.out.println("lookup via "+lookup+" of "+defc+" "+name+type);
             if (isSpecial)
-                target = lookup.in(specialCaller).unreflectSpecial(rmethod, specialCaller);
+                target = maybeMoveIn(lookup, specialCaller).unreflectSpecial(rmethod, specialCaller);
             else
-                target = lookup.in(defc).unreflect(rmethod);
+                target = maybeMoveIn(lookup, defc).unreflect(rmethod);
         } catch (ReflectiveOperationException ex) {
             noAccess = ex;
+            if (verbosity >= 5)  ex.printStackTrace(System.out);
             if (name.contains("bogus"))
                 assertTrue(noAccess instanceof NoSuchMethodException);
             else
@@ -865,7 +936,7 @@
 
         static final Object[][] CASES;
         static {
-            ArrayList<Object[]> cases = new ArrayList<Object[]>();
+            ArrayList<Object[]> cases = new ArrayList<>();
             Object types[][] = {
                 {'L',Object.class}, {'R',String.class},
                 {'I',int.class}, {'J',long.class},
@@ -884,12 +955,12 @@
                     Field field;
                         try {
                         field = HasFields.class.getDeclaredField(name);
-                    } catch (Exception ex) {
+                    } catch (NoSuchFieldException | SecurityException ex) {
                         throw new InternalError("no field HasFields."+name);
                     }
                     try {
                         value = field.get(fields);
-                    } catch (Exception ex) {
+                    } catch (IllegalArgumentException | IllegalAccessException ex) {
                         throw new InternalError("cannot fetch field HasFields."+name);
                     }
                     if (type == float.class) {
@@ -909,7 +980,7 @@
         }
     }
 
-    static final int TEST_UNREFLECT = 1, TEST_FIND_FIELD = 2, TEST_FIND_STATIC = 3, TEST_SETTER = 0x10;
+    static final int TEST_UNREFLECT = 1, TEST_FIND_FIELD = 2, TEST_FIND_STATIC = 3, TEST_SETTER = 0x10, TEST_BOUND = 0x20, TEST_NPE = 0x40;
     static boolean testModeMatches(int testMode, boolean isStatic) {
         switch (testMode) {
         case TEST_FIND_STATIC:          return isStatic;
@@ -921,16 +992,20 @@
 
     @Test
     public void testUnreflectGetter() throws Throwable {
+        if (CAN_SKIP_WORKING)  return;
         startTest("unreflectGetter");
         testGetter(TEST_UNREFLECT);
     }
     @Test
     public void testFindGetter() throws Throwable {
+        if (CAN_SKIP_WORKING)  return;
         startTest("findGetter");
         testGetter(TEST_FIND_FIELD);
+        testGetter(TEST_FIND_FIELD | TEST_BOUND);
     }
     @Test
     public void testFindStaticGetter() throws Throwable {
+        if (CAN_SKIP_WORKING)  return;
         startTest("findStaticGetter");
         testGetter(TEST_FIND_STATIC);
     }
@@ -939,6 +1014,8 @@
         for (Object[] c : HasFields.CASES) {
             boolean positive = (c[1] != Error.class);
             testGetter(positive, lookup, c[0], c[1], testMode);
+            if (positive)
+                testGetter(positive, lookup, c[0], c[1], testMode | TEST_NPE);
         }
         testGetter(true, lookup,
                    new Object[]{ true,  System.class, "out", java.io.PrintStream.class },
@@ -954,10 +1031,15 @@
         testAccessor(positive, lookup, fieldRef, value, testMode);
     }
 
-    public void testAccessor(boolean positive, MethodHandles.Lookup lookup,
+    public void testAccessor(boolean positive0, MethodHandles.Lookup lookup,
                              Object fieldRef, Object value, int testMode0) throws Throwable {
+        if (verbosity >= 4)
+            System.out.println("testAccessor"+Arrays.deepToString(new Object[]{positive0, lookup, fieldRef, value, testMode0}));
         boolean isGetter = ((testMode0 & TEST_SETTER) == 0);
-        int testMode = testMode0 & ~TEST_SETTER;
+        boolean doBound  = ((testMode0 & TEST_BOUND) != 0);
+        boolean testNPE  = ((testMode0 & TEST_NPE) != 0);
+        int testMode = testMode0 & ~(TEST_SETTER | TEST_BOUND | TEST_NPE);
+        boolean positive = positive0 && !testNPE;
         boolean isStatic;
         Class<?> fclass;
         String   fname;
@@ -982,6 +1064,7 @@
         }
         if (!testModeMatches(testMode, isStatic))  return;
         if (f == null && testMode == TEST_UNREFLECT)  return;
+        if (testNPE && isStatic)  return;
         countTest(positive);
         MethodType expType;
         if (isGetter)
@@ -992,7 +1075,7 @@
         Exception noAccess = null;
         MethodHandle mh;
         try {
-            switch (testMode0) {
+            switch (testMode0 & ~(TEST_BOUND | TEST_NPE)) {
             case TEST_UNREFLECT:   mh = lookup.unreflectGetter(f);                      break;
             case TEST_FIND_FIELD:  mh = lookup.findGetter(fclass, fname, ftype);        break;
             case TEST_FIND_STATIC: mh = lookup.findStaticGetter(fclass, fname, ftype);  break;
@@ -1008,6 +1091,7 @@
         } catch (ReflectiveOperationException ex) {
             mh = null;
             noAccess = ex;
+            if (verbosity >= 5)  ex.printStackTrace(System.out);
             if (fname.contains("bogus"))
                 assertTrue(noAccess instanceof NoSuchFieldException);
             else
@@ -1017,15 +1101,19 @@
             System.out.println("find"+(isStatic?"Static":"")+(isGetter?"Getter":"Setter")+" "+fclass.getName()+"."+fname+"/"+ftype
                                +" => "+mh
                                +(noAccess == null ? "" : " !! "+noAccess));
-        if (positive && noAccess != null)  throw new RuntimeException(noAccess);
-        assertEquals(positive ? "positive test" : "negative test erroneously passed", positive, mh != null);
-        if (!positive)  return; // negative test failed as expected
+        if (positive && !testNPE && noAccess != null)  throw new RuntimeException(noAccess);
+        assertEquals(positive0 ? "positive test" : "negative test erroneously passed", positive0, mh != null);
+        if (!positive && !testNPE)  return; // negative access test failed as expected
         assertEquals((isStatic ? 0 : 1)+(isGetter ? 0 : 1), mh.type().parameterCount());
 
 
         assertSame(mh.type(), expType);
-        assertNameStringContains(mh, fname);
+        //assertNameStringContains(mh, fname);  // This does not hold anymore with LFs
         HasFields fields = new HasFields();
+        HasFields fieldsForMH = fields;
+        if (testNPE)  fieldsForMH = null;  // perturb MH argument to elicit expected error
+        if (doBound)
+            mh = mh.bindTo(fieldsForMH);
         Object sawValue;
         Class<?> vtype = ftype;
         if (ftype != int.class)  vtype = Object.class;
@@ -1041,19 +1129,28 @@
         if (f != null && f.getDeclaringClass() == HasFields.class) {
             assertEquals(f.get(fields), value);  // clean to start with
         }
+        Throwable caughtEx = null;
         if (isGetter) {
             Object expValue = value;
             for (int i = 0; i <= 1; i++) {
-                if (isStatic) {
-                    if (ftype == int.class)
-                        sawValue = (int) mh.invokeExact();  // do these exactly
-                    else
-                        sawValue = mh.invokeExact();
-                } else {
-                    if (ftype == int.class)
-                        sawValue = (int) mh.invokeExact((Object) fields);
-                    else
-                        sawValue = mh.invokeExact((Object) fields);
+                sawValue = null;  // make DA rules happy under try/catch
+                try {
+                    if (isStatic || doBound) {
+                        if (ftype == int.class)
+                            sawValue = (int) mh.invokeExact();  // do these exactly
+                        else
+                            sawValue = mh.invokeExact();
+                    } else {
+                        if (ftype == int.class)
+                            sawValue = (int) mh.invokeExact((Object) fieldsForMH);
+                        else
+                            sawValue = mh.invokeExact((Object) fieldsForMH);
+                    }
+                } catch (RuntimeException ex) {
+                    if (ex instanceof NullPointerException && testNPE) {
+                        caughtEx = ex;
+                        break;
+                    }
                 }
                 assertEquals(sawValue, expValue);
                 if (f != null && f.getDeclaringClass() == HasFields.class
@@ -1068,16 +1165,23 @@
         } else {
             for (int i = 0; i <= 1; i++) {
                 Object putValue = randomArg(ftype);
-                if (isStatic) {
-                    if (ftype == int.class)
-                        mh.invokeExact((int)putValue);  // do these exactly
-                    else
-                        mh.invokeExact(putValue);
-                } else {
-                    if (ftype == int.class)
-                        mh.invokeExact((Object) fields, (int)putValue);
-                    else
-                        mh.invokeExact((Object) fields, putValue);
+                try {
+                    if (isStatic || doBound) {
+                        if (ftype == int.class)
+                            mh.invokeExact((int)putValue);  // do these exactly
+                        else
+                            mh.invokeExact(putValue);
+                    } else {
+                        if (ftype == int.class)
+                            mh.invokeExact((Object) fieldsForMH, (int)putValue);
+                        else
+                            mh.invokeExact((Object) fieldsForMH, putValue);
+                    }
+                } catch (RuntimeException ex) {
+                    if (ex instanceof NullPointerException && testNPE) {
+                        caughtEx = ex;
+                        break;
+                    }
                 }
                 if (f != null && f.getDeclaringClass() == HasFields.class) {
                     assertEquals(f.get(fields), putValue);
@@ -1087,21 +1191,33 @@
         if (f != null && f.getDeclaringClass() == HasFields.class) {
             f.set(fields, value);  // put it back
         }
+        if (testNPE) {
+            if (caughtEx == null || !(caughtEx instanceof NullPointerException))
+                throw new RuntimeException("failed to catch NPE exception"+(caughtEx == null ? " (caughtEx=null)" : ""), caughtEx);
+            caughtEx = null;  // nullify expected exception
+        }
+        if (caughtEx != null) {
+            throw new RuntimeException("unexpected exception", caughtEx);
+        }
     }
 
 
     @Test
     public void testUnreflectSetter() throws Throwable {
+        if (CAN_SKIP_WORKING)  return;
         startTest("unreflectSetter");
         testSetter(TEST_UNREFLECT);
     }
     @Test
     public void testFindSetter() throws Throwable {
+        if (CAN_SKIP_WORKING)  return;
         startTest("findSetter");
         testSetter(TEST_FIND_FIELD);
+        testSetter(TEST_FIND_FIELD | TEST_BOUND);
     }
     @Test
     public void testFindStaticSetter() throws Throwable {
+        if (CAN_SKIP_WORKING)  return;
         startTest("findStaticSetter");
         testSetter(TEST_FIND_STATIC);
     }
@@ -1111,6 +1227,8 @@
         for (Object[] c : HasFields.CASES) {
             boolean positive = (c[1] != Error.class);
             testSetter(positive, lookup, c[0], c[1], testMode);
+            if (positive)
+                testSetter(positive, lookup, c[0], c[1], testMode | TEST_NPE);
         }
         for (int isStaticN = 0; isStaticN <= 1; isStaticN++) {
             testSetter(false, lookup,
@@ -1125,34 +1243,84 @@
 
     @Test
     public void testArrayElementGetter() throws Throwable {
+        if (CAN_SKIP_WORKING)  return;
         startTest("arrayElementGetter");
         testArrayElementGetterSetter(false);
     }
 
     @Test
     public void testArrayElementSetter() throws Throwable {
+        if (CAN_SKIP_WORKING)  return;
         startTest("arrayElementSetter");
         testArrayElementGetterSetter(true);
     }
 
+    private static final int TEST_ARRAY_NONE = 0, TEST_ARRAY_NPE = 1, TEST_ARRAY_OOB = 2, TEST_ARRAY_ASE = 3;
+
     public void testArrayElementGetterSetter(boolean testSetter) throws Throwable {
-        testArrayElementGetterSetter(new Object[10], testSetter);
-        testArrayElementGetterSetter(new String[10], testSetter);
-        testArrayElementGetterSetter(new boolean[10], testSetter);
-        testArrayElementGetterSetter(new byte[10], testSetter);
-        testArrayElementGetterSetter(new char[10], testSetter);
-        testArrayElementGetterSetter(new short[10], testSetter);
-        testArrayElementGetterSetter(new int[10], testSetter);
-        testArrayElementGetterSetter(new float[10], testSetter);
-        testArrayElementGetterSetter(new long[10], testSetter);
-        testArrayElementGetterSetter(new double[10], testSetter);
+        testArrayElementGetterSetter(testSetter, TEST_ARRAY_NONE);
+    }
+
+    @Test
+    public void testArrayElementErrors() throws Throwable {
+        if (CAN_SKIP_WORKING)  return;
+        startTest("arrayElementErrors");
+        testArrayElementGetterSetter(false, TEST_ARRAY_NPE);
+        testArrayElementGetterSetter(true, TEST_ARRAY_NPE);
+        testArrayElementGetterSetter(false, TEST_ARRAY_OOB);
+        testArrayElementGetterSetter(true, TEST_ARRAY_OOB);
+        testArrayElementGetterSetter(new Object[10], true, TEST_ARRAY_ASE);
+        testArrayElementGetterSetter(new Example[10], true, TEST_ARRAY_ASE);
+        testArrayElementGetterSetter(new IntExample[10], true, TEST_ARRAY_ASE);
     }
 
-    public void testArrayElementGetterSetter(Object array, boolean testSetter) throws Throwable {
-        countTest(true);
-        if (verbosity >= 2)  System.out.println("array type = "+array.getClass().getComponentType().getName()+"["+Array.getLength(array)+"]");
+    public void testArrayElementGetterSetter(boolean testSetter, int negTest) throws Throwable {
+        testArrayElementGetterSetter(new String[10], testSetter, negTest);
+        testArrayElementGetterSetter(new Iterable<?>[10], testSetter, negTest);
+        testArrayElementGetterSetter(new Example[10], testSetter, negTest);
+        testArrayElementGetterSetter(new IntExample[10], testSetter, negTest);
+        testArrayElementGetterSetter(new Object[10], testSetter, negTest);
+        testArrayElementGetterSetter(new boolean[10], testSetter, negTest);
+        testArrayElementGetterSetter(new byte[10], testSetter, negTest);
+        testArrayElementGetterSetter(new char[10], testSetter, negTest);
+        testArrayElementGetterSetter(new short[10], testSetter, negTest);
+        testArrayElementGetterSetter(new int[10], testSetter, negTest);
+        testArrayElementGetterSetter(new float[10], testSetter, negTest);
+        testArrayElementGetterSetter(new long[10], testSetter, negTest);
+        testArrayElementGetterSetter(new double[10], testSetter, negTest);
+    }
+
+    public void testArrayElementGetterSetter(Object array, boolean testSetter, int negTest) throws Throwable {
+        boolean positive = (negTest == TEST_ARRAY_NONE);
+        int length = java.lang.reflect.Array.getLength(array);
         Class<?> arrayType = array.getClass();
         Class<?> elemType = arrayType.getComponentType();
+        Object arrayToMH = array;
+        // this stanza allows negative tests to make argument perturbations:
+        switch (negTest) {
+        case TEST_ARRAY_NPE:
+            arrayToMH = null;
+            break;
+        case TEST_ARRAY_OOB:
+            assert(length > 0);
+            arrayToMH = java.lang.reflect.Array.newInstance(elemType, 0);
+            break;
+        case TEST_ARRAY_ASE:
+            assert(testSetter && !elemType.isPrimitive());
+            if (elemType == Object.class)
+                arrayToMH = new StringBuffer[length];  // very random subclass of Object!
+            else if (elemType == Example.class)
+                arrayToMH = new SubExample[length];
+            else if (elemType == IntExample.class)
+                arrayToMH = new SubIntExample[length];
+            else
+                return;  // can't make an ArrayStoreException test
+            assert(arrayType.isInstance(arrayToMH))
+                : Arrays.asList(arrayType, arrayToMH.getClass(), testSetter, negTest);
+            break;
+        }
+        countTest(positive);
+        if (verbosity > 2)  System.out.println("array type = "+array.getClass().getComponentType().getName()+"["+length+"]"+(positive ? "" : " negative test #"+negTest+" using "+Arrays.deepToString(new Object[]{arrayToMH})));
         MethodType expType = !testSetter
                 ? MethodType.methodType(elemType,   arrayType, int.class)
                 : MethodType.methodType(void.class, arrayType, int.class, elemType);
@@ -1161,25 +1329,29 @@
                 : MethodHandles.arrayElementSetter(arrayType);
         assertSame(mh.type(), expType);
         if (elemType != int.class && elemType != boolean.class) {
-            // FIXME: change Integer.class and (Integer) below to int.class and (int) below.
-            MethodType gtype = mh.type().generic().changeParameterType(1, Integer.class);
+            MethodType gtype = mh.type().generic().changeParameterType(1, int.class);
             if (testSetter)  gtype = gtype.changeReturnType(void.class);
             mh = mh.asType(gtype);
         }
         Object sawValue, expValue;
         List<Object> model = array2list(array);
-        int length = Array.getLength(array);
+        Throwable caughtEx = null;
         for (int i = 0; i < length; i++) {
             // update array element
             Object random = randomArg(elemType);
             model.set(i, random);
             if (testSetter) {
-                if (elemType == int.class)
-                    mh.invokeExact((int[]) array, i, (int)random);
-                else if (elemType == boolean.class)
-                    mh.invokeExact((boolean[]) array, i, (boolean)random);
-                else
-                    mh.invokeExact(array, (Integer)i, random);
+                try {
+                    if (elemType == int.class)
+                        mh.invokeExact((int[]) arrayToMH, i, (int)random);
+                    else if (elemType == boolean.class)
+                        mh.invokeExact((boolean[]) arrayToMH, i, (boolean)random);
+                    else
+                        mh.invokeExact(arrayToMH, i, random);
+                } catch (RuntimeException ex) {
+                    caughtEx = ex;
+                    break;
+                }
                 assertEquals(model, array2list(array));
             } else {
                 Array.set(array, i, random);
@@ -1194,21 +1366,44 @@
             sawValue = Array.get(array, i);
             if (!testSetter) {
                 expValue = sawValue;
-                if (elemType == int.class)
-                    sawValue = (int) mh.invokeExact((int[]) array, i);
-                else if (elemType == boolean.class)
-                    sawValue = (boolean) mh.invokeExact((boolean[]) array, i);
-                else
-                    sawValue = mh.invokeExact(array, (Integer)i);
+                try {
+                    if (elemType == int.class)
+                        sawValue = (int) mh.invokeExact((int[]) arrayToMH, i);
+                    else if (elemType == boolean.class)
+                        sawValue = (boolean) mh.invokeExact((boolean[]) arrayToMH, i);
+                    else
+                        sawValue = mh.invokeExact(arrayToMH, i);
+                } catch (RuntimeException ex) {
+                    caughtEx = ex;
+                    break;
+                }
                 assertEquals(sawValue, expValue);
                 assertEquals(model, array2list(array));
             }
         }
+        if (!positive) {
+            if (caughtEx == null)
+                throw new RuntimeException("failed to catch exception for negTest="+negTest);
+            // test the kind of exception
+            Class<?> reqType = null;
+            switch (negTest) {
+            case TEST_ARRAY_ASE:  reqType = ArrayStoreException.class; break;
+            case TEST_ARRAY_OOB:  reqType = ArrayIndexOutOfBoundsException.class; break;
+            case TEST_ARRAY_NPE:  reqType = NullPointerException.class; break;
+            default:              assert(false);
+            }
+            if (reqType.isInstance(caughtEx)) {
+                caughtEx = null;  // nullify expected exception
+            }
+        }
+        if (caughtEx != null) {
+            throw new RuntimeException("unexpected exception", caughtEx);
+        }
     }
 
     List<Object> array2list(Object array) {
         int length = Array.getLength(array);
-        ArrayList<Object> model = new ArrayList<Object>(length);
+        ArrayList<Object> model = new ArrayList<>(length);
         for (int i = 0; i < length; i++)
             model.add(Array.get(array, i));
         return model;
@@ -1239,7 +1434,7 @@
             String name = pfx+"id";
             try {
                 return PRIVATE.findStatic(Callee.class, name, type);
-            } catch (Exception ex) {
+            } catch (NoSuchMethodException | IllegalAccessException ex) {
                 throw new RuntimeException(ex);
             }
         }
@@ -1290,7 +1485,7 @@
         RuntimeException error = null;
         try {
             target = id.asType(newType);
-        } catch (RuntimeException ex) {
+        } catch (WrongMethodTypeException ex) {
             error = ex;
         }
         if (verbosity >= 3)
@@ -1310,25 +1505,28 @@
 
     @Test
     public void testVarargsCollector() throws Throwable {
+        if (CAN_SKIP_WORKING)  return;
+        startTest("varargsCollector");
         MethodHandle vac0 = PRIVATE.findStatic(MethodHandlesTest.class, "called",
                                MethodType.methodType(Object.class, String.class, Object[].class));
         vac0 = vac0.bindTo("vac");
         MethodHandle vac = vac0.asVarargsCollector(Object[].class);
         testConvert(true, vac.asType(MethodType.genericMethodType(0)), null, "vac");
         testConvert(true, vac.asType(MethodType.genericMethodType(0)), null, "vac");
-        for (Class<?> at : new Class[] { Object.class, String.class, Integer.class }) {
+        for (Class<?> at : new Class<?>[] { Object.class, String.class, Integer.class }) {
             testConvert(true, vac.asType(MethodType.genericMethodType(1)), null, "vac", at);
             testConvert(true, vac.asType(MethodType.genericMethodType(2)), null, "vac", at, at);
         }
     }
 
-    @Test
+    @Test  // SLOW
     public void testPermuteArguments() throws Throwable {
         if (CAN_SKIP_WORKING)  return;
         startTest("permuteArguments");
+        testPermuteArguments(4, Integer.class,  2, long.class,    6);
+        if (CAN_TEST_LIGHTLY)  return;
         testPermuteArguments(4, Integer.class,  2, String.class,  0);
         testPermuteArguments(6, Integer.class,  0, null,         30);
-        //testPermuteArguments(4, Integer.class,  2, long.class,    6);  // FIXME Fail_7
     }
     public void testPermuteArguments(int max, Class<?> type1, int t2c, Class<?> type2, int dilution) throws Throwable {
         if (verbosity >= 2)
@@ -1354,7 +1552,9 @@
                     casStep++;
                 testPermuteArguments(args, types, outargs, numcases, casStep);
                 numcases *= inargs;
+                if (CAN_TEST_LIGHTLY && outargs < max-2)  continue;
                 if (dilution > 10 && outargs >= 4) {
+                    if (CAN_TEST_LIGHTLY)  continue;
                     int[] reorder = new int[outargs];
                     // Do some special patterns, which we probably missed.
                     // Replication of a single argument or argument pair.
@@ -1392,6 +1592,7 @@
                 reorder[i] = c % inargs;
                 c /= inargs;
             }
+            if (CAN_TEST_LIGHTLY && outargs >= 3 && (reorder[0] == reorder[1] || reorder[1] == reorder[2]))  continue;
             testPermuteArguments(args, types, reorder);
         }
     }
@@ -1457,19 +1658,20 @@
     }
 
 
-    @Test
+    @Test  // SLOW
     public void testSpreadArguments() throws Throwable {
         if (CAN_SKIP_WORKING)  return;
         startTest("spreadArguments");
-        for (Class<?> argType : new Class[]{Object.class, Integer.class, int.class}) {
+        for (Class<?> argType : new Class<?>[]{Object.class, Integer.class, int.class}) {
             if (verbosity >= 3)
                 System.out.println("spreadArguments "+argType);
-            // FIXME: enable _adapter_spread_args and fix Fail_2
-            for (int nargs = 0; nargs < 10; nargs++) {
-                if (argType == int.class && nargs >= 6)  continue; // FIXME Fail_1
-                for (int pos = 0; pos < nargs; pos++) {
-                    if (argType == int.class && pos > 0)  continue; // FIXME Fail_3
-                     testSpreadArguments(argType, pos, nargs);
+            for (int nargs = 0; nargs < 50; nargs++) {
+                if (CAN_TEST_LIGHTLY && nargs > 11)  break;
+                for (int pos = 0; pos <= nargs; pos++) {
+                    if (CAN_TEST_LIGHTLY && pos > 2 && pos < nargs-2)  continue;
+                    if (nargs > 10 && pos > 4 && pos < nargs-4 && pos % 10 != 3)
+                        continue;
+                    testSpreadArguments(argType, pos, nargs);
                 }
             }
         }
@@ -1484,7 +1686,7 @@
         Object[] args = randomArgs(target2.type().parameterArray());
         // make sure the target does what we think it does:
         if (pos == 0 && nargs < 5 && !argType.isPrimitive()) {
-            Object[] check = (Object[]) (Object) target.invokeWithArguments(args);
+            Object[] check = (Object[]) target.invokeWithArguments(args);
             assertArrayEquals(args, check);
             switch (nargs) {
                 case 0:
@@ -1501,7 +1703,7 @@
                     break;
             }
         }
-        List<Class<?>> newParams = new ArrayList<Class<?>>(target2.type().parameterList());
+        List<Class<?>> newParams = new ArrayList<>(target2.type().parameterList());
         {   // modify newParams in place
             List<Class<?>> spreadParams = newParams.subList(pos, nargs);
             spreadParams.clear(); spreadParams.add(arrayType);
@@ -1550,16 +1752,19 @@
         }
     }
 
-    @Test
+    @Test  // SLOW
     public void testCollectArguments() throws Throwable {
         if (CAN_SKIP_WORKING)  return;
         startTest("collectArguments");
-        for (Class<?> argType : new Class[]{Object.class, Integer.class, int.class}) {
+        for (Class<?> argType : new Class<?>[]{Object.class, Integer.class, int.class}) {
             if (verbosity >= 3)
                 System.out.println("collectArguments "+argType);
-            for (int nargs = 0; nargs < 10; nargs++) {
-                for (int pos = 0; pos < nargs; pos++) {
-                    if (argType == int.class)  continue; // FIXME Fail_4
+            for (int nargs = 0; nargs < 50; nargs++) {
+                if (CAN_TEST_LIGHTLY && nargs > 11)  break;
+                for (int pos = 0; pos <= nargs; pos++) {
+                    if (CAN_TEST_LIGHTLY && pos > 2 && pos < nargs-2)  continue;
+                    if (nargs > 10 && pos > 4 && pos < nargs-4 && pos % 10 != 3)
+                        continue;
                     testCollectArguments(argType, pos, nargs);
                 }
             }
@@ -1589,14 +1794,19 @@
         assertArrayEquals(collectedArgs, returnValue);
     }
 
-    @Test
+    @Test  // SLOW
     public void testInsertArguments() throws Throwable {
         if (CAN_SKIP_WORKING)  return;
         startTest("insertArguments");
-        for (int nargs = 0; nargs <= 4; nargs++) {
-            for (int ins = 0; ins <= 4; ins++) {
-                if (ins > MAX_ARG_INCREASE)  continue;  // FIXME Fail_6
+        for (int nargs = 0; nargs < 50; nargs++) {
+            if (CAN_TEST_LIGHTLY && nargs > 11)  break;
+            for (int ins = 0; ins <= nargs; ins++) {
+                if (nargs > 10 && ins > 4 && ins < nargs-4 && ins % 10 != 3)
+                    continue;
                 for (int pos = 0; pos <= nargs; pos++) {
+                    if (nargs > 10 && pos > 4 && pos < nargs-4 && pos % 10 != 3)
+                        continue;
+                    if (CAN_TEST_LIGHTLY && pos > 2 && pos < nargs-2)  continue;
                     testInsertArguments(nargs, pos, ins);
                 }
             }
@@ -1608,12 +1818,13 @@
         MethodHandle target = varargsArray(nargs + ins);
         Object[] args = randomArgs(target.type().parameterArray());
         List<Object> resList = Arrays.asList(args);
-        List<Object> argsToPass = new ArrayList<Object>(resList);
+        List<Object> argsToPass = new ArrayList<>(resList);
         List<Object> argsToInsert = argsToPass.subList(pos, pos + ins);
         if (verbosity >= 3)
-            System.out.println("insert: "+argsToInsert+" into "+target);
+            System.out.println("insert: "+argsToInsert+" @"+pos+" into "+target);
+        @SuppressWarnings("cast")  // cast to spread Object... is helpful
         MethodHandle target2 = MethodHandles.insertArguments(target, pos,
-                (Object[]) argsToInsert.toArray());
+                (Object[]/*...*/) argsToInsert.toArray());
         argsToInsert.clear();  // remove from argsToInsert
         Object res2 = target2.invokeWithArguments(argsToPass);
         Object res2List = Arrays.asList((Object[])res2);
@@ -1631,11 +1842,11 @@
         Class<?> classOfVCList = varargsList(1).invokeWithArguments(0).getClass();
         assertTrue(List.class.isAssignableFrom(classOfVCList));
         for (int nargs = 0; nargs <= 3; nargs++) {
-            for (Class<?> rtype : new Class[] { Object.class,
+            for (Class<?> rtype : new Class<?>[] { Object.class,
                                                 List.class,
                                                 int.class,
-                                                //byte.class, //FIXME: add this
-                                                //long.class, //FIXME: add this
+                                                byte.class,
+                                                long.class,
                                                 CharSequence.class,
                                                 String.class }) {
                 testFilterReturnValue(nargs, rtype);
@@ -1728,7 +1939,7 @@
             System.out.println("fold "+target+" with "+combine);
         MethodHandle target2 = MethodHandles.foldArguments(target, combine);
         // Simulate expected effect of combiner on arglist:
-        List<Object> expected = new ArrayList<Object>(argsToPass);
+        List<Object> expected = new ArrayList<>(argsToPass);
         List<Object> argsToFold = expected.subList(pos, pos + fold);
         if (verbosity >= 3)
             System.out.println("fold: "+argsToFold+" into "+target2);
@@ -1760,9 +1971,9 @@
         MethodHandle target = varargsArray(nargs);
         Object[] args = randomArgs(target.type().parameterArray());
         MethodHandle target2 = MethodHandles.dropArguments(target, pos,
-                Collections.nCopies(drop, Object.class).toArray(new Class[0]));
+                Collections.nCopies(drop, Object.class).toArray(new Class<?>[0]));
         List<Object> resList = Arrays.asList(args);
-        List<Object> argsToDrop = new ArrayList<Object>(resList);
+        List<Object> argsToDrop = new ArrayList<>(resList);
         for (int i = drop; i > 0; i--) {
             argsToDrop.add(pos, "blort#"+i);
         }
@@ -1773,15 +1984,16 @@
         assertEquals(resList, res2List);
     }
 
-    @Test
+    @Test  // SLOW
     public void testInvokers() throws Throwable {
         if (CAN_SKIP_WORKING)  return;
         startTest("exactInvoker, genericInvoker, varargsInvoker, dynamicInvoker");
         // exactInvoker, genericInvoker, varargsInvoker[0..N], dynamicInvoker
-        Set<MethodType> done = new HashSet<MethodType>();
+        Set<MethodType> done = new HashSet<>();
         for (int i = 0; i <= 6; i++) {
+            if (CAN_TEST_LIGHTLY && i > 3)  break;
             MethodType gtype = MethodType.genericMethodType(i);
-            for (Class<?> argType : new Class[]{Object.class, Integer.class, int.class}) {
+            for (Class<?> argType : new Class<?>[]{Object.class, Integer.class, int.class}) {
                 for (int j = -1; j < i; j++) {
                     MethodType type = gtype;
                     if (j < 0)
@@ -1790,7 +2002,6 @@
                         continue;
                     else
                         type = type.changeParameterType(j, argType);
-                    if (argType.isPrimitive() && j != i-1)  continue; // FIXME Fail_5
                     if (done.add(type))
                         testInvokers(type);
                     MethodType vtype = type.changeReturnType(void.class);
@@ -1811,7 +2022,7 @@
         assertTrue(target.isVarargsCollector());
         target = target.asType(type);
         Object[] args = randomArgs(type.parameterArray());
-        List<Object> targetPlusArgs = new ArrayList<Object>(Arrays.asList(args));
+        List<Object> targetPlusArgs = new ArrayList<>(Arrays.asList(args));
         targetPlusArgs.add(0, target);
         int code = (Integer) invokee(args);
         Object log = logEntry("invokee", args);
@@ -1890,6 +2101,7 @@
         }
         for (int k = 0; k <= nargs; k++) {
             // varargs invoker #0..N
+            if (CAN_TEST_LIGHTLY && (k > 1 || k < nargs - 1))  continue;
             countTest();
             calledLog.clear();
             inv = MethodHandles.spreadInvoker(type, k);
@@ -1897,7 +2109,7 @@
                                   .appendParameterTypes(Object[].class)
                                   .insertParameterTypes(0, MethodHandle.class));
             assertEquals(expType, inv.type());
-            List<Object> targetPlusVarArgs = new ArrayList<Object>(targetPlusArgs);
+            List<Object> targetPlusVarArgs = new ArrayList<>(targetPlusArgs);
             List<Object> tailList = targetPlusVarArgs.subList(1+k, 1+nargs);
             Object[] tail = tailList.toArray();
             tailList.clear(); tailList.add(tail);
@@ -1933,6 +2145,7 @@
     }
 
     private static final String MISSING_ARG = "missingArg";
+    private static final String MISSING_ARG_2 = "missingArg#2";
     static Object targetIfEquals() {
         return called("targetIfEquals");
     }
@@ -1968,28 +2181,39 @@
     public void testGuardWithTest() throws Throwable {
         if (CAN_SKIP_WORKING)  return;
         startTest("guardWithTest");
-        for (int nargs = 0; nargs <= 3; nargs++) {
-            if (nargs != 2)  continue;  // FIXME: test more later
+        for (int nargs = 0; nargs <= 50; nargs++) {
+            if (CAN_TEST_LIGHTLY && nargs > 7)  break;
             testGuardWithTest(nargs, Object.class);
             testGuardWithTest(nargs, String.class);
         }
     }
     void testGuardWithTest(int nargs, Class<?> argClass) throws Throwable {
+        testGuardWithTest(nargs, 0, argClass);
+        if (nargs <= 5 || nargs % 10 == 3) {
+            for (int testDrops = 1; testDrops <= nargs; testDrops++)
+                testGuardWithTest(nargs, testDrops, argClass);
+        }
+    }
+    void testGuardWithTest(int nargs, int testDrops, Class<?> argClass) throws Throwable {
         countTest();
+        int nargs1 = Math.min(3, nargs);
         MethodHandle test = PRIVATE.findVirtual(Object.class, "equals", MethodType.methodType(boolean.class, Object.class));
-        MethodHandle target = PRIVATE.findStatic(MethodHandlesTest.class, "targetIfEquals", MethodType.genericMethodType(nargs));
-        MethodHandle fallback = PRIVATE.findStatic(MethodHandlesTest.class, "fallbackIfNotEquals", MethodType.genericMethodType(nargs));
-        while (test.type().parameterCount() < nargs)
-            test = MethodHandles.dropArguments(test, test.type().parameterCount()-1, Object.class);
+        MethodHandle target = PRIVATE.findStatic(MethodHandlesTest.class, "targetIfEquals", MethodType.genericMethodType(nargs1));
+        MethodHandle fallback = PRIVATE.findStatic(MethodHandlesTest.class, "fallbackIfNotEquals", MethodType.genericMethodType(nargs1));
         while (test.type().parameterCount() > nargs)
+            // 0: test = constant(MISSING_ARG.equals(MISSING_ARG))
+            // 1: test = lambda (_) MISSING_ARG.equals(_)
             test = MethodHandles.insertArguments(test, 0, MISSING_ARG);
         if (argClass != Object.class) {
             test = changeArgTypes(test, argClass);
             target = changeArgTypes(target, argClass);
             fallback = changeArgTypes(fallback, argClass);
         }
-        MethodHandle mh = MethodHandles.guardWithTest(test, target, fallback);
-        assertEquals(target.type(), mh.type());
+        int testArgs = nargs - testDrops;
+        assert(testArgs >= 0);
+        test = addTrailingArgs(test, Math.min(testArgs, nargs), argClass);
+        target = addTrailingArgs(target, nargs, argClass);
+        fallback = addTrailingArgs(fallback, nargs, argClass);
         Object[][] argLists = {
             { },
             { "foo" }, { MISSING_ARG },
@@ -1997,7 +2221,19 @@
             { "foo", "foo", "baz" }, { "foo", "bar", "baz" }
         };
         for (Object[] argList : argLists) {
-            if (argList.length != nargs)  continue;
+            Object[] argList1 = argList;
+            if (argList.length != nargs) {
+                if (argList.length != nargs1)  continue;
+                argList1 = Arrays.copyOf(argList, nargs);
+                Arrays.fill(argList1, nargs1, nargs, MISSING_ARG_2);
+            }
+            MethodHandle test1 = test;
+            if (test1.type().parameterCount() > testArgs) {
+                int pc = test1.type().parameterCount();
+                test1 = MethodHandles.insertArguments(test, testArgs, Arrays.copyOfRange(argList1, testArgs, pc));
+            }
+            MethodHandle mh = MethodHandles.guardWithTest(test1, target, fallback);
+            assertEquals(target.type(), mh.type());
             boolean equals;
             switch (nargs) {
             case 0:   equals = true; break;
@@ -2007,7 +2243,7 @@
             String willCall = (equals ? "targetIfEquals" : "fallbackIfNotEquals");
             if (verbosity >= 3)
                 System.out.println(logEntry(willCall, argList));
-            Object result = mh.invokeWithArguments(argList);
+            Object result = mh.invokeWithArguments(argList1);
             assertCalled(willCall, argList);
         }
     }
@@ -2016,49 +2252,102 @@
     public void testCatchException() throws Throwable {
         if (CAN_SKIP_WORKING)  return;
         startTest("catchException");
-        for (int nargs = 2; nargs <= 6; nargs++) {
-            for (int ti = 0; ti <= 1; ti++) {
-                boolean throwIt = (ti != 0);
-                testCatchException(int.class, new ClassCastException("testing"), throwIt, nargs);
-                testCatchException(void.class, new java.io.IOException("testing"), throwIt, nargs);
-                testCatchException(String.class, new LinkageError("testing"), throwIt, nargs);
+        for (int nargs = 0; nargs < 40; nargs++) {
+            if (CAN_TEST_LIGHTLY && nargs > 11)  break;
+            for (int throwMode = 0; throwMode < THROW_MODE_LIMIT; throwMode++) {
+                testCatchException(int.class, new ClassCastException("testing"), throwMode, nargs);
+                if (CAN_TEST_LIGHTLY && nargs > 3)  continue;
+                testCatchException(void.class, new java.io.IOException("testing"), throwMode, nargs);
+                testCatchException(String.class, new LinkageError("testing"), throwMode, nargs);
             }
         }
     }
 
+    static final int THROW_NOTHING = 0, THROW_CAUGHT = 1, THROW_UNCAUGHT = 2, THROW_THROUGH_ADAPTER = 3, THROW_MODE_LIMIT = 4;
+
+    void testCatchException(Class<?> returnType, Throwable thrown, int throwMode, int nargs) throws Throwable {
+        testCatchException(returnType, thrown, throwMode, nargs, 0);
+        if (nargs <= 5 || nargs % 10 == 3) {
+            for (int catchDrops = 1; catchDrops <= nargs; catchDrops++)
+                testCatchException(returnType, thrown, throwMode, nargs, catchDrops);
+        }
+    }
+
     private static <T extends Throwable>
     Object throwOrReturn(Object normal, T exception) throws T {
-        if (exception != null)  throw exception;
+        if (exception != null) {
+            called("throwOrReturn/throw", normal, exception);
+            throw exception;
+        }
+        called("throwOrReturn/normal", normal, exception);
         return normal;
     }
+    private int fakeIdentityCount;
+    private Object fakeIdentity(Object x) {
+        System.out.println("should throw through this!");
+        fakeIdentityCount++;
+        return x;
+    }
 
-    void testCatchException(Class<?> returnType, Throwable thrown, boolean throwIt, int nargs) throws Throwable {
+    void testCatchException(Class<?> returnType, Throwable thrown, int throwMode, int nargs, int catchDrops) throws Throwable {
         countTest();
         if (verbosity >= 3)
-            System.out.println("catchException rt="+returnType+" throw="+throwIt+" nargs="+nargs);
+            System.out.println("catchException rt="+returnType+" throw="+throwMode+" nargs="+nargs+" drops="+catchDrops);
         Class<? extends Throwable> exType = thrown.getClass();
+        if (throwMode > THROW_CAUGHT)  thrown = new UnsupportedOperationException("do not catch this");
         MethodHandle throwOrReturn
                 = PRIVATE.findStatic(MethodHandlesTest.class, "throwOrReturn",
                     MethodType.methodType(Object.class, Object.class, Throwable.class));
+        if (throwMode == THROW_THROUGH_ADAPTER) {
+            MethodHandle fakeIdentity
+                = PRIVATE.findVirtual(MethodHandlesTest.class, "fakeIdentity",
+                    MethodType.methodType(Object.class, Object.class)).bindTo(this);
+            for (int i = 0; i < 10; i++)
+                throwOrReturn = MethodHandles.filterReturnValue(throwOrReturn, fakeIdentity);
+        }
+        int nargs1 = Math.max(2, nargs);
         MethodHandle thrower = throwOrReturn.asType(MethodType.genericMethodType(2));
-        while (thrower.type().parameterCount() < nargs)
-            thrower = MethodHandles.dropArguments(thrower, thrower.type().parameterCount(), Object.class);
-        MethodHandle catcher = varargsList(1+nargs).asType(MethodType.genericMethodType(1+nargs));
-        MethodHandle target = MethodHandles.catchException(thrower,
-                thrown.getClass(), catcher);
+        thrower = addTrailingArgs(thrower, nargs, Object.class);
+        int catchArgc = 1 + nargs - catchDrops;
+        MethodHandle catcher = varargsList(catchArgc).asType(MethodType.genericMethodType(catchArgc));
+        Object[] args = randomArgs(nargs, Object.class);
+        Object arg0 = MISSING_ARG;
+        Object arg1 = (throwMode == THROW_NOTHING) ? (Throwable) null : thrown;
+        if (nargs > 0)  arg0 = args[0];
+        if (nargs > 1)  args[1] = arg1;
+        assertEquals(nargs1, thrower.type().parameterCount());
+        if (nargs < nargs1) {
+            Object[] appendArgs = { arg0, arg1 };
+            appendArgs = Arrays.copyOfRange(appendArgs, nargs, nargs1);
+            thrower = MethodHandles.insertArguments(thrower, nargs, appendArgs);
+        }
+        assertEquals(nargs, thrower.type().parameterCount());
+        MethodHandle target = MethodHandles.catchException(thrower, exType, catcher);
         assertEquals(thrower.type(), target.type());
+        assertEquals(nargs, target.type().parameterCount());
         //System.out.println("catching with "+target+" : "+throwOrReturn);
-        Object[] args = randomArgs(nargs, Object.class);
-        args[1] = (throwIt ? thrown : null);
-        Object returned = target.invokeWithArguments(args);
+        Object returned;
+        try {
+            returned = target.invokeWithArguments(args);
+        } catch (Throwable ex) {
+            assertSame("must get the out-of-band exception", thrown, ex);
+            if (throwMode <= THROW_CAUGHT)
+                assertEquals(THROW_UNCAUGHT, throwMode);
+            returned = ex;
+        }
+        assertCalled("throwOrReturn/"+(throwMode == THROW_NOTHING ? "normal" : "throw"), arg0, arg1);
         //System.out.println("return from "+target+" : "+returned);
-        if (!throwIt) {
-            assertSame(args[0], returned);
-        } else {
-            List<Object> catchArgs = new ArrayList<Object>(Arrays.asList(args));
+        if (throwMode == THROW_NOTHING) {
+            assertSame(arg0, returned);
+        } else if (throwMode == THROW_CAUGHT) {
+            List<Object> catchArgs = new ArrayList<>(Arrays.asList(args));
+            // catcher receives an initial subsequence of target arguments:
+            catchArgs.subList(nargs - catchDrops, nargs).clear();
+            // catcher also receives the exception, prepended:
             catchArgs.add(0, thrown);
             assertEquals(catchArgs, returned);
         }
+        assertEquals(0, fakeIdentityCount);
     }
 
     @Test
@@ -2093,10 +2382,108 @@
     }
 
     @Test
+    public void testInterfaceCast() throws Throwable {
+        //if (CAN_SKIP_WORKING)  return;
+        startTest("interfaceCast");
+        assert( (((Object)"foo") instanceof CharSequence));
+        assert(!(((Object)"foo") instanceof Iterable));
+        for (MethodHandle mh : new MethodHandle[]{
+            MethodHandles.identity(String.class),
+            MethodHandles.identity(CharSequence.class),
+            MethodHandles.identity(Iterable.class)
+        }) {
+            if (verbosity > 0)  System.out.println("-- mh = "+mh);
+            for (Class<?> ctype : new Class<?>[]{
+                Object.class, String.class, CharSequence.class,
+                Number.class, Iterable.class
+            }) {
+                if (verbosity > 0)  System.out.println("---- ctype = "+ctype.getName());
+                //                           doret  docast
+                testInterfaceCast(mh, ctype, false, false);
+                testInterfaceCast(mh, ctype, true,  false);
+                testInterfaceCast(mh, ctype, false, true);
+                testInterfaceCast(mh, ctype, true,  true);
+            }
+        }
+    }
+    private static Class<?> i2o(Class<?> c) {
+        return (c.isInterface() ? Object.class : c);
+    }
+    public void testInterfaceCast(MethodHandle mh, Class<?> ctype,
+                                                   boolean doret, boolean docast) throws Throwable {
+        MethodHandle mh0 = mh;
+        if (verbosity > 1)
+            System.out.println("mh="+mh+", ctype="+ctype.getName()+", doret="+doret+", docast="+docast);
+        String normalRetVal = "normal return value";
+        MethodType mt = mh.type();
+        MethodType mt0 = mt;
+        if (doret)  mt = mt.changeReturnType(ctype);
+        else        mt = mt.changeParameterType(0, ctype);
+        if (docast) mh = MethodHandles.explicitCastArguments(mh, mt);
+        else        mh = mh.asType(mt);
+        assertEquals(mt, mh.type());
+        MethodType mt1 = mt;
+        // this bit is needed to make the interface types disappear for invokeWithArguments:
+        mh = MethodHandles.explicitCastArguments(mh, mt.generic());
+        Class<?>[] step = {
+            mt1.parameterType(0),  // param as passed to mh at first
+            mt0.parameterType(0),  // param after incoming cast
+            mt0.returnType(),      // return value before cast
+            mt1.returnType(),      // return value after outgoing cast
+        };
+        // where might a checkCast occur?
+        boolean[] checkCast = new boolean[step.length];
+        // the string value must pass each step without causing an exception
+        if (!docast) {
+            if (!doret) {
+                if (step[0] != step[1])
+                    checkCast[1] = true;  // incoming value is cast
+            } else {
+                if (step[2] != step[3])
+                    checkCast[3] = true;  // outgoing value is cast
+            }
+        }
+        boolean expectFail = false;
+        for (int i = 0; i < step.length; i++) {
+            Class<?> c = step[i];
+            if (!checkCast[i])  c = i2o(c);
+            if (!c.isInstance(normalRetVal)) {
+                if (verbosity > 3)
+                    System.out.println("expect failure at step "+i+" in "+Arrays.toString(step)+Arrays.toString(checkCast));
+                expectFail = true;
+                break;
+            }
+        }
+        countTest(!expectFail);
+        if (verbosity > 2)
+            System.out.println("expectFail="+expectFail+", mt="+mt);
+        Object res;
+        try {
+            res = mh.invokeWithArguments(normalRetVal);
+        } catch (Exception ex) {
+            res = ex;
+        }
+        boolean sawFail = !(res instanceof String);
+        if (sawFail != expectFail) {
+            System.out.println("*** testInterfaceCast: mh0 = "+mh0);
+            System.out.println("  retype using "+(docast ? "explicitCastArguments" : "asType")+" to "+mt+" => "+mh);
+            System.out.println("  call returned "+res);
+            System.out.println("  expected "+(expectFail ? "an exception" : normalRetVal));
+        }
+        if (!expectFail) {
+            assertFalse(res.toString(), sawFail);
+            assertEquals(normalRetVal, res);
+        } else {
+            assertTrue(res.toString(), sawFail);
+        }
+    }
+
+    @Test  // SLOW
     public void testCastFailure() throws Throwable {
         if (CAN_SKIP_WORKING)  return;
         startTest("testCastFailure");
         testCastFailure("cast/argument", 11000);
+        if (CAN_TEST_LIGHTLY)  return;
         testCastFailure("unbox/argument", 11000);
         testCastFailure("cast/return", 11000);
         testCastFailure("unbox/return", 11000);
@@ -2135,12 +2522,13 @@
                 INT_IDENTITY = PRIVATE.findStatic(
                     Surprise.class, "intIdentity",
                         MethodType.methodType(int.class, int.class));
-            } catch (Exception ex) {
+            } catch (NoSuchMethodException | IllegalAccessException ex) {
                 throw new RuntimeException(ex);
             }
         }
     }
 
+    @SuppressWarnings("ConvertToStringSwitch")
     void testCastFailure(String mode, int okCount) throws Throwable {
         countTest(false);
         if (verbosity > 2)  System.out.println("mode="+mode);
@@ -2192,7 +2580,7 @@
             if (verbosity > 2)
                 System.out.println("caught "+ex);
             if (verbosity > 3)
-                ex.printStackTrace();
+                ex.printStackTrace(System.out);
             assertTrue(true);  // all is well
         }
     }
@@ -2235,46 +2623,106 @@
         called("runForRunnable");
     }
     public interface Fooable {
-        Object foo(Fooable x, Object y);
-        // this is for randomArg:
-        public class Impl implements Fooable {
-            public Object foo(Fooable x, Object y) {
-                throw new RuntimeException("do not call");
-            }
-            final String name;
-            public Impl() { name = "Fooable#"+nextArg(); }
-            @Override public String toString() { return name; }
-        }
+        // overloads:
+        Object  foo(Object x, String y);
+        List<?> foo(String x, int y);
+        Object  foo(String x);
     }
-    static Object fooForFooable(Fooable x, Object y) {
-        return called("fooForFooable", x, y);
+    static Object fooForFooable(String x, Object... y) {
+        return called("fooForFooable/"+x, y);
     }
+    @SuppressWarnings("serial")  // not really a public API, just a test case
     public static class MyCheckedException extends Exception {
     }
     public interface WillThrow {
         void willThrow() throws MyCheckedException;
     }
+    /*non-public*/ interface PrivateRunnable {
+        public void run();
+    }
 
     @Test
-    public void testAsInstance() throws Throwable {
+    public void testAsInterfaceInstance() throws Throwable {
         if (CAN_SKIP_WORKING)  return;
+        startTest("asInterfaceInstance");
         Lookup lookup = MethodHandles.lookup();
+        // test typical case:  Runnable.run
         {
+            countTest();
+            if (verbosity >= 2)  System.out.println("Runnable");
             MethodType mt = MethodType.methodType(void.class);
             MethodHandle mh = lookup.findStatic(MethodHandlesTest.class, "runForRunnable", mt);
             Runnable proxy = MethodHandleProxies.asInterfaceInstance(Runnable.class, mh);
             proxy.run();
             assertCalled("runForRunnable");
         }
+        // well known single-name overloaded interface:  Appendable.append
         {
-            MethodType mt = MethodType.methodType(Object.class, Fooable.class, Object.class);
-            MethodHandle mh = lookup.findStatic(MethodHandlesTest.class, "fooForFooable", mt);
+            countTest();
+            if (verbosity >= 2)  System.out.println("Appendable");
+            ArrayList<List<?>> appendResults = new ArrayList<>();
+            MethodHandle append = lookup.bind(appendResults, "add", MethodType.methodType(boolean.class, Object.class));
+            append = append.asType(MethodType.methodType(void.class, List.class)); // specialize the type
+            MethodHandle asList = lookup.findStatic(Arrays.class, "asList", MethodType.methodType(List.class, Object[].class));
+            MethodHandle mh = MethodHandles.filterReturnValue(asList, append).asVarargsCollector(Object[].class);
+            Appendable proxy = MethodHandleProxies.asInterfaceInstance(Appendable.class, mh);
+            proxy.append("one");
+            proxy.append("two", 3, 4);
+            proxy.append('5');
+            assertEquals(Arrays.asList(Arrays.asList("one"),
+                                       Arrays.asList("two", 3, 4),
+                                       Arrays.asList('5')),
+                         appendResults);
+            if (verbosity >= 3)  System.out.println("appendResults="+appendResults);
+            appendResults.clear();
+            Formatter formatter = new Formatter(proxy);
+            String fmt = "foo str=%s char='%c' num=%d";
+            Object[] fmtArgs = { "str!", 'C', 42 };
+            String expect = String.format(fmt, fmtArgs);
+            formatter.format(fmt, fmtArgs);
+            String actual = "";
+            if (verbosity >= 3)  System.out.println("appendResults="+appendResults);
+            for (List<?> l : appendResults) {
+                Object x = l.get(0);
+                switch (l.size()) {
+                case 1:  actual += x; continue;
+                case 3:  actual += ((String)x).substring((int)(Object)l.get(1), (int)(Object)l.get(2)); continue;
+                }
+                actual += l;
+            }
+            if (verbosity >= 3)  System.out.println("expect="+expect);
+            if (verbosity >= 3)  System.out.println("actual="+actual);
+            assertEquals(expect, actual);
+        }
+        // test case of an single name which is overloaded:  Fooable.foo(...)
+        {
+            if (verbosity >= 2)  System.out.println("Fooable");
+            MethodHandle mh = lookup.findStatic(MethodHandlesTest.class, "fooForFooable",
+                                                MethodType.methodType(Object.class, String.class, Object[].class));
             Fooable proxy = MethodHandleProxies.asInterfaceInstance(Fooable.class, mh);
-            Object[] args = randomArgs(mt.parameterArray());
-            Object result = proxy.foo((Fooable) args[0], args[1]);
-            assertCalled("fooForFooable", args);
-            assertEquals(result, logEntry("fooForFooable", args));
+            for (Method m : Fooable.class.getDeclaredMethods()) {
+                countTest();
+                assertSame("foo", m.getName());
+                if (verbosity > 3)
+                    System.out.println("calling "+m);
+                MethodHandle invoker = lookup.unreflect(m);
+                MethodType mt = invoker.type();
+                Class<?>[] types = mt.parameterArray();
+                types[0] = int.class;  // placeholder
+                Object[] args = randomArgs(types);
+                args[0] = proxy;
+                if (verbosity > 3)
+                    System.out.println("calling "+m+" on "+Arrays.asList(args));
+                Object result = invoker.invokeWithArguments(args);
+                if (verbosity > 4)
+                    System.out.println("result = "+result);
+                String name = "fooForFooable/"+args[1];
+                Object[] argTail = Arrays.copyOfRange(args, 2, args.length);
+                assertCalled(name, argTail);
+                assertEquals(result, logEntry(name, argTail));
+            }
         }
+        // test processing of thrown exceptions:
         for (Throwable ex : new Throwable[] { new NullPointerException("ok"),
                                               new InternalError("ok"),
                                               new Throwable("fail"),
@@ -2285,11 +2733,12 @@
             mh = MethodHandles.insertArguments(mh, 0, ex);
             WillThrow proxy = MethodHandleProxies.asInterfaceInstance(WillThrow.class, mh);
             try {
+                countTest();
                 proxy.willThrow();
                 System.out.println("Failed to throw: "+ex);
                 assertTrue(false);
             } catch (Throwable ex1) {
-                if (verbosity > 2) {
+                if (verbosity > 3) {
                     System.out.println("throw "+ex);
                     System.out.println("catch "+(ex == ex1 ? "UNWRAPPED" : ex1));
                 }
@@ -2301,28 +2750,88 @@
                 } else {
                     assertNotSame("must pass undeclared checked exception with wrapping", ex, ex1);
                     if (!(ex1 instanceof UndeclaredThrowableException) || ex1.getCause() != ex) {
-                        ex1.printStackTrace();
+                        ex1.printStackTrace(System.out);
                     }
                     assertSame(ex, ex1.getCause());
                     UndeclaredThrowableException utex = (UndeclaredThrowableException) ex1;
                 }
             }
         }
-        // Test error checking:
-        for (Class<?> nonSAM : new Class[] { Object.class,
+        // Test error checking on bad interfaces:
+        for (Class<?> nonSMI : new Class<?>[] { Object.class,
                                              String.class,
                                              CharSequence.class,
+                                             java.io.Serializable.class,
+                                             PrivateRunnable.class,
                                              Example.class }) {
+            if (verbosity > 2)  System.out.println(nonSMI.getName());
             try {
-                MethodHandleProxies.asInterfaceInstance(nonSAM, varargsArray(0));
-                System.out.println("Failed to throw");
-                assertTrue(false);
+                countTest(false);
+                MethodHandleProxies.asInterfaceInstance(nonSMI, varargsArray(0));
+                assertTrue("Failed to throw on "+nonSMI.getName(), false);
             } catch (IllegalArgumentException ex) {
+                if (verbosity > 2)  System.out.println(nonSMI.getSimpleName()+": "+ex);
+                // Object: java.lang.IllegalArgumentException:
+                //     not a public interface: java.lang.Object
+                // String: java.lang.IllegalArgumentException:
+                //     not a public interface: java.lang.String
+                // CharSequence: java.lang.IllegalArgumentException:
+                //     not a single-method interface: java.lang.CharSequence
+                // Serializable: java.lang.IllegalArgumentException:
+                //     not a single-method interface: java.io.Serializable
+                // PrivateRunnable: java.lang.IllegalArgumentException:
+                //     not a public interface: test.java.lang.invoke.MethodHandlesTest$PrivateRunnable
+                // Example: java.lang.IllegalArgumentException:
+                //     not a public interface: test.java.lang.invoke.MethodHandlesTest$Example
+            }
+        }
+        // Test error checking on interfaces with the wrong method type:
+        for (Class<?> intfc : new Class<?>[] { Runnable.class /*arity 0*/,
+                                            Fooable.class /*arity 1 & 2*/ }) {
+            int badArity = 1;  // known to be incompatible
+            if (verbosity > 2)  System.out.println(intfc.getName());
+            try {
+                countTest(false);
+                MethodHandleProxies.asInterfaceInstance(intfc, varargsArray(badArity));
+                assertTrue("Failed to throw on "+intfc.getName(), false);
+            } catch (WrongMethodTypeException ex) {
+                if (verbosity > 2)  System.out.println(intfc.getSimpleName()+": "+ex);
+                // Runnable: java.lang.invoke.WrongMethodTypeException:
+                //     cannot convert MethodHandle(Object)Object[] to ()void
+                // Fooable: java.lang.invoke.WrongMethodTypeException:
+                //     cannot convert MethodHandle(Object)Object[] to (Object,String)Object
             }
         }
     }
+
+    @Test
+    public void testRunnableProxy() throws Throwable {
+        if (CAN_SKIP_WORKING)  return;
+        startTest("testRunnableProxy");
+        MethodHandles.Lookup lookup = MethodHandles.lookup();
+        MethodHandle run = lookup.findStatic(lookup.lookupClass(), "runForRunnable", MethodType.methodType(void.class));
+        Runnable r = MethodHandleProxies.asInterfaceInstance(Runnable.class, run);
+        testRunnableProxy(r);
+        assertCalled("runForRunnable");
+    }
+    private static void testRunnableProxy(Runnable r) {
+        //7058630: JSR 292 method handle proxy violates contract for Object methods
+        r.run();
+        Object o = r;
+        r = null;
+        boolean eq = (o == o);
+        int     hc = System.identityHashCode(o);
+        String  st = o.getClass().getName() + "@" + Integer.toHexString(hc);
+        Object expect = Arrays.asList(st, eq, hc);
+        if (verbosity >= 2)  System.out.println("expect st/eq/hc = "+expect);
+        Object actual = Arrays.asList(o.toString(), o.equals(o), o.hashCode());
+        if (verbosity >= 2)  System.out.println("actual st/eq/hc = "+actual);
+        assertEquals(expect, actual);
+    }
 }
 // Local abbreviated copy of sun.invoke.util.ValueConversions
+// This guy tests access from outside the same package member, but inside
+// the package itself.
 class ValueConversions {
     private static final Lookup IMPL_LOOKUP = MethodHandles.lookup();
     private static final Object[] NO_ARGS_ARRAY = {};
@@ -2357,7 +2866,7 @@
                                   Object a8, Object a9)
                 { return makeArray(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
     static MethodHandle[] makeArrays() {
-        ArrayList<MethodHandle> arrays = new ArrayList<MethodHandle>();
+        ArrayList<MethodHandle> arrays = new ArrayList<>();
         MethodHandles.Lookup lookup = IMPL_LOOKUP;
         for (;;) {
             int nargs = arrays.size();
@@ -2446,7 +2955,7 @@
                                      Object a8, Object a9)
                 { return makeList(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
     static MethodHandle[] makeLists() {
-        ArrayList<MethodHandle> lists = new ArrayList<MethodHandle>();
+        ArrayList<MethodHandle> lists = new ArrayList<>();
         MethodHandles.Lookup lookup = IMPL_LOOKUP;
         for (;;) {
             int nargs = lists.size();
@@ -2469,7 +2978,7 @@
     static {
         try {
             AS_LIST = IMPL_LOOKUP.findStatic(Arrays.class, "asList", MethodType.methodType(List.class, Object[].class));
-        } catch (Exception ex) { throw new RuntimeException(ex); }
+        } catch (NoSuchMethodException | IllegalAccessException ex) { throw new RuntimeException(ex); }
     }
 
     /** Return a method handle that takes the indicated number of Object
--- a/test/java/lang/invoke/MethodTypeTest.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/lang/invoke/MethodTypeTest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -29,6 +29,7 @@
 
 package test.java.lang.invoke;
 
+import java.io.IOException;
 import java.lang.invoke.MethodType;
 import java.lang.reflect.Method;
 
@@ -378,7 +379,7 @@
     public void testHashCode() {
         System.out.println("hashCode");
         MethodType instance = mt_viS;
-        ArrayList<Class<?>> types = new ArrayList<Class<?>>();
+        ArrayList<Class<?>> types = new ArrayList<>();
         types.add(instance.returnType());
         types.addAll(instance.parameterList());
         int expResult = types.hashCode();
@@ -556,7 +557,7 @@
             Object decode;
             try {
                 decode = readSerial(wire);
-            } catch (Exception ex) {
+            } catch (IOException | ClassNotFoundException ex) {
                 decode = ex;  // oops!
             }
             assertEquals(mt, decode);
--- a/test/java/lang/invoke/PermuteArgsTest.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/lang/invoke/PermuteArgsTest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -25,7 +25,7 @@
 
 /* @test
  * @summary unit tests for method handles which permute their arguments
- * @run junit/othervm -ea -esa -DPermuteArgsTest.MAX_ARITY=8 test.java.lang.invoke.PermuteArgsTest
+ * @run junit/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-VerifyDependencies -ea -esa -DPermuteArgsTest.MAX_ARITY=8 test.java.lang.invoke.PermuteArgsTest
  */
 /* Examples of manual runs:
  * java -DPermuteArgsTest.{DRY_RUN=true,MAX_ARITY=253} test.java.lang.invoke.PermuteArgsTest
@@ -45,7 +45,7 @@
 import static java.lang.invoke.MethodType.*;
 
 public class PermuteArgsTest {
-    private static final Class CLASS = PermuteArgsTest.class;
+    private static final Class<?> CLASS = PermuteArgsTest.class;
     private static final int MAX_ARITY = Integer.getInteger(CLASS.getSimpleName()+".MAX_ARITY", 8);
     private static final boolean DRY_RUN = Boolean.getBoolean(CLASS.getSimpleName()+".DRY_RUN");
     private static final boolean VERBOSE = Boolean.getBoolean(CLASS.getSimpleName()+".VERBOSE") || DRY_RUN;
@@ -99,12 +99,12 @@
         return Arrays.asList(w, x, y, z);
     }
     static Object listI_etc(int... va) {
-        ArrayList<Object> res = new ArrayList<Object>();
+        ArrayList<Object> res = new ArrayList<>();
         for (int x : va)  res.add(x);
         return res;
     }
     static Object listIJL_etc(int x, long y, Object z, Object... va) {
-        ArrayList<Object> res = new ArrayList<Object>();
+        ArrayList<Object> res = new ArrayList<>();
         res.addAll(Arrays.asList(x, y, z));
         res.addAll(Arrays.asList(va));
         return res;
@@ -168,7 +168,7 @@
                     mh1 = adjustArity(mh, arity);
                 } catch (IllegalArgumentException ex) {
                     System.out.println("*** mh = "+name+" : "+mh+"; arity = "+arity+" => "+ex);
-                    ex.printStackTrace();
+                    ex.printStackTrace(System.out);
                     break;  // cannot get this arity for this type
                 }
                 test("("+arity+")"+name, mh1);
@@ -191,7 +191,11 @@
                 pt = mt1.parameterType(mt1.parameterCount() - posArgs);
             mt1 = mt1.appendParameterTypes(pt);
         }
-        return mh.asType(mt1);
+        try {
+            return mh.asType(mt1);
+        } catch (WrongMethodTypeException | IllegalArgumentException ex) {
+            throw new IllegalArgumentException("cannot convert to type "+mt1+" from "+mh, ex);
+        }
     }
     static MethodHandle findTestMH(String name, int[] perm) throws ReflectiveOperationException {
         int arity = perm.length;
@@ -213,7 +217,7 @@
     }
 
     static void testPermutations(MethodHandle mh) throws Throwable {
-        HashSet<String> done = new HashSet<String>();
+        HashSet<String> done = new HashSet<>();
         MethodType mt = mh.type();
         int[] perm = nullPerm(mt.parameterCount());
         final int MARGIN = (perm.length <= 10 ? 2 : 0);
@@ -326,8 +330,8 @@
             Class<?> pt = ptypes[i];
             Object arg;
             if (pt == Void.class)       arg = null;
-            else if (pt == int.class)   arg = (int)  i + 101;
-            else if (pt == long.class)  arg = (long) i + 10_000_000_001L;
+            else if (pt == int.class)   arg = i + 101;
+            else if (pt == long.class)  arg = i + 10_000_000_001L;
             else                        arg = "#" + (i + 1);
             args[i] = arg;
         }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/lang/invoke/PrivateInvokeTest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,376 @@
+/*
+ * Copyright (c) 2009, 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.
+ */
+
+/* @test
+ * @summary white-box testing of method handle sub-primitives
+ * @run junit test.java.lang.invoke.PrivateInvokeTest
+ */
+
+package test.java.lang.invoke;
+
+import java.lang.invoke.*;
+import static java.lang.invoke.MethodHandles.*;
+import static java.lang.invoke.MethodType.*;
+import java.lang.reflect.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import org.junit.*;
+import static org.junit.Assert.*;
+
+public class PrivateInvokeTest {
+    // Utility functions
+    private static final Lookup LOOKUP = lookup();
+    private static final Class<?> THIS_CLASS = PrivateInvokeTest.class;
+    private static final int
+            REF_NONE                    = 0,  // null value
+            REF_getField                = 1,
+            REF_getStatic               = 2,
+            REF_putField                = 3,
+            REF_putStatic               = 4,
+            REF_invokeVirtual           = 5,
+            REF_invokeStatic            = 6,
+            REF_invokeSpecial           = 7,
+            REF_newInvokeSpecial        = 8,
+            REF_invokeInterface         = 9,
+            REF_LIMIT                  = 10,
+            REF_MH_invokeBasic         = REF_NONE;;
+    private static final String[] REF_KIND_NAMES = {
+        "MH::invokeBasic",
+        "REF_getField", "REF_getStatic", "REF_putField", "REF_putStatic",
+        "REF_invokeVirtual", "REF_invokeStatic", "REF_invokeSpecial",
+        "REF_newInvokeSpecial", "REF_invokeInterface"
+    };
+    private int verbose;
+    //{ verbose = 99; }  // for debugging
+    {
+        String vstr = System.getProperty(THIS_CLASS.getSimpleName()+".verbose");
+        if (vstr == null)
+            vstr = System.getProperty(THIS_CLASS.getName()+".verbose");
+        if (vstr == null)
+            vstr = System.getProperty("test.verbose");
+        if (vstr != null)  verbose = Integer.parseInt(vstr);
+    }
+    private static int referenceKind(Method m) {
+        if (Modifier.isStatic(m.getModifiers()))
+            return REF_invokeStatic;
+        else if (m.getDeclaringClass().isInterface())
+            return REF_invokeInterface;
+        else if (Modifier.isFinal(m.getModifiers()) ||
+            Modifier.isFinal(m.getDeclaringClass().getModifiers()))
+            return REF_invokeSpecial;
+        else
+            return REF_invokeVirtual;
+    }
+    private static MethodType basicType(MethodType mtype) {
+        MethodType btype = mtype.erase();
+        if (btype.hasPrimitives()) {
+            for (int i = -1; i < mtype.parameterCount(); i++) {
+                Class<?> type = (i < 0 ? mtype.returnType() : mtype.parameterType(i));
+                if (type == boolean.class ||
+                    type == byte.class ||
+                    type == char.class ||
+                    type == short.class) {
+                    type = int.class;
+                    if (i < 0)
+                        btype = btype.changeReturnType(type);
+                    else
+                        btype = btype.changeParameterType(i, type);
+                }
+            }
+        }
+        return btype;
+    }
+    private static Method getMethod(Class<?> defc, String name, Class<?>... ptypes) {
+        try {
+            return defc.getDeclaredMethod(name, ptypes);
+        } catch (NoSuchMethodException ex) {
+        }
+        try {
+            return defc.getMethod(name, ptypes);
+        } catch (NoSuchMethodException ex) {
+            throw new IllegalArgumentException(ex);
+        }
+    }
+    private static MethodHandle unreflect(Method m) {
+        try {
+            MethodHandle mh = LOOKUP.unreflect(m);
+            if (Modifier.isTransient(m.getModifiers()))
+                mh = mh.asFixedArity();  // remove varargs wrapper
+            return mh;
+        } catch (IllegalAccessException ex) {
+            throw new IllegalArgumentException(ex);
+        }
+    }
+    private static final Lookup DIRECT_INVOKER_LOOKUP;
+    private static final Class<?> MEMBER_NAME_CLASS;
+    private static final MethodHandle MH_INTERNAL_MEMBER_NAME;
+    private static final MethodHandle MH_DEBUG_STRING;
+    static {
+        try {
+            // This is white box testing.  Use reflection to grab private implementation bits.
+            String magicName = "IMPL_LOOKUP";
+            Field magicLookup = MethodHandles.Lookup.class.getDeclaredField(magicName);
+            // This unit test will fail if a security manager is installed.
+            magicLookup.setAccessible(true);
+            // Forbidden fruit...
+            DIRECT_INVOKER_LOOKUP = (Lookup) magicLookup.get(null);
+            MEMBER_NAME_CLASS = Class.forName("java.lang.invoke.MemberName", false, MethodHandle.class.getClassLoader());
+            MH_INTERNAL_MEMBER_NAME = DIRECT_INVOKER_LOOKUP
+                    .findVirtual(MethodHandle.class, "internalMemberName", methodType(MEMBER_NAME_CLASS))
+                    .asType(methodType(Object.class, MethodHandle.class));
+            MH_DEBUG_STRING = DIRECT_INVOKER_LOOKUP
+                    .findVirtual(MethodHandle.class, "debugString", methodType(String.class));
+        } catch (ReflectiveOperationException ex) {
+            throw new Error(ex);
+        }
+    }
+    private Object internalMemberName(MethodHandle mh) {
+        try {
+            return MH_INTERNAL_MEMBER_NAME.invokeExact(mh);
+        } catch (Throwable ex) {
+            throw new Error(ex);
+        }
+    }
+    private String debugString(MethodHandle mh) {
+        try {
+            return (String) MH_DEBUG_STRING.invokeExact(mh);
+        } catch (Throwable ex) {
+            throw new Error(ex);
+        }
+    }
+    private static MethodHandle directInvoker(int refKind, MethodType mtype) {
+        return directInvoker(REF_KIND_NAMES[refKind], mtype);
+    }
+    private static MethodHandle directInvoker(String name, MethodType mtype) {
+        boolean isStatic;
+        mtype = mtype.erase();
+        if (name.startsWith("MH::")) {
+            isStatic = false;
+            name = strip("MH::", name);
+        } else if (name.startsWith("REF_")) {
+            isStatic = true;
+            name = strip("REF_", name);
+            if (name.startsWith("invoke"))
+                name = "linkTo"+strip("invoke", name);
+            mtype = mtype.appendParameterTypes(MEMBER_NAME_CLASS);
+        } else {
+            throw new AssertionError("name="+name);
+        }
+        //System.out.println("directInvoker = "+name+mtype);
+        try {
+            if (isStatic)
+                return DIRECT_INVOKER_LOOKUP
+                        .findStatic(MethodHandle.class, name, mtype);
+            else
+                return DIRECT_INVOKER_LOOKUP
+                        .findVirtual(MethodHandle.class, name, mtype);
+        } catch (ReflectiveOperationException ex) {
+            throw new IllegalArgumentException(ex);
+        }
+    }
+    private Object invokeWithArguments(Method m, Object... args) {
+        Object recv = null;
+        if (!Modifier.isStatic(m.getModifiers())) {
+            recv = args[0];
+            args = pop(1, args);
+        }
+        try {
+            return m.invoke(recv, args);
+        } catch (IllegalAccessException|IllegalArgumentException|InvocationTargetException ex) {
+            throw new IllegalArgumentException(ex);
+        }
+    }
+    private Object invokeWithArguments(MethodHandle mh, Object... args) {
+        try {
+            return mh.invokeWithArguments(args);
+        } catch (Throwable ex) {
+            throw new IllegalArgumentException(ex);
+        }
+    }
+    private int counter;
+    private Object makeArgument(Class<?> type) {
+        final String cname = type.getSimpleName();
+        final int n = ++counter;
+        final int nn = (n << 10) + 13;
+        if (type.isAssignableFrom(String.class)) {
+            return "<"+cname+"#"+nn+">";
+        }
+        if (type == THIS_CLASS)  return this.withCounter(nn);
+        if (type == Integer.class   || type == int.class)     return nn;
+        if (type == Character.class || type == char.class)    return (char)(n % 100+' ');
+        if (type == Byte.class      || type == byte.class)    return (byte)-(n % 100);
+        if (type == Long.class      || type == long.class)    return (long)nn;
+        throw new IllegalArgumentException("don't know how to make argument of type: "+type);
+    }
+    private Object[] makeArguments(Class<?>... ptypes) {
+        Object[] args = new Object[ptypes.length];
+        for (int i = 0; i < args.length; i++)
+            args[i] = makeArgument(ptypes[i]);
+        return args;
+    }
+    private Object[] makeArguments(MethodType mtype) {
+        return makeArguments(mtype.parameterArray());
+    }
+    private Object[] pop(int n, Object[] args) {
+        if (n >= 0)
+            return Arrays.copyOfRange(args, n, args.length);
+        else
+            return Arrays.copyOfRange(args, 0, args.length+n);
+    }
+    private Object[] pushAtFront(Object arg1, Object[] args) {
+        Object[] res = new Object[1+args.length];
+        res[0] = arg1;
+        System.arraycopy(args, 0, res, 1, args.length);
+        return res;
+    }
+    private Object[] pushAtBack(Object[] args, Object argN) {
+        Object[] res = new Object[1+args.length];
+        System.arraycopy(args, 0, res, 0, args.length);
+        res[args.length] = argN;
+        return res;
+    }
+    private static String strip(String prefix, String s) {
+        assert(s.startsWith(prefix));
+        return s.substring(prefix.length());
+    }
+
+    private final int[] refKindTestCounts = new int[REF_KIND_NAMES.length];
+    @After
+    public void printCounts() {
+        ArrayList<String> zeroes = new ArrayList<>();
+        for (int i = 0; i < refKindTestCounts.length; i++) {
+            final int count = refKindTestCounts[i];
+            final String name = REF_KIND_NAMES[i];
+            if (count == 0) {
+                if (name != null)  zeroes.add(name);
+                continue;
+            }
+            if (verbose >= 0)
+                System.out.println("test count for "+name+" : "+count);
+            else if (name != null)
+                zeroes.add(name);
+        }
+        if (verbose >= 0)
+            System.out.println("test counts zero for "+zeroes);
+    }
+
+    // Test subjects
+    public static String makeString(Object x) { return "makeString("+x+")"; }
+    public static String dupString(String x) { return "("+x+"+"+x+")"; }
+    public static String intString(int x) { return "intString("+x+")"; }
+    public static String byteString(byte x) { return "byteString("+x+")"; }
+    public static String longString(String x, long y, String z) { return "longString("+x+y+z+")"; }
+
+    public final String toString() {
+        return "<"+getClass().getSimpleName()+"#"+counter+">";
+    }
+    public final String hello() { return "hello from "+this; }
+    private PrivateInvokeTest withCounter(int counter) {
+        PrivateInvokeTest res = new PrivateInvokeTest();
+        res.counter = counter;
+        return res;
+    }
+
+    public static void main(String... av) throws Throwable {
+        new PrivateInvokeTest().run();
+    }
+    public void run() throws Throwable {
+        testFirst();
+        testInvokeDirect();
+    }
+
+    @Test
+    public void testFirst() throws Throwable {
+        if (true)  return;  // nothing here
+        try {
+            System.out.println("start of testFirst");
+        } finally {
+            System.out.println("end of testFirst");
+        }
+    }
+
+    @Test
+    public void testInvokeDirect() {
+        testInvokeDirect(getMethod(THIS_CLASS, "hello"));
+        testInvokeDirect(getMethod(Object.class, "toString"));
+        testInvokeDirect(getMethod(Comparable.class, "compareTo", Object.class));
+        testInvokeDirect(getMethod(THIS_CLASS, "makeString", Object.class));
+        testInvokeDirect(getMethod(THIS_CLASS, "dupString", String.class));
+        testInvokeDirect(getMethod(THIS_CLASS, "intString", int.class));
+        testInvokeDirect(getMethod(THIS_CLASS, "byteString", byte.class));
+        testInvokeDirect(getMethod(THIS_CLASS, "longString", String.class, long.class, String.class));
+    }
+
+    void testInvokeDirect(Method m) {
+        final int refKind = referenceKind(m);
+        testInvokeDirect(m, refKind);
+        testInvokeDirect(m, REF_MH_invokeBasic);
+    }
+    void testInvokeDirect(Method m, int refKind) {
+        if (verbose >= 1)
+            System.out.println("testInvoke m="+m+" : "+REF_KIND_NAMES[refKind]);
+        final MethodHandle mh = unreflect(m);
+        Object[] args = makeArguments(mh.type());
+        Object res1 = invokeWithArguments(m, args);
+        // res1 comes from java.lang.reflect.Method::invoke
+        if (verbose >= 1)
+            System.out.println("m"+Arrays.asList(args)+" => "+res1);
+        // res2 comes from java.lang.invoke.MethodHandle::invoke
+        Object res2 = invokeWithArguments(mh, args);
+        assertEquals(res1, res2);
+        MethodType mtype = mh.type();
+        testInvokeVia("DMH invoker", refKind, directInvoker(refKind, mtype), mh, res1, args);
+        MethodType etype = mtype.erase();
+        if (etype != mtype) {
+            // Try a detuned invoker.
+            testInvokeVia("erased DMH invoker", refKind, directInvoker(refKind, etype), mh, res1, args);
+        }
+        MethodType btype = basicType(mtype);
+        if (btype != mtype && btype != etype) {
+            // Try a detuned invoker.
+            testInvokeVia("basic DMH invoker", refKind, directInvoker(refKind, btype), mh, res1, args);
+        }
+        if (false) {
+            // this can crash the JVM
+            testInvokeVia("generic DMH invoker", refKind, directInvoker(refKind, mtype.generic()), mh, res1, args);
+        }
+        refKindTestCounts[refKind] += 1;
+    }
+
+    void testInvokeVia(String kind, int refKind, MethodHandle invoker, MethodHandle mh, Object res1, Object... args) {
+        Object[] args1;
+        if (refKind == REF_MH_invokeBasic)
+            args1 = pushAtFront(mh, args);
+        else
+            args1 = pushAtBack(args, internalMemberName(mh));
+        if (verbose >= 2) {
+            System.out.println(kind+" invoker="+invoker+" mh="+debugString(mh)+" args="+Arrays.asList(args1));
+        }
+        Object res3 = invokeWithArguments(invoker, args1);
+        assertEquals(res1, res3);
+    }
+}
--- a/test/java/lang/invoke/RicochetTest.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/lang/invoke/RicochetTest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -40,7 +40,6 @@
 import static java.lang.invoke.MethodType.*;
 import static java.lang.invoke.MethodHandles.*;
 import static org.junit.Assert.*;
-import static org.junit.Assume.*;
 
 
 /**
@@ -48,7 +47,7 @@
  * @author jrose
  */
 public class RicochetTest {
-    private static final Class CLASS = RicochetTest.class;
+    private static final Class<?> CLASS = RicochetTest.class;
     private static final int MAX_ARITY = Integer.getInteger(CLASS.getSimpleName()+".MAX_ARITY", 40);
 
     public static void main(String... av) throws Throwable {
@@ -82,6 +81,7 @@
         testLongSpreads();
         testIntCollects();
         testReturns();
+        testRecursion();
     }
 
     @Test
@@ -147,7 +147,7 @@
         for (int nargs = 0; nargs <= MAX; nargs++) {
             if (nargs > 30 && nargs < MAX-20)  nargs += 10;
             int[] args = new int[nargs];
-            for (int j = 0; j < args.length; j++)  args[j] = (int)(j + 11);
+            for (int j = 0; j < args.length; j++)  args[j] = j + 11;
             //System.out.println("testIntSpreads "+Arrays.toString(args));
             int[] args1 = (int[]) id.invokeExact(args);
             assertArrayEquals(args, args1);
@@ -256,7 +256,7 @@
                     //System.out.println("  expect="+expect);
 
                     // now use the combined MH, and test the output:
-                    MethodHandle mh = collectArguments(lister, pos, INT_COLLECTORS[collects]);
+                    MethodHandle mh = collectArguments(lister, pos, int[].class, INT_COLLECTORS[collects]);
                     if (mh == null)  continue;  // no infix collection, yet
                     assert(mh.type().parameterCount() == inputs);
                     Object observe = mh.asSpreader(int[].class, args.length).invokeExact(args);
@@ -266,13 +266,53 @@
         }
     }
 
-    private static MethodHandle collectArguments(MethodHandle lister, int pos, MethodHandle collector) {
+    @Test
+    public void testByteCollects() throws Throwable {
+        if (!startTest("testByteCollects"))  return;
+        for (MethodHandle lister : BYTE_LISTERS) {
+            int outputs = lister.type().parameterCount();
+            for (int collects = 0; collects <= Math.min(outputs, BYTE_COLLECTORS.length-1); collects++) {
+                int inputs = outputs - 1 + collects;
+                if (inputs < 0)  continue;
+                for (int pos = 0; pos + collects <= inputs; pos++) {
+                    MethodHandle collector = BYTE_COLLECTORS[collects];
+                    byte[] args = new byte[inputs];
+                    int ap = 0, arg = 31;
+                    for (int i = 0; i < pos; i++)
+                        args[ap++] = (byte)(arg++ + 0);
+                    for (int i = 0; i < collects; i++)
+                        args[ap++] = (byte)(arg++ + 10);
+                    while (ap < args.length)
+                        args[ap++] = (byte)(arg++ + 20);
+                    // calculate piecemeal:
+                    //System.out.println("testIntCollects "+Arrays.asList(lister, pos, collector)+" on "+Arrays.toString(args));
+                    byte[] collargs = Arrays.copyOfRange(args, pos, pos+collects);
+                    byte coll = (byte) collector.asSpreader(byte[].class, collargs.length).invokeExact(collargs);
+                    byte[] listargs = Arrays.copyOfRange(args, 0, outputs);
+                    System.arraycopy(args, pos+collects, listargs, pos+1, outputs - (pos+1));
+                    listargs[pos] = coll;
+                    //System.out.println("  coll="+coll+" listargs="+Arrays.toString(listargs));
+                    Object expect = lister.asSpreader(byte[].class, listargs.length).invokeExact(listargs);
+                    //System.out.println("  expect="+expect);
+
+                    // now use the combined MH, and test the output:
+                    MethodHandle mh = collectArguments(lister, pos, byte[].class, BYTE_COLLECTORS[collects]);
+                    if (mh == null)  continue;  // no infix collection, yet
+                    assert(mh.type().parameterCount() == inputs);
+                    Object observe = mh.asSpreader(byte[].class, args.length).invokeExact(args);
+                    assertEquals(expect, observe);
+                }
+            }
+        }
+    }
+
+    private static MethodHandle collectArguments(MethodHandle lister, int pos, Class<?> array, MethodHandle collector) {
         int collects = collector.type().parameterCount();
         int outputs = lister.type().parameterCount();
         if (pos == outputs - 1)
             return MethodHandles.filterArguments(lister, pos,
-                        collector.asSpreader(int[].class, collects))
-                            .asCollector(int[].class, collects);
+                        collector.asSpreader(array, collects))
+                            .asCollector(array, collects);
         //return MethodHandles.collectArguments(lister, pos, collector); //no such animal
         return null;
     }
@@ -371,6 +411,62 @@
         //System.out.println("faultCount="+faultCount);
     }
 
+    @Test
+    public void testRecursion() throws Throwable {
+        if (!startTest("testRecursion"))  return;
+        final int LIMIT = 10;
+        for (int i = 0; i < LIMIT; i++) {
+            RFCB rfcb = new RFCB(i);
+            Object x = "x", y = "y";
+            Object result = rfcb.recursiveFunction(x, y);
+            verbose(1, result);
+        }
+    }
+    /** Recursive Function Control Block */
+    private static class RFCB {
+        java.util.Random random;
+        final MethodHandle[] fns;
+        int depth;
+        @SuppressWarnings("LeakingThisInConstructor")
+        RFCB(int seed) throws Throwable {
+            this.random = new java.util.Random(seed);
+            this.fns = new MethodHandle[Math.max(29, (1 << MAX_DEPTH-2)/3)];
+            java.util.Arrays.fill(fns, lookup().bind(this, "recursiveFunction", genericMethodType(2)));
+            for (int i = 5; i < fns.length; i++) {
+                switch (i % 4) {
+                case 0: fns[i] = filterArguments(fns[i - 5], 0, insertArguments(fns[i - 4], 1, ".")); break;
+                case 1: fns[i] = filterArguments(fns[i - 5], 1, insertArguments(fns[i - 3], 1, ".")); break;
+                case 2: fns[i] = filterReturnValue(fns[i - 5], insertArguments(fns[i - 2], 1, ".")); break;
+                }
+            }
+        }
+        Object recursiveFunction(Object x, Object y) throws Throwable {
+            depth++;
+            try {
+                final int ACTION_COUNT = 11;
+                switch (random.nextInt(ACTION_COUNT)) {
+                case 1:
+                    Throwable ex = new RuntimeException();
+                    ex.fillInStackTrace();
+                    if (VERBOSITY >= 2) ex.printStackTrace(System.out);
+                    x = "ST; " + x;
+                    break;
+                case 2:
+                    System.gc();
+                    x = "GC; " + x;
+                    break;
+                }
+                boolean isLeaf = (depth >= MAX_DEPTH);
+                if (isLeaf) {
+                    return Arrays.asList(x, y).toString();
+                }
+                return fns[random.nextInt(fns.length)].invokeExact(x, y);
+            } finally {
+                depth--;
+            }
+        }
+    }
+
     private static MethodHandle sequence(MethodHandle mh1, MethodHandle... mhs) {
         MethodHandle res = mh1;
         for (MethodHandle mh2 : mhs)
@@ -411,7 +507,7 @@
             return mh.invokeWithArguments(args);
         } catch (Throwable ex) {
             System.out.println("threw: "+mh+Arrays.asList(args));
-            ex.printStackTrace();
+            ex.printStackTrace(System.out);
             return ex;
         }
     }
@@ -459,8 +555,8 @@
     private static long opJ(long x) { return (long) opI((int)x); }
     private static Object opL2(Object x, Object y) { return (Object) opI2((int)x, (int)y); }
     private static Object opL(Object x) { return (Object) opI((int)x); }
-    private static int opL2_I(Object x, Object y) { return (int) opI2((int)x, (int)y); }
-    private static int opL_I(Object x) { return (int) opI((int)x); }
+    private static int opL2_I(Object x, Object y) { return opI2((int)x, (int)y); }
+    private static int opL_I(Object x) { return opI((int)x); }
     private static long opL_J(Object x) { return (long) opI((int)x); }
     private static final MethodHandle opI, opI2, opI3, opI4, opI_L, opJ, opJ2, opJ3, opL2, opL, opL2_I, opL_I, opL_J;
     static {
@@ -481,6 +577,9 @@
     private static final MethodHandle[] INT_COLLECTORS = {
         constant(int.class, 42), opI, opI2, opI3, opI4
     };
+    private static final MethodHandle[] BYTE_COLLECTORS = {
+        constant(byte.class, (byte)42), i2b(opI), i2b(opI2), i2b(opI3), i2b(opI4)
+    };
     private static final MethodHandle[] LONG_COLLECTORS = {
         constant(long.class, 42), opJ, opJ2, opJ3
     };
@@ -503,21 +602,36 @@
                                                              Collections.nCopies(8, int.class));
     private static final MethodHandle list8longs = findStatic("list8longs", Object.class,
                                                               Collections.nCopies(8, long.class));
-    private static final MethodHandle[] INT_LISTERS, LONG_LISTERS;
+    private static final MethodHandle[] INT_LISTERS, LONG_LISTERS, BYTE_LISTERS;
     static {
         int listerCount = list8ints.type().parameterCount() + 1;
         INT_LISTERS  = new MethodHandle[listerCount];
         LONG_LISTERS = new MethodHandle[listerCount];
+        BYTE_LISTERS = new MethodHandle[listerCount];
         MethodHandle lister = list8ints;
         MethodHandle llister = list8longs;
         for (int i = listerCount - 1; ; i--) {
             INT_LISTERS[i] = lister;
             LONG_LISTERS[i] = llister;
+            BYTE_LISTERS[i] = i2b(lister);
             if (i == 0)  break;
-            lister  = insertArguments(lister,  i-1, (int)0);
-            llister = insertArguments(llister, i-1, (long)0);
+            lister  = insertArguments(lister,  i-1, 0);
+            llister = insertArguments(llister, i-1, 0L);
         }
     }
+    private static MethodHandle i2b(MethodHandle mh) {
+        return MethodHandles.explicitCastArguments(mh, subst(mh.type(), int.class, byte.class));
+    }
+    private static MethodType subst(MethodType mt, Class<?> from, Class<?> to) {
+        for (int i = 0; i < mt.parameterCount(); i++) {
+            if (mt.parameterType(i) == from)
+                mt = mt.changeParameterType(i, to);
+        }
+        if (mt.returnType() == from)
+            mt = mt.changeReturnType(to);
+        return mt;
+    }
+
 
     private static Object  convI_L(int     x) { stress(); return (Object)  x; }
     private static int     convL_I(Object  x) { stress(); return (int)     x; }
@@ -536,6 +650,7 @@
     }
 
     // stress modes:
+    private static final int MAX_DEPTH = getProperty("MAX_DEPTH", 5);
     private static final int REPEAT = getProperty("REPEAT", 0);
     private static final int STRESS = getProperty("STRESS", 0);
     private static /*v*/ int STRESS_COUNT;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/lang/invoke/ThrowExceptionsTest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,229 @@
+/*
+ * Copyright (c) 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.
+ */
+
+/* @test
+ * @summary unit tests for method handles which permute their arguments
+ * @run junit test.java.lang.invoke.ThrowExceptionsTest
+ */
+
+package test.java.lang.invoke;
+
+import org.junit.*;
+
+import java.util.*;
+import java.lang.reflect.*;
+
+import java.lang.invoke.*;
+import static java.lang.invoke.MethodHandles.*;
+import static java.lang.invoke.MethodType.*;
+
+public class ThrowExceptionsTest {
+    private static final Class<?> CLASS = ThrowExceptionsTest.class;
+    private static final Lookup LOOKUP = lookup();
+
+    public static void main(String argv[]) throws Throwable {
+        new ThrowExceptionsTest().testAll((argv.length == 0 ? null : Arrays.asList(argv).toString()));
+    }
+
+    @Test
+    public void testWMT() throws Throwable {
+        // mostly call testWMTCallee, but sometimes call its void-returning variant
+        MethodHandle mh = testWMTCallee();
+        MethodHandle mh1 = mh.asType(mh.type().changeReturnType(void.class));
+        assert(mh1 != mh);
+        testWMT(mh, mh1, 1000);
+    }
+
+    @Test
+    public void testBoundWMT() throws Throwable {
+        // mostly call exactInvoker.bindTo(testWMTCallee), but sometimes call its void-returning variant
+        MethodHandle callee = testWMTCallee();
+        MethodHandle callee1 = callee.asType(callee.type().changeReturnType(void.class));
+        MethodHandle invoker = exactInvoker(callee.type());
+        MethodHandle mh  = invoker.bindTo(callee);
+        MethodHandle mh1 = invoker.bindTo(callee1);
+        testWMT(mh, mh1, 1000);
+    }
+
+    @Test
+    public void testFoldWMT() throws Throwable {
+        // mostly call exactInvoker.fold(constant(testWMTCallee)), but sometimes call its void-returning variant
+        MethodHandle callee = testWMTCallee();
+        MethodHandle callee1 = callee.asType(callee.type().changeReturnType(void.class));
+        MethodHandle invoker = exactInvoker(callee.type());
+        MethodHandle mh  = foldArguments(invoker, constant(MethodHandle.class, callee));
+        MethodHandle mh1 = foldArguments(invoker, constant(MethodHandle.class, callee1));
+        testWMT(mh, mh1, 1000);
+    }
+
+    @Test
+    public void testFoldCCE() throws Throwable {
+        MethodHandle callee = testWMTCallee();
+        MethodHandle callee1 = callee.asType(callee.type().changeParameterType(1, Number.class)).asType(callee.type());
+        MethodHandle invoker = exactInvoker(callee.type());
+        MethodHandle mh  = foldArguments(invoker, constant(MethodHandle.class, callee));
+        MethodHandle mh1 = foldArguments(invoker, constant(MethodHandle.class, callee1));
+        testWMT(mh, mh1, 1000);
+    }
+
+    @Test
+    public void testStackOverflow() throws Throwable {
+        MethodHandle callee = testWMTCallee();
+        MethodHandle callee1 = makeStackOverflow().asType(callee.type());
+        MethodHandle invoker = exactInvoker(callee.type());
+        MethodHandle mh  = foldArguments(invoker, constant(MethodHandle.class, callee));
+        MethodHandle mh1 = foldArguments(invoker, constant(MethodHandle.class, callee1));
+        for (int i = 0; i < REPEAT; i++) {
+            try {
+                testWMT(mh, mh1, 1000);
+            } catch (StackOverflowError ex) {
+                // OK, try again
+            }
+        }
+    }
+
+    private static MethodHandle makeStackOverflow() {
+        MethodType cellType = methodType(void.class);
+        MethodHandle[] cell = { null };  // recursion point
+        MethodHandle getCell = insertArguments(arrayElementGetter(cell.getClass()), 0, cell, 0);
+        MethodHandle invokeCell = foldArguments(exactInvoker(cellType), getCell);
+        assert(invokeCell.type() == cellType);
+        cell[0] = invokeCell;
+        // make it conformable to any type:
+        invokeCell = dropArguments(invokeCell, 0, Object[].class).asVarargsCollector(Object[].class);
+        return invokeCell;
+    }
+
+    static int testCases;
+
+    private void testAll(String match) throws Throwable {
+        testCases = 0;
+        Lookup lookup = lookup();
+        for (Method m : CLASS.getDeclaredMethods()) {
+            String name = m.getName();
+            if (name.startsWith("test") &&
+                (match == null || match.contains(name.substring("test".length()))) &&
+                m.getParameterTypes().length == 0 &&
+                Modifier.isPublic(m.getModifiers()) &&
+                !Modifier.isStatic(m.getModifiers())) {
+                System.out.println("["+name+"]");
+                int tc = testCases;
+                try {
+                    m.invoke(this);
+                } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) {
+                    System.out.println("*** "+ex);
+                    ex.printStackTrace(System.out);
+                }
+                if (testCases == tc)  testCases++;
+            }
+        }
+        if (testCases == 0)  throw new RuntimeException("no test cases found");
+        System.out.println("ran a total of "+testCases+" test cases");
+    }
+
+    private static MethodHandle findStatic(String name) {
+        return findMethod(name, true);
+    }
+    private static MethodHandle findVirtual(String name) {
+        return findMethod(name, false);
+    }
+    private static MethodHandle findMethod(String name, boolean isStatic) {
+        MethodHandle mh = null;
+        for (Method m : CLASS.getDeclaredMethods()) {
+            if (m.getName().equals(name) &&
+                Modifier.isStatic(m.getModifiers()) == isStatic) {
+                if (mh != null)
+                    throw new RuntimeException("duplicate methods: "+name);
+                try {
+                    mh = LOOKUP.unreflect(m);
+                } catch (ReflectiveOperationException ex) {
+                    throw new RuntimeException(ex);
+                }
+            }
+        }
+        if (mh == null)
+            throw new RuntimeException("no method: "+name);
+        return mh;
+    }
+
+    int testWMTCallee;
+    private int testWMTCallee(String x) {
+        return testWMTCallee++;
+    }
+    private static MethodHandle testWMTCallee() {
+        MethodHandle callee = findVirtual("testWMTCallee");
+        // FIXME: should not have to retype callee
+        callee = callee.asType(callee.type().changeParameterType(0, Object.class));
+        return callee;
+    }
+
+    private Exception testWMT(MethodHandle[] mhs, int reps) throws Throwable {
+        testCases += 1;
+        testWMTCallee = 0;
+        int catches = 0;
+        Exception savedEx = null;
+        for (int i = 0; i < reps; i++) {
+            MethodHandle mh = mhs[i % mhs.length];
+            int n;
+            try {
+                // FIXME: should not have to retype this
+                n = (int) mh.invokeExact((Object)this, "x");
+                assertEquals(n, i - catches);
+                // Using the exact type for this causes endless deopt due to
+                // 'non_cached_result' in SystemDictionary::find_method_handle_invoke.
+                // The problem is that the compiler thread needs to access a cached
+                // invoke method, but invoke methods are not cached if one of the
+                // component types is not on the BCP.
+            } catch (Exception ex) {
+                savedEx = ex;
+                catches++;
+            }
+        }
+        //VERBOSE: System.out.println("reps="+reps+" catches="+catches);
+        return savedEx;
+    }
+
+    private static final int REPEAT = Integer.getInteger(CLASS.getSimpleName()+".REPEAT", 10);
+
+    private Exception testWMT(MethodHandle mh, MethodHandle mh1, int reps) throws Throwable {
+        //VERBOSE: System.out.println("mh="+mh+" mh1="+mh1);
+        MethodHandle[] mhs = new MethodHandle[100];
+        Arrays.fill(mhs, mh);
+        int patch = mhs.length-1;
+        Exception savedEx = null;
+        for (int i = 0; i < REPEAT; i++) {
+            mhs[patch] = mh;
+            testWMT(mhs, 10000);
+            mhs[patch] = mh1;
+            savedEx = testWMT(mhs, reps);
+        }
+        return savedEx;
+    }
+
+    private static void assertEquals(Object x, Object y) {
+        if (x == y || x != null && x.equals(y))  return;
+        throw new RuntimeException(x+" != "+y);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/lang/invoke/remote/RemoteExample.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2009-2010 Sun Microsystems, Inc.  All Rights Reserved.
+ * 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.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package test.java.lang.invoke.remote;
+
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodHandles.Lookup;
+import test.java.lang.invoke.MethodHandlesTest;
+
+/**
+ * Out-of-package access into protected members of test.java.lang.invoke.remote.MethodHandle.PubExample.
+ */
+public class RemoteExample extends MethodHandlesTest.PubExample {
+    public RemoteExample() { super("RemoteExample"); }
+    public static Lookup lookup() { return MethodHandles.lookup(); }
+    public final     void fin_v0() { MethodHandlesTest.called("Rem/fin_v0", this); }
+    protected        void pro_v0() { MethodHandlesTest.called("Rem/pro_v0", this); }
+    protected static void pro_s0() { MethodHandlesTest.called("Rem/pro_s0"); }
+}
--- a/test/java/lang/management/ManagementFactory/MBeanServerMXBeanUnsupportedTest.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/lang/management/ManagementFactory/MBeanServerMXBeanUnsupportedTest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -29,7 +29,7 @@
  * @author Luis-Miguel Alventosa
  * @run clean MBeanServerMXBeanUnsupportedTest
  * @run build MBeanServerMXBeanUnsupportedTest
- * @run main MBeanServerMXBeanUnsupportedTest
+ * @run main/othervm MBeanServerMXBeanUnsupportedTest
  */
 
 import java.lang.management.ManagementFactory;
--- a/test/java/net/CookieHandler/B6791927.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/net/CookieHandler/B6791927.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -35,7 +35,7 @@
     public static final void main( String[] aaParamters ) throws Exception{
         // Forces a non US locale
         Locale.setDefault(Locale.FRANCE);
-        List<HttpCookie> cookies = HttpCookie.parse("set-cookie: CUSTOMER=WILE_E_COYOTE; expires=Wednesday, 09-Nov-2019 23:12:40 GMT");
+        List<HttpCookie> cookies = HttpCookie.parse("set-cookie: CUSTOMER=WILE_E_COYOTE; expires=Sat, 09-Nov-2019 23:12:40 GMT");
         if (cookies == null || cookies.isEmpty()) {
             throw new RuntimeException("No cookie found");
         }
--- a/test/java/net/CookieHandler/CookieManagerTest.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/net/CookieHandler/CookieManagerTest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -126,7 +126,7 @@
         testPolicies[count] = CookiePolicy.ACCEPT_ORIGINAL_SERVER;
         testCases[count++] = new CookieTestCase[]{
                 new CookieTestCase("Set-Cookie",
-                "CUSTOMER=WILE:BOB; path=/; expires=Wednesday, 09-Nov-2030 23:12:40 GMT;" + "domain=." + localHostAddr,
+                "CUSTOMER=WILE:BOB; path=/; expires=Sat, 09-Nov-2030 23:12:40 GMT;" + "domain=." + localHostAddr,
                 "CUSTOMER=WILE:BOB",
                 "/"
                 ),
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/net/CookieHandler/NullUriCookieTest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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 6953455
+ * @summary CookieStore.add() cannot handle null URI parameter
+ */
+
+import java.net.CookieManager;
+import java.net.CookieStore;
+import java.net.HttpCookie;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.List;
+
+public class NullUriCookieTest {
+    static boolean fail = false;
+
+    public static void main(String[] args) throws Exception {
+        checkCookieNullUri();
+    }
+
+    static void checkCookieNullUri() throws Exception {
+        //get a cookie store implementation and add a cookie to the store with null URI
+        CookieStore cookieStore = (new CookieManager()).getCookieStore();
+        HttpCookie cookie = new HttpCookie("MY_COOKIE", "MY_COOKIE_VALUE");
+        cookie.setDomain("foo.com");
+        cookieStore.add(null, cookie);
+
+        //Retrieve added cookie
+        URI uri = new URI("http://foo.com");
+        List<HttpCookie> addedCookieList = cookieStore.get(uri);
+
+        //Verify CookieStore behaves well
+        if (addedCookieList.size() != 1) {
+           fail = true;
+        }
+        checkFail("Abnormal size of cookie jar");
+
+        for (HttpCookie chip : addedCookieList) {
+            if (!chip.equals(cookie)) {
+                 fail = true;
+            }
+        }
+        checkFail("Cookie not retrieved from Cookie Jar");
+        boolean ret = cookieStore.remove(null,cookie);
+        if (!ret) {
+            fail = true;
+        }
+        checkFail("Abnormal removal behaviour from Cookie Jar");
+    }
+
+    static void checkFail(String exp) {
+        if (fail) {
+            throw new RuntimeException(exp);
+        }
+    }
+}
+
--- a/test/java/net/DatagramPacket/ReuseBuf.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/net/DatagramPacket/ReuseBuf.java	Fri Jun 21 19:11:42 2013 -0700
@@ -29,7 +29,6 @@
  * @summary DatagramPacket spec needs clarification (reuse buf)
  */
 import java.net.*;
-import java.io.*;
 
 public class ReuseBuf {
     static String msgs[] = {"Hello World", "Java", "Good Bye"};
@@ -74,7 +73,7 @@
         DatagramPacket dp = new DatagramPacket(b,b.length);
         for (int i = 0; i < msgs.length; i++) {
             ds.send(new DatagramPacket(msgs[i].getBytes(),msgs[i].length(),
-                                       InetAddress.getByName("LocalHost"),
+                                       InetAddress.getLocalHost(),
                                        port));
             ds.receive(dp);
             if (!msgs[i].equals(new String(dp.getData(), dp.getOffset(), dp.getLength()))) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/net/HttpCookie/ExpiredCookieTest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,98 @@
+/*
+ * 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 8000525
+ */
+
+import java.net.*;
+import java.util.*;
+import java.io.*;
+import java.text.*;
+
+public class ExpiredCookieTest {
+    // lifted from HttpCookie.java
+    private final static String[] COOKIE_DATE_FORMATS = {
+        "EEE',' dd-MMM-yy HH:mm:ss 'GMT'",
+        "EEE',' dd MMM yy HH:mm:ss 'GMT'",
+        "EEE MMM dd yy HH:mm:ss 'GMT'Z",
+        "EEE',' dd-MMM-yyyy HH:mm:ss 'GMT'",
+        "EEE',' dd MMM yyyy HH:mm:ss 'GMT'",
+        "EEE MMM dd yyyy HH:mm:ss 'GMT'Z"
+    };
+    static final TimeZone GMT = TimeZone.getTimeZone("GMT");
+
+    public static void main(String[] args) throws Exception {
+        Calendar cal = Calendar.getInstance(GMT);
+
+        for (int i = 0; i < COOKIE_DATE_FORMATS.length; i++) {
+            SimpleDateFormat df = new SimpleDateFormat(COOKIE_DATE_FORMATS[i],
+                                                     Locale.US);
+            cal.set(1970, 0, 1, 0, 0, 0);
+            df.setTimeZone(GMT);
+            df.setLenient(false);
+            df.set2DigitYearStart(cal.getTime());
+            CookieManager cm = new CookieManager(
+                null, CookiePolicy.ACCEPT_ALL);
+            CookieHandler.setDefault(cm);
+            Map<String,List<String>> header = new HashMap<>();
+            List<String> values = new ArrayList<>();
+
+            cal.set(1970, 6, 9, 10, 10, 1);
+            StringBuilder datestring =
+                new StringBuilder(df.format(cal.getTime()));
+            values.add(
+                "TEST1=TEST1; Path=/; Expires=" + datestring.toString());
+
+            cal.set(1969, 6, 9, 10, 10, 2);
+            datestring = new StringBuilder(df.format(cal.getTime()));
+            values.add(
+                "TEST2=TEST2; Path=/; Expires=" + datestring.toString());
+
+            cal.set(2070, 6, 9, 10, 10, 3);
+            datestring = new StringBuilder(df.format(cal.getTime()));
+            values.add(
+                "TEST3=TEST3; Path=/; Expires=" + datestring.toString());
+
+            cal.set(2069, 6, 9, 10, 10, 4);
+            datestring = new StringBuilder(df.format(cal.getTime()));
+            values.add(
+                "TEST4=TEST4; Path=/; Expires=" + datestring.toString());
+
+            header.put("Set-Cookie", values);
+            cm.put(new URI("http://127.0.0.1/"), header);
+
+            CookieStore cookieJar =  cm.getCookieStore();
+            List <HttpCookie> cookies = cookieJar.getCookies();
+            if (COOKIE_DATE_FORMATS[i].contains("yyyy")) {
+                if (cookies.size() != 2)
+                    throw new RuntimeException(
+                        "Incorrectly parsing a bad date");
+            } else if (cookies.size() != 1) {
+                throw new RuntimeException(
+                    "Incorrectly parsing a bad date");
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/net/Inet4Address/PingThis.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,91 @@
+/*
+ * 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.
+ */
+
+/*
+ * Portions Copyright (c) 2012 IBM Corporation
+ */
+
+/* @test
+ * @bug 7163874
+ * @summary InetAddress.isReachable is returning false
+ *          for InetAdress 0.0.0.0 and ::0
+ * @run main PingThis
+ * @run main/othervm -Djava.net.preferIPv4Stack=true PingThis
+ */
+
+import java.net.Inet6Address;
+import java.net.InetAddress;
+import java.net.NetworkInterface;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+public class PingThis {
+    private static boolean hasIPv6() throws Exception {
+        List<NetworkInterface> nics = Collections.list(NetworkInterface
+                .getNetworkInterfaces());
+        for (NetworkInterface nic : nics) {
+            List<InetAddress> addrs = Collections.list(nic.getInetAddresses());
+            for (InetAddress addr : addrs) {
+                if (addr instanceof Inet6Address)
+                    return true;
+            }
+        }
+
+        return false;
+    }
+
+    public static void main(String args[]) throws Exception {
+        if (System.getProperty("os.name").startsWith("Windows")) {
+            return;
+        }
+
+        boolean preferIPv4Stack = "true".equals(System
+                .getProperty("java.net.preferIPv4Stack"));
+        List<String> addrs = new ArrayList<String>();
+        InetAddress inetAddress = null;
+
+        addrs.add("0.0.0.0");
+        if (!preferIPv4Stack) {
+            if (hasIPv6()) {
+                addrs.add("::0");
+            }
+        }
+
+        for (String addr : addrs) {
+            inetAddress = InetAddress.getByName(addr);
+            System.out.println("The target ip is "
+                    + inetAddress.getHostAddress());
+            boolean isReachable = inetAddress.isReachable(3000);
+            System.out.println("the target is reachable: " + isReachable);
+            if (isReachable) {
+                System.out.println("Test passed ");
+            } else {
+                System.out.println("Test failed ");
+                throw new Exception("address " + inetAddress.getHostAddress()
+                        + " can not be reachable!");
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/net/ProxySelector/MultiThreadedSystemProxies.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,63 @@
+/*
+ * 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 7188755
+ * @run main/othervm MultiThreadedSystemProxies
+ * @summary Crash due to missing synchronization on gconf_client in
+ *          DefaultProxySelector.c
+ */
+import java.net.ProxySelector;
+import java.net.URI;
+
+/* Racey test, not guaranteed to fail, but if it does we have a problem. */
+
+public class MultiThreadedSystemProxies {
+    static final int NUM_THREADS = 100;
+
+    public static void main(String[] args) throws Exception {
+        System.setProperty("java.net.useSystemProxies", "true");
+        final ProxySelector ps = ProxySelector.getDefault();
+        final URI uri = new URI("http://ubuntu.com");
+        Thread[] threads = new Thread[NUM_THREADS];
+
+        for (int i = 0; i < NUM_THREADS; i++) {
+            threads[i] = new Thread(new Runnable() {
+                @Override
+                public void run() {
+                    try {
+                        ps.select(uri);
+                    } catch (Exception x) {
+                        throw new RuntimeException(x);
+                    }
+                }
+            });
+        }
+        for (int i = 0; i < NUM_THREADS; i++) {
+            threads[i].start();
+        }
+        for (int i = 0; i < NUM_THREADS; i++) {
+            threads[i].join();
+        }
+    }
+}
--- a/test/java/nio/channels/AsyncCloseAndInterrupt.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/nio/channels/AsyncCloseAndInterrupt.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,17 +22,24 @@
  */
 
 /* @test
- * @bug 4460583 4470470 4840199 6419424 6710579 6596323 6824135 6395224
+ * @bug 4460583 4470470 4840199 6419424 6710579 6596323 6824135 6395224 7142919
+ * @run main/othervm AsyncCloseAndInterrupt
  * @summary Comprehensive test of asynchronous closing and interruption
  * @author Mark Reinhold
  */
 
 import java.io.*;
 import java.net.*;
-import java.nio.*;
 import java.nio.channels.*;
-import java.util.*;
-
+import java.nio.ByteBuffer;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.Callable;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
 
 public class AsyncCloseAndInterrupt {
 
@@ -79,45 +86,12 @@
     // Server socket that refuses all connections
 
     static ServerSocketChannel refuser;
-    static List refuserClients = new ArrayList();
 
     private static void initRefuser() throws IOException {
         refuser = ServerSocketChannel.open();
         refuser.socket().bind(wildcardAddress);
-        pumpRefuser("Initializing refuser...");
     }
 
-    private static void pumpRefuser(String msg) throws IOException {
-        // Can't reliably saturate connection backlog on Windows Server editions
-        assert !TestUtil.onWindows();
-
-        log.print(msg);
-        int n = refuserClients.size();
-
-        // Saturate the refuser's connection backlog so that further connection
-        // attempts will block
-        //
-        outer:
-        for (;;) {
-            SocketChannel sc = SocketChannel.open();
-            sc.configureBlocking(false);
-            if (!sc.connect(refuser.socket().getLocalSocketAddress())) {
-                for (int i = 0; i < 20; i++) {
-                    Thread.yield();
-                    if (sc.finishConnect())
-                        break;
-                    if (i >= 19)
-                        break outer;
-                }
-            }
-            // Retain so that finalizer doesn't close
-            refuserClients.add(sc);
-        }
-
-        log.println("  " + (refuserClients.size() - n) + " connections");
-    }
-
-
     // Dead pipe source and sink
 
     static Pipe.SourceChannel deadSource;
@@ -374,8 +348,8 @@
         };
 
     static final Op CONNECT = new Op("connect") {
-            void setup() throws IOException {
-                pumpRefuser("Pumping refuser ...");
+            void setup() {
+                waitPump("connect wait for pumping refuser ...");
             }
             void doIO(InterruptibleChannel ich) throws IOException {
                 SocketChannel sc = (SocketChannel)ich;
@@ -386,8 +360,8 @@
         };
 
     static final Op FINISH_CONNECT = new Op("finishConnect") {
-            void setup() throws IOException {
-                pumpRefuser("Pumping refuser ...");
+            void setup() {
+                waitPump("finishConnect wait for pumping refuser ...");
             }
             void doIO(InterruptibleChannel ich) throws IOException {
                 SocketChannel sc = (SocketChannel)ich;
@@ -462,6 +436,7 @@
             this.test = test;
         }
 
+        @SuppressWarnings("fallthrough")
         private void caught(Channel ch, IOException x) {
             String xn = x.getClass().getName();
             switch (test) {
@@ -519,9 +494,63 @@
 
     }
 
+    private static volatile boolean pumpDone = false;
+    private static volatile boolean pumpReady = false;
 
-    // Tests
+    private static void waitPump(String msg){
+        pumpReady = false;
+        log.println(msg);
+
+        while (!pumpReady){
+            sleep(200);
+        }
+    }
+
+    // Create a pump thread dedicated to saturate refuser's connection backlog
+    private static Future<Integer> pumpRefuser(ExecutorService pumperExecutor) {
+
+        Callable<Integer> pumpTask = new Callable<Integer>() {
+
+            @Override
+            public Integer call() throws IOException {
+                // Can't reliably saturate connection backlog on Windows Server editions
+                assert !TestUtil.onWindows();
+                log.println("Start pumping refuser ...");
+                List<SocketChannel> refuserClients = new ArrayList<>();
 
+                // Saturate the refuser's connection backlog so that further connection
+                // attempts will be blocked
+                while (!pumpDone) {
+                    SocketChannel sc = SocketChannel.open();
+                    sc.configureBlocking(false);
+                    boolean connected = sc.connect(refuser.socket().getLocalSocketAddress());
+
+                    // Assume that the connection backlog is saturated if a
+                    // client cannot connect to the refuser within 50 miliseconds
+                    long start = System.currentTimeMillis();
+                    while (!connected && (System.currentTimeMillis() - start < 50)) {
+                        connected = sc.finishConnect();
+                    }
+
+                    if (connected) {
+                        // Retain so that finalizer doesn't close
+                        refuserClients.add(sc);
+                        pumpReady = false;
+                    } else {
+                        sc.close();
+                        pumpReady = true;
+                    }
+                }
+
+                log.println("Stop pumping refuser ...");
+                return refuserClients.size();
+            }
+        };
+
+        return pumperExecutor.submit(pumpTask);
+    }
+
+    // Test
     static void test(ChannelFactory cf, Op op, int test)
         throws Exception
     {
@@ -667,15 +696,40 @@
             log.println("WARNING Cannot reliably test connect/finishConnect"
                 + " operations on Windows");
         } else {
-            test(socketChannelFactory, CONNECT);
-            test(socketChannelFactory, FINISH_CONNECT);
+            // Only the following tests need refuser's connection backlog
+            // to be saturated
+            ExecutorService pumperExecutor =
+                    Executors.newSingleThreadExecutor(
+                    new ThreadFactory() {
+
+                        @Override
+                        public Thread newThread(Runnable r) {
+                            Thread t = new Thread(r);
+                            t.setDaemon(true);
+                            t.setName("Pumper");
+                            return t;
+                        }
+                    });
+
+            pumpDone = false;
+            try {
+                Future<Integer> pumpFuture = pumpRefuser(pumperExecutor);
+                waitPump("\nWait for initial Pump");
+
+                test(socketChannelFactory, CONNECT);
+                test(socketChannelFactory, FINISH_CONNECT);
+
+                pumpDone = true;
+                Integer newConn = pumpFuture.get(30, TimeUnit.SECONDS);
+                log.println("Pump " + newConn + " connections.");
+            } finally {
+                pumperExecutor.shutdown();
+            }
         }
 
         test(serverSocketChannelFactory, ACCEPT);
         test(datagramChannelFactory);
         test(pipeSourceChannelFactory);
         test(pipeSinkChannelFactory);
-
     }
-
 }
--- a/test/java/nio/channels/DatagramChannel/Connect.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/nio/channels/DatagramChannel/Connect.java	Fri Jun 21 19:11:42 2013 -0700
@@ -22,6 +22,7 @@
  */
 
 /* @test
+ * @bug 4313882 7183800
  * @summary Test DatagramChannel's send and receive methods
  * @author Mike McCloskey
  */
@@ -88,6 +89,9 @@
                 bb.put("hello".getBytes());
                 bb.flip();
                 InetAddress address = InetAddress.getLocalHost();
+                if (address.isLoopbackAddress()) {
+                    address = InetAddress.getLoopbackAddress();
+                }
                 InetSocketAddress isa = new InetSocketAddress(address, port);
                 dc.connect(isa);
                 dc.write(bb);
--- a/test/java/nio/channels/DatagramChannel/ConnectedSend.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/nio/channels/DatagramChannel/ConnectedSend.java	Fri Jun 21 19:11:42 2013 -0700
@@ -22,7 +22,7 @@
  */
 
 /* @test
- * @bug 4849277
+ * @bug 4849277 7183800
  * @summary Test DatagramChannel send while connected
  * @author Mike McCloskey
  */
@@ -46,14 +46,18 @@
 
         DatagramChannel sndChannel = DatagramChannel.open();
         sndChannel.socket().bind(null);
+        InetAddress address = InetAddress.getLocalHost();
+        if (address.isLoopbackAddress()) {
+            address = InetAddress.getLoopbackAddress();
+        }
         InetSocketAddress sender = new InetSocketAddress(
-            InetAddress.getLocalHost(),
+            address,
             sndChannel.socket().getLocalPort());
 
         DatagramChannel rcvChannel = DatagramChannel.open();
         rcvChannel.socket().bind(null);
         InetSocketAddress receiver = new InetSocketAddress(
-            InetAddress.getLocalHost(),
+            address,
             rcvChannel.socket().getLocalPort());
 
         rcvChannel.connect(sender);
@@ -80,14 +84,18 @@
     private static void test2() throws Exception {
         DatagramChannel sndChannel = DatagramChannel.open();
         sndChannel.socket().bind(null);
+        InetAddress address = InetAddress.getLocalHost();
+        if (address.isLoopbackAddress()) {
+            address = InetAddress.getLoopbackAddress();
+        }
         InetSocketAddress sender = new InetSocketAddress(
-            InetAddress.getLocalHost(),
+            address,
             sndChannel.socket().getLocalPort());
 
         DatagramChannel rcvChannel = DatagramChannel.open();
         rcvChannel.socket().bind(null);
         InetSocketAddress receiver = new InetSocketAddress(
-            InetAddress.getLocalHost(),
+            address,
             rcvChannel.socket().getLocalPort());
 
         rcvChannel.connect(sender);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/nio/channels/DatagramChannel/Disconnect.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,77 @@
+/*
+ * 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 7132924
+ * @summary Test DatagramChannel.disconnect when DatagramChannel is connected to an IPv4 socket
+ * @run main Disconnect
+ * @run main/othervm -Djava.net.preferIPv4Stack=true Disconnect
+ */
+
+import java.net.*;
+import java.nio.*;
+import java.nio.channels.*;
+import java.io.IOException;
+
+public class Disconnect {
+    public static void main(String[] args) throws IOException {
+        // test with default protocol family
+        try (DatagramChannel dc = DatagramChannel.open()) {
+            test(dc);
+            test(dc);
+        }
+
+        // test with IPv4 only
+        try (DatagramChannel dc = DatagramChannel.open(StandardProtocolFamily.INET)) {
+            test(dc);
+            test(dc);
+        }
+    }
+
+    /**
+     * Connect DatagramChannel to a server, write a datagram and disconnect. Invoke
+     * a second or subsequent time with the same DatagramChannel instance to check
+     * that disconnect works as expected.
+     */
+    static void test(DatagramChannel dc) throws IOException {
+        try (DatagramChannel server = DatagramChannel.open()) {
+            server.bind(new InetSocketAddress(0));
+
+            InetAddress lh = InetAddress.getLocalHost();
+            dc.connect(new InetSocketAddress(lh, server.socket().getLocalPort()));
+
+            dc.write(ByteBuffer.wrap("hello".getBytes()));
+
+            ByteBuffer bb = ByteBuffer.allocate(100);
+            server.receive(bb);
+
+            dc.disconnect();
+
+            try {
+                dc.write(ByteBuffer.wrap("another message".getBytes()));
+                throw new RuntimeException("write should fail, not connected");
+            } catch (NotYetConnectedException expected) {
+            }
+        }
+    }
+}
--- a/test/java/nio/channels/DatagramChannel/MulticastSendReceiveTests.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/nio/channels/DatagramChannel/MulticastSendReceiveTests.java	Fri Jun 21 19:11:42 2013 -0700
@@ -22,10 +22,11 @@
  */
 
 /* @test
- * @bug 4527345 7026376
+ * @bug 4527345 7026376 6633549
  * @summary Unit test for DatagramChannel's multicast support
  * @build MulticastSendReceiveTests NetworkConfiguration
  * @run main MulticastSendReceiveTests
+ * @run main/othervm -Djava.net.preferIPv4Stack=true MulticastSendReceiveTests
  */
 
 import java.nio.ByteBuffer;
@@ -186,6 +187,10 @@
                 id = sendDatagram(source, nif, group, port);
                 receiveDatagram(dc, source, id);
             } catch (UnsupportedOperationException x) {
+                String os = System.getProperty("os.name");
+                // Exclude-mode filtering supported on these platforms so UOE should never be thrown
+                if (os.equals("SunOS") || os.equals("Linux"))
+                    throw x;
                 System.out.println("Exclude-mode filtering not supported!");
             }
 
@@ -212,6 +217,10 @@
                 id = sendDatagram(source, nif, group, port);
                 receiveDatagram(dc, source, id);
             } catch (UnsupportedOperationException x) {
+                String os = System.getProperty("os.name");
+                // Include-mode filtering supported on these platforms so UOE should never be thrown
+                if (os.equals("SunOS") || os.equals("Linux"))
+                    throw x;
                 System.out.println("Include-mode filtering not supported!");
             }
         }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/nio/channels/FileChannel/InterruptDeadlock.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,137 @@
+/*
+ * 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.
+ */
+
+/* @test
+ * @bug 8012019
+ * @summary Tests interruption of threads doing position-based read methods in
+ *   an attempt to provoke a deadlock between position sensitive and position
+ *   insensitive methods
+ */
+import java.nio.ByteBuffer;
+import java.nio.channels.*;
+import java.nio.file.*;
+import static java.nio.file.StandardOpenOption.*;
+
+public class InterruptDeadlock {
+
+    /**
+     * A thread that continuously reads from a FileChannel with
+     * read(ByteBuffer,long). The thread terminates when interrupted and/or
+     * the FileChannel is closed.
+     */
+    static class Reader extends Thread {
+        final FileChannel fc;
+        volatile Exception exception;
+
+        Reader(FileChannel fc) {
+            this.fc = fc;
+        }
+
+        @Override
+        public void run() {
+            ByteBuffer bb = ByteBuffer.allocate(1024);
+            try {
+                long pos = 0L;
+                for (;;) {
+                    bb.clear();
+                    int n = fc.read(bb, pos);
+                    if (n > 0)
+                        pos += n;
+                    // fc.size is important here as it is position sensitive
+                    if (pos > fc.size())
+                        pos = 0L;
+                }
+            } catch (ClosedChannelException x) {
+                System.out.println(x.getClass() + " (expected)");
+            } catch (Exception unexpected) {
+                this.exception = unexpected;
+            }
+        }
+
+        Exception exception() {
+            return exception;
+        }
+
+        static Reader startReader(FileChannel fc) {
+            Reader r = new Reader(fc);
+            r.start();
+            return r;
+        }
+    }
+
+    // the number of reader threads to start
+    private static final int READER_COUNT = 4;
+
+    public static void main(String[] args) throws Exception {
+        Path file = Paths.get("data.txt");
+        try (FileChannel fc = FileChannel.open(file, CREATE, TRUNCATE_EXISTING, WRITE)) {
+            fc.position(1024L * 1024L);
+            fc.write(ByteBuffer.wrap(new byte[1]));
+        }
+
+        Reader[] readers = new Reader[READER_COUNT];
+
+        for (int i=1; i<=20; i++) {
+            System.out.format("Iteration: %s%n", i);
+
+            try (FileChannel fc = FileChannel.open(file)) {
+                boolean failed = false;
+
+                // start reader threads
+                for (int j=0; j<READER_COUNT; j++) {
+                    readers[j] = Reader.startReader(fc);
+                }
+
+                // give readers a bit of time to get started (not strictly required)
+                Thread.sleep(100);
+
+                // interrupt and wait for the readers to terminate
+                for (Reader r: readers) {
+                    r.interrupt();
+                }
+                for (Reader r: readers) {
+                    try {
+                        r.join(10000);
+                        Exception e = r.exception();
+                        if (e != null) {
+                            System.err.println("Reader thread failed with: " + e);
+                            failed = true;
+                        }
+                    } catch (InterruptedException x) {
+                        System.err.println("Reader thread did not terminte");
+                        failed = true;
+                    }
+                }
+
+                // the channel should not be open at this point
+                if (fc.isOpen()) {
+                    System.err.println("FileChannel was not closed");
+                    failed = true;
+                }
+
+                if (failed)
+                    throw new RuntimeException("Test failed - see log for details");
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/nio/channels/SelectionKey/RacyRegister.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,71 @@
+/*
+ * 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 7132889
+ * @summary Test that register does not return a valid SelectionKey when
+ *    invoked at around the time that the channel is closed
+ */
+
+import java.nio.channels.*;
+import java.util.concurrent.*;
+import java.util.Random;
+import java.io.IOException;
+
+public class RacyRegister {
+
+    public static void main(String[] args) throws Exception {
+        ExecutorService pool = Executors.newFixedThreadPool(1);
+        try (Selector sel = Selector.open()) {
+            int count = 100;
+            while (count-- > 0) {
+                final SocketChannel sc = SocketChannel.open();
+                sc.configureBlocking(false);
+
+                // close channel asynchronously
+                Future<Void> result = pool.submit(new Callable<Void>() {
+                    public Void call() throws IOException {
+                        sc.close();
+                        return null;
+                    }
+                });
+
+                // attempt to register channel with Selector
+                SelectionKey key = null;
+                try {
+                    key = sc.register(sel, SelectionKey.OP_READ);
+                } catch (ClosedChannelException ignore) {
+                }
+
+                // ensure close is done
+                result.get();
+
+                // if we have a key then it should be invalid
+                if (key != null && key.isValid())
+                    throw new RuntimeException("Key is valid");
+            }
+        } finally {
+            pool.shutdown();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/nio/channels/Selector/RacyDeregister.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,148 @@
+/*
+ * 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.
+ */
+
+/*
+ * Portions Copyright (c) 2012 IBM Corporation
+ */
+
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.nio.channels.SelectionKey;
+import java.nio.channels.Selector;
+import java.nio.channels.ServerSocketChannel;
+import java.nio.channels.SocketChannel;
+
+/*
+ * @test
+ * @bug 6429204
+ * @summary SelectionKey.interestOps does not update interest set on Windows.
+ * @author Frank Ding
+ */
+public class RacyDeregister {
+
+    static boolean notified;
+    static final Object selectorLock = new Object();
+    static final Object notifyLock = new Object();
+    /**
+     * null: not terminated
+     * true: passed
+     * false: failed
+     */
+    static volatile Boolean succTermination = null;
+
+    public static void main(String[] args) throws Exception {
+        InetAddress addr = InetAddress.getByName(null);
+        ServerSocketChannel sc = ServerSocketChannel.open();
+        sc.socket().bind(new InetSocketAddress(addr, 0));
+
+        SocketChannel.open(new InetSocketAddress(addr,
+                sc.socket().getLocalPort()));
+
+        SocketChannel accepted = sc.accept();
+        accepted.configureBlocking(false);
+
+        SocketChannel.open(new InetSocketAddress(addr,
+                sc.socket().getLocalPort()));
+        SocketChannel accepted2 = sc.accept();
+        accepted2.configureBlocking(false);
+
+        final Selector sel = Selector.open();
+        SelectionKey key2 = accepted2.register(sel, SelectionKey.OP_READ);
+        final SelectionKey[] key = new SelectionKey[]{
+            accepted.register(sel, SelectionKey.OP_READ)};
+
+
+        // thread that will be changing key[0].interestOps to OP_READ | OP_WRITE
+        new Thread() {
+
+            public void run() {
+                try {
+                    for (int k = 0; k < 15; k++) {
+                        for (int i = 0; i < 10000; i++) {
+                            synchronized (notifyLock) {
+                                synchronized (selectorLock) {
+                                    sel.wakeup();
+                                    key[0].interestOps(SelectionKey.OP_READ
+                                            | SelectionKey.OP_WRITE);
+                                }
+                                notified = false;
+                                long beginTime = System.currentTimeMillis();
+                                while (true) {
+                                    notifyLock.wait(5000);
+                                    if (notified) {
+                                        break;
+                                    }
+                                    long endTime = System.currentTimeMillis();
+                                    if (endTime - beginTime > 5000) {
+                                        succTermination = false;
+                                        // wake up main thread doing select()
+                                        sel.wakeup();
+                                        return;
+                                    }
+                                }
+                            }
+                        }
+                    }
+                    succTermination = true;
+                    // wake up main thread doing select()
+                    sel.wakeup();
+                } catch (Exception e) {
+                    System.out.println(e);
+                    succTermination = true;
+                    // wake up main thread doing select()
+                    sel.wakeup();
+                }
+            }
+        }.start();
+
+        // main thread will be doing registering/deregistering with the sel
+        while (true) {
+            sel.select();
+            if (Boolean.TRUE.equals(succTermination)) {
+                System.out.println("Test passed");
+                sel.close();
+                sc.close();
+                break;
+            } else if (Boolean.FALSE.equals(succTermination)) {
+                System.out.println("Failed to pass the test");
+                sel.close();
+                sc.close();
+                throw new RuntimeException("Failed to pass the test");
+            }
+            synchronized (selectorLock) {
+            }
+            if (sel.selectedKeys().contains(key[0]) && key[0].isWritable()) {
+                synchronized (notifyLock) {
+                    notified = true;
+                    notifyLock.notify();
+                    key[0].cancel();
+                    sel.selectNow();
+                    key2 = accepted2.register(sel, SelectionKey.OP_READ);
+                    key[0] = accepted.register(sel, SelectionKey.OP_READ);
+                }
+            }
+            key2.cancel();
+            sel.selectedKeys().clear();
+        }
+    }
+}
--- a/test/java/nio/channels/Selector/lots_of_updates.sh	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/nio/channels/Selector/lots_of_updates.sh	Fri Jun 21 19:11:42 2013 -0700
@@ -46,4 +46,4 @@
     ulimit -n 2048
 fi
 
-${TESTJAVA}/bin/java LotsOfUpdates
+${TESTJAVA}/bin/java ${TESTVMOPTS} LotsOfUpdates
--- a/test/java/nio/channels/SocketChannel/Open.sh	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/nio/channels/SocketChannel/Open.sh	Fri Jun 21 19:11:42 2013 -0700
@@ -29,7 +29,7 @@
     case "$OS" in
         SunOS )
             ulimit -n 100
-            $TESTJAVA/bin/java -classpath $TESTCLASSES Open ;;
+            $TESTJAVA/bin/java ${TESTVMOPTS} -classpath $TESTCLASSES Open ;;
         * )
             echo "unrecognized system: $OS" ;;
     esac
--- a/test/java/nio/channels/spi/SelectorProvider/inheritedChannel/Launcher.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/nio/channels/spi/SelectorProvider/inheritedChannel/Launcher.java	Fri Jun 21 19:11:42 2013 -0700
@@ -133,8 +133,11 @@
         dc.close();
 
         dc = DatagramChannel.open();
-
-        InetSocketAddress isa = new InetSocketAddress(InetAddress.getLocalHost(), port);
+        InetAddress address = InetAddress.getLocalHost();
+        if (address.isLoopbackAddress()) {
+            address = InetAddress.getLoopbackAddress();
+        }
+        InetSocketAddress isa = new InetSocketAddress(address, port);
 
         dc.connect(isa);
         return dc;
--- a/test/java/nio/file/Files/Misc.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/nio/file/Files/Misc.java	Fri Jun 21 19:11:42 2013 -0700
@@ -22,7 +22,7 @@
  */
 
 /* @test
- * @bug 4313887 6838333
+ * @bug 4313887 6838333 8005566
  * @summary Unit test for miscellenous methods in java.nio.file.Files
  * @library ..
  */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/nio/file/Files/NameLimits.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,103 @@
+/*
+ * 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.
+ */
+
+/* @test
+ * @bug 8011128
+ * @summary Test file and directory name limits. This test is primarily
+ *   intended to test Files.createDirectory on resolved paths at or around
+ *   the short path limit of 248 on Windows.
+ */
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+public class NameLimits {
+
+    static final int MAX_PATH = 255;
+    static final int MIN_PATH = 8;     // arbitrarily chosen
+
+    static Path generatePath(int len) {
+        if (len < MIN_PATH)
+            throw new RuntimeException("Attempting to generate path less than MIN_PATH");
+        StringBuilder sb = new StringBuilder(len);
+        sb.append("name");
+        while (sb.length() < len) {
+            sb.append('X');
+        }
+        return Paths.get(sb.toString());
+    }
+
+    static boolean tryCreateFile(int len) throws IOException {
+        Path name = generatePath(len);
+        try {
+            Files.createFile(name);
+        } catch (IOException ioe) {
+            System.err.format("Unable to create file of length %d (full path %d), %s%n",
+                name.toString().length(), name.toAbsolutePath().toString().length(), ioe);
+            return false;
+        }
+        Files.delete(name);
+        return true;
+    }
+
+    static boolean tryCreateDirectory(int len) throws IOException {
+        Path name = generatePath(len);
+        try {
+            Files.createDirectory(name);
+        } catch (IOException ioe) {
+            System.err.format("Unable to create directory of length %d (full path %d), %s%n",
+                name.toString().length(), name.toAbsolutePath().toString().length(), ioe);
+            return false;
+        }
+        Files.delete(name);
+        return true;
+    }
+
+    public static void main(String[] args) throws Exception {
+        int len;
+
+        // find the maximum file name if MAX_PATH or less
+        len = MAX_PATH;
+        while (!tryCreateFile(len)) {
+            len--;
+        }
+        System.out.format("Testing createFile on paths %d .. %d%n", MIN_PATH, len);
+        while (len >= MIN_PATH) {
+            if (!tryCreateFile(len--))
+                throw new RuntimeException("Test failed");
+        }
+
+        // find the maximum directory name if MAX_PATH or less
+        len = MAX_PATH;
+        while (!tryCreateDirectory(len)) {
+            len--;
+        }
+        System.out.format("Testing createDirectory on paths %d .. %d%n", MIN_PATH, len);
+        while (len >= MIN_PATH) {
+            if (!tryCreateDirectory(len--))
+                throw new RuntimeException("Test failed");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/nio/file/Path/MacPathTest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,177 @@
+/*
+ * 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.
+ *
+ * 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 7130915
+ * @summary Tests file path with nfc/nfd forms on MacOSX
+ * @library ../
+ * @build MacPathTest
+ * @run shell MacPathTest.sh
+ */
+
+import java.nio.file.*;
+import java.nio.file.attribute.*;
+import java.text.*;
+import java.util.*;
+import java.util.regex.*;
+
+public class MacPathTest {
+
+    public static void main(String args[]) throws Throwable {
+        String osname = System.getProperty("os.name");
+        if (!osname.contains("OS X") && !osname.contains("Darwin"))
+            return;
+        System.out.printf("sun.jnu.encoding=%s, file.encoding=%s%n",
+                          System.getProperty("file.encoding"),
+                          System.getProperty("sun.jnu.encoding"));
+        // English
+        test("TestDir_apple",                                    // test dir
+             "dir_macosx",                                       // dir
+             "file_macosx");                                     // file
+
+        // Japanese composite character
+        test("TestDir_\u30c8\u30a4\u30e4\u30cb\u30ca\u30eb/",
+             "dir_\u30a4\u30c1\u30b4\u306e\u30b1\u30fc\u30ad",
+             "file_\u30a4\u30c1\u30b4\u306e\u30b1\u30fc\u30ad");
+
+        // latin-1 supplementory
+        test("TestDir_K\u00f6rperlich\u00e4\u00df/",
+             "dir_Entt\u00e4uschung",
+             "file_Entt\u00e4uschung");
+
+        test("TestDir_K\u00f6rperlich\u00e4\u00df/",
+             "dir_Entt\u00c4uschung",
+             "file_Entt\u00c4uschung");
+
+        // Korean syblla
+        test("TestDir_\uac00\uac01\uac02",
+             "dir_\uac20\uac21\uac22",
+             "file_\uacc0\uacc1\uacc2");
+    }
+
+    private static boolean equal(Object x, Object y) {
+        return x == null ? y == null : x.equals(y);
+    }
+
+    private static boolean match(Path target, Path src) {
+        String fname = target.toString();
+        System.out.printf("    --> Trying  [%s], length=%d...", fname, fname.length());
+        if (target.equals(src)) {
+            System.out.println(" MATCHED!");
+            return true;
+        } else {
+            System.out.println(" NOT MATCHED!");
+        }
+        return false;
+    }
+
+    private static void test(String testdir, String dname, String fname_nfc)
+        throws Throwable
+    {
+        String fname = null;
+        String dname_nfd = Normalizer.normalize(dname, Normalizer.Form.NFD);
+        String fname_nfd = Normalizer.normalize(fname_nfc, Normalizer.Form.NFD);
+
+        System.out.printf("%n%n--------Testing...----------%n");
+        Path bpath = Paths.get(testdir);
+        Path dpath = Paths.get(testdir, dname);
+        Path dpath_nfd = Paths.get(testdir, dname_nfd);
+        Path fpath_nfc = Paths.get(testdir, fname_nfc);
+        Path fpath_nfd = Paths.get(testdir, fname_nfd);
+
+        if (Files.exists(bpath))
+            TestUtil.removeAll(bpath);
+        Files.createDirectories(dpath);
+
+        fname = dpath.toString();
+        System.out.printf(":Directory [%s][len=%d] created%n", fname, fname.length());
+
+        //////////////////////////////////////////////////////////////
+        if (!Files.isDirectory(dpath) || !Files.isDirectory(dpath_nfd)) {
+            throw new RuntimeException("Files.isDirectory(...) failed");
+        }
+
+        //////////////////////////////////////////////////////////////
+        // write out with nfd, read in with nfc + case
+        Files.write(fpath_nfd, new byte[] { 'n', 'f', 'd'});
+        System.out.println("    read in with nfc      (from nfd):" + new String(Files.readAllBytes(fpath_nfc)));
+
+        // check attrs with nfc + case
+        Set<PosixFilePermission> pfp = Files.getPosixFilePermissions(fpath_nfd);
+        if (!equal(pfp, Files.getPosixFilePermissions(fpath_nfc)) ) {
+            throw new RuntimeException("Files.getPosixfilePermission(...) failed");
+        }
+        Files.delete(fpath_nfd);
+
+        // write out with nfc, read in with nfd + case
+        Files.write(fpath_nfc, new byte[] { 'n', 'f', 'c'});
+        System.out.println("    read in with nfd      (from nfc):" + new String(Files.readAllBytes(fpath_nfd)));
+
+        // check attrs with nfc + case
+        pfp = Files.getPosixFilePermissions(fpath_nfc);
+        if (!equal(pfp, Files.getPosixFilePermissions(fpath_nfd))) {
+            throw new RuntimeException("Files.getPosixfilePermission(...) failed");
+        }
+        //////////////////////////////////////////////////////////////
+        boolean found_dir = false;
+        boolean found_file_nfc = false;
+        boolean found_file_nfd = false;
+        try (DirectoryStream<Path> stream = Files.newDirectoryStream(bpath)) {
+            for (Path path: stream) {
+                fname = path.toString();
+                System.out.printf("Found   : [%s], length=%d%n", fname, fname.length());
+                found_dir      |= match(dpath, path);
+                found_file_nfc |= match(fpath_nfc, path);
+                found_file_nfd |= match(fpath_nfd, path);
+            }
+        }
+        if (!found_dir || !found_file_nfc || !found_file_nfd) {
+            throw new RuntimeException("File.equal() failed");
+        }
+        // glob
+        String glob = "*" + fname_nfd.substring(2);  // remove leading "FI" from "FILE..."
+        System.out.println("glob=" + glob);
+        boolean globmatched = false;
+        try (DirectoryStream<Path> stream = Files.newDirectoryStream(bpath, glob)) {
+            for (Path path: stream) {
+                fname = path.toString();
+                System.out.printf("PathMatch : [%s], length=%d%n", fname, fname.length());
+                globmatched |= match(fpath_nfc, path);
+            }
+        }
+        if (!globmatched) {
+            //throw new RuntimeException("path matcher failed");
+            // it appears we have a regex.anon_eq bug in hangul syllable handling
+            System.out.printf("pathmatcher failed, glob=[%s]%n", glob);
+            System.out.printf("    -> fname_nfd.matches(fname_nfc)=%b%n",
+                              Pattern.compile(fname_nfd, Pattern.CANON_EQ)
+                                     .matcher(fname_nfc)
+                                     .matches());
+            System.out.printf("    -> fname_nfc.matches(fname_nfd)=%b%n",
+                              Pattern.compile(fname_nfc, Pattern.CANON_EQ)
+                                     .matcher(fname_nfd)
+                                     .matches());
+        }
+        TestUtil.removeAll(bpath);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/nio/file/Path/MacPathTest.sh	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,39 @@
+#! /bin/sh
+
+#
+# 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.
+#
+#
+OS=`uname -s`
+case "$OS" in
+  Darwin )  ;;
+  * )
+    exit 0
+    ;;
+esac
+
+if [ "x$TESTJAVA" = x ]; then
+  TESTJAVA=$1; shift
+  TESTCLASSES=.
+fi
+
+export LC_ALL=en_US.UTF-8; ${TESTJAVA}/bin/java -cp ${TESTCLASSES} MacPathTest
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/security/Signature/VerifyRangeCheckOverflow.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,56 @@
+/*
+ * 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.
+ */
+
+/*
+ * Portions Copyright (c) 2012 IBM Corporation
+ */
+
+/* @test
+ * @bug 7172149
+ * @summary AIOOBE from Signature.verify after integer overflow
+ * @author Jonathan Lu
+ */
+
+import java.security.KeyPair;
+import java.security.KeyPairGenerator;
+import java.security.PublicKey;
+import java.security.Signature;
+
+public class VerifyRangeCheckOverflow {
+
+    public static void main(String[] args) throws Exception {
+        KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("DSA");
+        keyPairGenerator.initialize(1024);
+        KeyPair keys = keyPairGenerator.generateKeyPair();
+        PublicKey publicKey = keys.getPublic();
+        byte[] sigBytes = new byte[100];
+
+        Signature signature = Signature.getInstance("SHA1withDSA");
+        signature.initVerify(publicKey);
+        try {
+            signature.verify(sigBytes, Integer.MAX_VALUE, 1);
+        } catch (IllegalArgumentException ex) {
+            // Expected
+        }
+    }
+}
--- a/test/java/security/cert/CertPathBuilder/targetConstraints/BuildEEBasicConstraints.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/security/cert/CertPathBuilder/targetConstraints/BuildEEBasicConstraints.java	Fri Jun 21 19:11:42 2013 -0700
@@ -21,18 +21,22 @@
  * questions.
  */
 
+// This test case relies on updated static security property, no way to re-use
+// security property in samevm/agentvm mode.
+
 /**
  * @test
  * @bug 6714842
  * @library ../../../testlibrary
  * @build CertUtils
- * @run main BuildEEBasicConstraints
+ * @run main/othervm BuildEEBasicConstraints
  * @summary make sure a PKIX CertPathBuilder builds a path to an
  *      end entity certificate when the setBasicConstraints method of the
  *      X509CertSelector of the targetConstraints PKIXBuilderParameters
  *      parameter is set to -2.
  */
 
+import java.security.Security;
 import java.security.cert.Certificate;
 import java.security.cert.CertPath;
 import java.security.cert.CertStore;
@@ -49,6 +53,9 @@
 public final class BuildEEBasicConstraints {
 
     public static void main(String[] args) throws Exception {
+        // reset the security property to make sure that the algorithms
+        // and keys used in this test are not disabled.
+        Security.setProperty("jdk.certpath.disabledAlgorithms", "MD2");
 
         X509Certificate rootCert = CertUtils.getCertFromFile("anchor.cer");
         TrustAnchor anchor = new TrustAnchor
--- a/test/java/security/cert/pkix/policyChanges/TestPolicy.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/security/cert/pkix/policyChanges/TestPolicy.java	Fri Jun 21 19:11:42 2013 -0700
@@ -21,16 +21,22 @@
  * questions.
  */
 
+// This test case relies on updated static security property, no way to re-use
+// security property in samevm/agentvm mode.
+
 /**
  * @test
  * @bug 4684793
- * @summary verify that the RFC3280 policy processing changes are implemented correctly
+ * @summary verify that the RFC3280 policy processing changes are
+ *          implemented correctly
+ * @run main/othervm TestPolicy
  * @author Andreas Sterbenz
  */
 
 import java.io.*;
 import java.util.*;
 
+import java.security.Security;
 import java.security.cert.*;
 
 public class TestPolicy {
@@ -72,6 +78,10 @@
     };
 
     public static void main(String[] args) throws Exception {
+        // reset the security property to make sure that the algorithms
+        // and keys used in this test are not disabled.
+        Security.setProperty("jdk.certpath.disabledAlgorithms", "MD2");
+
         factory = CertificateFactory.getInstance("X.509");
 
         X509Certificate anchor = loadCertificate("anchor.cer");
--- a/test/java/text/Bidi/BidiConformance.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/text/Bidi/BidiConformance.java	Fri Jun 21 19:11:42 2013 -0700
@@ -656,7 +656,6 @@
                        baseIsLTR4Constructor1[textNo][testNo],
                        isLTR_isRTL4Constructor1[textNo][0][testNo],
                        isLTR_isRTL4Constructor1[textNo][1][testNo]);
-System.out.println(bidi.toString());
     }
 
     private void callTestEachMethod4Constructor2(int textNo,
@@ -668,7 +667,6 @@
                        baseIsLTR4Constructor2[textNo][flagNo],
                        isLTR_isRTL4Constructor2[textNo][0][flagNo],
                        isLTR_isRTL4Constructor2[textNo][1][flagNo]);
-System.out.println(bidi.toString());
     }
 
     private void callTestEachMethod4Constructor3(int textNo,
@@ -680,7 +678,6 @@
                        baseIsLTR4Constructor3[textNo][dataNo],
                        isLTR_isRTL4Constructor3[textNo][0][dataNo],
                        isLTR_isRTL4Constructor3[textNo][1][dataNo]);
-System.out.println(bidi.toString());
     }
 
     private StringBuilder sb = new StringBuilder();
@@ -934,59 +931,145 @@
         System.out.println("*** Test getRunLevel()");
 
         String str = "ABC 123";
-        int length = str.length();
         Bidi bidi = new Bidi(str, Bidi.DIRECTION_LEFT_TO_RIGHT);
-
         try {
-            if (bidi.getRunLevel(-1) != 0 ||  // runCount - 2
+            if (bidi.getRunLevel(-1) != 0 ||  // runCount - 2 (out of range)
                 bidi.getRunLevel(0) != 0 ||   // runCount - 1
-                bidi.getRunLevel(1) != 0 ||   // runCount
-                bidi.getRunLevel(2) != 0) {   // runCount + 1
-                errorHandling("getRunLevel() should return 0" +
-                    " when getRunCount() is 1.");
+                bidi.getRunLevel(1) != 0 ||   // runCount     (out of range)
+                bidi.getRunLevel(2) != 0) {   // runCount + 1 (out of range)
+                errorHandling("Incorrect getRunLevel() value(s).");
             }
         }
         catch (Exception e) {
-            errorHandling("getRunLevel() should not throw an exception " +
-                "when getRunCount() is 1.");
+            errorHandling("getRunLevel() should not throw an exception: " + e);
         }
 
         str = "ABC " + HebrewABC + " 123";
-        length = str.length();
         bidi = new Bidi(str, Bidi.DIRECTION_LEFT_TO_RIGHT);
+        try {
+            if (bidi.getRunLevel(-1) != 0 ||  // runCount - 4 (out of range)
+                bidi.getRunLevel(0) != 0 ||   // runCount - 3
+                bidi.getRunLevel(1) != 1 ||   // runCount - 2
+                bidi.getRunLevel(2) != 2 ||   // runCount - 1
+                bidi.getRunLevel(3) != 0 ||   // runCount     (out of range)
+                bidi.getRunLevel(4) != 0) {   // runCount + 1 (out of range)
+                errorHandling("Incorrect getRunLevel() value(s).");
+            }
+        }
+        catch (Exception e) {
+            errorHandling("getRunLevel() should not throw an exception: " + e);
+        }
 
+        str = "ABC";
+        bidi = new Bidi(str, Bidi.DIRECTION_LEFT_TO_RIGHT);
         try {
-            bidi.getRunLevel(-1);
-            errorHandling("getRunLevel() should throw an AIOoBE " +
-                "when run is -1(too small).");
+            if (bidi.getRunLevel(-1) != 0 ||  // runCount - 2 (out of range)
+                bidi.getRunLevel(0) != 0 ||   // runCount - 1
+                bidi.getRunLevel(1) != 0 ||   // runCount     (out of range)
+                bidi.getRunLevel(2) != 0) {   // runCount + 1 (out of range)
+                errorHandling("Incorrect getRunLevel() value(s).");
+            }
+        }
+        catch (Exception e) {
+            errorHandling("getRunLevel() should not throw an exception: " + e);
         }
-        catch (ArrayIndexOutOfBoundsException e) {
+
+        str = "ABC";
+        bidi = new Bidi(str, Bidi.DIRECTION_RIGHT_TO_LEFT);
+        try {
+            if (bidi.getRunLevel(-1) != 1 ||  // runCount - 2 (out of range)
+                bidi.getRunLevel(0) != 2 ||   // runCount - 1
+                bidi.getRunLevel(1) != 1 ||   // runCount     (out of range)
+                bidi.getRunLevel(2) != 1) {   // runCount + 1 (out of range)
+                errorHandling("Incorrect getRunLevel() value(s).");
+            }
+        }
+        catch (Exception e) {
+            errorHandling("getRunLevel() should not throw an exception: " + e);
         }
-        catch (IllegalArgumentException e) {
-            errorHandling("getRunLevel() should not throw an IAE " +
-                "but an AIOoBE when run is -1(too small).");
+
+        str = "ABC";
+        bidi = new Bidi(str, Bidi.DIRECTION_DEFAULT_LEFT_TO_RIGHT);
+        try {
+            if (bidi.getRunLevel(-1) != 0 ||  // runCount - 2 (out of range)
+                bidi.getRunLevel(0) != 0 ||   // runCount - 1
+                bidi.getRunLevel(1) != 0 ||   // runCount     (out of range)
+                bidi.getRunLevel(2) != 0) {   // runCount + 1 (out of range)
+                errorHandling("Incorrect getRunLevel() value(s).");
+            }
+        }
+        catch (Exception e) {
+            errorHandling("getRunLevel() should not throw an exception: " + e);
         }
 
+        str = "ABC";
+        bidi = new Bidi(str, Bidi.DIRECTION_DEFAULT_RIGHT_TO_LEFT);
         try {
-            bidi.getRunLevel(0);
-            bidi.getRunLevel(1);
-            bidi.getRunLevel(2);
+            if (bidi.getRunLevel(-1) != 0 ||  // runCount - 2 (out of range)
+                bidi.getRunLevel(0) != 0 ||   // runCount - 1
+                bidi.getRunLevel(1) != 0 ||   // runCount     (out of range)
+                bidi.getRunLevel(2) != 0) {   // runCount + 1 (out of range)
+                errorHandling("Incorrect getRunLevel() value(s).");
+            }
         }
         catch (Exception e) {
-            errorHandling("getRunLevel() should not throw an exception" +
-                " when run is from 0 to 2(runCount-1).");
+            errorHandling("getRunLevel() should not throw an exception: " + e);
+        }
+
+        str = HebrewABC;
+        bidi = new Bidi(str, Bidi.DIRECTION_LEFT_TO_RIGHT);
+        try {
+            if (bidi.getRunLevel(-1) != 0 ||  // runCount - 2 (out of range)
+                bidi.getRunLevel(0) != 1 ||   // runCount - 1
+                bidi.getRunLevel(1) != 0 ||   // runCount     (out of range)
+                bidi.getRunLevel(2) != 0) {   // runCount + 1 (out of range)
+                errorHandling("Incorrect getRunLevel() value(s).");
+            }
+        }
+        catch (Exception e) {
+            errorHandling("getRunLevel() should not throw an exception: " + e);
         }
 
+        str = HebrewABC;
+        bidi = new Bidi(str, Bidi.DIRECTION_RIGHT_TO_LEFT);
         try {
-            bidi.getRunLevel(3);
-            errorHandling("getRunLevel() should throw an AIOoBE" +
-                " when run is 3(same as runCount).");
+            if (bidi.getRunLevel(-1) != 1 ||  // runCount - 2 (out of range)
+                bidi.getRunLevel(0) != 1 ||   // runCount - 1
+                bidi.getRunLevel(1) != 1 ||   // runCount     (out of range)
+                bidi.getRunLevel(2) != 1) {   // runCount + 1 (out of range)
+                errorHandling("Incorrect getRunLevel() value(s).");
+            }
+        }
+        catch (Exception e) {
+            errorHandling("getRunLevel() should not throw an exception: " + e);
         }
-        catch (ArrayIndexOutOfBoundsException e) {
+
+        str = HebrewABC;
+        bidi = new Bidi(str, Bidi.DIRECTION_DEFAULT_LEFT_TO_RIGHT);
+        try {
+            if (bidi.getRunLevel(-1) != 1 ||  // runCount - 2 (out of range)
+                bidi.getRunLevel(0) != 1 ||   // runCount - 1
+                bidi.getRunLevel(1) != 1 ||   // runCount     (out of range)
+                bidi.getRunLevel(2) != 1) {   // runCount + 1 (out of range)
+                errorHandling("Incorrect getRunLevel() value(s).");
+            }
+        }
+        catch (Exception e) {
+            errorHandling("getRunLevel() should not throw an exception: " + e);
         }
-        catch (IllegalArgumentException e) {
-            errorHandling("getRunLevel() should not throw an IAE " +
-                "but an AIOoBE when run is 3(same as runCount).");
+
+        str = HebrewABC;
+        bidi = new Bidi(str, Bidi.DIRECTION_DEFAULT_RIGHT_TO_LEFT);
+        try {
+            if (bidi.getRunLevel(-1) != 1 ||  // runCount - 2 (out of range)
+                bidi.getRunLevel(0) != 1 ||   // runCount - 1
+                bidi.getRunLevel(1) != 1 ||   // runCount     (out of range)
+                bidi.getRunLevel(2) != 1) {   // runCount + 1 (out of range)
+                errorHandling("Incorrect getRunLevel() value(s).");
+            }
+        }
+        catch (Exception e) {
+            errorHandling("getRunLevel() should not throw an exception: " + e);
         }
     }
 
--- a/test/java/text/Bidi/Bug6850113.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/text/Bidi/Bug6850113.java	Fri Jun 21 19:11:42 2013 -0700
@@ -25,6 +25,7 @@
  * @bug 6850113
  * @summary Verify the return value of digit() for some digits.
  * @compile -XDignore.symbol.file=true Bug6850113.java
+ * @run main Bug6850113
  */
 
 import sun.text.normalizer.UCharacter;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/text/Bidi/Bug8005277.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,67 @@
+/*
+ * 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 8005277
+ * @summary verify that Bidi.getRunLevel() returns a corect level.
+ */
+import java.text.Bidi;
+
+public class Bug8005277 {
+
+    public static void main(String[] args) {
+        boolean err = false;
+        String string = "\u05D0\u05D1\u05D2";
+        Bidi bidi = new Bidi(string, Bidi.DIRECTION_LEFT_TO_RIGHT);
+
+        int result = bidi.getRunCount();
+        if (result != 1) {
+            System.err.println("Incorrect run count: " + result);
+            err = true;
+        }
+
+        result = bidi.getRunStart(0);
+        if (result != 0) {
+            System.err.println("Incorrect run start: " + result);
+            err = true;
+        }
+
+        result = bidi.getRunLimit(0);
+        if (result != 3) {
+            System.err.println("Incorrect run limit: " + result);
+            err = true;
+        }
+
+        result = bidi.getRunLevel(0);
+        if (result != 1) {
+            System.err.println("Incorrect run level: " + result);
+            err = true;
+        }
+
+        if (err) {
+            throw new RuntimeException("Failed.");
+        }
+    }
+
+}
--- a/test/java/text/Format/DateFormat/Bug7130335.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/text/Format/DateFormat/Bug7130335.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -23,34 +23,47 @@
 
 /**
  * @test
- * @bug 7130335
+ * @bug 7130335 7130335
  * @summary Make sure that round-trip conversion (format/parse) works
- *          with old timestamps in Europe/Moscow.
+ *          with old timestamps in Europe/Moscow and with multiple time zone letters.
  */
 import java.text.*;
 import java.util.*;
+import static java.util.GregorianCalendar.*;
 
 public class Bug7130335 {
     private static final TimeZone MOSCOW = TimeZone.getTimeZone("Europe/Moscow");
+    private static final TimeZone LONDON = TimeZone.getTimeZone("Europe/London");
+    private static final TimeZone LA = TimeZone.getTimeZone("America/Los_Angeles");
+    private static final TimeZone[] ZONES = {
+        MOSCOW, LONDON, LA
+    };
 
     public static void main(String[] args) throws Exception {
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS z", Locale.US);
         sdf.setTimeZone(MOSCOW);
-        Calendar cal = new GregorianCalendar(MOSCOW);
+        Calendar cal = new GregorianCalendar(MOSCOW, Locale.US);
         cal.clear();
         // Try both +03:00 and +02:00
-        cal.set(1922, Calendar.SEPTEMBER, 30);
+        cal.set(1922, SEPTEMBER, 30);
         test(sdf, cal);
-        cal.add(Calendar.DAY_OF_YEAR, 1);
+        cal.add(DAY_OF_YEAR, 1);
         test(sdf, cal);
-        cal.set(1991, Calendar.MARCH, 31);
+        cal.set(1991, MARCH, 31);
         // in daylight saving time
         test(sdf, cal);
-        cal.add(Calendar.DAY_OF_YEAR, 1);
+        cal.add(DAY_OF_YEAR, 1);
         test(sdf, cal);
         // Try the current timestamp
         cal.setTimeInMillis(System.currentTimeMillis());
         test(sdf, cal);
+
+        // tests for multiple time zone letters (8000529)
+        test8000529("yyyy-MM-dd HH:mm:ss.SSS Z (z)");
+        test8000529("yyyy-MM-dd HH:mm:ss.SSS Z (zzzz)");
+        test8000529("yyyy-MM-dd HH:mm:ss.SSS z (Z)");
+        test8000529("yyyy-MM-dd HH:mm:ss.SSS zzzz (Z)");
+
     }
 
     private static void test(SimpleDateFormat sdf, Calendar cal) throws Exception {
@@ -63,4 +76,19 @@
             throw new RuntimeException("format: " + f + ", parse: " + p);
         }
     }
+
+    private static void test8000529(String fmt) throws Exception {
+        for (TimeZone tz : ZONES) {
+            SimpleDateFormat sdf = new SimpleDateFormat(fmt, Locale.US);
+            sdf.setTimeZone(tz);
+            Calendar cal = new GregorianCalendar(tz, Locale.US);
+            cal.clear();
+            cal.set(2012, JUNE, 22);
+            test(sdf, cal);
+            cal.set(2012, DECEMBER, 22);
+            test(sdf, cal);
+            cal.setTimeInMillis(System.currentTimeMillis());
+            test(sdf, cal);
+        }
+    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/util/AbstractCollection/ToArrayTest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,215 @@
+/*
+ * 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 7121314
+ * @summary AbstractCollection.toArray(T[]) doesn't return the given array
+ *           in concurrent modification.
+ * @author Ulf Zibis, David Holmes
+ */
+
+import java.util.AbstractCollection;
+import java.util.Arrays;
+import java.util.Iterator;
+
+public class ToArrayTest {
+
+    static class TestCollection<E> extends AbstractCollection<E> {
+        private final E[] elements;
+        private int[] sizes;
+        private int nextSize;
+
+        public TestCollection(E[] elements) {
+            this.elements = elements;
+            setSizeSequence(new int[] { elements.length });
+        }
+
+        /*
+         * Sets the values that size() will return on each use. The next
+         * call to size will return sizes[0], then sizes[1] etc. This allows us
+         * to emulate a concurrent change to the contents of the collection
+         * without having to perform concurrent changes. If sizes[n+1] contains
+         * a larger value, the collection will appear to have shrunk when
+         * iterated; if a smaller value then the collection will appear to have
+         * grown when iterated.
+         */
+        void setSizeSequence(int... sizes) {
+            this.sizes = sizes;
+            nextSize = 0;
+        }
+
+        /* can change collection's size after each invocation */
+        @Override
+        public int size() {
+            return sizes[nextSize == sizes.length - 1 ? nextSize : nextSize++];
+        }
+
+        @Override
+        public Iterator<E> iterator() {
+            return new Iterator<E>() {
+                int pos = 0;
+
+                public boolean hasNext() {
+                    return pos < sizes[nextSize];
+                }
+                public E next() {
+                    return elements[pos++];
+                }
+                public void remove() {
+                    throw new UnsupportedOperationException(
+                            "Not supported yet.");
+                }
+            };
+        }
+    }
+
+    static final Object[] OBJECTS = { new Object(), new Object(), new Object() };
+    static final TestCollection<?> CANDIDATE = new TestCollection<Object>(OBJECTS);
+    static final int CAP = OBJECTS.length; // capacity of the CANDIDATE
+    static final int LAST = CAP - 1; // last possible array index
+    Object[] a;
+    Object[] res;
+
+    int last() {
+        return a.length - 1;
+    }
+
+    protected void test() throws Throwable {
+        // Check array type conversion
+        res = new TestCollection<>(new Object[] { "1", "2" }).toArray(new String[0]);
+        check(res instanceof String[]);
+        check(res.length == 2);
+        check(res[1] == "2");
+
+        // Check incompatible type of target array
+        try {
+            res = CANDIDATE.toArray(new String[CAP]);
+            check(false);
+        } catch (Throwable t) {
+            check(t instanceof ArrayStoreException);
+        }
+
+        // Check more elements than a.length
+        a = new Object[CAP - 1]; // appears too small
+        res = CANDIDATE.toArray(a);
+        check(res != a);
+        check(res[LAST] != null);
+
+        // Check equal elements as a.length
+        a = new Object[CAP]; // appears to match
+        res = CANDIDATE.toArray(a);
+        check(res == a);
+        check(res[last()] != null);
+
+        // Check equal elements as a.length
+        a = new Object[CAP + 1]; // appears too big
+        res = CANDIDATE.toArray(a);
+        check(res == a);
+        check(res[last()] == null);
+
+        // Check less elements than expected, but more than a.length
+        a = new Object[CAP - 2]; // appears too small
+        CANDIDATE.setSizeSequence(CAP, CAP - 1);
+        res = CANDIDATE.toArray(a);
+        check(res != a);
+        check(res.length == CAP - 1);
+        check(res[LAST - 1] != null);
+
+        // Check less elements than expected, but equal as a.length
+        a = Arrays.copyOf(OBJECTS, CAP); // appears to match
+        CANDIDATE.setSizeSequence(CAP, CAP - 1);
+        res = CANDIDATE.toArray(a);
+        check(res == a);
+        check(res[last()] == null);
+
+        // Check more elements than expected and more than a.length
+        a = new Object[CAP - 1]; // appears to match
+        CANDIDATE.setSizeSequence(CAP - 1, CAP);
+        res = CANDIDATE.toArray(a);
+        check(res != a);
+        check(res[LAST] != null);
+
+        // Check more elements than expected, but equal as a.length
+        a = new Object[CAP - 1]; // appears to match
+        CANDIDATE.setSizeSequence(CAP - 2, CAP - 1);
+        res = CANDIDATE.toArray(a);
+        check(res == a);
+        check(res[last()] != null);
+
+        // Check more elements than expected, but less than a.length
+        a = Arrays.copyOf(OBJECTS, CAP); // appears to match
+        CANDIDATE.setSizeSequence(CAP - 2, CAP - 1);
+        res = CANDIDATE.toArray(a);
+        check(res == a);
+        check(res[last()] == null);
+
+        test_7121314();
+    }
+
+    /*
+     * Major target of this testcase, bug 7121314.
+     */
+    protected void test_7121314() throws Throwable {
+        // Check equal elements as a.length, but less than expected
+        a = new Object[CAP - 1]; // appears too small
+        CANDIDATE.setSizeSequence(CAP, CAP - 1);
+        res = CANDIDATE.toArray(a);
+        check(res == a);
+        check(res[last()] != null);
+
+        // Check less elements than a.length and less than expected
+        a = Arrays.copyOf(OBJECTS, CAP - 1); // appears too small
+        CANDIDATE.setSizeSequence(CAP, CAP - 2);
+        res = CANDIDATE.toArray(a);
+        check(res == a);
+        check(res[last()] == null);
+
+    }
+
+    public static void main(String[] args) throws Throwable {
+        ToArrayTest testcase = new ToArrayTest();
+        try {
+            testcase.test();
+        } catch (Throwable t) {
+            unexpected(t);
+        }
+
+        System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed);
+        if (failed > 0) throw new Exception("Some tests failed");
+    }
+
+    //--------------------- Infrastructure ---------------------------
+    static volatile int passed = 0, failed = 0;
+    static void pass() { passed++; }
+    static void fail() { failed++; Thread.dumpStack(); }
+    static void fail(String msg) { System.out.println(msg); fail(); }
+    static void unexpected(Throwable t) { failed++; t.printStackTrace(); }
+    static void check(boolean cond) { if (cond) pass(); else fail(); }
+    static void equal(Object x, Object y) {
+        if (x == null ? y == null : x.equals(y)) pass();
+        else {System.out.println(x + " not equal to " + y); fail(); }
+    }
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/util/EnumMap/ProperEntrySetOnClone.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,58 @@
+/*
+ * 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     7164256
+ * @summary EnumMap.entrySet() returns an entrySet referencing to the cloned instance
+ * @author  Diego Belfer
+ */
+
+import java.util.EnumMap;
+
+public class ProperEntrySetOnClone {
+    public enum Test {
+        ONE, TWO
+    }
+
+    public static void main(String[] args) {
+        EnumMap<Test, String> map1 = new EnumMap<Test, String>(Test.class);
+        map1.put(Test.ONE, "1");
+        map1.put(Test.TWO, "2");
+
+        // We need to force creation of the map1.entrySet
+        int size = map1.entrySet().size();
+        if (size != 2) {
+            throw new RuntimeException(
+                    "Invalid size in original map. Expected: 2 was: " + size);
+        }
+
+        EnumMap<Test, String> map2 = map1.clone();
+        map2.remove(Test.ONE);
+        size = map2.entrySet().size();
+        if (size != 1) {
+            throw new RuntimeException(
+                    "Invalid size in cloned instance. Expected: 1 was: " + size);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/util/HashMap/HashMapCloneLeak.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,70 @@
+/*
+ * 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.
+ */
+
+/**
+ * @test
+ * @bug 7042126
+ * @summary Verify that we do not leak contents when we clone a HashMap
+ * @author david.buck@oracle.com
+ * @run main/othervm HashMapCloneLeak
+ * @run main/othervm -XX:+AggressiveOpts HashMapCloneLeak
+ */
+
+import java.util.HashMap;
+import java.lang.ref.WeakReference;
+
+public class HashMapCloneLeak {
+
+    static WeakReference<Object> wr = null;
+
+    // helper method to keep testObject and map out of main method's scope
+    private static HashMap<Integer, Object> makeMap() {
+        HashMap<Integer, Object> map = new HashMap<Integer, Object>();
+        Object testObject = new Object();
+        wr = new WeakReference<Object>(testObject);
+        map.put(42, testObject);
+        return map;
+    }
+
+    public static void main(String[] args) throws Exception {
+        HashMap<Integer, Object> hm = makeMap();
+        hm = (HashMap<Integer, Object>)hm.clone();
+        hm.clear();
+        // There should no longer be a strong reference to testObject
+        // the WeakReference should be nulled out by GC. If not,
+        // we will hang here until timed out by the test harness.
+        Object[] chain = null;
+        while (wr.get() != null) {
+            try {
+                Object[] allocate = new Object[1000000];
+                allocate[0] = chain;
+                chain = allocate;
+            } catch (OutOfMemoryError oome) {
+                chain = null;
+            }
+            System.gc();
+            Thread.sleep(100);
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/util/Map/BasicSerialization.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,221 @@
+/*
+ * 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 8011200
+ * @run testng BasicSerialization
+ * @summary Ensure Maps can be serialized and deserialized.
+ * @author Mike Duigou
+ */
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.ByteArrayInputStream;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+import java.util.*;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentSkipListMap;
+
+import org.testng.annotations.Test;
+import org.testng.annotations.DataProvider;
+import static org.testng.Assert.fail;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertTrue;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertSame;
+
+public class BasicSerialization {
+
+    enum IntegerEnum {
+
+        e0, e1, e2, e3, e4, e5, e6, e7, e8, e9,
+        e10, e11, e12, e13, e14, e15, e16, e17, e18, e19,
+        e20, e21, e22, e23, e24, e25, e26, e27, e28, e29,
+        e30, e31, e32, e33, e34, e35, e36, e37, e38, e39,
+        e40, e41, e42, e43, e44, e45, e46, e47, e48, e49,
+        e50, e51, e52, e53, e54, e55, e56, e57, e58, e59,
+        e60, e61, e62, e63, e64, e65, e66, e67, e68, e69,
+        e70, e71, e72, e73, e74, e75, e76, e77, e78, e79,
+        e80, e81, e82, e83, e84, e85, e86, e87, e88, e89,
+        e90, e91, e92, e93, e94, e95, e96, e97, e98, e99,
+        EXTRA_KEY;
+        public static final int SIZE = values().length;
+    };
+    private static final int TEST_SIZE = IntegerEnum.SIZE - 1;
+    /**
+     * Realized keys ensure that there is always a hard ref to all test objects.
+     */
+    private static final IntegerEnum[] KEYS = new IntegerEnum[TEST_SIZE];
+    /**
+     * Realized values ensure that there is always a hard ref to all test
+     * objects.
+     */
+    private static final String[] VALUES = new String[TEST_SIZE];
+
+    static {
+        IntegerEnum[] keys = IntegerEnum.values();
+        for (int each = 0; each < TEST_SIZE; each++) {
+            KEYS[each] = keys[each];
+            VALUES[each] = keys[each].name();
+        }
+    }
+    private static final IntegerEnum EXTRA_KEY = IntegerEnum.EXTRA_KEY;
+    private static final String EXTRA_VALUE = IntegerEnum.EXTRA_KEY.name();
+
+    public static <K, V> Map<K, V> mapClone(Map<K, V> map) {
+        Method cloneMethod;
+
+        try {
+            cloneMethod = map.getClass().getMethod("clone", new Class[]{});
+        } catch (NoSuchMethodException | SecurityException all) {
+            cloneMethod = null;
+        }
+
+        if (null != cloneMethod) {
+            try {
+                Map<K, V> result = (Map<K, V>)cloneMethod.invoke(map, new Object[]{});
+                return result;
+            } catch (Exception all) {
+                fail("clone() failed " + map.getClass().getSimpleName(), all);
+                return null;
+            }
+        } else {
+            Constructor<? extends Map> copyConstructor;
+            try {
+                copyConstructor = (Constructor<? extends Map>)map.getClass().getConstructor(new Class[]{Map.class});
+
+                Map<K, V> result = (Map<K, V>)copyConstructor.newInstance(new Object[]{map});
+
+                return result;
+            } catch (Exception all) {
+                return serialClone(map);
+            }
+        }
+    }
+
+    @Test(dataProvider = "Map<IntegerEnum,String>")
+    public void testSerialization(String description, Map<IntegerEnum, String> map) {
+        Object foo = new Object();
+
+        Map<IntegerEnum, String> clone = mapClone(map);
+        Map<IntegerEnum, String> serialClone = serialClone(map);
+
+        assertEquals(map, map, description + ":should equal self");
+        assertEquals(clone, map, description + ":should equal clone");
+        assertEquals(map, clone, description + ": should equal orginal map");
+        assertEquals(serialClone, map, description + ": should equal deserialized clone");
+        assertEquals(map, serialClone, description + ": should equal original map");
+        assertEquals(serialClone, clone, description + ": deserialized clone should equal clone");
+        assertEquals(clone, serialClone, description + ": clone should equal deserialized clone");
+
+        assertFalse(map.containsKey(EXTRA_KEY), description + ":unexpected key");
+        assertFalse(clone.containsKey(EXTRA_KEY), description + ":unexpected key");
+        assertFalse(serialClone.containsKey(EXTRA_KEY), description + ":unexpected key");
+        map.put(EXTRA_KEY, EXTRA_VALUE);
+        clone.put(EXTRA_KEY, EXTRA_VALUE);
+        serialClone.put(EXTRA_KEY, EXTRA_VALUE);
+        assertTrue(map.containsKey(EXTRA_KEY), description + ":missing key");
+        assertTrue(clone.containsKey(EXTRA_KEY), description + ":missing key");
+        assertTrue(serialClone.containsKey(EXTRA_KEY), description + ":missing key");
+        assertSame(map.get(EXTRA_KEY), EXTRA_VALUE, description + ":wrong value");
+        assertSame(clone.get(EXTRA_KEY), EXTRA_VALUE, description + ":wrong value");
+        assertSame(serialClone.get(EXTRA_KEY), EXTRA_VALUE, description + ":wrong value");
+
+        assertEquals(map, map, description + ":should equal self");
+        assertEquals(clone, map, description + ":should equal clone");
+        assertEquals(map, clone, description + ": should equal orginal map");
+        assertEquals(serialClone, map, description + ": should equal deserialized clone");
+        assertEquals(map, serialClone, description + ": should equal original map");
+        assertEquals(serialClone, clone, description + ": deserialized clone should equal clone");
+        assertEquals(clone, serialClone, description + ": clone should equal deserialized clone");
+    }
+
+    static byte[] serializedForm(Object obj) {
+        try {
+            ByteArrayOutputStream baos = new ByteArrayOutputStream();
+            new ObjectOutputStream(baos).writeObject(obj);
+            return baos.toByteArray();
+        } catch (IOException e) {
+            fail("Unexpected Exception", e);
+            return null;
+        }
+    }
+
+    static Object readObject(byte[] bytes) throws IOException, ClassNotFoundException {
+        InputStream is = new ByteArrayInputStream(bytes);
+        return new ObjectInputStream(is).readObject();
+    }
+
+    @SuppressWarnings("unchecked")
+    static <T> T serialClone(T obj) {
+        try {
+            return (T)readObject(serializedForm(obj));
+        } catch (IOException | ClassNotFoundException e) {
+            fail("Unexpected Exception", e);
+            return null;
+        }
+    }
+
+    @DataProvider(name = "Map<IntegerEnum,String>", parallel = true)
+    private static Iterator<Object[]> makeMaps() {
+        return Arrays.asList(
+            // empty
+            new Object[]{"HashMap", new HashMap()},
+            new Object[]{"LinkedHashMap", new LinkedHashMap()},
+            new Object[]{"Collections.checkedMap(HashMap)", Collections.checkedMap(new HashMap(), IntegerEnum.class, String.class)},
+            new Object[]{"Collections.synchronizedMap(HashMap)", Collections.synchronizedMap(new HashMap())},
+            // null hostile
+            new Object[]{"EnumMap", new EnumMap(IntegerEnum.class)},
+            new Object[]{"Hashtable", new Hashtable()},
+            new Object[]{"TreeMap", new TreeMap()},
+            new Object[]{"ConcurrentHashMap", new ConcurrentHashMap()},
+            new Object[]{"ConcurrentSkipListMap", new ConcurrentSkipListMap()},
+            new Object[]{"Collections.checkedMap(ConcurrentHashMap)", Collections.checkedMap(new ConcurrentHashMap(), IntegerEnum.class, String.class)},
+            new Object[]{"Collections.synchronizedMap(EnumMap)", Collections.synchronizedMap(new EnumMap(IntegerEnum.class))},
+            // filled
+            new Object[]{"HashMap", fillMap(new HashMap())},
+            new Object[]{"LinkedHashMap", fillMap(new LinkedHashMap())},
+            new Object[]{"Collections.checkedMap(HashMap)", Collections.checkedMap(fillMap(new HashMap()), IntegerEnum.class, String.class)},
+            new Object[]{"Collections.synchronizedMap(HashMap)", Collections.synchronizedMap(fillMap(new HashMap()))},
+            // null hostile
+            new Object[]{"EnumMap", fillMap(new EnumMap(IntegerEnum.class))},
+            new Object[]{"Hashtable", fillMap(new Hashtable())},
+            new Object[]{"TreeMap", fillMap(new TreeMap())},
+            new Object[]{"ConcurrentHashMap", fillMap(new ConcurrentHashMap())},
+            new Object[]{"ConcurrentSkipListMap", fillMap(new ConcurrentSkipListMap())},
+            new Object[]{"Collections.checkedMap(ConcurrentHashMap)", Collections.checkedMap(fillMap(new ConcurrentHashMap()), IntegerEnum.class, String.class)},
+            new Object[]{"Collections.synchronizedMap(EnumMap)", Collections.synchronizedMap(fillMap(new EnumMap(IntegerEnum.class)))}).iterator();
+    }
+
+    private static Map<IntegerEnum, String> fillMap(Map<IntegerEnum, String> result) {
+        for (int each = 0; each < TEST_SIZE; each++) {
+            result.put(KEYS[each], VALUES[each]);
+        }
+
+        return result;
+    }
+}
--- a/test/java/util/Map/Collisions.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/util/Map/Collisions.java	Fri Jun 21 19:11:42 2013 -0700
@@ -24,6 +24,8 @@
 /*
  * @test
  * @bug 7126277
+ * @run main Collisions -shortrun
+ * @run main/othervm -Djdk.map.althashing.threshold=0 Collisions -shortrun
  * @summary Ensure Maps behave well with lots of hashCode() collisions.
  * @author Mike Duigou
  */
@@ -33,6 +35,11 @@
 
 public class Collisions {
 
+    /**
+     * Number of elements per map.
+     */
+    private static final int TEST_SIZE = 5000;
+
     final static class HashableInteger implements Comparable<HashableInteger> {
 
         final int value;
@@ -64,20 +71,19 @@
             return value - o.value;
         }
 
+        @Override
         public String toString() {
             return Integer.toString(value);
         }
     }
-    private static final int ITEMS = 5000;
-    private static final Object KEYS[][];
 
-    static {
-        HashableInteger UNIQUE_OBJECTS[] = new HashableInteger[ITEMS];
-        HashableInteger COLLIDING_OBJECTS[] = new HashableInteger[ITEMS];
-        String UNIQUE_STRINGS[] = new String[ITEMS];
-        String COLLIDING_STRINGS[] = new String[ITEMS];
+    private static Object[][] makeTestData(int size) {
+        HashableInteger UNIQUE_OBJECTS[] = new HashableInteger[size];
+        HashableInteger COLLIDING_OBJECTS[] = new HashableInteger[size];
+        String UNIQUE_STRINGS[] = new String[size];
+        String COLLIDING_STRINGS[] = new String[size];
 
-        for (int i = 0; i < ITEMS; i++) {
+        for (int i = 0; i < size; i++) {
             UNIQUE_OBJECTS[i] = new HashableInteger(i, Integer.MAX_VALUE);
             COLLIDING_OBJECTS[i] = new HashableInteger(i, 10);
             UNIQUE_STRINGS[i] = unhash(i);
@@ -86,7 +92,7 @@
                     : "\u0000\u0000\u0000\u0000\u0000" + COLLIDING_STRINGS[i - 1];
         }
 
-     KEYS = new Object[][] {
+     return new Object[][] {
             new Object[]{"Unique Objects", UNIQUE_OBJECTS},
             new Object[]{"Colliding Objects", COLLIDING_OBJECTS},
             new Object[]{"Unique Strings", UNIQUE_STRINGS},
@@ -132,23 +138,29 @@
     }
 
     private static void realMain(String[] args) throws Throwable {
-        for (Object[] keys_desc : KEYS) {
-            Map<Object, Object>[] MAPS = (Map<Object, Object>[]) new Map[]{
+        boolean shortRun = args.length > 0 && args[0].equals("-shortrun");
+
+        Object[][] mapKeys = makeTestData(shortRun ? (TEST_SIZE / 2) : TEST_SIZE);
+
+        // loop through data sets
+        for (Object[] keys_desc : mapKeys) {
+            Map<Object, Object>[] maps = (Map<Object, Object>[]) new Map[]{
+                        new HashMap<>(),
                         new Hashtable<>(),
-                        new HashMap<>(),
                         new IdentityHashMap<>(),
                         new LinkedHashMap<>(),
-                        new ConcurrentHashMap<>(),
+                        new TreeMap<>(),
                         new WeakHashMap<>(),
-                        new TreeMap<>(),
+                        new ConcurrentHashMap<>(),
                         new ConcurrentSkipListMap<>()
                     };
 
-            for (Map<Object, Object> map : MAPS) {
+            // for each map type.
+            for (Map<Object, Object> map : maps) {
                 String desc = (String) keys_desc[0];
                 Object[] keys = (Object[]) keys_desc[1];
                 try {
-                testMap(map, desc, keys);
+                    testMap(map, desc, keys);
                 } catch(Exception all) {
                     unexpected("Failed for " + map.getClass().getName() + " with " + desc, all);
                 }
@@ -397,7 +409,7 @@
     }
 
     public static void main(String[] args) throws Throwable {
-        Thread.currentThread().setName("Collisions");
+        Thread.currentThread().setName(Collisions.class.getName());
 //        Thread.currentThread().setPriority(Thread.MAX_PRIORITY);
         try {
             realMain(args);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/util/Map/EntryHashCode.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,110 @@
+/*
+ * 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.
+ */
+
+/*
+ * Portions Copyright (c) 2012 IBM Corporation
+ */
+
+/*
+ * @test
+ * @bug 8000955
+ * @summary Map.Entry implementations need to comply with Map.Entry.hashCode() defined behaviour.
+ * @author ngmr
+ * @run main/othervm -Djdk.map.althashing.threshold=1 EntryHashCode
+ */
+import java.util.*;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentSkipListMap;
+
+public class EntryHashCode {
+    private static final int TEST_SIZE = 100;
+
+    static final Object[][] entryData = {
+        new Object[TEST_SIZE],
+        new Object[TEST_SIZE]
+    };
+
+    @SuppressWarnings("unchecked")
+    static final Map<Object,Object>[] maps = (Map<Object,Object>[])new Map[] {
+        new HashMap<>(),
+        new Hashtable<>(),
+        new IdentityHashMap<>(),
+        new LinkedHashMap<>(),
+        new TreeMap<>(),
+        new WeakHashMap<>(),
+        new ConcurrentHashMap<>(),
+        new ConcurrentSkipListMap<>()
+    };
+
+    static {
+        for (int i = 0; i < entryData[0].length; i++) {
+            // key objects need to be Comparable for use in TreeMap
+            entryData[0][i] = new Comparable<Object>() {
+                public int compareTo(Object o) {
+                    return (hashCode() - o.hashCode());
+                }
+            };
+            entryData[1][i] = new Object();
+        }
+    }
+
+    private static void addTestData(Map<Object,Object> map) {
+        for (int i = 0; i < entryData[0].length; i++) {
+            map.put(entryData[0][i], entryData[1][i]);
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        Exception failure = null;
+        for (Map<Object,Object> map: maps) {
+            addTestData(map);
+
+            try {
+                for (Map.Entry<Object,Object> e: map.entrySet()) {
+                    Object key = e.getKey();
+                    Object value = e.getValue();
+                    int expectedEntryHashCode =
+                        (Objects.hashCode(key) ^ Objects.hashCode(value));
+
+                    if (e.hashCode() != expectedEntryHashCode) {
+                        throw new Exception("FAILURE: " +
+                                e.getClass().getName() +
+                                ".hashCode() does not conform to defined" +
+                                " behaviour of java.util.Map.Entry.hashCode()");
+                    }
+                }
+            } catch (Exception e) {
+                if (failure == null) {
+                    failure = e;
+                } else {
+                    failure.addSuppressed(e);
+                }
+            } finally {
+                map.clear();
+            }
+        }
+        if (failure != null) {
+            throw failure;
+        }
+    }
+}
--- a/test/java/util/TimeZone/Bug6912560.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/util/TimeZone/Bug6912560.java	Fri Jun 21 19:11:42 2013 -0700
@@ -40,6 +40,9 @@
         // set the user.timezone property
         String tzname = "Asia/Tokyo";
         System.setProperty("user.timezone", tzname);
+        // make sure the timezone will be initialized by
+        // the next call to TimeZone.getDefault()
+        TimeZone.setDefault(null);
 
         System.setSecurityManager(new SecurityManager());
         TimeZone tz = TimeZone.getDefault();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/util/TreeMap/Clone.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,58 @@
+/*
+ * 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 7198904
+ * @summary Verify that cloned TreeMap gets new keyset
+ * @author david.buck@oracle.com
+ * @run main/othervm Clone
+ * @run main/othervm -XX:+AggressiveOpts Clone
+ */
+
+import java.util.TreeMap;
+
+public class Clone  {
+
+    public static void main(String[] args) throws Exception {
+        TreeMap<String,Object> m1 = new TreeMap<String,Object>();
+        m1.put( "one", 1 );
+        m1.keySet();
+        TreeMap<String,Object> m2 = (TreeMap<String,Object>)m1.clone();
+        m1.put( "two", 2 );
+        m2.put( "three", 3 );
+        // iterate over the clone (m2) and we should get "one" and "three"
+        for( final String key : m2.keySet() ) {
+            if( !"one".equals( key ) && !"three".equals( key ) ) {
+                throw new IllegalStateException( "Unexpected key: " + key );
+            }
+        }
+        // iterate over the original (m1) and we should get "one" and "two"
+        for( final String key : m1.keySet() ) {
+            if( !"one".equals( key ) && !"two".equals( key ) ) {
+                throw new IllegalStateException( "Unexpected key: " + key );
+            }
+        }
+    }
+
+}
--- a/test/java/util/concurrent/BlockingQueue/LastElement.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/util/concurrent/BlockingQueue/LastElement.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 6215625
+ * @bug 6215625 7161229
  * @summary Check correct behavior when last element is removed.
  * @author Martin Buchholz
  */
@@ -38,9 +38,7 @@
         testQueue(new ArrayBlockingQueue<Integer>(10, true));
         testQueue(new ArrayBlockingQueue<Integer>(10, false));
         testQueue(new LinkedTransferQueue<Integer>());
-
-        System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed);
-        if (failed > 0) throw new Exception("Some tests failed");
+        testQueue(new PriorityBlockingQueue<Integer>());
     }
 
     void testQueue(BlockingQueue<Integer> q) throws Throwable {
@@ -59,6 +57,7 @@
         try {check(q.take() == three);}
         catch (Throwable t) {unexpected(t);}
         check(q.isEmpty() && q.size() == 0);
+        check(noRetention(q));
 
         // iterator().remove()
         q.clear();
@@ -77,6 +76,26 @@
         check(q.isEmpty() && q.size() == 0);
     }
 
+    boolean noRetention(BlockingQueue<?> q) {
+        if (q instanceof PriorityBlockingQueue) {
+            PriorityBlockingQueue<?> pbq = (PriorityBlockingQueue) q;
+            try {
+                java.lang.reflect.Field queue =
+                    PriorityBlockingQueue.class.getDeclaredField("queue");
+                queue.setAccessible(true);
+                Object[] a = (Object[]) queue.get(pbq);
+                return a[0] == null;
+            }
+            catch (NoSuchFieldException e) {
+                unexpected(e);
+            }
+            catch (IllegalAccessException e) {
+                // ignore - security manager must be installed
+            }
+        }
+        return true;
+    }
+
     //--------------------- Infrastructure ---------------------------
     volatile int passed = 0, failed = 0;
     void pass() {passed++;}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/util/concurrent/FutureTask/DoneTimedGetLoops.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,163 @@
+/*
+ * 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.
+ */
+
+/*
+ * Written by Martin Buchholz with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/publicdomain/zero/1.0/
+ */
+
+/*
+ * @test
+ * @run main DoneTimedGetLoops 300
+ * @summary isDone returning true guarantees that subsequent timed get
+ * will never throw TimeoutException.
+ */
+
+import java.util.*;
+import java.util.concurrent.*;
+import java.util.concurrent.atomic.*;
+
+@SuppressWarnings({"unchecked", "rawtypes", "deprecation"})
+public class DoneTimedGetLoops {
+    final long testDurationMillisDefault = 10L * 1000L;
+    final long testDurationMillis;
+
+    static class PublicFutureTask extends FutureTask<Boolean> {
+        final static Runnable noop = new Runnable() { public void run() {} };
+        PublicFutureTask() { super(noop, null); }
+        public void set(Boolean v) { super.set(v); }
+        public void setException(Throwable t) { super.setException(t); }
+    }
+
+    DoneTimedGetLoops(String[] args) {
+        testDurationMillis = (args.length > 0) ?
+            Long.valueOf(args[0]) : testDurationMillisDefault;
+    }
+
+    void test(String[] args) throws Throwable {
+        final long testDurationNanos = testDurationMillis * 1000L * 1000L;
+        final long quittingTimeNanos = System.nanoTime() + testDurationNanos;
+        final long timeoutMillis = 10L * 1000L;
+
+        final AtomicReference<PublicFutureTask> normalRef
+            = new AtomicReference<PublicFutureTask>();
+        final AtomicReference<PublicFutureTask> abnormalRef
+            = new AtomicReference<PublicFutureTask>();
+
+        final Throwable throwable = new Throwable();
+
+        abstract class CheckedThread extends Thread {
+            CheckedThread(String name) {
+                super(name);
+                setDaemon(true);
+                start();
+            }
+            /** Polls for quitting time. */
+            protected boolean quittingTime() {
+                return System.nanoTime() - quittingTimeNanos > 0;
+            }
+            /** Polls occasionally for quitting time. */
+            protected boolean quittingTime(long i) {
+                return (i % 1024) == 0 && quittingTime();
+            }
+            abstract protected void realRun() throws Exception;
+            public void run() {
+                try { realRun(); } catch (Throwable t) { unexpected(t); }
+            }
+        }
+
+        Thread setter = new CheckedThread("setter") {
+            protected void realRun() {
+                while (! quittingTime()) {
+                    PublicFutureTask future = new PublicFutureTask();
+                    normalRef.set(future);
+                    future.set(Boolean.TRUE);
+                }}};
+
+        Thread setterException = new CheckedThread("setterException") {
+            protected void realRun() {
+                while (! quittingTime()) {
+                    PublicFutureTask future = new PublicFutureTask();
+                    abnormalRef.set(future);
+                    future.setException(throwable);
+                }}};
+
+        Thread doneTimedGetNormal = new CheckedThread("doneTimedGetNormal") {
+            protected void realRun() throws Exception {
+                while (! quittingTime()) {
+                    PublicFutureTask future = normalRef.get();
+                    if (future != null) {
+                        while (!future.isDone())
+                            ;
+                        check(future.get(0L, TimeUnit.HOURS) == Boolean.TRUE);
+                    }}}};
+
+        Thread doneTimedGetAbnormal = new CheckedThread("doneTimedGetAbnormal") {
+            protected void realRun() throws Exception {
+                while (! quittingTime()) {
+                    PublicFutureTask future = abnormalRef.get();
+                    if (future != null) {
+                        while (!future.isDone())
+                            ;
+                        try { future.get(0L, TimeUnit.HOURS); fail(); }
+                        catch (ExecutionException t) {
+                            check(t.getCause() == throwable);
+                        }
+                    }}}};
+
+        for (Thread thread : new Thread[] {
+                 setter,
+                 setterException,
+                 doneTimedGetNormal,
+                 doneTimedGetAbnormal }) {
+            thread.join(timeoutMillis + testDurationMillis);
+            if (thread.isAlive()) {
+                System.err.printf("Hung thread: %s%n", thread.getName());
+                failed++;
+                for (StackTraceElement e : thread.getStackTrace())
+                    System.err.println(e);
+                // Kludge alert
+                thread.stop();
+                thread.join(timeoutMillis);
+            }
+        }
+    }
+
+    //--------------------- Infrastructure ---------------------------
+    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 equal(Object x, Object y) {
+        if (x == null ? y == null : x.equals(y)) pass();
+        else fail(x + " not equal to " + y);}
+    public static void main(String[] args) throws Throwable {
+        new DoneTimedGetLoops(args).instanceMain(args);}
+    public void instanceMain(String[] args) throws Throwable {
+        try {test(args);} catch (Throwable t) {unexpected(t);}
+        System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed);
+        if (failed > 0) throw new AssertionError("Some tests failed");}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/util/concurrent/FutureTask/ExplicitSet.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,87 @@
+/*
+ * 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 7132378
+ * @summary Race in FutureTask if used with explicit set ( not Runnable )
+ * @author Chris Hegarty
+ */
+
+import java.util.concurrent.Callable;
+import java.util.concurrent.FutureTask;
+
+public class ExplicitSet {
+
+    static void realMain(String[] args) throws Throwable {
+        for (int i = 1; i <= 10000; i++) {
+            //System.out.print(".");
+            test();
+        }
+    }
+
+    static void test() throws Throwable {
+        final SettableTask task = new SettableTask();
+
+        Thread thread = new Thread() { public void run() {
+            try {
+                check(task.get() != null);
+            } catch (Exception e) { unexpected(e); }
+        }};
+        thread.start();
+
+        task.set(Boolean.TRUE);
+        thread.join(5000);
+    }
+
+    static class SettableTask extends FutureTask<Boolean> {
+        SettableTask() {
+            super(new Callable<Boolean>() {
+                    public Boolean call() {
+                        fail ("The task should never be run!");
+                        return null;
+                    };
+                });
+        }
+
+        @Override
+        public void set(Boolean b) {
+            super.set(b);
+        }
+    }
+
+    //--------------------- Infrastructure ---------------------------
+    static volatile int passed = 0, failed = 0;
+    static void pass() {passed++;}
+    static void fail() {failed++; Thread.dumpStack();}
+    static void fail(String msg) {System.out.println(msg); fail();}
+    static void unexpected(Throwable t) {failed++; t.printStackTrace();}
+    static void check(boolean cond) {if (cond) pass(); else fail();}
+    static void equal(Object x, Object y) {
+        if (x == null ? y == null : x.equals(y)) pass();
+        else fail(x + " not equal to " + y);}
+    public static void main(String[] args) throws Throwable {
+        try {realMain(args);} catch (Throwable t) {unexpected(t);}
+        System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed);
+        if (failed > 0) throw new AssertionError("Some tests failed");}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/util/prefs/AddNodeChangeListener.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,95 @@
+/*
+ * 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.  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  7160252 7197662
+  * @summary Checks if events are delivered to a listener
+  *          when a child node is added or removed
+  * @run main/othervm -Djava.util.prefs.userRoot=. AddNodeChangeListener
+  */
+
+import java.util.prefs.*;
+
+ public class AddNodeChangeListener {
+
+     private static boolean failed = false;
+     private static Preferences userRoot, N2;
+     private static NodeChangeListenerAdd ncla;
+
+     public static void main(String[] args)
+         throws BackingStoreException, InterruptedException
+     {
+        userRoot = Preferences.userRoot();
+        ncla = new NodeChangeListenerAdd();
+        userRoot.addNodeChangeListener(ncla);
+        //Should initiate a node added event
+        addNode();
+        // Should not initiate a node added event
+        addNode();
+        //Should initate a child removed event
+        removeNode();
+
+        if (failed)
+            throw new RuntimeException("Failed");
+    }
+
+    private static void addNode()
+        throws BackingStoreException, InterruptedException
+    {
+        N2 = userRoot.node("N2");
+        userRoot.flush();
+        Thread.sleep(3000);
+        if (ncla.getAddNumber() != 1)
+            failed = true;
+    }
+
+    private static void removeNode()
+        throws BackingStoreException, InterruptedException
+    {
+        N2.removeNode();
+        userRoot.flush();
+        Thread.sleep(3000);
+        if (ncla.getAddNumber() != 0)
+            failed = true;
+    }
+
+    private static class NodeChangeListenerAdd implements NodeChangeListener {
+        private int totalNode = 0;
+
+        @Override
+        public void childAdded(NodeChangeEvent evt) {
+            totalNode++;
+        }
+
+        @Override
+        public void childRemoved(NodeChangeEvent evt) {
+            totalNode--;
+        }
+
+        public int getAddNumber(){
+            return totalNode;
+        }
+    }
+ }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/util/prefs/CheckUserPrefFirst.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,43 @@
+/*
+ * 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.  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.util.prefs.Preferences;
+
+/**
+ *
+ * @author khazra
+ * First class called by CheckUserPrefsStorage.sh to create and
+ * store a user preference
+ */
+
+public class CheckUserPrefFirst {
+
+    public static void main(String[] args) throws Exception {
+        Preferences prefs = Preferences.userNodeForPackage(CheckUserPrefFirst.class);
+        prefs.put("Check", "Success");
+        prefs.flush();
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/util/prefs/CheckUserPrefLater.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,45 @@
+/*
+ * 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.  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.util.prefs.Preferences;
+
+/**
+ * CheckUserPrefsStorage.sh uses this to check that preferences stored
+ * by CheckUserPrefFirst.java can be retrieved
+ * @author khazra
+ */
+
+public class CheckUserPrefLater {
+
+    public static void main(String[] args) throws Exception {
+        Preferences prefs = Preferences.userNodeForPackage(CheckUserPrefFirst.class);
+        String result = prefs.get("Check", null);
+        if ((result == null) || !(result.equals("Success")))
+            throw new RuntimeException("User pref not stored!");
+        prefs.remove("Check");
+        prefs.flush();
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/util/prefs/CheckUserPrefsStorage.sh	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,68 @@
+#
+# 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 7198073 7197662
+# @build CheckUserPrefFirst CheckUserPrefLater
+# @run shell CheckUserPrefsStorage.sh
+# @summary Tests that user preferences are stored in the
+#          permanent storage
+#
+
+OS=`uname -s`
+case "$OS" in
+  SunOS | Linux | Darwin )
+    PS=":"
+    FS="/"
+    ;;
+  CYGWIN* )
+    PS=";"
+    FS="/"
+    ;;
+  Windows* )
+    PS=";"
+    FS="\\"
+    ;;
+  * )
+    echo "Unrecognized system!"
+    exit 1;
+    ;;
+esac
+
+# run CheckUserPrefFirst - creates and stores a user pref
+${TESTJAVA}${FS}bin${FS}java -cp ${TESTCLASSES} -Djava.util.prefs.userRoot=. CheckUserPrefFirst
+result=$?
+if [ "$result" -ne "0" ]; then
+    exit 1
+fi
+
+# run CheckUserPrefLater - Looks for the stored pref
+${TESTJAVA}${FS}bin${FS}java -cp ${TESTCLASSES} -Djava.util.prefs.userRoot=. CheckUserPrefLater
+result=$?
+if [ "$result" -ne "0" ]; then
+    exit 1
+fi
+
+# no failures, exit.
+exit 0
+
--- a/test/java/util/prefs/CommentsInXml.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/util/prefs/CommentsInXml.java	Fri Jun 21 19:11:42 2013 -0700
@@ -23,8 +23,9 @@
 
 /*
  * @test
- * @bug 4619564
+ * @bug 4619564 7197662
  * @summary XMl Comments in Preferences File lead to ClassCastException
+ * @run main/othervm -Djava.util.prefs.userRoot=. CommentsInXml
  * @author kladko
  */
 
--- a/test/java/util/prefs/ConflictInFlush.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/util/prefs/ConflictInFlush.java	Fri Jun 21 19:11:42 2013 -0700
@@ -23,8 +23,9 @@
 
 /*
  * @test
- * @bug 4703132
+ * @bug 4703132 7197662
  * @summary flush() throws an IllegalStateException on a removed node
+ * @run main/othervm -Djava.util.prefs.userRoot=. ConflictInFlush
  * @author Sucheta Dambalkar
  */
 
--- a/test/java/util/prefs/ExportNode.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/util/prefs/ExportNode.java	Fri Jun 21 19:11:42 2013 -0700
@@ -24,9 +24,10 @@
 
 /*
  * @test
- * @bug 4387136 4947349
+ * @bug 4387136 4947349 7197662
  * @summary Due to a bug in XMLSupport.putPreferencesInXml(...),
  *          node's keys would not get exported.
+ * @run main/othervm -Djava.util.prefs.userRoot=. ExportNode
  * @author Konstantin Kladko
  */
 import java.util.prefs.*;
--- a/test/java/util/prefs/ExportSubtree.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/util/prefs/ExportSubtree.java	Fri Jun 21 19:11:42 2013 -0700
@@ -23,9 +23,10 @@
 
 
 /* @test
-   @bug 6203576 4700020
-   @summary checks if the output of exportSubtree() is identical to
-            the output from previous release.
+ * @bug 6203576 4700020 7197662
+ * @summary checks if the output of exportSubtree() is identical to
+ *          the output from previous release.
+ * @run main/othervm -Djava.util.prefs.userRoot=. ExportSubtree
  */
 
 import java.io.*;
--- a/test/java/util/prefs/PrefsSpi.sh	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/util/prefs/PrefsSpi.sh	Fri Jun 21 19:11:42 2013 -0700
@@ -24,7 +24,7 @@
 #
 
 # @test
-# @bug 4991526 6514993
+# @bug 4991526 6514993 7197662
 # @summary Unit test for Preferences jar providers
 #
 # @build PrefsSpi
@@ -89,12 +89,16 @@
 
 Sys "$java" "-cp" "$TESTCLASSES${CPS}extDir/PrefsSpi.jar" \
     -Djava.util.prefs.PreferencesFactory=StubPreferencesFactory \
+    -Djava.util.prefs.userRoot=. \
     PrefsSpi "StubPreferences"
 Sys "$java" "-cp" "$TESTCLASSES" \
+    -Djava.util.prefs.userRoot=. \
     PrefsSpi "java.util.prefs.*"
 Sys "$java" "-cp" "$TESTCLASSES${CPS}extDir/PrefsSpi.jar" \
+    -Djava.util.prefs.userRoot=. \
     PrefsSpi "StubPreferences"
 Sys "$java" "-cp" "$TESTCLASSES" "-Djava.ext.dirs=extDir" \
+    -Djava.util.prefs.userRoot=. \
     PrefsSpi "StubPreferences"
 
 rm -rf jarDir extDir
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/util/prefs/RemoveNullKeyCheck.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,45 @@
+/*
+ * 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.
+ */
+
+/* @test
+ * @bug 7160242
+ * @summary Check if NullPointerException is thrown if the key passed
+ *          to remove() is null.
+ * @run main/othervm -Djava.util.prefs.userRoot=. RemoveNullKeyCheck
+ */
+
+import java.util.prefs.Preferences;
+
+public class RemoveNullKeyCheck {
+
+    public static void main(String[] args) throws Exception {
+       try {
+           Preferences node = Preferences.userRoot().node("N1");
+           node.remove(null);
+           throw new RuntimeException("Expected NullPointerException " +
+                                      "not thrown");
+       } catch (NullPointerException npe) {
+           System.out.println("NullPointerException thrown");
+       }
+    }
+}
--- a/test/java/util/prefs/RemoveReadOnlyNode.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/util/prefs/RemoveReadOnlyNode.java	Fri Jun 21 19:11:42 2013 -0700
@@ -23,10 +23,11 @@
 
 
 /* @test
-   @bug 6178148
-   @summary check if wrong exception gets thrown if one of the child
-            nodes is readonly on underlying filesystem when node is
-            being removed.
+ * @bug 6178148 7197662
+ * @summary check if wrong exception gets thrown if one of the child
+ *          nodes is readonly on underlying filesystem when node is
+ *          being removed.
+ * @run main/othervm -Djava.util.prefs.userRoot=. RemoveReadOnlyNode
  */
 
 import java.io.*;
--- a/test/java/util/prefs/RemoveUnregedListener.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/java/util/prefs/RemoveUnregedListener.java	Fri Jun 21 19:11:42 2013 -0700
@@ -23,9 +23,10 @@
 
 
 /* @test
- * @bug 4705094
+ * @bug 4705094 7197662
  * @summary Checks if correct exception gets thrown when removing an
  *          unregistered NodeChangeListener .
+ * @run main/othervm -Djava.util.prefs.userRoot=. RemoveUnregedListener
  */
 
 import java.util.prefs.*;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/util/zip/TotalInOut.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,97 @@
+/*
+ * 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.  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 7188852
+ * @summary Test De/Inflater.getBytesRead/Written()
+ */
+
+import java.io.*;
+import java.util.*;
+import java.util.zip.*;
+
+
+public class TotalInOut {
+     static final int BUF_SIZE= 1 * 1024 * 1024;
+
+     static void realMain (String[] args) throws Throwable {
+         long dataSize = 128L * 1024L * 1024L;      // 128MB
+         if (args.length > 0 && "large".equals(args[0]))
+             dataSize = 5L * 1024L * 1024L * 1024L; //  5GB
+
+         Deflater deflater = new Deflater();
+         Inflater inflater = new Inflater();
+
+         byte[] dataIn = new byte[BUF_SIZE];
+         byte[] dataOut = new byte[BUF_SIZE];
+         byte[] tmp = new byte[BUF_SIZE];
+
+         Random r = new Random();
+         r.nextBytes(dataIn);
+         long bytesReadDef    = 0;
+         long bytesWrittenDef = 0;
+         long bytesReadInf    = 0;
+         long bytesWrittenInf = 0;
+
+         deflater.setInput(dataIn, 0, dataIn.length);
+         while (bytesReadDef < dataSize || bytesWrittenInf < dataSize) {
+             int len = r.nextInt(BUF_SIZE/2) + BUF_SIZE / 2;
+             if (deflater.needsInput()) {
+                 bytesReadDef += dataIn.length;
+                 check(bytesReadDef == deflater.getBytesRead());
+                 deflater.setInput(dataIn, 0, dataIn.length);
+             }
+             int n = deflater.deflate(tmp, 0, len);
+             bytesWrittenDef += n;
+             check(bytesWrittenDef == deflater.getBytesWritten());
+
+             inflater.setInput(tmp, 0, n);
+             bytesReadInf += n;
+             while (!inflater.needsInput()) {
+                 bytesWrittenInf += inflater.inflate(dataOut, 0, dataOut.length);
+                 check(bytesWrittenInf == inflater.getBytesWritten());
+             }
+             check(bytesReadInf == inflater.getBytesRead());
+         }
+     }
+
+     //--------------------- Infrastructure ---------------------------
+     static volatile int passed = 0, failed = 0;
+     static void pass() {passed++;}
+     static void pass(String msg) {System.out.println(msg); passed++;}
+     static void fail() {failed++; Thread.dumpStack();}
+     static void fail(String msg) {System.out.println(msg); fail();}
+     static void unexpected(Throwable t) {failed++; t.printStackTrace();}
+     static void unexpected(Throwable t, String msg) {
+         System.out.println(msg); failed++; t.printStackTrace();}
+     static boolean check(boolean cond) {if (cond) pass(); else fail(); return cond;}
+     static void equal(Object x, Object y) {
+          if (x == null ? y == null : x.equals(y)) pass();
+          else fail(x + " not equal to " + y);}
+     public static void main(String[] args) throws Throwable {
+          try {realMain(args);} catch (Throwable t) {unexpected(t);}
+          System.out.println("\nPassed = " + passed + " failed = " + failed);
+          if (failed > 0) throw new AssertionError("Some tests failed");}
+}
--- a/test/javax/management/remote/mandatory/connection/RMIConnectionIdTest.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/javax/management/remote/mandatory/connection/RMIConnectionIdTest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 4901808
+ * @bug 4901808 7183800
  * @summary Check that RMI connection ids include client host name
  * @author Eamonn McManus
  * @run clean RMIConnectionIdTest
@@ -60,7 +60,7 @@
         }
         String clientAddr = rest.substring(0, spaceIndex);
         InetAddress clientInetAddr = InetAddress.getByName(clientAddr);
-        InetAddress localAddr = InetAddress.getLocalHost();
+        InetAddress localAddr = clientInetAddr.isLoopbackAddress() ? InetAddress.getLoopbackAddress() : InetAddress.getLocalHost();
         System.out.println("InetAddresses: local=" + localAddr + "; " +
                            "connectionId=" + clientInetAddr);
         if (!localAddr.equals(clientInetAddr)) {
--- a/test/javax/management/remote/mandatory/notif/DeadListenerTest.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/javax/management/remote/mandatory/notif/DeadListenerTest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -31,6 +31,7 @@
 import com.sun.jmx.remote.internal.ServerNotifForwarder;
 import java.io.IOException;
 import java.lang.management.ManagementFactory;
+import java.lang.ref.WeakReference;
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
 import java.util.ArrayList;
@@ -86,20 +87,26 @@
         Map<ObjectName, Set<?>> listenerMap = (Map<ObjectName, Set<?>>) listenerMapF.get(serverNotifForwarder);
         assertTrue("Server listenerMap initially empty", mapWithoutKey(listenerMap, delegateName).isEmpty());
 
-        CountListener count1 = new CountListener();
+        final AtomicInteger count1Val = new AtomicInteger();
+        CountListener count1 = new CountListener(count1Val);
         mbsc.addNotificationListener(name, count1, null, null);
+        WeakReference<CountListener> count1Ref = new WeakReference<>(count1);
+        count1 = null;
 
-        CountListener count2 = new CountListener();
+        final AtomicInteger count2Val = new AtomicInteger();
+        CountListener count2 = new CountListener(count2Val);
         NotificationFilterSupport dummyFilter = new NotificationFilterSupport();
         dummyFilter.enableType("");
         mbsc.addNotificationListener(name, count2, dummyFilter, "noddy");
+        WeakReference<CountListener> count2Ref = new WeakReference<>(count2);
+        count2 = null;
 
         assertTrue("One entry in listenerMap for two listeners on same MBean", mapWithoutKey(listenerMap, delegateName).size() == 1);
         Set<?> set = listenerMap.get(name);
         assertTrue("Set in listenerMap for MBean has two elements", set != null && set.size() == 2);
 
-        assertTrue("Initial value of count1 == 0", count1.count() == 0);
-        assertTrue("Initial value of count2 == 0", count2.count() == 0);
+        assertTrue("Initial value of count1 == 0", count1Val.get() == 0);
+        assertTrue("Initial value of count2 == 0", count2Val.get() == 0);
 
         Notification notif = new Notification("type", name, 0);
 
@@ -107,11 +114,11 @@
 
         // Make sure notifs are working normally.
         long deadline = System.currentTimeMillis() + 2000;
-        while ((count1.count() != 1 || count2.count() != 1) && System.currentTimeMillis() < deadline) {
+        while ((count1Val.get() != 1 || count2Val.get() != 1) && System.currentTimeMillis() < deadline) {
             Thread.sleep(10);
         }
-        assertTrue("New value of count1 == 1", count1.count() == 1);
-        assertTrue("Initial value of count2 == 1", count2.count() == 1);
+        assertTrue("New value of count1 == 1", count1Val.get() == 1);
+        assertTrue("Initial value of count2 == 1", count2Val.get() == 1);
 
         // Make sure that removing a nonexistent listener from an existent MBean produces ListenerNotFoundException
         CountListener count3 = new CountListener();
@@ -136,28 +143,29 @@
         mbs.unregisterMBean(name);
         mbean.sendNotification(notif);
         Thread.sleep(200);
-        assertTrue("New value of count1 == 1", count1.count() == 1);
-        assertTrue("Initial value of count2 == 1", count2.count() == 1);
+
+        assertTrue("New value of count1 == 1", count1Val.get() == 1);
+        assertTrue("Initial value of count2 == 1", count2Val.get() == 1);
+
+        // wait for the listener cleanup to take place upon processing notifications
+        int countdown = 50; // waiting max. 5 secs
+        while (countdown-- > 0 &&
+                (count1Ref.get() != null ||
+                 count2Ref.get() != null)) {
+            System.gc();
+            Thread.sleep(100);
+            System.gc();
+        }
+        // listener has been removed or the wait has timed out
+
+        assertTrue("count1 notification listener has not been cleaned up", count1Ref.get() == null);
+        assertTrue("count2 notification listener has not been cleaned up", count2Ref.get() == null);
 
         // Check that there is no trace of the listeners any more in ServerNotifForwarder.listenerMap.
         // THIS DEPENDS ON JMX IMPLEMENTATION DETAILS.
         // If the JMX implementation changes, the code here may have to change too.
         Set<?> setForUnreg = listenerMap.get(name);
         assertTrue("No trace of unregistered MBean: " + setForUnreg, setForUnreg == null);
-
-        // Remove attempts should fail.
-        try {
-            mbsc.removeNotificationListener(name, count1);
-            assertTrue("Remove of count1 listener should have failed", false);
-        } catch (ListenerNotFoundException e) {
-            // OK: expected
-        }
-        try {
-            mbsc.removeNotificationListener(name, count2, dummyFilter, "noddy");
-            assertTrue("Remove of count2 listener should have failed", false);
-        } catch (ListenerNotFoundException e) {
-            // OK: expected
-        }
     }
 
     private static <K, V> Map<K, V> mapWithoutKey(Map<K, V> map, K key) {
@@ -173,6 +181,10 @@
     public static class CountListener implements NotificationListener {
         final AtomicInteger count;
 
+        public CountListener(AtomicInteger i) {
+            count = i;
+        }
+
         public CountListener() {
             this.count = new AtomicInteger();
         }
--- a/test/javax/naming/spi/DirectoryManager/GetContDirCtx.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/javax/naming/spi/DirectoryManager/GetContDirCtx.java	Fri Jun 21 19:11:42 2013 -0700
@@ -26,6 +26,7 @@
  * @bug 4241676
  * @summary getContinuationDirContext() should set CPE environment property.
  * @build DummyObjectFactory DummyContext
+ * @run main/othervm GetContDirCtx
  */
 
 import java.util.Hashtable;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/print/PrintServiceLookup/GetPrintServices.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,58 @@
+/*
+ * 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.
+ */
+
+import javax.print.PrintService;
+import javax.print.PrintServiceLookup;
+import javax.print.attribute.AttributeSet;
+import javax.print.attribute.HashAttributeSet;
+import javax.print.attribute.standard.PrinterName;
+
+/*
+ * @test
+ * @bug 8013810
+ * @summary Test that print service returned without filter are of the same class as with name filter
+ */
+public class GetPrintServices {
+
+  public static void main(String[] args) throws Exception {
+    for (PrintService service : PrintServiceLookup.lookupPrintServices(null, null)) {
+      String serviceName = service.getName();
+      PrintService serviceByName = lookupByName(serviceName);
+      if (!service.equals(serviceByName)) {
+        throw new RuntimeException("NOK " + serviceName
+                                   + " expected: " + service.getClass().getName()
+                                   + " got: " + serviceByName.getClass().getName());
+      }
+    }
+    System.out.println("Test PASSED");
+  }
+
+  private static PrintService lookupByName(String name) {
+    AttributeSet attributes = new HashAttributeSet();
+    attributes.add(new PrinterName(name, null));
+    for (PrintService service : PrintServiceLookup.lookupPrintServices(null, attributes)) {
+      return service;
+    }
+    return null;
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/JColorChooser/Test7194184.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,113 @@
+/*
+ * 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.
+ */
+
+/*
+ * Portions Copyright (c) 2012 IBM Corporation
+ */
+
+/*
+ * @test
+ * @bug 7194184
+ * @summary Tests JColorChooser Swatch keyboard accessibility.
+ * @author Sean Chou
+ * @library ../regtesthelpers
+ * @build Util
+ * @run main Test7194184
+ */
+
+import java.awt.Component;
+import java.awt.AWTException;
+import java.awt.Color;
+import java.awt.Robot;
+import java.awt.Toolkit;
+import java.awt.event.KeyEvent;
+
+import javax.swing.JColorChooser;
+import javax.swing.JFrame;
+import javax.swing.SwingUtilities;
+
+import java.util.concurrent.Callable;
+import sun.awt.SunToolkit;
+
+public class Test7194184 implements Runnable {
+    private static JFrame frame;
+    private static JColorChooser colorChooser;
+    private static Color selectedColor;
+
+    public static void main(String[] args) throws Exception {
+        testKeyBoardAccess();
+    }
+
+    private static void testKeyBoardAccess() throws Exception {
+        Robot robot = new Robot();
+        SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+
+        SwingUtilities.invokeLater(new Test7194184());
+        toolkit.realSync();
+
+        SwingUtilities.invokeLater(new Runnable() {
+            @Override
+            public void run() {
+                selectedColor = colorChooser.getColor();
+
+                Component recentSwatchPanel = Util.findSubComponent(colorChooser, "RecentSwatchPanel");
+                if (recentSwatchPanel == null) {
+                    throw new RuntimeException("RecentSwatchPanel not found");
+                }
+                recentSwatchPanel.requestFocusInWindow();
+            }
+        });
+
+        toolkit.realSync();
+
+        // Tab to move the focus to MainSwatch
+        Util.hitKeys(robot, KeyEvent.VK_SHIFT, KeyEvent.VK_TAB);
+
+        // Select the color on right
+        Util.hitKeys(robot, KeyEvent.VK_RIGHT);
+        Util.hitKeys(robot, KeyEvent.VK_RIGHT);
+        Util.hitKeys(robot, KeyEvent.VK_SPACE);
+        toolkit.realSync();
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                frame.dispose();
+                if (selectedColor == colorChooser.getColor()) {
+                    throw new RuntimeException("JColorChooser misses keyboard accessibility");
+                }
+            }
+        });
+    }
+
+    public void run() {
+        String title = getClass().getName();
+        frame = new JFrame(title);
+        colorChooser = new JColorChooser();
+
+        frame.add(colorChooser);
+        frame.pack();
+        frame.setVisible(true);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/JComboBox/4199622/bug4199622.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,243 @@
+/*
+ * 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.
+ */
+
+/* @test
+   @bug 4199622
+   @summary RFE: JComboBox shouldn't send ActionEvents for keyboard navigation
+   @author Vladislav Karnaukhov
+   @run main bug4199622
+*/
+
+import com.sun.java.swing.plaf.windows.WindowsLookAndFeel;
+import sun.awt.OSInfo;
+import sun.awt.SunToolkit;
+
+import javax.swing.*;
+import javax.swing.plaf.metal.MetalLookAndFeel;
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyEvent;
+import java.lang.reflect.InvocationTargetException;
+
+public class bug4199622 extends JFrame implements ActionListener {
+
+    static final int nElems = 20;
+    static JComboBox<String> cb = null;
+
+    bug4199622(LookAndFeel laf) {
+        super();
+
+        try {
+            UIManager.setLookAndFeel(laf);
+        } catch (UnsupportedLookAndFeelException e) {
+            throw new RuntimeException("Test failed", e);
+        }
+
+        setDefaultCloseOperation(DISPOSE_ON_CLOSE);
+        cb = new JComboBox<>();
+        for (int i = 0; i < nElems; i++) {
+            cb.addItem(String.valueOf(i + 1));
+        }
+        cb.addActionListener(this);
+        add(cb);
+
+        setSize(300, 300);
+        pack();
+    }
+
+    @Override
+    public void actionPerformed(ActionEvent e) {
+        if (UIManager.getBoolean("ComboBox.noActionOnKeyNavigation") && cb.isPopupVisible()) {
+            throw new RuntimeException("Test failed. actionPerformed generated");
+        }
+    }
+
+    static Robot robot = null;
+    static SunToolkit toolkit = null;
+
+    static void doTest() {
+        if (robot == null) {
+            try {
+                robot = new Robot();
+                robot.setAutoDelay(20);
+            } catch (AWTException e) {
+                throw new RuntimeException("Can't create robot. Test failed", e);
+            }
+        }
+
+        toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+        if (toolkit == null) {
+            throw new RuntimeException("Can't get the toolkit. Test failed");
+        }
+        toolkit.realSync();
+
+        doActualTest();
+
+        try {
+            SwingUtilities.invokeAndWait(new Runnable() {
+                @Override
+                public void run() {
+                    cb.hidePopup();
+                    cb.setEditable(true);
+                    cb.updateUI();
+                }
+            });
+        } catch (InterruptedException e) {
+            throw new RuntimeException("Test failed", e);
+        } catch (InvocationTargetException e) {
+            throw new RuntimeException("Test failed", e);
+        }
+
+        toolkit.realSync();
+        doActualTest();
+    }
+
+    static void doActualTest() {
+        UIManager.put("ComboBox.noActionOnKeyNavigation", true);
+        doTestUpDown();
+        UIManager.put("ComboBox.noActionOnKeyNavigation", false);
+        doTestUpDown();
+
+        UIManager.put("ComboBox.noActionOnKeyNavigation", true);
+        doTestPgUpDown();
+        UIManager.put("ComboBox.noActionOnKeyNavigation", false);
+        doTestPgUpDown();
+
+        UIManager.put("ComboBox.noActionOnKeyNavigation", true);
+        doTestHomeEnd();
+        UIManager.put("ComboBox.noActionOnKeyNavigation", false);
+        doTestHomeEnd();
+    }
+
+    static void doTestHomeEnd() {
+        try {
+            SwingUtilities.invokeAndWait(new Runnable() {
+                @Override
+                public void run() {
+                    cb.hidePopup();
+                    cb.setSelectedIndex(0);
+                }
+            });
+        } catch (InterruptedException e) {
+            throw new RuntimeException("Test failed", e);
+        } catch (InvocationTargetException e) {
+            throw new RuntimeException("Test failed", e);
+        }
+        toolkit.realSync();
+
+        robot.keyPress(KeyEvent.VK_END);
+        toolkit.realSync();
+        robot.keyPress(KeyEvent.VK_HOME);
+        toolkit.realSync();
+    }
+
+    static void doTestUpDown() {
+        try {
+            SwingUtilities.invokeAndWait(new Runnable() {
+                @Override
+                public void run() {
+                    cb.hidePopup();
+                    cb.setSelectedIndex(0);
+                }
+            });
+        } catch (InterruptedException e) {
+            throw new RuntimeException("Test failed", e);
+        } catch (InvocationTargetException e) {
+            throw new RuntimeException("Test failed", e);
+        }
+        toolkit.realSync();
+
+        for (int i = 0; i < nElems; i++) {
+            robot.keyPress(KeyEvent.VK_DOWN);
+            toolkit.realSync();
+        }
+
+        for (int i = 0; i < nElems; i++) {
+            robot.keyPress(KeyEvent.VK_UP);
+            toolkit.realSync();
+        }
+    }
+
+    static void doTestPgUpDown() {
+        try {
+            SwingUtilities.invokeAndWait(new Runnable() {
+                @Override
+                public void run() {
+                    cb.hidePopup();
+                    cb.setSelectedIndex(0);
+                }
+            });
+        } catch (InterruptedException e) {
+            throw new RuntimeException("Test failed", e);
+        } catch (InvocationTargetException e) {
+            throw new RuntimeException("Test failed", e);
+        }
+        toolkit.realSync();
+
+        int listHeight = cb.getMaximumRowCount();
+        for (int i = 0; i < nElems; i += listHeight) {
+            robot.keyPress(KeyEvent.VK_PAGE_DOWN);
+            toolkit.realSync();
+        }
+
+        for (int i = 0; i < nElems; i += listHeight) {
+            robot.keyPress(KeyEvent.VK_PAGE_UP);
+            toolkit.realSync();
+        }
+    }
+
+    public static void main(String[] args) {
+        try {
+            SwingUtilities.invokeAndWait(new Runnable() {
+                @Override
+                public void run() {
+                    bug4199622 test = new bug4199622(new MetalLookAndFeel());
+                    test.setVisible(true);
+                }
+            });
+        } catch (InterruptedException e) {
+            throw new RuntimeException("Test failed", e);
+        } catch (InvocationTargetException e) {
+            throw new RuntimeException("Test failed", e);
+        }
+        doTest();
+
+        if (OSInfo.getOSType() == OSInfo.OSType.WINDOWS) {
+            try {
+                SwingUtilities.invokeAndWait(new Runnable() {
+                    @Override
+                    public void run() {
+                        bug4199622 test = new bug4199622(new WindowsLookAndFeel());
+                        test.setVisible(true);
+                    }
+                });
+            } catch (InterruptedException e) {
+                throw new RuntimeException("Test failed", e);
+            } catch (InvocationTargetException e) {
+                throw new RuntimeException("Test failed", e);
+            }
+            doTest();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/JComboBox/6337518/bug6337518.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,48 @@
+/*
+ * 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.
+ */
+
+/* @test
+   @bug 6337518
+   @summary Null Arrow Button Throws Exception in BasicComboBoxUI
+   @author Anton Litvinov
+*/
+
+import javax.swing.*;
+import javax.swing.plaf.basic.*;
+
+public class bug6337518 extends BasicComboBoxUI {
+    @Override
+    protected JButton createArrowButton() {
+        return null;
+    }
+
+    public static void main(String[] args) throws Exception {
+        SwingUtilities.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                JComboBox comboBox = new JComboBox();
+                comboBox.setUI(new bug6337518());
+            }
+        });
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/JComponent/7154030/bug7154030.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,169 @@
+/*
+ * 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.
+ */
+
+/*
+ * Portions Copyright (c) 2012 IBM Corporation
+ */
+
+import javax.swing.JButton;
+import javax.swing.JDesktopPane;
+import javax.swing.JFrame;
+import javax.swing.SwingUtilities;
+import sun.awt.SunToolkit;
+
+import java.awt.AWTException;
+import java.awt.AlphaComposite;
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.Rectangle;
+import java.awt.Robot;
+import java.awt.Toolkit;
+import java.awt.image.BufferedImage;
+
+/* @test 1.1 2012/04/12
+ * @bug 7154030
+ * @summary Swing components fail to hide after calling hide()
+ * @author Jonathan Lu
+ * @library ../../regtesthelpers/
+ * @build Util
+ * @run main bug7154030
+ */
+
+public class bug7154030 {
+
+    private static JButton button = null;
+
+    public static void main(String[] args) throws Exception {
+        BufferedImage imageInit = null;
+
+        BufferedImage imageShow = null;
+
+        BufferedImage imageHide = null;
+
+        SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+
+        Robot robot = new Robot();
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+
+            @Override
+            public void run() {
+                JDesktopPane desktop = new JDesktopPane();
+                button = new JButton("button");
+                JFrame frame = new JFrame();
+
+                button.setSize(200, 200);
+                button.setLocation(100, 100);
+                button.setForeground(Color.RED);
+                button.setBackground(Color.RED);
+                button.setOpaque(true);
+                button.setVisible(false);
+                desktop.add(button);
+
+                frame.setContentPane(desktop);
+                frame.setSize(300, 300);
+                frame.setLocation(0, 0);
+                frame.setVisible(true);
+                frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
+            }
+        });
+
+        toolkit.realSync();
+        imageInit = robot.createScreenCapture(new Rectangle(0, 0, 300, 300));
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+
+            @Override
+            public void run() {
+                button.show();
+            }
+        });
+
+        toolkit.realSync();
+        imageShow = robot.createScreenCapture(new Rectangle(0, 0, 300, 300));
+        if (Util.compareBufferedImages(imageInit, imageShow)) {
+            throw new Exception("Failed to show opaque button");
+        }
+
+        toolkit.realSync();
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+
+            @Override
+            public void run() {
+                button.hide();
+            }
+        });
+
+        toolkit.realSync();
+        imageHide = robot.createScreenCapture(new Rectangle(0, 0, 300, 300));
+
+        if (!Util.compareBufferedImages(imageInit, imageHide)) {
+            throw new Exception("Failed to hide opaque button");
+        }
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+
+            @Override
+            public void run() {
+                button.setOpaque(false);
+                button.setBackground(new Color(128, 128, 0));
+                button.setVisible(false);
+            }
+        });
+
+        toolkit.realSync();
+        imageInit = robot.createScreenCapture(new Rectangle(0, 0, 300, 300));
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+
+            @Override
+            public void run() {
+                button.show();
+            }
+        });
+
+        toolkit.realSync();
+        imageShow = robot.createScreenCapture(new Rectangle(0, 0, 300, 300));
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+
+            @Override
+            public void run() {
+                button.hide();
+            }
+        });
+
+        if (Util.compareBufferedImages(imageInit, imageShow)) {
+            throw new Exception("Failed to show non-opaque button");
+        }
+
+        toolkit.realSync();
+        imageHide = robot.createScreenCapture(new Rectangle(0, 0, 300, 300));
+
+        if (!Util.compareBufferedImages(imageInit, imageHide)) {
+            throw new Exception("Failed to hide non-opaque button");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/JInternalFrame/InternalFrameIsNotCollectedTest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,139 @@
+/*
+ * 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.
+ */
+
+ /* @test
+    @bug 8012004
+    @summary JINTERNALFRAME NOT BEING FINALIZED AFTER CLOSING
+    @author mcherkas
+    @run main InternalFrameIsNotCollectedTest
+ */
+
+import sun.awt.SunToolkit;
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.KeyEvent;
+import java.beans.PropertyVetoException;
+import java.util.Date;
+
+public class InternalFrameIsNotCollectedTest {
+
+    public static final int waitTime = 10000;
+    private static Robot robot;
+
+    public static void sync() {
+
+        SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+        toolkit.realSync();
+    }
+
+    public static void main(String[] args) throws Exception {
+        initRobot();
+        SwingUtilities.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                initUI();
+                try {
+                    closeInternalFrame();
+                } catch (PropertyVetoException e) {
+                    throw new RuntimeException(e);
+                }
+            }
+        });
+        sync();
+        invokeGC();
+        Thread.sleep(1000); // it's better to wait 1 sec now then 10 sec later
+        Date startWaiting = new Date();
+        synchronized (CustomInternalFrame.waiter) {
+            // Sync with finalization thread.
+            Date now = new Date();
+            while (now.getTime() - startWaiting.getTime() < waitTime && !CustomInternalFrame.finalized) {
+                CustomInternalFrame.waiter.wait(waitTime);
+                now = new Date();
+            }
+        }
+        if (!CustomInternalFrame.finalized) {
+            throw new RuntimeException("Closed internal frame wasn't collected");
+        }
+    }
+
+    private static void initRobot() throws AWTException {
+        robot = new Robot();
+        robot.setAutoDelay(100);
+    }
+
+    private static void closeInternalFrame() throws PropertyVetoException {
+        robot.keyPress(KeyEvent.VK_CONTROL);
+        robot.keyPress(KeyEvent.VK_F4);
+        robot.keyRelease(KeyEvent.VK_F4);
+        robot.keyRelease(KeyEvent.VK_CONTROL);
+    }
+
+    private static void initUI() {
+        JFrame frame = new JFrame("Internal Frame Test");
+        frame.getContentPane().setLayout(new BorderLayout());
+        JDesktopPane desktopPane = new JDesktopPane();
+        desktopPane.setDesktopManager(new DefaultDesktopManager());
+        frame.getContentPane().add(desktopPane, BorderLayout.CENTER);
+
+        CustomInternalFrame iFrame = new CustomInternalFrame("Dummy Frame");
+
+        iFrame.setSize(200, 200);
+        iFrame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
+        desktopPane.add(iFrame);
+
+        frame.setSize(800, 600);
+        frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
+        frame.setVisible(true);
+        iFrame.setVisible(true);
+    }
+
+    private static void invokeGC() {
+        System.out.println("Firing garbage collection!");
+        try {
+            StringBuilder sb = new StringBuilder();
+            while (true) {
+                sb.append("any string. some test. a little bit more text." + sb.toString());
+            }
+        } catch (Throwable e) {
+            // do nothing
+        }
+    }
+
+
+    public static class CustomInternalFrame extends JInternalFrame {
+        public static volatile boolean finalized = false;
+        public static Object waiter = new Object();
+
+        public CustomInternalFrame(String title) {
+            super(title, true, true, true, true);
+        }
+
+        protected void finalize() {
+            System.out.println("Finalized!");
+            finalized = true;
+            waiter.notifyAll();
+        }
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/JMenu/4515762/bug4515762.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,172 @@
+/*
+ * 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.
+ */
+
+import java.awt.*;
+import java.awt.event.*;
+import javax.swing.*;
+import sun.awt.SunToolkit;
+
+/**
+ * @test
+ * @bug 4515762
+ * @author Mark Davidson
+ * @summary Tests the ability to support duplicate mnemonics
+ * @library ../../regtesthelpers
+ * @build Util
+ * @run main bug4515762
+ */
+public class bug4515762 {
+
+    private static volatile boolean actionExpected = false;
+    private static volatile boolean actionRecieved = false;
+
+    /**
+     * @param str name of Menu
+     */
+    private static JMenuBar createMenuBar() {
+        JMenuBar menubar = new JMenuBar();
+
+        // Duplicate menu item test for 4515762
+        JMenu menu = new JMenu("Duplicate Menu");
+        menu.setMnemonic('D');
+        menu.add(createMenuItem("Sunday", 'S'));
+        menu.add(createMenuItem("Monday", 'M'));
+
+        menu.add(createMenuItem("Tuesday", 'S'));
+        menu.add(createMenuItem("Wednesday", 'S'));
+        menu.add(createMenuItem("Thursday", 'S'));
+        menu.add(createMenuItem("Friday", 'F'));
+        menu.add(createMenuItem("Saturday", 'S'));
+
+        // Control with unique menu
+        JMenu menu2 = new JMenu("Unique Menu");
+        menu2.setMnemonic('U');
+        menu2.add(createMenuItem("Sunday", 'S'));
+        menu2.add(createMenuItem("Monday", 'M'));
+
+        menu2.add(createMenuItem("Tuesday", 'T'));
+        menu2.add(createMenuItem("Wednesday", 'W'));
+        menu2.add(createMenuItem("Thursday", 'U'));
+        menu2.add(createMenuItem("Friday", 'F'));
+        menu2.add(createMenuItem("Saturday", 'A'));
+
+        menubar.add(menu);
+        menubar.add(menu2);
+
+        return menubar;
+    }
+
+    /**
+     * Creates and returns the menu item.
+     */
+    private static JMenuItem createMenuItem(String name, char mnemonic) {
+        JMenuItem menuItem = new JMenuItem(name, mnemonic);
+        menuItem.addActionListener(new ActionListener() {
+
+            @Override
+            public void actionPerformed(ActionEvent evt) {
+                JMenuItem item = (JMenuItem) evt.getSource();
+                if (actionExpected == false) {
+                    throw new RuntimeException("Menu Action: "
+                            + item.getText() + " should not be called");
+                } else {
+                    actionRecieved = true;
+                }
+            }
+        });
+
+        return menuItem;
+    }
+
+    public static void checkAction() {
+        if (actionRecieved == true) {
+            actionRecieved = false;
+        } else {
+            throw new RuntimeException("Action has not been received");
+        }
+    }
+
+    public static void main(String[] args) throws Throwable {
+        SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+        Robot robot = new Robot();
+        robot.setAutoDelay(250);
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+
+            @Override
+            public void run() {
+                JFrame frame = new JFrame("Test");
+                frame.setJMenuBar(createMenuBar());
+                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+                frame.pack();
+                frame.setVisible(true);
+            }
+        });
+
+        toolkit.realSync();
+
+        Util.hitMnemonics(robot, KeyEvent.VK_D);
+        toolkit.realSync();
+
+        // Press the S key many times (should not cause an action peformed)
+        int TIMES = 5;
+        for (int i = 0; i < TIMES; i++) {
+            Util.hitKeys(robot, KeyEvent.VK_S);
+        }
+        toolkit.realSync();
+
+        // Unique menu items.
+        actionExpected = true;
+        Util.hitMnemonics(robot, KeyEvent.VK_U);
+
+        robot.keyPress(KeyEvent.VK_S);
+        robot.keyRelease(KeyEvent.VK_S);
+        toolkit.realSync();
+
+        checkAction();
+
+        Util.hitMnemonics(robot, KeyEvent.VK_U);
+        robot.keyPress(KeyEvent.VK_M);
+        robot.keyRelease(KeyEvent.VK_M);
+        toolkit.realSync();
+
+        checkAction();
+
+        Util.hitMnemonics(robot, KeyEvent.VK_U);
+        Util.hitKeys(robot, KeyEvent.VK_T);
+        toolkit.realSync();
+
+        checkAction();
+        Util.hitMnemonics(robot, KeyEvent.VK_U);
+        Util.hitKeys(robot, KeyEvent.VK_W);
+        toolkit.realSync();
+
+        checkAction();
+
+        Util.hitMnemonics(robot, KeyEvent.VK_U);
+        Util.hitKeys(robot, KeyEvent.VK_U);
+        toolkit.realSync();
+
+        checkAction();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/JMenu/4692443/bug4692443.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,132 @@
+/*
+ * 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.
+ *
+ * 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
+ * @library ../../regtesthelpers
+ * @build Util
+ * @bug 4692443 7105030
+ * @summary JMenu: MenuListener.menuSelected() event fired too late when using mnemonics
+ * @author Alexander Zuev
+ * @run main bug4692443
+ */
+
+import javax.swing.*;
+import javax.swing.event.*;
+import java.awt.event.*;
+import java.awt.*;
+import sun.awt.SunToolkit;
+
+public class bug4692443 {
+
+    public static PassedListener pass;
+    public static FailedListener fail;
+    public static volatile Boolean passed;
+
+    public static void main(String args[]) throws Throwable {
+
+        fail = new FailedListener();
+        pass = new PassedListener();
+        passed = false;
+        Robot robo = new Robot();
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                createAndShowGUI();
+            }
+        });
+
+        SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+        toolkit.realSync();
+
+        try {
+                robo = new Robot();
+            } catch (AWTException e) {
+                throw new RuntimeException("Robot could not be created");
+            }
+            int altKey = java.awt.event.KeyEvent.VK_ALT;
+            robo.setAutoDelay(100);
+            Util.hitMnemonics(robo, KeyEvent.VK_F); // Enter File menu
+            robo.keyPress(KeyEvent.VK_S);  // Enter submenu
+            robo.keyRelease(KeyEvent.VK_S);
+            robo.keyPress(KeyEvent.VK_O); // Launch "One" action
+            robo.keyRelease(KeyEvent.VK_O);
+            robo.keyPress(KeyEvent.VK_M); // Launch "One" action
+            robo.keyRelease(KeyEvent.VK_M);
+
+            toolkit.realSync();
+
+            if (!passed) {
+                throw new RuntimeException("Test failed.");
+            }
+
+    }
+
+    private static void createAndShowGUI() {
+        JFrame mainFrame = new JFrame("Bug 4692443");
+        JMenuBar mbar = new JMenuBar();
+        JMenu menu = new JMenu("File");
+        menu.setMnemonic('F');
+        menu.add(new JMenuItem("Menu Item 1")).setMnemonic('I');
+        final JMenu submenu = new JMenu("Submenu");
+        submenu.setMnemonic('S');
+        submenu.addMenuListener(new MenuListener() {
+            public void menuSelected(MenuEvent e) {
+                JMenuItem item = submenu.add(new JMenuItem("One", 'O'));
+                item.addActionListener(pass);
+                submenu.add(new JMenuItem("Two", 'w'));
+                submenu.add(new JMenuItem("Three", 'r'));
+            }
+            public void menuDeselected(MenuEvent e) {
+                submenu.removeAll();
+            }
+            public void menuCanceled(MenuEvent e) {
+                submenu.removeAll();
+            }
+        });
+        menu.add(submenu);
+        JMenuItem menuItem = menu.add(new JMenuItem("Menu Item 2"));
+        menuItem.setMnemonic('M');
+        menuItem.addActionListener(fail);
+        mbar.add(menu);
+        mainFrame.setJMenuBar(mbar);
+
+        mainFrame.setSize(200, 200);
+        mainFrame.setLocation(200, 200);
+        mainFrame.setVisible(true);
+        mainFrame.toFront();
+    }
+
+    public static class FailedListener implements ActionListener {
+        public void actionPerformed(ActionEvent ev) {
+            throw new RuntimeException("Test failed.");
+        }
+    }
+
+    public static class PassedListener implements ActionListener {
+        public void actionPerformed(ActionEvent ev) {
+            passed = true;
+        }
+    }
+
+}
--- a/test/javax/swing/JMenuItem/ActionListenerCalledTwice/ActionListenerCalledTwiceTest.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/javax/swing/JMenuItem/ActionListenerCalledTwice/ActionListenerCalledTwiceTest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -35,43 +35,72 @@
 import javax.swing.*;
 
 public class ActionListenerCalledTwiceTest {
+    static String menuItems[] = { "Item1", "Item2" };
+    static KeyStroke keyStrokes[] = {
+        KeyStroke.getKeyStroke(KeyEvent.VK_E, InputEvent.META_MASK),
+        KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0)
+    };
+
     static volatile int listenerCallCounter = 0;
     public static void main(String[] args) throws Exception {
         if (sun.awt.OSInfo.getOSType() != sun.awt.OSInfo.OSType.MACOSX) {
             System.out.println("This test is for MacOS only. Automatically passed on other platforms.");
             return;
         }
+
         System.setProperty("apple.laf.useScreenMenuBar", "true");
         SwingUtilities.invokeAndWait(new Runnable() {
             public void run() {
                 createAndShowGUI();
             }
         });
+
         SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
         Robot robot = new Robot();
         robot.setAutoDelay(100);
-        robot.keyPress(KeyEvent.VK_META);
-        robot.keyPress(KeyEvent.VK_E);
-        robot.keyRelease(KeyEvent.VK_E);
-        robot.keyRelease(KeyEvent.VK_META);
-        toolkit.realSync();
-        if (listenerCallCounter != 1) {
-            throw new Exception("Test failed: ActionListener called " + listenerCallCounter + " times instead of 1!");
+
+        for (int i = 0; i < menuItems.length; ++i) {
+            KeyStroke ks = keyStrokes[i];
+            int modKeyCode = getModKeyCode(ks.getModifiers());
+
+            if (modKeyCode != 0) {
+                robot.keyPress(modKeyCode);
+            }
+
+            robot.keyPress(ks.getKeyCode());
+            robot.keyRelease(ks.getKeyCode());
+
+            if (modKeyCode != 0) {
+                robot.keyRelease(modKeyCode);
+            }
+
+            toolkit.realSync();
+
+            if (listenerCallCounter != 1) {
+                throw new Exception("Test failed: ActionListener for " + menuItems[i] +
+                    " called " + listenerCallCounter + " times instead of 1!");
+            }
+
+            listenerCallCounter = 0;
         }
     }
 
     private static void createAndShowGUI() {
-        JMenuItem newItem = new JMenuItem("Exit");
-        newItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_E, InputEvent.META_MASK));
-        newItem.addActionListener(
-            new ActionListener(){
-                public void actionPerformed(ActionEvent e) {
-                    listenerCallCounter++;
+        JMenu menu = new JMenu("Menu");
+
+        for (int i = 0; i < menuItems.length; ++i) {
+            JMenuItem newItem = new JMenuItem(menuItems[i]);
+            newItem.setAccelerator(keyStrokes[i]);
+            newItem.addActionListener(
+                new ActionListener(){
+                    public void actionPerformed(ActionEvent e) {
+                        listenerCallCounter++;
+                    }
                 }
-            }
-        );
-        JMenu menu = new JMenu("Menu");
-        menu.add(newItem);
+            );
+            menu.add(newItem);
+        }
+
         JMenuBar bar = new JMenuBar();
         bar.add(menu);
         JFrame frame = new JFrame("Test");
@@ -80,4 +109,24 @@
         frame.pack();
         frame.setVisible(true);
     }
+
+    private static int getModKeyCode(int mod) {
+        if ((mod & (InputEvent.SHIFT_DOWN_MASK | InputEvent.SHIFT_MASK)) != 0) {
+            return KeyEvent.VK_SHIFT;
+        }
+
+        if ((mod & (InputEvent.CTRL_DOWN_MASK | InputEvent.CTRL_MASK)) != 0) {
+            return KeyEvent.VK_CONTROL;
+        }
+
+        if ((mod & (InputEvent.ALT_DOWN_MASK | InputEvent.ALT_MASK)) != 0) {
+            return KeyEvent.VK_ALT;
+        }
+
+        if ((mod & (InputEvent.META_DOWN_MASK | InputEvent.META_MASK)) != 0) {
+            return KeyEvent.VK_META;
+        }
+
+        return 0;
+    }
 }
--- a/test/javax/swing/JPopupMenu/6827786/bug6827786.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/javax/swing/JPopupMenu/6827786/bug6827786.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -65,7 +65,11 @@
         checkfocus();
 
         // select menu
-        Util.hitKeys(robot, KeyEvent.VK_ALT, KeyEvent.VK_F);
+        if (sun.awt.OSInfo.getOSType() == sun.awt.OSInfo.OSType.MACOSX) {
+            Util.hitKeys(robot, KeyEvent.VK_CONTROL, KeyEvent.VK_ALT, KeyEvent.VK_F);
+        } else {
+            Util.hitKeys(robot, KeyEvent.VK_ALT, KeyEvent.VK_F);
+        }
         // select submenu
         Util.hitKeys(robot, KeyEvent.VK_S);
         toolkit.realSync();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/JRootPane/4670486/bug4670486.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,145 @@
+/*
+ * 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.
+ */
+
+import java.awt.*;
+import java.awt.event.*;
+import javax.swing.*;
+import sun.awt.SunToolkit;
+
+/**
+ * @test
+ * @bug 4670486
+ * @author Mark Davidson
+ * @summary Regression: Popup menu bindings doesn't work when a default button has been defined.
+ * @library ../../regtesthelpers
+ * @build Util
+ * @run main bug4670486
+ */
+public class bug4670486 {
+
+    public static volatile boolean actionExpected = false;
+    public static volatile boolean actionRecieved = false;
+
+    private static JMenuBar createMenuBar() {
+        JMenuBar menubar = new JMenuBar();
+
+        // Control with unique menu
+        JMenu menu = new JMenu("Unique Menu");
+        menu.setMnemonic('U');
+        menu.add(createMenuItem("Sunday", 'S'));
+        menu.add(createMenuItem("Monday", 'M'));
+
+        menu.add(createMenuItem("Tuesday", 'T'));
+        menu.add(createMenuItem("Wednesday", 'W'));
+        menu.add(createMenuItem("Thursday", 'U'));
+        menu.add(createMenuItem("Friday", 'F'));
+        menu.add(createMenuItem("Saturday", 'A'));
+
+        menubar.add(menu);
+
+        return menubar;
+    }
+
+    private static JPanel createPanel(JFrame frame) {
+        JPanel panel = new JPanel();
+        JButton button = new JButton("Button");
+        JButton button2 = new JButton("Button 2");
+        JButton button3 = new JButton("Button 3");
+
+        JRootPane root = frame.getRootPane();
+        root.setDefaultButton(button);
+
+        panel.add(button);
+        panel.add(button2);
+        panel.add(button3);
+
+        return panel;
+    }
+
+    /**
+     * Creates and returns the menu item.
+     */
+    private static JMenuItem createMenuItem(String name, char mnemonic) {
+        JMenuItem menuItem = new JMenuItem(name, mnemonic);
+        menuItem.addActionListener(new ActionListener() {
+
+            @Override
+            public void actionPerformed(ActionEvent evt) {
+                actionRecieved = true;
+            }
+        });
+
+        return menuItem;
+    }
+
+    public static void checkAction() {
+        if (actionRecieved == true) {
+            actionRecieved = false;
+        } else {
+            throw new RuntimeException("Action has not been received");
+        }
+    }
+
+    public static void main(String[] args) throws Throwable {
+        SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+        Robot robot = new Robot();
+        robot.setAutoDelay(250);
+
+        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+
+            @Override
+            public void run() {
+                JFrame frame = new JFrame("Test");
+                frame.setContentPane(createPanel(frame));
+                frame.setJMenuBar(createMenuBar());
+                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+                frame.pack();
+                frame.setVisible(true);
+            }
+        });
+
+        toolkit.realSync();
+
+        // Change the default button to
+        // force a call to BasicRootPaneUI.updateDefaultButtonBindings()
+        Util.hitKeys(robot, KeyEvent.VK_TAB);
+
+        // If the bug exists, then as soon as the menu appears,
+        // the VK_ENTER, VK_DOWN, VK_UP and VK_ESC will have no
+        // effect.
+        Util.hitMnemonics(robot, KeyEvent.VK_U);
+        Util.hitKeys(robot, KeyEvent.VK_ENTER);
+        toolkit.realSync();
+
+        checkAction();
+
+        Util.hitMnemonics(robot, KeyEvent.VK_U);
+        Util.hitKeys(robot, KeyEvent.VK_DOWN);
+        Util.hitKeys(robot, KeyEvent.VK_ENTER);
+        toolkit.realSync();
+
+        checkAction();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/JScrollBar/7163696/Test7163696.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,103 @@
+/*
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 7163696
+ * @summary Tests that JScrollBar scrolls to the left
+ * @author Sergey Malenkov
+ */
+
+import sun.awt.SunToolkit;
+
+import java.awt.Dimension;
+import java.awt.Point;
+import java.awt.Robot;
+import java.awt.Toolkit;
+import java.awt.event.InputEvent;
+
+import javax.swing.JFrame;
+import javax.swing.JScrollBar;
+import javax.swing.SwingUtilities;
+import javax.swing.UIManager;
+import javax.swing.UIManager.LookAndFeelInfo;
+
+public class Test7163696 implements Runnable {
+
+    private static final boolean AUTO = null != System.getProperty("test.src", null);
+
+    public static void main(String[] args) throws Exception {
+        new Test7163696().test();
+    }
+
+    private JScrollBar bar;
+
+    private void test() throws Exception {
+        Robot robot = new Robot();
+        SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+        for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
+            UIManager.setLookAndFeel(info.getClassName());
+
+            SwingUtilities.invokeAndWait(this);
+            toolkit.realSync(500); // after creation
+
+            Point point = this.bar.getLocation();
+            SwingUtilities.convertPointToScreen(point, this.bar);
+            point.x += this.bar.getWidth() >> 2;
+            point.y += this.bar.getHeight() >> 1;
+            robot.mouseMove(point.x, point.y);
+            robot.mousePress(InputEvent.BUTTON1_MASK);
+            robot.mouseRelease(InputEvent.BUTTON1_MASK);
+
+            toolkit.realSync(500); // before validation
+            SwingUtilities.invokeAndWait(this);
+
+            if (this.bar != null) {
+                this.bar = null; // allows to reuse the instance
+                if (AUTO) { // error reporting only for automatic testing
+                    throw new Error("TEST FAILED");
+                }
+            }
+        }
+    }
+
+    public void run() {
+        if (this.bar == null) {
+            this.bar = new JScrollBar(JScrollBar.HORIZONTAL, 50, 10, 0, 100);
+            this.bar.setPreferredSize(new Dimension(400, 20));
+
+            JFrame frame = new JFrame();
+            frame.add(this.bar);
+            frame.pack();
+            frame.setVisible(true);
+        }
+        else if (40 != this.bar.getValue()) {
+            System.out.println("name = " + UIManager.getLookAndFeel().getName());
+            System.out.println("value = " + this.bar.getValue());
+        }
+        else {
+            SwingUtilities.getWindowAncestor(this.bar).dispose();
+            this.bar = null;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/JTabbedPane/4310381/bug4310381.html	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,6 @@
+<html>
+<body>
+<applet  code="bug4310381.class" width=150 height=150></applet>
+Observe that long Tab titles are clipped with dots at the end
+</body>
+</html> 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/JTabbedPane/4310381/bug4310381.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,83 @@
+/*
+ * 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.
+ */
+
+/*
+ * Portions Copyright (c) 2012 IBM Corporation
+ */
+
+/*
+ * @test
+ * @bug 4310381
+ * @summary Text in multi-row/col JTabbedPane tabs can be truncated/clipped
+ * @author Charles Lee
+   @run applet/manual=yesno bug4310381.html
+ */
+
+
+import javax.swing.*;
+import java.awt.*;
+import java.lang.reflect.InvocationTargetException;
+
+public class bug4310381 extends JApplet {
+    public static void main(String[] args) throws Exception {
+        SwingUtilities.invokeLater(new Runnable() {
+            public void run() {
+                JFrame frame = new JFrame();
+
+                frame.setContentPane(createContentPane());
+                frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
+                frame.setSize(150, 200);
+                frame.setLocationRelativeTo(null);
+
+                frame.setVisible(true);
+
+            }
+        });
+    }
+
+    @Override
+    public void init() {
+        try {
+            SwingUtilities.invokeAndWait(new Runnable() {
+                @Override
+                public void run() {
+                    setContentPane(createContentPane());
+                }
+            });
+        } catch (InterruptedException | InvocationTargetException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    private static Container createContentPane() {
+        JTabbedPane tab = new JTabbedPane();
+        String a2z = "abcdefghijklmnopqrstuvwxyz";
+
+        tab.addTab("0" + a2z + a2z, new JLabel("0"));
+        tab.addTab("1" + a2z, new JLabel("1" + a2z));
+        tab.addTab("2" + a2z, new JLabel("2" + a2z));
+        tab.addTab("3", new JLabel("3" + a2z)); // The last tab in Metal isn't truncated, that's ok
+
+        return tab;
+    }
+}
--- a/test/javax/swing/JTabbedPane/4624207/bug4624207.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/javax/swing/JTabbedPane/4624207/bug4624207.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -37,6 +37,8 @@
 import java.awt.event.FocusEvent;
 import java.awt.event.FocusListener;
 import java.awt.event.KeyEvent;
+
+import sun.awt.OSInfo;
 import sun.awt.SunToolkit;
 
 public class bug4624207 implements ChangeListener, FocusListener {
@@ -99,7 +101,7 @@
 
         toolkit.realSync();
 
-        if ("Aqua".equals(UIManager.getLookAndFeel().getID())) {
+        if (OSInfo.getOSType() == OSInfo.OSType.MACOSX) {
             Util.hitKeys(robot, KeyEvent.VK_CONTROL, KeyEvent.VK_ALT, KeyEvent.VK_B);
         } else {
             Util.hitKeys(robot, KeyEvent.VK_ALT, KeyEvent.VK_B);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/JTable/7055065/bug7055065.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,178 @@
+/*
+ * 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.
+ */
+
+/*
+ * Portions Copyright (c) 2012 IBM Corporation
+ */
+
+/* @test 1.1 2012/04/19
+ * @bug 7055065
+ * @summary NullPointerException when sorting JTable with empty cell
+ * @author Jonathan Lu
+ * @library ../../regtesthelpers/
+ * @build Util
+ * @run main bug7055065
+ */
+
+import java.awt.Dimension;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.Robot;
+import java.awt.Toolkit;
+import java.awt.event.InputEvent;
+import java.awt.event.KeyEvent;
+import javax.swing.JFrame;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTable;
+import javax.swing.SwingUtilities;
+import javax.swing.table.AbstractTableModel;
+import javax.swing.table.TableModel;
+import javax.swing.table.TableRowSorter;
+import sun.awt.SunToolkit;
+import java.util.concurrent.Callable;
+
+public class bug7055065 {
+
+    private static JTable table;
+
+    public static void main(String[] args) throws Exception {
+        SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+        Robot robot = new Robot();
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+
+            public void run() {
+                createAndShowUI();
+            }
+        });
+
+        toolkit.realSync();
+        clickCell(robot, 1, 1);
+        Util.hitKeys(robot, KeyEvent.VK_BACK_SPACE, KeyEvent.VK_BACK_SPACE,
+                KeyEvent.VK_BACK_SPACE);
+
+        toolkit.realSync();
+        clickColumnHeader(robot, 1);
+
+        toolkit.realSync();
+        clickColumnHeader(robot, 1);
+    }
+
+    private static void clickCell(Robot robot, final int row, final int column)
+        throws Exception {
+        Point point = Util.invokeOnEDT(new Callable<Point>() {
+            @Override
+            public Point call() throws Exception {
+                Rectangle rect = table.getCellRect(row, column, false);
+                Point point = new Point(rect.x + rect.width / 2, rect.y
+                    + rect.height / 2);
+                SwingUtilities.convertPointToScreen(point, table);
+                return point;
+            }
+        });
+
+        robot.mouseMove(point.x, point.y);
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+    }
+
+    private static void clickColumnHeader(Robot robot, final int column)
+        throws Exception {
+        Point point = Util.invokeOnEDT(new Callable<Point>() {
+            @Override
+            public Point call() throws Exception {
+                Rectangle rect = table.getCellRect(0, column, false);
+                int headerHeight = table.getTableHeader().getHeight();
+                Point point = new Point(rect.x + rect.width / 2, rect.y
+                    - headerHeight / 2);
+                SwingUtilities.convertPointToScreen(point, table);
+                return point;
+            }
+        });
+
+        robot.mouseMove(point.x, point.y);
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+    }
+
+    private static void createAndShowUI() {
+        JFrame frame = new JFrame("SimpleTableDemo");
+        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+
+        JPanel newContentPane = new JPanel();
+        newContentPane.setOpaque(true);
+        frame.setContentPane(newContentPane);
+
+        final String[] columnNames = { "String", "Number" };
+        final Object[][] data = { { "aaaa", new Integer(1) },
+            { "bbbb", new Integer(3) }, { "cccc", new Integer(2) },
+            { "dddd", new Integer(4) }, { "eeee", new Integer(5) } };
+        table = new JTable(data, columnNames);
+
+        table.setPreferredScrollableViewportSize(new Dimension(500, 400));
+        table.setFillsViewportHeight(true);
+
+        TableModel dataModel = new AbstractTableModel() {
+
+            public int getColumnCount() {
+                return columnNames.length;
+            }
+
+            public int getRowCount() {
+                return data.length;
+            }
+
+            public Object getValueAt(int row, int col) {
+                return data[row][col];
+            }
+
+            public String getColumnName(int column) {
+                return columnNames[column];
+            }
+
+            public Class<?> getColumnClass(int c) {
+                return getValueAt(0, c).getClass();
+            }
+
+            public boolean isCellEditable(int row, int col) {
+                return col != 5;
+            }
+
+            public void setValueAt(Object aValue, int row, int column) {
+                data[row][column] = aValue;
+            }
+        };
+        table.setModel(dataModel);
+        TableRowSorter<TableModel> sorter = new TableRowSorter<TableModel>(
+                dataModel);
+        table.setRowSorter(sorter);
+
+        JScrollPane scrollPane = new JScrollPane(table);
+        newContentPane.add(scrollPane);
+
+        frame.pack();
+        frame.setLocation(0, 0);
+        frame.setVisible(true);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/JTable/7068740/bug7068740.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,134 @@
+/*
+ * 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.
+ */
+
+/* @test
+   @bug 7068740
+   @summary JTable wrapped in JLayer can't use PGUP/PGDOWN keys
+   @author Vladislav Karnaukhov
+   @run main bug7068740
+*/
+
+import sun.awt.SunToolkit;
+
+import javax.swing.*;
+import javax.swing.plaf.LayerUI;
+import javax.swing.plaf.metal.MetalLookAndFeel;
+import javax.swing.table.DefaultTableModel;
+import java.awt.*;
+import java.awt.event.KeyEvent;
+import java.lang.reflect.InvocationTargetException;
+
+public class bug7068740 extends JFrame {
+
+    private static Robot robot = null;
+    private static JTable table = null;
+    private static SunToolkit toolkit = null;
+
+    bug7068740() {
+        super();
+        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
+
+        DefaultTableModel model = new DefaultTableModel() {
+            @Override
+            public int getRowCount() {
+                return 20;
+            }
+
+            @Override
+            public int getColumnCount() {
+                return 2;
+            }
+
+            @Override
+            public Object getValueAt(int row, int column) {
+                return "(" + row + "," + column + ")";
+            }
+        };
+
+        table = new JTable(model);
+        LayerUI<JComponent> layerUI = new LayerUI<>();
+        JLayer<JComponent> layer = new JLayer<>(table, layerUI);
+        JScrollPane scrollPane = new JScrollPane(layer);
+        add(scrollPane);
+        pack();
+        setLocationRelativeTo(null);
+    }
+
+    private static void setUp() {
+        try {
+            if (robot == null) {
+                robot = new Robot();
+                robot.setAutoDelay(20);
+            }
+
+            if (toolkit == null) {
+                toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+            }
+
+            SwingUtilities.invokeAndWait(new Runnable() {
+                @Override
+                public void run() {
+                    bug7068740 test = new bug7068740();
+                    test.setVisible(true);
+                }
+            });
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+            throw new RuntimeException("Test failed");
+        } catch (InvocationTargetException e) {
+            e.printStackTrace();
+            throw new RuntimeException("Test failed");
+        } catch (AWTException e) {
+            e.printStackTrace();
+            throw new RuntimeException("Test failed");
+        }
+    }
+
+    private static void doTest() {
+        toolkit.realSync();
+        table.setRowSelectionInterval(0, 0);
+
+        robot.keyPress(KeyEvent.VK_PAGE_DOWN);
+        toolkit.realSync();
+        if (table.getSelectedRow() != 19) {
+            throw new RuntimeException("Test failed");
+        }
+
+        robot.keyPress(KeyEvent.VK_PAGE_UP);
+        toolkit.realSync();
+        if (table.getSelectedRow() != 0) {
+            throw new RuntimeException("Test failed");
+        }
+    }
+
+    public static void main(String[] args) {
+        try {
+            UIManager.setLookAndFeel(new MetalLookAndFeel());
+            setUp();
+            doTest();
+        } catch (UnsupportedLookAndFeelException e) {
+            e.printStackTrace();
+            throw new RuntimeException("Test failed");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/JTable/7188612/JTableAccessibleGetLocationOnScreen.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,106 @@
+/*
+ * 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.
+ */
+
+/*
+ * Portions Copyright (c) 2012 IBM Corporation
+ */
+
+/* @test
+ * @bug 7188612
+ * @summary AccessibleTableHeader and AccessibleJTableCell should stick to
+ *    AccessibleComponent.getLocationOnScreen api.
+ * @author Frank Ding
+ */
+
+import javax.accessibility.AccessibleComponent;
+import javax.accessibility.AccessibleTable;
+import javax.swing.JComponent;
+import javax.swing.JFrame;
+import javax.swing.JTable;
+import javax.swing.SwingUtilities;
+
+public class JTableAccessibleGetLocationOnScreen {
+    private static JFrame frame;
+    private static JTable table;
+
+    public static void main(String[] args) throws Exception {
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+
+            @Override
+            public void run() {
+                constructInEDT();
+                try {
+                    assertGetLocation();
+                } finally {
+                    frame.dispose();
+                }
+            }
+        });
+
+    }
+
+    private static void constructInEDT() {
+        String[] columnNames = { "col1", "col2", };
+        Object[][] data = { { "row1, col1", "row1, col2" },
+                { "row2, col1", "row2, col2" }, };
+
+        frame = new JFrame(
+                "JTable AccessibleTableHeader and AccessibleJTableCell test");
+        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+        table = new JTable(data, columnNames);
+        frame.add(table);
+        frame.pack();
+    }
+
+    private static void assertGetLocation() {
+        // the frame is now invisible
+        // test getLocationOnScreen() of
+        // JTable$AccessibleJTable$AccessibleJTableHeaderCell
+        // and JTable$AccessibleJTable$AccessibleJTableCell
+        AccessibleTable accessibleTable = (AccessibleTable) table
+                .getAccessibleContext();
+        AccessibleTable header = accessibleTable.getAccessibleColumnHeader();
+        AccessibleComponent accessibleComp1 = (AccessibleComponent) header
+                .getAccessibleAt(0, 0);
+        // getLocation() must be null according to its javadoc and no exception
+        // is thrown
+        if (null != accessibleComp1.getLocationOnScreen()) {
+            throw new RuntimeException(
+                    "JTable$AccessibleJTable$AccessibleJTableHeaderCell."
+                            + "getLocation() must be null");
+        }
+
+        JComponent.AccessibleJComponent accessibleJComponent =
+                (JComponent.AccessibleJComponent) table.getAccessibleContext();
+        AccessibleComponent accessibleComp2 = (AccessibleComponent)
+                accessibleJComponent.getAccessibleChild(3);
+        // getLocation() must be null according to its javadoc and no exception
+        // is thrown
+        if (null != accessibleComp2.getLocationOnScreen()) {
+            throw new RuntimeException("JTable$AccessibleJTable$"
+                    + "AccessibleJTableCell.getLocation() must be null");
+        }
+
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/JTable/8005019/bug8005019.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,103 @@
+/*
+ * 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.
+ *
+ * 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 8005019
+ * @summary JTable passes row index instead of length when inserts selection interval
+ * @author Alexander Scherbatiy
+ * @run main bug8005019
+ */
+
+import java.util.*;
+import javax.swing.*;
+import javax.swing.table.*;
+
+public class bug8005019 {
+
+    public static void main(String[] args) throws Exception {
+        SwingUtilities.invokeAndWait(new Runnable() {
+
+            @Override
+            public void run() {
+                testSelectionWithFilterTable();
+            }
+        });
+    }
+
+    private static void testSelectionWithFilterTable() {
+        DefaultTableModel model = new DefaultTableModel(0, 1);
+        // a model with 3 elements is the minimum to demonstrate
+        // the bug
+        int last = 2;
+        for (int i = 0; i <= last; i++) {
+            model.addRow(new Object[]{i});
+        }
+        JTable table = new JTable(model);
+        table.setAutoCreateRowSorter(true);
+        // set selection at the end
+        table.setRowSelectionInterval(last, last);
+        // exclude rows based on identifier
+        RowFilter filter = new GeneralFilter(new int[]{0});
+        ((DefaultRowSorter) table.getRowSorter()).setRowFilter(filter);
+        // insertRow _before or at_ selected model index, such that
+        // endIndex (in event) > 1
+        model.insertRow(2, new Object[]{"x"});
+    }
+
+    private static class GeneralFilter extends RowFilter<Object, Object> {
+
+        private int[] columns;
+        List excludes = Arrays.asList(0);
+
+        GeneralFilter(int[] columns) {
+            this.columns = columns;
+        }
+
+        public boolean include(RowFilter.Entry<? extends Object, ? extends Object> value) {
+            int count = value.getValueCount();
+            if (columns.length > 0) {
+                for (int i = columns.length - 1; i >= 0; i--) {
+                    int index = columns[i];
+                    if (index < count) {
+                        if (include(value, index)) {
+                            return true;
+                        }
+                    }
+                }
+            } else {
+                while (--count >= 0) {
+                    if (include(value, count)) {
+                        return true;
+                    }
+                }
+            }
+            return false;
+        }
+
+        protected boolean include(
+                Entry<? extends Object, ? extends Object> entry,
+                int index) {
+            return !excludes.contains(entry.getIdentifier());
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/JTextArea/7049024/bug7049024.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,134 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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.
+ */
+
+/*
+ * Portions Copyright (c) 2011 IBM Corporation
+ */
+
+/* @test
+ * @bug 7049024
+ * @summary DnD fails with JTextArea and JTextField
+ * @author Sean Chou
+ */
+
+import sun.awt.SunToolkit;
+
+import javax.swing.*;
+import javax.swing.text.DefaultCaret;
+import java.awt.*;
+import java.awt.datatransfer.Clipboard;
+import java.awt.datatransfer.DataFlavor;
+
+public class bug7049024 {
+    public static Clipboard clipboard = null;
+
+    public static JTextField textField = null;
+
+    // This button is used to move focus away from textField.
+    public static JButton button = null;
+
+    public static JFrame frame = null;
+
+    public static DefaultCaret caret = null;
+
+    public static void main(String[] args) throws Exception {
+
+        SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+        SwingUtilities.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                frame = new JFrame("Test");
+                textField = new JTextField("test selection for textfield");
+                button = new JButton("To compete the focus");
+
+                frame.setLayout(new FlowLayout());
+                frame.getContentPane().add(textField);
+                frame.getContentPane().add(button);
+
+                frame.pack();
+                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+                frame.setVisible(true);
+            }
+        });
+        toolkit.realSync();
+
+        clipboard = textField.getToolkit().getSystemSelection();
+        if (null == clipboard) {
+            return;
+        }
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                textField.requestFocusInWindow();
+            }
+        });
+        toolkit.realSync();
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                caret = (DefaultCaret) textField.getCaret();
+                caret.setDot(2);
+                caret.moveDot(4);
+            }
+        });
+        toolkit.realSync();
+
+        String oldSelection = (String) clipboard.getData(DataFlavor.stringFlavor);
+        System.out.println("oldSelection is " + oldSelection);
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                button.requestFocusInWindow();
+            }
+        });
+        toolkit.realSync(); // So JTextField loses the focus.
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                caret.setDot(4);
+                caret.moveDot(6);
+            }
+        });
+        toolkit.realSync();
+
+        String newSelection = (String) clipboard.getData(DataFlavor.stringFlavor);
+        System.out.println("newSelection is " + newSelection);
+
+        boolean passed = newSelection.equals(oldSelection);
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                frame.dispose();
+            }
+        });
+
+        if (!passed) {
+            throw new RuntimeException("The test for bug 7049024 failed");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/JTree/8003400/Test8003400.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,109 @@
+/*
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8003400
+ * @summary Tests that JTree shows the last row
+ * @author Sergey Malenkov
+ * @run main/othervm Test8003400
+ * @run main/othervm Test8003400 reverse
+ * @run main/othervm Test8003400 system
+ * @run main/othervm Test8003400 system reverse
+ */
+
+import sun.awt.SunToolkit;
+
+import java.awt.Rectangle;
+import java.awt.Robot;
+import java.awt.Toolkit;
+import java.awt.event.KeyEvent;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import javax.swing.JFrame;
+import javax.swing.JScrollPane;
+import javax.swing.JTree;
+import javax.swing.SwingUtilities;
+import javax.swing.UIManager;
+import javax.swing.tree.DefaultMutableTreeNode;
+
+public class Test8003400 {
+
+    private static final String TITLE = "Test JTree with a large model";
+    private static List<String> OBJECTS = Arrays.asList(TITLE, "x", "y", "z");
+    private static JScrollPane pane;
+
+    public static void main(String[] args) throws Exception {
+        for (String arg : args) {
+            if (arg.equals("reverse")) {
+                Collections.reverse(OBJECTS);
+            }
+            if (arg.equals("system")) {
+                UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+            }
+        }
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                DefaultMutableTreeNode root = new DefaultMutableTreeNode();
+
+                JTree tree = new JTree(root);
+                tree.setLargeModel(true);
+                tree.setRowHeight(16);
+
+                JFrame frame = new JFrame(TITLE);
+                frame.add(pane = new JScrollPane(tree));
+                frame.setSize(200, 100);
+                frame.setLocationRelativeTo(null);
+                frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
+                frame.setVisible(true);
+
+                for (String object : OBJECTS) {
+                    root.add(new DefaultMutableTreeNode(object));
+                }
+                tree.expandRow(0);
+            }
+        });
+
+        SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+        toolkit.realSync(500);
+        new Robot().keyPress(KeyEvent.VK_END);
+        toolkit.realSync(500);
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                JTree tree = (JTree) pane.getViewport().getView();
+                Rectangle inner = tree.getRowBounds(tree.getRowCount() - 1);
+                Rectangle outer = SwingUtilities.convertRectangle(tree, inner, pane);
+                outer.y += tree.getRowHeight() - 1 - pane.getVerticalScrollBar().getHeight();
+                // error reporting only for automatic testing
+                if (null != System.getProperty("test.src", null)) {
+                    SwingUtilities.getWindowAncestor(pane).dispose();
+                    if (outer.y != 0) {
+                        throw new Error("TEST FAILED: " + outer.y);
+                    }
+                }
+            }
+        });
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/JTree/8003830/bug8003830.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,66 @@
+/*
+ * 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.
+ */
+
+import java.awt.EventQueue;
+import java.awt.Rectangle;
+import java.awt.event.ActionEvent;
+import javax.swing.JTree;
+import javax.swing.plaf.basic.BasicTreeUI;
+import javax.swing.tree.TreePath;
+
+
+/* Originally reported as NetBeans bug 222081.
+ *
+ * @test
+ * @bug 8003830
+ * @summary NullPointerException in BasicTreeUI.Actions when getPathBounds returns null
+ * @author Jaroslav Tulach
+ * @run main bug8003830
+ */
+
+public class bug8003830 implements Runnable {
+    public static void main(String[] args) throws Exception {
+        EventQueue.invokeAndWait(new bug8003830());
+    }
+    @Override
+    public void run() {
+        testNPEAtActionsPage();
+    }
+
+    public void testNPEAtActionsPage() {
+        JTree tree = new JTree();
+        BasicTreeUI ui = new NullReturningTreeUI();
+        tree.setUI(ui);
+        BasicTreeUI.TreePageAction tpa = ui.new TreePageAction(0, "down");
+        tpa.actionPerformed(new ActionEvent(tree, 0, ""));
+    }
+
+    private static final class NullReturningTreeUI extends BasicTreeUI {
+        @Override
+        public Rectangle getPathBounds(JTree tree, TreePath path) {
+            // the method can return null and callers have to be ready for
+            // that. Simulate the case by returning null for unknown reason.
+            return null;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/JTree/8004298/bug8004298.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,121 @@
+/*
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8004298
+ * @summary NPE in WindowsTreeUI.ensureRowsAreVisible
+ * @author Alexander Scherbatiy
+ * @library ../../regtesthelpers
+ * @build Util
+ * @run main bug8004298
+ */
+
+import java.awt.*;
+import java.awt.event.InputEvent;
+import javax.swing.*;
+import javax.swing.tree.*;
+import java.util.concurrent.Callable;
+import sun.awt.SunToolkit;
+import com.sun.java.swing.plaf.windows.WindowsLookAndFeel;
+import com.sun.java.swing.plaf.windows.WindowsTreeUI;
+
+public class bug8004298 {
+
+    private static JTree tree;
+
+    public static void main(String[] args) throws Exception {
+        Robot robot = new Robot();
+        robot.setAutoDelay(50);
+        SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+        try {
+            UIManager.setLookAndFeel(new WindowsLookAndFeel());
+        } catch (javax.swing.UnsupportedLookAndFeelException ulafe) {
+            System.out.println(ulafe.getMessage());
+            System.out.println("The test is considered PASSED");
+            return;
+        }
+        SwingUtilities.invokeAndWait(new Runnable() {
+
+            @Override
+            public void run() {
+                createAndShowGUI();
+            }
+        });
+
+        toolkit.realSync();
+
+        Point point = Util.invokeOnEDT(new Callable<Point>() {
+
+            @Override
+            public Point call() throws Exception {
+                Rectangle rect = tree.getRowBounds(2);
+                Point p = new Point(rect.x + rect.width / 2, rect.y + rect.height / 2);
+                SwingUtilities.convertPointToScreen(p, tree);
+                return p;
+            }
+        });
+
+        robot.mouseMove(point.x, point.y);
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+        toolkit.realSync();
+
+    }
+
+    private static void createAndShowGUI() {
+        JFrame frame = new JFrame();
+        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+
+        DefaultMutableTreeNode root = new DefaultMutableTreeNode("root");
+        root.add(new DefaultMutableTreeNode("colors"));
+        DefaultMutableTreeNode sports = new DefaultMutableTreeNode("sports");
+        sports.add(new DefaultMutableTreeNode("basketball"));
+        sports.add(new DefaultMutableTreeNode("football"));
+        root.add(sports);
+
+        tree = new JTree(root);
+        tree.setUI(new NullReturningTreeUI());
+
+        frame.getContentPane().add(tree);
+        frame.pack();
+        frame.setVisible(true);
+
+    }
+
+    private static final class NullReturningTreeUI extends WindowsTreeUI {
+
+        @Override
+        public Rectangle getPathBounds(JTree tree, TreePath path) {
+            // the method can return null and callers have to be ready for
+            // that. Simulate the case by returning null for unknown reason.
+            if (path != null && path.toString().contains("football")) {
+                return null;
+            }
+
+            return super.getPathBounds(tree, path);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/KeyboardManager/8013370/Test8013370.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,110 @@
+/*
+ * 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.
+ */
+
+import java.awt.Robot;
+import java.awt.Toolkit;
+import java.awt.event.ActionEvent;
+import java.awt.event.KeyEvent;
+
+import javax.swing.AbstractAction;
+import javax.swing.InputMap;
+import javax.swing.JFrame;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.KeyStroke;
+import sun.awt.SunToolkit;
+
+import static java.awt.event.InputEvent.CTRL_DOWN_MASK;
+import static javax.swing.JComponent.WHEN_IN_FOCUSED_WINDOW;
+import static javax.swing.JOptionPane.showMessageDialog;
+import static javax.swing.SwingUtilities.invokeAndWait;
+
+/*
+ * @test
+ * @bug 8013370
+ * @summary Ensure that key stroke is not null
+ * @author Sergey Malenkov
+ */
+
+public class Test8013370 implements Runnable {
+    public static void main(String[] args) throws Exception {
+        Test8013370 task = new Test8013370();
+        invokeAndWait(task);
+
+        Robot robot = new Robot();
+        robot.waitForIdle();
+        robot.keyPress(KeyEvent.VK_CONTROL);
+        robot.keyRelease(KeyEvent.VK_CONTROL);
+        robot.waitForIdle();
+
+        invokeAndWait(task);
+        task.validate();
+    }
+
+    private JFrame frame;
+    private boolean error;
+
+    @Override
+    public void run() {
+        if (this.frame == null) {
+            JMenuBar menu = new JMenuBar() {
+                @Override
+                protected boolean processKeyBinding(KeyStroke stroke, KeyEvent event, int condition, boolean pressed) {
+                    if (stroke == null) {
+                        Test8013370.this.error = true;
+                        return false;
+                    }
+                    return super.processKeyBinding(stroke, event, condition, pressed);
+                }
+            };
+            menu.add(new JMenuItem("Menu"));
+
+            InputMap map = menu.getInputMap(WHEN_IN_FOCUSED_WINDOW);
+            // We add exactly 10 actions because the ArrayTable is converted
+            // from a array to a hashtable when more than 8 values are added.
+            for (int i = 0; i < 9; i++) {
+                String name = " Action #" + i;
+                map.put(KeyStroke.getKeyStroke(KeyEvent.VK_A + i, CTRL_DOWN_MASK), name);
+
+                menu.getActionMap().put(name, new AbstractAction(name) {
+                    @Override
+                    public void actionPerformed(ActionEvent event) {
+                        showMessageDialog(null, getValue(NAME));
+                    }
+                });
+            }
+            this.frame = new JFrame("8013370");
+            this.frame.setJMenuBar(menu);
+            this.frame.setVisible(true);
+        }
+        else {
+            this.frame.dispose();
+        }
+    }
+
+    private void validate() {
+        if (this.error) {
+            throw new Error("KeyStroke is null");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/RepaintManager/IconifyTest/IconifyTest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,80 @@
+/*
+ * 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 4665214
+ * @summary Makes sure that RepaintManager doesn't attempt to repaint
+ *          a frame when it is iconified.
+ * @author Scott Violet
+ * @run main IconifyTest
+ */
+import java.awt.*;
+import java.awt.event.*;
+import javax.swing.*;
+import sun.awt.*;
+
+public class IconifyTest {
+    private static volatile boolean windowIconifiedIsCalled = false;
+    private static volatile boolean frameIsRepainted = false;
+    static JFrame frame;
+    static JButton button;
+
+    public static void main(String[] args) throws Throwable {
+        SunToolkit toolkit = (SunToolkit) SunToolkit.getDefaultToolkit();
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                frame = new JFrame();
+                button = new JButton("HI");
+                frame.getContentPane().add(button);
+                frame.addWindowListener(new WindowAdapter() {
+                    public void windowIconified(WindowEvent e) {
+                        windowIconifiedIsCalled = true;
+                        RepaintManager rm = RepaintManager.currentManager(null);
+                        rm.paintDirtyRegions();
+                        button.repaint();
+                        if (!rm.getDirtyRegion(button).isEmpty()) {
+                            frameIsRepainted = true;
+                        }
+                    }
+                });
+                frame.pack();
+                frame.setVisible(true);
+            }
+        });
+        toolkit.realSync();
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                frame.setExtendedState(Frame.ICONIFIED);
+            }
+        });
+        toolkit.realSync();
+
+        if (!windowIconifiedIsCalled) {
+            throw new Exception("Test failed: window was not iconified.");
+        }
+        if (frameIsRepainted) {
+            throw new Exception("Test failed: frame was repainted when window was iconified.");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/SpringLayout/4726194/bug4726194.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,161 @@
+/*
+ * 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 4726194 7124209
+ * @summary Tests for 4726194
+ * @author Phil Milne
+ */
+import java.awt.*;
+import java.lang.reflect.InvocationTargetException;
+import java.util.*;
+import java.util.List;
+import javax.swing.*;
+
+public class bug4726194 {
+
+    private static String[] hConstraints = {SpringLayout.WEST, "Width", SpringLayout.EAST, SpringLayout.HORIZONTAL_CENTER};
+    private static String[] vConstraints = {SpringLayout.NORTH, "Height", SpringLayout.SOUTH, SpringLayout.VERTICAL_CENTER, SpringLayout.BASELINE};
+    private static int[] FAIL = new int[3];
+    private static boolean TEST_DUPLICATES = false;
+
+    public static void main(String[] args) {
+        try {
+            SwingUtilities.invokeAndWait(new Runnable() {
+                @Override
+                public void run() {
+                    int minLevel = 2;
+                    int maxLevel = 2;
+                    for (int i = minLevel; i <= maxLevel; i++) {
+                        test(i, true);
+                        test(i, false);
+                    }
+                }
+            });
+        } catch (InterruptedException | InvocationTargetException ex) {
+            ex.printStackTrace();
+            throw new RuntimeException("FAILED: SwingUtilities.invokeAndWait method failed!");
+        }
+    }
+
+    public static void test(int level, boolean horizontal) {
+        List result = new ArrayList();
+        String[] constraints = horizontal ? hConstraints : vConstraints;
+        test(level, constraints, result, Arrays.asList(new Object[level]));
+        JTextField tf = new JTextField("");
+        tf.setFont(new Font("Dialog", Font.PLAIN, 6));
+        System.out.print("\t\t");
+        for (int j = 0; j < constraints.length; j++) {
+            String constraint = constraints[j];
+            System.out.print(constraint + "                ".substring(constraint.length()));
+        }
+        System.out.println("");
+        for (int i = 0; i < result.size(); i++) {
+            SpringLayout.Constraints c = new SpringLayout.Constraints(tf);
+            List cc = (List) result.get(i);
+            for (int j = 0; j < cc.size(); j++) {
+                String constraint = (String) cc.get(j);
+                c.setConstraint(constraint, Spring.constant((j + 1) * 10));
+            }
+            System.out.print(" Input:\t\t");
+            for (int j = 0; j < constraints.length; j++) {
+                String constraint = constraints[j];
+                int jj = cc.indexOf(constraint);
+                String val = cc.contains(constraint) ? Integer.toString((jj + 1) * 10) : "?";
+                System.out.print(val + "\t\t");
+            }
+            System.out.println("");
+            System.out.print("Output:\t\t");
+            for (int j = 0; j < constraints.length; j++) {
+                String constraint = constraints[j];
+                Spring spring = c.getConstraint(constraint);
+                String springVal = (spring == null) ? "?" : Integer.toString(spring.getValue());
+                System.out.print(springVal);
+                System.out.print("\t\t");
+            }
+            for (int j = 0; j < cc.size(); j++) {
+                String constraint = (String) cc.get(j);
+                Spring con = c.getConstraint(constraint);
+                if (con == null || con.getValue() != (j + 1) * 10) {
+                    throw new RuntimeException("Values are wrong!!! ");
+                }
+            }
+            if (horizontal) {
+                int[] a1 = getValues(c, new String[]{SpringLayout.WEST, SpringLayout.WIDTH, SpringLayout.EAST});
+                if (a1[0] + a1[1] != a1[2]) {
+                    throw new RuntimeException("WEST + WIDTH != EAST!!! ");
+                }
+                int[] a2 = getValues(c, new String[]{SpringLayout.WEST, SpringLayout.WIDTH, SpringLayout.HORIZONTAL_CENTER});
+                if (a2[0] + a2[1] / 2 != a2[2]) {
+                    throw new RuntimeException("WEST + WIDTH/2 != HORIZONTAL_CENTER!!! ");
+                }
+            } else {
+                int[] a3 = getValues(c, new String[]{SpringLayout.NORTH, SpringLayout.HEIGHT, SpringLayout.SOUTH});
+                if (a3[0] + a3[1] != a3[2]) {
+                    throw new RuntimeException("NORTH + HEIGHT != SOUTH!!! ");
+                }
+                int[] a4 = getValues(c, new String[]{SpringLayout.NORTH, SpringLayout.HEIGHT, SpringLayout.VERTICAL_CENTER});
+                int vcDiff = Math.abs(a4[0] + a4[1] / 2 - a4[2]);
+                if (vcDiff > 1) {
+                    throw new RuntimeException("NORTH + HEIGHT/2 != VERTICAL_CENTER!!! ");
+                }
+                int[] a5 = getValues(c, new String[]{SpringLayout.NORTH, SpringLayout.BASELINE, SpringLayout.SOUTH});
+                if (a5[0] > a5[1] != a5[1] > a5[2]) {
+                    throw new RuntimeException("BASELINE is not in the range: [NORTH, SOUTH]!!!");
+                }
+            }
+            System.out.println("");
+        }
+        System.out.println("");
+    }
+
+    private static int[] getValues(SpringLayout.Constraints con, String[] cNames) {
+        int[] result = new int[cNames.length];
+        for (int i = 0; i < cNames.length; i++) {
+            String name = cNames[i];
+            Spring s = con.getConstraint(name);
+            if (s == null) {
+                System.out.print("Warning: " + name + " is undefined. ");
+                return FAIL;
+            }
+            result[i] = s.getValue();
+        }
+        return result;
+    }
+
+    public static void test(int level, String[] constraints, List result, List soFar) {
+        if (level == 0) {
+            result.add(soFar);
+            return;
+        }
+        for (int i = 0; i < constraints.length; i++) {
+            if (soFar.contains(constraints[i]) && !TEST_DUPLICATES) {
+                continue;
+            }
+            List child = new ArrayList(soFar);
+            child.set(level - 1, constraints[i]);
+            test(level - 1, constraints, result, child);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/ToolTipManager/7123767/bug7123767.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,220 @@
+/*
+ * 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 7123767
+   @summary Wrong tooltip location in Multi-Monitor configurations
+   @author Vladislav Karnaukhov
+   @run main bug7123767
+*/
+
+import sun.awt.SunToolkit;
+
+import javax.swing.*;
+import javax.swing.plaf.metal.MetalLookAndFeel;
+import java.awt.*;
+import java.awt.event.MouseEvent;
+import java.lang.reflect.InvocationTargetException;
+
+public class bug7123767 extends JFrame {
+
+    private static class TestFactory extends PopupFactory {
+
+        private static TestFactory newFactory = new TestFactory();
+        private static PopupFactory oldFactory;
+
+        private TestFactory() {
+            super();
+        }
+
+        public static void install() {
+            if (oldFactory == null) {
+                oldFactory = getSharedInstance();
+                setSharedInstance(newFactory);
+            }
+        }
+
+        public static void uninstall() {
+            if (oldFactory != null) {
+                setSharedInstance(oldFactory);
+            }
+        }
+
+        // Actual test happens here
+        public Popup getPopup(Component owner, Component contents, int x, int y) {
+            GraphicsConfiguration mouseGC = testGC(MouseInfo.getPointerInfo().getLocation());
+            if (mouseGC == null) {
+                throw new RuntimeException("Can't find GraphicsConfiguration that mouse pointer belongs to");
+            }
+
+            GraphicsConfiguration tipGC = testGC(new Point(x, y));
+            if (tipGC == null) {
+                throw new RuntimeException("Can't find GraphicsConfiguration that tip belongs to");
+            }
+
+            if (!mouseGC.equals(tipGC)) {
+                throw new RuntimeException("Mouse and tip GCs are not equal");
+            }
+
+            return super.getPopup(owner, contents, x, y);
+        }
+
+        private static GraphicsConfiguration testGC(Point pt) {
+            GraphicsEnvironment environment = GraphicsEnvironment.getLocalGraphicsEnvironment();
+            GraphicsDevice[] devices = environment.getScreenDevices();
+            for (GraphicsDevice device : devices) {
+                GraphicsConfiguration[] configs = device.getConfigurations();
+                for (GraphicsConfiguration config : configs) {
+                    Rectangle rect = config.getBounds();
+                    Insets insets = Toolkit.getDefaultToolkit().getScreenInsets(config);
+                    adjustInsets(rect, insets);
+                    if (rect.contains(pt))
+                        return config;
+                }
+            }
+
+            return null;
+        }
+    }
+
+    private static final int MARGIN = 10;
+    private static bug7123767 frame;
+    private static Robot robot;
+
+    public static void main(String[] args) throws Exception {
+        UIManager.setLookAndFeel(new MetalLookAndFeel());
+        setUp();
+        testToolTip();
+        TestFactory.uninstall();
+    }
+
+    // Creates a window that is stretched across all available monitors
+    // and adds itself as ContainerListener to track tooltips drawing
+    private bug7123767() {
+        super();
+
+        ToolTipManager.sharedInstance().setInitialDelay(0);
+        setDefaultCloseOperation(DISPOSE_ON_CLOSE);
+        TestFactory.install();
+
+        JLabel label1 = new JLabel("no preferred location");
+        label1.setToolTipText("tip");
+        add(label1, BorderLayout.WEST);
+
+        JLabel label2 = new JLabel("preferred location (20000, 20000)") {
+            public Point getToolTipLocation(MouseEvent event) {
+                return new Point(20000, 20000);
+            }
+        };
+
+        label2.setToolTipText("tip");
+        add(label2, BorderLayout.EAST);
+
+        setUndecorated(true);
+        pack();
+
+        Rectangle rect = new Rectangle();
+        GraphicsEnvironment environment = GraphicsEnvironment.getLocalGraphicsEnvironment();
+        GraphicsDevice[] devices = environment.getScreenDevices();
+        for (GraphicsDevice device : devices) {
+            GraphicsConfiguration[] configs = device.getConfigurations();
+            for (GraphicsConfiguration config : configs) {
+                Insets localInsets = Toolkit.getDefaultToolkit().getScreenInsets(config);
+                Rectangle localRect = config.getBounds();
+                adjustInsets(localRect, localInsets);
+                rect.add(localRect);
+            }
+        }
+        setBounds(rect);
+    }
+
+    private static void setUp() throws InterruptedException, InvocationTargetException {
+        SwingUtilities.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                frame = new bug7123767();
+                frame.setVisible(true);
+            }
+        });
+    }
+
+    // Moves mouse pointer to the corners of every GraphicsConfiguration
+    private static void testToolTip() throws AWTException {
+        SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+        toolkit.realSync();
+
+        GraphicsEnvironment environment = GraphicsEnvironment.getLocalGraphicsEnvironment();
+        GraphicsDevice[] devices = environment.getScreenDevices();
+        for (GraphicsDevice device : devices) {
+            GraphicsConfiguration[] configs = device.getConfigurations();
+            for (GraphicsConfiguration config : configs) {
+                Rectangle rect = config.getBounds();
+                Insets insets = toolkit.getScreenInsets(config);
+                adjustInsets(rect, insets);
+
+                // Upper left
+                glide(rect.x + rect.width / 2, rect.y + rect.height / 2,
+                        rect.x + MARGIN, rect.y + MARGIN);
+                toolkit.realSync();
+
+                // Lower left
+                glide(rect.x + rect.width / 2, rect.y + rect.height / 2,
+                        rect.x + MARGIN, rect.y + rect.height - MARGIN);
+                toolkit.realSync();
+
+                // Upper right
+                glide(rect.x + rect.width / 2, rect.y + rect.height / 2,
+                        rect.x + rect.width - MARGIN, rect.y + MARGIN);
+                toolkit.realSync();
+
+                // Lower right
+                glide(rect.x + rect.width / 2, rect.y + rect.height / 2,
+                        rect.x + rect.width - MARGIN, rect.y + rect.height - MARGIN);
+                toolkit.realSync();
+            }
+        }
+    }
+
+    private static void glide(int x0, int y0, int x1, int y1) throws AWTException {
+        if (robot == null) {
+            robot = new Robot();
+            robot.setAutoDelay(20);
+        }
+
+        float dmax = (float) Math.max(Math.abs(x1 - x0), Math.abs(y1 - y0));
+        float dx = (x1 - x0) / dmax;
+        float dy = (y1 - y0) / dmax;
+
+        robot.mouseMove(x0, y0);
+        for (int i = 1; i <= dmax; i += 10) {
+            robot.mouseMove((int) (x0 + dx * i), (int) (y0 + dy * i));
+        }
+    }
+
+    private static void adjustInsets(Rectangle rect, final Insets insets) {
+        rect.x += insets.left;
+        rect.y += insets.top;
+        rect.width -= (insets.left + insets.right);
+        rect.height -= (insets.top + insets.bottom);
+    }
+}
--- a/test/javax/swing/regtesthelpers/Util.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/javax/swing/regtesthelpers/Util.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -23,11 +23,13 @@
 
 import javax.swing.*;
 import java.awt.*;
+import java.awt.event.*;
 import java.awt.image.BufferedImage;
 import java.util.ArrayList;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.concurrent.Callable;
+import sun.swing.*;
 
 /**
  * <p>This class contains utilities useful for regression testing.
@@ -144,6 +146,53 @@
     }
 
      /**
+     * Hits mnemonics by robot.
+     */
+    public static void hitMnemonics(Robot robot, int... keys) {
+
+        ArrayList<Integer> mnemonicKeyCodes = getSystemMnemonicKeyCodes();
+        for (Integer mnemonic : mnemonicKeyCodes) {
+            robot.keyPress(mnemonic);
+        }
+
+        hitKeys(robot, keys);
+
+        for (Integer mnemonic : mnemonicKeyCodes) {
+            robot.keyRelease(mnemonic);
+        }
+    }
+
+    /**
+     * Gets key codes from system mnemonic key mask
+     * @return key codes list
+     */
+    public static ArrayList<Integer> getSystemMnemonicKeyCodes() {
+        return Util.getKeyCodesFromKeyMask(SwingUtilities2.getSystemMnemonicKeyMask());
+    }
+
+    /**
+     * Gets the key codes list from modifiers
+     * @param modifiers an integer combination of the modifier constants
+     * @return key codes list
+     */
+    public static ArrayList<Integer> getKeyCodesFromKeyMask(int modifiers) {
+        ArrayList<Integer> result = new ArrayList<>();
+        if ((modifiers & InputEvent.CTRL_MASK) != 0) {
+            result.add(KeyEvent.VK_CONTROL);
+        }
+        if ((modifiers & InputEvent.ALT_MASK) != 0) {
+            result.add(KeyEvent.VK_ALT);
+        }
+        if ((modifiers & InputEvent.SHIFT_MASK) != 0) {
+            result.add(KeyEvent.VK_SHIFT);
+        }
+        if ((modifiers & InputEvent.META_MASK) != 0) {
+            result.add(KeyEvent.VK_META);
+        }
+        return result;
+    }
+
+     /**
      * Hits keys by robot.
      */
     public static void hitKeys(Robot robot, int... keys) {
--- a/test/javax/swing/text/CSSBorder/6796710/bug6796710.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/javax/swing/text/CSSBorder/6796710/bug6796710.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 6796710
+ * @bug 6796710 7124242
  * @summary Html content in JEditorPane is overlapping on swing components while resizing the application.
  * @library ../../../regtesthelpers
  * @build Util
@@ -31,11 +31,10 @@
    @run main bug6796710
  */
 
-import sun.awt.SunToolkit;
-
-import javax.swing.*;
 import java.awt.*;
 import java.awt.image.BufferedImage;
+import javax.swing.*;
+import sun.awt.SunToolkit;
 
 public class bug6796710 {
     // The page is inlined because we want to be sure that the JEditorPane filled synchronously
@@ -68,9 +67,12 @@
         robot = new Robot();
 
         SwingUtilities.invokeAndWait(new Runnable() {
+            @Override
             public void run() {
                 frame = new JFrame();
 
+                frame.setUndecorated(true);
+
                 pnBottom = new JPanel();
                 pnBottom.add(new JLabel("Some label"));
                 pnBottom.add(new JButton("A button"));
@@ -95,9 +97,13 @@
 
         ((SunToolkit) SunToolkit.getDefaultToolkit()).realSync();
 
+        // This delay should be added for MacOSX, realSync is not enough
+        Thread.sleep(1000);
+
         BufferedImage bufferedImage = getPnBottomImage();
 
         SwingUtilities.invokeAndWait(new Runnable() {
+            @Override
             public void run() {
                 frame.setSize(400, 150);
             }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/text/DefaultCaret/6938583/bug6938583.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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.
+ */
+
+/*
+ * Portions Copyright (c) 2011 IBM Corporation
+ */
+
+/*
+ * @test
+ * @bug 6938583
+ * @summary Unexpected NullPointerException when use CodeIM demo on windows
+ * @author LittleE
+ */
+
+import javax.swing.*;
+import javax.swing.text.DefaultCaret;
+import java.awt.event.MouseEvent;
+
+public class bug6938583 {
+    public static void main(String[] args) throws Exception {
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                JTextArea jta = new JTextArea();
+                DefaultCaret dc = new DefaultCaret();
+                jta.setCaret(dc);
+                dc.deinstall(jta);
+                dc.mouseClicked(new MouseEvent(jta, MouseEvent.MOUSE_CLICKED, 0, 0, 0, 0, 0, false));
+            }
+        });
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/text/View/8014863/bug8014863.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,146 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+
+/*
+ * @test
+ * @bug 8014863
+ * @summary  Tests the calculation of the line breaks when a text is inserted
+ * @author Dmitry Markov
+ * @library ../../../regtesthelpers
+ * @build Util
+ * @run main bug8014863
+ */
+
+import sun.awt.SunToolkit;
+
+import javax.swing.*;
+import javax.swing.text.html.HTMLEditorKit;
+import java.awt.*;
+import java.awt.event.KeyEvent;
+
+public class bug8014863 {
+
+    private static JEditorPane editorPane;
+    private static Robot robot;
+    private static SunToolkit toolkit;
+
+    public static void main(String[] args) throws Exception {
+        toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+        robot = new Robot();
+
+        createAndShowGUI();
+
+        toolkit.realSync();
+
+        Util.hitKeys(robot, KeyEvent.VK_HOME);
+        Util.hitKeys(robot, KeyEvent.VK_O);
+
+        toolkit.realSync();
+
+        if (3 != getNumberOfTextLines()) {
+            throw new RuntimeException("The number of texts lines does not meet the expectation");
+        }
+
+        Util.hitKeys(robot, KeyEvent.VK_N);
+
+        toolkit.realSync();
+
+        if (3 != getNumberOfTextLines()) {
+            throw new RuntimeException("The number of texts lines does not meet the expectation");
+        }
+
+        Util.hitKeys(robot, KeyEvent.VK_E);
+        Util.hitKeys(robot, KeyEvent.VK_SPACE);
+        Util.hitKeys(robot, KeyEvent.VK_T);
+        Util.hitKeys(robot, KeyEvent.VK_W);
+
+        toolkit.realSync();
+
+        if (3 != getNumberOfTextLines()) {
+            throw new RuntimeException("The number of texts lines does not meet the expectation");
+        }
+    }
+
+    private static int getNumberOfTextLines() throws Exception {
+        int numberOfLines = 0;
+        int caretPosition = getCaretPosition();
+        int current = 1;
+        int previous;
+
+        setCaretPosition(current);
+        do {
+            previous = current;
+            Util.hitKeys(robot, KeyEvent.VK_DOWN);
+            toolkit.realSync();
+            current = getCaretPosition();
+            numberOfLines++;
+        } while (current != previous);
+
+        setCaretPosition(caretPosition);
+        return numberOfLines;
+    }
+
+    private static int getCaretPosition() throws Exception {
+        final int[] result = new int[1];
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                result[0] = editorPane.getCaretPosition();
+            }
+        });
+        return result[0];
+    }
+
+    private static void setCaretPosition(final int position) throws Exception {
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                editorPane.setCaretPosition(position);
+            }
+        });
+    }
+
+    private static void createAndShowGUI() throws Exception {
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                try {
+                    UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
+                } catch (Exception ex) {
+                    throw new RuntimeException(ex);
+                }
+                JFrame frame = new JFrame();
+                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+
+                editorPane = new JEditorPane();
+                HTMLEditorKit editorKit = new HTMLEditorKit();
+                editorPane.setEditorKit(editorKit);
+                editorPane.setText("<p>qqqq <em>pp</em> qqqq <em>pp</em> " +
+                        "qqqq <em>pp</em> qqqq <em>pp</em> qqqq <em>pp</em> qqqq <em>pp" +
+                        "</em> qqqq <em>pp</em> qqqq <em>pp</em> qqqq <em>pp</em> qqqq</p>");
+                editorPane.setCaretPosition(1);
+
+                frame.add(editorPane);
+                frame.setSize(200, 200);
+                frame.setVisible(true);
+            }
+        });
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/text/html/8008289/bug8008289.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,138 @@
+/*
+ * 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.
+ */
+
+/*
+ * Portions Copyright (c) 2012 IBM Corporation
+ */
+import java.awt.BorderLayout;
+import java.awt.Toolkit;
+
+import java.awt.event.ActionListener;
+import javax.swing.DefaultButtonModel;
+import javax.swing.JEditorPane;
+import javax.swing.JFrame;
+import javax.swing.SwingUtilities;
+import javax.swing.text.StyleConstants;
+import javax.swing.text.StyleContext;
+import javax.swing.text.html.HTMLEditorKit;
+import sun.awt.SunToolkit;
+
+
+/*
+ * @test
+ * @bug 8008289
+ * @summary Shared ButtonModel instance should deregister previous listeners.
+ * @author Frank Ding
+ */
+public class bug8008289 {
+
+    private static JEditorPane html;
+    private static JFrame frame;
+
+    private static void setup() {
+        /**
+         * Note the input type is not restricted to "submit". Types "image",
+         * "checkbox", "radio" have the same problem.
+         */
+        html = new JEditorPane("text/html",
+                "<html><body><form action=\"http://localhost.cgi\">"
+                        + "<input type=submit name=submit value=\"submit\"/>"
+                        + "</form></body></html>");
+        frame = new JFrame();
+        frame.setLayout(new BorderLayout());
+        frame.add(html, BorderLayout.CENTER);
+        frame.setSize(200, 100);
+        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+        frame.setVisible(true);
+    }
+
+    private static void doTest() {
+        /*
+         * Calling updateComponentTreeUI creates a new FormView instance with
+         * its own associated JButton instance. The same DefaultButtonModel
+         * instance is used for both FormView's.
+         *
+         * The action listeners associated with (the JButton for) the first
+         * FormView should be unregistered from this common DefaultButtonModel,
+         * such that only those for the new FormView remain.
+         */
+        SwingUtilities.updateComponentTreeUI(html);
+    }
+
+    private static void verifySingleDefaultButtonModelListener() {
+        HTMLEditorKit htmlEditorKit = (HTMLEditorKit) html.getEditorKit();
+        StyleContext.NamedStyle style = ((StyleContext.NamedStyle) htmlEditorKit
+                .getInputAttributes());
+        DefaultButtonModel model = ((DefaultButtonModel) style
+                .getAttribute(StyleConstants.ModelAttribute));
+        ActionListener[] listeners = model.getActionListeners();
+        int actionListenerNum = listeners.length;
+        if (actionListenerNum != 1) {
+            throw new RuntimeException(
+                    "Expected single ActionListener object registered with "
+                    + "DefaultButtonModel; found " + actionListenerNum
+                    + " listeners registered.");
+        }
+
+        int changeListenerNum = model.getChangeListeners().length;
+        if (changeListenerNum != 1) {
+            throw new RuntimeException(
+                    "Expected at most one ChangeListener object registered "
+                    + "with DefaultButtonModel; found " + changeListenerNum
+                    + " listeners registered.");
+        }
+        int itemListenerNum = model.getItemListeners().length;
+        if (itemListenerNum != 1) {
+            throw new RuntimeException(
+                    "Expected at most one ItemListener object registered "
+                    + "with DefaultButtonModel; found " + itemListenerNum
+                    + " listeners registered.");
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        final SunToolkit toolkit = ((SunToolkit) Toolkit.getDefaultToolkit());
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+
+            @Override
+            public void run() {
+                setup();
+            }
+        });
+        toolkit.realSync();
+        SwingUtilities.invokeAndWait(new Runnable() {
+
+            @Override
+            public void run() {
+                try {
+                    verifySingleDefaultButtonModelListener();
+                    doTest();
+                    verifySingleDefaultButtonModelListener();
+                } finally {
+                    frame.dispose();
+                }
+            }
+        });
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/text/html/parser/Parser/6836089/bug6836089.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2010, 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 6836089
+ * @summary Tests correct parsing of characters outside Base Multilingual Plane
+ * @author Vladislav Karnaukhov
+ */
+
+import javax.swing.*;
+import javax.swing.text.html.*;
+
+public class bug6836089 {
+
+    public static void main(String[] args) throws Exception {
+        SwingUtilities.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                JTextPane htmlPane = new JTextPane();
+                htmlPane.setEditorKit(new HTMLEditorKit());
+
+                htmlPane.setText("<html><head></head><body>&#131072;</body></html>");
+                String str = htmlPane.getText();
+                if (str.contains("&#0;")) {
+                    throw new RuntimeException("Test failed");
+                }
+            }
+        });
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/xml/jaxp/Encodings/CheckEncodingPropertiesFile.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,421 @@
+/*
+ * 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.
+ */
+
+/**
+ * @test
+ * @bug 8008738
+ * @summary checks that the mapping implemented by
+ *      com.sun.org.apache.xml.internal.serializer.Encodings
+ *      correctly identifies valid Charset names and
+ *      correctly maps them to their preferred mime names.
+ *      Also checks that the Encodings.properties resource file
+ *      is consistent.
+ * @compile -XDignore.symbol.file CheckEncodingPropertiesFile.java
+ * @run main CheckEncodingPropertiesFile
+ * @author Daniel Fuchs
+ */
+
+import com.sun.org.apache.xml.internal.serializer.EncodingInfo;
+import com.sun.org.apache.xml.internal.serializer.Encodings;
+import java.io.InputStreamReader;
+import java.lang.reflect.Method;
+import java.nio.charset.Charset;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+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.Map.Entry;
+import java.util.Properties;
+import java.util.Set;
+import java.util.StringTokenizer;
+
+public class CheckEncodingPropertiesFile {
+
+    private static final String ENCODINGS_FILE = "com/sun/org/apache/xml/internal/serializer/Encodings.properties";
+
+    public static void main(String[] args) throws Exception {
+        Properties props = new Properties();
+        try (InputStreamReader is = new InputStreamReader(ClassLoader.getSystemResourceAsStream(ENCODINGS_FILE))) {
+            props.load(is);
+        }
+
+        //printAllCharsets();
+
+        test(props);
+    }
+
+
+    private static final class CheckCharsetMapping {
+
+        /**
+         * A map that maps Java or XML name to canonical charset names.
+         * key:    upper cased value of Java or XML name.
+         * value:  case-sensitive canonical name of charset.
+         */
+        private final Map<String, String> charsetMap = new HashMap<>();
+
+        private final Map<String, String> preferredMime = new HashMap<>();
+
+        /**
+         * Unresolved alias names.
+         * For a given set of names pointing to the same unresolved charset,
+         * this map will contain, for each alias in the set, a mapping
+         * with the alias.toUpperValue() as key and the set of known aliases
+         * as value.
+         */
+        private final Map<String, Collection<String>> unresolved = new HashMap<>();
+
+        public final static class ConflictingCharsetError extends Error {
+            ConflictingCharsetError(String a, String cs1, String cs2) {
+                super("Conflicting charset mapping for '"+a+"': '"+cs1+"' and '"+cs2+"'");
+            }
+        }
+
+        public final static class MissingValidCharsetNameError extends Error {
+            MissingValidCharsetNameError(String name, Collection<String> aliases) {
+                super(name+": Line "+aliases+" has no recognized charset alias");
+            }
+        }
+
+        public final static class ConflictingPreferredMimeNameError extends Error {
+            ConflictingPreferredMimeNameError(String a, String cs1, String cs2) {
+                super("Conflicting preferred mime name for '"+a+"': '"+cs1+"' and '"+cs2+"'");
+            }
+        }
+
+        /**
+         * For each alias in aliases, attempt to find the canonical
+         * charset name.
+         * All names in aliases are supposed to point to the same charset.
+         * Names in aliases can be java names or XML names, indifferently.
+         * @param aliases list of names (aliases) for a given charset.
+         * @return The canonical name of the charset, if found, null otherwise.
+         */
+        private String findCharsetNameFor(String[] aliases) {
+            String cs = null;
+            String res = null;
+            for (String a : aliases) {
+                final String k = a.toUpperCase();
+                String cachedCs = charsetMap.get(k);
+                if (cs == null) {
+                    cs = cachedCs;
+                }
+                if (cachedCs != null && cs != null
+                        && !Charset.forName(cachedCs).name().equals(Charset.forName(cs).name())) {
+                    throw new ConflictingCharsetError(a,cs,cachedCs);
+                }
+                try {
+                    final String rcs = Charset.forName(a).name();
+                    if (cs != null && !Charset.forName(cs).name().equals(rcs)) {
+                        throw new ConflictingCharsetError(a,cs,rcs);
+                    }
+                    if (res == null) {
+                        if (a.equals(aliases[0])) {
+                            res = a;
+                        } else {
+                            res = cs;
+                        }
+                    }
+                    cs = rcs;
+                    charsetMap.put(k, res == null ? cs : res);
+                } catch (Exception x) {
+                    continue;
+                }
+            }
+            return res == null ? cs : res;
+        }
+
+        /**
+         * Register a canonical charset name for a given set of aliases.
+         *
+         * @param charsetName the canonical charset name.
+         * @param aliases a list of aliases for the given charset.
+         */
+        private void registerCharsetNameFor(String charsetName, String[] aliases) {
+            if (charsetName == null) throw new NullPointerException();
+
+            for (String a : aliases) {
+                String k = a.toUpperCase();
+                String csv = charsetMap.get(k);
+                if (csv == null) {
+                    charsetMap.put(k, charsetName);
+                    csv = charsetName;
+                } else if (!csv.equals(charsetName)) {
+                    throw new ConflictingCharsetError(a,charsetName,csv);
+                }
+
+                final Collection<String> c = unresolved.get(k);
+                if (c != null) {
+                    for (String aa : c) {
+                        k = aa.toUpperCase();
+                        String csvv = charsetMap.get(k);
+                        if (csvv == null) charsetMap.put(k, csv);
+                        unresolved.remove(k);
+                    }
+                    throw new MissingValidCharsetNameError(charsetName,c);
+                }
+            }
+        }
+
+        /**
+         * Register a set of aliases as being unresolved.
+         * @param names    the list of names - this should be what is returned by
+         *                 nameSet.toArray(new String[nameSet.size()])
+         * @param nameSet  the set of unresolved aliases.
+         */
+        private void registerUnresolvedNamesFor(String[] names, Collection<String> nameSet) {
+            // This is not necessarily an error: it could happen that some
+            //    charsets are simply not supported on some OS/Arch
+            System.err.println("Warning: unresolved charset names: '"+ nameSet
+                    + "' This is not necessarily an error "
+                    + "- this charset may not be supported on this platform.");
+            for (String a : names) {
+                final String k = a.toUpperCase();
+                final Collection<String> c = unresolved.get(k);
+                if (c != null) {
+                    //System.out.println("Found: "+a+" -> "+c);
+                    //System.out.println("\t merging "+ c + " with " + nameSet);
+                    nameSet.addAll(c);
+                    for (String aa : c) {
+                        unresolved.put(aa.toUpperCase(), nameSet);
+                    }
+                }
+                unresolved.put(k, nameSet);
+            }
+        }
+
+
+        /**
+         * Add a new charset name mapping
+         * @param javaName the (supposedly) java name of the charset.
+         * @param xmlNames a list of corresponding XML names for that charset.
+         */
+        void addMapping(String javaName, Collection<String> xmlNames) {
+            final LinkedHashSet<String> aliasNames = new LinkedHashSet<>();
+            aliasNames.add(javaName);
+            aliasNames.addAll(xmlNames);
+            final String[] aliases = aliasNames.toArray(new String[aliasNames.size()]);
+            final String cs = findCharsetNameFor(aliases);
+            if (cs != null) {
+                registerCharsetNameFor(cs, aliases);
+                if (xmlNames.size() > 0) {
+                    String preferred = xmlNames.iterator().next();
+                    String cachedPreferred = preferredMime.get(cs.toUpperCase());
+                    if (cachedPreferred != null && !cachedPreferred.equals(preferred)) {
+                        throw new ConflictingPreferredMimeNameError(cs, cachedPreferred, preferred);
+                    }
+                    preferredMime.put(cs.toUpperCase(), preferred);
+                }
+            } else {
+                registerUnresolvedNamesFor(aliases, aliasNames);
+            }
+        }
+
+        /**
+         * Returns the canonical name of the charset for the given Java or XML
+         * alias name.
+         * @param alias the alias name
+         * @return the canonical charset name - or null if unknown.
+         */
+        public String getCharsetNameFor(String alias) {
+            return charsetMap.get(alias.toUpperCase());
+        }
+
+    }
+
+    public static void test(Properties props) throws Exception {
+
+        // First, build a mapping from the properties read from the resource
+        // file.
+        // We're going to check the consistency of the resource file
+        // while building this mapping, and throw errors if the file
+        // does not meet our assumptions.
+        //
+        Map<String, Collection<String>> lines = new HashMap<>();
+        final CheckCharsetMapping mapping = new CheckCharsetMapping();
+
+        for (String key : props.stringPropertyNames()) {
+            Collection<String> values = getValues(props.getProperty(key));
+            lines.put(key, values);
+            mapping.addMapping(key, values);
+        }
+
+        // Then build maps of EncodingInfos, and print along debugging
+        // information that should help understand the content of the
+        // resource file and the mapping it defines.
+        //
+        Map<String, EncodingInfo> javaInfos = new HashMap<>(); // Map indexed by java names
+        Map<String, EncodingInfo> xmlMap = new HashMap<>();    // Map indexed by XML names
+        Map<String, String> preferred =
+                new HashMap<>(mapping.preferredMime);          // Java Name -> Preferred Mime Name
+        List<EncodingInfo> all = new ArrayList<>();            // unused...
+        for (Entry<String, Collection<String>> e : lines.entrySet()) {
+            final String charsetName = mapping.getCharsetNameFor(e.getKey());
+            if (charsetName == null) {
+                System.out.println("!! No charset for: "+e.getKey()+ " "+ e.getValue());
+                continue;
+            }
+            Charset c = Charset.forName(charsetName);
+            EncodingInfo info;
+            final String k = e.getKey().toUpperCase();
+            final String kc = charsetName.toUpperCase();
+            StringBuilder sb = new StringBuilder();
+            for (String xml : e.getValue()) {
+                final String kx = xml.toUpperCase();
+                info = xmlMap.get(kx);
+                if (info == null) {
+                    info = new EncodingInfo(xml, charsetName);
+                    System.out.println("** XML: "+xml+" -> "+charsetName);
+                    xmlMap.put(kx, info);
+                    all.add(info);
+                }
+                if (!javaInfos.containsKey(k)) {
+                    javaInfos.put(k, info);
+                    if (!preferred.containsKey(k)) {
+                        preferred.put(k, xml);
+                    }
+                    sb.append("** Java: ").append(k).append(" -> ")
+                            .append(xml).append(" (charset: ")
+                            .append(charsetName).append(")\n");
+                }
+                if (!javaInfos.containsKey(kc)) {
+                    if (!preferred.containsKey(kc)) {
+                        preferred.put(kc, xml);
+                    }
+                    javaInfos.put(kc, info);
+                    sb.append("** Java: ").append(kc).append(" -> ")
+                            .append(xml).append(" (charset: ")
+                            .append(charsetName).append(")\n");
+                }
+                if (!javaInfos.containsKey(c.name().toUpperCase())) {
+                    if (!preferred.containsKey(c.name().toUpperCase())) {
+                        preferred.put(c.name().toUpperCase(), xml);
+                    }
+                    javaInfos.put(c.name().toUpperCase(), info);
+                    sb.append("** Java: ").append(c.name().toUpperCase()).append(" -> ")
+                            .append(xml).append(" (charset: ")
+                            .append(charsetName).append(")\n");
+                }
+            }
+            if (sb.length() == 0) {
+                System.out.println("Nothing new for "+charsetName+": "+e.getKey()+" -> "+e.getValue());
+            } else {
+                System.out.print(sb);
+            }
+
+        }
+
+        // Now we're going to verify that Encodings.java has done its job
+        // correctly. We're going to ask Encodings to convert java names to mime
+        // names and mime names to java names - and verify that the returned
+        // java names do map to recognized charsets.
+        //
+        // We're also going to verify that Encodings has recorded the preferred
+        // mime name correctly.
+
+        Method m = Encodings.class.getDeclaredMethod("getMimeEncoding", String.class);
+        m.setAccessible(true);
+
+        Set<String> xNames = new HashSet<>();
+        Set<String> jNames = new HashSet<>();
+        for (String name: xmlMap.keySet()) {
+            final String javaName = checkConvertMime2Java(name);
+            checkPreferredMime(m, javaName, preferred);
+            jNames.add(javaName);
+            xNames.add(name);
+        }
+
+
+        for (String javaName : lines.keySet()) {
+            final String javaCharsetName = mapping.getCharsetNameFor(javaName.toUpperCase());
+            if (javaCharsetName == null) continue;
+            if (!jNames.contains(javaName)) {
+                checkPreferredMime(m, javaName, preferred);
+                jNames.add(javaName);
+            }
+            for (String xml : lines.get(javaName)) {
+                if (xNames.contains(xml)) continue;
+                final String jName = checkConvertMime2Java(xml);
+                xNames.add(xml);
+                if (jNames.contains(jName)) continue;
+                checkPreferredMime(m, jName, preferred);
+            }
+        }
+    }
+
+    private static String checkConvertMime2Java(String xml) {
+        final String jName = Encodings.convertMime2JavaEncoding(xml);
+        final String jCharsetName;
+        try {
+            jCharsetName = Charset.forName(jName).name();
+        } catch (Exception x) {
+            throw new Error("Unrecognized charset returned by Encodings.convertMime2JavaEncoding(\""+xml+"\")", x);
+        }
+        System.out.println("Encodings.convertMime2JavaEncoding(\""+xml+"\") = \""+jName+"\" ("+jCharsetName+")");
+        return jName;
+    }
+
+    private static void checkPreferredMime(Method m, String javaName, Map<String,String> preferred)
+            throws Exception {
+        final String mime = (String) m.invoke(null, javaName);
+        final String expected = preferred.get(javaName.toUpperCase());
+        if (Arrays.deepEquals(new String[] {mime}, new String[] {expected})) {
+            System.out.println("Encodings.getMimeEncoding(\""+javaName+"\") = \""+mime+"\"");
+        } else {
+            throw new Error("Bad preferred mime type for: '"+javaName+"': expected '"+
+                expected+"' but got '"+mime+"'");
+        }
+    }
+
+    private static Collection<String> getValues(String val) {
+        int pos = val.indexOf(' ');
+        if (pos < 0) {
+            return Collections.singletonList(val);
+        }
+        //lastPrintable =
+        //    Integer.decode(val.substring(pos).trim()).intValue();
+        StringTokenizer st =
+            new StringTokenizer(val.substring(0, pos), ",");
+        final List<String> values = new ArrayList<>(st.countTokens());
+        while (st.hasMoreTokens()) {
+            values.add(st.nextToken());
+        }
+        return values;
+    }
+
+    // can be called in main() to help debugging.
+    // Prints out all available charsets and their recognized aliases
+    // as returned by the Charset API.
+    private static void printAllCharsets() {
+        Map<String, Charset> all = Charset.availableCharsets();
+        System.out.println("\n=========================================\n");
+        for (String can : all.keySet()) {
+            System.out.println(can + ": " + all.get(can).aliases());
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/xml/jaxp/PrecisionDecimalDV/XPrecisionDecimalToString.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,103 @@
+/*
+ * 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.
+ */
+
+import java.lang.reflect.Method;
+
+/**
+ * @test
+ * @bug 8013900
+ * @summary More warning compiling jaxp.
+ *   This test only test one of the methods used to implement hashCode()
+ *   in com.sun.org.apache.xerces.internal.impl.dv.xs.PrecisionDecimalDV$XPrecisionDecimal.
+ *   Since that method is private the test unfortunately needs to use reflection
+ *   to invoke the method.
+ * @run main XPrecisionDecimalToString
+ * @author Daniel Fuchs
+ */
+public class XPrecisionDecimalToString {
+
+    private static final String className =
+            "com.sun.org.apache.xerces.internal.impl.dv.xs.PrecisionDecimalDV$XPrecisionDecimal";
+    private static final String methodName = "canonicalToStringForHashCode";
+    private static final Class<?>[] signature = { String.class, String.class, int.class, int.class };
+    private static Method method;
+
+    // Invokes XPrecisionDecimal.canonicalToStringForHashCode through reflection,
+    // because the method is private...
+    //
+    // Construct a canonical String representation of this number
+    // for the purpose of deriving a hashCode value compliant with
+    // equals.
+    // The toString representation will be:
+    // NaN for NaN, INF for +infinity, -INF for -infinity, 0 for zero,
+    // and [1-9]\.[0-9]*[1-9]?(E[1-9][0-9]*)? for other numbers.
+    private static String canonicalToStringForHashCode(String ivalue, String fvalue, int sign, int pvalue) {
+        try {
+            if (method == null) {
+                Class<?> type = Class.forName(className);
+                method = type.getDeclaredMethod(methodName, signature);
+                method.setAccessible(true);
+            }
+        } catch (Exception x) {
+            throw new Error("Impossible to find '"+className+"."+methodName+"': "+ x, x);
+        }
+        try {
+            return (String) method.invoke(null, new Object[] {ivalue, fvalue, sign, pvalue} );
+        } catch(Exception x) {
+            throw new Error("Failed to invoke "+className+"."+methodName+"(\""+
+                    ivalue+"\", \""+fvalue+"\", "+sign+", "+pvalue+"): " +x, x);
+        }
+    }
+
+    /**
+     * @param args the command line arguments
+     */
+    public static void main(String[] args) {
+        test("123","7890",-1,0,"-1.23789E2");
+        test("0","007890",-1,0,"-7.89E-3");
+        test("123","7890",1,0,"1.23789E2");
+        test("0","007890",1,0,"7.89E-3");
+        test("123","7890",1,10,"1.23789E12");
+        test("0","007890",1,33,"7.89E30");
+        test("INF","",1,0,"INF");
+        test("INF","",-1,0,"-INF");
+        test("NaN","",0,0,"NaN");
+        test("0","",1,0,"0");
+        test("00000","00000",1,10,"0");
+        test("00000","00000",-1,10,"0");
+        test("00000","000001",-1,-10,"-1E-16");
+    }
+
+    private static void test(String ival, String fval, int sign, int pvalue, String expected) {
+        final String canonical = canonicalToStringForHashCode(ival, fval, sign, pvalue);
+        System.out.println((sign == -1 ? "-" : "") + ival +
+                ("INF".equals(ival) || "NaN".equals(ival) ? ""
+                 : ( "." + fval + "E" + pvalue))
+                + " => "+ canonical);
+        if (!expected.equals(canonical)) {
+            throw new Error("expected: "+expected+" got: "+ canonical);
+        }
+    }
+
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/lib/testlibrary/OutputAnalyzerTest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,181 @@
+/*
+ * 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.
+ */
+
+/*
+ * @test
+ * @summary Test the OutputAnalyzer utility class
+ * @library /testlibrary
+ */
+
+import jdk.testlibrary.OutputAnalyzer;
+
+public class OutputAnalyzerTest {
+
+    public static void main(String args[]) throws Exception {
+
+        String stdout = "aaaaaa";
+        String stderr = "bbbbbb";
+        String nonExistingString = "cccc";
+
+        OutputAnalyzer output = new OutputAnalyzer(stdout, stderr);
+
+        if (!stdout.equals(output.getStdout())) {
+            throw new Exception("getStdout() returned '" + output.getStdout()
+                    + "', expected '" + stdout + "'");
+        }
+
+        if (!stderr.equals(output.getStderr())) {
+            throw new Exception("getStderr() returned '" + output.getStderr()
+                    + "', expected '" + stderr + "'");
+        }
+
+        try {
+            output.shouldContain(stdout);
+            output.stdoutShouldContain(stdout);
+            output.shouldContain(stderr);
+            output.stderrShouldContain(stderr);
+        } catch (RuntimeException e) {
+            throw new Exception("shouldContain() failed", e);
+        }
+
+        try {
+            output.shouldContain(nonExistingString);
+            throw new Exception("shouldContain() failed to throw exception");
+        } catch (RuntimeException e) {
+            // expected
+        }
+
+        try {
+            output.stdoutShouldContain(stderr);
+            throw new Exception(
+                    "stdoutShouldContain() failed to throw exception");
+        } catch (RuntimeException e) {
+            // expected
+        }
+
+        try {
+            output.stderrShouldContain(stdout);
+            throw new Exception(
+                    "stdoutShouldContain() failed to throw exception");
+        } catch (RuntimeException e) {
+            // expected
+        }
+
+        try {
+            output.shouldNotContain(nonExistingString);
+            output.stdoutShouldNotContain(nonExistingString);
+            output.stderrShouldNotContain(nonExistingString);
+        } catch (RuntimeException e) {
+            throw new Exception("shouldNotContain() failed", e);
+        }
+
+        try {
+            output.shouldNotContain(stdout);
+            throw new Exception("shouldContain() failed to throw exception");
+        } catch (RuntimeException e) {
+            // expected
+        }
+
+        try {
+            output.stdoutShouldNotContain(stdout);
+            throw new Exception("shouldContain() failed to throw exception");
+        } catch (RuntimeException e) {
+            // expected
+        }
+
+        try {
+            output.stderrShouldNotContain(stderr);
+            throw new Exception("shouldContain() failed to throw exception");
+        } catch (RuntimeException e) {
+            // expected
+        }
+
+        String stdoutPattern = "[a]";
+        String stderrPattern = "[b]";
+        String nonExistingPattern = "[c]";
+
+        // Should match
+        try {
+            output.shouldMatch(stdoutPattern);
+            output.stdoutShouldMatch(stdoutPattern);
+            output.shouldMatch(stderrPattern);
+            output.stderrShouldMatch(stderrPattern);
+        } catch (RuntimeException e) {
+            throw new Exception("shouldMatch() failed", e);
+        }
+
+        try {
+            output.shouldMatch(nonExistingPattern);
+            throw new Exception("shouldMatch() failed to throw exception");
+        } catch (RuntimeException e) {
+            // expected
+        }
+
+        try {
+            output.stdoutShouldMatch(stderrPattern);
+            throw new Exception(
+                    "stdoutShouldMatch() failed to throw exception");
+        } catch (RuntimeException e) {
+            // expected
+        }
+
+        try {
+            output.stderrShouldMatch(stdoutPattern);
+            throw new Exception(
+                    "stderrShouldMatch() failed to throw exception");
+        } catch (RuntimeException e) {
+            // expected
+        }
+
+        // Should not match
+        try {
+            output.shouldNotMatch(nonExistingPattern);
+            output.stdoutShouldNotMatch(nonExistingPattern);
+            output.stderrShouldNotMatch(nonExistingPattern);
+        } catch (RuntimeException e) {
+            throw new Exception("shouldNotMatch() failed", e);
+        }
+
+        try {
+            output.shouldNotMatch(stdoutPattern);
+            throw new Exception("shouldNotMatch() failed to throw exception");
+        } catch (RuntimeException e) {
+            // expected
+        }
+
+        try {
+            output.stdoutShouldNotMatch(stdoutPattern);
+            throw new Exception("shouldNotMatch() failed to throw exception");
+        } catch (RuntimeException e) {
+            // expected
+        }
+
+        try {
+            output.stderrShouldNotMatch(stderrPattern);
+            throw new Exception("shouldNotMatch() failed to throw exception");
+        } catch (RuntimeException e) {
+            // expected
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/lib/testlibrary/jdk/testlibrary/JcmdBase.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,79 @@
+/*
+ * 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.
+ */
+
+package jdk.testlibrary;
+
+import java.util.ArrayList;
+
+public class JcmdBase {
+
+    private static ProcessBuilder processBuilder = new ProcessBuilder();
+
+    /**
+     * Attach jcmd to the current process
+     *
+     * @param commandArgs
+     *            jcmd command line parameters, e.g. JFR.start
+     * @return jcmd output
+     * @throws Exception
+     */
+    public final static OutputAnalyzer jcmd(String... commandArgs)
+            throws Exception {
+        ArrayList<String> cmd = new ArrayList<String>();
+        String cmdString = "";
+
+        // jcmd from the jdk to be tested
+        String jcmdPath = JdkFinder.getTool("jcmd", false);
+        cmd.add(jcmdPath);
+        cmdString += jcmdPath;
+
+        String pid = Integer.toString(ProcessTools.getProcessId());
+        cmd.add(pid);
+        cmdString += " " + pid;
+
+        for (int i = 0; i < commandArgs.length; i++) {
+            cmd.add(commandArgs[i]);
+            cmdString += " " + commandArgs[i];
+        }
+
+        // Log command line for debugging purpose
+        System.out.println("Command line:");
+        System.out.println(cmdString);
+
+        processBuilder.command(cmd);
+        OutputAnalyzer output = new OutputAnalyzer(processBuilder.start());
+
+        // Log output for debugging purpose
+        System.out.println("Command output:");
+        System.out.println(output.getOutput());
+
+        if (output.getExitValue() != 0) {
+            throw new Exception(processBuilder.command()
+                    + " resulted in exit value " + output.getExitValue()
+                    + " , expected to get 0");
+        }
+
+        return output;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/lib/testlibrary/jdk/testlibrary/JdkFinder.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,78 @@
+/*
+ * 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.
+ */
+
+package jdk.testlibrary;
+
+import java.io.File;
+
+public final class JdkFinder {
+
+    private JdkFinder() {
+    }
+
+    private static String getExecutable(String executable, String property) {
+        String binPath = System.getProperty(property);
+        if (binPath == null) {
+            throw new RuntimeException(
+                    "System property '" + property + "' not set");
+        }
+
+        binPath += File.separatorChar + "bin" + File.separatorChar + executable;
+
+        return binPath;
+    }
+
+    /**
+     * Returns the full path to a java launcher in jdk/bin based on system
+     * property.
+     *
+     * @param stableJdk
+     *            see {@link #getTool(String, boolean)}
+     * @return Full path to a java launcher in jdk/bin.
+     */
+    public static String getJavaLauncher(boolean stableJdk) {
+        return getTool("java", stableJdk);
+    }
+
+    /**
+     * Returns the full path to an executable in jdk/bin based on system
+     * property. Depending on value of {@code stableJdk} the method will look for
+     * either 'compile.jdk' or 'test.jdk' system properties.
+     * 'test.jdk' is normally set by jtreg. When running test separately,
+     * set this property using '-Dtest.jdk=/path/to/jdk'.
+     *
+     * @param stableJdk
+     *            If {@code true} the {@code tool} will be retrieved
+     *            from the compile (stable) JDK.
+     *            If {@code false} the {@code tool} will be retrieved
+     *            from the test JDK.
+     * @return Full path to an executable in jdk/bin.
+     */
+    public static String getTool(String tool, boolean stableJdk) {
+        if (stableJdk) {
+            return getExecutable(tool, "compile.jdk");
+        } else {
+            return getExecutable(tool, "test.jdk");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/lib/testlibrary/jdk/testlibrary/OutputAnalyzer.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,324 @@
+/*
+ * 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.
+ */
+
+package jdk.testlibrary;
+
+import java.io.IOException;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public final class OutputAnalyzer {
+
+    private final String stdout;
+    private final String stderr;
+    private final int exitValue;
+
+    /**
+     * Create an OutputAnalyzer, a utility class for verifying output and exit
+     * value from a Process
+     *
+     * @param process
+     *            Process to analyze
+     * @throws IOException
+     *             If an I/O error occurs.
+     */
+    public OutputAnalyzer(Process process) throws IOException {
+        OutputBuffer output = ProcessTools.getOutput(process);
+        exitValue = process.exitValue();
+        this.stdout = output.getStdout();
+        this.stderr = output.getStderr();
+    }
+
+    /**
+     * Create an OutputAnalyzer, a utility class for verifying output
+     *
+     * @param buf
+     *            String buffer to analyze
+     */
+    public OutputAnalyzer(String buf) {
+        this(buf, buf);
+    }
+
+    /**
+     * Create an OutputAnalyzer, a utility class for verifying output
+     *
+     * @param stdout
+     *            stdout buffer to analyze
+     * @param stderr
+     *            stderr buffer to analyze
+     */
+    public OutputAnalyzer(String stdout, String stderr) {
+        this.stdout = stdout;
+        this.stderr = stderr;
+        exitValue = -1;
+    }
+
+    /**
+     * Verify that the stdout and stderr contents of output buffer contains the
+     * string
+     *
+     * @param expectedString
+     *            String that buffer should contain
+     * @throws RuntimeException
+     *             If the string was not found
+     */
+    public void shouldContain(String expectedString) {
+        if (!stdout.contains(expectedString)
+                && !stderr.contains(expectedString)) {
+            throw new RuntimeException("'" + expectedString
+                    + "' missing from stdout/stderr: [" + stdout + stderr
+                    + "]\n");
+        }
+    }
+
+    /**
+     * Verify that the stdout contents of output buffer contains the string
+     *
+     * @param expectedString
+     *            String that buffer should contain
+     * @throws RuntimeException
+     *             If the string was not found
+     */
+    public void stdoutShouldContain(String expectedString) {
+        if (!stdout.contains(expectedString)) {
+            throw new RuntimeException("'" + expectedString
+                    + "' missing from stdout: [" + stdout + "]\n");
+        }
+    }
+
+    /**
+     * Verify that the stderr contents of output buffer contains the string
+     *
+     * @param expectedString
+     *            String that buffer should contain
+     * @throws RuntimeException
+     *             If the string was not found
+     */
+    public void stderrShouldContain(String expectedString) {
+        if (!stderr.contains(expectedString)) {
+            throw new RuntimeException("'" + expectedString
+                    + "' missing from stderr: [" + stderr + "]\n");
+        }
+    }
+
+    /**
+     * Verify that the stdout and stderr contents of output buffer does not
+     * contain the string
+     *
+     * @param expectedString
+     *            String that the buffer should not contain
+     * @throws RuntimeException
+     *             If the string was found
+     */
+    public void shouldNotContain(String notExpectedString) {
+        if (stdout.contains(notExpectedString)) {
+            throw new RuntimeException("'" + notExpectedString
+                    + "' found in stdout: [" + stdout + "]\n");
+        }
+        if (stderr.contains(notExpectedString)) {
+            throw new RuntimeException("'" + notExpectedString
+                    + "' found in stderr: [" + stderr + "]\n");
+        }
+    }
+
+    /**
+     * Verify that the stdout contents of output buffer does not contain the
+     * string
+     *
+     * @param expectedString
+     *            String that the buffer should not contain
+     * @throws RuntimeException
+     *             If the string was found
+     */
+    public void stdoutShouldNotContain(String notExpectedString) {
+        if (stdout.contains(notExpectedString)) {
+            throw new RuntimeException("'" + notExpectedString
+                    + "' found in stdout: [" + stdout + "]\n");
+        }
+    }
+
+    /**
+     * Verify that the stderr contents of output buffer does not contain the
+     * string
+     *
+     * @param expectedString
+     *            String that the buffer should not contain
+     * @throws RuntimeException
+     *             If the string was found
+     */
+    public void stderrShouldNotContain(String notExpectedString) {
+        if (stderr.contains(notExpectedString)) {
+            throw new RuntimeException("'" + notExpectedString
+                    + "' found in stderr: [" + stderr + "]\n");
+        }
+    }
+
+    /**
+     * Verify that the stdout and stderr contents of output buffer matches
+     * the pattern
+     *
+     * @param pattern
+     * @throws RuntimeException If the pattern was not found
+     */
+    public void shouldMatch(String pattern) {
+        Matcher stdoutMatcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stdout);
+        Matcher stderrMatcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stderr);
+        if (!stdoutMatcher.find() && !stderrMatcher.find()) {
+            throw new RuntimeException("'" + pattern
+                    + "' missing from stdout/stderr: [" + stdout + stderr
+                    + "]\n");
+        }
+    }
+
+    /**
+     * Verify that the stdout contents of output buffer matches the
+     * pattern
+     *
+     * @param pattern
+     * @throws RuntimeException If the pattern was not found
+     */
+    public void stdoutShouldMatch(String pattern) {
+        Matcher matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stdout);
+        if (!matcher.find()) {
+            throw new RuntimeException("'" + pattern
+                    + "' missing from stdout: [" + stdout + "]\n");
+        }
+    }
+
+    /**
+     * Verify that the stderr contents of output buffer matches the
+     * pattern
+     *
+     * @param pattern
+     * @throws RuntimeException If the pattern was not found
+     */
+    public void stderrShouldMatch(String pattern) {
+        Matcher matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stderr);
+        if (!matcher.find()) {
+            throw new RuntimeException("'" + pattern
+                    + "' missing from stderr: [" + stderr + "]\n");
+        }
+    }
+
+    /**
+     * Verify that the stdout and stderr contents of output buffer does not
+     * match the pattern
+     *
+     * @param pattern
+     * @throws RuntimeException If the pattern was found
+     */
+    public void shouldNotMatch(String pattern) {
+        Matcher matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stdout);
+        if (matcher.find()) {
+            throw new RuntimeException("'" + pattern
+                    + "' found in stdout: [" + stdout + "]\n");
+        }
+        matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stderr);
+        if (matcher.find()) {
+            throw new RuntimeException("'" + pattern
+                    + "' found in stderr: [" + stderr + "]\n");
+        }
+    }
+
+    /**
+     * Verify that the stdout contents of output buffer does not match the
+     * pattern
+     *
+     * @param pattern
+     * @throws RuntimeException If the pattern was found
+     */
+    public void stdoutShouldNotMatch(String pattern) {
+        Matcher matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stdout);
+        if (matcher.find()) {
+            throw new RuntimeException("'" + pattern
+                    + "' found in stdout: [" + stdout + "]\n");
+        }
+    }
+
+    /**
+     * Verify that the stderr contents of output buffer does not match the
+     * pattern
+     *
+     * @param pattern
+     * @throws RuntimeException If the pattern was found
+     */
+    public void stderrShouldNotMatch(String pattern) {
+        Matcher matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stderr);
+        if (matcher.find()) {
+            throw new RuntimeException("'" + pattern
+                    + "' found in stderr: [" + stderr + "]\n");
+        }
+    }
+
+    /**
+     * Verifiy the exit value of the process
+     *
+     * @param expectedExitValue
+     *            Expected exit value from process
+     * @throws RuntimeException
+     *             If the exit value from the process did not match the expected
+     *             value
+     */
+    public void shouldHaveExitValue(int expectedExitValue) {
+        if (getExitValue() != expectedExitValue) {
+            throw new RuntimeException("Exit value " + getExitValue()
+                    + " , expected to get " + expectedExitValue);
+        }
+    }
+
+    /**
+     * Get the contents of the output buffer (stdout and stderr)
+     *
+     * @return Content of the output buffer
+     */
+    public String getOutput() {
+        return stdout + stderr;
+    }
+
+    /**
+     * Get the contents of the stdout buffer
+     *
+     * @return Content of the stdout buffer
+     */
+    public String getStdout() {
+        return stdout;
+    }
+
+    /**
+     * Get the contents of the stderr buffer
+     *
+     * @return Content of the stderr buffer
+     */
+    public String getStderr() {
+        return stderr;
+    }
+
+    /**
+     * Get the process exit value
+     *
+     * @return Process exit value
+     */
+    public int getExitValue() {
+        return exitValue;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/lib/testlibrary/jdk/testlibrary/OutputBuffer.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,61 @@
+/*
+ * 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.
+ */
+
+package jdk.testlibrary;
+
+public class OutputBuffer {
+    private final String stdout;
+    private final String stderr;
+
+    /**
+     * Create an OutputBuffer, a class for storing and managing stdout and
+     * stderr results separately
+     *
+     * @param stdout
+     *            stdout result
+     * @param stderr
+     *            stderr result
+     */
+    public OutputBuffer(String stdout, String stderr) {
+        this.stdout = stdout;
+        this.stderr = stderr;
+    }
+
+    /**
+     * Returns the stdout result
+     *
+     * @return stdout result
+     */
+    public String getStdout() {
+        return stdout;
+    }
+
+    /**
+     * Returns the stderr result
+     *
+     * @return stderr result
+     */
+    public String getStderr() {
+        return stderr;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/lib/testlibrary/jdk/testlibrary/ProcessTools.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,151 @@
+/*
+ * 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.
+ */
+
+package jdk.testlibrary;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.lang.management.ManagementFactory;
+import java.lang.management.RuntimeMXBean;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Collections;
+
+import sun.management.VMManagement;
+
+public final class ProcessTools {
+
+    private ProcessTools() {
+    }
+
+    /**
+     * Pumps stdout and stderr from running the process into a String.
+     *
+     * @param processHandler
+     *            ProcessHandler to run.
+     * @return Output from process.
+     * @throws IOException
+     *             If an I/O error occurs.
+     */
+    public static OutputBuffer getOutput(ProcessBuilder processBuilder)
+            throws IOException {
+        return getOutput(processBuilder.start());
+    }
+
+    /**
+     * Pumps stdout and stderr the running process into a String.
+     *
+     * @param process
+     *            Process to pump.
+     * @return Output from process.
+     * @throws IOException
+     *             If an I/O error occurs.
+     */
+    public static OutputBuffer getOutput(Process process) throws IOException {
+        ByteArrayOutputStream stderrBuffer = new ByteArrayOutputStream();
+        ByteArrayOutputStream stdoutBuffer = new ByteArrayOutputStream();
+        StreamPumper outPumper = new StreamPumper(process.getInputStream(),
+                stdoutBuffer);
+        StreamPumper errPumper = new StreamPumper(process.getErrorStream(),
+                stderrBuffer);
+        Thread outPumperThread = new Thread(outPumper);
+        Thread errPumperThread = new Thread(errPumper);
+
+        outPumperThread.setDaemon(true);
+        errPumperThread.setDaemon(true);
+
+        outPumperThread.start();
+        errPumperThread.start();
+
+        try {
+            process.waitFor();
+            outPumperThread.join();
+            errPumperThread.join();
+        } catch (InterruptedException e) {
+            Thread.currentThread().interrupt();
+            return null;
+        }
+
+        return new OutputBuffer(stdoutBuffer.toString(),
+                stderrBuffer.toString());
+    }
+
+    /**
+     * Get the process id of the current running Java process
+     *
+     * @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);
+
+        return pid;
+    }
+
+    /**
+     * Get platform specific VM arguments (e.g. -d64 on 64bit Solaris)
+     *
+     * @return String[] with platform specific arguments, empty if there are
+     *         none
+     */
+    public static String[] getPlatformSpecificVMArgs() {
+        String osName = System.getProperty("os.name");
+        String dataModel = System.getProperty("sun.arch.data.model");
+
+        if (osName.equals("SunOS") && dataModel.equals("64")) {
+            return new String[] { "-d64" };
+        }
+
+        return new String[] {};
+    }
+
+    /**
+     * Create ProcessBuilder using the java launcher from the jdk to be tested
+     * and with any platform specific arguments prepended
+     */
+    public static ProcessBuilder createJavaProcessBuilder(String... command)
+            throws Exception {
+        String javapath = JdkFinder.getJavaLauncher(false);
+
+        ArrayList<String> args = new ArrayList<>();
+        args.add(javapath);
+        Collections.addAll(args, getPlatformSpecificVMArgs());
+        Collections.addAll(args, command);
+
+        return new ProcessBuilder(args.toArray(new String[args.size()]));
+
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/lib/testlibrary/jdk/testlibrary/StreamPumper.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,78 @@
+/*
+ * 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.
+ */
+
+package jdk.testlibrary;
+
+import java.io.OutputStream;
+import java.io.InputStream;
+import java.io.IOException;
+
+public final class StreamPumper implements Runnable {
+
+    private static final int BUF_SIZE = 256;
+
+    private final OutputStream out;
+    private final InputStream in;
+
+    /**
+     * Create a StreamPumper that reads from in and writes to out.
+     *
+     * @param in
+     *            The stream to read from.
+     * @param out
+     *            The stream to write to.
+     */
+    public StreamPumper(InputStream in, OutputStream out) {
+        this.in = in;
+        this.out = out;
+    }
+
+    /**
+     * Implements Thread.run(). Continuously read from {@code in} and write to
+     * {@code out} until {@code in} has reached end of stream. Abort on
+     * interruption. Abort on IOExceptions.
+     */
+    @Override
+    public void run() {
+        int length;
+        InputStream localIn = in;
+        OutputStream localOut = out;
+        byte[] buffer = new byte[BUF_SIZE];
+
+        try {
+            while ((length = localIn.read(buffer)) > 0 && !Thread.interrupted()) {
+                localOut.write(buffer, 0, length);
+            }
+        } catch (IOException e) {
+            // Just abort if something like this happens.
+            e.printStackTrace();
+        } finally {
+            try {
+                localOut.flush();
+                in.close();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/awt/datatransfer/SuplementaryCharactersTransferTest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,165 @@
+/*
+ * 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.
+ */
+
+/* @test
+   @bug 6877495
+   @summary JTextField and JTextArea does not support supplementary characters
+   @author Alexander Scherbatiy
+   @run main SuplementaryCharactersTransferTest
+*/
+
+
+import java.io.*;
+import java.util.*;
+import java.awt.*;
+import java.awt.datatransfer.*;
+import sun.awt.datatransfer.*;
+import sun.awt.datatransfer.DataTransferer.ReencodingInputStream;
+
+public class SuplementaryCharactersTransferTest {
+
+    public static final long TEXT_FORMAT = 13;
+
+    public static void main(String[] args) throws Exception {
+
+        DataTransferer dataTransferer = new TestDataTransferer();
+        dataTransferer.registerTextFlavorProperties("UNICODE TEXT", "utf-16le", "\r\n", "2");
+        ByteTransferable transferable = new ByteTransferable();
+        ReencodingInputStream is = dataTransferer.new ReencodingInputStream(transferable.getByteInputStream(), TEXT_FORMAT,
+                DataTransferer.getTextCharset(transferable.getDataFlavor()), transferable);
+
+        byte[] bytes = transferable.getBytes();
+        byte[] result = new byte[bytes.length];
+
+        is.read(result);
+
+        for (int i = 0; i < bytes.length; i++) {
+            if (bytes[i] != result[i]) {
+                throw new RuntimeException("Characters are not equal!");
+            }
+        }
+
+    }
+
+    static class ByteTransferable implements Transferable, ClipboardOwner {
+
+        private final DataFlavor dataFlavor;
+
+        public ByteTransferable() throws Exception {
+            dataFlavor = DataFlavor.getTextPlainUnicodeFlavor();
+        }
+
+        public DataFlavor getDataFlavor() {
+            return dataFlavor;
+        }
+
+        public DataFlavor[] getTransferDataFlavors() {
+            return new DataFlavor[]{dataFlavor};
+        }
+
+        public boolean isDataFlavorSupported(DataFlavor flavor) {
+            return flavor.equals(dataFlavor);
+        }
+
+        public byte[] getBytes() {
+            return new byte[]{97, 0, 64, -40, 32, -36, 98, 0};
+        }
+
+        public InputStream getByteInputStream() {
+            return new ByteArrayInputStream(getBytes());
+        }
+
+        public Object getTransferData(DataFlavor flavor)
+                throws UnsupportedFlavorException, IOException {
+            if (flavor.equals(dataFlavor)) {
+                return getByteInputStream();
+            } else {
+                throw new UnsupportedFlavorException(flavor);
+            }
+        }
+
+        public void lostOwnership(Clipboard clipboard, Transferable contents) {
+        }
+    }
+
+    static class TestDataTransferer extends DataTransferer {
+
+        @Override
+        public String getDefaultUnicodeEncoding() {
+            throw new UnsupportedOperationException("Not supported yet.");
+        }
+
+        @Override
+        public boolean isLocaleDependentTextFormat(long format) {
+            return false;
+        }
+
+        @Override
+        public boolean isFileFormat(long format) {
+            throw new UnsupportedOperationException("Not supported yet.");
+        }
+
+        @Override
+        public boolean isImageFormat(long format) {
+            throw new UnsupportedOperationException("Not supported yet.");
+        }
+
+        @Override
+        protected Long getFormatForNativeAsLong(String str) {
+            return TEXT_FORMAT;
+        }
+
+        @Override
+        protected String getNativeForFormat(long format) {
+            throw new UnsupportedOperationException("Not supported yet.");
+        }
+
+        @Override
+        protected ByteArrayOutputStream convertFileListToBytes(
+                ArrayList<String> fileList) throws IOException {
+            throw new UnsupportedOperationException("Not supported yet.");
+        }
+
+        @Override
+        protected String[] dragQueryFile(byte[] bytes) {
+            throw new UnsupportedOperationException("Not supported yet.");
+        }
+
+        @Override
+        protected Image platformImageBytesOrStreamToImage(InputStream str,
+                byte[] bytes, long format) throws IOException {
+            throw new UnsupportedOperationException("Not supported yet.");
+        }
+
+        @Override
+        protected byte[] imageToPlatformBytes(Image image, long format)
+                throws IOException {
+            throw new UnsupportedOperationException("Not supported yet.");
+        }
+
+        @Override
+        public ToolkitThreadBlockedHandler getToolkitThreadBlockedHandler() {
+            throw new UnsupportedOperationException("Not supported yet.");
+        }
+    }
+}
\ No newline at end of file
--- a/test/sun/invoke/util/ValueConversionsTest.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/sun/invoke/util/ValueConversionsTest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -27,11 +27,9 @@
 import sun.invoke.util.Wrapper;
 import java.lang.invoke.MethodType;
 import java.lang.invoke.MethodHandle;
-import java.lang.invoke.MethodHandles;
 import java.io.Serializable;
 import java.util.Arrays;
 import java.util.Collections;
-import org.junit.Ignore;
 import org.junit.Test;
 import static org.junit.Assert.*;
 
@@ -52,7 +50,7 @@
  * @author jrose
  */
 public class ValueConversionsTest {
-    private static final Class CLASS = ValueConversionsTest.class;
+    private static final Class<?> CLASS = ValueConversionsTest.class;
     private static final int MAX_ARITY = Integer.getInteger(CLASS.getSimpleName()+".MAX_ARITY", 40);
     private static final int START_ARITY = Integer.getInteger(CLASS.getSimpleName()+".START_ARITY", 0);
     private static final boolean EXHAUSTIVE = Boolean.getBoolean(CLASS.getSimpleName()+".EXHAUSTIVE");
@@ -124,36 +122,6 @@
     }
 
     @Test
-    public void testUnboxRaw() throws Throwable {
-        //System.out.println("unboxRaw");
-        for (Wrapper w : Wrapper.values()) {
-            if (w == Wrapper.OBJECT)  continue;  // skip this; no raw form
-            //System.out.println(w);
-            for (int n = -5; n < 10; n++) {
-                Object box = w.wrap(n);
-                long expResult = w.unwrapRaw(box);
-                Object box2 = w.wrapRaw(expResult);
-                assertEquals(box, box2);
-                MethodHandle unboxer = ValueConversions.unboxRaw(w.primitiveType());
-                long result = -1;
-                switch (w) {
-                    case INT:     result = (int)  unboxer.invokeExact(box); break;
-                    case LONG:    result = (long) unboxer.invokeExact(box); break;
-                    case FLOAT:   result = (int)  unboxer.invokeExact(box); break;
-                    case DOUBLE:  result = (long) unboxer.invokeExact(box); break;
-                    case CHAR:    result = (int)  unboxer.invokeExact(box); break;
-                    case BYTE:    result = (int)  unboxer.invokeExact(box); break;
-                    case SHORT:   result = (int)  unboxer.invokeExact(box); break;
-                    case BOOLEAN: result = (int)  unboxer.invokeExact(box); break;
-                    case VOID:    result = (int)  unboxer.invokeExact(box); break;
-                }
-                assertEquals("(w,n,box)="+Arrays.asList(w,n,box),
-                             expResult, result);
-            }
-        }
-    }
-
-    @Test
     public void testBox() throws Throwable {
         //System.out.println("box");
         for (Wrapper w : Wrapper.values()) {
@@ -165,7 +133,7 @@
                 Object expResult = box;
                 Object result = null;
                 switch (w) {
-                    case INT:     result = boxer.invokeExact((int)n); break;
+                    case INT:     result = boxer.invokeExact(/*int*/n); break;
                     case LONG:    result = boxer.invokeExact((long)n); break;
                     case FLOAT:   result = boxer.invokeExact((float)n); break;
                     case DOUBLE:  result = boxer.invokeExact((double)n); break;
@@ -182,65 +150,6 @@
     }
 
     @Test
-    public void testBoxRaw() throws Throwable {
-        //System.out.println("boxRaw");
-        for (Wrapper w : Wrapper.values()) {
-            if (w == Wrapper.VOID)  continue;  // skip this; no unboxed form
-            if (w == Wrapper.OBJECT)  continue;  // skip this; no raw form
-            //System.out.println(w);
-            for (int n = -5; n < 10; n++) {
-                Object box = w.wrap(n);
-                long   raw = w.unwrapRaw(box);
-                Object expResult = box;
-                MethodHandle boxer = ValueConversions.boxRaw(w.primitiveType());
-                Object result = null;
-                switch (w) {
-                case INT:     result = boxer.invokeExact((int)raw); break;
-                case LONG:    result = boxer.invokeExact(raw); break;
-                case FLOAT:   result = boxer.invokeExact((int)raw); break;
-                case DOUBLE:  result = boxer.invokeExact(raw); break;
-                case CHAR:    result = boxer.invokeExact((int)raw); break;
-                case BYTE:    result = boxer.invokeExact((int)raw); break;
-                case SHORT:   result = boxer.invokeExact((int)raw); break;
-                case BOOLEAN: result = boxer.invokeExact((int)raw); break;
-                }
-                assertEquals("(dst,src,n,box)="+Arrays.asList(w,w,n,box),
-                             expResult, result);
-            }
-        }
-    }
-
-    @Test
-    public void testReboxRaw() throws Throwable {
-        //System.out.println("reboxRaw");
-        for (Wrapper w : Wrapper.values()) {
-            Wrapper pw = Wrapper.forPrimitiveType(w.rawPrimitiveType());
-            if (w == Wrapper.VOID)  continue;  // skip this; no unboxed form
-            if (w == Wrapper.OBJECT)  continue;  // skip this; no raw form
-            //System.out.println(w);
-            for (int n = -5; n < 10; n++) {
-                Object box = w.wrap(n);
-                Object raw = pw.wrap(w.unwrapRaw(box));
-                Object expResult = box;
-                MethodHandle boxer = ValueConversions.rebox(w.primitiveType());
-                Object result = null;
-                switch (w) {
-                case INT:     result = boxer.invokeExact(raw); break;
-                case LONG:    result = boxer.invokeExact(raw); break;
-                case FLOAT:   result = boxer.invokeExact(raw); break;
-                case DOUBLE:  result = boxer.invokeExact(raw); break;
-                case CHAR:    result = boxer.invokeExact(raw); break;
-                case BYTE:    result = boxer.invokeExact(raw); break;
-                case SHORT:   result = boxer.invokeExact(raw); break;
-                case BOOLEAN: result = boxer.invokeExact(raw); break;
-                }
-                assertEquals("(dst,src,n,box)="+Arrays.asList(w,w,n,box),
-                             expResult, result);
-            }
-        }
-    }
-
-    @Test
     public void testCast() throws Throwable {
         //System.out.println("cast");
         Class<?>[] types = { Object.class, Serializable.class, String.class, Number.class, Integer.class };
@@ -250,14 +159,8 @@
             assertEquals(caster.type(), ValueConversions.identity().type());
             for (Object obj : objects) {
                 Class<?> src = obj.getClass();
-                boolean canCast;
-                if (dst.isInterface()) {
-                    canCast = true;
-                } else {
-                    canCast = dst.isAssignableFrom(src);
-                    assertEquals(canCast, dst.isInstance(obj));
-                }
-                //System.out.println("obj="+obj+" <: dst="+dst);
+                boolean canCast = dst.isAssignableFrom(src);
+                //System.out.println("obj="+obj+" <: dst="+dst+(canCast ? " (OK)" : " (will fail)"));
                 try {
                     Object result = caster.invokeExact(obj);
                     if (canCast)
@@ -283,6 +186,91 @@
     }
 
     @Test
+    public void testConvert() throws Throwable {
+        //System.out.println("convert");
+        for (long tval = 0, ctr = 0;;) {
+            if (++ctr > 99999)  throw new AssertionError("too many test values");
+            // next test value:
+            //System.out.println(Long.toHexString(tval)); // prints 3776 test patterns
+            tval = nextTestValue(tval);
+            if (tval == 0) {
+                //System.out.println("test value count = "+ctr);  // 3776 = 8*59*8
+                break;  // repeat
+            }
+        }
+        for (Wrapper src : Wrapper.values()) {
+            for (Wrapper dst : Wrapper.values()) {
+                testConvert(src, dst, 0);
+            }
+        }
+    }
+    static void testConvert(Wrapper src, Wrapper dst, long tval) throws Throwable {
+        //System.out.println(src+" => "+dst);
+        boolean testSingleCase = (tval != 0);
+        final long tvalInit = tval;
+        MethodHandle conv = ValueConversions.convertPrimitive(src, dst);
+        MethodType convType;
+        if (src == Wrapper.VOID)
+            convType = MethodType.methodType(dst.primitiveType() /* , void */);
+        else
+            convType = MethodType.methodType(dst.primitiveType(), src.primitiveType());
+        assertEquals(convType, conv.type());
+        MethodHandle converter = conv.asType(conv.type().changeReturnType(Object.class));
+        for (;;) {
+            long n = tval;
+            Object testValue = src.wrap(n);
+            Object expResult = dst.cast(testValue, dst.primitiveType());
+            Object result;
+            switch (src) {
+                case INT:     result = converter.invokeExact((int)n); break;
+                case LONG:    result = converter.invokeExact(/*long*/n); break;
+                case FLOAT:   result = converter.invokeExact((float)n); break;
+                case DOUBLE:  result = converter.invokeExact((double)n); break;
+                case CHAR:    result = converter.invokeExact((char)n); break;
+                case BYTE:    result = converter.invokeExact((byte)n); break;
+                case SHORT:   result = converter.invokeExact((short)n); break;
+                case OBJECT:  result = converter.invokeExact((Object)n); break;
+                case BOOLEAN: result = converter.invokeExact((n & 1) != 0); break;
+                case VOID:    result = converter.invokeExact(); break;
+                default:  throw new AssertionError();
+            }
+            assertEquals("(src,dst,n,testValue)="+Arrays.asList(src,dst,"0x"+Long.toHexString(n),testValue),
+                         expResult, result);
+            if (testSingleCase)  break;
+            // next test value:
+            tval = nextTestValue(tval);
+            if (tval == tvalInit)  break;  // repeat
+        }
+    }
+    static long tweakSign(long x) {
+        // Assuming that x is mostly zeroes, make those zeroes follow bit #62 (just below the sign).
+        // This function is self-inverse.
+        final long MID_SIGN_BIT = 62;
+        long sign = -((x >>> MID_SIGN_BIT) & 1);  // all ones or all zeroes
+        long flip = (sign >>> -MID_SIGN_BIT);  // apply the sign below the mid-bit
+        return x ^ flip;
+    }
+    static long nextTestValue(long x) {
+        // Produce 64 bits with three component bitfields:  [ high:3 | mid:58 | low:3 ].
+        // The high and low fields vary through all possible bit patterns.
+        // The middle field is either all zero or has a single bit set.
+        // For better coverage of the neighborhood of zero, an internal sign bit is xored downward also.
+        long ux = tweakSign(x);  // unsign the middle field
+        final long LOW_BITS  = 3, LOW_BITS_MASK  = (1L << LOW_BITS)-1;
+        final long HIGH_BITS = 3, HIGH_BITS_MASK = ~(-1L >>> HIGH_BITS);
+        if ((ux & LOW_BITS_MASK) != LOW_BITS_MASK) {
+            ++ux;
+        } else {
+            ux &= ~LOW_BITS_MASK;
+            long midBit = (ux & ~HIGH_BITS_MASK);
+            if (midBit == 0)
+                midBit = (1L<<LOW_BITS);  // introduce a low bit
+            ux += midBit;
+        }
+        return tweakSign(ux);
+    }
+
+    @Test
     public void testVarargsArray() throws Throwable {
         //System.out.println("varargsArray");
         final int MIN = START_ARITY;
@@ -334,7 +322,7 @@
     }
 
     private void testTypedVarargsArray(Class<?> arrayType) throws Throwable {
-        System.out.println(arrayType.getSimpleName());
+        //System.out.println(arrayType.getSimpleName());
         Class<?> elemType = arrayType.getComponentType();
         int MIN = START_ARITY;
         int MAX = MAX_ARITY-2;  // 253+1 would cause parameter overflow with 'this' added
@@ -361,6 +349,7 @@
             assert(stype == MethodType.methodType(arrayType, arrayType));
             if (nargs <= 5) {
                 // invoke target as a spreader also:
+                @SuppressWarnings("cast")
                 Object res2 = spreader.invokeWithArguments((Object)res);
                 String res2String = toArrayString(res2);
                 assertEquals(Arrays.toString(args), res2String);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/java2d/DirectX/DrawBitmaskToSurfaceTest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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     6997116
+ * @summary Test verifies that rendering of images with bitmap transparency
+ *          to a D3D surface does not cause an ClassCastException.
+ *
+ * @run main/othervm -Dsun.java2d.d3d=True DrawBitmaskToSurfaceTest
+ */
+
+import java.awt.Graphics;
+import java.awt.Image;
+import java.awt.image.BufferedImage;
+import java.awt.image.IndexColorModel;
+import java.util.concurrent.CountDownLatch;
+import javax.swing.JFrame;
+
+public class DrawBitmaskToSurfaceTest extends JFrame {
+
+    private final Image src;
+    private static java.util.concurrent.CountDownLatch latch = null;
+    private static Throwable theError = null;
+
+    public DrawBitmaskToSurfaceTest() {
+        src = createTestImage();
+    }
+
+    private static Image createTestImage() {
+        byte[] r = new byte[]{(byte)0x00, (byte)0x80, (byte)0xff, (byte)0xff};
+        byte[] g = new byte[]{(byte)0x00, (byte)0x80, (byte)0xff, (byte)0x00};
+        byte[] b = new byte[]{(byte)0x00, (byte)0x80, (byte)0xff, (byte)0x00};
+
+        IndexColorModel icm = new IndexColorModel(2, 4, r, g, b, 3);
+
+        BufferedImage img = new BufferedImage(100, 100,
+                                              BufferedImage.TYPE_BYTE_INDEXED,
+                                              icm);
+        return img;
+    }
+
+    @Override
+    public void paint(final Graphics g) {
+        try {
+            System.err.println("paint frame....");
+            g.drawImage(src, 30, 30, this);
+        } catch (Throwable e) {
+            theError = e;
+        } finally {
+            if (latch != null) {
+                latch.countDown();
+            }
+        }
+    }
+
+    public static void main(final String[] args) throws Exception {
+        final JFrame frame = new DrawBitmaskToSurfaceTest();
+        frame.setBounds(10, 350, 200, 200);
+        frame.setVisible(true);
+
+        Thread.sleep(2000);
+
+        System.err.println("Change frame bounds...");
+        latch = new CountDownLatch(1);
+        frame.setBounds(10, 350, 90, 90);
+        frame.repaint();
+
+        try {
+            if (latch.getCount() > 0) {
+                latch.await();
+            }
+        } catch (InterruptedException e) {
+        }
+
+        frame.dispose();
+
+        if (theError != null) {
+            throw new RuntimeException("Test failed.", theError);
+        }
+
+        System.err.println("Test passed");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/java2d/OpenGL/bug7181438.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,83 @@
+/*
+ * 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.
+ */
+
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsEnvironment;
+import java.awt.Transparency;
+import java.awt.image.BufferedImage;
+import java.awt.image.VolatileImage;
+
+/**
+ * @test
+ * @bug 7181438
+ * @summary Verifies that we get correct alpha, when we draw opaque
+ * BufferedImage to non opaque VolatileImage via intermediate opaque texture.
+ * @author Sergey Bylokhov
+ * @run main/othervm -Dsun.java2d.accthreshold=0 bug7181438
+ */
+public final class bug7181438 {
+
+    private static final int SIZE = 500;
+
+    public static void main(final String[] args) {
+
+        final BufferedImage bi = createBufferedImage();
+        final VolatileImage vi = createVolatileImage();
+        final Graphics s2dVi = vi.getGraphics();
+
+        //sw->texture->surface blit
+        s2dVi.drawImage(bi, 0, 0, null);
+
+        final BufferedImage results = vi.getSnapshot();
+        for (int i = 0; i < SIZE; ++i) {
+            for (int j = 0; j < SIZE; ++j) {
+                //Image should be opaque: (black color and alpha = 255)
+                if (results.getRGB(i, j) != 0xFF000000) {
+                    throw new RuntimeException("Failed: Wrong alpha");
+                }
+            }
+        }
+        System.out.println("Passed");
+    }
+
+
+    private static VolatileImage createVolatileImage() {
+        final GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
+        final GraphicsConfiguration gc = ge.getDefaultScreenDevice().getDefaultConfiguration();
+        return gc.createCompatibleVolatileImage(SIZE, SIZE,
+                                                Transparency.TRANSLUCENT);
+    }
+
+    private static BufferedImage createBufferedImage() {
+        final BufferedImage bi = new BufferedImage(SIZE, SIZE,
+                                                   BufferedImage.TYPE_INT_RGB);
+        final Graphics bg = bi.getGraphics();
+        //Black color and alpha = 0
+        bg.setColor(new Color(0, 0, 0, 0));
+        bg.fillRect(0, 0, SIZE, SIZE);
+        bg.dispose();
+        return bi;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/java2d/loops/RenderToCustomBufferTest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,115 @@
+/*
+ * 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.
+ */
+/**
+ * @test
+ * @bug     8015606
+ * @summary Test verifies whether a text is rendered correctly to
+ *          a custom buffered image.
+ *
+ * @run     main RenderToCustomBufferTest
+ */
+
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.awt.Transparency;
+import java.awt.color.ColorSpace;
+import java.awt.image.BufferedImage;
+import java.awt.image.ColorModel;
+import java.awt.image.ComponentColorModel;
+import java.awt.image.DataBuffer;
+import java.awt.image.WritableRaster;
+
+public class RenderToCustomBufferTest {
+     public static void main(String[] args) {
+        final BufferedImage dst_custom = createCustomBuffer();
+        final BufferedImage dst_dcm = new BufferedImage(width, height,
+                BufferedImage.TYPE_INT_RGB);
+
+        renderTo(dst_custom);
+        renderTo(dst_dcm);
+
+        check(dst_custom, dst_dcm);
+    }
+
+    private static void check(BufferedImage a, BufferedImage b) {
+        for (int y = 0; y < height; y++) {
+            for (int x = 0; x < width; x++) {
+                int pa = a.getRGB(x, y);
+                int pb = b.getRGB(x, y);
+
+                if (pa != pb) {
+                    String msg = String.format(
+                        "Point [%d, %d] has different colors: %08X and %08X",
+                        x, y, pa, pb);
+                    throw new RuntimeException("Test failed: " + msg);
+                }
+            }
+        }
+    }
+
+    private static BufferedImage createCustomBuffer() {
+        ColorSpace cs = ColorSpace.getInstance(ColorSpace.CS_sRGB);
+        ColorModel cm = new ComponentColorModel(cs, false, false,
+                Transparency.OPAQUE, DataBuffer.TYPE_FLOAT);
+        WritableRaster wr = cm.createCompatibleWritableRaster(width, height);
+
+        return new BufferedImage(cm, wr, false, null);
+    }
+
+    private static void renderTo(BufferedImage dst) {
+        System.out.println("The buffer: " + dst);
+        Graphics2D g = dst.createGraphics();
+
+        final int w = dst.getWidth();
+        final int h = dst.getHeight();
+
+        g.setColor(Color.blue);
+        g.fillRect(0, 0, w, h);
+
+        g.setColor(Color.red);
+        Font f = g.getFont();
+        g.setFont(f.deriveFont(48f));
+
+        g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
+               RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
+
+        // NB: this clip ctriggers the problem
+        g.setClip(50, 50, 200, 100);
+
+        g.drawString("AA Text", 52, 90);
+
+        g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
+               RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);
+
+        // NB: this clip ctriggers the problem
+        g.setClip(50, 100, 100, 100);
+        g.drawString("Text", 52, 148);
+
+        g.dispose();
+    }
+
+    private static final int width = 230;
+    private static final int height = 150;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/java2d/pipe/Test8004821.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,60 @@
+/*
+ * 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.
+ */
+
+import java.awt.Graphics2D;
+import java.awt.Polygon;
+import java.awt.image.BufferedImage;
+
+/**
+ * @test
+ * @bug 8004821
+ * @summary Verifies that drawPolygon() works with empty arrays.
+ * @author Sergey Bylokhov
+ */
+public final class Test8004821 {
+
+    public static void main(final String[] args) {
+        final int[] arrEmpty = {};
+        final int[] arr1elem = {150};
+        final BufferedImage bi = new BufferedImage(300, 300,
+                                                   BufferedImage.TYPE_INT_RGB);
+        final Graphics2D g = (Graphics2D) bi.getGraphics();
+        test(g, arrEmpty);
+        test(g, arr1elem);
+        g.translate(2.0, 2.0);
+        test(g, arrEmpty);
+        test(g, arr1elem);
+        g.scale(2.0, 2.0);
+        test(g, arrEmpty);
+        test(g, arr1elem);
+        g.dispose();
+    }
+
+    private static void test(final Graphics2D g, final int[] arr) {
+        g.drawPolygon(arr, arr, arr.length);
+        g.drawPolygon(new Polygon(arr, arr, arr.length));
+        g.fillPolygon(arr, arr, arr.length);
+        g.fillPolygon(new Polygon(arr, arr, arr.length));
+        g.drawPolyline(arr, arr, arr.length);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/management/AgentCMETest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,73 @@
+/*
+ * 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.
+ */
+
+/*
+ * Portions Copyright (c) 2012 IBM Corporation
+ */
+
+/**
+ * @test
+ * @bug 7164191
+ * @summary properties.putAll API may fail with ConcurrentModifcationException on multi-thread scenario
+ * @author Deven You
+ */
+
+import java.util.Properties;
+import sun.management.Agent;
+
+public class AgentCMETest {
+    static Class<?> agentClass;
+
+    /**
+     * In sun.management.Agent.loadManagementProperties(), call
+     * properties.putAll API may fail with ConcurrentModifcationException if the
+     * system properties are modified simultaneously by another thread
+     *
+     * @param args
+     * @throws Exception
+     */
+    public static void main(String[] args) throws Exception {
+        System.out.println("Start...");
+
+        final Properties properties = System.getProperties();
+        Thread t1 = new Thread(new Runnable() {
+            public void run() {
+                for (int i = 0; i < 100; i++) {
+                    properties.put(String.valueOf(i), "");
+                    try {
+                        Thread.sleep(1);
+                    } catch (InterruptedException e) {
+                        // do nothing
+                    }
+                }
+            }
+        });
+        t1.start();
+
+        for (int i = 0; i < 10000; i++) {
+            Agent.loadManagementProperties();
+        }
+
+        System.out.println("Finished...");
+    }
+}
--- a/test/sun/management/HotspotClassLoadingMBean/GetClassLoadingTime.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/sun/management/HotspotClassLoadingMBean/GetClassLoadingTime.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -27,6 +27,7 @@
  * @summary Basic unit test of HotspotClassLoadingMBean.getClassLoadingTime()
  * @author  Steve Bohne
  * @build ClassToLoad0
+ * @run main GetClassLoadingTime
  */
 
 /*
@@ -71,10 +72,8 @@
         }
 
         long time2 = mbean.getClassLoadingTime();
-        long count = mbean.getLoadedClassCount();
 
         if (trace) {
-            System.out.println("(new count is " + count + ")");
             System.out.println("Class loading time2 (ms): " + time2);
         }
 
@@ -93,8 +92,6 @@
 // so we can avoid delegation and spend lots of time loading the
 // same class over and over, to test the class loading timer.
 class KlassLoader extends ClassLoader {
-  static String klassDir="";
-  static int index=0;
 
   public KlassLoader() {
       super(null);
@@ -102,14 +99,13 @@
 
   protected synchronized Class findClass(String name)
                         throws ClassNotFoundException {
-        String cname = klassDir
-            + (klassDir == "" ? "" : "/")
-            +name.replace('.', '/')
+        String cname =
+            name.replace('.', '/')
             +".class";
 
         FileInputStream in;
         try {
-                in=new FileInputStream(cname);
+                in = new FileInputStream(new File(System.getProperty("test.classes", "."), cname));
                 if (in == null) {
                         throw new ClassNotFoundException("getResourceAsStream("
                                 +cname+")");
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/management/jdp/JdpClient.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,160 @@
+/*
+ * 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.
+ */
+
+import java.io.IOException;
+import java.net.Inet6Address;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.net.NetworkInterface;
+import java.net.ProtocolFamily;
+import java.net.StandardProtocolFamily;
+import java.net.StandardSocketOptions;
+import java.nio.ByteBuffer;
+import java.nio.channels.DatagramChannel;
+import java.nio.channels.SelectionKey;
+import java.nio.channels.Selector;
+import java.util.Collections;
+import java.util.Enumeration;
+import sun.management.jdp.JdpException;
+import sun.management.jdp.JdpJmxPacket;
+
+public class JdpClient {
+
+    private static class PacketListener implements Runnable {
+
+        private static final int BUFFER_LENGTH = 4096;
+        private final DatagramChannel channel;
+        private static int maxPacketCount = 1;
+        private static int maxEmptyPacketCount = 10;
+
+
+        PacketListener(DatagramChannel channel) {
+            this.channel = channel;
+        }
+
+        @java.lang.Override
+        public void run() {
+            try {
+                Selector sel;
+                sel = Selector.open();
+                channel.configureBlocking(false);
+                channel.register(sel, SelectionKey.OP_READ);
+                ByteBuffer buf = ByteBuffer.allocate(1024);
+
+                int count = 1;
+                int emptyPacketsCount = 1;
+
+                try {
+                    while (true) {
+
+                        sel.selectedKeys().clear();
+                        buf.rewind();
+
+                        sel.select(10 * 1000);
+                        channel.receive(buf);
+
+                        if (buf.position() == 0 ){
+                            if (JdpDoSomething.getVerbose()){
+                                System.err.println("Empty packet received");
+                            }
+                            if (++emptyPacketsCount > maxEmptyPacketCount){
+                                throw new RuntimeException("Test failed, maxEmptyPacketCount reached");
+                            }
+
+                            continue;
+                        }
+
+                        buf.flip();
+                        byte[] dgramData = new byte[buf.remaining()];
+                        buf.get(dgramData);
+
+                        try {
+                            JdpJmxPacket packet = new JdpJmxPacket(dgramData);
+                            JdpDoSomething.printJdpPacket(packet);
+                            if(++count > maxPacketCount){
+                                   break;
+                            }
+                        } catch (JdpException e) {
+                            e.printStackTrace();
+                            throw new RuntimeException("Test failed");
+                        }
+
+                    }
+
+                    System.out.println("OK: Test passed");
+
+                } finally {
+                    sel.close();
+                    channel.close();
+                }
+            } catch (IOException e) {
+                e.printStackTrace();
+                throw new RuntimeException("Test failed");
+            }
+        }
+    }
+
+    public static void main(String[] args) {
+        try {
+            String discoveryPort = System.getProperty("com.sun.management.jdp.port");
+            String discoveryAddress = System.getProperty("com.sun.management.jdp.address");
+            if (discoveryAddress == null || discoveryPort == null) {
+                System.out.println("Test failed. address and port must be specified");
+                return;
+            }
+
+            int port = Integer.parseInt(discoveryPort);
+            InetAddress address = InetAddress.getByName(discoveryAddress);
+
+
+            ProtocolFamily family = (address instanceof Inet6Address)
+                    ? StandardProtocolFamily.INET6 : StandardProtocolFamily.INET;
+
+            DatagramChannel channel;
+
+            channel = DatagramChannel.open(family);
+            channel.setOption(StandardSocketOptions.SO_REUSEADDR, true);
+            channel.bind(new InetSocketAddress(port));
+
+            Enumeration<NetworkInterface> nets = NetworkInterface.getNetworkInterfaces();
+            for (NetworkInterface interf : Collections.list(nets)) {
+                if (interf.supportsMulticast()) {
+                    try {
+                        channel.join(address, interf);
+                    } catch (IOException e) {
+                        // Skip not configured interfaces
+                    }
+                }
+            }
+
+            PacketListener listener = new PacketListener(channel);
+            new Thread(listener, "Jdp Client").start();
+
+        } catch (RuntimeException e){
+            System.out.println("Test failed.");
+        } catch (Exception e) {
+            e.printStackTrace();
+            System.out.println("Test failed. unexpected error " + e);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/management/jdp/JdpDoSomething.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,103 @@
+/*
+ * 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.
+ */
+
+import java.io.File;
+import java.io.IOException;
+import java.io.RandomAccessFile;
+import java.util.Objects;
+
+import sun.management.jdp.JdpJmxPacket;
+import sun.management.jdp.JdpException;
+
+public class JdpDoSomething {
+
+    private static final String lockFileName = "JdpDoSomething.lck";
+    private static final boolean verbose=false;
+
+    public static boolean getVerbose(){
+        return verbose;
+    }
+
+    public static void printJdpPacket(JdpJmxPacket p) {
+        if (getVerbose()) {
+            try {
+                RandomAccessFile f = new RandomAccessFile("out.dmp", "rw");
+                f.write(p.getPacketData());
+                f.close();
+            } catch (IOException e) {
+                System.out.println("Can't write a dump file: " + e);
+            }
+
+            System.out.println("Id: " + p.getId());
+            System.out.println("Jmx: " + p.getJmxServiceUrl());
+            System.out.println("Main: " + p.getMainClass());
+            System.out.println("InstanceName: " + p.getInstanceName());
+
+            System.out.flush();
+        }
+    }
+
+    public static void compaireJdpPacketEx(JdpJmxPacket p1, JdpJmxPacket p2)
+    throws JdpException {
+
+        if (!Objects.equals(p1, p1)) {
+            throw new JdpException("Packet mismatch error");
+        }
+
+        if (!Objects.equals(p1.getMainClass(), p2.getMainClass())) {
+            throw new JdpException("Packet mismatch error (main class)");
+        }
+
+        if (!Objects.equals(p1.getInstanceName(), p2.getInstanceName())) {
+            throw new JdpException("Packet mismatch error (instance name)");
+        }
+    }
+
+    public static void doSomething() {
+        try {
+            File lockFile = new File(lockFileName);
+            lockFile.createNewFile();
+
+            while (lockFile.exists()) {
+                long datetime = lockFile.lastModified();
+                long epoch = System.currentTimeMillis() / 1000;
+
+                // Don't allow test app to run more than an hour
+                if (epoch - datetime > 3600) {
+                    System.err.println("Lock is too old. Aborting");
+                    return;
+                }
+                Thread.sleep(1);
+            }
+
+        } catch (Throwable e) {
+            System.err.println("Something bad happens:" + e);
+        }
+    }
+
+    public static void main(String args[]) throws Exception {
+        System.err.println("main enter");
+        doSomething();
+        System.err.println("main exit");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/management/jdp/JdpTest.sh	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,338 @@
+#!/bin/sh -x
+
+# Copyright (c) 2011, 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 7169888
+# @compile -XDignore.symbol.file JdpUnitTest.java JdpClient.java JdpDoSomething.java
+# @run shell JdpTest.sh --jtreg --no-compile
+# @summary No word Failed expected in the test output
+
+_verbose=no
+_jtreg=no
+_compile=yes
+
+# temporary disable jcmd related tests
+# _testsuite="01,02,03,04,05"
+_testsuite="01,02,04"
+
+_pwd=`pwd`
+
+_testclasses=".classes"
+_testsrc="${_pwd}"
+_lockFileName="JdpDoSomething.lck"
+
+_logname=".classes/output.txt"
+_last_pid=""
+
+_ip="224.0.23.178"
+_port="7095"
+_jmxport="4545"
+
+_do_compile(){
+    # If the test run without JTReg, we have to compile it by our self
+    # Under JTReg see @compile statement above
+    # sun.* packages is not included to symbol file lib/ct.sym so we have
+    # to ignore it
+
+    if [ ! -d ${_testclasses} ]
+    then
+	  mkdir -p ${_testclasses}
+    fi
+
+    rm -f ${_testclasses}/*.class
+
+    # Compile testcase
+    ${COMPILEJAVA}/bin/javac -XDignore.symbol.file -d ${_testclasses} \
+                                             JdpUnitTest.java \
+                                             JdpDoSomething.java  \
+                                             JdpClient.java
+
+
+    if [ ! -f ${_testclasses}/JdpDoSomething.class -o ! -f ${_testclasses}/JdpClient.class -o ! -f ${_testclasses}/JdpUnitTest.class ]
+    then
+      echo "ERROR: Can't compile"
+      exit 255
+    fi
+}
+
+
+_app_start(){
+
+  testappname=$1
+  shift
+
+  ${TESTJAVA}/bin/java -server $* -cp ${_testclasses} ${testappname}  >> ${_logname} 2>&1 &
+ _last_pid=$!
+
+  npid=`_get_pid`
+  if [ "${npid}" = "" ]
+  then
+     echo "ERROR: Test app not started. Please check machine resources before filing a bug."
+     if [ "${_jtreg}" = "yes" ]
+     then
+       exit 255
+     fi
+  fi
+}
+
+_get_pid(){
+    ${TESTJAVA}/bin/jps | sed -n "/Jdp/s/ .*//p"
+}
+
+_app_stop(){
+   rm ${_lockFileName}
+
+# wait until VM is actually shuts down
+  while true
+  do
+    npid=`_get_pid`
+    if [ "${npid}" = "" ]
+    then
+      break
+    fi
+    sleep 1
+  done
+}
+
+_testme(){
+  ${TESTJAVA}/bin/java \
+  -cp ${_testclasses} \
+  $* \
+    -Dcom.sun.management.jdp.port=${_port} \
+    -Dcom.sun.management.jdp.address=${_ip} \
+  JdpClient
+
+}
+
+
+_jcmd(){
+    ${TESTJAVA}/bin/jcmd JdpDoSomething $* > /dev/null 2>/dev/null
+}
+
+
+_echo(){
+    echo "$*"
+    echo "$*" >> ${_logname}
+}
+
+# ============= TESTS ======================================
+
+test_01(){
+
+    _echo "**** Test one ****"
+
+    _app_start JdpUnitTest \
+    -Dcom.sun.management.jdp.port=${_port} \
+    -Dcom.sun.management.jdp.address=${_ip} \
+    -Dcom.sun.management.jdp.pause=5
+
+    res=`_testme`
+
+    case "${res}" in
+     OK*)
+	_echo "Passed"
+     ;;
+     *)
+	_echo "Failed!"
+     ;;
+    esac
+
+    _app_stop
+}
+
+test_02(){
+
+    _echo "**** Test two ****"
+
+    _app_start JdpDoSomething \
+     -Dcom.sun.management.jdp.port=${_port} \
+     -Dcom.sun.management.jdp.address=${_ip} \
+     -Dcom.sun.management.jdp.pause=5 \
+     -Dcom.sun.management.jmxremote.port=${_jmxport} \
+     -Dcom.sun.management.jmxremote.authenticate=false \
+     -Dcom.sun.management.jmxremote.ssl=false
+
+    res=`_testme`
+
+    case "${res}" in
+     OK*)
+	_echo "Passed"
+     ;;
+     *)
+	_echo "Failed!"
+     ;;
+    esac
+
+    _app_stop
+}
+
+test_03(){
+
+    _echo "**** Test three ****"
+
+    _app_start JdpDoSomething
+
+    _jcmd  ManagementAgent.start\
+                jdp.port=${_port} \
+                jdp.address=${_ip} \
+                jdp.pause=5 \
+                jmxremote.port=${_jmxport} \
+                jmxremote.authenticate=false \
+                jmxremote.ssl=false
+
+    res=`_testme`
+
+    case "${res}" in
+     OK*)
+	_echo "Passed"
+     ;;
+     *)
+	_echo "Failed!"
+     ;;
+    esac
+
+    _app_stop
+}
+
+test_04(){
+
+    _echo "**** Test four ****"
+
+    _app_start JdpDoSomething \
+     -Dcom.sun.management.jmxremote.autodiscovery=true \
+     -Dcom.sun.management.jmxremote.port=${_jmxport} \
+     -Dcom.sun.management.jmxremote.authenticate=false \
+     -Dcom.sun.management.jmxremote.ssl=false
+
+    res=`_testme`
+
+    case "${res}" in
+     OK*)
+	_echo "Passed"
+     ;;
+     *)
+	_echo "Failed!"
+     ;;
+    esac
+
+    _app_stop
+}
+
+test_05(){
+
+    _echo "**** Test five ****"
+
+    _app_start JdpDoSomething
+
+    _jcmd  ManagementAgent.start\
+                jmxremote.autodiscovery=true \
+                jmxremote.port=${_jmxport} \
+                jmxremote.authenticate=false \
+                jmxremote.ssl=false
+
+
+    res=`_testme`
+
+    case "${res}" in
+     OK*)
+	_echo "Passed"
+     ;;
+     *)
+	_echo "Failed!"
+     ;;
+    esac
+
+    _app_stop
+}
+
+
+# ============= MAIN =======================================
+
+if [ "x${TESTJAVA}" = "x" ]
+then
+  echo "TESTJAVA env have to be set"
+  exit
+fi
+
+# COMPILEJAVA variable is set when we test jre
+if [ "x${COMPILEJAVA}" = "x" ]
+then
+   COMPILEJAVA="${TESTJAVA}"
+fi
+
+
+#------------------------------------------------------------------------------
+# reading parameters
+
+for parm in "$@"
+do
+   case $parm in
+  --verbose)      _verbose=yes  ;;
+  --jtreg)        _jtreg=yes    ;;
+  --no-compile)   _compile=no   ;;
+  --testsuite=*)  _testsuite=`_echo $parm | sed "s,^--.*=\(.*\),\1,"`  ;;
+  *)
+     echo "Undefined parameter $parm. Try --help for help"
+     exit
+   ;;
+ esac
+done
+
+if [ "${_compile}" = "yes" ]
+then
+ _do_compile
+fi
+
+if [ "${_jtreg}" = "yes" ]
+then
+ _testclasses=${TESTCLASSES}
+ _testsrc=${TESTSRC}
+ _logname="output.txt"
+fi
+
+# Make sure _tesclasses is absolute path
+tt=`echo ${_testclasses} | sed -e 's,/,,'`
+if [ "${tt}" = "${_testclasses}" ]
+then
+  _testclasses="${_pwd}/${_testclasses}"
+fi
+
+_policyname="${_testclasses}/policy"
+
+rm -f ${_logname}
+rm -f ${_policyname}
+
+if [ -f ${_testsrc}/policy.tpl ]
+then
+
+cat ${_testsrc}/policy.tpl | \
+     sed -e "s,@_TESTCLASSES@,${_testclasses},g" -e "s,@TESTJAVA@,${TESTJAVA},g" \
+ > ${_policyname}
+
+fi
+
+# Local mode tests
+for i in `echo ${_testsuite} | sed -e "s/,/ /g"`
+do
+  test_${i}
+done
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/management/jdp/JdpUnitTest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,96 @@
+/*
+ * 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.
+ */
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.util.UUID;
+
+import sun.management.jdp.JdpController;
+import sun.management.jdp.JdpPacket;
+import sun.management.jdp.JdpJmxPacket;
+import sun.management.jdp.JdpException;
+
+public class JdpUnitTest {
+
+
+    static byte[] russian_name = {(byte)0xd0,(byte)0xbf,(byte)0xd1,(byte)0x80,(byte)0xd0,(byte)0xbe,(byte)0xd0,(byte)0xb2,
+                                  (byte)0xd0,(byte)0xb5,(byte)0xd1,(byte)0x80,(byte)0xd0,(byte)0xba,(byte)0xd0,(byte)0xb0,
+                                  (byte)0x20,(byte)0xd1,(byte)0x81,(byte)0xd0,(byte)0xb2,(byte)0xd1,(byte)0x8f,(byte)0xd0,
+                                  (byte)0xb7,(byte)0xd0,(byte)0xb8,(byte)0x0a};
+
+    /**
+     * This test tests that complete packet is build correctly
+     */
+    public static void PacketBuilderTest()
+        throws IOException, JdpException {
+
+        /* Complete packet test */
+        {
+            JdpJmxPacket p1 = new JdpJmxPacket(UUID.randomUUID(), "fake://unit-test");
+            p1.setMainClass("FakeUnitTest");
+            p1.setInstanceName( new String(russian_name,"UTF-8"));
+            byte[] b = p1.getPacketData();
+
+            JdpJmxPacket p2 = new JdpJmxPacket(b);
+            JdpDoSomething.printJdpPacket(p1);
+            JdpDoSomething.compaireJdpPacketEx(p1, p2);
+        }
+
+        /*Missed field packet test*/
+        {
+            JdpJmxPacket p1 = new JdpJmxPacket(UUID.randomUUID(), "fake://unit-test");
+            p1.setMainClass("FakeUnitTest");
+            p1.setInstanceName(null);
+            byte[] b = p1.getPacketData();
+
+            JdpJmxPacket p2 = new JdpJmxPacket(b);
+            JdpDoSomething.printJdpPacket(p1);
+            JdpDoSomething.compaireJdpPacketEx(p1, p2);
+        }
+
+         System.out.println("OK: Test passed");
+
+    }
+
+    public static void startFakeDiscoveryService()
+            throws IOException, JdpException {
+
+        String discoveryPort = System.getProperty("com.sun.management.jdp.port");
+        String discoveryAddress = System.getProperty("com.sun.management.jdp.address");
+        InetAddress address = InetAddress.getByName(discoveryAddress);
+        int port = Integer.parseInt(discoveryPort);
+        JdpController.startDiscoveryService(address, port, "FakeDiscovery", "fake://unit-test");
+    }
+
+    public static void main(String[] args) {
+        try {
+            PacketBuilderTest();
+            startFakeDiscoveryService();
+            JdpDoSomething.doSomething();
+
+        } catch (Throwable e) {
+            e.printStackTrace();
+            System.out.println("Test failed. unexpected error " + e);
+        }
+    }
+}
--- a/test/sun/misc/Cleaner/ExitOnThrow.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/sun/misc/Cleaner/ExitOnThrow.java	Fri Jun 21 19:11:42 2013 -0700
@@ -28,21 +28,17 @@
 
 public class ExitOnThrow {
 
-    private static volatile boolean ran = false;
-
     public static void main(String[] args) throws Exception {
         Cleaner.create(new Object(),
                        new Runnable() {
                                public void run() {
-                                   ran = true;
                                    throw new RuntimeException("Foo!");
                                }
                            });
-        while (!ran) {
+        while (true) {
             System.gc();
             Thread.sleep(100);
         }
-        System.exit(0);
     }
 
 }
--- a/test/sun/misc/Cleaner/exitOnThrow.sh	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/sun/misc/Cleaner/exitOnThrow.sh	Fri Jun 21 19:11:42 2013 -0700
@@ -25,10 +25,11 @@
 
 #
 # @test
-# @bug 4954921
+# @bug 4954921 8009259
 # @summary Ensure that if a cleaner throws an exception then the VM exits
 #
 # @build ExitOnThrow
+# @run shell exitOnThrow.sh
 
 # Command-line usage: sh exitOnThrow.sh /path/to/build
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/misc/IoTrace/IoTraceAgent.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,182 @@
+/*
+ * 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.
+ */
+
+import static com.sun.xml.internal.ws.org.objectweb.asm.Opcodes.ACC_FINAL;
+import static com.sun.xml.internal.ws.org.objectweb.asm.Opcodes.ACC_PRIVATE;
+import static com.sun.xml.internal.ws.org.objectweb.asm.Opcodes.ACC_PUBLIC;
+import static com.sun.xml.internal.ws.org.objectweb.asm.Opcodes.ACC_STATIC;
+import static com.sun.xml.internal.ws.org.objectweb.asm.Opcodes.ACC_SUPER;
+import static com.sun.xml.internal.ws.org.objectweb.asm.Opcodes.ILOAD;
+import static com.sun.xml.internal.ws.org.objectweb.asm.Opcodes.INVOKESPECIAL;
+import static com.sun.xml.internal.ws.org.objectweb.asm.Opcodes.INVOKESTATIC;
+import static com.sun.xml.internal.ws.org.objectweb.asm.Opcodes.IRETURN;
+import static com.sun.xml.internal.ws.org.objectweb.asm.Opcodes.RETURN;
+import static com.sun.xml.internal.ws.org.objectweb.asm.Opcodes.V1_6;
+
+import java.lang.instrument.ClassDefinition;
+import java.lang.instrument.Instrumentation;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.net.InetAddress;
+
+import com.sun.xml.internal.ws.org.objectweb.asm.ClassWriter;
+import com.sun.xml.internal.ws.org.objectweb.asm.MethodVisitor;
+import com.sun.xml.internal.ws.org.objectweb.asm.Type;
+import sun.misc.IoTrace;
+
+public class IoTraceAgent {
+
+    private static IoTraceListener listener;
+
+    public static void setListener(IoTraceListener l) {
+        listener = l;
+    }
+
+    public static Object socketReadBegin() {
+        IoTraceListener l = listener;
+        if (l != null) {
+            return l.socketReadBegin();
+        }
+        return null;
+    }
+
+    public static void socketReadEnd(Object context, InetAddress address, int port,
+                                     int timeout, long bytesRead) {
+        IoTraceListener l = listener;
+        if (l != null) {
+            l.socketReadEnd(context, address, port, timeout, bytesRead);
+        }
+    }
+
+    public static Object socketWriteBegin() {
+        IoTraceListener l = listener;
+        if (l != null) {
+            return l.socketWriteBegin();
+        }
+        return null;
+    }
+
+    public static void socketWriteEnd(Object context, InetAddress address, int port,
+                                      long bytesWritten) {
+        IoTraceListener l = listener;
+        if (l != null) {
+            l.socketWriteEnd(context, address, port, bytesWritten);
+        }
+    }
+
+    public static Object fileReadBegin(String path) {
+        IoTraceListener l = listener;
+        if (l != null) {
+            return l.fileReadBegin(path);
+        }
+        return null;
+    }
+
+    public static void fileReadEnd(Object context, long bytesRead) {
+        IoTraceListener l = listener;
+        if (l != null) {
+            l.fileReadEnd(context, bytesRead);
+        }
+    }
+
+    public static Object fileWriteBegin(String path) {
+        IoTraceListener l = listener;
+        if (l != null) {
+            return l.fileWriteBegin(path);
+        }
+        return null;
+    }
+
+    public static void fileWriteEnd(Object context, long bytesWritten) {
+        IoTraceListener l = listener;
+        if (l != null) {
+            l.fileWriteEnd(context, bytesWritten);
+        }
+    }
+
+    public static void premain(String agentArgs, Instrumentation inst)
+            throws Exception {
+        ClassDefinition cd = new ClassDefinition(IoTrace.class,
+                generateClassAsm());
+        inst.redefineClasses(cd);
+    }
+
+    private static byte[] generateClassAsm() {
+        ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
+        cw.visit(V1_6, ACC_PUBLIC | ACC_SUPER | ACC_FINAL, "sun/misc/IoTrace",
+                null, "java/lang/Object", null);
+
+        // for all methods in the existing IoTrace class
+        // we want to create a method in the new version of it which call
+        // IoTraceAgent
+        //
+        // 0: aload_0
+        // 1: iload_1
+        // 2: iload_2
+        // 3: invokestatic #16 // Method
+        // IoTraceAgent.socketReadBegin:(II)Ljava/lang/Object;
+        // 6: areturn
+
+        for (Method om : IoTrace.class.getDeclaredMethods()) {
+            if (!Modifier.isStatic(om.getModifiers())) {
+                continue;
+            }
+
+            // create a method with the same signature as the
+            // original method
+            MethodVisitor mv = cw.visitMethod(ACC_PUBLIC | ACC_STATIC,
+                    om.getName(), Type.getMethodDescriptor(om), null, null);
+            mv.visitCode();
+
+            // get the return type and argument list types
+            Type[] argTypes = Type.getArgumentTypes(om);
+            Type retType = Type.getReturnType(om);
+
+            // load all the arguments
+            int i = 0;
+            for (Type t : argTypes) {
+                mv.visitVarInsn(t.getOpcode(ILOAD), i++);
+            }
+
+            // call a method with the same signature (but in a different class)
+            // with all the arguments
+            mv.visitMethodInsn(INVOKESTATIC, "IoTraceAgent", om.getName(),
+                    Type.getMethodDescriptor(om));
+
+            // return the value from the called method
+            mv.visitInsn(retType.getOpcode(IRETURN));
+            mv.visitEnd();
+        }
+
+        // empty private constructor
+        MethodVisitor mv = cw.visitMethod(ACC_PRIVATE, "<init>", "()V", null,
+                null);
+        mv.visitCode();
+        mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V");
+        mv.visitInsn(RETURN);
+        mv.visitEnd();
+
+        cw.visitEnd();
+        return cw.toByteArray();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/misc/IoTrace/IoTraceBase.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,154 @@
+/*
+ * 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.
+ */
+
+import java.io.File;
+import java.net.InetAddress;
+
+
+public class IoTraceBase implements IoTraceListener {
+
+    protected static final Object my_context = new Object() {
+    };
+
+    private String path;
+    private long bytesRead;
+    private long bytesWritten;
+    private Object context;
+    private InetAddress address;
+    private int port;
+    private int timeout;
+
+    protected void clear() {
+        context = null;
+        bytesRead = 0;
+        bytesWritten = 0;
+        address = null;
+        port = 0;
+        timeout = 0;
+        path = null;
+    }
+
+    @Override
+    public Object fileWriteBegin(String p) {
+        path = p;
+        return my_context;
+    }
+
+    @Override
+    public void fileWriteEnd(Object ctx, long bw) {
+        context = ctx;
+        bytesWritten = bw;
+    }
+
+    @Override
+    public Object fileReadBegin(String p) {
+        path = p;
+        return my_context;
+    }
+
+    @Override
+    public void fileReadEnd(Object ctx, long br) {
+        context = ctx;
+        bytesRead = br;
+    }
+
+    @Override
+    public Object socketReadBegin() {
+        return my_context;
+    }
+
+    @Override
+    public void socketReadEnd(Object context, InetAddress address, int port,
+                              int timeout, long bytesRead) {
+        this.context = context;
+        this.address = address;
+        this.port = port;
+        this.timeout = timeout;
+        this.bytesRead = bytesRead;
+    }
+
+    @Override
+    public Object socketWriteBegin() {
+        return my_context;
+    }
+
+    @Override
+    public void socketWriteEnd(Object context, InetAddress address, int port,
+                               long bytesWritten) {
+        this.context = context;
+        this.address = address;
+        this.port = port;
+        this.bytesWritten = bytesWritten;
+    }
+
+    protected void expectFileRead(long br, File f) throws Exception {
+        expectFile(0, br, f);
+    }
+
+    protected void expectFileWrite(long bw, File f) throws Exception {
+        expectFile(bw, 0, f);
+    }
+
+    protected void expectFile(long bw, long br, File f) throws Exception {
+        if (context != my_context) {
+            throw new Exception("Wrong context: " + context);
+        }
+        if (bytesWritten != bw) {
+            throw new Exception("Expected " + bw + " byte to be read, got: "
+                    + bytesWritten);
+        }
+        if (bytesRead != br) {
+            throw new Exception("Expected " + br + " byte to be read, got: "
+                    + bytesWritten);
+        }
+        if (!path.equals(f.getPath())) {
+            throw new Exception("Incorrect path: " + path + ". Expected: "
+                    + f.getPath());
+        }
+    }
+
+    protected void expectSocket(int br, int bw, InetAddress ia, int p, int t)
+            throws Exception {
+        if (context != my_context) {
+            throw new Exception("Wrong context: " + context);
+        }
+        if (bytesWritten != bw) {
+            throw new Exception("Expected " + bw + " byte to be written, got: "
+                    + bytesWritten);
+        }
+        if (bytesRead != br) {
+            throw new Exception("Expected " + br + " byte to be read, got: "
+                    + bytesWritten);
+        }
+        if (!address.equals(ia)) {
+            throw new Exception("Incorrect address: " + address
+                    + ". Expected: " + ia);
+        }
+        if (port != p) {
+            throw new Exception("Expected " + p + " port, got: " + port);
+        }
+        if (timeout != t) {
+            throw new Exception("Expected " + t + " timeout, got: " + timeout);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/misc/IoTrace/IoTraceFileChannelReadWrite.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,77 @@
+/*
+ * 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.
+ */
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.nio.channels.FileChannel;
+import java.nio.file.StandardOpenOption;
+
+/*
+ * @test
+ * @bug 8003322
+ * @run shell ioTraceTest.sh IoTraceFileChannelReadWrite
+ */
+public class IoTraceFileChannelReadWrite extends IoTraceBase {
+
+    private void testWrite(File f) throws IOException, FileNotFoundException,
+            Exception {
+        try (FileChannel fc = FileChannel.open(f.toPath(),
+                StandardOpenOption.WRITE)) {
+            ByteBuffer bb = ByteBuffer.allocate(1);
+            bb.put((byte) 11);
+            bb.flip();
+            fc.write(bb);
+        }
+        expectFile(1, 0, f);
+    }
+
+    private void testRead(File f) throws IOException, FileNotFoundException,
+            Exception {
+        try (FileChannel fc = FileChannel.open(f.toPath(),
+                StandardOpenOption.READ)) {
+            ByteBuffer bb = ByteBuffer.allocate(1);
+            fc.read(bb);
+        }
+        expectFile(0, 1, f);
+    }
+
+    public void test() throws Exception {
+        IoTraceAgent.setListener(this);
+        File f = File.createTempFile("IoTraceFileChannelReadWrite", ".bin");
+        try {
+            clear();
+            testWrite(f);
+            clear();
+            testRead(f);
+        } finally {
+            f.delete();
+        }
+    }
+
+    public static void main(String... args) throws Exception {
+        IoTraceFileChannelReadWrite t = new IoTraceFileChannelReadWrite();
+        t.test();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/misc/IoTrace/IoTraceFileReadWrite.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,90 @@
+/*
+ * 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.
+ */
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.RandomAccessFile;
+
+/*
+ * @test
+ * @bug 8003322
+ * @run shell ioTraceTest.sh IoTraceFileReadWrite
+ */
+public class IoTraceFileReadWrite extends IoTraceBase {
+
+    private void testWrite(File f) throws IOException, FileNotFoundException,
+            Exception {
+        try (FileOutputStream fos = new FileOutputStream(f)) {
+            fos.write(11);
+        }
+        expectFile(1, 0, f);
+    }
+
+
+    private void testRead(File f) throws IOException, FileNotFoundException,
+            Exception {
+        try (FileInputStream fos = new FileInputStream(f)) {
+            fos.read();
+        }
+        expectFile(0, 1, f);
+    }
+
+    private void testRandomAccessWrite(File f) throws Exception {
+        try (RandomAccessFile raf = new RandomAccessFile(f, "rw")) {
+            raf.write(11);
+        }
+        expectFile(1, 0, f);
+    }
+
+    private void testRandomAccessRead(File f) throws Exception {
+        try (RandomAccessFile raf = new RandomAccessFile(f, "r")) {
+            raf.read();
+        }
+        expectFile(0, 1, f);
+    }
+
+    public void test() throws Exception {
+        IoTraceAgent.setListener(this);
+        File f = File.createTempFile("IoTraceFileReadWrite", ".bin");
+        try {
+            clear();
+            testWrite(f);
+            clear();
+            testRead(f);
+            clear();
+            testRandomAccessWrite(f);
+            clear();
+            testRandomAccessRead(f);
+        } finally {
+            f.delete();
+        }
+    }
+
+    public static void main(String... args) throws Exception {
+        IoTraceFileReadWrite t = new IoTraceFileReadWrite();
+        t.test();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/misc/IoTrace/IoTraceListener.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,139 @@
+/*
+ * 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.
+ */
+
+import java.net.InetAddress;
+
+import sun.misc.IoTrace;
+
+/**
+ * Implementations of this interface can be registered with
+ * {@link IoTrace#setListener(IoTraceListener)} to receive callbacks when file
+ * and socket operations are performed.
+ * <p>
+ * The xxBegin() methods return a "context". This can be any Object. This
+ * context will be passed to the corresponding xxEnd() method. This way, an
+ * implementation can correlate the beginning of an operation with the end.
+ * <p>
+ * It is possible for a xxEnd() method to be called with a null handle. This
+ * happens if tracing was started between the call to xxBegin() and xxEnd(), in
+ * which case xxBegin() would not have been called. It is the implementation's
+ * responsibility to not throw an exception in this case.
+ * <p>
+ * Implementations should never throw exceptions since this will cause
+ * disruptions to the I/O operations.
+ * <p>
+ * An xxBegin() call is not guaranteed to be followed by an xxEnd() call, since
+ * the listener in IoTrace can be reset at any time.
+ */
+public interface IoTraceListener {
+
+    /**
+     * Called before data is read from a socket.
+     *
+     * @return a context object
+     */
+    public Object socketReadBegin();
+
+    /**
+     * Called after data is read from the socket.
+     *
+     * @param context
+     *            the context returned by the previous call to socketReadBegin()
+     * @param address
+     *            the remote address the socket is bound to
+     * @param port
+     *            the remote port the socket is bound to
+     * @param timeout
+     *            the SO_TIMEOUT value of the socket (in milliseconds) or 0 if
+     *            there is no timeout set
+     * @param bytesRead
+     *            the number of bytes read from the socket, 0 if there was an
+     *            error reading from the socket
+     */
+    public void socketReadEnd(Object context, InetAddress address, int port,
+                              int timeout, long bytesRead);
+
+    /**
+     * Called before data is written to a socket.
+     *
+     * @return a context object
+     */
+    public Object socketWriteBegin();
+
+    /**
+     * Called after data is written to a socket.
+     *
+     * @param context
+     *            the context returned by the previous call to
+     *            socketWriteBegin()
+     * @param address
+     *            the remote address the socket is bound to
+     * @param port
+     *            the remote port the socket is bound to
+     * @param bytesWritten
+     *            the number of bytes written to the socket, 0 if there was an
+     *            error writing to the socket
+     */
+    public void socketWriteEnd(Object context, InetAddress address, int port,
+                               long bytesWritten);
+
+    /**
+     * Called before data is read from a file.
+     *
+     * @param path
+     *            the path of the file
+     * @return a context object
+     */
+    public Object fileReadBegin(String path);
+
+    /**
+     * Called after data is read from a file.
+     *
+     * @param context
+     *            the context returned by the previous call to fileReadBegin()
+     * @param bytesRead
+     *            the number of bytes written to the file, 0 if there was an
+     *            error writing to the file
+     */
+    public void fileReadEnd(Object context, long bytesRead);
+
+    /**
+     * Called before data is written to a file.
+     *
+     * @param path
+     *            the path of the file
+     * @return a context object
+     */
+    public Object fileWriteBegin(String path);
+
+    /**
+     * Called after data is written to a file.
+     *
+     * @param context
+     *            the context returned by the previous call to fileReadBegin()
+     * @param bytesWritten
+     *            the number of bytes written to the file, 0 if there was an
+     *            error writing to the file
+     */
+    public void fileWriteEnd(Object context, long bytesWritten);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/misc/IoTrace/IoTraceSocketReadWrite.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,76 @@
+/*
+ * 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.
+ */
+
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.InetAddress;
+import java.net.ServerSocket;
+import java.net.Socket;
+
+/*
+ * @test
+ * @bug 8003322
+ * @run shell ioTraceTest.sh IoTraceSocketReadWrite
+ */
+public class IoTraceSocketReadWrite extends IoTraceBase {
+
+    public void test() throws Exception {
+        IoTraceAgent.setListener(this);
+
+        ServerSocket ss = null;
+        Socket s1 = null, s2 = null;
+        OutputStream os = null;
+        InputStream is = null;
+
+        try {
+            InetAddress iaddr = InetAddress.getLocalHost();
+            ss = new ServerSocket(0);
+            s1 = new Socket(iaddr, ss.getLocalPort());
+            s2 = ss.accept();
+
+            os = s1.getOutputStream();
+            is = s2.getInputStream();
+
+            os.write((byte) 11);
+            is.read();
+
+            expectSocket(1, 1, s2.getInetAddress(), s2.getPort(), 0);
+
+        } finally {
+            if (ss != null) {
+                ss.close();
+            }
+            if (s1 != null) {
+                s1.close();
+            }
+            if (s2 != null) {
+                s2.close();
+            }
+        }
+    }
+
+    public static void main(String... args) throws Exception {
+        IoTraceSocketReadWrite t = new IoTraceSocketReadWrite();
+        t.test();
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/misc/IoTrace/ioTraceTest.sh	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,34 @@
+#
+# 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.
+#
+
+set -x
+PWD=`pwd`
+
+cd ${TESTSRC}
+${TESTJAVA}/bin/javac -XDignore.symbol.file=true -d ${TESTCLASSES} *.java
+
+cd ${TESTCLASSES}
+${TESTJAVA}/bin/jar cfm iotraceagent.jar ${TESTSRC}/iotraceagent.mf IoTraceAgent.class IoTraceListener.class
+
+cd ${PWD}
+${TESTJAVA}/bin/java ${TESTVMOPTS} -javaagent:${TESTCLASSES}/iotraceagent.jar -cp ${TESTCLASSES} $*
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/misc/IoTrace/iotraceagent.mf	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,3 @@
+Premain-Class: IoTraceAgent
+Can-Redefine-Classes: true
+Boot-Class-Path: iotraceagent.jar
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/net/www/MessageHeaderTest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,74 @@
+/*
+ * 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 8003948
+ * @run main MessageHeaderTest
+ */
+import java.io.*;
+import sun.net.www.MessageHeader;
+
+public class MessageHeaderTest {
+    public static void main (String[] args) throws Exception {
+        for (int i=0; i<7; i++) {
+            ByteArrayInputStream bis = new ByteArrayInputStream(headers[i].getBytes());
+            MessageHeader h = new MessageHeader(bis);
+            String before = h.toString();
+            before = before.substring(before.indexOf('{'));
+            boolean result = h.filterNTLMResponses("WWW-Authenticate");
+            String after = h.toString();
+            after = after.substring(after.indexOf('{'));
+            if (!expected[i].equals(after)) {
+                throw new RuntimeException(Integer.toString(i) + " expected != after");
+            }
+            if (result != expectedResult[i]) {
+                throw new RuntimeException(Integer.toString(i) + " result != expectedResult");
+            }
+        }
+    }
+
+    static String expected[] = {
+        "{null: HTTP/1.1 200 Ok}{Foo: bar}{Bar: foo}{WWW-Authenticate: NTLM sdsds}",
+        "{null: HTTP/1.1 200 Ok}{Foo: bar}{Bar: foo}{WWW-Authenticate: }",
+        "{null: HTTP/1.1 200 Ok}{Foo: bar}{Bar: foo}{WWW-Authenticate: NTLM sdsds}",
+        "{null: HTTP/1.1 200 Ok}{Foo: bar}{Bar: foo}{WWW-Authenticate: NTLM sdsds}",
+        "{null: HTTP/1.1 200 Ok}{Foo: bar}{Bar: foo}{WWW-Authenticate: NTLM sdsds}{Bar: foo}",
+        "{null: HTTP/1.1 200 Ok}{WWW-Authenticate: Negotiate}{Foo: bar}{Bar: foo}{WWW-Authenticate: NTLM}{Bar: foo}{WWW-Authenticate: Kerberos}",
+        "{null: HTTP/1.1 200 Ok}{Foo: foo}{Bar: }{WWW-Authenticate: NTLM blob}{Bar: foo blob}"
+    };
+
+    static boolean[] expectedResult = {
+        false, false, true, true, true, false, false
+    };
+
+    static String[] headers = {
+        "HTTP/1.1 200 Ok\r\nFoo: bar\r\nBar: foo\r\nWWW-Authenticate: NTLM sdsds",
+        "HTTP/1.1 200 Ok\r\nFoo: bar\r\nBar: foo\r\nWWW-Authenticate:",
+        "HTTP/1.1 200 Ok\r\nFoo: bar\r\nBar: foo\r\nWWW-Authenticate: NTLM sdsds\r\nWWW-Authenticate: Negotiate",
+        "HTTP/1.1 200 Ok\r\nFoo: bar\r\nBar: foo\r\nWWW-Authenticate: NTLM sdsds\r\nWWW-Authenticate: Negotiate\r\nWWW-Authenticate: Kerberos",
+        "HTTP/1.1 200 Ok\r\nWWW-Authenticate: Negotiate\r\nFoo: bar\r\nBar: foo\r\nWWW-Authenticate: NTLM sdsds\r\nBar: foo\r\nWWW-Authenticate: Kerberos",
+        "HTTP/1.1 200 Ok\r\nWWW-Authenticate: Negotiate\r\nFoo: bar\r\nBar: foo\r\nWWW-Authenticate: NTLM\r\nBar: foo\r\nWWW-Authenticate: Kerberos",
+        "HTTP/1.1 200 Ok\r\nFoo: foo\r\nBar:\r\nWWW-Authenticate: NTLM blob\r\nBar: foo blob"
+    };
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/net/www/http/HttpClient/IsAvailable.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,68 @@
+/*
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8009650
+ * @summary HttpClient available() check throws SocketException when connection
+ * has been closed
+ */
+
+import java.net.URL;
+import java.net.ServerSocket;
+import sun.net.www.http.HttpClient;
+import java.security.*;
+import java.lang.reflect.Method;
+
+public class IsAvailable {
+
+    public static void main(String[] args) throws Exception {
+        int readTimeout = 20;
+        ServerSocket ss = new ServerSocket(0);
+
+        URL url1 = new URL("http://localhost:" + ss.getLocalPort());
+        HttpClient c1 = HttpClient.New(url1);
+
+        Method available = HttpClient.class.
+                getDeclaredMethod("available", null);
+        available.setAccessible(true);
+
+        c1.setReadTimeout(readTimeout);
+        boolean a = (boolean) available.invoke(c1);
+        if (!a) {
+            throw new RuntimeException("connection should be available");
+        }
+        if (c1.getReadTimeout() != readTimeout) {
+            throw new RuntimeException("read timeout has been altered");
+        }
+
+        c1.closeServer();
+
+        a = (boolean) available.invoke(c1);
+        if (a) {
+            throw new RuntimeException("connection shouldn't be available");
+        }
+
+        ss.close();
+    }
+}
--- a/test/sun/net/www/messageheader/0	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-HTTP/1.1 200 Ok
-Foo: bar
-Bar: foo
-WWW-Authenticate: NTLM sdsds
--- a/test/sun/net/www/messageheader/1	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-HTTP/1.1 200 Ok
-Foo: bar
-Bar: foo
-WWW-Authenticate:
--- a/test/sun/net/www/messageheader/2	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-HTTP/1.1 200 Ok
-Foo: bar
-Bar: foo
-WWW-Authenticate: NTLM sdsds
-WWW-Authenticate: Negotiate
--- a/test/sun/net/www/messageheader/3	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-HTTP/1.1 200 Ok
-Foo: bar
-Bar: foo
-WWW-Authenticate: NTLM sdsds
-WWW-Authenticate: Negotiate
-WWW-Authenticate: Kerberos
--- a/test/sun/net/www/messageheader/4	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-HTTP/1.1 200 Ok
-WWW-Authenticate: Negotiate
-Foo: bar
-Bar: foo
-WWW-Authenticate: NTLM sdsds
-Bar: foo
-WWW-Authenticate: Kerberos
--- a/test/sun/net/www/messageheader/5	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-HTTP/1.1 200 Ok
-WWW-Authenticate: Negotiate
-Foo: bar
-Bar: foo
-WWW-Authenticate: NTLM
-Bar: foo
-WWW-Authenticate: Kerberos
--- a/test/sun/net/www/messageheader/6	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-HTTP/1.1 200 Ok
-Foo: foo
-Bar:
-WWW-Authenticate: NTLM blob
-Bar: foo blob
--- a/test/sun/net/www/messageheader/HTest.java	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
- * 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 8003948
- * @run main HTest
- */
-import java.io.*;
-import sun.net.www.MessageHeader;
-
-public class HTest {
-    public static void main (String[] args) throws Exception {
-        String prefix = System.getProperty("test.src");
-        System.out.println ("TEST.SRC = " + prefix);
-        for (int i=0; i<7; i++) {
-            File f = new File(prefix, Integer.toString(i));
-            FileInputStream fis = new FileInputStream(f);
-            MessageHeader h = new MessageHeader(fis);
-            String before = h.toString();
-            before = before.substring(before.indexOf('{'));
-            System.out.println ("Before");
-            System.out.println (before);
-            boolean result = h.filterNTLMResponses("WWW-Authenticate");
-            String after = h.toString();
-            after = after.substring(after.indexOf('{'));
-            System.out.println ("After");
-            System.out.println (after);
-            System.out.println ("Expected");
-            System.out.println (expected[i]);
-            if (!expected[i].equals(after)) {
-                throw new RuntimeException(Integer.toString(i) + " expected != after");
-            }
-            if (result != expectedResult[i]) {
-                throw new RuntimeException(Integer.toString(i) + " result != expectedResult");
-            }
-        }
-    }
-
-    static String expected[] = {
-        "{null: HTTP/1.1 200 Ok}{Foo: bar}{Bar: foo}{WWW-Authenticate: NTLM sdsds}",
-        "{null: HTTP/1.1 200 Ok}{Foo: bar}{Bar: foo}{WWW-Authenticate: }",
-        "{null: HTTP/1.1 200 Ok}{Foo: bar}{Bar: foo}{WWW-Authenticate: NTLM sdsds}",
-        "{null: HTTP/1.1 200 Ok}{Foo: bar}{Bar: foo}{WWW-Authenticate: NTLM sdsds}",
-        "{null: HTTP/1.1 200 Ok}{Foo: bar}{Bar: foo}{WWW-Authenticate: NTLM sdsds}{Bar: foo}",
-        "{null: HTTP/1.1 200 Ok}{WWW-Authenticate: Negotiate}{Foo: bar}{Bar: foo}{WWW-Authenticate: NTLM}{Bar: foo}{WWW-Authenticate: Kerberos}",
-        "{null: HTTP/1.1 200 Ok}{Foo: foo}{Bar: }{WWW-Authenticate: NTLM blob}{Bar: foo blob}"
-    };
-
-    static boolean[] expectedResult = {
-        false, false, true, true, true, false, false
-    };
-}
--- a/test/sun/net/www/protocol/http/HttpOnly.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/sun/net/www/protocol/http/HttpOnly.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -22,7 +22,7 @@
  */
 /**
  * @test
- * @bug 7095980
+ * @bug 7095980 8007315
  * @summary Ensure HttpURLConnection (and supporting APIs) don't expose
  *          HttpOnly cookies
  */
@@ -52,6 +52,8 @@
  * 4) check HttpOnly cookies received by server
  * 5) server reply with Set-Cookie containing HttpOnly cookie
  * 6) check HttpOnly cookies are not accessible from Http client
+ * 7) check that non-null (empty string) values are returned for
+      scenario where all values are stripped from original key values
  */
 
 public class HttpOnly {
@@ -177,6 +179,36 @@
                           " value " + val);
             }
         }
+
+        // TEST 7 : check that header keys containing empty key values don't return null
+        int i = 1;
+        String key = "";
+        String value = "";
+
+        while (true) {
+            key = uc.getHeaderFieldKey(i);
+            value = uc.getHeaderField(i++);
+            if (key == null && value == null)
+                break;
+
+            if (key != null)
+                check(value != null,
+                    "Encountered a null value for key value : " + key);
+        }
+
+        // TEST 7.5 similar test but use getHeaderFields
+        respHeaders = uc.getHeaderFields();
+        respEntries = respHeaders.entrySet();
+        for (Map.Entry<String,List<String>> entry : respEntries) {
+            String header = entry.getKey();
+            if (header != null) {
+                List<String> listValues = entry.getValue();
+                for (String value1 : listValues)
+                    check(value1 != null,
+                        "getHeaderFields returned null values for header:, "
+                        + header);
+            }
+        }
     }
 
     // HTTP Server
--- a/test/sun/nio/ch/SelProvider.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/sun/nio/ch/SelProvider.java	Fri Jun 21 19:11:42 2013 -0700
@@ -31,19 +31,23 @@
 
 public class SelProvider {
     public static void main(String[] args) throws Exception {
-        String osname = System.getProperty("os.name");
-        String osver = System.getProperty("os.version");
-        String spName = SelectorProvider.provider().getClass().getName();
-        String expected = null;
-        if ("SunOS".equals(osname)) {
-            expected = "sun.nio.ch.DevPollSelectorProvider";
-        } else if ("Linux".equals(osname)) {
-            expected = "sun.nio.ch.EPollSelectorProvider";
-        } else if (osname.contains("OS X")) {
-            expected = "sun.nio.ch.KQueueSelectorProvider";
-        } else
-            return;
-        if (!spName.equals(expected))
+        String expected = System.getProperty("java.nio.channels.spi.SelectorProvider");
+        if (expected == null) {
+            String osname = System.getProperty("os.name");
+            String osver = System.getProperty("os.version");
+            if ("SunOS".equals(osname)) {
+                expected = "sun.nio.ch.DevPollSelectorProvider";
+            } else if ("Linux".equals(osname)) {
+                expected = "sun.nio.ch.EPollSelectorProvider";
+            } else if (osname.contains("OS X")) {
+                expected = "sun.nio.ch.KQueueSelectorProvider";
+            } else {
+                return;
+            }
+        }
+        String cn = SelectorProvider.provider().getClass().getName();
+        System.out.println(cn);
+        if (!cn.equals(expected))
             throw new Exception("failed");
     }
 }
--- a/test/sun/nio/cs/OLD/TestIBMDB.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/sun/nio/cs/OLD/TestIBMDB.java	Fri Jun 21 19:11:42 2013 -0700
@@ -26,6 +26,7 @@
  * @bug 6843578
  * @summary Test IBM DB charsets
  * @build IBM930_OLD IBM933_OLD IBM935_OLD IBM937_OLD IBM939_OLD IBM942_OLD IBM943_OLD IBM948_OLD IBM949_OLD IBM950_OLD IBM970_OLD IBM942C_OLD IBM943C_OLD IBM949C_OLD IBM1381_OLD IBM1383_OLD EUC_CN_OLD EUC_KR_OLD GBK_OLD Johab_OLD MS932_OLD MS936_OLD MS949_OLD MS950_OLD
+ * @run main TestIBMDB
  */
 
 import java.nio.charset.*;
--- a/test/sun/nio/cs/OLD/TestX11CS.java	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,133 +0,0 @@
-/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
- * 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 1234567
- * @summary Test updated X11 charsets
- * @build X11GB2312_OLD X11GBK_OLD X11KSC5601_OLD
- */
-
-import java.nio.charset.*;
-import java.nio.*;
-import java.util.*;
-
-public class TestX11CS {
-
-    static char[] decode(byte[] bb, Charset cs)
-        throws Exception {
-        CharsetDecoder dec = cs.newDecoder();
-        ByteBuffer bbf = ByteBuffer.wrap(bb);
-        CharBuffer cbf = CharBuffer.allocate(bb.length);
-        CoderResult cr = dec.decode(bbf, cbf, true);
-        if (cr != CoderResult.UNDERFLOW) {
-            System.out.println("DEC-----------------");
-            int pos = bbf.position();
-            System.out.printf("  cr=%s, bbf.pos=%d, bb[pos]=%x,%x,%x,%x%n",
-                              cr.toString(), pos,
-                              bb[pos++]&0xff, bb[pos++]&0xff,bb[pos++]&0xff, bb[pos++]&0xff);
-            throw new RuntimeException("Decoding err: " + cs.name());
-        }
-        char[] cc = new char[cbf.position()];
-        cbf.flip(); cbf.get(cc);
-        return cc;
-
-    }
-
-    static byte[] encode(char[] cc, Charset cs)
-        throws Exception {
-        ByteBuffer bbf = ByteBuffer.allocate(cc.length * 4);
-        CharBuffer cbf = CharBuffer.wrap(cc);
-        CharsetEncoder enc = cs.newEncoder();
-
-        CoderResult cr = enc.encode(cbf, bbf, true);
-        if (cr != CoderResult.UNDERFLOW) {
-            System.out.println("ENC-----------------");
-            int pos = cbf.position();
-            System.out.printf("  cr=%s, cbf.pos=%d, cc[pos]=%x%n",
-                              cr.toString(), pos, cc[pos]&0xffff);
-            throw new RuntimeException("Encoding err: " + cs.name());
-        }
-        byte[] bb = new byte[bbf.position()];
-        bbf.flip(); bbf.get(bb);
-        return bb;
-    }
-
-    static char[] getChars(Charset newCS, Charset oldCS) {
-        CharsetEncoder enc = oldCS.newEncoder();
-        CharsetEncoder encNew = newCS.newEncoder();
-        char[] cc = new char[0x10000];
-        int pos = 0;
-        int i = 0;
-        while (i < 0x10000) {
-            if (enc.canEncode((char)i) != encNew.canEncode((char)i)) {
-                System.out.printf("  Err i=%x%n", i);
-                //throw new RuntimeException("canEncode() err!");
-            }
-            if (enc.canEncode((char)i)) {
-                cc[pos++] = (char)i;
-            }
-            i++;
-        }
-        return Arrays.copyOf(cc, pos);
-    }
-
-    static void compare(Charset newCS, Charset oldCS) throws Exception {
-        System.out.printf("    Diff <%s> <%s>...%n", newCS.name(), oldCS.name());
-        char[] cc = getChars(newCS, oldCS);
-
-        byte[] bb1 = encode(cc, newCS);
-        byte[] bb2 = encode(cc, oldCS);
-
-        if (!Arrays.equals(bb1, bb2)) {
-            System.out.printf("        encoding failed!%n");
-        }
-        char[] cc1 = decode(bb1, newCS);
-        char[] cc2 = decode(bb1, oldCS);
-        if (!Arrays.equals(cc1, cc2)) {
-            for (int i = 0; i < cc1.length; i++) {
-                if (cc1[i] != cc2[i]) {
-                    System.out.printf("i=%d, cc1=%x cc2=%x,  bb=<%x%x>%n",
-                                      i,
-                                      cc1[i]&0xffff, cc2[i]&0xffff,
-                                      bb1[i*2]&0xff, bb1[i*2+1]&0xff);
-                }
-
-            }
-
-            System.out.printf("        decoding failed%n");
-        }
-    }
-
-    public static void main(String[] args) throws Exception {
-        compare(new sun.awt.motif.X11GBK(),
-                new X11GBK_OLD());
-
-        compare(new sun.awt.motif.X11GB2312(),
-                new X11GB2312_OLD());
-
-        compare(new sun.awt.motif.X11KSC5601(),
-                new X11KSC5601_OLD());
-
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/rmi/rmic/classpath/RMICClassPathTest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,55 @@
+/*
+ * 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.
+ */
+
+/*
+ * Portions Copyright (c) 2012 IBM Corporation
+ */
+
+/* @test
+ * @bug 6610897
+ * @summary New constructor in sun.tools.java.ClassPath builds a path using
+ *          File.separator instead of File.pathSeparator
+ * @run main RMICClassPathTest
+ */
+
+import java.io.File;
+
+import sun.rmi.rmic.BatchEnvironment;
+
+public class RMICClassPathTest {
+    public static void main(String[] args) throws Exception {
+        String sysPath = "/home/~user/jdk/jre/lib/rt.jar";
+        String extDir = "";
+        String clPath = "/home/~user/user.jar" + File.pathSeparator +
+            "/home/~user/user2.jar" + File.pathSeparator +
+            "/home/~user/user3.jar";
+
+        String cpStr = BatchEnvironment.createClassPath(clPath, sysPath, extDir).toString();
+
+        String[] paths = cpStr.split(File.pathSeparator);
+
+        if (paths.length != 4) {
+            throw new Exception("ClassPath length is not correct: the expected length is 4 and the actual length is " + paths.length);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/security/krb5/auto/FileKeyTab.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,55 @@
+/*
+ * 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 7152121
+ * @summary Krb5LoginModule no longer handles keyTabNames with "file:" prefix
+ * @compile -XDignore.symbol.file FileKeyTab.java
+ * @run main/othervm FileKeyTab
+ */
+
+import java.io.File;
+import java.io.FileOutputStream;
+import sun.security.jgss.GSSUtil;
+
+// The basic krb5 test skeleton you can copy from
+public class FileKeyTab {
+
+    public static void main(String[] args) throws Exception {
+        new OneKDC(null).writeJAASConf();
+        String ktab = new File(OneKDC.KTAB).getAbsolutePath().replace('\\', '/');
+        File f = new File(OneKDC.JAAS_CONF);
+        try (FileOutputStream fos = new FileOutputStream(f)) {
+            fos.write((
+                "server {\n" +
+                "    com.sun.security.auth.module.Krb5LoginModule required\n" +
+                "    principal=\"" + OneKDC.SERVER + "\"\n" +
+                "    useKeyTab=true\n" +
+                "    keyTab=\"file:" + ktab + "\"\n" +
+                "    storeKey=true;\n};\n"
+                ).getBytes());
+        }
+        Context.fromJAAS("server");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/security/krb5/auto/SaslGSS.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,106 @@
+/*
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8012082
+ * @summary SASL: auth-conf negotiated, but unencrypted data is accepted,
+  *         reset to unencrypt
+ * @compile -XDignore.symbol.file SaslGSS.java
+ * @run main/othervm SaslGSS
+ */
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+import javax.security.sasl.AuthorizeCallback;
+import javax.security.sasl.RealmCallback;
+import javax.security.sasl.Sasl;
+import javax.security.sasl.SaslServer;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Locale;
+import org.ietf.jgss.*;
+import sun.security.jgss.GSSUtil;
+
+public class SaslGSS {
+
+    public static void main(String[] args) throws Exception {
+
+        String name = "host." + OneKDC.REALM.toLowerCase(Locale.US);
+
+        new OneKDC(null).writeJAASConf();
+        System.setProperty("javax.security.auth.useSubjectCredsOnly", "false");
+
+        // Client in JGSS so that it can control wrap privacy mode
+        GSSManager m = GSSManager.getInstance();
+        GSSContext sc = m.createContext(
+                        m.createName(OneKDC.SERVER, GSSUtil.NT_GSS_KRB5_PRINCIPAL),
+                        GSSUtil.GSS_KRB5_MECH_OID,
+                        null,
+                        GSSContext.DEFAULT_LIFETIME);
+        sc.requestMutualAuth(false);
+
+        // Server in SASL
+        final HashMap props = new HashMap();
+        props.put(Sasl.QOP, "auth-conf");
+        SaslServer ss = Sasl.createSaslServer("GSSAPI", "server",
+                name, props,
+                new CallbackHandler() {
+                    public void handle(Callback[] callbacks)
+                            throws IOException, UnsupportedCallbackException {
+                        for (Callback cb : callbacks) {
+                            if (cb instanceof RealmCallback) {
+                                ((RealmCallback) cb).setText(OneKDC.REALM);
+                            } else if (cb instanceof AuthorizeCallback) {
+                                ((AuthorizeCallback) cb).setAuthorized(true);
+                            }
+                        }
+                    }
+                });
+
+        // Handshake
+        byte[] token = new byte[0];
+        token = sc.initSecContext(token, 0, token.length);
+        token = ss.evaluateResponse(token);
+        token = sc.unwrap(token, 0, token.length, new MessageProp(0, false));
+        token[0] = (byte)(((token[0] & 4) != 0) ? 4 : 2);
+        token = sc.wrap(token, 0, token.length, new MessageProp(0, false));
+        ss.evaluateResponse(token);
+
+        // Talk
+        // 1. Client sends a auth-int message
+        byte[] hello = "hello".getBytes();
+        MessageProp qop = new MessageProp(0, false);
+        token = sc.wrap(hello, 0, hello.length, qop);
+        // 2. Server accepts it anyway
+        ss.unwrap(token, 0, token.length);
+        // 3. Server sends a message
+        token = ss.wrap(hello, 0, hello.length);
+        // 4. Client accepts, should be auth-conf
+        sc.unwrap(token, 0, token.length, qop);
+        if (!qop.getPrivacy()) {
+            throw new Exception();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/security/krb5/auto/UseCacheAndStoreKey.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,71 @@
+/*
+ * 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 7201053
+ * @summary Krb5LoginModule shows NPE when both useTicketCache and storeKey
+ *          are set to true
+ * @compile -XDignore.symbol.file UseCacheAndStoreKey.java
+ * @run main/othervm UseCacheAndStoreKey
+ */
+
+import java.io.FileOutputStream;
+import javax.security.auth.login.LoginException;
+
+// The basic krb5 test skeleton you can copy from
+public class UseCacheAndStoreKey {
+
+    public static void main(String[] args) throws Exception {
+
+        new OneKDC(null).writeJAASConf();
+
+        // KDC would save ccache for client
+        System.setProperty("test.kdc.save.ccache", "cache.here");
+        try (FileOutputStream fos = new FileOutputStream(OneKDC.JAAS_CONF)) {
+            fos.write((
+                "me {\n" +
+                "    com.sun.security.auth.module.Krb5LoginModule required\n" +
+                "    principal=\"" + OneKDC.USER + "\"\n" +
+                "    useTicketCache=true\n" +
+                "    ticketCache=cache.here\n" +
+                "    isInitiator=true\n" +
+                "    storeKey=true;\n};\n"
+                ).getBytes());
+        }
+
+        // The first login will use default callback and succeed
+        Context.fromJAAS("me");
+
+        // The second login uses ccache and won't be able to store the keys
+        try {
+            Context.fromJAAS("me");
+            throw new Exception("Should fail");
+        } catch (LoginException le) {
+            if (le.getMessage().indexOf("NullPointerException") >= 0
+                    || le.getCause() instanceof NullPointerException) {
+                throw new Exception("NPE");
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/security/krb5/ccache/EmptyCC.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,94 @@
+/*
+ * 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 7158329
+ * @bug 8001208
+ * @summary NPE in sun.security.krb5.Credentials.acquireDefaultCreds()
+ * @compile -XDignore.symbol.file EmptyCC.java
+ * @run main EmptyCC tmpcc
+ * @run main EmptyCC FILE:tmpcc
+ */
+import java.io.File;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import sun.security.krb5.Credentials;
+import sun.security.krb5.PrincipalName;
+import sun.security.krb5.internal.ccache.CredentialsCache;
+
+public class EmptyCC {
+    public static void main(String[] args) throws Exception {
+        final PrincipalName pn = new PrincipalName("dummy@FOO.COM");
+        final String ccache = args[0];
+
+        if (args.length == 1) {
+            // Main process, write the ccache and launch sub process
+            CredentialsCache cache = CredentialsCache.create(pn, ccache);
+            cache.save();
+
+            // java -cp $test.classes EmptyCC readcc
+            ProcessBuilder pb = new ProcessBuilder(
+                    new File(new File(System.getProperty("java.home"), "bin"),
+                        "java").getPath(),
+                    "-cp",
+                    System.getProperty("test.classes"),
+                    "EmptyCC",
+                    ccache,
+                    "readcc"
+                    );
+
+            pb.environment().put("KRB5CCNAME", ccache);
+            pb.redirectErrorStream(true);
+
+            Process p = pb.start();
+            try (InputStream ins = p.getInputStream()) {
+                byte[] buf = new byte[8192];
+                int n;
+                while ((n = ins.read(buf)) > 0) {
+                    System.out.write(buf, 0, n);
+                }
+            }
+            if (p.waitFor() != 0) {
+                throw new Exception("Test failed");
+            }
+        } else {
+            // Sub process, read the ccache
+            String cc = System.getenv("KRB5CCNAME");
+            if (!cc.equals(ccache)) {
+                throw new Exception("env not set correctly");
+            }
+            // 8001208: Fix for KRB5CCNAME not complete
+            // Make sure the ccache is created with bare file name
+            if (CredentialsCache.getInstance() == null) {
+                throw new Exception("Cache not instantiated");
+            }
+            if (!new File("tmpcc").exists()) {
+                throw new Exception("File not found");
+            }
+            Credentials.acquireTGTFromCache(pn, null);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/security/krb5/config/DNS.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,38 @@
+/*
+ * 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.
+ */
+
+// See dns.sh.
+import sun.security.krb5.Config;
+
+public class DNS {
+    public static void main(String[] args) throws Exception {
+        System.setProperty("java.security.krb5.conf",
+                System.getProperty("test.src", ".") +"/nothing.conf");
+        Config config = Config.getInstance();
+        String kdcs = config.getKDCList("X");
+        if (!kdcs.equals("a.com.:88 b.com.:99") &&
+                !kdcs.equals("a.com. b.com.:99")) {
+            throw new Exception("Strange KDC: [" + kdcs + "]");
+        };
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/security/krb5/config/NamingManager.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,60 @@
+/*
+ * 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.
+ */
+
+package javax.naming.spi;
+
+import com.sun.jndi.dns.DnsContext;
+import java.util.Hashtable;
+import javax.naming.Context;
+import javax.naming.NamingException;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.BasicAttribute;
+import javax.naming.directory.BasicAttributes;
+
+/**
+ * A fake javax.naming.spi.NamingManager. It allows reading a DNS
+ * record without contacting a real server.
+ *
+ * See DNS.java and dns.sh.
+ */
+public class NamingManager {
+    NamingManager() {}
+    public static Context getURLContext(
+            String scheme, Hashtable<?,?> environment)
+            throws NamingException {
+        return new DnsContext("", null, new Hashtable<String,String>()) {
+            public Attributes getAttributes(String name, String[] attrIds)
+                    throws NamingException {
+                return new BasicAttributes() {
+                    public Attribute get(String attrID) {
+                        BasicAttribute ba  = new BasicAttribute(attrID);
+                        ba.add("1 1 99 b.com.");
+                        ba.add("0 0 88 a.com.");    // 2nd has higher priority
+                        return ba;
+                    }
+                };
+            }
+        };
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/security/krb5/config/dns.sh	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,41 @@
+#
+# 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 8002344
+# @summary Krb5LoginModule config class does not return proper KDC list from DNS
+#
+
+if [ "${TESTJAVA}" = "" ] ; then
+  JAVAC_CMD=`which javac`
+  TESTJAVA=`dirname $JAVAC_CMD`/..
+fi
+
+if [ "${TESTSRC}" = "" ] ; then
+   TESTSRC="."
+fi
+
+$TESTJAVA/bin/javac -d . \
+        ${TESTSRC}/NamingManager.java ${TESTSRC}/DNS.java
+$TESTJAVA/bin/java -Xbootclasspath/p:. DNS
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/security/krb5/name/Immutable.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,41 @@
+/*
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8005460
+ * @summary [findbugs] Probably returned array should be cloned
+ */
+
+import sun.security.krb5.PrincipalName;
+
+public class Immutable {
+    public static void main(String[] args) throws Exception {
+        PrincipalName pn1 = new PrincipalName("host/service@REALM");
+        PrincipalName pn2 = (PrincipalName)pn1.clone();
+        pn1.getNameStrings()[0] = "http";
+        if (!pn1.equals(pn2)) {
+            throw new Exception();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/security/krb5/tools/KtabZero.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,78 @@
+/*
+ * 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.
+ */
+
+import sun.security.krb5.internal.ktab.KeyTab;
+import sun.security.krb5.internal.ktab.KeyTabConstants;
+
+import java.io.File;
+import java.lang.reflect.Field;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+
+/*
+ * @test
+ * @bug 8014196
+ * @summary ktab creates a file with zero kt_vno
+ */
+public class KtabZero {
+
+    static final String NAME = "k.tab";
+
+    public static void main(String[] args) throws Exception {
+
+        // 0. Non-existing keytab
+        Files.deleteIfExists(Paths.get(NAME));
+        check(true);
+
+        // 1. Create with KeyTab
+        Files.deleteIfExists(Paths.get(NAME));
+        KeyTab.getInstance(NAME).save();
+        check(false);
+
+        // 2. Create with the tool
+        Files.deleteIfExists(Paths.get(NAME));
+        try {
+            Class ktab = Class.forName("sun.security.krb5.internal.tools.Ktab");
+            ktab.getDeclaredMethod("main", String[].class).invoke(null,
+                    (Object)(("-k " + NAME + " -a me@HERE pass").split(" ")));
+        } catch (ClassNotFoundException cnfe) {
+            // Only Windows has ktab tool
+            System.out.println("No ktab tool here. Ignored.");
+            return;
+        }
+        check(false);
+    }
+
+    // Checks existence as well as kt-vno
+    static void check(boolean showBeMissing) throws Exception {
+        KeyTab kt = KeyTab.getInstance(NAME);
+        if (kt.isMissing() != showBeMissing) {
+            throw new Exception("isMissing is not " + showBeMissing);
+        }
+        Field f = KeyTab.class.getDeclaredField("kt_vno");
+        f.setAccessible(true);
+        if (f.getInt(kt) != KeyTabConstants.KRB5_KT_VNO) {
+            throw new Exception("kt_vno is " + f.getInt(kt));
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/security/krb5/tools/ktzero.sh	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,74 @@
+#
+# 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.
+#
+
+# @test
+# @bug 8014196
+# @summary ktab creates a file with zero kt_vno
+# @run shell ktzero.sh
+#
+
+if [ "${TESTJAVA}" = "" ] ; then
+  JAVAC_CMD=`which javac`
+  TESTJAVA=`dirname $JAVAC_CMD`/..
+fi
+
+if [ "${TESTSRC}" = "" ] ; then
+  TESTSRC="."
+fi
+
+OS=`uname -s`
+case "$OS" in
+  CYGWIN* )
+    FS="/"
+    ;;
+  Windows_* )
+    FS="\\"
+    ;;
+  * )
+    FS="/"
+    echo "Unsupported system!"
+    exit 0;
+    ;;
+esac
+
+KEYTAB=ktzero.tmp
+
+rm $KEYTAB 2> /dev/null
+KTAB="${TESTJAVA}${FS}bin${FS}ktab -k $KEYTAB"
+
+# Listing non-existing ktab should fail
+$KTAB -l && exit 1
+
+# Can add to non-existing ktab
+$KTAB -a me@LOCAL mine || exit 2
+
+# Now can be listed
+$KTAB -l || exit 3
+
+echo ABCDEFG > $KEYTAB
+
+# Invalid keytab should fail for all commands
+$KTAB -l && exit 4
+$KTAB -a me@LOCAL mine && exit 2
+
+exit 0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/security/pkcs/pkcs9/UnknownAttribute.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,81 @@
+/*
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8011867
+ * @summary Accept unknown PKCS #9 attributes
+ */
+
+import java.io.*;
+import java.util.Arrays;
+
+import sun.misc.HexDumpEncoder;
+import sun.security.pkcs.PKCS9Attribute;
+import sun.security.util.DerValue;
+import sun.security.util.ObjectIdentifier;
+
+public class UnknownAttribute {
+
+    public static void main(String[] args) throws Exception {
+        // Unknown attr
+        PKCS9Attribute p1 = new PKCS9Attribute(
+                PKCS9Attribute.CHALLENGE_PASSWORD_STR, "t0p5ecr3t");
+        if (!p1.isKnown()) {
+            throw new Exception();
+        }
+        // Unknown attr from DER
+        byte[] data = {
+                0x30, 0x08,                 // SEQUENCE OF
+                0x06, 0x02, 0x2A, 0x03,     // OID 1.2.3 and
+                0x31, 0x02, 0x05, 0x00      // an empty SET
+        };
+        PKCS9Attribute p2 = new PKCS9Attribute(new DerValue(data));
+        if (p2.isKnown()) {
+            throw new Exception();
+        }
+        ByteArrayOutputStream bout = new ByteArrayOutputStream();
+        p2.derEncode(bout);
+        new HexDumpEncoder().encodeBuffer(bout.toByteArray(), System.err);
+        if (!Arrays.equals(data, bout.toByteArray())) {
+            throw new Exception();
+        }
+        // Unknown attr from value
+        try {
+            new PKCS9Attribute(new ObjectIdentifier("1.2.3"), "hello");
+            throw new Exception();
+        } catch (IllegalArgumentException iae) {
+            // Good. Unknown attr must have byte[] value type
+        }
+        PKCS9Attribute p3 = new PKCS9Attribute(
+                new ObjectIdentifier("1.2.3"), new byte[]{0x31,0x02,0x05,0x00});
+        if (p3.isKnown()) {
+            throw new Exception();
+        }
+        bout = new ByteArrayOutputStream();
+        p3.derEncode(bout);
+        if (!Arrays.equals(data, bout.toByteArray())) {
+            throw new Exception();
+        }
+    }
+}
--- a/test/sun/security/provider/certpath/DisabledAlgorithms/CPBuilder.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/sun/security/provider/certpath/DisabledAlgorithms/CPBuilder.java	Fri Jun 21 19:11:42 2013 -0700
@@ -21,6 +21,9 @@
  * questions.
  */
 
+// This test case relies on updated static security property, no way to re-use
+// security property in samevm/agentvm mode.
+
 /**
  * @test
  *
@@ -392,6 +395,9 @@
     }
 
     public static void main(String args[]) throws Exception {
+        // reset the security property to make sure that the algorithms
+        // and keys used in this test are not disabled.
+        Security.setProperty("jdk.certpath.disabledAlgorithms", "MD2");
 
         CertPathBuilder builder = CertPathBuilder.getInstance("PKIX");
 
--- a/test/sun/security/provider/certpath/DisabledAlgorithms/CPValidatorEndEntity.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/sun/security/provider/certpath/DisabledAlgorithms/CPValidatorEndEntity.java	Fri Jun 21 19:11:42 2013 -0700
@@ -21,6 +21,9 @@
  * questions.
  */
 
+// This test case relies on updated static security property, no way to re-use
+// security property in samevm/agentvm mode.
+
 /**
  * @test
  *
@@ -28,7 +31,7 @@
  * @summary Disable MD2 support.
  *          New CertPathValidatorException.BasicReason enum constant for
  *     constrained algorithm.
- *
+ * @run main/othervm CPValidatorEndEntity
  * @author Xuelei Fan
  */
 
@@ -313,6 +316,10 @@
     }
 
     public static void main(String args[]) throws Exception {
+        // reset the security property to make sure that the algorithms
+        // and keys used in this test are not disabled.
+        Security.setProperty("jdk.certpath.disabledAlgorithms", "MD2");
+
         try {
             validate(endentiry_SHA1withRSA_1024_1024,
                                     intermediate_SHA1withRSA_1024_1024);
--- a/test/sun/security/provider/certpath/DisabledAlgorithms/CPValidatorIntermediate.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/sun/security/provider/certpath/DisabledAlgorithms/CPValidatorIntermediate.java	Fri Jun 21 19:11:42 2013 -0700
@@ -21,6 +21,9 @@
  * questions.
  */
 
+// This test case relies on updated static security property, no way to re-use
+// security property in samevm/agentvm mode.
+
 /**
  * @test
  *
@@ -28,7 +31,7 @@
  * @summary Disable MD2 support
  *          new CertPathValidatorException.BasicReason enum constant for
  *     constrained algorithm
- *
+ * @run main/othervm CPValidatorIntermediate
  * @author Xuelei Fan
  */
 
@@ -212,6 +215,10 @@
     }
 
     public static void main(String args[]) throws Exception {
+        // reset the security property to make sure that the algorithms
+        // and keys used in this test are not disabled.
+        Security.setProperty("jdk.certpath.disabledAlgorithms", "MD2");
+
         try {
             validate(intermediate_SHA1withRSA_1024_1024);
             validate(intermediate_SHA1withRSA_1024_512);
--- a/test/sun/security/provider/certpath/DisabledAlgorithms/CPValidatorTrustAnchor.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/sun/security/provider/certpath/DisabledAlgorithms/CPValidatorTrustAnchor.java	Fri Jun 21 19:11:42 2013 -0700
@@ -21,6 +21,9 @@
  * questions.
  */
 
+// This test case relies on updated static security property, no way to re-use
+// security property in samevm/agentvm mode.
+
 /**
  * @test
  *
@@ -28,7 +31,7 @@
  * @summary Disable MD2 support
  *          new CertPathValidatorException.BasicReason enum constant for
  *     constrained algorithm
- *
+ * @run main/othervm CPValidatorTrustAnchor
  * @author Xuelei Fan
  */
 
@@ -133,6 +136,10 @@
     }
 
     public static void main(String args[]) throws Exception {
+        // reset the security property to make sure that the algorithms
+        // and keys used in this test are not disabled.
+        Security.setProperty("jdk.certpath.disabledAlgorithms", "MD2");
+
         try {
             validate(trustAnchor_SHA1withRSA_1024);
             validate(trustAnchor_SHA1withRSA_512);
--- a/test/sun/security/ssl/com/sun/net/ssl/SSLSecurity/ProviderTest.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/sun/security/ssl/com/sun/net/ssl/SSLSecurity/ProviderTest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -27,6 +27,7 @@
  * @compile JavaxSSLContextImpl.java ComSSLContextImpl.java
  *      JavaxTrustManagerFactoryImpl.java ComTrustManagerFactoryImpl.java
  *      JavaxKeyManagerFactoryImpl.java ComKeyManagerFactoryImpl.java
+ * @run main ProviderTest
  * @summary brokenness in the com.sun.net.ssl.SSLSecurity wrappers
  */
 
--- a/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/ClientHandshaker/RSAExport.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/ClientHandshaker/RSAExport.java	Fri Jun 21 19:11:42 2013 -0700
@@ -201,6 +201,7 @@
 
 import java.io.*;
 import java.net.*;
+import java.security.Security;
 import java.security.KeyStore;
 import java.security.KeyFactory;
 import java.security.cert.Certificate;
@@ -417,6 +418,10 @@
     volatile Exception clientException = null;
 
     public static void main(String[] args) throws Exception {
+        // reset the security property to make sure that the algorithms
+        // and keys used in this test are not disabled.
+        Security.setProperty("jdk.certpath.disabledAlgorithms", "MD2");
+
         if (debug)
             System.setProperty("javax.net.debug", "all");
 
--- a/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/InputRecord/InterruptedIO.java	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,183 +0,0 @@
-/*
- * Copyright (c) 2001, 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.
- *
- * 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 4393337
- * @summary [TEST RUNS ON SOLARIS ONLY] Throw an InterruptedIOException
- * when read on SSLSocket is * interrupted.
- */
-
-import java.io.InputStream;
-import java.io.IOException;
-import java.io.InterruptedIOException;
-import java.net.Socket;
-import javax.net.ssl.*;
-
-/**
- * Interrupts an SSL socket that is blocked on a read. An
- * InterruptedIOException will be thrown and handled within the test if the
- * test completes correctly.
- */
-
-public class InterruptedIO {
-
-    /**
-     * Starts a client and a server thread. Gives the client enough time to
-     * block in a read, then interrupts it.
-     */
-    public static void main(String[] args) throws Exception {
-
-        String reason =
-            "Test valid only on SunOS.\n" +
-            "=========================\n" +
-            "It was determined that Thread.interrupt() could \n" +
-            "not be reliably return InterruptedIOException \n" +
-            "on non-Solaris implementations.  Thread.interrupt() \n" +
-            "API was updated in merlin (JDK 1.4) to reflect this.\n";
-        System.out.println(reason);
-
-        String osName = System.getProperty("os.name", "");
-        if (!osName.equalsIgnoreCase("SunOS")) {
-            System.out.println("Ignoring test on '" + osName + "'");
-            return;
-        }
-
-        String testRoot = System.getProperty("test.src", ".");
-        System.setProperty("javax.net.ssl.keyStore",
-                           testRoot +
-                           "/../../../../../../../etc/keystore");
-        System.setProperty("javax.net.ssl.keyStorePassword",
-                           "passphrase");
-        System.setProperty("javax.net.ssl.trustStore",
-                           testRoot +
-                           "/../../../../../../../etc/truststore");
-
-        Server server = new Server();
-        server.start();
-
-        Client client = new Client(server.getPort()); // Will do handshake
-        client.start(); // Will block in read
-
-        // sleep for 5 seconds
-        System.out.println("Main - Pausing for 5 seconds...");
-        Thread.sleep(5 * 1000);
-
-        System.out.println("Main - Interrupting client reader thread");
-        client.interrupt();
-        client.join(); // Wait for client thread to complete
-
-        if (client.failed())
-            throw new Exception("Main - Test InterruptedIO failed "
-                                + "on client side.");
-        else
-            System.out.println("Main - Test InterruptedIO successful!");
-    }
-
-    /**
-     * Accepts an incoming SSL Connection. Then blocks in a read.
-     */
-    static class Server extends Thread {
-
-        private SSLServerSocket ss;
-
-        public Server() throws Exception {
-            ss = (SSLServerSocket) SSLServerSocketFactory.getDefault().
-                createServerSocket(0);
-        }
-
-        public int getPort() {
-            return ss.getLocalPort();
-        }
-
-        public void run() {
-            try {
-                System.out.println("Server - Will accept connections on port "
-                                   + getPort());
-                Socket s = ss.accept();
-                InputStream is = s.getInputStream();
-                // We want the client to block so deadlock
-                is.read();
-            } catch (IOException e) {
-                // Happens when client closese connection.
-                // If an error occurs, Client will detect problem
-            }
-        }
-    }
-
-    /**
-     * Initiates an SSL connection to a server. Then blocks in a read. It
-     * should be interrupted by another thread. An InterruptedIOException
-     * is expected to be thrown.
-     */
-    static class Client extends Thread {
-
-        private SSLSocket socket;
-        private InputStream inStream;
-        private boolean failed = false;
-
-        public Client(int port) throws Exception {
-            socket = (SSLSocket) SSLSocketFactory.getDefault().
-                createSocket("localhost", port);
-            inStream = socket.getInputStream();
-            System.out.println("Client - "
-                               + "Connected to: localhost" + ":" + port);
-            System.out.println("Client - "
-                               + "Doing SSL Handshake...");
-            socket.startHandshake(); // Asynchronous call
-            System.out.println("Client - Done with SSL Handshake");
-        }
-
-        public void run() {
-
-            try {
-                System.out.println("Client - Reading from input stream ...");
-                if (inStream.read() == -1) {
-                    System.out.println("Client - End-of-stream detected");
-                    failed = true;
-                }
-            } catch (InterruptedIOException e) {
-                System.out.println("Client - "
-                                   + "As expected, InterruptedIOException "
-                                   + "was thrown. Message: "
-                                   + e.getMessage());
-            } catch (Exception e) {
-                System.out.println("Client - Unexpected exception:");
-                e.printStackTrace();
-                failed = true;
-            } finally {
-                try {
-                    socket.close();
-                } catch (IOException e) {
-                    // Squelch it
-                }
-            }
-        }
-
-        public boolean failed() {
-            return failed;
-        }
-
-    }
-
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/X509TrustManagerImpl/CertRequestOverflow.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,402 @@
+/*
+ * 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.
+ */
+
+//
+// SunJSSE does not support dynamic system properties, no way to re-use
+// system properties in samevm/agentvm mode.
+//
+
+/*
+ * @test
+ * @bug 7200295
+ * @summary CertificateRequest message is wrapping when using large
+ *          numbers of Certs
+ * @run main/othervm CertRequestOverflow
+ */
+
+import java.io.*;
+import java.net.*;
+import java.util.*;
+import javax.net.ssl.*;
+import java.security.cert.*;
+import java.security.*;
+
+public class CertRequestOverflow {
+
+    /*
+     * =============================================================
+     * Set the various variables needed for the tests, then
+     * specify what tests to run on each side.
+     */
+
+    /*
+     * Should we run the client or server in a separate thread?
+     * Both sides can throw exceptions, but do you have a preference
+     * as to which side should be the main thread.
+     */
+    static boolean separateServerThread = false;
+
+    /*
+     * Where do we find the keystores?
+     */
+    static String pathToStores = "../../../../../../../etc";
+    static String keyStoreFile = "keystore";
+    static String trustStoreFile = "truststore";
+    static String passwd = "passphrase";
+    private final static char[] cpasswd = "passphrase".toCharArray();
+
+    /*
+     * Is the server ready to serve?
+     */
+    volatile static boolean serverReady = false;
+
+    /*
+     * Turn on SSL debugging?
+     */
+    static boolean debug = false;
+
+    /*
+     * If the client or server is doing some kind of object creation
+     * that the other side depends on, and that thread prematurely
+     * exits, you may experience a hang.  The test harness will
+     * terminate all hung threads after its timeout has expired,
+     * currently 3 minutes by default, but you might try to be
+     * smart about it....
+     */
+
+    /*
+     * Define the server side of the test.
+     *
+     * If the server prematurely exits, serverReady will be set to true
+     * to avoid infinite hangs.
+     */
+    void doServerSide() throws Exception {
+        SSLServerSocketFactory sslssf =
+                                getContext(true).getServerSocketFactory();
+        SSLServerSocket sslServerSocket =
+            (SSLServerSocket) sslssf.createServerSocket(serverPort);
+        serverPort = sslServerSocket.getLocalPort();
+
+        // enable endpoint identification
+        // ignore, we may test the feature when known how to parse client
+        // hostname
+        //SSLParameters params = sslServerSocket.getSSLParameters();
+        //params.setEndpointIdentificationAlgorithm("HTTPS");
+        //sslServerSocket.setSSLParameters(params);
+
+        /*
+         * Signal Client, we're ready for his connect.
+         */
+        serverReady = true;
+
+        SSLSocket sslSocket = (SSLSocket) sslServerSocket.accept();
+        sslSocket.setNeedClientAuth(true);
+        InputStream sslIS = sslSocket.getInputStream();
+        OutputStream sslOS = sslSocket.getOutputStream();
+
+        try {
+            sslIS.read();
+            sslOS.write(85);
+            sslOS.flush();
+
+            throw new Exception("SERVER TEST FAILED!  " +
+                        "It is expected to fail with field length overflow");
+        } catch (SSLException ssle) {
+            Throwable cause = ssle.getCause();
+            if (!(cause instanceof RuntimeException)) {
+                System.out.println("We are expecting a RuntimeException!");
+                throw ssle;
+            }
+            System.out.println("The expected exception!  " + ssle);
+        } finally {
+            sslSocket.close();
+        }
+
+        System.out.println("SERVER TEST PASSED!");
+    }
+
+    /*
+     * Define the client side of the test.
+     *
+     * If the server prematurely exits, serverReady will be set to true
+     * to avoid infinite hangs.
+     */
+    void doClientSide() throws Exception {
+
+        /*
+         * Wait for server to get started.
+         */
+        while (!serverReady) {
+            Thread.sleep(50);
+        }
+
+        SSLSocketFactory sslsf = getContext(false).getSocketFactory();
+        SSLSocket sslSocket = (SSLSocket)
+            sslsf.createSocket("localhost", serverPort);
+
+        // enable endpoint identification
+        SSLParameters params = sslSocket.getSSLParameters();
+        params.setEndpointIdentificationAlgorithm("HTTPS");
+        sslSocket.setSSLParameters(params);
+
+        InputStream sslIS = sslSocket.getInputStream();
+        OutputStream sslOS = sslSocket.getOutputStream();
+
+        try {
+            sslOS.write(280);
+            sslOS.flush();
+            sslIS.read();
+        } catch (SSLException ssle) {
+            System.out.println("An expected exception!");
+        } finally {
+            sslSocket.close();
+        }
+    }
+
+    MyExtendedX509TM serverTM;
+    MyExtendedX509TM clientTM;
+
+    private SSLContext getContext(boolean server) throws Exception {
+        String keyFilename =
+            System.getProperty("test.src", "./") + "/" + pathToStores +
+                "/" + keyStoreFile;
+        String trustFilename =
+            System.getProperty("test.src", "./") + "/" + pathToStores +
+                "/" + trustStoreFile;
+
+        KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509");
+        KeyStore ks = KeyStore.getInstance("JKS");
+        ks.load(new FileInputStream(keyFilename), cpasswd);
+        kmf.init(ks, cpasswd);
+
+        TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509");
+        KeyStore ts = KeyStore.getInstance("JKS");
+        ts.load(new FileInputStream(trustFilename), cpasswd);
+        tmf.init(ts);
+
+        TrustManager tms[] = tmf.getTrustManagers();
+        if (tms == null || tms.length == 0) {
+            throw new Exception("unexpected trust manager implementation");
+        } else {
+           if (!(tms[0] instanceof X509TrustManager)) {
+            throw new Exception("unexpected trust manager implementation: "
+                                + tms[0].getClass().getCanonicalName());
+           }
+        }
+
+        if (server) {
+            serverTM = new MyExtendedX509TM((X509TrustManager)tms[0]);
+
+            tms = new TrustManager[] {serverTM};
+        } else {
+            clientTM = new MyExtendedX509TM((X509TrustManager)tms[0]);
+
+            tms = new TrustManager[] {clientTM};
+        }
+
+        SSLContext ctx = SSLContext.getInstance("TLS");
+        ctx.init(kmf.getKeyManagers(), tms, null);
+
+        return ctx;
+    }
+
+    static class MyExtendedX509TM extends X509ExtendedTrustManager
+            implements X509TrustManager {
+
+        X509TrustManager tm;
+
+        boolean clientChecked;
+        boolean serverChecked;
+
+        MyExtendedX509TM(X509TrustManager tm) {
+            clientChecked = false;
+            serverChecked = false;
+
+            this.tm = tm;
+        }
+
+        public boolean wasClientChecked() {
+            return clientChecked;
+        }
+
+        public boolean wasServerChecked() {
+            return serverChecked;
+        }
+
+
+        public void checkClientTrusted(X509Certificate chain[], String authType)
+                throws CertificateException {
+            tm.checkClientTrusted(chain, authType);
+        }
+
+        public void checkServerTrusted(X509Certificate chain[], String authType)
+                throws CertificateException {
+            tm.checkServerTrusted(chain, authType);
+        }
+
+        public X509Certificate[] getAcceptedIssuers() {
+            // (hack code) increase the size of the returned array to make a
+            // overflow CertificateRequest.
+            List<X509Certificate> issuersList = new LinkedList<>();
+            X509Certificate[] issuers = tm.getAcceptedIssuers();
+            for (int i = 0; i < 800; i += issuers.length) {
+                for (X509Certificate issuer : issuers) {
+                    issuersList.add(issuer);
+                }
+            }
+
+            return issuersList.toArray(issuers);
+        }
+
+        public void checkClientTrusted(X509Certificate[] chain, String authType,
+                Socket socket) throws CertificateException {
+            clientChecked = true;
+            tm.checkClientTrusted(chain, authType);
+        }
+
+        public void checkServerTrusted(X509Certificate[] chain, String authType,
+                Socket socket) throws CertificateException {
+            serverChecked = true;
+            tm.checkServerTrusted(chain, authType);
+        }
+
+        public void checkClientTrusted(X509Certificate[] chain, String authType,
+            SSLEngine engine) throws CertificateException {
+            clientChecked = true;
+            tm.checkClientTrusted(chain, authType);
+        }
+
+        public void checkServerTrusted(X509Certificate[] chain, String authType,
+            SSLEngine engine) throws CertificateException {
+            serverChecked = true;
+            tm.checkServerTrusted(chain, authType);
+        }
+    }
+
+    /*
+     * =============================================================
+     * The remainder is just support stuff
+     */
+
+    // use any free port by default
+    volatile int serverPort = 0;
+
+    volatile Exception serverException = null;
+    volatile Exception clientException = null;
+
+    public static void main(String[] args) throws Exception {
+
+        if (debug)
+            System.setProperty("javax.net.debug", "all");
+
+        /*
+         * Start the tests.
+         */
+        new CertRequestOverflow();
+    }
+
+    Thread clientThread = null;
+    Thread serverThread = null;
+
+    /*
+     * Primary constructor, used to drive remainder of the test.
+     *
+     * Fork off the other side, then do your work.
+     */
+    CertRequestOverflow() throws Exception {
+        if (separateServerThread) {
+            startServer(true);
+            startClient(false);
+        } else {
+            startClient(true);
+            startServer(false);
+        }
+
+        /*
+         * Wait for other side to close down.
+         */
+        if (separateServerThread) {
+            serverThread.join();
+        } else {
+            clientThread.join();
+        }
+
+        /*
+         * When we get here, the test is pretty much over.
+         *
+         * If the main thread excepted, that propagates back
+         * immediately.  If the other thread threw an exception, we
+         * should report back.
+         */
+        if (serverException != null)
+            throw serverException;
+        if (clientException != null)
+            throw clientException;
+    }
+
+    void startServer(boolean newThread) throws Exception {
+        if (newThread) {
+            serverThread = new Thread() {
+                public void run() {
+                    try {
+                        doServerSide();
+                    } catch (Exception e) {
+                        /*
+                         * Our server thread just died.
+                         *
+                         * Release the client, if not active already...
+                         */
+                        System.err.println("Server died...");
+                        serverReady = true;
+                        serverException = e;
+                    }
+                }
+            };
+            serverThread.start();
+        } else {
+            doServerSide();
+        }
+    }
+
+    void startClient(boolean newThread) throws Exception {
+        if (newThread) {
+            clientThread = new Thread() {
+                public void run() {
+                    try {
+                        doClientSide();
+                    } catch (Exception e) {
+                        /*
+              * Our client thread just died.
+                         */
+                        System.err.println("Client died...");
+                        clientException = e;
+                    }
+                }
+            };
+            clientThread.start();
+        } else {
+            doClientSide();
+        }
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/security/ssl/javax/net/ssl/TLSv12/DisabledShortRSAKeys.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,433 @@
+/*
+ * 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.  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.
+ */
+
+// SunJSSE does not support dynamic system properties, no way to re-use
+// system properties in samevm/agentvm mode.
+
+/*
+ * @test
+ * @bug 7109274
+ * @summary Consider disabling support for X.509 certificates with RSA keys
+ *          less than 1024 bits
+ *
+ * @run main/othervm DisabledShortRSAKeys PKIX TLSv1.2
+ * @run main/othervm DisabledShortRSAKeys SunX509 TLSv1.2
+ * @run main/othervm DisabledShortRSAKeys PKIX TLSv1.1
+ * @run main/othervm DisabledShortRSAKeys SunX509 TLSv1.1
+ * @run main/othervm DisabledShortRSAKeys PKIX TLSv1
+ * @run main/othervm DisabledShortRSAKeys SunX509 TLSv1
+ * @run main/othervm DisabledShortRSAKeys PKIX SSLv3
+ * @run main/othervm DisabledShortRSAKeys SunX509 SSLv3
+ */
+
+import java.net.*;
+import java.util.*;
+import java.io.*;
+import javax.net.ssl.*;
+import java.security.Security;
+import java.security.KeyStore;
+import java.security.KeyFactory;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateFactory;
+import java.security.spec.*;
+import java.security.interfaces.*;
+import sun.misc.BASE64Decoder;
+
+
+public class DisabledShortRSAKeys {
+
+    /*
+     * =============================================================
+     * Set the various variables needed for the tests, then
+     * specify what tests to run on each side.
+     */
+
+    /*
+     * Should we run the client or server in a separate thread?
+     * Both sides can throw exceptions, but do you have a preference
+     * as to which side should be the main thread.
+     */
+    static boolean separateServerThread = true;
+
+    /*
+     * Where do we find the keystores?
+     */
+    // Certificates and key used in the test.
+    static String trustedCertStr =
+        "-----BEGIN CERTIFICATE-----\n" +
+        "MIICkjCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADA7MQswCQYDVQQGEwJVUzEN\n" +
+        "MAsGA1UEChMESmF2YTEdMBsGA1UECxMUU3VuSlNTRSBUZXN0IFNlcml2Y2UwHhcN\n" +
+        "MTEwODE5MDE1MjE5WhcNMzIwNzI5MDE1MjE5WjA7MQswCQYDVQQGEwJVUzENMAsG\n" +
+        "A1UEChMESmF2YTEdMBsGA1UECxMUU3VuSlNTRSBUZXN0IFNlcml2Y2UwgZ8wDQYJ\n" +
+        "KoZIhvcNAQEBBQADgY0AMIGJAoGBAM8orG08DtF98TMSscjGsidd1ZoN4jiDpi8U\n" +
+        "ICz+9dMm1qM1d7O2T+KH3/mxyox7Rc2ZVSCaUD0a3CkhPMnlAx8V4u0H+E9sqso6\n" +
+        "iDW3JpOyzMExvZiRgRG/3nvp55RMIUV4vEHOZ1QbhuqG4ebN0Vz2DkRft7+flthf\n" +
+        "vDld6f5JAgMBAAGjgaUwgaIwHQYDVR0OBBYEFLl81dnfp0wDrv0OJ1sxlWzH83Xh\n" +
+        "MGMGA1UdIwRcMFqAFLl81dnfp0wDrv0OJ1sxlWzH83XhoT+kPTA7MQswCQYDVQQG\n" +
+        "EwJVUzENMAsGA1UEChMESmF2YTEdMBsGA1UECxMUU3VuSlNTRSBUZXN0IFNlcml2\n" +
+        "Y2WCAQAwDwYDVR0TAQH/BAUwAwEB/zALBgNVHQ8EBAMCAQYwDQYJKoZIhvcNAQEE\n" +
+        "BQADgYEALlgaH1gWtoBZ84EW8Hu6YtGLQ/L9zIFmHonUPZwn3Pr//icR9Sqhc3/l\n" +
+        "pVTxOINuFHLRz4BBtEylzRIOPzK3tg8XwuLb1zd0db90x3KBCiAL6E6cklGEPwLe\n" +
+        "XYMHDn9eDsaq861Tzn6ZwzMgw04zotPMoZN0mVd/3Qca8UJFucE=\n" +
+        "-----END CERTIFICATE-----";
+
+    static String targetCertStr =
+        "-----BEGIN CERTIFICATE-----\n" +
+        "MIICNDCCAZ2gAwIBAgIBDDANBgkqhkiG9w0BAQQFADA7MQswCQYDVQQGEwJVUzEN\n" +
+        "MAsGA1UEChMESmF2YTEdMBsGA1UECxMUU3VuSlNTRSBUZXN0IFNlcml2Y2UwHhcN\n" +
+        "MTExMTA3MTM1NTUyWhcNMzEwNzI1MTM1NTUyWjBPMQswCQYDVQQGEwJVUzENMAsG\n" +
+        "A1UEChMESmF2YTEdMBsGA1UECxMUU3VuSlNTRSBUZXN0IFNlcml2Y2UxEjAQBgNV\n" +
+        "BAMTCWxvY2FsaG9zdDBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQC3Pb49OSPfOD2G\n" +
+        "HSXFCFx1GJEZfqG9ZUf7xuIi/ra5dLjPGAaoY5QF2QOa8VnOriQCXDfyXHxsuRnE\n" +
+        "OomxL7EVAgMBAAGjeDB2MAsGA1UdDwQEAwID6DAdBgNVHQ4EFgQUXNCJK3/dtCIc\n" +
+        "xb+zlA/JINlvs/MwHwYDVR0jBBgwFoAUuXzV2d+nTAOu/Q4nWzGVbMfzdeEwJwYD\n" +
+        "VR0lBCAwHgYIKwYBBQUHAwEGCCsGAQUFBwMCBggrBgEFBQcDAzANBgkqhkiG9w0B\n" +
+        "AQQFAAOBgQB2qIDUxA2caMPpGtUACZAPRUtrGssCINIfItETXJZCx/cRuZ5sP4D9\n" +
+        "N1acoNDn0hCULe3lhXAeTC9NZ97680yJzregQMV5wATjo1FGsKY30Ma+sc/nfzQW\n" +
+        "+h/7RhYtoG0OTsiaDCvyhI6swkNJzSzrAccPY4+ZgU8HiDLzZTmM3Q==\n" +
+        "-----END CERTIFICATE-----";
+
+    // Private key in the format of PKCS#8, key size is 512 bits.
+    static String targetPrivateKey =
+        "MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAtz2+PTkj3zg9hh0l\n" +
+        "xQhcdRiRGX6hvWVH+8biIv62uXS4zxgGqGOUBdkDmvFZzq4kAlw38lx8bLkZxDqJ\n" +
+        "sS+xFQIDAQABAkByx/5Oo2hQ/w2q4L8z+NTRlJ3vdl8iIDtC/4XPnfYfnGptnpG6\n" +
+        "ZThQRvbMZiai0xHQPQMszvAHjZVme1eDl3EBAiEA3aKJHynPVCEJhpfCLWuMwX5J\n" +
+        "1LntwJO7NTOyU5m8rPECIQDTpzn5X44r2rzWBDna/Sx7HW9IWCxNgUD2Eyi2nA7W\n" +
+        "ZQIgJerEorw4aCAuzQPxiGu57PB6GRamAihEAtoRTBQlH0ECIQDN08FgTtnesgCU\n" +
+        "DFYLLcw1CiHvc7fZw4neBDHCrC8NtQIgA8TOUkGnpCZlQ0KaI8KfKWI+vxFcgFnH\n" +
+        "3fnqsTgaUs4=";
+
+    static char passphrase[] = "passphrase".toCharArray();
+
+    /*
+     * Is the server ready to serve?
+     */
+    volatile static boolean serverReady = false;
+
+    /*
+     * Turn on SSL debugging?
+     */
+    static boolean debug = false;
+
+    /*
+     * Define the server side of the test.
+     *
+     * If the server prematurely exits, serverReady will be set to true
+     * to avoid infinite hangs.
+     */
+    void doServerSide() throws Exception {
+        SSLContext context = generateSSLContext(null, targetCertStr,
+                                            targetPrivateKey);
+        SSLServerSocketFactory sslssf = context.getServerSocketFactory();
+        SSLServerSocket sslServerSocket =
+            (SSLServerSocket)sslssf.createServerSocket(serverPort);
+        serverPort = sslServerSocket.getLocalPort();
+
+        /*
+         * Signal Client, we're ready for his connect.
+         */
+        serverReady = true;
+
+        try (SSLSocket sslSocket = (SSLSocket)sslServerSocket.accept()) {
+            InputStream sslIS = sslSocket.getInputStream();
+            OutputStream sslOS = sslSocket.getOutputStream();
+
+            sslIS.read();
+            sslOS.write('A');
+            sslOS.flush();
+
+            throw new Exception(
+                    "RSA keys shorter than 1024 bits should be disabled");
+        } catch (SSLHandshakeException sslhe) {
+            // the expected exception, ignore
+        }
+    }
+
+    /*
+     * Define the client side of the test.
+     *
+     * If the server prematurely exits, serverReady will be set to true
+     * to avoid infinite hangs.
+     */
+    void doClientSide() throws Exception {
+
+        /*
+         * Wait for server to get started.
+         */
+        while (!serverReady) {
+            Thread.sleep(50);
+        }
+
+        SSLContext context = generateSSLContext(trustedCertStr, null, null);
+        SSLSocketFactory sslsf = context.getSocketFactory();
+
+        try (SSLSocket sslSocket =
+            (SSLSocket)sslsf.createSocket("localhost", serverPort)) {
+
+            // only enable the target protocol
+            sslSocket.setEnabledProtocols(new String[] {enabledProtocol});
+
+            // enable a block cipher
+            sslSocket.setEnabledCipherSuites(
+                new String[] {"TLS_DHE_RSA_WITH_AES_128_CBC_SHA"});
+
+            InputStream sslIS = sslSocket.getInputStream();
+            OutputStream sslOS = sslSocket.getOutputStream();
+
+            sslOS.write('B');
+            sslOS.flush();
+            sslIS.read();
+
+            throw new Exception(
+                    "RSA keys shorter than 1024 bits should be disabled");
+        } catch (SSLHandshakeException sslhe) {
+            // the expected exception, ignore
+        }
+    }
+
+    /*
+     * =============================================================
+     * The remainder is just support stuff
+     */
+    private static String tmAlgorithm;        // trust manager
+    private static String enabledProtocol;    // the target protocol
+
+    private static void parseArguments(String[] args) {
+        tmAlgorithm = args[0];
+        enabledProtocol = args[1];
+    }
+
+    private static SSLContext generateSSLContext(String trustedCertStr,
+            String keyCertStr, String keySpecStr) throws Exception {
+
+        // generate certificate from cert string
+        CertificateFactory cf = CertificateFactory.getInstance("X.509");
+
+        // create a key store
+        KeyStore ks = KeyStore.getInstance("JKS");
+        ks.load(null, null);
+
+        // import the trused cert
+        Certificate trusedCert = null;
+        ByteArrayInputStream is = null;
+        if (trustedCertStr != null) {
+            is = new ByteArrayInputStream(trustedCertStr.getBytes());
+            trusedCert = cf.generateCertificate(is);
+            is.close();
+
+            ks.setCertificateEntry("RSA Export Signer", trusedCert);
+        }
+
+        if (keyCertStr != null) {
+            // generate the private key.
+            PKCS8EncodedKeySpec priKeySpec = new PKCS8EncodedKeySpec(
+                                new BASE64Decoder().decodeBuffer(keySpecStr));
+            KeyFactory kf = KeyFactory.getInstance("RSA");
+            RSAPrivateKey priKey =
+                    (RSAPrivateKey)kf.generatePrivate(priKeySpec);
+
+            // generate certificate chain
+            is = new ByteArrayInputStream(keyCertStr.getBytes());
+            Certificate keyCert = cf.generateCertificate(is);
+            is.close();
+
+            Certificate[] chain = null;
+            if (trusedCert != null) {
+                chain = new Certificate[2];
+                chain[0] = keyCert;
+                chain[1] = trusedCert;
+            } else {
+                chain = new Certificate[1];
+                chain[0] = keyCert;
+            }
+
+            // import the key entry.
+            ks.setKeyEntry("Whatever", priKey, passphrase, chain);
+        }
+
+        // create SSL context
+        TrustManagerFactory tmf = TrustManagerFactory.getInstance(tmAlgorithm);
+        tmf.init(ks);
+
+        SSLContext ctx = SSLContext.getInstance("TLS");
+        if (keyCertStr != null && !keyCertStr.isEmpty()) {
+            KeyManagerFactory kmf = KeyManagerFactory.getInstance("NewSunX509");
+            kmf.init(ks, passphrase);
+
+            ctx.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);
+            ks = null;
+        } else {
+            ctx.init(null, tmf.getTrustManagers(), null);
+        }
+
+        return ctx;
+    }
+
+
+    // use any free port by default
+    volatile int serverPort = 0;
+
+    volatile Exception serverException = null;
+    volatile Exception clientException = null;
+
+    public static void main(String[] args) throws Exception {
+        if (debug)
+            System.setProperty("javax.net.debug", "all");
+
+        /*
+         * Get the customized arguments.
+         */
+        parseArguments(args);
+
+        /*
+         * Start the tests.
+         */
+        new DisabledShortRSAKeys();
+    }
+
+    Thread clientThread = null;
+    Thread serverThread = null;
+
+    /*
+     * Primary constructor, used to drive remainder of the test.
+     *
+     * Fork off the other side, then do your work.
+     */
+    DisabledShortRSAKeys() throws Exception {
+        try {
+            if (separateServerThread) {
+                startServer(true);
+                startClient(false);
+            } else {
+                startClient(true);
+                startServer(false);
+            }
+        } catch (Exception e) {
+            // swallow for now.  Show later
+        }
+
+        /*
+         * Wait for other side to close down.
+         */
+        if (separateServerThread) {
+            serverThread.join();
+        } else {
+            clientThread.join();
+        }
+
+        /*
+         * When we get here, the test is pretty much over.
+         * Which side threw the error?
+         */
+        Exception local;
+        Exception remote;
+        String whichRemote;
+
+        if (separateServerThread) {
+            remote = serverException;
+            local = clientException;
+            whichRemote = "server";
+        } else {
+            remote = clientException;
+            local = serverException;
+            whichRemote = "client";
+        }
+
+        /*
+         * If both failed, return the curthread's exception, but also
+         * print the remote side Exception
+         */
+        if ((local != null) && (remote != null)) {
+            System.out.println(whichRemote + " also threw:");
+            remote.printStackTrace();
+            System.out.println();
+            throw local;
+        }
+
+        if (remote != null) {
+            throw remote;
+        }
+
+        if (local != null) {
+            throw local;
+        }
+    }
+
+    void startServer(boolean newThread) throws Exception {
+        if (newThread) {
+            serverThread = new Thread() {
+                public void run() {
+                    try {
+                        doServerSide();
+                    } catch (Exception e) {
+                        /*
+                         * Our server thread just died.
+                         *
+                         * Release the client, if not active already...
+                         */
+                        System.err.println("Server died...");
+                        serverReady = true;
+                        serverException = e;
+                    }
+                }
+            };
+            serverThread.start();
+        } else {
+            try {
+                doServerSide();
+            } catch (Exception e) {
+                serverException = e;
+            } finally {
+                serverReady = true;
+            }
+        }
+    }
+
+    void startClient(boolean newThread) throws Exception {
+        if (newThread) {
+            clientThread = new Thread() {
+                public void run() {
+                    try {
+                        doClientSide();
+                    } catch (Exception e) {
+                        /*
+                         * Our client thread just died.
+                         */
+                        System.err.println("Client died...");
+                        clientException = e;
+                    }
+                }
+            };
+            clientThread.start();
+        } else {
+            try {
+                doClientSide();
+            } catch (Exception e) {
+                clientException = e;
+            }
+        }
+    }
+}
--- a/test/sun/security/ssl/javax/net/ssl/TLSv12/ShortRSAKey512.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/sun/security/ssl/javax/net/ssl/TLSv12/ShortRSAKey512.java	Fri Jun 21 19:11:42 2013 -0700
@@ -23,6 +23,9 @@
  * questions.
  */
 
+// This test case relies on updated static security property, no way to re-use
+// security property in samevm/agentvm mode.
+
 /*
  * @test
  * @bug 7106773
@@ -38,6 +41,7 @@
 import java.util.*;
 import java.io.*;
 import javax.net.ssl.*;
+import java.security.Security;
 import java.security.KeyStore;
 import java.security.KeyFactory;
 import java.security.cert.Certificate;
@@ -275,6 +279,10 @@
     volatile Exception clientException = null;
 
     public static void main(String[] args) throws Exception {
+        // reset the security property to make sure that the algorithms
+        // and keys used in this test are not disabled.
+        Security.setProperty("jdk.certpath.disabledAlgorithms", "MD2");
+
         if (debug)
             System.setProperty("javax.net.debug", "all");
 
--- a/test/sun/security/tools/jarsigner/TimestampCheck.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/sun/security/tools/jarsigner/TimestampCheck.java	Fri Jun 21 19:11:42 2013 -0700
@@ -129,6 +129,9 @@
 
             DerOutputStream statusInfo = new DerOutputStream();
             statusInfo.putInteger(0);
+            DerOutputStream statusStrings = new DerOutputStream();
+            statusStrings.putUTF8String("Status for " + path);
+            statusInfo.write(DerValue.tag_Sequence, statusStrings);
 
             DerOutputStream token = new DerOutputStream();
             AlgorithmId[] algorithms = {aid};
--- a/test/sun/security/tools/keytool/console.sh	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/sun/security/tools/keytool/console.sh	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,3 @@
-#! /bin/sh
-
 #
 # Copyright (c) 2006, 2008, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -24,10 +22,11 @@
 #
 
 # @test
-# @bug 6418647
+# @bug 6418647 8005527
 # @summary Doc bug 5035358 shows sun.security.util.Password.readPassword() is buggy.
 # @author Weijun Wang
-#
+# @ignore unable to test manual tools that have input from stdin,
+#               and output to stderr and stdout
 # @run shell/manual console.sh
 
 if [ "$ALT_PASS" = "" ]; then
--- a/test/sun/text/resources/LocaleData	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/sun/text/resources/LocaleData	Fri Jun 21 19:11:42 2013 -0700
@@ -656,7 +656,6 @@
 FormatData/es_UY/NumberElements/2=;
 CurrencyNames/es_VE/VEB=Bs
 # bug 6570259
-CurrencyNames/es_VE/VEF=BsF.
 FormatData/es_VE/NumberPatterns/0=#,##0.###;-#,##0.###
 # FormatData/es_VE/NumberPatterns/1=Bs#,##0.00;Bs -#,##0.00 # Changed; see bug 4122840
 FormatData/es_VE/NumberPatterns/2=#,##0%
@@ -7003,6 +7002,13 @@
 CurrencyNames/zh_CN/tmt=\u571f\u5e93\u66fc\u65af\u5766\u65b0\u9a6c\u7eb3\u7279
 CurrencyNames/zh_CN/zwl=\u6d25\u5df4\u5e03\u97e6\u5143 (2009)
 
+# bug 7189611
+CurrencyNames/es_VE/VEF=Bs.F.
 CurrencyNames/zh_TW/cuc=\u53e4\u5df4\u53ef\u8f49\u63db\u62ab\u7d22
 CurrencyNames/zh_TW/tmt=\u571f\u5eab\u66fc\u65b0\u99ac\u7d0d\u7279
 CurrencyNames/zh_TW/zwl=\u8f9b\u5df4\u5a01\u5143 (2009)
+
+# bug 7171028
+FormatData/sl/DateTimePatterns/4=EEEE, dd. MMMM y
+FormatData/sl/DateTimePatterns/5=dd. MMMM y
+
--- a/test/sun/text/resources/LocaleDataTest.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/sun/text/resources/LocaleDataTest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -33,7 +33,8 @@
  *      6379214 6485516 6486607 4225362 4494727 6533691 6531591 6531593 6570259
  *      6509039 6609737 6610748 6645271 6507067 6873931 6450945 6645268 6646611
  *      6645405 6650730 6910489 6573250 6870908 6585666 6716626 6914413 6916787
- *      6919624 6998391 7019267 7020960 7025837 7020583 7036905 7066203
+ *      6919624 6998391 7019267 7020960 7025837 7020583 7036905 7066203 7189611
+ *      7171028
  * @summary Verify locale data
  *
  */
--- a/test/sun/tools/jconsole/ImmutableResourceTest.java	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved.
- * 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.
- */
-
-/**
- *
- *
- *  This isn't the test case: ImmutableResourceTest.sh is.
- *  Refer to ImmutableResourceTest.sh when running this test.
- *
- *  @bug        6287579
- *  @summary    SubClasses of ListResourceBundle should fix getContents()
- */
-import java.util.ResourceBundle;
-
-public class ImmutableResourceTest {
-
-    public static void main(String[] args) throws Exception {
-
-        /* Reach under the covers and get the message strings */
-        sun.tools.jconsole.resources.JConsoleResources jcr =
-            new sun.tools.jconsole.resources.JConsoleResources ();
-        Object [][] testData = jcr.getContents();
-
-        /* Shred our copy of the message strings */
-        for (int ii = 0; ii < testData.length; ii++) {
-            testData[ii][0] = "xxx";
-            testData[ii][1] = "yyy";
-        }
-
-        /*
-         * Try a lookup for the shredded key.
-         * If this is successful we have a problem.
-         */
-        String ss = sun.tools.jconsole.Resources.getText("xxx");
-        if ("yyy".equals(ss)) {
-            throw new Exception ("SubClasses of ListResourceBundle should fix getContents()");
-        }
-        System.out.println("...Finished.");
-    }
-}
--- a/test/sun/tools/jconsole/ImmutableResourceTest.sh	Wed Jun 19 21:51:50 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,111 +0,0 @@
-#
-# Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved.
-# 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        6287579
-#   @summary    SubClasses of ListResourceBundle should fix getContents()
-#
-#   @run shell ImmutableResourceTest.sh
-
-# Beginning of subroutines:
-status=1
-
-#Call this from anywhere to fail the test with an error message
-# usage: fail "reason why the test failed"
-fail()
- { echo "The test failed :-("
-   echo "$*" 1>&2
-   echo "exit status was $status"
-   exit $status
- } #end of fail()
-
-#Call this from anywhere to pass the test with a message
-# usage: pass "reason why the test passed if applicable"
-pass()
- { echo "The test passed!!!"
-   echo "$*" 1>&2
-   exit 0
- } #end of pass()
-
-# end of subroutines
-
-# The beginning of the script proper
-
-OS=`uname -s`
-case "$OS" in
-   SunOS | Linux | Darwin )
-      PATHSEP=":"
-      ;;
-
-   Windows* | CYGWIN*)
-      PATHSEP=";"
-      ;;
-
-   # catch all other OSs
-   * )
-      echo "Unrecognized system!  $OS"
-      fail "Unrecognized system!  $OS"
-      ;;
-esac
-
-TARGETCLASS="ImmutableResourceTest"
-if [ -z "${TESTJAVA}" ] ; then
-   # TESTJAVA is not set, so the test is running stand-alone.
-   # TESTJAVA holds the path to the root directory of the build of the JDK
-   # to be tested.  That is, any java files run explicitly in this shell
-   # should use TESTJAVA in the path to the java interpreter.
-   # So, we'll set this to the JDK spec'd on the command line.  If none
-   # is given on the command line, tell the user that and use a default.
-   # THIS IS THE JDK BEING TESTED.
-   if [ -n "$1" ] ; then
-          TESTJAVA=$1
-      else
-          TESTJAVA=$JAVA_HOME
-   fi
-   TESTSRC=.
-   TESTCLASSES=.
-   #Deal with .class files:
-fi
-#
-echo "JDK under test is: $TESTJAVA"
-#
-CP="-classpath ${TESTCLASSES}${PATHSEP}${TESTJAVA}/lib/jconsole.jar"
-# Compile the test class using the classpath we need:
-#
-env
-#
-set -vx
-#
-#Compile.  jconsole.jar is required on the classpath.
-${TESTJAVA}/bin/javac -d "${TESTCLASSES}" ${CP} -g \
-                         "${TESTSRC}"/"${TARGETCLASS}".java
-#
-#Run the test class, again with the classpath we need:
-${TESTJAVA}/bin/java ${CP} ${TARGETCLASS}
-status=$?
-echo "test status was: $status"
-if [ $status -eq "0" ];
-   then pass ""
-
-   else fail "unspecified test failure"
-fi
--- a/test/sun/util/logging/PlatformLoggerTest.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/sun/util/logging/PlatformLoggerTest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug     6882376 6985460
+ * @bug     6882376 6985460 8010309
  * @summary Test if java.util.logging.Logger is created before and after
  *          logging is enabled.  Also validate some basic PlatformLogger
  *          operations.  othervm mode to make sure java.util.logging
@@ -33,11 +33,12 @@
  * @run main/othervm PlatformLoggerTest
  */
 
+import java.lang.reflect.Field;
 import java.util.logging.*;
 import sun.util.logging.PlatformLogger;
+import static sun.util.logging.PlatformLogger.Level.*;
 
 public class PlatformLoggerTest {
-    private static final int defaultEffectiveLevel = 0;
     public static void main(String[] args) throws Exception {
         final String FOO_PLATFORM_LOGGER = "test.platformlogger.foo";
         final String BAR_PLATFORM_LOGGER = "test.platformlogger.bar";
@@ -69,39 +70,63 @@
         checkLogger(GOO_PLATFORM_LOGGER, null);
         checkLogger(BAR_LOGGER, Level.WARNING);
 
-        foo.setLevel(PlatformLogger.SEVERE);
+        foo.setLevel(PlatformLogger.Level.SEVERE);
         checkLogger(FOO_PLATFORM_LOGGER, Level.SEVERE);
 
+        checkPlatformLoggerLevels(foo, bar);
     }
 
+    // don't use java.util.logging here to prevent it from initialized
     private static void checkPlatformLogger(PlatformLogger logger, String name) {
         if (!logger.getName().equals(name)) {
             throw new RuntimeException("Invalid logger's name " +
                 logger.getName() + " but expected " + name);
         }
 
-        if (logger.getLevel() != defaultEffectiveLevel) {
+        if (logger.level() != null) {
             throw new RuntimeException("Invalid default level for logger " +
-                logger.getName());
+                logger.getName() + ": " + logger.level());
         }
 
-        if (logger.isLoggable(PlatformLogger.FINE) != false) {
-            throw new RuntimeException("isLoggerable(FINE) returns true for logger " +
-                logger.getName() + " but expected false");
+        checkLoggable(logger, FINE, false);
+
+        logger.setLevel(FINER);
+        checkLevel(logger, FINER);
+        checkLoggable(logger, FINER, true);
+        checkLoggable(logger, FINE, true);
+        checkLoggable(logger, FINEST, false);
+
+        logger.info("OK: Testing log message");
+    }
+
+    private static void checkLoggable(PlatformLogger logger, PlatformLogger.Level level, boolean expected) {
+        if (logger.isLoggable(level) != expected) {
+            throw new RuntimeException("logger " + logger.getName() + ": " + level +
+                (expected ? " not loggable" : " loggable"));
         }
 
-        logger.setLevel(PlatformLogger.FINER);
-        if (logger.getLevel() != Level.FINER.intValue()) {
-            throw new RuntimeException("Invalid level for logger " +
-                logger.getName() + " " + logger.getLevel());
+        if (logger.isLoggable(level.intValue()) != expected) {
+            throw new RuntimeException("logger " + logger.getName() + ": " + level.intValue() +
+                (expected ? " not loggable" : " loggable"));
         }
 
-        if (logger.isLoggable(PlatformLogger.FINE) != true) {
-            throw new RuntimeException("isLoggerable(FINE) returns false for logger " +
-                logger.getName() + " but expected true");
+        int value = level.intValue() + 5; // custom level value
+        if (expected && !logger.isLoggable(value)) {
+            throw new RuntimeException("logger " + logger.getName() + ": " + value +
+                " not loggable");
+        }
+    }
+
+    private static void checkLevel(PlatformLogger logger, PlatformLogger.Level level) {
+        if (logger.level() != level) {
+            throw new RuntimeException("Invalid level for logger " +
+                logger.getName() + ": " + logger.level() + " != " + level);
         }
 
-        logger.info("OK: Testing log message");
+        if (logger.getLevel() != level.intValue()) {
+            throw new RuntimeException("Invalid level for logger " +
+                logger.getName() + ": " + logger.getLevel() + " != " + level.intValue());
+        }
     }
 
     private static void checkLogger(String name, Level level) {
@@ -125,6 +150,81 @@
         logger.info("Test info(String)");
     }
 
+    private static void checkPlatformLoggerLevels(PlatformLogger... loggers) {
+        final Level[] levels = new Level[] {
+            Level.ALL, Level.CONFIG, Level.FINE, Level.FINER, Level.FINEST,
+            Level.INFO, Level.OFF, Level.SEVERE, Level.WARNING
+        };
+
+        int count = PlatformLogger.Level.values().length;
+        if (levels.length != count) {
+            throw new RuntimeException("There are " + count +
+                    " PlatformLogger.Level members, but " + levels.length +
+                    " standard java.util.logging levels - the numbers should be equal.");
+        }
+        // check mappings
+        for (Level level : levels) {
+            checkPlatformLoggerLevelMapping(level);
+        }
+
+        for (Level level : levels) {
+            PlatformLogger.Level platformLevel = PlatformLogger.Level.valueOf(level.getName());
+            for (PlatformLogger logger : loggers) {
+                logger.setLevel(platformLevel);       // setLevel(PlatformLogger.Level)
+                checkLoggerLevel(logger, level);
+
+                logger.setLevel(ALL);  // setLevel(int)
+                checkLoggerLevel(logger, Level.ALL);
+            }
+        }
+    }
+
+    private static void checkLoggerLevel(PlatformLogger logger, Level level) {
+        PlatformLogger.Level plevel = PlatformLogger.Level.valueOf(level.getName());
+        if (plevel != logger.level()) {
+            throw new RuntimeException("Retrieved PlatformLogger level "
+                    + logger.level()
+                    + " is not the same as set level " + plevel);
+        }
+
+        // check the level set in java.util.logging.Logger
+        Logger javaLogger = LogManager.getLogManager().getLogger(logger.getName());
+        Level javaLevel = javaLogger.getLevel();
+        if (javaLogger.getLevel() != level) {
+            throw new RuntimeException("Retrieved backing java.util.logging.Logger level "
+                    + javaLevel + " is not the expected " + level);
+        }
+    }
+
+    private static void checkPlatformLoggerLevelMapping(Level level) {
+        // map the given level to PlatformLogger.Level of the same name and value
+        PlatformLogger.Level platformLevel = PlatformLogger.Level.valueOf(level.getName());
+        if (platformLevel.intValue() != level.intValue()) {
+            throw new RuntimeException("Mismatched level: " + level
+                    + " PlatformLogger.Level" + platformLevel);
+        }
+
+        try {
+            // validate if there is a public static final field in PlatformLogger
+            Field constantField = PlatformLogger.class.getField(level.getName());
+            int l = (int) constantField.get(null);
+            if (l != platformLevel.intValue()) {
+                throw new RuntimeException("static final " + level.getName() + " (" +
+                    l + ") != " + platformLevel.intValue());
+            }
+        } catch (Exception e) {
+            throw new RuntimeException("No public static PlatformLogger." + level.getName() +
+                                       " field", e);
+        }
+        if (!platformLevel.name().equals(level.getName()))
+            throw new RuntimeException("The value of PlatformLogger." + level.getName() + ".name() is "
+                                       + platformLevel.name() + " but expected " + level.getName());
+
+        if (platformLevel.intValue() != level.intValue())
+            throw new RuntimeException("The value of PlatformLogger." + level.intValue() + ".intValue() is "
+                                       + platformLevel.intValue() + " but expected " + level.intValue());
+    }
+
     static Point[] getPoints() {
         Point[] res = new Point[3];
         res[0] = new Point(0,0);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/jar/JarBackSlash.java	Fri Jun 21 19:11:42 2013 -0700
@@ -0,0 +1,135 @@
+/*
+ * 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.
+ */
+
+/*
+ * Portions Copyright (c) 2012 IBM Corporation
+ */
+
+/*
+ * @test
+ * @bug 7201156
+ * @summary jar tool fails to convert file separation characters for list and extract
+ * @author Sean Chou
+ */
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.PipedInputStream;
+import java.io.PipedOutputStream;
+import java.io.PrintStream;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.jar.JarEntry;
+import java.util.jar.JarOutputStream;
+
+import sun.tools.jar.Main;
+
+public class JarBackSlash {
+
+    // used construct an entry JarBackSlash/dir/file.txt
+    private static String JARBACKSLASH = "JarBackSlash";
+    private static String DIR = "dir";
+    private static String FILENAME = "file.txt";
+
+    private static File createJarFile() throws IOException {
+        File jarFile = File.createTempFile("JarBackSlashTest", ".jar");
+        jarFile.deleteOnExit();
+
+        try (JarOutputStream output = new JarOutputStream(new FileOutputStream(jarFile))) {
+            JarEntry entry = new JarEntry(JARBACKSLASH + "/" + DIR + "/" + FILENAME);
+            output.putNextEntry(entry);
+        }
+
+        return jarFile;
+    }
+
+    private static void testJarList(String jarFile) throws IOException {
+        List<String> argList = new ArrayList<String>();
+        argList.add("-tvf");
+        argList.add(jarFile);
+        argList.add(JARBACKSLASH + File.separatorChar + DIR + File.separatorChar + FILENAME);
+
+        String jarArgs[] = new String[argList.size()];
+        jarArgs = argList.toArray(jarArgs);
+
+        PipedOutputStream pipedOutput = new PipedOutputStream();
+        PipedInputStream pipedInput = new PipedInputStream(pipedOutput);
+        PrintStream out = new PrintStream(pipedOutput);
+
+        Main jarTool = new Main(out, System.err, "jar");
+        if (!jarTool.run(jarArgs)) {
+            fail("Could not list jar file.");
+        }
+
+        out.flush();
+        check(pipedInput.available() > 0);
+    }
+
+
+    private static void testJarExtract(String jarFile) throws IOException {
+        List<String> argList = new ArrayList<String>();
+        argList.add("-xvf");
+        argList.add(jarFile);
+        argList.add(JARBACKSLASH + File.separatorChar + DIR + File.separatorChar + FILENAME);
+
+        String jarArgs[] = new String[argList.size()];
+        jarArgs = argList.toArray(jarArgs);
+
+        PipedOutputStream pipedOutput = new PipedOutputStream();
+        PipedInputStream pipedInput = new PipedInputStream(pipedOutput);
+        PrintStream out = new PrintStream(pipedOutput);
+
+        Main jarTool = new Main(out, System.err, "jar");
+        if (!jarTool.run(jarArgs)) {
+            fail("Could not list jar file.");
+        }
+
+        out.flush();
+        check(pipedInput.available() > 0);
+    }
+
+    public static void realMain(String[] args) throws Throwable {
+        File tmpJarFile = createJarFile();
+        String tmpJarFilePath = tmpJarFile.getAbsolutePath();
+
+        testJarList(tmpJarFilePath);
+        testJarExtract(tmpJarFilePath);
+    }
+
+
+    //--------------------- Infrastructure ---------------------------
+    static volatile int passed = 0, failed = 0;
+    static void pass() {passed++;}
+    static void fail() {failed++; Thread.dumpStack();}
+    static void fail(String msg) {System.out.println(msg); fail();}
+    static void unexpected(Throwable t) {failed++; t.printStackTrace();}
+    static void check(boolean cond) {if (cond) pass(); else fail();}
+    static void equal(Object x, Object y) {
+        if (x == null ? y == null : x.equals(y)) pass();
+        else fail(x + " not equal to " + y);}
+    public static void main(String[] args) throws Throwable {
+        try {realMain(args);} catch (Throwable t) {unexpected(t);}
+        System.out.println("\nPassed = " + passed + " failed = " + failed);
+        if (failed > 0) throw new AssertionError("Some tests failed");}
+}
--- a/test/tools/launcher/Arrrghs.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/tools/launcher/Arrrghs.java	Fri Jun 21 19:11:42 2013 -0700
@@ -24,10 +24,10 @@
 /**
  * @test
  * @bug 5030233 6214916 6356475 6571029 6684582 6742159 4459600 6758881 6753938
- *      6894719 6968053
+ *      6894719 6968053 7151434 7146424 8007333
  * @summary Argument parsing validation.
  * @compile -XDignore.symbol.file Arrrghs.java
- * @run main Arrrghs
+ * @run main/othervm Arrrghs
  */
 
 import java.io.BufferedReader;
@@ -205,8 +205,7 @@
         // exiting the process prematurely can terminate the stderr.
         scratchpad.add(javaCmd + " -version " + inArgs);
         File batFile = new File("atest.bat");
-        java.nio.file.Files.deleteIfExists(batFile.toPath());
-        createFile(batFile, scratchpad);
+        createAFile(batFile, scratchpad);
 
         TestResult tr = doExec(batFile.getName());
 
@@ -312,6 +311,20 @@
         checkArgumentParsing("..\\..\\", "..\\..\\");
         checkArgumentParsing("../../", "../../");
         checkArgumentParsing("a b\\ c", "a", "b\\", "c");
+        // 2 back-slashes
+        checkArgumentParsing("\\\\?", "\\\\?");
+        // 3 back-slashes
+        checkArgumentParsing("\\\\\\?", "\\\\\\?");
+        // 4 back-slashes
+        checkArgumentParsing("\\\\\\\\?", "\\\\\\\\?");
+        // 5 back-slashes
+        checkArgumentParsing("\\\\\\\\\\?", "\\\\\\\\\\?");
+        // 6 back-slashes
+        checkArgumentParsing("\\\\\\\\\\\\?", "\\\\\\\\\\\\?");
+
+        // more treatment of  mixed slashes
+        checkArgumentParsing("f1/ f3\\ f4/", "f1/", "f3\\", "f4/");
+        checkArgumentParsing("f1/ f2\' ' f3/ f4/", "f1/", "f2\'", "'", "f3/", "f4/");
     }
 
     private void initEmptyDir(File emptyDir) throws IOException {
@@ -574,6 +587,14 @@
         tr.isNotZeroOutput();
         if (!tr.testStatus)
             System.out.println(tr);
+
+        // 7151434, test for non-negative exit value for an incorrectly formed
+        // command line, '% java -jar -W', note the bogus -W
+        tr = doExec(javaCmd, "-jar", "-W");
+        tr.checkNegative();
+        tr.contains("Unrecognized option: -W");
+        if (!tr.testStatus)
+            System.out.println(tr);
     }
 
     /*
--- a/test/tools/launcher/I18NJarTest.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/tools/launcher/I18NJarTest.java	Fri Jun 21 19:11:42 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -52,6 +52,8 @@
     private static final File cwd = new File(".");
     private static final File dir = new File("\uFF66\uFF67\uFF68\uFF69");
     private static final String encoding = System.getProperty("sun.jnu.encoding", "");
+    private static final String LANG = System.getenv("LANG");
+    private static final String LC_ALL = System.getenv("LC_ALL");
 
     public static void main(String... args) throws Exception {
         boolean localeAvailable = false;
@@ -63,7 +65,16 @@
         }
         if (!localeAvailable) {
             System.out.println("Warning: locale: " + Locale.JAPAN
-                    + " not found, test passes vacuosly");
+                    + " not found, test passes vacuously");
+            return;
+        }
+        if ("C".equals(LC_ALL) || "C".equals(LANG)) {
+            System.out.println("Warning: The LANG and/or LC_ALL env vars are " +
+              "set to \"C\":\n" +
+              "  LANG=" + LANG + "\n" +
+              "  LC_ALL=" + LC_ALL + "\n" +
+              "This test requires support for multi-byte filenames.\n" +
+              "Test passes vacuously.");
             return;
         }
         if (encoding.equals("MS932") || encoding.equals("UTF-8")) {
@@ -73,7 +84,7 @@
         } else {
             System.out.println("Warning: current encoding is " + encoding +
                     "this test requires MS932 <Ja> or UTF-8," +
-                    " test passes vacuosly");
+                    " test passes vacuously");
             return;
         }
         dir.mkdir();
--- a/test/tools/launcher/TestHelper.java	Wed Jun 19 21:51:50 2013 -0700
+++ b/test/tools/launcher/TestHelper.java	Fri Jun 21 19:11:42 2013 -0700
@@ -189,13 +189,15 @@
                     m.invoke(this, (Object[]) null);
                     System.out.println(m.getName() + ": OK");
                     passed++;
+                    System.out.printf("Passed: %d, Failed: %d, ExitValue: %d%n",
+                                       passed, failed, testExitValue);
                 } catch (Throwable ex) {
                     System.out.printf("Test %s failed: %s %n", m, ex.getCause());
                     failed++;
                 }
             }
         }
-        System.out.printf("Passed: %d, Failed %d%n", passed, failed);
+        System.out.printf("Total: Passed: %d, Failed %d%n", passed, failed);
         if (failed > 0) {
             throw new RuntimeException("Tests failed: " + failed);
         }
@@ -330,6 +332,51 @@
         Files.copy(src.toPath(), dst.toPath(), COPY_ATTRIBUTES, REPLACE_EXISTING);
     }
 
+    /**
+     * Attempt to create a file at the given location. If an IOException
+     * occurs then back off for a moment and try again. When a number of
+     * attempts fail, give up and throw an exception.
+     */
+    void createAFile(File aFile, List<String> contents) throws IOException {
+        IOException cause = null;
+        for (int attempts = 0; attempts < 10; attempts++) {
+            try {
+                Files.write(aFile.getAbsoluteFile().toPath(), contents,
+                    Charset.defaultCharset(), CREATE, TRUNCATE_EXISTING, WRITE);
+                if (cause != null) {
+                    /*
+                     * report attempts and errors that were encountered
+                     * for diagnostic purposes
+                     */
+                    System.err.println("Created batch file " +
+                                        aFile + " in " + (attempts + 1) +
+                                        " attempts");
+                    System.err.println("Errors encountered: " + cause);
+                    cause.printStackTrace();
+                }
+                return;
+            } catch (IOException ioe) {
+                if (cause != null) {
+                    // chain the exceptions so they all get reported for diagnostics
+                    cause.addSuppressed(ioe);
+                } else {
+                    cause = ioe;
+                }
+            }
+
+            try {
+                Thread.sleep(500);
+            } catch (InterruptedException ie) {
+                if (cause != null) {
+                    // cause should alway be non-null here
+                    ie.addSuppressed(cause);
+                }
+                throw new RuntimeException("Interrupted while creating batch file", ie);
+            }
+        }
+        throw new RuntimeException("Unable to create batch file", cause);
+    }
+
     static void createFile(File outFile, List<String> content) throws IOException {
         Files.write(outFile.getAbsoluteFile().toPath(), content,
                 Charset.defaultCharset(), CREATE_NEW);
@@ -456,6 +503,8 @@
         }
 
         void appendError(String x) {
+            testStatus = false;
+            testExitValue++;
             status.println(TEST_PREFIX + x);
         }
 
@@ -466,16 +515,12 @@
         void checkNegative() {
             if (exitValue == 0) {
                 appendError("test must not return 0 exit value");
-                testStatus = false;
-                testExitValue++;
             }
         }
 
         void checkPositive() {
             if (exitValue != 0) {
-                testStatus = false;
                 appendError("test did not return 0 exit value");
-                testExitValue++;
             }
         }
 
@@ -485,9 +530,7 @@
 
         boolean isZeroOutput() {
             if (!testOutput.isEmpty()) {
-                testStatus = false;
                 appendError("No message from cmd please");
-                testExitValue++;
                 return false;
             }
             return true;
@@ -495,9 +538,7 @@
 
         boolean isNotZeroOutput() {
             if (testOutput.isEmpty()) {
-                testStatus = false;
                 appendError("Missing message");
-                testExitValue++;
                 return false;
             }
             return true;
@@ -534,7 +575,6 @@
                 }
             }
             appendError("string <" + str + "> not found");
-            testExitValue++;
             return false;
         }
 
@@ -545,7 +585,6 @@
                 }
             }
             appendError("string <" + stringToMatch + "> not found");
-            testExitValue++;
             return false;
         }
     }